summaryrefslogtreecommitdiffstats
path: root/backend/database
diff options
context:
space:
mode:
Diffstat (limited to 'backend/database')
-rw-r--r--backend/database/datamodel.graphql15
1 files changed, 14 insertions, 1 deletions
diff --git a/backend/database/datamodel.graphql b/backend/database/datamodel.graphql
index 940fb6f..c4ac4f6 100644
--- a/backend/database/datamodel.graphql
+++ b/backend/database/datamodel.graphql
@@ -43,9 +43,22 @@ type Item {
updatedAt: DateTime!
}
+type OrderItem {
+ id: ID! @unique
+ title: String!
+ description: String!
+ image: String
+ price: Int!
+ createdAt: DateTime!
+ updatedAt: DateTime!
+ quantity: Int! @default(value: 1)
+ item: Item! # Relationship to an Item
+ user: User! # Relationship to a user
+}
+
type Order {
id: ID! @unique
- items: [Item!]!
+ items: [OrderItem!]!
total: Int!
user: User!
createdAt: DateTime!