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

Derrick catherine/refund cancellation fix updates #289

Merged
merged 19 commits into from
Jul 29, 2023

Conversation

xiec1377
Copy link
Contributor

@xiec1377 xiec1377 commented Jul 23, 2023

Notion ticket link

(no notion ticket)

  1. visual differences:
    (a) include “Camp Cancellation” in heading
    (b) textStyle for subheading is different
    (c) no total refund at the bottom

  2. functional differences
    (a) doesn’t fail gracefully on bad refund code (FE tries to map refunds which doesn’t exist and crashes, we probably want this to redirect to main page with a toast about the failure)
    (b) EDLP should be hidden if it’s price is $0
    (c) having a loading spinner on this would be a “nice to have”, search the code base for “spinner” for examples

  3. code style:
    (a) we’ll want to use existing textStyles rather than hardcoding new font sizes (see my draft PR for example)
    (b) lots of lint warnings about types and unused variables, we want to clean those up before they hit the main branch

Implementation description

  • For visual differences, added textStyle and button sizing for dynamic page sizing
  • For functional differences,
    • loading state first set to true which displays spinner; in useEffect() function, if valid API call, set validCode to true; else set validCode to false, display toast error and return to home page; finally set loading to false
    • if getEDLPTotalCharge() = $0, then hide EDLP section

Steps to test

  1. Go to link to test for the above requirements

What should reviewers focus on?

  • Test functional bugs
  • Check if visually looks the same to the Figma for all sm, md, lg sizing

Checklist

  • My PR name is descriptive and in imperative tense
  • My commit messages are descriptive and in imperative tense. My commits are atomic and trivial commits are squashed or fixup'd into non-trivial commits
  • I have run the appropriate linter(s)
  • I have requested a review from the PL, as well as other devs who have background knowledge on this PR or who will be building on top of this PR

@xiec1377 xiec1377 temporarily deployed to fon-preview July 23, 2023 15:24 — with GitHub Actions Inactive
@github-actions
Copy link

github-actions bot commented Jul 23, 2023

Visit the preview URL for this PR (updated for commit d67e4d3):

https://focus-on-nature--pr289-derrick-catherine-re-zyvzh10f.web.app

(expires Sat, 05 Aug 2023 21:51:54 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 0aeb3dd1cc2aa82265739c366a8befd0d956fd1f

@xiec1377 xiec1377 temporarily deployed to fon-preview July 24, 2023 00:13 — with GitHub Actions Inactive
@derrick-yyang derrick-yyang temporarily deployed to fon-preview July 25, 2023 00:15 — with GitHub Actions Inactive
@derrick-yyang derrick-yyang marked this pull request as ready for review July 25, 2023 00:17
@xiec1377 xiec1377 changed the title Derrick catherine/refund cancellation Derrick catherine/refund cancellation updates Jul 25, 2023
@xiec1377 xiec1377 changed the title Derrick catherine/refund cancellation updates Derrick catherine/refund cancellation fix updates Jul 25, 2023
@derrick-yyang derrick-yyang temporarily deployed to fon-preview July 25, 2023 00:36 — with GitHub Actions Inactive
Copy link
Contributor

@williamtran10 williamtran10 left a comment

Choose a reason for hiding this comment

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

Overall, good job addressing the big list of changes. Preferably in the future if you make linting changes to files that are out of the scope of the ticket, include them all in a separate PR (thanks for fixing them though).

@williamtran10
Copy link
Contributor

Also still a couple small lint changes to make

@derrick-yyang derrick-yyang temporarily deployed to fon-preview July 29, 2023 02:47 — with GitHub Actions Inactive
@derrick-yyang derrick-yyang temporarily deployed to fon-preview July 29, 2023 02:51 — with GitHub Actions Inactive
@derrick-yyang derrick-yyang temporarily deployed to fon-preview July 29, 2023 04:17 — with GitHub Actions Inactive
@derrick-yyang
Copy link
Contributor

Also still a couple small lint changes to make

I think the last lint warnings should be left. One of them is related to key which is required from using the .maps function.
The other one is unrelated to our changes, not sure if we actually want it or not

Copy link
Contributor

@williamtran10 williamtran10 left a comment

Choose a reason for hiding this comment

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

Only a couple of small changes left. Also in the future, it's a good idea to let the reviewer mark conversations as resolved so that it's easier for them to check any changes that were requested.

frontend/src/types/CamperTypes.ts Outdated Show resolved Hide resolved
frontend/src/types/CamperTypes.ts Outdated Show resolved Hide resolved
@xiec1377 xiec1377 temporarily deployed to fon-preview July 29, 2023 21:03 — with GitHub Actions Inactive
@williamtran10
Copy link
Contributor

Also double check the most recent commit 637f5c5, it might have reverted some of your fixes

@xiec1377 xiec1377 temporarily deployed to fon-preview July 29, 2023 21:38 — with GitHub Actions Inactive
@xiec1377 xiec1377 temporarily deployed to fon-preview July 29, 2023 21:49 — with GitHub Actions Inactive
Copy link
Contributor

@williamtran10 williamtran10 left a comment

Choose a reason for hiding this comment

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

Good work and good job getting through this slog of a ticket. Feel free to merge

@xiec1377 xiec1377 merged commit 499bff9 into dev Jul 29, 2023
3 checks passed
williamtran10 pushed a commit that referenced this pull request Aug 1, 2023
* fix: Code readibility and frontend fixes

Co-authored-by: Catherine Xie <[email protected]>

* fix: removed error

* fix: Added total refund at the bottom

* fix: Remove EDLP if it's 0$

* fix: WIP redirect when given wrong refund code

* fix: error handled gracefully from API

* feat: Added spinner styling when loading:

* fix: linting

* fix: textStyle for dynamic page sizing

* fix: button sizing for dynamic page size

* fix: linting

* fix: lint

* fix: Linting

* fix: Address PR Comments

* fix: Address PR Comments

* fix: Removed any warning by adding type

* fix: linting fix

* fix: linting fix

* fix: deleted unexpected console statement

---------

Co-authored-by: Derrick Yang <[email protected]>
BraydenRoyston added a commit that referenced this pull request Oct 30, 2023
* Refactor: Updates invite link in waitlist registration email #244

* Feat: Waitlist registration entry  (#237)

* Feat: Add personal info and emergency contact questions step1 (#238)

* Review Registration Personal Info (#223)

* Rebase

* Address PR comments, organize code to remove duplication

* Lint

* Rebase

* Address PR comments, organize code to remove duplication

* Lint

* Lint

* Add visited verification on review summary page.

* Add new dependency after resolving merge conflict.

* Address comments

* Registrant Experience: Review Information Step (Additional Info) (#246)

* Add and implement EditCardHeader

* Edit styles in additional question groups to support responsiveness

* Add additional info edit card and edit prop names for consistency

* Make all styles consistent.

* Lint

* Add error validation on save

* Add image upload to camp creation (#224)

* Add image upload to camp creation

* aspect ratio fixes

* Add error handling so that when a user tries to click next, errors are shown (if any).

Co-authored-by: twilkhoo <[email protected]>

* Fix: Safari time picker (#248)

* fix: require province to proceed (#252)

* Fix: camp creation validator logic (#249)

* Fix: camp creation validator logic

* Add EDLP logic

* Fix merge conflict error with the VStack

Co-authored-by: twilkhoo <[email protected]>
Co-authored-by: Tejas Wilkhoo <[email protected]>

* Move campers modal (#247)

* update 'updateCamperByids' to allow moving between sessions

* very rough draft of full implementation

* remove console.log + added deleteActionCleanUp to reset the selected camper

* yarn fix + fix unimported components + remove console.log

* yarn for backend

* add check to find earliest and latest session date

* Lint

* Fix cancel button logic

* Lint + var rename

* styling changes + change html to chakra comps

Co-authored-by: twilkhoo <[email protected]>

* fix: session date ordering, hide completed sessions (#245)

* fix: session date ordering, hide completed sessions

* more ordering

* ordering and loading states

* Fix: Call Remove waitlisted camper only once (#255)

* Commit all changes

* Close before processing for deleting a camp also.

* Add wait list step 1 (#219)

* rebasing 'change routes to load waitlist registration + implement waitlist registration pages'

* fix age display

* remove generic footer + edit & use waitlist footer + shrink page top padding

* revert changes to formatSessionInfo back to what was in dev

* fix failed checkout url redirect bug

* Registrant Experience: Review Information Step (Add PersonalInfo and EmergencyContactQuestionsto EditCamperCard/ContactCard components) (#254)

* Commit all changes

* Remove spacer to make styles consistent

* Lint.

* Fix: Display EDLP tag applicable to a session (#258)

* Commit changes

* Address changes

* add check to ensure that at least one multiple choice option has text (#259)

* add check to ensure that at least one multiple choice option has text

* lint

* remove console.log

* Add error handling for whitespace options and require at least two options for multiple choice

---------

Co-authored-by: twilkhoo <[email protected]>

* Resolve error when registering for non-existant camp (#260)

* Commit changes

* Lint

* Add notFound comment.

* Lint.

* Waitlist backend call (#262)

* added adding waitlist campers call to the frontend

* use error message from backend api for registering waitlist camper

* run lint

* err msg change + variable name change

* Add "and" and period.

---------

Co-authored-by: twilkhoo <[email protected]>

* Registrant Experience: Review Information Step (EDLP) (#263)

* Commit all changes.

* Change type of setRequireEdlp to use React.Dispatch.

* Commit all changes. (#266)

* Fix camper edit functionality (#264)

* Commit all changes.

* Fix clicking a camper twice.

* Commit all changes. (#265)

* Add legacy openssl flag to build command (#271)

* Add a temp comment to track status before updating deps.

* Update react-scripts to v5 and test.

* Try using a legacy openssl flag to work around the conflicting hash error.

* Resolve uncaught error when viewing camp and fix coordinator/counsellor/volunteer editing (#267)

* Commit all changes.

* Create another endpoint for when we want to create new camp sessions.

* Consolidate changes into one endpoint.

* Fix: Manage sessions doesn’t persist. (#268)

* Add fields in schema to sort waitlisted campers (by date created). (#269)

* fix: docker build failing on old line (#272)

* fix: prevent duplicate multiple choice (#273)

* fix: prevent duplicates in multiple choice

* refactor: use enum for option error handling

* style: more descriptive names and clean up eslint warnings

* fix: Add current session date validation on camp creation flow (#274)

* added error message when trying to move to next page with no dates selected in session camp card

* fix: frontend lint fixes

* fix: PR Feeback

---------

Co-authored-by: Derrick Yang <[email protected]>

* Aaron/fix email validation (#277)

* feat: added two email verification tests

* feat: initial code for deep email validation check

* fix: removed deep-email-validator logic

* fix: removed deep-email-validator imports

* bug: removed unneeded dependencies and package bug

* feat: camper selection frontend (#281)

* feat: WIP, homepage of CamperCancellationRefund flow

* feat: WIP rough in refund page and component

* feat: WIP design layout of cancellation card

* feat: add RefundDTO

* feat: add refund dummy endpoint

* fix: lint

* fix: CSS

* feat: WIP hooked up backend

Co-authored-by: Nathan Souphanthong <[email protected]>

* fix: syntax fix to use map function for refund card

* feat: WIP, added information according to backend data onto CamperRefundInfoCards

* fix: added start/end time

Co-authored-by: Nathan Souphanthong <[email protected]>

* fix: WIP EDLP Time and grouping sessions based on name

Co-authored-by: Nathan Souphanthong <[email protected]>

* feat: Added EDLP Time calculation

* fix: unneeded syntax

* fix: remove console log

* fix: formatting for multiplace instances

* fix: vstack width

* feat: disabled state for when first session is < 30 days

* fix: lint

* feat: added refundCode to URL

* fix: PR feedback

---------

Co-authored-by: Nathan <[email protected]>
Co-authored-by: William Tran <[email protected]>
Co-authored-by: Nathan Souphanthong <[email protected]>

* feat: add refund link generation (#276)

 * feature: unique refund link generation

---------

Co-authored-by: Tina <[email protected]>
Co-authored-by: Brayden Royston <[email protected]>

* Setup Stripe webhooks (#250)

* Setup Stripe webhooks

---------

Co-authored-by: Nathan <[email protected]>

* fix: sorted session dates in registration emails (#278)

* fix: sorted session dates in registration emails

* bug: fixed linting issue with return

* fix: allow user to deselect multiselect options containing commas (#279)

* feat: batch process camper cancellations (#282)

* feat: batch process camper cancellations

* fix: allow user to change from short answer to multiple choice with rendered default option (#283)

* chore: fix lint (#284)

* Nathan tina/add discount amount to confirmation email (#286)

* Add discount amount to confirmation email (Nathan/Tina)

---------

Co-authored-by: Tina <[email protected]>

* feat: add check for registrationResult (#288)

* fix: refund cancellation fix updates (#289)

* fix: Code readibility and frontend fixes

Co-authored-by: Catherine Xie <[email protected]>

* fix: removed error

* fix: Added total refund at the bottom

* fix: Remove EDLP if it's 0$

* fix: WIP redirect when given wrong refund code

* fix: error handled gracefully from API

* feat: Added spinner styling when loading:

* fix: linting

* fix: textStyle for dynamic page sizing

* fix: button sizing for dynamic page size

* fix: linting

* fix: lint

* fix: Linting

* fix: Address PR Comments

* fix: Address PR Comments

* fix: Removed any warning by adding type

* fix: linting fix

* fix: linting fix

* fix: deleted unexpected console statement

---------

Co-authored-by: Derrick Yang <[email protected]>

* Add form validation to email in registration (#290)

* feat: add regex check to validate email

* fix: use existing checkEmail function

* Catherine derrick/error banner and coupon display (#296)

* feat: Added endpoint to retrieve discount info from stripe checkout session chargeId

* feat: Added frontend code to display refund amount, if any

* feat: Added error banner if cards are disabled

* feat: Refactored code so total refund changes based on selected cards

* feat: Added disable logic for button in the footer

* fix: linting

* fix: PR feedback - fixed negative discount total refund

* fix: PR feedback - distribute discount to be proportional to selected refund cards

* fix: linting

---------

Co-authored-by: Catherine Xie <[email protected]>

* feat: add validation for non-negative EDLP amount (#294)

* feat: add validation for non-negative EDLP amount

* fix: lint

* feat[BE]: add user refund flow (#291)

* feat: batch process camper cancellations

* feat: factor out Stripe refund creation

* refactor: use Promise all instead of await in loop

* feat: added new field "refundStatus" to camper obj

* fix: add refundstatus field for camp+camperservice

* fix: add refundStatus in more objects

* fix: changed variable names and refund status

* chore: changed "Not Refunded" status to "Paid"

* feat: added new field paymentintentid to camper

* fix: edit camper object with paymentintentid

* fix: included paymentintentid in cancellation func

* brayden/webhook integration

* fix: remove paymentintent, change cancel flow

* fix: fixed stripe api bug

* fix: patched refundstatus not updating in db

* fix: linting fixes

---------

Co-authored-by: Tina <[email protected]>
Co-authored-by: William Tran <[email protected]>
Co-authored-by: Brayden Royston <[email protected]>
Co-authored-by: BraydenRoyston <[email protected]>

* Derrick catherine/send data on request refund (#295)

* fix: add empty dep array so useEffect is only called once

* Added functionality to request refund so it calls a dummy endpoint

Co-authored-by: Catherine Xie <[email protected]>

* feat: Added functionality to request refund so it calls a dummy endpoint

Co-authored-by: Catherine Xie <[email protected]>

* feat: Added loading for requestRefund button

* fix: lint

* fix: margin adjustment

* chore: lint

---------

Co-authored-by: Catherine Xie <[email protected]>
Co-authored-by: Brayden Royston <[email protected]>
Co-authored-by: BraydenRoyston <[email protected]>

* feat[FE]: add refund confirmation page (#293)

* feat: add refund confirmation page

---------

Co-authored-by: BraydenRoyston <[email protected]>

---------

Co-authored-by: Dhruv Mittal <[email protected]>
Co-authored-by: Tejas Wilkhoo <[email protected]>
Co-authored-by: e-wai <[email protected]>
Co-authored-by: twilkhoo <[email protected]>
Co-authored-by: TW1234567 <[email protected]>
Co-authored-by: Ivan Yu <[email protected]>
Co-authored-by: William Tran <[email protected]>
Co-authored-by: thywang <[email protected]>
Co-authored-by: Nathan Souphanthong <[email protected]>
Co-authored-by: Derrick Yang <[email protected]>
Co-authored-by: Acezhang09 <[email protected]>
Co-authored-by: Derrick Yang <[email protected]>
Co-authored-by: Nathan <[email protected]>
Co-authored-by: William Tran <[email protected]>
Co-authored-by: Nathan Souphanthong <[email protected]>
Co-authored-by: Tina <[email protected]>
Co-authored-by: Brayden Royston <[email protected]>
Co-authored-by: Catherine Xie <[email protected]>
Co-authored-by: Brayden Royston <[email protected]>
BraydenRoyston added a commit that referenced this pull request Nov 4, 2023
* Refactor: Updates invite link in waitlist registration email #244

* Feat: Waitlist registration entry  (#237)

* Feat: Add personal info and emergency contact questions step1 (#238)

* Review Registration Personal Info (#223)

* Rebase

* Address PR comments, organize code to remove duplication

* Lint

* Rebase

* Address PR comments, organize code to remove duplication

* Lint

* Lint

* Add visited verification on review summary page.

* Add new dependency after resolving merge conflict.

* Address comments

* Registrant Experience: Review Information Step (Additional Info) (#246)

* Add and implement EditCardHeader

* Edit styles in additional question groups to support responsiveness

* Add additional info edit card and edit prop names for consistency

* Make all styles consistent.

* Lint

* Add error validation on save

* Add image upload to camp creation (#224)

* Add image upload to camp creation

* aspect ratio fixes

* Add error handling so that when a user tries to click next, errors are shown (if any).

Co-authored-by: twilkhoo <[email protected]>

* Fix: Safari time picker (#248)

* fix: require province to proceed (#252)

* Fix: camp creation validator logic (#249)

* Fix: camp creation validator logic

* Add EDLP logic

* Fix merge conflict error with the VStack

Co-authored-by: twilkhoo <[email protected]>
Co-authored-by: Tejas Wilkhoo <[email protected]>

* Move campers modal (#247)

* update 'updateCamperByids' to allow moving between sessions

* very rough draft of full implementation

* remove console.log + added deleteActionCleanUp to reset the selected camper

* yarn fix + fix unimported components + remove console.log

* yarn for backend

* add check to find earliest and latest session date

* Lint

* Fix cancel button logic

* Lint + var rename

* styling changes + change html to chakra comps

Co-authored-by: twilkhoo <[email protected]>

* fix: session date ordering, hide completed sessions (#245)

* fix: session date ordering, hide completed sessions

* more ordering

* ordering and loading states

* Fix: Call Remove waitlisted camper only once (#255)

* Commit all changes

* Close before processing for deleting a camp also.

* Add wait list step 1 (#219)

* rebasing 'change routes to load waitlist registration + implement waitlist registration pages'

* fix age display

* remove generic footer + edit & use waitlist footer + shrink page top padding

* revert changes to formatSessionInfo back to what was in dev

* fix failed checkout url redirect bug

* Registrant Experience: Review Information Step (Add PersonalInfo and EmergencyContactQuestionsto EditCamperCard/ContactCard components) (#254)

* Commit all changes

* Remove spacer to make styles consistent

* Lint.

* Fix: Display EDLP tag applicable to a session (#258)

* Commit changes

* Address changes

* add check to ensure that at least one multiple choice option has text (#259)

* add check to ensure that at least one multiple choice option has text

* lint

* remove console.log

* Add error handling for whitespace options and require at least two options for multiple choice

---------

Co-authored-by: twilkhoo <[email protected]>

* Resolve error when registering for non-existant camp (#260)

* Commit changes

* Lint

* Add notFound comment.

* Lint.

* Waitlist backend call (#262)

* added adding waitlist campers call to the frontend

* use error message from backend api for registering waitlist camper

* run lint

* err msg change + variable name change

* Add "and" and period.

---------

Co-authored-by: twilkhoo <[email protected]>

* Registrant Experience: Review Information Step (EDLP) (#263)

* Commit all changes.

* Change type of setRequireEdlp to use React.Dispatch.

* Commit all changes. (#266)

* Fix camper edit functionality (#264)

* Commit all changes.

* Fix clicking a camper twice.

* Commit all changes. (#265)

* Add legacy openssl flag to build command (#271)

* Add a temp comment to track status before updating deps.

* Update react-scripts to v5 and test.

* Try using a legacy openssl flag to work around the conflicting hash error.

* Resolve uncaught error when viewing camp and fix coordinator/counsellor/volunteer editing (#267)

* Commit all changes.

* Create another endpoint for when we want to create new camp sessions.

* Consolidate changes into one endpoint.

* Fix: Manage sessions doesn’t persist. (#268)

* Add fields in schema to sort waitlisted campers (by date created). (#269)

* fix: docker build failing on old line (#272)

* fix: prevent duplicate multiple choice (#273)

* fix: prevent duplicates in multiple choice

* refactor: use enum for option error handling

* style: more descriptive names and clean up eslint warnings

* fix: Add current session date validation on camp creation flow (#274)

* added error message when trying to move to next page with no dates selected in session camp card

* fix: frontend lint fixes

* fix: PR Feeback

---------

Co-authored-by: Derrick Yang <[email protected]>

* Aaron/fix email validation (#277)

* feat: added two email verification tests

* feat: initial code for deep email validation check

* fix: removed deep-email-validator logic

* fix: removed deep-email-validator imports

* bug: removed unneeded dependencies and package bug

* feat: camper selection frontend (#281)

* feat: WIP, homepage of CamperCancellationRefund flow

* feat: WIP rough in refund page and component

* feat: WIP design layout of cancellation card

* feat: add RefundDTO

* feat: add refund dummy endpoint

* fix: lint

* fix: CSS

* feat: WIP hooked up backend

Co-authored-by: Nathan Souphanthong <[email protected]>

* fix: syntax fix to use map function for refund card

* feat: WIP, added information according to backend data onto CamperRefundInfoCards

* fix: added start/end time

Co-authored-by: Nathan Souphanthong <[email protected]>

* fix: WIP EDLP Time and grouping sessions based on name

Co-authored-by: Nathan Souphanthong <[email protected]>

* feat: Added EDLP Time calculation

* fix: unneeded syntax

* fix: remove console log

* fix: formatting for multiplace instances

* fix: vstack width

* feat: disabled state for when first session is < 30 days

* fix: lint

* feat: added refundCode to URL

* fix: PR feedback

---------

Co-authored-by: Nathan <[email protected]>
Co-authored-by: William Tran <[email protected]>
Co-authored-by: Nathan Souphanthong <[email protected]>

* feat: add refund link generation (#276)

 * feature: unique refund link generation

---------

Co-authored-by: Tina <[email protected]>
Co-authored-by: Brayden Royston <[email protected]>

* Setup Stripe webhooks (#250)

* Setup Stripe webhooks

---------

Co-authored-by: Nathan <[email protected]>

* fix: sorted session dates in registration emails (#278)

* fix: sorted session dates in registration emails

* bug: fixed linting issue with return

* fix: allow user to deselect multiselect options containing commas (#279)

* feat: batch process camper cancellations (#282)

* feat: batch process camper cancellations

* fix: allow user to change from short answer to multiple choice with rendered default option (#283)

* chore: fix lint (#284)

* Nathan tina/add discount amount to confirmation email (#286)

* Add discount amount to confirmation email (Nathan/Tina)

---------

Co-authored-by: Tina <[email protected]>

* feat: add check for registrationResult (#288)

* fix: refund cancellation fix updates (#289)

* fix: Code readibility and frontend fixes

Co-authored-by: Catherine Xie <[email protected]>

* fix: removed error

* fix: Added total refund at the bottom

* fix: Remove EDLP if it's 0$

* fix: WIP redirect when given wrong refund code

* fix: error handled gracefully from API

* feat: Added spinner styling when loading:

* fix: linting

* fix: textStyle for dynamic page sizing

* fix: button sizing for dynamic page size

* fix: linting

* fix: lint

* fix: Linting

* fix: Address PR Comments

* fix: Address PR Comments

* fix: Removed any warning by adding type

* fix: linting fix

* fix: linting fix

* fix: deleted unexpected console statement

---------

Co-authored-by: Derrick Yang <[email protected]>

* Add form validation to email in registration (#290)

* feat: add regex check to validate email

* fix: use existing checkEmail function

* Catherine derrick/error banner and coupon display (#296)

* feat: Added endpoint to retrieve discount info from stripe checkout session chargeId

* feat: Added frontend code to display refund amount, if any

* feat: Added error banner if cards are disabled

* feat: Refactored code so total refund changes based on selected cards

* feat: Added disable logic for button in the footer

* fix: linting

* fix: PR feedback - fixed negative discount total refund

* fix: PR feedback - distribute discount to be proportional to selected refund cards

* fix: linting

---------

Co-authored-by: Catherine Xie <[email protected]>

* feat: add validation for non-negative EDLP amount (#294)

* feat: add validation for non-negative EDLP amount

* fix: lint

* feat[BE]: add user refund flow (#291)

* feat: batch process camper cancellations

* feat: factor out Stripe refund creation

* refactor: use Promise all instead of await in loop

* feat: added new field "refundStatus" to camper obj

* fix: add refundstatus field for camp+camperservice

* fix: add refundStatus in more objects

* fix: changed variable names and refund status

* chore: changed "Not Refunded" status to "Paid"

* feat: added new field paymentintentid to camper

* fix: edit camper object with paymentintentid

* fix: included paymentintentid in cancellation func

* brayden/webhook integration

* fix: remove paymentintent, change cancel flow

* fix: fixed stripe api bug

* fix: patched refundstatus not updating in db

* fix: linting fixes

---------

Co-authored-by: Tina <[email protected]>
Co-authored-by: William Tran <[email protected]>
Co-authored-by: Brayden Royston <[email protected]>
Co-authored-by: BraydenRoyston <[email protected]>

* Derrick catherine/send data on request refund (#295)

* fix: add empty dep array so useEffect is only called once

* Added functionality to request refund so it calls a dummy endpoint

Co-authored-by: Catherine Xie <[email protected]>

* feat: Added functionality to request refund so it calls a dummy endpoint

Co-authored-by: Catherine Xie <[email protected]>

* feat: Added loading for requestRefund button

* fix: lint

* fix: margin adjustment

* chore: lint

---------

Co-authored-by: Catherine Xie <[email protected]>
Co-authored-by: Brayden Royston <[email protected]>
Co-authored-by: BraydenRoyston <[email protected]>

* feat[FE]: add refund confirmation page (#293)

* feat: add refund confirmation page

---------

Co-authored-by: BraydenRoyston <[email protected]>

* hotfix[users cannot sign in]: fix for pre-existing cors issue on prod that client encountered

---------

Co-authored-by: Dhruv Mittal <[email protected]>
Co-authored-by: Tejas Wilkhoo <[email protected]>
Co-authored-by: e-wai <[email protected]>
Co-authored-by: twilkhoo <[email protected]>
Co-authored-by: TW1234567 <[email protected]>
Co-authored-by: Ivan Yu <[email protected]>
Co-authored-by: William Tran <[email protected]>
Co-authored-by: thywang <[email protected]>
Co-authored-by: Nathan Souphanthong <[email protected]>
Co-authored-by: Derrick Yang <[email protected]>
Co-authored-by: Acezhang09 <[email protected]>
Co-authored-by: Derrick Yang <[email protected]>
Co-authored-by: Nathan <[email protected]>
Co-authored-by: William Tran <[email protected]>
Co-authored-by: Nathan Souphanthong <[email protected]>
Co-authored-by: Tina <[email protected]>
Co-authored-by: Brayden Royston <[email protected]>
Co-authored-by: Catherine Xie <[email protected]>
Co-authored-by: Brayden Royston <[email protected]>
BraydenRoyston added a commit that referenced this pull request Dec 17, 2023
* Refactor: Updates invite link in waitlist registration email #244

* Feat: Waitlist registration entry  (#237)

* Feat: Add personal info and emergency contact questions step1 (#238)

* Review Registration Personal Info (#223)

* Rebase

* Address PR comments, organize code to remove duplication

* Lint

* Rebase

* Address PR comments, organize code to remove duplication

* Lint

* Lint

* Add visited verification on review summary page.

* Add new dependency after resolving merge conflict.

* Address comments

* Registrant Experience: Review Information Step (Additional Info) (#246)

* Add and implement EditCardHeader

* Edit styles in additional question groups to support responsiveness

* Add additional info edit card and edit prop names for consistency

* Make all styles consistent.

* Lint

* Add error validation on save

* Add image upload to camp creation (#224)

* Add image upload to camp creation

* aspect ratio fixes

* Add error handling so that when a user tries to click next, errors are shown (if any).

Co-authored-by: twilkhoo <[email protected]>

* Fix: Safari time picker (#248)

* fix: require province to proceed (#252)

* Fix: camp creation validator logic (#249)

* Fix: camp creation validator logic

* Add EDLP logic

* Fix merge conflict error with the VStack

Co-authored-by: twilkhoo <[email protected]>
Co-authored-by: Tejas Wilkhoo <[email protected]>

* Move campers modal (#247)

* update 'updateCamperByids' to allow moving between sessions

* very rough draft of full implementation

* remove console.log + added deleteActionCleanUp to reset the selected camper

* yarn fix + fix unimported components + remove console.log

* yarn for backend

* add check to find earliest and latest session date

* Lint

* Fix cancel button logic

* Lint + var rename

* styling changes + change html to chakra comps

Co-authored-by: twilkhoo <[email protected]>

* fix: session date ordering, hide completed sessions (#245)

* fix: session date ordering, hide completed sessions

* more ordering

* ordering and loading states

* Fix: Call Remove waitlisted camper only once (#255)

* Commit all changes

* Close before processing for deleting a camp also.

* Add wait list step 1 (#219)

* rebasing 'change routes to load waitlist registration + implement waitlist registration pages'

* fix age display

* remove generic footer + edit & use waitlist footer + shrink page top padding

* revert changes to formatSessionInfo back to what was in dev

* fix failed checkout url redirect bug

* Registrant Experience: Review Information Step (Add PersonalInfo and EmergencyContactQuestionsto EditCamperCard/ContactCard components) (#254)

* Commit all changes

* Remove spacer to make styles consistent

* Lint.

* Fix: Display EDLP tag applicable to a session (#258)

* Commit changes

* Address changes

* add check to ensure that at least one multiple choice option has text (#259)

* add check to ensure that at least one multiple choice option has text

* lint

* remove console.log

* Add error handling for whitespace options and require at least two options for multiple choice

---------

Co-authored-by: twilkhoo <[email protected]>

* Resolve error when registering for non-existant camp (#260)

* Commit changes

* Lint

* Add notFound comment.

* Lint.

* Waitlist backend call (#262)

* added adding waitlist campers call to the frontend

* use error message from backend api for registering waitlist camper

* run lint

* err msg change + variable name change

* Add "and" and period.

---------

Co-authored-by: twilkhoo <[email protected]>

* Registrant Experience: Review Information Step (EDLP) (#263)

* Commit all changes.

* Change type of setRequireEdlp to use React.Dispatch.

* Commit all changes. (#266)

* Fix camper edit functionality (#264)

* Commit all changes.

* Fix clicking a camper twice.

* Commit all changes. (#265)

* Add legacy openssl flag to build command (#271)

* Add a temp comment to track status before updating deps.

* Update react-scripts to v5 and test.

* Try using a legacy openssl flag to work around the conflicting hash error.

* Resolve uncaught error when viewing camp and fix coordinator/counsellor/volunteer editing (#267)

* Commit all changes.

* Create another endpoint for when we want to create new camp sessions.

* Consolidate changes into one endpoint.

* Fix: Manage sessions doesn’t persist. (#268)

* Add fields in schema to sort waitlisted campers (by date created). (#269)

* fix: docker build failing on old line (#272)

* fix: prevent duplicate multiple choice (#273)

* fix: prevent duplicates in multiple choice

* refactor: use enum for option error handling

* style: more descriptive names and clean up eslint warnings

* fix: Add current session date validation on camp creation flow (#274)

* added error message when trying to move to next page with no dates selected in session camp card

* fix: frontend lint fixes

* fix: PR Feeback

---------

Co-authored-by: Derrick Yang <[email protected]>

* Aaron/fix email validation (#277)

* feat: added two email verification tests

* feat: initial code for deep email validation check

* fix: removed deep-email-validator logic

* fix: removed deep-email-validator imports

* bug: removed unneeded dependencies and package bug

* feat: camper selection frontend (#281)

* feat: WIP, homepage of CamperCancellationRefund flow

* feat: WIP rough in refund page and component

* feat: WIP design layout of cancellation card

* feat: add RefundDTO

* feat: add refund dummy endpoint

* fix: lint

* fix: CSS

* feat: WIP hooked up backend

Co-authored-by: Nathan Souphanthong <[email protected]>

* fix: syntax fix to use map function for refund card

* feat: WIP, added information according to backend data onto CamperRefundInfoCards

* fix: added start/end time

Co-authored-by: Nathan Souphanthong <[email protected]>

* fix: WIP EDLP Time and grouping sessions based on name

Co-authored-by: Nathan Souphanthong <[email protected]>

* feat: Added EDLP Time calculation

* fix: unneeded syntax

* fix: remove console log

* fix: formatting for multiplace instances

* fix: vstack width

* feat: disabled state for when first session is < 30 days

* fix: lint

* feat: added refundCode to URL

* fix: PR feedback

---------

Co-authored-by: Nathan <[email protected]>
Co-authored-by: William Tran <[email protected]>
Co-authored-by: Nathan Souphanthong <[email protected]>

* feat: add refund link generation (#276)

 * feature: unique refund link generation

---------

Co-authored-by: Tina <[email protected]>
Co-authored-by: Brayden Royston <[email protected]>

* Setup Stripe webhooks (#250)

* Setup Stripe webhooks

---------

Co-authored-by: Nathan <[email protected]>

* fix: sorted session dates in registration emails (#278)

* fix: sorted session dates in registration emails

* bug: fixed linting issue with return

* fix: allow user to deselect multiselect options containing commas (#279)

* feat: batch process camper cancellations (#282)

* feat: batch process camper cancellations

* fix: allow user to change from short answer to multiple choice with rendered default option (#283)

* chore: fix lint (#284)

* Nathan tina/add discount amount to confirmation email (#286)

* Add discount amount to confirmation email (Nathan/Tina)

---------

Co-authored-by: Tina <[email protected]>

* feat: add check for registrationResult (#288)

* fix: refund cancellation fix updates (#289)

* fix: Code readibility and frontend fixes

Co-authored-by: Catherine Xie <[email protected]>

* fix: removed error

* fix: Added total refund at the bottom

* fix: Remove EDLP if it's 0$

* fix: WIP redirect when given wrong refund code

* fix: error handled gracefully from API

* feat: Added spinner styling when loading:

* fix: linting

* fix: textStyle for dynamic page sizing

* fix: button sizing for dynamic page size

* fix: linting

* fix: lint

* fix: Linting

* fix: Address PR Comments

* fix: Address PR Comments

* fix: Removed any warning by adding type

* fix: linting fix

* fix: linting fix

* fix: deleted unexpected console statement

---------

Co-authored-by: Derrick Yang <[email protected]>

* Add form validation to email in registration (#290)

* feat: add regex check to validate email

* fix: use existing checkEmail function

* Catherine derrick/error banner and coupon display (#296)

* feat: Added endpoint to retrieve discount info from stripe checkout session chargeId

* feat: Added frontend code to display refund amount, if any

* feat: Added error banner if cards are disabled

* feat: Refactored code so total refund changes based on selected cards

* feat: Added disable logic for button in the footer

* fix: linting

* fix: PR feedback - fixed negative discount total refund

* fix: PR feedback - distribute discount to be proportional to selected refund cards

* fix: linting

---------

Co-authored-by: Catherine Xie <[email protected]>

* feat: add validation for non-negative EDLP amount (#294)

* feat: add validation for non-negative EDLP amount

* fix: lint

* feat[BE]: add user refund flow (#291)

* feat: batch process camper cancellations

* feat: factor out Stripe refund creation

* refactor: use Promise all instead of await in loop

* feat: added new field "refundStatus" to camper obj

* fix: add refundstatus field for camp+camperservice

* fix: add refundStatus in more objects

* fix: changed variable names and refund status

* chore: changed "Not Refunded" status to "Paid"

* feat: added new field paymentintentid to camper

* fix: edit camper object with paymentintentid

* fix: included paymentintentid in cancellation func

* brayden/webhook integration

* fix: remove paymentintent, change cancel flow

* fix: fixed stripe api bug

* fix: patched refundstatus not updating in db

* fix: linting fixes

---------

Co-authored-by: Tina <[email protected]>
Co-authored-by: William Tran <[email protected]>
Co-authored-by: Brayden Royston <[email protected]>
Co-authored-by: BraydenRoyston <[email protected]>

* Derrick catherine/send data on request refund (#295)

* fix: add empty dep array so useEffect is only called once

* Added functionality to request refund so it calls a dummy endpoint

Co-authored-by: Catherine Xie <[email protected]>

* feat: Added functionality to request refund so it calls a dummy endpoint

Co-authored-by: Catherine Xie <[email protected]>

* feat: Added loading for requestRefund button

* fix: lint

* fix: margin adjustment

* chore: lint

---------

Co-authored-by: Catherine Xie <[email protected]>
Co-authored-by: Brayden Royston <[email protected]>
Co-authored-by: BraydenRoyston <[email protected]>

* feat[FE]: add refund confirmation page (#293)

* feat: add refund confirmation page

---------

Co-authored-by: BraydenRoyston <[email protected]>

* hotfix[users cannot sign in]: fix for pre-existing cors issue on prod that client encountered

* fix: added access-control-allow-origin header to auth routes (#299)

---------

Co-authored-by: Dhruv Mittal <[email protected]>
Co-authored-by: Tejas Wilkhoo <[email protected]>
Co-authored-by: e-wai <[email protected]>
Co-authored-by: twilkhoo <[email protected]>
Co-authored-by: TW1234567 <[email protected]>
Co-authored-by: Ivan Yu <[email protected]>
Co-authored-by: William Tran <[email protected]>
Co-authored-by: thywang <[email protected]>
Co-authored-by: Nathan Souphanthong <[email protected]>
Co-authored-by: Derrick Yang <[email protected]>
Co-authored-by: Acezhang09 <[email protected]>
Co-authored-by: Derrick Yang <[email protected]>
Co-authored-by: Nathan <[email protected]>
Co-authored-by: William Tran <[email protected]>
Co-authored-by: Nathan Souphanthong <[email protected]>
Co-authored-by: Tina <[email protected]>
Co-authored-by: Brayden Royston <[email protected]>
Co-authored-by: Catherine Xie <[email protected]>
Co-authored-by: Brayden Royston <[email protected]>
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.

3 participants