clqms-be/public/paths/audit-logs.yaml
root 30c4e47304 chore(repo): normalize EOL and harden contact patch flow
- handle contact PATCH failures by checking model save result and returning HTTP 400 with the model error message
- update ContactDetailModel nested updates to enforce active-detail checks and use model update() with explicit failure propagation
- extend contact patch assertions and align test-create variants expectations to status=success for POST responses
- refresh composer lock metadata/dependency constraints and include generated docs/data/test files updated during normalization
- impact: API contract unchanged except clearer 400 error responses on invalid contact detail updates
2026-04-17 05:38:11 +07:00

77 lines
2.2 KiB
YAML
Executable File

/api/audit-logs:
get:
tags: [Audit]
summary: Retrieve audit log entries for a table
security:
- bearerAuth: []
parameters:
- name: table
in: query
required: true
schema:
type: string
description: Table alias for the audit data (logpatient, logorder, logmaster, logsystem)
- name: rec_id
in: query
schema:
type: string
description: Primary record identifier (RecID) to filter audit rows
- name: event_id
in: query
schema:
type: string
description: Canonical EventID (case insensitive)
- name: activity_id
in: query
schema:
type: string
description: Canonical ActivityID (case insensitive)
- name: from
in: query
schema:
type: string
format: date-time
description: Lower bound for LogDate inclusive
- name: to
in: query
schema:
type: string
format: date-time
description: Upper bound for LogDate inclusive
- name: search
in: query
schema:
type: string
description: Search term that matches user, reason, field names, or values
- name: page
in: query
schema:
type: integer
default: 1
description: Page number
- name: perPage
in: query
schema:
type: integer
default: 20
description: Items per page (max 100)
responses:
'200':
description: Audit log results
content:
application/json:
schema:
$ref: '../components/schemas/audit-logs.yaml#/AuditLogsEnvelope'
'400':
description: Validation failure (missing table or invalid filters)
content:
application/json:
schema:
$ref: '../components/schemas/audit-logs.yaml#/AuditLogsErrorResponse'
'500':
description: Internal error when retrieving audit logs
content:
application/json:
schema:
$ref: '../components/schemas/audit-logs.yaml#/AuditLogsErrorResponse'