@better-giving/donation 1.1.9 → 1.1.11

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.
@@ -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,12 @@ 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
+ /** exist when paid */
81
+ transfer_id?: number;
82
+ }
72
83
  type V2NonKeyAttributes = {
73
84
  /** program which the donation is attributed: may be empty `""` */
74
85
  programId?: string;
@@ -119,6 +130,7 @@ export declare namespace Donation {
119
130
  baseFee: number;
120
131
  processingFee: number;
121
132
  fiscalSponsorFee: number;
133
+ referrer_commission?: ReferrerCommission;
122
134
  fund_id?: string;
123
135
  fund_name?: string;
124
136
  fund_tx?: string;
@@ -167,7 +179,7 @@ export declare namespace Donation {
167
179
  /** only use this definition on writes: for reads, it's safer to use DBRecord */
168
180
  type V2DBRecord = PrimaryKey & EmailIndexKey & FiatRamp_IndexKey &
169
181
  /** be sure to include in crypto donation */
170
- WalletAddress_Index & Required<EndowmentId_IndexKey> & Required<AppUsed_IndexKey> & (WithKYC | WithoutKYC) & V2NonKeyAttributes;
182
+ WalletAddress_Index & Referrer_FinalizedDate_IndexKey & Required<EndowmentId_IndexKey> & Required<AppUsed_IndexKey> & (WithKYC | WithoutKYC) & V2NonKeyAttributes;
171
183
  /** only use this definition on writes: for reads, it's safer to use DBRecord */
172
184
  type V2InitCryptoDBRecord = PrimaryKey & EmailIndexKey &
173
185
  /** be sure to include in crypto donation */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-giving/donation",
3
- "version": "1.1.9",
3
+ "version": "1.1.11",
4
4
  "devDependencies": {
5
5
  "@better-giving/config": "1.1.2"
6
6
  },
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,13 @@ 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
+ /** exist when paid */
121
+ transfer_id?: number;
122
+ }
123
+
110
124
  type V2NonKeyAttributes = {
111
125
  /** program which the donation is attributed: may be empty `""` */
112
126
  programId?: string;
@@ -163,6 +177,7 @@ export declare namespace Donation {
163
177
  baseFee: number;
164
178
  processingFee: number;
165
179
  fiscalSponsorFee: number;
180
+ referrer_commission?: ReferrerCommission;
166
181
 
167
182
  /// fundraiser this donation is attributed to
168
183
  fund_id?: string;
@@ -249,6 +264,7 @@ export declare namespace Donation {
249
264
  FiatRamp_IndexKey &
250
265
  /** be sure to include in crypto donation */
251
266
  WalletAddress_Index &
267
+ Referrer_FinalizedDate_IndexKey &
252
268
  Required<EndowmentId_IndexKey> &
253
269
  Required<AppUsed_IndexKey> &
254
270
  (WithKYC | WithoutKYC) &