- 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
42 lines
1.1 KiB
C#
42 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Net.Mail;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace ComplianceNFs.Core.Ports
|
|
{
|
|
public interface IMailListener
|
|
{
|
|
void StartListening();
|
|
event Action<MailMessage> NewMailReceived;
|
|
}
|
|
|
|
public interface IXmlParser
|
|
{
|
|
Entities.ParsedInvoice Parse(Stream xmlStream);
|
|
}
|
|
|
|
public interface IPdfParser
|
|
{
|
|
Entities.ParsedInvoice Parse(Stream pdfStream);
|
|
}
|
|
|
|
public interface IAccessDbRepository
|
|
{
|
|
IEnumerable<Entities.BuyingRecord> GetByUnidade(string codSmartUnidade);
|
|
IEnumerable<Entities.BuyingRecord> GetByUnidadeAndMonth(string codSmartUnidade, int month, int year);
|
|
}
|
|
|
|
public interface IAttachmentRepository
|
|
{
|
|
Task SaveRawAsync(Entities.EnergyInvoice invoice);
|
|
Task UpdateMatchAsync(int invoiceId, int matchedCodTE, Entities.InvoiceStatus status, string notes);
|
|
}
|
|
|
|
public interface IFileArchiver
|
|
{
|
|
Task ArchiveAsync(Entities.EnergyInvoice invoice, byte[] rawFile);
|
|
}
|
|
}
|