Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update CommunityIinfrastructureLevy types to include "not liable" path #282

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 38 additions & 16 deletions schemas/application.json
Original file line number Diff line number Diff line change
Expand Up @@ -2766,25 +2766,47 @@
},
"CommunityInfrastructureLevy": {
"$id": "#CommunityInfrastructureLevy",
"additionalProperties": false,
"description": "Details about the Community Infrastructure Levy planning charge, if applicable",
"properties": {
"result": {
"enum": [
"exempt.annexe",
"exempt.extension",
"exempt.selfBuild",
"liable",
"relief.charity",
"relief.socialHousing"
"anyOf": [
{
"additionalProperties": false,
"properties": {
"result": {
"enum": [
"exempt.annexe",
"exempt.extension",
"exempt.selfBuild",
"relief.charity",
"relief.socialHousing",
"liable"
],
"type": "string"
}
},
"required": [
"result"
],
"type": "string"
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"declaration": {
"const": true,
"type": "boolean"
},
"result": {
"const": "notLiable",
"type": "string"
}
},
"required": [
"result",
"declaration"
],
"type": "object"
}
},
"required": [
"result"
],
"type": "object"
"description": "Details about the Community Infrastructure Levy planning charge, if applicable"
},
"ContactDetails": {
"additionalProperties": false,
Expand Down
55 changes: 39 additions & 16 deletions schemas/prototypeApplication.json
Original file line number Diff line number Diff line change
Expand Up @@ -517,25 +517,48 @@
"type": "object"
},
"CommunityInfrastructureLevy": {
"additionalProperties": false,
"description": "Details about the Community Infrastructure Levy planning charge, if applicable",
"properties": {
"result": {
"enum": [
"exempt.annexe",
"exempt.extension",
"exempt.selfBuild",
"liable",
"relief.charity",
"relief.socialHousing"
"$id": "#CommunityInfrastructureLevy",
"anyOf": [
{
"additionalProperties": false,
"properties": {
"result": {
"enum": [
"exempt.annexe",
"exempt.extension",
"exempt.selfBuild",
"relief.charity",
"relief.socialHousing",
"liable"
],
"type": "string"
}
},
"required": [
"result"
],
"type": "string"
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"declaration": {
"const": true,
"type": "boolean"
},
"result": {
"const": "notLiable",
"type": "string"
}
},
"required": [
"result",
"declaration"
],
"type": "object"
}
},
"required": [
"result"
],
"type": "object"
"description": "Details about the Community Infrastructure Levy planning charge, if applicable"
},
"ContactDetails": {
"additionalProperties": false,
Expand Down
15 changes: 1 addition & 14 deletions types/schemas/application/data/ApplicationData.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {CommunityInfrastructureLevy} from '../../../shared/CommunityInfrastructureLevy';
import {Declaration} from '../../../shared/Declarations';
import {Date} from '../../../shared/utils';
import {ApplicationType} from '../enums/ApplicationTypes';
Expand Down Expand Up @@ -48,20 +49,6 @@ export interface PlanningApplication {
localPlanningAuthority: string;
}

/**
* @id #CommunityInfrastructureLevy
* @description Details about the Community Infrastructure Levy planning charge, if applicable
*/
export interface CommunityInfrastructureLevy {
result:
| 'exempt.annexe'
| 'exempt.extension'
| 'exempt.selfBuild'
| 'liable'
| 'relief.charity'
| 'relief.socialHousing';
}

export interface LeadDeveloper {
type: 'ukCompany' | 'overseasCompany' | 'none';
company?: {
Expand Down
14 changes: 1 addition & 13 deletions types/schemas/prototypeApplication/data/ApplicationData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {PrimaryApplicationType} from '../enums/ApplicationType';
import {Date} from '../../../shared/utils';
import {Declaration} from '../../../shared/Declarations';
import {Fee, FeeNotApplicable} from '../../../shared/Fees';
import {CommunityInfrastructureLevy} from '../../../shared/CommunityInfrastructureLevy';

/**
* Base type for ApplicationData. Contains all shared properties across all application types
Expand Down Expand Up @@ -35,19 +36,6 @@ export interface PlanningApplication {
localPlanningAuthority: string;
}

/**
* @description Details about the Community Infrastructure Levy planning charge, if applicable
*/
export interface CommunityInfrastructureLevy {
result:
| 'exempt.annexe'
| 'exempt.extension'
| 'exempt.selfBuild'
| 'liable'
| 'relief.charity'
| 'relief.socialHousing';
}

export interface LeadDeveloper {
type: 'ukCompany' | 'overseasCompany' | 'none';
company?: {
Expand Down
21 changes: 21 additions & 0 deletions types/shared/CommunityInfrastructureLevy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* @id #CommunityInfrastructureLevy
* @description Details about the Community Infrastructure Levy planning charge, if applicable
*/
export type CommunityInfrastructureLevy = LiableForCIL | NotLiableForCIL;

type LiableForCIL = {
// Results are heirarchical (first check if project qualifies for full exemption from CIL, then CIL relief, else plain "liable")
result:
| 'exempt.annexe'
| 'exempt.extension'
| 'exempt.selfBuild'
| 'relief.charity'
| 'relief.socialHousing'
| 'liable';
};

type NotLiableForCIL = {
result: 'notLiable';
declaration: true;
};
Loading