blob: ed5c45c680a8e0ee36bd1622fae2e0c33962a367 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
generator client {
provider = "prisma-client-js"
output = "./generated/client"
}
datasource db {
provider = "postgresql"
url = env("POSTGRES_PRISMA_URL")
directUrl = env("POSTGRES_URL_NON_POOLING")
}
model Company {
id Int @id @default(autoincrement())
name String
users User[]
locations Location[]
products Product[]
stockOpnames StockOpname[]
}
model User {
id Int @id @default(autoincrement())
name String
company Company @relation(fields: [companyId], references: [id])
companyId Int
username String @unique
password String
stockOpnames StockOpname[]
team Team
}
model Location {
id Int @id @default(autoincrement())
name String
company Company @relation(fields: [companyId], references: [id])
companyId Int
stockOpnames StockOpname[]
}
model Product {
id Int @id @default(autoincrement())
barcode String
itemCode String
name String
onhandQty Int
differenceQty Int
isDifferent Boolean
company Company @relation(fields: [companyId], references: [id])
companyId Int
stockOpnames StockOpname[]
}
model StockOpname {
id Int @id @default(autoincrement())
product Product @relation(fields: [productId], references: [id])
productId Int
location Location @relation(fields: [locationId], references: [id])
locationId Int
company Company @relation(fields: [companyId], references: [id])
companyId Int
user User @relation(fields: [userId], references: [id])
userId Int
team Team
quantity Int
isDifferent Boolean
}
enum Team {
COUNT1
COUNT2
COUNT3
VERIFICATION
}
|