@better-giving/donation 1.1.8 → 1.1.10
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/donation.d.mts +12 -2
- package/dist/final-recorder.d.mts +3 -0
- package/package.json +1 -1
- package/src/donation.mts +15 -1
- package/src/final-recorder.mts +4 -0
package/dist/donation.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import type { ISODate } from "@better-giving/types/alias";
|
|
|
2
2
|
import type { ChainID, Environment } from "@better-giving/types/list";
|
|
3
3
|
import type { EmptyObject, OrStr } from "@better-giving/types/utils";
|
|
4
4
|
export declare namespace Donation {
|
|
5
|
-
type Index = "AppUsed_Index" | "Checked-8283_Index" | "Email_Index" | "EndowmentId_Index" | "FundDeposits_Index" | "Tax-Receipt-Sent_Index" | "Network-FinalizedDate_Index" | "WalletAddress_Index";
|
|
5
|
+
type Index = "AppUsed_Index" | "Checked-8283_Index" | "Email_Index" | "EndowmentId_Index" | "FundDeposits_Index" | "Tax-Receipt-Sent_Index" | "Network-FinalizedDate_Index" | "WalletAddress_Index" | "Referrer-FinalizedDate_index";
|
|
6
6
|
type App = "aging" | "angel-protocol" | "bg-marketplace" | "bg-widget" | "black-history-month" | "make-whole" | "mental-health" | "restore-earth" | "tester-app" | "ukraine-portal";
|
|
7
7
|
type Source = Extract<Donation.App, "bg-marketplace" | "bg-widget" | "tester-app">;
|
|
8
8
|
type Client = "apes" | "normal";
|
|
@@ -40,6 +40,11 @@ export declare namespace Donation {
|
|
|
40
40
|
network: Environment;
|
|
41
41
|
donationFinalTxDate: ISODate;
|
|
42
42
|
};
|
|
43
|
+
/** Referrer-FinalizedDate_Index */
|
|
44
|
+
type Referrer_FinalizedDate_IndexKey = {
|
|
45
|
+
referrer?: string;
|
|
46
|
+
donationFinalTxDate: ISODate;
|
|
47
|
+
};
|
|
43
48
|
/** Tax-Receipt-Sent_Index */
|
|
44
49
|
type Tax_Receipt_Sent_IndexKey = {
|
|
45
50
|
taxReceiptSent?: "yes" | "no";
|
|
@@ -69,6 +74,10 @@ export declare namespace Donation {
|
|
|
69
74
|
type V2FullKyc = DonorBasicInfo & DonorAddress;
|
|
70
75
|
type V2Kyc = DonorBasicInfo | V2FullKyc;
|
|
71
76
|
type PartialV2Kyc = Partial<V2FullKyc>;
|
|
77
|
+
interface ReferrerCommission {
|
|
78
|
+
from_tip: number;
|
|
79
|
+
from_fee: number;
|
|
80
|
+
}
|
|
72
81
|
type V2NonKeyAttributes = {
|
|
73
82
|
/** program which the donation is attributed: may be empty `""` */
|
|
74
83
|
programId?: string;
|
|
@@ -119,6 +128,7 @@ export declare namespace Donation {
|
|
|
119
128
|
baseFee: number;
|
|
120
129
|
processingFee: number;
|
|
121
130
|
fiscalSponsorFee: number;
|
|
131
|
+
referrer_commission?: ReferrerCommission;
|
|
122
132
|
fund_id?: string;
|
|
123
133
|
fund_name?: string;
|
|
124
134
|
fund_tx?: string;
|
|
@@ -167,7 +177,7 @@ export declare namespace Donation {
|
|
|
167
177
|
/** only use this definition on writes: for reads, it's safer to use DBRecord */
|
|
168
178
|
type V2DBRecord = PrimaryKey & EmailIndexKey & FiatRamp_IndexKey &
|
|
169
179
|
/** be sure to include in crypto donation */
|
|
170
|
-
WalletAddress_Index & Required<EndowmentId_IndexKey> & Required<AppUsed_IndexKey> & (WithKYC | WithoutKYC) & V2NonKeyAttributes;
|
|
180
|
+
WalletAddress_Index & Referrer_FinalizedDate_IndexKey & Required<EndowmentId_IndexKey> & Required<AppUsed_IndexKey> & (WithKYC | WithoutKYC) & V2NonKeyAttributes;
|
|
171
181
|
/** only use this definition on writes: for reads, it's safer to use DBRecord */
|
|
172
182
|
type V2InitCryptoDBRecord = PrimaryKey & EmailIndexKey &
|
|
173
183
|
/** be sure to include in crypto donation */
|
|
@@ -14,5 +14,8 @@ export type FinalRecorderPayload = {
|
|
|
14
14
|
/** intent to delete */
|
|
15
15
|
intentId?: string;
|
|
16
16
|
hideBgTip: boolean;
|
|
17
|
+
/** donation message */
|
|
18
|
+
donor_message?: string;
|
|
19
|
+
donor_public?: boolean;
|
|
17
20
|
} & FinalRecord & SettledAmounts & Fund & (Donation.WithKYC | Donation.WithoutKYC);
|
|
18
21
|
export {};
|
package/package.json
CHANGED
package/src/donation.mts
CHANGED
|
@@ -11,7 +11,8 @@ export declare namespace Donation {
|
|
|
11
11
|
| "FundDeposits_Index"
|
|
12
12
|
| "Tax-Receipt-Sent_Index"
|
|
13
13
|
| "Network-FinalizedDate_Index"
|
|
14
|
-
| "WalletAddress_Index"
|
|
14
|
+
| "WalletAddress_Index"
|
|
15
|
+
| "Referrer-FinalizedDate_index";
|
|
15
16
|
|
|
16
17
|
type App =
|
|
17
18
|
| "aging"
|
|
@@ -74,6 +75,12 @@ export declare namespace Donation {
|
|
|
74
75
|
donationFinalTxDate: ISODate; //SK
|
|
75
76
|
};
|
|
76
77
|
|
|
78
|
+
/** Referrer-FinalizedDate_Index */
|
|
79
|
+
type Referrer_FinalizedDate_IndexKey = {
|
|
80
|
+
referrer?: string; //PK
|
|
81
|
+
donationFinalTxDate: ISODate; //SK
|
|
82
|
+
};
|
|
83
|
+
|
|
77
84
|
/** Tax-Receipt-Sent_Index */
|
|
78
85
|
type Tax_Receipt_Sent_IndexKey = {
|
|
79
86
|
taxReceiptSent?: "yes" | "no"; //PK
|
|
@@ -107,6 +114,11 @@ export declare namespace Donation {
|
|
|
107
114
|
type V2Kyc = DonorBasicInfo | V2FullKyc;
|
|
108
115
|
type PartialV2Kyc = Partial<V2FullKyc>;
|
|
109
116
|
|
|
117
|
+
interface ReferrerCommission {
|
|
118
|
+
from_tip: number;
|
|
119
|
+
from_fee: number;
|
|
120
|
+
}
|
|
121
|
+
|
|
110
122
|
type V2NonKeyAttributes = {
|
|
111
123
|
/** program which the donation is attributed: may be empty `""` */
|
|
112
124
|
programId?: string;
|
|
@@ -163,6 +175,7 @@ export declare namespace Donation {
|
|
|
163
175
|
baseFee: number;
|
|
164
176
|
processingFee: number;
|
|
165
177
|
fiscalSponsorFee: number;
|
|
178
|
+
referrer_commission?: ReferrerCommission;
|
|
166
179
|
|
|
167
180
|
/// fundraiser this donation is attributed to
|
|
168
181
|
fund_id?: string;
|
|
@@ -249,6 +262,7 @@ export declare namespace Donation {
|
|
|
249
262
|
FiatRamp_IndexKey &
|
|
250
263
|
/** be sure to include in crypto donation */
|
|
251
264
|
WalletAddress_Index &
|
|
265
|
+
Referrer_FinalizedDate_IndexKey &
|
|
252
266
|
Required<EndowmentId_IndexKey> &
|
|
253
267
|
Required<AppUsed_IndexKey> &
|
|
254
268
|
(WithKYC | WithoutKYC) &
|
package/src/final-recorder.mts
CHANGED