@churchapps/helpers 1.1.8 → 1.2.0

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 (40) hide show
  1. package/.eslintrc.json +29 -0
  2. package/.github/FUNDING.yml +1 -1
  3. package/.prettierrc +11 -11
  4. package/.yarnrc.yml +6 -0
  5. package/CLAUDE.md +97 -89
  6. package/LICENSE +21 -21
  7. package/README.md +15 -15
  8. package/dist/interfaces/Donation.d.ts +6 -0
  9. package/dist/interfaces/Donation.d.ts.map +1 -1
  10. package/dist/interfaces/Donation.js.map +1 -1
  11. package/package.json +55 -54
  12. package/scripts/build-cjs.js +32 -32
  13. package/src/ApiHelper.ts +176 -176
  14. package/src/AppearanceHelper.ts +69 -69
  15. package/src/ArrayHelper.ts +157 -157
  16. package/src/CommonEnvironmentHelper.ts +104 -104
  17. package/src/CurrencyHelper.ts +10 -10
  18. package/src/DateHelper.ts +153 -153
  19. package/src/DonationHelper.ts +26 -26
  20. package/src/ErrorHelper.ts +39 -39
  21. package/src/EventHelper.ts +49 -49
  22. package/src/FileHelper.ts +55 -55
  23. package/src/PersonHelper.ts +82 -82
  24. package/src/UniqueIdHelper.ts +36 -36
  25. package/src/UserHelper.ts +59 -59
  26. package/src/index.ts +15 -15
  27. package/src/interfaces/Access.ts +138 -138
  28. package/src/interfaces/Attendance.ts +45 -45
  29. package/src/interfaces/Content.ts +84 -84
  30. package/src/interfaces/Doing.ts +93 -93
  31. package/src/interfaces/Donation.ts +190 -183
  32. package/src/interfaces/Error.ts +17 -17
  33. package/src/interfaces/Membership.ts +184 -184
  34. package/src/interfaces/Messaging.ts +96 -96
  35. package/src/interfaces/Permissions.ts +92 -92
  36. package/src/interfaces/Reporting.ts +41 -41
  37. package/src/interfaces/UserContextInterface.ts +13 -13
  38. package/src/interfaces/index.ts +13 -13
  39. package/tsconfig.json +36 -36
  40. package/eslint.config.js +0 -33
@@ -1,183 +1,190 @@
1
- import { PersonInterface } from ".";
2
-
3
- export interface DonationBatchInterface {
4
- id?: string;
5
- name?: string;
6
- batchDate?: Date;
7
- donationCount?: number;
8
- totalAmount?: number;
9
- }
10
- export interface DonationInterface {
11
- id?: string;
12
- batchId?: string;
13
- personId?: string;
14
- donationDate?: Date;
15
- amount?: number;
16
- method?: string;
17
- methodDetails?: string;
18
- notes?: string;
19
- person?: PersonInterface;
20
- fund?: FundInterface;
21
- }
22
- export interface DonationSummaryInterface {
23
- week: number;
24
- donations?: DonationSummaryDonation[];
25
- }
26
- export interface DonationSummaryDonation {
27
- totalAmount: number;
28
- fund?: FundInterface;
29
- }
30
- export interface FundInterface {
31
- id: string;
32
- name: string;
33
- taxDeductible?: boolean;
34
- amount?: number;
35
- }
36
- export interface FundDonationInterface {
37
- id?: string;
38
- donationId?: string;
39
- fundId?: string;
40
- amount?: number;
41
- donation?: DonationInterface;
42
- }
43
- export interface PaymentMethodInterface {
44
- id?: string;
45
- churchId?: string;
46
- personId?: string;
47
- customerId?: string;
48
- email?: string;
49
- name?: string;
50
- provider?: "stripe" | "paypal";
51
- type?: "card" | "bank" | "paypal";
52
- last4?: string;
53
- }
54
- export interface StripeCardUpdateInterface {
55
- paymentMethodId: string;
56
- cardData: StripeCardDataInterface;
57
- personId?: string;
58
- }
59
- export interface StripeCardDataInterface {
60
- card: StripeCardExpirationInterface;
61
- }
62
- export interface StripeCardExpirationInterface {
63
- exp_month: string;
64
- exp_year: string;
65
- }
66
- export interface StripeBankAccountInterface {
67
- account_holder_name: any;
68
- account_holder_type: any;
69
- country: string;
70
- currency: string;
71
- account_number: any;
72
- routing_number: any;
73
- }
74
- export interface StripeBankAccountUpdateInterface {
75
- paymentMethodId: string;
76
- customerId: string;
77
- personId?: string;
78
- bankData: StripeBankAccountHolderDataInterface;
79
- }
80
- export interface StripeBankAccountHolderDataInterface {
81
- account_holder_name: string;
82
- account_holder_type: string;
83
- }
84
- export interface StripeBankAccountVerifyInterface {
85
- customerId: string;
86
- paymentMethodId: string;
87
- amountData: { amounts: string[] };
88
- }
89
- export interface StripePersonDonationInterface {
90
- id: string;
91
- email: string;
92
- name: string;
93
- }
94
- export interface StripeFundDonationInterface {
95
- id: string;
96
- amount: number;
97
- name?: string;
98
- }
99
- export interface StripeDonationInterface {
100
- id?: string;
101
- type?: string;
102
- amount?: number;
103
- customerId?: string;
104
- billing_cycle_anchor?: number;
105
- proration_behavior?: string;
106
- interval?: StripeDonationIntervalInterface;
107
- person?: StripePersonDonationInterface;
108
- funds?: StripeFundDonationInterface[];
109
- notes?: string;
110
- churchId?: string;
111
- }
112
- export interface StripeDonationIntervalInterface {
113
- interval: string;
114
- interval_count: number;
115
- }
116
- export interface SubscriptionInterface {
117
- id: string;
118
- funds: [];
119
- billing_cycle_anchor: number;
120
- default_payment_method: string;
121
- default_source: string;
122
- plan: { amount: number; interval: string; interval_count: number };
123
- customer: string;
124
- }
125
-
126
- export interface PayPalPaymentMethodInterface {
127
- id: string;
128
- type: "paypal";
129
- name: string;
130
- last4?: string;
131
- email?: string;
132
- }
133
-
134
- export interface PaymentGatewayInterface {
135
- id: string;
136
- provider: "stripe" | "paypal";
137
- publicKey: string;
138
- enabled: boolean;
139
- }
140
-
141
- export interface MultiGatewayDonationInterface {
142
- id: string;
143
- type: "card" | "bank" | "paypal";
144
- provider: "stripe" | "paypal";
145
- customerId?: string;
146
- person?: {
147
- id?: string;
148
- email?: string;
149
- name?: string;
150
- };
151
- amount: number;
152
- billing_cycle_anchor?: number;
153
- interval?: {
154
- interval_count: number;
155
- interval: string;
156
- };
157
- funds?: FundDonationInterface[];
158
- notes?: string;
159
- }
160
-
161
- export class StripePaymentMethod {
162
- id: string;
163
- type: string;
164
- name: string;
165
- last4: string;
166
- exp_month?: string;
167
- exp_year?: string;
168
- status?: string;
169
- account_holder_name?: string;
170
- account_holder_type?: string;
171
-
172
- constructor(obj?: any) {
173
- this.id = obj?.id || null;
174
- this.type = obj?.type || (obj?.object && obj.object === "bank_account" ? "bank" : null);
175
- this.name = obj?.card?.brand || obj?.bank_name || null;
176
- this.last4 = obj?.last4 || obj?.card?.last4 || null;
177
- this.exp_month = obj?.exp_month || obj?.card?.exp_month || null;
178
- this.exp_year = obj?.exp_year || obj?.card?.exp_year || null;
179
- this.status = obj?.status || null;
180
- this.account_holder_name = obj?.account_holder_name || "";
181
- this.account_holder_type = obj?.account_holder_type || "individual";
182
- }
183
- }
1
+ import { PersonInterface } from ".";
2
+
3
+ export interface DonationBatchInterface {
4
+ id?: string;
5
+ name?: string;
6
+ batchDate?: Date;
7
+ donationCount?: number;
8
+ totalAmount?: number;
9
+ }
10
+ export interface DonationInterface {
11
+ id?: string;
12
+ batchId?: string;
13
+ personId?: string;
14
+ donationDate?: Date;
15
+ amount?: number;
16
+ method?: string;
17
+ methodDetails?: string;
18
+ notes?: string;
19
+ person?: PersonInterface;
20
+ fund?: FundInterface;
21
+ }
22
+ export interface DonationSummaryInterface {
23
+ week: number;
24
+ donations?: DonationSummaryDonation[];
25
+ }
26
+ export interface DonationSummaryDonation {
27
+ totalAmount: number;
28
+ fund?: FundInterface;
29
+ }
30
+ export interface FundInterface {
31
+ id: string;
32
+ name: string;
33
+ taxDeductible?: boolean;
34
+ amount?: number;
35
+ }
36
+ export interface FundDonationInterface {
37
+ id?: string;
38
+ donationId?: string;
39
+ fundId?: string;
40
+ amount?: number;
41
+ donation?: DonationInterface;
42
+ }
43
+ export interface PaymentMethodInterface {
44
+ id?: string;
45
+ churchId?: string;
46
+ personId?: string;
47
+ customerId?: string;
48
+ email?: string;
49
+ name?: string;
50
+ provider?: "stripe" | "paypal";
51
+ type?: "card" | "bank" | "paypal";
52
+ last4?: string;
53
+ gatewayId?: string;
54
+ }
55
+ export interface StripeCardUpdateInterface {
56
+ paymentMethodId: string;
57
+ cardData: StripeCardDataInterface;
58
+ personId?: string;
59
+ }
60
+ export interface StripeCardDataInterface {
61
+ card: StripeCardExpirationInterface;
62
+ }
63
+ export interface StripeCardExpirationInterface {
64
+ exp_month: string;
65
+ exp_year: string;
66
+ }
67
+ export interface StripeBankAccountInterface {
68
+ account_holder_name: any;
69
+ account_holder_type: any;
70
+ country: string;
71
+ currency: string;
72
+ account_number: any;
73
+ routing_number: any;
74
+ }
75
+ export interface StripeBankAccountUpdateInterface {
76
+ paymentMethodId: string;
77
+ customerId: string;
78
+ personId?: string;
79
+ bankData: StripeBankAccountHolderDataInterface;
80
+ }
81
+ export interface StripeBankAccountHolderDataInterface {
82
+ account_holder_name: string;
83
+ account_holder_type: string;
84
+ }
85
+ export interface StripeBankAccountVerifyInterface {
86
+ customerId: string;
87
+ paymentMethodId: string;
88
+ amountData: { amounts: string[] };
89
+ }
90
+ export interface StripePersonDonationInterface {
91
+ id: string;
92
+ email: string;
93
+ name: string;
94
+ }
95
+ export interface StripeFundDonationInterface {
96
+ id: string;
97
+ amount: number;
98
+ name?: string;
99
+ }
100
+ export interface StripeDonationInterface {
101
+ id?: string;
102
+ type?: string;
103
+ amount?: number;
104
+ customerId?: string;
105
+ billing_cycle_anchor?: number;
106
+ proration_behavior?: string;
107
+ interval?: StripeDonationIntervalInterface;
108
+ person?: StripePersonDonationInterface;
109
+ funds?: StripeFundDonationInterface[];
110
+ notes?: string;
111
+ churchId?: string;
112
+ }
113
+ export interface StripeDonationIntervalInterface {
114
+ interval: string;
115
+ interval_count: number;
116
+ }
117
+ export interface SubscriptionInterface {
118
+ id: string;
119
+ funds: [];
120
+ billing_cycle_anchor: number;
121
+ default_payment_method: string;
122
+ default_source: string;
123
+ plan: { amount: number; interval: string; interval_count: number };
124
+ customer: string;
125
+ gatewayId?: string;
126
+ }
127
+
128
+ export interface PayPalPaymentMethodInterface {
129
+ id: string;
130
+ type: "paypal";
131
+ name: string;
132
+ last4?: string;
133
+ email?: string;
134
+ }
135
+
136
+ export interface PayPalDonationInterface {
137
+ gatewayId?: string;
138
+ }
139
+
140
+ export interface PaymentGatewayInterface {
141
+ id: string;
142
+ provider: "stripe" | "paypal";
143
+ publicKey: string;
144
+ enabled: boolean;
145
+ }
146
+
147
+ export interface MultiGatewayDonationInterface {
148
+ id: string;
149
+ type: "card" | "bank" | "paypal";
150
+ provider: "stripe" | "paypal";
151
+ customerId?: string;
152
+ person?: {
153
+ id?: string;
154
+ email?: string;
155
+ name?: string;
156
+ };
157
+ amount: number;
158
+ billing_cycle_anchor?: number;
159
+ interval?: {
160
+ interval_count: number;
161
+ interval: string;
162
+ };
163
+ funds?: FundDonationInterface[];
164
+ notes?: string;
165
+ gatewayId?: string;
166
+ }
167
+
168
+ export class StripePaymentMethod {
169
+ id: string;
170
+ type: string;
171
+ name: string;
172
+ last4: string;
173
+ exp_month?: string;
174
+ exp_year?: string;
175
+ status?: string;
176
+ account_holder_name?: string;
177
+ account_holder_type?: string;
178
+
179
+ constructor(obj?: any) {
180
+ this.id = obj?.id || null;
181
+ this.type = obj?.type || (obj?.object && obj.object === "bank_account" ? "bank" : null);
182
+ this.name = obj?.card?.brand || obj?.bank_name || null;
183
+ this.last4 = obj?.last4 || obj?.card?.last4 || null;
184
+ this.exp_month = obj?.exp_month || obj?.card?.exp_month || null;
185
+ this.exp_year = obj?.exp_year || obj?.card?.exp_year || null;
186
+ this.status = obj?.status || null;
187
+ this.account_holder_name = obj?.account_holder_name || "";
188
+ this.account_holder_type = obj?.account_holder_type || "individual";
189
+ }
190
+ }
@@ -1,17 +1,17 @@
1
- export interface ErrorLogInterface {
2
- application?: string;
3
- errorTime?: Date;
4
- userId?: string;
5
- churchId?: string;
6
- originUrl?: string;
7
- errorType?: string;
8
- message?: string;
9
- details?: string;
10
- }
11
-
12
- export interface ErrorAppDataInterface {
13
- churchId: string;
14
- userId: string;
15
- originUrl: string;
16
- application: string;
17
- }
1
+ export interface ErrorLogInterface {
2
+ application?: string;
3
+ errorTime?: Date;
4
+ userId?: string;
5
+ churchId?: string;
6
+ originUrl?: string;
7
+ errorType?: string;
8
+ message?: string;
9
+ details?: string;
10
+ }
11
+
12
+ export interface ErrorAppDataInterface {
13
+ churchId: string;
14
+ userId: string;
15
+ originUrl: string;
16
+ application: string;
17
+ }