Versions Compared

Key

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

...

  • With cash limitation data, the WL-App can validate if some rule is active and if it needs to hide physical payments;

  • This control is by each user;

    • At the moment of payment, the WL-app retrieves information about the user's most recent delivery order using the getUserOrders function. This includes restaurant details and any applicable limitation rules. Based on this information, we need to implement logic that hides the physical payment option if any limitation is met.

      For example, if it is the user's first home delivery purchase, which we can determine if the getUserOrders query returns zero orders of this type, and the selected restaurant has a rule that the first purchase must not exceed $30.00 (as specified by the restaurant's information from Sanity), then the WL-app can check the current order value on this screen. If the order total cents exceeds the limit, the WL-app will hide the physical payment options.

      With all these details, the WL-app can effectively decide whether to display or hide the physical payment option.

image-20240529-170137.png

Consequences

  • Create a new field fields in Restaurant Document on Sanity to receive this informationstore Cash Limitation rules data;

  • Create a new screen on DOP (FZ-Portal) so the that user can manipulate this information and send it to Cash Limitation rules and store them on Sanity;

    • Use the Sanity Client Lib to get and save information on Sanity, this library is already available on DOP.

  • Create a new logic on WL-App in the payment page to control the exhibition according to the information and limitations that are got from Restaurant;

...