{
  "version": "2.0",
  "productId": "demo-mug-wrap",
  "title": "Wrap-print mug",
  "layout": "stacked",
  "pricing": {
    "currency": "USD",
    "basePrice": {
      "amount": 0,
      "per": "order"
    }
  },
  "sections": [
    {
      "id": "mug",
      "title": "Your mug",
      "fields": [
        {
          "id": "mug",
          "type": "select-one",
          "display": "cards",
          "label": "Mug",
          "required": true,
          "options": [
            {
              "id": "oz11",
              "label": "11 oz classic",
              "description": "Wrap template 200 × 85 mm.",
              "default": true,
              "priceModifiers": [
                {
                  "type": "perUnit",
                  "amount": 8.5,
                  "tiers": {
                    "basis": "quantity",
                    "mode": "flat",
                    "rows": [
                      {
                        "upTo": 23,
                        "amount": 8.5
                      },
                      {
                        "upTo": 99,
                        "amount": 6.5
                      },
                      {
                        "amount": 5
                      }
                    ]
                  }
                }
              ],
              "filecheck": {
                "context": {
                  "artworkSize": {
                    "width_mm": 200,
                    "height_mm": 85
                  }
                }
              }
            },
            {
              "id": "oz15",
              "label": "15 oz tall",
              "description": "Wrap template 210 × 100 mm.",
              "priceModifiers": [
                {
                  "type": "perUnit",
                  "amount": 9.5,
                  "tiers": {
                    "basis": "quantity",
                    "mode": "flat",
                    "rows": [
                      {
                        "upTo": 23,
                        "amount": 9.5
                      },
                      {
                        "upTo": 99,
                        "amount": 7.5
                      },
                      {
                        "amount": 6
                      }
                    ]
                  }
                }
              ],
              "filecheck": {
                "context": {
                  "artworkSize": {
                    "width_mm": 210,
                    "height_mm": 100
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "id": "artwork",
      "title": "Your artwork - Filecheck",
      "fields": [
        {
          "id": "artwork",
          "type": "file",
          "display": "dropzone",
          "label": "Upload your wrap artwork",
          "helpText": "The artwork must match the wrap template of the mug you picked; switch mugs and the same file is re-checked against the new template. Keep 10 mm clear of each end for the handle.",
          "required": true,
          "accept": [
            "application/pdf",
            "image/png",
            "image/jpeg",
            "image/tiff"
          ],
          "providerId": "filecheck",
          "filecheck": {
            "workflowId": "wf_inline_demo",
            "workflow": {
              "schemaVersion": 1,
              "title": "Mug wrap demo",
              "trigger": "order_placed",
              "intake": {
                "ruleId": null,
                "onError": "halt",
                "enabled": true
              },
              "streams": [],
              "merge": {
                "mode": "none",
                "config": {},
                "onError": "halt",
                "enabled": true
              },
              "finalize": [],
              "proofing": {
                "enabled": false,
                "type": "basic",
                "timing": "after_intake",
                "requireApproval": false,
                "config": {}
              },
              "delivery": {
                "enabled": false,
                "destinationIds": []
              },
              "enabled": true,
              "ui": {},
              "rule": {
                "description": "Mug checks; the template follows the selected mug.",
                "cardinality": {
                  "min": 1,
                  "max": 1,
                  "slots": []
                },
                "accepts": [
                  {
                    "kind": "pdf",
                    "mimeTypes": [
                      "application/pdf"
                    ],
                    "extensions": [
                      "pdf"
                    ],
                    "maxSize": 100000000,
                    "convertToPdf": false,
                    "preflight": {
                      "enabled": true,
                      "profile": {
                        "id": "prof_demo_mug",
                        "schemaVersion": 1,
                        "description": "Mug wrap checks; template and handle keep-out",
                        "sections": {
                          "geometry": {
                            "id": "geometry",
                            "enabled": true,
                            "rules": {
                              "geom.page_size": {
                                "id": "geom.page_size",
                                "enabled": true,
                                "severity": "reject",
                                "target": {
                                  "allowed": [
                                    {
                                      "width_mm": 200,
                                      "height_mm": 85
                                    }
                                  ],
                                  "tolerance_mm": 1,
                                  "autofix_within_percent": 0
                                }
                              },
                              "geom.safety_margin": {
                                "id": "geom.safety_margin",
                                "enabled": true,
                                "severity": "warn",
                                "target": {
                                  "min_mm": 10
                                }
                              }
                            }
                          },
                          "raster": {
                            "id": "raster",
                            "enabled": true,
                            "rules": {
                              "raster.effective_dpi": {
                                "id": "raster.effective_dpi",
                                "enabled": true,
                                "severity": "warn",
                                "target": {
                                  "min_dpi": 300,
                                  "target_width_mm": 200,
                                  "target_height_mm": 85
                                }
                              },
                              "raster.aspect_ratio": {
                                "id": "raster.aspect_ratio",
                                "enabled": true,
                                "severity": "warn",
                                "target": {
                                  "ratio": [
                                    40,
                                    17
                                  ],
                                  "tolerance": 0.05
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "onFail": "reject"
                  },
                  {
                    "kind": "raster",
                    "mimeTypes": [
                      "image/jpeg",
                      "image/png",
                      "image/tiff"
                    ],
                    "extensions": [
                      "jpg",
                      "jpeg",
                      "png",
                      "tif",
                      "tiff"
                    ],
                    "maxSize": 100000000,
                    "convertToPdf": false,
                    "preflight": {
                      "enabled": true,
                      "profile": {
                        "id": "prof_demo_mug",
                        "schemaVersion": 1,
                        "description": "Mug wrap checks; template and handle keep-out",
                        "sections": {
                          "geometry": {
                            "id": "geometry",
                            "enabled": true,
                            "rules": {
                              "geom.page_size": {
                                "id": "geom.page_size",
                                "enabled": true,
                                "severity": "reject",
                                "target": {
                                  "allowed": [
                                    {
                                      "width_mm": 200,
                                      "height_mm": 85
                                    }
                                  ],
                                  "tolerance_mm": 1,
                                  "autofix_within_percent": 0
                                }
                              },
                              "geom.safety_margin": {
                                "id": "geom.safety_margin",
                                "enabled": true,
                                "severity": "warn",
                                "target": {
                                  "min_mm": 10
                                }
                              }
                            }
                          },
                          "raster": {
                            "id": "raster",
                            "enabled": true,
                            "rules": {
                              "raster.effective_dpi": {
                                "id": "raster.effective_dpi",
                                "enabled": true,
                                "severity": "warn",
                                "target": {
                                  "min_dpi": 300,
                                  "target_width_mm": 200,
                                  "target_height_mm": 85
                                }
                              },
                              "raster.aspect_ratio": {
                                "id": "raster.aspect_ratio",
                                "enabled": true,
                                "severity": "warn",
                                "target": {
                                  "ratio": [
                                    40,
                                    17
                                  ],
                                  "tolerance": 0.05
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "onFail": "reject"
                  }
                ],
                "rejectUnknownTypes": true,
                "enabled": true,
                "ui": {
                  "title": "Upload your wrap artwork"
                }
              }
            }
          }
        }
      ]
    },
    {
      "id": "extras",
      "title": "Extras & quantity",
      "fields": [
        {
          "id": "giftbox",
          "type": "select-one",
          "display": "pills",
          "label": "Gift box",
          "required": true,
          "options": [
            {
              "id": "none",
              "label": "None",
              "default": true,
              "priceModifiers": []
            },
            {
              "id": "box",
              "label": "Gift box",
              "priceModifiers": [
                {
                  "type": "perUnit",
                  "amount": 1.5
                }
              ]
            }
          ]
        },
        {
          "id": "qty",
          "type": "quantity",
          "display": "pills",
          "label": "How many mugs?",
          "min": 1,
          "defaultValue": 6,
          "presets": [
            6,
            12,
            24,
            48
          ]
        }
      ]
    },
    {
      "id": "summary",
      "title": "Summary",
      "fields": [
        {
          "id": "recap",
          "type": "info",
          "display": "summary"
        }
      ]
    }
  ]
}
