@voplus/morpho-csp 1.2.155 → 1.2.157

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 (158) hide show
  1. package/es/data/risk-match/RiskMatchStore.d.ts +31 -0
  2. package/es/data/risk-match/RiskMatchStore.js +105 -0
  3. package/es/data/risk-match/RiskMatchStore.js.map +1 -0
  4. package/es/data/risk-match/hooks.d.ts +10 -0
  5. package/es/data/risk-match/hooks.js +19 -0
  6. package/es/data/risk-match/hooks.js.map +1 -0
  7. package/es/data/risk-match/index.d.ts +4 -0
  8. package/es/data/risk-match/index.js +5 -0
  9. package/es/data/risk-match/index.js.map +1 -0
  10. package/es/data/risk-match/interfaces.d.ts +9 -0
  11. package/es/data/risk-match/interfaces.js +2 -0
  12. package/es/data/risk-match/interfaces.js.map +1 -0
  13. package/es/data/risk-match/risk-match-events/index.d.ts +3 -0
  14. package/es/data/risk-match/risk-match-events/index.js +4 -0
  15. package/es/data/risk-match/risk-match-events/index.js.map +1 -0
  16. package/es/data/risk-match/risk-match-events/useAutoUpdateListData.d.ts +4 -0
  17. package/es/data/risk-match/risk-match-events/useAutoUpdateListData.js +15 -0
  18. package/es/data/risk-match/risk-match-events/useAutoUpdateListData.js.map +1 -0
  19. package/es/data/risk-match/risk-match-events/useOnDeleteRiskMatch.d.ts +4 -0
  20. package/es/data/risk-match/risk-match-events/useOnDeleteRiskMatch.js +16 -0
  21. package/es/data/risk-match/risk-match-events/useOnDeleteRiskMatch.js.map +1 -0
  22. package/es/data/risk-match/risk-match-events/useOnNewRiskMatch.d.ts +4 -0
  23. package/es/data/risk-match/risk-match-events/useOnNewRiskMatch.js +17 -0
  24. package/es/data/risk-match/risk-match-events/useOnNewRiskMatch.js.map +1 -0
  25. package/es/data/risk-match/types.d.ts +17 -0
  26. package/es/data/risk-match/types.js +2 -0
  27. package/es/data/risk-match/types.js.map +1 -0
  28. package/es/data/risk-profile/RiskProfileStore.d.ts +36 -0
  29. package/es/data/risk-profile/RiskProfileStore.js +127 -0
  30. package/es/data/risk-profile/RiskProfileStore.js.map +1 -0
  31. package/es/data/risk-profile/hooks.d.ts +11 -0
  32. package/es/data/risk-profile/hooks.js +24 -0
  33. package/es/data/risk-profile/hooks.js.map +1 -0
  34. package/es/data/risk-profile/index.d.ts +4 -0
  35. package/es/data/risk-profile/index.js +5 -0
  36. package/es/data/risk-profile/index.js.map +1 -0
  37. package/es/data/risk-profile/interfaces.d.ts +14 -0
  38. package/es/data/risk-profile/interfaces.js +2 -0
  39. package/es/data/risk-profile/interfaces.js.map +1 -0
  40. package/es/data/risk-profile/risk-profile-events/index.d.ts +3 -0
  41. package/es/data/risk-profile/risk-profile-events/index.js +4 -0
  42. package/es/data/risk-profile/risk-profile-events/index.js.map +1 -0
  43. package/es/data/risk-profile/risk-profile-events/useAutoUpdateListData.d.ts +4 -0
  44. package/es/data/risk-profile/risk-profile-events/useAutoUpdateListData.js +15 -0
  45. package/es/data/risk-profile/risk-profile-events/useAutoUpdateListData.js.map +1 -0
  46. package/es/data/risk-profile/risk-profile-events/useOnDeleteRiskProfile.d.ts +4 -0
  47. package/es/data/risk-profile/risk-profile-events/useOnDeleteRiskProfile.js +16 -0
  48. package/es/data/risk-profile/risk-profile-events/useOnDeleteRiskProfile.js.map +1 -0
  49. package/es/data/risk-profile/risk-profile-events/useOnNewRiskProfile.d.ts +4 -0
  50. package/es/data/risk-profile/risk-profile-events/useOnNewRiskProfile.js +17 -0
  51. package/es/data/risk-profile/risk-profile-events/useOnNewRiskProfile.js.map +1 -0
  52. package/es/data/risk-profile/types.d.ts +23 -0
  53. package/es/data/risk-profile/types.js +2 -0
  54. package/es/data/risk-profile/types.js.map +1 -0
  55. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchHeader/index.d.ts +6 -0
  56. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchHeader/index.js +21 -0
  57. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchHeader/index.js.map +1 -0
  58. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchHeader/index.less +15 -0
  59. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchItem/index.d.ts +7 -0
  60. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchItem/index.js +25 -0
  61. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchItem/index.js.map +1 -0
  62. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchItem/index.less +28 -0
  63. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchList/index.d.ts +10 -0
  64. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchList/index.js +51 -0
  65. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchList/index.js.map +1 -0
  66. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchList/index.less +21 -0
  67. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchProperties/index.d.ts +5 -0
  68. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchProperties/index.js +30 -0
  69. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchProperties/index.js.map +1 -0
  70. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchPropertiesView/index.d.ts +7 -0
  71. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchPropertiesView/index.js +18 -0
  72. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchPropertiesView/index.js.map +1 -0
  73. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchPropertiesView/index.less +4 -0
  74. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchQuickView/index.d.ts +15 -0
  75. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchQuickView/index.js +31 -0
  76. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchQuickView/index.js.map +1 -0
  77. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchQuickView/index.less +30 -0
  78. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchReport/index.d.ts +5 -0
  79. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchReport/index.js +10 -0
  80. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchReport/index.js.map +1 -0
  81. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchResult/index.d.ts +5 -0
  82. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchResult/index.js +31 -0
  83. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchResult/index.js.map +1 -0
  84. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchSearchDialog/index.d.ts +7 -0
  85. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchSearchDialog/index.js +29 -0
  86. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchSearchDialog/index.js.map +1 -0
  87. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchTabs/index.d.ts +5 -0
  88. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchTabs/index.js +22 -0
  89. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchTabs/index.js.map +1 -0
  90. package/es/modules/corporate/background-investigation/risk-match/components/RiskMatchTabs/index.less +13 -0
  91. package/es/modules/corporate/background-investigation/risk-match/controls/RiskMatchDataBar/index.d.ts +10 -0
  92. package/es/modules/corporate/background-investigation/risk-match/controls/RiskMatchDataBar/index.js +30 -0
  93. package/es/modules/corporate/background-investigation/risk-match/controls/RiskMatchDataBar/index.js.map +1 -0
  94. package/es/modules/corporate/background-investigation/risk-match/pages/RiskMatchDefaultView/index.d.ts +3 -0
  95. package/es/modules/corporate/background-investigation/risk-match/pages/RiskMatchDefaultView/index.js +33 -0
  96. package/es/modules/corporate/background-investigation/risk-match/pages/RiskMatchDefaultView/index.js.map +1 -0
  97. package/es/modules/corporate/background-investigation/risk-match/pages/RiskMatchDefaultView/index.less +17 -0
  98. package/es/modules/corporate/background-investigation/risk-profile/components/NewRiskProfileForm/index.d.ts +15 -0
  99. package/es/modules/corporate/background-investigation/risk-profile/components/NewRiskProfileForm/index.js +61 -0
  100. package/es/modules/corporate/background-investigation/risk-profile/components/NewRiskProfileForm/index.js.map +1 -0
  101. package/es/modules/corporate/background-investigation/risk-profile/components/NewRiskProfileForm/index.less +10 -0
  102. package/es/modules/corporate/background-investigation/risk-profile/components/NewRiskProfileForm/state.d.ts +11 -0
  103. package/es/modules/corporate/background-investigation/risk-profile/components/NewRiskProfileForm/state.js +34 -0
  104. package/es/modules/corporate/background-investigation/risk-profile/components/NewRiskProfileForm/state.js.map +1 -0
  105. package/es/modules/corporate/background-investigation/risk-profile/components/RiskProfileHead/index.d.ts +6 -0
  106. package/es/modules/corporate/background-investigation/risk-profile/components/RiskProfileHead/index.js +33 -0
  107. package/es/modules/corporate/background-investigation/risk-profile/components/RiskProfileHead/index.js.map +1 -0
  108. package/es/modules/corporate/background-investigation/risk-profile/components/RiskProfileHead/index.less +33 -0
  109. package/es/modules/corporate/background-investigation/risk-profile/components/RiskProfileItem/index.d.ts +7 -0
  110. package/es/modules/corporate/background-investigation/risk-profile/components/RiskProfileItem/index.js +37 -0
  111. package/es/modules/corporate/background-investigation/risk-profile/components/RiskProfileItem/index.js.map +1 -0
  112. package/es/modules/corporate/background-investigation/risk-profile/components/RiskProfileItem/index.less +53 -0
  113. package/es/modules/corporate/background-investigation/risk-profile/components/RiskProfileList/index.d.ts +10 -0
  114. package/es/modules/corporate/background-investigation/risk-profile/components/RiskProfileList/index.js +51 -0
  115. package/es/modules/corporate/background-investigation/risk-profile/components/RiskProfileList/index.js.map +1 -0
  116. package/es/modules/corporate/background-investigation/risk-profile/components/RiskProfileList/index.less +21 -0
  117. package/es/modules/corporate/background-investigation/risk-profile/components/RiskProfileProperties/index.d.ts +26 -0
  118. package/es/modules/corporate/background-investigation/risk-profile/components/RiskProfileProperties/index.js +53 -0
  119. package/es/modules/corporate/background-investigation/risk-profile/components/RiskProfileProperties/index.js.map +1 -0
  120. package/es/modules/corporate/background-investigation/risk-profile/components/RiskProfilePropertiesView/index.d.ts +6 -0
  121. package/es/modules/corporate/background-investigation/risk-profile/components/RiskProfilePropertiesView/index.js +23 -0
  122. package/es/modules/corporate/background-investigation/risk-profile/components/RiskProfilePropertiesView/index.js.map +1 -0
  123. package/es/modules/corporate/background-investigation/risk-profile/components/RiskProfileQuickView/index.d.ts +7 -0
  124. package/es/modules/corporate/background-investigation/risk-profile/components/RiskProfileQuickView/index.js +12 -0
  125. package/es/modules/corporate/background-investigation/risk-profile/components/RiskProfileQuickView/index.js.map +1 -0
  126. package/es/modules/corporate/background-investigation/risk-profile/components/RiskProfileTabs/index.d.ts +6 -0
  127. package/es/modules/corporate/background-investigation/risk-profile/components/RiskProfileTabs/index.js +67 -0
  128. package/es/modules/corporate/background-investigation/risk-profile/components/RiskProfileTabs/index.js.map +1 -0
  129. package/es/modules/corporate/background-investigation/risk-profile/components/RiskProfileTabs/index.less +13 -0
  130. package/es/modules/corporate/background-investigation/risk-profile/controls/RiskProfileDataBar/index.d.ts +10 -0
  131. package/es/modules/corporate/background-investigation/risk-profile/controls/RiskProfileDataBar/index.js +22 -0
  132. package/es/modules/corporate/background-investigation/risk-profile/controls/RiskProfileDataBar/index.js.map +1 -0
  133. package/es/modules/corporate/background-investigation/risk-profile/controls/RiskProfileMenu/index.d.ts +13 -0
  134. package/es/modules/corporate/background-investigation/risk-profile/controls/RiskProfileMenu/index.js +52 -0
  135. package/es/modules/corporate/background-investigation/risk-profile/controls/RiskProfileMenu/index.js.map +1 -0
  136. package/es/modules/corporate/background-investigation/risk-profile/controls/RiskProfileMenu/index.less +39 -0
  137. package/es/modules/corporate/background-investigation/risk-profile/controls/RiskProfileStatusLabel/index.d.ts +10 -0
  138. package/es/modules/corporate/background-investigation/risk-profile/controls/RiskProfileStatusLabel/index.js +14 -0
  139. package/es/modules/corporate/background-investigation/risk-profile/controls/RiskProfileStatusLabel/index.js.map +1 -0
  140. package/es/modules/corporate/background-investigation/risk-profile/controls/RiskProfileStatusLabel/index.less +20 -0
  141. package/es/modules/corporate/background-investigation/risk-profile/pages/RiskProfileDefaultView/index.d.ts +3 -0
  142. package/es/modules/corporate/background-investigation/risk-profile/pages/RiskProfileDefaultView/index.js +28 -0
  143. package/es/modules/corporate/background-investigation/risk-profile/pages/RiskProfileDefaultView/index.js.map +1 -0
  144. package/es/modules/corporate/background-investigation/risk-profile/pages/RiskProfileDefaultView/index.less +17 -0
  145. package/es/modules/corporate/background-investigation/risk-profile/pages/UnitRiskProfilePage/index.d.ts +3 -0
  146. package/es/modules/corporate/background-investigation/risk-profile/pages/UnitRiskProfilePage/index.js +34 -0
  147. package/es/modules/corporate/background-investigation/risk-profile/pages/UnitRiskProfilePage/index.js.map +1 -0
  148. package/es/modules/corporate/background-investigation/risk-profile/pages/UnitRiskProfilePage/index.less +11 -0
  149. package/es/modules/corporate/company/identity/components/IdentifyDetail/index.js +3 -5
  150. package/es/modules/corporate/company/identity/components/IdentifyDetail/index.js.map +1 -1
  151. package/es/modules/corporate/company/identity/components/IdentifyDetail/index.less +21 -15
  152. package/es/modules/corporate/relationship/components/CorporateRelationshipView/index.d.ts +1 -1
  153. package/es/modules/corporate/relationship/components/CorporateRelationshipView/index.js +9 -6
  154. package/es/modules/corporate/relationship/components/CorporateRelationshipView/index.js.map +1 -1
  155. package/es/routes.d.ts +24 -0
  156. package/es/routes.js +55 -3
  157. package/es/routes.js.map +1 -1
  158. package/package.json +1 -1
@@ -0,0 +1,31 @@
1
+ import { ApiEndPoint } from "@voplus/api";
2
+ import { CountedMap, Store } from "@voplus/morpho-data";
3
+ import { DeleteRiskMatchOptions, EditRiskMatchOptions, LoadRiskMatchOptions } from "./types";
4
+ import { IRiskMatch } from "./interfaces";
5
+ import { LoadDocumentListOptions } from "@voplus/morpho-document-core";
6
+ /** Quotation store supply backend functions. */
7
+ export declare class RiskMatchStore extends Store {
8
+ readonly endpoint: ApiEndPoint;
9
+ /** Name of the store */
10
+ readonly name: string;
11
+ private readonly _riskMatchDeleted;
12
+ private readonly _riskMatchCreated;
13
+ constructor(endpoint: ApiEndPoint);
14
+ /** All currently used corporate. */
15
+ readonly items: CountedMap<string, IRiskMatch>;
16
+ /** Event fires when a delete customer has been deleted. */
17
+ get RiskMatchDeletedEvent(): import("strongly-typed-events").IEvent<RiskMatchStore, IRiskMatch>;
18
+ /** Event fires when a new RiskMatch has been created. */
19
+ get RiskMatchCreatedEvent(): import("strongly-typed-events").IEvent<RiskMatchStore, IRiskMatch>;
20
+ /** Edit an existing item on server. */
21
+ edit(id: string, options: EditRiskMatchOptions): Promise<void>;
22
+ /** customer 內有文件不能delete */
23
+ delete(ids: string[], options?: DeleteRiskMatchOptions): Promise<any>;
24
+ /** Load a list of documents from server.
25
+ * @param {LoadDocumentListOptions}
26
+ */
27
+ loadList(options?: LoadDocumentListOptions): Promise<IRiskMatch[]>;
28
+ load(id: string, options: LoadRiskMatchOptions): Promise<IRiskMatch>;
29
+ }
30
+ /** 响应钩子检索 IdentityStore */
31
+ export declare const useRiskMatchStore: () => RiskMatchStore;
@@ -0,0 +1,105 @@
1
+ import { RequestBuilder } from "@voplus/api";
2
+ import { CountedMap, Store, useApplicationContext } from "@voplus/morpho-data";
3
+ import { observable } from "mobx";
4
+ import { EventDispatcher } from "strongly-typed-events";
5
+ const StoreName = "RiskMatchStore";
6
+ /** Quotation store supply backend functions. */
7
+ export class RiskMatchStore extends Store {
8
+ constructor(endpoint) {
9
+ super();
10
+ Object.defineProperty(this, "endpoint", {
11
+ enumerable: true,
12
+ configurable: true,
13
+ writable: true,
14
+ value: endpoint
15
+ });
16
+ /** Name of the store */
17
+ Object.defineProperty(this, "name", {
18
+ enumerable: true,
19
+ configurable: true,
20
+ writable: true,
21
+ value: StoreName
22
+ });
23
+ Object.defineProperty(this, "_riskMatchDeleted", {
24
+ enumerable: true,
25
+ configurable: true,
26
+ writable: true,
27
+ value: new EventDispatcher()
28
+ });
29
+ Object.defineProperty(this, "_riskMatchCreated", {
30
+ enumerable: true,
31
+ configurable: true,
32
+ writable: true,
33
+ value: new EventDispatcher()
34
+ });
35
+ /** All currently used corporate. */
36
+ Object.defineProperty(this, "items", {
37
+ enumerable: true,
38
+ configurable: true,
39
+ writable: true,
40
+ value: new CountedMap((key) => ({ id: key, loaded: false }), observable.map([], { deep: true }))
41
+ });
42
+ }
43
+ /** Event fires when a delete customer has been deleted. */
44
+ get RiskMatchDeletedEvent() {
45
+ return this._riskMatchDeleted.asEvent();
46
+ }
47
+ /** Event fires when a new RiskMatch has been created. */
48
+ get RiskMatchCreatedEvent() {
49
+ return this._riskMatchCreated.asEvent();
50
+ }
51
+ /** Edit an existing item on server. */
52
+ async edit(id, options) {
53
+ await this.action(async () => {
54
+ const r = await this.endpoint.post(`/api/units/risk-matches/${id}`, new RequestBuilder().json(options.data));
55
+ const t = await r.json();
56
+ this.items.overwrite(t.id, t);
57
+ }, options);
58
+ }
59
+ /** customer 內有文件不能delete */
60
+ async delete(ids, options) {
61
+ return await this.action(async () => {
62
+ await this.endpoint.delete(`/api/units/risk-matches/delete`, new RequestBuilder().json({ Ids: ids, Options: options === null || options === void 0 ? void 0 : options.data }));
63
+ const deleted = [];
64
+ for (const id of ids) {
65
+ const item = this.items.peek(id);
66
+ if (item) {
67
+ deleted.push(item);
68
+ this._riskMatchDeleted.dispatch(this, item);
69
+ }
70
+ }
71
+ return deleted;
72
+ }, options);
73
+ }
74
+ /** Load a list of documents from server.
75
+ * @param {LoadDocumentListOptions}
76
+ */
77
+ async loadList(options) {
78
+ let query = "";
79
+ if (options === null || options === void 0 ? void 0 : options.Includes) {
80
+ query = query.concat(`includes=${options.Includes}`);
81
+ }
82
+ if (query)
83
+ query = "?".concat(query);
84
+ const r = await this.endpoint.post(`/api/units/risk-matches${query}`, new RequestBuilder().json(options ? options : { Filters: [] }));
85
+ return (await r.json());
86
+ }
87
+ async load(id, options) {
88
+ let query = "";
89
+ if (options.includes)
90
+ query = query.concat(`includes=${options.includes}`);
91
+ if (query)
92
+ query = "?".concat(query);
93
+ const r = await this.endpoint.get(`/api/units/risk-matches/${id}${query}`);
94
+ return await r.json();
95
+ }
96
+ }
97
+ /** 响应钩子检索 IdentityStore */
98
+ export const useRiskMatchStore = () => {
99
+ const context = useApplicationContext();
100
+ if (!context.getStore(StoreName)) {
101
+ context.addStore(new RiskMatchStore(context.api.currentEndPoint));
102
+ }
103
+ return context.getStore(StoreName);
104
+ };
105
+ //# sourceMappingURL=RiskMatchStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RiskMatchStore.js","sourceRoot":"","sources":["../../../src/data/risk-match/RiskMatchStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAK/E,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,SAAS,GAAG,gBAAgB,CAAC;AAEnC,gDAAgD;AAChD,MAAM,OAAO,cAAe,SAAQ,KAAK;IAMxC,YAAmC,QAAqB;QACvD,KAAK,EAAE,CAAC;;;;;mBAD0B;;QALnC,wBAAwB;QACxB;;;;mBAA+B,SAAS;WAAC;QACzC;;;;mBAAqC,IAAI,eAAe,EAA8B;WAAC;QACvF;;;;mBAAqC,IAAI,eAAe,EAA8B;WAAC;QAMvF,oCAAoC;QACpC;;;;mBAAwD,IAAI,UAAU,CACrE,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAiB,CAAA,EAC3D,UAAU,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAClC;WAAC;IANF,CAAC;IAQD,2DAA2D;IAC3D,IAAW,qBAAqB;QAC/B,OAAO,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,CAAC;IACzC,CAAC;IAED,yDAAyD;IACzD,IAAW,qBAAqB;QAC/B,OAAO,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,C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QACjC,OAAO,CAAC,QAAQ,CAAC,IAAI,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC;KAClE;IACD,OAAO,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAoB,CAAC;AACvD,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { LoadDocumentListOptions } from "@voplus/morpho-document-core";
2
+ import { IRiskMatch } from "./interfaces";
3
+ import { ListDataContextState } from "@voplus/morpho-ui/es/data";
4
+ import { LoadRiskMatchOptions } from ".";
5
+ /** React hook to retrieve a RiskMatch
6
+ * @param {string} id - id of the RiskMatch
7
+ * @param {LoadDocumentOptions} options - options
8
+ */
9
+ export declare const useRiskMatch: (id: string, options?: LoadRiskMatchOptions | undefined) => IRiskMatch;
10
+ export declare const useRiskMatchListEffect: (list: ListDataContextState<IRiskMatch> | null, effect: (list: any[], total: number) => void, options?: LoadDocumentListOptions | undefined) => void;
@@ -0,0 +1,19 @@
1
+ import { useDocumentListLoaderEffect } from "@voplus/morpho-document-core";
2
+ import { useLoadCountedMapItem } from "@voplus/morpho-data";
3
+ import { useRiskMatchStore } from "./RiskMatchStore";
4
+ /** React hook to retrieve a RiskMatch
5
+ * @param {string} id - id of the RiskMatch
6
+ * @param {LoadDocumentOptions} options - options
7
+ */
8
+ export const useRiskMatch = (id, options) => {
9
+ options = options ? options : {};
10
+ const store = useRiskMatchStore();
11
+ return useLoadCountedMapItem(id, store.items, () => store.load(id, options), options);
12
+ };
13
+ export const useRiskMatchListEffect = (list, effect, options) => {
14
+ const deps = options ? options : {};
15
+ const store = useRiskMatchStore();
16
+ // Call useDocumentListEffect and ensure won't load twice for same loading options.
17
+ return useDocumentListLoaderEffect(list, effect, () => store.loadList(options), [deps]);
18
+ };
19
+ //# sourceMappingURL=hooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../src/data/risk-match/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAKpG,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAU,EAAE,OAA8B,EAAE,EAAE;IAC1E,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,EAA2B,CAAC;IAC3D,MAAM,KAAK,GAAG,iBAAiB,EAAE,CAAC;IAClC,OAAO,qBAAqB,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,OAAQ,CAAC,EAAE,OAAO,CAAC,CAAC;AACxF,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACrC,IAA6C,EAC7C,MAA4C,EAC5C,OAAiC,EAChC,EAAE;IACH,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,EAA8B,CAAC;IACjE,MAAM,KAAK,GAAG,iBAAiB,EAAE,CAAC;IAElC,mFAAmF;IACnF,OAAO,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;AACzF,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./interfaces";
2
+ export * from "./RiskMatchStore";
3
+ export * from "./hooks";
4
+ export * from "./types";
@@ -0,0 +1,5 @@
1
+ export * from "./interfaces";
2
+ export * from "./RiskMatchStore";
3
+ export * from "./hooks";
4
+ export * from "./types";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/data/risk-match/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { ILoadable } from "@voplus/morpho-data";
2
+ export interface IRiskMatch extends ILoadable {
3
+ id: string;
4
+ name: string;
5
+ gender?: string;
6
+ positive?: boolean;
7
+ channel?: string;
8
+ createDate?: string;
9
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/data/risk-match/interfaces.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export * from "./useOnNewRiskMatch";
2
+ export * from "./useOnDeleteRiskMatch";
3
+ export * from "./useAutoUpdateListData";
@@ -0,0 +1,4 @@
1
+ export * from "./useOnNewRiskMatch";
2
+ export * from "./useOnDeleteRiskMatch";
3
+ export * from "./useAutoUpdateListData";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/data/risk-match/risk-match-events/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { IRiskMatch } from "../interfaces";
2
+ import { ListDataContextState } from "@voplus/morpho-ui/es/data";
3
+ /** React hook to call action when a new RiskMatch has been created. */
4
+ export declare const useAutoUpdateListData: (list: ListDataContextState<any>, shouldUpdate: (d: IRiskMatch, event: string) => boolean) => void;
@@ -0,0 +1,15 @@
1
+ import { useOnDeleteRiskMatch, useOnNewRiskMatch } from ".";
2
+ /** React hook to call action when a new RiskMatch has been created. */
3
+ export const useAutoUpdateListData = (list, shouldUpdate) => {
4
+ useOnNewRiskMatch((s, d) => {
5
+ console.log(s, d);
6
+ console.log(shouldUpdate(d, "new"));
7
+ if (shouldUpdate(d, "new"))
8
+ list.union([d]);
9
+ });
10
+ useOnDeleteRiskMatch((s, d) => {
11
+ if (shouldUpdate(d, "new"))
12
+ list.remove(d.id);
13
+ });
14
+ };
15
+ //# sourceMappingURL=useAutoUpdateListData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAutoUpdateListData.js","sourceRoot":"","sources":["../../../../src/data/risk-match/risk-match-events/useAutoUpdateListData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,GAAG,CAAC;AAK5D,uEAAuE;AACvE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACpC,IAA+B,EAC/B,YAAuD,EACtD,EAAE;IACH,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAC1B,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAClB,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAA;QACnC,IAAI,YAAY,CAAC,CAAC,EAAE,KAAK,CAAC;YAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,oBAAoB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAC7B,IAAI,YAAY,CAAC,CAAC,EAAE,KAAK,CAAC;YAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { RiskMatchStore } from "../RiskMatchStore";
2
+ import { IRiskMatch } from "../interfaces";
3
+ /** React hook to call action when a delete RiskMatch has been created. */
4
+ export declare const useOnDeleteRiskMatch: (action: (store: RiskMatchStore, doc: IRiskMatch) => void) => void;
@@ -0,0 +1,16 @@
1
+ import { useRiskMatchStore } from "../RiskMatchStore";
2
+ import { useEffect } from "react";
3
+ /** React hook to call action when a delete RiskMatch has been created. */
4
+ export const useOnDeleteRiskMatch = (action) => {
5
+ const store = useRiskMatchStore();
6
+ const onDeleteRiskMatch = (store, doc) => {
7
+ action(store, doc);
8
+ };
9
+ useEffect(() => {
10
+ store.RiskMatchDeletedEvent.subscribe(onDeleteRiskMatch);
11
+ return () => {
12
+ store.RiskMatchDeletedEvent.unsubscribe(onDeleteRiskMatch);
13
+ };
14
+ });
15
+ };
16
+ //# sourceMappingURL=useOnDeleteRiskMatch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOnDeleteRiskMatch.js","sourceRoot":"","sources":["../../../../src/data/risk-match/risk-match-events/useOnDeleteRiskMatch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGrE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,0EAA0E;AAC1E,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,MAAwD,EAAE,EAAE;IAChG,MAAM,KAAK,GAAG,iBAAiB,EAAE,CAAC;IAClC,MAAM,iBAAiB,GAAG,CAAC,KAAqB,EAAE,GAAe,EAAE,EAAE;QACpE,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACpB,CAAC,CAAC;IACF,SAAS,CAAC,GAAG,EAAE;QACd,KAAK,CAAC,qBAAqB,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;QACzD,OAAO,GAAG,EAAE;YACX,KAAK,CAAC,qBAAqB,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;QAC5D,CAAC,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { RiskMatchStore } from "../RiskMatchStore";
2
+ import { IRiskMatch } from "../interfaces";
3
+ /** React hook to call action when a new RiskMatch has been created. */
4
+ export declare const useOnNewRiskMatch: (action: (store: RiskMatchStore, doc: IRiskMatch) => void) => void;
@@ -0,0 +1,17 @@
1
+ import { useRiskMatchStore } from "../RiskMatchStore";
2
+ import { useEffect } from "react";
3
+ /** React hook to call action when a new RiskMatch has been created. */
4
+ export const useOnNewRiskMatch = (action) => {
5
+ const store = useRiskMatchStore();
6
+ const onNewRiskMatch = (store, doc) => {
7
+ // console.log(`onNewRiskMatch - ${doc.id} ${doc.name}`);
8
+ action(store, doc);
9
+ };
10
+ useEffect(() => {
11
+ store.RiskMatchCreatedEvent.subscribe(onNewRiskMatch);
12
+ return () => {
13
+ store.RiskMatchCreatedEvent.unsubscribe(onNewRiskMatch);
14
+ };
15
+ });
16
+ };
17
+ //# sourceMappingURL=useOnNewRiskMatch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOnNewRiskMatch.js","sourceRoot":"","sources":["../../../../src/data/risk-match/risk-match-events/useOnNewRiskMatch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGrE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,uEAAuE;AACvE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,MAAwD,EAAE,EAAE;IAC7F,MAAM,KAAK,GAAG,iBAAiB,EAAE,CAAC;IAClC,MAAM,cAAc,GAAG,CAAC,KAAqB,EAAE,GAAe,EAAE,EAAE;QACjE,yDAAyD;QACzD,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACpB,CAAC,CAAC;IACF,SAAS,CAAC,GAAG,EAAE;QACd,KAAK,CAAC,qBAAqB,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;QACtD,OAAO,GAAG,EAAE;YACX,KAAK,CAAC,qBAAqB,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;QACzD,CAAC,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { LoadOptions, StoreActionOptions } from "@voplus/morpho-data";
2
+ import { DeleteDocumentOptions } from "@voplus/morpho-document-core";
3
+ import { IRiskMatch } from "./interfaces";
4
+ /** Custom load org contact options type */
5
+ export declare type LoadRiskMatchOptions = {
6
+ /** Comma separated include options e.g. path */
7
+ includes?: string;
8
+ } & LoadOptions<IRiskMatch>;
9
+ export declare type RiskMatchEditOptions = {
10
+ Positive?: boolean;
11
+ };
12
+ export declare type EditRiskMatchOptions = {
13
+ data: RiskMatchEditOptions;
14
+ } & StoreActionOptions;
15
+ export declare type DeleteRiskMatchOptions = {
16
+ data?: DeleteDocumentOptions;
17
+ } & StoreActionOptions;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/data/risk-match/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,36 @@
1
+ import { ApiEndPoint } from "@voplus/api";
2
+ import { CountedMap, Store, StoreActionOptions } from "@voplus/morpho-data";
3
+ import { CreateRiskProfileOptions, DeleteRiskProfileOptions, EditRiskProfileOptions, LoadRiskProfileOptions } from "./types";
4
+ import { IRiskProfile } from "./interfaces";
5
+ import { LoadDocumentListOptions } from "@voplus/morpho-document-core";
6
+ /** Quotation store supply backend functions. */
7
+ export declare class RiskProfileStore extends Store {
8
+ readonly endpoint: ApiEndPoint;
9
+ /** Name of the store */
10
+ readonly name: string;
11
+ private readonly _riskProfileDeleted;
12
+ private readonly _riskProfileCreated;
13
+ constructor(endpoint: ApiEndPoint);
14
+ /** All currently used corporate. */
15
+ readonly items: CountedMap<string, IRiskProfile>;
16
+ /** Event fires when a delete RiskProfile has been deleted. */
17
+ get RiskProfileDeletedEvent(): import("strongly-typed-events").IEvent<RiskProfileStore, IRiskProfile>;
18
+ /** Event fires when a new RiskProfile has been created. */
19
+ get RiskProfileCreatedEvent(): import("strongly-typed-events").IEvent<RiskProfileStore, IRiskProfile>;
20
+ /** Create a new Identity. */
21
+ create(options: CreateRiskProfileOptions): Promise<IRiskProfile>;
22
+ search(id: string, options: StoreActionOptions): Promise<void>;
23
+ /** Edit an existing item on server. */
24
+ edit(id: string, options: EditRiskProfileOptions): Promise<void>;
25
+ /** RiskProfile 內有文件不能delete */
26
+ delete(ids: string[], options?: DeleteRiskProfileOptions): Promise<any>;
27
+ /** Load a list of documents from server.
28
+ * @param {LoadDocumentListOptions}
29
+ */
30
+ loadList(options?: LoadDocumentListOptions): Promise<IRiskProfile[]>;
31
+ load(id: string, options: LoadRiskProfileOptions): Promise<IRiskProfile>;
32
+ /** 用于判断 unit 是否已经创建 risk profile */
33
+ loadRiskProfilt(id: string): Promise<IRiskProfile>;
34
+ }
35
+ /** 响应钩子检索 IdentityStore */
36
+ export declare const useRiskProfileStore: () => RiskProfileStore;
@@ -0,0 +1,127 @@
1
+ import { RequestBuilder } from "@voplus/api";
2
+ import { CountedMap, Store, useApplicationContext } from "@voplus/morpho-data";
3
+ import { observable } from "mobx";
4
+ import { EventDispatcher } from "strongly-typed-events";
5
+ const StoreName = "RiskProfileStore";
6
+ /** Quotation store supply backend functions. */
7
+ export class RiskProfileStore extends Store {
8
+ constructor(endpoint) {
9
+ super();
10
+ Object.defineProperty(this, "endpoint", {
11
+ enumerable: true,
12
+ configurable: true,
13
+ writable: true,
14
+ value: endpoint
15
+ });
16
+ /** Name of the store */
17
+ Object.defineProperty(this, "name", {
18
+ enumerable: true,
19
+ configurable: true,
20
+ writable: true,
21
+ value: StoreName
22
+ });
23
+ Object.defineProperty(this, "_riskProfileDeleted", {
24
+ enumerable: true,
25
+ configurable: true,
26
+ writable: true,
27
+ value: new EventDispatcher()
28
+ });
29
+ Object.defineProperty(this, "_riskProfileCreated", {
30
+ enumerable: true,
31
+ configurable: true,
32
+ writable: true,
33
+ value: new EventDispatcher()
34
+ });
35
+ /** All currently used corporate. */
36
+ Object.defineProperty(this, "items", {
37
+ enumerable: true,
38
+ configurable: true,
39
+ writable: true,
40
+ value: new CountedMap((key) => ({ id: key, loaded: false }), observable.map([], { deep: true }))
41
+ });
42
+ }
43
+ /** Event fires when a delete RiskProfile has been deleted. */
44
+ get RiskProfileDeletedEvent() {
45
+ return this._riskProfileDeleted.asEvent();
46
+ }
47
+ /** Event fires when a new RiskProfile has been created. */
48
+ get RiskProfileCreatedEvent() {
49
+ return this._riskProfileCreated.asEvent();
50
+ }
51
+ /** Create a new Identity. */
52
+ async create(options) {
53
+ // invariant(options.name, "Name cannot be empty.");
54
+ return await this.action(async () => {
55
+ const r = await this.endpoint.post(`/api/units/risk-profiles/create`, new RequestBuilder().json(options.data));
56
+ const t = (await r.json());
57
+ this._riskProfileCreated.dispatch(this, t);
58
+ return t;
59
+ }, options);
60
+ }
61
+ async search(id, options) {
62
+ await this.action(async () => {
63
+ const r = await this.endpoint.post(`/api/units/risk-profiles/${id}/search`);
64
+ const t = await r.json();
65
+ this.items.overwrite(t.id, t);
66
+ }, options);
67
+ }
68
+ /** Edit an existing item on server. */
69
+ async edit(id, options) {
70
+ await this.action(async () => {
71
+ const r = await this.endpoint.post(`/api/units/risk-profiles/${id}`, new RequestBuilder().json(options.data));
72
+ const t = await r.json();
73
+ this.items.overwrite(t.id, t);
74
+ }, options);
75
+ }
76
+ /** RiskProfile 內有文件不能delete */
77
+ async delete(ids, options) {
78
+ return await this.action(async () => {
79
+ await this.endpoint.delete(`/api/units/risk-profiles/delete`, new RequestBuilder().json({ Ids: ids, Options: options === null || options === void 0 ? void 0 : options.data }));
80
+ const deleted = [];
81
+ for (const id of ids) {
82
+ const item = this.items.peek(id);
83
+ if (item) {
84
+ deleted.push(item);
85
+ this._riskProfileDeleted.dispatch(this, item);
86
+ }
87
+ }
88
+ return deleted;
89
+ }, options);
90
+ }
91
+ /** Load a list of documents from server.
92
+ * @param {LoadDocumentListOptions}
93
+ */
94
+ async loadList(options) {
95
+ let query = "";
96
+ if (options === null || options === void 0 ? void 0 : options.Includes) {
97
+ query = query.concat(`includes=${options.Includes}`);
98
+ }
99
+ if (query)
100
+ query = "?".concat(query);
101
+ const r = await this.endpoint.post(`/api/units/risk-profiles${query}`, new RequestBuilder().json(options ? options : { Filters: [] }));
102
+ return (await r.json());
103
+ }
104
+ async load(id, options) {
105
+ let query = "";
106
+ if (options.includes)
107
+ query = query.concat(`includes=${options.includes}`);
108
+ if (query)
109
+ query = "?".concat(query);
110
+ const r = await this.endpoint.get(`/api/units/risk-profiles/${id}${query}`);
111
+ return await r.json();
112
+ }
113
+ /** 用于判断 unit 是否已经创建 risk profile */
114
+ async loadRiskProfilt(id) {
115
+ const r = await this.endpoint.get(`/api/units/${id}/risk-profile`);
116
+ return await r.json();
117
+ }
118
+ }
119
+ /** 响应钩子检索 IdentityStore */
120
+ export const useRiskProfileStore = () => {
121
+ const context = useApplicationContext();
122
+ if (!context.getStore(StoreName)) {
123
+ context.addStore(new RiskProfileStore(context.api.currentEndPoint));
124
+ }
125
+ return context.getStore(StoreName);
126
+ };
127
+ //# sourceMappingURL=RiskProfileStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RiskProfileStore.js","sourceRoot":"","sources":["../../../src/data/risk-profile/RiskProfileStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,qBAAqB,EAAsB,MAAM,qBAAqB,CAAC;AAUnG,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,SAAS,GAAG,kBAAkB,CAAC;AAErC,gDAAgD;AAChD,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IAM1C,YAAmC,QAAqB;QACvD,KAAK,EAAE,CAAC;;;;;mBAD0B;;QALnC,wBAAwB;QACxB;;;;mBAA+B,SAAS;WAAC;QACzC;;;;mBAAuC,IAAI,eAAe,EAAkC;WAAC;QAC7F;;;;mBAAuC,IAAI,eAAe,EAAkC;WAAC;QAM7F,oCAAoC;QACpC;;;;mBAA0D,IAAI,UA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GAAG,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC;QACnE,OAAO,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;IACvB,CAAC;CACD;AAED,2BAA2B;AAC3B,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACvC,MAAM,OAAO,GAAG,qBAAqB,EAAE,CAAC;IACxC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;QACjC,OAAO,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC;KACpE;IACD,OAAO,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAsB,CAAC;AACzD,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { LoadDocumentListOptions } from "@voplus/morpho-document-core";
2
+ import { IRiskProfile } from "./interfaces";
3
+ import { ListDataContextState } from "@voplus/morpho-ui/es/data";
4
+ import { LoadRiskProfileOptions } from ".";
5
+ /** React hook to retrieve a RiskProfile
6
+ * @param {string} id - id of the RiskProfile
7
+ * @param {LoadDocumentOptions} options - options
8
+ */
9
+ export declare const useRiskProfile: (id: string, options?: LoadRiskProfileOptions | undefined) => IRiskProfile;
10
+ export declare const useRiskProfileByUnit: (id: string, options?: LoadRiskProfileOptions | undefined) => IRiskProfile;
11
+ export declare const useRiskProfileListEffect: (list: ListDataContextState<IRiskProfile> | null, effect: (list: any[], total: number) => void, options?: LoadDocumentListOptions | undefined) => void;
@@ -0,0 +1,24 @@
1
+ import { useDocumentListLoaderEffect } from "@voplus/morpho-document-core";
2
+ import { useLoadCountedMapItem } from "@voplus/morpho-data";
3
+ import { useRiskProfileStore } from "./RiskProfileStore";
4
+ /** React hook to retrieve a RiskProfile
5
+ * @param {string} id - id of the RiskProfile
6
+ * @param {LoadDocumentOptions} options - options
7
+ */
8
+ export const useRiskProfile = (id, options) => {
9
+ options = options ? options : {};
10
+ const store = useRiskProfileStore();
11
+ return useLoadCountedMapItem(id, store.items, () => store.load(id, options), options);
12
+ };
13
+ export const useRiskProfileByUnit = (id, options) => {
14
+ options = options ? options : {};
15
+ const store = useRiskProfileStore();
16
+ return useLoadCountedMapItem(id, store.items, () => store.loadRiskProfilt(id), options);
17
+ };
18
+ export const useRiskProfileListEffect = (list, effect, options) => {
19
+ const deps = options ? options : {};
20
+ const store = useRiskProfileStore();
21
+ // Call useDocumentListEffect and ensure won't load twice for same loading options.
22
+ return useDocumentListLoaderEffect(list, effect, () => store.loadList(options), [deps]);
23
+ };
24
+ //# sourceMappingURL=hooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../src/data/risk-profile/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAKpG,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAAU,EAAE,OAAgC,EAAE,EAAE;IAC9E,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,EAA6B,CAAC;IAC7D,MAAM,KAAK,GAAG,mBAAmB,EAAE,CAAC;IACpC,OAAO,qBAAqB,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,OAAQ,CAAC,EAAE,OAAO,CAAC,CAAC;AACxF,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,EAAU,EAAE,OAAgC,EAAE,EAAE;IACpF,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,EAA6B,CAAC;IAC7D,MAAM,KAAK,GAAG,mBAAmB,EAAE,CAAC;IAEpC,OAAO,qBAAqB,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;AACzF,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACvC,IAA+C,EAC/C,MAA4C,EAC5C,OAAiC,EAChC,EAAE;IACH,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,EAA8B,CAAC;IACjE,MAAM,KAAK,GAAG,mBAAmB,EAAE,CAAC;IAEpC,mFAAmF;IACnF,OAAO,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;AACzF,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./interfaces";
2
+ export * from "./RiskProfileStore";
3
+ export * from "./hooks";
4
+ export * from "./types";
@@ -0,0 +1,5 @@
1
+ export * from "./interfaces";
2
+ export * from "./RiskProfileStore";
3
+ export * from "./hooks";
4
+ export * from "./types";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/data/risk-profile/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { ILoadable } from "@voplus/morpho-data";
2
+ export declare type RiskLevel = "High" | "Medium" | "Low";
3
+ export interface IRiskProfile extends ILoadable {
4
+ id: string;
5
+ createDate: string;
6
+ lastSearch?: string;
7
+ unit: {
8
+ id: string;
9
+ name: string;
10
+ };
11
+ riskLevel: RiskLevel;
12
+ unchecked?: number;
13
+ status?: string;
14
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/data/risk-profile/interfaces.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export * from "./useOnNewRiskProfile";
2
+ export * from "./useOnDeleteRiskProfile";
3
+ export * from "./useAutoUpdateListData";
@@ -0,0 +1,4 @@
1
+ export * from "./useOnNewRiskProfile";
2
+ export * from "./useOnDeleteRiskProfile";
3
+ export * from "./useAutoUpdateListData";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/data/risk-profile/risk-profile-events/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { IRiskProfile } from "../interfaces";
2
+ import { ListDataContextState } from "@voplus/morpho-ui/es/data";
3
+ /** React hook to call action when a new RiskProfile has been created. */
4
+ export declare const useAutoUpdateListData: (list: ListDataContextState<any>, shouldUpdate: (d: IRiskProfile, event: string) => boolean) => void;