{
 "$schema": "../../lib/umlimator.schema.json",
 "schemaVersion": 2,
 "title": "Requirement diagram",
 "root": "requirements",
 "nodes": [
  { "id": "bookshop", "type": "uml.Package", "label": "Online bookshop" },
  { "id": "ordering", "type": "sysml.Requirement", "label": "Online ordering", "parent": "bookshop",
   "props": { "reqId": "SHOP-1", "text": "The shop shall let a customer find, order and pay for books online." } },
  { "id": "search", "type": "sysml.Requirement", "label": "Search", "parent": "ordering",
   "props": { "reqId": "SHOP-1.1", "text": "The storefront shall find a book by its title, author or ISBN.", "stereotypes": ["functionalRequirement"], "risk": "low", "verifyMethod": "demonstration" } },
  { "id": "search-speed", "type": "sysml.Requirement", "label": "Search speed", "parent": "search",
   "props": { "reqId": "SHOP-1.1.1", "text": "Results shall appear within 1 s for 95 % of searches.", "stereotypes": ["performanceRequirement"], "risk": "medium", "verifyMethod": "test" } },
  { "id": "checkout", "type": "sysml.Requirement", "label": "Checkout", "parent": "ordering",
   "props": { "reqId": "SHOP-1.2", "text": "A customer shall place an order and pay for it in one checkout.", "stereotypes": ["functionalRequirement"], "risk": "high", "verifyMethod": "test" } },
  { "id": "refunds", "type": "sysml.Requirement", "label": "Refunds", "parent": "ordering",
   "props": { "reqId": "SHOP-1.3", "text": "A customer may return a book within 14 days of delivery for a full refund." } },
  { "id": "reg-refunds", "type": "sysml.Requirement", "label": "Distance selling refunds", "parent": "bookshop",
   "props": { "reqId": "REG-2", "text": "A customer may return a book within 14 days of delivery for a full refund." } },
  { "id": "checkout-pages", "type": "sysml.Requirement", "label": "Short checkout", "parent": "bookshop",
   "props": { "reqId": "CX-2", "text": "A checkout shall take no more than three pages.", "stereotypes": ["designConstraint"], "risk": "medium", "verifyMethod": "analysis" } },
  { "id": "payments", "type": "uml.Package", "label": "Payments", "parent": "bookshop" },
  { "id": "card-data", "type": "sysml.Requirement", "label": "No stored card numbers", "parent": "payments",
   "props": { "reqId": "PAY-1", "text": "The shop shall never store a full card number. The card gateway keeps the number and hands the shop a token, which the shop keeps with the order so that a refund can go back to the same card without asking the customer again.", "stereotypes": ["designConstraint"], "risk": "high", "verifyMethod": "inspection" } },
  { "id": "gateway-api", "type": "sysml.Requirement", "label": "Gateway interface", "parent": "payments",
   "props": { "reqId": "PAY-2", "text": "The api shall charge cards through the card gateway's REST interface.", "stereotypes": ["interfaceRequirement"], "risk": "low", "verifyMethod": "inspection" } },
  { "id": "parcel", "type": "sysml.Requirement", "label": "Parcel size", "parent": "bookshop",
   "props": { "reqId": "WH-1", "text": "Up to three paperbacks shall ship in one large-letter parcel.", "stereotypes": ["physicalRequirement"], "risk": "low", "verifyMethod": "inspection" } },
  { "id": "storefront", "type": "sysml.Block", "label": "Storefront", "parent": "bookshop" },
  { "id": "search-index", "type": "sysml.Block", "label": "Search index", "parent": "bookshop" },
  { "id": "gateway", "type": "sysml.Block", "label": "Card gateway", "parent": "payments" },
  { "id": "warehouse", "type": "sysml.Block", "label": "Warehouse", "parent": "bookshop" },
  { "id": "load-test", "type": "sysml.TestCase", "label": "Search load test", "parent": "bookshop" },
  { "id": "walkthrough", "type": "sysml.TestCase", "label": "Checkout walk-through", "parent": "bookshop" },
  { "id": "why-three", "type": "uml.Comment", "label": "Each extra page loses about one shopper in ten", "props": { "stereotypes": ["rationale"] } },
  { "id": "saved-cards", "type": "uml.Comment", "label": "Repeat customers ask to save their cards", "props": { "stereotypes": ["problem"] } }
 ],
 "edges": [
  { "id": "pages-from-checkout", "type": "sysml.DeriveReqt", "from": "checkout-pages", "to": "checkout" },
  { "id": "refunds-copy-reg", "type": "sysml.Copy", "from": "refunds", "to": "reg-refunds" },
  { "id": "gateway-api-traces-checkout", "type": "sysml.Trace", "from": "gateway-api", "to": "checkout" },
  { "id": "index-refines-search", "type": "sysml.Refine", "from": "search-index", "to": "search" },
  { "id": "storefront-satisfies-checkout", "type": "sysml.Satisfy", "from": "storefront", "to": "checkout" },
  { "id": "gateway-satisfies-card-data", "type": "sysml.Satisfy", "from": "gateway", "to": "card-data" },
  { "id": "warehouse-satisfies-parcel", "type": "sysml.Satisfy", "from": "warehouse", "to": "parcel" },
  { "id": "load-test-verifies-speed", "type": "sysml.Verify", "from": "load-test", "to": "search-speed" },
  { "id": "walkthrough-verifies-pages", "type": "sysml.Verify", "from": "walkthrough", "to": "checkout-pages" },
  { "id": "why-three-link", "type": "uml.CommentLink", "from": "why-three", "to": "checkout-pages" },
  { "id": "saved-cards-link", "type": "uml.CommentLink", "from": "saved-cards", "to": "card-data" }
 ],
 "views": [
  { "id": "requirements", "diagram": "sysml.requirement", "title": "What the shop must do", "parent": null, "subject": "bookshop", "direction": "down",
   "layout": { "walkthrough": [5, 3] },
   "nodeIds": ["bookshop", "ordering", "search", "search-speed", "checkout", "refunds", "reg-refunds", "checkout-pages", "payments", "card-data", "gateway-api", "parcel", "storefront", "search-index", "gateway", "warehouse", "load-test", "walkthrough", "why-three", "saved-cards"],
   "present": { "card-data": { "rows": 4 } } }
 ]
}
