Commit ff49cd5f authored by Gabriel Macena's avatar Gabriel Macena

[API] Refatora rotas de Subscription e corrige os nomes das entidades

parent 5f338820
......@@ -248,12 +248,12 @@ paths:
schema:
format: int32
type: integer
/subscription/applicants:
/subscription/submissions:
get:
tags:
- subscription
summary: Retrieves all applicants for this competition
description: Retrieves all applicants for this competition.
summary: Retrieves all submissions for this competition
description: Retrieves all submissions for this competition.
responses:
'200':
description: ''
......@@ -262,20 +262,22 @@ paths:
schema:
type: array
items:
$ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/Subscription'
oneOf:
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/SoloSubscriptionSubmission'
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/TeamSubscriptionSubmission'
post:
tags:
- subscription
summary: Creates an application for the competition
description: Creates a new application for the competition.
summary: Creates a submission for the competition
description: Creates a new submission for the competition.
requestBody:
content:
application/json:
schema:
type: object
oneOf:
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/SoloSubscription'
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/TeamSubscription'
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/SoloSubscriptionSubmission'
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/TeamSubscriptionSubmission'
required: true
responses:
'200':
......@@ -285,13 +287,13 @@ paths:
schema:
type: object
oneOf:
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/SoloSubscription'
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/TeamSubscription'
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/SoloSubscriptionSubmission'
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/TeamSubscriptionSubmission'
patch:
tags:
- subscription
summary: Updates multiple Applications
description: Updates multiple Applications.
summary: Updates multiple Submissions
description: Updates multiple Submissions.
requestBody:
content:
application/json-schema+json:
......@@ -299,8 +301,8 @@ paths:
type: array
items:
oneOf:
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/SoloSubscription'
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/TeamSubscription'
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/SoloSubscriptionSubmission'
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/TeamSubscriptionSubmission'
required: true
responses:
'200':
......@@ -311,9 +313,9 @@ paths:
type: array
items:
oneOf:
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/SoloSubscription'
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/TeamSubscription'
'/subscription/applicants/{applicantId}':
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/SoloSubscriptionSubmission'
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/TeamSubscriptionSubmission'
'/subscription/submissions/{submissionId}':
get:
tags:
- subscription
......@@ -327,10 +329,10 @@ paths:
schema:
type: object
oneOf:
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/SoloSubscription'
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/TeamSubscription'
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/SoloSubscriptionSubmission'
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/TeamSubscriptionSubmission'
parameters:
- name: applicantId
- name: submissionId
in: path
description: The unique identifier of the application.
required: true
......@@ -358,8 +360,8 @@ paths:
schema:
type: object
oneOf:
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/SoloSubscription'
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/TeamSubscription'
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/SoloSubscriptionSubmission'
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/TeamSubscriptionSubmission'
/subscription:
get:
tags:
......@@ -393,22 +395,24 @@ paths:
content:
application/json:
schema:
$ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/SubscriptionRule'
/subscription/templates:
get:
tags:
- public
summary: Retrieves all form templates
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/#/FormTemplate'
/subscription/templates/team:
oneOf:
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/SoloSubscriptionRule'
- $ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/TeamSubscriptionRule'
# /subscription/templates:
# get:
# tags:
# - public
# summary: Retrieves all form templates
# 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/#/FormTemplate'
/subscription/team-template:
get:
tags:
- public
......@@ -439,7 +443,7 @@ paths:
application/json:
schema:
$ref: 'https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas.yaml/#/FormTemplate'
/subscription/templates/participant:
/subscription/participant-template:
get:
tags:
- public
......
......@@ -124,15 +124,15 @@ SoloSubscriptionRule:
TeamSubscriptionRule:
$ref: >-
https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Subscription.yaml/#/TeamSubscriptionRule
Subscription:
SubscriptionSubmission:
$ref: >-
https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Subscription.yaml/#/Subscription
SoloSubscription:
https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Subscription.yaml/#/SubscriptionSubmission
SoloSubscriptionSubmission:
$ref: >-
https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Subscription.yaml/#/SoloSubscription
TeamSubscription:
https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Subscription.yaml/#/SoloSubscriptionSubmission
TeamSubscriptionSubmission:
$ref: >-
https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Subscription.yaml/#/TeamSubscription
https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Subscription.yaml/#/TeamSubscriptionSubmission
FormTemplate:
$ref: >-
https://gitlab.dev.evologica.com.br/Competify/Docs/raw/master/Api/components/schemas/Subscription.yaml/#/FormTemplate
......
......@@ -36,7 +36,7 @@ SubscriptionRule:
mapping:
- SOLO: '#/SoloSubscriptionRule'
- TEAM: '#/TeamSubscriptionRule'
Subscription:
SubscriptionSubmission:
required:
- status
- timestamp
......@@ -61,18 +61,18 @@ Subscription:
discriminator:
propertyName: type
mapping:
TEAM: '#/TeamSubscription'
SOLO: '#/SoloSubscription'
SoloSubscription:
TEAM: '#/TeamSubscriptionSubmission'
SOLO: '#/SoloSubscriptionSubmission'
SoloSubscriptionSubmission:
allOf:
- $ref: '#/Subscription'
- $ref: '#/SubscriptionSubmission'
- type: object
properties:
participant:
$ref: '#/FormSection'
TeamSubscription:
TeamSubscriptionSubmission:
allOf:
- $ref: '#/Subscription'
- $ref: '#/SubscriptionSubmission'
- type: object
properties:
team:
......@@ -135,6 +135,8 @@ FormAnswer:
type: integer
value:
type: string
error:
type: string
oid:
type: integer
FormSection:
......
This diff is collapsed.
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