Additions
Step-by-step guide
When the widget is placed on the page:
Minimal configurations involved:
- Display additions: Select what kind of additions we want to see: Product , Extras, Compositions
APIs involved:
Additions: "/v1/resources/virtualadditions"
Marketing groups: "/v1/resources/groups/marketing"
Products: "/v1/resources/products"
Extras: "/v1/resources/extras"
Compositions: "/v1/resources/extras"
Composition items: "/v1/resources/compositions/:compositionId/items"
Price calculator end point: "/v1/calculator/prices/calculate"
2. Required params: For fetching prices of Additions
- Start date
- End date
- resourceid
- DC and Ratetype
3. In a flow, if we simply have a "resourceid" in the url or context, we can fetch all the Additions for an Accommodation.
4. We can also configure dynamic fields, which act as a fall back for price, if Price calculator fails to get the price for an Additon.
5. Currently the widget fetches:
- Marketing groups first
- When a grop is clicked, we get the addons that falls into the group.
6. Steps involved in fetching valid additions:
- Pass "resourceId" to filter additions for a particular resource"/v1/resources/virtualadditions"
- Use the "additionResourceId" from step 1 and pass it as a filter using "resourceId" param to Marketing group endpoint: "/v1/resources/groups/marketing"
- When a marketing group is opened, all the additions are fetched, and depending on their type:
PRODUCTTYPE
- EXTRA
- COMPOSITION,
- The respective endpoint is called using "additionResourceId" as a filter.