style(backend): format changed architecture files

This commit is contained in:
Alexandre Brandizzi 2026-07-24 12:13:51 -03:00
parent f6e71edd00
commit ce7d612ac9
5 changed files with 75 additions and 75 deletions

View file

@ -55,9 +55,9 @@ namespace SeaHaven.DataServices.Implementation
}
public async Task<(IEnumerable<Dispatch> Items, int TotalCount)> GetPagedAsync(
int page,
int pageSize,
string? search = null,
int page,
int pageSize,
string? search = null,
string? status = null)
{
var query = _context.Dispatches.AsQueryable();
@ -414,22 +414,22 @@ namespace SeaHaven.DataServices.Implementation
.ToListAsync(cancellationToken);
var rawComments = await (from c in _context.Comments
where c.DispatchId == id && (c.IsDeleted == null || c.IsDeleted == false)
join u in _context.Users on c.UserId equals u.Id into users
from u in users.DefaultIfEmpty()
orderby c.CreatedDate
select new
{
c.Id,
c.Commenttext,
c.Commenter,
c.CommentType,
c.RecordType,
c.CreatedDate,
c.UserId,
UserFirstName = u != null ? u.FirstName : null,
UserLastName = u != null ? u.LastName : null
})
where c.DispatchId == id && (c.IsDeleted == null || c.IsDeleted == false)
join u in _context.Users on c.UserId equals u.Id into users
from u in users.DefaultIfEmpty()
orderby c.CreatedDate
select new
{
c.Id,
c.Commenttext,
c.Commenter,
c.CommentType,
c.RecordType,
c.CreatedDate,
c.UserId,
UserFirstName = u != null ? u.FirstName : null,
UserLastName = u != null ? u.LastName : null
})
.ToListAsync(cancellationToken);
var comments = rawComments.Select(c => new DispatchCommentDTO
@ -446,25 +446,25 @@ namespace SeaHaven.DataServices.Implementation
}).ToList();
var rawUplifts = await (from u in _context.DispatchUpliftRequests
where u.DispatchId == id && (u.IsDeleted == null || u.IsDeleted == false)
join dec in _context.Users on u.DecidedByUserId equals dec.Id into decs
from dec in decs.DefaultIfEmpty()
orderby u.CreatedDate descending
select new
{
u.Id,
u.CurrentNTE,
u.RequestedNTE,
u.VendorReason,
u.Status,
u.RequiredTier,
u.RequestedByVendorName,
RequestedAt = u.CreatedDate,
u.DecidedAt,
u.DecisionNote,
DecidedByFirstName = dec != null ? dec.FirstName : null,
DecidedByLastName = dec != null ? dec.LastName : null
})
where u.DispatchId == id && (u.IsDeleted == null || u.IsDeleted == false)
join dec in _context.Users on u.DecidedByUserId equals dec.Id into decs
from dec in decs.DefaultIfEmpty()
orderby u.CreatedDate descending
select new
{
u.Id,
u.CurrentNTE,
u.RequestedNTE,
u.VendorReason,
u.Status,
u.RequiredTier,
u.RequestedByVendorName,
RequestedAt = u.CreatedDate,
u.DecidedAt,
u.DecisionNote,
DecidedByFirstName = dec != null ? dec.FirstName : null,
DecidedByLastName = dec != null ? dec.LastName : null
})
.ToListAsync(cancellationToken);
var upliftRequests = rawUplifts.Select(u => new DispatchUpliftRequestDTO
@ -488,24 +488,24 @@ namespace SeaHaven.DataServices.Implementation
var workOrderIds = linkedWOs.Select(l => l.WorkOrderId).Where(wid => wid > 0).ToList();
var rawAudit = await (from a in _context.WorkOrderAuditLogs
where workOrderIds.Contains(a.WorkOrderId)
&& a.FieldName != null
&& a.FieldName.Contains(dispatchNumber)
join u in _context.Users on a.UserId equals u.Id into users
from u in users.DefaultIfEmpty()
orderby a.CreatedAt descending
select new
{
a.Id,
a.Action,
a.FieldName,
a.OldValue,
a.NewValue,
a.CreatedAt,
a.UserId,
UserFirstName = u != null ? u.FirstName : null,
UserLastName = u != null ? u.LastName : null
})
where workOrderIds.Contains(a.WorkOrderId)
&& a.FieldName != null
&& a.FieldName.Contains(dispatchNumber)
join u in _context.Users on a.UserId equals u.Id into users
from u in users.DefaultIfEmpty()
orderby a.CreatedAt descending
select new
{
a.Id,
a.Action,
a.FieldName,
a.OldValue,
a.NewValue,
a.CreatedAt,
a.UserId,
UserFirstName = u != null ? u.FirstName : null,
UserLastName = u != null ? u.LastName : null
})
.ToListAsync(cancellationToken);
var auditLog = rawAudit.Select(a => new DispatchAuditLogDTO

View file

@ -37,16 +37,16 @@ namespace SeaHaven.DataServices.Implementation
}
public async Task<(IEnumerable<Locations> Items, int TotalCount)> GetPagedAsync(
int page,
int pageSize,
int page,
int pageSize,
string? search = null)
{
var query = _context.Locations.AsQueryable();
if (!string.IsNullOrWhiteSpace(search))
{
query = query.Where(l =>
l.Name!.Contains(search) ||
query = query.Where(l =>
l.Name!.Contains(search) ||
l.City!.Contains(search));
}

View file

@ -106,11 +106,11 @@ namespace SeaHaven.DataServices.Implementation
ContactId = s.ContactId,
Date = s.Date,
Lineitems = s.LineItems!.Select(q => new QuoteLineItemReadModel
{
Descriptions = q.Descriptions,
Lineitem = q.Lineitem,
LineitemNumber = q.LineitemNumber
}).ToList(),
{
Descriptions = q.Descriptions,
Lineitem = q.Lineitem,
LineitemNumber = q.LineitemNumber
}).ToList(),
})
.ToListAsync(cancellationToken);
@ -137,10 +137,10 @@ namespace SeaHaven.DataServices.Implementation
BillingAddress = s.BillingAddress,
ShippingAddress = s.ShippingAddress,
Lineitems = s.LineItems!.Select(q => new QuoteLineItemReadModel
{
Descriptions = q.Descriptions,
Lineitem = q.Lineitem
}).ToList(),
{
Descriptions = q.Descriptions,
Lineitem = q.Lineitem
}).ToList(),
TotalAmount = s.LineItems!.Sum(l => l.Lineitem ?? 0)
})
.FirstOrDefaultAsync(cancellationToken);

View file

@ -54,7 +54,7 @@ namespace SeaHaven.Services.Implementation
public async Task<PagedResult<FollowUpDTO>> GetFollowUpsPagedAsync(int page, int pageSize, string? search = null, string? status = null)
{
var (items, totalCount) = await _followUpDataService.GetPagedAsync(page, pageSize, search);
var filteredItems = items.AsEnumerable();
if (!string.IsNullOrWhiteSpace(status))
{

View file

@ -180,11 +180,11 @@ namespace SeaHaven.Services.Implementation
private static QuoteLineItemDTO MapLineItem(
SeaHaven.DataServices.Models.QuoteLineItemReadModel item) => new()
{
Descriptions = item.Descriptions,
Lineitem = item.Lineitem,
LineitemNumber = item.LineitemNumber
};
{
Descriptions = item.Descriptions,
Lineitem = item.Lineitem,
LineitemNumber = item.LineitemNumber
};
private static string FormatAmount(decimal amount) => $"${amount}";
}