Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The following details quoted are from:

Jira Legacy
serverSystem JIRA
serverId255417eb-03fa-3e2f-a6ba-05d325fec50d
keyTRX-397
. To have the more updated details check on the Jira.

...

Reinforcing the Acceptance Criteria

  • If a store has only delivery time open AND delivery time close set (the default infos, without the additional time slot)

    • Display the information as they are right now (in the image above the “Take Away” info)

  • If a store has delivery time open AND delivery time close AND dinner time open AND dinner time close (in the end, this means that we’ll need all four infos)

    • Display both slots (breaking time) to the guest in the FE (the “Delivery Hours” section in the image above)

  • We’ll always show the information with high priority on the Store Locator page. As the Figma example the “Take Away/Dine in Hours” will decide what will be shown: ← Validate this with Simon/Intl

  • We’ll keep the logic made for restaurants that closes after midnight ← Validate this with Simon/Intl

  • Do we’ll need to consider other open/close rules? ← Validate this with Simon/Intl

Tasks breakdown

Did research in the code and discovered that we had an implementation regarding this on this PR: https://github.com/rbilabs/intl-whitelabel-app/pull/1686 but reverted here. By the revert description, the cause was “We need to revert this because of a mistake in the requirements.”

We have the option to bring the reverted PR back or work again on the same adjust:

The following solutions and tasks are based on the solution proposed by Odang, Kristoforus. Kudos to him.

Task 1

...

- Generate missing Sanity Graphql and add additional info on mergeRestaurantData

In the revert PR, some of the types from the generated command were kept but we’ll need to have that again so will be good if we run the yarn apollo:generate again to see if we'll have any change and to add again what's missing.

...

Expand
titlesrc/utils/restaurant/index.ts - Adding new information
Code Block
languagetypescript
export const mergeRestaurantData = ({
  rbiRestaurant,
  sanityStore,
}: IMergeRestaurantData): IStore & { available: boolean } => {
  return {
    // ... rest of the file    
    additionalHours: our new code here
  };
};

This method will be responsible for letting us get the needed data to be shown on the FE side. We can format/adjust the data from Sanity to what we want/need for the rest of the solution.

In Odang’s code, he create a placeholder to help standardize the information for the other hours information. Feel free to analyze this

DOD Like

  • Test using a console to see if the new data you be shown

Task 2

...

- Extend Hours comp to receive the new additional information

Now that we can get with success the data from Sanity (implemented on task 1) we need to pass this down to the three components.

...

Expand
titlesrc/components/store-info-modal/index.tsx
  • Code Block
    languagetypescript
    const Hours = ({ title, hours, additionalHours }: IHoursProps) => {
      // ... rest of the file
      const additionalOpeningHours = additionalHours
        ? additionalHours[`${abbreviatedDay}Open`]
        : '';
      const additionalClosingHours = additionalHours
        ? additionalHours[`${abbreviatedDay}Close`]
        : '';
      const isAdditionalHoursAvailable = additionalOpeningHours && additionalClosingHours;
      
      // ... rest of the file
    });

DOD Like

  • Test using a console to see if the new data you be shown

Task 3

...

- Show the new additional information on the interface

...

  • Add the new infos on the <Hours> comp used inside src/components/store-info-modal/index.tsx. I’ll let this be free for those who implement this. You can also take a look at Odang’s code

DOD Like

  • The layout should be as described in Figma

Task 4 - Highlight: Pass the new information through our <StoreStatus> comp and add new logic on the useStoreStatus hook

… Work in progres …