Files
hamkadr/src/JobsMedical.Web/Models/ContactMethod.cs
T

32 lines
1.0 KiB
C#
Raw Normal View History

using System.ComponentModel.DataAnnotations;
namespace JobsMedical.Web.Models;
/// <summary>
/// One contact channel for a listing — an applicant («آماده به کار»), a <see cref="Shift"/>, or a
/// <see cref="JobOpening"/>. A listing can carry several — e.g. three phones + an email + an
/// Instagram page. <see cref="Value"/> holds the raw handle / number / address; <see cref="Type"/>
/// decides how it's linked (tel:, mailto:, t.me/…, etc.). Exactly one owner FK is set.
/// </summary>
public class ContactMethod
{
public int Id { get; set; }
// Owner — exactly one of these is non-null.
public int? TalentListingId { get; set; }
public TalentListing? TalentListing { get; set; }
public int? ShiftId { get; set; }
public Shift? Shift { get; set; }
public int? JobOpeningId { get; set; }
public JobOpening? JobOpening { get; set; }
public ContactType Type { get; set; }
[Required, MaxLength(250)]
public string Value { get; set; } = "";
public int SortOrder { get; set; }
}