213faadf55
Job alerts (هشدار شغلی): users save what they want — scope (shift/job/both), role, city, shift type, employment type, minimum pay — and get notified when an employer posts a match. New JobAlert model + AlertScope enum + DbContext (user-cascade, role set-null, IsActive index) + migration. /Me/Alerts page to create/pause/delete alerts; entry point added to the کارجو panel. NotificationService.NotifyNewShift/Job now unions preference matches with active-alert matches (deduped) so alert owners are notified on publish. Help page gains an 'امکانات همکادر' capability showcase grid (with a 'ساخت هشدار شغلی' CTA) so the page demonstrates what the app does. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
38 lines
1.4 KiB
C#
38 lines
1.4 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace JobsMedical.Web.Models;
|
|
|
|
/// <summary>
|
|
/// A saved job alert ("هشدار شغلی") — the user describes what they're after (kind, role, city,
|
|
/// shift type, employment type, minimum pay). When an employer publishes a matching shift/job,
|
|
/// the matching engine notifies the owner. A user can keep several alerts; each can be paused.
|
|
/// </summary>
|
|
public class JobAlert
|
|
{
|
|
public int Id { get; set; }
|
|
|
|
public int UserId { get; set; }
|
|
public User User { get; set; } = null!;
|
|
|
|
[MaxLength(120)] public string? Label { get; set; } // optional friendly name
|
|
|
|
public AlertScope Scope { get; set; } = AlertScope.Any;
|
|
|
|
public int? RoleId { get; set; } // null = any role
|
|
public Role? Role { get; set; }
|
|
|
|
public int? CityId { get; set; } // null = any city
|
|
public City? City { get; set; }
|
|
|
|
public int? DistrictId { get; set; } // null = any district
|
|
|
|
public ShiftType? ShiftType { get; set; } // for shifts; null = any
|
|
public EmploymentType? EmploymentType { get; set; } // for jobs; null = any
|
|
|
|
/// <summary>Minimum acceptable pay (تومان): per-shift amount for shifts, monthly salary for jobs.</summary>
|
|
public long? MinPay { get; set; }
|
|
|
|
public bool IsActive { get; set; } = true;
|
|
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
|
}
|