Verified buildTypeScriptdomainuiserver

Team invitations

src/features/team-invites

Invite people to a team by email with a role. Invites expire after 7 days and can be accepted or revoked.

Brick

  • __tests__/

  • domain/

  • host/

  • server/

  • testing/

  • ui/

Host adapter (not part of the brick)

domain/index.ts
1/**
2 * The pure entrypoint: types and logic with no React and no I/O. Importable
3 * from both server and client code.
4 */
5
6export type { Invite, InviteRole, InviteStatus, NormalizeEmailInput, InviteMemberInput, ListInvitesInput, AcceptInput, RevokeInput, ISODateTime } from './types';
7export { TeamInvitesError, NotImplemented } from './errors';
8export type { TeamInvitesErrorCode } from './errors';
9export { initialInviteStatus, canInvite, transitionInvite, availableInviteEvents } from './lifecycle';
10export type { InviteEvent } from './lifecycle';
11export { normalizeEmail } from './operations';
12

Requirements

  • ✓

    REQ-1Emails are normalized and validated

    ✓ [REQ-1] Emails are normalized and validated #1 · ✓ [REQ-1] Emails are normalized and validated #2 · ✓ [REQ-1] Emails are normalized and validated #3

  • ✓

    REQ-2Inviting creates a pending invite that expires in 7 days

    ✓ [REQ-2] Inviting creates a pending invite that expires in 7 days #1

  • ✓

    REQ-3The same email can't be invited twice

    ✓ [REQ-3] The same email can't be invited twice #1

  • ✓

    REQ-4Only pending, unexpired invites can be accepted

    ✓ [REQ-4] Only pending, unexpired invites can be accepted #1 · ✓ [REQ-4] Only pending, unexpired invites can be accepted #2 · ✓ [REQ-4] Only pending, unexpired invites can be accepted #3

  • ✓

    REQ-5Pending invites can be revoked

    ✓ [REQ-5] Pending invites can be revoked #1 · ✓ [REQ-5] Pending invites can be revoked #2

  • ✓

    REQ-6The list shows pending invites first, then by email

    ✓ [REQ-6] The list shows pending invites first, then by email #1

  • ✓

    GATE-PORTABLESelf-contained: relative imports only, nothing escapes the brick (R1–R6)

    brick-lint + builder harness

  • ✓

    GATE-CONTRACTVendored host contract is byte-identical (R8)

    sha-256 comparison

  • ✓

    GATE-TYPESTypechecks under the strictest-superset tsconfig

    in-process tsc

  • ✓

    GATE-TESTSShips its own tests and they pass (R12)

    20 passing

  • ✓

    GATE-LIFECYCLE-INVITEInvite.status only changes through declared transitions

    8 generated lifecycle tests

Built 28/10/2026, 09:07:13 by BRICO team · 20 tests passing · operations by hand-written