diff --git a/src/mail/paymentRequest.ts b/src/mail/paymentRequest.ts index d2cedc31b..92bf09dd9 100644 --- a/src/mail/paymentRequest.ts +++ b/src/mail/paymentRequest.ts @@ -1,11 +1,11 @@ import request from './request' import i18n from 'i18n' import moment from 'moment' -import formatDate from '../modules/util/formatDate' +import formatDate from '../utils/formatDate' import emailTemplate from './templates/base-content' import { tableContentEmailTemplate } from './templates/table-content' -import currencyInfo from '../modules/util/currency-info' -import { handleAmount } from '../modules/util/handle-amount/handle-amount' +import currencyInfo from '../utils/currency-info' +import { handleAmount } from '../utils/handle-amount/handle-amount' type CurrencyKey = keyof typeof currencyInfo diff --git a/src/mail/payout.ts b/src/mail/payout.ts index c5b9d70fa..e37d5cd72 100644 --- a/src/mail/payout.ts +++ b/src/mail/payout.ts @@ -1,9 +1,9 @@ import i18n from 'i18n' import request from './request' -import { handleAmount } from '../modules/util/handle-amount/handle-amount' +import { handleAmount } from '../utils/handle-amount/handle-amount' import moment from 'moment' import { tableContentEmailTemplate } from './templates/table-content' -import currencyInfo from '../modules/util/currency-info' +import currencyInfo from '../utils/currency-info' const PayoutMail: any = { payoutCreated: async function (user: any, payout: any) { diff --git a/src/mail/templates/issue/claim.ts b/src/mail/templates/issue/claim.ts index 5e24a636d..422976118 100644 --- a/src/mail/templates/issue/claim.ts +++ b/src/mail/templates/issue/claim.ts @@ -1,7 +1,7 @@ import i18n from 'i18n' import request from '../../request' import { tableContentEmailTemplate, type ActionButton } from '../table-content' -import currencyInfo from '../../../modules/util/currency-info' +import currencyInfo from '../../../utils/currency-info' const ClaimMail: any = { notifyUnclaimedBounties: async function (user: any, issue: any, pullRequest: any) { diff --git a/src/modules/orders/orderRefund.ts b/src/modules/orders/orderRefund.ts index 257505ee2..317d688e3 100644 --- a/src/modules/orders/orderRefund.ts +++ b/src/modules/orders/orderRefund.ts @@ -1,7 +1,7 @@ import models from '../../models' import PaymentMail from '../../mail/payment' import requestPromise from 'request-promise' -import { handleAmount } from '../util/handle-amount/handle-amount' +import { handleAmount } from '../../utils/handle-amount/handle-amount' import stripeModule from '../../client/payment/stripe' const stripe = stripeModule() diff --git a/src/modules/payouts/payoutRequest.ts b/src/modules/payouts/payoutRequest.ts index 18cf150bd..fe89f812d 100644 --- a/src/modules/payouts/payoutRequest.ts +++ b/src/modules/payouts/payoutRequest.ts @@ -1,6 +1,6 @@ import models from '../../models' import Stripe from '../../client/payment/stripe' -import { handleAmount } from '../util/handle-amount/handle-amount' +import { handleAmount } from '../../utils/handle-amount/handle-amount' const stripe = Stripe() diff --git a/src/modules/users/userBankAccountCreate.ts b/src/modules/users/userBankAccountCreate.ts index 1bb52f406..0682c3ead 100644 --- a/src/modules/users/userBankAccountCreate.ts +++ b/src/modules/users/userBankAccountCreate.ts @@ -1,7 +1,7 @@ import models from '../../models' import stripeModule from '../../client/payment/stripe' const stripe = stripeModule() -import { currencyMap } from '../util/currency-map' +import { currencyMap } from '../../utils/currency-map' const currentModels = models as any diff --git a/src/modules/walletOrders/walletOrderBuilds.ts b/src/modules/walletOrders/walletOrderBuilds.ts index ed7990743..44b17e0d0 100644 --- a/src/modules/walletOrders/walletOrderBuilds.ts +++ b/src/modules/walletOrders/walletOrderBuilds.ts @@ -1,6 +1,6 @@ import stripe from '../../client/payment/stripe' import models from '../../models' -import { createOrUpdateCustomer } from '../util/customer' +import { createOrUpdateCustomer } from '../../utils/customer' const currentModels = models as any const stripeInstance = stripe() diff --git a/src/modules/webhooks/charges/chargeRefunded/chargeRefundedPaymentRequest.ts b/src/modules/webhooks/charges/chargeRefunded/chargeRefundedPaymentRequest.ts index dd643501a..e6de721b0 100644 --- a/src/modules/webhooks/charges/chargeRefunded/chargeRefundedPaymentRequest.ts +++ b/src/modules/webhooks/charges/chargeRefunded/chargeRefundedPaymentRequest.ts @@ -1,7 +1,7 @@ import Models from '../../../../models' import PaymentRequestMail from '../../../../mail/paymentRequest' import Stripe from '../../../../client/payment/stripe' -import { handleAmount } from '../../../util/handle-amount/handle-amount' +import { handleAmount } from '../../../../utils/handle-amount/handle-amount' const stripe = Stripe() const models = Models as any diff --git a/src/modules/webhooks/checkoutSessionCompleted.ts b/src/modules/webhooks/checkoutSessionCompleted.ts index 395efb251..bf594ec79 100644 --- a/src/modules/webhooks/checkoutSessionCompleted.ts +++ b/src/modules/webhooks/checkoutSessionCompleted.ts @@ -4,7 +4,7 @@ if (process.env.NODE_ENV !== 'production') { } import Stripe from '../../client/payment/stripe' import Models from '../../models' -import { handleAmount } from '../util/handle-amount/handle-amount' +import { handleAmount } from '../../utils/handle-amount/handle-amount' import PaymentRequestMail from '../../mail/paymentRequest' const stripe = Stripe() diff --git a/src/scripts/sync/sync_payment_requests.ts b/src/scripts/sync/sync_payment_requests.ts index 2e916b24c..fcad11038 100644 --- a/src/scripts/sync/sync_payment_requests.ts +++ b/src/scripts/sync/sync_payment_requests.ts @@ -1,7 +1,7 @@ import Stripe from '../../client/payment/stripe' import Models from '../../models' import { UUIDV4 } from 'sequelize' -import { handleAmount } from '../../modules/util/handle-amount/handle-amount' +import { handleAmount } from '../../utils/handle-amount/handle-amount' const models = Models as any diff --git a/src/services/payments/disputes/disputeService.ts b/src/services/payments/disputes/disputeService.ts index 4891d29a3..961ed7dd0 100644 --- a/src/services/payments/disputes/disputeService.ts +++ b/src/services/payments/disputes/disputeService.ts @@ -4,7 +4,7 @@ import { DisputeDataCreated, DisputeDataWithdrawn, DisputeDataClosed } from './t import PaymentRequestMail from '../../../mail/paymentRequest' import { findOrCreatePaymentRequestBalance } from '../../../queries/payment-request/payment-request-balance' import { findPaymentRequestPayment } from '../../../queries/payment-request/payment-request-payment' -import { handleAmount } from '../../../modules/util/handle-amount/handle-amount' +import { handleAmount } from '../../../utils/handle-amount/handle-amount' const stripe = Stripe() const models = Models as any diff --git a/src/modules/util/currency-info.ts b/src/utils/currency-info.ts similarity index 100% rename from src/modules/util/currency-info.ts rename to src/utils/currency-info.ts diff --git a/src/modules/util/currency-map.ts b/src/utils/currency-map.ts similarity index 100% rename from src/modules/util/currency-map.ts rename to src/utils/currency-map.ts diff --git a/src/modules/util/customer.ts b/src/utils/customer.ts similarity index 89% rename from src/modules/util/customer.ts rename to src/utils/customer.ts index 3354ad879..debd0d826 100644 --- a/src/modules/util/customer.ts +++ b/src/utils/customer.ts @@ -1,6 +1,6 @@ -import stripeModule from '../../client/payment/stripe' +import stripeModule from '../client/payment/stripe' const stripe = stripeModule() -import models from '../../models' +import models from '../models' const currentModels = models as any diff --git a/src/modules/util/formatDate.ts b/src/utils/formatDate.ts similarity index 100% rename from src/modules/util/formatDate.ts rename to src/utils/formatDate.ts diff --git a/src/modules/util/handle-amount/handle-amount.ts b/src/utils/handle-amount/handle-amount.ts similarity index 100% rename from src/modules/util/handle-amount/handle-amount.ts rename to src/utils/handle-amount/handle-amount.ts diff --git a/src/modules/util/index.ts b/src/utils/index.ts similarity index 100% rename from src/modules/util/index.ts rename to src/utils/index.ts diff --git a/test/handle-amount.test.ts b/test/handle-amount.test.ts index f5807619b..1e191f71e 100644 --- a/test/handle-amount.test.ts +++ b/test/handle-amount.test.ts @@ -1,5 +1,5 @@ import { expect } from 'chai' -import { handleAmount } from '../src/modules/util/handle-amount/handle-amount' +import { handleAmount } from '../src/utils/handle-amount/handle-amount' describe('Amount Conversion', () => { it('should convert cents to decimal', () => {