$schema: "https://json-schema.org/draft/2020-12/schema"
title: ODPS 4.1 Schema
type: object
required: [schema, version, product]
properties:
  schema:
    type: string
    format: uri
  version:
    type: number
  product:
    type: object
    required: [details]
    properties:
      contract:
        type: object
        required: [id, type, contractVersion, contractURL]
        properties:
          id:
            type: string
          type:
            type: string
          contractVersion:
            type: string
          contractURL:
            type: string
            format: uri

      details:
        type: object
        properties:
          en:
            type: object
            required: [name, productID, valueProposition, description, visibility, status, productVersion]
            properties:
              name:
                type: string
              productID:
                type: string
              governanceProfile:
                description: Indicates the governance maturity applied to the data product. The value describes the expected level of governance enforcement, automation, and operational control associated with the product.
                type: string
                enum:
                  - structured
                  - enforced
                  - automated
                  - audit_ready
              portfolioPriority:
                description: Indicates the importance of the data product within the organization's data product portfolio.
                type: string
                enum:
                  - critical
                  - high
                  - medium
                  - low
              valueProposition:
                type: string
              description:
                type: string
              visibility:
                type: string
              status:
                type: string
              productVersion:
                type: string

      productStrategy:
        type: object
        properties:
          status:
            type: string
            enum:
              - Planned
              - Active
              - At Risk
              - Achieved
              - Partially Achieved
              - Cancelled
              - Expired
          
          startDate:
            type: string
            format: date
            description: Date when the product strategy becomes active. Use ISO 8601, (YYYY-MM-DD).

          endDate:
            type: string
            format: date
            description: Date when the product strategy ends or is planned to end. Use ISO 8601, (YYYY-MM-DD).

          objectives:
            type: array
            items:
              type: object
              properties:
                en:
                  type: string

          strategicAlignment:
            type: array
            items:
              type: object
              properties:
                en:
                  type: string

          contributesToKPI:
            type: object
            required: [id, name, unit, target]
            properties:
              id:
                type: string
              name:
                type: string
              description:
                type: string
              unit:
                type: string
              target:
                type: [number, string]
              direction:
                type: string
                enum: [increase, decrease, at_least, at_most, equals]
              timeframe:
                type: string

          productKPIs:
            type: array
            items:
              type: object
              required: [id, name, unit, target]
              properties:
                id:
                  type: string
                name:
                  type: string
                description:
                  type: string
                unit:
                  type: string
                target:
                  type: [number, string]
                direction:
                  type: string
                  enum: [increase, decrease, at_least, at_most, equals]
                frequency:
                  type: string
                owner:
                  type: string
                calculation:
                  type: string

          relatedKPIs:
            type: array
            items:
              type: object
              required: [id, name, unit, target]
              properties:
                id:
                  type: string
                name:
                  type: string
                unit:
                  type: string
                target:
                  type: [number, string]
                direction:
                  type: string
                  enum: [increase, decrease, at_least, at_most, equals]

      pricingPlans:
        type: object
        properties:
          declarative:
            type: object
            properties:
              en:
                type: array
                items:
                  type: object
                  required: [name]

      SLA:
        type: object
        properties:
          declarative:
            type: object
            additionalProperties:
              type: object
              properties:
                name:
                  type: object
                  properties:
                    en:
                      type: string
                dimensions:
                  type: array
                  items:
                    type: object
                    required: [dimension, objective, unit]
                    properties:
                      dimension:
                        type: string
                      objective:
                        type: integer
                      unit:
                        type: string
                      weight:
                        type: integer
                        description: Relative importance of this dimension for product-level scoring. User-editable integer (no decimals).

      dataQuality:
        type: object
        properties:
          declarative:
            type: object
            additionalProperties:
              type: object
              properties:
                displaytitle:
                  type: object
                  properties:
                    en:
                      type: string
                dimensions:
                  type: array
                  items:
                    type: object
                    required: [dimension, objective, unit]
                    properties:
                      dimension:
                        type: string
                      objective:
                        type: integer
                      unit:
                        type: string
                      weight:
                        type: integer
                        description: Relative importance of this dimension for product-level scoring. User-editable integer (no decimals).
          executable:
            type: array
            items:
              type: object
              properties:
                dimension:
                  type: string
                type:
                  type: string
                  enum:
                    - SodaCL
                    - Montecarlo
                    - DQOps
                    - Great Expectations
                    - OpenMetadata
                    - Custom
                version:
                  type: string
                reference:
                  type: string
                  format: uri
                spec:
                  type: object

      dataAccess:
        type: object
        additionalProperties:
          type: object
          required: [outputPorttype]

      paymentGateways:
        type: object
        additionalProperties:
          type: object
          required: [type, version]

      support:
        type: object
        required: [phoneNumber, email]

      license:
        type: object
        properties:
          en:
            type: object
            required: [scope, termination, governance]

      dataHolder:
        type: object
        properties:
          en:
            type: object
            required: [legalName, email, URL, streetAddress, postalCode, addressLocality, addressCountry]
