Service Library - jobApplication

This document provides a complete reference of the custom code library for the jobApplication service. It includes all library functions, edge functions with their REST endpoints, templates, and assets.

Library Functions

Library functions are reusable modules available to all business APIs and other custom code within the service via require("lib/<moduleName>").

hasUserAlreadyApplied.js

module.exports = async function(userId, jobPostingId) { const JobApplication = this.getModel('jobApplication'); const app = await JobApplication.findOne({ where: { applicantUserId: userId, jobPostingId: jobPostingId, isActive: true }}); return !!app; }

getAdminJobPostingIds.js

module.exports = async function(userId) { const CompanyAdmin = this.getModel('companyAdmin', 'company'); const companies = await CompanyAdmin.findAll({ where: { userId: userId, isActive: true }}); const companyIds = companies.map(a => a.companyId); const JobPosting = this.getModel('jobPosting'); const jobPostings = await JobPosting.findAll({ where: { companyId: { $in: companyIds }, isActive: true }}); return jobPostings.map(jp => jp.id); }

This document was generated from the service library configuration and should be kept in sync with design changes.