$schema: "https://json-schema.org/draft/2020-12/schema"

title: "MyOme report base content"
description: "Base report structure used by all product-specific reports"
type: "object"

required: 
  - report_id
  - report_type
  - results
  - tests

properties:
  _versions:
    type: object
    example:
      gatk: 0.1.3
      myome-python: 0.2.3
  report_id:
    $ref: "../../ids.json#/definitions/ReportId"
  report_logo_uri:
    type: "string"
    pattern: "myome:logo:PR-?\\d+(-\\w+)?(.(svg|png))?$"
    example: "myome:logo:PR-4001-nw.svg"
  partner_logo_uri:
    type: "string"
    pattern: "myome:brand_logo:\\w+(.(svg|png))?$"
    example: "myome:brand_logo:novi"
  date:
    $ref: "../../core.json#/definitions/Date"
  subject:
    $ref: "../../entities/Subject.json"
  requisition:
    $ref: "../../entities/Requisition.json"
  samples:
    type: array
    items:
      $ref: "../../entities/Sample.json"
    minItems: 1
  supersedes:
    $ref: "../../structs.json#/definitions/Supersedes"
  labs:
    type: array
    items:
      $ref: "../../structs.json#/definitions/Lab"
    minItems: 0
  callback:
    type: object
    properties:
      url:
        type: string
        format: url
        examples:
          - "https://myome.com/i/R/f1a7-aec8-6434"
  signatures:
    type: array
    items:
      $ref: "../../structs.json#/definitions/Signature"
    minItems: 0
  tests:
    type: array
    items:
      $ref: "../../entities/Product.json"
    minItems: 1
  external_identifiers:
    $ref: "../../structs.json#/definitions/ExternalIdentifiers"

  # The following property definitions should be refined by any
  # subclass of this schema
  report_type:
    $ref: "../../core.json#/definitions/ReportType"
  results:
    type: object
