@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
| Method | Path | Auth | Description |
|---|---|---|---|
GET | /invite-codes | Yes | List |
POST | /invite-codes | Yes | Create |
POST | /invite-codes/batch | Yes | Create batch |
POST | /invite-codes/validate | — | Validate |
PATCH | /invite-codes/:id/deactivate | Yes | Deactivate |
Internals
Use-cases
Application operations. Each is a single-purpose class with one execute() method.
| Use-case | Signature |
|---|---|
CreateInviteCodeUseCase | execute(input: CreateInviteCodeInput) |
RedeemInviteCodeUseCase | execute(code: string, email?: string) |
SendInviteEmailUseCase | execute(input: SendInviteEmailInput): Promise<void> |
ValidateInviteCodeUseCase | execute(code: string, email?: string) |
Entities
Sequelize models owned by this module.
InviteCode — table invite_codes
| Field | Type |
|---|---|
id | string |
code | string |
email | string | null |
maxUses | number | null |
useCount | number |
expiresAt | Date | null |
createdBy | string | null |
isActive | boolean |
createdAt | Date |
updatedAt | Date |
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.