Skip to content

Commit 7170f43

Browse files
committed
admin: Improve donation amount editing warning, and require NationalTech for amount editing
Main improvement is giving people a nudge to edit the payment amounts.
1 parent 8896ca4 commit 7170f43

File tree

2 files changed

+2
-3
lines changed
  • apps
    • server/src/api/admin/fundraisers/{fundraiserId}/donations/{donationId}
    • web/src/components/admin

2 files changed

+2
-3
lines changed

apps/server/src/api/admin/fundraisers/{fundraiserId}/donations/{donationId}/patch.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ import {$DonationEdits} from '../../../../../../schemas';
99

1010
export const main = middyfy($DonationEdits, null, true, async (event) => {
1111
assertHasGroup(event, await get(fundraiserTable, {id: event.pathParameters.fundraiserId}), fixedGroups.National);
12-
assertHasGroupForProperties(event, ['matchFundingAmount'], fixedGroups.National);
13-
assertHasGroupForProperties(event, ['donationAmount', 'contributionAmount', 'stripeCustomerId', 'stripePaymentMethodId'], fixedGroups.NationalTech);
12+
assertHasGroupForProperties(event, ['donationAmount', 'contributionAmount', 'matchFundingAmount', 'stripeCustomerId', 'stripePaymentMethodId'], fixedGroups.NationalTech);
1413
const current = await get(donationTable, {fundraiserId: event.pathParameters.fundraiserId, id: event.pathParameters.donationId});
1514
const after = {...current, ...event.body};
1615

apps/web/src/components/admin/donation.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const DonationPage: React.FC<{fundraiserId: string; donationId: string}> = ({fun
2222
const fundraiser = asResponseValues(fundraisers.data?.find((f) => f.id === fundraiserId), fundraisers);
2323
const donation = asResponseValues(donations.data?.find((d) => d.fundraiserId === fundraiserId && d.id === donationId), donations);
2424
const giftAidEditWarning = 'We must hold accurate names and addresses for gift-aided donations as per the Income Tax Act 2007';
25-
const amountEditWarning = 'Do not edit amounts unless you know what you are doing. This will not update the fundraiser totals.';
25+
const amountEditWarning = 'You probably want to edit the amounts on the payments instead, not the donation. Editing the amount here will not update the fundraiser totals and makes it harder for us to do our accounting later.';
2626
const frequencyEditWarning = 'Do not edit the frequency of payments unless you know what you are doing. This will not update the payments.';
2727
const stripeCustomerIdWarning = 'Do not edit the Stripe customer ID unless you know what you are doing';
2828
const stripePaymentMethodIdWarning = 'Do not edit the Stripe payment method id unless you know what you are doing';

0 commit comments

Comments
 (0)