3780dcccf2
Backend:
- Patient model: name, phone, email, age, weight, height, gender,
blood type, disease history, allergies, medications, notes, category
- PatientVisit model: title, content, prescription, visit type,
visit/next-visit dates, linked to patient (cascade delete)
- HealthRequest model: public form submissions for beauty/health care
- Runtime SQLite migrations for all 3 new tables
- Full CRUD API: /api/patients, /api/patients/{id}/visits,
/api/health-requests (public POST + admin GET/PUT/DELETE)
Admin panel:
- 'پرونده بیماران' page: list, search, filter by category (beauty/health)
- Patient profile page: personal info + medical history + visits timeline
- Add/edit patient modal with all medical fields
- Add visit modal: type, date, clinical notes, prescription, next visit
- 'درخواستها' page: manage public health requests, mark as handled
- Badge counter for unhandled requests in sidebar
Frontend (SEO):
- New #health-care section with Schema.org MedicalClinic markup
- Two category cards: زیبایی پوست and سلامت عمومی
- Feature lists with checkmarks per category
- Inline request form that submits to /api/health-request
- Mobile responsive (single column on small screens)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
41 lines
1.4 KiB
C#
41 lines
1.4 KiB
C#
using Microsoft.EntityFrameworkCore;
|
|
using DrSousan.Api.Models;
|
|
|
|
namespace DrSousan.Api.Data;
|
|
|
|
public class AppDbContext(DbContextOptions<AppDbContext> options) : DbContext(options)
|
|
{
|
|
public DbSet<SiteSetting> SiteSettings => Set<SiteSetting>();
|
|
public DbSet<Service> Services => Set<Service>();
|
|
public DbSet<GalleryItem> GalleryItems => Set<GalleryItem>();
|
|
public DbSet<Testimonial> Testimonials => Set<Testimonial>();
|
|
public DbSet<BlogCategory> BlogCategories => Set<BlogCategory>();
|
|
public DbSet<BlogPost> BlogPosts => Set<BlogPost>();
|
|
public DbSet<Comment> Comments => Set<Comment>();
|
|
public DbSet<Faq> Faqs => Set<Faq>();
|
|
public DbSet<Patient> Patients => Set<Patient>();
|
|
public DbSet<PatientVisit> PatientVisits => Set<PatientVisit>();
|
|
public DbSet<HealthRequest> HealthRequests => Set<HealthRequest>();
|
|
|
|
protected override void OnModelCreating(ModelBuilder mb)
|
|
{
|
|
mb.Entity<SiteSetting>()
|
|
.HasIndex(s => new { s.Section, s.Key })
|
|
.IsUnique();
|
|
|
|
mb.Entity<BlogPost>()
|
|
.HasIndex(b => b.Slug)
|
|
.IsUnique();
|
|
|
|
mb.Entity<BlogCategory>()
|
|
.HasIndex(c => c.Slug)
|
|
.IsUnique();
|
|
|
|
mb.Entity<Comment>()
|
|
.HasOne(c => c.Parent)
|
|
.WithMany(c => c.Replies)
|
|
.HasForeignKey(c => c.ParentId)
|
|
.OnDelete(DeleteBehavior.Cascade);
|
|
}
|
|
}
|