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

@@ -143,6 +143,27 @@ definitions:
warehouseName:
type: string
type: object
models.InvoiceConfig:
properties:
createdAt:
type: string
description:
type: string
id:
type: integer
isActive:
type: boolean
metadata:
items:
type: integer
type: array
name:
type: string
type:
type: string
updatedAt:
type: string
type: object
models.Room:
properties:
createdAt:
@@ -312,6 +333,20 @@ definitions:
- name
- shelfId
type: object
requests.CreateInvoiceConfigRequest:
properties:
description:
type: string
isActive:
type: boolean
name:
type: string
type:
type: string
required:
- name
- type
type: object
requests.CreateRoomRequest:
properties:
description:
@@ -444,6 +479,17 @@ definitions:
name:
type: string
type: object
requests.UpdateInvoiceConfigRequest:
properties:
description:
type: string
isActive:
type: boolean
name:
type: string
type:
type: string
type: object
requests.UpdateRoomRequest:
properties:
description:
@@ -526,6 +572,11 @@ definitions:
id:
type: integer
type: object
responses.CreateInvoiceConfigResponse:
properties:
id:
type: integer
type: object
responses.CreateRoomResponse:
properties:
id:
@@ -642,6 +693,19 @@ definitions:
shelfId:
type: integer
type: object
responses.UpdateInvoiceConfigResponse:
properties:
description:
type: string
id:
type: integer
isActive:
type: boolean
name:
type: string
type:
type: string
type: object
responses.UpdateRoomResponse:
properties:
description:
@@ -1844,6 +1908,176 @@ paths:
summary: Update container
tags:
- container
/v1/invoice-configs:
get:
consumes:
- application/json
description: Retrieve a list of all invoice configs ordered by creation date
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/response.SuccessResponse'
- properties:
data:
items:
$ref: '#/definitions/models.InvoiceConfig'
type: array
type: object
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/response.ErrorResponse'
summary: List all invoice configs
tags:
- invoice-config
post:
consumes:
- application/json
description: Create a new invoice config with the provided details
parameters:
- description: Invoice config request body
in: body
name: body
required: true
schema:
$ref: '#/definitions/requests.CreateInvoiceConfigRequest'
produces:
- application/json
responses:
"201":
description: Created
schema:
allOf:
- $ref: '#/definitions/response.SuccessResponse'
- properties:
data:
$ref: '#/definitions/responses.CreateInvoiceConfigResponse'
type: object
"400":
description: Bad Request
schema:
$ref: '#/definitions/response.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/response.ErrorResponse'
summary: Create a new invoice config
tags:
- invoice-config
/v1/invoice-configs/{id}:
delete:
consumes:
- application/json
description: Delete an invoice config by its unique identifier
parameters:
- description: Invoice config ID
in: path
name: id
required: true
type: integer
produces:
- application/json
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'
summary: Delete invoice config
tags:
- invoice-config
get:
consumes:
- application/json
description: Retrieve a single invoice config using its unique identifier
parameters:
- description: Invoice config ID
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/response.SuccessResponse'
- properties:
data:
$ref: '#/definitions/models.InvoiceConfig'
type: object
"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'
summary: Get invoice config by ID
tags:
- invoice-config
put:
consumes:
- application/json
description: Update an existing invoice config by its ID. Only non-empty fields
will be updated.
parameters:
- description: Invoice config ID
in: path
name: id
required: true
type: integer
- description: Invoice config request body
in: body
name: body
required: true
schema:
$ref: '#/definitions/requests.UpdateInvoiceConfigRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/response.SuccessResponse'
- properties:
data:
$ref: '#/definitions/responses.UpdateInvoiceConfigResponse'
type: object
"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'
summary: Update invoice config
tags:
- invoice-config
/v1/rooms:
get:
consumes: