This module will implement all of the backend logic related to jobs. We are going to define the necessary models and controllers. Only the most important parts of the module will be explained.
The job model will define a single entity from the Jobs
collection and is going to handle the necessary validation when creating a new job. As for the company model, we are going to use a custom variable file for job industries and types. The two files will be located at jobboard/config/variables/industries.js
and jobboard/config/variables/jobtypes.js
, respectively. Both export a list of objects.
In order to implement the job
model, we are going to follow these steps:
Create the model file, called
jobboard/app/models/job.js
.Add the necessary dependencies:
const mongoose = require('mongoose'); const commonHelper = require('../helpers/common'); const Industries = require('../../config/variables/industries'); const Countries = require('../../config/variables/countries'...