Coflyr · WorkStep review
All WorkStep models merged into WorkStep
Model index · All 105 combined fields
One persisted WorkStep model replaces the separate model definitions below. Existing shared storage is the baseline; phase/reference fields join the complete inventory. All final model and physical table retirements are pending complete review.
Complete consolidation scope
| Source model | Current mapped table | Source scalar fields | Decision |
|---|---|---|---|
| RepositoryWorkStep | WorkStep | 20 | Dropped · Merge into WorkStep |
| RepositoryWorkStepRevision | WorkStep | 27 | Dropped · Merge into WorkStep |
| WorkStep | WorkStep | 53 | Keep WorkStep |
| WorkStepComponentSelection | WorkStep | 19 | Dropped · Merge into WorkStep |
| WorkStepExecutionOccurrence | WorkStep | 20 | Dropped · Merge into WorkStep |
| WorkStepMaterialDemand | WorkStep | 25 | Dropped · Merge into WorkStep |
| WorkStepMeasurementDefinition | WorkStep | 28 | Dropped · Merge into WorkStep |
| WorkStepRecord | WorkStep | 14 | Dropped · Merge into WorkStep |
| WorkStepResourceAssignment | WorkStep | 21 | Dropped · Merge into WorkStep |
| WorkStepResourceRequest | WorkStep | 28 | Dropped · Merge into WorkStep |
| WorkStepSoftwareChangePlan | WorkStep | 17 | Dropped · Merge into WorkStep |
| WorkorderExecutionEntry | WorkStep | 65 | Dropped · Merge into WorkStep |
| WorkStepPhase | WorkStepPhases | 9 | Dropped · Merge into WorkStep |
| WorkStepReferenceDetails | WorkStepReferenceDetails | 7 | Dropped · Merge into WorkStep |
WorkStepRecord is an abstract base with no standalone physical table; its fields are inherited today and move directly onto the unified model. Repository, revision, occurrence, entry, demand and assignment classes already share WorkStep storage; their separate model definitions are now marked for retirement. WorkStepPhase and WorkStepReferenceDetails are the additional separate tables covered by this decision.
Record roles and relationships
Unified WorkorderMaster (child) → WorkStep execution Occurrence → Execution → Entries / definitions / material and resource demand Resource request → Resource assignment Execution entry → Component selection Repository → Immutable repository revision Phase → Related phase; reference details → Owning execution
Retain RecordKind and the existing numeric values; add reviewed Phase/ReferenceDetails kinds as needed. One model does not collapse repeated occurrences, allocations, signed entries or version records into a single row. Preserve existing self-reference IDs and enforce valid role pairs, ownership, no self/cyclic parents and filtered uniqueness.
The selected task supplies the maintenance phase. MaintenancePhase and PhaseCode are Dropped from the WorkStep proposal. Map historical phase assignments to task-owned definitions and preserve applicability, revision context and related-phase/counterpart behavior during later implementation. Remaining phase relationships still require review. Reference details retain one-to-one ownership and existing AutoInclude/API behavior during endpoint adaptation. Only Execution rows count as executable steps in progress and manpower reports.
Fields and validation
All 105 mapped field names are represented once, including inherited audit/revision fields. Existing ActionType maps to EntryType. Nullable storage supports different record roles; required role values remain enforced by validation and constraints. Keep measurement identifiers, units and limits, demand versus actual usage, independent inspection/signature evidence, repository revision immutability and component-result behavior.
Adoption after complete review
- Implement one WorkStep entity with the combined field set, adapting typed-role query/controller/service behavior to RecordKind.
- Inspect live schemas; preserve or remap phase, reference, occurrence, entry, resource and repository identities, audit/revision links, self references and incoming foreign keys.
- Backfill phase/reference values and roles, reconcile historical standalone tables and replace relationship targets while preserving cardinality and immutable records.
- Adapt frontend forms, lookups, repository editing, phase planning, execution, signing, resources/material fulfillment and reporting to the unified entity.
- Validate field coverage, enum/default compatibility, role constraints, ownership and lifecycle queries before applying a reviewed migration or retiring physical tables.
Resolved workflow and field overlaps
Review decisions only. Backend services, APIs and database adoption remain pending complete review.
| Topic | Decision | Workflow and preservation rules |
|---|---|---|
| WorkStatus / CompletionState / ExecutionStatus / ShopStatus | One WorkStatus lifecycle | Single required lifecycle state for an executable WorkStep, merging WorkStatus, CompletionState, ExecutionStatus and the already retired ShopStatus. Use the WorkStatus enum with Draft as the default. Open/Ready identify preparation, InProgress/Production/Testing identify active work, Paused identifies suspended work, Completed identifies completion of physical work, QualityReview and ApprovedForRelease identify quality progression, Released requires valid release evidence, and Closed identifies final administrative closure. Planning, NotPerformed, Cancelled and Removed retain their distinct meanings. These are allowed states, not a compulsory linear sequence. The complete-work command performs signature, measurement, control and sequence validation before entering Completed; subsequent quality/release transitions require the recorded completion evidence. Use immutable transition/action evidence to report work performed after the current state advances beyond Completed. Never infer completion from ActionEndDate alone. Paused blocks execution changes; NotPerformed, Cancelled and Removed do not count as performed work. ApprovedForRelease is readiness, not release. Map legacy O/I/C/X to Open/InProgress/Closed/Cancelled; reconcile conflicting completion, shop and header states using evidence/history rather than enum order. Retain original source-state values in adoption history. Header aggregate states must not overwrite every child step. Allow only validated role-specific transitions. Completed may advance to QualityReview, ApprovedForRelease, Released and Closed; applicable work may use Testing before completion. Rework/reopen transitions require an authorized reason and preserve/invalidate dependent evidence explicitly. Use one lifecycle policy for entry saves, complete-work commands, reports, shop readiness and release gates. Performed-work reporting reads validated completion history; quality readiness requires ApprovedForRelease or valid subsequent release/closure evidence. Historical Closed alone is insufficient to fabricate completion or release. |
| Two measurement-validation paths | One measurement validation pipeline | Resolve planned measurements to MeasurementIdentifierId and a frozen applicable definition/version. Use MeasurementIdentifier as the local code and preserve explicit legacy ComponentTaskMeasurement mappings. Validate each reading once: ownership/code association, result type, unit, N/A policy, allowed answers, numerical limits, applicable formulas and required signatures. Result storage must preserve repeated observations and the definition/version used for each reading; never store readings on the reusable definition master. Run the same validator on result entry and completion, then enforce required-result coverage at completion. Preserve component formulas, signed results and historical definitions; replace the parallel component/generic validators with adapters feeding the one framework. |
| MeasurementId / MeasurementIdentifier | MeasurementIdentifier retained | One local text code links planned definitions, results and formula references within the owning executable WorkStep. Planned codes are unique within that step; repeated readings may share the code. MeasurementIdentifierId remains the reusable definition UUID lookup. |
| MeasurementText / TextValue | TextValue retained | Store text/custom answers on the individual measurement-result row using TextValue. Preserve original answers and definition context; MeasurementNotApplicable remains distinct from an absent or empty result. |
| Material-demand / fulfilment status | MaterialPartRequest fulfilment is authoritative; demand summary is derived | Stored request lifecycle for ResourceRequest rows only: Requested, Cancelled or Fulfilled. For MaterialDemand rows expose a read-only summary derived from linked MaterialPartRequest fulfilment records and verified quantities; do not allow a second independently editable demand status. Fulfilled requires verified net fulfilled quantity covering the required Quantity; partial supply remains Requested. Cancelled requires an explicitly cancelled demand or cancellation of all unfulfilled requirement with no remaining active request. Otherwise the summary is Requested. Allocation, ordering and a Closed request alone do not prove fulfilment; preserve PreStepCloseStatus and transaction evidence when work-step closure changes request status. ResourceRequest Fulfilled requires confirmed delivery of the requested resource service, rather than allocation alone. HTML review decision; backend / database adoption pending complete review. A demand may have multiple fulfilment requests. Calculate net fulfilled quantity using valid issued/serviced transactions after returns/reversals. Keep detailed Open/Allocated/Ordered/Serviced/Closed/Cancelled states on fulfilment requests; do not flatten them into independently editable demand states. Derived summaries refresh after transactions, cancellation, close and reopen. |
| FailureConfirmed / confirmation evidence | FailureConfirmation entry is authoritative | Remove the independently editable failure-confirmation Boolean. Confirmation is established by a valid FailureConfirmation entry linked through WorkStepId, with StaffMemberId, ActionEndDate and ActionText recording who, when and what was confirmed. Corrections invalidate/supersede evidence with audit history. A legacy true value without evidence remains unresolved historical data; never invent a signer or time. HTML review decision; backend / database adoption pending complete review. |
| ReleasedToService / release records / Released state | Release records are authoritative; WorkStatus reflects validated release | Remove the independently editable release Boolean. Determine release from valid, active, authorized release/sign records for the correct aircraft/component, work and quantity scope. Partial release does not release the whole scope; revoked/superseded records do not count. WorkStatus.Released is a validated projection of this evidence, not a second editable release assertion. Completion or a signature of another kind cannot imply release. HTML review decision; backend / database adoption pending complete review. Keep ReleaseSign only as legacy sign/reference text; it must not independently authorize or assert release. Link/import it to validated release evidence during adoption, preserving unverified historical text without upgrading its meaning. |
| CloseWorkStep / completion transition | One complete-work command; no persisted command Boolean | Keep CloseWorkStep only as a transient request-command option, not a stored WorkStep property. The option and the direct complete-work endpoint invoke the same lifecycle validation and atomic transition into WorkStatus.Completed. Persist the signed action and transition audit; retries must not duplicate evidence. Quality approval, release and final administrative closure remain separately validated transitions in the same WorkStatus lifecycle. HTML review decision; backend / database adoption pending complete review. |
| Troubleshooting / CriticalEvent control | Requirement on CriticalEvent; performance in execution evidence | Manage the troubleshooting requirement through CriticalEvent.ControlOptions.RequiresTroubleshooting selected by CriticalEventId. Record actual troubleshooting and its outcome in the linked execution/component-removal action using ActionText and existing component identity fields. Preserve the legacy removal troubleshooting marker as historical action evidence. Selecting a requirement does not prove work was performed, and performed work must not create a requirement automatically. There is no second editable troubleshooting Boolean on WorkStep. HTML review decision; backend / database adoption pending complete review. |
| HeaderSpecialCode / SpecialCode | SpecialCode retained | Merge the header/reference special code into SpecialCode. Preserve scope and source provenance. If legacy codes differ for the same owning step, reconcile them explicitly or retain separate linked reference rows; never overwrite, concatenate into an ambiguous code or truncate historical values. HTML review decision; backend / database adoption pending complete review. |
| PlannedManpower / EstimatedManHours | EstimatedManHours retained as Decimal person-hours | Merge planned labor effort into EstimatedManHours. Current creation code populates PlannedManpower from task/repository estimated man-hours, so the retained unit is person-hours. Convert finite Single values to Decimal explicitly, preserving null/zero and documented precision. Reconcile differing estimates; do not sum duplicate estimates or reinterpret genuine legacy headcount as hours. Staff headcount belongs to a staff resource request Quantity. HTML review decision; backend / database adoption pending complete review. |
Component actions and identity combinations
HTML proposal only. Existing backend validation and movement behavior are unchanged; unknown identities and extended actions await implementation after complete review.
Keep EntryType for the overall entry category and ComponentActionType for the component operation. Use separate source and destination child WorkStep rows linked to the same owning action through OwnerRecordId and WorkStepId. Each row uses the standard ConfigurationMasterId, ConfigurationId, PartId and RotableId fields, with ComponentActionRole identifying Source/Destination or Removed/Installed. Multiple units use additional separate child rows. PartNumber remains a snapshot; UndefinedPartNumber and UndefinedRotableNumber capture unresolved identities. The four From/To configuration and part fields are Dropped in this HTML proposal.
| Case | Part identity | Rotable identity | Handling |
|---|---|---|---|
| Saved part and saved unit | PartId (derive/validate) | RotableId | Both master records exist; unit must belong to the selected part. |
| Saved part; undefined unit | PartId | UndefinedRotableNumber | Record unit reference plus known serial/batch; resolve the unit before physical mutation. |
| Undefined part and unit | UndefinedPartNumber | UndefinedRotableNumber | Retain supplied identity evidence; resolve both masters before physical mutation. |
| Saved nonserialized part | PartId | Neither unit field | Allowed for part-only/nonserialized actions with a positive quantity; no artificial rotable required. |
| Undefined nonserialized part | UndefinedPartNumber | Neither unit field | Capture planning/identification details; resolve the part before material fulfillment or physical mutation. |
| Saved unit only supplied | Derive PartId from RotableId | RotableId | Do not require repeated part entry; reject any conflicting part identity. |
| Saved ID and undefined text together | PartId + UndefinedPartNumber | RotableId + UndefinedRotableNumber | Reject competing input identities for the same role; display/history snapshots are separate. |
| Undefined part with saved unit | UndefinedPartNumber | RotableId | Derive the saved part from the unit; reject conflicting undefined part input. |
| No usable part or unit identity | Neither | Neither or undefined unit only | Incomplete draft only; require a resolvable saved unit or a saved/undefined part identity before accepting the component action. |
Proposed validation and action rules
- Proposed actions: Install, Remove, Update, Replace, Swap, Inspect, Repair, Overhaul, Test, Service, Adjust, Modify, Calibrate, Other. Preserve existing Install=1 and Remove=2; explicitly assign new values during adoption.
- Require ComponentActionType for component-operation entries and ComponentActionRole for their component-identity child rows. EntryType still controls time, measurement, signing and other non-component entries.
- Use either PartId or UndefinedPartNumber for part identity, and either RotableId or UndefinedRotableNumber when a serialized unit is required. Resolve known rotables to their saved PartId; reject mismatches, empty UUIDs and whitespace-only undefined numbers.
- Install requires the destination position; Remove requires the source position. Update/Inspect/Repair/Overhaul/Test/Service/Adjust/Modify/Calibrate do not imply an installation or removal by themselves.
- Replace uses Removed and Installed child identity rows under the same owning action. Swap requires complete linked source/destination movements for both units and positions; validate and apply the operation atomically.
- Where quantity applies it must be positive; a row selecting an individual serialized unit represents one unit. Preserve applicable material-demand and resource-request quantity rules.
- Unresolved numbers may be captured for planning or identification. Final stock/configuration mutation requires resolved master IDs, position compatibility, action authorization and execution validation; undefined text is not a saved inventory link.
- Resolve identities through a reviewed operation that preserves the originally recorded text and audit evidence. Define paired-action ownership and duplicate checks before implementation; backend behavior is unchanged today.
- Represent source and destination as separate linked WorkStep rows with the same standard identity fields. Never collapse both sides into a single field value on one row. A remove-only action needs its source row; an install-only action needs its destination row.
- Software changes also use source and destination rows with PartId for the old and new software part and ConfigurationId for the applicable software position. Preserve source/target distinction, required target, different-part checks and allowed-position validation during adoption.
- Backfill each legacy FromConfigurationId/FromPartId and ToConfigurationId/ToPartId pair into its corresponding source or destination row. Preserve existing identity and history, link the paired rows, and validate paired replacement/swap/software changes atomically before retiring legacy columns. Backend/database implementation remains deferred.
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.