Commit Graph

197 Commits

Author SHA1 Message Date
Joseph Doherty cc555e4e34 feat(configmanager): add SearchFormViewModel
Implements Task 18 from phases 7-9 plan. SearchFormViewModel wraps
SearchSection model with properties for MaxResultRows, TimeoutSeconds,
and MaxConcurrentSearches. Includes full test coverage with 7 tests
verifying initialization, two-way binding, change notification, and
null argument handling.
2026-01-19 19:45:07 -05:00
Joseph Doherty 64518c7000 feat(configmanager): add DataAccessFormViewModel 2026-01-19 19:42:10 -05:00
Joseph Doherty c416544efe feat(configmanager): add DataSyncFormViewModel
Add form ViewModel that wraps DataSyncSection model for two-way binding
with change tracking in the ConfigManager UI.
2026-01-19 19:40:31 -05:00
Joseph Doherty c22e2ed877 feat(configmanager): add MainWindowViewModel with service wiring
Complete MainWindowViewModel implementation with:
- Constructor injection for IConfigFileService, IValidationService,
  IBackupService, IAutoDiscoveryService, and ILogger
- Properties: ConfigFolderPath, HasUnsavedChanges, ValidationStatus,
  ValidationStatusColor, SelectedNode, SelectedFormViewModel, TreeNodes
- Commands: OpenFolderCommand, SaveCommand, ExitCommand, UndoCommand,
  RedoCommand, ValidateCommand, TestConnectionCommand
- Methods: InitializeAsync, OpenFolderAsync, LoadConfigAsync,
  BuildTreeNodes, OnSelectedNodeChanged, SaveAsync, Validate,
  TestConnectionAsync

Update App.axaml.cs to register all services in DI container:
- IFileSystem -> FileSystem (singleton)
- IAutoDiscoveryService -> AutoDiscoveryService (singleton)
- IBackupService -> BackupService (singleton)
- IDiffService -> DiffService (singleton)
- IValidationService -> ValidationService (singleton)
- IConfigFileService -> ConfigFileService (scoped)
- MainWindowViewModel (transient)

Wire MainWindow.DataContext to resolved MainWindowViewModel.
2026-01-19 17:53:25 -05:00
Joseph Doherty 8caaa8ee54 feat(configmanager): add TreeNodeViewModel 2026-01-19 17:51:15 -05:00
Joseph Doherty e9fc764650 feat(configmanager): add MainWindow view 2026-01-19 17:49:04 -05:00
Joseph Doherty 9677b751e6 feat(configmanager): add AutoDiscoveryService with tests
Add service for auto-discovering configuration file locations. The
service searches in prioritized order:
1. JDESCOPING_CONFIG_PATH environment variable
2. Same directory as executable
3. ../JdeScoping.Host/ relative to executable
4. User config directory (~/.jdescoping on Unix, %LOCALAPPDATA%\JdeScoping on Windows)

Includes 9 unit tests covering all search locations, priority order,
edge cases (missing directory, missing appsettings.json), and
cancellation token support.
2026-01-19 17:47:03 -05:00
Joseph Doherty 68da728cdf feat(configmanager): add DiffService with tests 2026-01-19 17:44:28 -05:00
Joseph Doherty c8f3c0060d feat(configmanager): add ValidationService with tests 2026-01-19 17:42:14 -05:00
Joseph Doherty 0e441898a6 feat(configmanager): add BackupService with tests 2026-01-19 17:40:22 -05:00
Joseph Doherty 54620ccb2e feat(configmanager): add ConfigFileService with tests
Add config file loading and saving service following TDD approach:
- IConfigFileService interface for loading/saving config files
- ConfigLoadException for descriptive error handling
- ConfigFileService implementation with JSON serialization
- Unit tests with mocked IFileSystem dependency
2026-01-19 17:38:20 -05:00
Joseph Doherty 4335286560 feat(configmanager): add configuration models 2026-01-19 17:36:10 -05:00
Joseph Doherty 0e1bb6aa35 feat(configmanager): add MVVM base classes 2026-01-19 17:34:53 -05:00
Joseph Doherty c055bc6c78 feat(configmanager): add IFileSystem abstraction
Add file system abstraction to enable testability for file operations.
- IFileSystem interface with common file operations
- FileSystem implementation wrapping System.IO
- Unit tests for FileExists functionality
2026-01-19 17:33:39 -05:00
Joseph Doherty 54d4fd0eb6 feat(configmanager): add test project 2026-01-19 17:31:23 -05:00
Joseph Doherty 4ab17259d6 feat(configmanager): create initial project structure 2026-01-19 17:29:08 -05:00
Joseph Doherty fbe58a81e4 refactor(securestoremanager): add platform service abstractions and constants
Implement deferred code review findings:
- Add IDialogService/IClipboardService interfaces for testable platform operations
- Create AvaloniaDialogService and AvaloniaClipboardService implementations
- Extract dialog strings and file extensions to centralized Constants classes
- Refactor ViewModels to use DI instead of event delegates
- Update tests to use mock services
2026-01-19 16:54:35 -05:00
Joseph Doherty 1c546c111a fix: resolve test failures from timezone conversion and interface rename
- Fix CriteriaSheetGenerator.FormatTimestamp to handle all DateTimeKind values
- Update TestWebApplicationFactory to use IAuthenticationService
- Add logger parameter to ExcelParserServiceTests
- Add SecureStoreManager to solution under /utils/ folder
2026-01-19 14:55:22 -05:00
Joseph Doherty 604bfe919c refactor: address code review findings across all projects
Apply comprehensive fixes from code reviews including:
- Extract shared utilities (SqlFormatHelper, CellValueConverter, DbDestinationBase)
- Add interface abstractions (IAuthenticationService, IDatabaseMigrator, IMisQueryBuilder)
- Implement SecureStore for encrypted secrets storage
- Fix error handling with proper HTTP status codes and logging
- Optimize double enumeration in DevEtlRegistry
- Add DataSync.Dev README for developer onboarding
- Extract filter panel base classes to reduce duplication
- Update code review docs to mark all issues as fixed
2026-01-19 11:05:36 -05:00
Joseph Doherty 08f5aa1447 docs: add MisData archival implementation and unit test report
Document the MisData_Curr/Hist table split in architecture docs, add
post-sync archival scripts to move BackLevel records to history table,
and generate comprehensive unit test report (856 tests, 100% pass rate).
2026-01-19 04:03:25 -05:00
Joseph Doherty 1e5b1bb3da feat(database): split MisData into archival tables
Split MisData table into MisData_Curr (Status='Current') and
MisData_Hist (Status='BackLevel') following existing archival pattern.

- Add MisData_Curr and MisData_Hist table scripts
- Create MisData view (UNION ALL) for backward compatibility
- Update production and DEV pipeline configurations
- Update unit tests for new table count (22 tables)
- Update database documentation
2026-01-19 01:08:37 -05:00
Joseph Doherty 5a798b089b feat(excelio): allow DeleteRows on protected worksheets
Enable users to delete rows in protected Excel worksheets for better
data management flexibility.
2026-01-19 00:44:13 -05:00
Joseph Doherty 0c8657713b refactor(core): reorganize DTOs into Models and ViewModels folders
Move DTOs from ApiContracts to appropriate locations:
- SignalR DTOs → ViewModels (renamed Dto→ViewModel suffix)
- Pipeline DTOs → Models/Pipelines
- UserInfoDto → Models/Auth
- DataUpdateDto → Models/Infrastructure
2026-01-19 00:34:57 -05:00
Joseph Doherty 7e36bb4225 refactor: remove unused classes and consolidate ViewModels in Core
Remove 9 unused types from Core (duplicate extension classes, TableSpec, ColumnSpec, LotLocation), move ComponentLotViewModel and OperatorViewModel from Client to Core, and refactor DataSync.Dev to use pipeline-based configuration. Fix Login.razor to use UserInfoDto directly.
2026-01-19 00:13:12 -05:00
Joseph Doherty 80057590f4 feat(client): add pipeline viewer to navigation
Add navigation link to the ETL Pipeline Viewer page in the main navigation
bar, providing easy access for users to monitor and inspect pipeline
configurations and execution status.
2026-01-07 08:25:25 -05:00
Joseph Doherty dc927e2f71 feat(client): add PipelineViewer page
Add admin page for viewing ETL pipeline configurations with:
- Pipeline selector dropdown (alphabetical list)
- Status summary table (type, last run, success, next required, status)
- Execution history table with paging (10 per page)
- Source, destination, and scripts info cards
- Three PipelineScheduleSection components for Mass, Daily, Hourly schedules
- SQL modal integration for viewing queries and scripts
2026-01-07 08:18:57 -05:00
Joseph Doherty 2a15028e00 feat(client): add PipelineApiClient and admin components
- Add IPipelineApiClient interface in Core ApiContracts
- Add PipelineApiClient implementation extending ApiClientBase
- Create Components/Admin directory for admin UI components
- Add SqlQueryModal component for displaying SQL queries with copy-to-clipboard
- Add PipelineScheduleSection component for pipeline schedule display
- Register IPipelineApiClient in Program.cs DI container
- Add Admin components namespace to _Imports.razor
2026-01-07 08:14:37 -05:00
Joseph Doherty 676f090fc8 feat(api): add PipelineController and factory methods for pipeline viewer
- Add GetAvailableTables, GetPipelineConfig, GetScheduleDefaults to IEtlPipelineFactory
- Implement new methods in EtlPipelineFactory
- Create PipelineController with endpoints:
  - GET /api/pipelines - list all pipeline names
  - GET /api/pipelines/{name} - get pipeline configuration
  - GET /api/pipelines/{name}/status - get schedule status
  - GET /api/pipelines/{name}/executions - get execution history
- Add JdeScoping.DataSync reference to JdeScoping.Api
2026-01-07 08:06:45 -05:00
Joseph Doherty 33a04f4022 feat(datasync): implement GetRecentUpdatesAsync and GetLastRunsAsync
- GetRecentUpdatesAsync: Returns last N DataUpdate records for a table,
  optionally filtered by UpdateType, ordered by StartDt descending
- GetLastRunsAsync: Returns the most recent run (successful or not) for
  each UpdateType for a given table using a CTE with ROW_NUMBER
2026-01-07 08:01:23 -05:00
Joseph Doherty f3ad38b954 feat(datasync): add repository methods for pipeline viewer
Add GetRecentUpdatesAsync and GetLastRunsAsync interface methods to
IDataUpdateRepository to support the pipeline viewer feature.
2026-01-07 08:00:38 -05:00
Joseph Doherty 18f368fdb2 feat(core): add pipeline API routes 2026-01-07 07:58:50 -05:00
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 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