---
# System prepended metadata

title: Module 5(Jobs CRUD)
tags: [general]

---

---
title: Module 5(Jobs CRUD)
tags: general
---

# List of APIs

### Module 5: Jobs Module

#### Prerequisites

**New Tables**

    - jobs
        - id: uuid
        - title: string
        - isFeatured: boolean (default = False)
        - description: Text
        - company: (Many to One) Client
        - industry: (Many to One) Industry
        - skills: (Many To Many) skills
        - totalVacancies: number
        - creditPerVacancy: number
        - locations: (Many to Many) locations
        - urgency: number
        - process: json 
        - status: OPEN or CLOSED or In_PROGRESS
        - created_at: Date (Auto)
        - updated_at: Date (Auto)
        - created_by: User Mapping
        - updated_by: User Mapping
        - filledVacancies: number (optional)

**Note:** I have kept filled vacancies as optional because I don't know at this point if it is useful or not

##### 1) Create job

**Endpoint:**: POST '/jobs'

**Requirement**: isCCAdminOrSuperAdmin

##### 2) Get All jobs

**Endpoint:**: GET '/jobs'

**Response**: 

```
{
    meta: {
    ...
    },
    data: [{
     title, description, dates, isFeatured etc.
     
    }, ...]

}
```

##### 3) Edit job

**EndPoint**: PUT 'jobs/:job_id'

**Required**: isCCAdminOrCCSuperAdmin

Process:

Same as other Edit table functions.


##### 5) Disable jobs

**EndPoint**: POST 'jobs/disable'

**Required**: isCCAdminOrCCSuperAdmin

Process:

Same as recruiter members, will work with the given job_id.

Request Body: 
```
[{
    jobId: {job's id}, 
    disable: true/false
}]
```

If disable == true then disable the client else enable it.

##### 6) Delete jobs

**EndPoint**: DELETE '/jobs'

**Required**: isCCAdminOrCCSuperAdmin

Process:

Same as recruiter members, will work with the given job_id.

Request Body: 
```
[{
    jobId: {job's id}
}]
```

If disable == true then disable the client else enable it.


##### 7) Filters on jobs

same as before




