@better-giving/donation 1.1.3 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-giving/donation",
3
- "version": "1.1.3",
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
@@ -339,7 +339,7 @@ export declare namespace OnHoldDonation {
339
339
  /** status of this record should NOT be changed by our pipelines */
340
340
  third_party?: true;
341
341
  /** Nowpayments: number, custom: uuid */
342
- payment_id?: number | string;
342
+ payment_id?: number | string;
343
343
  };
344
344
 
345
345
  type FiatAttributes = {
@@ -349,8 +349,6 @@ export declare namespace OnHoldDonation {
349
349
  paymentMethod?: string;
350
350
  /** only exists if donor opts for manual bank verification */
351
351
  stripeDepositVerifyUrl?: string;
352
- // TODO: create donation intents for subscriptions as well, then uncomment the below line
353
- // frequency: FiatDonations.Frequency;
354
352
  };
355
353
 
356
354
  type NonKeyAttributes = {
@@ -396,6 +394,8 @@ export declare namespace OnHoldDonation {
396
394
  inHonorOf?: string;
397
395
  /** only allowed if honoree is provided */
398
396
  tributeNotif?: Donation.TributeNotif;
397
+ donor_message?: string;
398
+ donor_public?: boolean;
399
399
  } & (ApesAttributes | EmptyObject) &
400
400
  (Donation.WithKYC | Donation.WithoutKYC);
401
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,