Problem
When the user to search a restaurant on Whitelabel in Delivery mode, the system gives a restaurant available for delivery.
...
This cause problems for users, because show de wrong message, the correct message is the restaurant is closed at this moment but have a delivery in this address.
Proposal of Solution
Show a message informing the user that restaurant is closed, but open at X hours.
Currently, the system check if the restaurant is open, but this verification is bad, because only validate if it is open, case restaurant is open show information and set the restaurant to make orders, but in case of restaurant closed, so don’t send information for system and the show wrong message.
Technical Problem
intl-whitelabel-app
The front-end get this information in this file: src/components/address-modal/index.tsx
...
Use this query of GraphQl:
...
intl-whitelabel-graphql
On repository of intl-whitelabel-graphql has this query:
...
This service is from repository intl-delivery-service.
intl-delivery-service
In the file src/modules/quote/quote.service.ts. We have the retrieveFirstQuote function.
...
Because these are the errors ever are same thing, not has a treatment for the other flows.
Technical Solution
intl-delivery-service
In the file src/modules/restaurant/restaurant.service.ts have a function called findEligible
and in these functions have another function deriveEligibility
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.
...
After this in the file src/modules/quote/quote.service.ts in retrieveFirstQuote
function we can get these informations in the getEligibleDeliveryRestaurantData
function, because now return the errors and the nextOpenDate.
agora tratar o erro para retornar corretamente e mexer no front