Coflyr · Backend model field catalog
WorkTemplateItem
Maintenance.WorkTemplateItems.
Every mapped scalar field appears once. Types and nullability come from the current EF model snapshot. Navigation properties and unmapped DTO fields are outside this page. Purpose text is inferred from names and should be checked against the feature workflow.
Reviewed changes
- 2026-10-10 HTML decision: WorkTemplateItem marked Dropped; use WorkStep TemplateStep rows with WorkTemplateMasterId foreign key and structured demand children. Actual backend class and table remain pending complete review.
← All model classes · AMOS Workpackage example
Dropped · merge into WorkStep. Define template instructions using TemplateStep-role WorkStep rows with WorkTemplateMasterId. The original field inventory is retained below. Backend/database adoption is pending complete review. Review the replacement design.
Identity and naming
2 fields| # | Field | EF type | Storage | Business purpose | Review |
|---|---|---|---|---|---|
| 1 | Id | Guid | Required | Merge into the shared WorkStep.Id. Preserve stable row identity or an explicit identity mapping if IDs collide. Replacement: Id. Backend/database adoption pending complete review. | Merged To WorkStep.Id · pending |
| 2 | Title | string | Required | Merge into the shared WorkStep.ActionTitle. Required title on each TemplateStep row; preserve the existing item title capacity. Replacement: ActionTitle. Backend/database adoption pending complete review. | Merged To WorkStep.ActionTitle · pending |
Relationships and references
1 fields| # | Field | EF type | Storage | Business purpose | Review |
|---|---|---|---|---|---|
| 1 | ParentItemId | Guid? | Nullable | Merge into the shared WorkStep.OwnerRecordId. Keep nested TemplateStep rows in the same template/revision context; remap parents when issuing. Replacement: OwnerRecordId. Backend/database adoption pending complete review. | Merged To WorkStep.OwnerRecordId · pending |
Audit and revision
4 fields| # | Field | EF type | Storage | Business purpose | Review |
|---|---|---|---|---|---|
| 1 | RepositoryWorkStepRevisionId | Guid? | Nullable | Preserve the referenced repository instruction revision via explicit source relationship/history during adoption; no replacement revision-ID column is approved here. Replacement: Controlled source relationship / history. Backend/database adoption pending complete review. | Dropped Removal pending complete review |
| 2 | SystemAuditId | Guid? | Nullable | Merge into the shared WorkStep.SystemAuditId. Preserve audit references and historical evidence. Replacement: SystemAuditId / source audit history. Backend/database adoption pending complete review. | Merged To WorkStep.SystemAuditId · pending |
| 3 | UpdateId | Guid? | Nullable | Merge into the shared WorkStep.UpdateId. Preserve update-chain identity and source history. Replacement: UpdateId. Backend/database adoption pending complete review. | Merged To WorkStep.UpdateId · pending |
| 4 | WorkTemplateRevisionId | Guid | Required | Merge into the shared WorkStep.WorkTemplateMasterId. Resolve revision to its owning template. Master FK does not replace exact controlled revision history; do not reactivate the previously Dropped revision field. Replacement: WorkTemplateMasterId + preserved revision provenance. Backend/database adoption pending complete review. | Merged To WorkStep.WorkTemplateMasterId · pending |
Other fields
4 fields| # | Field | EF type | Storage | Business purpose | Review |
|---|---|---|---|---|---|
| 1 | InstructionHtml | string | Nullable | Merge into the shared WorkStep.ActionText. Retain complete formatted instructions and review storage/rendering capacity before moving data. Replacement: ActionText. Backend/database adoption pending complete review. | Merged To WorkStep.ActionText · pending |
| 2 | PartRequestsJson | string | Nullable | Expand every requested part, quantity and attribute into structured planned demand rows owned by the template step. Replacement: MaterialDemand child WorkStep rows. Backend/database adoption pending complete review. | Dropped Removal pending complete review |
| 3 | ResourceRequestsJson | string | Nullable | Expand planned manpower, tools, facilities and timing/quantity details into structured child rows. Replacement: ResourceRequest child WorkStep rows. Backend/database adoption pending complete review. | Dropped Removal pending complete review |
| 4 | Sequence | int | Required | Merge into the shared WorkStep.WorkStepNumber. Positive whole-number text, ordered numerically; preserve sibling order and hierarchy. Replacement: WorkStepNumber. Backend/database adoption pending complete review. | Merged To WorkStep.WorkStepNumber · pending |
Template steps in WorkStep
WorkTemplateItem is Dropped in this proposal. Backend classes and physical tables remain unchanged pending complete review.
WorkTemplateMaster owns reusable TemplateStep-role WorkStep rows through WorkTemplateMasterId. Template steps can have parent/child instructions and structured planned material/resource demand. Issuing creates independent executable WorkStep rows owned by a WorkorderMaster, with copied definitions and demands and preserved template/source revision provenance.
| Former item field | WorkStep treatment | Preserved behavior |
|---|---|---|
| WorkTemplateItem.Id | Id | Preserve stable row identity or an explicit identity mapping if IDs collide. |
| WorkTemplateItem.WorkTemplateRevisionId | WorkTemplateMasterId + preserved revision provenance | Resolve revision to its owning template. Master FK does not replace exact controlled revision history; do not reactivate the previously Dropped revision field. |
| WorkTemplateItem.ParentItemId | OwnerRecordId | Keep nested TemplateStep rows in the same template/revision context; remap parents when issuing. |
| WorkTemplateItem.RepositoryWorkStepRevisionId | Controlled source relationship / history | Preserve the referenced repository instruction revision via explicit source relationship/history during adoption; no replacement revision-ID column is approved here. |
| WorkTemplateItem.Sequence | WorkStepNumber | Positive whole-number text, ordered numerically; preserve sibling order and hierarchy. |
| WorkTemplateItem.Title | ActionTitle | Required title on each TemplateStep row; preserve the existing item title capacity. |
| WorkTemplateItem.InstructionHtml | ActionText | Retain complete formatted instructions and review storage/rendering capacity before moving data. |
| WorkTemplateItem.PartRequestsJson | MaterialDemand child WorkStep rows | Expand every requested part, quantity and attribute into structured planned demand rows owned by the template step. |
| WorkTemplateItem.ResourceRequestsJson | ResourceRequest child WorkStep rows | Expand planned manpower, tools, facilities and timing/quantity details into structured child rows. |
| WorkTemplateItem.SystemAuditId | SystemAuditId / source audit history | Preserve audit references and historical evidence. |
| WorkTemplateItem.UpdateId | UpdateId | Preserve update-chain identity and source history. |
Ownership and issuing rules
- WorkTemplateMasterId is a proposed foreign key to WorkTemplateMaster.Id. Require a saved owner for TemplateStep rows. Restrict deletion of referenced masters until definition ownership and historical use are reconciled.
- Append TemplateStep to RecordKind without changing existing role values. Exclude definition rows from execution progress, live booking, stock movements and signing queries.
- TemplateStep children use OwnerRecordId for hierarchy; planned material/resource rows use WorkStepId to identify their owning definition. Validate same template context, allowed role pairs, no self/cyclic parents and ordering.
- Issuing clones the full selected instruction tree and its planned demands, creates new execution IDs, remaps parents, and assigns the owning workorder. Never use the same row for reusable instructions and actual execution.
- Preserve exact approved template/repository revision and copied content for issued work. WorkTemplateRevisionId remains Dropped in the WorkStep proposal; replacement revision provenance remains an adoption review item rather than silently restoring that field.
- Unpack legacy parts/resources JSON without dropping quantities, units, request attributes or repeated rows. The previously Dropped WorkStep JSON fields remain Dropped.
- Retire WorkTemplateItem model/table only after the reviewed row migration, ownership/provenance mapping and issuing/query adaptation are implemented. This update changes HTML/metadata only.