1.1.4 • Published 5 years ago

@alaka/notification-service-functions v1.1.4

Weekly downloads
-
License
-
Repository
github
Last release
5 years ago

Notification service functions

Helper functions for notification-service API

Installation and configuration

Install via npm

npm install --save @alaka/notification-service-functions

Import package

NodeJS

const notificationServiceModule = require('@alaka/notification-service-functions');

ES6

import notificationServiceModule from '@alaka/notification-service-functions';

Initialization

/**
 * @param {object} config
 * @param {string} config.API_endpoint API endpoint for 8base workspace
 * @param {string} config.API_token 8base token for workspace
 */
const notificationService = notificationServiceModule(config);

Functions

Match manager Notifications

Candidate was submitted to Alaka (Match manager)

/**
 * Candidate was submitted to Alaka (Match manager)
 * @param {object} params
 * @param {object[]} params.matchManagers List of match managers who are assigned to project which RFQ is part of
 * @param {string} params.matchManagers[].firstName Match manager name for greeting
 * @param {string} params.matchManagers[].email Match manager email
 * @param {string} params.client Name of the client who owns the RFQ
 * @param {string} params.project Name of the project which RFQ is part of
 * @param {string} params.positionTitle RFQ position title e.g. Database administrator
 * @param {string} params.rfqNumber RFQ number/Code e.g. 0-1234
 * @param {string} params.supplier Name of the supplier
 * @param {string} params.company Supplier company name
 * @param {object[]} params.candidates All candidates who were submitted to RFQ
 * @param {string} params.candidates[].name Name of the candidate
 * @param {number} params.candidates[].score Sorting hat match score
 * @param {object[]} params.candidates[].rates Supplier rates for candidate
 * @param {number} params.candidates[].rates[].year Rate year
 * @param {number} params.candidates[].rates[].rate Rate value
 * @param {string} params.candidates[].availability Availability from the point of selection e.g. 1-2 weeks, less than a week..
 * @param {string} params.candidateLink Link to newly submitted candidate card
 * @param {string} params.rfqLink Link to select candidates page for RFQ
 * @returns {Promise<boolean>} TRUE if notification was successfully processed
 * @throws Error on missing or bad args
 */
candidateSubmittedToAlakaMatchManager(params);

Purchase order received (Match manager)

/**
 * Purchase order received (Match manager)
 * @param {object} params
 * @param {object[]} params.matchManagers List of match managers who are assigned to project which RFQ is part of
 * @param {string} params.matchManagers[].firstName Match manager name for greeting
 * @param {string} params.matchManagers[].email Match manager email
 * @param {string} params.client Name of the client who owns the RFQ
 * @param {string} params.project Name of the project which RFQ is part of
 * @param {string} params.rfqNumber RFQ number/Code e.g. 0-1234
 * @param {string} params.poNumber Purchase order number
 * @param {string} params.candidate Name of the candidate
 * @param {string} params.startDate Start date of PO e.g. 11-dec-2019
 * @param {string} params.endDate End date of PO e.g. 11-feb-2020
 * @param {number} params.hours Number of hours for RFQ
 * @param {number} params.rate Hourly rate of selected candidate
 * @param {string} params.link Link to RFQ
 * @returns {Promise<boolean>} TRUE if notification was successfully processed
 * @throws Error on missing or bad args
 */
purchaseOrderReceivedMatchManager(params);

Purchase order parsing has failed

/**
 * Purchase order parsing has failed
 * @param {object} params
 * @param {object[]} params.matchManagers List of match managers who are assigned to project which RFQ is part of
 * @param {string} params.matchManagers[].firstName Match manager name for greeting
 * @param {string} params.matchManagers[].email Match manager email
 * @param {string} params.client Name of the client who owns the RFQ
 * @param {string} params.project Name of the project which RFQ is part of
 * @param {string} params.rfqNumber RFQ number/Code e.g. 0-1234
 * @param {string} params.poNumber Purchase order number
 * @param {string} params.candidate Name of the candidate
 * @param {string} params.link Link to RFQ
 * @returns {Promise<boolean>} TRUE if notification was successfully processed
 * @throws Error on missing or bad args
 */
purchaseOrderParsingError(params);

Supplier Notifications

RFQ has been published

/**
 * RFQ has been published
 * @param {object} params
 * @param {object[]} params.suppliers List of suppliers to be notified
 * @param {string} params.suppliers[].firstName Supplier name for greeting
 * @param {string} params.suppliers[].email Supplier email
 * @param {string} params.client Name of the client who owns the RFQ
 * @param {string} params.project Name of the project which RFQ is part of
 * @param {string} params.rfqNumber RFQ number/Code e.g. 0-1234
 * @param {string} params.positionTitle RFQ position title e.g. Database administrator
 * @param {string} params.link Link to published RFQ
 * @returns {Promise<boolean>} TRUE if notification was successfully processed
 * @throws Error on missing or bad args
 */
rfqPublished(params);

Candidate rejected by match manager

/**
 * Candidate was rejected by match manager
 * @param {object} params
 * @param {object} params.supplier Supplier who submitted the candidate
 * @param {string} params.suppliers.firstName Supplier name for greeting
 * @param {string} params.suppliers.email Supplier email
 * @param {string} params.client Name of the client who owns the RFQ
 * @param {string} params.project Name of project which RFQ is part of
 * @param {string} params.rfqNumber RFQ number/code e.g. 0-1234
 * @param {string} params.positionTitle RFQ position title e.g. Database administrator
 * @param {string} params.candidate Name of candidate who was rejected
 * @param {string} params.reason Reason why was the candidate rejected
 * @param {string} params.link Link to candidate card
 * @returns {Promise<boolean>} TRUE if notification was successfully processed
 * @throws Error on missing or bad args
 */
candidateRejectedByAdmin(params);

Candidate NOT selected by client

/**
 * Candidate was rejected by client
 * @param {object} params
 * @param {object} params.supplier Supplier who submitted the candidate
 * @param {string} params.suppliers.firstName Supplier name for greeting
 * @param {string} params.suppliers.email Supplier email
 * @param {string} params.client Name of the client who owns the RFQ
 * @param {string} params.project Name of project which RFQ is part of
 * @param {string} params.rfqNumber RFQ number/code e.g. 0-1234
 * @param {string} params.positionTitle RFQ position title e.g. Database administrator
 * @param {string} params.candidate Name of candidate who was rejected
 * @param {string} params.reason Reason why was the candidate rejected
 * @param {string} params.link Link to candidate card
 * @returns {Promise<boolean>} TRUE if notification was successfully processed
 * @throws Error on missing or bad args
 */
candidateRejectedByClient(params);

Candidate selected by client

/**
 * Candidate was selected by client
 * @param {object} params
 * @param {object} params.supplier Supplier who submitted the candidate
 * @param {string} params.suppliers.firstName Supplier name for greeting
 * @param {string} params.suppliers.email Supplier email
 * @param {string} params.client Name of the client who owns the RFQ
 * @param {string} params.project Name of project which RFQ is part of
 * @param {string} params.rfqNumber RFQ number/code e.g. 0-1234
 * @param {string} params.positionTitle RFQ position title e.g. Database administrator
 * @param {string} params.candidate Name of candidate who was selected
 * @param {string} params.startDate Start date for the candidate DD-MMM-YYYY
 * @param {string} params.link Link to candidate card to suggest a start date
 * @returns {Promise<boolean>} TRUE if notification was successfully processed
 * @throws Error on missing or bad args
 */
candidateSelectedByClient(params);

Candidate submitted to Alaka (Supplier)

/**
 * Candidate was submitted successfully to Alaka (supplier)
 * @param {object} params
 * @param {object} params.supplier Supplier who submitted the candidate
 * @param {string} params.suppliers.firstName Supplier name for greeting
 * @param {string} params.suppliers.email Supplier email
 * @param {string} params.client Name of the client who owns the RFQ
 * @param {string} params.project Name of the project which RFQ is part of
 * @param {string} params.rfqNumber RFQ number/code e.g. 0-1234
 * @param {string} params.positionTitle RFQ position title e.g. Database administrator
 * @param {string} params.candidate Name of candidate who was submitted
 * @param {string} params.link Link to submitted candidate
 * @returns {Promise<boolean>} TRUE if notification was successfully processed
 * @throws Error on missing or bad args
 */
candidateSubmittedToAlakaSupplier(params);

Candidate submitted to client

/**
 * Candidate was successfully submitted to client
 * @param {object} params
 * @param {object} params.supplier Supplier who submitted the candidate
 * @param {string} params.suppliers.firstName Supplier name for greeting
 * @param {string} params.suppliers.email Supplier email
 * @param {string} params.client Name of the client who owns the RFQ
 * @param {string} params.project Name of the project which RFQ is part of
 * @param {string} params.rfqNumber RFQ number/code e.g. 0-1234
 * @param {string} params.positionTitle RFQ position title e.g. Database administrator
 * @param {string} params.candidate Name of candidate who was submitted
 * @param {string} params.link Link to submitted candidate
 * @returns {Promise<boolean>} TRUE if notification was successfully processed
 * @throws Error on missing or bad args
 */
candidateSubmittedToClient(params);

Purchase order received (Supplier)

/**
 * Purchase order received (supplier)
 * @param {object} params
 * @param {object} params.supplier Supplier who submitted the candidate
 * @param {string} params.suppliers.firstName Supplier name for greeting
 * @param {string} params.suppliers.email Supplier email
 * @param {string} params.client Name of the client who owns the RFQ
 * @param {string} params.project Name of the project which RFQ is part of
 * @param {string} params.rfqNumber RFQ number/Code e.g. 0-1234
 * @param {string} params.positionTitle RFQ position title e.g. Database administrator
 * @param {string} params.poNumber Purchase order number
 * @param {string} params.candidate Name of the candidate
 * @param {string} params.startDate Start date of PO e.g. 11-dec-2019
 * @param {string} params.endDate End date of PO e.g. 11-feb-2020
 * @param {number} params.hours Number of hours for RFQ
 * @param {number} params.rate Hourly rate of selected candidate
 * @returns {Promise<boolean>} TRUE if notification was successfully processed
 * @throws Error on missing or bad args
 */
purchaseOrderReceivedSupplier(params);

Development

This project uses eslint for linting and prettier for formating javascript code.

Git commit will failed if staged files don't pass linting!

VSCode plugins

VSCode format on save

In Preferences->Settings search and check option editor.formatOnSave for Workspace settings

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago