Versions Compared

Key

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

Questions:

...

1 - TASK: Create new promo code flow to loyalty

  • Create feature flag;

  • The first step to use the loyalty promo code at checkout will be to change the validation promo code flow.

    • On promo code component field, we will need to add a feature flag:

      • When this flag is enabled: The promo code flow will be LOYALTY OFFER

      • When this flag is disabled: The promo code flow will be CBA OFFER (current flow)

  • We will create a new hook to contain all the rules of this flow

    • We can use the same hook used to offer page flow.

      • intl-whitelabel-app/workspaces/frontend/src/state/loyalty/hooks/use-redeem-promo-codes.ts

...

  • We will need to update the button action to remove the applied offer on loyalty.offers.cmsOffers

    • path: intl-whitelabel-app/workspaces/frontend/src/state/global-state/models/loyalty/offers/offers.slice.ts

      Code Block
      languagetypescript
      removeCmsOffers: (state, { payload }: PayloadAction<LoyaltyOffer>) => {
        state.cmsOffers = state.cmsOffers.filter(offer => offer._id !== payload._id);
      },
    • path: intl-whitelabel-app/workspaces/frontend/src/pages/cart/your-cart/cart-offer.tsx

      Code Block
      languagetypescript
      const onRemove = () => {
        ...
        dispatch(actions.loyalty.removeCmsOffers(selectedLoyaltyOffer));
      };
      • OBS.: Change also:

        • path: intl-whitelabel-app/workspaces/frontend/src/state/global-state/models/loyalty/loyalty.actions.ts

3 - TASK: Hide CBA Options

  • We will need to hide the CBA option to ensure that anything CBA option shows.

    Image Added
    • Then, we will create a new attribute to hide this option;

      • This attribute value can be the opposite of the value of feature flag (flag created on task 1)

        Image Added

4 - TASK: Clean the applied offer when finished the order

  • When finished the order, we need to clean the offers on cookies, sessions and etc.

    • path: intl-whitelabel-app/workspaces/frontend/src/pages/order-confirmation/order-confirmation.tsx

...

  • First, it will call the PriceOrder mutation on intl-gateway or intl-graphql

  • This mutation will call the backend: intl-partners-service repository.

    • on this repository, will call:

      • public async price(@Body() payload: PriceOrderRequestDto): Promise<OrderResponseDto>

        • path: intl-partners-service/src/modules/orders/orders.controller.ts

      • after: public async price(input: IPriceOrderRequest): Promise<IOrder>

        • path: intl-partners-service/src/modules/orders/orders.service.ts

        • on this file is where calculate the order and is generated the rbiOrderId.

Info

Currently for some reason, the calc is wrong in 2 aspects:

  • Setting up wrong offers;

  • Missing configOffer calc;

...