@things-factory/ops-master 10.1.34 → 10.1.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-client/master-change-approval.d.ts +7 -0
- package/dist-client/master-change-approval.js +16 -0
- package/dist-client/master-change-approval.js.map +1 -1
- package/dist-client/pages/master/applied-when-dialog.d.ts +45 -0
- package/dist-client/pages/master/applied-when-dialog.js +139 -0
- package/dist-client/pages/master/applied-when-dialog.js.map +1 -0
- package/dist-client/pages/master/assignment-fields.d.ts +28 -0
- package/dist-client/pages/master/assignment-fields.js +55 -0
- package/dist-client/pages/master/assignment-fields.js.map +1 -0
- package/dist-client/pages/master/equipment.js +1 -0
- package/dist-client/pages/master/equipment.js.map +1 -1
- package/dist-client/pages/master/master-page-base.d.ts +14 -0
- package/dist-client/pages/master/master-page-base.js +40 -4
- package/dist-client/pages/master/master-page-base.js.map +1 -1
- package/dist-client/pages/master/material-definition.d.ts +4 -11
- package/dist-client/pages/master/material-definition.js +5 -53
- package/dist-client/pages/master/material-definition.js.map +1 -1
- package/dist-client/pages/master/material-revision-fields.d.ts +2 -0
- package/dist-client/pages/master/material-revision-fields.js +43 -0
- package/dist-client/pages/master/material-revision-fields.js.map +1 -0
- package/dist-client/pages/master/operational-location.js +1 -0
- package/dist-client/pages/master/operational-location.js.map +1 -1
- package/dist-client/pages/master/recipe-definition.d.ts +4 -135
- package/dist-client/pages/master/recipe-definition.js +7 -397
- package/dist-client/pages/master/recipe-definition.js.map +1 -1
- package/dist-client/pages/master/revision-comparison.d.ts +48 -0
- package/dist-client/pages/master/revision-comparison.js +553 -0
- package/dist-client/pages/master/revision-comparison.js.map +1 -0
- package/dist-client/pages/master/revision-view.d.ts +19 -0
- package/dist-client/pages/master/revision-view.js +133 -0
- package/dist-client/pages/master/revision-view.js.map +1 -0
- package/dist-client/pages/master/revision-workspace.d.ts +50 -0
- package/dist-client/pages/master/revision-workspace.js +752 -0
- package/dist-client/pages/master/revision-workspace.js.map +1 -0
- package/dist-client/pages/master/test-specification.d.ts +4 -29
- package/dist-client/pages/master/test-specification.js +5 -225
- package/dist-client/pages/master/test-specification.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/assignment/applied-when.d.ts +24 -0
- package/dist-server/service/assignment/applied-when.js +16 -0
- package/dist-server/service/assignment/applied-when.js.map +1 -0
- package/dist-server/service/assignment/assignment-claim.d.ts +111 -0
- package/dist-server/service/assignment/assignment-claim.js +160 -0
- package/dist-server/service/assignment/assignment-claim.js.map +1 -0
- package/dist-server/service/assignment/assignment-history.d.ts +87 -0
- package/dist-server/service/assignment/assignment-history.js +250 -0
- package/dist-server/service/assignment/assignment-history.js.map +1 -0
- package/dist-server/service/assignment/assignment-write.d.ts +25 -0
- package/dist-server/service/assignment/assignment-write.js +69 -0
- package/dist-server/service/assignment/assignment-write.js.map +1 -0
- package/dist-server/service/equipment/equipment-master-resolver.d.ts +9 -1
- package/dist-server/service/equipment/equipment-master-resolver.js +6 -3
- package/dist-server/service/equipment/equipment-master-resolver.js.map +1 -1
- package/dist-server/service/index.d.ts +15 -2
- package/dist-server/service/index.js +13 -0
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/location/location-master-resolver.d.ts +4 -1
- package/dist-server/service/location/location-master-resolver.js +6 -3
- package/dist-server/service/location/location-master-resolver.js.map +1 -1
- package/dist-server/service/master-axis.js +1 -1
- package/dist-server/service/master-axis.js.map +1 -1
- package/dist-server/service/master-change-policy.js +7 -2
- package/dist-server/service/master-change-policy.js.map +1 -1
- package/dist-server/service/master-conformance-resolver.js +11 -1
- package/dist-server/service/master-conformance-resolver.js.map +1 -1
- package/dist-server/service/master-crud.d.ts +11 -0
- package/dist-server/service/master-crud.js +15 -1
- package/dist-server/service/master-crud.js.map +1 -1
- package/dist-server/service/master-list.js +6 -0
- package/dist-server/service/master-list.js.map +1 -1
- package/dist-server/service/material/index.d.ts +3 -2
- package/dist-server/service/material/index.js +4 -2
- package/dist-server/service/material/index.js.map +1 -1
- package/dist-server/service/material/material-axis-status.d.ts +8 -0
- package/dist-server/service/material/material-axis-status.js +19 -0
- package/dist-server/service/material/material-axis-status.js.map +1 -0
- package/dist-server/service/material/material-definition.d.ts +3 -0
- package/dist-server/service/material/material-definition.js +13 -0
- package/dist-server/service/material/material-definition.js.map +1 -1
- package/dist-server/service/material/material-effective-list.d.ts +39 -0
- package/dist-server/service/material/material-effective-list.js +54 -0
- package/dist-server/service/material/material-effective-list.js.map +1 -0
- package/dist-server/service/material/material-master-resolver.js +4 -10
- package/dist-server/service/material/material-master-resolver.js.map +1 -1
- package/dist-server/service/material/material-query.js +9 -2
- package/dist-server/service/material/material-query.js.map +1 -1
- package/dist-server/service/material/material-revision-content.d.ts +10 -0
- package/dist-server/service/material/material-revision-content.js +92 -0
- package/dist-server/service/material/material-revision-content.js.map +1 -0
- package/dist-server/service/material/material-revision-resolver.d.ts +54 -0
- package/dist-server/service/material/material-revision-resolver.js +76 -0
- package/dist-server/service/material/material-revision-resolver.js.map +1 -0
- package/dist-server/service/material/material-revision-service.d.ts +144 -0
- package/dist-server/service/material/material-revision-service.js +547 -0
- package/dist-server/service/material/material-revision-service.js.map +1 -0
- package/dist-server/service/material/material-revision.d.ts +84 -0
- package/dist-server/service/material/material-revision.js +339 -0
- package/dist-server/service/material/material-revision.js.map +1 -0
- package/dist-server/service/operation/operation-definition.js +1 -0
- package/dist-server/service/operation/operation-definition.js.map +1 -1
- package/dist-server/service/operation/operation-master-resolver.js +2 -5
- package/dist-server/service/operation/operation-master-resolver.js.map +1 -1
- package/dist-server/service/recipe/index.d.ts +3 -2
- package/dist-server/service/recipe/index.js +4 -2
- package/dist-server/service/recipe/index.js.map +1 -1
- package/dist-server/service/recipe/recipe-definition.d.ts +4 -0
- package/dist-server/service/recipe/recipe-definition.js +14 -1
- package/dist-server/service/recipe/recipe-definition.js.map +1 -1
- package/dist-server/service/recipe/recipe-effective-list.d.ts +49 -0
- package/dist-server/service/recipe/recipe-effective-list.js +96 -0
- package/dist-server/service/recipe/recipe-effective-list.js.map +1 -0
- package/dist-server/service/recipe/recipe-query.js +9 -2
- package/dist-server/service/recipe/recipe-query.js.map +1 -1
- package/dist-server/service/recipe/recipe-revision-content.d.ts +32 -0
- package/dist-server/service/recipe/recipe-revision-content.js +65 -0
- package/dist-server/service/recipe/recipe-revision-content.js.map +1 -0
- package/dist-server/service/recipe/recipe-revision-line.d.ts +30 -0
- package/dist-server/service/recipe/recipe-revision-line.js +95 -0
- package/dist-server/service/recipe/recipe-revision-line.js.map +1 -0
- package/dist-server/service/recipe/recipe-revision-resolver.d.ts +59 -0
- package/dist-server/service/recipe/recipe-revision-resolver.js +76 -0
- package/dist-server/service/recipe/recipe-revision-resolver.js.map +1 -0
- package/dist-server/service/recipe/recipe-revision-service.d.ts +147 -0
- package/dist-server/service/recipe/recipe-revision-service.js +604 -0
- package/dist-server/service/recipe/recipe-revision-service.js.map +1 -0
- package/dist-server/service/recipe/recipe-revision.d.ts +100 -0
- package/dist-server/service/recipe/recipe-revision.js +373 -0
- package/dist-server/service/recipe/recipe-revision.js.map +1 -0
- package/dist-server/service/recipe/route-definition.js +1 -0
- package/dist-server/service/recipe/route-definition.js.map +1 -1
- package/dist-server/service/resource/class-members.js +9 -0
- package/dist-server/service/resource/class-members.js.map +1 -1
- package/dist-server/service/status/master-status.js +2 -1
- package/dist-server/service/status/master-status.js.map +1 -1
- package/dist-server/service/test-spec/test-spec-effective-list.d.ts +2 -0
- package/dist-server/service/test-spec/test-spec-effective-list.js +3 -1
- package/dist-server/service/test-spec/test-spec-effective-list.js.map +1 -1
- package/dist-server/service/test-spec/test-spec-revision-resolver.d.ts +1 -0
- package/dist-server/service/test-spec/test-spec-revision-service.d.ts +21 -0
- package/dist-server/service/test-spec/test-spec-revision-service.js +33 -0
- package/dist-server/service/test-spec/test-spec-revision-service.js.map +1 -1
- package/dist-server/service/test-spec/test-spec-revision.d.ts +2 -0
- package/dist-server/service/test-spec/test-spec-revision.js +6 -1
- package/dist-server/service/test-spec/test-spec-revision.js.map +1 -1
- package/dist-server/service/test-spec/test-specification.d.ts +2 -0
- package/dist-server/service/test-spec/test-specification.js +4 -0
- package/dist-server/service/test-spec/test-specification.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -3
- package/translations/en.json +148 -0
- package/translations/ko.json +148 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recipe-revision-service.js","sourceRoot":"","sources":["../../../server/service/recipe/recipe-revision-service.ts"],"names":[],"mappings":";;;AA2HA,oDAqBC;AAGD,kDAgCC;AAED,8DAWC;AA8CD,8CA4DC;AAED,0CA4CC;AAGD,8CAwBC;AAED,gDAgBC;AAGD,sDAYC;AAED,4DAwBC;AAwGD,sCA4BC;AAGD,wDAWC;AAGD,gDA+CC;AAED,wDAmCC;AAGD,0CAaC;AAvqBD,6CAAwC;AACxC,qCAAyE;AACzE,iDAA+C;AAC/C,kEAA4D;AAC5D,2DAAsD;AACtD,iEAAkF;AAClF,yEAAoE;AACpE,4EAAuE;AACvE,yDAAoD;AACpD,uEAAsG;AACtG,uDAK0B;AAE1B,KAAK,UAAU,SAAS,CACtB,OAAsB,EAAE,QAAgB,EAAE,QAAgB,EAAE,UAAkB,EAC9E,MAAoC,EAAE,OAAsC;IAE5E,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,eAAe,CAAC,gCAAc,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAA;IAC1G,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,OAAO,CAAC,SAAS,CAAC,kCAAe,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAC9H,IAAI,MAAM,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,GAAG,IAAA,6CAAmB,EAAC,QAAQ,CAAC,QAAQ,CAAC;QACzC,cAAc,EAAE,QAAQ,CAAC,OAAO,CAAC,SAAS;QAC1C,YAAY,EAAE,QAAQ,CAAC,OAAO,CAAC,OAAO,IAAI,SAAS;KACpD,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { createHash } from 'node:crypto'\nimport { EntityManager, LessThanOrEqual, MoreThanOrEqual } from 'typeorm'\nimport { Refusal } from '@things-factory/shell'\nimport { masterChangePolicy } from '../master-change-policy'\nimport { RecipeDefinition } from './recipe-definition'\nimport { RecipeRevisionInput, RecipeRevisionOutput } from './recipe-revision-line'\nimport { MaterialDefinition } from '../material/material-definition'\nimport { OperationDefinition } from '../operation/operation-definition'\nimport { RouteDefinition } from './route-definition'\nimport { readRecipeContent, recipeContentValues, RecipeDraftContent } from './recipe-revision-content'\nimport {\n RecipeBasis,\n RecipePlan,\n RecipeRevision,\n RecipeSegment\n} from './recipe-revision'\n\nasync function saveLines(\n manager: EntityManager, domainId: string, recipeId: string, revisionId: string,\n inputs: RecipeDraftContent['inputs'], outputs: RecipeDraftContent['outputs']\n) {\n const header = await manager.findOneByOrFail(RecipeRevision, { id: revisionId, domain: { id: domainId } })\n const route = header.route ? await manager.findOneBy(RouteDefinition, { domain: { id: domainId }, name: header.route }) : null\n if (header.route && !route) refuse('INVALID_RECIPE_REFERENCE', 'Route not found in this domain.')\n for (const [entity, lines] of [[RecipeRevisionInput, inputs], [RecipeRevisionOutput, outputs]] as const) {\n for (const [position, line] of lines.entries()) {\n const material = await manager.findOneBy(MaterialDefinition, { domain: { id: domainId }, name: line.material })\n if (!material) refuse('INVALID_RECIPE_REFERENCE', `Material not found: ${line.material}`)\n const operation = line.operation ? await manager.findOneBy(OperationDefinition, { domain: { id: domainId }, name: line.operation }) : null\n if (line.operation && (!operation || !route?.steps.includes(line.operation)))\n refuse('INVALID_RECIPE_REFERENCE', 'Input operation must exist in the selected route.')\n const values = {\n domain: { id: domainId }, recipe: { id: recipeId }, revision: { id: revisionId },\n materialDefinition: { id: material.id }, material: material.name,\n lineKey: line.lineKey, position, qty: line.qty\n }\n if (entity === RecipeRevisionInput) {\n await manager.save(RecipeRevisionInput, manager.create(RecipeRevisionInput, {\n ...values, operationDefinition: operation ? { id: operation.id } : null, operation: operation?.name ?? null\n }))\n } else {\n await manager.save(RecipeRevisionOutput, manager.create(RecipeRevisionOutput, values))\n }\n }\n }\n}\n\nasync function headerReferences(manager: EntityManager, domainId: string, content: RecipeDraftContent) {\n const primaryMaterial = await manager.findOneBy(MaterialDefinition, { domain: { id: domainId }, name: content.materialDefinitionName })\n const routeDefinition = content.route ? await manager.findOneBy(RouteDefinition, { domain: { id: domainId }, name: content.route }) : null\n if (!primaryMaterial || (content.route && !routeDefinition)) refuse('INVALID_RECIPE_REFERENCE')\n return { primaryMaterial: { id: primaryMaterial.id }, routeDefinition: routeDefinition ? { id: routeDefinition.id } : null }\n}\n\nexport class RecipeRefusal extends Refusal {\n constructor(code: string, detail?: string) {\n super(\n code,\n {},\n detail ?? RECIPE_REFUSALS[code] ?? 'The recipe change could not be applied.'\n )\n }\n}\nconst RECIPE_REFUSALS: Record<string, string> = {\n TRANSACTION_REQUIRED: 'This change requires a transaction.',\n INVALID_INSTANT: 'Enter a valid date and time including its time zone.',\n INVALID_CONTENT: 'The proposed recipe content is invalid.',\n INVALID_RECIPE_REFERENCE: 'A recipe material, operation or route is invalid in this domain.',\n RECIPE_NOT_FOUND: 'The recipe does not exist in this domain.',\n REVISION_NOT_FOUND: 'The revision does not exist in this domain.',\n INVALID_BASE_REVISION: 'The proposed change is based on a different revision.',\n DRAFT_NOT_OWNED: 'Only the draft author can edit or submit it.',\n REVISION_FROZEN: 'This submitted revision cannot be edited. Create another draft.',\n DRAFT_CONFLICT: 'The draft changed. Reload it before saving.',\n PLAN_CONFLICT: 'The approved schedule changed. Review and submit a new draft.',\n INVALID_SUBMISSION: 'The submitted content does not match the frozen revision.',\n AUTHOR_CANNOT_APPROVE: 'The author cannot approve their own change.',\n RETROACTIVE_IMPACT: 'This change would alter a recipe already used by a recorded execution.',\n FUTURE_PLAN_CONFLICT: 'This change conflicts with an approved future schedule.',\n NO_EFFECTIVE_REVISION: 'There is no published revision effective at the execution time.',\n AMBIGUOUS_EFFECTIVITY: 'More than one revision is effective at the execution time.',\n REVISION_INTEGRITY_FAILURE: 'The stored revision does not match its signed content.',\n BASIS_CONFLICT: 'This execution already has a different recipe or execution time.',\n APPROVAL_LINE_REQUIRED: 'Configure an approval line before submitting this change.',\n REVISION_REQUIRED: 'Change the recipe through a revision draft.'\n}\nfunction refuse(code: string, detail?: string): never {\n throw new RecipeRefusal(code, detail)\n}\nfunction transaction(manager: EntityManager) {\n if (!manager.queryRunner?.isTransactionActive) refuse('TRANSACTION_REQUIRED')\n}\n/** Current reads are required after waiting for the subject lock, including MySQL REPEATABLE READ. */\nfunction currentLock(manager: EntityManager) {\n const driver = manager.connection.options.type\n return manager.queryRunner?.isTransactionActive && !['sqlite', 'better-sqlite3', 'sqljs'].includes(driver)\n ? { lock: { mode: 'pessimistic_write' as const } }\n : {}\n}\nfunction instant(value: Date | string): Date {\n if (!(value instanceof Date) && (typeof value !== 'string' || !/(Z|[+-]\\d{2}:\\d{2})$/.test(value)))\n refuse('INVALID_INSTANT')\n const result = new Date(value)\n if (!Number.isFinite(result.getTime())) refuse('INVALID_INSTANT')\n return result\n}\nfunction text(value: unknown, field: string): string {\n if (typeof value !== 'string' || !value.trim()) refuse('INVALID_CONTENT', field)\n return value.trim()\n}\n/** Sorted object keys, ordered arrays, ISO instants. This is the v1 submission encoding. */\nfunction canonical(value: any): string {\n if (value === null || typeof value !== 'object') return JSON.stringify(value)\n if (Array.isArray(value)) return '[' + value.map(canonical).join(',') + ']'\n return (\n '{' +\n Object.keys(value)\n .sort()\n .map(key => JSON.stringify(key) + ':' + canonical(value[key]))\n .join(',') +\n '}'\n )\n}\nexport function recipeSubmissionHash(revision: RecipeRevision): string {\n return createHash('sha256')\n .update(\n canonical({\n schemaVersion: 1,\n revisionNumber: revision.revisionNumber,\n policyId: revision.policyId,\n domainId: revision.domainId,\n recipeId: revision.recipeId,\n primaryMaterialId: revision.primaryMaterialId,\n routeDefinitionId: revision.routeDefinitionId,\n baseRevisionId: revision.baseRevisionId,\n baseGeneration: revision.baseGeneration,\n ...recipeContentValues(revision),\n inputReferences: revision.inputs.map(line => [line.lineKey, line.materialDefinitionId, line.operationDefinitionId]),\n outputReferences: revision.outputs.map(line => [line.lineKey, line.materialDefinitionId]),\n effectiveFrom: revision.effectiveFrom.toISOString(),\n reason: revision.reason\n })\n )\n .digest('hex')\n}\n\n/** Display values are a checked projection of the frozen revision, never a second editable source. */\nexport async function recipeApprovalInput(manager: EntityManager, domainId: string, revisionId: string) {\n const draft = await revision(manager, domainId, revisionId)\n if (!draft.frozenAt || draft.contentHash !== recipeSubmissionHash(draft)) refuse('INVALID_SUBMISSION')\n const recipe = await subject(manager, domainId, draft.recipeId)\n const base = draft.baseRevisionId ? await revision(manager, domainId, draft.baseRevisionId) : null\n const plan = base ? await manager.findOneBy(RecipePlan, {\n domain: { id: domainId }, recipe: { id: draft.recipeId }, generation: draft.baseGeneration\n }) : null\n const segment = plan && base ? await manager.findOneBy(RecipeSegment, {\n domain: { id: domainId }, plan: { id: plan.id }, revision: { id: base.id }\n }) : null\n const values = (row: RecipeRevision) => ({\n revisionNumber: row.revisionNumber, ...recipeContentValues(row),\n detail: {\n revisionId: row.id, createdAt: row.createdAt.toISOString(), frozenAt: row.frozenAt?.toISOString(),\n effectiveFrom: row.effectiveFrom.toISOString(), reason: row.reason,\n ...(row.id === base?.id && segment ? { validFrom: segment.validFrom.toISOString(), validTo: segment.validTo?.toISOString() ?? null } : {})\n }\n })\n return {\n headline: recipe.name,\n reason: draft.reason,\n effectiveFrom: draft.effectiveFrom.toISOString(),\n before: base ? values(base) : null,\n after: values(draft),\n revision: {\n revisionId: draft.id,\n hash: draft.contentHash,\n recipeId: draft.recipeId,\n baseGeneration: draft.baseGeneration\n }\n }\n}\n\nexport async function assertRecipeApprovalInput(\n manager: EntityManager,\n domainId: string,\n input: Record<string, unknown>\n) {\n const reference = input?.revision as { revisionId?: string }\n if (typeof reference?.revisionId !== 'string') refuse('INVALID_SUBMISSION')\n const expected = await recipeApprovalInput(manager, domainId, reference.revisionId)\n for (const key of Object.keys(expected)) {\n if (canonical(input[key]) !== canonical(expected[key])) refuse('INVALID_SUBMISSION')\n }\n}\n\nasync function subject(manager: EntityManager, domainId: string, recipeId: string) {\n const recipe = await manager.findOne(RecipeDefinition, {\n where: { id: recipeId, domain: { id: domainId } },\n ...currentLock(manager)\n })\n if (!recipe) refuse('RECIPE_NOT_FOUND')\n // Compare the current head and latest persisted plan in one SQL snapshot. A historical\n // knownAt query must not compare its selected old plan with the current head.\n const head = await manager.createQueryBuilder(RecipeDefinition, 'head')\n .leftJoin(RecipePlan, 'plan', 'plan.recipe = head.id AND plan.domain = head.domain')\n .select('head.planGeneration', 'generation')\n .addSelect('MAX(plan.generation)', 'latest')\n .where({ id: recipeId, domain: { id: domainId } })\n .groupBy('head.id').addGroupBy('head.planGeneration')\n .getRawOne()\n if (!head || Number(head.generation) !== Number(head.latest ?? 0)) {\n throw new Refusal('PLAN_INTEGRITY_FAILURE', {}, 'The current plan generation does not match the latest published plan. Contact an administrator.')\n }\n return recipe\n}\nasync function revision(manager: EntityManager, domainId: string, revisionId: string, locked = true) {\n const found = await manager.findOne(RecipeRevision, {\n where: { id: revisionId, domain: { id: domainId } },\n relations: { inputs: true, outputs: true },\n ...(locked ? currentLock(manager) : {})\n })\n if (!found) refuse('REVISION_NOT_FOUND')\n found.inputs.sort((a, b) => a.position - b.position)\n found.outputs.sort((a, b) => a.position - b.position)\n return found\n}\n/** A write lock valid on every supported SQL backend, including SQLite (no SELECT FOR UPDATE). */\nasync function lockSubject(manager: EntityManager, domainId: string, recipeId: string) {\n transaction(manager)\n const locked = await manager\n .createQueryBuilder()\n .update(RecipeDefinition)\n .set({ revisionLock: () => 'revision_lock + 1' })\n .where({ id: recipeId, domain: { id: domainId } })\n .execute()\n if (locked.affected !== 1) refuse('RECIPE_NOT_FOUND')\n return subject(manager, domainId, recipeId)\n}\n\nexport async function createRecipeDraft(\n manager: EntityManager,\n domainId: string,\n creatorId: string,\n asked: { recipeId?: string; name?: string; baseRevisionId?: string; content: RecipeDraftContent }\n) {\n transaction(manager)\n const accepted = readRecipeContent(asked.content)\n const policy = await masterChangePolicy(manager, domainId, 'recipeDefinition')\n let recipe: RecipeDefinition\n if (asked.recipeId) {\n recipe = await lockSubject(manager, domainId, asked.recipeId)\n } else {\n recipe = await manager.save(\n RecipeDefinition,\n manager.create(RecipeDefinition, {\n domain: { id: domainId },\n name: text(asked.name, 'name'),\n materialDefinitionName: accepted.materialDefinitionName,\n inputs: [],\n outputs: [],\n planGeneration: 0,\n revisionLock: 0,\n creator: { id: creatorId },\n updater: { id: creatorId }\n })\n )\n }\n const previous = await manager.findOne(RecipeRevision, {\n where: { domain: { id: domainId }, recipe: { id: recipe.id } }, order: { revisionNumber: 'DESC' },\n ...currentLock(manager)\n })\n const revisionNumber = (previous?.revisionNumber ?? 0) + 1\n let baseRevisionId: string | null = null\n if (recipe.planGeneration > 0) {\n baseRevisionId = (await resolveRecipe(manager, domainId, recipe.id, accepted.effectiveFrom)).revision.id\n }\n if (asked.baseRevisionId && asked.baseRevisionId !== baseRevisionId) refuse('INVALID_BASE_REVISION')\n const { inputs, outputs, ...header } = accepted\n const saved = await manager.save(\n RecipeRevision,\n manager.create(RecipeRevision, {\n ...header,\n ...await headerReferences(manager, domainId, accepted),\n policy: { id: policy.id },\n domain: { id: domainId },\n recipe: { id: recipe.id },\n baseRevision: baseRevisionId ? { id: baseRevisionId } : null,\n baseGeneration: recipe.planGeneration,\n revisionNumber,\n editGeneration: 0,\n creator: { id: creatorId },\n createdAt: new Date(),\n frozenAt: null,\n contentHash: null,\n activityInstanceId: null\n })\n )\n await saveLines(manager, domainId, recipe.id, saved.id, inputs, outputs)\n return revision(manager, domainId, saved.id)\n}\n\nexport async function editRecipeDraft(\n manager: EntityManager,\n domainId: string,\n actorId: string,\n revisionId: string,\n expectedEditGeneration: number,\n input: RecipeDraftContent\n) {\n transaction(manager)\n const accepted = readRecipeContent(input)\n const initial = await revision(manager, domainId, revisionId, false)\n const recipe = await lockSubject(manager, domainId, initial.recipeId)\n const draft = await revision(manager, domainId, revisionId)\n if (draft.creatorId !== actorId) refuse('DRAFT_NOT_OWNED')\n if (draft.frozenAt) refuse('REVISION_FROZEN')\n if (draft.baseGeneration !== recipe.planGeneration) refuse('PLAN_CONFLICT')\n // Moving the effective date across a scheduled boundary changes the before-image.\n const baseRevisionId =\n recipe.planGeneration > 0\n ? (await resolveRecipe(manager, domainId, recipe.id, accepted.effectiveFrom)).revision.id\n : null\n const { inputs, outputs, ...header } = accepted\n const updated = await manager\n .createQueryBuilder()\n .update(RecipeRevision)\n .set({\n ...header,\n ...await headerReferences(manager, domainId, accepted),\n baseRevision: baseRevisionId ? { id: baseRevisionId } : null,\n editGeneration: expectedEditGeneration + 1\n })\n .where({\n id: revisionId,\n domain: { id: domainId },\n creator: { id: actorId },\n editGeneration: expectedEditGeneration\n })\n .andWhere('frozen_at IS NULL')\n .execute()\n if (updated.affected !== 1) refuse('DRAFT_CONFLICT')\n await manager.delete(RecipeRevisionInput, { revision: { id: revisionId }, domain: { id: domainId } })\n await manager.delete(RecipeRevisionOutput, { revision: { id: revisionId }, domain: { id: domainId } })\n await saveLines(manager, domainId, recipe.id, revisionId, inputs, outputs)\n return revision(manager, domainId, revisionId)\n}\n\n/** Product calls this in the same transaction as issuing its worklist approval. */\nexport async function freezeRecipeDraft(\n manager: EntityManager,\n domainId: string,\n actorId: string,\n revisionId: string,\n expectedEditGeneration: number\n) {\n const initial = await revision(manager, domainId, revisionId, false)\n const recipe = await lockSubject(manager, domainId, initial.recipeId)\n const draft = await revision(manager, domainId, revisionId)\n if (draft.creatorId !== actorId) refuse('DRAFT_NOT_OWNED')\n if (draft.frozenAt) refuse('REVISION_FROZEN')\n if (draft.editGeneration !== expectedEditGeneration) refuse('DRAFT_CONFLICT')\n if (draft.baseGeneration !== recipe.planGeneration) refuse('PLAN_CONFLICT')\n const policy = await masterChangePolicy(manager, domainId, 'recipeDefinition')\n if (draft.policyId !== policy.id) refuse('PLAN_CONFLICT')\n readRecipeContent(draft)\n const contentHash = recipeSubmissionHash(draft)\n await manager.update(\n RecipeRevision,\n { id: revisionId, domain: { id: domainId } },\n { frozenAt: new Date(), contentHash }\n )\n return revision(manager, domainId, revisionId)\n}\n\nexport async function bindRecipeApproval(\n manager: EntityManager,\n domainId: string,\n revisionId: string,\n activityInstanceId: string\n) {\n transaction(manager)\n const initial = await revision(manager, domainId, revisionId, false)\n await lockSubject(manager, domainId, initial.recipeId)\n const draft = await revision(manager, domainId, revisionId)\n if (!draft.frozenAt || draft.activityInstanceId) refuse('INVALID_SUBMISSION')\n await manager.update(\n RecipeRevision,\n { id: revisionId, domain: { id: domainId } },\n { activityInstanceId: text(activityInstanceId, 'activityInstanceId') }\n )\n}\n\n/** Internal completion callback only. Never expose this as an approved=true mutation. */\nexport async function publishRecipeRevision(\n manager: EntityManager,\n domainId: string,\n revisionId: string,\n decision: { activityInstanceId: string; approverId: string; submissionHash: string }\n) {\n return publishRevision(manager, domainId, revisionId, {\n kind: 'approved',\n activityInstanceId: decision.activityInstanceId,\n actorId: decision.approverId,\n submissionHash: decision.submissionHash\n })\n}\n\nexport async function publishUnregulatedRecipe(\n manager: EntityManager,\n domainId: string,\n actorId: string,\n revisionId: string,\n editGeneration: number\n) {\n transaction(manager)\n const initial = await revision(manager, domainId, revisionId, false)\n await lockSubject(manager, domainId, initial.recipeId)\n const policy = await masterChangePolicy(manager, domainId, 'recipeDefinition')\n if (policy.approvalRequired)\n throw new Refusal('MASTER_APPROVAL_REQUIRED', {}, 'This change requires product approval.')\n const prior = await manager.findOneBy(RecipePlan, {\n domain: { id: domainId },\n publishedRevision: { id: revisionId },\n releaseKind: 'policy'\n })\n if (prior) {\n if (prior.publisherId !== actorId) refuse('DRAFT_NOT_OWNED')\n return prior\n }\n const frozen = await freezeRecipeDraft(manager, domainId, actorId, revisionId, editGeneration)\n return publishRevision(manager, domainId, revisionId, { kind: 'policy', actorId, submissionHash: frozen.contentHash })\n}\n\nasync function publishRevision(\n manager: EntityManager,\n domainId: string,\n revisionId: string,\n decision: { kind: 'approved' | 'policy'; activityInstanceId?: string; actorId: string; submissionHash: string }\n) {\n const initial = await revision(manager, domainId, revisionId, false)\n const recipe = await lockSubject(manager, domainId, initial.recipeId)\n const draft = await revision(manager, domainId, revisionId)\n if (\n !draft.frozenAt ||\n (decision.kind === 'approved'\n ? draft.activityInstanceId !== decision.activityInstanceId\n : !!draft.activityInstanceId) ||\n draft.contentHash !== decision.submissionHash ||\n recipeSubmissionHash(draft) !== decision.submissionHash\n )\n refuse('INVALID_SUBMISSION')\n const policy = await masterChangePolicy(manager, domainId, 'recipeDefinition')\n if (draft.policyId !== policy.id) refuse('PLAN_CONFLICT')\n if (policy.approvalRequired !== (decision.kind === 'approved'))\n throw new Refusal('MASTER_APPROVAL_POLICY_MISMATCH', {}, 'Use the publication path required by the domain policy.')\n if (decision.kind === 'approved' && draft.creatorId === decision.actorId) refuse('AUTHOR_CANNOT_APPROVE')\n text(decision.actorId, 'publisher')\n const previousDecision = await manager.findOne(RecipePlan, {\n where: { domain: { id: domainId }, publishedRevision: { id: revisionId } },\n ...currentLock(manager)\n })\n if (previousDecision) return previousDecision\n if (draft.baseGeneration !== recipe.planGeneration) refuse('PLAN_CONFLICT')\n // Only replacement from effectiveFrom onward is supported in this slice, not arbitrary rescheduling.\n if (\n await manager.findOne(RecipeBasis, {\n where: { domain: { id: domainId }, recipe: { id: recipe.id }, businessTime: MoreThanOrEqual(draft.effectiveFrom) },\n ...currentLock(manager)\n })\n )\n refuse('RETROACTIVE_IMPACT')\n const oldPlan = await manager.findOne(RecipePlan, {\n where: { domain: { id: domainId }, recipe: { id: recipe.id }, generation: recipe.planGeneration },\n ...currentLock(manager)\n })\n if (recipe.planGeneration > 0 && !oldPlan) refuse('PLAN_CONFLICT')\n const oldSegments = oldPlan\n ? await manager.find(RecipeSegment, {\n where: { domain: { id: domainId }, recipe: { id: recipe.id }, plan: { id: oldPlan.id } },\n order: { validFrom: 'ASC' },\n ...currentLock(manager)\n })\n : []\n // Do not silently erase an already approved future appointment.\n if (oldSegments.some(segment => segment.validFrom >= draft.effectiveFrom)) refuse('FUTURE_PLAN_CONFLICT')\n const recordedAt = new Date()\n const plan = await manager.save(\n RecipePlan,\n manager.create(RecipePlan, {\n domain: { id: domainId },\n recipe: { id: recipe.id },\n generation: recipe.planGeneration + 1,\n recordedAt,\n activityInstanceId: decision.activityInstanceId ?? null,\n submissionHash: decision.submissionHash,\n approver: decision.kind === 'approved' ? { id: decision.actorId } : null,\n publisher: { id: decision.actorId },\n releaseKind: decision.kind,\n publishedRevision: { id: revisionId },\n policy: { id: policy.id }\n })\n )\n for (const old of oldSegments) {\n await manager.save(\n RecipeSegment,\n manager.create(RecipeSegment, {\n domain: { id: domainId },\n recipe: { id: recipe.id },\n plan: { id: plan.id },\n revision: { id: old.revisionId },\n validFrom: old.validFrom,\n validTo: !old.validTo || old.validTo > draft.effectiveFrom ? draft.effectiveFrom : old.validTo\n })\n )\n }\n await manager.save(\n RecipeSegment,\n manager.create(RecipeSegment, {\n domain: { id: domainId },\n recipe: { id: recipe.id },\n plan: { id: plan.id },\n revision: { id: revisionId },\n validFrom: draft.effectiveFrom,\n validTo: null\n })\n )\n const advanced = await manager.update(\n RecipeDefinition,\n { id: recipe.id, domain: { id: domainId }, planGeneration: recipe.planGeneration },\n { planGeneration: plan.generation }\n )\n if (advanced.affected !== 1) refuse('PLAN_CONFLICT')\n return plan\n}\n\nexport async function resolveRecipe(\n manager: EntityManager,\n domainId: string,\n recipeId: string,\n businessTime: Date | string,\n knownAt: Date | string = new Date()\n) {\n const at = instant(businessTime)\n const known = instant(knownAt)\n const plan = await manager.findOne(RecipePlan, {\n where: { domain: { id: domainId }, recipe: { id: recipeId }, recordedAt: LessThanOrEqual(known) },\n order: { generation: 'DESC' },\n ...currentLock(manager)\n })\n if (!plan) refuse('NO_EFFECTIVE_REVISION')\n await subject(manager, domainId, recipeId)\n const query = manager\n .createQueryBuilder(RecipeSegment, 'segment')\n .where({ domain: { id: domainId }, recipe: { id: recipeId }, plan: { id: plan.id } })\n .andWhere('segment.validFrom <= :at', { at })\n .andWhere('(segment.validTo IS NULL OR segment.validTo > :at)', { at })\n if (currentLock(manager).lock) query.setLock('pessimistic_write')\n const segments = await query.getMany()\n if (segments.length !== 1) refuse(segments.length ? 'AMBIGUOUS_EFFECTIVITY' : 'NO_EFFECTIVE_REVISION')\n const selected = await revision(manager, domainId, segments[0].revisionId)\n if (!selected.frozenAt || selected.contentHash !== recipeSubmissionHash(selected))\n refuse('REVISION_INTEGRITY_FAILURE')\n return { revision: selected, plan, segment: segments[0] }\n}\n\n/** Replay reads verify the captured digest too, not only the currently effective schedule. */\nexport async function recipeRevisionForBasis(manager: EntityManager, domainId: string, basis: RecipeBasis) {\n if (basis.domainId !== domainId) refuse('BASIS_CONFLICT')\n const selected = await revision(manager, domainId, basis.revisionId)\n if (selected.recipeId !== basis.recipeId || !selected.frozenAt || selected.contentHash !== basis.contentHash || recipeSubmissionHash(selected) !== basis.contentHash) {\n refuse('REVISION_INTEGRITY_FAILURE')\n }\n if (selected.routeDefinitionId ? (\n basis.routeSnapshot?.id !== selected.routeDefinitionId ||\n basis.routeHash !== createHash('sha256').update(canonical(basis.routeSnapshot)).digest('hex')\n ) : (basis.routeSnapshot !== null || basis.routeHash !== null)) refuse('REVISION_INTEGRITY_FAILURE')\n return selected\n}\n\n/** Must run inside the transaction that writes the execution result. */\nexport async function captureRecipeBasis(\n manager: EntityManager,\n domainId: string,\n recipeId: string,\n recordKey: string,\n businessTime: Date | string\n) {\n const at = instant(businessTime)\n await lockSubject(manager, domainId, recipeId)\n const existing = await manager.findOne(RecipeBasis, {\n where: { domain: { id: domainId }, recordKey },\n ...currentLock(manager)\n })\n if (existing) {\n if (existing.recipeId !== recipeId || existing.businessTime.getTime() !== at.getTime()) refuse('BASIS_CONFLICT')\n await recipeRevisionForBasis(manager, domainId, existing)\n return existing\n }\n const resolvedAt = new Date()\n const selected = await resolveRecipe(manager, domainId, recipeId, at, resolvedAt)\n const route = selected.revision.routeDefinitionId ? await manager.findOne(RouteDefinition, {\n where: { id: selected.revision.routeDefinitionId, domain: { id: domainId } }, ...currentLock(manager)\n }) : null\n if (selected.revision.routeDefinitionId && (!route ||\n (route.effectiveStart && route.effectiveStart > at) || (route.effectiveEnd && route.effectiveEnd <= at)))\n refuse('INVALID_RECIPE_REFERENCE', 'The referenced route is not effective at execution time.')\n if (selected.revision.inputs.some(line => line.operation && !route?.steps.includes(line.operation)))\n refuse('INVALID_RECIPE_REFERENCE', 'The current route no longer contains a required input operation.')\n const routeSnapshot = route ? {\n id: route.id, name: route.name, steps: route.steps, procedure: route.procedure ?? null\n } : null\n const saved = await manager.save(\n RecipeBasis,\n manager.create(RecipeBasis, {\n domain: { id: domainId },\n recipe: { id: recipeId },\n recordKey: text(recordKey, 'recordKey'),\n businessTime: at,\n resolvedAt,\n routeSnapshot,\n routeHash: routeSnapshot ? createHash('sha256').update(canonical(routeSnapshot)).digest('hex') : null,\n revision: { id: selected.revision.id },\n contentHash: selected.revision.contentHash,\n plan: { id: selected.plan.id }\n })\n )\n return manager.findOneByOrFail(RecipeBasis, { id: saved.id, domain: { id: domainId } })\n}\n\nexport async function recipeRevisionOverview(\n manager: EntityManager,\n domainId: string,\n recipeId: string,\n at = new Date()\n) {\n const recipe = await subject(manager, domainId, recipeId)\n const revisions = await manager.find(RecipeRevision, {\n where: { domain: { id: domainId }, recipe: { id: recipeId } },\n relations: { inputs: true, outputs: true },\n order: { createdAt: 'ASC', id: 'ASC' }\n })\n const plan = await manager.findOne(RecipePlan, {\n where: { domain: { id: domainId }, recipe: { id: recipeId }, generation: recipe.planGeneration }\n })\n const schedule = plan\n ? await manager.find(RecipeSegment, {\n where: { domain: { id: domainId }, recipe: { id: recipeId }, plan: { id: plan.id } },\n order: { validFrom: 'ASC' }\n })\n : []\n return {\n recipeId,\n name: recipe.name,\n generation: recipe.planGeneration,\n at: at.toISOString(),\n schedule: schedule.map(segment => ({\n ...segment,\n state: segment.validFrom > at ? 'scheduled' : segment.validTo && segment.validTo <= at ? 'expired' : 'current'\n })),\n revisions: revisions.map(item => ({ ...item,\n inputs: item.inputs.sort((a, b) => a.position - b.position),\n outputs: item.outputs.sort((a, b) => a.position - b.position),\n state: item.frozenAt ? 'frozen' : 'draft' }))\n }\n}\n\n/** Read-time projection, never a clock-driven rewrite of the identity row. */\nexport async function effectiveRecipe(\n manager: EntityManager,\n domainId: string,\n recipe: RecipeDefinition,\n at = new Date()\n) {\n const selected = await resolveRecipe(manager, domainId, recipe.id, at)\n return Object.assign(new RecipeDefinition(), recipe, {\n description: selected.revision.description,\n ...recipeContentValues(selected.revision),\n effectiveStart: selected.segment.validFrom,\n effectiveEnd: selected.segment.validTo ?? undefined\n })\n}\n"]}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { Domain } from '@things-factory/shell';
|
|
2
|
+
import { User } from '@things-factory/auth-base';
|
|
3
|
+
import type { RecipeDefinition } from './recipe-definition';
|
|
4
|
+
import { MasterChangePolicy } from '../master-change-policy';
|
|
5
|
+
import { RecipeRevisionInput, RecipeRevisionOutput } from './recipe-revision-line';
|
|
6
|
+
import type { MaterialDefinition } from '../material/material-definition';
|
|
7
|
+
import type { RouteDefinition } from './route-definition';
|
|
8
|
+
/** Content and the proposed effective date freeze together. Worklist owns the decision. */
|
|
9
|
+
export declare class RecipeRevision {
|
|
10
|
+
/** Human revision number within one identity; assigned once under the subject write lock. */
|
|
11
|
+
revisionNumber: number;
|
|
12
|
+
policy: MasterChangePolicy;
|
|
13
|
+
policyId: string;
|
|
14
|
+
id: string;
|
|
15
|
+
domain: Domain;
|
|
16
|
+
domainId: string;
|
|
17
|
+
recipe: RecipeDefinition;
|
|
18
|
+
recipeId: string;
|
|
19
|
+
baseRevision: RecipeRevision | null;
|
|
20
|
+
baseRevisionId: string | null;
|
|
21
|
+
baseGeneration: number;
|
|
22
|
+
editGeneration: number;
|
|
23
|
+
description: string | null;
|
|
24
|
+
materialDefinitionName: string;
|
|
25
|
+
primaryMaterial: MaterialDefinition;
|
|
26
|
+
primaryMaterialId: string;
|
|
27
|
+
routeDefinition: RouteDefinition | null;
|
|
28
|
+
routeDefinitionId: string | null;
|
|
29
|
+
route: string | null;
|
|
30
|
+
inputs: RecipeRevisionInput[];
|
|
31
|
+
outputs: RecipeRevisionOutput[];
|
|
32
|
+
effectiveFrom: Date;
|
|
33
|
+
reason: string;
|
|
34
|
+
creator: User;
|
|
35
|
+
creatorId: string;
|
|
36
|
+
createdAt: Date;
|
|
37
|
+
frozenAt: Date | null;
|
|
38
|
+
contentHash: string | null;
|
|
39
|
+
/** Opaque product decision ID: the common master module does not depend on worklist. */
|
|
40
|
+
activityInstanceId: string | null;
|
|
41
|
+
}
|
|
42
|
+
/** An append-only generation of the complete schedule for one recipe. */
|
|
43
|
+
export declare class RecipePlan {
|
|
44
|
+
policy: MasterChangePolicy;
|
|
45
|
+
policyId: string;
|
|
46
|
+
publishedRevision: RecipeRevision;
|
|
47
|
+
publishedRevisionId: string;
|
|
48
|
+
releaseKind: 'approved' | 'policy';
|
|
49
|
+
publisher: User;
|
|
50
|
+
publisherId: string;
|
|
51
|
+
id: string;
|
|
52
|
+
domain: Domain;
|
|
53
|
+
domainId: string;
|
|
54
|
+
recipe: RecipeDefinition;
|
|
55
|
+
recipeId: string;
|
|
56
|
+
generation: number;
|
|
57
|
+
recordedAt: Date;
|
|
58
|
+
activityInstanceId: string | null;
|
|
59
|
+
approver: User;
|
|
60
|
+
approverId: string;
|
|
61
|
+
submissionHash: string;
|
|
62
|
+
}
|
|
63
|
+
export declare class RecipeSegment {
|
|
64
|
+
id: string;
|
|
65
|
+
domain: Domain;
|
|
66
|
+
domainId: string;
|
|
67
|
+
recipe: RecipeDefinition;
|
|
68
|
+
recipeId: string;
|
|
69
|
+
plan: RecipePlan;
|
|
70
|
+
planId: string;
|
|
71
|
+
revision: RecipeRevision;
|
|
72
|
+
revisionId: string;
|
|
73
|
+
validFrom: Date;
|
|
74
|
+
validTo: Date | null;
|
|
75
|
+
}
|
|
76
|
+
/** Permanent evidence of the selected revision, also the retroactivity interlock. */
|
|
77
|
+
export declare class RecipeBasis {
|
|
78
|
+
/** Execution snapshot of an independently owned route; not a route master revision. */
|
|
79
|
+
routeSnapshot: {
|
|
80
|
+
id: string;
|
|
81
|
+
name: string;
|
|
82
|
+
steps: string[];
|
|
83
|
+
procedure: Record<string, unknown>[] | null;
|
|
84
|
+
} | null;
|
|
85
|
+
routeHash: string | null;
|
|
86
|
+
id: string;
|
|
87
|
+
domain: Domain;
|
|
88
|
+
domainId: string;
|
|
89
|
+
recipe: RecipeDefinition;
|
|
90
|
+
recipeId: string;
|
|
91
|
+
recordKey: string;
|
|
92
|
+
revision: RecipeRevision;
|
|
93
|
+
revisionId: string;
|
|
94
|
+
plan: RecipePlan;
|
|
95
|
+
planId: string;
|
|
96
|
+
contentHash: string;
|
|
97
|
+
businessTime: Date;
|
|
98
|
+
resolvedAt: Date;
|
|
99
|
+
}
|
|
100
|
+
export declare const RECIPE_REVISION_ENTITIES: (typeof RecipeRevisionOutput | typeof RecipeRevision | typeof RecipePlan | typeof RecipeSegment | typeof RecipeBasis)[];
|
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RECIPE_REVISION_ENTITIES = exports.RecipeBasis = exports.RecipeSegment = exports.RecipePlan = exports.RecipeRevision = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const shell_1 = require("@things-factory/shell");
|
|
7
|
+
const auth_base_1 = require("@things-factory/auth-base");
|
|
8
|
+
const master_change_policy_1 = require("../master-change-policy");
|
|
9
|
+
const recipe_revision_line_1 = require("./recipe-revision-line");
|
|
10
|
+
const typeorm_2 = require("typeorm");
|
|
11
|
+
// Relations own the columns and RelationId exposes read-only identifiers.
|
|
12
|
+
// Where a composite FK is declared, disable only the redundant single-column FK;
|
|
13
|
+
// the database still enforces existence, domain and recipe together.
|
|
14
|
+
/** Content and the proposed effective date freeze together. Worklist owns the decision. */
|
|
15
|
+
let RecipeRevision = class RecipeRevision {
|
|
16
|
+
};
|
|
17
|
+
exports.RecipeRevision = RecipeRevision;
|
|
18
|
+
tslib_1.__decorate([
|
|
19
|
+
(0, typeorm_1.Column)('int'),
|
|
20
|
+
tslib_1.__metadata("design:type", Number)
|
|
21
|
+
], RecipeRevision.prototype, "revisionNumber", void 0);
|
|
22
|
+
tslib_1.__decorate([
|
|
23
|
+
(0, typeorm_1.ManyToOne)(() => master_change_policy_1.MasterChangePolicy, { nullable: false, createForeignKeyConstraints: false }),
|
|
24
|
+
tslib_1.__metadata("design:type", master_change_policy_1.MasterChangePolicy)
|
|
25
|
+
], RecipeRevision.prototype, "policy", void 0);
|
|
26
|
+
tslib_1.__decorate([
|
|
27
|
+
(0, typeorm_1.RelationId)((row) => row.policy),
|
|
28
|
+
tslib_1.__metadata("design:type", String)
|
|
29
|
+
], RecipeRevision.prototype, "policyId", void 0);
|
|
30
|
+
tslib_1.__decorate([
|
|
31
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
32
|
+
tslib_1.__metadata("design:type", String)
|
|
33
|
+
], RecipeRevision.prototype, "id", void 0);
|
|
34
|
+
tslib_1.__decorate([
|
|
35
|
+
(0, typeorm_1.ManyToOne)(() => shell_1.Domain, { nullable: false }),
|
|
36
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
37
|
+
], RecipeRevision.prototype, "domain", void 0);
|
|
38
|
+
tslib_1.__decorate([
|
|
39
|
+
(0, typeorm_1.RelationId)((row) => row.domain),
|
|
40
|
+
tslib_1.__metadata("design:type", String)
|
|
41
|
+
], RecipeRevision.prototype, "domainId", void 0);
|
|
42
|
+
tslib_1.__decorate([
|
|
43
|
+
(0, typeorm_1.ManyToOne)('RecipeDefinition', { nullable: false, createForeignKeyConstraints: false }),
|
|
44
|
+
tslib_1.__metadata("design:type", Function)
|
|
45
|
+
], RecipeRevision.prototype, "recipe", void 0);
|
|
46
|
+
tslib_1.__decorate([
|
|
47
|
+
(0, typeorm_1.RelationId)((row) => row.recipe),
|
|
48
|
+
tslib_1.__metadata("design:type", String)
|
|
49
|
+
], RecipeRevision.prototype, "recipeId", void 0);
|
|
50
|
+
tslib_1.__decorate([
|
|
51
|
+
(0, typeorm_1.ManyToOne)(() => RecipeRevision, { nullable: true, createForeignKeyConstraints: false }),
|
|
52
|
+
tslib_1.__metadata("design:type", RecipeRevision)
|
|
53
|
+
], RecipeRevision.prototype, "baseRevision", void 0);
|
|
54
|
+
tslib_1.__decorate([
|
|
55
|
+
(0, typeorm_1.RelationId)((row) => row.baseRevision),
|
|
56
|
+
tslib_1.__metadata("design:type", String)
|
|
57
|
+
], RecipeRevision.prototype, "baseRevisionId", void 0);
|
|
58
|
+
tslib_1.__decorate([
|
|
59
|
+
(0, typeorm_1.Column)('int'),
|
|
60
|
+
tslib_1.__metadata("design:type", Number)
|
|
61
|
+
], RecipeRevision.prototype, "baseGeneration", void 0);
|
|
62
|
+
tslib_1.__decorate([
|
|
63
|
+
(0, typeorm_1.Column)('int', { default: 0 }),
|
|
64
|
+
tslib_1.__metadata("design:type", Number)
|
|
65
|
+
], RecipeRevision.prototype, "editGeneration", void 0);
|
|
66
|
+
tslib_1.__decorate([
|
|
67
|
+
(0, typeorm_1.Column)('text', { nullable: true }),
|
|
68
|
+
tslib_1.__metadata("design:type", String)
|
|
69
|
+
], RecipeRevision.prototype, "description", void 0);
|
|
70
|
+
tslib_1.__decorate([
|
|
71
|
+
(0, typeorm_1.Column)('varchar'),
|
|
72
|
+
tslib_1.__metadata("design:type", String)
|
|
73
|
+
], RecipeRevision.prototype, "materialDefinitionName", void 0);
|
|
74
|
+
tslib_1.__decorate([
|
|
75
|
+
(0, typeorm_1.ManyToOne)('MaterialDefinition', { nullable: false, createForeignKeyConstraints: false }),
|
|
76
|
+
tslib_1.__metadata("design:type", Function)
|
|
77
|
+
], RecipeRevision.prototype, "primaryMaterial", void 0);
|
|
78
|
+
tslib_1.__decorate([
|
|
79
|
+
(0, typeorm_1.RelationId)((row) => row.primaryMaterial),
|
|
80
|
+
tslib_1.__metadata("design:type", String)
|
|
81
|
+
], RecipeRevision.prototype, "primaryMaterialId", void 0);
|
|
82
|
+
tslib_1.__decorate([
|
|
83
|
+
(0, typeorm_1.ManyToOne)('RouteDefinition', { nullable: true, createForeignKeyConstraints: false }),
|
|
84
|
+
tslib_1.__metadata("design:type", Function)
|
|
85
|
+
], RecipeRevision.prototype, "routeDefinition", void 0);
|
|
86
|
+
tslib_1.__decorate([
|
|
87
|
+
(0, typeorm_1.RelationId)((row) => row.routeDefinition),
|
|
88
|
+
tslib_1.__metadata("design:type", String)
|
|
89
|
+
], RecipeRevision.prototype, "routeDefinitionId", void 0);
|
|
90
|
+
tslib_1.__decorate([
|
|
91
|
+
(0, typeorm_1.Column)('varchar', { nullable: true }),
|
|
92
|
+
tslib_1.__metadata("design:type", String)
|
|
93
|
+
], RecipeRevision.prototype, "route", void 0);
|
|
94
|
+
tslib_1.__decorate([
|
|
95
|
+
(0, typeorm_2.OneToMany)(() => recipe_revision_line_1.RecipeRevisionInput, line => line.revision),
|
|
96
|
+
tslib_1.__metadata("design:type", Array)
|
|
97
|
+
], RecipeRevision.prototype, "inputs", void 0);
|
|
98
|
+
tslib_1.__decorate([
|
|
99
|
+
(0, typeorm_2.OneToMany)(() => recipe_revision_line_1.RecipeRevisionOutput, line => line.revision),
|
|
100
|
+
tslib_1.__metadata("design:type", Array)
|
|
101
|
+
], RecipeRevision.prototype, "outputs", void 0);
|
|
102
|
+
tslib_1.__decorate([
|
|
103
|
+
(0, typeorm_1.Column)({ type: Date }),
|
|
104
|
+
tslib_1.__metadata("design:type", Date)
|
|
105
|
+
], RecipeRevision.prototype, "effectiveFrom", void 0);
|
|
106
|
+
tslib_1.__decorate([
|
|
107
|
+
(0, typeorm_1.Column)('text'),
|
|
108
|
+
tslib_1.__metadata("design:type", String)
|
|
109
|
+
], RecipeRevision.prototype, "reason", void 0);
|
|
110
|
+
tslib_1.__decorate([
|
|
111
|
+
(0, typeorm_1.ManyToOne)(() => auth_base_1.User, { nullable: false }),
|
|
112
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
113
|
+
], RecipeRevision.prototype, "creator", void 0);
|
|
114
|
+
tslib_1.__decorate([
|
|
115
|
+
(0, typeorm_1.RelationId)((row) => row.creator),
|
|
116
|
+
tslib_1.__metadata("design:type", String)
|
|
117
|
+
], RecipeRevision.prototype, "creatorId", void 0);
|
|
118
|
+
tslib_1.__decorate([
|
|
119
|
+
(0, typeorm_1.Column)({ type: Date }),
|
|
120
|
+
tslib_1.__metadata("design:type", Date)
|
|
121
|
+
], RecipeRevision.prototype, "createdAt", void 0);
|
|
122
|
+
tslib_1.__decorate([
|
|
123
|
+
(0, typeorm_1.Column)({ type: Date, nullable: true }),
|
|
124
|
+
tslib_1.__metadata("design:type", Date)
|
|
125
|
+
], RecipeRevision.prototype, "frozenAt", void 0);
|
|
126
|
+
tslib_1.__decorate([
|
|
127
|
+
(0, typeorm_1.Column)('varchar', { nullable: true }),
|
|
128
|
+
tslib_1.__metadata("design:type", String)
|
|
129
|
+
], RecipeRevision.prototype, "contentHash", void 0);
|
|
130
|
+
tslib_1.__decorate([
|
|
131
|
+
(0, typeorm_1.Column)('varchar', { nullable: true }),
|
|
132
|
+
tslib_1.__metadata("design:type", String)
|
|
133
|
+
], RecipeRevision.prototype, "activityInstanceId", void 0);
|
|
134
|
+
exports.RecipeRevision = RecipeRevision = tslib_1.__decorate([
|
|
135
|
+
(0, typeorm_1.Entity)('ops_recipe_revision'),
|
|
136
|
+
(0, typeorm_1.Index)('ix_recipe_revision_subject', ['domain', 'recipe', 'id'], { unique: true }),
|
|
137
|
+
(0, typeorm_1.Index)('ix_recipe_revision_list', ['domain', 'recipe', 'createdAt']),
|
|
138
|
+
(0, typeorm_1.ForeignKey)('MaterialDefinition', ['domain', 'primaryMaterial'], ['domain', 'id'], { onDelete: 'RESTRICT' }),
|
|
139
|
+
(0, typeorm_1.ForeignKey)('RouteDefinition', ['domain', 'routeDefinition'], ['domain', 'id'], { onDelete: 'RESTRICT' }),
|
|
140
|
+
(0, typeorm_1.ForeignKey)(() => master_change_policy_1.MasterChangePolicy, ['domain', 'policy'], ['domain', 'id'], { onDelete: 'RESTRICT' }),
|
|
141
|
+
(0, typeorm_1.ForeignKey)('RecipeDefinition', ['domain', 'recipe'], ['domain', 'id'], { onDelete: 'RESTRICT' }),
|
|
142
|
+
(0, typeorm_1.ForeignKey)('RecipeRevision', ['domain', 'recipe', 'baseRevision'], ['domain', 'recipe', 'id'], {
|
|
143
|
+
onDelete: 'RESTRICT'
|
|
144
|
+
}),
|
|
145
|
+
(0, typeorm_1.Index)('ix_recipe_revision_number', ['domain', 'recipe', 'revisionNumber'], { unique: true })
|
|
146
|
+
], RecipeRevision);
|
|
147
|
+
/** An append-only generation of the complete schedule for one recipe. */
|
|
148
|
+
let RecipePlan = class RecipePlan {
|
|
149
|
+
};
|
|
150
|
+
exports.RecipePlan = RecipePlan;
|
|
151
|
+
tslib_1.__decorate([
|
|
152
|
+
(0, typeorm_1.ManyToOne)(() => master_change_policy_1.MasterChangePolicy, { nullable: false, createForeignKeyConstraints: false }),
|
|
153
|
+
tslib_1.__metadata("design:type", master_change_policy_1.MasterChangePolicy)
|
|
154
|
+
], RecipePlan.prototype, "policy", void 0);
|
|
155
|
+
tslib_1.__decorate([
|
|
156
|
+
(0, typeorm_1.RelationId)((row) => row.policy),
|
|
157
|
+
tslib_1.__metadata("design:type", String)
|
|
158
|
+
], RecipePlan.prototype, "policyId", void 0);
|
|
159
|
+
tslib_1.__decorate([
|
|
160
|
+
(0, typeorm_1.ManyToOne)(() => RecipeRevision, { nullable: false, createForeignKeyConstraints: false }),
|
|
161
|
+
tslib_1.__metadata("design:type", RecipeRevision)
|
|
162
|
+
], RecipePlan.prototype, "publishedRevision", void 0);
|
|
163
|
+
tslib_1.__decorate([
|
|
164
|
+
(0, typeorm_1.RelationId)((row) => row.publishedRevision),
|
|
165
|
+
tslib_1.__metadata("design:type", String)
|
|
166
|
+
], RecipePlan.prototype, "publishedRevisionId", void 0);
|
|
167
|
+
tslib_1.__decorate([
|
|
168
|
+
(0, typeorm_1.Column)('varchar'),
|
|
169
|
+
tslib_1.__metadata("design:type", String)
|
|
170
|
+
], RecipePlan.prototype, "releaseKind", void 0);
|
|
171
|
+
tslib_1.__decorate([
|
|
172
|
+
(0, typeorm_1.ManyToOne)(() => auth_base_1.User, { nullable: false }),
|
|
173
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
174
|
+
], RecipePlan.prototype, "publisher", void 0);
|
|
175
|
+
tslib_1.__decorate([
|
|
176
|
+
(0, typeorm_1.RelationId)((row) => row.publisher),
|
|
177
|
+
tslib_1.__metadata("design:type", String)
|
|
178
|
+
], RecipePlan.prototype, "publisherId", void 0);
|
|
179
|
+
tslib_1.__decorate([
|
|
180
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
181
|
+
tslib_1.__metadata("design:type", String)
|
|
182
|
+
], RecipePlan.prototype, "id", void 0);
|
|
183
|
+
tslib_1.__decorate([
|
|
184
|
+
(0, typeorm_1.ManyToOne)(() => shell_1.Domain, { nullable: false }),
|
|
185
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
186
|
+
], RecipePlan.prototype, "domain", void 0);
|
|
187
|
+
tslib_1.__decorate([
|
|
188
|
+
(0, typeorm_1.RelationId)((row) => row.domain),
|
|
189
|
+
tslib_1.__metadata("design:type", String)
|
|
190
|
+
], RecipePlan.prototype, "domainId", void 0);
|
|
191
|
+
tslib_1.__decorate([
|
|
192
|
+
(0, typeorm_1.ManyToOne)('RecipeDefinition', { nullable: false, createForeignKeyConstraints: false }),
|
|
193
|
+
tslib_1.__metadata("design:type", Function)
|
|
194
|
+
], RecipePlan.prototype, "recipe", void 0);
|
|
195
|
+
tslib_1.__decorate([
|
|
196
|
+
(0, typeorm_1.RelationId)((row) => row.recipe),
|
|
197
|
+
tslib_1.__metadata("design:type", String)
|
|
198
|
+
], RecipePlan.prototype, "recipeId", void 0);
|
|
199
|
+
tslib_1.__decorate([
|
|
200
|
+
(0, typeorm_1.Column)('int'),
|
|
201
|
+
tslib_1.__metadata("design:type", Number)
|
|
202
|
+
], RecipePlan.prototype, "generation", void 0);
|
|
203
|
+
tslib_1.__decorate([
|
|
204
|
+
(0, typeorm_1.Column)({ type: Date }),
|
|
205
|
+
tslib_1.__metadata("design:type", Date)
|
|
206
|
+
], RecipePlan.prototype, "recordedAt", void 0);
|
|
207
|
+
tslib_1.__decorate([
|
|
208
|
+
(0, typeorm_1.Column)('varchar', { nullable: true }),
|
|
209
|
+
tslib_1.__metadata("design:type", String)
|
|
210
|
+
], RecipePlan.prototype, "activityInstanceId", void 0);
|
|
211
|
+
tslib_1.__decorate([
|
|
212
|
+
(0, typeorm_1.ManyToOne)(() => auth_base_1.User, { nullable: true }),
|
|
213
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
214
|
+
], RecipePlan.prototype, "approver", void 0);
|
|
215
|
+
tslib_1.__decorate([
|
|
216
|
+
(0, typeorm_1.RelationId)((row) => row.approver),
|
|
217
|
+
tslib_1.__metadata("design:type", String)
|
|
218
|
+
], RecipePlan.prototype, "approverId", void 0);
|
|
219
|
+
tslib_1.__decorate([
|
|
220
|
+
(0, typeorm_1.Column)('varchar'),
|
|
221
|
+
tslib_1.__metadata("design:type", String)
|
|
222
|
+
], RecipePlan.prototype, "submissionHash", void 0);
|
|
223
|
+
exports.RecipePlan = RecipePlan = tslib_1.__decorate([
|
|
224
|
+
(0, typeorm_1.Entity)('ops_recipe_plan'),
|
|
225
|
+
(0, typeorm_1.Index)('ix_recipe_plan_generation', ['domain', 'recipe', 'generation'], { unique: true }),
|
|
226
|
+
(0, typeorm_1.Index)('ix_recipe_plan_identity', ['domain', 'recipe', 'id'], { unique: true }),
|
|
227
|
+
(0, typeorm_1.Index)('ix_recipe_plan_decision', ['activityInstanceId'], { unique: true }),
|
|
228
|
+
(0, typeorm_1.Index)('ix_recipe_plan_publication', ['publishedRevision'], { unique: true }),
|
|
229
|
+
(0, typeorm_1.ForeignKey)(() => master_change_policy_1.MasterChangePolicy, ['domain', 'policy'], ['domain', 'id'], { onDelete: 'RESTRICT' }),
|
|
230
|
+
(0, typeorm_1.ForeignKey)(() => RecipeRevision, ['domain', 'recipe', 'publishedRevision'], ['domain', 'recipe', 'id'], { onDelete: 'RESTRICT' }),
|
|
231
|
+
(0, typeorm_1.ForeignKey)('RecipeDefinition', ['domain', 'recipe'], ['domain', 'id'], { onDelete: 'RESTRICT' })
|
|
232
|
+
], RecipePlan);
|
|
233
|
+
let RecipeSegment = class RecipeSegment {
|
|
234
|
+
};
|
|
235
|
+
exports.RecipeSegment = RecipeSegment;
|
|
236
|
+
tslib_1.__decorate([
|
|
237
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
238
|
+
tslib_1.__metadata("design:type", String)
|
|
239
|
+
], RecipeSegment.prototype, "id", void 0);
|
|
240
|
+
tslib_1.__decorate([
|
|
241
|
+
(0, typeorm_1.ManyToOne)(() => shell_1.Domain, { nullable: false }),
|
|
242
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
243
|
+
], RecipeSegment.prototype, "domain", void 0);
|
|
244
|
+
tslib_1.__decorate([
|
|
245
|
+
(0, typeorm_1.RelationId)((row) => row.domain),
|
|
246
|
+
tslib_1.__metadata("design:type", String)
|
|
247
|
+
], RecipeSegment.prototype, "domainId", void 0);
|
|
248
|
+
tslib_1.__decorate([
|
|
249
|
+
(0, typeorm_1.ManyToOne)('RecipeDefinition', { nullable: false, createForeignKeyConstraints: false }),
|
|
250
|
+
tslib_1.__metadata("design:type", Function)
|
|
251
|
+
], RecipeSegment.prototype, "recipe", void 0);
|
|
252
|
+
tslib_1.__decorate([
|
|
253
|
+
(0, typeorm_1.RelationId)((row) => row.recipe),
|
|
254
|
+
tslib_1.__metadata("design:type", String)
|
|
255
|
+
], RecipeSegment.prototype, "recipeId", void 0);
|
|
256
|
+
tslib_1.__decorate([
|
|
257
|
+
(0, typeorm_1.ManyToOne)(() => RecipePlan, { nullable: false, createForeignKeyConstraints: false }),
|
|
258
|
+
tslib_1.__metadata("design:type", RecipePlan)
|
|
259
|
+
], RecipeSegment.prototype, "plan", void 0);
|
|
260
|
+
tslib_1.__decorate([
|
|
261
|
+
(0, typeorm_1.RelationId)((row) => row.plan),
|
|
262
|
+
tslib_1.__metadata("design:type", String)
|
|
263
|
+
], RecipeSegment.prototype, "planId", void 0);
|
|
264
|
+
tslib_1.__decorate([
|
|
265
|
+
(0, typeorm_1.ManyToOne)(() => RecipeRevision, { nullable: false, createForeignKeyConstraints: false }),
|
|
266
|
+
tslib_1.__metadata("design:type", RecipeRevision)
|
|
267
|
+
], RecipeSegment.prototype, "revision", void 0);
|
|
268
|
+
tslib_1.__decorate([
|
|
269
|
+
(0, typeorm_1.RelationId)((row) => row.revision),
|
|
270
|
+
tslib_1.__metadata("design:type", String)
|
|
271
|
+
], RecipeSegment.prototype, "revisionId", void 0);
|
|
272
|
+
tslib_1.__decorate([
|
|
273
|
+
(0, typeorm_1.Column)({ type: Date }),
|
|
274
|
+
tslib_1.__metadata("design:type", Date)
|
|
275
|
+
], RecipeSegment.prototype, "validFrom", void 0);
|
|
276
|
+
tslib_1.__decorate([
|
|
277
|
+
(0, typeorm_1.Column)({ type: Date, nullable: true }),
|
|
278
|
+
tslib_1.__metadata("design:type", Date)
|
|
279
|
+
], RecipeSegment.prototype, "validTo", void 0);
|
|
280
|
+
exports.RecipeSegment = RecipeSegment = tslib_1.__decorate([
|
|
281
|
+
(0, typeorm_1.Entity)('ops_recipe_segment'),
|
|
282
|
+
(0, typeorm_1.Index)('ix_recipe_segment_lookup', ['domain', 'recipe', 'plan', 'validFrom']),
|
|
283
|
+
(0, typeorm_1.ForeignKey)('RecipeDefinition', ['domain', 'recipe'], ['domain', 'id'], { onDelete: 'RESTRICT' }),
|
|
284
|
+
(0, typeorm_1.ForeignKey)(() => RecipePlan, ['domain', 'recipe', 'plan'], ['domain', 'recipe', 'id'], { onDelete: 'RESTRICT' }),
|
|
285
|
+
(0, typeorm_1.ForeignKey)(() => RecipeRevision, ['domain', 'recipe', 'revision'], ['domain', 'recipe', 'id'], {
|
|
286
|
+
onDelete: 'RESTRICT'
|
|
287
|
+
})
|
|
288
|
+
], RecipeSegment);
|
|
289
|
+
/** Permanent evidence of the selected revision, also the retroactivity interlock. */
|
|
290
|
+
let RecipeBasis = class RecipeBasis {
|
|
291
|
+
};
|
|
292
|
+
exports.RecipeBasis = RecipeBasis;
|
|
293
|
+
tslib_1.__decorate([
|
|
294
|
+
(0, typeorm_1.Column)('simple-json', { nullable: true }),
|
|
295
|
+
tslib_1.__metadata("design:type", Object)
|
|
296
|
+
], RecipeBasis.prototype, "routeSnapshot", void 0);
|
|
297
|
+
tslib_1.__decorate([
|
|
298
|
+
(0, typeorm_1.Column)('varchar', { nullable: true }),
|
|
299
|
+
tslib_1.__metadata("design:type", String)
|
|
300
|
+
], RecipeBasis.prototype, "routeHash", void 0);
|
|
301
|
+
tslib_1.__decorate([
|
|
302
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
303
|
+
tslib_1.__metadata("design:type", String)
|
|
304
|
+
], RecipeBasis.prototype, "id", void 0);
|
|
305
|
+
tslib_1.__decorate([
|
|
306
|
+
(0, typeorm_1.ManyToOne)(() => shell_1.Domain, { nullable: false }),
|
|
307
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
308
|
+
], RecipeBasis.prototype, "domain", void 0);
|
|
309
|
+
tslib_1.__decorate([
|
|
310
|
+
(0, typeorm_1.RelationId)((row) => row.domain),
|
|
311
|
+
tslib_1.__metadata("design:type", String)
|
|
312
|
+
], RecipeBasis.prototype, "domainId", void 0);
|
|
313
|
+
tslib_1.__decorate([
|
|
314
|
+
(0, typeorm_1.ManyToOne)('RecipeDefinition', { nullable: false, createForeignKeyConstraints: false }),
|
|
315
|
+
tslib_1.__metadata("design:type", Function)
|
|
316
|
+
], RecipeBasis.prototype, "recipe", void 0);
|
|
317
|
+
tslib_1.__decorate([
|
|
318
|
+
(0, typeorm_1.RelationId)((row) => row.recipe),
|
|
319
|
+
tslib_1.__metadata("design:type", String)
|
|
320
|
+
], RecipeBasis.prototype, "recipeId", void 0);
|
|
321
|
+
tslib_1.__decorate([
|
|
322
|
+
(0, typeorm_1.Column)('varchar'),
|
|
323
|
+
tslib_1.__metadata("design:type", String)
|
|
324
|
+
], RecipeBasis.prototype, "recordKey", void 0);
|
|
325
|
+
tslib_1.__decorate([
|
|
326
|
+
(0, typeorm_1.ManyToOne)(() => RecipeRevision, { nullable: false, createForeignKeyConstraints: false }),
|
|
327
|
+
tslib_1.__metadata("design:type", RecipeRevision)
|
|
328
|
+
], RecipeBasis.prototype, "revision", void 0);
|
|
329
|
+
tslib_1.__decorate([
|
|
330
|
+
(0, typeorm_1.RelationId)((row) => row.revision),
|
|
331
|
+
tslib_1.__metadata("design:type", String)
|
|
332
|
+
], RecipeBasis.prototype, "revisionId", void 0);
|
|
333
|
+
tslib_1.__decorate([
|
|
334
|
+
(0, typeorm_1.ManyToOne)(() => RecipePlan, { nullable: false, createForeignKeyConstraints: false }),
|
|
335
|
+
tslib_1.__metadata("design:type", RecipePlan)
|
|
336
|
+
], RecipeBasis.prototype, "plan", void 0);
|
|
337
|
+
tslib_1.__decorate([
|
|
338
|
+
(0, typeorm_1.RelationId)((row) => row.plan),
|
|
339
|
+
tslib_1.__metadata("design:type", String)
|
|
340
|
+
], RecipeBasis.prototype, "planId", void 0);
|
|
341
|
+
tslib_1.__decorate([
|
|
342
|
+
(0, typeorm_1.Column)('varchar'),
|
|
343
|
+
tslib_1.__metadata("design:type", String)
|
|
344
|
+
], RecipeBasis.prototype, "contentHash", void 0);
|
|
345
|
+
tslib_1.__decorate([
|
|
346
|
+
(0, typeorm_1.Column)({ type: Date }),
|
|
347
|
+
tslib_1.__metadata("design:type", Date)
|
|
348
|
+
], RecipeBasis.prototype, "businessTime", void 0);
|
|
349
|
+
tslib_1.__decorate([
|
|
350
|
+
(0, typeorm_1.Column)({ type: Date }),
|
|
351
|
+
tslib_1.__metadata("design:type", Date)
|
|
352
|
+
], RecipeBasis.prototype, "resolvedAt", void 0);
|
|
353
|
+
exports.RecipeBasis = RecipeBasis = tslib_1.__decorate([
|
|
354
|
+
(0, typeorm_1.Entity)('ops_recipe_basis'),
|
|
355
|
+
(0, typeorm_1.Index)('ix_recipe_basis_domain_id', ['domain', 'id'], { unique: true }),
|
|
356
|
+
(0, typeorm_1.Index)('ix_recipe_basis_identity', ['domain', 'id', 'revision'], { unique: true }),
|
|
357
|
+
(0, typeorm_1.Index)('ix_recipe_basis_record', ['domain', 'recordKey'], { unique: true }),
|
|
358
|
+
(0, typeorm_1.Index)('ix_recipe_basis_time', ['domain', 'recipe', 'businessTime']),
|
|
359
|
+
(0, typeorm_1.ForeignKey)('RecipeDefinition', ['domain', 'recipe'], ['domain', 'id'], { onDelete: 'RESTRICT' }),
|
|
360
|
+
(0, typeorm_1.ForeignKey)(() => RecipePlan, ['domain', 'recipe', 'plan'], ['domain', 'recipe', 'id'], { onDelete: 'RESTRICT' }),
|
|
361
|
+
(0, typeorm_1.ForeignKey)(() => RecipeRevision, ['domain', 'recipe', 'revision'], ['domain', 'recipe', 'id'], {
|
|
362
|
+
onDelete: 'RESTRICT'
|
|
363
|
+
})
|
|
364
|
+
], RecipeBasis);
|
|
365
|
+
exports.RECIPE_REVISION_ENTITIES = [
|
|
366
|
+
RecipeRevision,
|
|
367
|
+
RecipePlan,
|
|
368
|
+
RecipeSegment,
|
|
369
|
+
RecipeBasis,
|
|
370
|
+
recipe_revision_line_1.RecipeRevisionInput,
|
|
371
|
+
recipe_revision_line_1.RecipeRevisionOutput
|
|
372
|
+
];
|
|
373
|
+
//# sourceMappingURL=recipe-revision.js.map
|