@flarehr/superhero-basic-profile 0.1.2217 → 0.1.2223
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,801 +0,0 @@
|
|
|
1
|
-
import { Record, Union } from "../fable_modules/fable-library-js.4.20.0/Types.js";
|
|
2
|
-
import { lambda_type, record_type, list_type, option_type, union_type } from "../fable_modules/fable-library-js.4.20.0/Reflection.js";
|
|
3
|
-
import { MetadataModule_incrementVersion, MetadataModule_withTimestamp, Metadata_$reflection } from "./Metadata.jsx";
|
|
4
|
-
import { PurgedAddress, PurgedAddress_$reflection, EmergencyContact_$reflection, ExternalId_$reflection, Address_$reflection, DateOfBirth_$reflection, MobilePhone_$reflection, Email_$reflection, Gender_$reflection, Title_$reflection, Name_$reflection, AccountId_$reflection } from "./DomainPrimitives.jsx";
|
|
5
|
-
import { empty } from "../fable_modules/fable-library-js.4.20.0/List.js";
|
|
6
|
-
import { FSharpResult$2 } from "../fable_modules/fable-library-js.4.20.0/Result.js";
|
|
7
|
-
import { FSharpChoice$2, FSharpChoice$3 } from "../fable_modules/fable-library-js.4.20.0/Choice.js";
|
|
8
|
-
|
|
9
|
-
export class Profile extends Union {
|
|
10
|
-
constructor(tag, fields) {
|
|
11
|
-
super();
|
|
12
|
-
this.tag = tag;
|
|
13
|
-
this.fields = fields;
|
|
14
|
-
}
|
|
15
|
-
cases() {
|
|
16
|
-
return ["Active", "Inactive", "Partial", "InactivePartial", "Archived", "ArchivedPartial", "Purged"];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export function Profile_$reflection() {
|
|
21
|
-
return union_type("DomainAggregates.Profile", [], Profile, () => [[["Item", ProfileDetail_$reflection()]], [["Item", ProfileDetail_$reflection()]], [["Item", PartialProfileDetail_$reflection()]], [["Item", PartialProfileDetail_$reflection()]], [["Item", ProfileDetail_$reflection()]], [["Item", PartialProfileDetail_$reflection()]], [["Item", PurgedProfileDetail_$reflection()]]]);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export class ProfileDetail extends Record {
|
|
25
|
-
constructor(Metadata, AccountId, Name, Title, Gender, Email, MobilePhone, DateOfBirth, Address, ExternalId, EmergencyContacts) {
|
|
26
|
-
super();
|
|
27
|
-
this.Metadata = Metadata;
|
|
28
|
-
this.AccountId = AccountId;
|
|
29
|
-
this.Name = Name;
|
|
30
|
-
this.Title = Title;
|
|
31
|
-
this.Gender = Gender;
|
|
32
|
-
this.Email = Email;
|
|
33
|
-
this.MobilePhone = MobilePhone;
|
|
34
|
-
this.DateOfBirth = DateOfBirth;
|
|
35
|
-
this.Address = Address;
|
|
36
|
-
this.ExternalId = ExternalId;
|
|
37
|
-
this.EmergencyContacts = EmergencyContacts;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export function ProfileDetail_$reflection() {
|
|
42
|
-
return record_type("DomainAggregates.ProfileDetail", [], ProfileDetail, () => [["Metadata", Metadata_$reflection()], ["AccountId", AccountId_$reflection()], ["Name", Name_$reflection()], ["Title", Title_$reflection()], ["Gender", Gender_$reflection()], ["Email", Email_$reflection()], ["MobilePhone", MobilePhone_$reflection()], ["DateOfBirth", DateOfBirth_$reflection()], ["Address", Address_$reflection()], ["ExternalId", option_type(ExternalId_$reflection())], ["EmergencyContacts", list_type(EmergencyContact_$reflection())]]);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export class PartialProfileDetail extends Record {
|
|
46
|
-
constructor(Metadata, AccountId, Name, Email, MobilePhone, ExternalId, Title, Gender, DateOfBirth, Address) {
|
|
47
|
-
super();
|
|
48
|
-
this.Metadata = Metadata;
|
|
49
|
-
this.AccountId = AccountId;
|
|
50
|
-
this.Name = Name;
|
|
51
|
-
this.Email = Email;
|
|
52
|
-
this.MobilePhone = MobilePhone;
|
|
53
|
-
this.ExternalId = ExternalId;
|
|
54
|
-
this.Title = Title;
|
|
55
|
-
this.Gender = Gender;
|
|
56
|
-
this.DateOfBirth = DateOfBirth;
|
|
57
|
-
this.Address = Address;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export function PartialProfileDetail_$reflection() {
|
|
62
|
-
return record_type("DomainAggregates.PartialProfileDetail", [], PartialProfileDetail, () => [["Metadata", Metadata_$reflection()], ["AccountId", AccountId_$reflection()], ["Name", Name_$reflection()], ["Email", Email_$reflection()], ["MobilePhone", option_type(MobilePhone_$reflection())], ["ExternalId", option_type(ExternalId_$reflection())], ["Title", option_type(Title_$reflection())], ["Gender", option_type(Gender_$reflection())], ["DateOfBirth", option_type(DateOfBirth_$reflection())], ["Address", option_type(Address_$reflection())]]);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export class PurgedProfileDetail extends Record {
|
|
66
|
-
constructor(Metadata, AccountId, Title, Gender, DateOfBirth, Address) {
|
|
67
|
-
super();
|
|
68
|
-
this.Metadata = Metadata;
|
|
69
|
-
this.AccountId = AccountId;
|
|
70
|
-
this.Title = Title;
|
|
71
|
-
this.Gender = Gender;
|
|
72
|
-
this.DateOfBirth = DateOfBirth;
|
|
73
|
-
this.Address = Address;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export function PurgedProfileDetail_$reflection() {
|
|
78
|
-
return record_type("DomainAggregates.PurgedProfileDetail", [], PurgedProfileDetail, () => [["Metadata", Metadata_$reflection()], ["AccountId", AccountId_$reflection()], ["Title", Title_$reflection()], ["Gender", Gender_$reflection()], ["DateOfBirth", DateOfBirth_$reflection()], ["Address", PurgedAddress_$reflection()]]);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export function PartialProfileDetailModule_update(updated, current) {
|
|
82
|
-
return new PartialProfileDetail(current.Metadata, current.AccountId, updated.Name, updated.Email, updated.MobilePhone, current.ExternalId, updated.Title, updated.Gender, updated.DateOfBirth, updated.Address);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export class ProfileModule_Updater extends Union {
|
|
86
|
-
constructor(tag, fields) {
|
|
87
|
-
super();
|
|
88
|
-
this.tag = tag;
|
|
89
|
-
this.fields = fields;
|
|
90
|
-
}
|
|
91
|
-
cases() {
|
|
92
|
-
return ["FullUpdate", "PartialUpdate"];
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export function ProfileModule_Updater_$reflection() {
|
|
97
|
-
return union_type("DomainAggregates.ProfileModule.Updater", [], ProfileModule_Updater, () => [[["Item", lambda_type(ProfileDetail_$reflection(), ProfileDetail_$reflection())]], [["Item", lambda_type(PartialProfileDetail_$reflection(), PartialProfileDetail_$reflection())]]]);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
function ProfileModule_ofFullProfileCreationDetails(metadata, p) {
|
|
101
|
-
return new ProfileDetail(metadata, p.AccountId, p.Name, p.Title, p.Gender, p.Email, p.MobilePhone, p.DateOfBirth, p.Address, p.ExternalId, empty());
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function ProfileModule_ofPartialCreationDetails(metadata, p) {
|
|
105
|
-
return new PartialProfileDetail(metadata, p.AccountId, p.Name, p.Email, p.MobilePhone, p.ExternalId, p.Title, p.Gender, p.DateOfBirth, p.Address);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export function ProfileModule_create(metadata, profile) {
|
|
109
|
-
return new Profile(0, [ProfileModule_ofFullProfileCreationDetails(metadata, profile)]);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export function ProfileModule_createPartial(metadata, p) {
|
|
113
|
-
return new Profile(2, [ProfileModule_ofPartialCreationDetails(metadata, p)]);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export function ProfileModule_tryPromotePartial(fullProfileDetail, profile) {
|
|
117
|
-
switch (profile.tag) {
|
|
118
|
-
case 3:
|
|
119
|
-
return new FSharpResult$2(0, [new Profile(1, [ProfileModule_ofFullProfileCreationDetails(profile.fields[0].Metadata, fullProfileDetail)])]);
|
|
120
|
-
case 4:
|
|
121
|
-
case 5:
|
|
122
|
-
return new FSharpResult$2(1, ["Cannot promote an Archived profile"]);
|
|
123
|
-
case 0:
|
|
124
|
-
case 1:
|
|
125
|
-
case 6:
|
|
126
|
-
return new FSharpResult$2(1, ["Cannot promote a non Partial profile"]);
|
|
127
|
-
default:
|
|
128
|
-
return new FSharpResult$2(0, [new Profile(0, [ProfileModule_ofFullProfileCreationDetails(profile.fields[0].Metadata, fullProfileDetail)])]);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export function ProfileModule_tryUpdate(updater, profile) {
|
|
133
|
-
let matchResult, detail, update, detail_1, update_1, detail_2, update_2, detail_3, update_3;
|
|
134
|
-
switch (profile.tag) {
|
|
135
|
-
case 0: {
|
|
136
|
-
if (updater.tag === 0) {
|
|
137
|
-
matchResult = 0;
|
|
138
|
-
detail = profile.fields[0];
|
|
139
|
-
update = updater.fields[0];
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
matchResult = 5;
|
|
143
|
-
}
|
|
144
|
-
break;
|
|
145
|
-
}
|
|
146
|
-
case 1: {
|
|
147
|
-
if (updater.tag === 0) {
|
|
148
|
-
matchResult = 1;
|
|
149
|
-
detail_1 = profile.fields[0];
|
|
150
|
-
update_1 = updater.fields[0];
|
|
151
|
-
}
|
|
152
|
-
else {
|
|
153
|
-
matchResult = 5;
|
|
154
|
-
}
|
|
155
|
-
break;
|
|
156
|
-
}
|
|
157
|
-
case 2: {
|
|
158
|
-
if (updater.tag === 1) {
|
|
159
|
-
matchResult = 2;
|
|
160
|
-
detail_2 = profile.fields[0];
|
|
161
|
-
update_2 = updater.fields[0];
|
|
162
|
-
}
|
|
163
|
-
else {
|
|
164
|
-
matchResult = 5;
|
|
165
|
-
}
|
|
166
|
-
break;
|
|
167
|
-
}
|
|
168
|
-
case 3: {
|
|
169
|
-
if (updater.tag === 1) {
|
|
170
|
-
matchResult = 3;
|
|
171
|
-
detail_3 = profile.fields[0];
|
|
172
|
-
update_3 = updater.fields[0];
|
|
173
|
-
}
|
|
174
|
-
else {
|
|
175
|
-
matchResult = 5;
|
|
176
|
-
}
|
|
177
|
-
break;
|
|
178
|
-
}
|
|
179
|
-
case 6: {
|
|
180
|
-
matchResult = 4;
|
|
181
|
-
break;
|
|
182
|
-
}
|
|
183
|
-
default:
|
|
184
|
-
matchResult = 5;
|
|
185
|
-
}
|
|
186
|
-
switch (matchResult) {
|
|
187
|
-
case 0:
|
|
188
|
-
return new FSharpResult$2(0, [new Profile(0, [update(detail)])]);
|
|
189
|
-
case 1:
|
|
190
|
-
return new FSharpResult$2(0, [new Profile(1, [update_1(detail_1)])]);
|
|
191
|
-
case 2:
|
|
192
|
-
return new FSharpResult$2(0, [new Profile(2, [update_2(detail_2)])]);
|
|
193
|
-
case 3:
|
|
194
|
-
return new FSharpResult$2(0, [new Profile(3, [update_3(detail_3)])]);
|
|
195
|
-
case 4:
|
|
196
|
-
return new FSharpResult$2(1, ["Cannot update a Purged profile"]);
|
|
197
|
-
default:
|
|
198
|
-
return new FSharpResult$2(1, ["Cannot update profile"]);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
export function ProfileModule_getAccountId(_arg) {
|
|
203
|
-
let matchResult, p, p_1;
|
|
204
|
-
switch (_arg.tag) {
|
|
205
|
-
case 1: {
|
|
206
|
-
matchResult = 0;
|
|
207
|
-
p = _arg.fields[0];
|
|
208
|
-
break;
|
|
209
|
-
}
|
|
210
|
-
case 4: {
|
|
211
|
-
matchResult = 0;
|
|
212
|
-
p = _arg.fields[0];
|
|
213
|
-
break;
|
|
214
|
-
}
|
|
215
|
-
case 2: {
|
|
216
|
-
matchResult = 1;
|
|
217
|
-
p_1 = _arg.fields[0];
|
|
218
|
-
break;
|
|
219
|
-
}
|
|
220
|
-
case 3: {
|
|
221
|
-
matchResult = 1;
|
|
222
|
-
p_1 = _arg.fields[0];
|
|
223
|
-
break;
|
|
224
|
-
}
|
|
225
|
-
case 5: {
|
|
226
|
-
matchResult = 1;
|
|
227
|
-
p_1 = _arg.fields[0];
|
|
228
|
-
break;
|
|
229
|
-
}
|
|
230
|
-
case 6: {
|
|
231
|
-
matchResult = 2;
|
|
232
|
-
break;
|
|
233
|
-
}
|
|
234
|
-
default: {
|
|
235
|
-
matchResult = 0;
|
|
236
|
-
p = _arg.fields[0];
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
switch (matchResult) {
|
|
240
|
-
case 0:
|
|
241
|
-
return p.AccountId;
|
|
242
|
-
case 1:
|
|
243
|
-
return p_1.AccountId;
|
|
244
|
-
default:
|
|
245
|
-
return _arg.fields[0].AccountId;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
export function ProfileModule_getMetadata(_arg) {
|
|
250
|
-
let matchResult, p, p_1;
|
|
251
|
-
switch (_arg.tag) {
|
|
252
|
-
case 1: {
|
|
253
|
-
matchResult = 0;
|
|
254
|
-
p = _arg.fields[0];
|
|
255
|
-
break;
|
|
256
|
-
}
|
|
257
|
-
case 4: {
|
|
258
|
-
matchResult = 0;
|
|
259
|
-
p = _arg.fields[0];
|
|
260
|
-
break;
|
|
261
|
-
}
|
|
262
|
-
case 2: {
|
|
263
|
-
matchResult = 1;
|
|
264
|
-
p_1 = _arg.fields[0];
|
|
265
|
-
break;
|
|
266
|
-
}
|
|
267
|
-
case 3: {
|
|
268
|
-
matchResult = 1;
|
|
269
|
-
p_1 = _arg.fields[0];
|
|
270
|
-
break;
|
|
271
|
-
}
|
|
272
|
-
case 5: {
|
|
273
|
-
matchResult = 1;
|
|
274
|
-
p_1 = _arg.fields[0];
|
|
275
|
-
break;
|
|
276
|
-
}
|
|
277
|
-
case 6: {
|
|
278
|
-
matchResult = 2;
|
|
279
|
-
break;
|
|
280
|
-
}
|
|
281
|
-
default: {
|
|
282
|
-
matchResult = 0;
|
|
283
|
-
p = _arg.fields[0];
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
switch (matchResult) {
|
|
287
|
-
case 0:
|
|
288
|
-
return p.Metadata;
|
|
289
|
-
case 1:
|
|
290
|
-
return p_1.Metadata;
|
|
291
|
-
default:
|
|
292
|
-
return _arg.fields[0].Metadata;
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
export function ProfileModule_getEmergencyContacts(_arg) {
|
|
297
|
-
let matchResult, p;
|
|
298
|
-
switch (_arg.tag) {
|
|
299
|
-
case 2:
|
|
300
|
-
case 3:
|
|
301
|
-
case 5:
|
|
302
|
-
case 6: {
|
|
303
|
-
matchResult = 1;
|
|
304
|
-
break;
|
|
305
|
-
}
|
|
306
|
-
case 1: {
|
|
307
|
-
matchResult = 0;
|
|
308
|
-
p = _arg.fields[0];
|
|
309
|
-
break;
|
|
310
|
-
}
|
|
311
|
-
case 4: {
|
|
312
|
-
matchResult = 0;
|
|
313
|
-
p = _arg.fields[0];
|
|
314
|
-
break;
|
|
315
|
-
}
|
|
316
|
-
default: {
|
|
317
|
-
matchResult = 0;
|
|
318
|
-
p = _arg.fields[0];
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
switch (matchResult) {
|
|
322
|
-
case 0:
|
|
323
|
-
return p.EmergencyContacts;
|
|
324
|
-
default:
|
|
325
|
-
return undefined;
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
export function ProfileModule_incrementVersion(delta, timestamp, profile) {
|
|
330
|
-
const metadata_1 = MetadataModule_withTimestamp(timestamp, MetadataModule_incrementVersion(delta, ProfileModule_getMetadata(profile)));
|
|
331
|
-
switch (profile.tag) {
|
|
332
|
-
case 2: {
|
|
333
|
-
const p_1 = profile.fields[0];
|
|
334
|
-
return new Profile(2, [new PartialProfileDetail(metadata_1, p_1.AccountId, p_1.Name, p_1.Email, p_1.MobilePhone, p_1.ExternalId, p_1.Title, p_1.Gender, p_1.DateOfBirth, p_1.Address)]);
|
|
335
|
-
}
|
|
336
|
-
case 1: {
|
|
337
|
-
const p_2 = profile.fields[0];
|
|
338
|
-
return new Profile(1, [new ProfileDetail(metadata_1, p_2.AccountId, p_2.Name, p_2.Title, p_2.Gender, p_2.Email, p_2.MobilePhone, p_2.DateOfBirth, p_2.Address, p_2.ExternalId, p_2.EmergencyContacts)]);
|
|
339
|
-
}
|
|
340
|
-
case 3: {
|
|
341
|
-
const p_3 = profile.fields[0];
|
|
342
|
-
return new Profile(3, [new PartialProfileDetail(metadata_1, p_3.AccountId, p_3.Name, p_3.Email, p_3.MobilePhone, p_3.ExternalId, p_3.Title, p_3.Gender, p_3.DateOfBirth, p_3.Address)]);
|
|
343
|
-
}
|
|
344
|
-
case 4: {
|
|
345
|
-
const p_4 = profile.fields[0];
|
|
346
|
-
return new Profile(4, [new ProfileDetail(metadata_1, p_4.AccountId, p_4.Name, p_4.Title, p_4.Gender, p_4.Email, p_4.MobilePhone, p_4.DateOfBirth, p_4.Address, p_4.ExternalId, p_4.EmergencyContacts)]);
|
|
347
|
-
}
|
|
348
|
-
case 5: {
|
|
349
|
-
const p_5 = profile.fields[0];
|
|
350
|
-
return new Profile(5, [new PartialProfileDetail(metadata_1, p_5.AccountId, p_5.Name, p_5.Email, p_5.MobilePhone, p_5.ExternalId, p_5.Title, p_5.Gender, p_5.DateOfBirth, p_5.Address)]);
|
|
351
|
-
}
|
|
352
|
-
case 6: {
|
|
353
|
-
const p_6 = profile.fields[0];
|
|
354
|
-
return new Profile(6, [new PurgedProfileDetail(metadata_1, p_6.AccountId, p_6.Title, p_6.Gender, p_6.DateOfBirth, p_6.Address)]);
|
|
355
|
-
}
|
|
356
|
-
default: {
|
|
357
|
-
const p = profile.fields[0];
|
|
358
|
-
return new Profile(0, [new ProfileDetail(metadata_1, p.AccountId, p.Name, p.Title, p.Gender, p.Email, p.MobilePhone, p.DateOfBirth, p.Address, p.ExternalId, p.EmergencyContacts)]);
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
export function ProfileModule_tryPurge(_arg) {
|
|
364
|
-
let matchResult, profileDetail;
|
|
365
|
-
switch (_arg.tag) {
|
|
366
|
-
case 6: {
|
|
367
|
-
matchResult = 1;
|
|
368
|
-
break;
|
|
369
|
-
}
|
|
370
|
-
case 2:
|
|
371
|
-
case 3:
|
|
372
|
-
case 5: {
|
|
373
|
-
matchResult = 2;
|
|
374
|
-
break;
|
|
375
|
-
}
|
|
376
|
-
case 1: {
|
|
377
|
-
matchResult = 0;
|
|
378
|
-
profileDetail = _arg.fields[0];
|
|
379
|
-
break;
|
|
380
|
-
}
|
|
381
|
-
case 4: {
|
|
382
|
-
matchResult = 0;
|
|
383
|
-
profileDetail = _arg.fields[0];
|
|
384
|
-
break;
|
|
385
|
-
}
|
|
386
|
-
default: {
|
|
387
|
-
matchResult = 0;
|
|
388
|
-
profileDetail = _arg.fields[0];
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
switch (matchResult) {
|
|
392
|
-
case 0:
|
|
393
|
-
return new FSharpResult$2(0, [new Profile(6, [new PurgedProfileDetail(profileDetail.Metadata, profileDetail.AccountId, profileDetail.Title, profileDetail.Gender, profileDetail.DateOfBirth, new PurgedAddress(profileDetail.Address.City, profileDetail.Address.State, profileDetail.Address.Postcode, profileDetail.Address.CountryCode))])]);
|
|
394
|
-
case 1:
|
|
395
|
-
return new FSharpResult$2(1, ["Profile is already purged"]);
|
|
396
|
-
default:
|
|
397
|
-
return new FSharpResult$2(1, ["Cannot Purge a Partial profile"]);
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
export function ProfileModule_ensureNotPurged(_arg) {
|
|
402
|
-
switch (_arg.tag) {
|
|
403
|
-
case 6:
|
|
404
|
-
return new FSharpResult$2(1, ["Profile is purged"]);
|
|
405
|
-
default:
|
|
406
|
-
return new FSharpResult$2(0, [undefined]);
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
export function ProfileModule_tryActivate(_arg) {
|
|
411
|
-
switch (_arg.tag) {
|
|
412
|
-
case 2:
|
|
413
|
-
return new FSharpResult$2(1, ["Cannot activate a Partial profile"]);
|
|
414
|
-
case 1:
|
|
415
|
-
return new FSharpResult$2(0, [new Profile(0, [_arg.fields[0]])]);
|
|
416
|
-
case 3:
|
|
417
|
-
return new FSharpResult$2(0, [new Profile(2, [_arg.fields[0]])]);
|
|
418
|
-
case 4:
|
|
419
|
-
case 5:
|
|
420
|
-
return new FSharpResult$2(1, ["Cannot activate an Archived profile"]);
|
|
421
|
-
case 6:
|
|
422
|
-
return new FSharpResult$2(1, ["Cannot activate a Purged profile"]);
|
|
423
|
-
default:
|
|
424
|
-
return new FSharpResult$2(1, ["Cannot activate an Active profile"]);
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
export function ProfileModule_tryDeactivate(_arg) {
|
|
429
|
-
switch (_arg.tag) {
|
|
430
|
-
case 2:
|
|
431
|
-
return new FSharpResult$2(0, [new Profile(3, [_arg.fields[0]])]);
|
|
432
|
-
case 1:
|
|
433
|
-
case 3:
|
|
434
|
-
return new FSharpResult$2(1, ["Cannot deactivate an Inactive profile"]);
|
|
435
|
-
case 4:
|
|
436
|
-
case 5:
|
|
437
|
-
return new FSharpResult$2(1, ["Cannot deactivate an Archived profile"]);
|
|
438
|
-
case 6:
|
|
439
|
-
return new FSharpResult$2(1, ["Cannot deactivate a Purged profile"]);
|
|
440
|
-
default:
|
|
441
|
-
return new FSharpResult$2(0, [new Profile(1, [_arg.fields[0]])]);
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
export function ProfileModule_tryArchive(_arg) {
|
|
446
|
-
let matchResult, p, p_1;
|
|
447
|
-
switch (_arg.tag) {
|
|
448
|
-
case 4:
|
|
449
|
-
case 5: {
|
|
450
|
-
matchResult = 2;
|
|
451
|
-
break;
|
|
452
|
-
}
|
|
453
|
-
case 6: {
|
|
454
|
-
matchResult = 3;
|
|
455
|
-
break;
|
|
456
|
-
}
|
|
457
|
-
case 1: {
|
|
458
|
-
matchResult = 0;
|
|
459
|
-
p = _arg.fields[0];
|
|
460
|
-
break;
|
|
461
|
-
}
|
|
462
|
-
case 2: {
|
|
463
|
-
matchResult = 1;
|
|
464
|
-
p_1 = _arg.fields[0];
|
|
465
|
-
break;
|
|
466
|
-
}
|
|
467
|
-
case 3: {
|
|
468
|
-
matchResult = 1;
|
|
469
|
-
p_1 = _arg.fields[0];
|
|
470
|
-
break;
|
|
471
|
-
}
|
|
472
|
-
default: {
|
|
473
|
-
matchResult = 0;
|
|
474
|
-
p = _arg.fields[0];
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
switch (matchResult) {
|
|
478
|
-
case 0:
|
|
479
|
-
return new FSharpResult$2(0, [new Profile(4, [p])]);
|
|
480
|
-
case 1:
|
|
481
|
-
return new FSharpResult$2(0, [new Profile(5, [p_1])]);
|
|
482
|
-
case 2:
|
|
483
|
-
return new FSharpResult$2(1, ["Cannot archive a Archived profile"]);
|
|
484
|
-
default:
|
|
485
|
-
return new FSharpResult$2(1, ["Cannot archive a Purged profile"]);
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
export function ProfileModule_tryRestore(_arg) {
|
|
490
|
-
switch (_arg.tag) {
|
|
491
|
-
case 2:
|
|
492
|
-
return new FSharpResult$2(1, ["Cannot restore a Partial profile"]);
|
|
493
|
-
case 1:
|
|
494
|
-
case 3:
|
|
495
|
-
return new FSharpResult$2(1, ["Cannot restore an Inactive profile"]);
|
|
496
|
-
case 4:
|
|
497
|
-
return new FSharpResult$2(0, [new Profile(0, [_arg.fields[0]])]);
|
|
498
|
-
case 5:
|
|
499
|
-
return new FSharpResult$2(0, [new Profile(2, [_arg.fields[0]])]);
|
|
500
|
-
case 6:
|
|
501
|
-
return new FSharpResult$2(1, ["Cannot restore a Purged profile"]);
|
|
502
|
-
default:
|
|
503
|
-
return new FSharpResult$2(1, ["Cannot restore an Active profile"]);
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
export function ProfileModule_getExternalId(_arg) {
|
|
508
|
-
let matchResult, p, p_1;
|
|
509
|
-
switch (_arg.tag) {
|
|
510
|
-
case 1: {
|
|
511
|
-
matchResult = 0;
|
|
512
|
-
p = _arg.fields[0];
|
|
513
|
-
break;
|
|
514
|
-
}
|
|
515
|
-
case 4: {
|
|
516
|
-
matchResult = 0;
|
|
517
|
-
p = _arg.fields[0];
|
|
518
|
-
break;
|
|
519
|
-
}
|
|
520
|
-
case 2: {
|
|
521
|
-
matchResult = 1;
|
|
522
|
-
p_1 = _arg.fields[0];
|
|
523
|
-
break;
|
|
524
|
-
}
|
|
525
|
-
case 3: {
|
|
526
|
-
matchResult = 1;
|
|
527
|
-
p_1 = _arg.fields[0];
|
|
528
|
-
break;
|
|
529
|
-
}
|
|
530
|
-
case 5: {
|
|
531
|
-
matchResult = 1;
|
|
532
|
-
p_1 = _arg.fields[0];
|
|
533
|
-
break;
|
|
534
|
-
}
|
|
535
|
-
case 6: {
|
|
536
|
-
matchResult = 2;
|
|
537
|
-
break;
|
|
538
|
-
}
|
|
539
|
-
default: {
|
|
540
|
-
matchResult = 0;
|
|
541
|
-
p = _arg.fields[0];
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
switch (matchResult) {
|
|
545
|
-
case 0:
|
|
546
|
-
return p.ExternalId;
|
|
547
|
-
case 1:
|
|
548
|
-
return p_1.ExternalId;
|
|
549
|
-
default:
|
|
550
|
-
return undefined;
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
export function ProfileModule_getEmail(_arg) {
|
|
555
|
-
let matchResult, p, p_1;
|
|
556
|
-
switch (_arg.tag) {
|
|
557
|
-
case 1: {
|
|
558
|
-
matchResult = 0;
|
|
559
|
-
p = _arg.fields[0];
|
|
560
|
-
break;
|
|
561
|
-
}
|
|
562
|
-
case 4: {
|
|
563
|
-
matchResult = 0;
|
|
564
|
-
p = _arg.fields[0];
|
|
565
|
-
break;
|
|
566
|
-
}
|
|
567
|
-
case 2: {
|
|
568
|
-
matchResult = 1;
|
|
569
|
-
p_1 = _arg.fields[0];
|
|
570
|
-
break;
|
|
571
|
-
}
|
|
572
|
-
case 3: {
|
|
573
|
-
matchResult = 1;
|
|
574
|
-
p_1 = _arg.fields[0];
|
|
575
|
-
break;
|
|
576
|
-
}
|
|
577
|
-
case 5: {
|
|
578
|
-
matchResult = 1;
|
|
579
|
-
p_1 = _arg.fields[0];
|
|
580
|
-
break;
|
|
581
|
-
}
|
|
582
|
-
case 6: {
|
|
583
|
-
matchResult = 2;
|
|
584
|
-
break;
|
|
585
|
-
}
|
|
586
|
-
default: {
|
|
587
|
-
matchResult = 0;
|
|
588
|
-
p = _arg.fields[0];
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
switch (matchResult) {
|
|
592
|
-
case 0:
|
|
593
|
-
return p.Email;
|
|
594
|
-
case 1:
|
|
595
|
-
return p_1.Email;
|
|
596
|
-
default:
|
|
597
|
-
return undefined;
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
export class OperationalProfile extends Union {
|
|
602
|
-
constructor(tag, fields) {
|
|
603
|
-
super();
|
|
604
|
-
this.tag = tag;
|
|
605
|
-
this.fields = fields;
|
|
606
|
-
}
|
|
607
|
-
cases() {
|
|
608
|
-
return ["Active", "Inactive", "Partial", "InactivePartial"];
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
export function OperationalProfile_$reflection() {
|
|
613
|
-
return union_type("DomainAggregates.OperationalProfile", [], OperationalProfile, () => [[["Item", ProfileDetail_$reflection()]], [["Item", ProfileDetail_$reflection()]], [["Item", PartialProfileDetail_$reflection()]], [["Item", PartialProfileDetail_$reflection()]]]);
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
export function OperationalProfileModule_toDomain(profile) {
|
|
617
|
-
switch (profile.tag) {
|
|
618
|
-
case 1:
|
|
619
|
-
return new Profile(1, [profile.fields[0]]);
|
|
620
|
-
case 2:
|
|
621
|
-
return new Profile(2, [profile.fields[0]]);
|
|
622
|
-
case 3:
|
|
623
|
-
return new Profile(3, [profile.fields[0]]);
|
|
624
|
-
default:
|
|
625
|
-
return new Profile(0, [profile.fields[0]]);
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
export function OperationalProfileModule_ofDomain(profile) {
|
|
630
|
-
switch (profile.tag) {
|
|
631
|
-
case 1:
|
|
632
|
-
return new OperationalProfile(1, [profile.fields[0]]);
|
|
633
|
-
case 2:
|
|
634
|
-
return new OperationalProfile(2, [profile.fields[0]]);
|
|
635
|
-
case 3:
|
|
636
|
-
return new OperationalProfile(3, [profile.fields[0]]);
|
|
637
|
-
case 4:
|
|
638
|
-
case 5:
|
|
639
|
-
case 6:
|
|
640
|
-
return undefined;
|
|
641
|
-
default:
|
|
642
|
-
return new OperationalProfile(0, [profile.fields[0]]);
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
export function OperationalProfileModule_getEmail(profile) {
|
|
647
|
-
let matchResult, p, p_1;
|
|
648
|
-
switch (profile.tag) {
|
|
649
|
-
case 1: {
|
|
650
|
-
matchResult = 0;
|
|
651
|
-
p = profile.fields[0];
|
|
652
|
-
break;
|
|
653
|
-
}
|
|
654
|
-
case 2: {
|
|
655
|
-
matchResult = 1;
|
|
656
|
-
p_1 = profile.fields[0];
|
|
657
|
-
break;
|
|
658
|
-
}
|
|
659
|
-
case 3: {
|
|
660
|
-
matchResult = 1;
|
|
661
|
-
p_1 = profile.fields[0];
|
|
662
|
-
break;
|
|
663
|
-
}
|
|
664
|
-
default: {
|
|
665
|
-
matchResult = 0;
|
|
666
|
-
p = profile.fields[0];
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
switch (matchResult) {
|
|
670
|
-
case 0:
|
|
671
|
-
return p.Email;
|
|
672
|
-
default:
|
|
673
|
-
return p_1.Email;
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
export function OperationalProfileModule_$007CFullDetails$007CPartialDetails$007CNonOperational$007C(profile) {
|
|
678
|
-
let matchResult, details, details_1;
|
|
679
|
-
switch (profile.tag) {
|
|
680
|
-
case 0: {
|
|
681
|
-
matchResult = 0;
|
|
682
|
-
details = profile.fields[0];
|
|
683
|
-
break;
|
|
684
|
-
}
|
|
685
|
-
case 1: {
|
|
686
|
-
matchResult = 0;
|
|
687
|
-
details = profile.fields[0];
|
|
688
|
-
break;
|
|
689
|
-
}
|
|
690
|
-
case 2: {
|
|
691
|
-
matchResult = 1;
|
|
692
|
-
details_1 = profile.fields[0];
|
|
693
|
-
break;
|
|
694
|
-
}
|
|
695
|
-
case 3: {
|
|
696
|
-
matchResult = 1;
|
|
697
|
-
details_1 = profile.fields[0];
|
|
698
|
-
break;
|
|
699
|
-
}
|
|
700
|
-
default:
|
|
701
|
-
matchResult = 2;
|
|
702
|
-
}
|
|
703
|
-
switch (matchResult) {
|
|
704
|
-
case 0:
|
|
705
|
-
return new FSharpChoice$3(0, [details]);
|
|
706
|
-
case 1:
|
|
707
|
-
return new FSharpChoice$3(1, [details_1]);
|
|
708
|
-
default:
|
|
709
|
-
return new FSharpChoice$3(2, [undefined]);
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
export function $007COperational$007CNonOperational$007C(profile) {
|
|
714
|
-
const matchValue = OperationalProfileModule_ofDomain(profile);
|
|
715
|
-
if (matchValue == null) {
|
|
716
|
-
return new FSharpChoice$2(1, [undefined]);
|
|
717
|
-
}
|
|
718
|
-
else {
|
|
719
|
-
return new FSharpChoice$2(0, [matchValue]);
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
export class FullProfile extends Union {
|
|
724
|
-
constructor(tag, fields) {
|
|
725
|
-
super();
|
|
726
|
-
this.tag = tag;
|
|
727
|
-
this.fields = fields;
|
|
728
|
-
}
|
|
729
|
-
cases() {
|
|
730
|
-
return ["Active", "Inactive"];
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
|
|
734
|
-
export function FullProfile_$reflection() {
|
|
735
|
-
return union_type("DomainAggregates.FullProfile", [], FullProfile, () => [[["Item", ProfileDetail_$reflection()]], [["Item", ProfileDetail_$reflection()]]]);
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
export function FullProfileModule_toDomain(profile) {
|
|
739
|
-
if (profile.tag === 1) {
|
|
740
|
-
return new Profile(1, [profile.fields[0]]);
|
|
741
|
-
}
|
|
742
|
-
else {
|
|
743
|
-
return new Profile(0, [profile.fields[0]]);
|
|
744
|
-
}
|
|
745
|
-
}
|
|
746
|
-
|
|
747
|
-
export function FullProfileModule_ofDomain(profile) {
|
|
748
|
-
switch (profile.tag) {
|
|
749
|
-
case 1:
|
|
750
|
-
return new FullProfile(1, [profile.fields[0]]);
|
|
751
|
-
case 2:
|
|
752
|
-
case 3:
|
|
753
|
-
case 4:
|
|
754
|
-
case 5:
|
|
755
|
-
case 6:
|
|
756
|
-
return undefined;
|
|
757
|
-
default:
|
|
758
|
-
return new FullProfile(0, [profile.fields[0]]);
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
|
|
762
|
-
export function FullProfileModule_value(profile) {
|
|
763
|
-
if (profile.tag === 1) {
|
|
764
|
-
return profile.fields[0];
|
|
765
|
-
}
|
|
766
|
-
else {
|
|
767
|
-
return profile.fields[0];
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
export function FullProfileModule_getMetadata(_arg) {
|
|
772
|
-
let p;
|
|
773
|
-
if (_arg.tag === 1) {
|
|
774
|
-
p = _arg.fields[0];
|
|
775
|
-
}
|
|
776
|
-
else {
|
|
777
|
-
p = _arg.fields[0];
|
|
778
|
-
}
|
|
779
|
-
return p.Metadata;
|
|
780
|
-
}
|
|
781
|
-
|
|
782
|
-
export function FullProfileModule_getEmail(_arg) {
|
|
783
|
-
let p;
|
|
784
|
-
if (_arg.tag === 1) {
|
|
785
|
-
p = _arg.fields[0];
|
|
786
|
-
}
|
|
787
|
-
else {
|
|
788
|
-
p = _arg.fields[0];
|
|
789
|
-
}
|
|
790
|
-
return p.Email;
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
export function FullProfileModule_getCase(profile) {
|
|
794
|
-
if (profile.tag === 1) {
|
|
795
|
-
return (Item_1) => (new FullProfile(1, [Item_1]));
|
|
796
|
-
}
|
|
797
|
-
else {
|
|
798
|
-
return (Item) => (new FullProfile(0, [Item]));
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
|