@withpotter/loyalty — module reference

A support module — it mounts no HTTP routes of its own but contributes the internal building blocks below. See the package internal architecture for how the layers fit together.

Internals

Entities

Sequelize models owned by this module.

LoyaltyProgram — table loyalty_programs

FieldType
idstring
tenantIdstring
tenantTenant
namestring
pointsNamestring
pointsPerCurrencynumber
currencyPerPointnumber
minRedeemPointsnumber
pointsExpiryDaysnumber | null
isActiveboolean
settingsLoyaltyProgramSettings | null
createdAtDate
updatedAtDate
tiersLoyaltyTier[]
earnRulesLoyaltyEarnRule[]
balancesLoyaltyBalance[]
idstring
programIdstring
programLoyaltyProgram
namestring
minLifetimePointsnumber
earnMultipliernumber
perksLoyaltyTierPerks | null
badgeColorstring | null
positionnumber
createdAtDate
updatedAtDate
idstring
programIdstring
programLoyaltyProgram
triggerLoyaltyEarnTrigger
pointsAmountnumber | null
pointsPerCurrencyOverridenumber | null
descriptionstring | null
isActiveboolean
conditionsRecord<string, unknown> | null
createdAtDate
updatedAtDate
idstring
programIdstring
programLoyaltyProgram
memberIdstring
memberMember
tenantIdstring
tenantTenant
currentPointsnumber
lifetimePointsnumber
redeemedPointsnumber
tierIdstring | null
tierLoyaltyTier
lastEarnedAtDate | null
lastRedeemedAtDate | null
createdAtDate
updatedAtDate
transactionsLoyaltyTransaction[]
idstring
balanceIdstring
balanceLoyaltyBalance
tenantIdstring
typeLoyaltyTransactionType
pointsnumber
descriptionstring | null
triggerLoyaltyEarnTrigger | null
orderIdstring | null
bookingIdstring | null
metadataRecord<string, unknown> | null
createdAtDate

Repositories

Data-access classes wrapping the entities.

LoyaltyRepository

findProgramByTenant · findAllProgramsByTenant · countProgramsByTenant · findProgramById · createProgram · updateProgram · deleteProgram · findTiersByProgram · createTier · updateTier · deleteTier · findTierForPoints · findEarnRulesByProgram · findActiveEarnRule · createEarnRule · updateEarnRule · deleteEarnRule · findBalance · findBalanceByTenantAndMember · findOrCreateBalance · listBalances · earnPoints · redeemPoints · updateBalanceTier · listTransactions · getProgramStats

Generated from the module’s source. Routes are relative to the engine root (default http://localhost:3001). For full request/response schemas use the live OpenAPI document.