Skip to content

Commit

Permalink
Merge pull request #2020 from NMDSdevopsServiceAdm/liveConflict
Browse files Browse the repository at this point in the history
Merge Test to Live for Release 4.1
  • Loading branch information
NMDSdevopsServiceAdm authored Mar 4, 2020
2 parents 16c286d + 7aa64b3 commit 293515c
Show file tree
Hide file tree
Showing 30 changed files with 4,290 additions and 520 deletions.
4 changes: 3 additions & 1 deletion server/data/bulkUploadLock.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use strict';

const rfr = require('rfr');

const db = rfr('server/utils/datastore');

module.exports = {
Expand Down Expand Up @@ -87,4 +89,4 @@ module.exports = {
type: db.QueryTypes.UPDATE
});
}
};
};
36 changes: 34 additions & 2 deletions server/data/parentWDFReport.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,36 @@ SELECT
COUNT(:zero)
FROM
cqc."Worker"
LEFT JOIN
cqc."Job"
ON
"Worker"."MainJobFKValue" = "Job"."JobID"
LEFT JOIN
cqc."Nationality"
ON
cqc."Worker"."NationalityOtherFK" = "Nationality"."ID"
LEFT JOIN
cqc."Qualification"
ON
"Worker"."SocialCareQualificationFKValue" = "Qualification"."ID"
WHERE
"EstablishmentFK" = "Establishment"."EstablishmentID" AND
"LastWdfEligibility" IS NOT NULL AND
("GenderValue" IS NOT NULL) AND
("DateOfBirthValue" IS NOT NULL) AND
(("NationalityValue" = :British OR "NationalityValue" = :Dont) OR ("NationalityValue" = :Other AND "Nationality"."Nationality" IS NOT NULL)) AND
("Job"."JobName" IS NOT NULL OR "Job"."JobName" != :emptyValue) AND
("MainJobStartDateValue" IS NOT NULL) AND
("RecruitedFromValue" IS NOT NULL) AND
("ContractValue" IS NOT NULL) AND
("WeeklyHoursContractedValue" IS NOT NULL OR "WeeklyHoursAverageValue" IS NOT NULL) AND
("ZeroHoursContractValue" IS NOT NULL) AND
("DaysSickValue" IS NOT NULL) AND
(("AnnualHourlyPayValue" IS NOT NULL OR ("AnnualHourlyPayRate" IS NOT NULL OR "AnnualHourlyPayValue" = :Dont))) AND
("CareCertificateValue" IS NOT NULL) AND
("QualificationInSocialCareValue" IS NOT NULL OR ("QualificationInSocialCareValue" = :No OR "QualificationInSocialCareValue" = :Dont) OR ("Qualification"."Level" IS NOT NULL OR "Qualification"."Level" != :emptyValue)) AND
("OtherQualificationsValue" IS NOT NULL) AND
"LastWdfEligibility" > :effectiveDate AND
("DataOwner" = :Parent OR "DataPermissions" = :WorkplaceStaff) AND
"Archived" = :falseFlag
) AS "CompletedWorkerRecords",
array_to_string(array(
Expand Down Expand Up @@ -97,7 +123,6 @@ SELECT
"StartersValue",
"LeaversValue",
"NumberOfStaffValue",
updated,
CASE WHEN updated > :effectiveDate THEN to_char(updated, :timeFormat) ELSE NULL END AS "LastUpdatedDate",
"ShareDataWithCQC",
Expand Down Expand Up @@ -148,6 +173,13 @@ exports.getEstablishmentData = async establishmentId =>
Vacancies: 'Vacancies',
Starters: 'Starters',
Leavers: 'Leavers',
Dont: 'Don\'t know',
Other: 'Other',
No: 'No',
emptyValue: '',
WorkplaceStaff: 'Workplace and Staff',
Parent: 'Parent',
British: 'British'
},
type: db.QueryTypes.SELECT
});
Expand Down
Loading

0 comments on commit 293515c

Please sign in to comment.