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.
Invite a user to join the organization.
Goal
Allow org admins to invite new members.
Context
Team management. Sends invitation email.
Emitted Events
•
`org.invite.sent` (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 InviteMemberContract = defineCommand({
meta: {
key: 'identity.org.invite',
version: '1.0.0',
stability: 'stable',
owners: ['platform.identity-rbac'],
tags: ['identity', 'org', 'invite', 'member'],
description: 'Invite a user to join the organization.',
goal: 'Allow org admins to invite new members.',
context: 'Team management. Sends invitation email.',
},
io: {
input: InviteMemberInputModel,
output: InvitationModel,
errors: {
ALREADY_MEMBER: {
description: 'User is already a member of this organization',
http: 409,
gqlCode: 'ALREADY_MEMBER',
when: 'Invitee is already a member',
},
INVITE_PENDING: {
description: 'An invitation for this email is already pending',
http: 409,
gqlCode: 'INVITE_PENDING',
when: 'Active invitation exists',
},
},
},
policy: {
auth: 'user',
},
sideEffects: {
emits: [
{
key: 'org.invite.sent',
version: '1.0.0',
when: 'Invitation is sent',
payload: InvitationModel,
},
],
audit: ['org.invite.sent'],
},
});