- Created ComplianceNFs.Core project with domain entities and ports - Implemented BuyingRecord, EnergyInvoice, ParsedInvoice entities - Defined domain interfaces for mail listening, XML and PDF parsing, and repository access - Established ComplianceNFs.Infrastructure project with file archiving, mail listening, and data access implementations - Developed PDF and XML parsers for invoice data extraction - Set up AccessDbRepository and AttachmentRepository for data retrieval and storage - Created ComplianceNFs.Service project for background processing and service orchestration - Implemented Worker service for periodic tasks - Established ComplianceNFs.Monitor project with WPF UI for monitoring invoice statuses - Added ViewModel for UI data binding and command handling - Configured project files for .NET 9.0 and necessary package references - Created initial appsettings.json for configuration management - Added TODOs and roadmap for future development
102 lines
3.3 KiB
Markdown
102 lines
3.3 KiB
Markdown
# ComplianceNFs TODOs and Roadmap
|
|
|
|
## TODOs in Codebase
|
|
|
|
### ComplianceNFs.Infrastructure/Archiving/FileArchiver.cs
|
|
|
|
- [x] FileArchiver.ArchiveAsync: Create subfolder for invoice.Status, move file
|
|
|
|
### ComplianceNFs.Infrastructure/Mail/MailListener.cs
|
|
|
|
- [x] MailListener.StartListening: Connect to mailbox, filter by allowlist, raise NewMailReceived
|
|
|
|
### ComplianceNFs.Infrastructure/Parsers/PdfParser.cs
|
|
|
|
- [x] PdfParser.Parse: Use iTextSharp or PdfSharp to extract text/numbers via regex
|
|
|
|
### ComplianceNFs.Infrastructure/Parsers/XmlParser.cs
|
|
|
|
- [x] XmlParser.Parse: Use System.Xml to parse known elements
|
|
|
|
### ComplianceNFs.Infrastructure/Repositories/AccessDbRepository.cs
|
|
|
|
- [x] AccessDbRepository.GetByUnidade: Implement actual query to Access DB
|
|
|
|
- [x] AccessDbRepository.GetByUnidadeAndMonth: Implement actual query to Access DB
|
|
|
|
### ComplianceNFs.Infrastructure/Repositories/AttachmentRepository.cs
|
|
|
|
- [x] AttachmentRepository.SaveRawAsync: Implement actual insert into Postgres attachments table
|
|
|
|
- [x] AttachmentRepository.UpdateMatchAsync: Implement actual update in Postgres
|
|
|
|
### ComplianceNFs.Core/Application/Services
|
|
|
|
- [x] InvoiceIngestionService: Implement ingestion logic and subscribe to NewMailReceived
|
|
|
|
- [x] MatchingService: Implement invoice matching logic
|
|
|
|
- [x] ComplianceService: Implement compliance validation logic
|
|
|
|
- [x] NotificationService: Implement notification logic for mismatches
|
|
|
|
- [x] ArchivingService: Implement archiving logic for final status
|
|
|
|
### ComplianceNFs.Monitor/MonitorViewModel.cs
|
|
|
|
- [ ] MonitorViewModel: Inject IInvoiceStatusStream and subscribe to updates
|
|
|
|
- [ ] MonitorViewModel.ForceScan: Call service to force ingestion cycle
|
|
|
|
### ComplianceNFs.Service/Program.cs
|
|
|
|
- [ ] Register application services (InvoiceIngestionService, MatchingService, etc.)
|
|
|
|
---
|
|
|
|
## Roadmap to Finish the App
|
|
|
|
### 1. Infrastructure Layer
|
|
|
|
- [x] **FileArchiver**: Implement logic to create subfolders by `InvoiceStatus` and move files accordingly.
|
|
- [x] **MailListener**: Use MailKit to connect to IMAP/Exchange, filter by allowlist, and raise `NewMailReceived` event.
|
|
- [x] **PdfParser**: Integrate iTextSharp or PdfSharp, extract invoice data using regex.
|
|
- [x] **XmlParser**: Use System.Xml to parse invoice XMLs and map to `ParsedInvoice`.
|
|
- [x] **AccessDbRepository**: Implement queries to Access DB for buying records.
|
|
- [x] **AttachmentRepository**: Implement Postgres insert/update for invoice attachments.
|
|
|
|
### 2. Application Layer
|
|
|
|
- [x] Implement and register:
|
|
- InvoiceIngestionService
|
|
- MatchingService
|
|
- ComplianceService
|
|
- NotificationService
|
|
- ArchivingService
|
|
|
|
- [ ] Wire up these services in DI in `Program.cs`.
|
|
|
|
### 3. Service Host
|
|
|
|
- [ ] Ensure all services are registered and started in the Worker.
|
|
- [ ] Implement polling and retry logic as per configuration.
|
|
|
|
### 4. WPF Monitor
|
|
|
|
- [ ] Inject and subscribe to `IInvoiceStatusStream` in `MonitorViewModel`.
|
|
- [ ] Implement `ForceScan` to trigger ingestion from UI.
|
|
- [ ] Bind UI to show recent invoice status updates.
|
|
|
|
### 5. Configuration & Testing
|
|
|
|
- [ ] Test all configuration values from `appsettings.json`.
|
|
- [ ] Add error handling, logging, and validation.
|
|
- [ ] Write integration tests for end-to-end flow.
|
|
|
|
---
|
|
|
|
**Tip:**
|
|
|
|
- Tackle infrastructure TODOs first, then application services, then UI and orchestration.
|
|
- Use comments in code for any business logic or mapping details that need clarification.
|