Refactor job handling and integrate LinkedIn API support#59
Open
Refactor job handling and integrate LinkedIn API support#59
Conversation
Implemented a new `GetJobDataJob` abstract class to standardize job fetching logic across APIs. Added a LinkedIn job macro and updated the `ApiName` enum for LinkedIn API support. Refactored `AppServiceProvider` to include LinkedIn-related functionality and improved code consistency.
Refactored `GetJobDataJob` by moving it out of the `Store` namespace and adjusting the `makeApiRequest` and DTO transformation methods to use the `Country` model instead of just the country code. Added new job classes (`JSearchJobDataJob` and `LinkedInJobDataJob`) to handle specific API integrations, supporting custom request structures and response transformations for `JSearch` and `LinkedIn` APIs.
Introduced a new Artisan command `app:link-countries` to associate specified active countries with all job categories. The command ensures existing relationships are cleared, provides progress feedback, and verifies the linking process upon completion.
Replaced the `GetJobData` dispatch with `JSearchJobDataJob` and `LinkedInJobDataJob` for improved granularity. Removed unused exception handling related to `CategoryNotFoundException` and cleaned up imports to streamline the code.
Refactored `GetJobDataJob` and its subclasses to enhance logging clarity and add proper exception handling. Replaced `readonly` properties to ensure compatibility and introduced validation for missing API keys. Updated LinkedIn job request endpoint to adjust query behavior.
Replaced the 'job_description' field with 'linkedin_org_description' to ensure alignment with LinkedIn's data structure. This change improves the accuracy of job descriptions pulled from LinkedIn sources.
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.
📝 Why is PR is required?
Answer:
This PR refactors job data handling to improve logging, error handling, and data accuracy while introducing LinkedIn-specific job API integration and abstracting job fetching logic for multiple APIs. It also adds a new Artisan command to link active countries to job categories.
🛠️ Changes
📌 Related Issues (e.g., Fixes #123, Closes #456)
Ans: None
📸 Screenshots (if applicable)
Ans: None
📣 Additional Comments
Ans