Repository navigation
Conversation
- Added workable to TP_ID enum, migration, common constants, and config - Added Prisma field mappings (77 fields) for Candidate, Job, Offer, and Department - Added preprocess and disunify normalizers for Workable ATS entities - Added WorkableAuthHandler supporting both Direct API Key/Token and OAuth2 flows - Wired token refresh service and metadata endpoint for Workable - Implemented full ATS endpoints in candidate, job, department, offer, and proxy services - Added client UI org URL input prompt, metadata, and oauth callback support - Added JS SDK connect flow for Workable - Added comprehensive unit test suite covering helpers, transforms, and auth (30/30 passing) - Formatted all modified files with Prettier
|
Thank you for following the naming conventions for pull request titles! 🙏 |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #551
Fixes #551
/claim #551
Summary of Changes
This PR implements the full, production-grade Workable ATS integration across Revert backend, Prisma database schema/seed, unified CRM transforms, client UI, and JS SDK.
1. Database & Configuration
workabletoTP_IDenum inschema.prisma.20260907130000_workable_enum/migration.sqlwithALTER TYPE "TP_ID" ADD VALUE 'workable';.workableinATS_TP_ID,DEFAULT_SCOPE, andmapIntegrationIdToIntegrationName.WORKABLE_CLIENT_ID,WORKABLE_CLIENT_SECRET,WORKABLE_AUTH_URL, andWORKABLE_TOKEN_URLinconfig.tsand.env.example.fields.tsand enabled seeding inseed.ts.2. Dual Authentication & Routing
routes/v1/ats/authHandlers/workable.ts:sendConnectionAddedEvent./oauth-callbackinroutes/v1/ats/auth.tsto automatically route between OAuth and Direct API Token based on available app credentials.services/auth.tsand registered official Workable logo/metadata inservices/metadata.ts.3. Unified ATS Endpoints
services/ats/candidate.ts):getCandidate: Fetches/candidates/:idand unifies.getCandidates: Fetches/candidates(or/jobs/:shortcode/candidates) with cursor pagination and unifies.createCandidate: Creates candidate; routes to/jobs/:shortcode/candidatesifshortcodeorjob_idis supplied, else/candidates.updateCandidate: Updates candidate viaPATCH /candidates/:id.deleteCandidate: Deletes candidate viaDELETE /candidates/:id.services/ats/job.ts):getJob: Fetches/jobs/:shortcodeand unifies.getJobs: Fetches/jobswith cursor pagination and unifies.createJob,updateJob,deleteJob: Standard unsupported responses matching Revert ATS architecture.services/ats/department.ts):getDepartments: Fetches/departmentswith cursor pagination and unifies.getDepartment: Resolves specific department from/departmentsby ID/name.services/ats/offer.ts):getOffer: Fetches/offers/:idand unifies.getOffers: Fetches/offersor/candidates/:id/offerand unifies.services/ats/proxy.ts):https://{subdomain}.workable.com/spi/v3/{path}with Bearer auth headers.4. Transforms & Normalizers
helpers/crm/transform/preprocess.ts): Added normalizers for Candidate (names, emails, phones, stages, application shortcodes), Job (shortcode, department, status mapping), Offer (status, candidate/job links), and Department.helpers/crm/transform/disunify.ts): Added Workable candidate creation payload disunification (candidate: { firstname, lastname, name, email, phone, headline, summary }).5. Frontend UI & JS SDK
EditCredentials.tsx): Added Subdomain / Organisation URL input and validation check for Workable.enums/metadata.ts): Added Workable app info, description, and logo.oauth/index.tsx): Includedworkablein ATS/oauth-callbackhandler.packages/js/src/index.ts): Added Workable popup connect flow supporting direct API key modal input or OAuth popup.Verification & Testing
./node_modules/.bin/jest --config=packages/backend/jest.config.json packages/backend/helpers/ats/workable.test.ts --forceExitsince_id,after_id,cursor,paging.next_id)./node_modules/.bin/prettier --check <all changed files>->All matched files use Prettier code style!