38031cb189
Phone fix: shifts/jobs showed Facility.Phone, but unnamed ads all share one placeholder facility, so every such listing displayed the same stale number while the ad's real phone sat unused in the description. ContactMethod is now attachable to a Shift/JobOpening (not just talent); ingestion stores the ad's own number(s) on each listing and the detail pages render them (new _ContactList partial), falling back to the facility phone only when the ad had none. Migration ShiftJobContacts (nullable owner FKs) — auto-applies on deploy. Stale applicants: skip «آماده به کار» posts older than 7 days at ingest, by the source's real timestamp (Telegram <time>, Bale date) or a Persian time-ago phrase in the text (Divar «۲ هفته پیش»). Recorded as Discarded; shifts/jobs are not aged out. Admin: Review page now shows a «مشاهده آگهی در منبع» link (RawListing.SourceUrl) so the source post can be checked before publishing. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
32 lines
1.0 KiB
C#
32 lines
1.0 KiB
C#
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; }
|
|
}
|