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.
Send a notification to a user.
Goal
Deliver notifications across multiple channels.
Context
Called by services when events require user notification.
Emitted Events
•
`notification.sent` (v1.0.0)
Source Definition
import { defineCommand, defineQuery } from '@lssm-tech/lib.contracts-spec';
import {
defineEnum,
defineSchemaModel,
ScalarTypeEnum,
} from '@lssm-tech/lib.schema';
export const SendNotificationContract = defineCommand({
meta: {
key: 'notifications.send',
version: '1.0.0',
stability: 'stable',
owners: ['platform.notifications'],
tags: ['notifications', 'send'],
description: 'Send a notification to a user.',
goal: 'Deliver notifications across multiple channels.',
context: 'Called by services when events require user notification.',
},
io: {
input: SendNotificationInputModel,
output: NotificationModel,
errors: {
USER_NOT_FOUND: {
description: 'Target user does not exist',
http: 404,
gqlCode: 'USER_NOT_FOUND',
when: 'User ID is invalid',
},
TEMPLATE_NOT_FOUND: {
description: 'Notification template does not exist',
http: 404,
gqlCode: 'TEMPLATE_NOT_FOUND',
when: 'Template ID is invalid',
},
},
},
policy: {
auth: 'user',
},
sideEffects: {
emits: [
{
key: 'notification.sent',
version: '1.0.0',
when: 'Notification is sent',
payload: NotificationModel,
},
],
},
});