clqms-be/public/paths/locations.yaml
mahdahar 10d87d21b4 refactor(api-docs): Split Master Data into Contacts and Locations modules
- Split monolithic master-data.yaml into separate contact.yaml and locations.yaml files
- Replace 'Master Data' tag with dedicated 'Contacts' and 'Locations' tags for better API organization
- Add complete CRUD operations for Contacts (GET, POST, PATCH, DELETE, GET by ID)
- Add complete CRUD operations for Locations (GET, POST, PATCH, DELETE, GET by ID)
- Enhance Contact schema with comprehensive fields: NameFirst, NameLast, Title, Initial,
  Birthdate, EmailAddress1/2, Phone, MobilePhone1/2, Specialty, SubSpecialty
- Enhance Location schema with additional fields: Description, LocType, improved Parent
  field documentation for hierarchical locations
- Update bundled API documentation to reflect new endpoint structure
- Remove deprecated Occupation, MedicalSpecialty, and Counter schemas from bundled docs
2026-02-18 08:45:54 +07:00

191 lines
5.1 KiB
YAML

/api/location:
get:
tags: [Locations]
summary: List locations
security:
- bearerAuth: []
parameters:
- name: LocCode
in: query
schema:
type: string
description: Filter by location code
- name: LocName
in: query
schema:
type: string
description: Filter by location name (searches in LocFull)
responses:
'200':
description: List of locations
content:
application/json:
schema:
type: object
properties:
status:
type: string
message:
type: string
data:
type: array
items:
$ref: '../components/schemas/master-data.yaml#/Location'
post:
tags: [Locations]
summary: Create location
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- LocCode
- LocFull
properties:
SiteID:
type: integer
description: Reference to site
LocCode:
type: string
maxLength: 6
description: Location code (short identifier)
Parent:
type: integer
nullable: true
description: Parent location ID for hierarchical locations
LocFull:
type: string
maxLength: 255
description: Full location name
Description:
type: string
maxLength: 255
description: Location description
LocType:
type: string
description: Location type code (e.g., ROOM, WARD, BUILDING)
responses:
'201':
description: Location created successfully
content:
application/json:
schema:
$ref: '../components/schemas/common.yaml#/SuccessResponse'
'422':
description: Validation error
content:
application/json:
schema:
$ref: '../components/schemas/common.yaml#/ErrorResponse'
patch:
tags: [Locations]
summary: Update location
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- LocationID
properties:
LocationID:
type: integer
description: Location ID to update
SiteID:
type: integer
description: Reference to site
LocCode:
type: string
maxLength: 6
description: Location code (short identifier)
Parent:
type: integer
nullable: true
description: Parent location ID for hierarchical locations
LocFull:
type: string
maxLength: 255
description: Full location name
Description:
type: string
maxLength: 255
description: Location description
LocType:
type: string
description: Location type code (e.g., ROOM, WARD, BUILDING)
responses:
'201':
description: Location updated successfully
content:
application/json:
schema:
$ref: '../components/schemas/common.yaml#/SuccessResponse'
'422':
description: Validation error
content:
application/json:
schema:
$ref: '../components/schemas/common.yaml#/ErrorResponse'
delete:
tags: [Locations]
summary: Delete location
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- LocationID
properties:
LocationID:
type: integer
description: Location ID to delete
responses:
'200':
description: Location deleted successfully
content:
application/json:
schema:
$ref: '../components/schemas/common.yaml#/SuccessResponse'
/api/location/{id}:
get:
tags: [Locations]
summary: Get location by ID
security:
- bearerAuth: []
parameters:
- name: id
in: path
required: true
schema:
type: integer
description: Location ID
responses:
'200':
description: Location details
content:
application/json:
schema:
type: object
properties:
status:
type: string
message:
type: string
data:
$ref: '../components/schemas/master-data.yaml#/Location'