@lysaab/lysa-pep 3.0.3 → 3.0.4

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 (41) hide show
  1. package/Exports.d.ts +7 -7
  2. package/Exports.js +7 -7
  3. package/components/CountrySelect.d.ts +11 -11
  4. package/components/CountrySelect.js +41 -41
  5. package/components/PepAnswers.d.ts +8 -8
  6. package/components/PepAnswers.js +137 -137
  7. package/model/PepModel.d.ts +7 -7
  8. package/model/PepModel.js +40 -40
  9. package/package.json +1 -1
  10. package/pages/IsPep/IsPepMessages.d.ts +32 -32
  11. package/pages/IsPep/IsPepMessages.js +34 -34
  12. package/pages/IsPep/IsPepPage.d.ts +15 -15
  13. package/pages/IsPep/IsPepPage.js +61 -61
  14. package/pages/PepContext.d.ts +81 -80
  15. package/pages/PepContext.js +89 -88
  16. package/pages/RelationPage/RelationMessages.d.ts +105 -105
  17. package/pages/RelationPage/RelationMessages.js +107 -107
  18. package/pages/RelationPage/RelationPage.d.ts +6 -6
  19. package/pages/RelationPage/RelationPage.js +156 -156
  20. package/pages/RolePage/RoleMessages.d.ts +185 -185
  21. package/pages/RolePage/RoleMessages.js +187 -187
  22. package/pages/RolePage/RolePage.d.ts +11 -11
  23. package/pages/RolePage/RolePage.js +223 -223
  24. package/pages/StatusPage/StatusMessages.d.ts +72 -72
  25. package/pages/StatusPage/StatusMessages.js +74 -74
  26. package/pages/StatusPage/StatusPage.d.ts +8 -8
  27. package/pages/StatusPage/StatusPage.js +105 -105
  28. package/utils/Possession.d.ts +1 -1
  29. package/utils/Possession.js +27 -27
  30. package/model/Countries.d.ts +0 -4
  31. package/model/Countries.js +0 -1002
  32. package/model/PepTexts.d.ts +0 -380
  33. package/model/PepTexts.js +0 -552
  34. package/pages/PepIsPepPage.d.ts +0 -15
  35. package/pages/PepIsPepPage.js +0 -59
  36. package/pages/PepRelationPage.d.ts +0 -6
  37. package/pages/PepRelationPage.js +0 -79
  38. package/pages/PepRolePage.d.ts +0 -10
  39. package/pages/PepRolePage.js +0 -127
  40. package/pages/PepStatusPage.d.ts +0 -6
  41. package/pages/PepStatusPage.js +0 -58
@@ -1,9 +1,9 @@
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",
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
7
  defaultMessage: `{
8
8
  entityType, select,
9
9
  PERSON {
@@ -13,21 +13,21 @@ export const messages = defineMessages({
13
13
  Is {name} or a person close to {name} a politically exposed person (PEP)?
14
14
  }
15
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",
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
31
  defaultMessage: `{
32
32
  entityType, select,
33
33
  PERSON {
@@ -37,11 +37,11 @@ export const messages = defineMessages({
37
37
  {name} is PEP because of his or her role
38
38
  }
39
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",
40
+ }`,
41
+ },
42
+ [PepType.RELATIVE]: {
43
+ id: "pep.ispep.RELATIVE",
44
+ description: "I have a relationship with a person that is a PEP",
45
45
  defaultMessage: `{
46
46
  entityType, select,
47
47
  PERSON {
@@ -51,11 +51,11 @@ export const messages = defineMessages({
51
51
  {name} has a relationship with a PEP
52
52
  }
53
53
  other {}
54
- }`,
55
- },
56
- [PepType.COLLEAGUE]: {
57
- id: "pep.ispep.COLLEAGUE",
58
- description: "The person has a colleague that is a PEP",
54
+ }`,
55
+ },
56
+ [PepType.COLLEAGUE]: {
57
+ id: "pep.ispep.COLLEAGUE",
58
+ description: "The person has a colleague that is a PEP",
59
59
  defaultMessage: `{
60
60
  entityType, select,
61
61
  PERSON {
@@ -65,6 +65,6 @@ export const messages = defineMessages({
65
65
  {name} works for, or has a business relationship with, a PEP
66
66
  }
67
67
  other {}
68
- }`,
69
- },
70
- });
68
+ }`,
69
+ },
70
+ });
@@ -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", description: "Next button", defaultMessage: "Next" }))));
61
+ };
@@ -1,80 +1,81 @@
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
+ 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,88 +1,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
- };
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
+ };