feat(cardex): implement cardex controller, service, and DTO for stock movements

feat(pos): add POS controller and service for order creation and stock retrieval
refactor(pos): enhance stock and product category retrieval with pagination and mapping
This commit is contained in:
2025-12-21 19:09:41 +03:30
parent d514267f58
commit c6a86719dd
42 changed files with 3769 additions and 119 deletions
+38 -11
View File
@@ -10,16 +10,17 @@ datasource db {
}
model User {
id Int @id @default(autoincrement())
mobileNumber String @unique @db.Char(11)
password String
firstName String
lastName String
roleId Int
createdAt DateTime @default(now()) @db.Timestamp(0)
deletedAt DateTime? @db.Timestamp(0)
updatedAt DateTime @updatedAt @db.Timestamp(0)
role Role @relation("User_Role", fields: [roleId], references: [id], onUpdate: NoAction)
id Int @id @default(autoincrement())
mobileNumber String @unique @db.Char(11)
password String
firstName String
lastName String
roleId Int
createdAt DateTime @default(now()) @db.Timestamp(0)
deletedAt DateTime? @db.Timestamp(0)
updatedAt DateTime @updatedAt @db.Timestamp(0)
role Role @relation("User_Role", fields: [roleId], references: [id], onUpdate: NoAction)
refreshTokens RefreshToken[]
@@index([roleId], map: "Users_roleId_fkey")
@@map("Users")
@@ -27,7 +28,7 @@ model User {
model Role {
id Int @id @default(autoincrement())
name String @db.VarChar(100)
name String @unique() @db.VarChar(100)
description String? @db.Text
permissions Json?
createdAt DateTime @default(now()) @db.Timestamp(0)
@@ -345,6 +346,32 @@ model StockBalance {
@@map("Stock_Balance")
}
model OtpCode {
id Int @id @default(autoincrement())
mobileNumber String @db.VarChar(20)
code String @db.VarChar(10)
used Boolean @default(false)
expiresAt DateTime @db.Timestamp(0)
createdAt DateTime @default(now()) @db.Timestamp(0)
@@index([mobileNumber])
@@map("Otp_Codes")
}
model RefreshToken {
id Int @id @default(autoincrement())
tokenHash String @db.VarChar(255)
userId Int
revoked Boolean @default(false)
expiresAt DateTime @db.Timestamp(0)
createdAt DateTime @default(now()) @db.Timestamp(0)
user User @relation(fields: [userId], references: [id])
@@index([userId])
@@map("Refresh_Tokens")
}
model InventoryTransfer {
id Int @id @default(autoincrement())
code String @unique @db.VarChar(100)