Skip to content

fix(build): Include asPaymentAmount#335

Merged
brh28 merged 7 commits intolnflash:mainfrom
heyolaniran:feature/payment-entry-notification
Apr 27, 2026
Merged

fix(build): Include asPaymentAmount#335
brh28 merged 7 commits intolnflash:mainfrom
heyolaniran:feature/payment-entry-notification

Conversation

@heyolaniran
Copy link
Copy Markdown
Contributor

this Pr add the asPaymentAmount to the USDAmount. @brh28 @islandbitcoin

heyolaniran and others added 6 commits April 7, 2026 16:56
feat: Cashout Settled Notification
In this commit  i've added :
- Graph QL  mutation that resolves the cashout (payment entry) notification from Admin action
- At App Layer, this commit added the send cashout notification for cashout settled on Galoy Payments notification type and delegate the notification action to admin push notification filtered send from the notification service
- Unit test for cashout notification in test flash unit directory. all unit tests passed
End to End test notification push made and passed
- GraphQL schema updated
- Custom Flash Notification Category

Flash Notification Categories
- Notification title in en-local

notification format

fix: cashout notification body format

fix: remove the firebase key path

fix: remove notificationCategory from the Cashout resolver

fix: rebuild graphql schema and update bruno cashout endpoint

fix: notification title

fix: rm duplicated .env.local from gitignore

 rebuild the graphql schema

fix: not log credentials
Comment thread src/domain/shared/money/USDAmount.ts Outdated
asPaymentAmount(): Amount<WalletCurrency> {
return {
currency: this.currencyCode,
amount: this.money.toSource() / PRECISION_M,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is PRECISION_M? Can we add a unit test to show this working as expected?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is a defined internal scaling factor in bigint-money , it helps us to store every amount as a big Int multiplied by PRECISION_M to avoid all floating issue.

toSource() Returns the underlying bigint value.

This is the current value of the object, multiplied by 10 ** 12 (PRECISION_M).

So if we need the amount back in cents, we have do divide again by PRECISION_M

@heyolaniran
Copy link
Copy Markdown
Contributor Author

@brh28 there is a test you can run in test/flash/unit/domain/shared/Money.spec.ts

@brh28
Copy link
Copy Markdown
Contributor

brh28 commented Apr 27, 2026

@brh28 there is a test you can run in test/flash/unit/domain/shared/Money.spec.ts
Appears to be failing:

Summary of all failing tests
 FAIL  test/flash/unit/domain/shared/Money.spec.ts
  ● Money Amount › USD Amount › asPaymentAmount › should return the correct PaymentAmount for JMDAmount

    TypeError: amt.asPaymentAmount is not a function

      130 |         const amt = JMDAmount.cents('54321')
      131 |         if (amt instanceof Error) throw amt
    > 132 |         const paymentAmount = amt.asPaymentAmount()
          |                                   ^
      133 |         expect(paymentAmount.amount).toBe(54321n)
      134 |         expect(paymentAmount.currency).toBe(WalletCurrency.Jmd)
      135 |       })

      at Object.asPaymentAmount (test/flash/unit/domain/shared/Money.spec.ts:132:35)

@heyolaniran
Copy link
Copy Markdown
Contributor Author

@brh28 Please pull my latest commit f9b6428

@brh28 brh28 changed the title Feature/payment entry notification fix(build): Include asPaymentAmount Apr 27, 2026
@brh28 brh28 merged commit 62d64c6 into lnflash:main Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants