Versions Compared

Key

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

...

Expand
titleImprove Order Details Screen

File: src/components/points-details-card/index.tsx
Changes:

  • Add field “Initial points balance“

  • Add “ - “ before “Points used”

    • Add “-“ only in numbers greater than 0'

      • points used: 0

      • points used: -123

  • Add filed “Total transaction points“

    • pointsEarned - pointsUsed consider bonusPoints as well

  • Label “Balance“ to “Final points balance“

    • pointsBalance + (pointsEarned - pointsUsed) consider debits as well

image-20240821-173549.png

Expand
titleCreate new utils with functions to calculate transactions values

File Local src/utils/utils.ts

  • function to calculate initial points value

  • function to calculate earn points value (earn + bonus)

  • function to calcutate transaction points value (earn + bonus - used)

  • function to calculate final point value (balancePoints + (pointsEarned - pointsUsed) )

...