...
Technical Solution
intl-delivery-service
Task 1 - create a feature flag
Create a flag DELIVERY-CLOSED-AT-MOMENT
Task 2 - return nextOpenDate
in findEligible
function
In the file src/modules/restaurant/restaurant.service.ts have a function called
findEligible
and in these functions have another functionderiveEligibility
and in this function return errors of restaurant and return the next time that the restaurant open again, but now don’t use this, so we need to add this information.
...
And the returned this function need to change too, because need pass the parameter
nextOpenDate
and adjusted of logic to return the data in case ofeligible
equals the false, in this validation we can validate if not have none eligible, so we use ineligible.
Before:
...
After:
...
Task
...
3 - Validate if restaurant is closed and fire a throw exception
In the file src/modules/quote/quote.service.ts in
retrieveFirstQuote
function, we can get these informations in thegetEligibleDeliveryRestaurantData
function, because now return the errors and the nextOpenDate.
...
Just an example to fire throw:
...
Task
...
4 - Change of return in catch for return correct status
In the file src/modules/quote/quote.service.ts in
retrieveFirstQuote
function we can adjust the return in catch and in this catch we can get the error of restaurant closed and manipulate this error, and change for return the status correct and the nextOpenDate.
...
Now with back-end returning the status correct and the field nextEarliestOpen
we can to do correct logic in the front-end.
Task 1 - Create a feature flag
Create a feature flag - DELIVERY-CLOSED-AT-MOMENT
Task 2 - Adjusted front-end for get the status closed restaurant
In the file src/components/address-modal/index.tsx int the
handleQuoteResult
function we have a logic for to check the status of delivery quotes, so we need to improve this logic, we can add more details and validate the statusStore. Also, we need to add new dispach dispatch for delivery closed.
...
About the dispachdispatch, we have a logic for it, and conciste in concise to get the status of quote and store, we need to create a new for closed restaurant, we need create a new types for AddressModalAction, have this in the POC.
...
Task
...
3 - Create or change component for show message of the restaurant closed
With this made, we can use this in moment for call a delivery and show the error correct in case of closed restaurant
...
In the file of this component we need to change some things for work, for example we need to tranform transform in a React component and pass the atribute attribute for next open date.
...
POC - intl-whitelabel-app
...