Skip to content

Commit

Permalink
Merge pull request #53 from richard483/fix-1
Browse files Browse the repository at this point in the history
dded get company info api, job applicants api, bind job & user with … 
added get user job application list
  • Loading branch information
richard483 authored Jan 16, 2024
2 parents 3a4c544 + 55ea30f commit 9c6c63a
Show file tree
Hide file tree
Showing 19 changed files with 651 additions and 20 deletions.
61 changes: 61 additions & 0 deletions docs/company-controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ HTTP Code: 400
1. [Update](#update)

## Update
| Key | Description |
| ------ | ------------- |
| Method | `POST` |
| Path | `/company/update` |


| Key | Type |
| ---------- | ------ |
Expand Down Expand Up @@ -139,4 +144,60 @@ HTTP Code: 400
},
"error": "BAD_REQUEST"
}
```

---

1. [GetInfo](#getInfo)

## Get Info

| Key | Description |
| ------ | ------------- |
| Method | `POST` |
| Path | `/info/:companyId` |

### Success Response

HTTP Code: 200

```json
{
"status": true,
"statusCode": 200,
"data": {
"id": "7b9e79f7-ebc1-49de-a0db-b9d53cfe1cf7",
"profilePicture": null,
"name": "Nijisanji Anycolor",
"description": "Nijisanji is a VTuber agency under Ichikara Inc. While the company is based in Japan, it also has branches in China, Indonesia, South Korea, and India.",
"createdAt": "2024-01-16T08:09:59.992Z",
"updatedAt": "2024-01-16T08:09:59.992Z"
}
}
```

### Invalid credential

HTTP Code: 401

```json
{
"status": true,
"statusCode": 401,
"data": {
"access": "UNAUTHORIZED"
}
}
```

### no data

HTTP Code: 200

```json
{
"status": true,
"statusCode": 200,
"data": null
}
```
263 changes: 263 additions & 0 deletions docs/job-controller.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,263 @@
# Job controller

---

[Get applicants list](#getApplicants)

## Get Applicants

| Key | Description |
| ------ | ------------- |
| Method | `POST` |
| Path | `/job/applicants/:jobId` |

### Request Body (all fields are optional)

| Key | Type |
| ---------- | ------ |
| `page` | number? |
| `size` | number? |

### Success Response

HTTP Code: 200

```json
{
"status": true,
"statusCode": 200,
"data": {
"data": [
{
"id": "a05c4cf9-fac2-4d63-a542-97945bffd0b0",
"email": "richard.william483@gmail.com",
"username": "richard__uwu",
"firstName": "Richard",
"lastName": "William",
"password": "$2b$10$Cxot0Ynr0gnSCDGC7wjo4upLoXABsgZ01BUmbqh2tQ7S76sXm3GN6",
"createdAt": "2024-01-16T08:10:00.242Z",
"updatedAt": "2024-01-16T08:10:00.876Z",
"roles": [
"USER"
],
"description": "default richard description that being created by seed.ts",
"previousWorkplaceId": [
"7b9e79f7-ebc1-49de-a0db-b9d53cfe1cf7",
"84d98c27-d50a-4deb-b4be-446dbe342598",
"ff567d29-8dea-4de9-a24d-6affa42f50c8"
],
"previousWorkplaceCount": 3,
"ratingsAvg": null,
"companyId": null,
"portfolio": [],
"profilePicture": null,
"hasGoogleAccount": false
},
{
"id": "d433d551-64ed-40f1-b799-4c3499bd093c",
"email": "default.user@email.com",
"username": "Default User",
"firstName": "Default",
"lastName": "User",
"password": "$2b$10$5R7ho.XC03csXn3NrbjHKOxN.P0JrHjbIUD8BsM3Dgb7T0Xo40JOa",
"createdAt": "2024-01-16T08:10:00.313Z",
"updatedAt": "2024-01-16T08:10:00.875Z",
"roles": [
"USER"
],
"description": "default user description that being created by seed.ts",
"previousWorkplaceId": [
"7b9e79f7-ebc1-49de-a0db-b9d53cfe1cf7",
"84d98c27-d50a-4deb-b4be-446dbe342598",
"ff567d29-8dea-4de9-a24d-6affa42f50c8"
],
"previousWorkplaceCount": 3,
"ratingsAvg": null,
"companyId": null,
"portfolio": [],
"profilePicture": null,
"hasGoogleAccount": false
},
{
"id": "d433d551-64ed-40f1-b799-4c3499bd093c",
"email": "default.user@email.com",
"username": "Default User",
"firstName": "Default",
"lastName": "User",
"password": "$2b$10$5R7ho.XC03csXn3NrbjHKOxN.P0JrHjbIUD8BsM3Dgb7T0Xo40JOa",
"createdAt": "2024-01-16T08:10:00.313Z",
"updatedAt": "2024-01-16T08:10:00.875Z",
"roles": [
"USER"
],
"description": "default user description that being created by seed.ts",
"previousWorkplaceId": [
"7b9e79f7-ebc1-49de-a0db-b9d53cfe1cf7",
"84d98c27-d50a-4deb-b4be-446dbe342598",
"ff567d29-8dea-4de9-a24d-6affa42f50c8"
],
"previousWorkplaceCount": 3,
"ratingsAvg": null,
"companyId": null,
"portfolio": [],
"profilePicture": null,
"hasGoogleAccount": false
},
{
"id": "d433d551-64ed-40f1-b799-4c3499bd093c",
"email": "default.user@email.com",
"username": "Default User",
"firstName": "Default",
"lastName": "User",
"password": "$2b$10$5R7ho.XC03csXn3NrbjHKOxN.P0JrHjbIUD8BsM3Dgb7T0Xo40JOa",
"createdAt": "2024-01-16T08:10:00.313Z",
"updatedAt": "2024-01-16T08:10:00.875Z",
"roles": [
"USER"
],
"description": "default user description that being created by seed.ts",
"previousWorkplaceId": [
"7b9e79f7-ebc1-49de-a0db-b9d53cfe1cf7",
"84d98c27-d50a-4deb-b4be-446dbe342598",
"ff567d29-8dea-4de9-a24d-6affa42f50c8"
],
"previousWorkplaceCount": 3,
"ratingsAvg": null,
"companyId": null,
"portfolio": [],
"profilePicture": null,
"hasGoogleAccount": false
},
{
"id": "d433d551-64ed-40f1-b799-4c3499bd093c",
"email": "default.user@email.com",
"username": "Default User",
"firstName": "Default",
"lastName": "User",
"password": "$2b$10$5R7ho.XC03csXn3NrbjHKOxN.P0JrHjbIUD8BsM3Dgb7T0Xo40JOa",
"createdAt": "2024-01-16T08:10:00.313Z",
"updatedAt": "2024-01-16T08:10:00.875Z",
"roles": [
"USER"
],
"description": "default user description that being created by seed.ts",
"previousWorkplaceId": [
"7b9e79f7-ebc1-49de-a0db-b9d53cfe1cf7",
"84d98c27-d50a-4deb-b4be-446dbe342598",
"ff567d29-8dea-4de9-a24d-6affa42f50c8"
],
"previousWorkplaceCount": 3,
"ratingsAvg": null,
"companyId": null,
"portfolio": [],
"profilePicture": null,
"hasGoogleAccount": false
}
],
"hasPrevious": false,
"hasNext": true,
"totalPages": 6,
"isLast": false,
"isFirst": true
}
}
```

### Invalid credential

HTTP Code: 401

```json
{
"status": true,
"statusCode": 401,
"data": {
"access": "UNAUTHORIZED"
}
}
```

### Empty body

HTTP Code: 400

```json
{
"status": true,
"statusCode": 200,
"data": {
"hasPrevious": false,
"hasNext": false,
"totalPages": null,
"isLast": false,
"isFirst": true
}
}

```
---
[Apply Job](#applyJob)

## Apply Job

| Key | Description |
| ------ | ---------------- |
| Method | `GET` |
| Path | `/job/apply/:jobId` |


### Success Response

HTTP Code: 200

```json
{
"status": true,
"statusCode": 200,
"data": {
"id": "7c7e2bac-415d-4f3b-8125-814684a78cdd",
"userId": "3f016730-07ae-4ef6-88f1-1fc3ce57008e",
"jobId": "e00b4d7f-19c1-40f7-8e96-895dcd9b6f0e",
"paymentId": null,
"title": "This is job1 title for 3f016730-07ae-4ef6-88f1-1fc3ce57008e",
"description": "Contract for the following job description: This is job1 description for ninisani",
"paymentRate": null,
"template": null,
"createdAt": "2024-01-16T09:46:53.601Z",
"updatedAt": "2024-01-16T09:46:53.601Z",
"status": "PENDING",
"customField": null,
"workSubmission": null,
"ratingId": null
}
}
```

### Unauthorized

HTTP Code: 401

```json
{
"status": true,
"statusCode": 401,
"data": {
"access": "UNAUTHORIZED"
}
}
```

### Job not found

HTTP Code: 401

```json
{
"status": false,
"statusCode": 418,
"message": {
"jobId": "NOT_FOUND"
},
"error": "INTERNAL_SERVER_ERROR"
}
```
Loading

0 comments on commit 9c6c63a

Please sign in to comment.