diff --git a/schema/schema.json b/schema/schema.json index 3eb5a89a..ae6f729e 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -430,6 +430,21 @@ ], "type": "object" }, + "ApplicationFeeNotApplicable": { + "$id": "#ApplicationFeeNotApplicable", + "additionalProperties": false, + "description": "An indicator that an application fee does not apply to this application type or journey", + "properties": { + "notApplicable": { + "const": true, + "type": "boolean" + } + }, + "required": [ + "notApplicable" + ], + "type": "object" + }, "ApplicationType": { "$id": "#ApplicationType", "anyOf": [ @@ -1835,7 +1850,14 @@ "$ref": "#/definitions/ApplicationDeclaration" }, "fee": { - "$ref": "#/definitions/ApplicationFee" + "anyOf": [ + { + "$ref": "#/definitions/ApplicationFee" + }, + { + "$ref": "#/definitions/ApplicationFeeNotApplicable" + } + ] }, "preApp": { "$ref": "#/definitions/PreApplication" @@ -2250,6 +2272,21 @@ ], "type": "object" }, + "FeeExplanationNotApplicable": { + "$id": "#FeeExplanationNotApplicable", + "additionalProperties": false, + "description": "An indicator that an application fee does not apply to this application type or journey, therefore there is not an explanation of how it was calculated", + "properties": { + "notApplicable": { + "const": true, + "type": "boolean" + } + }, + "required": [ + "notApplicable" + ], + "type": "object" + }, "File": { "$id": "#File", "additionalProperties": false, @@ -4034,7 +4071,14 @@ "$ref": "#/definitions/ApplicationDeclaration" }, "fee": { - "$ref": "#/definitions/ApplicationFee" + "anyOf": [ + { + "$ref": "#/definitions/ApplicationFee" + }, + { + "$ref": "#/definitions/ApplicationFeeNotApplicable" + } + ] }, "leadDeveloper": { "$ref": "#/definitions/LeadDeveloper" @@ -5497,7 +5541,14 @@ "additionalProperties": false, "properties": { "fee": { - "$ref": "#/definitions/FeeExplanation" + "anyOf": [ + { + "$ref": "#/definitions/FeeExplanation" + }, + { + "$ref": "#/definitions/FeeExplanationNotApplicable" + } + ] }, "files": { "$ref": "#/definitions/RequestedFiles" diff --git a/types/schema/Metadata.ts b/types/schema/Metadata.ts index 2cbc165b..d8117faa 100644 --- a/types/schema/Metadata.ts +++ b/types/schema/Metadata.ts @@ -53,6 +53,14 @@ export interface CalculateMetadata { policyRefs?: QuestionMetaData['policyRefs']; } +/** + * @id #FeeExplanationNotApplicable + * @description An indicator that an application fee does not apply to this application type or journey, therefore there is not an explanation of how it was calculated + */ +export interface FeeExplanationNotApplicable { + notApplicable: true; +} + /** * @id #FeeExplanation * @description An explanation, including policy references, of the fees associated with this application @@ -99,6 +107,6 @@ export interface PlanXMetadata extends BaseMetadata { flowId: UUID; url: URL; files: RequestedFiles; - fee: FeeExplanation; + fee: FeeExplanation | FeeExplanationNotApplicable; }; } diff --git a/types/schema/data/Application.ts b/types/schema/data/Application.ts index b1e7b4d2..6072b10d 100644 --- a/types/schema/data/Application.ts +++ b/types/schema/data/Application.ts @@ -9,7 +9,7 @@ export type Application = BaseApplication | LondonApplication; export interface BaseApplication { type: ApplicationType; - fee: ApplicationFee; + fee: ApplicationFee | ApplicationFeeNotApplicable; declaration: ApplicationDeclaration; preApp?: PreApplication; CIL?: CommunityInfrastructureLevy; @@ -24,6 +24,14 @@ export interface LondonApplication extends BaseApplication { leadDeveloper?: LeadDeveloper; } +/** + * @id #ApplicationFeeNotApplicable + * @description An indicator that an application fee does not apply to this application type or journey + */ +export interface ApplicationFeeNotApplicable { + notApplicable: true; +} + /** * @id #ApplicationFee * @description The costs associated with this application