Tiered Fees Custom Discount Message

Description

There is a requirement to add a message about discount/description on the Fee Table. In a first moment, the proposal will be to configure/show the message discount on Whitelabel, but the Sanity structure will be enhanced to receive more Fee configurations in the future, as the Fees Tiers that currently are in the LD.

These configurations will be related to the restaurant group and the Fee config.

image-20240502-101216.png

Acceptance criteria

Review

Paula Winter

Sanity:

Fee Config

  1. This feature will be in the path:

    1. RBI Sanity Studio > Marketing Content > Features > Feature Fees > Fee Config

      1. This menu needs to be shown just IBERIA markets

        image-20240424-110751.png

  2. The fields:

    • Default Config

      • It is a boolean

      • It isn’t required

      • DEFAULT FALSE;

      • Disable toggle, in other words, the configuration isn't a default configuration;

      • Enabled toggle, in other words, the configuration is a default configuration;

    • Configuration Title

      • It is a string field

      • It is required

      • When there is a value

    • Fee Type

      • It is a list field

      • It is required

      • When there is a value

      • Possible values:

        • Delivery Fee

        • Service Fee

    • Fee Expiration Date

      • It is a date field with mask YYYY-MM-DD

      • When the the Default Config toggle field disabled

        • It isn’t required

        • Will be hidden

      • When the the Default Config toggle field enabled

        • It is required

        • Will be shown

        • time date

      • When there is a value

        • Just in the start date field

        • Just in the end date field

        • There is value in both field

    • Fee Discount Message

      • It is a translation field

        • In this field, there will be a possibility to add the discount message with all languages enabled to this market;

      • It is required

      • When there is value

         

  3. As the Fee Config document is used in the Fee Restaurant Config document the user can change the toggle even if the document is already published. As we don't find a way to control this we need to ensure that the user will not be able to change the value of the toggle after the first publish.

    1. After the first publish, will disable the fields:

      1. Default Config

      2. Fee Type

    2. Like that the video:

If there is a need to change the value field (Default Config or Fee Type), delete the specific document and create a new one with the new values.

  1. This is a page with all fields

Fee Restaurant Config

  1. This feature will be in the path:

    1. RBI Sanity Studio > Marketing Content > Features > Feature Fees > Fee Restaurant Config

      1. This menu needs to be shown just IBERIA markets

  2. The fields:

    1. Fee Restaurant Configuration Title

      1. It is a string field

      2. It is required

      3. When there is value

    2. Restaurants Group

      1. It is a list item field

      2. It is required

      3. When there is an item

    3. Delivery Fee Config

      1. It is collapsed

        1. When collapse is disabled

        2. When collapse is enabled

      2. It is required

        1. Default Config

          1. It is a list item field

          2. It is required

          3. The list must filter and show just the default config on the Delivery Fee types

          4. Will be able to add just ONE Default Config

            1. If Add more the 1, will validate the field

        2. Other Config

          1. It is a list item field

          2. It isn’t required

          3. When there is an item

            1. The list must filter and show just the default config on the Delivery Fee types

            2. Will be able to add just ONE Other Config

            3. If Add more the 1, will validate the field

    4. Service Fee Config

      1. It is collapsed

        1. When collapse is disabled

        2. When collapse is enabled

      2. It is required

        1. Default Config

          1. It is a list item field

          2. It is required

          3. The list must filter and show just the default config on the Service Fee types

          4. Will be able to add just ONE Default Config

            1. If Add more the 1, will validate the field

        2. Other Config

          1. It is a list item field

          2. It isn’t required

          3. When there is an item

            1. The list must filter and show just the default config on the Service Fee types

            2. Will be able to add just ONE Other Config

            3. If Add more the 1, will validate the field

  3. This is a page with all fields

Whitelabel:

  1. Toggle Enabled or Disabled:

    1. The Fee discount description will show on the fee table modal when the Sanity toggle is enabled;

      1. Will considered enabled:

        1. On Sanity there is a DEFAULT CONFIG added to the restaurant group that the restaurant is part;

        2. On Sanity there is an OTHER CONFIG added to the restaurant group that the restaurant is part with period valid;

        3. If there are the DEFAULT CONFIG and OTHER CONFIG:

          1. it will be considered the OTHER CONFIG, if the period has been valid;

          2. else, it will be considering the DEFAULT CONFIG;

    2. When the Sanity toggle is disabled, the Fee discount description will hide on the fee table modal;

      1. If anyone’s conditions above are matched.