diff --git a/src/routes/officers.js b/src/routes/officers.js index eed57ee..a6d8e12 100644 --- a/src/routes/officers.js +++ b/src/routes/officers.js @@ -93,6 +93,8 @@ router.get('/:id', async (req, res, next) => { * @function * @memberof module:routes/officers~router-officers * @inner + * + * @param {String} password - Updated password of admin. */ router.patch('/admin/password', async (req, res, next) => { passport.authenticate('admin', { session: false }, async (err, admin, info) => { @@ -120,6 +122,7 @@ router.patch('/admin/password', async (req, res, next) => { * PATCH /:id/password * * Update officer's password by UUID. This route is only accessible to the admin. + * id is the ID of the officer whose password is being updated. * * Request body must be a JSON object containing the fields specified in the `parameters` section. * @@ -127,6 +130,8 @@ router.patch('/admin/password', async (req, res, next) => { * @function * @memberof module:routes/officers~router-officers * @inner + * + * @param {String} password - Updated password of officer. */ router.patch('/:id/password', async (req, res, next) => { passport.authenticate('admin', { session: false }, async (err, admin, info) => { @@ -158,7 +163,7 @@ router.patch('/:id/password', async (req, res, next) => { * * Mark officer as inactive by UUID. This route is only accessible to the admin. * - * Request body must be a JSON object containing the fields specified in the `parameters` section. + * id represents the ID of the officer being marked as inactive. * * @name delete/:id * @function diff --git a/src/routes/settings.js b/src/routes/settings.js index 71f8238..6d18e7c 100644 --- a/src/routes/settings.js +++ b/src/routes/settings.js @@ -48,7 +48,9 @@ router.get('/loans', async (req, res, next) => { /** * PATCH /loans/:loanType * - * Edit the settings of a given loan type + * Edit the settings of a given loan type. + * + * loanType is the loan type whose settings should be edited. * * Request body must be a JSON object containing the fields specified in the `parameters` section. * @@ -56,6 +58,12 @@ router.get('/loans', async (req, res, next) => { * @function * @memberof module:routes/settings~router-settings * @inner + * + * @param {MandatoryIndividualSettingSchema} interest_rate -The interest rate of the current loan type. Used for automatic interest calculations. + * @param {IndividualSettingSchema} service_fee - Initial service fees for the current loan type. Deducted from the loan value upon loan approval. + * @param {IndividualSettingSchema} capital_build_up - Capital build-up fee for the current loan type. Deducted from the loan value upon loan approval. + * @param {IndividualSettingSchema} savings - Savings contribution for the current loan type. Deducted from the loan value upon loan approval. + * @param {TimeSettingSchema} time - Time period between interest applications. */ router.patch('/loans/:loanType', async (req, res, next) => { passport.authenticate('admin', { session: false }, async (err, admin, info) => { @@ -109,12 +117,17 @@ router.get('/deposits', async (req, res, next) => { * * Edit the settings of a given deposit type * + * depositType is the deposit type whose settings should be edited. + * * Request body must be a JSON object containing the fields specified in the `parameters` section. * * @name patch/deposits/:depositType * @function * @memberof module:routes/settings~router-settings * @inner + * + * @param {MandatoryIndividualSettingSchema} interest_rate - Interest rate of the deposit type. + * @param {TimeSettingSchema} time - Time period between interest applications. */ router.patch('/deposits/:depositType', async (req, res, next) => { passport.authenticate('admin', { session: false }, async (err, admin, info) => { @@ -175,6 +188,12 @@ router.get('/notifications', async (req, res, next) => { * @function * @memberof module:routes/settings~router-settings * @inner + * + * @param {Number} reminder - How close to the deadline a loan has to be for it to warrant a reminder. + * @param {Number} first_notice - How close to the deadline a loan has to be for it to warrant a first notice. + * @param {Number} second_notice - How close to the deadline a loan has to be for it to warrant a second notice. + * @param {Number} third_notice - How close to the deadline a loan has to be for it to warrant a third notice. + * @param {Number} demand_letter - How close to the deadline a loan has to be for it to warrant a demand letter. */ router.patch('/notifications', async (req, res, next) => { passport.authenticate('admin', { session: false }, async (err, admin, info) => { diff --git a/src/routes/users.js b/src/routes/users.js index dbe23c8..bb59130 100644 --- a/src/routes/users.js +++ b/src/routes/users.js @@ -84,6 +84,19 @@ router.get('/search', async function (req, res, next) { * @function * @memberof module:routes/users~router-users * @inner + * + * @prop {String} username - Username, unique identifier per user. + * @prop {NameSchema} name - User's full name. + * @prop {Date} birthday - User's birthday. + * @prop {String} birthplace - User's birthplace. + * @prop {String} sex - User's sex. Must be either 'M' or 'F' + * @prop {String} civil_status - User's civil status. Must be either 'Single' or 'Married' + * @prop {String} tin_no - TIN number of the user. Must be of the format XXX-XXX-XXX-XXX where X is a number from 0 to 9 + * @prop {String} contact_no - User's contact number.. + * @prop {Number} monthly_income - Users' monthly income. + * @prop {LocationSchema} address - Users' address. + * @prop {String} occupation - Users' occupation. + * @prop {SpouseSchema} spouse - Users' spouse, if any. */ router.put('/', async function (req, res, next) { passport.authenticate('is-manager', { session: false }, async (err, manager, info) => { @@ -119,10 +132,24 @@ router.put('/', async function (req, res, next) { * * Request body must be a JSON object containing the fields specified in the `parameters` section. * - * @name patch/username + * Username should be the username of the user to edit. + * + * @name patch/:username * @function * @memberof module:routes/users~router-users * @inner + * + * @prop {NameSchema} name - User's full name. + * @prop {Date} birthday - User's birthday. + * @prop {String} birthplace - User's birthplace. + * @prop {String} sex - User's sex. Must be either 'M' or 'F' + * @prop {String} civil_status - User's civil status. Must be either 'Single' or 'Married' + * @prop {String} tin_no - TIN number of the user. Must be of the format XXX-XXX-XXX-XXX where X is a number from 0 to 9 + * @prop {String} contact_no - User's contact number.. + * @prop {Number} monthly_income - Users' monthly income. + * @prop {LocationSchema} address - Users' address. + * @prop {String} occupation - Users' occupation. + * @prop {SpouseSchema} spouse - Users' spouse, if any. */ router.patch('/:username', async function (req, res, next) { passport.authenticate('is-manager', { session: false }, async (err, manager, info) => { @@ -154,11 +181,11 @@ router.patch('/:username', async function (req, res, next) { }) /** - * Delete the information of a user in the users listing. + * Marks a given user as deleted. * - * Request body must be a JSON object containing the fields specified in the `parameters` section. + * username should be the Username of the user to be marked as deleted. * - * @name delete/username + * @name delete/:username * @function * @memberof module:routes/users~router-users * @inner