OSS-first docs
These docs teach the open system first: contracts, generated surfaces, runtimes, governance, and incremental adoption. Studio shows up as the operating layer on top, not as the source of truth.
Accept an organization invitation.
Goal
Allow users to join organizations via invitation.
Context
Called from invitation email link.
Emitted Events
•
`org.member.added` (v1.0.0)
Source Definition
import { defineCommand, defineQuery } from '@lssm-tech/lib.contracts-spec';
import { ScalarTypeEnum, SchemaModel } from '@lssm-tech/lib.schema';
import { SuccessResultModel } from './user';
export const AcceptInviteContract = defineCommand({
meta: {
key: 'identity.org.invite.accept',
version: '1.0.0',
stability: 'stable',
owners: ['platform.identity-rbac'],
tags: ['identity', 'org', 'invite', 'accept'],
description: 'Accept an organization invitation.',
goal: 'Allow users to join organizations via invitation.',
context: 'Called from invitation email link.',
},
io: {
input: AcceptInviteInputModel,
output: MemberModel,
errors: {
INVITE_EXPIRED: {
description: 'The invitation has expired',
http: 410,
gqlCode: 'INVITE_EXPIRED',
when: 'Invitation is past expiry date',
},
INVITE_USED: {
description: 'The invitation has already been used',
http: 409,
gqlCode: 'INVITE_USED',
when: 'Invitation was already accepted',
},
},
},
policy: {
auth: 'user',
},
sideEffects: {
emits: [
{
key: 'org.member.added',
version: '1.0.0',
when: 'Member joins org',
payload: MemberModel,
},
],
audit: ['org.member.added'],
},
});