-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatamodel.prisma
110 lines (97 loc) · 1.69 KB
/
datamodel.prisma
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
type User {
id: ID! @id
name: String!
email: String! @unique
password: String!
addresses: [Address]
cart: Cart
addnInfo: AddInfo
orders: [Order]
}
type Address{
id: ID! @id
name: String!
line1: String!
line2: String
district: String
state: String
pincode: String
user : User @relation(link: INLINE)
}
type Supplier{
id: ID! @id
code: String!
name: String!
gstin: String
}
type Company{
id: ID!@id
name: String!
}
type Product{
id: ID! @id
code: String!
name: String!
imageuri: String
category: Category!
tags: [Tag]
hsn: String
variants: [Variant!]!
supplier: Supplier!
company: Company!
}
type Variant{
id: ID! @id
name: String!
price: Int
pRate: Float
taxType: Float
stock: Int
product: Product @relation(link: INLINE)
}
type Category{
id: ID! @id
name: String!
}
type Tag{
id: ID! @id
name: String!
search: String!
}
type Cart{
id: ID! @id
items: [CartItem]!
user: User! @relation(link: INLINE)
}
type CartItem{
id: ID! @id
cart: Cart @relation(link: INLINE)
product : Product!
variant: Variant! @relation(link: INLINE)
quantity: Int! @default(value: 1)
}
type Order{
id: ID! @id
user: User! @relation(link: INLINE)
delivered: Boolean! @default(value: false)
items: [CartItem]!
amount: Int!
orderDate: DateTime!
deliverDate: DateTime
eta: DateTime
payment: Payment! @relation(link: INLINE)
deliverTo: Address!
}
type Payment{
id: ID! @id
user: User! @relation(link: INLINE)
order: Order!
modeOfPayment: String!
payed: Boolean! @default(value: false)
amount : Int!
}
type AddInfo{
id: ID! @id
user: User! @relation(link: INLINE)
nickName: String! @default(value: "Dude")
}