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.

identity.org.create

Create a new organization.

  • Type: operation (command)
  • Version: 1.0.0
  • Stability: stable
  • Owners: platform.identity-rbac
  • Tags: identity, org, create
  • File: packages/libs/identity-rbac/src/contracts/organization.ts
  • field.key.label
    identity.org.create
    field.version.label
    1.0.0
    field.type.label
    operation (command)
    field.title.label
    identity.org.create
    field.description.label

    Create a new organization.

  • Type: operation (command)
  • Version: 1.0.0
  • Stability: stable
  • Owners: platform.identity-rbac
  • Tags: identity, org, create
  • File: packages/libs/identity-rbac/src/contracts/organization.ts
  • field.tags.label
    identity,org,create
    field.owners.label
    platform.identity-rbac
    field.stability.label
    stable

    Create a new organization.

    Goal

    Allow users to create new organizations/workspaces.

    Context

    Called during onboarding or when creating additional workspaces.

    Emitted Events

    `org.created` (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 CreateOrgContract = defineCommand({
    	meta: {
    		key: 'identity.org.create',
    		version: '1.0.0',
    		stability: 'stable',
    		owners: ['platform.identity-rbac'],
    		tags: ['identity', 'org', 'create'],
    		description: 'Create a new organization.',
    		goal: 'Allow users to create new organizations/workspaces.',
    		context: 'Called during onboarding or when creating additional workspaces.',
    	},
    	io: {
    		input: CreateOrgInputModel,
    		output: OrganizationModel,
    		errors: {
    			SLUG_EXISTS: {
    				description: 'An organization with this slug already exists',
    				http: 409,
    				gqlCode: 'SLUG_EXISTS',
    				when: 'Slug is already taken',
    			},
    		},
    	},
    	policy: {
    		auth: 'user',
    	},
    	sideEffects: {
    		emits: [
    			{
    				key: 'org.created',
    				version: '1.0.0',
    				when: 'Organization is created',
    				payload: OrganizationModel,
    			},
    		],
    		audit: ['org.created'],
    	},
    });