@withpotter/invite-code — module reference

HTTP routes this module mounts, plus its internal use-cases, entities, and repositories. The exhaustive request/response contract is the engine’s OpenAPI document at /docs; the layered structure below follows the package internal architecture.

HTTP routes

InviteCodeController /invite-codes

MethodPathAuthDescription
GET/invite-codesYesList
POST/invite-codesYesCreate
POST/invite-codes/batchYesCreate batch
POST/invite-codes/validateValidate
PATCH/invite-codes/:id/deactivateYesDeactivate

Internals

Use-cases

Application operations. Each is a single-purpose class with one execute() method.

Use-caseSignature
CreateInviteCodeUseCaseexecute(input: CreateInviteCodeInput)
RedeemInviteCodeUseCaseexecute(code: string, email?: string)
SendInviteEmailUseCaseexecute(input: SendInviteEmailInput): Promise<void>
ValidateInviteCodeUseCaseexecute(code: string, email?: string)

Entities

Sequelize models owned by this module.

InviteCode — table invite_codes

FieldType
idstring
codestring
emailstring | null
maxUsesnumber | null
useCountnumber
expiresAtDate | null
createdBystring | null
isActiveboolean
createdAtDate
updatedAtDate

Repositories

Data-access classes wrapping the entities.

InviteCodeRepository

create · findByCode · findById · incrementUseCount · deactivate · findAll

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.