Compatibility Attendance API
Summary
Eighteen compatibility operations preserve existing Attendance client routes and bare response shapes during gateway cutover.
Audience
Existing frontend integrators, backend developers, QA/support engineers, architects, and implementation partners.
Reference Content
Authentication: downstream bearer/self/approver context expected; exact enforcement requires confirmation. Tenant: expected/required by underlying operations. Maturity: Compatibility/Transitional. Success is generally 200 with bare arrays, DTOs, strings, or objects. Validation is 400, missing records 404, locked reopen 403, and conflicts generally translate to 400.
| Method and public route | Purpose | Request → response | Behavior, status, and safe example |
|---|---|---|---|
GET /api/attendance/weekly | Date-range rows | start,end,laborId? → AttendanceDto[] | 200 read-only; fictional query → []; handled failure → 400 text. |
GET /api/attendance/employees | Active roster | none → AttendanceEmployeeDto[] | 200 read-only; example → []. |
GET /api/attendance/pending | Pending review | start?,end? → PendingAttendanceDto[] | 200 read-only; example → []. |
GET /api/attendance/monthly-summary | Attendance summary | month,year,laborId? → MonthlyAttendanceSummaryDto[] | 200; invalid month → 400. |
POST /api/attendance | Save rows | AttendanceSaveRequest[] → success string | 200; validates/calculates/audits/events; fictional one-row body → success string; invalid → 400. |
POST /api/attendance/bulk-punch | Bulk self attendance save | BulkPunchRequest[] → object with message/results/count | 200 even with per-row failures represented in results; fictional rows → result object. |
POST /api/attendance/{id:int}/approve | Approve | id → AttendanceDto | 200; canonical recalculation/audit/event; unknown → 404. |
POST /api/attendance/{id:int}/reject | Reject | id + RejectRequest → AttendanceDto | 200; clear/audit/event; unknown → 404. |
GET /api/attendance/punch/today | Today's punches | laborId? → PunchLogDto[] | 200 read-only; fictional id → []. |
GET /api/attendance/punch/weekly | Self weekly attendance | start,end → AttendanceDto[] | 200; self context; fictional dates → []. |
POST /api/attendance/punch | Submit punch | PunchRequest → PunchLogDto | 200; punch/audit/event and possible attendance; invalid employee → 400. |
POST /api/attendance/punch/{id:int}/approve | Approve punch | id → PunchLogDto | 200; audit and possible attendance approval; unknown → 404. |
POST /api/attendance/punch/{id:int}/reject | Reject punch | id → PunchLogDto | 200; audit and conditional clear; unknown → 404. |
POST /api/attendance/reopen-requests | Create reopen | ReopenCreateRequest → ReopenRequestDto | 200; future/invalid → 400; duplicate conflict → compatibility 400. |
GET /api/attendance/reopen-requests/my | Personal reopen list | none → ReopenRequestDto[] | 200 read-only. |
GET /api/attendance/reopen-requests/pending | Pending reopen list | none → ReopenRequestDto[] | 200 read-only; approver scope expected. |
POST /api/attendance/reopen-requests/{id:int}/approve | Approve reopen | id → ReopenRequestDto | 200; locked → 403; invalid state → 400; missing → 404; audit/event. |
POST /api/attendance/reopen-requests/{id:int}/reject | Reject reopen | id + ReopenRejectRequest → DTO | 200; invalid state → 400; missing → 404; audit. |
Request/response fields and validation match the corresponding direct-family pages, except envelopes are removed and the bulk operation maps virtual UI status names into confirmed attendance statuses. Safe example bodies are those shown on the direct pages with the compatibility route substituted; success responses are bare. No compatibility approved-record query, snapshot, employee-profile upsert, audit/timeline, or delete-attendance route exists.
Five development-only demo mappings are intentionally omitted from this public inventory and examples.
Source References
microservices/src/attendance-service/Api/AttendanceCompatibilityEndpoints.csmicroservices/src/attendance-service/Application/Dtos.csmicroservices/src/attendance-service/Application/Services/AttendanceCommands.csmicroservices/src/attendance-service/Application/Services/PunchWorkflow.csmicroservices/src/attendance-service/Application/Services/ReopenRequestWorkflow.csmicroservices/src/gateway-api/Program.cs
Related Articles
See Also
Keywords
- Attendance API
- Compatibility Attendance API
Revision Information
- Status: Draft
- Last reviewed: 2026-07-15
- Review cycle: Quarterly