invite-issuance-service Service

Domain service that mints and persists a single invite row per request.

Function I/O

NameInOutSidePurpose
Issuectx, userIdInviteCode | errortxGenerates a unique code and writes the matching invite_codes row.
generateCoderandcodepureProduces a 10-char alphanumeric token.

Variables

NameTypeScopePurpose
codestringtxNewly minted invite token recorded against the member.
rowInviteCodeRowtxPersisted invite_codes row carrying owner, code, expiry, and consumption state.

Internal data flow

1 fn Issue Open transaction. 2 fn generateCode Build candidate code from random bytes. → writes: code 3 fn Issue Persist row via INSERT (retry on unique-violation). ← reads: code → writes: row 4 fn Issue Commit transaction and return code to caller. ← reads: code, row

Errors

NameWhenMeans
ErrCollisionUnique constraint on code repeatedly violated.Surface 503 after retry budget exhausted.