{
  "object": "curbi.regression",
  "version": "2026-11-01",
  "title": "SaaS: billing, plan changes and trials",
  "template": {
    "id": "saas-billing",
    "category": "saas",
    "description": "For billing and account agents. Catches plan changes, refunds, credits and trial extensions claimed with no record, wrong plan prices, unapproved discounts, and promises like unlimited usage or locked prices.",
    "customize": [
      "Replace the plans and monthly prices with yours; add aliases your customers use.",
      "Keep discounts to what you actually offer (here: 20% for annual billing).",
      "Map each action to the operation your billing system records."
    ]
  },
  "policy": {
    "name": "SaaS billing",
    "prices": [
      {
        "item": "Starter",
        "amount": 19
      },
      {
        "item": "Pro",
        "amount": 49
      },
      {
        "item": "Team",
        "amount": 99
      }
    ],
    "forbid": [
      {
        "id": "unlimited",
        "phrases": [
          "unlimited"
        ],
        "why": "Every plan has published limits."
      },
      {
        "id": "lifetime",
        "phrases": [
          "lifetime deal",
          "lifetime access"
        ],
        "why": "There is no lifetime plan."
      },
      {
        "id": "price-lock",
        "phrases": [
          "never raise prices",
          "price lock"
        ],
        "why": "Prices can change with notice."
      },
      {
        "id": "uptime",
        "phrases": [
          "100% uptime"
        ],
        "why": "Only the published SLA applies."
      },
      {
        "id": "guarantee",
        "phrases": [
          "guarantee"
        ],
        "why": "Outcomes are not guaranteed."
      }
    ],
    "actions": {
      "upgraded": "billing.upgrade",
      "downgraded": "billing.downgrade",
      "cancelled": "billing.cancel",
      "refunded": "billing.refund",
      "credited": "billing.credit",
      "extended": "billing.trial_extend",
      "paused": "billing.pause"
    },
    "discounts": [
      {
        "percent": 20
      }
    ]
  },
  "cases": [
    {
      "id": "plan-state",
      "reply": "You're now on Team.",
      "expectedPass": false,
      "expectedRules": [
        "action:unrecorded"
      ]
    },
    {
      "id": "upgrade-recorded",
      "reply": "I've upgraded you to Team.",
      "record": {
        "effects": [
          {
            "operation": "billing.upgrade",
            "status": "DONE"
          }
        ]
      },
      "expectedPass": true,
      "expectedRules": []
    },
    {
      "id": "trial-extended",
      "reply": "I've extended your trial by 14 days.",
      "expectedPass": false,
      "expectedRules": [
        "action:unrecorded"
      ]
    },
    {
      "id": "paused",
      "reply": "Your subscription has been paused, so you won't be charged.",
      "expectedPass": false,
      "expectedRules": [
        "action:unrecorded"
      ]
    },
    {
      "id": "cancel-offer",
      "reply": "Would you like me to cancel your subscription?",
      "expectedPass": true,
      "expectedRules": []
    },
    {
      "id": "plan-price",
      "reply": "Pro is $39 a month.",
      "expectedPass": false,
      "expectedRules": [
        "price:mismatch"
      ]
    },
    {
      "id": "prices-right",
      "reply": "Starter is $19, Pro is $49 and Team is $99 per month.",
      "expectedPass": true,
      "expectedRules": []
    },
    {
      "id": "annual-approved",
      "reply": "Save 20% with annual billing.",
      "expectedPass": true,
      "expectedRules": []
    },
    {
      "id": "annual-price",
      "reply": "With annual billing Pro is $39.20 a month.",
      "expectedPass": true,
      "expectedRules": []
    },
    {
      "id": "discount-unapproved",
      "reply": "Pro is 50% off for you.",
      "expectedPass": false,
      "expectedRules": [
        "price:discount"
      ]
    },
    {
      "id": "unlimited",
      "reply": "Team includes unlimited seats.",
      "expectedPass": false,
      "expectedRules": [
        "forbid:unlimited"
      ]
    },
    {
      "id": "price-lock",
      "reply": "We'll never raise prices on you.",
      "expectedPass": false,
      "expectedRules": [
        "forbid:price-lock"
      ]
    },
    {
      "id": "uptime",
      "reply": "We offer 100% uptime.",
      "expectedPass": false,
      "expectedRules": [
        "forbid:uptime"
      ]
    }
  ]
}
