26ff8d9b4f
Set up repository with legacy .NET Framework 4.8 source (OLD/), new .NET 10 Blazor solution (NEW/), OpenSpec specifications, documentation, and project configuration.
283 lines
12 KiB
Markdown
283 lines
12 KiB
Markdown
# Tasks: Implement Domain Models
|
|
|
|
## Phase 1: Foundation (Enums, Interfaces, Helpers)
|
|
|
|
- [x] Create JdeDateConverter helper class
|
|
- Location: `JdeScoping.Core/Helpers/JdeDateConverter.cs`
|
|
- Implements: CYYDDD date format conversion, HHMMSS time conversion
|
|
- Validation: Unit tests for valid dates, zero dates, invalid formats all pass
|
|
|
|
- [x] Create SearchStatus enum
|
|
- Location: `JdeScoping.Core/Models/Enums/SearchStatus.cs`
|
|
- Values: New (0), Submitted (1), Started (2), Ended (3), Error (4)
|
|
- Validation: Has `[JsonConverter(typeof(JsonStringEnumConverter))]` attribute
|
|
|
|
- [x] Create UpdateTypes enum
|
|
- Location: `JdeScoping.Core/Models/Enums/UpdateTypes.cs`
|
|
- Values: Hourly (1), Daily (2), Mass (3)
|
|
- Validation: Has `[JsonConverter(typeof(JsonStringEnumConverter))]` attribute
|
|
|
|
- [x] Create IBusinessUnit interface
|
|
- Location: `JdeScoping.Core/Interfaces/IBusinessUnit.cs`
|
|
- Properties: Code, Description, LastUpdateDT
|
|
- Validation: Compiles, used by WorkCenter and ProfitCenter
|
|
|
|
## Phase 2: Search-Related Entities
|
|
|
|
- [x] Replace Search entity
|
|
- Location: `JdeScoping.Core/Models/Search.cs`
|
|
- Properties: ID, UserName, Name, Status, SubmitDT, StartDT, EndDT, CriteriaJSON, Criteria, Results
|
|
- Validation: Matches spec requirement, Results is `byte[]?`
|
|
|
|
- [x] Create SearchCriteria entity
|
|
- Location: `JdeScoping.Core/Models/SearchCriteria.cs`
|
|
- Properties: MinimumDT, MaximumDT, WorkOrderNumbers, ItemNumbers, ProfitCenters, WorkCenters, OperatorIDs, ComponentLotNumbers, ExtractMisData, PartOperations
|
|
- Validation: All list properties initialized to empty lists
|
|
|
|
- [x] Create SearchUpdate entity
|
|
- Location: `JdeScoping.Core/Models/SearchUpdate.cs`
|
|
- Properties: ID, UserName, Name, Status, SubmitDT, StartDT, EndDT, Timestamp
|
|
- Validation: Constructor accepts Search, sets Timestamp to DateTime.UtcNow
|
|
|
|
- [x] Create StatusUpdate entity
|
|
- Location: `JdeScoping.Core/Models/StatusUpdate.cs`
|
|
- Properties: Message, Timestamp
|
|
- Validation: Compiles, simple message DTO
|
|
|
|
## Phase 3: Work Order Entities
|
|
|
|
- [x] Replace WorkOrder entity
|
|
- Location: `JdeScoping.Core/Models/WorkOrder.cs`
|
|
- Properties: WorkOrderNumber, BranchCode, LotNumber?, ItemNumber, ShortItemNumber, ParentWorkOrderNumber?, OrderQuantity, HeldQuantity, ShippedQuantity, StatusCode, StatusCodeUpdateDT, IssueDate, StartDate, RoutingType, LastUpdateDT
|
|
- Validation: Private JDE date fields, computed LastUpdateDT, nullable annotations
|
|
|
|
- [x] Create WorkOrderStep entity
|
|
- Location: `JdeScoping.Core/Models/WorkOrderStep.cs`
|
|
- Properties: WorkOrderNumber, BranchCode, WorkCenterCode, StepNumber, StepDescription?, FunctionOperationDescription?, StepTypeCode, StartDT, EndDT, FunctionCode, ScrappedQuantity, LastUpdateDT
|
|
- Validation: Nullable annotations on optional fields
|
|
|
|
- [x] Create WorkOrderTime entity
|
|
- Location: `JdeScoping.Core/Models/WorkOrderTime.cs`
|
|
- Properties: UniqueID, WorkOrderNumber, BranchCode, WorkCenterCode, StepNumber, AddressNumber, GlDate, LastUpdateDT
|
|
- Validation: Matches F31122 table structure
|
|
|
|
- [x] Create WorkOrderComponent entity
|
|
- Location: `JdeScoping.Core/Models/WorkOrderComponent.cs`
|
|
- Properties: UniqueID, WorkOrderNumber, LotNumber?, BranchCode, ShortItemNumber?, Quantity, LastUpdateDT
|
|
- Validation: ShortItemNumber and LotNumber are nullable
|
|
|
|
- [x] Create WorkOrderRouting entity
|
|
- Location: `JdeScoping.Core/Models/WorkOrderRouting.cs`
|
|
- Properties: UserID, BatchNumber, TransactionNumber, LineNumber, StepNumber, WorkCenterCode, WorkOrderNumber, RoutingType, BranchCode, StepDescription?, FunctionCode, TransactionDate, LastUpdateDT
|
|
- Validation: Compiles, nullable StepDescription
|
|
|
|
## Phase 4: Lot Entities
|
|
|
|
- [x] Replace Lot entity
|
|
- Location: `JdeScoping.Core/Models/Lot.cs`
|
|
- Properties: LotNumber, BranchCode, ShortItemNumber, ItemNumber, SupplierCode, StatusCode (char), Memo1?, Memo2?, Memo3?, LastUpdateDT
|
|
- Validation: StatusCode is char type, nullable memo fields
|
|
|
|
- [x] Replace LotUsage entity
|
|
- Location: `JdeScoping.Core/Models/LotUsage.cs`
|
|
- Properties: UniqueID, WorkOrderNumber, LotNumber, BranchCode, ShortItemNumber, Quantity, LastUpdateDT
|
|
- Validation: Cardex entry structure matches spec
|
|
|
|
- [x] Create LotLocation entity
|
|
- Location: `JdeScoping.Core/Models/LotLocation.cs`
|
|
- Properties: LotNumber, ShortItemNumber, BranchCode, Location, LastUpdateDT
|
|
- Validation: Compiles with all properties
|
|
|
|
## Phase 5: Reference Entities
|
|
|
|
- [x] Replace Item entity
|
|
- Location: `JdeScoping.Core/Models/Item.cs`
|
|
- Properties: ShortItemNumber, ItemNumber, Description, PlanningFamily?, StockingType?, LastUpdateDT
|
|
- Validation: Dual identifier pattern (ShortItemNumber + ItemNumber)
|
|
|
|
- [x] Replace WorkCenter entity
|
|
- Location: `JdeScoping.Core/Models/WorkCenter.cs`
|
|
- Properties: Code, Description, LastUpdateDT
|
|
- Validation: Implements IBusinessUnit interface
|
|
|
|
- [x] Create ProfitCenter entity
|
|
- Location: `JdeScoping.Core/Models/ProfitCenter.cs`
|
|
- Properties: Code, Description, LastUpdateDT
|
|
- Validation: Implements IBusinessUnit interface
|
|
|
|
- [x] Create Branch entity
|
|
- Location: `JdeScoping.Core/Models/Branch.cs`
|
|
- Properties: Code, Description, LastUpdateDT
|
|
- Validation: Compiles, matches spec
|
|
|
|
- [x] Replace JdeUser entity
|
|
- Location: `JdeScoping.Core/Models/JdeUser.cs`
|
|
- Properties: AddressNumber, UserID, FullName, LastUpdateDT
|
|
- Validation: AddressNumber is long, matches spec
|
|
|
|
- [x] Create StatusCode entity
|
|
- Location: `JdeScoping.Core/Models/StatusCode.cs`
|
|
- Properties: Code, Description, LastUpdateDT
|
|
- Validation: JDE work order status lookup
|
|
|
|
- [x] Create FunctionCode entity
|
|
- Location: `JdeScoping.Core/Models/FunctionCode.cs`
|
|
- Properties: Code, Description, LastUpdateDT
|
|
- Validation: JDE function code lookup
|
|
|
|
## Phase 6: Config and Mapping Entities
|
|
|
|
- [x] Create DataUpdate entity
|
|
- Location: `JdeScoping.Core/Models/DataUpdate.cs`
|
|
- Properties: ID, SourceSystem, SourceData, TableName, StartDT, EndDT, UpdateType, WasSuccessful, NumberRecords
|
|
- Validation: UpdateType uses UpdateTypes enum
|
|
|
|
- [x] Create OrgHierarchy entity
|
|
- Location: `JdeScoping.Core/Models/OrgHierarchy.cs`
|
|
- Properties: WorkCenterCode, BranchCode, ProfitCenterCode, LastUpdateDT
|
|
- Validation: Profit center to work center mapping
|
|
|
|
- [x] Create RouteMaster entity
|
|
- Location: `JdeScoping.Core/Models/RouteMaster.cs`
|
|
- Properties: BranchCode, ItemNumber, RoutingType, SequenceNumber, FunctionCode, WorkCenterCode, StartDate, EndDate?, LastUpdateDT
|
|
- Validation: EndDate is nullable
|
|
|
|
## Phase 7: CMS and External Entities
|
|
|
|
- [x] Create MisData entity
|
|
- Location: `JdeScoping.Core/Models/MisData.cs`
|
|
- Properties: ItemNumber, BranchCode, SequenceNumber, MisNumber, RevID?, CharNumber, TestDescription?, SamplingType?, SamplingValue?, ToolsGauges?, WorkInstructions?, Status, ReleaseDate?
|
|
- Validation: Many nullable string fields per spec
|
|
|
|
- [x] Create POReceiver entity
|
|
- Location: `JdeScoping.Core/Models/POReceiver.cs`
|
|
- Properties: OrderNumber, OrderCompany, OrderSuffix, LineNumber, NumberOfLines, InvoiceNumber, BranchCode, LotNumber?, ShortItemNumber (string!), DateReceived, Subledger?, QtyReceived, LastUpdateDT
|
|
- Validation: ShortItemNumber is string (intentional legacy quirk)
|
|
|
|
- [x] Create POInspect entity
|
|
- Location: `JdeScoping.Core/Models/POInspect.cs`
|
|
- Properties: UniqueID, OrderNumber, OrderCompany, LineNumber, InvoiceNumber, LotNumber?, ShortItemNumber, LastUpdateDT
|
|
- Validation: Compiles with nullable LotNumber
|
|
|
|
- [x] Create DcsLot entity
|
|
- Location: `JdeScoping.Core/Models/DcsLot.cs`
|
|
- Properties: ItemNumber, LotNumber, LotSuffix?, LastUpdateDT
|
|
- Validation: Simple DCS lot record
|
|
|
|
- [x] Create CamstarMO entity
|
|
- Location: `JdeScoping.Core/Models/CamstarMO.cs`
|
|
- Properties: MONumber, LastUpdateDT
|
|
- Validation: Simple Camstar manufacturing order
|
|
|
|
## Phase 8: Auth and User Entities
|
|
|
|
- [x] Create UserInfo entity
|
|
- Location: `JdeScoping.Core/Models/UserInfo.cs`
|
|
- Properties: Username, FirstName?, LastName?, DisplayName (computed), Title?, EmailAddress?
|
|
- Validation: DisplayName computed property works (fallback to Username)
|
|
|
|
## Phase 9: Query Support Entities
|
|
|
|
- [x] Create QueryTypes entity
|
|
- Location: `JdeScoping.Core/Models/QueryTypes.cs`
|
|
- Properties: Code, Name, OrderIndex, filter flags (TimeSpanFilter, WorkOrderFilter, etc.)
|
|
- Validation: Static dictionary pattern, Identify() method stub
|
|
|
|
- [x] Create TableSpec entity
|
|
- Location: `JdeScoping.Core/Models/TableSpec.cs`
|
|
- Properties: Name, TempTableName (computed), Columns, PrimaryKey
|
|
- Validation: Constructor initializes lists, stub methods exist
|
|
|
|
- [x] Create ColumnSpec entity
|
|
- Location: `JdeScoping.Core/Models/ColumnSpec.cs`
|
|
- Properties: Name, Definition
|
|
- Validation: Simple column specification
|
|
|
|
## Phase 10: ViewModels
|
|
|
|
- [x] Create WorkOrderViewModel
|
|
- Location: `JdeScoping.Core/ViewModels/WorkOrderViewModel.cs`
|
|
- Properties: WorkOrderNumber, ItemNumber
|
|
- Validation: Minimal projection DTO
|
|
|
|
- [x] Create LotViewModel
|
|
- Location: `JdeScoping.Core/ViewModels/LotViewModel.cs`
|
|
- Properties: LotNumber, ItemNumber
|
|
- Validation: Used by SearchCriteria.ComponentLotNumbers
|
|
|
|
- [x] Create ItemViewModel
|
|
- Location: `JdeScoping.Core/ViewModels/ItemViewModel.cs`
|
|
- Properties: ItemNumber, Description
|
|
- Validation: Minimal projection DTO
|
|
|
|
- [x] Create WorkCenterViewModel
|
|
- Location: `JdeScoping.Core/ViewModels/WorkCenterViewModel.cs`
|
|
- Properties: Code, Description
|
|
- Validation: Minimal projection DTO
|
|
|
|
- [x] Create ProfitCenterViewModel
|
|
- Location: `JdeScoping.Core/ViewModels/ProfitCenterViewModel.cs`
|
|
- Properties: Code, Description
|
|
- Validation: Minimal projection DTO
|
|
|
|
- [x] Create JdeUserViewModel
|
|
- Location: `JdeScoping.Core/ViewModels/JdeUserViewModel.cs`
|
|
- Properties: AddressNumber, UserID, FullName
|
|
- Validation: Minimal projection DTO
|
|
|
|
- [x] Create PartOperationViewModel
|
|
- Location: `JdeScoping.Core/ViewModels/PartOperationViewModel.cs`
|
|
- Properties: ItemNumber, OperationNumber, MisNumber, Revision
|
|
- Validation: Used by SearchCriteria.PartOperations
|
|
|
|
## Phase 11: Extension Methods
|
|
|
|
- [x] Create WorkOrderExtensions
|
|
- Location: `JdeScoping.Core/Extensions/WorkOrderExtensions.cs`
|
|
- Method: ToViewModel() -> WorkOrderViewModel
|
|
- Validation: Extension method on WorkOrder compiles and works
|
|
|
|
- [x] Create LotExtensions
|
|
- Location: `JdeScoping.Core/Extensions/LotExtensions.cs`
|
|
- Method: ToViewModel() -> LotViewModel
|
|
- Validation: Extension method on Lot compiles and works
|
|
|
|
- [x] Create ItemExtensions
|
|
- Location: `JdeScoping.Core/Extensions/ItemExtensions.cs`
|
|
- Method: ToViewModel() -> ItemViewModel
|
|
- Validation: Extension method on Item compiles and works
|
|
|
|
- [x] Create WorkCenterExtensions
|
|
- Location: `JdeScoping.Core/Extensions/WorkCenterExtensions.cs`
|
|
- Method: ToViewModel() -> WorkCenterViewModel
|
|
- Validation: Extension method on WorkCenter compiles and works
|
|
|
|
- [x] Create ProfitCenterExtensions
|
|
- Location: `JdeScoping.Core/Extensions/ProfitCenterExtensions.cs`
|
|
- Method: ToViewModel() -> ProfitCenterViewModel
|
|
- Validation: Extension method on ProfitCenter compiles and works
|
|
|
|
- [x] Create JdeUserExtensions
|
|
- Location: `JdeScoping.Core/Extensions/JdeUserExtensions.cs`
|
|
- Method: ToViewModel() -> JdeUserViewModel
|
|
- Validation: Extension method on JdeUser compiles and works
|
|
|
|
## Phase 12: Verification
|
|
|
|
- [x] Verify solution builds
|
|
- Command: `dotnet build NEW/src/JdeScoping.Core/JdeScoping.Core.csproj`
|
|
- Validation: Build succeeds with no errors
|
|
|
|
- [x] Verify nullable reference types
|
|
- Validation: All nullable properties use `?` annotation, no compiler warnings
|
|
|
|
- [x] Verify JSON serialization
|
|
- Validation: SearchStatus and UpdateTypes serialize as strings, not integers
|
|
|
|
- [x] Run OpenSpec validation
|
|
- Command: `openspec validate implement-domain-models --strict`
|
|
- Validation: All requirements marked as covered
|
|
|
|
- [x] Cross-reference with spec
|
|
- Validation: All 52 requirements from domain-models/spec.md implemented
|