@better-giving/donation 1.1.2 → 1.1.4

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.
@@ -238,7 +238,8 @@ export declare namespace OnHoldDonation {
238
238
  walletAddress: string;
239
239
  /** status of this record should NOT be changed by our pipelines */
240
240
  third_party?: true;
241
- payment_id?: number;
241
+ /** Nowpayments: number, custom: uuid */
242
+ payment_id?: number | string;
242
243
  };
243
244
  type FiatAttributes = {
244
245
  chainId: ChainID.V2FiatChainID;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-giving/donation",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "devDependencies": {
5
5
  "@better-giving/config": "1.1.2"
6
6
  },
@@ -0,0 +1,34 @@
1
+ import type { ISODate } from "@better-giving/types/alias";
2
+ import type { Environment } from "@better-giving/types/list";
3
+
4
+ export declare namespace GSI1 {
5
+ type Name = "donor-gsi";
6
+
7
+ interface Key {
8
+ /** `Donor#{donor_id}#{env}` */
9
+ gsi1PK: `Donor#${string}#${Environment}`;
10
+ gsi1SK: ISODate;
11
+ }
12
+ }
13
+
14
+ export declare namespace DonationMessage {
15
+ interface PrimaryKey {
16
+ /** `Recipient#{recipient_id}#{env}` */
17
+ PK: `Recipient#${string}#${Environment}`;
18
+ SK: ISODate;
19
+ }
20
+
21
+ interface NonKeyAttributes {
22
+ /** USD amount at the time of donation */
23
+ amount: number;
24
+ donation_id: string;
25
+ donor_id: string;
26
+ donor_message: string;
27
+ donor_name: string;
28
+ env: Environment;
29
+ /** Endow or fund ID */
30
+ recipient_id: string;
31
+ }
32
+
33
+ interface DBRecord extends PrimaryKey, NonKeyAttributes, GSI1.Key {}
34
+ }
package/src/donation.mts CHANGED
@@ -338,7 +338,8 @@ export declare namespace OnHoldDonation {
338
338
  walletAddress: string;
339
339
  /** status of this record should NOT be changed by our pipelines */
340
340
  third_party?: true;
341
- payment_id?: number;
341
+ /** Nowpayments: number, custom: uuid */
342
+ payment_id?: number | string;
342
343
  };
343
344
 
344
345
  type FiatAttributes = {
@@ -348,8 +349,6 @@ export declare namespace OnHoldDonation {
348
349
  paymentMethod?: string;
349
350
  /** only exists if donor opts for manual bank verification */
350
351
  stripeDepositVerifyUrl?: string;
351
- // TODO: create donation intents for subscriptions as well, then uncomment the below line
352
- // frequency: FiatDonations.Frequency;
353
352
  };
354
353
 
355
354
  type NonKeyAttributes = {
@@ -395,6 +394,8 @@ export declare namespace OnHoldDonation {
395
394
  inHonorOf?: string;
396
395
  /** only allowed if honoree is provided */
397
396
  tributeNotif?: Donation.TributeNotif;
397
+ donor_message?: string;
398
+ donor_public?: boolean;
398
399
  } & (ApesAttributes | EmptyObject) &
399
400
  (Donation.WithKYC | Donation.WithoutKYC);
400
401
 
package/src/intent.mts CHANGED
@@ -95,6 +95,8 @@ export const intent = v.object({
95
95
  recipient,
96
96
  program: v.optional(program),
97
97
  donor,
98
+ donor_message: v.optional(v.pipe(requiredStr, v.maxLength(500))),
99
+ donor_public: v.optional(v.boolean()),
98
100
  source: donationSource,
99
101
  tribute: v.optional(tribute),
100
102
  frequency,