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