-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Summary:
Create a reusable React donation form with client-side validation and submission to the backend API. This ticket focuses on the UI, validation and calling apiClient.createDonation().
Files to create:
apps/frontend/src/containers/donations/DonationForm.tsx(new)apps/frontend/src/containers/donations/donations.css(new, no comprehensive styling yet)apps/frontend/src/api/apiClient.ts(patch/addcreateDonation())
Form fields (exact):
firstName(string)lastName(string)email(string, validated)amount(decimal, validated positive)isAnonymous(boolean)donationType(one_time|recurring) - dropdown or radiodedicationMessage(optional text)showDedicationPublicly(boolean)
Client validation rules:
emailrequired and valid when providedamount> 0- If
donationType === 'recurring'then defer detailed recurring validation to #6 ; here the UI must allow choosingrecurringand capture a simplerecurringIntervalstring (user-friendly select: 'monthly', 'bimonthly', 'quarterly', 'weekly').
Testing:
- Unit tests: mock
apiClient.createDonation()and assert form validation, disabled states, and submission flow.
Metadata
Metadata
Assignees
Labels
No labels