diff --git a/.circleci/config.yml b/.circleci/config.yml index b4441dc..8b16634 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -65,7 +65,7 @@ workflows: only: - develop - pm-1127_1 - - pm-4288 + - pm-4288_1 # Production builds are exectuted only on tagged commits to the # master branch. diff --git a/sql/reports/topcoder/completed-profiles-count.sql b/sql/reports/topcoder/completed-profiles-count.sql index 6a0ce9c..6902431 100644 --- a/sql/reports/topcoder/completed-profiles-count.sql +++ b/sql/reports/topcoder/completed-profiles-count.sql @@ -43,6 +43,15 @@ WHERE m.description IS NOT NULL AND jsonb_array_length(mtp.value::jsonb -> 'preferredRoles') > 0 ) ) + AND ( + $2::boolean IS NULL + OR ( + ( + mtp.value::jsonb ? 'availability' + AND btrim(mtp.value->>'availability') <> '' + ) = $2::boolean + ) + ) ) AND EXISTS ( SELECT 1 diff --git a/src/reports/topcoder/topcoder-reports.service.ts b/src/reports/topcoder/topcoder-reports.service.ts index bfacded..326509e 100644 --- a/src/reports/topcoder/topcoder-reports.service.ts +++ b/src/reports/topcoder/topcoder-reports.service.ts @@ -97,6 +97,8 @@ type CompletedProfileRow = { city: string | null; skillCount: string | number | null; principalSkills: string[] | null; + isOpenToWork?: boolean | null; + openToWork?: { availability?: string; preferredRoles?: string[] } | null; }; type CompletedProfilesCountRow = { @@ -699,6 +701,8 @@ export class TopcoderReportsService { ? Number(row.skillCount) : undefined, principalSkills: row.principalSkills || undefined, + openToWork: row.openToWork ?? null, + isOpenToWork: row.isOpenToWork ?? false, })); return {