{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ordogrid/json-schema/ordogrid-fidelity-program-schema.json",
  "title": "FidelityProgram",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ordogrid-fidelity-api-openapi.yml#/components/schemas/FidelityProgram",
  "properties": {
    "object": {
      "const": "fidelity_program"
    },
    "program": {
      "properties": {
        "_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "company_id": {
          "type": "string"
        },
        "created_at": {
          "description": "UTC, ISO 8601 with milliseconds and Z, e.g. 2026-10-22T10:00:00.123Z.",
          "format": "date-time",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
          "type": [
            "string",
            "null"
          ]
        },
        "mode": {
          "enum": [
            "points",
            "stamps"
          ],
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "settings": {
          "properties": {
            "brand_color": {
              "type": "string"
            },
            "earn_rate": {
              "default": 1,
              "exclusiveMinimum": 0,
              "type": "number"
            },
            "expiry_reminder_days": {
              "default": 3,
              "minimum": 0,
              "type": "integer"
            },
            "expiry_reminder_enabled": {
              "default": true,
              "type": "boolean"
            },
            "from_name": {
              "type": "string"
            },
            "google_review_url": {
              "type": "string"
            },
            "logo_url": {
              "type": "string"
            },
            "min_order_amount": {
              "default": 0,
              "minimum": 0,
              "type": "number"
            },
            "reply_to": {
              "type": "string"
            },
            "rounding": {
              "const": "floor",
              "default": "floor"
            },
            "wallet_enabled": {
              "default": true,
              "type": "boolean"
            },
            "welcome_bonus_points": {
              "default": 0,
              "minimum": 0,
              "type": "integer"
            }
          },
          "type": "object"
        },
        "status": {
          "enum": [
            "active",
            "inactive"
          ],
          "type": "string"
        },
        "updated_at": {
          "description": "UTC, ISO 8601 with milliseconds and Z, e.g. 2026-10-22T10:00:00.123Z.",
          "format": "date-time",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    }
  },
  "type": "object"
}