Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare API for upcoming UI changes #249

Merged
merged 13 commits into from
Oct 22, 2022
Merged

Conversation

ganhongyao
Copy link
Collaborator

@ganhongyao ganhongyao commented Oct 21, 2022

Changes

  • Add primary donor logo (frontend + backend)
  • Add campaign image in interest (frontend + backend)
  • Replace is_redeemed column in Coupons table with campaign_charity_id
    • This is because the new schema is such that if a coupon is redeemed without any personal contributions, there are no secondary donations. We need campaign_charity_id to keep track which campaign charity this coupon was redeemed for.
    • This makes redeemed? derived from whether the campaign_charity_id is null or not
  • Rework secondary_donations POST endpoint
Behaviour Endpoint Request body type
Redeeming a coupon with personal contribution POST coupons/redeem CouponRedeemPostData
Redeeming a coupon without personal contribution POST coupons/redeem CouponRedeemPostData, with amount = 0
Making an external contribution without coupon POST secondary_donations SecondaryDonationPostData
  • Update views as necessary for upcoming UI changes

@sivayogasubramanian
Copy link
Contributor

I am going to request changes as I come across them when I am doing the frontend components.

frontend/components/campaigns/campaignCharities/CampaignCharityCard.tsx in #252 would need PrimaryDonor name in the CampaignCharityDonationPublicData.

@sivayogasubramanian
Copy link
Contributor

I made the fixes in #252. Help check if its okay.

Copy link
Contributor

@sivayogasubramanian sivayogasubramanian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Didn't really test everything as it will be easier to find issues during integration.

@sivayogasubramanian sivayogasubramanian merged commit 9a16997 into master Oct 22, 2022
@sivayogasubramanian sivayogasubramanian deleted the hongyao/prep-api branch October 22, 2022 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants