From c2187176891b2dac1ac1c3854882dbb9c8fe0bd7 Mon Sep 17 00:00:00 2001 From: tzarmango Date: Thu, 18 Oct 2018 14:13:44 +0100 Subject: [PATCH] RDM-3144 added CaseTypeLite object for cyclic dependency resolution --- package.json | 2 +- src/shared/domain/definition/case-type-lite.model.ts | 12 ++++++++++++ src/shared/domain/definition/jurisdiction.model.ts | 4 ++-- 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 src/shared/domain/definition/case-type-lite.model.ts diff --git a/package.json b/package.json index 7cf2a7ab93..c3618a6b9d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hmcts/ccd-case-ui-toolkit", - "version": "1.2.16", + "version": "1.2.17", "description": "Case UI Toolkit", "main": "./dist/index.umd.js", "module": "./dist/index.js", diff --git a/src/shared/domain/definition/case-type-lite.model.ts b/src/shared/domain/definition/case-type-lite.model.ts new file mode 100644 index 0000000000..cd4b8a9f0b --- /dev/null +++ b/src/shared/domain/definition/case-type-lite.model.ts @@ -0,0 +1,12 @@ +import { CaseEvent } from './case-event.model'; +import { CaseState } from './case-state.model'; + +// Light clone of CaseType to be used in Jurisdiction class +// to avoid cyclic dependency +export class CaseTypeLite { + id: string; + name: string; + events: CaseEvent[]; + states: CaseState[]; + description: string; +} diff --git a/src/shared/domain/definition/jurisdiction.model.ts b/src/shared/domain/definition/jurisdiction.model.ts index 76111cccf9..20f1fbddc5 100644 --- a/src/shared/domain/definition/jurisdiction.model.ts +++ b/src/shared/domain/definition/jurisdiction.model.ts @@ -1,8 +1,8 @@ -import { CaseType } from './case-type.model'; +import { CaseTypeLite } from './case-type-lite.model'; export class Jurisdiction { id: string; name: string; description: string; - caseTypes: CaseType[]; + caseTypes: CaseTypeLite[]; }