Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Applicant filtering api endpoint #5681

Open
wants to merge 9 commits into
base: dev
Choose a base branch
from

Conversation

tristan-orourke
Copy link
Member

Resolves #4966.

The endpoint is https://talent.test/api/v2/applicants, and filters are added via url queries. The endpoint currently accepts 4 queries:

  • skillIds: a comma separated list of skill ids. Only applicants that have all these skills will be returned.
  • classifications: a comma separated list of classifications (in the form 'CS-02'). Applicants that have any of these classifications will be returned.
  • limit: the maximum number of entries to return. Defaults to, and cannot be set higher than, an app-wide maximum (currently 500, set in config/app.php).
  • offset: skips the first n results returned from the database. limit and offset can be used together for pagination.

An example query: https://talent.test/api/v2/applicants?classifications=CS-01,EX-ENG-02&skillIds=2,3,4&limit=50&offset=100

Notes:

  • Currently this endpoint is only accessible to admins.

@codecov
Copy link

codecov bot commented Apr 13, 2021

Codecov Report

Merging #5681 (0797d48) into dev (02c52e1) will decrease coverage by 0.15%.
The diff coverage is 16.00%.

Impacted file tree graph

Impacted Files Coverage Δ Complexity Δ
app/Http/Controllers/Api/ApplicantController.php 51.62% <0.00%> (-48.38%) 11.00 <5.00> (+5.00) ⬇️
...rvices/Validation/Rules/CommaSeparatedListRule.php 0.00% <0.00%> (ø) 5.00 <5.00> (?)
...vices/Validation/Rules/ValidClassificationRule.php 100.00% <100.00%> (ø) 3.00 <3.00> (?)
app/Models/Experience.php 79.32% <0.00%> (+6.90%) 9.00% <0.00%> (ø%)
@@             Coverage Diff              @@
##                dev    #5681      +/-   ##
============================================
- Coverage     50.66%   50.51%   -0.14%     
- Complexity     1803     1816      +13     
============================================
  Files           448      450       +2     
  Lines         10576    10626      +50     
  Branches        430      430              
============================================
+ Hits           5357     5367      +10     
- Misses         4903     4943      +40     
  Partials        316      316              
Impacted Files Coverage Δ Complexity Δ
app/Http/Controllers/Api/ApplicantController.php 51.62% <0.00%> (-48.38%) 11.00 <5.00> (+5.00) ⬇️
...rvices/Validation/Rules/CommaSeparatedListRule.php 0.00% <0.00%> (ø) 5.00 <5.00> (?)
...vices/Validation/Rules/ValidClassificationRule.php 100.00% <100.00%> (ø) 3.00 <3.00> (?)
app/Models/Experience.php 79.32% <0.00%> (+6.90%) 9.00% <0.00%> (ø%)

@tristan-orourke tristan-orourke marked this pull request as ready for review April 13, 2021 16:01
@tristan-orourke tristan-orourke requested a review from mnigh April 14, 2021 13:54
public function index(Request $request)
{
$expectsJson = $request->expectsJson();
Log::debug("Expects json: $expectsJson");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this leftover from testing?

use App\Services\Validation\Rules\CommaSeparatedListRule;
use Illuminate\Database\Eloquent\Builder;
use App\Services\Validation\Rules\ValidClassificationRule;
use Illuminate\Support\Facades\Log;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this leftover from testing?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Task - Manager - API endpoint for search
2 participants