From cb4513d9e760afa7c17c5fd4c1a53b08ea9f3002 Mon Sep 17 00:00:00 2001 From: Sean Sundberg Date: Tue, 19 Sep 2023 20:20:56 -0500 Subject: [PATCH] Integrate backend services updates (#36) Signed-off-by: Sean Sundberg --- package-lock.json | 100 ++ package.json | 1 + src/atoms/kyc-case-management.atom.ts | 3 + src/atoms/menu-options.atom.ts | 7 + src/components/AtomSelect/AtomSelect.tsx | 74 ++ src/components/AtomSelect/index.ts | 1 + .../CountrySelect/CountrySelect.tsx | 28 +- src/components/DocumentList/DocumentList.tsx | 7 +- .../EntityTypeSelect/EntityTypeSelect.tsx | 28 + src/components/EntityTypeSelect/index.ts | 1 + .../IndustryTypeSelect/IndustryTypeSelect.tsx | 28 + src/components/IndustryTypeSelect/index.ts | 1 + src/components/index.ts | 5 +- src/models/kyc-case.model.ts | 76 +- src/services/file-upload/file-upload.api.ts | 5 + src/services/file-upload/file-upload.mock.ts | 18 + src/services/file-upload/file-upload.rest.ts | 22 + src/services/file-upload/index.ts | 13 + src/services/index.ts | 1 + .../kyc-case-management.api.ts | 14 +- .../kyc-case-management.graphql-hack.ts | 294 +---- .../kyc-case-management.graphql.ts | 232 +++- .../kyc-case-management.mock.ts | 67 +- src/services/menu-options/index.ts | 4 +- .../menu-options/menu-options.mock.ts | 1043 +++++++++++++++++ .../menu-options/menu-options.service.ts | 252 ---- src/services/schema.gql | 32 +- src/utils/collections.ts | 17 + src/utils/index.ts | 8 +- src/utils/load-document.ts | 16 + src/utils/stream-to-buffer.ts | 12 + src/utils/url-to-stream.ts | 9 + src/views/Dashboard/Dashboard.tsx | 7 +- .../KYCCaseDetail/KYCCaseNew/KYCCaseNew.tsx | 20 +- .../KYCCaseOutreach/KYCCaseOutreach.tsx | 36 +- .../KYCCasePending/KYCCasePending.tsx | 9 - .../KYCCaseReview/KYCCaseReview.tsx | 50 +- .../KYCCaseDetail/util/event-handler.util.ts | 30 + src/views/KYC/KYCCaseDetail/util/index.ts | 2 + src/views/KYC/KYCCaseList/KYCCaseList.tsx | 20 +- vite.config.ts | 6 +- 41 files changed, 1895 insertions(+), 704 deletions(-) create mode 100644 src/components/AtomSelect/AtomSelect.tsx create mode 100644 src/components/AtomSelect/index.ts create mode 100644 src/components/EntityTypeSelect/EntityTypeSelect.tsx create mode 100644 src/components/EntityTypeSelect/index.ts create mode 100644 src/components/IndustryTypeSelect/IndustryTypeSelect.tsx create mode 100644 src/components/IndustryTypeSelect/index.ts create mode 100644 src/services/file-upload/file-upload.api.ts create mode 100644 src/services/file-upload/file-upload.mock.ts create mode 100644 src/services/file-upload/file-upload.rest.ts create mode 100644 src/services/file-upload/index.ts create mode 100644 src/services/menu-options/menu-options.mock.ts delete mode 100644 src/services/menu-options/menu-options.service.ts create mode 100644 src/utils/collections.ts create mode 100644 src/utils/load-document.ts create mode 100644 src/utils/stream-to-buffer.ts create mode 100644 src/utils/url-to-stream.ts create mode 100644 src/views/KYC/KYCCaseDetail/util/event-handler.util.ts create mode 100644 src/views/KYC/KYCCaseDetail/util/index.ts diff --git a/package-lock.json b/package-lock.json index 15678a1..1415ff9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,6 +33,7 @@ "@typescript-eslint/eslint-plugin": "^6.7.0", "@typescript-eslint/parser": "^6.7.0", "@vitejs/plugin-react-swc": "^3.3.2", + "axios": "^1.5.0", "eslint": "^8.49.0", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.4.3", @@ -1392,6 +1393,23 @@ "node": ">=8" } }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true + }, + "node_modules/axios": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.0.tgz", + "integrity": "sha512-D4DdjDo5CY50Qms0qGQTTw6Q44jl7zRwY7bthds06pUGfChBCTcQs+N743eFWGEd6pRTMd6A+I87aWyFV5wiZQ==", + "dev": true, + "dependencies": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -1551,6 +1569,18 @@ "simple-swizzle": "^0.2.2" } }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/commander": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", @@ -2067,6 +2097,15 @@ "robust-predicates": "^3.0.0" } }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -2440,6 +2479,40 @@ "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", "dev": true }, + "node_modules/follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -2920,6 +2993,27 @@ "node": ">=8.6" } }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -3167,6 +3261,12 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true + }, "node_modules/punycode": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", diff --git a/package.json b/package.json index 788380d..2f51132 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "@typescript-eslint/eslint-plugin": "^6.7.0", "@typescript-eslint/parser": "^6.7.0", "@vitejs/plugin-react-swc": "^3.3.2", + "axios": "^1.5.0", "eslint": "^8.49.0", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.4.3", diff --git a/src/atoms/kyc-case-management.atom.ts b/src/atoms/kyc-case-management.atom.ts index ef89709..e35fca9 100644 --- a/src/atoms/kyc-case-management.atom.ts +++ b/src/atoms/kyc-case-management.atom.ts @@ -4,6 +4,9 @@ import {atomWithObservable, loadable} from "jotai/utils"; import {kycCaseManagementApi} from "../services"; import {KycCaseModel} from "../models"; +const kycCasesAtom = atom(() => kycCaseManagementApi().listCases()) +export const kycCasesLoadable = loadable(kycCasesAtom) + export const kycCaseAtom: Atom = atomWithObservable( () => kycCaseManagementApi().subscribeToCases(), {initialValue: []} diff --git a/src/atoms/menu-options.atom.ts b/src/atoms/menu-options.atom.ts index ae4c323..6d08166 100644 --- a/src/atoms/menu-options.atom.ts +++ b/src/atoms/menu-options.atom.ts @@ -4,3 +4,10 @@ import {loadable} from "jotai/utils"; export const countriesAtom = atom(async () => menuOptionsApi().getCountryList()) export const countriesAtomLoadable = loadable(countriesAtom); + + +export const entityTypesAtom = atom(async () => menuOptionsApi().getEntityTypes()) +export const entityTypesAtomLoadable = loadable(entityTypesAtom); + +export const industryTypesAtom = atom(async () => menuOptionsApi().getIndustries()) +export const industryTypesAtomLoadable = loadable(industryTypesAtom); diff --git a/src/components/AtomSelect/AtomSelect.tsx b/src/components/AtomSelect/AtomSelect.tsx new file mode 100644 index 0000000..d19be8d --- /dev/null +++ b/src/components/AtomSelect/AtomSelect.tsx @@ -0,0 +1,74 @@ +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore +import React, {ChangeEvent, CSSProperties} from 'react'; +import {Select, SelectItem} from "@carbon/react"; +import {Loadable} from "jotai/vanilla/utils/loadable"; + +import {FormOptionModel} from "../../models"; + +export interface AtomSelectProps { + id: string; + loadable: Loadable>; + value: string; + invalidText: string; + labelText: string; + required?: boolean; + readOnly?: boolean; + onChange?: (event: ChangeEvent) => void; + className?: string; + style?: CSSProperties; +} + +export interface SpecificAtomSelectProps { + id: string; + required?: boolean; + readOnly?: boolean; + value: string; + onChange?: (event: ChangeEvent) => void; + className?: string; + style?: CSSProperties; +} + +const loadFormItems = (loadable: Loadable>): FormOptionModel[] => { + const items: FormOptionModel[] = loadable.state === 'hasData' + ? loadable.data + : []; + + return items + .filter(item => item.value !== null) + .filter(item => item.text !== undefined) + .filter(item => item.value !== 'null') + .filter(item => item.text !== 'undefined') +} + +export const AtomSelect: React.FunctionComponent = (props: AtomSelectProps) => { + + const items: FormOptionModel[] = loadFormItems(props.loadable); + + const buildSelectItem = (option: FormOptionModel) => { + const key = `${props.id}-${option.value}`; + + if (option.value === null || option.value === 'null') { + console.log('Option: ', Object.assign({}, option, {key})); + } + + return () + } + + return ( + + ) +} diff --git a/src/components/AtomSelect/index.ts b/src/components/AtomSelect/index.ts new file mode 100644 index 0000000..68fa28b --- /dev/null +++ b/src/components/AtomSelect/index.ts @@ -0,0 +1 @@ +export * from './AtomSelect'; diff --git a/src/components/CountrySelect/CountrySelect.tsx b/src/components/CountrySelect/CountrySelect.tsx index 67f86fb..d41d168 100644 --- a/src/components/CountrySelect/CountrySelect.tsx +++ b/src/components/CountrySelect/CountrySelect.tsx @@ -1,41 +1,29 @@ // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore -import React, {ChangeEvent, CSSProperties} from 'react'; -import {Select, SelectItem} from "@carbon/react"; +import React from 'react'; import {useAtomValue} from "jotai"; +import {Loadable} from "jotai/vanilla/utils/loadable"; +import {AtomSelect, SpecificAtomSelectProps} from "../AtomSelect"; import {countriesAtomLoadable} from "../../atoms"; import {FormOptionModel} from "../../models"; -export interface CountrySelectProps { - id: string; - required?: boolean; - readOnly?: boolean; - value: string; - onChange?: (event: ChangeEvent) => void; - className?: string; - style?: CSSProperties; -} - -export const CountrySelect: React.FunctionComponent = (props: CountrySelectProps) => { - const countriesLoadable = useAtomValue(countriesAtomLoadable); - const countries: FormOptionModel[] = countriesLoadable.state === 'hasData' ? countriesLoadable.data : []; +export const CountrySelect: React.FunctionComponent = (props: SpecificAtomSelectProps) => { + const countriesLoadable: Loadable> = useAtomValue(countriesAtomLoadable); return ( - + loadable={countriesLoadable} + /> ) } diff --git a/src/components/DocumentList/DocumentList.tsx b/src/components/DocumentList/DocumentList.tsx index aec7d2f..727a104 100644 --- a/src/components/DocumentList/DocumentList.tsx +++ b/src/components/DocumentList/DocumentList.tsx @@ -8,11 +8,16 @@ import './DocumentList.scss'; import {DocumentModel} from "../../models"; export interface DocumentListProps { - documents: DocumentModel[] + hideEmpty?: boolean; + documents: DocumentModel[]; } export const DocumentList: React.FunctionComponent = (props: DocumentListProps) => { if (!props.documents || props.documents.length === 0) { + if (props.hideEmpty) { + return (<>) + } + return (
diff --git a/src/components/EntityTypeSelect/EntityTypeSelect.tsx b/src/components/EntityTypeSelect/EntityTypeSelect.tsx new file mode 100644 index 0000000..c58561e --- /dev/null +++ b/src/components/EntityTypeSelect/EntityTypeSelect.tsx @@ -0,0 +1,28 @@ +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore +import React from 'react'; +import {useAtomValue} from "jotai"; +import {Loadable} from "jotai/vanilla/utils/loadable"; + +import {AtomSelect, SpecificAtomSelectProps} from "../AtomSelect"; +import {entityTypesAtomLoadable} from "../../atoms"; +import {FormOptionModel} from "../../models"; + +export const EntityTypeSelect: React.FunctionComponent = (props: SpecificAtomSelectProps) => { + const loadable: Loadable> = useAtomValue(entityTypesAtomLoadable); + + return ( + + ) +} diff --git a/src/components/EntityTypeSelect/index.ts b/src/components/EntityTypeSelect/index.ts new file mode 100644 index 0000000..73a05b3 --- /dev/null +++ b/src/components/EntityTypeSelect/index.ts @@ -0,0 +1 @@ +export * from './EntityTypeSelect' diff --git a/src/components/IndustryTypeSelect/IndustryTypeSelect.tsx b/src/components/IndustryTypeSelect/IndustryTypeSelect.tsx new file mode 100644 index 0000000..fa8a4d8 --- /dev/null +++ b/src/components/IndustryTypeSelect/IndustryTypeSelect.tsx @@ -0,0 +1,28 @@ +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore +import React from 'react'; +import {useAtomValue} from "jotai"; +import {Loadable} from "jotai/vanilla/utils/loadable"; + +import {AtomSelect, SpecificAtomSelectProps} from "../AtomSelect"; +import {industryTypesAtomLoadable} from "../../atoms"; +import {FormOptionModel} from "../../models"; + +export const IndustryTypeSelect: React.FunctionComponent = (props: SpecificAtomSelectProps) => { + const loadable: Loadable> = useAtomValue(industryTypesAtomLoadable); + + return ( + + ) +} diff --git a/src/components/IndustryTypeSelect/index.ts b/src/components/IndustryTypeSelect/index.ts new file mode 100644 index 0000000..a65d281 --- /dev/null +++ b/src/components/IndustryTypeSelect/index.ts @@ -0,0 +1 @@ +export * from './IndustryTypeSelect'; diff --git a/src/components/index.ts b/src/components/index.ts index d9a34a6..d26fe69 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -6,5 +6,8 @@ export * from './DemoTile' export * from './DemoTileContainer' export * from './DataTable' export * from './DocumentList' -export * from './CountrySelect' export * from './Stack' +export * from './CountrySelect' +export * from './EntityTypeSelect' +export * from './IndustryTypeSelect' +export * from './AtomSelect' diff --git a/src/models/kyc-case.model.ts b/src/models/kyc-case.model.ts index acda3f7..acf6d07 100644 --- a/src/models/kyc-case.model.ts +++ b/src/models/kyc-case.model.ts @@ -1,3 +1,5 @@ +import * as Stream from "stream"; + export interface KycCaseModel { id: string; status: string; @@ -8,6 +10,7 @@ export interface KycCaseModel { negativeScreening?: NegativeScreeningModel; counterpartyNegativeScreening?: NegativeScreeningModel; customerRiskAssessment?: CustomerRiskAssessmentModel; + caseSummary?: KycCaseSummaryModel; } export interface PersonModel { @@ -17,21 +20,24 @@ export interface PersonModel { export interface CustomerModel extends PersonModel { personalIdentificationNumber: string; - riskCategory: string; + industryType: string; + entityType: string; } -export interface DocumentModel { +export interface DocumentModel extends DocumentInputModel { id: string; - name: string; - path: string; + content: Buffer; } export interface NegativeScreeningModel { result: string; + error?: string; } export interface CustomerRiskAssessmentModel { - result: string; + rating: string; + score: number; + error?: string; } export interface ReviewCaseModel { @@ -47,27 +53,56 @@ export interface ApproveCaseModel { documents: DocumentModel[]; } +export interface KycCaseSummaryModel { + summary: string; + error?: string; +} -export const createEmptyCase = (): KycCaseModel => { - return { - id: 'new', - customer: { - name: '', - countryOfResidence: 'US', - personalIdentificationNumber: '', - riskCategory: '' - }, - status: 'New', - documents: [], - } +export interface DocumentRef { + url: string; +} + +export const isDocumentRef = (val: unknown): val is DocumentRef => { + return !!val && !!(val as {url: string}).url; +} + +export interface DocumentContent { + content: Buffer; +} + +export const isDocumentContent = (val: unknown): val is DocumentContent => { + return !!val && !!(val as {content: unknown}).content; +} + +export interface DocumentStream { + stream: Stream; +} + +export const isDocumentStream = (val: unknown): val is DocumentStream => { + return !!val && !!(val as {stream: unknown}).stream; +} + +export interface DocumentInputModel { + name: string; + path: string; } export const createEmptyCustomer = (): CustomerModel => { return { name: '', countryOfResidence: 'US', - riskCategory: 'Low', personalIdentificationNumber: '', + industryType: '', + entityType: '', + } +} + +export const createEmptyCase = (): KycCaseModel => { + return { + id: 'new', + customer: createEmptyCustomer(), + status: 'New', + documents: [], } } @@ -79,7 +114,6 @@ export const createNewCase = (customer: CustomerModel): KycCaseModel => { documents: [], } } - export const createEmptyReviewCase = (id: string): ReviewCaseModel => { return { id, @@ -99,3 +133,7 @@ export const createEmptyApproveCase = (id: string): ApproveCaseModel => { documents: [] } } + +export interface DocumentedCase { + documents: DocumentModel[]; +} diff --git a/src/services/file-upload/file-upload.api.ts b/src/services/file-upload/file-upload.api.ts new file mode 100644 index 0000000..784d99c --- /dev/null +++ b/src/services/file-upload/file-upload.api.ts @@ -0,0 +1,5 @@ +import {DocumentModel} from "../../models"; + +export abstract class FileUploadApi { + abstract uploadFile(caseId: string, name: string, file: File): Promise; +} diff --git a/src/services/file-upload/file-upload.mock.ts b/src/services/file-upload/file-upload.mock.ts new file mode 100644 index 0000000..a97e19b --- /dev/null +++ b/src/services/file-upload/file-upload.mock.ts @@ -0,0 +1,18 @@ +import {FileUploadApi} from "./file-upload.api"; +import {kycCaseManagementApi, KycCaseManagementApi} from "../kyc-case-management"; +import {DocumentModel} from "../../models"; + +export class FileUploadMock implements FileUploadApi { + service: KycCaseManagementApi; + + constructor() { + this.service = kycCaseManagementApi(); + } + + async uploadFile(caseId: string, name: string): Promise { + + const content = Buffer.from('') + return this.service.addDocumentToCase(caseId, name, {content}) + } + +} diff --git a/src/services/file-upload/file-upload.rest.ts b/src/services/file-upload/file-upload.rest.ts new file mode 100644 index 0000000..fcc2c5b --- /dev/null +++ b/src/services/file-upload/file-upload.rest.ts @@ -0,0 +1,22 @@ +import axios from "axios"; + +import {FileUploadApi} from "./file-upload.api"; +import {DocumentModel} from "../../models"; + +export class FileUploadRest implements FileUploadApi { + uploadFile(caseId: string, name: string, file: File): Promise { + const url = '/api/document/upload' + + const form = new FormData(); + form.append('name', name); + form.append('parentId', caseId); + form.append('file', file); + + return axios + .post(url, form) + .then(response => { + return response.data; + }); + } + +} diff --git a/src/services/file-upload/index.ts b/src/services/file-upload/index.ts new file mode 100644 index 0000000..42e1163 --- /dev/null +++ b/src/services/file-upload/index.ts @@ -0,0 +1,13 @@ +import {FileUploadApi} from "./file-upload.api"; +import {FileUploadRest} from "./file-upload.rest"; + +export * from './file-upload.api' + +let _instance: FileUploadApi; +export const fileUploadApi = (): FileUploadApi => { + if (_instance) { + return _instance; + } + + return _instance = new FileUploadRest(); +} diff --git a/src/services/index.ts b/src/services/index.ts index 3683fa4..ddfd3d2 100644 --- a/src/services/index.ts +++ b/src/services/index.ts @@ -1,3 +1,4 @@ export * from './kyc-case-management'; export * from './menu-options'; export * from './data-extraction'; +export * from './file-upload'; diff --git a/src/services/kyc-case-management/kyc-case-management.api.ts b/src/services/kyc-case-management/kyc-case-management.api.ts index c608333..41e179c 100644 --- a/src/services/kyc-case-management/kyc-case-management.api.ts +++ b/src/services/kyc-case-management/kyc-case-management.api.ts @@ -1,14 +1,24 @@ import {Observable} from "rxjs"; -import {ApproveCaseModel, CustomerModel, KycCaseModel, ReviewCaseModel} from "../../models"; +import { + ApproveCaseModel, + CustomerModel, DocumentContent, + DocumentModel, + DocumentRef, DocumentStream, + KycCaseModel, + ReviewCaseModel +} from "../../models"; export abstract class KycCaseManagementApi { + abstract reload(): Promise; abstract listCases(): Promise; abstract subscribeToCases(skipQuery?: boolean): Observable; abstract getCase(id: string): Promise; abstract createCase(customer: CustomerModel): Promise; - abstract addDocumentToCase(id: string, documentName: string, documentPath: string): Promise; + abstract getDocument(id: string): Promise; + abstract addDocumentToCase(id: string, documentName: string, document: DocumentRef | DocumentStream | DocumentContent): Promise; + abstract removeDocumentFromCase(id: string, documentId: string): Promise; abstract reviewCase(input: ReviewCaseModel): Promise; abstract approveCase(input: ApproveCaseModel): Promise; } diff --git a/src/services/kyc-case-management/kyc-case-management.graphql-hack.ts b/src/services/kyc-case-management/kyc-case-management.graphql-hack.ts index 3850f14..ea82ad5 100644 --- a/src/services/kyc-case-management/kyc-case-management.graphql-hack.ts +++ b/src/services/kyc-case-management/kyc-case-management.graphql-hack.ts @@ -1,222 +1,21 @@ -import {ApolloClient, FetchResult, gql} from "@apollo/client"; -import {BehaviorSubject, Observable} from "rxjs"; +import {Observable} from "rxjs"; import {KycCaseManagementApi} from "./kyc-case-management.api"; -import {getApolloClient} from "../../backends"; -import {ApproveCaseModel, CustomerModel, KycCaseModel, ReviewCaseModel} from "../../models"; +import {KycCaseManagementGraphql} from "./kyc-case-management.graphql"; +import {KycCaseModel} from "../../models"; -const LIST_CASES = gql` - query ListCases { - listCases { - id - status - customer { - name - countryOfResidence - riskCategory - } - documents { - id - name - path - } - customerOutreach - counterparty { - name - countryOfResidence - } - negativeScreening { - result - } - counterpartyNegativeScreening { - result - } - customerRiskAssessment { - result - } - } - } -` -const GET_CASE = gql` - query GetCase($caseId:ID!) { - getCase(id:$caseId) { - id - status - customer { - name - countryOfResidence - riskCategory - } - documents { - id - name - path - } - customerOutreach - counterparty { - name - countryOfResidence - } - negativeScreening { - result - } - counterpartyNegativeScreening { - result - } - customerRiskAssessment { - result - } - } - } -` -const CREATE_CASE = gql` - mutation CreateCase($customer:CustomerInput!) { - createCase(customer:$customer) { - id - status - customer { - name - countryOfResidence - riskCategory - } - documents { - id - name - path - } - customerOutreach - counterparty { - name - countryOfResidence - } - negativeScreening { - result - } - counterpartyNegativeScreening { - result - } - customerRiskAssessment { - result - } - } - } -` -const ADD_DOCUMENT_TO_CASE = gql` - mutation AddDocumentToCase($caseId:ID!,$documentName:String!,$documentPath:String!) { - addDocumentToCase(caseId:$caseId,documentName:$documentName,documentPath:$documentPath) { - id - status - customer { - name - countryOfResidence - riskCategory - } - documents { - id - name - path - } - customerOutreach - counterparty { - name - countryOfResidence - } - negativeScreening { - result - } - counterpartyNegativeScreening { - result - } - customerRiskAssessment { - result - } - } - } -` -const APPROVE_CASE = gql` - mutation ApproveCase($approveCase: ApproveCaseInput!) { - approveCase(case: $approveCase) { - id - status - customer { - name - countryOfResidence - riskCategory - } - documents { - id - name - path - } - customerOutreach - counterparty { - name - countryOfResidence - } - negativeScreening { - result - } - counterpartyNegativeScreening { - result - } - customerRiskAssessment { - result - } - } - } -` -const REVIEW_CASE = gql` - mutation ReviewCase($reviewCase: ReviewCaseInput!) { - reviewCase(case: $reviewCase) { - id - status - customer { - name - countryOfResidence - riskCategory - } - documents { - id - name - path - } - customerOutreach - counterparty { - name - countryOfResidence - } - negativeScreening { - result - } - counterpartyNegativeScreening { - result - } - customerRiskAssessment { - result - } - } - } -` - -export class KycCaseManagementGraphqlHack implements KycCaseManagementApi { - client: ApolloClient; - subject: BehaviorSubject +export class KycCaseManagementGraphqlHack extends KycCaseManagementGraphql implements KycCaseManagementApi { constructor() { - this.client = getApolloClient(); - this.subject = new BehaviorSubject([]) - } + super(); + + this.caseNotifySubject.subscribe({ + next: async () => { + const cases = await this.listCases(); - listCases(): Promise { - return this.client - .query<{listCases: KycCaseModel[]}>({ - query: LIST_CASES, - }) - .then(result => result.data.listCases) - .catch(err => { - console.log('Error querying cases: ', err) - throw err - }) as Promise + this.subject.next(cases); + } + }) } subscribeToCases(skipQuery: boolean = false): Observable { @@ -229,73 +28,10 @@ export class KycCaseManagementGraphqlHack implements KycCaseManagementApi { return this.subject; } - async createCase(customer: CustomerModel): Promise { - return this.client - .mutate<{createCase: KycCaseModel}>({ - mutation: CREATE_CASE, - variables: {customer}, - refetchQueries: [{query: LIST_CASES}], - awaitRefetchQueries: true - }) - .then(async (result: FetchResult<{createCase: KycCaseModel}>) => { - this.subscribeToCases(); - - return result.data?.createCase - }) as Promise - } - - addDocumentToCase(caseId: string, documentName: string, documentPath: string): Promise { - return this.client - .mutate<{addDocumentToCase: KycCaseModel}>({ - mutation: ADD_DOCUMENT_TO_CASE, - variables: {caseId, documentName, documentPath}, - refetchQueries: [{query: LIST_CASES}], - awaitRefetchQueries: true - }) - .then(async (result: FetchResult<{addDocumentToCase: KycCaseModel}>) => await result.data?.addDocumentToCase) as Promise - } - - approveCase(input: ApproveCaseModel): Promise { - return this.client - .mutate<{approveCase: KycCaseModel}>({ - mutation: APPROVE_CASE, - variables: {'case': input}, - refetchQueries: [{query: LIST_CASES}, {query: GET_CASE, variables: {caseId: input.id}}], - awaitRefetchQueries: true - }) - .then(async (result: FetchResult<{approveCase: KycCaseModel}>) => { - this.subscribeToCases(); - - return result.data?.approveCase - }) as Promise - } - - reviewCase(input: ReviewCaseModel): Promise { - return this.client - .mutate<{reviewCase: KycCaseModel}>({ - mutation: REVIEW_CASE, - variables: {'case': input}, - refetchQueries: [{query: LIST_CASES}, {query: GET_CASE, variables: {caseId: input.id}}], - awaitRefetchQueries: true - }) - .then(async (result: FetchResult<{reviewCase: KycCaseModel}>) => { - this.subscribeToCases(); - - return result.data?.reviewCase - }) as Promise - } + async reload(): Promise { + await this.client.resetStore(); - getCase(caseId: string): Promise { - return this.client - .query<{getCase: KycCaseModel}>({ - query: GET_CASE, - variables: {caseId}, - }) - .then(result => result.data.getCase) - .catch(err => { - console.log('Error getting case: ' + caseId, err) - throw err - }) as Promise + this.caseNotifySubject.next(''); } } \ No newline at end of file diff --git a/src/services/kyc-case-management/kyc-case-management.graphql.ts b/src/services/kyc-case-management/kyc-case-management.graphql.ts index bbd47ba..ebb8a01 100644 --- a/src/services/kyc-case-management/kyc-case-management.graphql.ts +++ b/src/services/kyc-case-management/kyc-case-management.graphql.ts @@ -1,9 +1,16 @@ import {ApolloClient, FetchResult, gql} from "@apollo/client"; -import {BehaviorSubject, Observable} from "rxjs"; +import {BehaviorSubject, Observable, Subject} from "rxjs"; import {KycCaseManagementApi} from "./kyc-case-management.api"; import {getApolloClient} from "../../backends"; -import {ApproveCaseModel, CustomerModel, KycCaseModel, ReviewCaseModel} from "../../models"; +import { + ApproveCaseModel, + CustomerModel, + DocumentModel, + DocumentRef, + KycCaseModel, + ReviewCaseModel +} from "../../models"; const LIST_CASES = gql` query ListCases { @@ -13,7 +20,8 @@ const LIST_CASES = gql` customer { name countryOfResidence - riskCategory + entityType + industryType } documents { id @@ -27,12 +35,20 @@ const LIST_CASES = gql` } negativeScreening { result + error } counterpartyNegativeScreening { result + error } customerRiskAssessment { - result + score + rating + error + } + caseSummary { + summary + error } } } @@ -45,7 +61,8 @@ const CASES_SUBSCRIPTION = gql` customer { name countryOfResidence - riskCategory + entityType + industryType } documents { id @@ -59,12 +76,20 @@ const CASES_SUBSCRIPTION = gql` } negativeScreening { result + error } counterpartyNegativeScreening { result + error } customerRiskAssessment { - result + score + rating + error + } + caseSummary { + summary + error } } } @@ -77,7 +102,8 @@ const GET_CASE = gql` customer { name countryOfResidence - riskCategory + entityType + industryType } documents { id @@ -91,12 +117,20 @@ const GET_CASE = gql` } negativeScreening { result + error } counterpartyNegativeScreening { result + error } customerRiskAssessment { - result + score + rating + error + } + caseSummary { + summary + error } } } @@ -109,7 +143,8 @@ const CREATE_CASE = gql` customer { name countryOfResidence - riskCategory + entityType + industryType } documents { id @@ -123,25 +158,34 @@ const CREATE_CASE = gql` } negativeScreening { result + error } counterpartyNegativeScreening { result + error } customerRiskAssessment { - result + score + rating + error + } + caseSummary { + summary + error } } } ` const ADD_DOCUMENT_TO_CASE = gql` - mutation AddDocumentToCase($caseId:ID!,$documentName:String!,$documentPath:String!) { - addDocumentToCase(caseId:$caseId,documentName:$documentName,documentPath:$documentPath) { + mutation AddDocumentToCase($caseId:ID!,$documentName:String!,$documentUrl:String!) { + addDocumentToCase(caseId:$caseId,documentName:$documentName,documentUrl:$documentUrl) { id status customer { name countryOfResidence - riskCategory + entityType + industryType } documents { id @@ -155,25 +199,34 @@ const ADD_DOCUMENT_TO_CASE = gql` } negativeScreening { result + error } counterpartyNegativeScreening { result + error } customerRiskAssessment { - result + score + rating + error + } + caseSummary { + summary + error } } } ` const APPROVE_CASE = gql` - mutation ApproveCase($approveCase: ApproveCaseInput!) { - approveCase(case: $approveCase) { + mutation ApproveCase($case: ApproveCaseInput!) { + approveCase(case: $case) { id status customer { name countryOfResidence - riskCategory + entityType + industryType } documents { id @@ -187,25 +240,34 @@ const APPROVE_CASE = gql` } negativeScreening { result + error } counterpartyNegativeScreening { result + error } customerRiskAssessment { - result + score + rating + error + } + caseSummary { + summary + error } } } ` const REVIEW_CASE = gql` - mutation ReviewCase($reviewCase: ReviewCaseInput!) { - reviewCase(case: $reviewCase) { + mutation ReviewCase($case: ReviewCaseInput!) { + reviewCase(case: $case) { id status customer { name countryOfResidence - riskCategory + entityType + industryType } documents { id @@ -219,12 +281,71 @@ const REVIEW_CASE = gql` } negativeScreening { result + error } counterpartyNegativeScreening { result + error } customerRiskAssessment { + score + rating + error + } + caseSummary { + summary + error + } + } + } +` +const GET_DOCUMENT = gql` + query GetDocument($id:ID!) { + getDocument(id:$id) { + id + path + name + } + } +` + +const REMOVE_DOCUMENT_FROM_CASE = gql` + mutation RemoveDocumentFromCase($caseId: ID!, $documentId: ID!) { + removeDocumentFromCase(caseId: $caseId, documentId: $documentId) { + id + status + customer { + name + countryOfResidence + entityType + industryType + } + documents { + id + name + path + } + customerOutreach + counterparty { + name + countryOfResidence + } + negativeScreening { result + error + } + counterpartyNegativeScreening { + result + error + } + customerRiskAssessment { + score + rating + error + } + caseSummary { + summary + error } } } @@ -233,10 +354,12 @@ const REVIEW_CASE = gql` export class KycCaseManagementGraphql implements KycCaseManagementApi { client: ApolloClient; subject: BehaviorSubject + caseNotifySubject: Subject; constructor() { this.client = getApolloClient(); this.subject = new BehaviorSubject([]) + this.caseNotifySubject = new Subject(); } listCases(): Promise { @@ -244,7 +367,11 @@ export class KycCaseManagementGraphql implements KycCaseManagementApi { .query<{listCases: KycCaseModel[]}>({ query: LIST_CASES, }) - .then(result => result.data.listCases) + .then(result => { + console.log('Cases returned: ', {cases: result.data.listCases}); + + return result.data.listCases; + }) .catch(err => { console.log('Error querying cases: ', err) throw err @@ -289,18 +416,26 @@ export class KycCaseManagementGraphql implements KycCaseManagementApi { refetchQueries: [{query: LIST_CASES}], awaitRefetchQueries: true }) - .then(async (result: FetchResult<{createCase: KycCaseModel}>) => await result.data?.createCase) as Promise + .then(async (result: FetchResult<{createCase: KycCaseModel}>) => { + this.caseNotifySubject.next(result.data?.createCase.id || ''); + + return result.data?.createCase + }) as Promise } - addDocumentToCase(caseId: string, documentName: string, documentPath: string): Promise { + addDocumentToCase(caseId: string, documentName: string, document: DocumentRef): Promise { return this.client - .mutate<{addDocumentToCase: KycCaseModel}>({ + .mutate<{addDocumentToCase: DocumentModel}>({ mutation: ADD_DOCUMENT_TO_CASE, - variables: {caseId, documentName, documentPath}, + variables: {caseId, documentName, document}, refetchQueries: [{query: LIST_CASES}], awaitRefetchQueries: true }) - .then(async (result: FetchResult<{addDocumentToCase: KycCaseModel}>) => await result.data?.addDocumentToCase) as Promise + .then(async (result: FetchResult<{addDocumentToCase: DocumentModel}>) => { + this.caseNotifySubject.next(caseId); + + return result.data?.addDocumentToCase + }) as Promise } approveCase(input: ApproveCaseModel): Promise { @@ -311,7 +446,11 @@ export class KycCaseManagementGraphql implements KycCaseManagementApi { refetchQueries: [{query: LIST_CASES}, {query: GET_CASE, variables: {caseId: input.id}}], awaitRefetchQueries: true }) - .then(async (result: FetchResult<{approveCase: KycCaseModel}>) => await result.data?.approveCase) as Promise + .then(async (result: FetchResult<{approveCase: KycCaseModel}>) => { + this.caseNotifySubject.next(result.data?.approveCase.id || ''); + + return result.data?.approveCase + }) as Promise } reviewCase(input: ReviewCaseModel): Promise { @@ -322,7 +461,11 @@ export class KycCaseManagementGraphql implements KycCaseManagementApi { refetchQueries: [{query: LIST_CASES}, {query: GET_CASE, variables: {caseId: input.id}}], awaitRefetchQueries: true }) - .then(async (result: FetchResult<{reviewCase: KycCaseModel}>) => await result.data?.reviewCase) as Promise + .then(async (result: FetchResult<{reviewCase: KycCaseModel}>) => { + this.caseNotifySubject.next(result.data?.reviewCase.id || ''); + + return result.data?.reviewCase + }) as Promise } getCase(caseId: string): Promise { @@ -338,4 +481,35 @@ export class KycCaseManagementGraphql implements KycCaseManagementApi { }) as Promise } + getDocument(id: string): Promise { + return this.client + .query<{getDocument: DocumentModel}>({ + query: GET_DOCUMENT, + variables: {id}, + }) + .then(result => result.data.getDocument) + .catch(err => { + console.log('Error getting case: ' + id, err) + throw err + }) as Promise + } + + removeDocumentFromCase(caseId: string, documentId: string): Promise { + return this.client + .mutate<{removeDocumentFromCase: KycCaseModel}>({ + mutation: REMOVE_DOCUMENT_FROM_CASE, + variables: {caseId, documentId}, + refetchQueries: [{query: LIST_CASES}, {query: GET_CASE, variables: {caseId}}], + awaitRefetchQueries: true + }) + .then(async (result: FetchResult<{removeDocumentFromCase: KycCaseModel}>) => { + this.caseNotifySubject.next(result.data?.removeDocumentFromCase.id || ''); + + return result.data?.removeDocumentFromCase + }) as Promise + } + + async reload(): Promise { + } + } \ No newline at end of file diff --git a/src/services/kyc-case-management/kyc-case-management.mock.ts b/src/services/kyc-case-management/kyc-case-management.mock.ts index 3e71c82..f6363ab 100644 --- a/src/services/kyc-case-management/kyc-case-management.mock.ts +++ b/src/services/kyc-case-management/kyc-case-management.mock.ts @@ -1,8 +1,16 @@ import {BehaviorSubject, Observable} from "rxjs"; import {CaseNotFound, KycCaseManagementApi} from "./kyc-case-management.api"; -import {ApproveCaseModel, createNewCase, CustomerModel, KycCaseModel, ReviewCaseModel} from "../../models"; -import {delay, first} from "../../utils"; +import { + ApproveCaseModel, + createNewCase, + CustomerModel, DocumentContent, + DocumentModel, DocumentRef, DocumentStream, isDocumentContent, isDocumentRef, + KycCaseModel, + ReviewCaseModel +} from "../../models"; +import {delay, first, streamToBuffer, urlToStream} from "../../utils"; +import Stream from "stream"; const initialValue: KycCaseModel[] = [ { @@ -11,7 +19,8 @@ const initialValue: KycCaseModel[] = [ name: 'John Doe', countryOfResidence: 'US', personalIdentificationNumber: '123458690', - riskCategory: 'Low' + entityType: '02', + industryType: '92.00', }, status: 'New', documents: [], @@ -22,7 +31,8 @@ const initialValue: KycCaseModel[] = [ name: 'Jane Doe', countryOfResidence: 'CA', personalIdentificationNumber: 'AB1458690', - riskCategory: 'Low' + entityType: '03', + industryType: '10.82/2', }, status: 'New', documents: [], @@ -66,18 +76,33 @@ export class KycCaseManagementMock implements KycCaseManagementApi { return newCase; } - async addDocumentToCase(caseId: string, documentName: string, documentPath: string): Promise { + async addDocumentToCase(caseId: string, documentName: string, document: DocumentRef | DocumentContent | DocumentStream): Promise { const currentCase = await this.getCase(caseId); currentCase.status = 'Pending'; const id = '' + (currentCase.documents.length + 1); + const documentId = `${caseId}-${id}`; + const content = await this.loadDocument(document); - currentCase.documents.push({id: `${caseId}-${id}`, name: documentName, path: documentPath}); + const doc = {id: documentId, name: documentName, path: `${documentId}/${documentName}`, content: content} + currentCase.documents.push(doc); this.subject.next(this.subject.value); - return currentCase; + return doc; + } + + async loadDocument(document: DocumentRef | DocumentContent | DocumentStream): Promise { + if (isDocumentContent(document)) { + return document.content; + } + + const stream: Stream = isDocumentRef(document) + ? await urlToStream(document.url) + : document.stream; + + return streamToBuffer(stream); } async reviewCase(reviewCase: ReviewCaseModel): Promise { @@ -104,4 +129,32 @@ export class KycCaseManagementMock implements KycCaseManagementApi { return currentCase; } + + async getDocument(id: string): Promise { + const doc: DocumentModel = first( + this.subject.value + .map(kycCase => first(kycCase.documents.filter(tmp => tmp.id === id)).orElse(undefined)) + .filter(doc => !!doc) + ).orElseThrow(() => new Error('Document not found: ' + id)) + + if (!doc) { + throw new Error('Document not found: ' + id); + } + + return doc; + } + + async removeDocumentFromCase(caseId: string, documentId: string): Promise { + const currentCase = await this.getCase(caseId); + + currentCase.documents = currentCase.documents + .filter(doc => doc.id !== documentId) + + this.subject.next(this.subject.value); + + return currentCase; + } + + async reload() { + } } diff --git a/src/services/menu-options/index.ts b/src/services/menu-options/index.ts index 298ef21..ddb0572 100644 --- a/src/services/menu-options/index.ts +++ b/src/services/menu-options/index.ts @@ -1,5 +1,5 @@ -import {MenuOptionsService} from "./menu-options.service.ts"; +import {MenuOptionsMock} from "./menu-options.mock.ts"; export * from './menu-options.api'; -export const menuOptionsApi = () => new MenuOptionsService(); +export const menuOptionsApi = () => new MenuOptionsMock(); diff --git a/src/services/menu-options/menu-options.mock.ts b/src/services/menu-options/menu-options.mock.ts new file mode 100644 index 0000000..27719fc --- /dev/null +++ b/src/services/menu-options/menu-options.mock.ts @@ -0,0 +1,1043 @@ +import {MenuOptionsApi} from "./menu-options.api"; +import {FormOptionModel} from "../../models"; +import {parseCsv} from "../../utils"; + +const industryTypesCsv = `Code,Division,Industry ,Strategic Rating, +01.11,Growing of non-perennial crops,"Growing of cereals (except rice), leguminous crops and oil seeds",MEDIUM, +01.12,Growing of non-perennial crops,Growing of rice,LOW, +01.13,Growing of non-perennial crops,"Growing of vegetables and melons, roots and tubers",MEDIUM, +01.14,Growing of non-perennial crops,Growing of sugar cane,LOW, +01.15,Growing of non-perennial crops,Growing of tobacco,HIGH, +01.16,Growing of non-perennial crops,Growing of fibre crops,MEDIUM, +01.19,Growing of non-perennial crops,Growing of other non-perennial crops,MEDIUM, +01.21,Growing of perennial crops,Growing of grapes,MEDIUM, +01.22,Growing of perennial crops,Growing of tropical and subtropical fruits,LOW, +01.23,Growing of perennial crops,Growing of citrus fruits,LOW, +01.24,Growing of perennial crops,Growing of pome fruits and stone fruits,MEDIUM, +01.25,Growing of perennial crops,Growing of other tree and bush fruits and nuts,MEDIUM, +01.26,Growing of perennial crops,Growing of oleaginous fruits,LOW, +01.27,Growing of perennial crops,Growing of beverage crops,LOW, +24.41,Manufacture of basic metals,Precious metals production,HIGH, +01.29,Growing of perennial crops,Growing of other perennial crops,MEDIUM, +01.30,Plant propagation,Plant propagation,MEDIUM, +01.41,Animal production,Raising of dairy cattle,LOW, +01.42,Animal production,Raising of other cattle and buffaloes,LOW, +01.43,Animal production,Raising of horses and other equines,LOW, +01.44,Animal production,Raising of camels and camelids,LOW, +01.45,Animal production,Raising of sheep and goats,LOW, +01.46,Animal production,Raising of swine/pigs,LOW, +01.47,Animal production,Raising of poultry,LOW, +01.49,Animal production,Raising of other animals,MEDIUM, +01.50,Mixed Farming,Mixed farming,MEDIUM, +01.61,Support activities to agriculture and post-harvest crop activities,Support activities for crop production,MEDIUM, +01.63,Support activities to agriculture and post-harvest crop activities,Post-harvest crop activities,MEDIUM, +01.64,Support activities to agriculture and post-harvest crop activities,Seed processing for propagation,LOW, +01.70,"Hunting, trapping and related service activities","Hunting, trapping and related service activities",AUTO-HIGH, +02.10,Forestry and logging,Silviculture and other forestry activities,MEDIUM, +02.20,Forestry and logging,Logging,MEDIUM, +02.30,Forestry and logging,Gathering of wild growing non-wood products,MEDIUM, +02.40,Forestry and logging,Support services to forestry,MEDIUM, +03.11,Mining and Quarrying,Marine fishing,MEDIUM, +03.12,Mining and Quarrying,Freshwater fishing,MEDIUM, +03.21,Mining and Quarrying,Marine aquaculture,MEDIUM, +03.22,Mining and Quarrying,Freshwater aquaculture,MEDIUM, +26.52,"Manufacture of computer, electronic and optical products",Manufacture of watches and clocks,LOW, +32.12,Other manufacturing,Manufacture of jewellery and related articles,HIGH, +32.13,Other manufacturing,Manufacture of imitation jewellery and related articles,LOW, +46.35,"Wholesale trade, except of motor vehicles and motorcycles",Wholesale of tobacco products,HIGH, +47.26,"Retail trade, except of motor vehicles and motorcycles",Retail sale of tobacco products in specialised stores,HIGH, +88.10,Social work activities without accommodation,Social work activities without accommodation for the elderly and disabled,LOW, +46.71/1,"Wholesale trade, except of motor vehicles and motorcycles",Wholesale of petroleum and petroleum products,HIGH, +47.78/1,"Retail trade, except of motor vehicles and motorcycles",Retail sale in commercial art galleries,AUTO-HIGH, +47.79/1,"Retail trade, except of motor vehicles and motorcycles","Retail sale of antiques including antique books, in stores",AUTO-HIGH, +08.92,Other mining and quarrying,Extraction of peat,MEDIUM, +08.93,Other mining and quarrying,Extraction of salt,MEDIUM, +87.30,Residential care activities,Residential care activities for the elderly and disabled,HIGH, +05.20,Mining of coal and lignite,Mining of lignite,AUTO-HIGH, +06.10,Extraction of crude petroleum and natural gas,Extraction of crude petroleum,AUTO-HIGH, +10.11,Manufacture of food products,Processing and preserving of meat,MEDIUM, +10.12,Manufacture of food products,Processing and preserving of poultry meat,MEDIUM, +10.13,Manufacture of food products,Production of meat and poultry meat products,MEDIUM, +10.20,Manufacture of food products,"Processing and preserving of fish, crustaceans and molluscs",MEDIUM, +10.31,Manufacture of food products,Processing and preserving of potatoes,MEDIUM, +10.32,Manufacture of food products,Manufacture of fruit and vegetable juice,LOW, +10.39,Manufacture of food products,Other processing and preserving of fruit and vegetables,MEDIUM, +10.41,Manufacture of food products,Manufacture of oils and fats,LOW, +10.42,Manufacture of food products,Manufacture of margarine and similar edible fats,LOW, +10.52,Manufacture of food products,Manufacture of ice cream,LOW, +10.62,Manufacture of food products,Manufacture of starches and starch products,LOW, +10.71,Manufacture of food products,Manufacture of bread; manufacture of fresh pastry goods and cakes,LOW, +10.72,Manufacture of food products,Manufacture of rusks and biscuits; manufacture of preserved pastry goods and cakes,LOW, +10.73,Manufacture of food products,"Manufacture of macaroni, noodles, couscous and similar farinaceous products",MEDIUM, +10.81,Manufacture of food products,Manufacture of sugar,LOW, +10.84,Manufacture of food products,Manufacture of condiments and seasonings,LOW, +10.85,Manufacture of food products,Manufacture of prepared meals and dishes,MEDIUM, +10.86,Manufacture of food products,Manufacture of homogenised food preparations and dietetic food,MEDIUM, +10.89,Manufacture of food products,Manufacture of other food products n.e.c.,MEDIUM, +10.91,Manufacture of food products,Manufacture of prepared feeds for farm animals,MEDIUM, +10.92,Manufacture of food products,Manufacture of prepared pet foods,MEDIUM, +11.01,Manufacture of beverages,"Distilling, rectifying and blending of spirits",LOW, +11.02,Manufacture of beverages,Manufacture of wine from grape,LOW, +11.03,Manufacture of beverages,Manufacture of cider and other fruit wines,LOW, +11.04,Manufacture of beverages,Manufacture of other non-distilled fermented beverages,LOW, +11.05,Manufacture of beverages,Manufacture of beer,LOW, +11.06,Manufacture of beverages,Manufacture of malt,LOW, +11.07,Manufacture of beverages,Manufacture of soft drinks; production of mineral waters and other bottled waters,LOW, +12.00,Manufacture of tobacco products,Manufacture of tobacco products,HIGH, +13.10,Manufacture of textiles,Preparation and spinning of textile fibres,LOW, +13.20,Manufacture of textiles,Weaving of textiles,LOW, +13.30,Manufacture of textiles,Finishing of textiles,LOW, +13.91,Manufacture of textiles,Manufacture of knitted and crocheted fabrics,LOW, +13.94,Manufacture of textiles,"Manufacture of cordage, rope, twine and netting",LOW, +13.95,Manufacture of textiles,"Manufacture of non-wovens and articles made from non-wovens, except apparel",LOW, +13.96,Manufacture of textiles,Manufacture of other technical and industrial textiles,LOW, +13.99,Manufacture of textiles,Manufacture of other textiles n.e.c.,LOW, +14.11,Manufacture of wearing apparel,Manufacture of leather clothes,LOW, +14.12,Manufacture of wearing apparel,Manufacture of workwear,LOW, +14.19,Manufacture of wearing apparel,Manufacture of other wearing apparel and accessories,MEDIUM, +14.20,Manufacture of wearing apparel,Manufacture of articles of fur,MEDIUM, +14.31,Manufacture of wearing apparel,Manufacture of knitted and crocheted hosiery,LOW, +14.39,Manufacture of wearing apparel,Manufacture of other knitted and crocheted apparel,LOW, +15.11,Manufacture of leather and related products,Tanning and dressing of leather; dressing and dyeing of fur,MEDIUM, +15.12,Manufacture of leather and related products,"Manufacture of luggage, handbags and the like, saddlery and harness",LOW, +15.20,Manufacture of leather and related products,Manufacture of footwear,LOW, +16.10,"Manufacture of wood and of products of wood and cork, except furniture; manufacture of articles of straw and plaiting materials",Sawmilling and planing of wood,LOW, +16.21,"Manufacture of wood and of products of wood and cork, except furniture; manufacture of articles of straw and plaiting materials",Manufacture of veneer sheets and wood-based panels,LOW, +16.22,"Manufacture of wood and of products of wood and cork, except furniture; manufacture of articles of straw and plaiting materials",Manufacture of assembled parquet floors,LOW, +16.23,"Manufacture of wood and of products of wood and cork, except furniture; manufacture of articles of straw and plaiting materials",Manufacture of other builders' carpentry and joinery,LOW, +16.24,"Manufacture of wood and of products of wood and cork, except furniture; manufacture of articles of straw and plaiting materials",Manufacture of wooden containers,LOW, +16.29,"Manufacture of wood and of products of wood and cork, except furniture; manufacture of articles of straw and plaiting materials","Manufacture of other products of wood; manufacture of articles of cork, straw and plaiting materials",LOW, +17.11,Manufacture of paper and paper products,Manufacture of pulp,LOW, +17.12,Manufacture of paper and paper products,Manufacture of paper and paperboard,LOW, +17.22,Manufacture of paper and paper products,Manufacture of household and sanitary goods and of toilet requisites,LOW, +17.23,Manufacture of paper and paper products,Manufacture of paper stationery,LOW, +17.24,Manufacture of paper and paper products,Manufacture of wallpaper,LOW, +17.29,Manufacture of paper and paper products,Manufacture of other articles of paper and paperboard,LOW, +18.11,Printing and reproduction of recorded media,Printing of newspapers,LOW, +18.13,Printing and reproduction of recorded media,Pre-press and pre-media services,LOW, +18.14,Printing and reproduction of recorded media,Binding and related services,LOW, +19.10,Manufacture of coke and refined petroleum products,Manufacture of coke oven products,LOW, +20.11,Manufacture of chemicals and chemical products,Manufacture of industrial gases,AUTO-HIGH, +20.12,Manufacture of chemicals and chemical products,Manufacture of dyes and pigments,LOW, +06.20,Extraction of crude petroleum and natural gas,Extraction of natural gas,AUTO-HIGH, +20.14,Manufacture of chemicals and chemical products,Manufacture of other organic basic chemicals (Med),AUTO-HIGH, +20.15,Manufacture of chemicals and chemical products,Manufacture of fertilisers and nitrogen compounds,AUTO-HIGH, +20.16,Manufacture of chemicals and chemical products,Manufacture of plastics in primary forms,LOW, +20.17,Manufacture of chemicals and chemical products,Manufacture of synthetic rubber in primary forms,LOW, +87.90,Residential care activities,Other residential care activities,HIGH, +20.42,Manufacture of chemicals and chemical products,Manufacture of perfumes and toilet preparations,LOW, +07.10,Mining of metal ores,Mining of iron ores,AUTO-HIGH, +20.52,Manufacture of chemicals and chemical products,Manufacture of glues,LOW, +20.53,Manufacture of chemicals and chemical products,Manufacture of essential oils,LOW, +20.59,Manufacture of chemicals and chemical products,Manufacture of other chemical products n.e.c.,AUTO-HIGH, +20.60,Manufacture of chemicals and chemical products,Manufacture of man-made fibres,LOW, +21.10,Manufacture of basic pharmaceutical products and pharmaceutical preparations,Manufacture of basic pharmaceutical products,AUTO-HIGH, +07.21,Mining of metal ores,Mining of uranium and thorium ores,AUTO-HIGH, +22.11,Manufacture of rubber and plastic products,Manufacture of rubber tyres and tubes; retreading and rebuilding of rubber tyres,LOW, +22.19,Manufacture of rubber and plastic products,Manufacture of other rubber products,LOW, +22.21,Manufacture of rubber and plastic products,"Manufacture of plastic plates, sheets, tubes and profiles",LOW, +22.22,Manufacture of rubber and plastic products,Manufacture of plastic packing goods,LOW, +22.23,Manufacture of rubber and plastic products,Manufacture of builders' ware of plastic,LOW, +22.29,Manufacture of rubber and plastic products,Manufacture of other plastic products,LOW, +23.11,Manufacture of other non-metallic mineral products,Manufacture of flat glass,LOW, +23.12,Manufacture of other non-metallic mineral products,Shaping and processing of flat glass,LOW, +23.13,Manufacture of other non-metallic mineral products,Manufacture of hollow glass,LOW, +23.14,Manufacture of other non-metallic mineral products,Manufacture of glass fibres,LOW, +23.19,Manufacture of other non-metallic mineral products,"Manufacture and processing of other glass, including technical glassware",LOW, +23.20,Manufacture of other non-metallic mineral products,Manufacture of refractory products,LOW, +23.31,Manufacture of other non-metallic mineral products,Manufacture of ceramic tiles and flags,LOW, +23.32,Manufacture of other non-metallic mineral products,"Manufacture of bricks, tiles and construction products, in baked clay",LOW, +23.41,Manufacture of other non-metallic mineral products,Manufacture of ceramic household and ornamental articles,LOW, +23.42,Manufacture of other non-metallic mineral products,Manufacture of ceramic sanitary fixtures,LOW, +23.43,Manufacture of other non-metallic mineral products,Manufacture of ceramic insulators and insulating fittings,LOW, +23.44,Manufacture of other non-metallic mineral products,Manufacture of other technical ceramic products,LOW, +23.49,Manufacture of other non-metallic mineral products,Manufacture of other ceramic products,LOW, +23.51,Manufacture of other non-metallic mineral products,Manufacture of cement,LOW, +23.52,Manufacture of other non-metallic mineral products,Manufacture of lime and plaster,LOW, +23.61,Manufacture of other non-metallic mineral products,Manufacture of concrete products for construction purposes,LOW, +23.62,Manufacture of other non-metallic mineral products,Manufacture of plaster products for construction purposes,LOW, +23.63,Manufacture of other non-metallic mineral products,Manufacture of ready-mixed concrete,LOW, +23.64,Manufacture of other non-metallic mineral products,Manufacture of mortars,LOW, +23.65,Manufacture of other non-metallic mineral products,Manufacture of fibre cement,LOW, +23.69,Manufacture of other non-metallic mineral products,"Manufacture of other articles of concrete, plaster and cement",LOW, +23.70,Manufacture of other non-metallic mineral products,"Cutting, shaping and finishing of stone",LOW, +23.91,Manufacture of other non-metallic mineral products,Production of abrasive products,LOW, +23.99,Manufacture of other non-metallic mineral products,Manufacture of other non-metallic mineral products n.e.c.,LOW, +24.10,Manufacture of basic metals,Manufacture of basic iron and steel and of ferro-alloys,LOW, +24.20,Manufacture of basic metals,"Manufacture of tubes, pipes, hollow profiles and related fittings, of steel",LOW, +24.31,Manufacture of basic metals,Cold drawing of bars,LOW, +24.32,Manufacture of basic metals,Cold rolling of narrow strip,LOW, +24.33,Manufacture of basic metals,Cold forming or folding,LOW, +24.34,Manufacture of basic metals,Cold drawing of wire,LOW, +07.29,Mining of metal ores,Mining of other non-ferrous metal ores,AUTO-HIGH, +87.10,Residential care activities,Residential nursing care activities,HIGH, +24.43,Manufacture of basic metals,"Lead, zinc and tin production",LOW, +24.44,Manufacture of basic metals,Copper production,MEDIUM, +24.45,Manufacture of basic metals,Other non-ferrous metal production,LOW, +87.20,Residential care activities,"Residential care activities for learning disabilities, mental health and substance abuse",HIGH, +24.51,Manufacture of basic metals,Casting of iron,LOW, +24.52,Manufacture of basic metals,Casting of steel,LOW, +24.53,Manufacture of basic metals,Casting of light metals,LOW, +64.99/9,"Financial service activities, except insurance and pension funding","Other financial service activities, except insurance and pension funding, (not including security dealing on own account and factoring) n.e.c.",MEDIUM, +25.11,"Manufacture of fabricated metal products, except machinery and equipment",Manufacture of metal structures and parts of structures,LOW, +25.12,"Manufacture of fabricated metal products, except machinery and equipment",Manufacture of doors and windows of metal,LOW, +25.21,"Manufacture of fabricated metal products, except machinery and equipment",Manufacture of central heating radiators and boilers,LOW, +25.29,"Manufacture of fabricated metal products, except machinery and equipment","Manufacture of other tanks, reservoirs and containers of metal",LOW, +08.91,Other mining and quarrying,Mining of chemical and fertiliser minerals,AUTO-HIGH, +08.99,Other mining and quarrying,Other mining and quarrying n.e.c.,AUTO-HIGH, +25.50,"Manufacture of fabricated metal products, except machinery and equipment","Forging, pressing, stamping and roll-forming of metal; powder metallurgy",LOW, +25.61,"Manufacture of fabricated metal products, except machinery and equipment",Treatment and coating of metals,LOW, +64.19/1,"Financial service activities, except insurance and pension funding",Banks,LOW, +25.71,"Manufacture of fabricated metal products, except machinery and equipment",Manufacture of cutlery,LOW, +25.72,"Manufacture of fabricated metal products, except machinery and equipment",Manufacture of locks and hinges,LOW, +64.19,"Financial service activities, except insurance and pension funding",Credit Unions and other monetary institutions,HIGH, +25.91,"Manufacture of fabricated metal products, except machinery and equipment",Manufacture of steel drums and similar containers,LOW, +25.92,"Manufacture of fabricated metal products, except machinery and equipment",Manufacture of light metal packaging,LOW, +25.93,"Manufacture of fabricated metal products, except machinery and equipment","Manufacture of wire products, chain and springs",LOW, +25.94,"Manufacture of fabricated metal products, except machinery and equipment",Manufacture of fasteners and screw machine products,LOW, +25.99,"Manufacture of fabricated metal products, except machinery and equipment",Manufacture of other fabricated metal products n.e.c.,LOW, +09.10,Mining support service activities,Support activities for petroleum and natural gas extraction,AUTO-HIGH, +09.90,Mining support service activities,Support activities for other mining and quarrying,AUTO-HIGH, +20.13,Manufacture of chemicals and chemical products,Manufacture of other inorganic basic chemicals (Med),AUTO-HIGH, +26.40,"Manufacture of computer, electronic and optical products",Manufacture of consumer electronics,LOW, +20.51,Manufacture of chemicals and chemical products,Manufacture of explosives,AUTO-HIGH, +21.20,Manufacture of basic pharmaceutical products and pharmaceutical preparations,Manufacture of pharmaceutical preparations,AUTO-HIGH, +26.80,"Manufacture of computer, electronic and optical products",Manufacture of magnetic and optical media,MEDIUM, +27.11,Manufacture of electrical equipment,"Manufacture of electric motors, generators and transformers",LOW, +27.12,Manufacture of electrical equipment,Manufacture of electricity distribution and control apparatus,LOW, +27.20,Manufacture of electrical equipment,Manufacture of batteries and accumulators,LOW, +24.46,Manufacture of basic metals,Processing of nuclear fuel,AUTO-HIGH, +27.32,Manufacture of electrical equipment,Manufacture of other electronic and electric wires and cables,LOW, +64.11,"Financial service activities, except insurance and pension funding",Central banking,LOW, +27.40,Manufacture of electrical equipment,Manufacture of electric lighting equipment,LOW, +27.51,Manufacture of electrical equipment,Manufacture of electric domestic appliances,LOW, +27.52,Manufacture of electrical equipment,Manufacture of non-electric domestic appliances,LOW, +80.10,Security and investigation activities,Private security activities,HIGH, +25.40,"Manufacture of fabricated metal products, except machinery and equipment",Manufacture of weapons and ammunition,AUTO-HIGH, +28.12,Manufacture of machinery and equipment n.e.c.,Manufacture of fluid power equipment,MEDIUM, +28.14,Manufacture of machinery and equipment n.e.c.,Manufacture of other taps and valves,LOW, +51.22,Air transport,Space transport,HIGH, +28.21,Manufacture of machinery and equipment n.e.c.,"Manufacture of ovens, furnaces and furnace burners",LOW, +28.22,Manufacture of machinery and equipment n.e.c.,Manufacture of lifting and handling equipment,LOW, +28.23,Manufacture of machinery and equipment n.e.c.,Manufacture of office machinery and equipment (except computers and peripheral equipment),LOW, +28.24,Manufacture of machinery and equipment n.e.c.,Manufacture of power-driven hand tools,LOW, +28.25,Manufacture of machinery and equipment n.e.c.,Manufacture of non-domestic cooling and ventilation equipment,LOW, +28.29,Manufacture of machinery and equipment n.e.c.,Manufacture of other general-purpose machinery n.e.c.,MEDIUM, +28.41,Manufacture of machinery and equipment n.e.c.,Manufacture of metal forming machinery,LOW, +28.49,Manufacture of machinery and equipment n.e.c.,Manufacture of other machine tools,LOW, +28.91,Manufacture of machinery and equipment n.e.c.,Manufacture of machinery for metallurgy,LOW, +28.93,Manufacture of machinery and equipment n.e.c.,"Manufacture of machinery for food, beverage and tobacco processing",MEDIUM, +28.94,Manufacture of machinery and equipment n.e.c.,"Manufacture of machinery for textile, apparel and leather production",LOW, +28.95,Manufacture of machinery and equipment n.e.c.,Manufacture of machinery for paper and paperboard production,LOW, +28.96,Manufacture of machinery and equipment n.e.c.,Manufacture of plastics and rubber machinery,LOW, +47.73,"Retail trade, except of motor vehicles and motorcycles",Dispensing chemist in specialised stores,LOW, +29.10,"Manufacture of motor vehicles, trailers and semi-trailers",Manufacture of motor vehicles,LOW, +29.31,"Manufacture of motor vehicles, trailers and semi-trailers",Manufacture of electrical and electronic equipment for motor vehicles,HIGH, +29.32,"Manufacture of motor vehicles, trailers and semi-trailers",Manufacture of other parts and accessories for motor vehicles,MEDIUM, +46.76,"Wholesale trade, except of motor vehicles and motorcycles",Wholesale of other intermediate products,MEDIUM, +30.12,Manufacture of other transport equipment,Building of pleasure and sporting boats,LOW, +30.20,Manufacture of other transport equipment,Manufacture of railway locomotives and rolling stock,LOW, +66.12,Activities auxiliary to financial services and insurance activities,Security and commodity contracts brokerage,MEDIUM, +30.40,Manufacture of other transport equipment,Manufacture of military fighting vehicles,AUTO-HIGH, +30.91,Manufacture of other transport equipment,Manufacture of motorcycles,LOW, +30.92,Manufacture of other transport equipment,Manufacture of bicycles and invalid carriages,LOW, +30.99,Manufacture of other transport equipment,Manufacture of other transport equipment n.e.c.,LOW, +31.01,Manufacture of furniture,Manufacture of office and shop furniture,LOW, +31.02,Manufacture of furniture,Manufacture of kitchen furniture,LOW, +31.03,Manufacture of furniture,Manufacture of mattresses,LOW, +31.09,Manufacture of furniture,Manufacture of other furniture,LOW, +94.91,Activities of membership organisations,Activities of religious organisations,HIGH, +26.60,"Manufacture of computer, electronic and optical products",Manufacture of irradiation electromedical and electrotherapeutic equipment,AUTO-HIGH, +96.09,Other personal service activities,Other personal service activities n.e.c.,MEDIUM, +32.20,Other manufacturing,Manufacture of musical instruments,LOW, +32.30,Other manufacturing,Manufacture of sports goods,LOW, +32.50,Other manufacturing,Manufacture of medical and dental instruments and supplies,MEDIUM, +32.91,Other manufacturing,Manufacture of brooms and brushes,LOW, +32.99,Other manufacturing,Other manufacturing n.e.c.,MEDIUM, +33.11,Repair and installation of machinery and equipment,Repair of fabricated metal products,HIGH, +33.12,Repair and installation of machinery and equipment,Repair of machinery,LOW, +33.13,Repair and installation of machinery and equipment,Repair of electronic and optical equipment,MEDIUM, +33.14,Repair and installation of machinery and equipment,Repair of electrical equipment,MEDIUM, +01.28,Growing of perennial crops,Growing of spices aromatic drug and pharmaceutical crops,MEDIUM, +28.13/1,Manufacture of machinery and equipment n.e.c.,Manufacture of pumps,MEDIUM, +33.17,Repair and installation of machinery and equipment,Repair and maintenance of other transport equipment,LOW, +33.19,Repair and installation of machinery and equipment,Repair of other equipment,LOW, +33.20,Repair and installation of machinery and equipment,Installation of industrial machinery and equipment,LOW, +35.11,"Electricity, gas, steam and air conditioning supply",Production of electricity,LOW, +35.12,"Electricity, gas, steam and air conditioning supply",Transmission of electricity,MEDIUM, +35.13,"Electricity, gas, steam and air conditioning supply",Distribution of electricity,MEDIUM, +35.14,"Electricity, gas, steam and air conditioning supply",Trade of electricity,MEDIUM, +35.21,"Electricity, gas, steam and air conditioning supply",Manufacture of gas,AUTO-HIGH, +35.22,"Electricity, gas, steam and air conditioning supply",Distribution of gaseous fuels through mains,AUTO-HIGH, +35.23,"Electricity, gas, steam and air conditioning supply",Trade of gas through mains,AUTO-HIGH, +35.30,"Electricity, gas, steam and air conditioning supply",Steam and air conditioning supply,LOW, +36.00,"Water collection, treatment and supply","Water collection, treatment and supply",LOW, +37.00,Sewerage,Sewerage,LOW, +38.11,"Waste collection, treatment and disposal activities; materials recovery",Collection of non-hazardous waste,LOW, +38.12,"Waste collection, treatment and disposal activities; materials recovery",Collection of hazardous waste,AUTO-HIGH, +38.21,"Waste collection, treatment and disposal activities; materials recovery",Treatment and disposal of non-hazardous waste,LOW, +38.22,"Waste collection, treatment and disposal activities; materials recovery",Treatment and disposal of hazardous waste,AUTO-HIGH, +38.31,"Waste collection, treatment and disposal activities; materials recovery",Dismantling of wrecks,MEDIUM, +38.32,"Waste collection, treatment and disposal activities; materials recovery",Recovery of sorted materials,HIGH, +39.00,Remediation activities and other waste management services,Remediation activities and other waste management services,LOW, +41.10,Construction of buildings,Development of building projects,MEDIUM, +42.11,Civil engineering,Construction of roads and motorways,MEDIUM, +42.12,Civil engineering,Construction of railways and underground railways,MEDIUM, +42.13,Civil engineering,Construction of bridges and tunnels,MEDIUM, +42.21,Civil engineering,Construction of utility projects for fluids,MEDIUM, +42.22,Civil engineering,Construction of utility projects for electricity and telecommunications,MEDIUM, +42.91,Civil engineering,Construction of water projects,MEDIUM, +42.99,Civil engineering,Construction of other civil engineering projects n.e.c.,MEDIUM, +43.11,Specialised construction activities,Demolition,MEDIUM, +43.12,Specialised construction activities,Site preparation,MEDIUM, +43.13,Specialised construction activities,Test drilling and boring,MEDIUM, +43.21,Specialised construction activities,Electrical installation,LOW, +43.22,Specialised construction activities,"Plumbing, heat and air-conditioning installation",LOW, +43.29,Specialised construction activities,Other construction installation,MEDIUM, +43.31,Specialised construction activities,Plastering,MEDIUM, +43.32,Specialised construction activities,Joinery installation,LOW, +43.33,Specialised construction activities,Floor and wall covering,MEDIUM, +43.39,Specialised construction activities,Other building completion and finishing,MEDIUM, +43.91,Specialised construction activities,Roofing activities,LOW, +45.19,Wholesale and retail trade and repair of motor vehicles and motorcycles,Sale of other motor vehicles,HIGH, +45.20,Wholesale and retail trade and repair of motor vehicles and motorcycles,Maintenance and repair of motor vehicles,LOW, +45.31,Wholesale and retail trade and repair of motor vehicles and motorcycles,Wholesale trade of motor vehicle parts and accessories,MEDIUM, +45.32,Wholesale and retail trade and repair of motor vehicles and motorcycles,Retail trade of motor vehicle parts and accessories,MEDIUM, +45.40,Wholesale and retail trade and repair of motor vehicles and motorcycles,"Sale, maintenance and repair of motorcycles and related parts and accessories",MEDIUM, +46.11,"Wholesale trade, except of motor vehicles and motorcycles","Agents involved in the sale of agricultural raw materials, live animals, textile raw materials and semi-finished goods",LOW, +46.12,"Wholesale trade, except of motor vehicles and motorcycles","Agents involved in the sale of fuels, ores, metals and industrial chemicals",AUTO-HIGH, +46.13,"Wholesale trade, except of motor vehicles and motorcycles",Agents involved in the sale of timber and building materials,LOW, +27.31,Manufacture of electrical equipment,Manufacture of fibre optic cables,MEDIUM, +46.15,"Wholesale trade, except of motor vehicles and motorcycles","Agents involved in the sale of furniture, household goods, hardware and ironmongery",LOW, +46.16,"Wholesale trade, except of motor vehicles and motorcycles","Agents involved in the sale of textiles, clothing, fur, footwear and leather goods",HIGH, +46.17,"Wholesale trade, except of motor vehicles and motorcycles","Agents involved in the sale of food, beverages and tobacco",MEDIUM, +46.18,"Wholesale trade, except of motor vehicles and motorcycles",Agents specialised in the sale of other particular products,LOW, +46.19,"Wholesale trade, except of motor vehicles and motorcycles",Agents involved in the sale of a variety of goods,LOW, +46.21,"Wholesale trade, except of motor vehicles and motorcycles","Wholesale of grain, unmanufactured tobacco, seeds and animal feeds",MEDIUM, +46.22,"Wholesale trade, except of motor vehicles and motorcycles",Wholesale of flowers and plants,LOW, +46.23,"Wholesale trade, except of motor vehicles and motorcycles",Wholesale of live animals,HIGH, +46.24,"Wholesale trade, except of motor vehicles and motorcycles","Wholesale of hides, skins and leather",MEDIUM, +46.31,"Wholesale trade, except of motor vehicles and motorcycles",Wholesale of fruit and vegetables,LOW, +46.32,"Wholesale trade, except of motor vehicles and motorcycles",Wholesale of meat and meat products,LOW, +46.33,"Wholesale trade, except of motor vehicles and motorcycles","Wholesale of dairy products, eggs and edible oils and fats",LOW, +27.33,Manufacture of electrical equipment,Manufacture of wiring devices,AUTO-HIGH, +46.36,"Wholesale trade, except of motor vehicles and motorcycles",Wholesale of sugar and chocolate and sugar confectionery,LOW, +46.37,"Wholesale trade, except of motor vehicles and motorcycles","Wholesale of coffee, tea, cocoa and spices",LOW, +46.38,"Wholesale trade, except of motor vehicles and motorcycles","Wholesale of other food, including fish, crustaceans and molluscs",LOW, +46.39,"Wholesale trade, except of motor vehicles and motorcycles","Non-specialised wholesale of food, beverages and tobacco",MEDIUM, +46.41,"Wholesale trade, except of motor vehicles and motorcycles",Wholesale of textiles,LOW, +46.42,"Wholesale trade, except of motor vehicles and motorcycles",Wholesale of clothing and footwear,MEDIUM, +46.44,"Wholesale trade, except of motor vehicles and motorcycles",Wholesale of china and glassware and cleaning materials,LOW, +46.45,"Wholesale trade, except of motor vehicles and motorcycles",Wholesale of perfume and cosmetics,LOW, +46.51,"Wholesale trade, except of motor vehicles and motorcycles","Wholesale of computers, computer peripheral equipment and software",HIGH, +46.47,"Wholesale trade, except of motor vehicles and motorcycles","Wholesale of furniture, carpets and lighting equipment",LOW, +46.48,"Wholesale trade, except of motor vehicles and motorcycles",Wholesale of watches and jewellery,AUTO-HIGH, +47.76,"Retail trade, except of motor vehicles and motorcycles","Retail sale of flowers, plants, seeds, fertilisers, pet animals and pet food in specialised stores",HIGH, +46.52,"Wholesale trade, except of motor vehicles and motorcycles",Wholesale of electronic and telecommunications equipment and parts,HIGH, +46.61,"Wholesale trade, except of motor vehicles and motorcycles","Wholesale of agricultural machinery, equipment and supplies",LOW, +46.62,"Wholesale trade, except of motor vehicles and motorcycles",Wholesale of machine tools,LOW, +46.63,"Wholesale trade, except of motor vehicles and motorcycles","Wholesale of mining, construction and civil engineering machinery",LOW, +46.64,"Wholesale trade, except of motor vehicles and motorcycles",Wholesale of machinery for the textile industry and of sewing and knitting machines,LOW, +46.65,"Wholesale trade, except of motor vehicles and motorcycles",Wholesale of office furniture,LOW, +46.66,"Wholesale trade, except of motor vehicles and motorcycles",Wholesale of other office machinery and equipment,LOW, +46.69,"Wholesale trade, except of motor vehicles and motorcycles",Wholesale of other machinery and equipment,LOW, +26.30/1,"Manufacture of computer, electronic and optical products",Manufacture of telegraph and telephone apparatus and equipment,MEDIUM, +46.73,"Wholesale trade, except of motor vehicles and motorcycles","Wholesale of wood, construction materials and sanitary equipment",LOW, +46.74,"Wholesale trade, except of motor vehicles and motorcycles","Wholesale of hardware, plumbing and heating equipment and supplies",LOW, +47.42/9,"Retail trade, except of motor vehicles and motorcycles","Retail sale of telecommunications equipment (other than mobile telephones) n.e.c., in specialised stores",HIGH, +28.15,Manufacture of machinery and equipment n.e.c.,"Manufacture of bearings, gears, gearing and driving elements",AUTO-HIGH, +46.77,"Wholesale trade, except of motor vehicles and motorcycles",Wholesale of waste and scrap,HIGH, +46.90,"Wholesale trade, except of motor vehicles and motorcycles",Non-specialised wholesale trade,LOW, +47.11,"Retail trade, except of motor vehicles and motorcycles","Retail sale in non-specialised stores with food, beverages or tobacco predominating",MEDIUM, +47.19,"Retail trade, except of motor vehicles and motorcycles",Other retail sale in non-specialised stores,LOW, +47.21,"Retail trade, except of motor vehicles and motorcycles",Retail sale of fruit and vegetables in specialised stores,LOW, +47.22,"Retail trade, except of motor vehicles and motorcycles",Retail sale of meat and meat products in specialised stores,LOW, +47.23,"Retail trade, except of motor vehicles and motorcycles","Retail sale of fish, crustaceans and molluscs in specialised stores",LOW, +47.24,"Retail trade, except of motor vehicles and motorcycles","Retail sale of bread, cakes, flour confectionery and sugar confectionery in specialised stores",LOW, +47.25,"Retail trade, except of motor vehicles and motorcycles",Retail sale of beverages in specialised stores,MEDIUM, +47.78/9,"Retail trade, except of motor vehicles and motorcycles","Other retail sale of new goods in specialised stores (other than by opticians or commercial art galleries), n.e.c",MEDIUM, +47.29,"Retail trade, except of motor vehicles and motorcycles",Other retail sale of food in specialised stores,MEDIUM, +47.30,"Retail trade, except of motor vehicles and motorcycles",Retail sale of automotive fuel in specialised stores,LOW, +47.41,"Retail trade, except of motor vehicles and motorcycles","Retail sale of computers, peripheral units and software in specialised stores",MEDIUM, +47.43,"Retail trade, except of motor vehicles and motorcycles",Retail sale of audio and video equipment in specialised stores,MEDIUM, +47.51,"Retail trade, except of motor vehicles and motorcycles",Retail sale of textiles in specialised stores,LOW, +47.52,"Retail trade, except of motor vehicles and motorcycles","Retail sale of hardware, paints and glass in specialised stores",LOW, +47.53,"Retail trade, except of motor vehicles and motorcycles","Retail sale of carpets, rugs, wall and floor coverings in specialised stores",LOW, +47.54,"Retail trade, except of motor vehicles and motorcycles",Retail sale of electrical household appliances in specialised stores,LOW, +47.61,"Retail trade, except of motor vehicles and motorcycles",Retail sale of books in specialised stores,LOW, +47.62,"Retail trade, except of motor vehicles and motorcycles",Retail sale of newspapers and stationery in specialised stores,LOW, +47.63,"Retail trade, except of motor vehicles and motorcycles",Retail sale of music and video recordings in specialised stores,LOW, +47.64,"Retail trade, except of motor vehicles and motorcycles",Retail sale of sporting equipment in specialised stores,LOW, +47.65,"Retail trade, except of motor vehicles and motorcycles",Retail sale of games and toys in specialised stores,LOW, +47.71,"Retail trade, except of motor vehicles and motorcycles",Retail sale of clothing in specialised stores,MEDIUM, +32.11,Other manufacturing,Striking of coins,AUTO-HIGH, +47.75,"Retail trade, except of motor vehicles and motorcycles",Retail sale of cosmetic and toilet articles in specialised stores,LOW, +24.42,Manufacture of basic metals,Aluminium production,MEDIUM, +47.77,"Retail trade, except of motor vehicles and motorcycles",Retail sale of watches and jewellery in specialised stores,AUTO-HIGH, +47.81,"Retail trade, except of motor vehicles and motorcycles","Retail sale via stalls and markets of food, beverages and tobacco products",HIGH, +47.82,"Retail trade, except of motor vehicles and motorcycles","Retail sale via stalls and markets of textiles, clothing and footwear",LOW, +47.89,"Retail trade, except of motor vehicles and motorcycles",Retail sale via stalls and markets of other goods,LOW, +47.91,"Retail trade, except of motor vehicles and motorcycles",Retail sale via mail order houses or via Internet,MEDIUM, +47.99,"Retail trade, except of motor vehicles and motorcycles","Other retail sale not in stores, stalls or markets",MEDIUM, +49.10,Land transport and transport via pipelines,"Passenger rail transport, interurban",LOW, +49.20,Land transport and transport via pipelines,Freight rail transport,MEDIUM, +49.32,Land transport and transport via pipelines,Taxi operation,MEDIUM, +49.39,Land transport and transport via pipelines,Other passenger land transport n.e.c.,MEDIUM, +49.41,Land transport and transport via pipelines,Freight transport by road,MEDIUM, +49.42,Land transport and transport via pipelines,Removal services,LOW, +46.46,"Wholesale trade, except of motor vehicles and motorcycles",Wholesale of pharmaceutical goods,AUTO-HIGH, +50.10,Water transport,Sea and coastal passenger water transport,MEDIUM, +50.20,Water transport,Sea and coastal freight water transport,MEDIUM, +50.30,Water transport,Inland passenger water transport,MEDIUM, +50.40,Water transport,Inland freight water transport,MEDIUM, +51.21,Air transport,Freight air transport,MEDIUM, +33.15,Repair and installation of machinery and equipment,Repair and maintenance of ships and boats,MEDIUM, +52.22,Warehousing and support activities for transportation,Service activities incidental to water transportation,MEDIUM, +52.23,Warehousing and support activities for transportation,Service activities incidental to air transportation,MEDIUM, +52.29,Warehousing and support activities for transportation,Other transportation support activities,MEDIUM, +53.10,Postal and courier activities,Postal activities under universal service obligation,LOW, +55.10,Accommodation,Hotels and similar accommodation,MEDIUM, +55.30,Accommodation,"Camping grounds, recreational vehicle parks and trailer parks",LOW, +55.90,Accommodation,Other accommodation,MEDIUM, +56.21,Accommodation,Event catering activities,MEDIUM, +56.29,Accommodation,Other food service activities,MEDIUM, +58.11,Publishing activities,Book publishing,LOW, +58.12,Publishing activities,Publishing of directories and mailing lists,LOW, +58.13,Publishing activities,Publishing of newspapers,LOW, +58.19,Publishing activities,Other publishing activities,LOW, +58.21,Publishing activities,Publishing of computer games,LOW, +58.29,Publishing activities,Other software publishing,LOW, +59.12,"Motion picture, video and television programme production, sound recording and music publishing activites","Motion picture, video and television programme post-production activities",LOW, +59.14,"Motion picture, video and television programme production, sound recording and music publishing activites",Motion picture projection activities,LOW, +59.20,"Motion picture, video and television programme production, sound recording and music publishing activites",Sound recording and music publishing activities,LOW, +60.10,Programming and broadcasting activities,Radio broadcasting,LOW, +60.20,Programming and broadcasting activities,Television programming and broadcasting activities,LOW, +61.10,Telecommunications,Wired telecommunications activities,MEDIUM, +61.20,Telecommunications,Wireless telecommunications activities,MEDIUM, +61.30,Telecommunications,Satellite telecommunications activities,MEDIUM, +33.16,Repair and installation of machinery and equipment,Repair and maintenance of aircraft and spacecraft,HIGH, +62.02,"Computer programming, consultancy and related activities",Computer consultancy activities,LOW, +62.03,"Computer programming, consultancy and related activities",Computer facilities management activities,LOW, +62.09,"Computer programming, consultancy and related activities",Other information technology and computer service activities,LOW, +63.11,Information service activities,"Data processing, hosting and related activities",LOW, +63.12,Information service activities,Web portals,LOW, +63.91,Information service activities,News agencies activities of,LOW, +63.99,Information service activities,Other information service activities n.e.c.,LOW, +46.72,"Wholesale trade, except of motor vehicles and motorcycles",Wholesale of metals and metal ores,AUTO-HIGH, +25.62,"Manufacture of fabricated metal products, except machinery and equipment",Machining,MEDIUM, +64.91,"Financial service activities, except insurance and pension funding",Financial leasing,LOW, +65.11,"Insurance, reinsurance and pension funding, except compulsory social security",Life insurance,LOW, +65.12,"Insurance, reinsurance and pension funding, except compulsory social security",Non-life insurance,LOW, +65.30,"Insurance, reinsurance and pension funding, except compulsory social security",Pension funding,LOW, +66.11,Activities auxiliary to financial services and insurance activities,Administration of financial markets,LOW, +25.73,"Manufacture of fabricated metal products, except machinery and equipment",Manufacture of tools,MEDIUM, +66.19,Activities auxiliary to financial services and insurance activities,"Other activities auxiliary to financial services, except insurance and pension funding",MEDIUM, +66.21,Activities auxiliary to financial services and insurance activities,Risk and damage evaluation,LOW, +66.22,Activities auxiliary to financial services and insurance activities,Activities of insurance agents and brokers,LOW, +66.29,Activities auxiliary to financial services and insurance activities,Other activities auxiliary to insurance and pension funding,LOW, +66.30,Activities auxiliary to financial services and insurance activities,Fund management activities,MEDIUM, +68.10,Real estate activities,Buying and selling of own real estate,HIGH, +68.31,Real estate activities,Real estate agencies,HIGH, +68.32,Real estate activities,Management of real estate on a fee or contract basis,HIGH, +70.10,Activities of head offices; management consultancy activities,Activities of head offices,LOW, +70.21,Activities of head offices; management consultancy activities,Public relations and communication activities,LOW, +71.20,Architectural and engineering activities; technical testing and analysis,Technical testing and analysis,LOW, +72.11,Scientific research and development,Research and experimental development on biotechnology,MEDIUM, +72.19,Scientific research and development,Other research and experimental development on natural sciences and engineering,LOW, +72.20,Scientific research and development,Research and experimental development on social sciences and humanities,LOW, +73.11,Advertising and market research,Advertising agencies,LOW, +73.12,Advertising and market research,Media representation,LOW, +73.20,Advertising and market research,Market research and public opinion polling,LOW, +74.10,"Other professional, scientific and technical activities",Specialised design activities,LOW, +74.30,"Other professional, scientific and technical activities",Translation and interpretation activities,MEDIUM, +75.00,Veterinary activities,Veterinary activities,LOW, +77.11,Rental and leasing activities,Renting and leasing of cars and light motor vehicles,HIGH, +77.12,Rental and leasing activities,Renting and leasing of trucks,LOW, +77.21,Rental and leasing activities,Renting and leasing of recreational and sports goods,LOW, +77.22,Rental and leasing activities,Renting of video tapes and disks,LOW, +77.31,Rental and leasing activities,Renting and leasing of agricultural machinery and equipment,LOW, +77.32,Rental and leasing activities,Renting and leasing of construction and civil engineering machinery and equipment,LOW, +77.33,Rental and leasing activities,Renting and leasing of office machinery and equipment (including computers),LOW, +77.39,Rental and leasing activities,"Renting and leasing of other machinery, equipment and tangible goods n.e.c.",MEDIUM, +77.40,Rental and leasing activities,"Leasing of intellectual property and similar products, except copyrighted works",LOW, +78.20,Employment activities,Temporary employment agency activities,MEDIUM, +78.30,Employment activities,Other human resources provision,MEDIUM, +79.11,"Travel agency, tour operator and other reservation service and related activities",Travel agency activities,LOW, +79.12,"Travel agency, tour operator and other reservation service and related activities",Tour operator activities,LOW, +49.50,Land transport and transport via pipelines,Transport via pipeline,AUTO-HIGH, +80.20,Security and investigation activities,Security systems service activities,LOW, +80.30,Security and investigation activities,Investigation activities,LOW, +81.10,Services to buildings and landscape activities,Combined facilities support activities,LOW, +81.21,Services to buildings and landscape activities,General cleaning of buildings,MEDIUM, +81.30,Services to buildings and landscape activities,Landscape Service Activities,MEDIUM, +82.11,"Office administrative, office support and other business support activities",Combined office administrative service activities,LOW, +82.19,"Office administrative, office support and other business support activities","Photocopying, document preparation and other specialised office support activities",LOW, +82.20,"Office administrative, office support and other business support activities",Activities of call centres,LOW, +82.92,"Office administrative, office support and other business support activities",Packaging activities,MEDIUM, +82.99,"Office administrative, office support and other business support activities",Other business support service activities n.e.c.,MEDIUM, +84.11,Public administration and defence; compulsory social security,General public administration activities,MEDIUM, +84.12,Public administration and defence; compulsory social security,"Regulation of the activities of providing health care, education, cultural services and other social services, excluding social security",LOW, +84.13,Public administration and defence; compulsory social security,Regulation of and contribution to more efficient operation of businesses,LOW, +84.21,Public administration and defence; compulsory social security,Foreign affairs,AUTO-HIGH, +26.11,"Manufacture of computer, electronic and optical products",Manufacture of electronic components,HIGH, +84.23,Public administration and defence; compulsory social security,Justice and judicial activities,LOW, +84.24,Public administration and defence; compulsory social security,Public order and safety activities,LOW, +84.25,Public administration and defence; compulsory social security,Fire service activities,LOW, +84.30,Public administration and defence; compulsory social security,Compulsory social security activities,LOW, +85.10,Education,Pre-primary education,LOW, +85.20,Education,Primary education,LOW, +85.31,Education,General secondary education,LOW, +85.32,Education,Technical and vocational secondary education,LOW, +85.41,Education,Post-secondary non-tertiary education,LOW, +85.51,Education,Sports and recreation education,LOW, +85.52,Education,Cultural education,LOW, +85.53,Education,Driving school activities,LOW, +85.59,Education,Other education n.e.c.,MEDIUM, +85.60,Education,Educational support activities,LOW, +86.21,Human health activities,General medical practice activities,LOW, +86.22,Human health activities,Specialist medical practice activities,LOW, +86.23,Human health activities,Dental practice activities,LOW, +86.90,Human health activities,Other human health activities,MEDIUM, +26.20,"Manufacture of computer, electronic and optical products",Manufacture of computers and peripheral equipment,HIGH, +08.11,Other mining and quarrying,"Quarrying of ornamental and building stone, limestone, gypsum, chalk and slate",MEDIUM, +27.90,Manufacture of electrical equipment,Manufacture of other electrical equipment,MEDIUM, +84.22,Public administration and defence; compulsory social security,Defence activities,AUTO-HIGH, +46.14,"Wholesale trade, except of motor vehicles and motorcycles","Agents involved in the sale of machinery, industrial equipment, ships and aircraft",HIGH, +88.91,Social work activities without accommodation,Child day-care activities,LOW, +88.99,Social work activities without accommodation,Other social work activities without accommodation n.e.c.,LOW, +90.01,"Creative, arts and entertainment activities",Performing arts,LOW, +90.02,"Creative, arts and entertainment activities",Support activities to performing arts,LOW, +90.03,"Creative, arts and entertainment activities",Artistic creation,LOW, +90.04,"Creative, arts and entertainment activities",Operation of arts facilities,LOW, +91.02,"Libraries, archives, museums and other cultural activities",Museum activities,LOW, +91.03,"Libraries, archives, museums and other cultural activities",Operation of historical sites and buildings and similar visitor attractions,LOW, +91.04,"Libraries, archives, museums and other cultural activities",Botanical and zoological gardens and nature reserve activities,MEDIUM, +46.75,"Wholesale trade, except of motor vehicles and motorcycles",Wholesale of chemical products,HIGH, +93.11,Sports activities and amusement and recreation activities,Operation of sports facilities,LOW, +93.12,Sports activities and amusement and recreation activities,Activities of sport clubs,MEDIUM, +93.13,Sports activities and amusement and recreation activities,Fitness facilities,LOW, +93.21,Sports activities and amusement and recreation activities,Activities of amusement parks and theme parks,LOW, +93.29,Sports activities and amusement and recreation activities,Other amusement and recreation activities N.E.C.,MEDIUM, +94.11,Activities of membership organisations,Activities of business and employers membership organisations,LOW, +94.12,Activities of membership organisations,Activities of professional membership organisations,LOW, +94.20,Activities of membership organisations,Activities of trade unions,LOW, +61.90,Telecommunications,Other telecommunications activities,HIGH, +94.92,Activities of membership organisations,Activities of political organisations,HIGH, +94.99,Activities of membership organisations,Activities of other membership organisations n.e.c.,MEDIUM, +95.11,Repair of computers and personal and household goods,Repair of computers and peripheral equipment,LOW, +95.12,Repair of computers and personal and household goods,Repair of communication equipment,LOW, +95.21,Repair of computers and personal and household goods,Repair of consumer electronics,LOW, +95.22,Repair of computers and personal and household goods,Repair of household appliances and home and garden equipment,LOW, +95.23,Repair of computers and personal and household goods,Repair of footwear and leather goods,LOW, +95.24,Repair of computers and personal and household goods,Repair of furniture and home furnishings,LOW, +95.25,Repair of computers and personal and household goods,"Repair of watches, clocks and jewellery",LOW, +95.29,Repair of computers and personal and household goods,Repair of other personal and household goods,LOW, +96.01,Other personal service activities,Washing and (dry-)cleaning of textile and fur products,LOW, +96.02,Other personal service activities,Hairdressing and other beauty treatment,MEDIUM, +96.03,Other personal service activities,Funeral and related activities,LOW, +96.04,Other personal service activities,Physical well-being activities,LOW, +26.30/9,"Manufacture of computer, electronic and optical products",Manufacture of communication equipment (other than telegraph and telephone apparatus and equipment),HIGH, +97.00,Activities of households as employers of domestic personnel,Activities of households as employers of domestic personnel,HIGH, +98.10,Undifferentiated goods- and services-producing activities of private households for own use,Undifferentiated goods-producing activities of private households for own use,LOW, +98.20,Undifferentiated goods- and services-producing activities of private households for own use,Undifferentiated service-producing activities of private households for own use,LOW, +99.00,Activities of extraterritorial organisations and bodies,Activities of extraterritorial organisations and bodies,AUTO-HIGH, +26.12,"Manufacture of computer, electronic and optical products",Manufacture of loaded electronic boards,LOW, +01.62/1,Support activities to agriculture and post-harvest crop activities,Farm animal boarding and care,LOW, +01.62/9,Support activities to agriculture and post-harvest crop activities,Support activities for animal production (other than farm animal boarding and care) n.e.c.,LOW, +08.12,Other mining and quarrying,Operation of gravel and sand pits; mining of clays and kaolin,MEDIUM, +92.00,Gambling and betting activities,Gambling and betting activities,AUTO-HIGH, +10.51/1,Manufacture of food products,Liquid milk and cream production,MEDIUM, +10.51/2,Manufacture of food products,Butter and cheese production,MEDIUM, +10.51/9,Manufacture of food products,"Manufacture of milk products (other than liquid milk and cream, butter, cheese) n.e.c.",MEDIUM, +10.61/1,Manufacture of food products,Grain milling,LOW, +10.61/2,Manufacture of food products,Manufacture of breakfast cereals and cereals-based foods,MEDIUM, +10.82/1,Manufacture of food products,"Manufacture of cocoa, and chocolate confectionery",LOW, +10.82/2,Manufacture of food products,Manufacture of sugar confectionery,MEDIUM, +10.83/1,Manufacture of food products,Tea processing,LOW, +10.83/2,Manufacture of food products,Production of coffee and coffee substitutes,LOW, +13.92/1,Manufacture of textiles,Manufacture of soft furnishings,LOW, +13.92/2,Manufacture of textiles,"Manufacture of canvas goods, sacks etc.",LOW, +13.92/3,Manufacture of textiles,Manufacture of household textiles (other than soft furnishings of 13.92/1),LOW, +13.93/1,Manufacture of textiles,Manufacture of woven or tufted carpets and rugs,LOW, +13.93/9,Manufacture of textiles,Manufacture of carpets and rugs (other than woven or tufted) n.e.c.,LOW, +14.13/1,Manufacture of wearing apparel,Manufacture of men's outerwear other than leather clothes and workwear,LOW, +14.13/2,Manufacture of wearing apparel,"Manufacture of women's outerwear, other than leather clothes and workwear",LOW, +14.14/1,Manufacture of wearing apparel,Manufacture of men's underwear,LOW, +14.14/2,Manufacture of wearing apparel,Manufacture of women's underwear,LOW, +17.21/1,Manufacture of paper and paper products,Manufacture of corrugated paper and paperboard; manufacture of sacks and bags of paper,LOW, +17.21/9,Manufacture of paper and paper products,Manufacture of paper and paperboard containers other than sacks and bags,LOW, +17AA,,FINANCIAL MANGMNT AUXILIARY ACTIVITIES-Fund Managers acting on behalf of UK investment tr,MEDIUM, +17AB,,FINANCIAL MANGMNT AUXILIARY ACTIVITIES-Fund Managers acting on behalf of UK money market,MEDIUM, +17AC,,FINANCIAL MANGMNT AUXILIARY ACTIVITIES-Fund Managers acting on behalf of UK insurance com,MEDIUM, +17AD,,FINANCIAL MANGMNT AUXILIARY ACTIVITIES-Fund Managers acting on behalf of UK individuals,MEDIUM, +17AE,,FINANCIAL MANGMNT AUXILIARY ACTIVITIES-Fund Managers acting on behalf of any other UK res,MEDIUM, +17AF,,FINANCIAL MANGMNT AUXILIARY ACTIVITIES-Fund Managers acting on behalf of non-resident cli,MEDIUM, +17AG,,FINANCIAL MANGMNT AUXILIARY ACTIVITIES-Fund Managers acting on behalf of any other deposi,MEDIUM, +18.12/1,Printing and reproduction of recorded media,Manufacture of printed labels,LOW, +18.12/9,Printing and reproduction of recorded media,Printing (other than printing of newspapers and printing on labels and tags) n.e.c.,LOW, +18.20/1,Printing and reproduction of recorded media,Reproduction of sound recording,LOW, +18.20/2,Printing and reproduction of recorded media,Reproduction of video recording,LOW, +18.20/3,Printing and reproduction of recorded media,Reproduction of computer media,LOW, +19.20/1,Manufacture of coke and refined petroleum products,Mineral oil refining,AUTO-HIGH, +19.20/9,Manufacture of coke and refined petroleum products,Other treatment of petroleum products (excluding mineral oil refining/petrochemicals manufacture),MEDIUM, +20.30/1,Manufacture of chemicals and chemical products,"Manufacture of paints, varnishes and similar coatings, mastics and sealants",LOW, +20.30/2,Manufacture of chemicals and chemical products,Manufacture of printing ink,LOW, +20.41/1,Manufacture of chemicals and chemical products,Manufacture of soap and detergents,LOW, +20.41/2,Manufacture of chemicals and chemical products,Manufacture of cleaning and polishing preparations,LOW, +26.51/1,"Manufacture of computer, electronic and optical products","Manufacture of electronic instruments and appliances for measuring, testing, and navigation, except industrial process control equipment",HIGH, +28.99,Manufacture of machinery and equipment n.e.c.,Manufacture of other special-purpose machinery n.e.c.,HIGH, +30.11,Manufacture of other transport equipment,Building of ships and floating structures,HIGH, +26.51/2,"Manufacture of computer, electronic and optical products",Manufacture of electronic industrial process control equipment,AUTO-HIGH, +26.51/3,"Manufacture of computer, electronic and optical products","Manufacture of non-electronic instruments and appliances for measuring, testing and navigation, except industrial process control equipment",AUTO-HIGH, +26.51/4,"Manufacture of computer, electronic and optical products",Manufacture of non-electronic industrial process control equipment,LOW, +64.30/3,"Financial service activities, except insurance and pension funding",Activities of venture and development capital companies,AUTO-HIGH, +26.70/2,"Manufacture of computer, electronic and optical products",Manufacture of photographic and cinematographic equipment,LOW, +30.30,Manufacture of other transport equipment,Manufacture of air and spacecraft and related machinery,HIGH, +28.13/2,Manufacture of machinery and equipment n.e.c.,Manufacture of compressors,LOW, +28.30/1,Manufacture of machinery and equipment n.e.c.,Manufacture of agricultural tractors,LOW, +28.30/2,Manufacture of machinery and equipment n.e.c.,Manufacture of agricultural and forestry machinery (other than agricultural tractors),LOW, +28.92/1,Manufacture of machinery and equipment n.e.c.,Manufacture of machinery for mining,LOW, +28.92/2,Manufacture of machinery and equipment n.e.c.,Manufacture of earthmoving equipment,LOW, +28.92/3,Manufacture of machinery and equipment n.e.c.,Manufacture of equipment for concrete crushing and screening roadworks,LOW, +29.20/1,"Manufacture of motor vehicles, trailers and semi-trailers",Manufacture of bodies (coachwork) for motor vehicles (except caravans),LOW, +29.20/2,"Manufacture of motor vehicles, trailers and semi-trailers",Manufacture of trailers and semi-trailers,LOW, +29.20/3,"Manufacture of motor vehicles, trailers and semi-trailers",Manufacture of caravans,LOW, +32.40/1,Other manufacturing,Manufacture of professional and arcade games and toys,LOW, +32.40/9,Other manufacturing,Manufacture of games and toys (other than professional and arcade games and toys) n.e.c.,LOW, +41.20/1,Construction of buildings,Construction of commercial buildings,MEDIUM, +41.20/2,Construction of buildings,Construction of domestic buildings,MEDIUM, +43.34/1,Specialised construction activities,Painting,MEDIUM, +43.34/2,Specialised construction activities,Glazing,LOW, +43.99/1,Specialised construction activities,Scaffold erection,MEDIUM, +43.99/9,Specialised construction activities,Specialised construction activities (other than scaffold erection) n.e.c.,MEDIUM, +45.11/1,Wholesale and retail trade and repair of motor vehicles and motorcycles,Sale of new cars and light motor vehicles,HIGH, +45.11/2,Wholesale and retail trade and repair of motor vehicles and motorcycles,Sale of used cars and light motor vehicles,HIGH, +46.34/1,"Wholesale trade, except of motor vehicles and motorcycles","Wholesale of fruit and vegetable juices, mineral waters and soft drinks",MEDIUM, +46.34/2,"Wholesale trade, except of motor vehicles and motorcycles","Wholesale of wine, beer, spirits and other alcoholic beverages",MEDIUM, +46.43/1,"Wholesale trade, except of motor vehicles and motorcycles","Wholesale of gramophone records, audio tapes, compact discs and video tapes and of the equipment on which these are played",LOW, +46.43/9,"Wholesale trade, except of motor vehicles and motorcycles","Wholesale of radio and television goods and of electrical household appliances (other than of gramophone records, audio tapes, compact discs and video tapes and the equipment on which these are played) n.e.c.",LOW, +46.49/1,"Wholesale trade, except of motor vehicles and motorcycles",Wholesale of musical instruments,LOW, +46.49/9,"Wholesale trade, except of motor vehicles and motorcycles",Wholesale of household goods (other than musical instruments) n.e.c.,LOW, +05.10/1,Mining of coal and lignite,Mining of hard coal from deep coal mines (underground mining),AUTO-HIGH, +46.71/9,"Wholesale trade, except of motor vehicles and motorcycles",Wholesale of fuels and related products (other than petroleum and petroleum products),LOW, +47.42/1,"Retail trade, except of motor vehicles and motorcycles",Retail sale of mobile telephones in specialised stores,MEDIUM, +26.70/1,"Manufacture of computer, electronic and optical products",Manufacture of optical precision instruments,HIGH, +47.59/1,"Retail trade, except of motor vehicles and motorcycles",Retail sale of musical instruments and scores in specialised stores,LOW, +47.59/9,"Retail trade, except of motor vehicles and motorcycles","Retail sale of furniture, lighting equipment and other household articles (other than musical instruments) n.e.c., in specialised stores",LOW, +47.72/1,"Retail trade, except of motor vehicles and motorcycles",Retail sale of footwear in specialised stores,LOW, +47.72/2,"Retail trade, except of motor vehicles and motorcycles",Retail sale of leather goods in specialised stores,LOW, +47.74/1,"Retail trade, except of motor vehicles and motorcycles",Retail sale of hearing aids in specialised stores,LOW, +47.74/9,"Retail trade, except of motor vehicles and motorcycles","Retail sale of medical and orthopaedic goods (other than hearing aids) n.e.c., in specialised stores",LOW, +05.10/2,Mining of coal and lignite,Mining of hard coal from open cast coal working (surface mining),AUTO-HIGH, +47.78/2,"Retail trade, except of motor vehicles and motorcycles",Retail sale by opticians,LOW, +25.30,"Manufacture of fabricated metal products, except machinery and equipment","Manufacture of steam generators, except central heating hot water boilers",HIGH, +24.54,Manufacture of basic metals,Casting of other non-ferrous metals,LOW, +47.79/9,"Retail trade, except of motor vehicles and motorcycles",Retail sale of second-hand goods (other than antiques and antique books) in stores,HIGH, +49.31/1,Land transport and transport via pipelines,"Urban, suburban or metropolitan area passenger railway transportation by underground, metro and similar systems",LOW, +49.31/9,Land transport and transport via pipelines,"Urban, suburban or metropolitan area passenger land transport other than railway transportation by underground, metro and similar systems",LOW, +51.10/1,Air transport,Scheduled passenger air transport,MEDIUM, +51.10/2,Air transport,Non-scheduled passenger air transport,MEDIUM, +52.10/1,Warehousing and support activities for transportation,Operation of warehousing and storage facilities for water transport activities of division 50,MEDIUM, +52.10/2,Warehousing and support activities for transportation,Operation of warehousing and storage facilities for air transport activities of division 51,MEDIUM, +52.10/3,Warehousing and support activities for transportation,Operation of warehousing and storage facilities for land transport activities of division 49,MEDIUM, +52.21/1,Warehousing and support activities for transportation,Operation of rail freight terminals,MEDIUM, +52.21/2,Warehousing and support activities for transportation,Operation of rail passenger facilities at railway stations,MEDIUM, +52.21/3,Warehousing and support activities for transportation,Operation of bus and coach passenger facilities at bus and coach stations,MEDIUM, +52.21/9,Warehousing and support activities for transportation,"Other service activities incidental to land transportation, n.e.c. (not including operation of rail freight terminals, passenger facilities at railway stations or passenger facilities at bus and coach stations)",MEDIUM, +52.24/1,Warehousing and support activities for transportation,Cargo handling for water transport activities of division 50,MEDIUM, +52.24/2,Warehousing and support activities for transportation,Cargo handling for air transport activities of division 51,MEDIUM, +52.24/3,Warehousing and support activities for transportation,Cargo handling for land transport activities of division 49,MEDIUM, +53.20/1,Warehousing and support activities for transportation,Licensed Carriers,LOW, +53.20/2,Warehousing and support activities for transportation,Unlicensed Carriers,LOW, +55.20/1,Accommodation,Holiday centres and villages,LOW, +55.20/2,Accommodation,Youth hostels,LOW, +55.20/9,Accommodation,Other holiday and other short-stay accommodation (not including holiday centres and villages or youth hostels) n.e.c.,LOW, +56.10/1,Food and beverage service activities,Licensed restaurants,MEDIUM, +56.10/2,Food and beverage service activities,Unlicensed restaurants and cafes,MEDIUM, +56.10/3,Food and beverage service activities,Take away food shops and mobile food stands,MEDIUM, +56.30/1,Food and beverage service activities,Licensed clubs,LOW, +56.30/2,Food and beverage service activities,Public houses and bars,LOW, +58.14/1,Publishing activities,Publishing of learned journals,LOW, +58.14/2,Publishing activities,"Publishing of consumer, business and professional journals and periodicals",LOW, +59.11/1,"Motion picture, video and television programme production, sound recording and music publishing activites",Motion picture production activities,MEDIUM, +59.11/2,"Motion picture, video and television programme production, sound recording and music publishing activites",Video production activities,MEDIUM, +59.11/3,"Motion picture, video and television programme production, sound recording and music publishing activites",Television programme production activities,LOW, +59.13/1,"Motion picture, video and television programme production, sound recording and music publishing activites",Motion picture distribution activities,LOW, +59.13/2,"Motion picture, video and television programme production, sound recording and music publishing activites",Video distribution activities,LOW, +59.13/3,"Motion picture, video and television programme production, sound recording and music publishing activites",Television programme distribution activities,LOW, +62.01/1,"Computer programming, consultancy and related activities",Ready-made interactive leisure and entertainment software development,LOW, +62.01/2,"Computer programming, consultancy and related activities",Business and domestic software development,LOW, +20.20,Manufacture of chemicals and chemical products,Manufacture of pesticides and other agrochemical products,HIGH, +64.19/2,"Financial service activities, except insurance and pension funding",Building societies,LOW, +64.20/1,"Financial service activities, except insurance and pension funding",Activities of agricultural holding companies,LOW, +64.20/2,"Financial service activities, except insurance and pension funding",Activities of production holding companies,LOW, +64.20/3,"Financial service activities, except insurance and pension funding",Activities of construction holding companies,MEDIUM, +64.20/4,"Financial service activities, except insurance and pension funding",Activities of distribution holding companies,LOW, +64.20/5,"Financial service activities, except insurance and pension funding",Activities of financial services holding companies,LOW, +64.20/9,"Financial service activities, except insurance and pension funding","Activities of other holding companies (not including agricultural, production, construction, distribution and financial services holding companies) n.e.c.",LOW, +64.30/1,"Financial service activities, except insurance and pension funding",Activities of investment trusts,LOW, +64.30/2,"Financial service activities, except insurance and pension funding",Activities of unit trusts,LOW, +64.30/4,"Financial service activities, except insurance and pension funding",Activities of open-ended investment companies,MEDIUM, +64.30/5,"Financial service activities, except insurance and pension funding",Activities of property unit trusts,HIGH, +64.30/6,"Financial service activities, except insurance and pension funding",Activities of real estate investment trusts,HIGH, +64.92/1,"Financial service activities, except insurance and pension funding",Credit granting by non-deposit taking finance houses and other specialist consumer credit grantors,AUTO-HIGH, +64.92/2,"Financial service activities, except insurance and pension funding",Activities of mortgage finance companies,LOW, +64.92/9,"Financial service activities, except insurance and pension funding",Other credit granting (not including credit granting by non-deposit taking finance houses and other specialist consumer credit grantors and activities of mortgage finance companies) n.e.c.,AUTO-HIGH, +64.99/1,"Financial service activities, except insurance and pension funding",Security dealing on own account,LOW, +64.99/2,"Financial service activities, except insurance and pension funding",Factoring,HIGH, +28.11,Manufacture of machinery and equipment n.e.c.,"Manufacture of engines and turbines, except aircraft, vehicle and cycle engines",HIGH, +65.20/1,"Insurance, reinsurance and pension funding, except compulsory social security",Life reinsurance,LOW, +65.20/2,"Insurance, reinsurance and pension funding, except compulsory social security",Non-life reinsurance,LOW, +68.20/1,Real estate activities,Renting and operating of Housing Association real estate,MEDIUM, +68.20/2,Real estate activities,Letting and operating of conference and exhibition centres,LOW, +68.20/9,Real estate activities,Letting and operating of own or leased real estate (other than Housing Association real estate and conference and exhibition services) n.e.c.,HIGH, +69.10/1,Legal and accounting activities,Barristers at law,LOW, +69.10/2,Legal and accounting activities,Solicitors,HIGH, +69.10/9,Legal and accounting activities,Activities of patent and copyright agents; other legal activities (other than those of barristers and solicitors) n.e.c.,LOW, +69.20/1,Legal and accounting activities,"Accounting, and auditing activities",HIGH, +69.20/2,Legal and accounting activities,Bookkeeping activities,HIGH, +69.20/3,Legal and accounting activities,Tax consultancy,HIGH, +70.22/1,Activities of head offices; management consultancy activities,Financial management,HIGH, +70.22/9,Activities of head offices; management consultancy activities,Management consultancy activities (other than financial management),LOW, +71.11/1,Architectural and engineering activities; technical testing and analysis,Architectural activities,LOW, +71.11/2,Architectural and engineering activities; technical testing and analysis,Urban planning and landscape architectural activities,MEDIUM, +71.12/1,Architectural and engineering activities; technical testing and analysis,Engineering design activities for industrial process and production,LOW, +71.12/2,Architectural and engineering activities; technical testing and analysis,Engineering related scientific and technical consulting activities,LOW, +71.12/9,Architectural and engineering activities; technical testing and analysis,Other engineering activities (not including engineering design for industrial process and production or engineering related scientific and technical consulting activities),LOW, +74.20/1,"Other professional, scientific and technical activities",Portrait photographic activities,MEDIUM, +74.20/2,"Other professional, scientific and technical activities",Other specialist photography (not including portrait photography),LOW, +74.20/3,"Other professional, scientific and technical activities",Film processing,LOW, +74.20/9,"Other professional, scientific and technical activities",Other photographic activities (not including portrait and other specialist photography and film processing) n.e.c.,LOW, +74.90/1,"Other professional, scientific and technical activities",Environmental consulting activities,LOW, +74.90/2,"Other professional, scientific and technical activities",Quantity surveying activities,LOW, +74.90/9,"Other professional, scientific and technical activities","Other professional, scientific and technical activities (not including environmental consultancy or quantity surveying) n.e.c.",MEDIUM, +77.29/1,Rental and leasing activities,Renting and leasing of media entertainment equipment,LOW, +77.29/9,Rental and leasing activities,Renting and leasing of other personal and household goods (other than media entertainment equipment),LOW, +77.34/1,Rental and leasing activities,Renting and leasing of passenger water transport equipment,LOW, +77.34/2,Rental and leasing activities,Renting and leasing of freight water transport equipment,LOW, +77.35/1,Rental and leasing activities,Renting and leasing of passenger air transport equipment,LOW, +77.35/2,Rental and leasing activities,Renting and leasing of freight air transport equipment,LOW, +78.10/1,Employment activities,"Motion picture, television and other theatrical casting",LOW, +78.10/9,Employment activities,Activities of employment placement agencies (other than motion picture television and other theatrical casting) n.e.c.,MEDIUM, +79.90/1,"Travel agency, tour operator and other reservation service and related activities",Activities of tourist guides,LOW, +79.90/9,"Travel agency, tour operator and other reservation service and related activities",Other reservation service activities (not including activities of tourist guides),LOW, +81.22/1,Services to buildings and landscape activities,Window cleaning services,LOW, +81.22/2,Services to buildings and landscape activities,Specialised cleaning services,MEDIUM, +81.22/3,Services to buildings and landscape activities,Furnace and chimney cleaning services,LOW, +81.22/9,Services to buildings and landscape activities,"Building and industrial cleaning activities (other than window cleaning, specialised cleaning and furnace and chimney cleaning services) n.e.c.",MEDIUM, +81.29/1,Services to buildings and landscape activities,Disinfecting and extermination services,LOW, +81.29/9,Services to buildings and landscape activities,Cleaning services (other than disinfecting and extermination services) n.e.c.,MEDIUM, +82.30/1,"Office administrative, office support and other business support activities",Activities of exhibition and fair organizers,LOW, +82.30/2,"Office administrative, office support and other business support activities",Activities of conference organizers,LOW, +82.91/1,"Office administrative, office support and other business support activities",Activities of collection agencies,LOW, +82.91/2,"Office administrative, office support and other business support activities",Activities of credit bureaus,LOW, +85.42/1,Education,First-degree level higher education,LOW, +85.42/2,Education,Post-graduate level higher education,LOW, +86.10/1,Human health activities,Hospital activities,LOW, +86.10/2,Human health activities,Medical nursing home activities,LOW, +91.01/1,"Libraries, archives, museums and other cultural activities",Library activities,LOW, +91.01/2,"Libraries, archives, museums and other cultural activities",Archive activities,LOW, +93.19/1,Sports activities and amusement and recreation activities,Activities of racehorse owners,MEDIUM, +93.19/9,Sports activities and amusement and recreation activities,Other sports activities (not including activities of racehorse owners) n.e.c.,MEDIUM, +NOT_FOUND,,Data Not Recognised,HIGH, +NULL,,MISSING DATA,HIGH, +`; +const entityTypesCsv = ` +code,description,risk_weight +01,Private Limited Company,MEDIUM +02,Sole Trader,MEDIUM +03,Limited Liability Partnership,MEDIUM +04,Clubs,HIGH +05,Charity,HIGH +06,Association / Society,HIGH +07,Public Limited Company (PLC),MEDIUM +09,Partnership,HIGH +10,Trust,HIGH +12,Pension Schemes,LOW +14,Public Sector Bodies,LOW +16,Outlet,HIGH +99,Missing Data,HIGH +` + +let entityTypes: FormOptionModel[]; +let industryTypes: FormOptionModel[]; + +export class MenuOptionsMock implements MenuOptionsApi { + async getCountryList(): Promise { + return [ + {text: 'Afghanistan', value: 'AF'}, + {text: 'Åland Islands', value: 'AX'}, + {text: 'Albania', value: 'AL'}, + {text: 'Algeria', value: 'DZ'}, + {text: 'American Samoa', value: 'AS'}, + {text: 'AndorrA', value: 'AD'}, + {text: 'Angola', value: 'AO'}, + {text: 'Anguilla', value: 'AI'}, + {text: 'Antarctica', value: 'AQ'}, + {text: 'Antigua and Barbuda', value: 'AG'}, + {text: 'Argentina', value: 'AR'}, + {text: 'Armenia', value: 'AM'}, + {text: 'Aruba', value: 'AW'}, + {text: 'Australia', value: 'AU'}, + {text: 'Austria', value: 'AT'}, + {text: 'Azerbaijan', value: 'AZ'}, + {text: 'Bahamas', value: 'BS'}, + {text: 'Bahrain', value: 'BH'}, + {text: 'Bangladesh', value: 'BD'}, + {text: 'Barbados', value: 'BB'}, + {text: 'Belarus', value: 'BY'}, + {text: 'Belgium', value: 'BE'}, + {text: 'Belize', value: 'BZ'}, + {text: 'Benin', value: 'BJ'}, + {text: 'Bermuda', value: 'BM'}, + {text: 'Bhutan', value: 'BT'}, + {text: 'Bolivia', value: 'BO'}, + {text: 'Bosnia and Herzegovina', value: 'BA'}, + {text: 'Botswana', value: 'BW'}, + {text: 'Bouvet Island', value: 'BV'}, + {text: 'Brazil', value: 'BR'}, + {text: 'British Indian Ocean Territory', value: 'IO'}, + {text: 'Brunei Darussalam', value: 'BN'}, + {text: 'Bulgaria', value: 'BG'}, + {text: 'Burkina Faso', value: 'BF'}, + {text: 'Burundi', value: 'BI'}, + {text: 'Cambodia', value: 'KH'}, + {text: 'Cameroon', value: 'CM'}, + {text: 'Canada', value: 'CA'}, + {text: 'Cape Verde', value: 'CV'}, + {text: 'Cayman Islands', value: 'KY'}, + {text: 'Central African Republic', value: 'CF'}, + {text: 'Chad', value: 'TD'}, + {text: 'Chile', value: 'CL'}, + {text: 'China', value: 'CN'}, + {text: 'Christmas Island', value: 'CX'}, + {text: 'Cocos (Keeling) Islands', value: 'CC'}, + {text: 'Colombia', value: 'CO'}, + {text: 'Comoros', value: 'KM'}, + {text: 'Congo', value: 'CG'}, + {text: 'Congo, The Democratic Republic of the', value: 'CD'}, + {text: 'Cook Islands', value: 'CK'}, + {text: 'Costa Rica', value: 'CR'}, + {text: 'Cote D\'Ivoire', value: 'CI'}, + {text: 'Croatia', value: 'HR'}, + {text: 'Cuba', value: 'CU'}, + {text: 'Cyprus', value: 'CY'}, + {text: 'Czech Republic', value: 'CZ'}, + {text: 'Denmark', value: 'DK'}, + {text: 'Djibouti', value: 'DJ'}, + {text: 'Dominica', value: 'DM'}, + {text: 'Dominican Republic', value: 'DO'}, + {text: 'Ecuador', value: 'EC'}, + {text: 'Egypt', value: 'EG'}, + {text: 'El Salvador', value: 'SV'}, + {text: 'Equatorial Guinea', value: 'GQ'}, + {text: 'Eritrea', value: 'ER'}, + {text: 'Estonia', value: 'EE'}, + {text: 'Ethiopia', value: 'ET'}, + {text: 'Falkland Islands (Malvinas)', value: 'FK'}, + {text: 'Faroe Islands', value: 'FO'}, + {text: 'Fiji', value: 'FJ'}, + {text: 'Finland', value: 'FI'}, + {text: 'France', value: 'FR'}, + {text: 'French Guiana', value: 'GF'}, + {text: 'French Polynesia', value: 'PF'}, + {text: 'French Southern Territories', value: 'TF'}, + {text: 'Gabon', value: 'GA'}, + {text: 'Gambia', value: 'GM'}, + {text: 'Georgia', value: 'GE'}, + {text: 'Germany', value: 'DE'}, + {text: 'Ghana', value: 'GH'}, + {text: 'Gibraltar', value: 'GI'}, + {text: 'Greece', value: 'GR'}, + {text: 'Greenland', value: 'GL'}, + {text: 'Grenada', value: 'GD'}, + {text: 'Guadeloupe', value: 'GP'}, + {text: 'Guam', value: 'GU'}, + {text: 'Guatemala', value: 'GT'}, + {text: 'Guernsey', value: 'GG'}, + {text: 'Guinea', value: 'GN'}, + {text: 'Guinea-Bissau', value: 'GW'}, + {text: 'Guyana', value: 'GY'}, + {text: 'Haiti', value: 'HT'}, + {text: 'Heard Island and Mcdonald Islands', value: 'HM'}, + {text: 'Holy See (Vatican City State)', value: 'VA'}, + {text: 'Honduras', value: 'HN'}, + {text: 'Hong Kong', value: 'HK'}, + {text: 'Hungary', value: 'HU'}, + {text: 'Iceland', value: 'IS'}, + {text: 'India', value: 'IN'}, + {text: 'Indonesia', value: 'ID'}, + {text: 'Iran, Islamic Republic Of', value: 'IR'}, + {text: 'Iraq', value: 'IQ'}, + {text: 'Ireland', value: 'IE'}, + {text: 'Isle of Man', value: 'IM'}, + {text: 'Israel', value: 'IL'}, + {text: 'Italy', value: 'IT'}, + {text: 'Jamaica', value: 'JM'}, + {text: 'Japan', value: 'JP'}, + {text: 'Jersey', value: 'JE'}, + {text: 'Jordan', value: 'JO'}, + {text: 'Kazakhstan', value: 'KZ'}, + {text: 'Kenya', value: 'KE'}, + {text: 'Kiribati', value: 'KI'}, + {text: 'Korea, Democratic People\'S Republic of', value: 'KP'}, + {text: 'Korea, Republic of', value: 'KR'}, + {text: 'Kuwait', value: 'KW'}, + {text: 'Kyrgyzstan', value: 'KG'}, + {text: 'Lao People\'S Democratic Republic', value: 'LA'}, + {text: 'Latvia', value: 'LV'}, + {text: 'Lebanon', value: 'LB'}, + {text: 'Lesotho', value: 'LS'}, + {text: 'Liberia', value: 'LR'}, + {text: 'Libyan Arab Jamahiriya', value: 'LY'}, + {text: 'Liechtenstein', value: 'LI'}, + {text: 'Lithuania', value: 'LT'}, + {text: 'Luxembourg', value: 'LU'}, + {text: 'Macao', value: 'MO'}, + {text: 'Macedonia, The Former Yugoslav Republic of', value: 'MK'}, + {text: 'Madagascar', value: 'MG'}, + {text: 'Malawi', value: 'MW'}, + {text: 'Malaysia', value: 'MY'}, + {text: 'Maldives', value: 'MV'}, + {text: 'Mali', value: 'ML'}, + {text: 'Malta', value: 'MT'}, + {text: 'Marshall Islands', value: 'MH'}, + {text: 'Martinique', value: 'MQ'}, + {text: 'Mauritania', value: 'MR'}, + {text: 'Mauritius', value: 'MU'}, + {text: 'Mayotte', value: 'YT'}, + {text: 'Mexico', value: 'MX'}, + {text: 'Micronesia, Federated States of', value: 'FM'}, + {text: 'Moldova, Republic of', value: 'MD'}, + {text: 'Monaco', value: 'MC'}, + {text: 'Mongolia', value: 'MN'}, + {text: 'Montserrat', value: 'MS'}, + {text: 'Morocco', value: 'MA'}, + {text: 'Mozambique', value: 'MZ'}, + {text: 'Myanmar', value: 'MM'}, + {text: 'Namibia', value: 'NA'}, + {text: 'Nauru', value: 'NR'}, + {text: 'Nepal', value: 'NP'}, + {text: 'Netherlands', value: 'NL'}, + {text: 'Netherlands Antilles', value: 'AN'}, + {text: 'New Caledonia', value: 'NC'}, + {text: 'New Zealand', value: 'NZ'}, + {text: 'Nicaragua', value: 'NI'}, + {text: 'Niger', value: 'NE'}, + {text: 'Nigeria', value: 'NG'}, + {text: 'Niue', value: 'NU'}, + {text: 'Norfolk Island', value: 'NF'}, + {text: 'Northern Mariana Islands', value: 'MP'}, + {text: 'Norway', value: 'NO'}, + {text: 'Oman', value: 'OM'}, + {text: 'Pakistan', value: 'PK'}, + {text: 'Palau', value: 'PW'}, + {text: 'Palestinian Territory, Occupied', value: 'PS'}, + {text: 'Panama', value: 'PA'}, + {text: 'Papua New Guinea', value: 'PG'}, + {text: 'Paraguay', value: 'PY'}, + {text: 'Peru', value: 'PE'}, + {text: 'Philippines', value: 'PH'}, + {text: 'Pitcairn', value: 'PN'}, + {text: 'Poland', value: 'PL'}, + {text: 'Portugal', value: 'PT'}, + {text: 'Puerto Rico', value: 'PR'}, + {text: 'Qatar', value: 'QA'}, + {text: 'Reunion', value: 'RE'}, + {text: 'Romania', value: 'RO'}, + {text: 'Russian Federation', value: 'RU'}, + {text: 'RWANDA', value: 'RW'}, + {text: 'Saint Helena', value: 'SH'}, + {text: 'Saint Kitts and Nevis', value: 'KN'}, + {text: 'Saint Lucia', value: 'LC'}, + {text: 'Saint Pierre and Miquelon', value: 'PM'}, + {text: 'Saint Vincent and the Grenadines', value: 'VC'}, + {text: 'Samoa', value: 'WS'}, + {text: 'San Marino', value: 'SM'}, + {text: 'Sao Tome and Principe', value: 'ST'}, + {text: 'Saudi Arabia', value: 'SA'}, + {text: 'Senegal', value: 'SN'}, + {text: 'Serbia and Montenegro', value: 'CS'}, + {text: 'Seychelles', value: 'SC'}, + {text: 'Sierra Leone', value: 'SL'}, + {text: 'Singapore', value: 'SG'}, + {text: 'Slovakia', value: 'SK'}, + {text: 'Slovenia', value: 'SI'}, + {text: 'Solomon Islands', value: 'SB'}, + {text: 'Somalia', value: 'SO'}, + {text: 'South Africa', value: 'ZA'}, + {text: 'South Georgia and the South Sandwich Islands', value: 'GS'}, + {text: 'Spain', value: 'ES'}, + {text: 'Sri Lanka', value: 'LK'}, + {text: 'Sudan', value: 'SD'}, + {text: 'Suritext', value: 'SR'}, + {text: 'Svalbard and Jan Mayen', value: 'SJ'}, + {text: 'Swaziland', value: 'SZ'}, + {text: 'Sweden', value: 'SE'}, + {text: 'Switzerland', value: 'CH'}, + {text: 'Syrian Arab Republic', value: 'SY'}, + {text: 'Taiwan, Province of China', value: 'TW'}, + {text: 'Tajikistan', value: 'TJ'}, + {text: 'Tanzania, United Republic of', value: 'TZ'}, + {text: 'Thailand', value: 'TH'}, + {text: 'Timor-Leste', value: 'TL'}, + {text: 'Togo', value: 'TG'}, + {text: 'Tokelau', value: 'TK'}, + {text: 'Tonga', value: 'TO'}, + {text: 'Trinidad and Tobago', value: 'TT'}, + {text: 'Tunisia', value: 'TN'}, + {text: 'Turkey', value: 'TR'}, + {text: 'Turkmenistan', value: 'TM'}, + {text: 'Turks and Caicos Islands', value: 'TC'}, + {text: 'Tuvalu', value: 'TV'}, + {text: 'Uganda', value: 'UG'}, + {text: 'Ukraine', value: 'UA'}, + {text: 'United Arab Emirates', value: 'AE'}, + {text: 'United Kingdom', value: 'GB'}, + {text: 'United States', value: 'US'}, + {text: 'United States Minor Outlying Islands', value: 'UM'}, + {text: 'Uruguay', value: 'UY'}, + {text: 'Uzbekistan', value: 'UZ'}, + {text: 'Vanuatu', value: 'VU'}, + {text: 'Venezuela', value: 'VE'}, + {text: 'Viet Nam', value: 'VN'}, + {text: 'Virgin Islands, British', value: 'VG'}, + {text: 'Virgin Islands, U.S.', value: 'VI'}, + {text: 'Wallis and Futuna', value: 'WF'}, + {text: 'Western Sahara', value: 'EH'}, + {text: 'Yemen', value: 'YE'}, + {text: 'Zambia', value: 'ZM'}, + {text: 'Zimbabwe', value: 'ZW'} + ] + } + + async getEntityTypes(): Promise { + if (entityTypes) { + return entityTypes; + } + + return entityTypes = entityTypesCsv + .split('\n') + .map(parseCsv) + .map(values => ({ + value: '' + values[0], + text: '' + values[1], + })) + .filter(val => val.value !== 'code'); + } + + async getIndustries(): Promise { + if (industryTypes) { + return industryTypes; + } + + return industryTypes = industryTypesCsv + .split('\n') + .map(parseCsv) + .map(values => ({ + value: '' + values[0], + text: '' + values[2], + })) + .filter(val => val.value !== 'Code'); + } +} \ No newline at end of file diff --git a/src/services/menu-options/menu-options.service.ts b/src/services/menu-options/menu-options.service.ts deleted file mode 100644 index 349aadb..0000000 --- a/src/services/menu-options/menu-options.service.ts +++ /dev/null @@ -1,252 +0,0 @@ -import {MenuOptionsApi} from "./menu-options.api.ts"; -import {FormOptionModel} from "../../models"; - -export class MenuOptionsService implements MenuOptionsApi { - async getCountryList(): Promise { - return [ - {text: 'Afghanistan', value: 'AF'}, - {text: 'Åland Islands', value: 'AX'}, - {text: 'Albania', value: 'AL'}, - {text: 'Algeria', value: 'DZ'}, - {text: 'American Samoa', value: 'AS'}, - {text: 'AndorrA', value: 'AD'}, - {text: 'Angola', value: 'AO'}, - {text: 'Anguilla', value: 'AI'}, - {text: 'Antarctica', value: 'AQ'}, - {text: 'Antigua and Barbuda', value: 'AG'}, - {text: 'Argentina', value: 'AR'}, - {text: 'Armenia', value: 'AM'}, - {text: 'Aruba', value: 'AW'}, - {text: 'Australia', value: 'AU'}, - {text: 'Austria', value: 'AT'}, - {text: 'Azerbaijan', value: 'AZ'}, - {text: 'Bahamas', value: 'BS'}, - {text: 'Bahrain', value: 'BH'}, - {text: 'Bangladesh', value: 'BD'}, - {text: 'Barbados', value: 'BB'}, - {text: 'Belarus', value: 'BY'}, - {text: 'Belgium', value: 'BE'}, - {text: 'Belize', value: 'BZ'}, - {text: 'Benin', value: 'BJ'}, - {text: 'Bermuda', value: 'BM'}, - {text: 'Bhutan', value: 'BT'}, - {text: 'Bolivia', value: 'BO'}, - {text: 'Bosnia and Herzegovina', value: 'BA'}, - {text: 'Botswana', value: 'BW'}, - {text: 'Bouvet Island', value: 'BV'}, - {text: 'Brazil', value: 'BR'}, - {text: 'British Indian Ocean Territory', value: 'IO'}, - {text: 'Brunei Darussalam', value: 'BN'}, - {text: 'Bulgaria', value: 'BG'}, - {text: 'Burkina Faso', value: 'BF'}, - {text: 'Burundi', value: 'BI'}, - {text: 'Cambodia', value: 'KH'}, - {text: 'Cameroon', value: 'CM'}, - {text: 'Canada', value: 'CA'}, - {text: 'Cape Verde', value: 'CV'}, - {text: 'Cayman Islands', value: 'KY'}, - {text: 'Central African Republic', value: 'CF'}, - {text: 'Chad', value: 'TD'}, - {text: 'Chile', value: 'CL'}, - {text: 'China', value: 'CN'}, - {text: 'Christmas Island', value: 'CX'}, - {text: 'Cocos (Keeling) Islands', value: 'CC'}, - {text: 'Colombia', value: 'CO'}, - {text: 'Comoros', value: 'KM'}, - {text: 'Congo', value: 'CG'}, - {text: 'Congo, The Democratic Republic of the', value: 'CD'}, - {text: 'Cook Islands', value: 'CK'}, - {text: 'Costa Rica', value: 'CR'}, - {text: 'Cote D\'Ivoire', value: 'CI'}, - {text: 'Croatia', value: 'HR'}, - {text: 'Cuba', value: 'CU'}, - {text: 'Cyprus', value: 'CY'}, - {text: 'Czech Republic', value: 'CZ'}, - {text: 'Denmark', value: 'DK'}, - {text: 'Djibouti', value: 'DJ'}, - {text: 'Dominica', value: 'DM'}, - {text: 'Dominican Republic', value: 'DO'}, - {text: 'Ecuador', value: 'EC'}, - {text: 'Egypt', value: 'EG'}, - {text: 'El Salvador', value: 'SV'}, - {text: 'Equatorial Guinea', value: 'GQ'}, - {text: 'Eritrea', value: 'ER'}, - {text: 'Estonia', value: 'EE'}, - {text: 'Ethiopia', value: 'ET'}, - {text: 'Falkland Islands (Malvinas)', value: 'FK'}, - {text: 'Faroe Islands', value: 'FO'}, - {text: 'Fiji', value: 'FJ'}, - {text: 'Finland', value: 'FI'}, - {text: 'France', value: 'FR'}, - {text: 'French Guiana', value: 'GF'}, - {text: 'French Polynesia', value: 'PF'}, - {text: 'French Southern Territories', value: 'TF'}, - {text: 'Gabon', value: 'GA'}, - {text: 'Gambia', value: 'GM'}, - {text: 'Georgia', value: 'GE'}, - {text: 'Germany', value: 'DE'}, - {text: 'Ghana', value: 'GH'}, - {text: 'Gibraltar', value: 'GI'}, - {text: 'Greece', value: 'GR'}, - {text: 'Greenland', value: 'GL'}, - {text: 'Grenada', value: 'GD'}, - {text: 'Guadeloupe', value: 'GP'}, - {text: 'Guam', value: 'GU'}, - {text: 'Guatemala', value: 'GT'}, - {text: 'Guernsey', value: 'GG'}, - {text: 'Guinea', value: 'GN'}, - {text: 'Guinea-Bissau', value: 'GW'}, - {text: 'Guyana', value: 'GY'}, - {text: 'Haiti', value: 'HT'}, - {text: 'Heard Island and Mcdonald Islands', value: 'HM'}, - {text: 'Holy See (Vatican City State)', value: 'VA'}, - {text: 'Honduras', value: 'HN'}, - {text: 'Hong Kong', value: 'HK'}, - {text: 'Hungary', value: 'HU'}, - {text: 'Iceland', value: 'IS'}, - {text: 'India', value: 'IN'}, - {text: 'Indonesia', value: 'ID'}, - {text: 'Iran, Islamic Republic Of', value: 'IR'}, - {text: 'Iraq', value: 'IQ'}, - {text: 'Ireland', value: 'IE'}, - {text: 'Isle of Man', value: 'IM'}, - {text: 'Israel', value: 'IL'}, - {text: 'Italy', value: 'IT'}, - {text: 'Jamaica', value: 'JM'}, - {text: 'Japan', value: 'JP'}, - {text: 'Jersey', value: 'JE'}, - {text: 'Jordan', value: 'JO'}, - {text: 'Kazakhstan', value: 'KZ'}, - {text: 'Kenya', value: 'KE'}, - {text: 'Kiribati', value: 'KI'}, - {text: 'Korea, Democratic People\'S Republic of', value: 'KP'}, - {text: 'Korea, Republic of', value: 'KR'}, - {text: 'Kuwait', value: 'KW'}, - {text: 'Kyrgyzstan', value: 'KG'}, - {text: 'Lao People\'S Democratic Republic', value: 'LA'}, - {text: 'Latvia', value: 'LV'}, - {text: 'Lebanon', value: 'LB'}, - {text: 'Lesotho', value: 'LS'}, - {text: 'Liberia', value: 'LR'}, - {text: 'Libyan Arab Jamahiriya', value: 'LY'}, - {text: 'Liechtenstein', value: 'LI'}, - {text: 'Lithuania', value: 'LT'}, - {text: 'Luxembourg', value: 'LU'}, - {text: 'Macao', value: 'MO'}, - {text: 'Macedonia, The Former Yugoslav Republic of', value: 'MK'}, - {text: 'Madagascar', value: 'MG'}, - {text: 'Malawi', value: 'MW'}, - {text: 'Malaysia', value: 'MY'}, - {text: 'Maldives', value: 'MV'}, - {text: 'Mali', value: 'ML'}, - {text: 'Malta', value: 'MT'}, - {text: 'Marshall Islands', value: 'MH'}, - {text: 'Martinique', value: 'MQ'}, - {text: 'Mauritania', value: 'MR'}, - {text: 'Mauritius', value: 'MU'}, - {text: 'Mayotte', value: 'YT'}, - {text: 'Mexico', value: 'MX'}, - {text: 'Micronesia, Federated States of', value: 'FM'}, - {text: 'Moldova, Republic of', value: 'MD'}, - {text: 'Monaco', value: 'MC'}, - {text: 'Mongolia', value: 'MN'}, - {text: 'Montserrat', value: 'MS'}, - {text: 'Morocco', value: 'MA'}, - {text: 'Mozambique', value: 'MZ'}, - {text: 'Myanmar', value: 'MM'}, - {text: 'Namibia', value: 'NA'}, - {text: 'Nauru', value: 'NR'}, - {text: 'Nepal', value: 'NP'}, - {text: 'Netherlands', value: 'NL'}, - {text: 'Netherlands Antilles', value: 'AN'}, - {text: 'New Caledonia', value: 'NC'}, - {text: 'New Zealand', value: 'NZ'}, - {text: 'Nicaragua', value: 'NI'}, - {text: 'Niger', value: 'NE'}, - {text: 'Nigeria', value: 'NG'}, - {text: 'Niue', value: 'NU'}, - {text: 'Norfolk Island', value: 'NF'}, - {text: 'Northern Mariana Islands', value: 'MP'}, - {text: 'Norway', value: 'NO'}, - {text: 'Oman', value: 'OM'}, - {text: 'Pakistan', value: 'PK'}, - {text: 'Palau', value: 'PW'}, - {text: 'Palestinian Territory, Occupied', value: 'PS'}, - {text: 'Panama', value: 'PA'}, - {text: 'Papua New Guinea', value: 'PG'}, - {text: 'Paraguay', value: 'PY'}, - {text: 'Peru', value: 'PE'}, - {text: 'Philippines', value: 'PH'}, - {text: 'Pitcairn', value: 'PN'}, - {text: 'Poland', value: 'PL'}, - {text: 'Portugal', value: 'PT'}, - {text: 'Puerto Rico', value: 'PR'}, - {text: 'Qatar', value: 'QA'}, - {text: 'Reunion', value: 'RE'}, - {text: 'Romania', value: 'RO'}, - {text: 'Russian Federation', value: 'RU'}, - {text: 'RWANDA', value: 'RW'}, - {text: 'Saint Helena', value: 'SH'}, - {text: 'Saint Kitts and Nevis', value: 'KN'}, - {text: 'Saint Lucia', value: 'LC'}, - {text: 'Saint Pierre and Miquelon', value: 'PM'}, - {text: 'Saint Vincent and the Grenadines', value: 'VC'}, - {text: 'Samoa', value: 'WS'}, - {text: 'San Marino', value: 'SM'}, - {text: 'Sao Tome and Principe', value: 'ST'}, - {text: 'Saudi Arabia', value: 'SA'}, - {text: 'Senegal', value: 'SN'}, - {text: 'Serbia and Montenegro', value: 'CS'}, - {text: 'Seychelles', value: 'SC'}, - {text: 'Sierra Leone', value: 'SL'}, - {text: 'Singapore', value: 'SG'}, - {text: 'Slovakia', value: 'SK'}, - {text: 'Slovenia', value: 'SI'}, - {text: 'Solomon Islands', value: 'SB'}, - {text: 'Somalia', value: 'SO'}, - {text: 'South Africa', value: 'ZA'}, - {text: 'South Georgia and the South Sandwich Islands', value: 'GS'}, - {text: 'Spain', value: 'ES'}, - {text: 'Sri Lanka', value: 'LK'}, - {text: 'Sudan', value: 'SD'}, - {text: 'Suritext', value: 'SR'}, - {text: 'Svalbard and Jan Mayen', value: 'SJ'}, - {text: 'Swaziland', value: 'SZ'}, - {text: 'Sweden', value: 'SE'}, - {text: 'Switzerland', value: 'CH'}, - {text: 'Syrian Arab Republic', value: 'SY'}, - {text: 'Taiwan, Province of China', value: 'TW'}, - {text: 'Tajikistan', value: 'TJ'}, - {text: 'Tanzania, United Republic of', value: 'TZ'}, - {text: 'Thailand', value: 'TH'}, - {text: 'Timor-Leste', value: 'TL'}, - {text: 'Togo', value: 'TG'}, - {text: 'Tokelau', value: 'TK'}, - {text: 'Tonga', value: 'TO'}, - {text: 'Trinidad and Tobago', value: 'TT'}, - {text: 'Tunisia', value: 'TN'}, - {text: 'Turkey', value: 'TR'}, - {text: 'Turkmenistan', value: 'TM'}, - {text: 'Turks and Caicos Islands', value: 'TC'}, - {text: 'Tuvalu', value: 'TV'}, - {text: 'Uganda', value: 'UG'}, - {text: 'Ukraine', value: 'UA'}, - {text: 'United Arab Emirates', value: 'AE'}, - {text: 'United Kingdom', value: 'GB'}, - {text: 'United States', value: 'US'}, - {text: 'United States Minor Outlying Islands', value: 'UM'}, - {text: 'Uruguay', value: 'UY'}, - {text: 'Uzbekistan', value: 'UZ'}, - {text: 'Vanuatu', value: 'VU'}, - {text: 'Venezuela', value: 'VE'}, - {text: 'Viet Nam', value: 'VN'}, - {text: 'Virgin Islands, British', value: 'VG'}, - {text: 'Virgin Islands, U.S.', value: 'VI'}, - {text: 'Wallis and Futuna', value: 'WF'}, - {text: 'Western Sahara', value: 'EH'}, - {text: 'Yemen', value: 'YE'}, - {text: 'Zambia', value: 'ZM'}, - {text: 'Zimbabwe', value: 'ZW'} - ] - } -} \ No newline at end of file diff --git a/src/services/schema.gql b/src/services/schema.gql index 9eac6cf..a4c8021 100644 --- a/src/services/schema.gql +++ b/src/services/schema.gql @@ -11,21 +11,25 @@ input ApproveCaseInput { """KYC Customer""" type Customer { countryOfResidence: String! + entityType: String! + industryType: String! name: String! personalIdentificationNumber: String! - riskCategory: String! } input CustomerInput { countryOfResidence: String! + entityType: String! + industryType: String! name: String! personalIdentificationNumber: String! - riskCategory: String! } """Customer risk assessment""" type CustomerRiskAssessment { - result: String! + error: String + rating: String! + score: Float! } """Data extraction question""" @@ -57,10 +61,17 @@ type Document { } input DocumentInput { + id: ID! name: String! path: String! } +"""Object representing a key/value pair""" +type FormOption { + text: String! + value: String! +} + """greeting""" type Greeting { greeting: String! @@ -68,6 +79,7 @@ type Greeting { """KYC Case""" type KycCase { + caseSummary: KycCaseSummary counterparty: Person counterpartyNegativeScreening: NegativeScreening customer: Customer! @@ -79,15 +91,23 @@ type KycCase { status: String! } +"""KYC case summary""" +type KycCaseSummary { + error: String + summary: String! +} + type Mutation { - addDocumentToCase(caseId: ID!, documentName: String!, documentPath: String!): KycCase! + addDocumentToCase(caseId: ID!, documentName: String!, documentUrl: String!): KycCase! approveCase(case: ApproveCaseInput!): KycCase! createCase(customer: CustomerInput!): KycCase! + removeDocumentFromCase(caseId: ID!, documentId: ID!): KycCase! reviewCase(case: ReviewCaseInput!): KycCase! } """Negative screening""" type NegativeScreening { + error: String result: String! } @@ -106,8 +126,12 @@ type Query { extractDataForQuestion(customer: String!, question: DataExtractionQuestionIdInput!): DataExtractionResult! extractDataForQuestions(customer: String!, questions: [DataExtractionQuestionIdInput!]!): [DataExtractionResult!]! getCase(id: ID!): KycCase! + getDocument(id: ID!): Document! helloWorld: Greeting! listCases: [KycCase!]! + listCountries: [FormOption!]! + listEntityTypes: [FormOption!]! + listIndustryTypes: [FormOption!]! listQuestions: [DataExtractionQuestion!]! } diff --git a/src/utils/collections.ts b/src/utils/collections.ts new file mode 100644 index 0000000..3e58b81 --- /dev/null +++ b/src/utils/collections.ts @@ -0,0 +1,17 @@ +export const leftOuter = (a: T[], b: T[]): T[] => { + const ids = b.map(val => val.id); + + return a.filter(val => !ids.includes(val.id)); +} + +export const rightOuter = (a: T[], b: T[]): T[] => { + const ids = a.map(val => val.id); + + return b.filter(val => !ids.includes(val.id)); +} + +export const inner = (a: T[], b: T[]): T[] => { + const ids = a.map(val => val.id); + + return b.filter(val => ids.includes(val.id)); +} diff --git a/src/utils/index.ts b/src/utils/index.ts index 63b84d4..10487a0 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,4 +1,8 @@ -export * from './first'; +export * from './collections'; +export * from './csv'; export * from './delay'; export * from './file-list'; -export * from './csv'; +export * from './first'; +export * from './load-document'; +export * from './stream-to-buffer'; +export * from './url-to-stream'; diff --git a/src/utils/load-document.ts b/src/utils/load-document.ts new file mode 100644 index 0000000..7e5fd8d --- /dev/null +++ b/src/utils/load-document.ts @@ -0,0 +1,16 @@ +import Stream from "stream"; +import {isDocumentContent, isDocumentRef} from "../models"; +import {urlToStream} from "./url-to-stream.ts"; +import {streamToBuffer} from "./stream-to-buffer.ts"; + +export const loadDocument = async (document: {url: string} | {content: Buffer} | {stream: Stream}): Promise => { + if (isDocumentContent(document)) { + return document.content; + } + + const stream: Stream = isDocumentRef(document) + ? await urlToStream(document.url) + : document.stream; + + return streamToBuffer(stream); +} diff --git a/src/utils/stream-to-buffer.ts b/src/utils/stream-to-buffer.ts new file mode 100644 index 0000000..fb43d66 --- /dev/null +++ b/src/utils/stream-to-buffer.ts @@ -0,0 +1,12 @@ +import * as Stream from "stream"; + +export const streamToBuffer = async (stream: Stream): Promise => { + return new Promise((resolve, reject) => { + + const chunks = []; + + stream.on('data', (data) => chunks.push(data)); + stream.on('end', () => resolve(Buffer.concat(chunks))); + stream.on('error', (err) => reject(err)); + }); +} diff --git a/src/utils/url-to-stream.ts b/src/utils/url-to-stream.ts new file mode 100644 index 0000000..d9ce87d --- /dev/null +++ b/src/utils/url-to-stream.ts @@ -0,0 +1,9 @@ +import * as Stream from "stream"; +import axios from "axios"; + +export const urlToStream = async (url: string): Promise => { + return axios.get(url, { + responseType: 'stream', + }) + .then(response => response.data) +} diff --git a/src/views/Dashboard/Dashboard.tsx b/src/views/Dashboard/Dashboard.tsx index 6a42d5f..a1b00c5 100644 --- a/src/views/Dashboard/Dashboard.tsx +++ b/src/views/Dashboard/Dashboard.tsx @@ -4,12 +4,14 @@ import React from 'react'; import {useAtomValue} from "jotai"; import {DonutChart} from "@carbon/charts-react"; -import {KycCaseStatus, kycCaseStatusAtom} from "../../atoms"; +import {kycCasesLoadable, KycCaseStatus, kycCaseStatusAtom} from "../../atoms"; +import {Loading} from "@carbon/react"; export interface DashboardProps { } export const Dashboard: React.FunctionComponent = () => { + const loadableKycCases = useAtomValue(kycCasesLoadable); const kycCaseStatus: KycCaseStatus[] = useAtomValue(kycCaseStatusAtom) const options = { @@ -23,6 +25,9 @@ export const Dashboard: React.FunctionComponent = () => { height: '400px' } + if (loadableKycCases.state === 'loading') { + return () + } return (
diff --git a/src/views/KYC/KYCCaseDetail/KYCCaseNew/KYCCaseNew.tsx b/src/views/KYC/KYCCaseDetail/KYCCaseNew/KYCCaseNew.tsx index 8c37c28..0982ffd 100644 --- a/src/views/KYC/KYCCaseDetail/KYCCaseNew/KYCCaseNew.tsx +++ b/src/views/KYC/KYCCaseDetail/KYCCaseNew/KYCCaseNew.tsx @@ -6,7 +6,7 @@ import {Button, Form, TextInput} from "@carbon/react"; import PasswordInput from "@carbon/react/es/components/TextInput/PasswordInput"; import {default as setValue} from 'set-value'; -import {CountrySelect, Stack} from "../../../../components"; +import {CountrySelect, EntityTypeSelect, IndustryTypeSelect, Stack} from "../../../../components"; import {createEmptyCustomer, CustomerModel} from "../../../../models"; import {kycCaseManagementApi} from "../../../../services"; @@ -75,14 +75,16 @@ export const KYCCaseNew: React.FunctionComponent = (props: KYCC onChange={handleChange('personalIdentificationNumber')} required={true} /> - +
diff --git a/src/views/KYC/KYCCaseDetail/KYCCaseOutreach/KYCCaseOutreach.tsx b/src/views/KYC/KYCCaseDetail/KYCCaseOutreach/KYCCaseOutreach.tsx index 45ab40b..ae45b28 100644 --- a/src/views/KYC/KYCCaseDetail/KYCCaseOutreach/KYCCaseOutreach.tsx +++ b/src/views/KYC/KYCCaseDetail/KYCCaseOutreach/KYCCaseOutreach.tsx @@ -7,8 +7,9 @@ import {Button, Checkbox, FileUploader, Form, TextInput} from "@carbon/react"; import './KYCCaseOutreach.scss'; import {CountrySelect, DocumentList, Stack} from "../../../../components"; import {ApproveCaseModel, createEmptyApproveCase, KycCaseModel,} from "../../../../models"; -import {kycCaseManagementApi} from "../../../../services"; -import {fileListUtil} from "../../../../utils"; +import {KycCaseManagementApi, kycCaseManagementApi} from "../../../../services"; +import {handleFileUploaderChange} from "../util"; +import {leftOuter} from "../../../../utils"; export interface KYCCaseReviewProps { currentCase: KycCaseModel; @@ -20,7 +21,7 @@ export const KYCCaseOutreach: React.FunctionComponent = (pro const [updatedCase, setUpdatedCase] = useState(createEmptyApproveCase(props.currentCase.id)) const [fileStatus, setFileStatus] = useState<'edit' | 'complete' | 'uploading'>('edit') - const service = kycCaseManagementApi(); + const service: KycCaseManagementApi = kycCaseManagementApi(); const handleCancel = () => { navigate(props.returnUrl); @@ -34,22 +35,6 @@ export const KYCCaseOutreach: React.FunctionComponent = (pro navigate(props.returnUrl); } - const handleFileUploaderChange = (event: {target: {files: FileList, filenameStatus: string}}) => { - const files: FileList = event.target.files; - const fileNames = fileListUtil(files).map(f => f.name) - - console.log('File uploader: ', {event, files, fileNames}); - - setFileStatus('uploading') - setTimeout(() => setFileStatus('complete'), 1000) - - // TODO handle document remove - const documents = updatedCase.documents.concat(fileNames.map(name => ({name, path: name, id: ''}))) - - setUpdatedCase(Object.assign({}, updatedCase, {documents})) - - } - return (
@@ -70,15 +55,6 @@ export const KYCCaseOutreach: React.FunctionComponent = (pro readOnly={true} style={{marginBottom: '20px'}} /> -
= (pro readOnly={true} style={{marginBottom: '20px'}} /> - + = (pro multiple={true} disabled={false} iconDescription="Delete file" - onChange={handleFileUploaderChange} + onChange={handleFileUploaderChange(props.currentCase.id, updatedCase, setUpdatedCase, setFileStatus)} name="" />
diff --git a/src/views/KYC/KYCCaseDetail/KYCCasePending/KYCCasePending.tsx b/src/views/KYC/KYCCaseDetail/KYCCasePending/KYCCasePending.tsx index ff0d92d..a8a5f52 100644 --- a/src/views/KYC/KYCCaseDetail/KYCCasePending/KYCCasePending.tsx +++ b/src/views/KYC/KYCCaseDetail/KYCCasePending/KYCCasePending.tsx @@ -37,15 +37,6 @@ export const KYCCasePending: React.FunctionComponent = (pro readOnly={true} style={{marginBottom: '20px'}} /> -
= (props const [updatedCase, setUpdatedCase] = useState(createEmptyReviewCase(props.currentCase.id)) const [fileStatus, setFileStatus] = useState<'edit' | 'complete' | 'uploading'>('edit') - const service = kycCaseManagementApi(); + const service: KycCaseManagementApi = kycCaseManagementApi(); const handleCancel = () => { navigate(props.returnUrl); @@ -35,23 +36,6 @@ export const KYCCaseReview: React.FunctionComponent = (props navigate(props.returnUrl); } - const handleFileUploaderChange = (event: {target: {files: FileList, filenameStatus: string}}) => { - const files: FileList = event.target.files; - const fileNames = fileListUtil(files).map(f => f.name) - - console.log('File uploader: ', {event, files, fileNames}); - - - setFileStatus('uploading') - setTimeout(() => setFileStatus('complete'), 1000) - - // TODO handle document remove - const documents = updatedCase.documents.concat(fileNames.map(name => ({name, path: name, id: ''}))) - - setUpdatedCase(Object.assign({}, updatedCase, {documents})) - - } - const handleCustomerOutreach = (_: ChangeEvent, data: {checked: boolean}) => { const copy: ReviewCaseModel = JSON.parse(JSON.stringify(updatedCase)); @@ -91,13 +75,16 @@ export const KYCCaseReview: React.FunctionComponent = (props readOnly={true} style={{marginBottom: '20px'}} /> - +
@@ -116,16 +103,17 @@ export const KYCCaseReview: React.FunctionComponent = (props labelText="Counterparty name" placeholder="Counterparty name" value={updatedCase.counterparty?.name || ''} - onChange={handleChange('counterParty.name')} + onChange={handleChange('counterparty.name')} required={true} /> + = (props multiple={true} disabled={false} iconDescription="Delete file" - onChange={handleFileUploaderChange} + onChange={handleFileUploaderChange(props.currentCase.id, updatedCase, setUpdatedCase, setFileStatus)} name="" />
diff --git a/src/views/KYC/KYCCaseDetail/util/event-handler.util.ts b/src/views/KYC/KYCCaseDetail/util/event-handler.util.ts new file mode 100644 index 0000000..13fce95 --- /dev/null +++ b/src/views/KYC/KYCCaseDetail/util/event-handler.util.ts @@ -0,0 +1,30 @@ +import {DocumentedCase, DocumentModel} from "../../../../models"; +import {fileUploadApi, FileUploadApi} from "../../../../services"; +import {fileListUtil} from "../../../../utils"; + +export const handleFileUploaderChange = (caseId: string, updatedCase: T, setUpdatedCase, setFileStatus) => { + const fileUploadService: FileUploadApi = fileUploadApi(); + + return (event: {target: {files: FileList, filenameStatus: string}}) => { + const fileList: FileList = event.target.files; + const files: File[] = fileListUtil(fileList); + + console.log('File uploader: ', {event, files: fileList, fileNames: files.map(f => f.name)}); + + setFileStatus('uploading') + + // TODO handle document remove + Promise.all(files.map(f => fileUploadService.uploadFile(caseId, f.name, f))) + .then((result: DocumentModel[]) => { + setFileStatus('complete'); + + return result.filter(doc => !!doc); + }) + .then((newDocuments: DocumentModel[]) => { + const documents = updatedCase.documents.concat(newDocuments) + + setUpdatedCase(Object.assign({}, updatedCase, {documents})) + }) + .catch(() => setFileStatus('error')) + } +} diff --git a/src/views/KYC/KYCCaseDetail/util/index.ts b/src/views/KYC/KYCCaseDetail/util/index.ts new file mode 100644 index 0000000..416dfa1 --- /dev/null +++ b/src/views/KYC/KYCCaseDetail/util/index.ts @@ -0,0 +1,2 @@ + +export * from './event-handler.util'; diff --git a/src/views/KYC/KYCCaseList/KYCCaseList.tsx b/src/views/KYC/KYCCaseList/KYCCaseList.tsx index aa69870..68a2040 100644 --- a/src/views/KYC/KYCCaseList/KYCCaseList.tsx +++ b/src/views/KYC/KYCCaseList/KYCCaseList.tsx @@ -5,10 +5,11 @@ import {useNavigate} from "react-router-dom"; import {useAtomValue} from "jotai"; import '../KYC.scss'; -import {countriesAtomLoadable, kycCaseAtom} from "../../../atoms"; +import {countriesAtomLoadable, kycCaseAtom, kycCasesLoadable} from "../../../atoms"; import {DataTable} from "../../../components"; -import {FormOptionModel, KycCaseModel} from "../../../models"; +import {CustomerRiskAssessmentModel, FormOptionModel, KycCaseModel} from "../../../models"; import {first} from "../../../utils"; +import {Loading} from "@carbon/react"; export interface KYCCaseListProps { basePath: string; @@ -35,6 +36,14 @@ const mapCountry = (countryCode: string, countries: FormOptionModel[] = []): str .orElse(countryCode); } +const craToString = (riskAssessment?: CustomerRiskAssessmentModel) => { + if (!riskAssessment) { + return '--'; + } + + return `${riskAssessment.rating} (${riskAssessment.score})` +} + const kycCaseModelToTableModel = (countries: FormOptionModel[] = []) => { return (model: KycCaseModel): KycCaseTableModel => { return { @@ -45,12 +54,13 @@ const kycCaseModelToTableModel = (countries: FormOptionModel[] = []) => { customerOutreach: model.customerOutreach || 'N/A', negativeScreening: model.negativeScreening?.result || '--', counterpartyNegativeScreening: model.counterpartyNegativeScreening?.result || '--', - customerRiskAssessment: model.customerRiskAssessment?.result || '--' + customerRiskAssessment: craToString(model.customerRiskAssessment), } } } export const KYCCaseList: React.FunctionComponent = (props: KYCCaseListProps) => { + const loadableKycCases = useAtomValue(kycCasesLoadable); const kycCases = useAtomValue(kycCaseAtom); const countriesLoadable = useAtomValue(countriesAtomLoadable); const navigate = useNavigate(); @@ -75,6 +85,10 @@ export const KYCCaseList: React.FunctionComponent = (props: KY navigate(url) } + if (loadableKycCases.state === 'loading') { + return () + } + return (
{ const env = loadEnv(mode, process.cwd(), '') - const apiTarget: string = env.API_TARGET || 'http://localhost:3000'; - const graphqlTarget: string = env.GRAPHQL_TARGET || 'http://localhost:3000'; - const socketTarget: string = env.SOCKET_TARGET || 'ws://localhost:3000'; + const apiTarget: string = env.API_TARGET1 || 'http://localhost:3000'; + const graphqlTarget: string = env.GRAPHQL_TARGET1 || 'http://localhost:3000'; + const socketTarget: string = env.SOCKET_TARGET1 || 'ws://localhost:3000'; console.log('Target urls: ', {apiTarget, graphqlTarget, socketTarget, mode})