[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:
soroush.asadi
2026-06-07 07:44:25 +03:30
parent 437258294b
commit d87afb577c
11 changed files with 1802 additions and 4 deletions
@@ -709,6 +709,43 @@ namespace JobsMedical.Web.Migrations
b.ToTable("Reports");
});
modelBuilder.Entity("JobsMedical.Web.Models.Review", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Comment")
.HasMaxLength(1000)
.HasColumnType("character varying(1000)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<int>("FacilityId")
.HasColumnType("integer");
b.Property<bool>("IsApproved")
.HasColumnType("boolean");
b.Property<int>("Stars")
.HasColumnType("integer");
b.Property<int>("UserId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("UserId");
b.HasIndex("FacilityId", "UserId")
.IsUnique();
b.ToTable("Reviews");
});
modelBuilder.Entity("JobsMedical.Web.Models.Role", b =>
{
b.Property<int>("Id")
@@ -1166,6 +1203,25 @@ namespace JobsMedical.Web.Migrations
b.Navigation("LinkedShift");
});
modelBuilder.Entity("JobsMedical.Web.Models.Review", b =>
{
b.HasOne("JobsMedical.Web.Models.Facility", "Facility")
.WithMany()
.HasForeignKey("FacilityId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("JobsMedical.Web.Models.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Facility");
b.Navigation("User");
});
modelBuilder.Entity("JobsMedical.Web.Models.Shift", b =>
{
b.HasOne("JobsMedical.Web.Models.Facility", "Facility")