shoc-backend/Api.SeaHavenIndustries/DTOs/EditLocation_DTO.cs
Arthur Bassi 4e4bb0ca90 fix(locations): reject unparseable accountId and forward cancellation
Blank accountId stays optional; nonblank parse failures return 400. Account lookup uses ExistsActiveAsync with the request token.
2026-08-26 14:18:38 -03:00

35 lines
1.1 KiB
C#

using SeaHaven.Services.DTOs;
namespace Api.SeaHavenIndustries.DTOs
{
public class EditLocation_DTO
{
public int Id { get; set; }
public string? Title { get; set; }
public string? Name { get; set; }
public string? Address { get; set; }
public string? City { get; set; }
public string? State { get; set; }
public string? ZipCode { get; set; }
public string? Phone { get; set; }
public string? Contact { get; set; }
public string? ContactEmail { get; set; }
public string? Status { get; set; }
public string? AccountId { get; set; }
public int? GetAccountId() => LocationAccountIdMapping.ParseOptional(AccountId);
// ✅ Map API DTO to Service DTO
public UpdateLocationDTO ToServiceUpdateDTO()
{
return new UpdateLocationDTO
{
LocationName = this.Name,
Address = this.Address,
City = this.City,
State = this.State,
Zipcode = this.ZipCode
};
}
}
}