Commit Graph

204 Commits

Author SHA1 Message Date
Joseph Doherty b31fd35575 feat(core): add pipeline viewer DTOs 2026-01-07 07:56:18 -05:00
Joseph Doherty ff487aa99c docs: add pipeline viewer implementation plan
Detailed step-by-step implementation tasks:
1. Create Pipeline DTOs in Core
2. Add Pipeline Routes to ApiRoutes
3. Add Repository Methods
4. Implement Repository Methods
5. Create PipelineController
6. Add Missing Factory Methods
7. Create Client API Service
8. Create SqlQueryModal Component
9. Create PipelineScheduleSection Component
10. Create PipelineViewer Page
11. Register Services
12. Add Navigation Link
2026-01-07 07:53:54 -05:00
Joseph Doherty 9afecca957 docs: update pipeline viewer design based on Codex review
Addressed CLEAN architecture and best practices feedback:
- API loads config, returns DTO (not client loading JSON directly)
- Reuse existing DataSync Configuration types
- Add UpdateType filter to GetRecentUpdatesAsync
- Reuse existing IsOverdue() with grace period
- Add LastRun + LastRunWasSuccessful (not just LastSuccessfulRun)
- Follow ApiRoutes + ApiClientBase patterns
- Make Duration nullable for in-progress runs
- Use UpdateTypes enum instead of string
- Add [Authorize] to page and controller
2026-01-07 07:49:48 -05:00
Joseph Doherty 5040a8488f docs: add ETL pipeline viewer component design
Design document for admin monitoring component that visualizes:
- Pipeline configuration from pipelines.json
- Execution status (last run, next required, overdue)
- Recent execution history (last 10 per schedule type)
- Schedule sections for Mass/Daily/Hourly with defaults vs overrides
2026-01-07 07:40:49 -05:00
Joseph Doherty 8630a5d32b docs: add WorkProcessor design and implementation documentation
- WorkProcessorReport.md: Analysis of legacy work processor from OLD solution
- Design document with clean architecture and component specifications
- Implementation plan with 15 TDD tasks
2026-01-07 06:30:54 -05:00
Joseph Doherty 5ee920a399 feat: complete WorkProcessor integration and bug fixes
- Fix hourly lookback bug: use hourly timestamp/interval (not daily)
- Update DI registrations across DataSync, DataAccess, Api layers
- Add WorkProcessor config to appsettings.json
- Remove deprecated DataSyncService (replaced by WorkProcessor)

All 340 DataSync tests pass. Legacy bug from OLD solution now fixed.
2026-01-07 06:26:45 -05:00
Joseph Doherty 91b516e197 feat: implement WorkProcessor and search execution services
- SearchRepository: Search table operations with Dapper
- SearchExecutionService: Search pipeline with proper cancellation handling
- WorkProcessor: Unified BackgroundService for syncs and searches
- SearchNotificationService: SignalR notifications in Api layer

All 45 new tests pass. Proper shutdown vs timeout distinction
prevents marking searches as error on host shutdown.
2026-01-07 06:18:35 -05:00
Joseph Doherty ca4cf9d3ec feat(dataaccess): implement ISearchProcessor interface on SearchProcessor 2026-01-07 06:07:22 -05:00
Joseph Doherty 14799b62dc feat: add WorkProcessor interfaces and options
- ISearchNotificationService: SignalR notification abstraction in Core
- WorkProcessorOptions: configuration for work processor behavior
- ISearchRepository: Search table operations contract
- ISearchExecutionService: search pipeline orchestration contract
2026-01-07 06:06:12 -05:00
Joseph Doherty 488aef560b feat(core): add ISearchProcessor interface for search execution abstraction 2026-01-07 06:04:17 -05:00
Joseph Doherty c814a7294b refactor(datasync): remove deprecated SyncMode and SyncModeConfig
- Delete SyncMode.cs enum file
- Remove SyncModes property from PipelineConfig
- Remove SyncModeConfig and DestinationOverride records
- Remove WithMode(SyncMode) from IEtlPipelineBuilder
- Remove BuildWithSyncModes() and related methods from EtlPipelineFactory
- Remove syncModes sections from all pipelines in pipelines.json
- Update tests to use schedules-only configuration

All pipelines now require 'schedules' format (mass/daily/hourly).
WithUpdateType(UpdateTypes) is the only way to set update type.
2026-01-07 05:16:20 -05:00
Joseph Doherty 1618b6664d refactor: remove unused CMS/JDE repositories and data sources
Remove legacy JDE and CMS direct-access code that is no longer used:
- Delete ICmsDataSource, IJdeDataSource interfaces
- Delete ISearchProcessor, IUpdateProcessor interfaces
- Delete IJdeRepository and ICmsRepository (all partials)
- Delete JdeRepository and CmsRepository implementations
- Delete JdeQueries and CmsQueries
- Delete JdeFileDataSource, JdeOracleDataSource
- Delete CmsFileDataSource, CmsOracleDataSource
- Remove unused methods from LotFinderRepository interfaces
- Delete associated unit tests (CmsRepositoryTests, JdeRepositoryTests)

All data sync now uses ETL pipelines via DataSync project.
2026-01-07 05:04:49 -05:00
Joseph Doherty 6952f686fa perf: optimize ExcelIO tests with fixture-based consolidation
- Add WorkbookFixtureBase and 4 concrete fixtures for shared workbooks
- Add ExcelTestHelpers with shared utility methods
- Create Integration/ folder with 7 fixture-based test classes:
  - MinimalSearchTests (5 tests)
  - SearchResultsSheetTests (5 tests)
  - MisInfoSheetTests (11 tests)
  - InvestigationSheetTests (7 tests)
  - ProtectionAndStyleTests (7 tests)
  - LegacyFormatTests (5 tests)
  - LargeDataSetTests (1 test)
- Delete redundant ExcelExportIntegrationTests.cs (26 tests)
- Delete redundant LegacyComparisonTests.cs (16 tests)
- Reduce workbook generations from ~42 to 4 fixtures
- Test runtime reduced from ~18 min to ~4 min (76% improvement)
- All 122 ExcelIO tests pass
2026-01-07 03:55:33 -05:00
Joseph Doherty 884d3a093b chore(datasync): mark SyncMode and SyncModeConfig as obsolete 2026-01-07 01:58:01 -05:00
Joseph Doherty fc5769b219 test: fix ServiceRegistrationTests config key (Ldap:UseFakeAuth) 2026-01-07 01:56:34 -05:00
Joseph Doherty b0619dc49f config: add GIW connection string placeholder 2026-01-07 01:47:38 -05:00
Joseph Doherty 8a852eac41 feat(datasync): add 8 missing pipeline definitions
Add pipeline definitions for:
- WorkOrderTime_Curr (JDE F31122_VIEW)
- WorkOrderComponent_Curr (JDE F3111_VIEW)
- WorkOrderStep_Curr (JDE F3112_VIEW with F00192_VIEW join)
- WorkOrderRouting (JDE F3112Z1_VIEW)
- StatusCode (GIW F0005_VIEW - uses giw connection)
- OrgHierarchy (JDE F30006_VIEW)
- RouteMaster (JDE F3003_VIEW)
- FunctionCode (JDE PRODDTA.F00192 - always full reload)

Update MisData pipeline:
- Set mass.intervalMinutes to 100800 (10x default)
- Disable hourly schedule
2026-01-07 01:44:50 -05:00
Joseph Doherty 3af06b6aff refactor(datasync): migrate pipelines to new schedule schema
- Add scheduleDefaults with mass/daily/hourly defaults
- Add massQuery (unfiltered) to each pipeline for Mass schedule
- Add schedules section to each pipeline inheriting defaults
- Keep syncModes for backward compatibility
2026-01-07 01:39:22 -05:00
Joseph Doherty da02784feb feat(datasync): add custom interval support to DataUpdateRepository
Add optional customIntervals parameter to GetSyncStatusAsync to allow
per-pipeline interval overrides instead of hardcoded defaults. This
enables tables like MisData to use longer sync intervals (e.g., 70 days)
while other tables use standard intervals.

Key changes:
- IDataUpdateRepository.GetSyncStatusAsync now accepts an optional
  Dictionary<string, int> for custom intervals keyed by "TableName_UpdateType"
- GetExpectedInterval and IsOverdue made public static for testing and reuse
- Added GetDefaultInterval method for accessing default values
- Updated DataSyncHealthCheck to use new signature
- Added comprehensive unit tests for custom interval behavior
2026-01-07 01:35:28 -05:00
Joseph Doherty e234c9f29a refactor(datasync): use WithUpdateType instead of WithMode in TableSyncOperation
Update TableSyncOperation to pass UpdateTypes directly to the pipeline
builder using WithUpdateType() instead of mapping to SyncMode and calling
the deprecated WithMode() method. This enables proper schedule-based
configuration handling where Daily and Hourly have distinct behaviors.

- Remove SyncMode mapping logic from ExecuteSyncCoreAsync
- Call WithUpdateType(task.UpdateType) directly
- Update log message to reflect UpdateType instead of SyncMode
- Add TableSyncOperationTests verifying WithUpdateType is called correctly
2026-01-07 01:25:24 -05:00
Joseph Doherty bb54994f2d feat(datasync): add WithUpdateType to IEtlPipelineBuilder
- Add WithUpdateType(UpdateTypes) method to IEtlPipelineBuilder interface
- Mark existing WithMode(SyncMode) as [Obsolete("Use WithUpdateType instead")]
- Update PipelineBuilder to store UpdateTypes instead of SyncMode
- Add GetEffectiveScheduleConfig method to merge pipeline schedules with defaults
- Add BuildWithSchedules method for new Schedules-based config
- Update validation to support both old SyncModes and new Schedules formats
- Pass ScheduleDefaults from PipelinesRoot to PipelineBuilder
- For Mass mode: use massQuery, apply prePurge/reIndex from schedule config
- For Daily/Hourly: use regular query with date parameters
- Add 8 new tests for WithUpdateType functionality
2026-01-07 01:15:18 -05:00
Joseph Doherty 4b3c900d52 feat(datasync): add GIW connection type to DbQuerySource
Add support for "giw" connection type in DbQuerySource to enable
the StatusCode pipeline to query from the GIW Oracle database.
2026-01-07 01:08:52 -05:00
Joseph Doherty c59a3160d0 feat(dataaccess): add GIW connection factory method
Add CreateGiwConnectionAsync to IDbConnectionFactory and DbConnectionFactory
for connecting to the GIW Oracle database. This connection is needed for the
StatusCode data sync pipeline.

- Reuses existing CreateOracleConnectionAsync helper with "GIW" data source
- Follows same pattern as JDE, JDEStage, and CMS connections
- Includes 4 unit tests covering missing/empty/invalid connection strings
2026-01-07 00:54:11 -05:00
Joseph Doherty 21f598f25c feat(datasync): add Schedules property to PipelineConfig
Add PipelineSchedules? Schedules parameter to PipelineConfig record between
SyncModes and Transformers for new schedule-based configuration. The existing
SyncModes property is now nullable for backward compatibility during the
transition to the new schedule system.
2026-01-07 00:41:03 -05:00
Joseph Doherty 15cfc1a010 feat(datasync): add ScheduleDefaults to PipelinesRoot
Add ScheduleDefaults? parameter to PipelinesRoot record and
EffectiveScheduleDefaults computed property that returns
defaults when null.

Updates all existing test usages to include the new parameter.
2026-01-07 00:33:18 -05:00
Joseph Doherty 1318dce18a feat(datasync): add ScheduleConfig and ScheduleDefaults models
Add configuration models for the new schedule-based pipeline configuration:
- ScheduleConfig: Per-schedule configuration (Enabled, IntervalMinutes, PrePurge, ReIndex, UpdateWhen)
- ScheduleDefaults: Default configurations for Mass (weekly), Daily, and Hourly schedules
- PipelineSchedules: Per-pipeline schedule overrides
- MergeWith method for merging pipeline overrides with defaults

Part of Task 1 from pipeline-schedule-alignment implementation plan.
2026-01-07 00:18:28 -05:00
Joseph Doherty bd8cb87275 docs: add pipeline schedule alignment implementation plan
15-task plan to align pipelines.json with legacy DataSyncReport.md:
- Phase 1: Schema & Models (Tasks 1-3)
- Phase 2: GIW Connection (Tasks 4-5)
- Phase 3: Core ETL Changes (Tasks 6-8)
- Phase 4: Pipeline Configurations (Tasks 9-11)
- Phase 5: Validation & Testing (Tasks 12-15)
2026-01-07 00:13:03 -05:00
Joseph Doherty 2a9dbe2f62 docs: add pipeline schedule alignment design
Aligns pipelines.json with legacy DataSyncReport.md:
- Three schedules (Mass/Daily/Hourly) instead of two sync modes
- 8 missing pipelines to add
- GIW connection for StatusCode
- Per-pipeline schedule configuration
2026-01-07 00:07:46 -05:00
Joseph Doherty 621dd41a97 refactor(ExcelIO): delete old attribute-based infrastructure
- Remove OutputColumnAttribute, OutputTableAttribute, OutputColumnCache
- Remove AttributeTableWriter and ColumnFormatter
- Remove duplicate ExcelFormats from Mapping (use Formatting version)
- Remove OutputColumn model
- Add FilterEntryMaps for criteria sheet filter models
- Update CriteriaSheetGenerator to use FluentTableWriter
- Remove attributes from filter entry models (now use fluent maps)
- Update DI to register filter entry maps and remove old services
- Update tests to use new fluent infrastructure
- Delete obsolete test files for removed infrastructure

Task 16 of fluent-excel-mapping-implementation plan.
2026-01-06 23:56:02 -05:00
Joseph Doherty e98ce636e2 refactor(ExcelIO): remove duplicate result models (now in Core) 2026-01-06 23:46:54 -05:00
Joseph Doherty 4fbd264181 refactor(DataAccess): remove duplicate Models and Attributes (now in Core/ExcelIO) 2026-01-06 23:42:42 -05:00
Joseph Doherty e36eb27947 refactor(DataAccess): use Core.Models.SearchResults 2026-01-06 23:40:02 -05:00
Joseph Doherty 8883fb2680 refactor(ExcelIO): migrate ExcelExportService to Core models and FluentTableWriter
- Replace AttributeTableWriter with FluentTableWriter in ExcelExportService
- Inject ExcelMapRegistry for fluent map lookups
- Use registry.GetMap<T>().TabName instead of reflection-based attribute reading
- Update ExcelIO SearchModel to reference Core result types via aliases
- Remove System.Reflection import (no longer needed)
- Add JdeScoping.Core.Models.SearchResults import for result types
2026-01-06 23:38:30 -05:00
Joseph Doherty a6b7f646b1 feat(ExcelIO): register ExcelMapRegistry and FluentTableWriter in DI 2026-01-06 23:33:05 -05:00
Joseph Doherty 62baafb1b4 feat(ExcelIO): add FluentTableWriter using map registry 2026-01-06 23:31:26 -05:00
Joseph Doherty ccf70a9857 feat(ExcelIO): add fluent maps for SearchResult models 2026-01-06 23:29:20 -05:00
Joseph Doherty 14fdba2784 feat(Core): add SearchResults models as pure POCOs 2026-01-06 23:27:47 -05:00
Joseph Doherty 671f8ce357 test(ExcelIO): add unit tests for fluent mapping infrastructure 2026-01-06 23:26:11 -05:00
Joseph Doherty b48ef586ac feat(ExcelIO): add ExcelMapRegistry for DI integration 2026-01-06 23:23:57 -05:00
Joseph Doherty 45243aa3ca feat(ExcelIO): add ExcelClassMap base class with fluent Map method 2026-01-06 23:23:51 -05:00
Joseph Doherty 48180259d2 feat(ExcelIO): add ColumnBuilder fluent API 2026-01-06 23:22:56 -05:00
Joseph Doherty 6c58394640 feat(ExcelIO): add ExcelFormats constants 2026-01-06 23:22:55 -05:00
Joseph Doherty bfbec425f4 feat(ExcelIO): add ColumnDefinition for fluent mapping 2026-01-06 23:21:28 -05:00
Joseph Doherty 90e47c27c6 feat(db-exporter): add work order step definition files 2026-01-06 18:25:34 -05:00
Joseph Doherty b2b8f71e0e chore: add *.zstd to gitignore 2026-01-06 18:22:39 -05:00
Joseph Doherty d2136cacf7 fix(DbExporter): fix compressed size calculation and clean up
- Move file size read after streams are disposed to get accurate compressed size
- Clean up definition files to use working example queries
- Add .gitignore for output directory
2026-01-06 17:06:16 -05:00
Joseph Doherty f61a64b059 feat(DbExporter): add ScadaBridge definition files
Add JSON definition files for exporting ScadaBridge tables:
- Config tables: OpcUaClients, LmxClients, Tags, TemplateScripts
- Provider tables: EmailProviders, SmsProviders, TeamsProviders
- Lookup tables: ScadaClientTypes, ScriptTypes, TriggerTypes, DataTypes
2026-01-06 17:01:43 -05:00
Joseph Doherty 48c96eb8f4 feat(DbExporter): add counting data reader for accurate row count
Wrap IDataReader with CountingDataReader to track rows as they're read
during protobuf serialization, fixing the export returning 0 rows.
2026-01-06 17:00:09 -05:00
Joseph Doherty 87a02d5368 feat(DbExporter): implement CLI entry point 2026-01-06 16:57:58 -05:00
Joseph Doherty ba11407be4 feat(DbExporter): implement verify and verify-full
Add Verifier class that reads exported .pb.zstd files and:
- Deserializes protobuf data through zstd decompression
- Extracts schema information (column names and types)
- Counts rows for verification
- Optionally computes SHA256 hash and compares against sidecar file
2026-01-06 16:55:18 -05:00