Skip to content

Commit

Permalink
Feature/2552 Updates to character task/report in line with changes (#…
Browse files Browse the repository at this point in the history
…2576)

* update character information on candidate

* update character information v3

* Revert "update character information v3"

This reverts commit b7a4e66.

* Revert "update character information on candidate"

This reverts commit 2f4ba91.

* update application agency report

* add changes from other PR

* Revert "add changes from other PR"

This reverts commit b720941.

* update question text

* fix display of character information
  • Loading branch information
HalcyonJAC authored Oct 10, 2024
1 parent c22abd7 commit 088d267
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 23 deletions.
24 changes: 16 additions & 8 deletions src/views/Exercise/Applications/AgencyReport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -340,14 +340,15 @@
</div>

<div
v-if="isApplicationVersionGreaterThan1 && application.characterInformationV2 && hasFinancialIssues"
v-if="isApplicationVersionGreaterThan1 && characterInformation && hasFinancialIssues"
class="govuk-summary-list__row"
>
<dt class="govuk-summary-list__key">
Issues declared by the candidate
</dt>
<FinancialMattersAgencyReport
:character-information="application.characterInformationV2"
:character-information="characterInformation"
:version="applicationOpenDatePost15102024 ? 3 : 2"
/>
</div>
</dl>
Expand Down Expand Up @@ -501,6 +502,7 @@
</template>

<script>
import { mapGetters } from 'vuex';
import FinancialMattersAgencyReport from '@/views/InformationReview/FinancialMattersAgencyReport.vue';
import { isApplicationVersionGreaterThan } from '@/helpers/exerciseHelper';
Expand All @@ -510,6 +512,12 @@ export default {
FinancialMattersAgencyReport,
},
computed: {
...mapGetters({
applicationOpenDatePost15102024: 'exerciseDocument/applicationOpenDatePost15102024',
}),
characterInformation() {
return this.applicationOpenDatePost15102024 ? this.application.characterInformationV3 : this.application.characterInformationV2;
},
application() {
return this.$store.state.application.record;
},
Expand All @@ -530,12 +538,12 @@ export default {
return bsb ? bsb : {};
},
hasFinancialIssues() {
return !!(this.application.characterInformationV2 &&
(this.application.characterInformationV2.bankruptcies
|| this.application.characterInformationV2.ivas
|| this.application.characterInformationV2.lateTaxReturns
|| this.application.characterInformationV2.lateVatReturns
|| this.application.characterInformationV2.hmrcFines));
return !!(this.characterInformation &&
(this.characterInformation.bankruptcies
|| this.characterInformation.ivas
|| this.characterInformation.lateTaxReturns
|| this.characterInformation.lateVatReturns
|| this.characterInformation.hmrcFines));
},
},
};
Expand Down
84 changes: 69 additions & 15 deletions src/views/InformationReview/FinancialMattersAgencyReport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
<div class="govuk-summary-list__row">
<dd class="govuk-summary-list__value">
<span class="govuk-!-font-weight-bold">Has been declared bankrupt</span>
<InformationReviewRenderer
<InformationReviewSectionRenderer
:data="characterInformation.bankruptcyDetails"
:display-month-year-only="false"
:data-default="emptyObject(['details', 'date', 'title'])"
:edit="false"
field="bankruptcyDetails"
:is-asked="'bankruptcyDetails' in characterInformation"
/>
</dd>
Expand All @@ -22,10 +24,14 @@
>
<div class="govuk-summary-list__row">
<dd class="govuk-summary-list__value">
<span class="govuk-!-font-weight-bold">Has entered into an Individual Voluntary Agreement (IVA)</span>
<InformationReviewRenderer
<span class="govuk-!-font-weight-bold">
{{ version === 3 ? 'Has entered into an Individual Voluntary Agreement (IVA) or other similar arrangement' : 'Has entered into an Individual Voluntary Agreement (IVA)' }}
</span>
<InformationReviewSectionRenderer
:data="characterInformation.ivaDetails"
:display-month-year-only="false"
:data-default="emptyObject(['details', 'date', 'title'])"
:edit="false"
field="ivaDetails"
:is-asked="'ivaDetails' in characterInformation"
/>
</dd>
Expand All @@ -38,10 +44,14 @@
>
<div class="govuk-summary-list__row">
<dd class="govuk-summary-list__value">
<span class="govuk-!-font-weight-bold">Has filed late tax returns</span>
<InformationReviewRenderer
<span class="govuk-!-font-weight-bold">
{{ version === 3 ? 'Has filed late tax returns and/or made late tax payments' : 'Has filed late tax returns' }}
</span>
<InformationReviewSectionRenderer
:data="characterInformation.lateTaxReturnDetails"
:display-month-year-only="false"
:data-default="emptyObject(['details', 'date', 'title'])"
:edit="false"
field="lateTaxReturnDetails"
:is-asked="'lateTaxReturnDetails' in characterInformation"
/>
</dd>
Expand All @@ -54,10 +64,14 @@
>
<div class="govuk-summary-list__row">
<dd class="govuk-summary-list__value">
<span class="govuk-!-font-weight-bold">Has filed late VAT returns</span>
<InformationReviewRenderer
<span class="govuk-!-font-weight-bold">
{{ version === 3 ? 'Has filed late VAT returns and/or made late VAT payments' : 'Has filed late VAT returns' }}
</span>
<InformationReviewSectionRenderer
:data="characterInformation.lateVatReturnDetails"
:display-month-year-only="false"
:data-default="emptyObject(['details', 'date', 'title'])"
:edit="false"
field="lateVatReturnDetails"
:is-asked="'lateVatReturnDetails' in characterInformation"
/>
</dd>
Expand All @@ -71,31 +85,71 @@
<div class="govuk-summary-list__row">
<dd class="govuk-summary-list__value">
<span class="govuk-!-font-weight-bold">Has ever been fined by HMRC</span>
<InformationReviewRenderer
<InformationReviewSectionRenderer
:data="characterInformation.hmrcFineDetails"
:display-month-year-only="false"
:data-default="emptyObject(['details', 'date', 'title'])"
:edit="false"
field="hmrcFineDetails"
:is-asked="'hmrcFineDetails' in characterInformation"
/>
</dd>
</div>
</dl>

<dl
v-if="version === 3 && characterInformation.hmrcTaxDetails"
class="govuk-summary-list govuk-!-margin-bottom-0"
>
<div class="govuk-summary-list__row">
<dd class="govuk-summary-list__value">
<span class="govuk-!-font-weight-bold">Is aware of any open HMRC enquiries into their tax affairs</span>
<InformationReviewSectionRenderer
:data="characterInformation.hmrcTaxDetails"
:data-default="emptyObject(['details'])"
:edit="false"
field="hmrcTaxDetails"
:is-asked="'hmrcTaxDetails' in characterInformation"
/>
</dd>
</div>
</dl>
</div>
</template>

<script>
import InformationReviewRenderer from '@/components/Page/InformationReviewRenderer.vue';
import InformationReviewSectionRenderer from '@/components/Page/InformationReviewSectionRenderer.vue';
export default {
name: 'FinancialMattersAgencyReport',
components: {
InformationReviewRenderer,
InformationReviewSectionRenderer,
},
props: {
characterInformation: {
type: Object,
required: true,
default: new Object({}),
},
version: {
type: Number,
required: false,
default: 2,
},
},
methods: {
emptyObject(items){
const obj = {};
if (items.some(item => item === 'title')) {
obj.title = '';
}
if (items.some(item => item === 'date')) {
obj.date = new Date();
}
if (items.some(item => item === 'details')) {
obj.details = '';
}
return obj;
},
},
};
</script>

0 comments on commit 088d267

Please sign in to comment.