Commit cd2f7c72 authored by Gabriel Macena's avatar Gabriel Macena

[API] Adiciona e corrige rotas de Phases

parent 3e502abd
...@@ -663,25 +663,6 @@ paths: ...@@ -663,25 +663,6 @@ paths:
application/json: application/json:
schema: schema:
$ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/Phase' $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/Phase'
patch:
tags:
- phases
summary: Updates the phases of this competition
requestBody:
content:
application/json-patch+json:
schema:
type: array
items:
$ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/JsonPatch'
required: true
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/Phase'
'/phases/{phaseId}': '/phases/{phaseId}':
get: get:
tags: tags:
...@@ -700,11 +681,9 @@ paths: ...@@ -700,11 +681,9 @@ paths:
summary: Updates a specific phase of this competition summary: Updates a specific phase of this competition
requestBody: requestBody:
content: content:
application/json-patch+json: application/json:
schema: schema:
type: array $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/Phase'
items:
$ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/JsonPatch'
required: true required: true
responses: responses:
'200': '200':
...@@ -713,6 +692,17 @@ paths: ...@@ -713,6 +692,17 @@ paths:
application/json: application/json:
schema: schema:
$ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/Phase' $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/Phase'
delete:
tags:
- phases
summary: Deletes a specific phase of this competition
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/Phase'
parameters: parameters:
- name: phaseId - name: phaseId
in: path in: path
...@@ -733,7 +723,7 @@ paths: ...@@ -733,7 +723,7 @@ paths:
schema: schema:
type: array type: array
items: items:
$ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/Rank' $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/Ranking'
parameters: parameters:
- name: phaseId - name: phaseId
in: path in: path
...@@ -755,15 +745,36 @@ paths: ...@@ -755,15 +745,36 @@ paths:
type: array type: array
items: items:
$ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/PhaseParticipation' $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/PhaseParticipation'
post: parameters:
- name: phaseId
in: path
required: true
schema:
format: int32
type: integer
'/phases/{phaseId}/participations/{participationId}':
get:
tags: tags:
- phases - phases
summary: Creates a new Participation for the Phase summary: Retrieves the specific Participation
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/PhaseParticipation'
patch:
tags:
- phases
summary: Updates the specific Participation
requestBody: requestBody:
content: content:
application/json: application/json-patch+json:
schema: schema:
$ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/PhaseParticipation' type: array
items:
$ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/JsonPatch'
required: true required: true
responses: responses:
'200': '200':
...@@ -779,29 +790,35 @@ paths: ...@@ -779,29 +790,35 @@ paths:
schema: schema:
format: int32 format: int32
type: integer type: integer
'/phases/{phaseId}/participations/{participationId}': - name: participationId
in: path
required: true
schema:
format: int32
type: integer
'/phases/{phaseId}/evaluations':
get: get:
tags: tags:
- phases - phases
summary: Retrieves the specific Participation summary: Retrieves all Evaluations for the Phase
responses: responses:
'200': '200':
description: '' description: ''
content: content:
application/json: application/json:
schema: schema:
$ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/PhaseParticipation' type: array
patch: items:
$ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/Ranking'
post:
tags: tags:
- phases - phases
summary: Updates the specific Participation summary: Creates a new Evaluation
requestBody: requestBody:
content: content:
application/json-patch+json: application/json:
schema: schema:
type: array $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/Ranking'
items:
$ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/JsonPatch'
required: true required: true
responses: responses:
'200': '200':
...@@ -809,7 +826,7 @@ paths: ...@@ -809,7 +826,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/PhaseParticipation' $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/Ranking'
parameters: parameters:
- name: phaseId - name: phaseId
in: path in: path
...@@ -817,94 +834,34 @@ paths: ...@@ -817,94 +834,34 @@ paths:
schema: schema:
format: int32 format: int32
type: integer type: integer
- name: participationId parameters:
- name: phaseId
in: path
required: true
schema:
format: int32
type: integer
'/phases/{phaseId}/participations':
get:
tags:
- phases
summary: Retrieves all Participations for the Phase
responses:
'200':
description: ''
content:
application/json:
schema:
type: array
items:
$ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/PhaseParticipation'
parameters:
- name: phaseId
in: path in: path
required: true required: true
schema: schema:
format: int32 format: int32
type: integer type: integer
# '/phases/{phaseId}/events':
# get:
# tags:
# - phases
# summary: Retrieves all Events for the Phase
# responses:
# '200':
# description: ''
# content:
# application/json:
# schema:
# type: array
# items:
# $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/PhaseEvent'
# post:
# tags:
# - phases
# summary: Creates a new Event for the Phase
# requestBody:
# content:
# application/json:
# schema:
# $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/PhaseEvent'
# required: true
# responses:
# '200':
# description: ''
# content:
# application/json:
# schema:
# $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/PhaseEvent'
# parameters:
# - name: phaseId
# in: path
# required: true
# schema:
# format: int32
# type: integer
# '/phases/{phaseId}/events/{eventId}':
# get:
# tags:
# - phases
# summary: Retrieves the specific Event
# responses:
# '200':
# description: ''
# content:
# application/json:
# schema:
# $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/PhaseEvent'
# patch:
# tags:
# - phases
# summary: Updates the specific Event
# requestBody:
# content:
# application/json-patch+json:
# schema:
# type: array
# items:
# $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/JsonPatch'
# required: true
# responses:
# '200':
# description: ''
# content:
# application/json:
# schema:
# $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/PhaseEvent'
# parameters:
# - name: phaseId
# in: path
# required: true
# schema:
# format: int32
# type: integer
# - name: eventId
# in: path
# required: true
# schema:
# format: int32
# type: integer
'/phases/{phaseId}/assessments': '/phases/{phaseId}/assessments':
get: get:
tags: tags:
...@@ -1001,62 +958,6 @@ paths: ...@@ -1001,62 +958,6 @@ paths:
schema: schema:
format: int32 format: int32
type: integer type: integer
# '/phases/{phaseId}/assessments/{assessmentId}/questions':
# get:
# tags:
# - phases
# summary: Retrieves all Questions of a specific Assessment
# responses:
# '200':
# description: ''
# content:
# application/json:
# schema:
# $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/Question'
# parameters:
# - name: phaseId
# in: path
# required: true
# schema:
# format: int32
# type: integer
# - name: assessmentId
# in: path
# required: true
# schema:
# format: int32
# type: integer
# '/phases/{phaseId}/assessments/{assessmentId}/questions/{questionId}':
# get:
# tags:
# - phases
# summary: Retrieves the specific Question
# responses:
# '200':
# description: ''
# content:
# application/json:
# schema:
# $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/Question'
# parameters:
# - name: phaseId
# in: path
# required: true
# schema:
# format: int32
# type: integer
# - name: assessmentId
# in: path
# required: true
# schema:
# format: int32
# type: integer
# - name: questionId
# in: path
# required: true
# schema:
# format: int32
# type: integer
'/phases/{phaseId}/assessments/{assessmentId}/submissions': '/phases/{phaseId}/assessments/{assessmentId}/submissions':
get: get:
tags: tags:
...@@ -1142,85 +1043,84 @@ paths: ...@@ -1142,85 +1043,84 @@ paths:
schema: schema:
format: int32 format: int32
type: integer type: integer
# '/phases/{phaseId}/evaluation': '/phases/{phaseId}/formula':
# get: patch:
# tags: tags:
# - phases - phases
# summary: Retrieves the evaluation method for the specified phase summary: Updates the evaluation formula for the specified phase
# responses: requestBody:
# '200': content:
# description: '' application/json:
# content: schema:
# application/json: $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/EvaluationFormula'
# schema: required: true
# $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/EvaluationRule' responses:
# patch: '200':
# tags: description: ''
# - phases content:
# summary: Updates the evaluation method for the specified phase application/json:
# requestBody: schema:
# content: $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/EvaluationFormula'
# application/json-patch+json: parameters:
# schema: - name: phaseId
# type: array in: path
# items: required: true
# $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/JsonPatch' schema:
# required: true format: int32
# responses: type: integer
# '200': '/phases/{phaseId}/classification':
# description: '' patch:
# content: tags:
# application/json: - phases
# schema: summary: Updates the classification method for the specified phase
# $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/EvaluationRule' requestBody:
# parameters: content:
# - name: phaseId application/json:
# in: path schema:
# required: true type: object
# schema: oneOf:
# format: int32 - $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/MinimumPerformance'
# type: integer - $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/BestRanked'
# '/phases/{phaseId}/classification': required: true
# get: responses:
# tags: '200':
# - phases description: ''
# summary: Retrieves the classification method for the specified phase content:
# responses: application/json:
# '200': schema:
# description: '' type: object
# content: oneOf:
# application/json: - $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/MinimumPerformance'
# schema: - $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/BestRanked'
# type: object parameters:
# oneOf: - name: phaseId
# - $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/MinimumPerformance' in: path
# - $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/BestRanked' required: true
# patch: schema:
# tags: format: int32
# - phases type: integer
# summary: Updates the classification method for the specified phase '/phases/{phaseId}/status':
# requestBody: patch:
# content: tags:
# application/json-patch+json: - phases
# schema: summary: Updates the status for the specified phase
# type: array requestBody:
# items: content:
# $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/JsonPatch' application/json:
# required: true schema:
# responses: $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/Phase'
# '200': required: true
# description: '' responses:
# content: '200':
# application/json: description: ''
# schema: content:
# type: object application/json:
# oneOf: schema:
# - $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/MinimumPerformance' $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/Phase'
# - $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/BestRanked' parameters:
# parameters: - name: phaseId
# - name: phaseId in: path
# in: path required: true
# required: true schema:
# schema: format: int32
# format: int32 type: integer
# type: integer
...@@ -105,16 +105,19 @@ MinimumPerformance: ...@@ -105,16 +105,19 @@ MinimumPerformance:
https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Phase.yaml/#/MinimumPerformance https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Phase.yaml/#/MinimumPerformance
ClassificationRule: ClassificationRule:
$ref: >- $ref: >-
https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Phase.yaml/#/ClassificationRule https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Phase.yaml/#/ClassificationStrategy
EvaluationRule: EvaluationRule:
$ref: >- $ref: >-
https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Phase.yaml/#/EvaluationRule https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Phase.yaml/#/EvaluationFormula
TieBreakCriteria: TieBreakCriteria:
$ref: >- $ref: >-
https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Phase.yaml/#/TieBreakCriteria https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Phase.yaml/#/TieBreakCriteria
Rank: Rank:
$ref: >- $ref: >-
https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Phase.yaml/#/Rank https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Phase.yaml/#/Rank
Ranking:
$ref: >-
https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Phase.yaml/#/Ranking
Subscription: Subscription:
$ref: >- $ref: >-
https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Subscription.yaml/#/Subscription https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Subscription.yaml/#/Subscription
......
...@@ -84,7 +84,7 @@ BestRanked: ...@@ -84,7 +84,7 @@ BestRanked:
- tieBreakCriterias - tieBreakCriterias
- number - number
allOf: allOf:
- $ref: '#/ClassificationRule' - $ref: '#/ClassificationStrategy'
- type: object - type: object
properties: properties:
number: number:
...@@ -97,12 +97,12 @@ MinimumPerformance: ...@@ -97,12 +97,12 @@ MinimumPerformance:
required: required:
- cutOffMark - cutOffMark
allOf: allOf:
- $ref: '#/ClassificationRule' - $ref: '#/ClassificationStrategy'
- type: object - type: object
properties: properties:
cutOffMark: cutOffMark:
type: number type: number
ClassificationRule: ClassificationStrategy:
required: required:
- type - type
properties: properties:
...@@ -118,7 +118,7 @@ ClassificationRule: ...@@ -118,7 +118,7 @@ ClassificationRule:
mapping: mapping:
BEST_RANKED: '#/BestRanked' BEST_RANKED: '#/BestRanked'
MINIMUM_PERFORMANCE: '#/MinimumPerformance' MINIMUM_PERFORMANCE: '#/MinimumPerformance'
EvaluationRule: EvaluationFormula:
required: required:
- expression - expression
properties: properties:
...@@ -143,10 +143,10 @@ Rank: ...@@ -143,10 +143,10 @@ Rank:
properties: properties:
timestamp: timestamp:
type: integer type: integer
classificationRule: classificationStrategy:
$ref: '#/ClassificationRule' $ref: '#/ClassificationStrategy'
evaluationRule: EvaluationFormula:
$ref: '#/EvaluationRule' $ref: '#/EvaluationFormula'
position: position:
type: integer type: integer
grade: grade:
...@@ -160,3 +160,17 @@ Rank: ...@@ -160,3 +160,17 @@ Rank:
type: array type: array
items: items:
$ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Submission.yaml/#/AssessmentSubmissionEvaluation' $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Submission.yaml/#/AssessmentSubmissionEvaluation'
Ranking:
required:
- timestamp
properties:
id:
type: integer
ranks:
type: array
items:
$ref: '#/Rank'
timestamp:
type: integer
\ No newline at end of file
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