diff options
| author | Randy Ridge <randyridge@gmail.com> | 2018-09-14 20:01:25 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-09-14 20:01:25 -0400 |
| commit | 908180c77cd38011eeedcae949613da2a3391e5e (patch) | |
| tree | b59bf1aae819a04d453cde72f6e601f5561a740f /stepped-solutions/53/backend/datamodel.graphql | |
| parent | 1f6667d233a4a2e9df977204d83a8f749c050c75 (diff) | |
| parent | b3bebda57ba187b7fa10398054b54c05d3fd3555 (diff) | |
Merge branch 'master' into randyridge/our
Diffstat (limited to 'stepped-solutions/53/backend/datamodel.graphql')
| -rwxr-xr-x | stepped-solutions/53/backend/datamodel.graphql | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/stepped-solutions/53/backend/datamodel.graphql b/stepped-solutions/53/backend/datamodel.graphql new file mode 100755 index 0000000..ce9ae38 --- /dev/null +++ b/stepped-solutions/53/backend/datamodel.graphql @@ -0,0 +1,57 @@ +enum Permission { + ADMIN + USER + ITEMCREATE + ITEMUPDATE + ITEMDELETE + PERMISSIONUPDATE +} + +type User { + id: ID! @unique + name: String! + email: String! @unique + password: String! + resetToken: String + resetTokenExpiry: String + permissions: [Permission] + cart: [CartItem!]! +} + +type Item { + id: ID! @unique + title: String! + description: String! + image: String + largeImage: String + price: Int! + user: User! +} + +type CartItem { + id: ID! @unique + quantity: Int! @default(value: 1) + item: Item # relationship to Item + user: User! # relationship to User +} + +type OrderItem { + id: ID! @unique + title: String! + description: String! + image: String! + largeImage: String! + price: Int! + quantity: Int! @default(value: 1) + user: User +} + +type Order { + id: ID! @unique + items: [OrderItem!]! + total: Int! + user: User! + charge: String! + createdAt: DateTime! + updatedAt: DateTime! +} |
