Skip to content

Commit

Permalink
remove unused code, minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kapppa-joe committed Nov 11, 2024
1 parent b1a5fe1 commit 1a4b8bf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
4 changes: 0 additions & 4 deletions backend/server/models/BulkImport/csv/crossValidate.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,6 @@ const _buildWorkplaceDictWithNewWorkers = (allNewWorkers) => {
.value();
};

const _addErrorForWorkersWithSameRefsMovingToSameWorkplace = (csvWorkerSchemaErrors, JSONWorker) => {
addCrossValidateError(csvWorkerSchemaErrors, TRANSFER_STAFF_RECORD_ERRORS.SameRefsMovingToWorkplace, JSONWorker);
};

module.exports = {
crossValidate,
_crossValidateMainJobRole,
Expand Down
24 changes: 12 additions & 12 deletions backend/server/models/BulkImport/csv/crossValidateErrors.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
const MAIN_JOB_ROLE_ERROR_CODE = 1280;
const TRANSFER_STAFF_RECORD_BASE_ERROR_CODE = 1400;

const MAIN_JOB_ERRORS = Object.freeze({
RegisteredManagerWithoutCqcRegulatedService: {
const MAIN_JOB_ERRORS = {
RegisteredManagerWithoutCqcRegulatedService: Object.freeze({
errCode: MAIN_JOB_ROLE_ERROR_CODE,
errType: 'MAIN_JOB_ROLE_ERROR',
column: 'MAINJOBROLE',
_sourceFieldName: 'mainJobRoleId',
error:
'Workers MAINJOBROLE is Registered Manager but you are not providing a CQC regulated service. Please change to another Job Role',
},
});
}),
};

const TRANSFER_STAFF_RECORD_ERRORS = Object.freeze({
NewWorkplaceNotFound: {
const TRANSFER_STAFF_RECORD_ERRORS = {
NewWorkplaceNotFound: Object.freeze({
errCode: TRANSFER_STAFF_RECORD_BASE_ERROR_CODE + 1,
errType: 'TRANSFERSTAFFRECORD_ERROR',
column: 'TRANSFERSTAFFRECORD',
_sourceFieldName: 'transferStaffRecord',
error: 'Cannot find an existing workplace with the reference provided in TRANSFERSTAFFRECORD',
},
SameLocalIdExistInNewWorkplace: {
}),
SameLocalIdExistInNewWorkplace: Object.freeze({
errCode: TRANSFER_STAFF_RECORD_BASE_ERROR_CODE + 2,
errType: 'TRANSFERSTAFFRECORD_ERROR',
column: 'UNIQUEWORKERID',
_sourceFieldName: 'uniqueWorkerId',
error: 'The UNIQUEWORKERID for this worker is already used in the new workplace given in TRANSFERSTAFFRECORD',
},
SameRefsMovingToWorkplace: {
}),
SameRefsMovingToWorkplace: Object.freeze({
errCode: TRANSFER_STAFF_RECORD_BASE_ERROR_CODE + 3,
errType: 'TRANSFERSTAFFRECORD_ERROR',
column: 'UNIQUEWORKERID',
_sourceFieldName: 'uniqueWorkerId',
error:
'There are more than one worker with this UNIQUEWORKERID moving into the new workplace given in TRANSFERSTAFFRECORD.',
},
});
}),
};

const addCrossValidateError = (errorsArray, errorType, JSONWorker) => {
const newErrorObject = {
Expand Down

0 comments on commit 1a4b8bf

Please sign in to comment.