Track txnId and successful users

This commit is contained in:
Austin Chen 2022-05-04 12:09:54 -04:00
parent 12aceef4ca
commit 76d234388b
2 changed files with 6 additions and 0 deletions

View File

@ -16,6 +16,8 @@ export type Manalink = {
// If set to Infinity, the link can be used infinitely // If set to Infinity, the link can be used infinitely
maxUses: number maxUses: number
// Used for simpler caching
successUserIds: string[]
// Successful redemptions of the link // Successful redemptions of the link
successes: Claim[] successes: Claim[]
// Failed redemptions of the link // Failed redemptions of the link
@ -25,5 +27,8 @@ export type Manalink = {
type Claim = { type Claim = {
toId: string toId: string
// The ID of the successful txn that tracks the money moved
txnId: string
claimedTime: number claimedTime: number
} }

View File

@ -31,6 +31,7 @@ export async function createManalink(data: {
createdTime: Date.now(), createdTime: Date.now(),
expiresTime, expiresTime,
maxUses, maxUses,
successUserIds: [],
successes: [], successes: [],
failures: [], failures: [],
} }