Skip to content

Move util module from src/modules/util to src/utils#1382

Merged
alexanmtz merged 3 commits into
masterfrom
copilot/move-util-to-utils
Feb 5, 2026
Merged

Move util module from src/modules/util to src/utils#1382
alexanmtz merged 3 commits into
masterfrom
copilot/move-util-to-utils

Conversation

Copilot AI commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution!

Description

Refactored directory structure by relocating src/modules/util to src/utils to follow standard Node.js/TypeScript conventions where utility modules live at the project root level rather than nested under modules.

Changes

  • Directory relocation: Moved all files from src/modules/util/ to src/utils/

    • currency-info.ts, currency-map.ts, customer.ts, formatDate.ts
    • handle-amount/handle-amount.ts, index.ts
  • Import path updates: Updated import statements across 13 files:

    • src/services/payments/disputes/disputeService.ts
    • src/scripts/sync/sync_payment_requests.ts
    • src/mail/payout.ts (2 imports)
    • src/mail/paymentRequest.ts (3 imports)
    • src/mail/templates/issue/claim.ts
    • test/handle-amount.test.ts
    • src/modules/orders/orderRefund.ts
    • src/modules/payouts/payoutRequest.ts
    • src/modules/users/userBankAccountCreate.ts
    • src/modules/walletOrders/walletOrderBuilds.ts
    • src/modules/webhooks/checkoutSessionCompleted.ts
    • src/modules/webhooks/charges/chargeRefunded/chargeRefundedPaymentRequest.ts
    • src/utils/customer.ts (fixed relative paths after move)

All imports changed from various ../util/* and ../modules/util/* patterns to the correct ../../utils/* or ../utils/* pattern based on file location.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: alexanmtz <88840+alexanmtz@users.noreply.github.com>
Copilot AI changed the title [WIP] Move util module to utils directory and update references Move util module from src/modules/util to src/utils Feb 5, 2026
Copilot AI requested a review from alexanmtz February 5, 2026 13:38
@alexanmtz
alexanmtz marked this pull request as ready for review February 5, 2026 13:45

@alexanmtz alexanmtz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Lot of build errors

src/modules/orders/orderRefund.ts:4:30 - error TS2307: Cannot find module '../util/handle-amount/handle-amount' or its corresponding type declarations.

4 import { handleAmount } from '../util/handle-amount/handle-amount'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/modules/payouts/payoutRequest.ts:3:30 - error TS2307: Cannot find module '../util/handle-amount/handle-amount' or its corresponding type declarations.

3 import { handleAmount } from '../util/handle-amount/handle-amount'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/modules/users/userBankAccountCreate.ts:4:29 - error TS2307: Cannot find module '../util/currency-map' or its corresponding type declarations.

4 import { currencyMap } from '../util/currency-map'
~~~~~~~~~~~~~~~~~~~~~~

src/modules/walletOrders/walletOrderBuilds.ts:3:40 - error TS2307: Cannot find module '../util/customer' or its corresponding type declarations.

3 import { createOrUpdateCustomer } from '../util/customer'
~~~~~~~~~~~~~~~~~~

src/modules/webhooks/charges/chargeRefunded/chargeRefundedPaymentRequest.ts:4:30 - error TS2307: Cannot find module '../../../util/handle-amount/handle-amount' or its corresponding type declarations.

4 import { handleAmount } from '../../../util/handle-amount/handle-amount'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/modules/webhooks/checkoutSessionCompleted.ts:7:30 - error TS2307: Cannot find module '../util/handle-amount/handle-amount' or its corresponding type declarations.

7 import { handleAmount } from '../util/handle-amount/handle-amount'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/utils/customer.ts:1:26 - error TS2307: Cannot find module '../../client/payment/stripe' or its corresponding type declarations.

1 import stripeModule from '../../client/payment/stripe'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/utils/customer.ts:3:20 - error TS2307: Cannot find module '../../models' or its corresponding type declarations.

3 import models from '../../models'
~~~~~~~~~~~~~~

Found 8 errors in 7 files.

Errors Files
1 src/modules/orders/orderRefund.ts:4
1 src/modules/payouts/payoutRequest.ts:3
1 src/modules/users/userBankAccountCreate.ts:4
1 src/modules/walletOrders/walletOrderBuilds.ts:3
1 src/modules/webhooks/charges/chargeRefunded/chargeRefundedPaymentRequest.ts:4
1 src/modules/webhooks/checkoutSessionCompleted.ts:7
2 src/utils/customer.ts:1

Exited with code exit status 1

Co-authored-by: alexanmtz <88840+alexanmtz@users.noreply.github.com>

Copilot AI commented Feb 5, 2026

Copy link
Copy Markdown
Contributor Author

Lot of build errors

src/modules/orders/orderRefund.ts:4:30 - error TS2307: Cannot find module '../util/handle-amount/handle-amount' or its corresponding type declarations....

Fixed all build errors in commit 1506888. Updated 7 additional files:

  • 6 files in src/modules/ that were still referencing the old ../util/ path
  • Fixed src/utils/customer.ts relative imports after the directory move

All imports now correctly reference the new src/utils/ location.

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Feb 5, 2026
@alexanmtz
alexanmtz merged commit 8900f30 into master Feb 5, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants