1.1 KiB
1.1 KiB
Controller Design — Unit 03: Availability Module
Dit document beschrijft de endpoints van de AvailabilityController.
1. Publieke Status Endpoint
- Method:
GET - Path:
/api/availability/status - Auth: Geen (AllowAnonymous)
- Response:
AvailabilityResponse - Logic: Roept
IAvailabilityService.IsAvailableAsync()aan en mapt de status naar het response object.
2. Status Update Endpoint (Beheer)
- Method:
POST - Path:
/api/availability/admin/status - Auth:
OwnerOnlyPolicy (Unit 02) - Request Body:
{ "newStatus": "Maintenance", "reason": "Gepland database onderhoud" } - Logic:
- Valideert de nieuwe status.
- Werkt de database record bij via de
IAvailabilityService. - Maakt een audit log aan (Unit 02).
- Response:
200 OK.
3. Integratie met Audit Log
Bij elke statuswijziging wordt de IAuditService aangeroepen met de volgende gegevens:
- ActorId: De ID van de Owner.
- Action:
SystemStatusChanged. - Details:
OldStatus: Available, NewStatus: Maintenance, Reason: ...