Refactor to use EnvelopeDto in report generation
Updated ReportCreator and ReportItem to accept EnvelopeDto instead of Envelope, promoting better separation of concerns and improved data handling via DTOs.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using DevExpress.Xpo;
|
||||
using DigitalData.Core.Abstraction.Application.Repository;
|
||||
using EnvelopeGenerator.Application.Common.Dto;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.ServiceHost.Exceptions;
|
||||
|
||||
@@ -7,7 +8,7 @@ namespace EnvelopeGenerator.ServiceHost.Jobs.FinalizeDocument;
|
||||
|
||||
public class ReportCreator(IRepository<EnvelopeReport> reportRepo)
|
||||
{
|
||||
public async Task<byte[]> CreateReportAsync(Envelope envelope, CancellationToken cancel = default)
|
||||
public async Task<byte[]> CreateReportAsync(EnvelopeDto envelope, CancellationToken cancel = default)
|
||||
{
|
||||
var reports = await reportRepo.Where(r => r.EnvelopeId == envelope.Id).ToListAsync(cancel);
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using EnvelopeGenerator.Application.Common.Dto;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
|
||||
@@ -7,7 +8,7 @@ public class ReportItem
|
||||
{
|
||||
public ReportItem() { }
|
||||
|
||||
public ReportItem(EnvelopeReport report, Envelope envelope)
|
||||
public ReportItem(EnvelopeReport report, EnvelopeDto envelope)
|
||||
{
|
||||
CreatorFullName = envelope.User is not null
|
||||
? $"{envelope.User.Prename} {envelope.User.Name}".Trim()
|
||||
|
||||
Reference in New Issue
Block a user