Fix FastEndpoints/Swagger wiring and missing required fields in DTOs

- Register FastEndpoints, SwaggerDocument, DbContext in Program.cs
- Add DbContextOptions constructor to PyroFetesDbContext
- Add CityId to Show DTOs and endpoints (NOT NULL in DB)
- Add F4T2NumberApproval/F4T2ExpirationDate to Staff DTOs and endpoints
- Simplify DeleteShow to rely on DB cascade instead of manual includes
- Default NOT NULL string fields to empty string on create

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-27 19:35:01 +02:00
parent 3a09bfc8ad
commit 6c1330e570
18 changed files with 70 additions and 53 deletions
@@ -22,10 +22,13 @@ public class UpdateStaffEndpoint(PyroFetesDbContext pf3DbContext) : Endpoint<Upd
return;
}
staff.FirstName = req.FirstName;
staff.LastName = req.LastName;
staff.Profession = req.Profession;
staff.Email = req.Email;
staff.FirstName = req.FirstName ?? staff.FirstName;
staff.LastName = req.LastName ?? staff.LastName;
staff.Profession = req.Profession ?? staff.Profession;
staff.Email = req.Email ?? staff.Email;
staff.F4T2NumberApproval = req.F4T2NumberApproval ?? staff.F4T2NumberApproval;
if (req.F4T2ExpirationDate.HasValue)
staff.F4T2ExpirationDate = req.F4T2ExpirationDate.Value;
await pf3DbContext.SaveChangesAsync(ct);
@@ -35,7 +38,9 @@ public class UpdateStaffEndpoint(PyroFetesDbContext pf3DbContext) : Endpoint<Upd
FirstName = staff.FirstName,
LastName = staff.LastName,
Profession = staff.Profession,
Email = staff.Email
Email = staff.Email,
F4T2NumberApproval = staff.F4T2NumberApproval,
F4T2ExpirationDate = staff.F4T2ExpirationDate
};
await Send.OkAsync(result, ct);