@lysaab/lysa-pep 3.0.4 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/Exports.d.ts +7 -7
  2. package/Exports.js +7 -7
  3. package/components/PepAnswers.d.ts +8 -8
  4. package/components/PepAnswers.js +103 -137
  5. package/messages/src/components/PepAnswers.json +1 -1
  6. package/messages/src/pages/IsPep/IsPepMessages.json +1 -1
  7. package/messages/src/pages/IsPep/IsPepPage.json +1 -1
  8. package/messages/src/pages/RelationPage/RelationMessages.json +1 -1
  9. package/messages/src/pages/RelationPage/RelationPage.json +1 -1
  10. package/messages/src/pages/RolePage/RoleMessages.json +1 -1
  11. package/messages/src/pages/RolePage/RolePage.json +1 -1
  12. package/messages/src/pages/StatusPage/StatusMessages.json +1 -1
  13. package/messages/src/pages/StatusPage/StatusPage.json +1 -1
  14. package/model/PepModel.d.ts +7 -7
  15. package/model/PepModel.js +40 -40
  16. package/package.json +3 -3
  17. package/pages/IsPep/IsPepMessages.d.ts +20 -32
  18. package/pages/IsPep/IsPepMessages.js +10 -70
  19. package/pages/IsPep/IsPepPage.d.ts +15 -15
  20. package/pages/IsPep/IsPepPage.js +61 -61
  21. package/pages/PepContext.d.ts +80 -81
  22. package/pages/PepContext.js +88 -89
  23. package/pages/RelationPage/RelationMessages.d.ts +67 -105
  24. package/pages/RelationPage/RelationMessages.js +69 -287
  25. package/pages/RelationPage/RelationPage.d.ts +6 -6
  26. package/pages/RelationPage/RelationPage.js +158 -156
  27. package/pages/RolePage/RoleMessages.d.ts +115 -185
  28. package/pages/RolePage/RoleMessages.js +117 -385
  29. package/pages/RolePage/RolePage.d.ts +13 -11
  30. package/pages/RolePage/RolePage.js +222 -223
  31. package/pages/StatusPage/StatusMessages.d.ts +48 -72
  32. package/pages/StatusPage/StatusMessages.js +50 -272
  33. package/pages/StatusPage/StatusPage.d.ts +10 -8
  34. package/pages/StatusPage/StatusPage.js +104 -105
  35. package/utils/Possession.d.ts +1 -1
  36. package/utils/Possession.js +27 -27
  37. package/components/CountrySelect.d.ts +0 -11
  38. package/components/CountrySelect.js +0 -41
  39. package/messages/src/components/CountrySelect.json +0 -1
@@ -1,70 +1,10 @@
1
- import { defineMessages } from "react-intl";
2
- import { PepType } from "../PepContext";
3
- export const messages = defineMessages({
4
- header: {
5
- id: "pep.ispep.header",
6
- description: "Is PEP question header",
7
- defaultMessage: `{
8
- entityType, select,
9
- PERSON {
10
- Are you or is a peer close to you a politically exposed person (PEP)?
11
- }
12
- CORPORATION {
13
- Is {name} or a person close to {name} a politically exposed person (PEP)?
14
- }
15
- other {}
16
- }`,
17
- },
18
- required: {
19
- id: "pep.ispep.required",
20
- description: "Required validator text",
21
- defaultMessage: "You need to choose an alternative",
22
- },
23
- [PepType.NOT_PEP]: {
24
- id: "pep.ispep.NOT_PEP",
25
- description: "Not pep",
26
- defaultMessage: "No",
27
- },
28
- [PepType.ME]: {
29
- id: "pep.ispep.ME",
30
- description: "The person is pep",
31
- defaultMessage: `{
32
- entityType, select,
33
- PERSON {
34
- I have a role which makes me a PEP
35
- }
36
- CORPORATION {
37
- {name} is PEP because of his or her role
38
- }
39
- other {}
40
- }`,
41
- },
42
- [PepType.RELATIVE]: {
43
- id: "pep.ispep.RELATIVE",
44
- description: "I have a relationship with a person that is a PEP",
45
- defaultMessage: `{
46
- entityType, select,
47
- PERSON {
48
- I have a relationship with a person that is a PEP
49
- }
50
- CORPORATION {
51
- {name} has a relationship with a PEP
52
- }
53
- other {}
54
- }`,
55
- },
56
- [PepType.COLLEAGUE]: {
57
- id: "pep.ispep.COLLEAGUE",
58
- description: "The person has a colleague that is a PEP",
59
- defaultMessage: `{
60
- entityType, select,
61
- PERSON {
62
- I work for, or have a business relationship with, a PEP
63
- }
64
- CORPORATION {
65
- {name} works for, or has a business relationship with, a PEP
66
- }
67
- other {}
68
- }`,
69
- },
70
- });
1
+ import { defineMessages } from "react-intl";
2
+ import { PepType } from "../PepContext";
3
+ export const messages = defineMessages({
4
+ header: { id: "pep.ispep.header" },
5
+ required: { id: "pep.ispep.required" },
6
+ [PepType.NOT_PEP]: { id: "pep.ispep.NOT_PEP" },
7
+ [PepType.ME]: { id: "pep.ispep.ME" },
8
+ [PepType.RELATIVE]: { id: "pep.ispep.RELATIVE" },
9
+ [PepType.COLLEAGUE]: { id: "pep.ispep.COLLEAGUE" },
10
+ });
@@ -1,15 +1,15 @@
1
- import React, { FunctionComponent } from "react";
2
- import { PepType, EntityType } from "../PepContext";
3
- export interface QuestionsProps {
4
- ownerName?: string;
5
- entityType?: EntityType;
6
- type?: PepType;
7
- onChange: (type: PepType) => void;
8
- resetValues?: () => void;
9
- }
10
- export declare const IsPepQuestion: React.FC<QuestionsProps>;
11
- interface Props {
12
- next: () => void;
13
- }
14
- export declare const IsPepPage: FunctionComponent<Props>;
15
- export {};
1
+ import React, { FunctionComponent } from "react";
2
+ import { PepType, EntityType } from "../PepContext";
3
+ export interface QuestionsProps {
4
+ ownerName?: string;
5
+ entityType?: EntityType;
6
+ type?: PepType;
7
+ onChange: (type: PepType) => void;
8
+ resetValues?: () => void;
9
+ }
10
+ export declare const IsPepQuestion: React.FC<QuestionsProps>;
11
+ interface Props {
12
+ next: () => void;
13
+ }
14
+ export declare const IsPepPage: FunctionComponent<Props>;
15
+ export {};
@@ -1,61 +1,61 @@
1
- import React, { useRef, useCallback, useContext, } from "react";
2
- import { Form, RadioGroup, RequiredValidator, PrimaryButton, Card, } from "@lysaab/ui-2";
3
- import { PepType, PepContext, EntityType } from "../PepContext";
4
- import { useIntl, FormattedMessage } from "react-intl";
5
- import { messages } from "./IsPepMessages";
6
- export const IsPepQuestion = ({ ownerName, entityType, type, onChange, resetValues, }) => {
7
- const intl = useIntl();
8
- const IsPepAlternatives = [
9
- {
10
- text: intl.formatMessage(messages[PepType.NOT_PEP], {
11
- entityType,
12
- name: ownerName,
13
- }),
14
- value: PepType.NOT_PEP,
15
- },
16
- {
17
- text: intl.formatMessage(messages[PepType.ME], {
18
- entityType,
19
- name: ownerName,
20
- }),
21
- value: PepType.ME,
22
- },
23
- {
24
- text: intl.formatMessage(messages[PepType.RELATIVE], {
25
- entityType,
26
- name: ownerName,
27
- }),
28
- value: PepType.RELATIVE,
29
- },
30
- {
31
- text: intl.formatMessage(messages[PepType.COLLEAGUE], {
32
- entityType,
33
- name: ownerName,
34
- }),
35
- value: PepType.COLLEAGUE,
36
- },
37
- ];
38
- return (React.createElement(RadioGroup, { alternatives: IsPepAlternatives, onChange: (alternative) => {
39
- onChange(alternative.value);
40
- resetValues === null || resetValues === void 0 ? void 0 : resetValues();
41
- }, value: IsPepAlternatives.find((alt) => alt.value === type), header: intl.formatMessage(messages.header, {
42
- entityType,
43
- name: ownerName,
44
- }), validators: [
45
- new RequiredValidator(intl.formatMessage(messages.required)),
46
- ], "data-test-id": "pep-ispep" }));
47
- };
48
- export const IsPepPage = ({ next }) => {
49
- const pepContext = useContext(PepContext);
50
- const formRef = useRef();
51
- const nextPage = useCallback(() => {
52
- if (formRef.current && formRef.current.isValid) {
53
- next();
54
- }
55
- }, [formRef, next]);
56
- return (React.createElement(Form, { onSubmit: nextPage, lysaFormRef: formRef },
57
- React.createElement(Card, null,
58
- React.createElement(IsPepQuestion, { ownerName: pepContext.state.ownerName, entityType: pepContext.state.legalEntityType || EntityType.PERSON, type: pepContext.state.type, onChange: (type) => pepContext.setState({ type }) })),
59
- React.createElement(PrimaryButton, { block: true, type: "submit" },
60
- React.createElement(FormattedMessage, { id: "pep.ispep.next", description: "Next button", defaultMessage: "Next" }))));
61
- };
1
+ import React, { useRef, useCallback, useContext, } from "react";
2
+ import { Form, RadioGroup, RequiredValidator, PrimaryButton, Card, } from "@lysaab/ui-2";
3
+ import { PepType, PepContext, EntityType } from "../PepContext";
4
+ import { useIntl, FormattedMessage } from "react-intl";
5
+ import { messages } from "./IsPepMessages";
6
+ export const IsPepQuestion = ({ ownerName, entityType, type, onChange, resetValues, }) => {
7
+ const intl = useIntl();
8
+ const IsPepAlternatives = [
9
+ {
10
+ text: intl.formatMessage(messages[PepType.NOT_PEP], {
11
+ entityType,
12
+ name: ownerName,
13
+ }),
14
+ value: PepType.NOT_PEP,
15
+ },
16
+ {
17
+ text: intl.formatMessage(messages[PepType.ME], {
18
+ entityType,
19
+ name: ownerName,
20
+ }),
21
+ value: PepType.ME,
22
+ },
23
+ {
24
+ text: intl.formatMessage(messages[PepType.RELATIVE], {
25
+ entityType,
26
+ name: ownerName,
27
+ }),
28
+ value: PepType.RELATIVE,
29
+ },
30
+ {
31
+ text: intl.formatMessage(messages[PepType.COLLEAGUE], {
32
+ entityType,
33
+ name: ownerName,
34
+ }),
35
+ value: PepType.COLLEAGUE,
36
+ },
37
+ ];
38
+ return (React.createElement(RadioGroup, { alternatives: IsPepAlternatives, onChange: (alternative) => {
39
+ onChange(alternative.value);
40
+ resetValues === null || resetValues === void 0 ? void 0 : resetValues();
41
+ }, value: IsPepAlternatives.find((alt) => alt.value === type), header: intl.formatMessage(messages.header, {
42
+ entityType,
43
+ name: ownerName,
44
+ }), validators: [
45
+ new RequiredValidator(intl.formatMessage(messages.required)),
46
+ ], "data-test-id": "pep-ispep" }));
47
+ };
48
+ export const IsPepPage = ({ next }) => {
49
+ const pepContext = useContext(PepContext);
50
+ const formRef = useRef();
51
+ const nextPage = useCallback(() => {
52
+ if (formRef.current && formRef.current.isValid) {
53
+ next();
54
+ }
55
+ }, [formRef, next]);
56
+ return (React.createElement(Form, { onSubmit: nextPage, lysaFormRef: formRef },
57
+ React.createElement(Card, null,
58
+ React.createElement(IsPepQuestion, { ownerName: pepContext.state.ownerName, entityType: pepContext.state.legalEntityType || EntityType.PERSON, type: pepContext.state.type, onChange: (type) => pepContext.setState({ type }) })),
59
+ React.createElement(PrimaryButton, { block: true, type: "submit" },
60
+ React.createElement(FormattedMessage, { id: "pep.ispep.next" }))));
61
+ };
@@ -1,81 +1,80 @@
1
- import React from "react";
2
- export declare enum EntityType {
3
- PERSON = "PERSON",
4
- CORPORATION = "CORPORATION"
5
- }
6
- export declare enum PepType {
7
- NOT_PEP = "NOT_PEP",
8
- ME = "ME",
9
- RELATIVE = "RELATIVE",
10
- COLLEAGUE = "COLLEAGUE"
11
- }
12
- export declare enum PepStatus {
13
- ONGOING = "ONGOING",
14
- ENDED = "ENDED"
15
- }
16
- export declare enum Role {
17
- HEAD_OF_GOVERNMENT = "HEAD_OF_GOVERNMENT",
18
- MINISTER = "MINISTER",
19
- PARLIMENT_MEMBER = "PARLIMENT_MEMBER",
20
- CENTRAL_BANK_MEMBER = "CENTRAL_BANK_MEMBER",
21
- BOARD_MEMBER_POLITICAL_PARTY = "BOARD_MEMBER_POLITICAL_PARTY",
22
- JUDGE_SUPREME_COURT = "JUDGE_SUPREME_COURT",
23
- JUDGE_OTHER_HIGH_COURT = "JUDGE_OTHER_HIGH_COURT",
24
- REVISION_INSTITUTE = "REVISION_INSTITUTE",
25
- AMBASSADOR = "AMBASSADOR",
26
- MILITARY_OFFICER = "MILITARY_OFFICER",
27
- GOVERNMENT_COMPANY = "GOVERNMENT_COMPANY",
28
- EU_HIGH_RANKING_POSITION = "EU_HIGH_RANKING_POSITION",
29
- HIGH_RANKING_POSITION_INTERNALTIONAL_CORP = "HIGH_RANKING_POSITION_INTERNALTIONAL_CORP"
30
- }
31
- export declare enum Relation {
32
- MARRIED_PARTNER = "MARRIED_PARTNER",
33
- COLIVING_PARTNER = "COLIVING_PARTNER",
34
- CHILD = "CHILD",
35
- PARENT = "PARENT",
36
- CHILD_MARRIED_PARTNER = "CHILD_MARRIED_PARTNER",
37
- CHILD_COLIVING_PARTNER = "CHILD_COLIVING_PARTNER"
38
- }
39
- export declare enum BusinessRelation {
40
- CO_OWNERSHIP = "CO_OWNERSHIP",
41
- CLOSE_CONNECTION = "CLOSE_CONNECTION",
42
- COMPANY_FOR_PEP = "COMPANY_FOR_PEP"
43
- }
44
- export declare enum MilitaryRank {
45
- GENERAL = "GENERAL",
46
- LIEUTENANT_GENERAL = "LIEUTENANT_GENERAL",
47
- MAJOR_GENERAL = "MAJOR_GENERAL",
48
- ADMIRAL = "ADMIRAL",
49
- VICE_ADMIRAL = "VICE_ADMIRAL",
50
- REAR_ADMIRAL = "REAR_ADMIRAL"
51
- }
52
- export interface PepState {
53
- legalEntityType?: EntityType;
54
- type?: PepType;
55
- role?: Role;
56
- country?: string;
57
- ended?: Date;
58
- ambassadorCountry?: string;
59
- militaryRank?: MilitaryRank;
60
- governmentCompany?: string;
61
- governmentCompanyRole?: string;
62
- internationalOrganisation?: string;
63
- internationalOrganisationRole?: string;
64
- relationToPEP?: Relation;
65
- nameOfPEP?: string;
66
- birthdayOfPEP?: Date;
67
- tin?: string;
68
- businessRelation?: BusinessRelation;
69
- locked?: boolean;
70
- isOngoing?: PepStatus;
71
- isLocalCountry?: string;
72
- ownerName?: string;
73
- }
74
- export declare const EMPTY_PEP_STATE: PepState;
75
- export interface PepContextProps {
76
- state: PepState;
77
- setState: (newState: Partial<PepState>) => void;
78
- }
79
- export declare const PepContext: React.Context<PepContextProps>;
80
- export declare const withPep: <P extends object>(Component: React.ComponentType<P>) => React.FC<Omit<P, keyof PepContextProps>>;
81
- export declare const PepContextProvider: React.FC;
1
+ import React from "react";
2
+ export declare enum EntityType {
3
+ PERSON = "PERSON",
4
+ CORPORATION = "CORPORATION"
5
+ }
6
+ export declare enum PepType {
7
+ NOT_PEP = "NOT_PEP",
8
+ ME = "ME",
9
+ RELATIVE = "RELATIVE",
10
+ COLLEAGUE = "COLLEAGUE"
11
+ }
12
+ export declare enum PepStatus {
13
+ ONGOING = "ONGOING",
14
+ ENDED = "ENDED"
15
+ }
16
+ export declare enum Role {
17
+ HEAD_OF_GOVERNMENT = "HEAD_OF_GOVERNMENT",
18
+ MINISTER = "MINISTER",
19
+ PARLIMENT_MEMBER = "PARLIMENT_MEMBER",
20
+ CENTRAL_BANK_MEMBER = "CENTRAL_BANK_MEMBER",
21
+ BOARD_MEMBER_POLITICAL_PARTY = "BOARD_MEMBER_POLITICAL_PARTY",
22
+ JUDGE_SUPREME_COURT = "JUDGE_SUPREME_COURT",
23
+ JUDGE_OTHER_HIGH_COURT = "JUDGE_OTHER_HIGH_COURT",
24
+ REVISION_INSTITUTE = "REVISION_INSTITUTE",
25
+ AMBASSADOR = "AMBASSADOR",
26
+ MILITARY_OFFICER = "MILITARY_OFFICER",
27
+ GOVERNMENT_COMPANY = "GOVERNMENT_COMPANY",
28
+ EU_HIGH_RANKING_POSITION = "EU_HIGH_RANKING_POSITION",
29
+ HIGH_RANKING_POSITION_INTERNALTIONAL_CORP = "HIGH_RANKING_POSITION_INTERNALTIONAL_CORP"
30
+ }
31
+ export declare enum Relation {
32
+ MARRIED_PARTNER = "MARRIED_PARTNER",
33
+ COLIVING_PARTNER = "COLIVING_PARTNER",
34
+ CHILD = "CHILD",
35
+ PARENT = "PARENT",
36
+ CHILD_MARRIED_PARTNER = "CHILD_MARRIED_PARTNER",
37
+ CHILD_COLIVING_PARTNER = "CHILD_COLIVING_PARTNER"
38
+ }
39
+ export declare enum BusinessRelation {
40
+ CO_OWNERSHIP = "CO_OWNERSHIP",
41
+ CLOSE_CONNECTION = "CLOSE_CONNECTION",
42
+ COMPANY_FOR_PEP = "COMPANY_FOR_PEP"
43
+ }
44
+ export declare enum MilitaryRank {
45
+ GENERAL = "GENERAL",
46
+ LIEUTENANT_GENERAL = "LIEUTENANT_GENERAL",
47
+ MAJOR_GENERAL = "MAJOR_GENERAL",
48
+ ADMIRAL = "ADMIRAL",
49
+ VICE_ADMIRAL = "VICE_ADMIRAL",
50
+ REAR_ADMIRAL = "REAR_ADMIRAL"
51
+ }
52
+ export interface PepState {
53
+ legalEntityType?: EntityType;
54
+ type?: PepType;
55
+ role?: Role;
56
+ country?: string;
57
+ ended?: Date;
58
+ ambassadorCountry?: string;
59
+ militaryRank?: MilitaryRank;
60
+ governmentCompany?: string;
61
+ governmentCompanyRole?: string;
62
+ internationalOrganisation?: string;
63
+ internationalOrganisationRole?: string;
64
+ relationToPEP?: Relation;
65
+ nameOfPEP?: string;
66
+ birthdayOfPEP?: Date;
67
+ tin?: string;
68
+ businessRelation?: BusinessRelation;
69
+ isOngoing?: PepStatus;
70
+ isLocalCountry?: string;
71
+ ownerName?: string;
72
+ }
73
+ export declare const EMPTY_PEP_STATE: PepState;
74
+ export interface PepContextProps {
75
+ state: PepState;
76
+ setState: (newState: Partial<PepState>) => void;
77
+ }
78
+ export declare const PepContext: React.Context<PepContextProps>;
79
+ export declare const withPep: <P extends object>(Component: React.ComponentType<P>) => React.FC<Omit<P, keyof PepContextProps>>;
80
+ export declare const PepContextProvider: React.FC;
@@ -1,89 +1,88 @@
1
- import React, { useReducer } from "react";
2
- export var EntityType;
3
- (function (EntityType) {
4
- EntityType["PERSON"] = "PERSON";
5
- EntityType["CORPORATION"] = "CORPORATION";
6
- })(EntityType || (EntityType = {}));
7
- export var PepType;
8
- (function (PepType) {
9
- PepType["NOT_PEP"] = "NOT_PEP";
10
- PepType["ME"] = "ME";
11
- PepType["RELATIVE"] = "RELATIVE";
12
- PepType["COLLEAGUE"] = "COLLEAGUE";
13
- })(PepType || (PepType = {}));
14
- export var PepStatus;
15
- (function (PepStatus) {
16
- PepStatus["ONGOING"] = "ONGOING";
17
- PepStatus["ENDED"] = "ENDED";
18
- })(PepStatus || (PepStatus = {}));
19
- export var Role;
20
- (function (Role) {
21
- Role["HEAD_OF_GOVERNMENT"] = "HEAD_OF_GOVERNMENT";
22
- Role["MINISTER"] = "MINISTER";
23
- Role["PARLIMENT_MEMBER"] = "PARLIMENT_MEMBER";
24
- Role["CENTRAL_BANK_MEMBER"] = "CENTRAL_BANK_MEMBER";
25
- Role["BOARD_MEMBER_POLITICAL_PARTY"] = "BOARD_MEMBER_POLITICAL_PARTY";
26
- Role["JUDGE_SUPREME_COURT"] = "JUDGE_SUPREME_COURT";
27
- Role["JUDGE_OTHER_HIGH_COURT"] = "JUDGE_OTHER_HIGH_COURT";
28
- Role["REVISION_INSTITUTE"] = "REVISION_INSTITUTE";
29
- Role["AMBASSADOR"] = "AMBASSADOR";
30
- Role["MILITARY_OFFICER"] = "MILITARY_OFFICER";
31
- Role["GOVERNMENT_COMPANY"] = "GOVERNMENT_COMPANY";
32
- Role["EU_HIGH_RANKING_POSITION"] = "EU_HIGH_RANKING_POSITION";
33
- Role["HIGH_RANKING_POSITION_INTERNALTIONAL_CORP"] = "HIGH_RANKING_POSITION_INTERNALTIONAL_CORP";
34
- })(Role || (Role = {}));
35
- export var Relation;
36
- (function (Relation) {
37
- Relation["MARRIED_PARTNER"] = "MARRIED_PARTNER";
38
- Relation["COLIVING_PARTNER"] = "COLIVING_PARTNER";
39
- Relation["CHILD"] = "CHILD";
40
- Relation["PARENT"] = "PARENT";
41
- Relation["CHILD_MARRIED_PARTNER"] = "CHILD_MARRIED_PARTNER";
42
- Relation["CHILD_COLIVING_PARTNER"] = "CHILD_COLIVING_PARTNER";
43
- })(Relation || (Relation = {}));
44
- export var BusinessRelation;
45
- (function (BusinessRelation) {
46
- BusinessRelation["CO_OWNERSHIP"] = "CO_OWNERSHIP";
47
- BusinessRelation["CLOSE_CONNECTION"] = "CLOSE_CONNECTION";
48
- BusinessRelation["COMPANY_FOR_PEP"] = "COMPANY_FOR_PEP";
49
- })(BusinessRelation || (BusinessRelation = {}));
50
- export var MilitaryRank;
51
- (function (MilitaryRank) {
52
- MilitaryRank["GENERAL"] = "GENERAL";
53
- MilitaryRank["LIEUTENANT_GENERAL"] = "LIEUTENANT_GENERAL";
54
- MilitaryRank["MAJOR_GENERAL"] = "MAJOR_GENERAL";
55
- MilitaryRank["ADMIRAL"] = "ADMIRAL";
56
- MilitaryRank["VICE_ADMIRAL"] = "VICE_ADMIRAL";
57
- MilitaryRank["REAR_ADMIRAL"] = "REAR_ADMIRAL";
58
- })(MilitaryRank || (MilitaryRank = {}));
59
- export const EMPTY_PEP_STATE = {
60
- legalEntityType: undefined,
61
- type: undefined,
62
- role: undefined,
63
- country: undefined,
64
- ended: undefined,
65
- ambassadorCountry: undefined,
66
- militaryRank: undefined,
67
- governmentCompany: undefined,
68
- governmentCompanyRole: undefined,
69
- internationalOrganisation: undefined,
70
- internationalOrganisationRole: undefined,
71
- relationToPEP: undefined,
72
- nameOfPEP: undefined,
73
- birthdayOfPEP: undefined,
74
- tin: undefined,
75
- businessRelation: undefined,
76
- locked: undefined,
77
- isOngoing: undefined,
78
- isLocalCountry: undefined,
79
- ownerName: undefined,
80
- };
81
- export const PepContext = React.createContext({});
82
- export const withPep = (Component) => (props) => (React.createElement(PepContext.Consumer, null, (contextProps) => React.createElement(Component, Object.assign({}, props, contextProps))));
83
- function stateReducer(state, newState) {
84
- return Object.assign(Object.assign({}, state), newState);
85
- }
86
- export const PepContextProvider = ({ children }) => {
87
- const [pep, setPep] = useReducer(stateReducer, {});
88
- return (React.createElement(PepContext.Provider, { value: { state: pep, setState: setPep } }, children));
89
- };
1
+ import React, { useReducer } from "react";
2
+ export var EntityType;
3
+ (function (EntityType) {
4
+ EntityType["PERSON"] = "PERSON";
5
+ EntityType["CORPORATION"] = "CORPORATION";
6
+ })(EntityType || (EntityType = {}));
7
+ export var PepType;
8
+ (function (PepType) {
9
+ PepType["NOT_PEP"] = "NOT_PEP";
10
+ PepType["ME"] = "ME";
11
+ PepType["RELATIVE"] = "RELATIVE";
12
+ PepType["COLLEAGUE"] = "COLLEAGUE";
13
+ })(PepType || (PepType = {}));
14
+ export var PepStatus;
15
+ (function (PepStatus) {
16
+ PepStatus["ONGOING"] = "ONGOING";
17
+ PepStatus["ENDED"] = "ENDED";
18
+ })(PepStatus || (PepStatus = {}));
19
+ export var Role;
20
+ (function (Role) {
21
+ Role["HEAD_OF_GOVERNMENT"] = "HEAD_OF_GOVERNMENT";
22
+ Role["MINISTER"] = "MINISTER";
23
+ Role["PARLIMENT_MEMBER"] = "PARLIMENT_MEMBER";
24
+ Role["CENTRAL_BANK_MEMBER"] = "CENTRAL_BANK_MEMBER";
25
+ Role["BOARD_MEMBER_POLITICAL_PARTY"] = "BOARD_MEMBER_POLITICAL_PARTY";
26
+ Role["JUDGE_SUPREME_COURT"] = "JUDGE_SUPREME_COURT";
27
+ Role["JUDGE_OTHER_HIGH_COURT"] = "JUDGE_OTHER_HIGH_COURT";
28
+ Role["REVISION_INSTITUTE"] = "REVISION_INSTITUTE";
29
+ Role["AMBASSADOR"] = "AMBASSADOR";
30
+ Role["MILITARY_OFFICER"] = "MILITARY_OFFICER";
31
+ Role["GOVERNMENT_COMPANY"] = "GOVERNMENT_COMPANY";
32
+ Role["EU_HIGH_RANKING_POSITION"] = "EU_HIGH_RANKING_POSITION";
33
+ Role["HIGH_RANKING_POSITION_INTERNALTIONAL_CORP"] = "HIGH_RANKING_POSITION_INTERNALTIONAL_CORP";
34
+ })(Role || (Role = {}));
35
+ export var Relation;
36
+ (function (Relation) {
37
+ Relation["MARRIED_PARTNER"] = "MARRIED_PARTNER";
38
+ Relation["COLIVING_PARTNER"] = "COLIVING_PARTNER";
39
+ Relation["CHILD"] = "CHILD";
40
+ Relation["PARENT"] = "PARENT";
41
+ Relation["CHILD_MARRIED_PARTNER"] = "CHILD_MARRIED_PARTNER";
42
+ Relation["CHILD_COLIVING_PARTNER"] = "CHILD_COLIVING_PARTNER";
43
+ })(Relation || (Relation = {}));
44
+ export var BusinessRelation;
45
+ (function (BusinessRelation) {
46
+ BusinessRelation["CO_OWNERSHIP"] = "CO_OWNERSHIP";
47
+ BusinessRelation["CLOSE_CONNECTION"] = "CLOSE_CONNECTION";
48
+ BusinessRelation["COMPANY_FOR_PEP"] = "COMPANY_FOR_PEP";
49
+ })(BusinessRelation || (BusinessRelation = {}));
50
+ export var MilitaryRank;
51
+ (function (MilitaryRank) {
52
+ MilitaryRank["GENERAL"] = "GENERAL";
53
+ MilitaryRank["LIEUTENANT_GENERAL"] = "LIEUTENANT_GENERAL";
54
+ MilitaryRank["MAJOR_GENERAL"] = "MAJOR_GENERAL";
55
+ MilitaryRank["ADMIRAL"] = "ADMIRAL";
56
+ MilitaryRank["VICE_ADMIRAL"] = "VICE_ADMIRAL";
57
+ MilitaryRank["REAR_ADMIRAL"] = "REAR_ADMIRAL";
58
+ })(MilitaryRank || (MilitaryRank = {}));
59
+ export const EMPTY_PEP_STATE = {
60
+ legalEntityType: undefined,
61
+ type: undefined,
62
+ role: undefined,
63
+ country: undefined,
64
+ ended: undefined,
65
+ ambassadorCountry: undefined,
66
+ militaryRank: undefined,
67
+ governmentCompany: undefined,
68
+ governmentCompanyRole: undefined,
69
+ internationalOrganisation: undefined,
70
+ internationalOrganisationRole: undefined,
71
+ relationToPEP: undefined,
72
+ nameOfPEP: undefined,
73
+ birthdayOfPEP: undefined,
74
+ tin: undefined,
75
+ businessRelation: undefined,
76
+ isOngoing: undefined,
77
+ isLocalCountry: undefined,
78
+ ownerName: undefined,
79
+ };
80
+ export const PepContext = React.createContext({});
81
+ export const withPep = (Component) => props => (React.createElement(PepContext.Consumer, null, contextProps => React.createElement(Component, Object.assign({}, props, contextProps))));
82
+ function stateReducer(state, newState) {
83
+ return Object.assign(Object.assign({}, state), newState);
84
+ }
85
+ export const PepContextProvider = ({ children }) => {
86
+ const [pep, setPep] = useReducer(stateReducer, {});
87
+ return (React.createElement(PepContext.Provider, { value: { state: pep, setState: setPep } }, children));
88
+ };