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.
Detach a file from an entity.
Goal
Remove a file association.
Context
Called when removing file from entity.
Source Definition
import { defineCommand, defineQuery } from '@lssm-tech/lib.contracts-spec';
import { defineSchemaModel, ScalarTypeEnum } from '@lssm-tech/lib.schema';
export const DetachFileContract = defineCommand({
meta: {
key: 'attachment.detach',
version: '1.0.0',
stability: 'stable',
owners: ['platform.files'],
tags: ['files', 'attachment', 'detach'],
description: 'Detach a file from an entity.',
goal: 'Remove a file association.',
context: 'Called when removing file from entity.',
},
io: {
input: DetachFileInput,
output: SuccessOutput,
errors: {
ATTACHMENT_NOT_FOUND: {
description: 'Attachment does not exist',
http: 404,
gqlCode: 'ATTACHMENT_NOT_FOUND',
when: 'Attachment ID is invalid',
},
},
},
policy: {
auth: 'user',
},
});