TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/pabloeferreyra/Turnero/llms.txt
Use this file to discover all available pages before exploring further.
Medic entity links an ASP.NET Identity user to the appointment scheduling system. User administration view models (EditRoleViewModel, UserClaimsViewModel, etc.) are used exclusively by the AdministrationController to manage roles and claims. This page also documents the ApplicationDbContext entity set registrations and the static RolesConstants and ClaimsStore types.
Medic
Medic represents a doctor registered in the system. The UserGuid field links the record to the corresponding IdentityUser.Id, enabling SignalR to route appointment notifications directly to that doctor’s browser session.
Primary key. Database-generated identity.
The doctor’s display name. Shown in appointment dropdowns and DataTables columns.
The
Id of the linked IdentityUser. Used by TurnsController and VisitsController to send directed SignalR notifications: hubContext.Clients.User(medic.UserGuid).SendAsync(...).Reverse navigation. All
Turn records assigned to this medic.Reverse navigation. All
Visit records created by this medic.MedicDto
Lightweight projection used in dropdownSelectList bindings and the in-memory cache.
MedicDto records are cached at application startup under the key "medics" using IMemoryCache. Cache is refreshed by calling medicsRepository.GetCachedMedics(). A restart is required to pick up new or deleted medic records if the cache is stale.RolesConstants
Static string constants defining the three built-in role names.| Constant | String Value | Purpose |
|---|---|---|
Ingreso | "Ingreso" | Reception staff — create, edit, and delete appointments |
Medico | "Medico" | Doctors — manage patient records, mark patients as arrived |
Admin | "Admin" | Administrators — manage users, roles, medics, and time slots |
[Authorize(Roles = ...)] attributes on controller actions.
ClaimsStore
Defines the three predefined claims that can be granted to individual users viaGET/POST /Administration/ManageUserClaims.
| Claim Type | Purpose |
|---|---|
Create Role | Allows the user to create new roles |
Edit Role | Allows the user to edit existing roles |
Delete Role | Required by the DeleteRolePolicy authorization policy |
DeleteRolePolicy is registered in Program.cs as:
AppSettings
Static class holding the connection string value set at startup.Program.cs before DbContext registration:
User Administration View Models
These models are used exclusively byAdministrationController for rendering and processing user/role management forms.
EditRoleViewModel
| Field | Description |
|---|---|
Id | The IdentityRole.Id string |
RoleName | The role’s display name |
Users | List of usernames currently in this role |
EditUserViewModel
UserClaimsViewModel
POST /Administration/ManageUserClaims. The handler removes all existing claims from the user and then re-adds only those where IsSelected == true.
UserRoleViewModel
GET/POST /Administration/EditUsersInRole/{roleId} to render a checkbox list of all users, marking those already in the role.
ApplicationDbContext
ApplicationDbContext inherits from IdentityDbContext (providing all ASP.NET Identity tables) and registers the following entity sets:
OnModelCreating Configuration
ApplicationDbContext.OnModelCreating applies the following conventions:
| Entity | Column | Configuration |
|---|---|---|
Turn.DateTurn | date | HasColumnType("date") |
Patient.BirthDate | date | HasColumnType("date") |
Visit.VisitDate | date | HasColumnType("date") |
Allergies (date props) | date | HasColumnType("date"), HasDefaultValue(null) |
Visit (string props) | varchar | HasDefaultValue("") |
PersonalBackground (bool props) | boolean | HasDefaultValue(false) |
ParentsData (string props) | varchar | HasDefaultValue("") |
ParentsData (date props) | date | HasDefaultValue(DateOnly.MinValue) |
ParentsData (int props) | integer | HasDefaultValue(0) |
CongErrors (string props) | varchar | HasDefaultValue("") |
PerinatalBackground (int props) | integer | HasDefaultValue(0) |