@flarehr/superhero-basic-profile 0.1.2217 → 0.1.2219
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/assets/delete.dcc7b157.svg +5 -0
- package/dist/assets/dialog-warning.cc77f3ba.svg +5 -0
- package/dist/assets/pencil.05fe6be6.svg +5 -0
- package/dist/index.html +20 -0
- package/dist/superhero-basic-profile.js +50 -0
- package/package.json +1 -1
- package/dist/App.jsx +0 -4
- package/dist/Basic.Profile.Domain/AnalyticsEvent.jsx +0 -102
- package/dist/Basic.Profile.Domain/Audit.jsx +0 -149
- package/dist/Basic.Profile.Domain/Commands.jsx +0 -68
- package/dist/Basic.Profile.Domain/CommonTypes.jsx +0 -194
- package/dist/Basic.Profile.Domain/Config/Api/Admin/Read.jsx +0 -58
- package/dist/Basic.Profile.Domain/Config/Api/Admin/Write.jsx +0 -23
- package/dist/Basic.Profile.Domain/Config/Api/FlareAdminShell/Read.jsx +0 -35
- package/dist/Basic.Profile.Domain/Config/Commands.jsx +0 -72
- package/dist/Basic.Profile.Domain/Config/ConfigCommandHandler.jsx +0 -197
- package/dist/Basic.Profile.Domain/Config/Dto.jsx +0 -181
- package/dist/Basic.Profile.Domain/Config/Types.jsx +0 -152
- package/dist/Basic.Profile.Domain/DateTimeProvider.jsx +0 -23
- package/dist/Basic.Profile.Domain/DomainAggregates.jsx +0 -801
- package/dist/Basic.Profile.Domain/DomainPrimitives.jsx +0 -426
- package/dist/Basic.Profile.Domain/Dto/Aggregates.jsx +0 -564
- package/dist/Basic.Profile.Domain/Dto/AnalyticsEvent.jsx +0 -157
- package/dist/Basic.Profile.Domain/Dto/Api/Backend/Common.jsx +0 -102
- package/dist/Basic.Profile.Domain/Dto/Api/Backend/Read.jsx +0 -85
- package/dist/Basic.Profile.Domain/Dto/Api/Backend/Write.jsx +0 -16
- package/dist/Basic.Profile.Domain/Dto/Api/Common.jsx +0 -427
- package/dist/Basic.Profile.Domain/Dto/Api/External/Read.jsx +0 -118
- package/dist/Basic.Profile.Domain/Dto/Api/External/ReadV2.jsx +0 -6
- package/dist/Basic.Profile.Domain/Dto/Api/External/Write.jsx +0 -184
- package/dist/Basic.Profile.Domain/Dto/Api/External/WriteV2.jsx +0 -439
- package/dist/Basic.Profile.Domain/Dto/Api/FlareAdminShell/Read.jsx +0 -38
- package/dist/Basic.Profile.Domain/Dto/Api/FlareAdminShell/Write.jsx +0 -199
- package/dist/Basic.Profile.Domain/Dto/Api/Internal/Read.jsx +0 -125
- package/dist/Basic.Profile.Domain/Dto/Audit.jsx +0 -121
- package/dist/Basic.Profile.Domain/Dto/Commands.jsx +0 -256
- package/dist/Basic.Profile.Domain/Dto/Common.jsx +0 -84
- package/dist/Basic.Profile.Domain/Dto/Events.jsx +0 -220
- package/dist/Basic.Profile.Domain/Dto/Primitives.jsx +0 -580
- package/dist/Basic.Profile.Domain/Dto/ProfileCreationModels.jsx +0 -324
- package/dist/Basic.Profile.Domain/Dto/Validation.jsx +0 -229
- package/dist/Basic.Profile.Domain/Events.jsx +0 -64
- package/dist/Basic.Profile.Domain/Import/Api/InternalApi/Read.jsx +0 -140
- package/dist/Basic.Profile.Domain/Import/Api/InternalApi/Validation.jsx +0 -499
- package/dist/Basic.Profile.Domain/Import/Api/InternalApi/Write.jsx +0 -51
- package/dist/Basic.Profile.Domain/Import/Api/Read.jsx +0 -154
- package/dist/Basic.Profile.Domain/Import/CommonTypes.jsx +0 -187
- package/dist/Basic.Profile.Domain/Import/Dto.jsx +0 -475
- package/dist/Basic.Profile.Domain/Import/ImportCommandHandler.jsx +0 -531
- package/dist/Basic.Profile.Domain/Import/Types.jsx +0 -405
- package/dist/Basic.Profile.Domain/JwtPayload.jsx +0 -44
- package/dist/Basic.Profile.Domain/Metadata.jsx +0 -257
- package/dist/Basic.Profile.Domain/ProfileCommandHandler.jsx +0 -261
- package/dist/Basic.Profile.Domain/ProfileModels.jsx +0 -59
- package/dist/Basic.Profile.Domain/Utils.jsx +0 -372
- package/dist/Common/PreactCustomElement.jsx +0 -8
- package/dist/Common/Resources.jsx +0 -20
- package/dist/Common/Tailwind.jsx +0 -8
- package/dist/Common/Utils.jsx +0 -18
- package/dist/Directory/App.jsx +0 -192
- package/dist/Directory/BackendServices/Common.jsx +0 -115
- package/dist/Directory/BackendServices/ConfigService.jsx +0 -168
- package/dist/Directory/BackendServices/ImportService.jsx +0 -137
- package/dist/Directory/Common.jsx +0 -93
- package/dist/Directory/Config/Components.jsx +0 -173
- package/dist/Directory/Config/Types.jsx +0 -187
- package/dist/Directory/PastImports/PastImports.jsx +0 -81
- package/dist/Directory/ProfileImport/ProfileImport.jsx +0 -284
- package/dist/Directory/ProfileImport/Types.jsx +0 -91
- package/dist/Directory/TabNav.jsx +0 -24
- package/dist/Directory/Types.jsx +0 -101
- package/dist/Directory/User.jsx +0 -117
- package/dist/HeadlessUI/Dialog.jsx +0 -66
- package/dist/HeadlessUI/ModalDialog.jsx +0 -74
- package/dist/HeadlessUI/Switch.jsx +0 -66
- package/dist/HeadlessUI/Transition.jsx +0 -66
|
@@ -1,427 +0,0 @@
|
|
|
1
|
-
import { EmergencyContactDtoModule_toDomain, DateOfBirth_toDomain as DateOfBirth_toDomain_1, AddressModule_toDomain, Address as Address_1, MobilePhone_toDomain as MobilePhone_toDomain_1, Email_toDomain as Email_toDomain_1, Gender_toDomain as Gender_toDomain_1, Title_toDomain as Title_toDomain_1, NameModule_toDomain, PurgedAddress_$reflection, Name_$reflection, EmergencyContactDto_$reflection, Address_$reflection, PurgedAddressModule_ofDomain, EmergencyContactDtoModule_ofDomain, ExternalId_ofDomain, AddressModule_ofDomain, DateOfBirth_ofDomain, MobilePhone_ofDomain, Email_ofDomain, Gender_ofDomain, Title_ofDomain, NameModule_ofDomain } from "../Primitives.jsx";
|
|
2
|
-
import { map } from "../../../fable_modules/fable-library-js.4.20.0/List.js";
|
|
3
|
-
import { unwrap } from "../../../fable_modules/fable-library-js.4.20.0/Option.js";
|
|
4
|
-
import { Union } from "../../../fable_modules/fable-library-js.4.20.0/Types.js";
|
|
5
|
-
import { union_type, anonRecord_type, option_type, list_type, string_type } from "../../../fable_modules/fable-library-js.4.20.0/Reflection.js";
|
|
6
|
-
import { FSharpResult$2 } from "../../../fable_modules/fable-library-js.4.20.0/Result.js";
|
|
7
|
-
import { Validate_optionalEmail, Validate_relationship, Validate_dateOfBirthStrAgeNow, Validate_state, Validate_postcode, Validate_countryCode, Validate_city, Validate_optionalAddressLine, Validate_addressLine, Validate_mobilePhone, Validate_email, Validate_gender, Validate_title, Validate_optionalName, Validate_name } from "../Validation.jsx";
|
|
8
|
-
import { ResultCE_result, ResultCE_ResultBuilder__Zero } from "../../../fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultCE.fs.js";
|
|
9
|
-
|
|
10
|
-
export function Read_V2_FullProfileDtoModule_ofDomain(p) {
|
|
11
|
-
const Name = NameModule_ofDomain(p.Name);
|
|
12
|
-
const Title = Title_ofDomain(p.Title);
|
|
13
|
-
const Gender = Gender_ofDomain(p.Gender);
|
|
14
|
-
const Email = Email_ofDomain(p.Email);
|
|
15
|
-
const MobilePhone = MobilePhone_ofDomain(p.MobilePhone);
|
|
16
|
-
const DateOfBirth = DateOfBirth_ofDomain(p.DateOfBirth);
|
|
17
|
-
const Address = AddressModule_ofDomain(p.Address);
|
|
18
|
-
let ExternalId;
|
|
19
|
-
const input_1 = p.ExternalId;
|
|
20
|
-
ExternalId = ((input_1 == null) ? undefined : ExternalId_ofDomain(input_1));
|
|
21
|
-
return {
|
|
22
|
-
Address: Address,
|
|
23
|
-
DateOfBirth: DateOfBirth,
|
|
24
|
-
Email: Email,
|
|
25
|
-
EmergencyContacts: map(EmergencyContactDtoModule_ofDomain, p.EmergencyContacts),
|
|
26
|
-
ExternalId: unwrap(ExternalId),
|
|
27
|
-
Gender: Gender,
|
|
28
|
-
MobilePhone: MobilePhone,
|
|
29
|
-
Name: Name,
|
|
30
|
-
Title: Title,
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export function Read_V2_PurgedProfileDtoModule_ofDomain(p) {
|
|
35
|
-
const Title = Title_ofDomain(p.Title);
|
|
36
|
-
const Gender = Gender_ofDomain(p.Gender);
|
|
37
|
-
const DateOfBirth = DateOfBirth_ofDomain(p.DateOfBirth);
|
|
38
|
-
return {
|
|
39
|
-
Address: PurgedAddressModule_ofDomain(p.Address),
|
|
40
|
-
DateOfBirth: DateOfBirth,
|
|
41
|
-
Gender: Gender,
|
|
42
|
-
Title: Title,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export function Read_V2_PartialProfileDtoModule_ofDomain(p) {
|
|
47
|
-
let input_11;
|
|
48
|
-
const Name = NameModule_ofDomain(p.Name);
|
|
49
|
-
const Email = Email_ofDomain(p.Email);
|
|
50
|
-
let MobilePhone;
|
|
51
|
-
const input_1 = p.MobilePhone;
|
|
52
|
-
MobilePhone = ((input_1 == null) ? undefined : MobilePhone_ofDomain(input_1));
|
|
53
|
-
let ExternalId;
|
|
54
|
-
const input_3 = p.ExternalId;
|
|
55
|
-
ExternalId = ((input_3 == null) ? undefined : ExternalId_ofDomain(input_3));
|
|
56
|
-
let Title;
|
|
57
|
-
const input_5 = p.Title;
|
|
58
|
-
Title = ((input_5 == null) ? undefined : Title_ofDomain(input_5));
|
|
59
|
-
let Gender;
|
|
60
|
-
const input_7 = p.Gender;
|
|
61
|
-
Gender = ((input_7 == null) ? undefined : Gender_ofDomain(input_7));
|
|
62
|
-
let DateOfBirth;
|
|
63
|
-
const input_9 = p.DateOfBirth;
|
|
64
|
-
DateOfBirth = ((input_9 == null) ? undefined : DateOfBirth_ofDomain(input_9));
|
|
65
|
-
return {
|
|
66
|
-
Address: unwrap((input_11 = p.Address, (input_11 == null) ? undefined : AddressModule_ofDomain(input_11))),
|
|
67
|
-
DateOfBirth: unwrap(DateOfBirth),
|
|
68
|
-
Email: Email,
|
|
69
|
-
ExternalId: unwrap(ExternalId),
|
|
70
|
-
Gender: unwrap(Gender),
|
|
71
|
-
MobilePhone: unwrap(MobilePhone),
|
|
72
|
-
Name: Name,
|
|
73
|
-
Title: unwrap(Title),
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export class Read_V2_ProfileDto extends Union {
|
|
78
|
-
constructor(tag, fields) {
|
|
79
|
-
super();
|
|
80
|
-
this.tag = tag;
|
|
81
|
-
this.fields = fields;
|
|
82
|
-
}
|
|
83
|
-
cases() {
|
|
84
|
-
return ["Active", "Inactive", "Purged", "Partial", "InactivePartial", "Archived", "ArchivedPartial"];
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export function Read_V2_ProfileDto_$reflection() {
|
|
89
|
-
return union_type("Dto.Api.Common.Read.V2.ProfileDto", [], Read_V2_ProfileDto, () => [[["Item", anonRecord_type(["Address", Address_$reflection()], ["DateOfBirth", string_type], ["Email", string_type], ["EmergencyContacts", list_type(EmergencyContactDto_$reflection())], ["ExternalId", option_type(string_type)], ["Gender", string_type], ["MobilePhone", string_type], ["Name", Name_$reflection()], ["Title", string_type])]], [["Item", anonRecord_type(["Address", Address_$reflection()], ["DateOfBirth", string_type], ["Email", string_type], ["EmergencyContacts", list_type(EmergencyContactDto_$reflection())], ["ExternalId", option_type(string_type)], ["Gender", string_type], ["MobilePhone", string_type], ["Name", Name_$reflection()], ["Title", string_type])]], [["Item", anonRecord_type(["Address", PurgedAddress_$reflection()], ["DateOfBirth", string_type], ["Gender", string_type], ["Title", string_type])]], [["Item", anonRecord_type(["Address", option_type(Address_$reflection())], ["DateOfBirth", option_type(string_type)], ["Email", string_type], ["ExternalId", option_type(string_type)], ["Gender", option_type(string_type)], ["MobilePhone", option_type(string_type)], ["Name", Name_$reflection()], ["Title", option_type(string_type)])]], [["Item", anonRecord_type(["Address", option_type(Address_$reflection())], ["DateOfBirth", option_type(string_type)], ["Email", string_type], ["ExternalId", option_type(string_type)], ["Gender", option_type(string_type)], ["MobilePhone", option_type(string_type)], ["Name", Name_$reflection()], ["Title", option_type(string_type)])]], [["Item", anonRecord_type(["Address", Address_$reflection()], ["DateOfBirth", string_type], ["Email", string_type], ["EmergencyContacts", list_type(EmergencyContactDto_$reflection())], ["ExternalId", option_type(string_type)], ["Gender", string_type], ["MobilePhone", string_type], ["Name", Name_$reflection()], ["Title", string_type])]], [["Item", anonRecord_type(["Address", option_type(Address_$reflection())], ["DateOfBirth", option_type(string_type)], ["Email", string_type], ["ExternalId", option_type(string_type)], ["Gender", option_type(string_type)], ["MobilePhone", option_type(string_type)], ["Name", Name_$reflection()], ["Title", option_type(string_type)])]]]);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export function Read_V2_ProfileDtoModule_ofDomain(profile) {
|
|
93
|
-
switch (profile.tag) {
|
|
94
|
-
case 1:
|
|
95
|
-
return new Read_V2_ProfileDto(1, [Read_V2_FullProfileDtoModule_ofDomain(profile.fields[0])]);
|
|
96
|
-
case 2:
|
|
97
|
-
return new Read_V2_ProfileDto(3, [Read_V2_PartialProfileDtoModule_ofDomain(profile.fields[0])]);
|
|
98
|
-
case 3:
|
|
99
|
-
return new Read_V2_ProfileDto(4, [Read_V2_PartialProfileDtoModule_ofDomain(profile.fields[0])]);
|
|
100
|
-
case 4:
|
|
101
|
-
return new Read_V2_ProfileDto(5, [Read_V2_FullProfileDtoModule_ofDomain(profile.fields[0])]);
|
|
102
|
-
case 5:
|
|
103
|
-
return new Read_V2_ProfileDto(6, [Read_V2_PartialProfileDtoModule_ofDomain(profile.fields[0])]);
|
|
104
|
-
case 6:
|
|
105
|
-
return new Read_V2_ProfileDto(2, [Read_V2_PurgedProfileDtoModule_ofDomain(profile.fields[0])]);
|
|
106
|
-
default:
|
|
107
|
-
return new Read_V2_ProfileDto(0, [Read_V2_FullProfileDtoModule_ofDomain(profile.fields[0])]);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export function Read_V2_ProfileDtoModule_ofDomainOperational(profile) {
|
|
112
|
-
switch (profile.tag) {
|
|
113
|
-
case 1:
|
|
114
|
-
return new Read_V2_ProfileDto(1, [Read_V2_FullProfileDtoModule_ofDomain(profile.fields[0])]);
|
|
115
|
-
case 2:
|
|
116
|
-
return new Read_V2_ProfileDto(3, [Read_V2_PartialProfileDtoModule_ofDomain(profile.fields[0])]);
|
|
117
|
-
case 3:
|
|
118
|
-
return new Read_V2_ProfileDto(4, [Read_V2_PartialProfileDtoModule_ofDomain(profile.fields[0])]);
|
|
119
|
-
default:
|
|
120
|
-
return new Read_V2_ProfileDto(0, [Read_V2_FullProfileDtoModule_ofDomain(profile.fields[0])]);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export function Validation_toErrorMessage(propName, reason) {
|
|
125
|
-
let matchResult, max, min;
|
|
126
|
-
switch (reason.tag) {
|
|
127
|
-
case 1: {
|
|
128
|
-
matchResult = 1;
|
|
129
|
-
max = reason.fields[0];
|
|
130
|
-
break;
|
|
131
|
-
}
|
|
132
|
-
case 2: {
|
|
133
|
-
matchResult = 2;
|
|
134
|
-
min = reason.fields[0];
|
|
135
|
-
break;
|
|
136
|
-
}
|
|
137
|
-
case 4: {
|
|
138
|
-
matchResult = 3;
|
|
139
|
-
break;
|
|
140
|
-
}
|
|
141
|
-
case 5: {
|
|
142
|
-
matchResult = 4;
|
|
143
|
-
break;
|
|
144
|
-
}
|
|
145
|
-
case 3: {
|
|
146
|
-
matchResult = 5;
|
|
147
|
-
break;
|
|
148
|
-
}
|
|
149
|
-
case 6: {
|
|
150
|
-
matchResult = 6;
|
|
151
|
-
break;
|
|
152
|
-
}
|
|
153
|
-
case 9: {
|
|
154
|
-
matchResult = 7;
|
|
155
|
-
break;
|
|
156
|
-
}
|
|
157
|
-
case 7: {
|
|
158
|
-
matchResult = 8;
|
|
159
|
-
break;
|
|
160
|
-
}
|
|
161
|
-
case 8: {
|
|
162
|
-
if (reason.fields[0].tag === 0) {
|
|
163
|
-
matchResult = 9;
|
|
164
|
-
}
|
|
165
|
-
else {
|
|
166
|
-
matchResult = 9;
|
|
167
|
-
}
|
|
168
|
-
break;
|
|
169
|
-
}
|
|
170
|
-
case 10: {
|
|
171
|
-
matchResult = 10;
|
|
172
|
-
break;
|
|
173
|
-
}
|
|
174
|
-
default:
|
|
175
|
-
matchResult = 0;
|
|
176
|
-
}
|
|
177
|
-
switch (matchResult) {
|
|
178
|
-
case 0:
|
|
179
|
-
return `${propName} is required`;
|
|
180
|
-
case 1:
|
|
181
|
-
return `${propName} exceeds the character limit of ${max}`;
|
|
182
|
-
case 2:
|
|
183
|
-
return `${propName} must be at least ${min} characters`;
|
|
184
|
-
case 3:
|
|
185
|
-
return `${propName} must only have digits`;
|
|
186
|
-
case 4:
|
|
187
|
-
return `${propName} is not valid`;
|
|
188
|
-
case 5:
|
|
189
|
-
return `${propName} has invalid characters`;
|
|
190
|
-
case 6:
|
|
191
|
-
return `${propName} is not valid`;
|
|
192
|
-
case 7:
|
|
193
|
-
return `${propName} is not a valid Australian mobile number. Must include international dial code (+61401234567)`;
|
|
194
|
-
case 8:
|
|
195
|
-
return `${propName} is not valid`;
|
|
196
|
-
case 9:
|
|
197
|
-
return `${propName}: all profile users must be at least 13 and under 100 years of age. Please check the date of birth is correct.`;
|
|
198
|
-
default:
|
|
199
|
-
return `${propName} must start with a letter`;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
function mapError(propName) {
|
|
204
|
-
return (input) => {
|
|
205
|
-
const input_1 = input;
|
|
206
|
-
return (input_1.tag === 1) ? (new FSharpResult$2(1, [[propName, input_1.fields[0]]])) : (new FSharpResult$2(0, [input_1.fields[0]]));
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
export function Name_toDomain(n) {
|
|
211
|
-
let e_3;
|
|
212
|
-
let input_8;
|
|
213
|
-
let input_6;
|
|
214
|
-
const input_4 = mapError("FirstName")(Validate_name(n.FirstName));
|
|
215
|
-
if (input_4.tag === 1) {
|
|
216
|
-
input_6 = (new FSharpResult$2(1, [input_4.fields[0]]));
|
|
217
|
-
}
|
|
218
|
-
else {
|
|
219
|
-
const input_2 = mapError("MiddleName")(Validate_optionalName(n.MiddleName));
|
|
220
|
-
if (input_2.tag === 1) {
|
|
221
|
-
input_6 = (new FSharpResult$2(1, [input_2.fields[0]]));
|
|
222
|
-
}
|
|
223
|
-
else {
|
|
224
|
-
const input = mapError("LastName")(Validate_name(n.LastName));
|
|
225
|
-
input_6 = ((input.tag === 1) ? (new FSharpResult$2(1, [input.fields[0]])) : (new FSharpResult$2(0, [n])));
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
input_8 = ((input_6.tag === 1) ? (new FSharpResult$2(1, [(e_3 = input_6.fields[0], Validation_toErrorMessage(e_3[0], e_3[1]))])) : (new FSharpResult$2(0, [input_6.fields[0]])));
|
|
229
|
-
if (input_8.tag === 1) {
|
|
230
|
-
return new FSharpResult$2(1, [input_8.fields[0]]);
|
|
231
|
-
}
|
|
232
|
-
else {
|
|
233
|
-
return NameModule_toDomain(input_8.fields[0]);
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
export function Title_toDomain(t) {
|
|
238
|
-
let e_1;
|
|
239
|
-
let input_4;
|
|
240
|
-
let input_2;
|
|
241
|
-
const input = mapError("Title")(Validate_title(t));
|
|
242
|
-
input_2 = ((input.tag === 1) ? (new FSharpResult$2(1, [input.fields[0]])) : (new FSharpResult$2(0, [t])));
|
|
243
|
-
input_4 = ((input_2.tag === 1) ? (new FSharpResult$2(1, [(e_1 = input_2.fields[0], Validation_toErrorMessage(e_1[0], e_1[1]))])) : (new FSharpResult$2(0, [input_2.fields[0]])));
|
|
244
|
-
if (input_4.tag === 1) {
|
|
245
|
-
return new FSharpResult$2(1, [input_4.fields[0]]);
|
|
246
|
-
}
|
|
247
|
-
else {
|
|
248
|
-
return Title_toDomain_1(input_4.fields[0]);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
export function Gender_toDomain(g) {
|
|
253
|
-
let e_1;
|
|
254
|
-
let input_4;
|
|
255
|
-
let input_2;
|
|
256
|
-
const input = mapError("Gender")(Validate_gender(g));
|
|
257
|
-
input_2 = ((input.tag === 1) ? (new FSharpResult$2(1, [input.fields[0]])) : (new FSharpResult$2(0, [g])));
|
|
258
|
-
input_4 = ((input_2.tag === 1) ? (new FSharpResult$2(1, [(e_1 = input_2.fields[0], Validation_toErrorMessage(e_1[0], e_1[1]))])) : (new FSharpResult$2(0, [input_2.fields[0]])));
|
|
259
|
-
if (input_4.tag === 1) {
|
|
260
|
-
return new FSharpResult$2(1, [input_4.fields[0]]);
|
|
261
|
-
}
|
|
262
|
-
else {
|
|
263
|
-
return Gender_toDomain_1(input_4.fields[0]);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
export function Email_toDomain(email) {
|
|
268
|
-
let e_1;
|
|
269
|
-
let input_4;
|
|
270
|
-
let input_2;
|
|
271
|
-
const input = mapError("Email")(Validate_email(email));
|
|
272
|
-
input_2 = ((input.tag === 1) ? (new FSharpResult$2(1, [input.fields[0]])) : (new FSharpResult$2(0, [email])));
|
|
273
|
-
input_4 = ((input_2.tag === 1) ? (new FSharpResult$2(1, [(e_1 = input_2.fields[0], Validation_toErrorMessage(e_1[0], e_1[1]))])) : (new FSharpResult$2(0, [input_2.fields[0]])));
|
|
274
|
-
if (input_4.tag === 1) {
|
|
275
|
-
return new FSharpResult$2(1, [input_4.fields[0]]);
|
|
276
|
-
}
|
|
277
|
-
else {
|
|
278
|
-
return Email_toDomain_1(input_4.fields[0]);
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
export function MobilePhone_toDomain(m) {
|
|
283
|
-
let e_1;
|
|
284
|
-
let input_4;
|
|
285
|
-
let input_2;
|
|
286
|
-
const input = mapError("MobilePhone")(Validate_mobilePhone(m));
|
|
287
|
-
input_2 = ((input.tag === 1) ? (new FSharpResult$2(1, [input.fields[0]])) : (new FSharpResult$2(0, [m])));
|
|
288
|
-
input_4 = ((input_2.tag === 1) ? (new FSharpResult$2(1, [(e_1 = input_2.fields[0], Validation_toErrorMessage(e_1[0], e_1[1]))])) : (new FSharpResult$2(0, [input_2.fields[0]])));
|
|
289
|
-
if (input_4.tag === 1) {
|
|
290
|
-
return new FSharpResult$2(1, [input_4.fields[0]]);
|
|
291
|
-
}
|
|
292
|
-
else {
|
|
293
|
-
return MobilePhone_toDomain_1(input_4.fields[0]);
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
export function Address_validate(a) {
|
|
298
|
-
const input_10 = mapError("AddressLine1")(Validate_addressLine(a.AddressLine1));
|
|
299
|
-
if (input_10.tag === 1) {
|
|
300
|
-
return new FSharpResult$2(1, [input_10.fields[0]]);
|
|
301
|
-
}
|
|
302
|
-
else {
|
|
303
|
-
const input_8 = mapError("AddressLine2")(Validate_optionalAddressLine(a.AddressLine2));
|
|
304
|
-
if (input_8.tag === 1) {
|
|
305
|
-
return new FSharpResult$2(1, [input_8.fields[0]]);
|
|
306
|
-
}
|
|
307
|
-
else {
|
|
308
|
-
const input_6 = mapError("City")(Validate_city(a.City));
|
|
309
|
-
if (input_6.tag === 1) {
|
|
310
|
-
return new FSharpResult$2(1, [input_6.fields[0]]);
|
|
311
|
-
}
|
|
312
|
-
else {
|
|
313
|
-
const input_4 = mapError("CountryCode")(Validate_countryCode(a.CountryCode));
|
|
314
|
-
if (input_4.tag === 1) {
|
|
315
|
-
return new FSharpResult$2(1, [input_4.fields[0]]);
|
|
316
|
-
}
|
|
317
|
-
else {
|
|
318
|
-
const input_2 = mapError("Postcode")(Validate_postcode(a.Postcode));
|
|
319
|
-
if (input_2.tag === 1) {
|
|
320
|
-
return new FSharpResult$2(1, [input_2.fields[0]]);
|
|
321
|
-
}
|
|
322
|
-
else {
|
|
323
|
-
const s = a.State.toUpperCase().trim();
|
|
324
|
-
const input = mapError("State")(Validate_state(s));
|
|
325
|
-
if (input.tag === 1) {
|
|
326
|
-
return new FSharpResult$2(1, [input.fields[0]]);
|
|
327
|
-
}
|
|
328
|
-
else {
|
|
329
|
-
return new FSharpResult$2(0, [new Address_1(a.AddressLine1, a.AddressLine2, a.City, s, a.Postcode, a.CountryCode)]);
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
export function Address_toDomain(a) {
|
|
339
|
-
let e;
|
|
340
|
-
let input_3;
|
|
341
|
-
const input_1 = Address_validate(a);
|
|
342
|
-
input_3 = ((input_1.tag === 1) ? (new FSharpResult$2(1, [(e = input_1.fields[0], Validation_toErrorMessage(e[0], e[1]))])) : (new FSharpResult$2(0, [input_1.fields[0]])));
|
|
343
|
-
if (input_3.tag === 1) {
|
|
344
|
-
return new FSharpResult$2(1, [input_3.fields[0]]);
|
|
345
|
-
}
|
|
346
|
-
else {
|
|
347
|
-
return AddressModule_toDomain(input_3.fields[0]);
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
export function Address_toDomainV1(a) {
|
|
352
|
-
let e_1;
|
|
353
|
-
let input_4;
|
|
354
|
-
let input_2;
|
|
355
|
-
const s = a.State.toUpperCase().trim();
|
|
356
|
-
const input = mapError("State")(Validate_state(s));
|
|
357
|
-
input_2 = ((input.tag === 1) ? (new FSharpResult$2(1, [input.fields[0]])) : (new FSharpResult$2(0, [new Address_1(a.AddressLine1, a.AddressLine2, a.City, s, a.Postcode, a.CountryCode)])));
|
|
358
|
-
input_4 = ((input_2.tag === 1) ? (new FSharpResult$2(1, [(e_1 = input_2.fields[0], Validation_toErrorMessage(e_1[0], e_1[1]))])) : (new FSharpResult$2(0, [input_2.fields[0]])));
|
|
359
|
-
if (input_4.tag === 1) {
|
|
360
|
-
return new FSharpResult$2(1, [input_4.fields[0]]);
|
|
361
|
-
}
|
|
362
|
-
else {
|
|
363
|
-
return AddressModule_toDomain(input_4.fields[0]);
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
export function DateOfBirth_toDomain(dob) {
|
|
368
|
-
let input_3;
|
|
369
|
-
const input_1 = Validate_dateOfBirthStrAgeNow(dob);
|
|
370
|
-
input_3 = ((input_1.tag === 1) ? (new FSharpResult$2(1, [Validation_toErrorMessage("DateOfBirth", input_1.fields[0])])) : (new FSharpResult$2(0, [input_1.fields[0]])));
|
|
371
|
-
if (input_3.tag === 1) {
|
|
372
|
-
return new FSharpResult$2(1, [input_3.fields[0]]);
|
|
373
|
-
}
|
|
374
|
-
else {
|
|
375
|
-
return DateOfBirth_toDomain_1(dob);
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
export function EmergencyContact_toDomain(ec) {
|
|
380
|
-
let e_7;
|
|
381
|
-
let input_14;
|
|
382
|
-
let input_12;
|
|
383
|
-
const input_10 = mapError("FullName")(Validate_name(ec.FullName));
|
|
384
|
-
if (input_10.tag === 1) {
|
|
385
|
-
input_12 = (new FSharpResult$2(1, [input_10.fields[0]]));
|
|
386
|
-
}
|
|
387
|
-
else {
|
|
388
|
-
const input_8 = mapError("Relationship")(Validate_relationship(ec.Relationship));
|
|
389
|
-
if (input_8.tag === 1) {
|
|
390
|
-
input_12 = (new FSharpResult$2(1, [input_8.fields[0]]));
|
|
391
|
-
}
|
|
392
|
-
else {
|
|
393
|
-
const input_6 = mapError("MobilePhone")(Validate_mobilePhone(ec.MobilePhone));
|
|
394
|
-
if (input_6.tag === 1) {
|
|
395
|
-
input_12 = (new FSharpResult$2(1, [input_6.fields[0]]));
|
|
396
|
-
}
|
|
397
|
-
else {
|
|
398
|
-
const input_4 = mapError("Email")(Validate_optionalEmail(ec.Email));
|
|
399
|
-
if (input_4.tag === 1) {
|
|
400
|
-
input_12 = (new FSharpResult$2(1, [input_4.fields[0]]));
|
|
401
|
-
}
|
|
402
|
-
else {
|
|
403
|
-
let input_2;
|
|
404
|
-
const matchValue = ec.Address;
|
|
405
|
-
if (matchValue != null) {
|
|
406
|
-
let input;
|
|
407
|
-
const result_5 = Address_validate(matchValue);
|
|
408
|
-
input = ((result_5.tag === 1) ? (new FSharpResult$2(1, [result_5.fields[0]])) : (new FSharpResult$2(0, [undefined])));
|
|
409
|
-
input_2 = ((input.tag === 1) ? (new FSharpResult$2(1, [input.fields[0]])) : (new FSharpResult$2(0, [undefined])));
|
|
410
|
-
}
|
|
411
|
-
else {
|
|
412
|
-
input_2 = ResultCE_ResultBuilder__Zero(ResultCE_result);
|
|
413
|
-
}
|
|
414
|
-
input_12 = ((input_2.tag === 1) ? (new FSharpResult$2(1, [input_2.fields[0]])) : (new FSharpResult$2(0, [ec])));
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
input_14 = ((input_12.tag === 1) ? (new FSharpResult$2(1, [(e_7 = input_12.fields[0], Validation_toErrorMessage(e_7[0], e_7[1]))])) : (new FSharpResult$2(0, [input_12.fields[0]])));
|
|
420
|
-
if (input_14.tag === 1) {
|
|
421
|
-
return new FSharpResult$2(1, [input_14.fields[0]]);
|
|
422
|
-
}
|
|
423
|
-
else {
|
|
424
|
-
return EmergencyContactDtoModule_toDomain(input_14.fields[0]);
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { Record } from "../../../../fable_modules/fable-library-js.4.20.0/Types.js";
|
|
2
|
-
import { record_type, string_type, option_type } from "../../../../fable_modules/fable-library-js.4.20.0/Reflection.js";
|
|
3
|
-
import { DateOfBirth_ofDomain, MobilePhone_ofDomain, Email_ofDomain, Gender_ofDomain, Title_ofDomain, NameModule_ofDomain, ExternalId_ofDomain, Name_$reflection } from "../../Primitives.jsx";
|
|
4
|
-
import { StreamIdModule_value } from "../../../Metadata.jsx";
|
|
5
|
-
import { map } from "../../../../fable_modules/fable-library-js.4.20.0/Option.js";
|
|
6
|
-
|
|
7
|
-
export class ProfileDto extends Record {
|
|
8
|
-
constructor(Address, DateOfBirth, Email, ExternalId, Gender, Id, MobilePhone, Name, Title) {
|
|
9
|
-
super();
|
|
10
|
-
this.Address = Address;
|
|
11
|
-
this.DateOfBirth = DateOfBirth;
|
|
12
|
-
this.Email = Email;
|
|
13
|
-
this.ExternalId = ExternalId;
|
|
14
|
-
this.Gender = Gender;
|
|
15
|
-
this.Id = Id;
|
|
16
|
-
this.MobilePhone = MobilePhone;
|
|
17
|
-
this.Name = Name;
|
|
18
|
-
this.Title = Title;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function ProfileDto_$reflection() {
|
|
23
|
-
return record_type("Dto.Api.External.Read.ProfileDto", [], ProfileDto, () => [["Address", option_type(Address_$reflection())], ["DateOfBirth", option_type(string_type)], ["Email", option_type(string_type)], ["ExternalId", option_type(string_type)], ["Gender", option_type(string_type)], ["Id", string_type], ["MobilePhone", option_type(string_type)], ["Name", option_type(Name_$reflection())], ["Title", option_type(string_type)]]);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export class Address extends Record {
|
|
27
|
-
constructor(AddressLine1, AddressLine2, City, State, Postcode, CountryCode) {
|
|
28
|
-
super();
|
|
29
|
-
this.AddressLine1 = AddressLine1;
|
|
30
|
-
this.AddressLine2 = AddressLine2;
|
|
31
|
-
this.City = City;
|
|
32
|
-
this.State = State;
|
|
33
|
-
this.Postcode = Postcode;
|
|
34
|
-
this.CountryCode = CountryCode;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export function Address_$reflection() {
|
|
39
|
-
return record_type("Dto.Api.External.Read.Address", [], Address, () => [["AddressLine1", option_type(string_type)], ["AddressLine2", option_type(string_type)], ["City", string_type], ["State", string_type], ["Postcode", string_type], ["CountryCode", string_type]]);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export function ProfileDtoModule_ofFull(p) {
|
|
43
|
-
const Id = StreamIdModule_value(p.Metadata.StreamId);
|
|
44
|
-
const ExternalId = map(ExternalId_ofDomain, p.ExternalId);
|
|
45
|
-
const Name = NameModule_ofDomain(p.Name);
|
|
46
|
-
const Title = Title_ofDomain(p.Title);
|
|
47
|
-
const Gender = Gender_ofDomain(p.Gender);
|
|
48
|
-
const Email = Email_ofDomain(p.Email);
|
|
49
|
-
const MobilePhone = MobilePhone_ofDomain(p.MobilePhone);
|
|
50
|
-
return new ProfileDto(new Address(p.Address.AddressLine1, p.Address.AddressLine2, p.Address.City, p.Address.State, p.Address.Postcode, p.Address.CountryCode), DateOfBirth_ofDomain(p.DateOfBirth), Email, ExternalId, Gender, Id, MobilePhone, Name, Title);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export function ProfileDtoModule_ofPurged(p) {
|
|
54
|
-
const Id = StreamIdModule_value(p.Metadata.StreamId);
|
|
55
|
-
const Title = Title_ofDomain(p.Title);
|
|
56
|
-
const Gender = Gender_ofDomain(p.Gender);
|
|
57
|
-
return new ProfileDto(new Address(undefined, undefined, p.Address.City, p.Address.State, p.Address.Postcode, p.Address.CountryCode), DateOfBirth_ofDomain(p.DateOfBirth), undefined, undefined, Gender, Id, undefined, undefined, Title);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export function ProfileDtoModule_ofPartial(p) {
|
|
61
|
-
const Id = StreamIdModule_value(p.Metadata.StreamId);
|
|
62
|
-
const ExternalId = map(ExternalId_ofDomain, p.ExternalId);
|
|
63
|
-
const Name = NameModule_ofDomain(p.Name);
|
|
64
|
-
const Title = map(Title_ofDomain, p.Title);
|
|
65
|
-
const Gender = map(Gender_ofDomain, p.Gender);
|
|
66
|
-
const Email = Email_ofDomain(p.Email);
|
|
67
|
-
const MobilePhone = map(MobilePhone_ofDomain, p.MobilePhone);
|
|
68
|
-
const DateOfBirth = map(DateOfBirth_ofDomain, p.DateOfBirth);
|
|
69
|
-
return new ProfileDto(map((a) => (new Address(a.AddressLine1, a.AddressLine2, a.City, a.State, a.Postcode, a.CountryCode)), p.Address), DateOfBirth, Email, ExternalId, Gender, Id, MobilePhone, Name, Title);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export function ProfileDtoModule_ofDomain(profile) {
|
|
73
|
-
let matchResult, p, p_1;
|
|
74
|
-
switch (profile.tag) {
|
|
75
|
-
case 1: {
|
|
76
|
-
matchResult = 0;
|
|
77
|
-
p = profile.fields[0];
|
|
78
|
-
break;
|
|
79
|
-
}
|
|
80
|
-
case 4: {
|
|
81
|
-
matchResult = 0;
|
|
82
|
-
p = profile.fields[0];
|
|
83
|
-
break;
|
|
84
|
-
}
|
|
85
|
-
case 2: {
|
|
86
|
-
matchResult = 1;
|
|
87
|
-
p_1 = profile.fields[0];
|
|
88
|
-
break;
|
|
89
|
-
}
|
|
90
|
-
case 3: {
|
|
91
|
-
matchResult = 1;
|
|
92
|
-
p_1 = profile.fields[0];
|
|
93
|
-
break;
|
|
94
|
-
}
|
|
95
|
-
case 5: {
|
|
96
|
-
matchResult = 1;
|
|
97
|
-
p_1 = profile.fields[0];
|
|
98
|
-
break;
|
|
99
|
-
}
|
|
100
|
-
case 6: {
|
|
101
|
-
matchResult = 2;
|
|
102
|
-
break;
|
|
103
|
-
}
|
|
104
|
-
default: {
|
|
105
|
-
matchResult = 0;
|
|
106
|
-
p = profile.fields[0];
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
switch (matchResult) {
|
|
110
|
-
case 0:
|
|
111
|
-
return ProfileDtoModule_ofFull(p);
|
|
112
|
-
case 1:
|
|
113
|
-
return ProfileDtoModule_ofPartial(p_1);
|
|
114
|
-
default:
|
|
115
|
-
return ProfileDtoModule_ofPurged(profile.fields[0]);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|