Commit cd2f7c72 authored by Gabriel Macena's avatar Gabriel Macena

[API] Adiciona e corrige rotas de Phases

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