@ambushsoftworks/nestjs-payments-graphql 0.1.0

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.
Files changed (217) hide show
  1. package/dist/constants.d.ts +17 -0
  2. package/dist/constants.js +21 -0
  3. package/dist/constants.js.map +1 -0
  4. package/dist/dto/create-installment.input.d.ts +5 -0
  5. package/dist/dto/create-installment.input.js +39 -0
  6. package/dist/dto/create-installment.input.js.map +1 -0
  7. package/dist/dto/create-invoice.input.d.ts +13 -0
  8. package/dist/dto/create-invoice.input.js +95 -0
  9. package/dist/dto/create-invoice.input.js.map +1 -0
  10. package/dist/dto/create-line-item.input.d.ts +10 -0
  11. package/dist/dto/create-line-item.input.js +77 -0
  12. package/dist/dto/create-line-item.input.js.map +1 -0
  13. package/dist/dto/create-payment-plan.input.d.ts +11 -0
  14. package/dist/dto/create-payment-plan.input.js +76 -0
  15. package/dist/dto/create-payment-plan.input.js.map +1 -0
  16. package/dist/dto/create-recurring-invoice.input.d.ts +18 -0
  17. package/dist/dto/create-recurring-invoice.input.js +117 -0
  18. package/dist/dto/create-recurring-invoice.input.js.map +1 -0
  19. package/dist/dto/create-recurring-line-item.input.d.ts +10 -0
  20. package/dist/dto/create-recurring-line-item.input.js +77 -0
  21. package/dist/dto/create-recurring-line-item.input.js.map +1 -0
  22. package/dist/dto/create-refund.input.d.ts +5 -0
  23. package/dist/dto/create-refund.input.js +43 -0
  24. package/dist/dto/create-refund.input.js.map +1 -0
  25. package/dist/dto/index.d.ts +8 -0
  26. package/dist/dto/index.js +20 -0
  27. package/dist/dto/index.js.map +1 -0
  28. package/dist/dto/invoice-filter.input.d.ts +10 -0
  29. package/dist/dto/invoice-filter.input.js +64 -0
  30. package/dist/dto/invoice-filter.input.js.map +1 -0
  31. package/dist/dto/payment-plan-filter.input.d.ts +7 -0
  32. package/dist/dto/payment-plan-filter.input.js +46 -0
  33. package/dist/dto/payment-plan-filter.input.js.map +1 -0
  34. package/dist/dto/record-manual-payment.input.d.ts +9 -0
  35. package/dist/dto/record-manual-payment.input.js +58 -0
  36. package/dist/dto/record-manual-payment.input.js.map +1 -0
  37. package/dist/dto/recurring-invoice-filter.input.d.ts +7 -0
  38. package/dist/dto/recurring-invoice-filter.input.js +46 -0
  39. package/dist/dto/recurring-invoice-filter.input.js.map +1 -0
  40. package/dist/dto/update-invoice-metadata.input.d.ts +3 -0
  41. package/dist/dto/update-invoice-metadata.input.js +30 -0
  42. package/dist/dto/update-invoice-metadata.input.js.map +1 -0
  43. package/dist/dto/update-payment-config.input.d.ts +8 -0
  44. package/dist/dto/update-payment-config.input.js +61 -0
  45. package/dist/dto/update-payment-config.input.js.map +1 -0
  46. package/dist/dto/update-recurring-template.input.d.ts +12 -0
  47. package/dist/dto/update-recurring-template.input.js +89 -0
  48. package/dist/dto/update-recurring-template.input.js.map +1 -0
  49. package/dist/dto/upsert-payment-provider.input.d.ts +5 -0
  50. package/dist/dto/upsert-payment-provider.input.js +43 -0
  51. package/dist/dto/upsert-payment-provider.input.js.map +1 -0
  52. package/dist/dto/validators/is-metadata.d.ts +1 -0
  53. package/dist/dto/validators/is-metadata.js +41 -0
  54. package/dist/dto/validators/is-metadata.js.map +1 -0
  55. package/dist/exceptions/index.d.ts +34 -0
  56. package/dist/exceptions/index.js +73 -0
  57. package/dist/exceptions/index.js.map +1 -0
  58. package/dist/gateways/gateway-registry.service.d.ts +10 -0
  59. package/dist/gateways/gateway-registry.service.js +45 -0
  60. package/dist/gateways/gateway-registry.service.js.map +1 -0
  61. package/dist/gateways/payment-gateway.interface.d.ts +50 -0
  62. package/dist/gateways/payment-gateway.interface.js +3 -0
  63. package/dist/gateways/payment-gateway.interface.js.map +1 -0
  64. package/dist/gateways/recurring-payment-gateway.interface.d.ts +32 -0
  65. package/dist/gateways/recurring-payment-gateway.interface.js +3 -0
  66. package/dist/gateways/recurring-payment-gateway.interface.js.map +1 -0
  67. package/dist/gateways/stripe/stripe-webhook.controller.d.ts +24 -0
  68. package/dist/gateways/stripe/stripe-webhook.controller.js +150 -0
  69. package/dist/gateways/stripe/stripe-webhook.controller.js.map +1 -0
  70. package/dist/gateways/stripe/stripe.gateway.d.ts +84 -0
  71. package/dist/gateways/stripe/stripe.gateway.js +424 -0
  72. package/dist/gateways/stripe/stripe.gateway.js.map +1 -0
  73. package/dist/index.d.ts +70 -0
  74. package/dist/index.js +147 -0
  75. package/dist/index.js.map +1 -0
  76. package/dist/interfaces/invoice-repository.interface.d.ts +23 -0
  77. package/dist/interfaces/invoice-repository.interface.js +3 -0
  78. package/dist/interfaces/invoice-repository.interface.js.map +1 -0
  79. package/dist/interfaces/payment-config-repository.interface.d.ts +11 -0
  80. package/dist/interfaces/payment-config-repository.interface.js +3 -0
  81. package/dist/interfaces/payment-config-repository.interface.js.map +1 -0
  82. package/dist/interfaces/payment-customer-repository.interface.d.ts +6 -0
  83. package/dist/interfaces/payment-customer-repository.interface.js +3 -0
  84. package/dist/interfaces/payment-customer-repository.interface.js.map +1 -0
  85. package/dist/interfaces/payment-email.interfaces.d.ts +74 -0
  86. package/dist/interfaces/payment-email.interfaces.js +3 -0
  87. package/dist/interfaces/payment-email.interfaces.js.map +1 -0
  88. package/dist/interfaces/payment-event-listener.interface.d.ts +61 -0
  89. package/dist/interfaces/payment-event-listener.interface.js +3 -0
  90. package/dist/interfaces/payment-event-listener.interface.js.map +1 -0
  91. package/dist/interfaces/payment-plan-repository.interface.d.ts +16 -0
  92. package/dist/interfaces/payment-plan-repository.interface.js +3 -0
  93. package/dist/interfaces/payment-plan-repository.interface.js.map +1 -0
  94. package/dist/interfaces/payment-repository.interface.d.ts +13 -0
  95. package/dist/interfaces/payment-repository.interface.js +3 -0
  96. package/dist/interfaces/payment-repository.interface.js.map +1 -0
  97. package/dist/interfaces/recurring-invoice-repository.interface.d.ts +16 -0
  98. package/dist/interfaces/recurring-invoice-repository.interface.js +3 -0
  99. package/dist/interfaces/recurring-invoice-repository.interface.js.map +1 -0
  100. package/dist/interfaces/refund-repository.interface.d.ts +8 -0
  101. package/dist/interfaces/refund-repository.interface.js +3 -0
  102. package/dist/interfaces/refund-repository.interface.js.map +1 -0
  103. package/dist/interfaces/transaction-manager.interface.d.ts +19 -0
  104. package/dist/interfaces/transaction-manager.interface.js +3 -0
  105. package/dist/interfaces/transaction-manager.interface.js.map +1 -0
  106. package/dist/interfaces/webhook-idempotency-repository.interface.d.ts +5 -0
  107. package/dist/interfaces/webhook-idempotency-repository.interface.js +3 -0
  108. package/dist/interfaces/webhook-idempotency-repository.interface.js.map +1 -0
  109. package/dist/models/e-transfer-instructions.model.d.ts +11 -0
  110. package/dist/models/e-transfer-instructions.model.js +56 -0
  111. package/dist/models/e-transfer-instructions.model.js.map +1 -0
  112. package/dist/models/index.d.ts +13 -0
  113. package/dist/models/index.js +36 -0
  114. package/dist/models/index.js.map +1 -0
  115. package/dist/models/invoice-client.model.d.ts +5 -0
  116. package/dist/models/invoice-client.model.js +32 -0
  117. package/dist/models/invoice-client.model.js.map +1 -0
  118. package/dist/models/invoice-line-item.model.d.ts +14 -0
  119. package/dist/models/invoice-line-item.model.js +72 -0
  120. package/dist/models/invoice-line-item.model.js.map +1 -0
  121. package/dist/models/invoice.model.d.ts +86 -0
  122. package/dist/models/invoice.model.js +210 -0
  123. package/dist/models/invoice.model.js.map +1 -0
  124. package/dist/models/online-payment-session.model.d.ts +6 -0
  125. package/dist/models/online-payment-session.model.js +40 -0
  126. package/dist/models/online-payment-session.model.js.map +1 -0
  127. package/dist/models/paginated-invoices.model.d.ts +5 -0
  128. package/dist/models/paginated-invoices.model.js +19 -0
  129. package/dist/models/paginated-invoices.model.js.map +1 -0
  130. package/dist/models/paginated-payment-plans.model.d.ts +5 -0
  131. package/dist/models/paginated-payment-plans.model.js +19 -0
  132. package/dist/models/paginated-payment-plans.model.js.map +1 -0
  133. package/dist/models/paginated-recurring-invoices.model.d.ts +5 -0
  134. package/dist/models/paginated-recurring-invoices.model.js +19 -0
  135. package/dist/models/paginated-recurring-invoices.model.js.map +1 -0
  136. package/dist/models/paginated.model.d.ts +6 -0
  137. package/dist/models/paginated.model.js +30 -0
  138. package/dist/models/paginated.model.js.map +1 -0
  139. package/dist/models/payment-config.model.d.ts +21 -0
  140. package/dist/models/payment-config.model.js +98 -0
  141. package/dist/models/payment-config.model.js.map +1 -0
  142. package/dist/models/payment-method-setup.model.d.ts +4 -0
  143. package/dist/models/payment-method-setup.model.js +32 -0
  144. package/dist/models/payment-method-setup.model.js.map +1 -0
  145. package/dist/models/payment-plan-installment.model.d.ts +12 -0
  146. package/dist/models/payment-plan-installment.model.js +57 -0
  147. package/dist/models/payment-plan-installment.model.js.map +1 -0
  148. package/dist/models/payment-plan.model.d.ts +25 -0
  149. package/dist/models/payment-plan.model.js +105 -0
  150. package/dist/models/payment-plan.model.js.map +1 -0
  151. package/dist/models/payment.model.d.ts +23 -0
  152. package/dist/models/payment.model.js +102 -0
  153. package/dist/models/payment.model.js.map +1 -0
  154. package/dist/models/recurring-invoice-line-item.model.d.ts +14 -0
  155. package/dist/models/recurring-invoice-line-item.model.js +72 -0
  156. package/dist/models/recurring-invoice-line-item.model.js.map +1 -0
  157. package/dist/models/recurring-invoice.model.d.ts +43 -0
  158. package/dist/models/recurring-invoice.model.js +157 -0
  159. package/dist/models/recurring-invoice.model.js.map +1 -0
  160. package/dist/models/refund.model.d.ts +15 -0
  161. package/dist/models/refund.model.js +73 -0
  162. package/dist/models/refund.model.js.map +1 -0
  163. package/dist/payments.module.d.ts +54 -0
  164. package/dist/payments.module.js +211 -0
  165. package/dist/payments.module.js.map +1 -0
  166. package/dist/register-payment-enums.d.ts +1 -0
  167. package/dist/register-payment-enums.js +18 -0
  168. package/dist/register-payment-enums.js.map +1 -0
  169. package/dist/services/customer.service.d.ts +15 -0
  170. package/dist/services/customer.service.js +63 -0
  171. package/dist/services/customer.service.js.map +1 -0
  172. package/dist/services/default-payment-email-templates.d.ts +8 -0
  173. package/dist/services/default-payment-email-templates.js +249 -0
  174. package/dist/services/default-payment-email-templates.js.map +1 -0
  175. package/dist/services/e-transfer.service.d.ts +35 -0
  176. package/dist/services/e-transfer.service.js +93 -0
  177. package/dist/services/e-transfer.service.js.map +1 -0
  178. package/dist/services/invoice-number.service.d.ts +9 -0
  179. package/dist/services/invoice-number.service.js +56 -0
  180. package/dist/services/invoice-number.service.js.map +1 -0
  181. package/dist/services/invoice.service.d.ts +66 -0
  182. package/dist/services/invoice.service.js +293 -0
  183. package/dist/services/invoice.service.js.map +1 -0
  184. package/dist/services/payment-config.service.d.ts +26 -0
  185. package/dist/services/payment-config.service.js +90 -0
  186. package/dist/services/payment-config.service.js.map +1 -0
  187. package/dist/services/payment-email.service.d.ts +20 -0
  188. package/dist/services/payment-email.service.js +153 -0
  189. package/dist/services/payment-email.service.js.map +1 -0
  190. package/dist/services/payment-plan.service.d.ts +47 -0
  191. package/dist/services/payment-plan.service.js +264 -0
  192. package/dist/services/payment-plan.service.js.map +1 -0
  193. package/dist/services/payment.service.d.ts +65 -0
  194. package/dist/services/payment.service.js +532 -0
  195. package/dist/services/payment.service.js.map +1 -0
  196. package/dist/services/recurring-interval.util.d.ts +3 -0
  197. package/dist/services/recurring-interval.util.js +43 -0
  198. package/dist/services/recurring-interval.util.js.map +1 -0
  199. package/dist/services/recurring-invoice.service.d.ts +88 -0
  200. package/dist/services/recurring-invoice.service.js +450 -0
  201. package/dist/services/recurring-invoice.service.js.map +1 -0
  202. package/dist/services/refund.service.d.ts +44 -0
  203. package/dist/services/refund.service.js +373 -0
  204. package/dist/services/refund.service.js.map +1 -0
  205. package/dist/services/static-branding-resolver.d.ts +6 -0
  206. package/dist/services/static-branding-resolver.js +13 -0
  207. package/dist/services/static-branding-resolver.js.map +1 -0
  208. package/dist/types/index.d.ts +240 -0
  209. package/dist/types/index.js +19 -0
  210. package/dist/types/index.js.map +1 -0
  211. package/dist/types/payment-customer.types.d.ts +15 -0
  212. package/dist/types/payment-customer.types.js +3 -0
  213. package/dist/types/payment-customer.types.js.map +1 -0
  214. package/dist/types/recurring-invoice.types.d.ts +84 -0
  215. package/dist/types/recurring-invoice.types.js +3 -0
  216. package/dist/types/recurring-invoice.types.js.map +1 -0
  217. package/package.json +70 -0
package/dist/index.js ADDED
@@ -0,0 +1,147 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PaymentModel = exports.InvoiceClientModel = exports.InvoiceLineItemModel = exports.InstallmentStatusEnum = exports.PaymentPlanStatusEnum = exports.RefundStatusEnum = exports.PaymentStatusEnum = exports.PaymentMethodEnum = exports.InvoiceStatusEnum = exports.InvoiceModel = exports.UniqueConstraintViolationException = exports.InvalidRecurringInvoiceStateException = exports.InvalidPaymentStateException = exports.RefundNotAllowedException = exports.InvoiceNumberExhaustedException = exports.InvoiceNotPayableException = exports.DuplicatePaymentException = exports.PaymentGatewayException = exports.PaymentAmountExceededException = exports.InvalidInvoiceStateException = exports.PaymentException = exports.GatewayRegistryService = exports.ETransferService = exports.CustomerService = exports.RecurringInvoiceService = exports.PaymentEmailService = exports.PaymentPlanService = exports.PaymentConfigService = exports.RefundService = exports.PaymentService = exports.InvoiceNumberService = exports.InvoiceService = exports.E_TRANSFER_CODE_PREFIX = exports.DEFAULT_CURRENCY = exports.WEBHOOK_ERROR_REPORTER = exports.PAYMENT_EMAIL_TEMPLATE_RENDERER = exports.PAYMENT_EMAIL_BRANDING_RESOLVER = exports.PAYMENT_CLIENT_RESOLVER = exports.PAYMENT_EMAIL_SENDER = exports.PAYMENT_EVENT_LISTENER = exports.TRANSACTION_MANAGER = exports.PAYMENT_CUSTOMER_REPOSITORY = exports.RECURRING_INVOICE_REPOSITORY = exports.WEBHOOK_IDEMPOTENCY_REPOSITORY = exports.PAYMENT_CONFIG_REPOSITORY = exports.PAYMENT_PLAN_REPOSITORY = exports.REFUND_REPOSITORY = exports.PAYMENT_REPOSITORY = exports.INVOICE_REPOSITORY = exports.PaymentsModule = void 0;
4
+ exports.DefaultPaymentEmailTemplateRenderer = exports.computeCycleCount = exports.computeNextInvoiceDate = exports.StaticBrandingResolver = exports.PAYMENTS_WEBHOOK = exports.PaymentsWebhook = exports.StripeGateway = exports.IsMetadata = exports.RecurringInvoiceFilterInput = exports.PaymentPlanFilterInput = exports.InvoiceFilterInput = exports.UpsertPaymentProviderInput = exports.UpdateRecurringTemplateInput = exports.UpdateInvoiceMetadataInput = exports.UpdatePaymentConfigInput = exports.RecordManualPaymentInput = exports.CreateRecurringLineItemInput = exports.CreateRecurringInvoiceInput = exports.CreatePaymentPlanInput = exports.CreateInstallmentInput = exports.CreateRefundInput = exports.CreateLineItemInput = exports.CreateInvoiceInput = exports.Paginated = exports.RecurringInvoiceLineItemModel = exports.RecurringInvoiceStatusEnum = exports.RecurringIntervalUnitEnum = exports.RecurringInvoiceModel = exports.PaginatedRecurringInvoices = exports.PaginatedPaymentPlans = exports.PaginatedInvoices = exports.PaymentMethodSetupModel = exports.PaymentPlanInstallmentModel = exports.PaymentPlanModel = exports.PaymentProviderModel = exports.PaymentConfigModel = exports.OnlinePaymentSessionModel = exports.ETransferInstructionsModel = exports.RefundModel = void 0;
5
+ var payments_module_1 = require("./payments.module");
6
+ Object.defineProperty(exports, "PaymentsModule", { enumerable: true, get: function () { return payments_module_1.PaymentsModule; } });
7
+ var constants_1 = require("./constants");
8
+ Object.defineProperty(exports, "INVOICE_REPOSITORY", { enumerable: true, get: function () { return constants_1.INVOICE_REPOSITORY; } });
9
+ Object.defineProperty(exports, "PAYMENT_REPOSITORY", { enumerable: true, get: function () { return constants_1.PAYMENT_REPOSITORY; } });
10
+ Object.defineProperty(exports, "REFUND_REPOSITORY", { enumerable: true, get: function () { return constants_1.REFUND_REPOSITORY; } });
11
+ Object.defineProperty(exports, "PAYMENT_PLAN_REPOSITORY", { enumerable: true, get: function () { return constants_1.PAYMENT_PLAN_REPOSITORY; } });
12
+ Object.defineProperty(exports, "PAYMENT_CONFIG_REPOSITORY", { enumerable: true, get: function () { return constants_1.PAYMENT_CONFIG_REPOSITORY; } });
13
+ Object.defineProperty(exports, "WEBHOOK_IDEMPOTENCY_REPOSITORY", { enumerable: true, get: function () { return constants_1.WEBHOOK_IDEMPOTENCY_REPOSITORY; } });
14
+ Object.defineProperty(exports, "RECURRING_INVOICE_REPOSITORY", { enumerable: true, get: function () { return constants_1.RECURRING_INVOICE_REPOSITORY; } });
15
+ Object.defineProperty(exports, "PAYMENT_CUSTOMER_REPOSITORY", { enumerable: true, get: function () { return constants_1.PAYMENT_CUSTOMER_REPOSITORY; } });
16
+ Object.defineProperty(exports, "TRANSACTION_MANAGER", { enumerable: true, get: function () { return constants_1.TRANSACTION_MANAGER; } });
17
+ Object.defineProperty(exports, "PAYMENT_EVENT_LISTENER", { enumerable: true, get: function () { return constants_1.PAYMENT_EVENT_LISTENER; } });
18
+ Object.defineProperty(exports, "PAYMENT_EMAIL_SENDER", { enumerable: true, get: function () { return constants_1.PAYMENT_EMAIL_SENDER; } });
19
+ Object.defineProperty(exports, "PAYMENT_CLIENT_RESOLVER", { enumerable: true, get: function () { return constants_1.PAYMENT_CLIENT_RESOLVER; } });
20
+ Object.defineProperty(exports, "PAYMENT_EMAIL_BRANDING_RESOLVER", { enumerable: true, get: function () { return constants_1.PAYMENT_EMAIL_BRANDING_RESOLVER; } });
21
+ Object.defineProperty(exports, "PAYMENT_EMAIL_TEMPLATE_RENDERER", { enumerable: true, get: function () { return constants_1.PAYMENT_EMAIL_TEMPLATE_RENDERER; } });
22
+ Object.defineProperty(exports, "WEBHOOK_ERROR_REPORTER", { enumerable: true, get: function () { return constants_1.WEBHOOK_ERROR_REPORTER; } });
23
+ Object.defineProperty(exports, "DEFAULT_CURRENCY", { enumerable: true, get: function () { return constants_1.DEFAULT_CURRENCY; } });
24
+ Object.defineProperty(exports, "E_TRANSFER_CODE_PREFIX", { enumerable: true, get: function () { return constants_1.E_TRANSFER_CODE_PREFIX; } });
25
+ var invoice_service_1 = require("./services/invoice.service");
26
+ Object.defineProperty(exports, "InvoiceService", { enumerable: true, get: function () { return invoice_service_1.InvoiceService; } });
27
+ var invoice_number_service_1 = require("./services/invoice-number.service");
28
+ Object.defineProperty(exports, "InvoiceNumberService", { enumerable: true, get: function () { return invoice_number_service_1.InvoiceNumberService; } });
29
+ var payment_service_1 = require("./services/payment.service");
30
+ Object.defineProperty(exports, "PaymentService", { enumerable: true, get: function () { return payment_service_1.PaymentService; } });
31
+ var refund_service_1 = require("./services/refund.service");
32
+ Object.defineProperty(exports, "RefundService", { enumerable: true, get: function () { return refund_service_1.RefundService; } });
33
+ var payment_config_service_1 = require("./services/payment-config.service");
34
+ Object.defineProperty(exports, "PaymentConfigService", { enumerable: true, get: function () { return payment_config_service_1.PaymentConfigService; } });
35
+ var payment_plan_service_1 = require("./services/payment-plan.service");
36
+ Object.defineProperty(exports, "PaymentPlanService", { enumerable: true, get: function () { return payment_plan_service_1.PaymentPlanService; } });
37
+ var payment_email_service_1 = require("./services/payment-email.service");
38
+ Object.defineProperty(exports, "PaymentEmailService", { enumerable: true, get: function () { return payment_email_service_1.PaymentEmailService; } });
39
+ var recurring_invoice_service_1 = require("./services/recurring-invoice.service");
40
+ Object.defineProperty(exports, "RecurringInvoiceService", { enumerable: true, get: function () { return recurring_invoice_service_1.RecurringInvoiceService; } });
41
+ var customer_service_1 = require("./services/customer.service");
42
+ Object.defineProperty(exports, "CustomerService", { enumerable: true, get: function () { return customer_service_1.CustomerService; } });
43
+ var e_transfer_service_1 = require("./services/e-transfer.service");
44
+ Object.defineProperty(exports, "ETransferService", { enumerable: true, get: function () { return e_transfer_service_1.ETransferService; } });
45
+ var gateway_registry_service_1 = require("./gateways/gateway-registry.service");
46
+ Object.defineProperty(exports, "GatewayRegistryService", { enumerable: true, get: function () { return gateway_registry_service_1.GatewayRegistryService; } });
47
+ var exceptions_1 = require("./exceptions");
48
+ Object.defineProperty(exports, "PaymentException", { enumerable: true, get: function () { return exceptions_1.PaymentException; } });
49
+ Object.defineProperty(exports, "InvalidInvoiceStateException", { enumerable: true, get: function () { return exceptions_1.InvalidInvoiceStateException; } });
50
+ Object.defineProperty(exports, "PaymentAmountExceededException", { enumerable: true, get: function () { return exceptions_1.PaymentAmountExceededException; } });
51
+ Object.defineProperty(exports, "PaymentGatewayException", { enumerable: true, get: function () { return exceptions_1.PaymentGatewayException; } });
52
+ Object.defineProperty(exports, "DuplicatePaymentException", { enumerable: true, get: function () { return exceptions_1.DuplicatePaymentException; } });
53
+ Object.defineProperty(exports, "InvoiceNotPayableException", { enumerable: true, get: function () { return exceptions_1.InvoiceNotPayableException; } });
54
+ Object.defineProperty(exports, "InvoiceNumberExhaustedException", { enumerable: true, get: function () { return exceptions_1.InvoiceNumberExhaustedException; } });
55
+ Object.defineProperty(exports, "RefundNotAllowedException", { enumerable: true, get: function () { return exceptions_1.RefundNotAllowedException; } });
56
+ Object.defineProperty(exports, "InvalidPaymentStateException", { enumerable: true, get: function () { return exceptions_1.InvalidPaymentStateException; } });
57
+ Object.defineProperty(exports, "InvalidRecurringInvoiceStateException", { enumerable: true, get: function () { return exceptions_1.InvalidRecurringInvoiceStateException; } });
58
+ Object.defineProperty(exports, "UniqueConstraintViolationException", { enumerable: true, get: function () { return exceptions_1.UniqueConstraintViolationException; } });
59
+ var invoice_model_1 = require("./models/invoice.model");
60
+ Object.defineProperty(exports, "InvoiceModel", { enumerable: true, get: function () { return invoice_model_1.InvoiceModel; } });
61
+ Object.defineProperty(exports, "InvoiceStatusEnum", { enumerable: true, get: function () { return invoice_model_1.InvoiceStatusEnum; } });
62
+ Object.defineProperty(exports, "PaymentMethodEnum", { enumerable: true, get: function () { return invoice_model_1.PaymentMethodEnum; } });
63
+ Object.defineProperty(exports, "PaymentStatusEnum", { enumerable: true, get: function () { return invoice_model_1.PaymentStatusEnum; } });
64
+ Object.defineProperty(exports, "RefundStatusEnum", { enumerable: true, get: function () { return invoice_model_1.RefundStatusEnum; } });
65
+ Object.defineProperty(exports, "PaymentPlanStatusEnum", { enumerable: true, get: function () { return invoice_model_1.PaymentPlanStatusEnum; } });
66
+ Object.defineProperty(exports, "InstallmentStatusEnum", { enumerable: true, get: function () { return invoice_model_1.InstallmentStatusEnum; } });
67
+ var invoice_line_item_model_1 = require("./models/invoice-line-item.model");
68
+ Object.defineProperty(exports, "InvoiceLineItemModel", { enumerable: true, get: function () { return invoice_line_item_model_1.InvoiceLineItemModel; } });
69
+ var invoice_client_model_1 = require("./models/invoice-client.model");
70
+ Object.defineProperty(exports, "InvoiceClientModel", { enumerable: true, get: function () { return invoice_client_model_1.InvoiceClientModel; } });
71
+ var payment_model_1 = require("./models/payment.model");
72
+ Object.defineProperty(exports, "PaymentModel", { enumerable: true, get: function () { return payment_model_1.PaymentModel; } });
73
+ var refund_model_1 = require("./models/refund.model");
74
+ Object.defineProperty(exports, "RefundModel", { enumerable: true, get: function () { return refund_model_1.RefundModel; } });
75
+ var e_transfer_instructions_model_1 = require("./models/e-transfer-instructions.model");
76
+ Object.defineProperty(exports, "ETransferInstructionsModel", { enumerable: true, get: function () { return e_transfer_instructions_model_1.ETransferInstructionsModel; } });
77
+ var online_payment_session_model_1 = require("./models/online-payment-session.model");
78
+ Object.defineProperty(exports, "OnlinePaymentSessionModel", { enumerable: true, get: function () { return online_payment_session_model_1.OnlinePaymentSessionModel; } });
79
+ var payment_config_model_1 = require("./models/payment-config.model");
80
+ Object.defineProperty(exports, "PaymentConfigModel", { enumerable: true, get: function () { return payment_config_model_1.PaymentConfigModel; } });
81
+ Object.defineProperty(exports, "PaymentProviderModel", { enumerable: true, get: function () { return payment_config_model_1.PaymentProviderModel; } });
82
+ var payment_plan_model_1 = require("./models/payment-plan.model");
83
+ Object.defineProperty(exports, "PaymentPlanModel", { enumerable: true, get: function () { return payment_plan_model_1.PaymentPlanModel; } });
84
+ var payment_plan_installment_model_1 = require("./models/payment-plan-installment.model");
85
+ Object.defineProperty(exports, "PaymentPlanInstallmentModel", { enumerable: true, get: function () { return payment_plan_installment_model_1.PaymentPlanInstallmentModel; } });
86
+ var payment_method_setup_model_1 = require("./models/payment-method-setup.model");
87
+ Object.defineProperty(exports, "PaymentMethodSetupModel", { enumerable: true, get: function () { return payment_method_setup_model_1.PaymentMethodSetupModel; } });
88
+ var paginated_invoices_model_1 = require("./models/paginated-invoices.model");
89
+ Object.defineProperty(exports, "PaginatedInvoices", { enumerable: true, get: function () { return paginated_invoices_model_1.PaginatedInvoices; } });
90
+ var paginated_payment_plans_model_1 = require("./models/paginated-payment-plans.model");
91
+ Object.defineProperty(exports, "PaginatedPaymentPlans", { enumerable: true, get: function () { return paginated_payment_plans_model_1.PaginatedPaymentPlans; } });
92
+ var paginated_recurring_invoices_model_1 = require("./models/paginated-recurring-invoices.model");
93
+ Object.defineProperty(exports, "PaginatedRecurringInvoices", { enumerable: true, get: function () { return paginated_recurring_invoices_model_1.PaginatedRecurringInvoices; } });
94
+ var recurring_invoice_model_1 = require("./models/recurring-invoice.model");
95
+ Object.defineProperty(exports, "RecurringInvoiceModel", { enumerable: true, get: function () { return recurring_invoice_model_1.RecurringInvoiceModel; } });
96
+ var recurring_invoice_model_2 = require("./models/recurring-invoice.model");
97
+ Object.defineProperty(exports, "RecurringIntervalUnitEnum", { enumerable: true, get: function () { return recurring_invoice_model_2.RecurringIntervalUnitEnum; } });
98
+ Object.defineProperty(exports, "RecurringInvoiceStatusEnum", { enumerable: true, get: function () { return recurring_invoice_model_2.RecurringInvoiceStatusEnum; } });
99
+ var recurring_invoice_line_item_model_1 = require("./models/recurring-invoice-line-item.model");
100
+ Object.defineProperty(exports, "RecurringInvoiceLineItemModel", { enumerable: true, get: function () { return recurring_invoice_line_item_model_1.RecurringInvoiceLineItemModel; } });
101
+ var paginated_model_1 = require("./models/paginated.model");
102
+ Object.defineProperty(exports, "Paginated", { enumerable: true, get: function () { return paginated_model_1.Paginated; } });
103
+ var create_invoice_input_1 = require("./dto/create-invoice.input");
104
+ Object.defineProperty(exports, "CreateInvoiceInput", { enumerable: true, get: function () { return create_invoice_input_1.CreateInvoiceInput; } });
105
+ var create_line_item_input_1 = require("./dto/create-line-item.input");
106
+ Object.defineProperty(exports, "CreateLineItemInput", { enumerable: true, get: function () { return create_line_item_input_1.CreateLineItemInput; } });
107
+ var create_refund_input_1 = require("./dto/create-refund.input");
108
+ Object.defineProperty(exports, "CreateRefundInput", { enumerable: true, get: function () { return create_refund_input_1.CreateRefundInput; } });
109
+ var create_installment_input_1 = require("./dto/create-installment.input");
110
+ Object.defineProperty(exports, "CreateInstallmentInput", { enumerable: true, get: function () { return create_installment_input_1.CreateInstallmentInput; } });
111
+ var create_payment_plan_input_1 = require("./dto/create-payment-plan.input");
112
+ Object.defineProperty(exports, "CreatePaymentPlanInput", { enumerable: true, get: function () { return create_payment_plan_input_1.CreatePaymentPlanInput; } });
113
+ var create_recurring_invoice_input_1 = require("./dto/create-recurring-invoice.input");
114
+ Object.defineProperty(exports, "CreateRecurringInvoiceInput", { enumerable: true, get: function () { return create_recurring_invoice_input_1.CreateRecurringInvoiceInput; } });
115
+ var create_recurring_line_item_input_1 = require("./dto/create-recurring-line-item.input");
116
+ Object.defineProperty(exports, "CreateRecurringLineItemInput", { enumerable: true, get: function () { return create_recurring_line_item_input_1.CreateRecurringLineItemInput; } });
117
+ var record_manual_payment_input_1 = require("./dto/record-manual-payment.input");
118
+ Object.defineProperty(exports, "RecordManualPaymentInput", { enumerable: true, get: function () { return record_manual_payment_input_1.RecordManualPaymentInput; } });
119
+ var update_payment_config_input_1 = require("./dto/update-payment-config.input");
120
+ Object.defineProperty(exports, "UpdatePaymentConfigInput", { enumerable: true, get: function () { return update_payment_config_input_1.UpdatePaymentConfigInput; } });
121
+ var update_invoice_metadata_input_1 = require("./dto/update-invoice-metadata.input");
122
+ Object.defineProperty(exports, "UpdateInvoiceMetadataInput", { enumerable: true, get: function () { return update_invoice_metadata_input_1.UpdateInvoiceMetadataInput; } });
123
+ var update_recurring_template_input_1 = require("./dto/update-recurring-template.input");
124
+ Object.defineProperty(exports, "UpdateRecurringTemplateInput", { enumerable: true, get: function () { return update_recurring_template_input_1.UpdateRecurringTemplateInput; } });
125
+ var upsert_payment_provider_input_1 = require("./dto/upsert-payment-provider.input");
126
+ Object.defineProperty(exports, "UpsertPaymentProviderInput", { enumerable: true, get: function () { return upsert_payment_provider_input_1.UpsertPaymentProviderInput; } });
127
+ var invoice_filter_input_1 = require("./dto/invoice-filter.input");
128
+ Object.defineProperty(exports, "InvoiceFilterInput", { enumerable: true, get: function () { return invoice_filter_input_1.InvoiceFilterInput; } });
129
+ var payment_plan_filter_input_1 = require("./dto/payment-plan-filter.input");
130
+ Object.defineProperty(exports, "PaymentPlanFilterInput", { enumerable: true, get: function () { return payment_plan_filter_input_1.PaymentPlanFilterInput; } });
131
+ var recurring_invoice_filter_input_1 = require("./dto/recurring-invoice-filter.input");
132
+ Object.defineProperty(exports, "RecurringInvoiceFilterInput", { enumerable: true, get: function () { return recurring_invoice_filter_input_1.RecurringInvoiceFilterInput; } });
133
+ var is_metadata_1 = require("./dto/validators/is-metadata");
134
+ Object.defineProperty(exports, "IsMetadata", { enumerable: true, get: function () { return is_metadata_1.IsMetadata; } });
135
+ var stripe_gateway_1 = require("./gateways/stripe/stripe.gateway");
136
+ Object.defineProperty(exports, "StripeGateway", { enumerable: true, get: function () { return stripe_gateway_1.StripeGateway; } });
137
+ var stripe_webhook_controller_1 = require("./gateways/stripe/stripe-webhook.controller");
138
+ Object.defineProperty(exports, "PaymentsWebhook", { enumerable: true, get: function () { return stripe_webhook_controller_1.PaymentsWebhook; } });
139
+ Object.defineProperty(exports, "PAYMENTS_WEBHOOK", { enumerable: true, get: function () { return stripe_webhook_controller_1.PAYMENTS_WEBHOOK; } });
140
+ var static_branding_resolver_1 = require("./services/static-branding-resolver");
141
+ Object.defineProperty(exports, "StaticBrandingResolver", { enumerable: true, get: function () { return static_branding_resolver_1.StaticBrandingResolver; } });
142
+ var recurring_interval_util_1 = require("./services/recurring-interval.util");
143
+ Object.defineProperty(exports, "computeNextInvoiceDate", { enumerable: true, get: function () { return recurring_interval_util_1.computeNextInvoiceDate; } });
144
+ Object.defineProperty(exports, "computeCycleCount", { enumerable: true, get: function () { return recurring_interval_util_1.computeCycleCount; } });
145
+ var default_payment_email_templates_1 = require("./services/default-payment-email-templates");
146
+ Object.defineProperty(exports, "DefaultPaymentEmailTemplateRenderer", { enumerable: true, get: function () { return default_payment_email_templates_1.DefaultPaymentEmailTemplateRenderer; } });
147
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,23 @@
1
+ import type { Invoice, InvoiceWithItems, InvoiceLineItem, InvoiceFilter, CreateInvoiceData, CreateLineItemData } from '../types';
2
+ export interface IInvoiceRepository {
3
+ create(data: CreateInvoiceData): Promise<Invoice>;
4
+ findById(id: string): Promise<Invoice | null>;
5
+ findByIdForUpdate(id: string): Promise<Invoice | null>;
6
+ findByIdWithItems(id: string): Promise<InvoiceWithItems | null>;
7
+ findByDivision(divisionId: string, filter?: InvoiceFilter, skip?: number, take?: number): Promise<{
8
+ items: Invoice[];
9
+ totalCount: number;
10
+ }>;
11
+ findByClientDetailsIds(clientDetailsIds: string[], skip?: number, take?: number): Promise<{
12
+ items: Invoice[];
13
+ totalCount: number;
14
+ }>;
15
+ findByETransferCode(code: string): Promise<Invoice | null>;
16
+ update(id: string, data: Partial<Invoice>): Promise<Invoice>;
17
+ findMaxInvoiceNumber(prefix: string): Promise<string | null>;
18
+ findOverdue(now: Date): Promise<Invoice[]>;
19
+ createLineItem(data: CreateLineItemData): Promise<InvoiceLineItem>;
20
+ deleteLineItem(id: string): Promise<void>;
21
+ findLineItemsByInvoice(invoiceId: string): Promise<InvoiceLineItem[]>;
22
+ withTransaction<T>(fn: (repo: IInvoiceRepository) => Promise<T>): Promise<T>;
23
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=invoice-repository.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invoice-repository.interface.js","sourceRoot":"","sources":["../../src/interfaces/invoice-repository.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ import type { PaymentConfig, PaymentProvider, CreatePaymentConfigData } from '../types';
2
+ export interface IPaymentConfigRepository {
3
+ findByDivisionId(divisionId: string): Promise<PaymentConfig | null>;
4
+ upsert(data: CreatePaymentConfigData): Promise<PaymentConfig>;
5
+ findProvidersByConfigId(configId: string): Promise<PaymentProvider[]>;
6
+ upsertProvider(configId: string, providerType: string, data: {
7
+ isActive?: boolean;
8
+ config?: Record<string, unknown> | null;
9
+ }): Promise<PaymentProvider>;
10
+ deactivateProvider(configId: string, providerType: string): Promise<void>;
11
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=payment-config-repository.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-config-repository.interface.js","sourceRoot":"","sources":["../../src/interfaces/payment-config-repository.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import type { PaymentCustomer, CreatePaymentCustomerData } from '../types/payment-customer.types';
2
+ export interface IPaymentCustomerRepository {
3
+ create(data: CreatePaymentCustomerData): Promise<PaymentCustomer>;
4
+ findByClientAndProvider(divisionId: string, clientDetailsId: string, provider: string): Promise<PaymentCustomer | null>;
5
+ findByProviderCustomerId(providerCustomerId: string): Promise<PaymentCustomer | null>;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=payment-customer-repository.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-customer-repository.interface.js","sourceRoot":"","sources":["../../src/interfaces/payment-customer-repository.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,74 @@
1
+ import type { Invoice, InvoiceWithItems, Payment, Refund } from '../types';
2
+ import type { ETransferInstructions } from '../services/e-transfer.service';
3
+ export interface IPaymentEmailSender {
4
+ send(params: {
5
+ to: string;
6
+ from: {
7
+ email: string;
8
+ name?: string;
9
+ };
10
+ subject: string;
11
+ html: string;
12
+ text?: string;
13
+ }): Promise<void>;
14
+ }
15
+ export interface IPaymentClientResolver {
16
+ resolveClient(clientDetailsId: string): Promise<{
17
+ email: string;
18
+ name: string;
19
+ } | null>;
20
+ }
21
+ export interface PaymentEmailBrandingConfig {
22
+ appName: string;
23
+ primaryColor: string;
24
+ fromEmail: string;
25
+ fromName?: string;
26
+ logoUrl?: string;
27
+ companyName?: string;
28
+ supportEmail?: string;
29
+ locale?: string;
30
+ }
31
+ export interface IPaymentEmailBrandingResolver {
32
+ resolveBranding(divisionId: string): Promise<PaymentEmailBrandingConfig>;
33
+ }
34
+ export interface RenderedPaymentEmail {
35
+ subject: string;
36
+ html: string;
37
+ text?: string;
38
+ }
39
+ export interface IPaymentEmailTemplateRenderer {
40
+ renderInvoiceNotification(params: InvoiceEmailParams): RenderedPaymentEmail;
41
+ renderETransferInstructions(params: ETransferEmailParams): RenderedPaymentEmail;
42
+ renderPaymentConfirmation(params: PaymentConfirmationEmailParams): RenderedPaymentEmail;
43
+ renderOverdueReminder(params: OverdueReminderEmailParams): RenderedPaymentEmail;
44
+ renderRefundConfirmation(params: RefundConfirmationEmailParams): RenderedPaymentEmail;
45
+ }
46
+ export interface InvoiceEmailParams {
47
+ invoice: InvoiceWithItems;
48
+ clientName: string;
49
+ branding: PaymentEmailBrandingConfig;
50
+ }
51
+ export interface ETransferEmailParams {
52
+ invoice: Invoice;
53
+ instructions: ETransferInstructions;
54
+ clientName: string;
55
+ branding: PaymentEmailBrandingConfig;
56
+ }
57
+ export interface PaymentConfirmationEmailParams {
58
+ payment: Payment;
59
+ invoice: Invoice;
60
+ clientName: string;
61
+ branding: PaymentEmailBrandingConfig;
62
+ }
63
+ export interface OverdueReminderEmailParams {
64
+ invoice: Invoice;
65
+ clientName: string;
66
+ branding: PaymentEmailBrandingConfig;
67
+ }
68
+ export interface RefundConfirmationEmailParams {
69
+ refund: Refund;
70
+ payment: Payment;
71
+ invoice: Invoice;
72
+ clientName: string;
73
+ branding: PaymentEmailBrandingConfig;
74
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=payment-email.interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-email.interfaces.js","sourceRoot":"","sources":["../../src/interfaces/payment-email.interfaces.ts"],"names":[],"mappings":""}
@@ -0,0 +1,61 @@
1
+ export interface InvoiceLineItemEvent {
2
+ id: string;
3
+ description: string;
4
+ quantity: number;
5
+ unitPrice: number;
6
+ isTaxable: boolean;
7
+ referenceType: string | null;
8
+ referenceId: string | null;
9
+ metadata: Record<string, unknown> | null;
10
+ }
11
+ export interface PaidInvoiceEvent {
12
+ invoiceId: string;
13
+ divisionId: string;
14
+ referenceType: string | null;
15
+ referenceId: string | null;
16
+ metadata: Record<string, unknown> | null;
17
+ lineItems: InvoiceLineItemEvent[];
18
+ recurringInvoiceId: string | null;
19
+ }
20
+ export interface RefundedInvoiceEvent {
21
+ invoiceId: string;
22
+ divisionId: string;
23
+ referenceType: string | null;
24
+ referenceId: string | null;
25
+ newInvoiceStatus: string;
26
+ metadata: Record<string, unknown> | null;
27
+ lineItems: InvoiceLineItemEvent[];
28
+ }
29
+ export interface RecurringInvoiceGeneratedEvent {
30
+ recurringInvoiceId: string;
31
+ invoiceId: string;
32
+ divisionId: string;
33
+ referenceType: string | null;
34
+ referenceId: string | null;
35
+ isAutoCharge: boolean;
36
+ metadata: Record<string, unknown> | null;
37
+ }
38
+ export interface RecurringPaymentFailedEvent {
39
+ recurringInvoiceId: string;
40
+ invoiceId: string;
41
+ divisionId: string;
42
+ referenceType: string | null;
43
+ referenceId: string | null;
44
+ failureReason: string;
45
+ consecutiveFailures: number;
46
+ isPaused: boolean;
47
+ metadata: Record<string, unknown> | null;
48
+ }
49
+ export interface RecurringInvoicePausedEvent {
50
+ recurringInvoiceId: string;
51
+ divisionId: string;
52
+ reason: string;
53
+ metadata: Record<string, unknown> | null;
54
+ }
55
+ export interface IPaymentEventListener {
56
+ onInvoicePaid(event: PaidInvoiceEvent): Promise<void>;
57
+ onInvoiceRefunded?(event: RefundedInvoiceEvent): Promise<void>;
58
+ onRecurringInvoiceGenerated?(event: RecurringInvoiceGeneratedEvent): Promise<void>;
59
+ onRecurringPaymentFailed?(event: RecurringPaymentFailedEvent): Promise<void>;
60
+ onRecurringInvoicePaused?(event: RecurringInvoicePausedEvent): Promise<void>;
61
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=payment-event-listener.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-event-listener.interface.js","sourceRoot":"","sources":["../../src/interfaces/payment-event-listener.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,16 @@
1
+ import type { PaymentPlan, PaymentPlanInstallment, CreatePaymentPlanData, CreateInstallmentData, PaymentPlanFilter } from '../types';
2
+ export interface IPaymentPlanRepository {
3
+ create(data: CreatePaymentPlanData): Promise<PaymentPlan>;
4
+ findById(id: string): Promise<PaymentPlan | null>;
5
+ findByDivision(divisionId: string, filter?: PaymentPlanFilter, skip?: number, take?: number): Promise<{
6
+ items: PaymentPlan[];
7
+ totalCount: number;
8
+ }>;
9
+ update(id: string, data: Partial<PaymentPlan>): Promise<PaymentPlan>;
10
+ createInstallment(data: CreateInstallmentData): Promise<PaymentPlanInstallment>;
11
+ findInstallmentById(id: string): Promise<PaymentPlanInstallment | null>;
12
+ findInstallmentByInvoiceId(invoiceId: string): Promise<PaymentPlanInstallment | null>;
13
+ updateInstallment(id: string, data: Partial<PaymentPlanInstallment>): Promise<PaymentPlanInstallment>;
14
+ findInstallmentsByPlan(paymentPlanId: string): Promise<PaymentPlanInstallment[]>;
15
+ withTransaction<T>(fn: (repo: IPaymentPlanRepository) => Promise<T>): Promise<T>;
16
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=payment-plan-repository.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-plan-repository.interface.js","sourceRoot":"","sources":["../../src/interfaces/payment-plan-repository.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ import type { Payment, PaymentStatus, CreatePaymentData } from '../types';
2
+ export interface IPaymentRepository {
3
+ create(data: CreatePaymentData): Promise<Payment>;
4
+ findById(id: string): Promise<Payment | null>;
5
+ findByInvoiceId(invoiceId: string): Promise<Payment[]>;
6
+ findByProviderPaymentId(provider: string, providerPaymentId: string): Promise<Payment | null>;
7
+ update(id: string, data: Partial<Payment>): Promise<Payment>;
8
+ findPendingByInvoiceId(invoiceId: string): Promise<Payment[]>;
9
+ findStaleByStatuses(statuses: PaymentStatus[], olderThan: Date): Promise<Payment[]>;
10
+ findByIdForUpdate(id: string): Promise<Payment | null>;
11
+ sumPendingConfirmationByInvoiceId(invoiceId: string): Promise<number>;
12
+ withTransaction<T>(fn: (repo: IPaymentRepository) => Promise<T>): Promise<T>;
13
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=payment-repository.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-repository.interface.js","sourceRoot":"","sources":["../../src/interfaces/payment-repository.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,16 @@
1
+ import type { RecurringInvoice, RecurringInvoiceWithItems, RecurringInvoiceLineItem, CreateRecurringInvoiceData, CreateRecurringLineItemData, RecurringInvoiceFilter } from '../types/recurring-invoice.types';
2
+ export interface IRecurringInvoiceRepository {
3
+ create(data: CreateRecurringInvoiceData): Promise<RecurringInvoice>;
4
+ findById(id: string): Promise<RecurringInvoice | null>;
5
+ findByIdWithItems(id: string): Promise<RecurringInvoiceWithItems | null>;
6
+ findByDivision(divisionId: string, filter?: RecurringInvoiceFilter, skip?: number, take?: number): Promise<{
7
+ items: RecurringInvoice[];
8
+ totalCount: number;
9
+ }>;
10
+ update(id: string, data: Partial<RecurringInvoice>): Promise<RecurringInvoice>;
11
+ createLineItem(data: CreateRecurringLineItemData): Promise<RecurringInvoiceLineItem>;
12
+ deleteLineItem(id: string): Promise<void>;
13
+ findLineItemsByRecurringInvoice(recurringInvoiceId: string): Promise<RecurringInvoiceLineItem[]>;
14
+ replaceLineItems(recurringInvoiceId: string, items: CreateRecurringLineItemData[]): Promise<RecurringInvoiceLineItem[]>;
15
+ claimDueRecurringInvoices(now: Date, limit: number, computeNextDate: (config: RecurringInvoice) => Date): Promise<RecurringInvoiceWithItems[]>;
16
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=recurring-invoice-repository.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recurring-invoice-repository.interface.js","sourceRoot":"","sources":["../../src/interfaces/recurring-invoice-repository.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import type { Refund, CreateRefundData } from '../types';
2
+ export interface IRefundRepository {
3
+ create(data: CreateRefundData): Promise<Refund>;
4
+ findById(id: string): Promise<Refund | null>;
5
+ findByPaymentId(paymentId: string): Promise<Refund[]>;
6
+ update(id: string, data: Partial<Refund>): Promise<Refund>;
7
+ withTransaction<T>(fn: (repo: IRefundRepository) => Promise<T>): Promise<T>;
8
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=refund-repository.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refund-repository.interface.js","sourceRoot":"","sources":["../../src/interfaces/refund-repository.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ import type { IInvoiceRepository } from './invoice-repository.interface';
2
+ import type { IPaymentRepository } from './payment-repository.interface';
3
+ import type { IRefundRepository } from './refund-repository.interface';
4
+ import type { IPaymentPlanRepository } from './payment-plan-repository.interface';
5
+ import type { IPaymentConfigRepository } from './payment-config-repository.interface';
6
+ import type { IWebhookIdempotencyRepository } from './webhook-idempotency-repository.interface';
7
+ export interface TransactionRepositories {
8
+ invoices: IInvoiceRepository;
9
+ payments: IPaymentRepository;
10
+ refunds: IRefundRepository;
11
+ paymentPlans?: IPaymentPlanRepository;
12
+ config: IPaymentConfigRepository;
13
+ webhookIdempotency: IWebhookIdempotencyRepository;
14
+ }
15
+ export interface ITransactionManager {
16
+ runInTransaction<T>(fn: (repos: TransactionRepositories) => Promise<T>, options?: {
17
+ timeout?: number;
18
+ }): Promise<T>;
19
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=transaction-manager.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction-manager.interface.js","sourceRoot":"","sources":["../../src/interfaces/transaction-manager.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export interface IWebhookIdempotencyRepository {
2
+ exists(eventId: string): Promise<boolean>;
3
+ record(eventId: string): Promise<void>;
4
+ cleanupBefore(date: Date): Promise<number>;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=webhook-idempotency-repository.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhook-idempotency-repository.interface.js","sourceRoot":"","sources":["../../src/interfaces/webhook-idempotency-repository.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ export declare class ETransferInstructionsModel {
2
+ invoiceNumber: string;
3
+ amount: number;
4
+ currency: string;
5
+ eTransferCode: string;
6
+ eTransferEmail: string;
7
+ eTransferRecipient: string;
8
+ securityQuestion?: string;
9
+ securityAnswer?: string;
10
+ message: string;
11
+ }
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ETransferInstructionsModel = void 0;
13
+ const graphql_1 = require("@nestjs/graphql");
14
+ let ETransferInstructionsModel = class ETransferInstructionsModel {
15
+ };
16
+ exports.ETransferInstructionsModel = ETransferInstructionsModel;
17
+ __decorate([
18
+ (0, graphql_1.Field)(),
19
+ __metadata("design:type", String)
20
+ ], ETransferInstructionsModel.prototype, "invoiceNumber", void 0);
21
+ __decorate([
22
+ (0, graphql_1.Field)(() => graphql_1.Int),
23
+ __metadata("design:type", Number)
24
+ ], ETransferInstructionsModel.prototype, "amount", void 0);
25
+ __decorate([
26
+ (0, graphql_1.Field)(),
27
+ __metadata("design:type", String)
28
+ ], ETransferInstructionsModel.prototype, "currency", void 0);
29
+ __decorate([
30
+ (0, graphql_1.Field)(),
31
+ __metadata("design:type", String)
32
+ ], ETransferInstructionsModel.prototype, "eTransferCode", void 0);
33
+ __decorate([
34
+ (0, graphql_1.Field)(),
35
+ __metadata("design:type", String)
36
+ ], ETransferInstructionsModel.prototype, "eTransferEmail", void 0);
37
+ __decorate([
38
+ (0, graphql_1.Field)(),
39
+ __metadata("design:type", String)
40
+ ], ETransferInstructionsModel.prototype, "eTransferRecipient", void 0);
41
+ __decorate([
42
+ (0, graphql_1.Field)({ nullable: true }),
43
+ __metadata("design:type", String)
44
+ ], ETransferInstructionsModel.prototype, "securityQuestion", void 0);
45
+ __decorate([
46
+ (0, graphql_1.Field)({ nullable: true }),
47
+ __metadata("design:type", String)
48
+ ], ETransferInstructionsModel.prototype, "securityAnswer", void 0);
49
+ __decorate([
50
+ (0, graphql_1.Field)(),
51
+ __metadata("design:type", String)
52
+ ], ETransferInstructionsModel.prototype, "message", void 0);
53
+ exports.ETransferInstructionsModel = ETransferInstructionsModel = __decorate([
54
+ (0, graphql_1.ObjectType)('ETransferInstructions')
55
+ ], ETransferInstructionsModel);
56
+ //# sourceMappingURL=e-transfer-instructions.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"e-transfer-instructions.model.js","sourceRoot":"","sources":["../../src/models/e-transfer-instructions.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAyD;AAGlD,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;CA2BtC,CAAA;AA3BY,gEAA0B;AAErC;IADC,IAAA,eAAK,GAAE;;iEACc;AAGtB;IADC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,aAAG,CAAC;;0DACF;AAGf;IADC,IAAA,eAAK,GAAE;;4DACS;AAGjB;IADC,IAAA,eAAK,GAAE;;iEACc;AAGtB;IADC,IAAA,eAAK,GAAE;;kEACe;AAGvB;IADC,IAAA,eAAK,GAAE;;sEACmB;AAG3B;IADC,IAAA,eAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oEACA;AAG1B;IADC,IAAA,eAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kEACF;AAGxB;IADC,IAAA,eAAK,GAAE;;2DACQ;qCA1BL,0BAA0B;IADtC,IAAA,oBAAU,EAAC,uBAAuB,CAAC;GACvB,0BAA0B,CA2BtC"}