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.
Create a new user account.
Goal
Register a new user in the system.
Context
Used during signup flows. May trigger email verification.
Emitted Events
•
`user.created` (v1.0.0)
Source Definition
import { defineCommand, defineQuery } from '@lssm-tech/lib.contracts-spec';
import { ScalarTypeEnum, SchemaModel } from '@lssm-tech/lib.schema';
export const CreateUserContract = defineCommand({
meta: {
key: 'identity.user.create',
version: '1.0.0',
stability: 'stable',
owners: ['platform.identity-rbac'],
tags: ['identity', 'user', 'create'],
description: 'Create a new user account.',
goal: 'Register a new user in the system.',
context: 'Used during signup flows. May trigger email verification.',
},
io: {
input: CreateUserInputModel,
output: UserProfileModel,
errors: {
EMAIL_EXISTS: {
description: 'A user with this email already exists',
http: 409,
gqlCode: 'EMAIL_EXISTS',
when: 'Email is already registered',
},
},
},
policy: {
auth: 'anonymous',
},
sideEffects: {
emits: [
{
key: 'user.created',
version: '1.0.0',
when: 'User is successfully created',
payload: UserProfileModel,
},
],
audit: ['user.created'],
},
});