[Facilities] Public facility pages + ratings & reviews
New /Facilities/Details public page: verified badge, info, Neshan map + directions, the facility's open shifts & jobs, and a complaint form; facility cards on /Facilities link to it. Ratings & reviews: Review model (1-5 stars + comment, one per user/facility, unique index, migration); logged-in users rate/review on the facility page; average + count shown in the header and the review list; admins moderate (hide/delete) at /Admin/Reviews. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace JobsMedical.Web.Models;
|
||||
|
||||
/// <summary>A کادر درمان's rating + review of a facility they worked with (1–5 stars + comment).
|
||||
/// One review per user per facility. Shown immediately; an admin can hide/delete.</summary>
|
||||
public class Review
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public int FacilityId { get; set; }
|
||||
public Facility Facility { get; set; } = null!;
|
||||
|
||||
public int UserId { get; set; }
|
||||
public User User { get; set; } = null!;
|
||||
|
||||
public int Stars { get; set; } // 1..5
|
||||
[MaxLength(1000)] public string? Comment { get; set; }
|
||||
|
||||
public bool IsApproved { get; set; } = true; // admin can hide
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
Reference in New Issue
Block a user