2026-08-26 09:12:48 -03:00
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
2024-09-28 14:58:36 -04:00
|
|
|
|
|
|
|
|
|
|
namespace Data.SeaHavenIndustries
|
|
|
|
|
|
{
|
|
|
|
|
|
public class Locations : FullAuditEntity
|
|
|
|
|
|
{
|
2026-04-28 18:55:14 -05:00
|
|
|
|
public int Id { get; set; }
|
2026-08-26 09:12:48 -03:00
|
|
|
|
public int? AccountId { get; set; }
|
|
|
|
|
|
[ForeignKey(nameof(AccountId))]
|
|
|
|
|
|
public Accounts? Account { get; set; }
|
2024-09-28 14:58:36 -04:00
|
|
|
|
public string? Title { get; set; }
|
|
|
|
|
|
public string? Name { get; set; }
|
2026-04-28 18:55:14 -05:00
|
|
|
|
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; }
|
Add LocationController with full CRUD and extended model
- Extend Locations model with Address, City, State, ZipCode, Phone, Contact, ContactEmail, Status, AccountId
- Update Location DTOs to match new fields
- Create LocationController with paged list, get by ID, create, update, delete
- Support both REST-style routes (/api/Location/{id}) and legacy query routes (/api/Location/DeleteLocation?id=)
- Add migration for new Location columns
2026-04-16 17:09:59 -04:00
|
|
|
|
public string? City { get; set; }
|
|
|
|
|
|
public string? State { get; set; }
|
2026-04-28 18:55:14 -05:00
|
|
|
|
public string? Zip { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
// Contact fields - match actual database columns
|
|
|
|
|
|
public string? PhoneNumber { get; set; }
|
|
|
|
|
|
public string? Email { get; set; }
|
Add LocationController with full CRUD and extended model
- Extend Locations model with Address, City, State, ZipCode, Phone, Contact, ContactEmail, Status, AccountId
- Update Location DTOs to match new fields
- Create LocationController with paged list, get by ID, create, update, delete
- Support both REST-style routes (/api/Location/{id}) and legacy query routes (/api/Location/DeleteLocation?id=)
- Add migration for new Location columns
2026-04-16 17:09:59 -04:00
|
|
|
|
public string? Status { get; set; }
|
2026-07-24 22:13:25 -03:00
|
|
|
|
public string? ExternalSource { get; set; }
|
|
|
|
|
|
public string? ExternalLocationId { get; set; }
|
2026-04-28 18:55:14 -05:00
|
|
|
|
|
2026-09-25 11:19:29 -03:00
|
|
|
|
/// <summary>Free-text site notes, edited from the work-order Site dialog.</summary>
|
|
|
|
|
|
public string? Notes { get; set; }
|
|
|
|
|
|
|
2026-04-28 18:55:14 -05:00
|
|
|
|
// Navigation Properties
|
2024-09-28 14:58:36 -04:00
|
|
|
|
public ICollection<Template>? Templates { get; set; }
|
|
|
|
|
|
public ICollection<WorkOrder>? workOrders { get; set; }
|
2026-09-14 21:44:45 -03:00
|
|
|
|
|
|
|
|
|
|
// SH-138: site contacts (soft-deleted rows stay for historical WorkOrderContacts)
|
|
|
|
|
|
public ICollection<Contacts>? Contacts { get; set; }
|
2024-09-28 14:58:36 -04:00
|
|
|
|
}
|
|
|
|
|
|
}
|