feat(platform): I4 delivery batches, lines, and license SN APIs

Add Flyway V4 tables, delivery-batches and license-sns endpoints with
validation, audit actions, controller tests, and OpenAPI snapshot update.

Made-with: Cursor
This commit is contained in:
2026-04-06 21:49:04 +08:00
parent df91ab0673
commit 9df6f60a17
28 changed files with 3151 additions and 14 deletions
+813 -14
View File
@@ -90,10 +90,205 @@
}
}
},
"/api/v1/license-sns/{id}" : {
"get" : {
"tags" : [ "license-sn-controller" ],
"operationId" : "get_1",
"parameters" : [ {
"name" : "id",
"in" : "path",
"required" : true,
"schema" : {
"type" : "integer",
"format" : "int64"
}
} ],
"responses" : {
"200" : {
"description" : "OK",
"content" : {
"*/*" : {
"schema" : {
"$ref" : "#/components/schemas/LicenseSnResponse"
}
}
}
}
}
},
"put" : {
"tags" : [ "license-sn-controller" ],
"operationId" : "update_1",
"parameters" : [ {
"name" : "id",
"in" : "path",
"required" : true,
"schema" : {
"type" : "integer",
"format" : "int64"
}
} ],
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/LicenseSnUpdateRequest"
}
}
},
"required" : true
},
"responses" : {
"200" : {
"description" : "OK",
"content" : {
"*/*" : {
"schema" : {
"$ref" : "#/components/schemas/LicenseSnResponse"
}
}
}
}
}
}
},
"/api/v1/delivery-batches/{id}" : {
"get" : {
"tags" : [ "delivery-batch-controller" ],
"operationId" : "get_2",
"parameters" : [ {
"name" : "id",
"in" : "path",
"required" : true,
"schema" : {
"type" : "integer",
"format" : "int64"
}
} ],
"responses" : {
"200" : {
"description" : "OK",
"content" : {
"*/*" : {
"schema" : {
"$ref" : "#/components/schemas/DeliveryBatchResponse"
}
}
}
}
}
},
"put" : {
"tags" : [ "delivery-batch-controller" ],
"operationId" : "update_2",
"parameters" : [ {
"name" : "id",
"in" : "path",
"required" : true,
"schema" : {
"type" : "integer",
"format" : "int64"
}
} ],
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/DeliveryBatchUpdateRequest"
}
}
},
"required" : true
},
"responses" : {
"200" : {
"description" : "OK",
"content" : {
"*/*" : {
"schema" : {
"$ref" : "#/components/schemas/DeliveryBatchResponse"
}
}
}
}
}
}
},
"/api/v1/delivery-batches/{id}/lines/{lineId}" : {
"put" : {
"tags" : [ "delivery-batch-controller" ],
"operationId" : "updateLine",
"parameters" : [ {
"name" : "id",
"in" : "path",
"required" : true,
"schema" : {
"type" : "integer",
"format" : "int64"
}
}, {
"name" : "lineId",
"in" : "path",
"required" : true,
"schema" : {
"type" : "integer",
"format" : "int64"
}
} ],
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/DeliveryLineRequest"
}
}
},
"required" : true
},
"responses" : {
"200" : {
"description" : "OK",
"content" : {
"*/*" : {
"schema" : {
"$ref" : "#/components/schemas/DeliveryLineResponse"
}
}
}
}
}
},
"delete" : {
"tags" : [ "delivery-batch-controller" ],
"operationId" : "deleteLine",
"parameters" : [ {
"name" : "id",
"in" : "path",
"required" : true,
"schema" : {
"type" : "integer",
"format" : "int64"
}
}, {
"name" : "lineId",
"in" : "path",
"required" : true,
"schema" : {
"type" : "integer",
"format" : "int64"
}
} ],
"responses" : {
"204" : {
"description" : "No Content"
}
}
}
},
"/api/v1/customers/{id}" : {
"get" : {
"tags" : [ "customer-controller" ],
"operationId" : "get_1",
"operationId" : "get_3",
"parameters" : [ {
"name" : "id",
"in" : "path",
@@ -118,7 +313,7 @@
},
"put" : {
"tags" : [ "customer-controller" ],
"operationId" : "update_1",
"operationId" : "update_3",
"parameters" : [ {
"name" : "id",
"in" : "path",
@@ -173,7 +368,7 @@
"/api/v1/contracts/{id}" : {
"get" : {
"tags" : [ "contract-controller" ],
"operationId" : "get_2",
"operationId" : "get_4",
"parameters" : [ {
"name" : "id",
"in" : "path",
@@ -198,7 +393,7 @@
},
"put" : {
"tags" : [ "contract-controller" ],
"operationId" : "update_2",
"operationId" : "update_4",
"parameters" : [ {
"name" : "id",
"in" : "path",
@@ -235,7 +430,7 @@
"/api/v1/contracts/{id}/lines/{lineId}" : {
"put" : {
"tags" : [ "contract-controller" ],
"operationId" : "updateLine",
"operationId" : "updateLine_1",
"parameters" : [ {
"name" : "id",
"in" : "path",
@@ -278,7 +473,7 @@
},
"delete" : {
"tags" : [ "contract-controller" ],
"operationId" : "deleteLine",
"operationId" : "deleteLine_1",
"parameters" : [ {
"name" : "id",
"in" : "path",
@@ -377,10 +572,252 @@
}
}
},
"/api/v1/license-sns" : {
"get" : {
"tags" : [ "license-sn-controller" ],
"operationId" : "list_1",
"parameters" : [ {
"name" : "page",
"in" : "query",
"required" : false,
"schema" : {
"type" : "integer",
"format" : "int32",
"default" : 0,
"minimum" : 0
}
}, {
"name" : "size",
"in" : "query",
"required" : false,
"schema" : {
"type" : "integer",
"format" : "int32",
"default" : 20,
"maximum" : 200,
"minimum" : 1
}
}, {
"name" : "projectId",
"in" : "query",
"required" : false,
"schema" : {
"type" : "integer",
"format" : "int64"
}
}, {
"name" : "keyword",
"in" : "query",
"required" : false,
"schema" : {
"type" : "string"
}
}, {
"name" : "status",
"in" : "query",
"required" : false,
"schema" : {
"type" : "string"
}
} ],
"responses" : {
"200" : {
"description" : "OK",
"content" : {
"*/*" : {
"schema" : {
"$ref" : "#/components/schemas/PageResponseLicenseSnResponse"
}
}
}
}
}
},
"post" : {
"tags" : [ "license-sn-controller" ],
"operationId" : "create_1",
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/LicenseSnCreateRequest"
}
}
},
"required" : true
},
"responses" : {
"201" : {
"description" : "Created",
"content" : {
"*/*" : {
"schema" : {
"$ref" : "#/components/schemas/LicenseSnResponse"
}
}
}
}
}
}
},
"/api/v1/delivery-batches" : {
"get" : {
"tags" : [ "delivery-batch-controller" ],
"operationId" : "list_2",
"parameters" : [ {
"name" : "page",
"in" : "query",
"required" : false,
"schema" : {
"type" : "integer",
"format" : "int32",
"default" : 0,
"minimum" : 0
}
}, {
"name" : "size",
"in" : "query",
"required" : false,
"schema" : {
"type" : "integer",
"format" : "int32",
"default" : 20,
"maximum" : 200,
"minimum" : 1
}
}, {
"name" : "projectId",
"in" : "query",
"required" : false,
"schema" : {
"type" : "integer",
"format" : "int64"
}
}, {
"name" : "contractId",
"in" : "query",
"required" : false,
"schema" : {
"type" : "integer",
"format" : "int64"
}
}, {
"name" : "keyword",
"in" : "query",
"required" : false,
"schema" : {
"type" : "string"
}
} ],
"responses" : {
"200" : {
"description" : "OK",
"content" : {
"*/*" : {
"schema" : {
"$ref" : "#/components/schemas/PageResponseDeliveryBatchResponse"
}
}
}
}
}
},
"post" : {
"tags" : [ "delivery-batch-controller" ],
"operationId" : "create_2",
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/DeliveryBatchCreateRequest"
}
}
},
"required" : true
},
"responses" : {
"201" : {
"description" : "Created",
"content" : {
"*/*" : {
"schema" : {
"$ref" : "#/components/schemas/DeliveryBatchResponse"
}
}
}
}
}
}
},
"/api/v1/delivery-batches/{id}/lines" : {
"get" : {
"tags" : [ "delivery-batch-controller" ],
"operationId" : "listLines",
"parameters" : [ {
"name" : "id",
"in" : "path",
"required" : true,
"schema" : {
"type" : "integer",
"format" : "int64"
}
} ],
"responses" : {
"200" : {
"description" : "OK",
"content" : {
"*/*" : {
"schema" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/DeliveryLineResponse"
}
}
}
}
}
}
},
"post" : {
"tags" : [ "delivery-batch-controller" ],
"operationId" : "addLine",
"parameters" : [ {
"name" : "id",
"in" : "path",
"required" : true,
"schema" : {
"type" : "integer",
"format" : "int64"
}
} ],
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/DeliveryLineRequest"
}
}
},
"required" : true
},
"responses" : {
"201" : {
"description" : "Created",
"content" : {
"*/*" : {
"schema" : {
"$ref" : "#/components/schemas/DeliveryLineResponse"
}
}
}
}
}
}
},
"/api/v1/customers" : {
"get" : {
"tags" : [ "customer-controller" ],
"operationId" : "list_1",
"operationId" : "list_3",
"parameters" : [ {
"name" : "page",
"in" : "query",
@@ -425,7 +862,7 @@
},
"post" : {
"tags" : [ "customer-controller" ],
"operationId" : "create_1",
"operationId" : "create_3",
"requestBody" : {
"content" : {
"application/json" : {
@@ -453,7 +890,7 @@
"/api/v1/contracts" : {
"get" : {
"tags" : [ "contract-controller" ],
"operationId" : "list_2",
"operationId" : "list_4",
"parameters" : [ {
"name" : "page",
"in" : "query",
@@ -514,7 +951,7 @@
},
"post" : {
"tags" : [ "contract-controller" ],
"operationId" : "create_2",
"operationId" : "create_4",
"requestBody" : {
"content" : {
"application/json" : {
@@ -542,7 +979,7 @@
"/api/v1/contracts/{id}/lines" : {
"get" : {
"tags" : [ "contract-controller" ],
"operationId" : "listLines",
"operationId" : "listLines_1",
"parameters" : [ {
"name" : "id",
"in" : "path",
@@ -570,7 +1007,7 @@
},
"post" : {
"tags" : [ "contract-controller" ],
"operationId" : "addLine",
"operationId" : "addLine_1",
"parameters" : [ {
"name" : "id",
"in" : "path",
@@ -636,10 +1073,84 @@
}
}
},
"/api/v1/license-sns/{id}/status" : {
"patch" : {
"tags" : [ "license-sn-controller" ],
"operationId" : "patchStatus",
"parameters" : [ {
"name" : "id",
"in" : "path",
"required" : true,
"schema" : {
"type" : "integer",
"format" : "int64"
}
} ],
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/LicenseSnStatusPatchRequest"
}
}
},
"required" : true
},
"responses" : {
"200" : {
"description" : "OK",
"content" : {
"*/*" : {
"schema" : {
"$ref" : "#/components/schemas/LicenseSnResponse"
}
}
}
}
}
}
},
"/api/v1/delivery-batches/{id}/status" : {
"patch" : {
"tags" : [ "delivery-batch-controller" ],
"operationId" : "patchStatus_1",
"parameters" : [ {
"name" : "id",
"in" : "path",
"required" : true,
"schema" : {
"type" : "integer",
"format" : "int64"
}
} ],
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/DeliveryBatchStatusPatchRequest"
}
}
},
"required" : true
},
"responses" : {
"200" : {
"description" : "OK",
"content" : {
"*/*" : {
"schema" : {
"$ref" : "#/components/schemas/DeliveryBatchResponse"
}
}
}
}
}
}
},
"/api/v1/contracts/{id}/status" : {
"patch" : {
"tags" : [ "contract-controller" ],
"operationId" : "patchStatus",
"operationId" : "patchStatus_2",
"parameters" : [ {
"name" : "id",
"in" : "path",
@@ -726,7 +1237,7 @@
"/api/v1/audit-events" : {
"get" : {
"tags" : [ "audit-controller" ],
"operationId" : "list_3",
"operationId" : "list_5",
"parameters" : [ {
"name" : "entityType",
"in" : "query",
@@ -829,6 +1340,177 @@
}
}
},
"LicenseSnUpdateRequest" : {
"type" : "object",
"properties" : {
"projectId" : {
"type" : "integer",
"format" : "int64"
},
"contractLineId" : {
"type" : "integer",
"format" : "int64"
},
"activationRemark" : {
"type" : "string",
"maxLength" : 512,
"minLength" : 0
}
}
},
"LicenseSnResponse" : {
"type" : "object",
"properties" : {
"id" : {
"type" : "integer",
"format" : "int64"
},
"snCode" : {
"type" : "string"
},
"projectId" : {
"type" : "integer",
"format" : "int64"
},
"contractLineId" : {
"type" : "integer",
"format" : "int64"
},
"status" : {
"type" : "string"
},
"activationRemark" : {
"type" : "string"
},
"createdAt" : {
"type" : "string",
"format" : "date-time"
},
"updatedAt" : {
"type" : "string",
"format" : "date-time"
}
}
},
"DeliveryBatchUpdateRequest" : {
"type" : "object",
"properties" : {
"plannedDeliveryDate" : {
"type" : "string"
},
"remarks" : {
"type" : "string",
"maxLength" : 4000,
"minLength" : 0
}
}
},
"DeliveryBatchResponse" : {
"type" : "object",
"properties" : {
"id" : {
"type" : "integer",
"format" : "int64"
},
"projectId" : {
"type" : "integer",
"format" : "int64"
},
"contractId" : {
"type" : "integer",
"format" : "int64"
},
"batchCode" : {
"type" : "string"
},
"plannedDeliveryDate" : {
"type" : "string",
"format" : "date"
},
"status" : {
"type" : "string"
},
"finishedAt" : {
"type" : "string",
"format" : "date-time"
},
"remarks" : {
"type" : "string"
},
"createdAt" : {
"type" : "string",
"format" : "date-time"
},
"updatedAt" : {
"type" : "string",
"format" : "date-time"
},
"lines" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/DeliveryLineResponse"
}
}
}
},
"DeliveryLineResponse" : {
"type" : "object",
"properties" : {
"id" : {
"type" : "integer",
"format" : "int64"
},
"batchId" : {
"type" : "integer",
"format" : "int64"
},
"sortOrder" : {
"type" : "integer",
"format" : "int32"
},
"description" : {
"type" : "string"
},
"quantity" : {
"type" : "number"
},
"contractLineId" : {
"type" : "integer",
"format" : "int64"
},
"createdAt" : {
"type" : "string",
"format" : "date-time"
},
"updatedAt" : {
"type" : "string",
"format" : "date-time"
}
}
},
"DeliveryLineRequest" : {
"type" : "object",
"properties" : {
"sortOrder" : {
"type" : "integer",
"format" : "int32"
},
"description" : {
"type" : "string",
"maxLength" : 512,
"minLength" : 0
},
"quantity" : {
"type" : "number",
"minimum" : 1.0E-4
},
"contractLineId" : {
"type" : "integer",
"format" : "int64"
}
},
"required" : [ "description", "quantity" ]
},
"CustomerRequest" : {
"type" : "object",
"properties" : {
@@ -1003,6 +1685,57 @@
},
"required" : [ "itemName", "quantity" ]
},
"LicenseSnCreateRequest" : {
"type" : "object",
"properties" : {
"snCode" : {
"type" : "string",
"maxLength" : 128,
"minLength" : 0
},
"projectId" : {
"type" : "integer",
"format" : "int64"
},
"contractLineId" : {
"type" : "integer",
"format" : "int64"
},
"activationRemark" : {
"type" : "string",
"maxLength" : 512,
"minLength" : 0
}
},
"required" : [ "snCode" ]
},
"DeliveryBatchCreateRequest" : {
"type" : "object",
"properties" : {
"projectId" : {
"type" : "integer",
"format" : "int64"
},
"contractId" : {
"type" : "integer",
"format" : "int64"
},
"batchCode" : {
"type" : "string",
"maxLength" : 64,
"minLength" : 0
},
"plannedDeliveryDate" : {
"type" : "string"
},
"remarks" : {
"type" : "string",
"maxLength" : 4000,
"minLength" : 0
}
},
"required" : [ "batchCode", "projectId" ]
},
"ContractCreateRequest" : {
"type" : "object",
"properties" : {
@@ -1027,6 +1760,26 @@
},
"required" : [ "customerId", "projectId" ]
},
"LicenseSnStatusPatchRequest" : {
"type" : "object",
"properties" : {
"status" : {
"type" : "string",
"minLength" : 1
}
},
"required" : [ "status" ]
},
"DeliveryBatchStatusPatchRequest" : {
"type" : "object",
"properties" : {
"status" : {
"type" : "string",
"minLength" : 1
}
},
"required" : [ "status" ]
},
"ContractStatusPatchRequest" : {
"type" : "object",
"properties" : {
@@ -1060,6 +1813,29 @@
}
}
},
"PageResponseLicenseSnResponse" : {
"type" : "object",
"properties" : {
"content" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/LicenseSnResponse"
}
},
"totalElements" : {
"type" : "integer",
"format" : "int64"
},
"number" : {
"type" : "integer",
"format" : "int32"
},
"size" : {
"type" : "integer",
"format" : "int32"
}
}
},
"DictionaryItemResponse" : {
"type" : "object",
"properties" : {
@@ -1075,6 +1851,29 @@
}
}
},
"PageResponseDeliveryBatchResponse" : {
"type" : "object",
"properties" : {
"content" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/DeliveryBatchResponse"
}
},
"totalElements" : {
"type" : "integer",
"format" : "int64"
},
"number" : {
"type" : "integer",
"format" : "int32"
},
"size" : {
"type" : "integer",
"format" : "int32"
}
}
},
"PageResponseCustomerResponse" : {
"type" : "object",
"properties" : {