@flarehr/superhero-basic-profile 0.1.2214 → 0.1.2217
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.jsx +4 -0
- package/dist/Basic.Profile.Domain/AnalyticsEvent.jsx +102 -0
- package/dist/Basic.Profile.Domain/Audit.jsx +149 -0
- package/dist/Basic.Profile.Domain/Commands.jsx +68 -0
- package/dist/Basic.Profile.Domain/CommonTypes.jsx +194 -0
- package/dist/Basic.Profile.Domain/Config/Api/Admin/Read.jsx +58 -0
- package/dist/Basic.Profile.Domain/Config/Api/Admin/Write.jsx +23 -0
- package/dist/Basic.Profile.Domain/Config/Api/FlareAdminShell/Read.jsx +35 -0
- package/dist/Basic.Profile.Domain/Config/Commands.jsx +72 -0
- package/dist/Basic.Profile.Domain/Config/ConfigCommandHandler.jsx +197 -0
- package/dist/Basic.Profile.Domain/Config/Dto.jsx +181 -0
- package/dist/Basic.Profile.Domain/Config/Types.jsx +152 -0
- package/dist/Basic.Profile.Domain/DateTimeProvider.jsx +23 -0
- package/dist/Basic.Profile.Domain/DomainAggregates.jsx +801 -0
- package/dist/Basic.Profile.Domain/DomainPrimitives.jsx +426 -0
- package/dist/Basic.Profile.Domain/Dto/Aggregates.jsx +564 -0
- package/dist/Basic.Profile.Domain/Dto/AnalyticsEvent.jsx +157 -0
- package/dist/Basic.Profile.Domain/Dto/Api/Backend/Common.jsx +102 -0
- package/dist/Basic.Profile.Domain/Dto/Api/Backend/Read.jsx +85 -0
- package/dist/Basic.Profile.Domain/Dto/Api/Backend/Write.jsx +16 -0
- package/dist/Basic.Profile.Domain/Dto/Api/Common.jsx +427 -0
- package/dist/Basic.Profile.Domain/Dto/Api/External/Read.jsx +118 -0
- package/dist/Basic.Profile.Domain/Dto/Api/External/ReadV2.jsx +6 -0
- package/dist/Basic.Profile.Domain/Dto/Api/External/Write.jsx +184 -0
- package/dist/Basic.Profile.Domain/Dto/Api/External/WriteV2.jsx +439 -0
- package/dist/Basic.Profile.Domain/Dto/Api/FlareAdminShell/Read.jsx +38 -0
- package/dist/Basic.Profile.Domain/Dto/Api/FlareAdminShell/Write.jsx +199 -0
- package/dist/Basic.Profile.Domain/Dto/Api/Internal/Read.jsx +125 -0
- package/dist/Basic.Profile.Domain/Dto/Audit.jsx +121 -0
- package/dist/Basic.Profile.Domain/Dto/Commands.jsx +256 -0
- package/dist/Basic.Profile.Domain/Dto/Common.jsx +84 -0
- package/dist/Basic.Profile.Domain/Dto/Events.jsx +220 -0
- package/dist/Basic.Profile.Domain/Dto/Primitives.jsx +580 -0
- package/dist/Basic.Profile.Domain/Dto/ProfileCreationModels.jsx +324 -0
- package/dist/Basic.Profile.Domain/Dto/Validation.jsx +229 -0
- package/dist/Basic.Profile.Domain/Events.jsx +64 -0
- package/dist/Basic.Profile.Domain/Import/Api/InternalApi/Read.jsx +140 -0
- package/dist/Basic.Profile.Domain/Import/Api/InternalApi/Validation.jsx +499 -0
- package/dist/Basic.Profile.Domain/Import/Api/InternalApi/Write.jsx +51 -0
- package/dist/Basic.Profile.Domain/Import/Api/Read.jsx +154 -0
- package/dist/Basic.Profile.Domain/Import/CommonTypes.jsx +187 -0
- package/dist/Basic.Profile.Domain/Import/Dto.jsx +475 -0
- package/dist/Basic.Profile.Domain/Import/ImportCommandHandler.jsx +531 -0
- package/dist/Basic.Profile.Domain/Import/Types.jsx +405 -0
- package/dist/Basic.Profile.Domain/JwtPayload.jsx +44 -0
- package/dist/Basic.Profile.Domain/Metadata.jsx +257 -0
- package/dist/Basic.Profile.Domain/ProfileCommandHandler.jsx +261 -0
- package/dist/Basic.Profile.Domain/ProfileModels.jsx +59 -0
- package/dist/Basic.Profile.Domain/Utils.jsx +372 -0
- package/dist/Common/PreactCustomElement.jsx +8 -0
- package/dist/Common/Resources.jsx +20 -0
- package/dist/Common/Tailwind.jsx +8 -0
- package/dist/Common/Utils.jsx +18 -0
- package/dist/Directory/App.jsx +192 -0
- package/dist/Directory/BackendServices/Common.jsx +115 -0
- package/dist/Directory/BackendServices/ConfigService.jsx +168 -0
- package/dist/Directory/BackendServices/ImportService.jsx +137 -0
- package/dist/Directory/Common.jsx +93 -0
- package/dist/Directory/Config/Components.jsx +173 -0
- package/dist/Directory/Config/Types.jsx +187 -0
- package/dist/Directory/PastImports/PastImports.jsx +81 -0
- package/dist/Directory/ProfileImport/ProfileImport.jsx +284 -0
- package/dist/Directory/ProfileImport/Types.jsx +91 -0
- package/dist/Directory/TabNav.jsx +24 -0
- package/dist/Directory/Types.jsx +101 -0
- package/dist/Directory/User.jsx +117 -0
- package/dist/HeadlessUI/Dialog.jsx +66 -0
- package/dist/HeadlessUI/ModalDialog.jsx +74 -0
- package/dist/HeadlessUI/Switch.jsx +66 -0
- package/dist/HeadlessUI/Transition.jsx +66 -0
- package/package.json +1 -1
- package/dist/assets/delete.dcc7b157.svg +0 -5
- package/dist/assets/dialog-warning.cc77f3ba.svg +0 -5
- package/dist/assets/pencil.05fe6be6.svg +0 -5
- package/dist/index.html +0 -20
- package/dist/superhero-basic-profile.js +0 -50
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { ProfileIdModule_value } from "../DomainPrimitives.jsx";
|
|
2
|
+
import { Union, Record } from "../../fable_modules/fable-library-js.4.20.0/Types.js";
|
|
3
|
+
import { union_type, class_type, getUnionFields, name, record_type, int32_type, option_type, string_type } from "../../fable_modules/fable-library-js.4.20.0/Reflection.js";
|
|
4
|
+
import { StreamIdModule_value } from "../Metadata.jsx";
|
|
5
|
+
import { map } from "../../fable_modules/fable-library-js.4.20.0/Option.js";
|
|
6
|
+
import { Gender_ofDomain, Title_ofDomain, AccountId_ofDomain } from "./Primitives.jsx";
|
|
7
|
+
import { ProfileState_$reflection } from "../AnalyticsEvent.jsx";
|
|
8
|
+
import { toString } from "../../fable_modules/fable-library-js.4.20.0/Guid.js";
|
|
9
|
+
import { EventIdModule_value } from "../Events.jsx";
|
|
10
|
+
|
|
11
|
+
export function getMethod(domainMetadata) {
|
|
12
|
+
const matchValue = domainMetadata.Source;
|
|
13
|
+
switch (matchValue.tag) {
|
|
14
|
+
case 1:
|
|
15
|
+
return "internal API";
|
|
16
|
+
case 2:
|
|
17
|
+
return "self";
|
|
18
|
+
case 3:
|
|
19
|
+
return "employer admin";
|
|
20
|
+
case 4:
|
|
21
|
+
return "superhero";
|
|
22
|
+
case 5:
|
|
23
|
+
return "internal";
|
|
24
|
+
default:
|
|
25
|
+
return "partner";
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function tryGetAdminId(domainMetadata) {
|
|
30
|
+
if (domainMetadata != null) {
|
|
31
|
+
const matchValue = domainMetadata.Source;
|
|
32
|
+
if (matchValue.tag === 3) {
|
|
33
|
+
return ProfileIdModule_value(matchValue.fields[0].ProfileId);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function ProfileTypeDto_ofDomain(_arg) {
|
|
45
|
+
if (_arg.tag === 1) {
|
|
46
|
+
return "Partial";
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
return "Full";
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export class MixpanelProfilePropertiesDto extends Record {
|
|
54
|
+
constructor(StreamId, AccountId, ProfileType, Title, Gender, YearOfBirth, City, State, Postcode, CountryCode, ProfileState) {
|
|
55
|
+
super();
|
|
56
|
+
this.StreamId = StreamId;
|
|
57
|
+
this.AccountId = AccountId;
|
|
58
|
+
this.ProfileType = ProfileType;
|
|
59
|
+
this.Title = Title;
|
|
60
|
+
this.Gender = Gender;
|
|
61
|
+
this.YearOfBirth = YearOfBirth;
|
|
62
|
+
this.City = City;
|
|
63
|
+
this.State = State;
|
|
64
|
+
this.Postcode = Postcode;
|
|
65
|
+
this.CountryCode = CountryCode;
|
|
66
|
+
this.ProfileState = ProfileState;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function MixpanelProfilePropertiesDto_$reflection() {
|
|
71
|
+
return record_type("Dto.AnalyticsEvent.MixpanelProfilePropertiesDto", [], MixpanelProfilePropertiesDto, () => [["StreamId", string_type], ["AccountId", option_type(string_type)], ["ProfileType", option_type(string_type)], ["Title", option_type(string_type)], ["Gender", option_type(string_type)], ["YearOfBirth", option_type(int32_type)], ["City", option_type(string_type)], ["State", option_type(string_type)], ["Postcode", option_type(string_type)], ["CountryCode", option_type(string_type)], ["ProfileState", option_type(string_type)]]);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function MixpanelProfilePropertiesDtoModule_ofDomain(payload) {
|
|
75
|
+
return new MixpanelProfilePropertiesDto(StreamIdModule_value(payload.StreamId), map(AccountId_ofDomain, payload.AccountId), map(ProfileTypeDto_ofDomain, payload.ProfileType), map(Title_ofDomain, payload.Title), map(Gender_ofDomain, payload.Gender), payload.YearOfBirth, payload.City, payload.State, payload.Postcode, payload.CountryCode, map((x) => name(getUnionFields(x, ProfileState_$reflection())[0]), payload.ProfileState));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export class AnalyticsEventDataDto extends Record {
|
|
79
|
+
constructor(StreamId, Timestamp, EventId, Method, AdminId) {
|
|
80
|
+
super();
|
|
81
|
+
this.StreamId = StreamId;
|
|
82
|
+
this.Timestamp = Timestamp;
|
|
83
|
+
this.EventId = EventId;
|
|
84
|
+
this.Method = Method;
|
|
85
|
+
this.AdminId = AdminId;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function AnalyticsEventDataDto_$reflection() {
|
|
90
|
+
return record_type("Dto.AnalyticsEvent.AnalyticsEventDataDto", [], AnalyticsEventDataDto, () => [["StreamId", string_type], ["Timestamp", class_type("System.DateTime")], ["EventId", string_type], ["Method", option_type(string_type)], ["AdminId", option_type(string_type)]]);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function AnalyticsEventDataDtoModule_ofDomain(data) {
|
|
94
|
+
return new AnalyticsEventDataDto(StreamIdModule_value(data.StreamId), data.Timestamp, toString(EventIdModule_value(data.EventId), "D").toLocaleUpperCase(), map(getMethod, data.DomainMetadata), tryGetAdminId(data.DomainMetadata));
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export class AnalyticsStateChangedEventDataDto extends Record {
|
|
98
|
+
constructor(StreamId, Timestamp, EventId, From, To, Method, AdminId) {
|
|
99
|
+
super();
|
|
100
|
+
this.StreamId = StreamId;
|
|
101
|
+
this.Timestamp = Timestamp;
|
|
102
|
+
this.EventId = EventId;
|
|
103
|
+
this.From = From;
|
|
104
|
+
this.To = To;
|
|
105
|
+
this.Method = Method;
|
|
106
|
+
this.AdminId = AdminId;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function AnalyticsStateChangedEventDataDto_$reflection() {
|
|
111
|
+
return record_type("Dto.AnalyticsEvent.AnalyticsStateChangedEventDataDto", [], AnalyticsStateChangedEventDataDto, () => [["StreamId", string_type], ["Timestamp", class_type("System.DateTime")], ["EventId", string_type], ["From", option_type(string_type)], ["To", option_type(string_type)], ["Method", option_type(string_type)], ["AdminId", option_type(string_type)]]);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export function AnalyticsStateChangedEventDataDtoModule_ofDomain(data) {
|
|
115
|
+
return new AnalyticsStateChangedEventDataDto(StreamIdModule_value(data.StreamId), data.Timestamp, toString(EventIdModule_value(data.EventId), "D").toLocaleUpperCase(), map((x) => name(getUnionFields(x, ProfileState_$reflection())[0]), data.From), map((x_2) => name(getUnionFields(x_2, ProfileState_$reflection())[0]), data.To), map(getMethod, data.DomainMetadata), tryGetAdminId(data.DomainMetadata));
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export class AnalyticsEventDto extends Union {
|
|
119
|
+
constructor(tag, fields) {
|
|
120
|
+
super();
|
|
121
|
+
this.tag = tag;
|
|
122
|
+
this.fields = fields;
|
|
123
|
+
}
|
|
124
|
+
cases() {
|
|
125
|
+
return ["Created", "Updated", "PartialCreated", "PartialUpdated", "PartialPromoted", "Restored", "Archived", "Activated", "Deactivated", "Purged"];
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export function AnalyticsEventDto_$reflection() {
|
|
130
|
+
return union_type("Dto.AnalyticsEvent.AnalyticsEventDto", [], AnalyticsEventDto, () => [[["Item", AnalyticsEventDataDto_$reflection()]], [["Item", AnalyticsEventDataDto_$reflection()]], [["Item", AnalyticsEventDataDto_$reflection()]], [["Item", AnalyticsEventDataDto_$reflection()]], [["Item", AnalyticsEventDataDto_$reflection()]], [["Item", AnalyticsStateChangedEventDataDto_$reflection()]], [["Item", AnalyticsStateChangedEventDataDto_$reflection()]], [["Item", AnalyticsStateChangedEventDataDto_$reflection()]], [["Item", AnalyticsStateChangedEventDataDto_$reflection()]], [["Item", AnalyticsStateChangedEventDataDto_$reflection()]]]);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export function AnalyticsEventType_ofDomain(event) {
|
|
134
|
+
switch (event.tag) {
|
|
135
|
+
case 1:
|
|
136
|
+
return new AnalyticsEventDto(1, [AnalyticsEventDataDtoModule_ofDomain(event.fields[0])]);
|
|
137
|
+
case 2:
|
|
138
|
+
return new AnalyticsEventDto(2, [AnalyticsEventDataDtoModule_ofDomain(event.fields[0])]);
|
|
139
|
+
case 3:
|
|
140
|
+
return new AnalyticsEventDto(3, [AnalyticsEventDataDtoModule_ofDomain(event.fields[0])]);
|
|
141
|
+
case 4:
|
|
142
|
+
return new AnalyticsEventDto(4, [AnalyticsEventDataDtoModule_ofDomain(event.fields[0])]);
|
|
143
|
+
case 5:
|
|
144
|
+
return new AnalyticsEventDto(5, [AnalyticsStateChangedEventDataDtoModule_ofDomain(event.fields[0])]);
|
|
145
|
+
case 7:
|
|
146
|
+
return new AnalyticsEventDto(7, [AnalyticsStateChangedEventDataDtoModule_ofDomain(event.fields[0])]);
|
|
147
|
+
case 8:
|
|
148
|
+
return new AnalyticsEventDto(8, [AnalyticsStateChangedEventDataDtoModule_ofDomain(event.fields[0])]);
|
|
149
|
+
case 6:
|
|
150
|
+
return new AnalyticsEventDto(6, [AnalyticsStateChangedEventDataDtoModule_ofDomain(event.fields[0])]);
|
|
151
|
+
case 9:
|
|
152
|
+
return new AnalyticsEventDto(9, [AnalyticsStateChangedEventDataDtoModule_ofDomain(event.fields[0])]);
|
|
153
|
+
default:
|
|
154
|
+
return new AnalyticsEventDto(0, [AnalyticsEventDataDtoModule_ofDomain(event.fields[0])]);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { replace } from "../../../../fable_modules/fable-library-js.4.20.0/RegExp.js";
|
|
2
|
+
import { Record } from "../../../../fable_modules/fable-library-js.4.20.0/Types.js";
|
|
3
|
+
import { EmergencyContactDto_$reflection, EmergencyContactDtoModule_ofDomain, Address, AddressModule_ofDomain, DateOfBirth_ofDomain, MobilePhone_ofDomain, Email_ofDomain, Gender_ofDomain, Title_ofDomain, Name, NameModule_ofDomain, Address_$reflection, Name_$reflection } from "../../Primitives.jsx";
|
|
4
|
+
import { list_type, record_type, string_type } from "../../../../fable_modules/fable-library-js.4.20.0/Reflection.js";
|
|
5
|
+
import { EmergencyContact_toDomain, Address_toDomain, DateOfBirth_toDomain, MobilePhone_toDomain, Email_toDomain, Gender_toDomain, Title_toDomain, Name_toDomain } from "../Common.jsx";
|
|
6
|
+
import { FSharpResult$2 } from "../../../../fable_modules/fable-library-js.4.20.0/Result.js";
|
|
7
|
+
import { ProfileDetail } from "../../../DomainAggregates.jsx";
|
|
8
|
+
import { map } from "../../../../fable_modules/fable-library-js.4.20.0/List.js";
|
|
9
|
+
import { Auto_generateBoxedEncoder_437914C6, toString } from "../../../../fable_modules/Thoth.Json.10.2.0/Encode.fs.js";
|
|
10
|
+
import { CaseStrategy } from "../../../../fable_modules/Thoth.Json.10.2.0/Types.fs.js";
|
|
11
|
+
import { traverseResultM } from "../../../../fable_modules/FsToolkit.ErrorHandling.4.16.0/List.fs.js";
|
|
12
|
+
import { Auto_generateBoxedDecoder_Z6670B51, fromString } from "../../../../fable_modules/Thoth.Json.10.2.0/Decode.fs.js";
|
|
13
|
+
import { uncurry2 } from "../../../../fable_modules/fable-library-js.4.20.0/Util.js";
|
|
14
|
+
|
|
15
|
+
export function cleanString(str) {
|
|
16
|
+
return replace(str.trim(), "[\\n\\r]", "");
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export class FullProfileDto extends Record {
|
|
20
|
+
constructor(Name, Title, Gender, Email, MobilePhone, DateOfBirth, Address) {
|
|
21
|
+
super();
|
|
22
|
+
this.Name = Name;
|
|
23
|
+
this.Title = Title;
|
|
24
|
+
this.Gender = Gender;
|
|
25
|
+
this.Email = Email;
|
|
26
|
+
this.MobilePhone = MobilePhone;
|
|
27
|
+
this.DateOfBirth = DateOfBirth;
|
|
28
|
+
this.Address = Address;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function FullProfileDto_$reflection() {
|
|
33
|
+
return record_type("Dto.Api.Backend.Common.FullProfileDto", [], FullProfileDto, () => [["Name", Name_$reflection()], ["Title", string_type], ["Gender", string_type], ["Email", string_type], ["MobilePhone", string_type], ["DateOfBirth", string_type], ["Address", Address_$reflection()]]);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function FullProfileDtoModule_ofDomain(p) {
|
|
37
|
+
let name_1, input_1, address_1, input_3;
|
|
38
|
+
return new FullProfileDto((name_1 = NameModule_ofDomain(p.Name), new Name(cleanString(name_1.FirstName), (input_1 = name_1.MiddleName, (input_1 == null) ? undefined : cleanString(input_1)), cleanString(name_1.LastName))), cleanString(Title_ofDomain(p.Title)), cleanString(Gender_ofDomain(p.Gender)), cleanString(Email_ofDomain(p.Email)), cleanString(MobilePhone_ofDomain(p.MobilePhone)), cleanString(DateOfBirth_ofDomain(p.DateOfBirth)), (address_1 = AddressModule_ofDomain(p.Address), new Address(cleanString(address_1.AddressLine1), (input_3 = address_1.AddressLine2, (input_3 == null) ? undefined : cleanString(input_3)), cleanString(address_1.City), cleanString(address_1.State), cleanString(address_1.Postcode), cleanString(address_1.CountryCode))));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function FullProfileDtoModule_toDomain(p, metadata, accountId, externalId, emergencyContacts) {
|
|
42
|
+
const input_12 = Name_toDomain(p.Name);
|
|
43
|
+
if (input_12.tag === 1) {
|
|
44
|
+
return new FSharpResult$2(1, [input_12.fields[0]]);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
const input_10 = Title_toDomain(p.Title);
|
|
48
|
+
if (input_10.tag === 1) {
|
|
49
|
+
return new FSharpResult$2(1, [input_10.fields[0]]);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
const input_8 = Gender_toDomain(p.Gender);
|
|
53
|
+
if (input_8.tag === 1) {
|
|
54
|
+
return new FSharpResult$2(1, [input_8.fields[0]]);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
const input_6 = Email_toDomain(p.Email);
|
|
58
|
+
if (input_6.tag === 1) {
|
|
59
|
+
return new FSharpResult$2(1, [input_6.fields[0]]);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
const input_4 = MobilePhone_toDomain(p.MobilePhone);
|
|
63
|
+
if (input_4.tag === 1) {
|
|
64
|
+
return new FSharpResult$2(1, [input_4.fields[0]]);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
const input_2 = DateOfBirth_toDomain(p.DateOfBirth);
|
|
68
|
+
if (input_2.tag === 1) {
|
|
69
|
+
return new FSharpResult$2(1, [input_2.fields[0]]);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
const input = Address_toDomain(p.Address);
|
|
73
|
+
if (input.tag === 1) {
|
|
74
|
+
return new FSharpResult$2(1, [input.fields[0]]);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
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)]);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function EmergencyContactsListDtoModule_ofDomain(ec) {
|
|
88
|
+
return map(EmergencyContactDtoModule_ofDomain, ec);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function EmergencyContactsListDtoModule_toJson(ec) {
|
|
92
|
+
return toString(0, Auto_generateBoxedEncoder_437914C6(list_type(EmergencyContactDto_$reflection()), new CaseStrategy(1, []), undefined, undefined)(ec));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function EmergencyContactsListDtoModule_toDomain(ec) {
|
|
96
|
+
return traverseResultM(EmergencyContact_toDomain, ec);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export function EmergencyContactsListDtoModule_ofJson(json) {
|
|
100
|
+
return fromString(uncurry2(Auto_generateBoxedDecoder_Z6670B51(list_type(EmergencyContactDto_$reflection()), new CaseStrategy(1, []), undefined)), json);
|
|
101
|
+
}
|
|
102
|
+
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Union, Record } from "../../../../fable_modules/fable-library-js.4.20.0/Types.js";
|
|
2
|
+
import { Address, AddressModule_ofDomain, DateOfBirth_ofDomain, Gender_ofDomain, Title_ofDomain, MobilePhone_ofDomain, Email_ofDomain, Name, NameModule_ofDomain, Address_$reflection, Name_$reflection } from "../../Primitives.jsx";
|
|
3
|
+
import { union_type, record_type, option_type, string_type } from "../../../../fable_modules/fable-library-js.4.20.0/Reflection.js";
|
|
4
|
+
import { FullProfileDtoModule_ofDomain, FullProfileDto_$reflection, cleanString } from "./Common.jsx";
|
|
5
|
+
import { Auto_generateBoxedEncoder_437914C6, toString } from "../../../../fable_modules/Thoth.Json.10.2.0/Encode.fs.js";
|
|
6
|
+
import { CaseStrategy } from "../../../../fable_modules/Thoth.Json.10.2.0/Types.fs.js";
|
|
7
|
+
import { Auto_generateBoxedDecoder_Z6670B51, fromString } from "../../../../fable_modules/Thoth.Json.10.2.0/Decode.fs.js";
|
|
8
|
+
import { uncurry2 } from "../../../../fable_modules/fable-library-js.4.20.0/Util.js";
|
|
9
|
+
|
|
10
|
+
export class PartialProfileDto extends Record {
|
|
11
|
+
constructor(Name, Email, MobilePhone, Title, Gender, DateOfBirth, Address) {
|
|
12
|
+
super();
|
|
13
|
+
this.Name = Name;
|
|
14
|
+
this.Email = Email;
|
|
15
|
+
this.MobilePhone = MobilePhone;
|
|
16
|
+
this.Title = Title;
|
|
17
|
+
this.Gender = Gender;
|
|
18
|
+
this.DateOfBirth = DateOfBirth;
|
|
19
|
+
this.Address = Address;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function PartialProfileDto_$reflection() {
|
|
24
|
+
return record_type("Dto.Api.Backend.Read.PartialProfileDto", [], PartialProfileDto, () => [["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())]]);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function PartialProfileDtoModule_ofDomain(p) {
|
|
28
|
+
let name_1, input_1, input_5, input_3, input_9, input_7, input_13, input_11, input_17, input_15, input_23, input_19, address_1, input_21;
|
|
29
|
+
return new PartialProfileDto((name_1 = NameModule_ofDomain(p.Name), new Name(cleanString(name_1.FirstName), (input_1 = name_1.MiddleName, (input_1 == null) ? undefined : cleanString(input_1)), cleanString(name_1.LastName))), cleanString(Email_ofDomain(p.Email)), (input_5 = ((input_3 = p.MobilePhone, (input_3 == null) ? undefined : MobilePhone_ofDomain(input_3))), (input_5 == null) ? undefined : cleanString(input_5)), (input_9 = ((input_7 = p.Title, (input_7 == null) ? undefined : Title_ofDomain(input_7))), (input_9 == null) ? undefined : cleanString(input_9)), (input_13 = ((input_11 = p.Gender, (input_11 == null) ? undefined : Gender_ofDomain(input_11))), (input_13 == null) ? undefined : cleanString(input_13)), (input_17 = ((input_15 = p.DateOfBirth, (input_15 == null) ? undefined : DateOfBirth_ofDomain(input_15))), (input_17 == null) ? undefined : cleanString(input_17)), (input_23 = ((input_19 = p.Address, (input_19 == null) ? undefined : AddressModule_ofDomain(input_19))), (input_23 == null) ? undefined : ((address_1 = input_23, new Address(cleanString(address_1.AddressLine1), (input_21 = address_1.AddressLine2, (input_21 == null) ? undefined : cleanString(input_21)), cleanString(address_1.City), cleanString(address_1.State), cleanString(address_1.Postcode), cleanString(address_1.CountryCode))))));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export class ProfileDto extends Union {
|
|
33
|
+
constructor(tag, fields) {
|
|
34
|
+
super();
|
|
35
|
+
this.tag = tag;
|
|
36
|
+
this.fields = fields;
|
|
37
|
+
}
|
|
38
|
+
cases() {
|
|
39
|
+
return ["Full", "Partial"];
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function ProfileDto_$reflection() {
|
|
44
|
+
return union_type("Dto.Api.Backend.Read.ProfileDto", [], ProfileDto, () => [[["Item", FullProfileDto_$reflection()]], [["Item", PartialProfileDto_$reflection()]]]);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function ProfileDtoModule_ofFull(p) {
|
|
48
|
+
return new ProfileDto(0, [FullProfileDtoModule_ofDomain(p)]);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function ProfileDtoModule_ofPartial(p) {
|
|
52
|
+
return new ProfileDto(1, [PartialProfileDtoModule_ofDomain(p)]);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function ProfileDtoModule_toJson(p) {
|
|
56
|
+
return toString(0, Auto_generateBoxedEncoder_437914C6(ProfileDto_$reflection(), new CaseStrategy(1, []), undefined, undefined)(p));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function ProfileDtoModule_ofJson(json) {
|
|
60
|
+
return fromString(uncurry2(Auto_generateBoxedDecoder_Z6670B51(ProfileDto_$reflection(), new CaseStrategy(1, []), undefined)), json);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export class ProfileUpdateStatus extends Union {
|
|
64
|
+
constructor(tag, fields) {
|
|
65
|
+
super();
|
|
66
|
+
this.tag = tag;
|
|
67
|
+
this.fields = fields;
|
|
68
|
+
}
|
|
69
|
+
cases() {
|
|
70
|
+
return ["Success", "EmailNotUnique"];
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function ProfileUpdateStatus_$reflection() {
|
|
75
|
+
return union_type("Dto.Api.Backend.Read.ProfileUpdateStatus", [], ProfileUpdateStatus, () => [[], []]);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function ProfileUpdateStatusModule_toJson(p) {
|
|
79
|
+
return toString(0, Auto_generateBoxedEncoder_437914C6(ProfileUpdateStatus_$reflection(), new CaseStrategy(1, []), undefined, undefined)(p));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function ProfileUpdateStatusModule_ofJson(json) {
|
|
83
|
+
return fromString(uncurry2(Auto_generateBoxedDecoder_Z6670B51(ProfileUpdateStatus_$reflection(), new CaseStrategy(1, []), undefined)), json);
|
|
84
|
+
}
|
|
85
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Auto_generateBoxedDecoder_Z6670B51, fromString } from "../../../../fable_modules/Thoth.Json.10.2.0/Decode.fs.js";
|
|
2
|
+
import { uncurry2 } from "../../../../fable_modules/fable-library-js.4.20.0/Util.js";
|
|
3
|
+
import { FullProfileDtoModule_toDomain, FullProfileDto_$reflection } from "./Common.jsx";
|
|
4
|
+
import { CaseStrategy } from "../../../../fable_modules/Thoth.Json.10.2.0/Types.fs.js";
|
|
5
|
+
import { Auto_generateBoxedEncoder_437914C6, toString } from "../../../../fable_modules/Thoth.Json.10.2.0/Encode.fs.js";
|
|
6
|
+
|
|
7
|
+
export const ProfileDtoModule_ofJson = (s) => fromString(uncurry2(Auto_generateBoxedDecoder_Z6670B51(FullProfileDto_$reflection(), new CaseStrategy(1, []), undefined)), s);
|
|
8
|
+
|
|
9
|
+
export function ProfileDtoModule_toDomain(profileDto, metadata, accountId, externalId, emergencyContacts) {
|
|
10
|
+
return FullProfileDtoModule_toDomain(profileDto, metadata, accountId, externalId, emergencyContacts);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function ProfileDtoModule_toJson(profile) {
|
|
14
|
+
return toString(0, Auto_generateBoxedEncoder_437914C6(FullProfileDto_$reflection(), new CaseStrategy(1, []), undefined, undefined)(profile));
|
|
15
|
+
}
|
|
16
|
+
|