@flarehr/superhero-basic-profile 0.1.2215 → 0.1.2217
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.
- package/dist/App.jsx +4 -0
- package/dist/Basic.Profile.Domain/AnalyticsEvent.jsx +102 -0
- package/dist/Basic.Profile.Domain/Audit.jsx +149 -0
- package/dist/Basic.Profile.Domain/Commands.jsx +68 -0
- package/dist/Basic.Profile.Domain/CommonTypes.jsx +194 -0
- package/dist/Basic.Profile.Domain/Config/Api/Admin/Read.jsx +58 -0
- package/dist/Basic.Profile.Domain/Config/Api/Admin/Write.jsx +23 -0
- package/dist/Basic.Profile.Domain/Config/Api/FlareAdminShell/Read.jsx +35 -0
- package/dist/Basic.Profile.Domain/Config/Commands.jsx +72 -0
- package/dist/Basic.Profile.Domain/Config/ConfigCommandHandler.jsx +197 -0
- package/dist/Basic.Profile.Domain/Config/Dto.jsx +181 -0
- package/dist/Basic.Profile.Domain/Config/Types.jsx +152 -0
- package/dist/Basic.Profile.Domain/DateTimeProvider.jsx +23 -0
- package/dist/Basic.Profile.Domain/DomainAggregates.jsx +801 -0
- package/dist/Basic.Profile.Domain/DomainPrimitives.jsx +426 -0
- package/dist/Basic.Profile.Domain/Dto/Aggregates.jsx +564 -0
- package/dist/Basic.Profile.Domain/Dto/AnalyticsEvent.jsx +157 -0
- package/dist/Basic.Profile.Domain/Dto/Api/Backend/Common.jsx +102 -0
- package/dist/Basic.Profile.Domain/Dto/Api/Backend/Read.jsx +85 -0
- package/dist/Basic.Profile.Domain/Dto/Api/Backend/Write.jsx +16 -0
- package/dist/Basic.Profile.Domain/Dto/Api/Common.jsx +427 -0
- package/dist/Basic.Profile.Domain/Dto/Api/External/Read.jsx +118 -0
- package/dist/Basic.Profile.Domain/Dto/Api/External/ReadV2.jsx +6 -0
- package/dist/Basic.Profile.Domain/Dto/Api/External/Write.jsx +184 -0
- package/dist/Basic.Profile.Domain/Dto/Api/External/WriteV2.jsx +439 -0
- package/dist/Basic.Profile.Domain/Dto/Api/FlareAdminShell/Read.jsx +38 -0
- package/dist/Basic.Profile.Domain/Dto/Api/FlareAdminShell/Write.jsx +199 -0
- package/dist/Basic.Profile.Domain/Dto/Api/Internal/Read.jsx +125 -0
- package/dist/Basic.Profile.Domain/Dto/Audit.jsx +121 -0
- package/dist/Basic.Profile.Domain/Dto/Commands.jsx +256 -0
- package/dist/Basic.Profile.Domain/Dto/Common.jsx +84 -0
- package/dist/Basic.Profile.Domain/Dto/Events.jsx +220 -0
- package/dist/Basic.Profile.Domain/Dto/Primitives.jsx +580 -0
- package/dist/Basic.Profile.Domain/Dto/ProfileCreationModels.jsx +324 -0
- package/dist/Basic.Profile.Domain/Dto/Validation.jsx +229 -0
- package/dist/Basic.Profile.Domain/Events.jsx +64 -0
- package/dist/Basic.Profile.Domain/Import/Api/InternalApi/Read.jsx +140 -0
- package/dist/Basic.Profile.Domain/Import/Api/InternalApi/Validation.jsx +499 -0
- package/dist/Basic.Profile.Domain/Import/Api/InternalApi/Write.jsx +51 -0
- package/dist/Basic.Profile.Domain/Import/Api/Read.jsx +154 -0
- package/dist/Basic.Profile.Domain/Import/CommonTypes.jsx +187 -0
- package/dist/Basic.Profile.Domain/Import/Dto.jsx +475 -0
- package/dist/Basic.Profile.Domain/Import/ImportCommandHandler.jsx +531 -0
- package/dist/Basic.Profile.Domain/Import/Types.jsx +405 -0
- package/dist/Basic.Profile.Domain/JwtPayload.jsx +44 -0
- package/dist/Basic.Profile.Domain/Metadata.jsx +257 -0
- package/dist/Basic.Profile.Domain/ProfileCommandHandler.jsx +261 -0
- package/dist/Basic.Profile.Domain/ProfileModels.jsx +59 -0
- package/dist/Basic.Profile.Domain/Utils.jsx +372 -0
- package/dist/Common/PreactCustomElement.jsx +8 -0
- package/dist/Common/Resources.jsx +20 -0
- package/dist/Common/Tailwind.jsx +8 -0
- package/dist/Common/Utils.jsx +18 -0
- package/dist/Directory/App.jsx +192 -0
- package/dist/Directory/BackendServices/Common.jsx +115 -0
- package/dist/Directory/BackendServices/ConfigService.jsx +168 -0
- package/dist/Directory/BackendServices/ImportService.jsx +137 -0
- package/dist/Directory/Common.jsx +93 -0
- package/dist/Directory/Config/Components.jsx +173 -0
- package/dist/Directory/Config/Types.jsx +187 -0
- package/dist/Directory/PastImports/PastImports.jsx +81 -0
- package/dist/Directory/ProfileImport/ProfileImport.jsx +284 -0
- package/dist/Directory/ProfileImport/Types.jsx +91 -0
- package/dist/Directory/TabNav.jsx +24 -0
- package/dist/Directory/Types.jsx +101 -0
- package/dist/Directory/User.jsx +117 -0
- package/dist/HeadlessUI/Dialog.jsx +66 -0
- package/dist/HeadlessUI/ModalDialog.jsx +74 -0
- package/dist/HeadlessUI/Switch.jsx +66 -0
- package/dist/HeadlessUI/Transition.jsx +66 -0
- package/package.json +1 -1
- package/dist/assets/delete.dcc7b157.svg +0 -5
- package/dist/assets/dialog-warning.cc77f3ba.svg +0 -5
- package/dist/assets/pencil.05fe6be6.svg +0 -5
- package/dist/index.html +0 -20
- package/dist/superhero-basic-profile.js +0 -50
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import { Record } from "../../fable_modules/fable-library-js.4.20.0/Types.js";
|
|
2
|
+
import { record_type, option_type, string_type } from "../../fable_modules/fable-library-js.4.20.0/Reflection.js";
|
|
3
|
+
import { ExternalId_ofDomain, AddressModule_ofDomain, DateOfBirth_ofDomain, MobilePhone_ofDomain, Email_ofDomain, Gender_ofDomain, Title_ofDomain, NameModule_ofDomain, AccountId_ofDomain, ExternalId_toDomain, AddressModule_toDomain, DateOfBirth_toDomain, MobilePhone_toDomain, Email_toDomain, Gender_toDomain, Title_toDomain, NameModule_toDomain, AccountId_toDomain, Address_$reflection, Name_$reflection } from "./Primitives.jsx";
|
|
4
|
+
import { FSharpResult$2 } from "../../fable_modules/fable-library-js.4.20.0/Result.js";
|
|
5
|
+
import { PartialProfileUpdateDetails, PartialProfileCreationDetails, FullProfileCreationDetails } from "../ProfileModels.jsx";
|
|
6
|
+
|
|
7
|
+
export class FullProfileCreationDetailsDto extends Record {
|
|
8
|
+
constructor(AccountId, Name, Title, Gender, Email, MobilePhone, DateOfBirth, Address, ExternalId) {
|
|
9
|
+
super();
|
|
10
|
+
this.AccountId = AccountId;
|
|
11
|
+
this.Name = Name;
|
|
12
|
+
this.Title = Title;
|
|
13
|
+
this.Gender = Gender;
|
|
14
|
+
this.Email = Email;
|
|
15
|
+
this.MobilePhone = MobilePhone;
|
|
16
|
+
this.DateOfBirth = DateOfBirth;
|
|
17
|
+
this.Address = Address;
|
|
18
|
+
this.ExternalId = ExternalId;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function FullProfileCreationDetailsDto_$reflection() {
|
|
23
|
+
return record_type("Dto.ProfileCreationModels.FullProfileCreationDetailsDto", [], FullProfileCreationDetailsDto, () => [["AccountId", string_type], ["Name", Name_$reflection()], ["Title", string_type], ["Gender", string_type], ["Email", string_type], ["MobilePhone", string_type], ["DateOfBirth", string_type], ["Address", Address_$reflection()], ["ExternalId", option_type(string_type)]]);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function FullProfileCreationDetailsDtoModule_toDomain(profile) {
|
|
27
|
+
const accountId = AccountId_toDomain(profile.AccountId);
|
|
28
|
+
const input_17 = NameModule_toDomain(profile.Name);
|
|
29
|
+
if (input_17.tag === 1) {
|
|
30
|
+
return new FSharpResult$2(1, [input_17.fields[0]]);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
const input_15 = Title_toDomain(profile.Title);
|
|
34
|
+
if (input_15.tag === 1) {
|
|
35
|
+
return new FSharpResult$2(1, [input_15.fields[0]]);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
const input_13 = Gender_toDomain(profile.Gender);
|
|
39
|
+
if (input_13.tag === 1) {
|
|
40
|
+
return new FSharpResult$2(1, [input_13.fields[0]]);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
const input_11 = Email_toDomain(profile.Email);
|
|
44
|
+
if (input_11.tag === 1) {
|
|
45
|
+
return new FSharpResult$2(1, [input_11.fields[0]]);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
const input_9 = MobilePhone_toDomain(profile.MobilePhone);
|
|
49
|
+
if (input_9.tag === 1) {
|
|
50
|
+
return new FSharpResult$2(1, [input_9.fields[0]]);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
const input_7 = DateOfBirth_toDomain(profile.DateOfBirth);
|
|
54
|
+
if (input_7.tag === 1) {
|
|
55
|
+
return new FSharpResult$2(1, [input_7.fields[0]]);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
const input_5 = AddressModule_toDomain(profile.Address);
|
|
59
|
+
if (input_5.tag === 1) {
|
|
60
|
+
return new FSharpResult$2(1, [input_5.fields[0]]);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
let input_3;
|
|
64
|
+
const input_1 = profile.ExternalId;
|
|
65
|
+
if (input_1 != null) {
|
|
66
|
+
const input_2 = ExternalId_toDomain(input_1);
|
|
67
|
+
input_3 = ((input_2.tag === 1) ? (new FSharpResult$2(1, [input_2.fields[0]])) : (new FSharpResult$2(0, [input_2.fields[0]])));
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
input_3 = (new FSharpResult$2(0, [undefined]));
|
|
71
|
+
}
|
|
72
|
+
if (input_3.tag === 1) {
|
|
73
|
+
return new FSharpResult$2(1, [input_3.fields[0]]);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
return new FSharpResult$2(0, [new FullProfileCreationDetails(accountId, input_17.fields[0], input_15.fields[0], input_13.fields[0], input_11.fields[0], input_9.fields[0], input_7.fields[0], input_5.fields[0], input_3.fields[0])]);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function FullProfileCreationDetailsDtoModule_ofDomain(p) {
|
|
88
|
+
let input_1;
|
|
89
|
+
return new FullProfileCreationDetailsDto(AccountId_ofDomain(p.AccountId), NameModule_ofDomain(p.Name), Title_ofDomain(p.Title), Gender_ofDomain(p.Gender), Email_ofDomain(p.Email), MobilePhone_ofDomain(p.MobilePhone), DateOfBirth_ofDomain(p.DateOfBirth), AddressModule_ofDomain(p.Address), (input_1 = p.ExternalId, (input_1 == null) ? undefined : ExternalId_ofDomain(input_1)));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export class PartialProfileCreationDetailsDto extends Record {
|
|
93
|
+
constructor(AccountId, Name, Email, MobilePhone, ExternalId, Title, Gender, DateOfBirth, Address) {
|
|
94
|
+
super();
|
|
95
|
+
this.AccountId = AccountId;
|
|
96
|
+
this.Name = Name;
|
|
97
|
+
this.Email = Email;
|
|
98
|
+
this.MobilePhone = MobilePhone;
|
|
99
|
+
this.ExternalId = ExternalId;
|
|
100
|
+
this.Title = Title;
|
|
101
|
+
this.Gender = Gender;
|
|
102
|
+
this.DateOfBirth = DateOfBirth;
|
|
103
|
+
this.Address = Address;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function PartialProfileCreationDetailsDto_$reflection() {
|
|
108
|
+
return record_type("Dto.ProfileCreationModels.PartialProfileCreationDetailsDto", [], PartialProfileCreationDetailsDto, () => [["AccountId", string_type], ["Name", Name_$reflection()], ["Email", string_type], ["MobilePhone", option_type(string_type)], ["ExternalId", option_type(string_type)], ["Title", option_type(string_type)], ["Gender", option_type(string_type)], ["DateOfBirth", option_type(string_type)], ["Address", option_type(Address_$reflection())]]);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function PartialProfileCreationDetailsDtoModule_toDomain(p) {
|
|
112
|
+
const accountId = AccountId_toDomain(p.AccountId);
|
|
113
|
+
const input_32 = NameModule_toDomain(p.Name);
|
|
114
|
+
if (input_32.tag === 1) {
|
|
115
|
+
return new FSharpResult$2(1, [input_32.fields[0]]);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
const input_30 = Email_toDomain(p.Email);
|
|
119
|
+
if (input_30.tag === 1) {
|
|
120
|
+
return new FSharpResult$2(1, [input_30.fields[0]]);
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
let input_28;
|
|
124
|
+
const input_1 = p.MobilePhone;
|
|
125
|
+
if (input_1 != null) {
|
|
126
|
+
const input_2 = MobilePhone_toDomain(input_1);
|
|
127
|
+
input_28 = ((input_2.tag === 1) ? (new FSharpResult$2(1, [input_2.fields[0]])) : (new FSharpResult$2(0, [input_2.fields[0]])));
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
input_28 = (new FSharpResult$2(0, [undefined]));
|
|
131
|
+
}
|
|
132
|
+
if (input_28.tag === 1) {
|
|
133
|
+
return new FSharpResult$2(1, [input_28.fields[0]]);
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
let input_26;
|
|
137
|
+
const input_4 = p.ExternalId;
|
|
138
|
+
if (input_4 != null) {
|
|
139
|
+
const input_5 = ExternalId_toDomain(input_4);
|
|
140
|
+
input_26 = ((input_5.tag === 1) ? (new FSharpResult$2(1, [input_5.fields[0]])) : (new FSharpResult$2(0, [input_5.fields[0]])));
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
input_26 = (new FSharpResult$2(0, [undefined]));
|
|
144
|
+
}
|
|
145
|
+
if (input_26.tag === 1) {
|
|
146
|
+
return new FSharpResult$2(1, [input_26.fields[0]]);
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
let input_24;
|
|
150
|
+
const input_7 = p.Title;
|
|
151
|
+
if (input_7 != null) {
|
|
152
|
+
const input_8 = Title_toDomain(input_7);
|
|
153
|
+
input_24 = ((input_8.tag === 1) ? (new FSharpResult$2(1, [input_8.fields[0]])) : (new FSharpResult$2(0, [input_8.fields[0]])));
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
input_24 = (new FSharpResult$2(0, [undefined]));
|
|
157
|
+
}
|
|
158
|
+
if (input_24.tag === 1) {
|
|
159
|
+
return new FSharpResult$2(1, [input_24.fields[0]]);
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
let input_22;
|
|
163
|
+
const input_10 = p.Gender;
|
|
164
|
+
if (input_10 != null) {
|
|
165
|
+
const input_11 = Gender_toDomain(input_10);
|
|
166
|
+
input_22 = ((input_11.tag === 1) ? (new FSharpResult$2(1, [input_11.fields[0]])) : (new FSharpResult$2(0, [input_11.fields[0]])));
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
input_22 = (new FSharpResult$2(0, [undefined]));
|
|
170
|
+
}
|
|
171
|
+
if (input_22.tag === 1) {
|
|
172
|
+
return new FSharpResult$2(1, [input_22.fields[0]]);
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
let input_20;
|
|
176
|
+
const input_13 = p.DateOfBirth;
|
|
177
|
+
if (input_13 != null) {
|
|
178
|
+
const input_14 = DateOfBirth_toDomain(input_13);
|
|
179
|
+
input_20 = ((input_14.tag === 1) ? (new FSharpResult$2(1, [input_14.fields[0]])) : (new FSharpResult$2(0, [input_14.fields[0]])));
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
input_20 = (new FSharpResult$2(0, [undefined]));
|
|
183
|
+
}
|
|
184
|
+
if (input_20.tag === 1) {
|
|
185
|
+
return new FSharpResult$2(1, [input_20.fields[0]]);
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
let input_18;
|
|
189
|
+
const input_16 = p.Address;
|
|
190
|
+
if (input_16 != null) {
|
|
191
|
+
const input_17 = AddressModule_toDomain(input_16);
|
|
192
|
+
input_18 = ((input_17.tag === 1) ? (new FSharpResult$2(1, [input_17.fields[0]])) : (new FSharpResult$2(0, [input_17.fields[0]])));
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
input_18 = (new FSharpResult$2(0, [undefined]));
|
|
196
|
+
}
|
|
197
|
+
if (input_18.tag === 1) {
|
|
198
|
+
return new FSharpResult$2(1, [input_18.fields[0]]);
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
return new FSharpResult$2(0, [new PartialProfileCreationDetails(accountId, input_32.fields[0], input_30.fields[0], input_28.fields[0], input_26.fields[0], input_24.fields[0], input_22.fields[0], input_20.fields[0], input_18.fields[0])]);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export function PartialProfileCreationDetailsDtoModule_ofDomain(p) {
|
|
213
|
+
let input_1, input_3, input_5, input_7, input_9, input_11;
|
|
214
|
+
return new PartialProfileCreationDetailsDto(AccountId_ofDomain(p.AccountId), NameModule_ofDomain(p.Name), Email_ofDomain(p.Email), (input_1 = p.MobilePhone, (input_1 == null) ? undefined : MobilePhone_ofDomain(input_1)), (input_3 = p.ExternalId, (input_3 == null) ? undefined : ExternalId_ofDomain(input_3)), (input_5 = p.Title, (input_5 == null) ? undefined : Title_ofDomain(input_5)), (input_7 = p.Gender, (input_7 == null) ? undefined : Gender_ofDomain(input_7)), (input_9 = p.DateOfBirth, (input_9 == null) ? undefined : DateOfBirth_ofDomain(input_9)), (input_11 = p.Address, (input_11 == null) ? undefined : AddressModule_ofDomain(input_11)));
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export class PartialProfileUpdateDetailsDto extends Record {
|
|
218
|
+
constructor(Name, Email, MobilePhone, Title, Gender, DateOfBirth, Address) {
|
|
219
|
+
super();
|
|
220
|
+
this.Name = Name;
|
|
221
|
+
this.Email = Email;
|
|
222
|
+
this.MobilePhone = MobilePhone;
|
|
223
|
+
this.Title = Title;
|
|
224
|
+
this.Gender = Gender;
|
|
225
|
+
this.DateOfBirth = DateOfBirth;
|
|
226
|
+
this.Address = Address;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export function PartialProfileUpdateDetailsDto_$reflection() {
|
|
231
|
+
return record_type("Dto.ProfileCreationModels.PartialProfileUpdateDetailsDto", [], PartialProfileUpdateDetailsDto, () => [["Name", Name_$reflection()], ["Email", string_type], ["MobilePhone", option_type(string_type)], ["Title", option_type(string_type)], ["Gender", option_type(string_type)], ["DateOfBirth", option_type(string_type)], ["Address", option_type(Address_$reflection())]]);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export function PartialProfileUpdateDetailsDtoModule_toDomain(p) {
|
|
235
|
+
const input_27 = NameModule_toDomain(p.Name);
|
|
236
|
+
if (input_27.tag === 1) {
|
|
237
|
+
return new FSharpResult$2(1, [input_27.fields[0]]);
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
const input_25 = Email_toDomain(p.Email);
|
|
241
|
+
if (input_25.tag === 1) {
|
|
242
|
+
return new FSharpResult$2(1, [input_25.fields[0]]);
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
let input_23;
|
|
246
|
+
const input_1 = p.MobilePhone;
|
|
247
|
+
if (input_1 != null) {
|
|
248
|
+
const input_2 = MobilePhone_toDomain(input_1);
|
|
249
|
+
input_23 = ((input_2.tag === 1) ? (new FSharpResult$2(1, [input_2.fields[0]])) : (new FSharpResult$2(0, [input_2.fields[0]])));
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
input_23 = (new FSharpResult$2(0, [undefined]));
|
|
253
|
+
}
|
|
254
|
+
if (input_23.tag === 1) {
|
|
255
|
+
return new FSharpResult$2(1, [input_23.fields[0]]);
|
|
256
|
+
}
|
|
257
|
+
else {
|
|
258
|
+
let input_21;
|
|
259
|
+
const input_4 = p.Title;
|
|
260
|
+
if (input_4 != null) {
|
|
261
|
+
const input_5 = Title_toDomain(input_4);
|
|
262
|
+
input_21 = ((input_5.tag === 1) ? (new FSharpResult$2(1, [input_5.fields[0]])) : (new FSharpResult$2(0, [input_5.fields[0]])));
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
input_21 = (new FSharpResult$2(0, [undefined]));
|
|
266
|
+
}
|
|
267
|
+
if (input_21.tag === 1) {
|
|
268
|
+
return new FSharpResult$2(1, [input_21.fields[0]]);
|
|
269
|
+
}
|
|
270
|
+
else {
|
|
271
|
+
let input_19;
|
|
272
|
+
const input_7 = p.Gender;
|
|
273
|
+
if (input_7 != null) {
|
|
274
|
+
const input_8 = Gender_toDomain(input_7);
|
|
275
|
+
input_19 = ((input_8.tag === 1) ? (new FSharpResult$2(1, [input_8.fields[0]])) : (new FSharpResult$2(0, [input_8.fields[0]])));
|
|
276
|
+
}
|
|
277
|
+
else {
|
|
278
|
+
input_19 = (new FSharpResult$2(0, [undefined]));
|
|
279
|
+
}
|
|
280
|
+
if (input_19.tag === 1) {
|
|
281
|
+
return new FSharpResult$2(1, [input_19.fields[0]]);
|
|
282
|
+
}
|
|
283
|
+
else {
|
|
284
|
+
let input_17;
|
|
285
|
+
const input_10 = p.DateOfBirth;
|
|
286
|
+
if (input_10 != null) {
|
|
287
|
+
const input_11 = DateOfBirth_toDomain(input_10);
|
|
288
|
+
input_17 = ((input_11.tag === 1) ? (new FSharpResult$2(1, [input_11.fields[0]])) : (new FSharpResult$2(0, [input_11.fields[0]])));
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
input_17 = (new FSharpResult$2(0, [undefined]));
|
|
292
|
+
}
|
|
293
|
+
if (input_17.tag === 1) {
|
|
294
|
+
return new FSharpResult$2(1, [input_17.fields[0]]);
|
|
295
|
+
}
|
|
296
|
+
else {
|
|
297
|
+
let input_15;
|
|
298
|
+
const input_13 = p.Address;
|
|
299
|
+
if (input_13 != null) {
|
|
300
|
+
const input_14 = AddressModule_toDomain(input_13);
|
|
301
|
+
input_15 = ((input_14.tag === 1) ? (new FSharpResult$2(1, [input_14.fields[0]])) : (new FSharpResult$2(0, [input_14.fields[0]])));
|
|
302
|
+
}
|
|
303
|
+
else {
|
|
304
|
+
input_15 = (new FSharpResult$2(0, [undefined]));
|
|
305
|
+
}
|
|
306
|
+
if (input_15.tag === 1) {
|
|
307
|
+
return new FSharpResult$2(1, [input_15.fields[0]]);
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
return new FSharpResult$2(0, [new PartialProfileUpdateDetails(input_27.fields[0], input_25.fields[0], input_23.fields[0], input_21.fields[0], input_19.fields[0], input_17.fields[0], input_15.fields[0])]);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export function PartialProfileUpdateDetailsDtoModule_ofDomain(p) {
|
|
321
|
+
let input_1, input_3, input_5, input_7, input_9;
|
|
322
|
+
return new PartialProfileUpdateDetailsDto(NameModule_ofDomain(p.Name), Email_ofDomain(p.Email), (input_1 = p.MobilePhone, (input_1 == null) ? undefined : MobilePhone_ofDomain(input_1)), (input_3 = p.Title, (input_3 == null) ? undefined : Title_ofDomain(input_3)), (input_5 = p.Gender, (input_5 == null) ? undefined : Gender_ofDomain(input_5)), (input_7 = p.DateOfBirth, (input_7 == null) ? undefined : DateOfBirth_ofDomain(input_7)), (input_9 = p.Address, (input_9 == null) ? undefined : AddressModule_ofDomain(input_9)));
|
|
323
|
+
}
|
|
324
|
+
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { Union } from "../../fable_modules/fable-library-js.4.20.0/Types.js";
|
|
2
|
+
import { union_type, char_type, int32_type } from "../../fable_modules/fable-library-js.4.20.0/Reflection.js";
|
|
3
|
+
import { filter, isNullOrWhiteSpace } from "../../fable_modules/fable-library-js.4.20.0/String.js";
|
|
4
|
+
import { FSharpResult$2 } from "../../fable_modules/fable-library-js.4.20.0/Result.js";
|
|
5
|
+
import { isDigit } from "../../fable_modules/fable-library-js.4.20.0/Char.js";
|
|
6
|
+
import { utcNow, addYears, date, compare, year, addDays } from "../../fable_modules/fable-library-js.4.20.0/Date.js";
|
|
7
|
+
import { op_UnaryNegation_Int32 } from "../../fable_modules/fable-library-js.4.20.0/Int32.js";
|
|
8
|
+
import { create, match } from "../../fable_modules/fable-library-js.4.20.0/RegExp.js";
|
|
9
|
+
import { Date_tryParse, Date_isValid } from "../Utils.jsx";
|
|
10
|
+
import { traverseResultM } from "../../fable_modules/FsToolkit.ErrorHandling.4.16.0/List.fs.js";
|
|
11
|
+
import { singleton, ofArray } from "../../fable_modules/fable-library-js.4.20.0/List.js";
|
|
12
|
+
import { Gender_toDomain, Title_toDomain } from "./Primitives.jsx";
|
|
13
|
+
import { RelationshipModule_toDomain, AuStateModule_toDomain } from "../DomainPrimitives.jsx";
|
|
14
|
+
|
|
15
|
+
export class ValidationNotPassed extends Union {
|
|
16
|
+
constructor(tag, fields) {
|
|
17
|
+
super();
|
|
18
|
+
this.tag = tag;
|
|
19
|
+
this.fields = fields;
|
|
20
|
+
}
|
|
21
|
+
cases() {
|
|
22
|
+
return ["Required", "MaxLen", "MinLen", "Regex", "NumbersOnly", "DuSelection", "Email", "Date", "DateOfBirth", "PhoneNumber", "NotStartWith"];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function ValidationNotPassed_$reflection() {
|
|
27
|
+
return union_type("Dto.Validation.ValidationNotPassed", [], ValidationNotPassed, () => [[], [["Item", int32_type]], [["Item", int32_type]], [], [], [], [], [], [["Item", DateOfBirthNotPassed_$reflection()]], [], [["Item", char_type]]]);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export class DateOfBirthNotPassed extends Union {
|
|
31
|
+
constructor(tag, fields) {
|
|
32
|
+
super();
|
|
33
|
+
this.tag = tag;
|
|
34
|
+
this.fields = fields;
|
|
35
|
+
}
|
|
36
|
+
cases() {
|
|
37
|
+
return ["Over100", "Under13"];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function DateOfBirthNotPassed_$reflection() {
|
|
42
|
+
return union_type("Dto.Validation.DateOfBirthNotPassed", [], DateOfBirthNotPassed, () => [[], []]);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function Fn_required(value) {
|
|
46
|
+
if (isNullOrWhiteSpace(value)) {
|
|
47
|
+
return new FSharpResult$2(1, [new ValidationNotPassed(0, [])]);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
return new FSharpResult$2(0, [undefined]);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function Fn_numbersOnly(value) {
|
|
55
|
+
if (filter(isDigit, value) === value) {
|
|
56
|
+
return new FSharpResult$2(0, [undefined]);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
return new FSharpResult$2(1, [new ValidationNotPassed(4, [])]);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function Fn_minLen(min, value) {
|
|
64
|
+
if (value.length < min) {
|
|
65
|
+
return new FSharpResult$2(1, [new ValidationNotPassed(2, [min])]);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
return new FSharpResult$2(0, [undefined]);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function Fn_maxLen(max, value) {
|
|
73
|
+
if (value.length > max) {
|
|
74
|
+
return new FSharpResult$2(1, [new ValidationNotPassed(1, [max])]);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
return new FSharpResult$2(0, [undefined]);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function Fn_duSelection(toDu, value) {
|
|
82
|
+
const matchValue = toDu(value);
|
|
83
|
+
if (matchValue.tag === 1) {
|
|
84
|
+
return new FSharpResult$2(1, [new ValidationNotPassed(5, [])]);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
return new FSharpResult$2(0, [undefined]);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function Fn_dateOfBirth(today, dob) {
|
|
92
|
+
const today_1 = addDays(today, 1);
|
|
93
|
+
let age;
|
|
94
|
+
const age$0027 = (year(today_1) - year(dob)) | 0;
|
|
95
|
+
age = ((compare(date(dob), addYears(today_1, op_UnaryNegation_Int32(age$0027))) > 0) ? (age$0027 - 1) : age$0027);
|
|
96
|
+
const input_2 = (age >= 13) ? (new FSharpResult$2(0, [undefined])) : (new FSharpResult$2(1, [new ValidationNotPassed(8, [new DateOfBirthNotPassed(1, [])])]));
|
|
97
|
+
if (input_2.tag === 1) {
|
|
98
|
+
return new FSharpResult$2(1, [input_2.fields[0]]);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
const input = (age < 100) ? (new FSharpResult$2(0, [undefined])) : (new FSharpResult$2(1, [new ValidationNotPassed(8, [new DateOfBirthNotPassed(0, [])])]));
|
|
102
|
+
if (input.tag === 1) {
|
|
103
|
+
return new FSharpResult$2(1, [input.fields[0]]);
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
return new FSharpResult$2(0, [undefined]);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function Fn_regex(pattern, value) {
|
|
112
|
+
if (match(create(pattern), value) != null) {
|
|
113
|
+
return new FSharpResult$2(0, [undefined]);
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
return new FSharpResult$2(1, [new ValidationNotPassed(3, [])]);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export function Fn_dateStr(value) {
|
|
121
|
+
return Date_isValid(new ValidationNotPassed(7, []), value);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export function Fn_dateOfBirthStr(today, value) {
|
|
125
|
+
const input_1 = Date_tryParse(new ValidationNotPassed(7, []), value);
|
|
126
|
+
if (input_1.tag === 1) {
|
|
127
|
+
return new FSharpResult$2(1, [input_1.fields[0]]);
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
return Fn_dateOfBirth(today, input_1.fields[0]);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export function Fn_email(value) {
|
|
135
|
+
if ((((value.length <= 320) && !(value.indexOf("..") >= 0)) && !(value.indexOf(".@") >= 0)) && (match(/^[A-Z0-9][A-Z0-9._%+'-]{0,63}@(?:[A-Z0-9-]{1,63}\.){1,125}[A-Z]{2,63}$/gui, value) != null)) {
|
|
136
|
+
return new FSharpResult$2(0, [undefined]);
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
return new FSharpResult$2(1, [new ValidationNotPassed(6, [])]);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export function Fn_notStartWith(character, value) {
|
|
144
|
+
if (value.indexOf(character) === 0) {
|
|
145
|
+
return new FSharpResult$2(1, [new ValidationNotPassed(10, [character])]);
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
return new FSharpResult$2(0, [undefined]);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export function validate(validationFunctionList, field) {
|
|
153
|
+
const result_1 = traverseResultM((f) => f(field), validationFunctionList);
|
|
154
|
+
if (result_1.tag === 1) {
|
|
155
|
+
return new FSharpResult$2(1, [result_1.fields[0]]);
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
return new FSharpResult$2(0, [undefined]);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export const Validate_name = (field) => validate(ofArray([Fn_required, (value_1) => Fn_maxLen(60, value_1), (value_2) => Fn_notStartWith("-", value_2), (value_3) => Fn_notStartWith("\'", value_3), (value_4) => Fn_regex("(^[A-Za-zÀ-ÖØ-öø-ÿĀ-ž])[A-Za-zÀ-ÖØ-öø-ÿĀ-ž\\- \']{0,59}$", value_4)]), field);
|
|
163
|
+
|
|
164
|
+
export function Validate_optionalName(v) {
|
|
165
|
+
if (v != null) {
|
|
166
|
+
return validate(ofArray([(value) => Fn_maxLen(60, value), (value_1) => Fn_notStartWith("-", value_1), (value_2) => Fn_notStartWith("\'", value_2), (value_3) => Fn_regex("(^[A-Za-zÀ-ÖØ-öø-ÿĀ-ž])[A-Za-zÀ-ÖØ-öø-ÿĀ-ž\\- \']{0,59}$", value_3)]), v);
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
return new FSharpResult$2(0, [undefined]);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export const Validate_addressLine = (field) => validate(ofArray([Fn_required, (value_1) => Fn_maxLen(60, value_1), (value_2) => Fn_regex("(^[0-9A-Za-z])[0-9A-Za-z\\- \'\\/,\\.]{0,59}$", value_2)]), field);
|
|
174
|
+
|
|
175
|
+
export function Validate_optionalAddressLine(v) {
|
|
176
|
+
if (v != null) {
|
|
177
|
+
return validate(ofArray([(value) => Fn_maxLen(60, value), (value_1) => Fn_regex("(^[0-9A-Za-z])[0-9A-Za-z\\- \'\\/,\\.]{0,59}$", value_1)]), v);
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
return new FSharpResult$2(0, [undefined]);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export const Validate_title = (field) => validate(ofArray([Fn_required, (value_1) => Fn_duSelection(Title_toDomain, value_1)]), field);
|
|
185
|
+
|
|
186
|
+
export const Validate_gender = (field) => validate(ofArray([Fn_required, (value_1) => Fn_duSelection(Gender_toDomain, value_1)]), field);
|
|
187
|
+
|
|
188
|
+
export const Validate_email = (field) => validate(ofArray([Fn_required, Fn_email]), field);
|
|
189
|
+
|
|
190
|
+
export function Validate_optionalEmail(v) {
|
|
191
|
+
if (v != null) {
|
|
192
|
+
return validate(singleton(Validate_email), v);
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
return new FSharpResult$2(0, [undefined]);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export const Validate_mobilePhone = (field) => validate(ofArray([Fn_required, (value_1) => Fn_maxLen(12, value_1), (arg) => {
|
|
200
|
+
const input_1 = Fn_regex("^\\+\\d{11}$", arg);
|
|
201
|
+
return (input_1.tag === 1) ? (new FSharpResult$2(1, [new ValidationNotPassed(9, [])])) : (new FSharpResult$2(0, [input_1.fields[0]]));
|
|
202
|
+
}]), field);
|
|
203
|
+
|
|
204
|
+
export function Validate_dateOfBirth(today) {
|
|
205
|
+
return (field) => validate(singleton((dob) => Fn_dateOfBirth(today, dob)), field);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export function Validate_dateOfBirthAgeNow(dob) {
|
|
209
|
+
return Validate_dateOfBirth(utcNow())(dob);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export function Validate_dateOfBirthStr(today) {
|
|
213
|
+
return (field) => validate(ofArray([Fn_required, (value_1) => Fn_dateOfBirthStr(today, value_1)]), field);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export function Validate_dateOfBirthStrAgeNow(dob) {
|
|
217
|
+
return Validate_dateOfBirthStr(utcNow())(dob);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export const Validate_city = (field) => validate(ofArray([Fn_required, (value_1) => Fn_maxLen(60, value_1), (value_2) => Fn_regex("(^[A-Za-z])[A-Za-z\\- ]{0,59}$", value_2)]), field);
|
|
221
|
+
|
|
222
|
+
export const Validate_state = (field) => validate(ofArray([Fn_required, (value_1) => Fn_duSelection(AuStateModule_toDomain, value_1)]), field);
|
|
223
|
+
|
|
224
|
+
export const Validate_postcode = (field) => validate(ofArray([Fn_required, (value_1) => Fn_maxLen(4, value_1), Fn_numbersOnly]), field);
|
|
225
|
+
|
|
226
|
+
export const Validate_countryCode = (field) => validate(ofArray([Fn_required, (value_1) => Fn_maxLen(4, value_1)]), field);
|
|
227
|
+
|
|
228
|
+
export const Validate_relationship = (field) => validate(ofArray([Fn_required, (value_1) => Fn_duSelection(RelationshipModule_toDomain, value_1)]), field);
|
|
229
|
+
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Record, Union } from "../fable_modules/fable-library-js.4.20.0/Types.js";
|
|
2
|
+
import { PartialProfileUpdateDetails_$reflection, PartialProfileCreationDetails_$reflection, FullProfileCreationDetails_$reflection } from "./ProfileModels.jsx";
|
|
3
|
+
import { EmergencyContact_$reflection, Address_$reflection, DateOfBirth_$reflection, MobilePhone_$reflection, Email_$reflection, Gender_$reflection, Title_$reflection, Name_$reflection } from "./DomainPrimitives.jsx";
|
|
4
|
+
import { record_type, class_type, union_type, list_type } from "../fable_modules/fable-library-js.4.20.0/Reflection.js";
|
|
5
|
+
import { CommandId_$reflection } from "./Commands.jsx";
|
|
6
|
+
import { ProfileEventMetadata_$reflection } from "./Metadata.jsx";
|
|
7
|
+
|
|
8
|
+
export class ProfileEvent extends Union {
|
|
9
|
+
constructor(tag, fields) {
|
|
10
|
+
super();
|
|
11
|
+
this.tag = tag;
|
|
12
|
+
this.fields = fields;
|
|
13
|
+
}
|
|
14
|
+
cases() {
|
|
15
|
+
return ["ProfileCreated", "PartialCreated", "PartialUpdated", "PartialPromoted", "ProfileActivated", "ProfileDeactivated", "ProfileArchived", "ProfileRestored", "NameChanged", "TitleChanged", "GenderChanged", "EmailChanged", "MobilePhoneChanged", "DateOfBirthChanged", "AddressChanged", "EmergencyContactsChanged", "PersonalDataPurged"];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function ProfileEvent_$reflection() {
|
|
20
|
+
return union_type("Events.ProfileEvent", [], ProfileEvent, () => [[["Item", FullProfileCreationDetails_$reflection()]], [["Item", PartialProfileCreationDetails_$reflection()]], [["Item", PartialProfileUpdateDetails_$reflection()]], [["Item", FullProfileCreationDetails_$reflection()]], [], [], [], [], [["Item", Name_$reflection()]], [["Item", Title_$reflection()]], [["Item", Gender_$reflection()]], [["Item", Email_$reflection()]], [["Item", MobilePhone_$reflection()]], [["Item", DateOfBirth_$reflection()]], [["Item", Address_$reflection()]], [["Item", list_type(EmergencyContact_$reflection())]], []]);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function ProfileEventModule_isEmailChangedEvent(profileEvent) {
|
|
24
|
+
if (profileEvent.tag === 11) {
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export class EventId extends Union {
|
|
33
|
+
constructor(Item) {
|
|
34
|
+
super();
|
|
35
|
+
this.tag = 0;
|
|
36
|
+
this.fields = [Item];
|
|
37
|
+
}
|
|
38
|
+
cases() {
|
|
39
|
+
return ["EventId"];
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function EventId_$reflection() {
|
|
44
|
+
return union_type("Events.EventId", [], EventId, () => [[["Item", class_type("System.Guid")]]]);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function EventIdModule_value(_arg) {
|
|
48
|
+
return _arg.fields[0];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export class Event$1 extends Record {
|
|
52
|
+
constructor(Id, CommandId, Data, Metadata) {
|
|
53
|
+
super();
|
|
54
|
+
this.Id = Id;
|
|
55
|
+
this.CommandId = CommandId;
|
|
56
|
+
this.Data = Data;
|
|
57
|
+
this.Metadata = Metadata;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function Event$1_$reflection(gen0) {
|
|
62
|
+
return record_type("Events.Event`1", [gen0], Event$1, () => [["Id", EventId_$reflection()], ["CommandId", CommandId_$reflection()], ["Data", gen0], ["Metadata", ProfileEventMetadata_$reflection()]]);
|
|
63
|
+
}
|
|
64
|
+
|