@hed-hog/billing 0.0.2

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 (232) hide show
  1. package/dist/adapters/billing-gateway-registry.d.ts +8 -0
  2. package/dist/adapters/billing-gateway-registry.d.ts.map +1 -0
  3. package/dist/adapters/billing-gateway-registry.js +33 -0
  4. package/dist/adapters/billing-gateway-registry.js.map +1 -0
  5. package/dist/adapters/mercadopago.adapter.d.ts +44 -0
  6. package/dist/adapters/mercadopago.adapter.d.ts.map +1 -0
  7. package/dist/adapters/mercadopago.adapter.js +68 -0
  8. package/dist/adapters/mercadopago.adapter.js.map +1 -0
  9. package/dist/adapters/pagarme.adapter.d.ts +44 -0
  10. package/dist/adapters/pagarme.adapter.d.ts.map +1 -0
  11. package/dist/adapters/pagarme.adapter.js +68 -0
  12. package/dist/adapters/pagarme.adapter.js.map +1 -0
  13. package/dist/adapters/payment-gateway.adapter.d.ts +15 -0
  14. package/dist/adapters/payment-gateway.adapter.d.ts.map +1 -0
  15. package/dist/adapters/payment-gateway.adapter.js +3 -0
  16. package/dist/adapters/payment-gateway.adapter.js.map +1 -0
  17. package/dist/adapters/stripe.adapter.d.ts +44 -0
  18. package/dist/adapters/stripe.adapter.d.ts.map +1 -0
  19. package/dist/adapters/stripe.adapter.js +69 -0
  20. package/dist/adapters/stripe.adapter.js.map +1 -0
  21. package/dist/billing-contracts.controller.d.ts +22 -0
  22. package/dist/billing-contracts.controller.d.ts.map +1 -0
  23. package/dist/billing-contracts.controller.js +84 -0
  24. package/dist/billing-contracts.controller.js.map +1 -0
  25. package/dist/billing-coupons.controller.d.ts +22 -0
  26. package/dist/billing-coupons.controller.d.ts.map +1 -0
  27. package/dist/billing-coupons.controller.js +84 -0
  28. package/dist/billing-coupons.controller.js.map +1 -0
  29. package/dist/billing-dashboard.controller.d.ts +13 -0
  30. package/dist/billing-dashboard.controller.d.ts.map +1 -0
  31. package/dist/billing-dashboard.controller.js +36 -0
  32. package/dist/billing-dashboard.controller.js.map +1 -0
  33. package/dist/billing-entitlements.controller.d.ts +19 -0
  34. package/dist/billing-entitlements.controller.d.ts.map +1 -0
  35. package/dist/billing-entitlements.controller.js +62 -0
  36. package/dist/billing-entitlements.controller.js.map +1 -0
  37. package/dist/billing-gateways.controller.d.ts +8 -0
  38. package/dist/billing-gateways.controller.d.ts.map +1 -0
  39. package/dist/billing-gateways.controller.js +50 -0
  40. package/dist/billing-gateways.controller.js.map +1 -0
  41. package/dist/billing-invoices.controller.d.ts +18 -0
  42. package/dist/billing-invoices.controller.d.ts.map +1 -0
  43. package/dist/billing-invoices.controller.js +61 -0
  44. package/dist/billing-invoices.controller.js.map +1 -0
  45. package/dist/billing-offers.controller.d.ts +22 -0
  46. package/dist/billing-offers.controller.d.ts.map +1 -0
  47. package/dist/billing-offers.controller.js +84 -0
  48. package/dist/billing-offers.controller.js.map +1 -0
  49. package/dist/billing-orders.controller.d.ts +19 -0
  50. package/dist/billing-orders.controller.d.ts.map +1 -0
  51. package/dist/billing-orders.controller.js +62 -0
  52. package/dist/billing-orders.controller.js.map +1 -0
  53. package/dist/billing-payments.controller.d.ts +17 -0
  54. package/dist/billing-payments.controller.d.ts.map +1 -0
  55. package/dist/billing-payments.controller.js +51 -0
  56. package/dist/billing-payments.controller.js.map +1 -0
  57. package/dist/billing-prices.controller.d.ts +22 -0
  58. package/dist/billing-prices.controller.d.ts.map +1 -0
  59. package/dist/billing-prices.controller.js +84 -0
  60. package/dist/billing-prices.controller.js.map +1 -0
  61. package/dist/billing-products.controller.d.ts +22 -0
  62. package/dist/billing-products.controller.d.ts.map +1 -0
  63. package/dist/billing-products.controller.js +84 -0
  64. package/dist/billing-products.controller.js.map +1 -0
  65. package/dist/billing-refunds.controller.d.ts +16 -0
  66. package/dist/billing-refunds.controller.d.ts.map +1 -0
  67. package/dist/billing-refunds.controller.js +41 -0
  68. package/dist/billing-refunds.controller.js.map +1 -0
  69. package/dist/billing-subscriptions.controller.d.ts +22 -0
  70. package/dist/billing-subscriptions.controller.d.ts.map +1 -0
  71. package/dist/billing-subscriptions.controller.js +92 -0
  72. package/dist/billing-subscriptions.controller.js.map +1 -0
  73. package/dist/billing-webhooks.controller.d.ts +16 -0
  74. package/dist/billing-webhooks.controller.d.ts.map +1 -0
  75. package/dist/billing-webhooks.controller.js +41 -0
  76. package/dist/billing-webhooks.controller.js.map +1 -0
  77. package/dist/billing.module.d.ts +3 -0
  78. package/dist/billing.module.d.ts.map +1 -0
  79. package/dist/billing.module.js +61 -0
  80. package/dist/billing.module.js.map +1 -0
  81. package/dist/billing.service.d.ts +169 -0
  82. package/dist/billing.service.d.ts.map +1 -0
  83. package/dist/billing.service.js +290 -0
  84. package/dist/billing.service.js.map +1 -0
  85. package/dist/dto/create-contract.dto.d.ts +11 -0
  86. package/dist/dto/create-contract.dto.d.ts.map +1 -0
  87. package/dist/dto/create-contract.dto.js +52 -0
  88. package/dist/dto/create-contract.dto.js.map +1 -0
  89. package/dist/dto/create-coupon.dto.d.ts +12 -0
  90. package/dist/dto/create-coupon.dto.d.ts.map +1 -0
  91. package/dist/dto/create-coupon.dto.js +60 -0
  92. package/dist/dto/create-coupon.dto.js.map +1 -0
  93. package/dist/dto/create-entitlement.dto.d.ts +12 -0
  94. package/dist/dto/create-entitlement.dto.d.ts.map +1 -0
  95. package/dist/dto/create-entitlement.dto.js +54 -0
  96. package/dist/dto/create-entitlement.dto.js.map +1 -0
  97. package/dist/dto/create-offer.dto.d.ts +7 -0
  98. package/dist/dto/create-offer.dto.d.ts.map +1 -0
  99. package/dist/dto/create-offer.dto.js +35 -0
  100. package/dist/dto/create-offer.dto.js.map +1 -0
  101. package/dist/dto/create-order.dto.d.ts +12 -0
  102. package/dist/dto/create-order.dto.d.ts.map +1 -0
  103. package/dist/dto/create-order.dto.js +65 -0
  104. package/dist/dto/create-order.dto.js.map +1 -0
  105. package/dist/dto/create-price.dto.d.ts +15 -0
  106. package/dist/dto/create-price.dto.d.ts.map +1 -0
  107. package/dist/dto/create-price.dto.js +76 -0
  108. package/dist/dto/create-price.dto.js.map +1 -0
  109. package/dist/dto/create-product.dto.d.ts +9 -0
  110. package/dist/dto/create-product.dto.d.ts.map +1 -0
  111. package/dist/dto/create-product.dto.js +45 -0
  112. package/dist/dto/create-product.dto.js.map +1 -0
  113. package/dist/dto/create-subscription.dto.d.ts +14 -0
  114. package/dist/dto/create-subscription.dto.d.ts.map +1 -0
  115. package/dist/dto/create-subscription.dto.js +67 -0
  116. package/dist/dto/create-subscription.dto.js.map +1 -0
  117. package/dist/dto/update-contract.dto.d.ts +6 -0
  118. package/dist/dto/update-contract.dto.d.ts.map +1 -0
  119. package/dist/dto/update-contract.dto.js +9 -0
  120. package/dist/dto/update-contract.dto.js.map +1 -0
  121. package/dist/dto/update-coupon.dto.d.ts +6 -0
  122. package/dist/dto/update-coupon.dto.d.ts.map +1 -0
  123. package/dist/dto/update-coupon.dto.js +9 -0
  124. package/dist/dto/update-coupon.dto.js.map +1 -0
  125. package/dist/dto/update-offer.dto.d.ts +6 -0
  126. package/dist/dto/update-offer.dto.d.ts.map +1 -0
  127. package/dist/dto/update-offer.dto.js +9 -0
  128. package/dist/dto/update-offer.dto.js.map +1 -0
  129. package/dist/dto/update-order.dto.d.ts +6 -0
  130. package/dist/dto/update-order.dto.d.ts.map +1 -0
  131. package/dist/dto/update-order.dto.js +9 -0
  132. package/dist/dto/update-order.dto.js.map +1 -0
  133. package/dist/dto/update-price.dto.d.ts +6 -0
  134. package/dist/dto/update-price.dto.d.ts.map +1 -0
  135. package/dist/dto/update-price.dto.js +9 -0
  136. package/dist/dto/update-price.dto.js.map +1 -0
  137. package/dist/dto/update-product.dto.d.ts +6 -0
  138. package/dist/dto/update-product.dto.d.ts.map +1 -0
  139. package/dist/dto/update-product.dto.js +9 -0
  140. package/dist/dto/update-product.dto.js.map +1 -0
  141. package/dist/dto/update-subscription.dto.d.ts +6 -0
  142. package/dist/dto/update-subscription.dto.d.ts.map +1 -0
  143. package/dist/dto/update-subscription.dto.js +9 -0
  144. package/dist/dto/update-subscription.dto.js.map +1 -0
  145. package/dist/index.d.ts +32 -0
  146. package/dist/index.d.ts.map +1 -0
  147. package/dist/index.js +48 -0
  148. package/dist/index.js.map +1 -0
  149. package/hedhog/data/menu.yaml +284 -0
  150. package/hedhog/data/role.yaml +7 -0
  151. package/hedhog/data/route.yaml +422 -0
  152. package/hedhog/frontend/app/_lib/billing-mocks.ts.ejs +270 -0
  153. package/hedhog/frontend/app/contracts/page.tsx.ejs +562 -0
  154. package/hedhog/frontend/app/coupons/page.tsx.ejs +669 -0
  155. package/hedhog/frontend/app/entitlements/page.tsx.ejs +526 -0
  156. package/hedhog/frontend/app/gateways/page.tsx.ejs +308 -0
  157. package/hedhog/frontend/app/invoices/page.tsx.ejs +179 -0
  158. package/hedhog/frontend/app/offers/page.tsx.ejs +483 -0
  159. package/hedhog/frontend/app/orders/page.tsx.ejs +424 -0
  160. package/hedhog/frontend/app/page.tsx.ejs +186 -0
  161. package/hedhog/frontend/app/payments/page.tsx.ejs +187 -0
  162. package/hedhog/frontend/app/prices/page.tsx.ejs +704 -0
  163. package/hedhog/frontend/app/products/page.tsx.ejs +568 -0
  164. package/hedhog/frontend/app/refunds/page.tsx.ejs +174 -0
  165. package/hedhog/frontend/app/reports/page.tsx.ejs +177 -0
  166. package/hedhog/frontend/app/subscriptions/page.tsx.ejs +283 -0
  167. package/hedhog/frontend/app/webhooks/page.tsx.ejs +172 -0
  168. package/hedhog/frontend/messages/en.json +551 -0
  169. package/hedhog/frontend/messages/pt.json +563 -0
  170. package/hedhog/table/billing_contract.yaml +37 -0
  171. package/hedhog/table/billing_contract_seat.yaml +28 -0
  172. package/hedhog/table/billing_coupon.yaml +42 -0
  173. package/hedhog/table/billing_entitlement.yaml +41 -0
  174. package/hedhog/table/billing_entitlement_event.yaml +20 -0
  175. package/hedhog/table/billing_invoice.yaml +60 -0
  176. package/hedhog/table/billing_invoice_item.yaml +25 -0
  177. package/hedhog/table/billing_offer.yaml +22 -0
  178. package/hedhog/table/billing_offer_price.yaml +23 -0
  179. package/hedhog/table/billing_order.yaml +50 -0
  180. package/hedhog/table/billing_order_item.yaml +35 -0
  181. package/hedhog/table/billing_payment.yaml +66 -0
  182. package/hedhog/table/billing_payment_method.yaml +49 -0
  183. package/hedhog/table/billing_payment_provider.yaml +21 -0
  184. package/hedhog/table/billing_price.yaml +53 -0
  185. package/hedhog/table/billing_product.yaml +31 -0
  186. package/hedhog/table/billing_product_item.yaml +24 -0
  187. package/hedhog/table/billing_provider_event.yaml +31 -0
  188. package/hedhog/table/billing_refund.yaml +41 -0
  189. package/hedhog/table/billing_seat_allocation.yaml +42 -0
  190. package/hedhog/table/billing_subscription.yaml +66 -0
  191. package/hedhog/table/billing_subscription_event.yaml +20 -0
  192. package/hedhog/table/billing_subscription_item.yaml +29 -0
  193. package/package.json +37 -0
  194. package/src/adapters/billing-gateway-registry.ts +23 -0
  195. package/src/adapters/mercadopago.adapter.ts +66 -0
  196. package/src/adapters/pagarme.adapter.ts +66 -0
  197. package/src/adapters/payment-gateway.adapter.ts +14 -0
  198. package/src/adapters/stripe.adapter.ts +67 -0
  199. package/src/billing-contracts.controller.ts +46 -0
  200. package/src/billing-coupons.controller.ts +46 -0
  201. package/src/billing-dashboard.controller.ts +14 -0
  202. package/src/billing-entitlements.controller.ts +34 -0
  203. package/src/billing-gateways.controller.ts +19 -0
  204. package/src/billing-invoices.controller.ts +32 -0
  205. package/src/billing-offers.controller.ts +46 -0
  206. package/src/billing-orders.controller.ts +33 -0
  207. package/src/billing-payments.controller.ts +20 -0
  208. package/src/billing-prices.controller.ts +46 -0
  209. package/src/billing-products.controller.ts +46 -0
  210. package/src/billing-refunds.controller.ts +15 -0
  211. package/src/billing-subscriptions.controller.ts +49 -0
  212. package/src/billing-webhooks.controller.ts +15 -0
  213. package/src/billing.module.ts +48 -0
  214. package/src/billing.service.ts +391 -0
  215. package/src/dto/create-contract.dto.ts +30 -0
  216. package/src/dto/create-coupon.dto.ts +37 -0
  217. package/src/dto/create-entitlement.dto.ts +31 -0
  218. package/src/dto/create-offer.dto.ts +17 -0
  219. package/src/dto/create-order.dto.ts +42 -0
  220. package/src/dto/create-price.dto.ts +50 -0
  221. package/src/dto/create-product.dto.ts +25 -0
  222. package/src/dto/create-subscription.dto.ts +42 -0
  223. package/src/dto/update-contract.dto.ts +4 -0
  224. package/src/dto/update-coupon.dto.ts +4 -0
  225. package/src/dto/update-offer.dto.ts +4 -0
  226. package/src/dto/update-order.dto.ts +4 -0
  227. package/src/dto/update-price.dto.ts +4 -0
  228. package/src/dto/update-product.dto.ts +4 -0
  229. package/src/dto/update-subscription.dto.ts +4 -0
  230. package/src/index.ts +32 -0
  231. package/src/language/en.json +8 -0
  232. package/src/language/pt.json +8 -0
@@ -0,0 +1,169 @@
1
+ import { PaginationDTO, PaginationService } from '@hed-hog/api-pagination';
2
+ import { PrismaService } from '@hed-hog/api-prisma';
3
+ import { CreateContractDto } from './dto/create-contract.dto';
4
+ import { CreateCouponDto } from './dto/create-coupon.dto';
5
+ import { CreateEntitlementDto } from './dto/create-entitlement.dto';
6
+ import { CreateOfferDto } from './dto/create-offer.dto';
7
+ import { CreateOrderDto } from './dto/create-order.dto';
8
+ import { CreatePriceDto } from './dto/create-price.dto';
9
+ import { CreateProductDto } from './dto/create-product.dto';
10
+ import { CreateSubscriptionDto } from './dto/create-subscription.dto';
11
+ import { UpdateContractDto } from './dto/update-contract.dto';
12
+ import { UpdateOfferDto } from './dto/update-offer.dto';
13
+ import { UpdatePriceDto } from './dto/update-price.dto';
14
+ import { UpdateProductDto } from './dto/update-product.dto';
15
+ export declare class BillingService {
16
+ private readonly prisma;
17
+ private readonly paginationService;
18
+ constructor(prisma: PrismaService, paginationService: PaginationService);
19
+ listProducts(paginationParams: PaginationDTO): Promise<{
20
+ total: any;
21
+ lastPage: number;
22
+ page: number;
23
+ pageSize: number;
24
+ prev: number;
25
+ next: number;
26
+ data: any[];
27
+ }>;
28
+ getProduct(id: number): Promise<any>;
29
+ createProduct(data: CreateProductDto): Promise<any>;
30
+ updateProduct(id: number, data: UpdateProductDto): Promise<any>;
31
+ deleteProduct(id: number): Promise<any>;
32
+ listPrices(paginationParams: PaginationDTO): Promise<{
33
+ total: any;
34
+ lastPage: number;
35
+ page: number;
36
+ pageSize: number;
37
+ prev: number;
38
+ next: number;
39
+ data: any[];
40
+ }>;
41
+ getPrice(id: number): Promise<any>;
42
+ createPrice(data: CreatePriceDto): Promise<any>;
43
+ updatePrice(id: number, data: UpdatePriceDto): Promise<any>;
44
+ deletePrice(id: number): Promise<any>;
45
+ listOffers(paginationParams: PaginationDTO): Promise<{
46
+ total: any;
47
+ lastPage: number;
48
+ page: number;
49
+ pageSize: number;
50
+ prev: number;
51
+ next: number;
52
+ data: any[];
53
+ }>;
54
+ getOffer(id: number): Promise<any>;
55
+ createOffer(data: CreateOfferDto): Promise<any>;
56
+ updateOffer(id: number, data: UpdateOfferDto): Promise<any>;
57
+ deleteOffer(id: number): Promise<any>;
58
+ listCoupons(paginationParams: PaginationDTO): Promise<{
59
+ total: any;
60
+ lastPage: number;
61
+ page: number;
62
+ pageSize: number;
63
+ prev: number;
64
+ next: number;
65
+ data: any[];
66
+ }>;
67
+ getCoupon(id: number): Promise<any>;
68
+ createCoupon(data: CreateCouponDto): Promise<any>;
69
+ updateCoupon(id: number, data: Partial<CreateCouponDto>): Promise<any>;
70
+ deleteCoupon(id: number): Promise<any>;
71
+ listOrders(paginationParams: PaginationDTO): Promise<{
72
+ total: any;
73
+ lastPage: number;
74
+ page: number;
75
+ pageSize: number;
76
+ prev: number;
77
+ next: number;
78
+ data: any[];
79
+ }>;
80
+ getOrder(id: number): Promise<any>;
81
+ createOrder(data: CreateOrderDto): Promise<any>;
82
+ listSubscriptions(paginationParams: PaginationDTO): Promise<{
83
+ total: any;
84
+ lastPage: number;
85
+ page: number;
86
+ pageSize: number;
87
+ prev: number;
88
+ next: number;
89
+ data: any[];
90
+ }>;
91
+ getSubscription(id: number): Promise<any>;
92
+ createSubscription(data: CreateSubscriptionDto): Promise<any>;
93
+ cancelSubscription(id: number): Promise<any>;
94
+ pauseSubscription(id: number): Promise<any>;
95
+ resumeSubscription(id: number): Promise<any>;
96
+ listInvoices(paginationParams: PaginationDTO): Promise<{
97
+ total: any;
98
+ lastPage: number;
99
+ page: number;
100
+ pageSize: number;
101
+ prev: number;
102
+ next: number;
103
+ data: any[];
104
+ }>;
105
+ getInvoice(id: number): Promise<any>;
106
+ createInvoice(data: Record<string, unknown>): Promise<any>;
107
+ listPayments(paginationParams: PaginationDTO): Promise<{
108
+ total: any;
109
+ lastPage: number;
110
+ page: number;
111
+ pageSize: number;
112
+ prev: number;
113
+ next: number;
114
+ data: any[];
115
+ }>;
116
+ getPayment(id: number): Promise<any>;
117
+ listRefunds(paginationParams: PaginationDTO): Promise<{
118
+ total: any;
119
+ lastPage: number;
120
+ page: number;
121
+ pageSize: number;
122
+ prev: number;
123
+ next: number;
124
+ data: any[];
125
+ }>;
126
+ listEntitlements(paginationParams: PaginationDTO): Promise<{
127
+ total: any;
128
+ lastPage: number;
129
+ page: number;
130
+ pageSize: number;
131
+ prev: number;
132
+ next: number;
133
+ data: any[];
134
+ }>;
135
+ createEntitlement(data: CreateEntitlementDto): Promise<any>;
136
+ deleteEntitlement(id: number): Promise<any>;
137
+ listContracts(paginationParams: PaginationDTO): Promise<{
138
+ total: any;
139
+ lastPage: number;
140
+ page: number;
141
+ pageSize: number;
142
+ prev: number;
143
+ next: number;
144
+ data: any[];
145
+ }>;
146
+ getContract(id: number): Promise<any>;
147
+ createContract(data: CreateContractDto): Promise<any>;
148
+ updateContract(id: number, data: UpdateContractDto): Promise<any>;
149
+ deleteContract(id: number): Promise<any>;
150
+ listGateways(): Promise<any>;
151
+ updateGateway(slug: string, data: Record<string, unknown>): Promise<any>;
152
+ listWebhooks(paginationParams: PaginationDTO): Promise<{
153
+ total: any;
154
+ lastPage: number;
155
+ page: number;
156
+ pageSize: number;
157
+ prev: number;
158
+ next: number;
159
+ data: any[];
160
+ }>;
161
+ getDashboardData(): Promise<{
162
+ activeSubscriptions: any;
163
+ failedPayments: any;
164
+ overdueInvoices: any;
165
+ revenueThisMonthCents: any;
166
+ recentPayments: any;
167
+ }>;
168
+ }
169
+ //# sourceMappingURL=billing.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing.service.d.ts","sourceRoot":"","sources":["../src/billing.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,qBACa,cAAc;IAEvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,iBAAiB;gBADjB,MAAM,EAAE,aAAa,EACrB,iBAAiB,EAAE,iBAAiB;IAKjD,YAAY,CAAC,gBAAgB,EAAE,aAAa;;;;;;;;;IAQ5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AM;IAS7B,YAAY,CAAC,gBAAgB,EAAE,aAAa;;;;;;;;;IAQ5C,UAAU,CAAC,EAAE,EAAE,MAAM;IASrB,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAM3C,YAAY,CAAC,gBAAgB,EAAE,aAAa;;;;;;;;;IAQ5C,UAAU,CAAC,EAAE,EAAE,MAAM;IAQrB,WAAW,CAAC,gBAAgB,EAAE,aAAa;;;;;;;;;IAU3C,gBAAgB,CAAC,gBAAgB,EAAE,aAAa;;;;;;;;;IAQhD,iBAAiB,CAAC,IAAI,EAAE,oBAAoB;IAI5C,iBAAiB,CAAC,EAAE,EAAE,MAAM;IAS5B,aAAa,CAAC,gBAAgB,EAAE,aAAa;;;;;;;;;IAQ7C,WAAW,CAAC,EAAE,EAAE,MAAM;IAYtB,cAAc,CAAC,IAAI,EAAE,iBAAiB;IAItC,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB;IAIlD,cAAc,CAAC,EAAE,EAAE,MAAM;IAMzB,YAAY;IAMZ,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAUzD,YAAY,CAAC,gBAAgB,EAAE,aAAa;;;;;;;;;IAU5C,gBAAgB;;;;;;;CAiCvB"}
@@ -0,0 +1,290 @@
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.BillingService = void 0;
13
+ const api_pagination_1 = require("@hed-hog/api-pagination");
14
+ const api_prisma_1 = require("@hed-hog/api-prisma");
15
+ const common_1 = require("@nestjs/common");
16
+ let BillingService = class BillingService {
17
+ constructor(prisma, paginationService) {
18
+ this.prisma = prisma;
19
+ this.paginationService = paginationService;
20
+ }
21
+ // ─── Products ─────────────────────────────────────────────────────────────
22
+ async listProducts(paginationParams) {
23
+ return this.paginationService.paginate(this.prisma.billing_product, paginationParams, { orderBy: { created_at: 'desc' } });
24
+ }
25
+ async getProduct(id) {
26
+ const product = await this.prisma.billing_product.findUnique({
27
+ where: { id },
28
+ include: { billing_price: true },
29
+ });
30
+ if (!product)
31
+ throw new common_1.NotFoundException('Product not found');
32
+ return product;
33
+ }
34
+ async createProduct(data) {
35
+ return this.prisma.billing_product.create({ data });
36
+ }
37
+ async updateProduct(id, data) {
38
+ return this.prisma.billing_product.update({ where: { id }, data });
39
+ }
40
+ async deleteProduct(id) {
41
+ return this.prisma.billing_product.delete({ where: { id } });
42
+ }
43
+ // ─── Prices ───────────────────────────────────────────────────────────────
44
+ async listPrices(paginationParams) {
45
+ return this.paginationService.paginate(this.prisma.billing_price, paginationParams, {
46
+ include: { billing_product: { select: { id: true, name: true } } },
47
+ orderBy: { created_at: 'desc' },
48
+ });
49
+ }
50
+ async getPrice(id) {
51
+ const price = await this.prisma.billing_price.findUnique({
52
+ where: { id },
53
+ include: { billing_product: true },
54
+ });
55
+ if (!price)
56
+ throw new common_1.NotFoundException('Price not found');
57
+ return price;
58
+ }
59
+ async createPrice(data) {
60
+ return this.prisma.billing_price.create({ data });
61
+ }
62
+ async updatePrice(id, data) {
63
+ return this.prisma.billing_price.update({ where: { id }, data });
64
+ }
65
+ async deletePrice(id) {
66
+ return this.prisma.billing_price.delete({ where: { id } });
67
+ }
68
+ // ─── Offers ───────────────────────────────────────────────────────────────
69
+ async listOffers(paginationParams) {
70
+ return this.paginationService.paginate(this.prisma.billing_offer, paginationParams, { orderBy: { created_at: 'desc' } });
71
+ }
72
+ async getOffer(id) {
73
+ const offer = await this.prisma.billing_offer.findUnique({
74
+ where: { id },
75
+ include: { billing_offer_price: { include: { billing_price: true } } },
76
+ });
77
+ if (!offer)
78
+ throw new common_1.NotFoundException('Offer not found');
79
+ return offer;
80
+ }
81
+ async createOffer(data) {
82
+ return this.prisma.billing_offer.create({ data });
83
+ }
84
+ async updateOffer(id, data) {
85
+ return this.prisma.billing_offer.update({ where: { id }, data });
86
+ }
87
+ async deleteOffer(id) {
88
+ return this.prisma.billing_offer.delete({ where: { id } });
89
+ }
90
+ // ─── Coupons ──────────────────────────────────────────────────────────────
91
+ async listCoupons(paginationParams) {
92
+ return this.paginationService.paginate(this.prisma.billing_coupon, paginationParams, { orderBy: { created_at: 'desc' } });
93
+ }
94
+ async getCoupon(id) {
95
+ const coupon = await this.prisma.billing_coupon.findUnique({ where: { id } });
96
+ if (!coupon)
97
+ throw new common_1.NotFoundException('Coupon not found');
98
+ return coupon;
99
+ }
100
+ async createCoupon(data) {
101
+ return this.prisma.billing_coupon.create({ data });
102
+ }
103
+ async updateCoupon(id, data) {
104
+ return this.prisma.billing_coupon.update({ where: { id }, data });
105
+ }
106
+ async deleteCoupon(id) {
107
+ return this.prisma.billing_coupon.delete({ where: { id } });
108
+ }
109
+ // ─── Orders ───────────────────────────────────────────────────────────────
110
+ async listOrders(paginationParams) {
111
+ return this.paginationService.paginate(this.prisma.billing_order, paginationParams, { orderBy: { created_at: 'desc' } });
112
+ }
113
+ async getOrder(id) {
114
+ const order = await this.prisma.billing_order.findUnique({
115
+ where: { id },
116
+ include: { billing_order_item: true },
117
+ });
118
+ if (!order)
119
+ throw new common_1.NotFoundException('Order not found');
120
+ return order;
121
+ }
122
+ async createOrder(data) {
123
+ return this.prisma.billing_order.create({ data });
124
+ }
125
+ // ─── Subscriptions ────────────────────────────────────────────────────────
126
+ async listSubscriptions(paginationParams) {
127
+ return this.paginationService.paginate(this.prisma.billing_subscription, paginationParams, {
128
+ include: {
129
+ billing_product: { select: { id: true, name: true } },
130
+ billing_price: { select: { id: true, name: true, amount_cents: true, interval_unit: true } },
131
+ },
132
+ orderBy: { created_at: 'desc' },
133
+ });
134
+ }
135
+ async getSubscription(id) {
136
+ const sub = await this.prisma.billing_subscription.findUnique({
137
+ where: { id },
138
+ include: {
139
+ billing_product: true,
140
+ billing_price: true,
141
+ billing_subscription_item: true,
142
+ billing_invoice: { take: 5, orderBy: { created_at: 'desc' } },
143
+ },
144
+ });
145
+ if (!sub)
146
+ throw new common_1.NotFoundException('Subscription not found');
147
+ return sub;
148
+ }
149
+ async createSubscription(data) {
150
+ return this.prisma.billing_subscription.create({ data });
151
+ }
152
+ async cancelSubscription(id) {
153
+ return this.prisma.billing_subscription.update({
154
+ where: { id },
155
+ data: { status: 'canceled', canceled_at: new Date() },
156
+ });
157
+ }
158
+ async pauseSubscription(id) {
159
+ return this.prisma.billing_subscription.update({
160
+ where: { id },
161
+ data: { status: 'paused' },
162
+ });
163
+ }
164
+ async resumeSubscription(id) {
165
+ return this.prisma.billing_subscription.update({
166
+ where: { id },
167
+ data: { status: 'active' },
168
+ });
169
+ }
170
+ // ─── Invoices ─────────────────────────────────────────────────────────────
171
+ async listInvoices(paginationParams) {
172
+ return this.paginationService.paginate(this.prisma.billing_invoice, paginationParams, { orderBy: { created_at: 'desc' } });
173
+ }
174
+ async getInvoice(id) {
175
+ const invoice = await this.prisma.billing_invoice.findUnique({
176
+ where: { id },
177
+ include: { billing_invoice_item: true, billing_payment: { take: 5 } },
178
+ });
179
+ if (!invoice)
180
+ throw new common_1.NotFoundException('Invoice not found');
181
+ return invoice;
182
+ }
183
+ async createInvoice(data) {
184
+ return this.prisma.billing_invoice.create({ data: data });
185
+ }
186
+ // ─── Payments ─────────────────────────────────────────────────────────────
187
+ async listPayments(paginationParams) {
188
+ return this.paginationService.paginate(this.prisma.billing_payment, paginationParams, { orderBy: { created_at: 'desc' } });
189
+ }
190
+ async getPayment(id) {
191
+ const payment = await this.prisma.billing_payment.findUnique({ where: { id } });
192
+ if (!payment)
193
+ throw new common_1.NotFoundException('Payment not found');
194
+ return payment;
195
+ }
196
+ // ─── Refunds ──────────────────────────────────────────────────────────────
197
+ async listRefunds(paginationParams) {
198
+ return this.paginationService.paginate(this.prisma.billing_refund, paginationParams, { orderBy: { created_at: 'desc' } });
199
+ }
200
+ // ─── Entitlements ─────────────────────────────────────────────────────────
201
+ async listEntitlements(paginationParams) {
202
+ return this.paginationService.paginate(this.prisma.billing_entitlement, paginationParams, { orderBy: { created_at: 'desc' } });
203
+ }
204
+ async createEntitlement(data) {
205
+ return this.prisma.billing_entitlement.create({ data });
206
+ }
207
+ async deleteEntitlement(id) {
208
+ return this.prisma.billing_entitlement.update({
209
+ where: { id },
210
+ data: { status: 'revoked' },
211
+ });
212
+ }
213
+ // ─── Contracts ────────────────────────────────────────────────────────────
214
+ async listContracts(paginationParams) {
215
+ return this.paginationService.paginate(this.prisma.billing_contract, paginationParams, { orderBy: { created_at: 'desc' } });
216
+ }
217
+ async getContract(id) {
218
+ const contract = await this.prisma.billing_contract.findUnique({
219
+ where: { id },
220
+ include: {
221
+ billing_contract_seat: { include: { billing_product: true } },
222
+ billing_seat_allocation: true,
223
+ },
224
+ });
225
+ if (!contract)
226
+ throw new common_1.NotFoundException('Contract not found');
227
+ return contract;
228
+ }
229
+ async createContract(data) {
230
+ return this.prisma.billing_contract.create({ data });
231
+ }
232
+ async updateContract(id, data) {
233
+ return this.prisma.billing_contract.update({ where: { id }, data });
234
+ }
235
+ async deleteContract(id) {
236
+ return this.prisma.billing_contract.delete({ where: { id } });
237
+ }
238
+ // ─── Gateways ─────────────────────────────────────────────────────────────
239
+ async listGateways() {
240
+ return this.prisma.billing_payment_provider.findMany({
241
+ orderBy: { name: 'asc' },
242
+ });
243
+ }
244
+ async updateGateway(slug, data) {
245
+ return this.prisma.billing_payment_provider.upsert({
246
+ where: { slug },
247
+ update: data,
248
+ create: Object.assign({ slug, name: slug }, data),
249
+ });
250
+ }
251
+ // ─── Webhooks ─────────────────────────────────────────────────────────────
252
+ async listWebhooks(paginationParams) {
253
+ return this.paginationService.paginate(this.prisma.billing_provider_event, paginationParams, { orderBy: { created_at: 'desc' } });
254
+ }
255
+ // ─── Dashboard ────────────────────────────────────────────────────────────
256
+ async getDashboardData() {
257
+ var _a;
258
+ const [activeSubscriptions, failedPayments, overdueInvoices, recentPayments,] = await Promise.all([
259
+ this.prisma.billing_subscription.count({ where: { status: 'active' } }),
260
+ this.prisma.billing_payment.count({ where: { status: 'failed' } }),
261
+ this.prisma.billing_invoice.count({ where: { status: 'open' } }),
262
+ this.prisma.billing_payment.findMany({
263
+ where: { status: 'paid' },
264
+ orderBy: { paid_at: 'desc' },
265
+ take: 10,
266
+ }),
267
+ ]);
268
+ const paidThisMonth = await this.prisma.billing_payment.aggregate({
269
+ where: {
270
+ status: 'paid',
271
+ paid_at: { gte: new Date(new Date().getFullYear(), new Date().getMonth(), 1) },
272
+ },
273
+ _sum: { amount_cents: true },
274
+ });
275
+ return {
276
+ activeSubscriptions,
277
+ failedPayments,
278
+ overdueInvoices,
279
+ revenueThisMonthCents: (_a = paidThisMonth._sum.amount_cents) !== null && _a !== void 0 ? _a : 0,
280
+ recentPayments,
281
+ };
282
+ }
283
+ };
284
+ exports.BillingService = BillingService;
285
+ exports.BillingService = BillingService = __decorate([
286
+ (0, common_1.Injectable)(),
287
+ __metadata("design:paramtypes", [api_prisma_1.PrismaService,
288
+ api_pagination_1.PaginationService])
289
+ ], BillingService);
290
+ //# sourceMappingURL=billing.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing.service.js","sourceRoot":"","sources":["../src/billing.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4DAA2E;AAC3E,oDAAoD;AACpD,2CAA+D;AAexD,IAAM,cAAc,GAApB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starts_at: string;
6
+ ends_at?: string;
7
+ total_seats?: number;
8
+ status?: string;
9
+ signed_at?: string;
10
+ }
11
+ //# sourceMappingURL=create-contract.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-contract.dto.d.ts","sourceRoot":"","sources":["../../src/dto/create-contract.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,iBAAiB;IAE5B,UAAU,EAAE,MAAM,CAAC;IAGnB,IAAI,EAAE,MAAM,CAAC;IAIb,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,SAAS,EAAE,MAAM,CAAC;IAGlB,OAAO,CAAC,EAAE,MAAM,CAAC;IAIjB,WAAW,CAAC,EAAE,MAAM,CAAC;IAIrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,52 @@
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.CreateContractDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ class CreateContractDto {
15
+ }
16
+ exports.CreateContractDto = CreateContractDto;
17
+ __decorate([
18
+ (0, class_validator_1.IsNumber)(),
19
+ __metadata("design:type", Number)
20
+ ], CreateContractDto.prototype, "contact_id", void 0);
21
+ __decorate([
22
+ (0, class_validator_1.IsString)(),
23
+ __metadata("design:type", String)
24
+ ], CreateContractDto.prototype, "name", void 0);
25
+ __decorate([
26
+ (0, class_validator_1.IsOptional)(),
27
+ (0, class_validator_1.IsString)(),
28
+ __metadata("design:type", String)
29
+ ], CreateContractDto.prototype, "description", void 0);
30
+ __decorate([
31
+ (0, class_validator_1.IsString)(),
32
+ __metadata("design:type", String)
33
+ ], CreateContractDto.prototype, "starts_at", void 0);
34
+ __decorate([
35
+ (0, class_validator_1.IsOptional)(),
36
+ __metadata("design:type", String)
37
+ ], CreateContractDto.prototype, "ends_at", void 0);
38
+ __decorate([
39
+ (0, class_validator_1.IsOptional)(),
40
+ (0, class_validator_1.IsNumber)(),
41
+ __metadata("design:type", Number)
42
+ ], CreateContractDto.prototype, "total_seats", void 0);
43
+ __decorate([
44
+ (0, class_validator_1.IsOptional)(),
45
+ (0, class_validator_1.IsEnum)(['draft', 'active', 'expired', 'terminated']),
46
+ __metadata("design:type", String)
47
+ ], CreateContractDto.prototype, "status", void 0);
48
+ __decorate([
49
+ (0, class_validator_1.IsOptional)(),
50
+ __metadata("design:type", String)
51
+ ], CreateContractDto.prototype, "signed_at", void 0);
52
+ //# sourceMappingURL=create-contract.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-contract.dto.js","sourceRoot":"","sources":["../../src/dto/create-contract.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAyE;AAEzE,MAAa,iBAAiB;CA2B7B;AA3BD,8CA2BC;AAzBC;IADC,IAAA,0BAAQ,GAAE;;qDACQ;AAGnB;IADC,IAAA,0BAAQ,GAAE;;+CACE;AAIb;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;sDACU;AAGrB;IADC,IAAA,0BAAQ,GAAE;;oDACO;AAGlB;IADC,IAAA,4BAAU,GAAE;;kDACI;AAIjB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;sDACU;AAIrB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,EAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;;iDACrC;AAGhB;IADC,IAAA,4BAAU,GAAE;;oDACM"}
@@ -0,0 +1,12 @@
1
+ export declare class CreateCouponDto {
2
+ code: string;
3
+ name: string;
4
+ discount_type?: string;
5
+ discount_value?: number;
6
+ currency?: string;
7
+ max_uses?: number;
8
+ starts_at?: string;
9
+ ends_at?: string;
10
+ status?: string;
11
+ }
12
+ //# sourceMappingURL=create-coupon.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-coupon.dto.d.ts","sourceRoot":"","sources":["../../src/dto/create-coupon.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,eAAe;IAE1B,IAAI,EAAE,MAAM,CAAC;IAGb,IAAI,EAAE,MAAM,CAAC;IAIb,aAAa,CAAC,EAAE,MAAM,CAAC;IAKvB,cAAc,CAAC,EAAE,MAAM,CAAC;IAIxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAKlB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,OAAO,CAAC,EAAE,MAAM,CAAC;IAIjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1,60 @@
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.CreateCouponDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ class CreateCouponDto {
15
+ }
16
+ exports.CreateCouponDto = CreateCouponDto;
17
+ __decorate([
18
+ (0, class_validator_1.IsString)(),
19
+ __metadata("design:type", String)
20
+ ], CreateCouponDto.prototype, "code", void 0);
21
+ __decorate([
22
+ (0, class_validator_1.IsString)(),
23
+ __metadata("design:type", String)
24
+ ], CreateCouponDto.prototype, "name", void 0);
25
+ __decorate([
26
+ (0, class_validator_1.IsOptional)(),
27
+ (0, class_validator_1.IsEnum)(['percentage', 'fixed']),
28
+ __metadata("design:type", String)
29
+ ], CreateCouponDto.prototype, "discount_type", void 0);
30
+ __decorate([
31
+ (0, class_validator_1.IsOptional)(),
32
+ (0, class_validator_1.IsNumber)(),
33
+ (0, class_validator_1.Min)(0),
34
+ __metadata("design:type", Number)
35
+ ], CreateCouponDto.prototype, "discount_value", void 0);
36
+ __decorate([
37
+ (0, class_validator_1.IsOptional)(),
38
+ (0, class_validator_1.IsString)(),
39
+ __metadata("design:type", String)
40
+ ], CreateCouponDto.prototype, "currency", void 0);
41
+ __decorate([
42
+ (0, class_validator_1.IsOptional)(),
43
+ (0, class_validator_1.IsNumber)(),
44
+ (0, class_validator_1.Min)(1),
45
+ __metadata("design:type", Number)
46
+ ], CreateCouponDto.prototype, "max_uses", void 0);
47
+ __decorate([
48
+ (0, class_validator_1.IsOptional)(),
49
+ __metadata("design:type", String)
50
+ ], CreateCouponDto.prototype, "starts_at", void 0);
51
+ __decorate([
52
+ (0, class_validator_1.IsOptional)(),
53
+ __metadata("design:type", String)
54
+ ], CreateCouponDto.prototype, "ends_at", void 0);
55
+ __decorate([
56
+ (0, class_validator_1.IsOptional)(),
57
+ (0, class_validator_1.IsEnum)(['active', 'inactive', 'expired']),
58
+ __metadata("design:type", String)
59
+ ], CreateCouponDto.prototype, "status", void 0);
60
+ //# sourceMappingURL=create-coupon.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-coupon.dto.js","sourceRoot":"","sources":["../../src/dto/create-coupon.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA8E;AAE9E,MAAa,eAAe;CAkC3B;AAlCD,0CAkCC;AAhCC;IADC,IAAA,0BAAQ,GAAE;;6CACE;AAGb;IADC,IAAA,0BAAQ,GAAE;;6CACE;AAIb;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,EAAC,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;;sDACT;AAKvB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAG,EAAC,CAAC,CAAC;;uDACiB;AAIxB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;iDACO;AAKlB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAG,EAAC,CAAC,CAAC;;iDACW;AAGlB;IADC,IAAA,4BAAU,GAAE;;kDACM;AAGnB;IADC,IAAA,4BAAU,GAAE;;gDACI;AAIjB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,EAAC,CAAC,QAAQ,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;;+CAC1B"}
@@ -0,0 +1,12 @@
1
+ export declare class CreateEntitlementDto {
2
+ contact_id: number;
3
+ source_type: string;
4
+ source_id: number;
5
+ target_type: string;
6
+ target_id: number;
7
+ access_type: string;
8
+ starts_at?: string;
9
+ ends_at?: string;
10
+ status?: string;
11
+ }
12
+ //# sourceMappingURL=create-entitlement.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-entitlement.dto.d.ts","sourceRoot":"","sources":["../../src/dto/create-entitlement.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,oBAAoB;IAE/B,UAAU,EAAE,MAAM,CAAC;IAGnB,WAAW,EAAE,MAAM,CAAC;IAGpB,SAAS,EAAE,MAAM,CAAC;IAGlB,WAAW,EAAE,MAAM,CAAC;IAGpB,SAAS,EAAE,MAAM,CAAC;IAGlB,WAAW,EAAE,MAAM,CAAC;IAGpB,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,OAAO,CAAC,EAAE,MAAM,CAAC;IAIjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}