feat: update validation and exception handling, refactor controller routes, and enhance sales invoice item DTO

- Removed global validation pipe and added a new ValidationExceptionFilter for better error handling.
- Refactored controller routes to use underscores instead of hyphens for consistency.
- Updated CreateSalesInvoiceItemDto to include new fields: quantity, unit_type, and payload.
- Modified CreateSalesInvoiceDto to enforce items as an array with a minimum size.
- Added Enums module to provide gold karat values through a dedicated endpoint.
- Introduced new columns in the database schema for sales invoice items and goods.
This commit is contained in:
2026-02-16 20:51:34 +03:30
parent a073af76fe
commit 55b96d4f79
28 changed files with 572 additions and 122 deletions
@@ -1210,13 +1210,15 @@ export type SalesInvoiceScalarFieldEnum = (typeof SalesInvoiceScalarFieldEnum)[k
export const SalesInvoiceItemScalarFieldEnum = {
id: 'id',
count: 'count',
quantity: 'quantity',
unit_type: 'unit_type',
unit_price: 'unit_price',
total_amount: 'total_amount',
created_at: 'created_at',
invoice_id: 'invoice_id',
good_id: 'good_id',
service_id: 'service_id'
service_id: 'service_id',
payload: 'payload'
} as const
export type SalesInvoiceItemScalarFieldEnum = (typeof SalesInvoiceItemScalarFieldEnum)[keyof typeof SalesInvoiceItemScalarFieldEnum]
@@ -1276,6 +1278,14 @@ export const SortOrder = {
export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder]
export const NullableJsonNullValueInput = {
DbNull: DbNull,
JsonNull: JsonNull
} as const
export type NullableJsonNullValueInput = (typeof NullableJsonNullValueInput)[keyof typeof NullableJsonNullValueInput]
export const NullsOrder = {
first: 'first',
last: 'last'
@@ -1364,6 +1374,23 @@ export const SalesInvoiceOrderByRelevanceFieldEnum = {
export type SalesInvoiceOrderByRelevanceFieldEnum = (typeof SalesInvoiceOrderByRelevanceFieldEnum)[keyof typeof SalesInvoiceOrderByRelevanceFieldEnum]
export const JsonNullValueFilter = {
DbNull: DbNull,
JsonNull: JsonNull,
AnyNull: AnyNull
} as const
export type JsonNullValueFilter = (typeof JsonNullValueFilter)[keyof typeof JsonNullValueFilter]
export const QueryMode = {
default: 'default',
insensitive: 'insensitive'
} as const
export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode]
export const SalesInvoiceItemOrderByRelevanceFieldEnum = {
id: 'id',
invoice_id: 'invoice_id',
@@ -1450,6 +1477,27 @@ export type IntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'In
/**
* Reference to a field of type 'UnitType'
*/
export type EnumUnitTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'UnitType'>
/**
* Reference to a field of type 'Json'
*/
export type JsonFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Json'>
/**
* Reference to a field of type 'QueryMode'
*/
export type EnumQueryModeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'QueryMode'>
/**
* Reference to a field of type 'PaymentMethodType'
*/