mp-js-api 0.0.4 → 0.0.6

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 (54) hide show
  1. package/dist/api.d.ts +74 -0
  2. package/dist/api.d.ts.map +1 -0
  3. package/dist/api.js +158 -0
  4. package/dist/index.d.ts +51 -48
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +72 -317
  7. package/dist/tables/addresses.d.ts +0 -2
  8. package/dist/tables/addresses.d.ts.map +1 -1
  9. package/dist/tables/addresses.js +0 -58
  10. package/dist/tables/contact-attributes.d.ts +0 -2
  11. package/dist/tables/contact-attributes.d.ts.map +1 -1
  12. package/dist/tables/contact-attributes.js +0 -22
  13. package/dist/tables/contacts.d.ts +0 -2
  14. package/dist/tables/contacts.d.ts.map +1 -1
  15. package/dist/tables/contacts.js +0 -112
  16. package/dist/tables/event-participants.d.ts +0 -2
  17. package/dist/tables/event-participants.d.ts.map +1 -1
  18. package/dist/tables/event-participants.js +0 -50
  19. package/dist/tables/events.d.ts +0 -2
  20. package/dist/tables/events.d.ts.map +1 -1
  21. package/dist/tables/events.js +0 -120
  22. package/dist/tables/form-responses.d.ts +1 -1
  23. package/dist/tables/from-response-answers.d.ts +6 -6
  24. package/dist/tables/from-response-answers.d.ts.map +1 -1
  25. package/dist/tables/group-participants.d.ts +0 -2
  26. package/dist/tables/group-participants.d.ts.map +1 -1
  27. package/dist/tables/group-participants.js +0 -64
  28. package/dist/tables/groups.d.ts +0 -2
  29. package/dist/tables/groups.d.ts.map +1 -1
  30. package/dist/tables/groups.js +0 -106
  31. package/dist/tables/households.d.ts +0 -2
  32. package/dist/tables/households.d.ts.map +1 -1
  33. package/dist/tables/households.js +0 -58
  34. package/dist/tables/participants.d.ts +0 -2
  35. package/dist/tables/participants.d.ts.map +1 -1
  36. package/dist/tables/participants.js +0 -66
  37. package/dist/utils/strings.d.ts +14 -5
  38. package/dist/utils/strings.d.ts.map +1 -1
  39. package/dist/utils/strings.js +28 -15
  40. package/package.json +1 -1
  41. package/src/api.ts +266 -0
  42. package/src/index.ts +197 -435
  43. package/src/tables/addresses.ts +1 -59
  44. package/src/tables/contact-attributes.ts +0 -23
  45. package/src/tables/contacts.ts +0 -118
  46. package/src/tables/event-participants.ts +1 -51
  47. package/src/tables/events.ts +0 -119
  48. package/src/tables/form-responses.ts +1 -1
  49. package/src/tables/from-response-answers.ts +6 -8
  50. package/src/tables/group-participants.ts +55 -119
  51. package/src/tables/groups.ts +1 -107
  52. package/src/tables/households.ts +0 -58
  53. package/src/tables/participants.ts +1 -67
  54. package/src/utils/strings.ts +31 -17
@@ -50,62 +50,4 @@ export interface Address {
50
50
  doNotValidate: boolean;
51
51
  lastGeoCodeAttempt: null | string;
52
52
  country: null | string;
53
- }
54
-
55
- export function mapAddressRecord(addressRecord: AddressRecord): Address {
56
- return {
57
- addressID: addressRecord.Address_ID,
58
- addressLine1: addressRecord.Address_Line_1,
59
- addressLine2: addressRecord.Address_Line_2,
60
- city: addressRecord.City,
61
- stateRegion: addressRecord['State/Region'],
62
- postalCode: addressRecord.Postal_Code,
63
- foreignCountry: addressRecord.Foreign_Country,
64
- countryCode: addressRecord.Country_Code,
65
- carrierRoute: addressRecord.Carrier_Route,
66
- lotNumber: addressRecord.Lot_Number,
67
- deliveryPointCode: addressRecord.Delivery_Point_Code,
68
- deliveryPointCheckDigit: addressRecord.Delivery_Point_Check_Digit,
69
- latitude: addressRecord.Latitude,
70
- longitude: addressRecord.Longitude,
71
- altitude: addressRecord.Altitude,
72
- timeZone: addressRecord.Time_Zone,
73
- barCode: addressRecord.Bar_Code,
74
- areaCode: addressRecord.Area_Code,
75
- lastValidationAttempt: addressRecord.Last_Validation_Attempt,
76
- county: addressRecord.County,
77
- validated: addressRecord.Validated,
78
- doNotValidate: addressRecord.Do_Not_Validate,
79
- lastGeoCodeAttempt: addressRecord.Last_GeoCode_Attempt,
80
- country: addressRecord.Country,
81
- };
82
- }
83
-
84
- export function mapAddressToAddressRecord(address: Address): AddressRecord {
85
- return {
86
- Address_ID: address.addressID,
87
- Address_Line_1: address.addressLine1,
88
- Address_Line_2: address.addressLine2,
89
- City: address.city,
90
- ['State/Region']: address.stateRegion,
91
- Postal_Code: address.postalCode,
92
- Foreign_Country: address.foreignCountry,
93
- Country_Code: address.countryCode,
94
- Carrier_Route: address.carrierRoute,
95
- Lot_Number: address.lotNumber,
96
- Delivery_Point_Code: address.deliveryPointCode,
97
- Delivery_Point_Check_Digit: address.deliveryPointCheckDigit,
98
- Latitude: address.latitude,
99
- Longitude: address.longitude,
100
- Altitude: address.altitude,
101
- Time_Zone: address.timeZone,
102
- Bar_Code: address.barCode,
103
- Area_Code: address.areaCode,
104
- Last_Validation_Attempt: address.lastValidationAttempt,
105
- County: address.county,
106
- Validated: address.validated,
107
- Do_Not_Validate: address.doNotValidate,
108
- Last_GeoCode_Attempt: address.lastGeoCodeAttempt,
109
- Country: address.country,
110
- };
111
- }
53
+ }
@@ -15,26 +15,3 @@ export interface ContactAttribute {
15
15
  endDate?: string | null;
16
16
  notes?: string | null;
17
17
  }
18
-
19
-
20
- export function mapContactAttributeRecord(originalObject: ContactAttributeRecord): ContactAttribute {
21
- return {
22
- contactAttributeID: originalObject.Contact_Attribute_ID,
23
- contactID: originalObject.Contact_ID,
24
- attributeID: originalObject.Attribute_ID,
25
- startDate: originalObject.Start_Date,
26
- endDate: originalObject.End_Date,
27
- notes: originalObject.Notes
28
- };
29
- }
30
-
31
- export function mapContactAttributeToContactAttributeRecord(contactAttribute: ContactAttribute): ContactAttributeRecord {
32
- return {
33
- Contact_Attribute_ID: contactAttribute.contactAttributeID,
34
- Contact_ID: contactAttribute.contactID,
35
- Attribute_ID: contactAttribute.attributeID,
36
- Start_Date: contactAttribute.startDate,
37
- End_Date: contactAttribute.endDate,
38
- Notes: contactAttribute.notes
39
- };
40
- }
@@ -103,121 +103,3 @@ export interface Contact {
103
103
  otherInformation: unknown | null;
104
104
  communicationPreferences: unknown | null;
105
105
  }
106
-
107
- export const mapContactRecord = (record: ContactRecord): Contact => ({
108
- contactID: record.Contact_ID,
109
- company: record.Company,
110
- companyName: record.Company_Name,
111
- displayName: record.Display_Name,
112
- prefixID: record.Prefix_ID,
113
- firstName: record.First_Name,
114
- middleName: record.Middle_Name,
115
- lastName: record.Last_Name,
116
- suffixID: record.Suffix_ID,
117
- nickname: record.Nickname,
118
- dateOfBirth: record.Date_of_Birth,
119
- genderID: record.Gender_ID,
120
- maritalStatusID: record.Marital_Status_ID,
121
- contactStatusID: record.Contact_Status_ID,
122
- householdID: record.Household_ID,
123
- householdPositionID: record.Household_Position_ID,
124
- anniversaryDate: record.Anniversary_Date,
125
- dateOfDeath: record.Date_of_Death,
126
- participantRecord: record.Participant_Record,
127
- donorRecord: record.Donor_Record,
128
- emailAddress: record.Email_Address,
129
- mobilePhone: record.Mobile_Phone,
130
- companyPhone: record.Company_Phone,
131
- pagerPhone: record.Pager_Phone,
132
- faxPhone: record.Fax_Phone,
133
- facebookAccount: record.Facebook_Account,
134
- twitterAccount: record.Twitter_Account,
135
- webPage: record.Web_Page,
136
- industryID: record.Industry_ID,
137
- occupationID: record.Occupation_ID,
138
- hsGraduationYear: record.HS_Graduation_Year,
139
- bulkEmailOptOut: record.Bulk_Email_Opt_Out,
140
- emailUnlisted: record.Email_Unlisted,
141
- doNotText: record.Do_Not_Text,
142
- mobilePhoneUnlisted: record.Mobile_Phone_Unlisted,
143
- removeFromDirectory: record.Remove_From_Directory,
144
- userAccount: record.User_Account,
145
- idCard: record.ID_Card,
146
- contactGUID: record.Contact_GUID,
147
- _contactSetupDate: record._Contact_Setup_Date,
148
- occupationName: record.Occupation_Name,
149
- emailVerified: record.Email_Verified,
150
- mobilePhoneVerified: record.Mobile_Phone_Verified,
151
- maidenName: record.Maiden_Name,
152
-
153
- professionalInformation: record.Professional_Information,
154
- contactMethods: record.Contact_Methods,
155
- currentSchool: record.Current_School,
156
- otherInformation: record.Other_Information,
157
- communicationPreferences: record.Communication_Preferences,
158
- });
159
-
160
- export const mapContactToContactRecord = <
161
- T extends Contact | Partial<Contact> = Contact
162
- >(
163
- contact: Contact | Partial<Contact>
164
- ): T extends Contact ? ContactRecord : Partial<ContactRecord> => {
165
- const mappings = {
166
- contactID: 'Contact_ID',
167
- company: 'Company',
168
- companyName: 'Company_Name',
169
- displayName: 'Display_Name',
170
- prefixID: 'Prefix_ID',
171
- firstName: 'First_Name',
172
- middleName: 'Middle_Name',
173
- lastName: 'Last_Name',
174
- suffixID: 'Suffix_ID',
175
- nickname: 'Nickname',
176
- dateOfBirth: 'Date_of_Birth',
177
- genderID: 'Gender_ID',
178
- maritalStatusID: 'Marital_Status_ID',
179
- contactStatusID: 'Contact_Status_ID',
180
- householdID: 'Household_ID',
181
- householdPositionID: 'Household_Position_ID',
182
- anniversaryDate: 'Anniversary_Date',
183
- dateOfDeath: 'Date_of_Death',
184
- participantRecord: 'Participant_Record',
185
- donorRecord: 'Donor_Record',
186
- emailAddress: 'Email_Address',
187
- mobilePhone: 'Mobile_Phone',
188
- companyPhone: 'Company_Phone',
189
- pagerPhone: 'Pager_Phone',
190
- faxPhone: 'Fax_Phone',
191
- facebookAccount: 'Facebook_Account',
192
- twitterAccount: 'Twitter_Account',
193
- webPage: 'Web_Page',
194
- industryID: 'Industry_ID',
195
- occupationID: 'Occupation_ID',
196
- hsGraduationYear: 'HS_Graduation_Year',
197
- bulkEmailOptOut: 'Bulk_Email_Opt_Out',
198
- emailUnlisted: 'Email_Unlisted',
199
- doNotText: 'Do_Not_Text',
200
- mobilePhoneUnlisted: 'Mobile_Phone_Unlisted',
201
- removeFromDirectory: 'Remove_From_Directory',
202
- userAccount: 'User_Account',
203
- idCard: 'ID_Card',
204
- contactGUID: 'Contact_GUID',
205
- _contactSetupDate: '_Contact_Setup_Date',
206
- occupationName: 'Occupation_Name',
207
- emailVerified: 'Email_Verified',
208
- mobilePhoneVerified: 'Mobile_Phone_Verified',
209
- maidenName: 'Maiden_Name',
210
- professionalInformation: 'Professional_Information',
211
- contactMethods: 'Contact_Methods',
212
- currentSchool: 'Current_School',
213
- otherInformation: 'Other_Information',
214
- communicationPreferences: 'Communication_Preferences',
215
- };
216
-
217
- let contactRecord: Partial<ContactRecord> = {};
218
- for (const key in contact) {
219
- contactRecord[mappings[key]] = contact[key];
220
- }
221
-
222
- return contactRecord as ContactRecord;
223
- };
@@ -42,54 +42,4 @@ export interface EventParticipant {
42
42
  attendeeMessageSent: boolean;
43
43
  attendingOnline: boolean;
44
44
  rsvpStatusID: null | number;
45
- }
46
-
47
- export function mapEventParticipantRecord(originalObject: EventParticipantRecord): EventParticipant {
48
- return {
49
- eventParticipantID: originalObject.Event_Participant_ID,
50
- eventID: originalObject.Event_ID,
51
- participantID: originalObject.Participant_ID,
52
- participationStatusID: originalObject.Participation_Status_ID,
53
- timeIn: originalObject.Time_In,
54
- timeConfirmed: originalObject.Time_Confirmed,
55
- timeOut: originalObject.Time_Out,
56
- notes: originalObject.Notes,
57
- groupParticipantID: originalObject.Group_Participant_ID,
58
- checkInStation: originalObject.Check_in_Station,
59
- setupDate: originalObject._Setup_Date,
60
- groupID: originalObject.Group_ID,
61
- roomID: originalObject.Room_ID,
62
- callParents: originalObject.Call_Parents,
63
- groupRoleID: originalObject.Group_Role_ID,
64
- responseID: originalObject.Response_ID,
65
- registrantMessageSent: originalObject.Registrant_Message_Sent,
66
- attendeeMessageSent: originalObject.Attendee_Message_Sent,
67
- attendingOnline: originalObject.Attending_Online,
68
- rsvpStatusID: originalObject.RSVP_Status_ID,
69
- };
70
- }
71
-
72
- export function mapEventParticipantToEventParticipantRecord(eventParticipant: EventParticipant): EventParticipantRecord {
73
- return {
74
- Event_Participant_ID: eventParticipant.eventParticipantID,
75
- Event_ID: eventParticipant.eventID,
76
- Participant_ID: eventParticipant.participantID,
77
- Participation_Status_ID: eventParticipant.participationStatusID,
78
- Time_In: eventParticipant.timeIn,
79
- Time_Confirmed: eventParticipant.timeConfirmed,
80
- Time_Out: eventParticipant.timeOut,
81
- Notes: eventParticipant.notes,
82
- Group_Participant_ID: eventParticipant.groupParticipantID,
83
- Check_in_Station: eventParticipant.checkInStation,
84
- _Setup_Date: eventParticipant.setupDate,
85
- Group_ID: eventParticipant.groupID,
86
- Room_ID: eventParticipant.roomID,
87
- Call_Parents: eventParticipant.callParents,
88
- Group_Role_ID: eventParticipant.groupRoleID,
89
- Response_ID: eventParticipant.responseID,
90
- Registrant_Message_Sent: eventParticipant.registrantMessageSent,
91
- Attendee_Message_Sent: eventParticipant.attendeeMessageSent,
92
- Attending_Online: eventParticipant.attendingOnline,
93
- RSVP_Status_ID: eventParticipant.rsvpStatusID,
94
- };
95
- }
45
+ }
@@ -114,122 +114,3 @@ export type Event = {
114
114
  convertDefaultContacts: boolean;
115
115
  }
116
116
 
117
- export function mapEventRecord(originalObject: EventRecord): Event {
118
- return {
119
- eventID: originalObject.Event_ID,
120
- eventTitle: originalObject.Event_Title,
121
- eventTypeID: originalObject.Event_Type_ID,
122
- congregationID: originalObject.Congregation_ID,
123
- locationID: originalObject.Location_ID,
124
- meetingInstructions: originalObject.Meeting_Instructions,
125
- description: originalObject.Description,
126
- programID: originalObject.Program_ID,
127
- primaryContact: originalObject.Primary_Contact,
128
- participantsExpected: originalObject.Participants_Expected,
129
- minutesForSetup: originalObject.Minutes_for_Setup,
130
- eventStartDate: originalObject.Event_Start_Date,
131
- eventEndDate: originalObject.Event_End_Date,
132
- minutesForCleanup: originalObject.Minutes_for_Cleanup,
133
- cancelled: originalObject.Cancelled,
134
- approved: originalObject._Approved,
135
- publicWebsiteSettings: originalObject.Public_Website_Settings,
136
- visibilityLevelID: originalObject.Visibility_Level_ID,
137
- featuredOnCalendar: originalObject.Featured_On_Calendar,
138
- onlineRegistrationProduct: originalObject.Online_Registration_Product,
139
- registrationForm: originalObject.Registration_Form,
140
- registrationStart: originalObject.Registration_Start,
141
- registrationEnd: originalObject.Registration_End,
142
- registrationActive: originalObject.Registration_Active,
143
- registerIntoSeries: originalObject.Register_Into_Series,
144
- externalRegistrationURL: originalObject.External_Registration_URL,
145
- webApproved: originalObject._Web_Approved,
146
- forceLogin: originalObject.Force_Login,
147
- checkInInformation: originalObject.Check_in_Information,
148
- allowCheckin: originalObject.Allow_Check_in,
149
- ignoreProgramGroups: originalObject.Ignore_Program_Groups,
150
- prohibitGuests: originalObject.Prohibit_Guests,
151
- searchResults: originalObject.Search_Results,
152
- earlyCheckinPeriod: originalObject.Early_Check_in_Period,
153
- lateCheckinPeriod: originalObject.Late_Check_in_Period,
154
- notificationSettings: originalObject.Notification_Settings,
155
- registrantMessage: originalObject.Registrant_Message,
156
- daysOutToRemind: originalObject.Days_Out_to_Remind,
157
- optionalReminderMessage: originalObject.Optional_Reminder_Message,
158
- attendeeMessage: originalObject.Attendee_Message,
159
- sendToHeads: originalObject.Send_To_Heads,
160
- otherEventInformation: originalObject.Other_Event_Information,
161
- parentEventID: originalObject.Parent_Event_ID,
162
- priorityID: originalObject.Priority_ID,
163
- onConnectionCard: originalObject.On_Connection_Card,
164
- accountingInformation: originalObject.Accounting_Information,
165
- onDonationBatchTool: originalObject.On_Donation_Batch_Tool,
166
- projectCode: originalObject.Project_Code,
167
- onlineMeetingLink: originalObject.Online_Meeting_Link,
168
- readMoreURL: originalObject.Read_More_URL,
169
- allowSelfCheckin: originalObject.Allow_Self_Checkin,
170
- minorRegistration: originalObject.Minor_Registration,
171
- allowEmail: originalObject.Allow_Email,
172
- showBuildingRoomInfo: originalObject.Show_Building_Room_Info,
173
- convertDefaultContacts: originalObject.Convert_Default_Contacts,
174
- };
175
- }
176
-
177
- export function mapEventToEventRecord(event: Event): EventRecord {
178
- return {
179
- Event_ID: event.eventID,
180
- Event_Title: event.eventTitle,
181
- Event_Type_ID: event.eventTypeID,
182
- Congregation_ID: event.congregationID,
183
- Location_ID: event.locationID,
184
- Meeting_Instructions: event.meetingInstructions,
185
- Description: event.description,
186
- Program_ID: event.programID,
187
- Primary_Contact: event.primaryContact,
188
- Participants_Expected: event.participantsExpected,
189
- Minutes_for_Setup: event.minutesForSetup,
190
- Event_Start_Date: event.eventStartDate,
191
- Event_End_Date: event.eventEndDate,
192
- Minutes_for_Cleanup: event.minutesForCleanup,
193
- Cancelled: event.cancelled,
194
- _Approved: event.approved,
195
- Public_Website_Settings: event.publicWebsiteSettings,
196
- Visibility_Level_ID: event.visibilityLevelID,
197
- Featured_On_Calendar: event.featuredOnCalendar,
198
- Online_Registration_Product: event.onlineRegistrationProduct,
199
- Registration_Form: event.registrationForm,
200
- Registration_Start: event.registrationStart,
201
- Registration_End: event.registrationEnd,
202
- Registration_Active: event.registrationActive,
203
- Register_Into_Series: event.registerIntoSeries,
204
- External_Registration_URL: event.externalRegistrationURL,
205
- _Web_Approved: event.webApproved,
206
- Force_Login: event.forceLogin,
207
- Check_in_Information: event.checkInInformation,
208
- Allow_Check_in: event.allowCheckin,
209
- Ignore_Program_Groups: event.ignoreProgramGroups,
210
- Prohibit_Guests: event.prohibitGuests,
211
- Search_Results: event.searchResults,
212
- Early_Check_in_Period: event.earlyCheckinPeriod,
213
- Late_Check_in_Period: event.lateCheckinPeriod,
214
- Notification_Settings: event.notificationSettings,
215
- Registrant_Message: event.registrantMessage,
216
- Days_Out_to_Remind: event.daysOutToRemind,
217
- Optional_Reminder_Message: event.optionalReminderMessage,
218
- Attendee_Message: event.attendeeMessage,
219
- Send_To_Heads: event.sendToHeads,
220
- Other_Event_Information: event.otherEventInformation,
221
- Parent_Event_ID: event.parentEventID,
222
- Priority_ID: event.priorityID,
223
- On_Connection_Card: event.onConnectionCard,
224
- Accounting_Information: event.accountingInformation,
225
- On_Donation_Batch_Tool: event.onDonationBatchTool,
226
- Project_Code: event.projectCode,
227
- Online_Meeting_Link: event.onlineMeetingLink,
228
- Read_More_URL: event.readMoreURL,
229
- Allow_Self_Checkin: event.allowSelfCheckin,
230
- Minor_Registration: event.minorRegistration,
231
- Allow_Email: event.allowEmail,
232
- Show_Building_Room_Info: event.showBuildingRoomInfo,
233
- Convert_Default_Contacts: event.convertDefaultContacts,
234
- };
235
- }
@@ -39,7 +39,7 @@ export interface FormResponse {
39
39
  addressLine2: string | null;
40
40
  addressCity: string | null;
41
41
  addressState: string | null;
42
- addressZip: number |null;
42
+ addressZip: string |null;
43
43
  eventID: number;
44
44
  pledgeCampaignID: null;
45
45
  opportunityID: null;
@@ -1,5 +1,3 @@
1
-
2
-
3
1
  export interface FormResponseAnswerRecord {
4
2
  Form_Response_Answer_ID: number;
5
3
  Form_Field_ID: number;
@@ -14,12 +12,12 @@ export interface FormResponseAnswerRecord {
14
12
 
15
13
 
16
14
  export interface FormResponseAnswer {
17
- form_Response_Answer_ID: number;
18
- form_Field_ID: number;
15
+ formResponseAnswerID: number;
16
+ formFieldID: number;
17
+ formResponseID: number;
19
18
  response: string | null;
20
- form_Response_ID: number;
21
- event_Participant_ID: number | null;
22
- pledge_ID: null;
23
- opportunity_Response: null;
19
+ eventParticipantID: number | null;
20
+ pledgeID: null;
21
+ opportunityResponse: null;
24
22
  placed: boolean;
25
23
  }
@@ -1,123 +1,59 @@
1
1
  export interface GroupParticipantRecord {
2
- Group_Participant_ID: number;
3
- Group_ID: number;
4
- Participant_ID: number;
5
- Group_Role_ID: number;
6
- Start_Date: string;
7
- End_Date: string | null;
8
- Employee_Role: boolean;
9
- Hours_Per_Week: null | number;
10
- Notes: null | string;
11
- Need_Book: boolean;
12
- Email_Opt_Out: boolean;
13
- Share_With_Group: boolean;
14
- Auto_Promote: boolean;
15
- _First_Attendance: null | string;
16
- _Second_Attendance: null | string;
17
- _Third_Attendance: null | string;
18
- _Last_Attendance: null | string;
19
- Show_Email: boolean;
20
- Show_Phone: boolean;
21
- Show_Last_Name: boolean;
22
- Show_Photo: boolean;
23
- _Show_Birthday: boolean;
24
- _Show_Email: boolean;
25
- _Show_Home_Phone: boolean;
26
- _Show_Mobile_Phone: boolean;
27
- _Show_Address: boolean;
28
- _Show_Photo: boolean;
2
+ Group_Participant_ID: number;
3
+ Group_ID: number;
4
+ Participant_ID: number;
5
+ Group_Role_ID: number;
6
+ Start_Date: string;
7
+ End_Date: string | null;
8
+ Employee_Role: boolean;
9
+ Hours_Per_Week: null | number;
10
+ Notes: null | string;
11
+ Need_Book: boolean;
12
+ Email_Opt_Out: boolean;
13
+ Share_With_Group: boolean;
14
+ Auto_Promote: boolean;
15
+ _First_Attendance: null | string;
16
+ _Second_Attendance: null | string;
17
+ _Third_Attendance: null | string;
18
+ _Last_Attendance: null | string;
19
+ Show_Email: boolean;
20
+ Show_Phone: boolean;
21
+ Show_Last_Name: boolean;
22
+ Show_Photo: boolean;
23
+ _Show_Birthday: boolean;
24
+ _Show_Email: boolean;
25
+ _Show_Home_Phone: boolean;
26
+ _Show_Mobile_Phone: boolean;
27
+ _Show_Address: boolean;
28
+ _Show_Photo: boolean;
29
29
  }
30
30
 
31
31
  export interface GroupParticipant {
32
- groupParticipantID: number;
33
- groupID: number;
34
- participantID: number;
35
- groupRoleID: number;
36
- startDate: string;
37
- endDate: string | null;
38
- employeeRole: boolean;
39
- hoursPerWeek: null | number;
40
- notes: null | string;
41
- needBook: boolean;
42
- emailOptOut: boolean;
43
- shareWithGroup: boolean;
44
- autoPromote: boolean;
45
- firstAttendance: null | string;
46
- secondAttendance: null | string;
47
- thirdAttendance: null | string;
48
- lastAttendance: null | string;
49
- showEmail: boolean;
50
- showPhone: boolean;
51
- showLastName: boolean;
52
- showPhoto: boolean;
53
- _showBirthday: boolean;
54
- _showEmail: boolean;
55
- _showHomePhone: boolean;
56
- _showMobilePhone: boolean;
57
- _showAddress: boolean;
58
- _showPhoto: boolean;
59
- }
60
-
61
- export function mapGroupParticipantRecord(originalObject: GroupParticipantRecord): GroupParticipant {
62
- return {
63
- groupParticipantID: originalObject.Group_Participant_ID,
64
- groupID: originalObject.Group_ID,
65
- participantID: originalObject.Participant_ID,
66
- groupRoleID: originalObject.Group_Role_ID,
67
- startDate: originalObject.Start_Date,
68
- endDate: originalObject.End_Date,
69
- employeeRole: originalObject.Employee_Role,
70
- hoursPerWeek: originalObject.Hours_Per_Week,
71
- notes: originalObject.Notes,
72
- needBook: originalObject.Need_Book,
73
- emailOptOut: originalObject.Email_Opt_Out,
74
- shareWithGroup: originalObject.Share_With_Group,
75
- autoPromote: originalObject.Auto_Promote,
76
- firstAttendance: originalObject._First_Attendance,
77
- secondAttendance: originalObject._Second_Attendance,
78
- thirdAttendance: originalObject._Third_Attendance,
79
- lastAttendance: originalObject._Last_Attendance,
80
- showEmail: originalObject.Show_Email,
81
- showPhone: originalObject.Show_Phone,
82
- showLastName: originalObject.Show_Last_Name,
83
- showPhoto: originalObject.Show_Photo,
84
- _showBirthday: originalObject._Show_Birthday,
85
- _showEmail: originalObject._Show_Email,
86
- _showHomePhone: originalObject._Show_Home_Phone,
87
- _showMobilePhone: originalObject._Show_Mobile_Phone,
88
- _showAddress: originalObject._Show_Address,
89
- _showPhoto: originalObject._Show_Photo,
90
- };
91
- }
92
-
93
- export function mapGroupParticipantToGroupParticipantRecord(groupParticipant: GroupParticipant): GroupParticipantRecord {
94
- return {
95
- Group_Participant_ID: groupParticipant.groupParticipantID,
96
- Group_ID: groupParticipant.groupID,
97
- Participant_ID: groupParticipant.participantID,
98
- Group_Role_ID: groupParticipant.groupRoleID,
99
- Start_Date: groupParticipant.startDate,
100
- End_Date: groupParticipant.endDate,
101
- Employee_Role: groupParticipant.employeeRole,
102
- Hours_Per_Week: groupParticipant.hoursPerWeek,
103
- Notes: groupParticipant.notes,
104
- Need_Book: groupParticipant.needBook,
105
- Email_Opt_Out: groupParticipant.emailOptOut,
106
- Share_With_Group: groupParticipant.shareWithGroup,
107
- Auto_Promote: groupParticipant.autoPromote,
108
- _First_Attendance: groupParticipant.firstAttendance,
109
- _Second_Attendance: groupParticipant.secondAttendance,
110
- _Third_Attendance: groupParticipant.thirdAttendance,
111
- _Last_Attendance: groupParticipant.lastAttendance,
112
- Show_Email: groupParticipant.showEmail,
113
- Show_Phone: groupParticipant.showPhone,
114
- Show_Last_Name: groupParticipant.showLastName,
115
- Show_Photo: groupParticipant.showPhoto,
116
- _Show_Birthday: groupParticipant._showBirthday,
117
- _Show_Email: groupParticipant._showEmail,
118
- _Show_Home_Phone: groupParticipant._showHomePhone,
119
- _Show_Mobile_Phone: groupParticipant._showMobilePhone,
120
- _Show_Address: groupParticipant._showAddress,
121
- _Show_Photo: groupParticipant._showPhoto,
122
- };
123
- }
32
+ groupParticipantID: number;
33
+ groupID: number;
34
+ participantID: number;
35
+ groupRoleID: number;
36
+ startDate: string;
37
+ endDate: string | null;
38
+ employeeRole: boolean;
39
+ hoursPerWeek: null | number;
40
+ notes: null | string;
41
+ needBook: boolean;
42
+ emailOptOut: boolean;
43
+ shareWithGroup: boolean;
44
+ autoPromote: boolean;
45
+ firstAttendance: null | string;
46
+ secondAttendance: null | string;
47
+ thirdAttendance: null | string;
48
+ lastAttendance: null | string;
49
+ showEmail: boolean;
50
+ showPhone: boolean;
51
+ showLastName: boolean;
52
+ showPhoto: boolean;
53
+ _showBirthday: boolean;
54
+ _showEmail: boolean;
55
+ _showHomePhone: boolean;
56
+ _showMobilePhone: boolean;
57
+ _showAddress: boolean;
58
+ _showPhoto: boolean;
59
+ }