...
Task 1 - create a feature flag
Create a flag ENABLE-DELIVERY-CLOSED-AT-MOMENT
...
Task 1 - Create a feature flag
Create a feature flag - ENABLE-DELIVERY-CLOSED-AT-MOMENT
Task 2 - Add the additional hours in graphQL
We need to create a new fragment for add in Additional hour for use in operating hour fragment - src/queries/rbi/fragments/operating-hours-fragment.graphql
We need to run the command “yarn apollo:generate"
Task 3 - 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 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 dispatch for delivery closed.
...
About the dispatch, we have a logic for it, and concise to get the status of quote and store, we need to create a new for closed restaurant, we need to create new types for AddressModalAction, have this in the POC.
...
Task
...
4 - Create the 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
ATTENTION - the component in line 641 is not to be use, we need to create a new component for use in this local.
...
We need change or create a new component for show message about closed restaurant. In this POC I’m use the component src/components/modal-no-delivery-stores-open/no-stores-open-delivery-modal.tsx this component don’t is used currently in the app, so we can change some thing and use, this is a example of component:
In the file of this component we need to change some things for work, for example we need to transform in a React component and pass the attribute for next open date.
The component to be create is this:
...
PS - the text for title and description is this:
...
Create this component in src/components/address-modal/new-component
We need to pass the next open date and next Day Open
The button "Use Different Address“ return to screen of search delivery.
Task 4 - Create a validation for enable/disable “Order Pickup” button
Need to validate if restaurant has a service mode "Order Pickup", case not we need to disable this button
validate if it has service mode correct
validate if this service mode is opened
Get information that back-end returned, you can get a storeId and source the information in Sanity, or get the RestaurantData of back-end and search in this object
POC - intl-whitelabel-app
The POC of this solution:
https://github.com/rbilabs/intl-whitelabel-app/pull/2422
intl-packages
Task 1 - adjust packages for return additional hours
...
About the messages of delivery will be available:
If today is Monday at 8 AM and the restaurant open at 10 AM, so we need show a message “Delivery will be avaliable today at 10:00 AM”.
If today is Monday and the restaurant open tomorrow (Tuesday) at 10 AM, so need show “Delivery will be avaliable tomorrow at 10:00 AM”.
If today is Monday and the restaurant open (Weadnesday) at 10 AM, so need show “Delivery will be avaliable Weadnesday at 10:00 AM”.
The button "Use Different Address“ return to screen of search delivery.
Task 5 - Create a validation for enable/disable “Order Pickup” button
Need to validate if restaurant has a service mode "Order Pickup", case not we need to disable this button
validate if it has service mode correct
validate if this service mode is opened
Get information that back-end returned, you can get a storeId and source the information in Sanity, or get the RestaurantData of back-end and search in this object
POC - intl-whitelabel-app
The POC of this solution:
https://github.com/rbilabs/intl-whitelabel-app/pull/2422
intl-packages
Task 1 - adjust packages for return additional hours
We have a problem for return the additional hours of delivery mode, currently the back-end don’t return this, the repository intl-delivery-service use the intl-packages of restaurant packages, in the file packages/restaurant/src/rbi-restaurant/operating-hours.ts have the formatOperatingHours
function, and in this function have just normal hours, so we need to add additional hours in this function.
...
In the file src/functions/graphql/schemas/restaurant.gql we need to add a new interface for additional time and add this additional times in the OperatingHours
interface.
Example:
...
After add all new fields, we need to run the command “yarn graphql:types” to generate the types for GraphQL.
...
additional time and add this additional times in the OperatingHours
interface.
Example:
...
After add all new fields, we need to run the command “yarn graphql:types” to generate the types for GraphQL.
...
intl-partner-delivery
After intl-delivery-service found the restaurants, the system get the quotes in intl-partner-delivery repository. And in this repository it is get the times of Sanity again, and every time the system get the additional time in case this time exist.
So this is a error, because in case of we need to shutdown the flag for don’t see the addition time the quotes will continue looking this time and will occur bugs.
So we need add this flag in intl-partner-delivery respository too.
Task 1 - Add flag to control if will use additional time
Add Flag in src/modules/restaurants/availability/handlers/restaurant-delivery-time-handler.ts
Use the same flag of other enviroments of back-end:
delivery-closed-at-moment
We need to add the flag and adjusted unit tests and adjust other flow that have impact because this change.
How to integrate the environments localy
intl-packages, you need to remove some lines of node_modules/pino/lib/proto.js file:
...
run:
yarn install
yarn build
go to packages of restaurant “cd restaurant"
run “yarn link", must show in console “success Registered "@rbilabs/intl-restaurant".”
intl-delivery-service
create file .env with base .env.sample
yarn install
yarn build
connect with packages run: yarn link @rbilabs/intl-restaurant
start environment with command - STAGE=dev AWS_ACCOUNT_ID=326165771931 AWS_PROFILE=rbi.dev.admin AWS_REGION=eu-west-3 BRAND=plk yarn start:debug
intl-whitelabel-graphql
add your address of int-delivery-service in file: src/functions/graphql/providers/delivery.ts
...
create a file .env with base .env.axample
yarn install
yarn build
start environment - export $(cat .env | xargs) && STAGE=dev AWS_ACCOUNT_ID=326165771931 AWS_PROFILE=rbi.dev.admin AWS_REGION=eu-west-3 BRAND=plk yarn start:debug
intl-whitelabel-app
in moment start environment with yarn start you must choose the config local in graphql
...
others config you can use development for all
This is a simple way for connect these environments, maybe you need to do more things.