mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-09-30 04:53:11 +00:00
- 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
40 lines
1.5 KiB
C#
40 lines
1.5 KiB
C#
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace Data.SeaHavenIndustries
|
|
{
|
|
public class Locations : FullAuditEntity
|
|
{
|
|
public int Id { get; set; }
|
|
public int? AccountId { get; set; }
|
|
[ForeignKey(nameof(AccountId))]
|
|
public Accounts? Account { get; set; }
|
|
public string? Title { get; set; }
|
|
public string? Name { get; set; }
|
|
public string? Latitude { get; set; }
|
|
public string? Longitude { get; set; }
|
|
|
|
// Address fields - match actual database columns
|
|
public string? Address1 { get; set; }
|
|
public string? Address2 { get; set; }
|
|
public string? City { get; set; }
|
|
public string? State { get; set; }
|
|
public string? Zip { get; set; }
|
|
|
|
// Contact fields - match actual database columns
|
|
public string? PhoneNumber { get; set; }
|
|
public string? Email { get; set; }
|
|
public string? Status { get; set; }
|
|
public string? ExternalSource { get; set; }
|
|
public string? ExternalLocationId { get; set; }
|
|
|
|
/// <summary>Free-text site notes, edited from the work-order Site dialog.</summary>
|
|
public string? Notes { get; set; }
|
|
|
|
// Navigation Properties
|
|
public ICollection<Template>? Templates { get; set; }
|
|
public ICollection<WorkOrder>? workOrders { get; set; }
|
|
|
|
// SH-138: site contacts (soft-deleted rows stay for historical WorkOrderContacts)
|
|
public ICollection<Contacts>? Contacts { get; set; }
|
|
}
|
|
}
|