[Alerts] Customizable job alerts + Help capabilities showcase
CI/CD / CI · dotnet build (push) Successful in 1m8s
CI/CD / Deploy · hamkadr (push) Successful in 1m7s

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>
This commit is contained in:
soroush.asadi
2026-06-04 18:17:56 +03:30
parent 42deac1261
commit 213faadf55
11 changed files with 1727 additions and 3 deletions
+8
View File
@@ -76,6 +76,14 @@ public enum ListingKind
Job = 1
}
/// <summary>Which listing types a job alert watches.</summary>
public enum AlertScope
{
Any = 0, // هر دو (شیفت و استخدام)
Shifts = 1, // فقط شیفت
Jobs = 2 // فقط استخدام
}
/// <summary>
/// Gender. On a listing it's the requirement (Any = فرقی نمی‌کند); on a person it's their gender
/// (Any = unspecified).
+37
View File
@@ -0,0 +1,37 @@
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;
}