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

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

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