@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.
Files changed (76) hide show
  1. package/dist/assets/delete.dcc7b157.svg +5 -0
  2. package/dist/assets/dialog-warning.cc77f3ba.svg +5 -0
  3. package/dist/assets/pencil.05fe6be6.svg +5 -0
  4. package/dist/index.html +20 -0
  5. package/dist/superhero-basic-profile.js +50 -0
  6. package/package.json +1 -1
  7. package/dist/App.jsx +0 -4
  8. package/dist/Basic.Profile.Domain/AnalyticsEvent.jsx +0 -102
  9. package/dist/Basic.Profile.Domain/Audit.jsx +0 -149
  10. package/dist/Basic.Profile.Domain/Commands.jsx +0 -68
  11. package/dist/Basic.Profile.Domain/CommonTypes.jsx +0 -194
  12. package/dist/Basic.Profile.Domain/Config/Api/Admin/Read.jsx +0 -58
  13. package/dist/Basic.Profile.Domain/Config/Api/Admin/Write.jsx +0 -23
  14. package/dist/Basic.Profile.Domain/Config/Api/FlareAdminShell/Read.jsx +0 -35
  15. package/dist/Basic.Profile.Domain/Config/Commands.jsx +0 -72
  16. package/dist/Basic.Profile.Domain/Config/ConfigCommandHandler.jsx +0 -197
  17. package/dist/Basic.Profile.Domain/Config/Dto.jsx +0 -181
  18. package/dist/Basic.Profile.Domain/Config/Types.jsx +0 -152
  19. package/dist/Basic.Profile.Domain/DateTimeProvider.jsx +0 -23
  20. package/dist/Basic.Profile.Domain/DomainAggregates.jsx +0 -801
  21. package/dist/Basic.Profile.Domain/DomainPrimitives.jsx +0 -426
  22. package/dist/Basic.Profile.Domain/Dto/Aggregates.jsx +0 -564
  23. package/dist/Basic.Profile.Domain/Dto/AnalyticsEvent.jsx +0 -157
  24. package/dist/Basic.Profile.Domain/Dto/Api/Backend/Common.jsx +0 -102
  25. package/dist/Basic.Profile.Domain/Dto/Api/Backend/Read.jsx +0 -85
  26. package/dist/Basic.Profile.Domain/Dto/Api/Backend/Write.jsx +0 -16
  27. package/dist/Basic.Profile.Domain/Dto/Api/Common.jsx +0 -427
  28. package/dist/Basic.Profile.Domain/Dto/Api/External/Read.jsx +0 -118
  29. package/dist/Basic.Profile.Domain/Dto/Api/External/ReadV2.jsx +0 -6
  30. package/dist/Basic.Profile.Domain/Dto/Api/External/Write.jsx +0 -184
  31. package/dist/Basic.Profile.Domain/Dto/Api/External/WriteV2.jsx +0 -439
  32. package/dist/Basic.Profile.Domain/Dto/Api/FlareAdminShell/Read.jsx +0 -38
  33. package/dist/Basic.Profile.Domain/Dto/Api/FlareAdminShell/Write.jsx +0 -199
  34. package/dist/Basic.Profile.Domain/Dto/Api/Internal/Read.jsx +0 -125
  35. package/dist/Basic.Profile.Domain/Dto/Audit.jsx +0 -121
  36. package/dist/Basic.Profile.Domain/Dto/Commands.jsx +0 -256
  37. package/dist/Basic.Profile.Domain/Dto/Common.jsx +0 -84
  38. package/dist/Basic.Profile.Domain/Dto/Events.jsx +0 -220
  39. package/dist/Basic.Profile.Domain/Dto/Primitives.jsx +0 -580
  40. package/dist/Basic.Profile.Domain/Dto/ProfileCreationModels.jsx +0 -324
  41. package/dist/Basic.Profile.Domain/Dto/Validation.jsx +0 -229
  42. package/dist/Basic.Profile.Domain/Events.jsx +0 -64
  43. package/dist/Basic.Profile.Domain/Import/Api/InternalApi/Read.jsx +0 -140
  44. package/dist/Basic.Profile.Domain/Import/Api/InternalApi/Validation.jsx +0 -499
  45. package/dist/Basic.Profile.Domain/Import/Api/InternalApi/Write.jsx +0 -51
  46. package/dist/Basic.Profile.Domain/Import/Api/Read.jsx +0 -154
  47. package/dist/Basic.Profile.Domain/Import/CommonTypes.jsx +0 -187
  48. package/dist/Basic.Profile.Domain/Import/Dto.jsx +0 -475
  49. package/dist/Basic.Profile.Domain/Import/ImportCommandHandler.jsx +0 -531
  50. package/dist/Basic.Profile.Domain/Import/Types.jsx +0 -405
  51. package/dist/Basic.Profile.Domain/JwtPayload.jsx +0 -44
  52. package/dist/Basic.Profile.Domain/Metadata.jsx +0 -257
  53. package/dist/Basic.Profile.Domain/ProfileCommandHandler.jsx +0 -261
  54. package/dist/Basic.Profile.Domain/ProfileModels.jsx +0 -59
  55. package/dist/Basic.Profile.Domain/Utils.jsx +0 -372
  56. package/dist/Common/PreactCustomElement.jsx +0 -8
  57. package/dist/Common/Resources.jsx +0 -20
  58. package/dist/Common/Tailwind.jsx +0 -8
  59. package/dist/Common/Utils.jsx +0 -18
  60. package/dist/Directory/App.jsx +0 -192
  61. package/dist/Directory/BackendServices/Common.jsx +0 -115
  62. package/dist/Directory/BackendServices/ConfigService.jsx +0 -168
  63. package/dist/Directory/BackendServices/ImportService.jsx +0 -137
  64. package/dist/Directory/Common.jsx +0 -93
  65. package/dist/Directory/Config/Components.jsx +0 -173
  66. package/dist/Directory/Config/Types.jsx +0 -187
  67. package/dist/Directory/PastImports/PastImports.jsx +0 -81
  68. package/dist/Directory/ProfileImport/ProfileImport.jsx +0 -284
  69. package/dist/Directory/ProfileImport/Types.jsx +0 -91
  70. package/dist/Directory/TabNav.jsx +0 -24
  71. package/dist/Directory/Types.jsx +0 -101
  72. package/dist/Directory/User.jsx +0 -117
  73. package/dist/HeadlessUI/Dialog.jsx +0 -66
  74. package/dist/HeadlessUI/ModalDialog.jsx +0 -74
  75. package/dist/HeadlessUI/Switch.jsx +0 -66
  76. package/dist/HeadlessUI/Transition.jsx +0 -66
@@ -1,184 +0,0 @@
1
- import { Record } from "../../../../fable_modules/fable-library-js.4.20.0/Types.js";
2
- import { ExternalId_toDomain, MobilePhone_toDomain, Gender_toDomain, Title_toDomain, NameModule_toDomain, Address_$reflection, Name_$reflection } from "../../Primitives.jsx";
3
- import { record_type, option_type, string_type } from "../../../../fable_modules/fable-library-js.4.20.0/Reflection.js";
4
- import { FSharpResult$2 } from "../../../../fable_modules/fable-library-js.4.20.0/Result.js";
5
- import { Address_toDomainV1, DateOfBirth_toDomain, Email_toDomain } from "../Common.jsx";
6
- import { unwrap } from "../../../../fable_modules/fable-library-js.4.20.0/Option.js";
7
- import { empty } from "../../../../fable_modules/fable-library-js.4.20.0/List.js";
8
- import { ProfileDetail } from "../../../DomainAggregates.jsx";
9
- import { FullProfileCreationDetails } from "../../../ProfileModels.jsx";
10
- import { newGuid } from "../../../../fable_modules/fable-library-js.4.20.0/Guid.js";
11
- import { Command$1, ProfileCommand, CommandId } from "../../../Commands.jsx";
12
-
13
- export class ProfileWriteDto extends Record {
14
- constructor(Name, ExternalId, Title, Gender, Email, MobilePhone, DateOfBirth, Address) {
15
- super();
16
- this.Name = Name;
17
- this.ExternalId = ExternalId;
18
- this.Title = Title;
19
- this.Gender = Gender;
20
- this.Email = Email;
21
- this.MobilePhone = MobilePhone;
22
- this.DateOfBirth = DateOfBirth;
23
- this.Address = Address;
24
- }
25
- }
26
-
27
- export function ProfileWriteDto_$reflection() {
28
- return record_type("Dto.Api.External.Write.ProfileWriteDto", [], ProfileWriteDto, () => [["Name", Name_$reflection()], ["ExternalId", option_type(string_type)], ["Title", string_type], ["Gender", string_type], ["Email", string_type], ["MobilePhone", string_type], ["DateOfBirth", string_type], ["Address", Address_$reflection()]]);
29
- }
30
-
31
- function ProfileWriteDtoModule_toDomainInternal(profile) {
32
- const input_17 = NameModule_toDomain(profile.Name);
33
- if (input_17.tag === 1) {
34
- return new FSharpResult$2(1, [input_17.fields[0]]);
35
- }
36
- else {
37
- const input_15 = Title_toDomain(profile.Title);
38
- if (input_15.tag === 1) {
39
- return new FSharpResult$2(1, [input_15.fields[0]]);
40
- }
41
- else {
42
- const input_13 = Gender_toDomain(profile.Gender);
43
- if (input_13.tag === 1) {
44
- return new FSharpResult$2(1, [input_13.fields[0]]);
45
- }
46
- else {
47
- const input_11 = Email_toDomain(profile.Email);
48
- if (input_11.tag === 1) {
49
- return new FSharpResult$2(1, [input_11.fields[0]]);
50
- }
51
- else {
52
- const input_9 = MobilePhone_toDomain(profile.MobilePhone);
53
- if (input_9.tag === 1) {
54
- return new FSharpResult$2(1, [input_9.fields[0]]);
55
- }
56
- else {
57
- const input_7 = DateOfBirth_toDomain(profile.DateOfBirth);
58
- if (input_7.tag === 1) {
59
- return new FSharpResult$2(1, [input_7.fields[0]]);
60
- }
61
- else {
62
- const input_5 = Address_toDomainV1(profile.Address);
63
- if (input_5.tag === 1) {
64
- return new FSharpResult$2(1, [input_5.fields[0]]);
65
- }
66
- else {
67
- let input_3;
68
- const input_1 = profile.ExternalId;
69
- if (input_1 != null) {
70
- const input_2 = ExternalId_toDomain(input_1);
71
- input_3 = ((input_2.tag === 1) ? (new FSharpResult$2(1, [input_2.fields[0]])) : (new FSharpResult$2(0, [input_2.fields[0]])));
72
- }
73
- else {
74
- input_3 = (new FSharpResult$2(0, [undefined]));
75
- }
76
- if (input_3.tag === 1) {
77
- return new FSharpResult$2(1, [input_3.fields[0]]);
78
- }
79
- else {
80
- return new FSharpResult$2(0, [{
81
- Address: input_5.fields[0],
82
- DateOfBirth: input_7.fields[0],
83
- Email: input_11.fields[0],
84
- ExternalId: unwrap(input_3.fields[0]),
85
- Gender: input_13.fields[0],
86
- MobilePhone: input_9.fields[0],
87
- Name: input_17.fields[0],
88
- Title: input_15.fields[0],
89
- }]);
90
- }
91
- }
92
- }
93
- }
94
- }
95
- }
96
- }
97
- }
98
- }
99
-
100
- export function ProfileWriteDtoModule_toProfileDetail(accountId, metadata, profile) {
101
- let data;
102
- const input = ProfileWriteDtoModule_toDomainInternal(profile);
103
- if (input.tag === 1) {
104
- return new FSharpResult$2(1, [input.fields[0]]);
105
- }
106
- else {
107
- return new FSharpResult$2(0, [(data = input.fields[0], new ProfileDetail(metadata, accountId, data.Name, data.Title, data.Gender, data.Email, data.MobilePhone, data.DateOfBirth, data.Address, data.ExternalId, empty()))]);
108
- }
109
- }
110
-
111
- export function ProfileWriteDtoModule_toCreateCommand(accountId, metadata, profile) {
112
- let data, details, copyOfStruct;
113
- const input = ProfileWriteDtoModule_toDomainInternal(profile);
114
- if (input.tag === 1) {
115
- return new FSharpResult$2(1, [input.fields[0]]);
116
- }
117
- else {
118
- return new FSharpResult$2(0, [(data = input.fields[0], (details = (new FullProfileCreationDetails(accountId, data.Name, data.Title, data.Gender, data.Email, data.MobilePhone, data.DateOfBirth, data.Address, data.ExternalId)), new Command$1(new CommandId((copyOfStruct = newGuid(), copyOfStruct)), new ProfileCommand(0, [details]), metadata)))]);
119
- }
120
- }
121
-
122
- export class ProfileUpdateDto extends Record {
123
- constructor(Name, Title, Gender, Email, MobilePhone, DateOfBirth, Address) {
124
- super();
125
- this.Name = Name;
126
- this.Title = Title;
127
- this.Gender = Gender;
128
- this.Email = Email;
129
- this.MobilePhone = MobilePhone;
130
- this.DateOfBirth = DateOfBirth;
131
- this.Address = Address;
132
- }
133
- }
134
-
135
- export function ProfileUpdateDto_$reflection() {
136
- return record_type("Dto.Api.External.Write.ProfileUpdateDto", [], ProfileUpdateDto, () => [["Name", Name_$reflection()], ["Title", string_type], ["Gender", string_type], ["Email", string_type], ["MobilePhone", string_type], ["DateOfBirth", string_type], ["Address", Address_$reflection()]]);
137
- }
138
-
139
- export function ProfileUpdateDtoModule_toProfileDetail(accountId, metadata, externalId, emergencyContacts, profile) {
140
- const input_12 = NameModule_toDomain(profile.Name);
141
- if (input_12.tag === 1) {
142
- return new FSharpResult$2(1, [input_12.fields[0]]);
143
- }
144
- else {
145
- const input_10 = Title_toDomain(profile.Title);
146
- if (input_10.tag === 1) {
147
- return new FSharpResult$2(1, [input_10.fields[0]]);
148
- }
149
- else {
150
- const input_8 = Gender_toDomain(profile.Gender);
151
- if (input_8.tag === 1) {
152
- return new FSharpResult$2(1, [input_8.fields[0]]);
153
- }
154
- else {
155
- const input_6 = Email_toDomain(profile.Email);
156
- if (input_6.tag === 1) {
157
- return new FSharpResult$2(1, [input_6.fields[0]]);
158
- }
159
- else {
160
- const input_4 = MobilePhone_toDomain(profile.MobilePhone);
161
- if (input_4.tag === 1) {
162
- return new FSharpResult$2(1, [input_4.fields[0]]);
163
- }
164
- else {
165
- const input_2 = DateOfBirth_toDomain(profile.DateOfBirth);
166
- if (input_2.tag === 1) {
167
- return new FSharpResult$2(1, [input_2.fields[0]]);
168
- }
169
- else {
170
- const input = Address_toDomainV1(profile.Address);
171
- if (input.tag === 1) {
172
- return new FSharpResult$2(1, [input.fields[0]]);
173
- }
174
- else {
175
- return new FSharpResult$2(0, [new ProfileDetail(metadata, accountId, input_12.fields[0], input_10.fields[0], input_8.fields[0], input_6.fields[0], input_4.fields[0], input_2.fields[0], input.fields[0], externalId, emergencyContacts)]);
176
- }
177
- }
178
- }
179
- }
180
- }
181
- }
182
- }
183
- }
184
-
@@ -1,439 +0,0 @@
1
- import { Record } from "../../../../fable_modules/fable-library-js.4.20.0/Types.js";
2
- import { ExternalId_toDomain, Address_$reflection, Name_$reflection } from "../../Primitives.jsx";
3
- import { record_type, option_type, string_type } from "../../../../fable_modules/fable-library-js.4.20.0/Reflection.js";
4
- import { Address_toDomain, DateOfBirth_toDomain, Gender_toDomain, Title_toDomain, MobilePhone_toDomain, Email_toDomain, Name_toDomain } from "../Common.jsx";
5
- import { FSharpResult$2 } from "../../../../fable_modules/fable-library-js.4.20.0/Result.js";
6
- import { ProfileDetail, Profile, PartialProfileDetail } from "../../../DomainAggregates.jsx";
7
- import { FullProfileCreationDetails, PartialProfileUpdateDetails, PartialProfileCreationDetails } from "../../../ProfileModels.jsx";
8
- import { newGuid } from "../../../../fable_modules/fable-library-js.4.20.0/Guid.js";
9
- import { Command$1, ProfileCommand, CommandId } from "../../../Commands.jsx";
10
- import { MetadataModule_toCommandMetadata, CommandMetadata_withTimestamp } from "../../../Metadata.jsx";
11
-
12
- export class PartialProfileCreateDto extends Record {
13
- constructor(Name, Email, ExternalId, MobilePhone, Title, Gender, DateOfBirth, Address) {
14
- super();
15
- this.Name = Name;
16
- this.Email = Email;
17
- this.ExternalId = ExternalId;
18
- this.MobilePhone = MobilePhone;
19
- this.Title = Title;
20
- this.Gender = Gender;
21
- this.DateOfBirth = DateOfBirth;
22
- this.Address = Address;
23
- }
24
- }
25
-
26
- export function PartialProfileCreateDto_$reflection() {
27
- return record_type("Dto.Api.External.WriteV2.PartialProfileCreateDto", [], PartialProfileCreateDto, () => [["Name", Name_$reflection()], ["Email", string_type], ["ExternalId", option_type(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())]]);
28
- }
29
-
30
- function PartialProfileCreateDtoModule_toDomainInternal(p) {
31
- const input_32 = Name_toDomain(p.Name);
32
- if (input_32.tag === 1) {
33
- return new FSharpResult$2(1, [input_32.fields[0]]);
34
- }
35
- else {
36
- const input_30 = Email_toDomain(p.Email);
37
- if (input_30.tag === 1) {
38
- return new FSharpResult$2(1, [input_30.fields[0]]);
39
- }
40
- else {
41
- let input_28;
42
- const input_1 = p.MobilePhone;
43
- if (input_1 != null) {
44
- const input_2 = MobilePhone_toDomain(input_1);
45
- input_28 = ((input_2.tag === 1) ? (new FSharpResult$2(1, [input_2.fields[0]])) : (new FSharpResult$2(0, [input_2.fields[0]])));
46
- }
47
- else {
48
- input_28 = (new FSharpResult$2(0, [undefined]));
49
- }
50
- if (input_28.tag === 1) {
51
- return new FSharpResult$2(1, [input_28.fields[0]]);
52
- }
53
- else {
54
- let input_26;
55
- const input_4 = p.ExternalId;
56
- if (input_4 != null) {
57
- const input_5 = ExternalId_toDomain(input_4);
58
- input_26 = ((input_5.tag === 1) ? (new FSharpResult$2(1, [input_5.fields[0]])) : (new FSharpResult$2(0, [input_5.fields[0]])));
59
- }
60
- else {
61
- input_26 = (new FSharpResult$2(0, [undefined]));
62
- }
63
- if (input_26.tag === 1) {
64
- return new FSharpResult$2(1, [input_26.fields[0]]);
65
- }
66
- else {
67
- let input_24;
68
- const input_7 = p.Title;
69
- if (input_7 != null) {
70
- const input_8 = Title_toDomain(input_7);
71
- input_24 = ((input_8.tag === 1) ? (new FSharpResult$2(1, [input_8.fields[0]])) : (new FSharpResult$2(0, [input_8.fields[0]])));
72
- }
73
- else {
74
- input_24 = (new FSharpResult$2(0, [undefined]));
75
- }
76
- if (input_24.tag === 1) {
77
- return new FSharpResult$2(1, [input_24.fields[0]]);
78
- }
79
- else {
80
- let input_22;
81
- const input_10 = p.Gender;
82
- if (input_10 != null) {
83
- const input_11 = Gender_toDomain(input_10);
84
- input_22 = ((input_11.tag === 1) ? (new FSharpResult$2(1, [input_11.fields[0]])) : (new FSharpResult$2(0, [input_11.fields[0]])));
85
- }
86
- else {
87
- input_22 = (new FSharpResult$2(0, [undefined]));
88
- }
89
- if (input_22.tag === 1) {
90
- return new FSharpResult$2(1, [input_22.fields[0]]);
91
- }
92
- else {
93
- let input_20;
94
- const input_13 = p.DateOfBirth;
95
- if (input_13 != null) {
96
- const input_14 = DateOfBirth_toDomain(input_13);
97
- input_20 = ((input_14.tag === 1) ? (new FSharpResult$2(1, [input_14.fields[0]])) : (new FSharpResult$2(0, [input_14.fields[0]])));
98
- }
99
- else {
100
- input_20 = (new FSharpResult$2(0, [undefined]));
101
- }
102
- if (input_20.tag === 1) {
103
- return new FSharpResult$2(1, [input_20.fields[0]]);
104
- }
105
- else {
106
- let input_18;
107
- const input_16 = p.Address;
108
- if (input_16 != null) {
109
- const input_17 = Address_toDomain(input_16);
110
- input_18 = ((input_17.tag === 1) ? (new FSharpResult$2(1, [input_17.fields[0]])) : (new FSharpResult$2(0, [input_17.fields[0]])));
111
- }
112
- else {
113
- input_18 = (new FSharpResult$2(0, [undefined]));
114
- }
115
- if (input_18.tag === 1) {
116
- return new FSharpResult$2(1, [input_18.fields[0]]);
117
- }
118
- else {
119
- return new FSharpResult$2(0, [[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]]]);
120
- }
121
- }
122
- }
123
- }
124
- }
125
- }
126
- }
127
- }
128
- }
129
-
130
- export function PartialProfileCreateDtoModule_toProfile(accountId, metadata, p) {
131
- let _arg;
132
- const input = PartialProfileCreateDtoModule_toDomainInternal(p);
133
- if (input.tag === 1) {
134
- return new FSharpResult$2(1, [input.fields[0]]);
135
- }
136
- else {
137
- return new FSharpResult$2(0, [(_arg = input.fields[0], new Profile(2, [new PartialProfileDetail(metadata, accountId, _arg[0], _arg[1], _arg[2], _arg[3], _arg[4], _arg[5], _arg[6], _arg[7])]))]);
138
- }
139
- }
140
-
141
- export function PartialProfileCreateDtoModule_toCreateCommand(accountId, metadata, p) {
142
- let _arg, details, copyOfStruct;
143
- const input = PartialProfileCreateDtoModule_toDomainInternal(p);
144
- if (input.tag === 1) {
145
- return new FSharpResult$2(1, [input.fields[0]]);
146
- }
147
- else {
148
- return new FSharpResult$2(0, [(_arg = input.fields[0], (details = (new PartialProfileCreationDetails(accountId, _arg[0], _arg[1], _arg[2], _arg[3], _arg[4], _arg[5], _arg[6], _arg[7])), new Command$1(new CommandId((copyOfStruct = newGuid(), copyOfStruct)), new ProfileCommand(1, [details]), metadata)))]);
149
- }
150
- }
151
-
152
- export class PartialProfileUpdateDto extends Record {
153
- constructor(Name, Email, MobilePhone, Title, Gender, DateOfBirth, Address) {
154
- super();
155
- this.Name = Name;
156
- this.Email = Email;
157
- this.MobilePhone = MobilePhone;
158
- this.Title = Title;
159
- this.Gender = Gender;
160
- this.DateOfBirth = DateOfBirth;
161
- this.Address = Address;
162
- }
163
- }
164
-
165
- export function PartialProfileUpdateDto_$reflection() {
166
- return record_type("Dto.Api.External.WriteV2.PartialProfileUpdateDto", [], PartialProfileUpdateDto, () => [["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())]]);
167
- }
168
-
169
- function PartialProfileUpdateDtoModule_toDomainInternal(updateDto) {
170
- const input_27 = Name_toDomain(updateDto.Name);
171
- if (input_27.tag === 1) {
172
- return new FSharpResult$2(1, [input_27.fields[0]]);
173
- }
174
- else {
175
- const input_25 = Email_toDomain(updateDto.Email);
176
- if (input_25.tag === 1) {
177
- return new FSharpResult$2(1, [input_25.fields[0]]);
178
- }
179
- else {
180
- let input_23;
181
- const input_1 = updateDto.MobilePhone;
182
- if (input_1 != null) {
183
- const input_2 = MobilePhone_toDomain(input_1);
184
- input_23 = ((input_2.tag === 1) ? (new FSharpResult$2(1, [input_2.fields[0]])) : (new FSharpResult$2(0, [input_2.fields[0]])));
185
- }
186
- else {
187
- input_23 = (new FSharpResult$2(0, [undefined]));
188
- }
189
- if (input_23.tag === 1) {
190
- return new FSharpResult$2(1, [input_23.fields[0]]);
191
- }
192
- else {
193
- let input_21;
194
- const input_4 = updateDto.Title;
195
- if (input_4 != null) {
196
- const input_5 = Title_toDomain(input_4);
197
- input_21 = ((input_5.tag === 1) ? (new FSharpResult$2(1, [input_5.fields[0]])) : (new FSharpResult$2(0, [input_5.fields[0]])));
198
- }
199
- else {
200
- input_21 = (new FSharpResult$2(0, [undefined]));
201
- }
202
- if (input_21.tag === 1) {
203
- return new FSharpResult$2(1, [input_21.fields[0]]);
204
- }
205
- else {
206
- let input_19;
207
- const input_7 = updateDto.Gender;
208
- if (input_7 != null) {
209
- const input_8 = Gender_toDomain(input_7);
210
- input_19 = ((input_8.tag === 1) ? (new FSharpResult$2(1, [input_8.fields[0]])) : (new FSharpResult$2(0, [input_8.fields[0]])));
211
- }
212
- else {
213
- input_19 = (new FSharpResult$2(0, [undefined]));
214
- }
215
- if (input_19.tag === 1) {
216
- return new FSharpResult$2(1, [input_19.fields[0]]);
217
- }
218
- else {
219
- let input_17;
220
- const input_10 = updateDto.DateOfBirth;
221
- if (input_10 != null) {
222
- const input_11 = DateOfBirth_toDomain(input_10);
223
- input_17 = ((input_11.tag === 1) ? (new FSharpResult$2(1, [input_11.fields[0]])) : (new FSharpResult$2(0, [input_11.fields[0]])));
224
- }
225
- else {
226
- input_17 = (new FSharpResult$2(0, [undefined]));
227
- }
228
- if (input_17.tag === 1) {
229
- return new FSharpResult$2(1, [input_17.fields[0]]);
230
- }
231
- else {
232
- let input_15;
233
- const input_13 = updateDto.Address;
234
- if (input_13 != null) {
235
- const input_14 = Address_toDomain(input_13);
236
- input_15 = ((input_14.tag === 1) ? (new FSharpResult$2(1, [input_14.fields[0]])) : (new FSharpResult$2(0, [input_14.fields[0]])));
237
- }
238
- else {
239
- input_15 = (new FSharpResult$2(0, [undefined]));
240
- }
241
- if (input_15.tag === 1) {
242
- return new FSharpResult$2(1, [input_15.fields[0]]);
243
- }
244
- else {
245
- return new FSharpResult$2(0, [[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]]]);
246
- }
247
- }
248
- }
249
- }
250
- }
251
- }
252
- }
253
- }
254
-
255
- export function PartialProfileUpdateDtoModule_toProfile(metadata, profileState, accountId, externalId, updateDto) {
256
- let _arg;
257
- const input = PartialProfileUpdateDtoModule_toDomainInternal(updateDto);
258
- if (input.tag === 1) {
259
- return new FSharpResult$2(1, [input.fields[0]]);
260
- }
261
- else {
262
- return new FSharpResult$2(0, [(_arg = input.fields[0], profileState(new PartialProfileDetail(metadata, accountId, _arg[0], _arg[1], _arg[2], externalId, _arg[3], _arg[4], _arg[5], _arg[6])))]);
263
- }
264
- }
265
-
266
- export function PartialProfileUpdateDtoModule_toUpdateCommand(metadata, domainMetadata, timestamp, updateDto) {
267
- let _arg, details, copyOfStruct;
268
- const input = PartialProfileUpdateDtoModule_toDomainInternal(updateDto);
269
- if (input.tag === 1) {
270
- return new FSharpResult$2(1, [input.fields[0]]);
271
- }
272
- else {
273
- return new FSharpResult$2(0, [(_arg = input.fields[0], (details = (new PartialProfileUpdateDetails(_arg[0], _arg[1], _arg[2], _arg[3], _arg[4], _arg[5], _arg[6])), new Command$1(new CommandId((copyOfStruct = newGuid(), copyOfStruct)), new ProfileCommand(2, [details]), CommandMetadata_withTimestamp(timestamp, MetadataModule_toCommandMetadata(metadata, domainMetadata)))))]);
274
- }
275
- }
276
-
277
- export class ProfileWriteDto extends Record {
278
- constructor(Name, ExternalId, Title, Gender, Email, MobilePhone, DateOfBirth, Address) {
279
- super();
280
- this.Name = Name;
281
- this.ExternalId = ExternalId;
282
- this.Title = Title;
283
- this.Gender = Gender;
284
- this.Email = Email;
285
- this.MobilePhone = MobilePhone;
286
- this.DateOfBirth = DateOfBirth;
287
- this.Address = Address;
288
- }
289
- }
290
-
291
- export function ProfileWriteDto_$reflection() {
292
- return record_type("Dto.Api.External.WriteV2.ProfileWriteDto", [], ProfileWriteDto, () => [["Name", Name_$reflection()], ["ExternalId", option_type(string_type)], ["Title", string_type], ["Gender", string_type], ["Email", string_type], ["MobilePhone", string_type], ["DateOfBirth", string_type], ["Address", Address_$reflection()]]);
293
- }
294
-
295
- export function ProfileWriteDtoModule_toDomainInternal(p) {
296
- const input_17 = Name_toDomain(p.Name);
297
- if (input_17.tag === 1) {
298
- return new FSharpResult$2(1, [input_17.fields[0]]);
299
- }
300
- else {
301
- const input_15 = Email_toDomain(p.Email);
302
- if (input_15.tag === 1) {
303
- return new FSharpResult$2(1, [input_15.fields[0]]);
304
- }
305
- else {
306
- const input_13 = MobilePhone_toDomain(p.MobilePhone);
307
- if (input_13.tag === 1) {
308
- return new FSharpResult$2(1, [input_13.fields[0]]);
309
- }
310
- else {
311
- let input_11;
312
- const input_1 = p.ExternalId;
313
- if (input_1 != null) {
314
- const input_2 = ExternalId_toDomain(input_1);
315
- input_11 = ((input_2.tag === 1) ? (new FSharpResult$2(1, [input_2.fields[0]])) : (new FSharpResult$2(0, [input_2.fields[0]])));
316
- }
317
- else {
318
- input_11 = (new FSharpResult$2(0, [undefined]));
319
- }
320
- if (input_11.tag === 1) {
321
- return new FSharpResult$2(1, [input_11.fields[0]]);
322
- }
323
- else {
324
- const input_9 = Title_toDomain(p.Title);
325
- if (input_9.tag === 1) {
326
- return new FSharpResult$2(1, [input_9.fields[0]]);
327
- }
328
- else {
329
- const input_7 = Gender_toDomain(p.Gender);
330
- if (input_7.tag === 1) {
331
- return new FSharpResult$2(1, [input_7.fields[0]]);
332
- }
333
- else {
334
- const input_5 = DateOfBirth_toDomain(p.DateOfBirth);
335
- if (input_5.tag === 1) {
336
- return new FSharpResult$2(1, [input_5.fields[0]]);
337
- }
338
- else {
339
- const input_3 = Address_toDomain(p.Address);
340
- if (input_3.tag === 1) {
341
- return new FSharpResult$2(1, [input_3.fields[0]]);
342
- }
343
- else {
344
- return new FSharpResult$2(0, [[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]]]);
345
- }
346
- }
347
- }
348
- }
349
- }
350
- }
351
- }
352
- }
353
- }
354
-
355
- export function ProfileWriteDtoModule_toCreateCommand(accountId, metadata, p) {
356
- let _arg, details, copyOfStruct;
357
- const input = ProfileWriteDtoModule_toDomainInternal(p);
358
- if (input.tag === 1) {
359
- return new FSharpResult$2(1, [input.fields[0]]);
360
- }
361
- else {
362
- return new FSharpResult$2(0, [(_arg = input.fields[0], (details = (new FullProfileCreationDetails(accountId, _arg[0], _arg[4], _arg[5], _arg[1], _arg[2], _arg[6], _arg[7], _arg[3])), new Command$1(new CommandId((copyOfStruct = newGuid(), copyOfStruct)), new ProfileCommand(0, [details]), metadata)))]);
363
- }
364
- }
365
-
366
- export class ProfileUpdateDto extends Record {
367
- constructor(Name, Title, Gender, Email, MobilePhone, DateOfBirth, Address) {
368
- super();
369
- this.Name = Name;
370
- this.Title = Title;
371
- this.Gender = Gender;
372
- this.Email = Email;
373
- this.MobilePhone = MobilePhone;
374
- this.DateOfBirth = DateOfBirth;
375
- this.Address = Address;
376
- }
377
- }
378
-
379
- export function ProfileUpdateDto_$reflection() {
380
- return record_type("Dto.Api.External.WriteV2.ProfileUpdateDto", [], ProfileUpdateDto, () => [["Name", Name_$reflection()], ["Title", string_type], ["Gender", string_type], ["Email", string_type], ["MobilePhone", string_type], ["DateOfBirth", string_type], ["Address", Address_$reflection()]]);
381
- }
382
-
383
- function ProfileUpdateDtoModule_toDomainInternal(updateDto) {
384
- const input_12 = Name_toDomain(updateDto.Name);
385
- if (input_12.tag === 1) {
386
- return new FSharpResult$2(1, [input_12.fields[0]]);
387
- }
388
- else {
389
- const input_10 = Email_toDomain(updateDto.Email);
390
- if (input_10.tag === 1) {
391
- return new FSharpResult$2(1, [input_10.fields[0]]);
392
- }
393
- else {
394
- const input_8 = MobilePhone_toDomain(updateDto.MobilePhone);
395
- if (input_8.tag === 1) {
396
- return new FSharpResult$2(1, [input_8.fields[0]]);
397
- }
398
- else {
399
- const input_6 = Title_toDomain(updateDto.Title);
400
- if (input_6.tag === 1) {
401
- return new FSharpResult$2(1, [input_6.fields[0]]);
402
- }
403
- else {
404
- const input_4 = Gender_toDomain(updateDto.Gender);
405
- if (input_4.tag === 1) {
406
- return new FSharpResult$2(1, [input_4.fields[0]]);
407
- }
408
- else {
409
- const input_2 = DateOfBirth_toDomain(updateDto.DateOfBirth);
410
- if (input_2.tag === 1) {
411
- return new FSharpResult$2(1, [input_2.fields[0]]);
412
- }
413
- else {
414
- const input = Address_toDomain(updateDto.Address);
415
- if (input.tag === 1) {
416
- return new FSharpResult$2(1, [input.fields[0]]);
417
- }
418
- else {
419
- return new FSharpResult$2(0, [[input_12.fields[0], input_10.fields[0], input_8.fields[0], input_6.fields[0], input_4.fields[0], input_2.fields[0], input.fields[0]]]);
420
- }
421
- }
422
- }
423
- }
424
- }
425
- }
426
- }
427
- }
428
-
429
- export function ProfileUpdateDtoModule_toProfileDetail(accountId, metadata, externalId, emergencyContacts, profileUpdateDto) {
430
- let _arg;
431
- const input = ProfileUpdateDtoModule_toDomainInternal(profileUpdateDto);
432
- if (input.tag === 1) {
433
- return new FSharpResult$2(1, [input.fields[0]]);
434
- }
435
- else {
436
- return new FSharpResult$2(0, [(_arg = input.fields[0], new ProfileDetail(metadata, accountId, _arg[0], _arg[3], _arg[4], _arg[1], _arg[2], _arg[5], _arg[6], externalId, emergencyContacts))]);
437
- }
438
- }
439
-
@@ -1,38 +0,0 @@
1
- import { Record } from "../../../../fable_modules/fable-library-js.4.20.0/Types.js";
2
- import { record_type, int32_type, option_type, string_type } from "../../../../fable_modules/fable-library-js.4.20.0/Reflection.js";
3
- import { Name, Name_$reflection } from "../../Primitives.jsx";
4
-
5
- export class ProfileDto extends Record {
6
- constructor(State, Name, Email, MobilePhone, Version) {
7
- super();
8
- this.State = State;
9
- this.Name = Name;
10
- this.Email = Email;
11
- this.MobilePhone = MobilePhone;
12
- this.Version = (Version | 0);
13
- }
14
- }
15
-
16
- export function ProfileDto_$reflection() {
17
- return record_type("Dto.Api.FlareAdminShell.Read.ProfileDto", [], ProfileDto, () => [["State", string_type], ["Name", Name_$reflection()], ["Email", string_type], ["MobilePhone", option_type(string_type)], ["Version", int32_type]]);
18
- }
19
-
20
- export function fromProfileAggregate(profile) {
21
- switch (profile.tag) {
22
- case 1:
23
- return new ProfileDto("Inactive", profile.fields[0].Name, profile.fields[0].Email, profile.fields[0].MobilePhone, profile.fields[0].Metadata.Version);
24
- case 3:
25
- return new ProfileDto("Partial", profile.fields[0].Name, profile.fields[0].Email, profile.fields[0].MobilePhone, profile.fields[0].Metadata.Version);
26
- case 4:
27
- return new ProfileDto("InactivePartial", profile.fields[0].Name, profile.fields[0].Email, profile.fields[0].MobilePhone, profile.fields[0].Metadata.Version);
28
- case 5:
29
- return new ProfileDto("Archived", profile.fields[0].Name, profile.fields[0].Email, profile.fields[0].MobilePhone, profile.fields[0].Metadata.Version);
30
- case 6:
31
- return new ProfileDto("ArchivedPartial", profile.fields[0].Name, profile.fields[0].Email, profile.fields[0].MobilePhone, profile.fields[0].Metadata.Version);
32
- case 2:
33
- return new ProfileDto("Purged", new Name("", undefined, ""), "", undefined, profile.fields[0].Metadata.Version);
34
- default:
35
- return new ProfileDto("Active", profile.fields[0].Name, profile.fields[0].Email, profile.fields[0].MobilePhone, profile.fields[0].Metadata.Version);
36
- }
37
- }
38
-