Add product

This commit is contained in:
Niklas Fondberg
2021-04-08 15:09:31 +02:00
parent e0f629d54d
commit f60a51a94b
11 changed files with 184 additions and 171 deletions
+22 -103
View File
@@ -7,6 +7,15 @@ const typeDefs = gql`
orders: [Order]
order(id: ID!): Order
products(limit: Int, visible: Boolean, browsable: Boolean): [Product]
product(id: Int!): Product
}
type Market {
id: ID!
name: String
vat: Float
currency: String
priceAdjustment: Float
}
type Address {
@@ -79,12 +88,13 @@ const typeDefs = gql`
billingAddressId: Int
deliveryAddressId: Int
rows: [OrderRow]
marketObject: Market
}
type OrderRow {
id: ID!
order: Order
insertedDate: DateTime
inserted: DateTime
orderId: Int
productId: Int
productGroup: String
@@ -100,6 +110,11 @@ const typeDefs = gql`
pwintySku: String
}
type Category {
id: ID!
name: String
}
type Product {
id: ID!
path: String!
@@ -126,6 +141,7 @@ const typeDefs = gql`
groupId: Int!
group: ProductGroup!
marketId: Int!
market: Market!
inserted: DateTime!
updated: DateTime!
}
@@ -141,38 +157,13 @@ const typeDefs = gql`
export { typeDefs };
/**
schema {
query: Query
}
type Address {
id: ID!
firstname: String
lastname: String
recipientName: String
companyname: String
address1: String
address2: String
countryCode: String
city: String
zipcode: String
stateCountyOrRegion: String
}
type Category {
id: ID!
name: String
}
type ContactInformation {
email: String
phone: String
address: Address
}
scalar Date
scalar DateTime
type Designer {
id: ID!
@@ -180,98 +171,26 @@ type Designer {
orderRows(fromDate: Date, toDate: Date): [OrderRow]
}
enum Group {
PHOTO_WALLPAPER
CANVAS
WALLPAPER
DO_IT_YOURSELF_FRAME
DESIGNER_WALLPAPER
POSTER
FRAMED_PRINT
}
scalar JSONString
type Market {
id: ID!
name: String
}
type Order {
id: ID!
insertedDate: DateTime!
paid: Boolean!
confirmed: Boolean!
delivered: Boolean!
canceled: Boolean!
countryCode: String!
locale: String!
market: String!
currency: String
contractCustomerId: Int
exchangeRateEUR: Float
language: String
pwintyId: Int
email: String
phone: String
rows: [OrderRow]
billingInformation: ContactInformation
deliveryInformation: ContactInformation
}
type OrderRow {
id: ID!
order: Order
insertedDate: DateTime
orderId: Int
productId: Int
productGroup: String
artNo: String
path: String
name: String
price: Float
designerId: String
commissionAmount: String
status: String
pwintyImageId: Int
frameColor: String
pwintySku: String
json: JSONString
}
type PrintProduct {
id: ID!
group: Group!
insertedDate: DateTime!
insertedDate: DateTime!
updatedDate: DateTime
}
type Product {
id: ID!
path: String!
visible: Boolean
browsable: Boolean
insertedDate: DateTime!
updatedDate: DateTime!
categories: [Category]
designer: Designer
printProducts: [PrintProduct]
blacklisting: [ProductBlacklist]
insertedDate: DateTime!
updatedDate: DateTime
}
type ProductBlacklist {
id: ID!
group: Group!
marketId: String!
insertedDate: DateTime!
updatedDate: DateTime!
market: Market
insertedDate: DateTime!
updatedDate: DateTime
}
type Query {
products(limit: Int, visible: Boolean, browsable: Boolean): [Product]
product(id: Int!): Product
order(id: Int!): Order
designer(id: Int!): Designer
designers: [Designer]
}