-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a124a32
commit deedeb5
Showing
12 changed files
with
14,077 additions
and
9,967 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ import Highlight from "../../src/highlight.js" | |
## Details | ||
|
||
This endpoint is used to create company applications. | ||
In order of a Company to use its account, the application must be accepted by an Admin and then the Company should | ||
In order of a Company to use its account, the company must verify its application by clicking in a link sent by email after the creation of the application and then the Company should | ||
finish its registration. | ||
|
||
**URL** : `/apply/company` | ||
|
@@ -249,7 +249,48 @@ values={[ | |
</TabItem> | ||
</Tabs> | ||
|
||
### Example 5 - Invalid Password | ||
### Example 5 - Application with the same email created recently | ||
|
||
**Code** : <Highlight level="danger" inline>403 FORBIDDEN</Highlight> | ||
|
||
<Tabs | ||
defaultValue="request" | ||
values={[ | ||
{label: 'Request', value: 'request'}, | ||
{label: 'Response', value: 'response'}, | ||
]} | ||
> | ||
<TabItem value="request"> | ||
|
||
```json | ||
{ | ||
"email": "[email protected]", | ||
"password": "password123", | ||
"companyName": "Company", | ||
"motivation": "We wish to revolutionize the industry with young engineers." | ||
} | ||
``` | ||
|
||
</TabItem> | ||
|
||
<TabItem value="response"> | ||
|
||
```json | ||
{ | ||
"error_code": 1, | ||
"errors": [ | ||
{ | ||
"msg": "company-application-recently-created", | ||
} | ||
] | ||
} | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
### Example 6 - Invalid Password | ||
|
||
**Code** : <Highlight level="danger" inline>422 UNPROCESSABLE ENTITY</Highlight> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,7 +66,7 @@ Filters the applications by the name of the respective companies. | |
Array of strings which filters the application by their state. | ||
|
||
:::caution | ||
Must be a valid state (currently `["PENDING", "APPROVED", "REJECTED"]`). | ||
Must be a valid state (currently `["UNVERIFIED", "PENDING", "APPROVED", "REJECTED"]`). | ||
::: | ||
|
||
### submissionDateFrom | ||
|
@@ -153,6 +153,7 @@ values={[ | |
"companyName": "Company name", | ||
"motivation": "We wish to revolutionize the industry with young engineers.", | ||
"submittedAt": "2022-09-08T16:31:11.784Z", | ||
"isVerified": true, | ||
"__v": 0, | ||
"state": "PENDING" | ||
}, | ||
|
@@ -162,6 +163,7 @@ values={[ | |
"companyName": "Example Company", | ||
"motivation": "We are a brand new tech company in Porto, Portugal", | ||
"submittedAt": "2022-09-07T13:15:15.971Z", | ||
"isVerified": true, | ||
"__v": 0, | ||
"approvedAt": "2022-09-07T13:17:30.908Z", | ||
"state": "APPROVED" | ||
|
@@ -172,13 +174,24 @@ values={[ | |
"companyName": "Bad Company", | ||
"motivation": "We want to exploit workers.", | ||
"submittedAt": "2022-09-07T13:15:15.971Z", | ||
"isVerified": true, | ||
"__v": 0, | ||
"rejectedAt": "2022-09-07T13:17:30.908Z", | ||
"rejectReason": "Motivation doesn't seem right", | ||
"state": "REJECTED" | ||
}, | ||
{ | ||
"_id": "63189963541e53a45a423dce", | ||
"email": "[email protected]", | ||
"companyName": "Unverified", | ||
"motivation": "We are a new company in Lisbon", | ||
"submittedAt": "2022-09-07T13:15:15.971Z", | ||
"isVerified": false, | ||
"__v": 0, | ||
"state": "PENDING" | ||
} | ||
], | ||
"docCount": 3 | ||
"docCount": 4 | ||
} | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
--- | ||
id: validate | ||
title: Validate Application | ||
sidebar_label: Validate Application | ||
slug: /applications/validate | ||
--- | ||
|
||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
|
||
import Highlight from "../../src/highlight.js" | ||
|
||
## Details | ||
|
||
This endpoint is used to validate an application using a previous created token. | ||
The token is generated with the [ create ](./create) endpoint and is sent to the user by email. | ||
|
||
|
||
**URL** : `/apply/company/:token/validate` | ||
|
||
**Method** : <Highlight level="info" inline>POST</Highlight> | ||
|
||
## Request examples | ||
|
||
### Example 1 - Valid Request | ||
|
||
**Code** : <Highlight level="success" inline>200 OK</Highlight> | ||
|
||
<Tabs | ||
defaultValue="request" | ||
values={[ | ||
{label: 'Request', value: 'request'}, | ||
{label: 'Response', value: 'response'}, | ||
]} | ||
> | ||
<TabItem value="request"> | ||
|
||
```bash | ||
/apply/company/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6Im5pQGFlZmV1cC5wdCIsImlhdCI6MTY2MzAxMzg0OSwiZXhwIjoxNjYzMDE0NDQ5fQ.k5Z_nBpqt_Hs8JBhLH0ZXTl2-BG-utdIAUdhKXEFuFc/validate | ||
``` | ||
|
||
</TabItem> | ||
|
||
<TabItem value="response"> | ||
|
||
```json | ||
{} | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
### Example 2 - Invalid Token | ||
|
||
**Code** : <Highlight level="danger" inline>404 NOT_FOUND</Highlight> | ||
|
||
<Tabs | ||
defaultValue="request" | ||
values={[ | ||
{label: 'Request', value: 'request'}, | ||
{label: 'Response', value: 'response'}, | ||
]} | ||
> | ||
<TabItem value="request"> | ||
|
||
```bash | ||
/apply/company/invalid/validate | ||
|
||
``` | ||
|
||
</TabItem> | ||
|
||
<TabItem value="response"> | ||
|
||
```json | ||
{ | ||
"error_code": 3, | ||
"errors": [ | ||
{ | ||
"msg": "invalid-token" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
### Example 3 - Expired Token | ||
|
||
**Code** : <Highlight level="danger" inline>410 GONE</Highlight> | ||
|
||
<Tabs | ||
defaultValue="request" | ||
values={[ | ||
{label: 'Request', value: 'request'}, | ||
{label: 'Response', value: 'response'}, | ||
]} | ||
> | ||
<TabItem value="request"> | ||
|
||
```bash | ||
/apply/company/expired/validate | ||
``` | ||
|
||
</TabItem> | ||
|
||
<TabItem value="response"> | ||
|
||
```json | ||
{ | ||
"error_code": 3, | ||
"errors": [ | ||
{ | ||
"msg": "expired-token" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
### Example 4 - Application Already Validated | ||
|
||
**Code** : <Highlight level="danger" inline>409 CONFLICT</Highlight> | ||
|
||
<Tabs | ||
defaultValue="request" | ||
values={[ | ||
{label: 'Request', value: 'request'}, | ||
{label: 'Response', value: 'response'}, | ||
]} | ||
> | ||
<TabItem value="request"> | ||
|
||
```bash | ||
/apply/company/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6Im5pQGFlZmV1cC5wdCIsImlhdCI6MTY2MzAxMzg0OSwiZXhwIjoxNjYzMDE0NDQ5fQ.k5Z_nBpqt_Hs8JBhLH0ZXTl2-BG-utdIAUdhKXEFuFc/validate | ||
``` | ||
|
||
</TabItem> | ||
|
||
<TabItem value="response"> | ||
|
||
```json | ||
{ | ||
"error_code": 3, | ||
"errors": [ | ||
{ | ||
"msg": "application-already-validated" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> |
Oops, something went wrong.