Commit Graph

177 Commits

Author SHA1 Message Date
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
Joseph Doherty b797f55ac5 refactor(db): rename stored procedures to usp_ and function to fn_ prefix 2026-01-06 15:48:58 -05:00
Joseph Doherty 4e3e1c9df3 docs: add SQL naming convention implementation plan 2026-01-06 15:47:17 -05:00
Joseph Doherty f138b1ae59 docs: add MatchMIS function to naming convention design 2026-01-06 15:45:24 -05:00
Joseph Doherty 5c1ef7136e docs: add stored procedure naming convention design 2026-01-06 15:43:22 -05:00
Joseph Doherty cd68b2c655 fix: read file size after streams are closed in converter 2026-01-06 15:39:47 -05:00
Joseph Doherty 6ebd78d487 feat: add parallel file conversion support to cache converter
- Add optional third parameter for parallelism (default: 8)
- Use Parallel.ForEachAsync for concurrent file processing
- Thread-safe console output with lock
- Thread-safe size counters with Interlocked

Usage: dotnet run -- <cache-dir> <scripts-dir> [parallelism]
2026-01-06 15:35:00 -05:00
Joseph Doherty 645ef46f35 refactor(data-access): replace TVP lookups with STRING_SPLIT and OPENJSON
Remove dependency on deleted SQL Server Table-Valued Parameter types
by refactoring lookup methods to use built-in SQL Server functions:

- Simple single-value lookups (Items, WorkOrders, WorkCenters,
  ProfitCenters, Users) now use STRING_SPLIT with comma-separated
  strings from C#
- Complex multi-column lookup (Lots with LotNumber + ItemNumber)
  now uses OPENJSON with JSON string from C#

This eliminates the need for TVP type definitions (scripts 033-039)
while maintaining equivalent functionality.
2026-01-06 15:34:39 -05:00
Joseph Doherty c6aeb20d9c docs: update documentation for extraction functions migration
- Add ExtractionFunctions.md reference document
- Update database-schema spec with 11 extraction functions
- Update data-access spec to document extraction function approach
- Update search-processing spec with new query builder interface
- Add Database.Tests to Testing.md architecture doc
- Update DataFlow.md with extraction function flow
2026-01-06 14:54:10 -05:00
Joseph Doherty 35c1e6baf0 refactor: use SQL schema and streaming in converter
- Read schema from SQL CREATE TABLE scripts instead of inferring from JSON
- Stream JSON records using Utf8JsonReader instead of loading all into memory
- Write protobuf output in batches of 10000 rows to reduce memory usage
- Add mapping from cache file names to SQL scripts and table names
- Map SQL types (VARCHAR, BIGINT, DECIMAL, DATETIME2, BIT) to .NET types
- Update usage to require scripts directory as second argument
2026-01-06 14:39:22 -05:00
Joseph Doherty 691a6d1ffd refactor(data-access): remove TVP code and simplify SearchModel
- Remove all List<*FilterEntry> properties and *FilterEnabled computed properties from SearchModel
- Delete TableValuedParameterExtensions.cs
- Delete entire FilterEntries folder and all filter entry model classes
- Delete FilterHandlers folder and all filter handler classes
- Delete IFilterHandler interface and FilterResult model
- Update MisQueryBuilder to use SQL extraction functions instead of model properties
- Update SearchProcessor to get ExtractMisData from database using fn_GetSearchExtractMisData
- Update DependencyInjection to remove filter handler registrations
- Delete obsolete tests for TVP extensions and filter handlers

Filter criteria are now stored as JSON in Search.Criteria column and extracted using SQL functions (fn_GetSearch*) during query execution.
2026-01-06 14:32:03 -05:00
Joseph Doherty a2a8bb3e9f refactor(datasync): remove obsolete DataSourceConfig properties 2026-01-06 14:25:46 -05:00
Joseph Doherty 8b1dfeb6c6 fix: address code review issues in converter tool 2026-01-06 14:24:23 -05:00
Joseph Doherty edd07858a1 refactor(datasync): remove obsolete appsettings properties
Remove legacy ETL properties from DataSources configuration:
- FetcherTypeName (9 entries)
- PostProcessorTypeName (1 entry - MisData)
- PrepurgeData from MassConfig (9 entries)
- ReIndexData from MassConfig (9 entries)

These properties were used by the old fetcher-based ETL system
and are no longer needed with the new EtlPipeline architecture.
2026-01-06 14:24:19 -05:00
Joseph Doherty 3c728dd575 refactor(datasync): update tests to remove FetcherTypeName
- Remove FetcherTypeName assignments from test fixtures in ScheduleCheckerTests
  and SyncOrchestratorTests
- Remove PrepurgeData and ReIndexData assignments from MassConfig in tests
- Mark FetcherTypeName, PostProcessorTypeName, PrepurgeData, and ReIndexData
  as obsolete with deprecation warnings pointing to pipelines.json
- Change FetcherTypeName from required to optional to allow tests to compile
  without providing the deprecated property
2026-01-06 14:22:26 -05:00
Joseph Doherty 6d08fd4a6c feat: add protobuf cache converter tool
Add standalone CLI tool to convert zstd-compressed JSON cache files
to zstd-compressed Protocol Buffers format for faster deserialization.
2026-01-06 14:21:46 -05:00
Joseph Doherty edff5859b9 docs: add protobuf cache conversion implementation plan
10-task plan covering converter tool creation, ProtobufZstdFileSource,
DevEtl migrations, and cleanup of obsolete JSON source files.
2026-01-06 14:18:27 -05:00