- Add audit-logging-plan.md with comprehensive logging implementation guide - Update AGENTS.md with project guidelines - Refactor test models: remove RefTHoldModel, RefVSetModel, TestDefTechModel - Update TestDefSiteModel and related migrations - Update seeder and test data files - Update API documentation (OpenAPI specs)
363 lines
9.5 KiB
YAML
363 lines
9.5 KiB
YAML
/api/tests:
|
|
get:
|
|
tags: [Tests]
|
|
summary: List test definitions
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: page
|
|
in: query
|
|
schema:
|
|
type: integer
|
|
default: 1
|
|
description: Page number for pagination
|
|
- name: perPage
|
|
in: query
|
|
schema:
|
|
type: integer
|
|
default: 20
|
|
description: Number of items per page
|
|
- name: SiteID
|
|
in: query
|
|
schema:
|
|
type: integer
|
|
description: Filter by site ID
|
|
- name: TestType
|
|
in: query
|
|
schema:
|
|
type: string
|
|
enum: [TEST, PARAM, CALC, GROUP, TITLE]
|
|
description: Filter by test type
|
|
- name: VisibleScr
|
|
in: query
|
|
schema:
|
|
type: integer
|
|
enum: [0, 1]
|
|
description: Filter by screen visibility (0=hidden, 1=visible)
|
|
- name: VisibleRpt
|
|
in: query
|
|
schema:
|
|
type: integer
|
|
enum: [0, 1]
|
|
description: Filter by report visibility (0=hidden, 1=visible)
|
|
- name: search
|
|
in: query
|
|
schema:
|
|
type: string
|
|
description: Search by test code or name
|
|
responses:
|
|
'200':
|
|
description: List of test definitions
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
status:
|
|
type: string
|
|
data:
|
|
type: array
|
|
items:
|
|
$ref: '../components/schemas/tests.yaml#/TestDefinition'
|
|
pagination:
|
|
type: object
|
|
properties:
|
|
total:
|
|
type: integer
|
|
description: Total number of records matching the query
|
|
|
|
post:
|
|
tags: [Tests]
|
|
summary: Create test definition
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
SiteID:
|
|
type: integer
|
|
description: Site ID (required)
|
|
TestSiteCode:
|
|
type: string
|
|
description: Test code (required)
|
|
TestSiteName:
|
|
type: string
|
|
description: Test name (required)
|
|
TestType:
|
|
type: string
|
|
enum: [TEST, PARAM, CALC, GROUP, TITLE]
|
|
description: Test type (required)
|
|
Description:
|
|
type: string
|
|
DisciplineID:
|
|
type: integer
|
|
DepartmentID:
|
|
type: integer
|
|
ResultType:
|
|
type: string
|
|
enum: [NMRIC, VSET]
|
|
RefType:
|
|
type: string
|
|
enum: [NMRC, TEXT, THOLD, VSET]
|
|
VSet:
|
|
type: integer
|
|
ReqQty:
|
|
type: number
|
|
format: decimal
|
|
ReqQtyUnit:
|
|
type: string
|
|
Unit1:
|
|
type: string
|
|
Factor:
|
|
type: number
|
|
format: decimal
|
|
Unit2:
|
|
type: string
|
|
Decimal:
|
|
type: integer
|
|
CollReq:
|
|
type: string
|
|
Method:
|
|
type: string
|
|
ExpectedTAT:
|
|
type: integer
|
|
SeqScr:
|
|
type: integer
|
|
SeqRpt:
|
|
type: integer
|
|
IndentLeft:
|
|
type: integer
|
|
FontStyle:
|
|
type: string
|
|
VisibleScr:
|
|
type: integer
|
|
VisibleRpt:
|
|
type: integer
|
|
CountStat:
|
|
type: integer
|
|
details:
|
|
type: object
|
|
description: Type-specific details
|
|
refnum:
|
|
type: array
|
|
items:
|
|
type: object
|
|
reftxt:
|
|
type: array
|
|
items:
|
|
type: object
|
|
testmap:
|
|
type: array
|
|
items:
|
|
type: object
|
|
required:
|
|
- SiteID
|
|
- TestSiteCode
|
|
- TestSiteName
|
|
- TestType
|
|
responses:
|
|
'201':
|
|
description: Test definition created
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
status:
|
|
type: string
|
|
example: created
|
|
message:
|
|
type: string
|
|
data:
|
|
type: object
|
|
properties:
|
|
TestSiteId:
|
|
type: integer
|
|
|
|
patch:
|
|
tags: [Tests]
|
|
summary: Update test definition
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
TestSiteID:
|
|
type: integer
|
|
description: Test Site ID (required)
|
|
TestSiteCode:
|
|
type: string
|
|
TestSiteName:
|
|
type: string
|
|
TestType:
|
|
type: string
|
|
enum: [TEST, PARAM, CALC, GROUP, TITLE]
|
|
Description:
|
|
type: string
|
|
DisciplineID:
|
|
type: integer
|
|
DepartmentID:
|
|
type: integer
|
|
ResultType:
|
|
type: string
|
|
enum: [NMRIC, VSET]
|
|
RefType:
|
|
type: string
|
|
enum: [NMRC, TEXT, THOLD, VSET]
|
|
VSet:
|
|
type: integer
|
|
ReqQty:
|
|
type: number
|
|
format: decimal
|
|
ReqQtyUnit:
|
|
type: string
|
|
Unit1:
|
|
type: string
|
|
Factor:
|
|
type: number
|
|
format: decimal
|
|
Unit2:
|
|
type: string
|
|
Decimal:
|
|
type: integer
|
|
CollReq:
|
|
type: string
|
|
Method:
|
|
type: string
|
|
ExpectedTAT:
|
|
type: integer
|
|
SeqScr:
|
|
type: integer
|
|
SeqRpt:
|
|
type: integer
|
|
IndentLeft:
|
|
type: integer
|
|
FontStyle:
|
|
type: string
|
|
VisibleScr:
|
|
type: integer
|
|
VisibleRpt:
|
|
type: integer
|
|
CountStat:
|
|
type: integer
|
|
details:
|
|
type: object
|
|
description: Type-specific details
|
|
refnum:
|
|
type: array
|
|
items:
|
|
type: object
|
|
reftxt:
|
|
type: array
|
|
items:
|
|
type: object
|
|
testmap:
|
|
type: array
|
|
items:
|
|
type: object
|
|
required:
|
|
- TestSiteID
|
|
responses:
|
|
'200':
|
|
description: Test definition updated
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
status:
|
|
type: string
|
|
example: success
|
|
message:
|
|
type: string
|
|
data:
|
|
type: object
|
|
properties:
|
|
TestSiteId:
|
|
type: integer
|
|
|
|
/api/tests/{id}:
|
|
get:
|
|
tags: [Tests]
|
|
summary: Get test definition by ID
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
description: Test Site ID
|
|
responses:
|
|
'200':
|
|
description: Test definition details
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
status:
|
|
type: string
|
|
message:
|
|
type: string
|
|
data:
|
|
$ref: '../components/schemas/tests.yaml#/TestDefinition'
|
|
'404':
|
|
description: Test not found
|
|
|
|
delete:
|
|
tags: [Tests]
|
|
summary: Soft delete test definition
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
description: Test Site ID to delete
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
TestSiteID:
|
|
type: integer
|
|
description: Optional - can be provided in body instead of path
|
|
responses:
|
|
'200':
|
|
description: Test disabled successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
status:
|
|
type: string
|
|
example: success
|
|
message:
|
|
type: string
|
|
data:
|
|
type: object
|
|
properties:
|
|
TestSiteId:
|
|
type: integer
|
|
EndDate:
|
|
type: string
|
|
format: date-time
|
|
'404':
|
|
description: Test not found
|
|
'422':
|
|
description: Test already disabled
|