Commit Graph

193 Commits

Author SHA1 Message Date
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
Joseph Doherty 6f58bfd8cc feat(DbExporter): implement database export with protobuf+zstd
Adds DatabaseExporter class that exports query results to compressed
protobuf format. Supports SQL Server and Oracle providers with streaming
compression and SHA256 hash verification.
2026-01-06 16:52:43 -05:00
Joseph Doherty b497f018dd feat(DbExporter): create project structure and definition model
Add DbExporter tool project with:
- Project file targeting .NET 10 with required packages
  (protobuf-net-data, ZstdSharp.Port, Microsoft.Data.SqlClient,
  Oracle.ManagedDataAccess.Core)
- ExportDefinition model for JSON-based export configuration
- Placeholder Program.cs entry point
2026-01-06 16:49:59 -05:00
Joseph Doherty 6a8250ef60 docs: update DevEtlRegistry comment for protobuf 2026-01-06 16:44:25 -05:00
Joseph Doherty 81f0c3f289 chore: remove obsolete JSON source files 2026-01-06 16:43:53 -05:00
Joseph Doherty ead3496cdf refactor: migrate all DevEtl files to protobuf source
Replace JsonZstdFileSource with ProtobufZstdFileSource across all 20
DevEtl pipeline files. This removes the need for manually defined
JsonColumnSchema arrays as protobuf files embed their schema.

Changes per file:
- Remove using JdeScoping.DataSync.Dev.Models
- Remove private JsonColumnSchema[] Schema array
- Change CacheFileName from .json.zstd to .pb.zstd
- Change WithSource from JsonZstdFileSource to ProtobufZstdFileSource
2026-01-06 16:42:56 -05:00
Joseph Doherty ca63b674f5 refactor: migrate BranchDevEtl to protobuf source 2026-01-06 16:40:19 -05:00
Joseph Doherty 055406431d feat: add ProtobufZstdFileSource for reading protobuf cache files 2026-01-06 16:39:35 -05:00
Joseph Doherty d503fec7cc deps: add protobuf-net-data to DataSync.Dev 2026-01-06 16:38:47 -05:00
Joseph Doherty 896ce59d8e docs: update specs and architecture docs with usp_/fn_ naming convention 2026-01-06 16:07:34 -05:00
Joseph Doherty 2c82ac78e3 test: update test to use SqlObjects.SubmitSearch constant 2026-01-06 16:05:06 -05:00
Joseph Doherty e5b9c18352 feat(data-access): add SqlObjects constants and update references
Add centralized SqlObjects class with constants for stored procedure
and function names using usp_/fn_ prefixes. Update LotFinderRepository
and MisQueryBuilder to use the new naming convention.
2026-01-06 15:50:21 -05:00