Skip to content

number of checkmarks, number of qr codes logic helper method #89

@helenailic

Description

@helenailic

when a user opens up their point tracker, for the "star" pin points (those they've passed with points), if they've already redeemed the specific checkpoint it should return a checkmark/success/already redeemed message. If they haven't redeemed it yet, it should show specific QR code for that checkpoint.

We will use this helper method to determine how many checkmarks vs qr codes need to be generated:

  1. take in raw number of points they have, based on where pinpoint thresholds are (this should be modularized), determine how many checkpoints they should have as "star" components and passed
  2. compare the number of checkpoints they have passed to the n_checkpoints field in the database (need to use 'get' method) to determine how many checkmarks vs qr codes are needed

Return a json object or tuple with (# checkmarks, # qr codes) needed

Example:
I have 60 points, which means I've crossed 3 checkpoints.
n_checkpoints = 2, meaning i've already redeemed 2 of them.
Thus, I would return 2 checkmarks, 1 qr code.

This method should be a helper method in the PointBar.tsx file

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions