feat: add invoice-configs management functionality

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

View File

@@ -1873,6 +1873,279 @@ const docTemplate = `{
}
}
},
"/v1/invoice-configs": {
"get": {
"description": "Retrieve a list of all invoice configs ordered by creation date",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"invoice-config"
],
"summary": "List all invoice configs",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/response.SuccessResponse"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/models.InvoiceConfig"
}
}
}
}
]
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.ErrorResponse"
}
}
}
},
"post": {
"description": "Create a new invoice config with the provided details",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"invoice-config"
],
"summary": "Create a new invoice config",
"parameters": [
{
"description": "Invoice config request body",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/requests.CreateInvoiceConfigRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"allOf": [
{
"$ref": "#/definitions/response.SuccessResponse"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/responses.CreateInvoiceConfigResponse"
}
}
}
]
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.ErrorResponse"
}
}
}
}
},
"/v1/invoice-configs/{id}": {
"get": {
"description": "Retrieve a single invoice config using its unique identifier",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"invoice-config"
],
"summary": "Get invoice config by ID",
"parameters": [
{
"type": "integer",
"description": "Invoice config ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/response.SuccessResponse"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/models.InvoiceConfig"
}
}
}
]
}
},
"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 by its ID. Only non-empty fields will be updated.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"invoice-config"
],
"summary": "Update invoice config",
"parameters": [
{
"type": "integer",
"description": "Invoice config ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Invoice config request body",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/requests.UpdateInvoiceConfigRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/response.SuccessResponse"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/responses.UpdateInvoiceConfigResponse"
}
}
}
]
}
},
"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 by its unique identifier",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"invoice-config"
],
"summary": "Delete invoice config",
"parameters": [
{
"type": "integer",
"description": "Invoice config 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/rooms": {
"get": {
"description": "Retrieve a list of all rooms ordered by creation date",
@@ -2906,6 +3179,38 @@ const docTemplate = `{
}
}
},
"models.InvoiceConfig": {
"type": "object",
"properties": {
"createdAt": {
"type": "string"
},
"description": {
"type": "string"
},
"id": {
"type": "integer"
},
"isActive": {
"type": "boolean"
},
"metadata": {
"type": "array",
"items": {
"type": "integer"
}
},
"name": {
"type": "string"
},
"type": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
}
},
"models.Room": {
"type": "object",
"properties": {
@@ -3158,6 +3463,27 @@ const docTemplate = `{
}
}
},
"requests.CreateInvoiceConfigRequest": {
"type": "object",
"required": [
"name",
"type"
],
"properties": {
"description": {
"type": "string"
},
"isActive": {
"type": "boolean"
},
"name": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"requests.CreateRoomRequest": {
"type": "object",
"required": [
@@ -3357,6 +3683,23 @@ const docTemplate = `{
}
}
},
"requests.UpdateInvoiceConfigRequest": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"isActive": {
"type": "boolean"
},
"name": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"requests.UpdateRoomRequest": {
"type": "object",
"properties": {
@@ -3485,6 +3828,14 @@ const docTemplate = `{
}
}
},
"responses.CreateInvoiceConfigResponse": {
"type": "object",
"properties": {
"id": {
"type": "integer"
}
}
},
"responses.CreateRoomResponse": {
"type": "object",
"properties": {
@@ -3664,6 +4015,26 @@ const docTemplate = `{
}
}
},
"responses.UpdateInvoiceConfigResponse": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"id": {
"type": "integer"
},
"isActive": {
"type": "boolean"
},
"name": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"responses.UpdateRoomResponse": {
"type": "object",
"properties": {