{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://kaldenframelabs.com/schemas/service-offer-v1.schema.json",
  "title": "KaldenFrame Labs service offer v1",
  "description": "Strict machine-readable contract for one current KaldenFrame request-to-buy service. Presence is not evidence of purchase, adoption, endorsement, availability guarantee, or fitness.",
  "type": "object",
  "additionalProperties": false,
  "required": ["$schema", "schema", "offerVersion", "generatedUtc", "publisher", "service", "offerBoundary"],
  "properties": {
    "$schema": {"const": "https://kaldenframelabs.com/schemas/service-offer-v1.schema.json"},
    "schema": {"const": "kaldenframe.service-offer.v1"},
    "offerVersion": {"const": "1.0.0"},
    "generatedUtc": {"type": "string", "format": "date-time"},
    "publisher": {
      "type": "object",
      "additionalProperties": false,
      "required": ["name", "url", "contactUrl"],
      "properties": {
        "name": {"const": "KaldenFrame Labs"},
        "url": {"const": "https://kaldenframelabs.com/"},
        "contactUrl": {"const": "https://kaldenframelabs.com/contact/"}
      }
    },
    "service": {"$ref": "#/$defs/service"},
    "offerBoundary": {"$ref": "#/$defs/nonEmptyStrings"}
  },
  "$defs": {
    "firstPartyUrl": {"type": "string", "format": "uri", "pattern": "^https://kaldenframelabs\\.com/"},
    "nonEmptyStrings": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {"type": "string", "minLength": 1, "maxLength": 1200}
    },
    "deliverable": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "name", "description"],
      "properties": {
        "id": {"type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"},
        "name": {"type": "string", "minLength": 1, "maxLength": 160},
        "description": {"type": "string", "minLength": 1, "maxLength": 800}
      }
    },
    "service": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "name", "serviceType", "status", "canonicalUrl", "price", "scope", "acceptedInput", "deliverables", "delivery", "followUp", "routes", "exclusions", "refunds", "claimBoundary"],
      "properties": {
        "id": {"const": "KALDENFRAME-RELEASE-BOUNDARY-REVIEW-V1"},
        "name": {"const": "Release Boundary Review"},
        "serviceType": {"const": "Release workflow architecture review"},
        "status": {"const": "AVAILABLE_REQUEST_TO_BUY"},
        "canonicalUrl": {"const": "https://kaldenframelabs.com/services/release-boundary-review/"},
        "price": {
          "type": "object",
          "additionalProperties": false,
          "required": ["model", "amount", "currency", "checkoutStatus"],
          "properties": {
            "model": {"const": "FIXED_ONE_TIME"},
            "amount": {"const": 450},
            "currency": {"const": "USD"},
            "checkoutStatus": {"const": "EMAIL_SCOPE_CONFIRMATION_BEFORE_PAYMENT"}
          }
        },
        "scope": {
          "type": "object",
          "additionalProperties": false,
          "required": ["repositoryCount", "repositoryVisibility", "repositoryHost", "releasePathCount", "releaseDecisionCount", "largeMonorepoIncluded", "multipleReleasePathsIncluded"],
          "properties": {
            "repositoryCount": {"const": 1},
            "repositoryVisibility": {"const": "PUBLIC"},
            "repositoryHost": {"const": "GITHUB"},
            "releasePathCount": {"const": 1},
            "releaseDecisionCount": {"const": 1},
            "largeMonorepoIncluded": {"const": false},
            "multipleReleasePathsIncluded": {"const": false}
          }
        },
        "acceptedInput": {
          "type": "object",
          "additionalProperties": false,
          "required": ["required", "optional", "prohibited"],
          "properties": {
            "required": {"$ref": "#/$defs/nonEmptyStrings"},
            "optional": {"$ref": "#/$defs/nonEmptyStrings"},
            "prohibited": {"$ref": "#/$defs/nonEmptyStrings"}
          }
        },
        "deliverables": {
          "type": "array",
          "minItems": 3,
          "maxItems": 3,
          "items": {"$ref": "#/$defs/deliverable"}
        },
        "delivery": {
          "type": "object",
          "additionalProperties": false,
          "required": ["format", "dueWithinBusinessDays", "clockStartsAfter"],
          "properties": {
            "format": {"const": "WRITTEN_TECHNICAL_REPORT_BY_EMAIL"},
            "dueWithinBusinessDays": {"const": 5},
            "clockStartsAfter": {"$ref": "#/$defs/nonEmptyStrings"}
          }
        },
        "followUp": {
          "type": "object",
          "additionalProperties": false,
          "required": ["included", "rounds", "format", "requestWithinCalendarDaysAfterDelivery"],
          "properties": {
            "included": {"const": true},
            "rounds": {"const": 1},
            "format": {"const": "CONSOLIDATED_EMAIL"},
            "requestWithinCalendarDaysAfterDelivery": {"const": 7}
          }
        },
        "routes": {
          "type": "object",
          "additionalProperties": false,
          "required": ["fitCheckUrl", "sampleUrl", "termsUrl", "privacyUrl", "purchaseRequest"],
          "properties": {
            "fitCheckUrl": {"$ref": "#/$defs/firstPartyUrl"},
            "sampleUrl": {"$ref": "#/$defs/firstPartyUrl"},
            "termsUrl": {"$ref": "#/$defs/firstPartyUrl"},
            "privacyUrl": {"$ref": "#/$defs/firstPartyUrl"},
            "purchaseRequest": {
              "type": "object",
              "additionalProperties": false,
              "required": ["method", "address", "scopeConfirmationRequiredBeforePayment", "webCheckoutActive"],
              "properties": {
                "method": {"const": "EMAIL"},
                "address": {"const": "billing@kaldenframelabs.com"},
                "scopeConfirmationRequiredBeforePayment": {"const": true},
                "webCheckoutActive": {"const": false}
              }
            }
          }
        },
        "exclusions": {"$ref": "#/$defs/nonEmptyStrings"},
        "refunds": {"$ref": "#/$defs/nonEmptyStrings"},
        "claimBoundary": {"$ref": "#/$defs/nonEmptyStrings"}
      }
    }
  }
}
