$schema: "https://json-schema.org/draft/2020-12/schema"
title: "Product"
type: "object"

properties:
  productversion_id:
    $ref: '../ids.json#/definitions/ProductVersionId'
  name:
    type:
      string
    description: A short human-readable name of the product
  description:
    description: A short human-readable description of the product (one-line)
    type: string
  long_description:
    description: A human-readable description of the product, typically 1-3 paragraphs
    type: string
  disclaimers:
    type:
      array
    items:
      type: string
  methods:
    type:
      array
    items:
      type: string
  limitations:
    type:
      array
    items:
      type: string
  workflow_id:
    $ref: '../ids.json#/definitions/WorkflowId'
  workflow_config:
    type: "object"
  report_type:
    $ref: "../core.json#/definitions/ReportType"
  data_required:
    type: array
    description: |
      minimum data required to re-requisition a given product
    items:
      type: object
      $ref: "#/definitions/RequiredAlignmentMetrics"
  consents:
    type: array
    description: List of consents applicable to this product
    items:
      $ref: "../ids.json#/definitions/ConsentUri"
      
required:
  - productversion_id
  - name
  - description

examples:
  - productversion_id: 'PR-2008-0.0.1'
    name: 'MyOme Personal Genome, Genetic Health'
    description: MyOme Personal Genome screening based on ACMG secondary findings
    report_type: "MONOGENIC"

definitions:
  RequiredAlignmentMetrics:
    description: |
      required metrics from the alignment dataset
    type: object
    properties:
      dataset_type:
        allOf:
          - $ref: "../core.json#/definitions/DataSetType"
          - const: "ALIGNMENT"
      min_depth:
        type: "number"
        description: minimum sequencing depth
      sequencing_type: 
        description: sequencing type
        $ref: "../core.json#/definitions/SequencingType"
