Skip to content

Commit

Permalink
refactor and add export by csv of donation
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosQ96 committed Apr 20, 2023
1 parent 3b760c9 commit 65275d6
Show file tree
Hide file tree
Showing 6 changed files with 336 additions and 52 deletions.
42 changes: 41 additions & 1 deletion src/server/adminJs/adminJs-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,22 @@ export interface AdminJsProjectsQuery {
reviewStatus: ReviewStatus;
}

export interface AdminJsDonationsQuery {
projectId?: string;
contactEmail?: string;
referrerWallet?: string;
userId?: string;
fromWalletAddress?: string;
toWalletAddress?: string;
status?: string;
createdAt?: string;
currency?: string;
transactionNetworkId?: string;
isProjectVerified?: string;
}

// headers defined by the verification team for exporting
export const headers = [
export const projectHeaders = [
'id',
'title',
'slug',
Expand All @@ -54,3 +68,29 @@ export const headers = [
'secondWalletAddress',
'secondWalletAddressNetwork',
];

export const donationHeaders = [
'id',
'transactionId',
'transactionNetworkId',
'isProjectVerified',
'status',
'toWalletAddress',
'fromWalletAddress',
'tokenAddress',
'currency',
'anonymous',
'amount',
'isFiat',
'isCustomToken',
'valueEth',
'valueUsd',
'priceEth',
'priceUsd',
'projectId',
'userId',
'contactEmail',
'createdAt',
'referrerWallet',
'isTokenEligibleForGivback',
];
3 changes: 3 additions & 0 deletions src/server/adminJs/adminJsPermissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,15 @@ const donationPermissions = {
new: true,
show: true,
edit: true,
exportFilterToCsv: true,
},
[UserRole.OPERATOR]: {
show: true,
exportFilterToCsv: true,
},
[UserRole.VERIFICATION_FORM_REVIEWER]: {
show: true,
exportFilterToCsv: true,
},
[UserRole.CAMPAIGN_MANAGER]: {
show: true,
Expand Down
Loading

0 comments on commit 65275d6

Please sign in to comment.