shoc-backend/Api.SeaHavenIndustries/DTOs/EditLocation_DTO.cs
Alexandre Brandizzi c3865e56ac Sites API: site code uniqueness, soft delete with role check, open work orders, site notes
- Reject duplicate site codes per client (case-insensitive); site code is immutable once set
- Delete tombstones the site and requires the DeleteSites permission (Admin, Scheduler)
- GET /api/locations/{id}/open-work-orders returns the open count and ids
- PATCH /api/locations/{id}/contact-info saves contacts and notes from the work-order Site dialog
- Add nullable Locations.Notes, used as the site-level POC notes fallback
2026-09-25 11:19:29 -03:00

37 lines
1.2 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 string? Notes { get; set; }
public List<SiteContactInput_DTO>? Contacts { 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
};
}
}
}