feat: implement POS order management system

- Added CreateOrderDto and CreateOrderItemDto for order creation.
- Developed PosOrdersController to handle order-related endpoints.
- Created PosOrdersService for business logic related to orders.
- Implemented PosOrdersWorkflow for order processing workflows.
- Established Prisma integration for database operations in orders.
- Introduced SalesInvoicesModule and related DTOs for sales invoice management.
- Enhanced SalesInvoicesService and SalesInvoicesWorkflow for invoice processing.
This commit is contained in:
2026-01-07 15:25:59 +03:30
parent b05048e62f
commit 5fd6611aca
37 changed files with 1974 additions and 291 deletions
File diff suppressed because one or more lines are too long
@@ -416,7 +416,8 @@ export const ModelName = {
StockAdjustment: 'StockAdjustment',
StockReservation: 'StockReservation',
Supplier: 'Supplier',
SupplierLedger: 'SupplierLedger'
SupplierLedger: 'SupplierLedger',
StockAvailableView: 'StockAvailableView'
} as const
export type ModelName = (typeof ModelName)[keyof typeof ModelName]
@@ -432,7 +433,7 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
omit: GlobalOmitOptions
}
meta: {
modelProps: "user" | "role" | "otpCode" | "refreshToken" | "bankBranch" | "bankAccount" | "bankAccountTransaction" | "inventory" | "inventoryBankAccount" | "posAccount" | "inventoryTransfer" | "inventoryTransferItem" | "bank" | "order" | "orderItem" | "customer" | "triggerLog" | "productVariant" | "product" | "productBrand" | "productCategory" | "purchaseReceipt" | "purchaseReceiptItem" | "purchaseReceiptPayments" | "salesInvoice" | "salesInvoiceItem" | "salesInvoicePayment" | "stockMovement" | "stockBalance" | "stockAdjustment" | "stockReservation" | "supplier" | "supplierLedger"
modelProps: "user" | "role" | "otpCode" | "refreshToken" | "bankBranch" | "bankAccount" | "bankAccountTransaction" | "inventory" | "inventoryBankAccount" | "posAccount" | "inventoryTransfer" | "inventoryTransferItem" | "bank" | "order" | "orderItem" | "customer" | "triggerLog" | "productVariant" | "product" | "productBrand" | "productCategory" | "purchaseReceipt" | "purchaseReceiptItem" | "purchaseReceiptPayments" | "salesInvoice" | "salesInvoiceItem" | "salesInvoicePayment" | "stockMovement" | "stockBalance" | "stockAdjustment" | "stockReservation" | "supplier" | "supplierLedger" | "stockAvailableView"
txIsolationLevel: TransactionIsolationLevel
}
model: {
@@ -2614,6 +2615,36 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
}
}
}
StockAvailableView: {
payload: Prisma.$StockAvailableViewPayload<ExtArgs>
fields: Prisma.StockAvailableViewFieldRefs
operations: {
findFirst: {
args: Prisma.StockAvailableViewFindFirstArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$StockAvailableViewPayload> | null
}
findFirstOrThrow: {
args: Prisma.StockAvailableViewFindFirstOrThrowArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$StockAvailableViewPayload>
}
findMany: {
args: Prisma.StockAvailableViewFindManyArgs<ExtArgs>
result: runtime.Types.Utils.PayloadToResult<Prisma.$StockAvailableViewPayload>[]
}
aggregate: {
args: Prisma.StockAvailableViewAggregateArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.AggregateStockAvailableView>
}
groupBy: {
args: Prisma.StockAvailableViewGroupByArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.StockAvailableViewGroupByOutputType>[]
}
count: {
args: Prisma.StockAvailableViewCountArgs<ExtArgs>
result: runtime.Types.Utils.Optional<Prisma.StockAvailableViewCountAggregateOutputType> | number
}
}
}
}
} & {
other: {
@@ -2829,7 +2860,8 @@ export const OrderScalarFieldEnum = {
createdAt: 'createdAt',
updatedAt: 'updatedAt',
deletedAt: 'deletedAt',
customerId: 'customerId'
customerId: 'customerId',
posAccountId: 'posAccountId'
} as const
export type OrderScalarFieldEnum = (typeof OrderScalarFieldEnum)[keyof typeof OrderScalarFieldEnum]
@@ -3078,7 +3110,6 @@ export type StockAdjustmentScalarFieldEnum = (typeof StockAdjustmentScalarFieldE
export const StockReservationScalarFieldEnum = {
id: 'id',
quantity: 'quantity',
expiresAt: 'expiresAt',
createdAt: 'createdAt',
productId: 'productId',
inventoryId: 'inventoryId',
@@ -3122,6 +3153,17 @@ export const SupplierLedgerScalarFieldEnum = {
export type SupplierLedgerScalarFieldEnum = (typeof SupplierLedgerScalarFieldEnum)[keyof typeof SupplierLedgerScalarFieldEnum]
export const StockAvailableViewScalarFieldEnum = {
productId: 'productId',
inventoryId: 'inventoryId',
physicalQuantity: 'physicalQuantity',
reservedQuantity: 'reservedQuantity',
availableQuantity: 'availableQuantity'
} as const
export type StockAvailableViewScalarFieldEnum = (typeof StockAvailableViewScalarFieldEnum)[keyof typeof StockAvailableViewScalarFieldEnum]
export const SortOrder = {
asc: 'asc',
desc: 'desc'
@@ -3634,6 +3676,7 @@ export type GlobalOmitConfig = {
stockReservation?: Prisma.StockReservationOmit
supplier?: Prisma.SupplierOmit
supplierLedger?: Prisma.SupplierLedgerOmit
stockAvailableView?: Prisma.StockAvailableViewOmit
}
/* Types for Logging */
@@ -83,7 +83,8 @@ export const ModelName = {
StockAdjustment: 'StockAdjustment',
StockReservation: 'StockReservation',
Supplier: 'Supplier',
SupplierLedger: 'SupplierLedger'
SupplierLedger: 'SupplierLedger',
StockAvailableView: 'StockAvailableView'
} as const
export type ModelName = (typeof ModelName)[keyof typeof ModelName]
@@ -278,7 +279,8 @@ export const OrderScalarFieldEnum = {
createdAt: 'createdAt',
updatedAt: 'updatedAt',
deletedAt: 'deletedAt',
customerId: 'customerId'
customerId: 'customerId',
posAccountId: 'posAccountId'
} as const
export type OrderScalarFieldEnum = (typeof OrderScalarFieldEnum)[keyof typeof OrderScalarFieldEnum]
@@ -527,7 +529,6 @@ export type StockAdjustmentScalarFieldEnum = (typeof StockAdjustmentScalarFieldE
export const StockReservationScalarFieldEnum = {
id: 'id',
quantity: 'quantity',
expiresAt: 'expiresAt',
createdAt: 'createdAt',
productId: 'productId',
inventoryId: 'inventoryId',
@@ -571,6 +572,17 @@ export const SupplierLedgerScalarFieldEnum = {
export type SupplierLedgerScalarFieldEnum = (typeof SupplierLedgerScalarFieldEnum)[keyof typeof SupplierLedgerScalarFieldEnum]
export const StockAvailableViewScalarFieldEnum = {
productId: 'productId',
inventoryId: 'inventoryId',
physicalQuantity: 'physicalQuantity',
reservedQuantity: 'reservedQuantity',
availableQuantity: 'availableQuantity'
} as const
export type StockAvailableViewScalarFieldEnum = (typeof StockAvailableViewScalarFieldEnum)[keyof typeof StockAvailableViewScalarFieldEnum]
export const SortOrder = {
asc: 'asc',
desc: 'desc'