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.

notifications.send

Send a notification to a user.

  • Type: operation (command)
  • Version: 1.0.0
  • Stability: stable
  • Owners: platform.notifications
  • Tags: notifications, send
  • File: packages/modules/notifications/src/contracts/index.ts
  • field.key.label
    notifications.send
    field.version.label
    1.0.0
    field.type.label
    operation (command)
    field.title.label
    notifications.send
    field.description.label

    Send a notification to a user.

  • Type: operation (command)
  • Version: 1.0.0
  • Stability: stable
  • Owners: platform.notifications
  • Tags: notifications, send
  • File: packages/modules/notifications/src/contracts/index.ts
  • field.tags.label
    notifications,send
    field.owners.label
    platform.notifications
    field.stability.label
    stable

    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,
    			},
    		],
    	},
    });