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 modelCurrent mapped tableSource scalar fieldsDecision
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

  1. Implement one WorkStep entity with the combined field set, adapting typed-role query/controller/service behavior to RecordKind.
  2. Inspect live schemas; preserve or remap phase, reference, occurrence, entry, resource and repository identities, audit/revision links, self references and incoming foreign keys.
  3. Backfill phase/reference values and roles, reconcile historical standalone tables and replace relationship targets while preserving cardinality and immutable records.
  4. Adapt frontend forms, lookups, repository editing, phase planning, execution, signing, resources/material fulfillment and reporting to the unified entity.
  5. 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.

TopicDecisionWorkflow 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.

CasePart identityRotable identityHandling
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

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 fieldWorkStep treatmentPreserved 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