feat: add invoice-config-items management functionality

This commit is contained in:
Tran Anh Tuan
2026-05-12 09:52:25 +07:00
parent eac8a686d1
commit c39b010e5e
14 changed files with 1571 additions and 0 deletions

View File

@@ -1867,6 +1867,279 @@
}
}
},
"/v1/invoice-config-items": {
"get": {
"description": "Retrieve a list of all invoice config items",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"invoice-config-item"
],
"summary": "List all invoice config items",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/response.SuccessResponse"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/models.InvoiceConfigItem"
}
}
}
}
]
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.ErrorResponse"
}
}
}
},
"post": {
"description": "Create a new invoice config item with the provided details",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"invoice-config-item"
],
"summary": "Create a new invoice config item",
"parameters": [
{
"description": "Invoice config item request body",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/requests.CreateInvoiceConfigItemRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"allOf": [
{
"$ref": "#/definitions/response.SuccessResponse"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/responses.CreateInvoiceConfigItemResponse"
}
}
}
]
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.ErrorResponse"
}
}
}
}
},
"/v1/invoice-config-items/{id}": {
"get": {
"description": "Retrieve a single invoice config item using its unique identifier",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"invoice-config-item"
],
"summary": "Get invoice config item by ID",
"parameters": [
{
"type": "integer",
"description": "Invoice config item ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/response.SuccessResponse"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/models.InvoiceConfigItem"
}
}
}
]
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/response.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.ErrorResponse"
}
}
}
},
"put": {
"description": "Update an existing invoice config item by its ID. Only non-empty fields will be updated.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"invoice-config-item"
],
"summary": "Update invoice config item",
"parameters": [
{
"type": "integer",
"description": "Invoice config item ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Invoice config item request body",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/requests.UpdateInvoiceConfigItemRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/response.SuccessResponse"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/responses.UpdateInvoiceConfigItemResponse"
}
}
}
]
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/response.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.ErrorResponse"
}
}
}
},
"delete": {
"description": "Delete an invoice config item by its unique identifier",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"invoice-config-item"
],
"summary": "Delete invoice config item",
"parameters": [
{
"type": "integer",
"description": "Invoice config item ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.SuccessResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.ErrorResponse"
}
}
}
}
},
"/v1/invoice-configs": {
"get": {
"description": "Retrieve a list of all invoice configs ordered by creation date",
@@ -3205,6 +3478,38 @@
}
}
},
"models.InvoiceConfigItem": {
"type": "object",
"properties": {
"allowAlternative": {
"type": "boolean"
},
"componentId": {
"type": "integer"
},
"id": {
"type": "integer"
},
"invoiceConfigId": {
"type": "integer"
},
"metadata": {
"type": "array",
"items": {
"type": "integer"
}
},
"note": {
"type": "string"
},
"priorityOrder": {
"type": "integer"
},
"requiredQuantity": {
"type": "integer"
}
}
},
"models.Room": {
"type": "object",
"properties": {
@@ -3457,6 +3762,35 @@
}
}
},
"requests.CreateInvoiceConfigItemRequest": {
"type": "object",
"required": [
"componentId",
"invoiceConfigId",
"priorityOrder",
"requiredQuantity"
],
"properties": {
"allowAlternative": {
"type": "boolean"
},
"componentId": {
"type": "integer"
},
"invoiceConfigId": {
"type": "integer"
},
"note": {
"type": "string"
},
"priorityOrder": {
"type": "integer"
},
"requiredQuantity": {
"type": "integer"
}
}
},
"requests.CreateInvoiceConfigRequest": {
"type": "object",
"required": [
@@ -3677,6 +4011,23 @@
}
}
},
"requests.UpdateInvoiceConfigItemRequest": {
"type": "object",
"properties": {
"allowAlternative": {
"type": "boolean"
},
"note": {
"type": "string"
},
"priorityOrder": {
"type": "integer"
},
"requiredQuantity": {
"type": "integer"
}
}
},
"requests.UpdateInvoiceConfigRequest": {
"type": "object",
"properties": {
@@ -3822,6 +4173,14 @@
}
}
},
"responses.CreateInvoiceConfigItemResponse": {
"type": "object",
"properties": {
"id": {
"type": "integer"
}
}
},
"responses.CreateInvoiceConfigResponse": {
"type": "object",
"properties": {
@@ -4009,6 +4368,32 @@
}
}
},
"responses.UpdateInvoiceConfigItemResponse": {
"type": "object",
"properties": {
"allowAlternative": {
"type": "boolean"
},
"componentId": {
"type": "integer"
},
"id": {
"type": "integer"
},
"invoiceConfigId": {
"type": "integer"
},
"note": {
"type": "string"
},
"priorityOrder": {
"type": "integer"
},
"requiredQuantity": {
"type": "integer"
}
}
},
"responses.UpdateInvoiceConfigResponse": {
"type": "object",
"properties": {