Skip to content

Commit

Permalink
Feature/apply 1209 Update character section of the application form (#…
Browse files Browse the repository at this point in the history
…2574)

* add guidance reference v2

* add comment

* update constant of guidance reference v2

* add year to guidance reference

* add comment
  • Loading branch information
HalcyonJAC authored Oct 10, 2024
1 parent 5dbb265 commit c22abd7
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 4 deletions.
12 changes: 11 additions & 1 deletion src/filters.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as filters from '@jac-uk/jac-kit/filters/filters';
import { ADVERT_TYPES, EXERCISE_STAGE, APPLICATION_STATUS, TASK_TYPE, OFFENCE_CATEGORY, GUIDANCE_REFERENCE, INDEPENDENT_ASSESSMENTS_STATUS, ASSESSOR_TYPES, ASSESSMENT_METHOD, APPLICATION_FORM_PARTS, WORKING_BASIS } from '@/helpers/constants';
import { ADVERT_TYPES, EXERCISE_STAGE, APPLICATION_STATUS, TASK_TYPE, OFFENCE_CATEGORY, GUIDANCE_REFERENCE, GUIDANCE_REFERENCE_V2, INDEPENDENT_ASSESSMENTS_STATUS, ASSESSOR_TYPES, ASSESSMENT_METHOD, APPLICATION_FORM_PARTS, WORKING_BASIS } from '@/helpers/constants';

const lookup = (value) => {
let returnValue;
Expand Down Expand Up @@ -298,13 +298,23 @@ const lookup = (value) => {
lookup[OFFENCE_CATEGORY.MIXED] = 'Mixed';

// character issues guide reference
// V1
lookup[GUIDANCE_REFERENCE.CRIMINAL_OFFENCES] = 'Criminal offences: paras 21-24';
lookup[GUIDANCE_REFERENCE.MOTERING_OFFENCES] = 'Motoring offences: paras 25-30';
lookup[GUIDANCE_REFERENCE.FIXED_PENALTY_NOTICES] = 'Fixed penalty notices: paras 31-34';
lookup[GUIDANCE_REFERENCE.FINANCIAL_INSOLVENCY_DEBT] = 'Financial insolvency and debt: paras 35-38';
lookup[GUIDANCE_REFERENCE.FINANCIAL_VAT_TAX] = 'Financial VAT and Tax: paras 39-43';
lookup[GUIDANCE_REFERENCE.PROFESSIONAL_CONDUCT] = 'Professional conduct: paras 44-57';
lookup[GUIDANCE_REFERENCE.FURTHER_DISCLOSURES] = 'Further disclosures: paras 58-65';
// V2
lookup[GUIDANCE_REFERENCE_V2.CRIMINAL_OFFENCES] = 'Criminal offences: paras 15-17';
lookup[GUIDANCE_REFERENCE_V2.MOTERING_OFFENCES] = 'Motoring offences: paras 18-23';
lookup[GUIDANCE_REFERENCE_V2.FIXED_PENALTY_NOTICES] = 'Fixed penalty notices: paras 24-26';
lookup[GUIDANCE_REFERENCE_V2.FINANCIAL_INSOLVENCY_DEBT] = 'Financial insolvency and debt: paras 28-32';
lookup[GUIDANCE_REFERENCE_V2.FINANCIAL_VAT_TAX] = 'Financial VAT and Tax: paras 33-38';
lookup[GUIDANCE_REFERENCE_V2.PROFESSIONAL_CONDUCT] = 'Professional conduct: paras 39-51';
lookup[GUIDANCE_REFERENCE_V2.CIVIL_PROCEEDINGS] = 'Civil proceedings: paras 52-53';
lookup[GUIDANCE_REFERENCE_V2.FURTHER_DISCLOSURES] = 'Further disclosures: paras 56-60';

// assessment methods
lookup[ASSESSMENT_METHOD.SELF_ASSESSMENT_WITH_COMPETENCIES] = 'Self Assessment with competencies';
Expand Down
12 changes: 12 additions & 0 deletions src/helpers/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,17 @@ const GUIDANCE_REFERENCE = {
PROFESSIONAL_CONDUCT: 'professionalConduct',
FURTHER_DISCLOSURES: 'furtherDisclosures',
};
// for exercises launched after 15/10/2024
const GUIDANCE_REFERENCE_V2 = {
CRIMINAL_OFFENCES: 'criminalOffencesV2',
MOTERING_OFFENCES: 'moteringOffencesV2',
FIXED_PENALTY_NOTICES: 'fixedPenaltyNoticesV2',
FINANCIAL_INSOLVENCY_DEBT: 'financialInsolvencyDebtV2',
FINANCIAL_VAT_TAX: 'financialVatTaxV2',
PROFESSIONAL_CONDUCT: 'professionalConductV2',
CIVIL_PROCEEDINGS: 'civilProceedingsV2',
FURTHER_DISCLOSURES: 'furtherDisclosuresV2',
};

const TASK_QT_MAP = {};
TASK_QT_MAP[TASK_TYPE.CRITICAL_ANALYSIS] = QUALIFYING_TEST.TYPE.CRITICAL_ANALYSIS;
Expand Down Expand Up @@ -276,6 +287,7 @@ export {
ASSESSOR_TYPES,
OFFENCE_CATEGORY,
GUIDANCE_REFERENCE,
GUIDANCE_REFERENCE_V2,
ASSESSMENT_METHOD,
APPLICATION_FORM_PARTS,
DEFAULT_WORD_COUNT,
Expand Down
8 changes: 8 additions & 0 deletions src/store/exercise/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,14 @@ export default {
// Used to facilitate different fields after 01-04-2023
return state.record.applicationOpenDate > new Date('2023-04-01');
},
applicationOpenDatePost15102024: (state, getters, rootState, rootGetters) => {
const { isDevelop } = rootGetters;
// hard-coded exercises for testing
if (isDevelop && ['JAC00010'].includes(state.record.referenceNumber)) {
return true;
}
return state.record.applicationOpenDate > new Date('2024-10-15');
},
hasInitialApprovalDate(state) {
return checkNested(state.record, '_approval', 'initialApprovalDate');
},
Expand Down
12 changes: 9 additions & 3 deletions src/views/Exercise/Reports/CharacterIssues.vue
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@

<div class="govuk-grid-column-full">
<h4 class="govuk-!-margin-top-0 govuk-!-margin-bottom-1">
Guidance reference
Guidance reference {{ applicationOpenDatePost15102024 ? '2024' : '2020' }}
</h4>
<CheckboxGroup
id="guidance-reference"
Expand Down Expand Up @@ -532,6 +532,7 @@
import { httpsCallable } from '@firebase/functions';
import { query, collection, doc, onSnapshot, where, getDocs } from '@firebase/firestore';
import { firestore, functions } from '@/firebase';
import { mapGetters } from 'vuex';
import vuexfireSerialize from '@jac-uk/jac-kit/helpers/vuexfireSerialize';
import Table from '@jac-uk/jac-kit/components/Table/Table.vue';
import TableCell from '@jac-uk/jac-kit/components/Table/TableCell.vue';
Expand All @@ -540,7 +541,7 @@ import { tableAsyncQuery } from '@jac-uk/jac-kit/components/Table/tableQuery';
import { downloadXLSX } from '@jac-uk/jac-kit/helpers/export';
import Select from '@jac-uk/jac-kit/draftComponents/Form/Select.vue';
import permissionMixin from '@/permissionMixin';
import { EXERCISE_STAGE, OFFENCE_CATEGORY, GUIDANCE_REFERENCE, APPLICATION_STATUS } from '@/helpers/constants';
import { EXERCISE_STAGE, OFFENCE_CATEGORY, GUIDANCE_REFERENCE, GUIDANCE_REFERENCE_V2, APPLICATION_STATUS } from '@/helpers/constants';
import ActionButton from '@jac-uk/jac-kit/draftComponents/ActionButton.vue';
import { downloadBase64File } from '@/helpers/file';
import CheckboxGroup from '@jac-uk/jac-kit/draftComponents/Form/CheckboxGroup.vue';
Expand Down Expand Up @@ -577,11 +578,16 @@ export default {
otherApplicationRecords: [], // used to store other application records for the same candidate (format: "[ { candidateId: '', otherRecords: [] }")
open: [],
offenceCategory: OFFENCE_CATEGORY,
guidanceReference: GUIDANCE_REFERENCE,
editMode: false,
};
},
computed: {
...mapGetters({
applicationOpenDatePost15102024: 'exerciseDocument/applicationOpenDatePost15102024',
}),
guidanceReference() {
return this.applicationOpenDatePost15102024 ? GUIDANCE_REFERENCE_V2 : GUIDANCE_REFERENCE;
},
exercise() {
return this.$store.state.exerciseDocument.record;
},
Expand Down

0 comments on commit c22abd7

Please sign in to comment.