Provide admin export functionality for vouchers
Closed this issue · 4 comments
Add a CSV export feature to export all vouchers for all vendors, with the following fields (note field names will be exactly as specified here):
Field Name | Order | Notes |
---|---|---|
Vendor ID |
1 | |
Vendor name |
2 | Optional. It helps for being able to visually check who’s who. Need to confirm if this is feasible. |
Order Number ID |
3 | This is OrderId . |
Order reference number |
4 | |
Customer name |
5 | |
Customer email address |
6 | Unlike in the vendor portal UI, this should always be included in the exports. |
Order date & time |
7 | Project to NZ time zone. |
Line item ID |
8 | |
Voucher ID |
9 | This should be constructed using the same business logic as the vendor portal. |
Payment gateway |
10 | |
Quantity |
11 | |
isDonation |
12 | |
Gross sales |
13 | |
CC Fees |
14 | |
Net Sales |
15 | |
isRefunded |
16 |
Yes thank you :)
The back-end side of this has been completed. The front-end app needs to be updated.
@randiratnayake could you please take a look at this? There is a new 'admin view' (kind of like a sub-site to the main vendor portal) - if you have a special claim in your token you get a new option in the top-right menu to switch to admin view, and this gives superuser powers.
What we'd like to do for this is to add a new button to the admin view, very similar to the current 'Export all businesses' button, but which is 'Export all vouchers'. This will work the same way as the 'Export all businesses' button (i.e. it downloads a CSV), but it goes to a different URL: /internal/vouchers/csv
.
(FYI this API can take ~60-90 seconds to return a result, since this is a very heavy query.)
@randiratnayake the back-end components have been deployed to the test site, and if you use the voucher-csv
branch then your changes will be auto-deployed when you push a commit. (We have CI/CD set up now!)
@johndowns the front end changes to have the ability to download all vouchers is committed to the feature branch.
The behaviour I see it takes a while for that download to return. So should there be some sort of visual feedback to indicate so? If that be nice to have work-related this issue is completed.