shoc-backend/Data.SeaHavenIndustries/Models/Contacts.cs
npalOmega cd78c93fa8 fix
2026-01-21 16:24:54 -06:00

46 lines
1.5 KiB
C#

using System;
using System.ComponentModel.DataAnnotations.Schema;
namespace Data.SeaHavenIndustries
{
public class Contacts : FullAuditEntity
{
public string? Title { get; set; }
public string? Owner { get; set; }
public string? FirstName { get; set; }
public string? MiddleName { get; set; }
public string? LastName { get; set; }
public string? ContactType { get; set; }
public string? PhoneNumber { get; set; }
public string? Email { get; set; }
// Address fields
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; }
// Social Media
public string? FacebookUrl { get; set; }
public string? LinkedInUrl { get; set; }
public string? TwitterUrl { get; set; }
// Foreign Keys
public int? LocationId { get; set; }
public int? AccountId { get; set; }
// Navigation Properties
[ForeignKey(nameof(LocationId))]
public Locations? Location { get; set; }
[ForeignKey(nameof(AccountId))]
public Accounts? Account { get; set; }
public ICollection<WorkOrderContacts>? WorkOrderContacts { get; set; }
// Computed property for full name
[NotMapped]
public string? FullName => $"{FirstName} {MiddleName} {LastName}".Trim();
}
}