89-poster-defaults (#96)

* print defaults in printproducts

* Add default to printproduct mutation

* added insertDefaults when changing productgroup

* fixed bug for square in square

* cleanup, and tests for calculations

* small fixes, added return values for update
This commit is contained in:
Arwid Thornström
2021-12-08 11:00:15 +01:00
committed by GitHub
parent b556bb8df2
commit 6741e82479
9 changed files with 3669 additions and 20 deletions
+51 -16
View File
@@ -390,6 +390,7 @@ type PrintProduct {
inserted: DateTime!
updated: DateTime
interiors: [Interior]
defaults: PrintProductDefaults
}
enum InteriorType {
@@ -413,6 +414,21 @@ type Interior {
orientation: Orientation
}
enum BorderType {
NONE
WHITE
BLACK
}
type PrintProductDefaults {
printId: ID
widthMm: Float
heightMm: Float
cropX: Float
cropY: Float
border: BorderType
}
type Designer {
id: ID!
name: String
@@ -476,32 +492,29 @@ type IdNumberResult {
}
type Mutation {
""" Product """
addProduct(name: String!, batch: String): Product
productInfo(productId: Int!, info: ProductInfoInput!): Product
productFocusPoint(
productWallpaperType(
productId: Int!
focusXpoint2: Float!
focusYpoint2: Float!
wallpaperTypes: [ProductWallpaperType]!
): Product
productBlacklisting(
productId: Int!
markets: [ProductBlacklistingInput]
): Product
productGroup(productId: Int!, groupIds: [Int]): Product
productGroupInteriors(productId: Int!, groupId: Int!, uris: [String]): Product
productKeywords(productId: Int!, keywordIds: [Int]): Product
""" Product Image """
productFocusPoint(
productId: Int!
focusXpoint2: Float!
focusYpoint2: Float!
): Product
productProportionsWarning(
productId: Int!
proportions: ProductProportionsInput!
): Product
addOwnInteriorToPrintProduct(
printId: Int!
uploadedS3Key: String!
): IdNumberResult
productWallpaperType(
productId: Int!
wallpaperTypes: [ProductWallpaperType]!
): Product
updateProductImage(
productId: Int!
uploadedS3Key: String!
@@ -509,16 +522,38 @@ type Mutation {
height: Int!
): String
""" Product Relations """
addRelatedProducts(productId: Int!, articleNumbers: [String]!): Product
removeRelatedProducts(productId: Int!, relatedProductIds: [Int]!): Product
addKeyword(name: String!, type: KeywordType): Keyword
""" Product Categories """
addCategoriesToProduct(productId: Int!, categoryIds: [Int]!): Product
removeCategoriesFromProduct(productId: Int!, categoryIds: [Int]!): Product
""" Product Keywords """
productKeywords(productId: Int!, keywordIds: [Int]): Product
addKeyword(name: String!, type: KeywordType): Keyword
""" Product Other """
updateProductComments(productId: Int!, comments: String!): Product
""" Printproducts """
productGroup(productId: Int!, groupIds: [Int]): Product
productGroupInteriors(productId: Int!, groupId: Int!, uris: [String]): Product
addOwnInteriorToPrintProduct(
printId: Int!
uploadedS3Key: String!
): IdNumberResult
printProductDefaults(
printId: Int!
widthMm: Int!
heightMm: Int!
cropX: Float!
cropY: Float!
border: BorderType!
): PrintProductDefaults
""" Mass Update """
massUpdatePublishing(
productIds: [Int]!
visible: Boolean