Commit 84d00870 authored by Rosana Aurélio's avatar Rosana Aurélio

[COMPETITION] Correção no schema do subscription.

parent 538911b3
{ {
"Answer": { "FormField": {
"required": [ "required": [
"type", "id",
"question" "label",
"qualifier",
"order",
"required",
"unique",
"removable",
"type"
], ],
"properties": { "properties": {
"type": { "id": {
"type": "integer"
},
"label": {
"type": "string"
},
"qualifier": {
"type": "string", "type": "string",
"enum": [ "enum": [
"SUBJECTIVE", "FIRST_NAME",
"OBJECTIVE" "LAST_NAME",
"TEAM_NAME",
"EMAIL",
"OTHER"
] ]
}, },
"question": { "order": {
"$ref": "https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Exam.json/#/Question" "type": "integer"
},
"required": {
"type": "boolean"
},
"unique": {
"type": "boolean"
},
"removable": {
"type": "boolean"
},
"type": {
"type": "string",
"enum": [
"TEXT",
"DATE"
]
} }
} }
}, },
"AnswerGrade": { "FormFieldAnswer": {
"required": [ "required": [
"grade", "field",
"question" "value"
], ],
"properties": { "properties": {
"grade": { "field": {
"format": "float", "$ref": "#/FormField"
"type": "number" },
"value": {
"type": "string"
}, },
"question": { "qualifier": {
"$ref": "https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Exam.json/#/Question" "type": "string",
"enum": [
"FIRST_NAME",
"LAST_NAME",
"TEAM_NAME",
"EMAIL",
"OTHER"
]
} }
} }
}, },
"AssessmentSubmission": { "FormTemplate": {
"required": [ "required": [
"type" "id",
"field",
"value"
], ],
"properties": { "properties": {
"lastUpdate": { "id": {
"type": "number", "type": "integer"
"description": "Last time this submission was modified"
}, },
"assignment": { "field": {
"$ref": "https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Assessment.json/#/Assignment" "$ref": "#/FormField"
}, },
"type": { "value": {
"type": "string"
},
"qualifier": {
"type": "string", "type": "string",
"enum": [ "enum": [
"VIRTUAL", "FIRST_NAME",
"HANDMADE" "LAST_NAME",
"TEAM_NAME",
"EMAIL",
"OTHER"
] ]
} }
},
"discriminator": {
"propertyName": "type"
} }
}, },
"AssessmentSubmissionEvaluation": { "Invitation": {
"title": "Submission invitation token.",
"required": [ "required": [
"timestamp", "id",
"submission" "token",
"subject",
"submission",
"status"
], ],
"type": "object",
"properties": { "properties": {
"timestamp": { "id": {
"type": "integer" "type": "integer"
}, },
"grade": { "token": {
"type": "number", "type": "string"
"format": "float" },
"subject": {
"type": "string"
}, },
"submission": { "submission": {
"$ref": "https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Assessment.json/#/AssessmentSubmission" "$ref": "https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Submission.yaml/#/Submission"
}, },
"grades": { "status": {
"type": "array", "type": "string",
"items": { "enum": [
"$ref": "#/AnswerGrade" "AVAILABLE",
} "CONSUMED",
"EXPIRED"
]
} }
} }
}, },
"HandmadeAssessmentSubmission": { "SoloSubscription": {
"allOf": [ "allOf": {
{
"$ref": "#/AssessmentSubmission"
},
{
"type": "object", "type": "object",
"$ref": "#/Subscription"
}
},
"Subscription": {
"required": [ "required": [
"uploadUri" "requestReview",
"status",
"participantTemplate"
], ],
"properties": { "properties": {
"uploadUri": { "id": {
"type": "string" "type": "integer"
} },
} "requestReview": {
} "type": "boolean"
},
"status": {
"type": "string",
"enum": [
"PREP",
"OPEN",
"CLOSED"
] ]
}, },
"ObjectiveAnswer": { "schedule": {
"allOf": [ "$ref": "https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Assessment.yaml/#/ScheduleEvent"
{
"$ref": "#/Answer"
}, },
{ "type": {
"type": "object", "type": "string",
"required": [ "enum": [
"alternativeKey" "SOLO",
], "TEAM"
"properties": {
"alternativeKey": {
"type": "string"
}
}
}
] ]
}, },
"SubjectiveAnswer": { "participantTemplate": {
"allOf": [ "$ref": "#/FormTemplate"
}
},
"discriminator": {
"propertyName": "type",
"mapping": [
{ {
"$ref": "#/Answer" "SOLO": "#/SoloSubscription"
}, },
{ {
"type": "object", "TEAM": "#/TeamSubscription"
"required": [
"freeText"
],
"properties": {
"freeText": {
"type": "string"
}
}
} }
] ]
}
}, },
"VirtualAssessmentSubmission": { "TeamSubscription": {
"allOf": [ "allOf": [
{ {
"$ref": "#/AssessmentSubmission" "$ref": "#/Subscription"
}, },
{ {
"type": "object", "type": "object",
"required": [
"startedAt"
],
"properties": { "properties": {
"startedAt": { "teamTemplate": {
"type": "string", "description": "The team template id of this subscription",
"format": "date-time" "$ref": "#/FormTemplate"
}, },
"finishedAt": { "minMembers": {
"type": "string", "type": "integer"
"format": "date-time"
},
"answers": {
"type": "array",
"items": {
"$ref": "#/Answer"
}
}, },
"draft": { "maxMembers": {
"$ref": "#/VirtualAssessmentSubmissionDraft" "type": "integer"
} }
} }
} }
] ]
}, },
"VirtualAssessmentSubmissionDraft": { "Submission": {
"required": [ "required": [
"createdAt", "timestamp",
"content", "type",
"assignment" "status"
], ],
"properties": { "properties": {
"createdAt": { "competition": {
"format": "date-time", "$ref": "https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Phase.yaml/#/Competition"
"type": "string"
},
"updatedAt": {
"format": "date-time",
"type": "string"
}, },
"content": { "timestamp": {
"type": "string" "type": "number"
},
"assessment": {
"$ref": "https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Assessment.json/#/Assignment"
}
}
}, },
"SubmissionSection": {
"required": [
"type",
"template"
],
"properties": {
"type": { "type": {
"type": "string", "type": "string",
"enum": [ "enum": [
"PARTICIPANT", "SOLO",
"TEAM" "TEAM"
] ]
}, },
"answers": { "sections": {
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/answer" "$ref": "https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Submission.yaml/#/SubmissionSection"
} }
}, },
"template": { "invitations": {
"$ref": "https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Subscription.json/#/FormTemplate" "type": "array",
"items": {
"$ref": "#/Invitation"
}
} }
}, },
"discriminator": { "discriminator": {
"propertyName": "type", "propertyName": "type",
"mapping": { "mapping": {
"PARTICIPANT": "#/ParticipantSubmissionSection", "SOLO": "#/SoloSubmission",
"TEAM": "#/TeamSubmissionSection" "TEAM": "#/TeamSubmission"
} }
} }
}, },
"TeamSubmissionSection": { "TeamSubmission": {
"required": [
"team"
],
"allOf": { "allOf": {
"type": "object", "type": "object",
"$ref": "#/SubmissionSection" "$ref": "#/Submission",
"properties": {
"team": {
"$ref": "https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Submission.yaml/#/TeamSubmissionSection"
},
"leader": {
"$ref": "https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Submission.yaml/#/ParticipantSubmissionSection"
},
"participants": {
"type": "array",
"items": {
"$ref": "https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Submission.yaml/#/ParticipantSubmissionSection"
}
}
}
} }
}, },
"ParticipantSubmissionSection": { "SoloSubmission": {
"required": [
"participant"
],
"allOf": { "allOf": {
"type": "object", "type": "object",
"$ref": "#/SubmissionSection" "$ref": "#/Submission",
"properties": {
"participant": {
"$ref": "https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Submission.yaml/#/ParticipantSubmissionSection"
}
} }
} }
} }
}
\ No newline at end of file
...@@ -173,8 +173,8 @@ TeamSubmission: ...@@ -173,8 +173,8 @@ TeamSubmission:
required: required:
- team - team
allOf: allOf:
- type: object type: object
- $ref: '#/Submission' $ref: '#/Submission'
properties: properties:
team: team:
$ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Submission.yaml/#/TeamSubmissionSection' $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Submission.yaml/#/TeamSubmissionSection'
...@@ -188,8 +188,8 @@ SoloSubmission: ...@@ -188,8 +188,8 @@ SoloSubmission:
required: required:
- participant - participant
allOf: allOf:
- type: object type: object
- $ref: '#/Submission' $ref: '#/Submission'
properties: properties:
participant: participant:
$ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Submission.yaml/#/ParticipantSubmissionSection' $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Submission.yaml/#/ParticipantSubmissionSection'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment