-
Notifications
You must be signed in to change notification settings - Fork 16
Description
Description
The renewal form will be hosted on the FE and will need to pull data in from Salesforce to pre-populate the field.
Proposed solution
An endpoint that replaces the current endpoint used for the renewal popup (and looks at an old School Adoption record type in salesforce) that will display the users current books and student per book count.
This management command should be updated/replaced with something that will pull:
Book__r.Name (or maybe Book__c.Name - try to avoid using Book_Name__c),
Fall_Students__c, Spring_Students__c (most recent number from either of these fields)
WHERE Renewal_Date__c > 6/1/2021 (or maybe > 1 year)
FROM Opportunities
Roy has requested this data to be formatted like the current adoptionJSON that is sent over with the adoption/renewal/signup forms.
Eg.
{"Books":[{"name":"AP Physics","students":"150"},{"name":"Astronomy","students":"300"}]}
There should also be a flag for when someone should see the popup - directing them to the renewal form.
We have two options here - pull all contacts that have Renewal_Eligible__c in the CMS and use that to trigger the popup. Or add this to the users account /api endpoint (preferred... but not sure of timing).
Discuss this before working on the contact grab.
renewalEndpoint setting is: https://www2.openstax.org/l/218812/2022-06-14/zldbyb
Acceptance Criteria
- User gets popup when they have an opportunity with a confirmed date over 1 year old.
- Opportunity data on the renewal form is pre-populated with the information from Salesforce