$schema: https://json-schema.org/draft/2020-12/schema
$id: CompetitionForms.yaml
type: object
properties:
  forms:
    $ref: '#/$defs/RecordFormBase'
    description: The forms for the competition
  validation:
    $ref: '#/$defs/RecordUnknown'
    description: The validation rules for the competition forms
required:
  - forms
unevaluatedProperties:
  not: {}
examples:
  - forms:
      formA:
        id: b7c1e2f4-8a3d-4e2a-9c5b-1f2e3d4c5b6a
        name: Form A
        description: Form A description
        instructions: Form A instructions
        jsonSchema:
          $id: formA.json
          type: object
          properties:
            name:
              first:
                type: string
              last:
                type: string
            email:
              type: string
            phone:
              type: string
        uiSchema:
          type: VerticalLayout
          elements:
            - type: Group
              label: Name
              elements:
                - type: Control
                  scope: '#/properties/name/first'
                - type: Control
                  scope: '#/properties/name/last'
            - type: Control
              scope: '#/properties/email'
            - type: Control
              scope: '#/properties/phone'
        mappingToCommonGrants:
          name:
            firstName:
              field: name.first
            lastName:
              field: name.last
          emails:
            primary:
              field: email
          phones:
            primary:
              field: phone
        mappingFromCommonGrants:
          name:
            first:
              field: name.firstName
            last:
              field: name.lastName
          email:
            field: emails.primary
          phone:
            field: phones.primary
        createdAt: '2025-01-01T17:01:01.000Z'
        lastModifiedAt: '2025-01-02T17:30:00.000Z'
      formB:
        id: b7c1e2f4-8a3d-4e2a-9c5b-1f2e3d4c5b6a
        name: Form A
        description: Form A description
        instructions: Form A instructions
        jsonSchema:
          $id: formA.json
          type: object
          properties:
            name:
              first:
                type: string
              last:
                type: string
            email:
              type: string
            phone:
              type: string
        uiSchema:
          type: VerticalLayout
          elements:
            - type: Group
              label: Name
              elements:
                - type: Control
                  scope: '#/properties/name/first'
                - type: Control
                  scope: '#/properties/name/last'
            - type: Control
              scope: '#/properties/email'
            - type: Control
              scope: '#/properties/phone'
        mappingToCommonGrants:
          name:
            firstName:
              field: name.first
            lastName:
              field: name.last
          emails:
            primary:
              field: email
          phones:
            primary:
              field: phone
        mappingFromCommonGrants:
          name:
            first:
              field: name.firstName
            last:
              field: name.lastName
          email:
            field: emails.primary
          phone:
            field: phones.primary
        createdAt: '2025-01-01T17:01:01.000Z'
        lastModifiedAt: '2025-01-02T17:30:00.000Z'
    validation:
      required:
        - formA
        - formB
description: Set of forms that need to be completed to apply to the competition.
$defs:
  RecordFormBase:
    type: object
    properties: {}
    unevaluatedProperties:
      $ref: Form.yaml
  RecordUnknown:
    type: object
    properties: {}
    unevaluatedProperties: {}
