@23blocks/block-sales 3.1.4 → 3.2.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.
- package/dist/index.esm.js +9 -1
- package/dist/src/lib/sales.block.d.ts +30 -0
- package/dist/src/lib/sales.block.d.ts.map +1 -1
- package/dist/src/lib/services/customers.service.d.ts +20 -0
- package/dist/src/lib/services/customers.service.d.ts.map +1 -1
- package/dist/src/lib/services/entities.service.d.ts +24 -0
- package/dist/src/lib/services/entities.service.d.ts.map +1 -1
- package/dist/src/lib/services/flexible-orders.service.d.ts +59 -0
- package/dist/src/lib/services/flexible-orders.service.d.ts.map +1 -1
- package/dist/src/lib/services/mercadopago.service.d.ts +12 -0
- package/dist/src/lib/services/mercadopago.service.d.ts.map +1 -1
- package/dist/src/lib/services/order-details.service.d.ts +16 -0
- package/dist/src/lib/services/order-details.service.d.ts.map +1 -1
- package/dist/src/lib/services/order-taxes.service.d.ts +19 -0
- package/dist/src/lib/services/order-taxes.service.d.ts.map +1 -1
- package/dist/src/lib/services/orders.service.d.ts +36 -0
- package/dist/src/lib/services/orders.service.d.ts.map +1 -1
- package/dist/src/lib/services/payments.service.d.ts +21 -0
- package/dist/src/lib/services/payments.service.d.ts.map +1 -1
- package/dist/src/lib/services/stripe.service.d.ts +39 -0
- package/dist/src/lib/services/stripe.service.d.ts.map +1 -1
- package/dist/src/lib/services/subscription-models.service.d.ts +16 -0
- package/dist/src/lib/services/subscription-models.service.d.ts.map +1 -1
- package/dist/src/lib/services/subscriptions.service.d.ts +32 -0
- package/dist/src/lib/services/subscriptions.service.d.ts.map +1 -1
- package/dist/src/lib/services/users.service.d.ts +51 -0
- package/dist/src/lib/services/users.service.d.ts.map +1 -1
- package/dist/src/lib/services/vendor-payments.service.d.ts +47 -0
- package/dist/src/lib/services/vendor-payments.service.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1812,7 +1812,15 @@ function createVendorPaymentsService(transport, _config) {
|
|
|
1812
1812
|
};
|
|
1813
1813
|
}
|
|
1814
1814
|
|
|
1815
|
-
|
|
1815
|
+
/**
|
|
1816
|
+
* Create the Sales block.
|
|
1817
|
+
*
|
|
1818
|
+
* @example
|
|
1819
|
+
* ```typescript
|
|
1820
|
+
* const block = createSalesBlock(transport, { appId: 'xxx' });
|
|
1821
|
+
* const orders = await block.orders.list({ page: 1 });
|
|
1822
|
+
* ```
|
|
1823
|
+
*/ function createSalesBlock(transport, config) {
|
|
1816
1824
|
return {
|
|
1817
1825
|
orders: createOrdersService(transport),
|
|
1818
1826
|
orderDetails: createOrderDetailsService(transport),
|
|
@@ -1,24 +1,54 @@
|
|
|
1
1
|
import type { Transport, BlockConfig, BlockMetadata } from '@23blocks/contracts';
|
|
2
2
|
import { type OrdersService, type OrderDetailsService, type OrderTaxesService, type PaymentsService, type SubscriptionsService, type SubscriptionModelsService, type SalesEntitiesService, type SalesUsersService, type SalesCustomersService, type FlexibleOrdersService, type StripeService, type MercadoPagoService, type VendorPaymentsService } from './services/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Configuration for the Sales block.
|
|
5
|
+
*/
|
|
3
6
|
export interface SalesBlockConfig extends BlockConfig {
|
|
7
|
+
/** Application ID */
|
|
4
8
|
appId: string;
|
|
9
|
+
/** Tenant ID (optional, for multi-tenant setups) */
|
|
5
10
|
tenantId?: string;
|
|
6
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Sales, orders, and payment management block interface.
|
|
14
|
+
*/
|
|
7
15
|
export interface SalesBlock {
|
|
16
|
+
/** Order CRUD operations */
|
|
8
17
|
orders: OrdersService;
|
|
18
|
+
/** Order line-item detail management */
|
|
9
19
|
orderDetails: OrderDetailsService;
|
|
20
|
+
/** Order tax management */
|
|
10
21
|
orderTaxes: OrderTaxesService;
|
|
22
|
+
/** Payment processing */
|
|
11
23
|
payments: PaymentsService;
|
|
24
|
+
/** Subscription management */
|
|
12
25
|
subscriptions: SubscriptionsService;
|
|
26
|
+
/** Subscription model definition management */
|
|
13
27
|
subscriptionModels: SubscriptionModelsService;
|
|
28
|
+
/** Sales entity management */
|
|
14
29
|
entities: SalesEntitiesService;
|
|
30
|
+
/** Sales user management */
|
|
15
31
|
users: SalesUsersService;
|
|
32
|
+
/** Sales customer management */
|
|
16
33
|
customers: SalesCustomersService;
|
|
34
|
+
/** Flexible order management */
|
|
17
35
|
flexibleOrders: FlexibleOrdersService;
|
|
36
|
+
/** Stripe payment integration */
|
|
18
37
|
stripe: StripeService;
|
|
38
|
+
/** MercadoPago payment integration */
|
|
19
39
|
mercadopago: MercadoPagoService;
|
|
40
|
+
/** Vendor payment management */
|
|
20
41
|
vendorPayments: VendorPaymentsService;
|
|
21
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Create the Sales block.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* const block = createSalesBlock(transport, { appId: 'xxx' });
|
|
49
|
+
* const orders = await block.orders.list({ page: 1 });
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
22
52
|
export declare function createSalesBlock(transport: Transport, config: SalesBlockConfig): SalesBlock;
|
|
23
53
|
export declare const salesBlockMetadata: BlockMetadata;
|
|
24
54
|
//# sourceMappingURL=sales.block.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sales.block.d.ts","sourceRoot":"","sources":["../../../src/lib/sales.block.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAcL,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,KAAK,k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AE7B;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,4BAA4B;IAC5B,MAAM,EAAE,aAAa,CAAC;IACtB,wCAAwC;IACxC,YAAY,EAAE,mBAAmB,CAAC;IAClC,2BAA2B;IAC3B,UAAU,EAAE,iBAAiB,CAAC;IAC9B,yBAAyB;IACzB,QAAQ,EAAE,eAAe,CAAC;IAC1B,8BAA8B;IAC9B,aAAa,EAAE,oBAAoB,CAAC;IACpC,+CAA+C;IAC/C,kBAAkB,EAAE,yBAAyB,CAAC;IAC9C,8BAA8B;IAC9B,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,4BAA4B;IAC5B,KAAK,EAAE,iBAAiB,CAAC;IACzB,gCAAgC;IAChC,SAAS,EAAE,qBAAqB,CAAC;IACjC,gCAAgC;IAChC,cAAc,EAAE,qBAAqB,CAAC;IACtC,iCAAiC;IACjC,MAAM,EAAE,aAAa,CAAC;IACtB,sCAAsC;IACtC,WAAW,EAAE,kBAAkB,CAAC;IAChC,gCAAgC;IAChC,cAAc,EAAE,qBAAqB,CAAC;CACvC;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,gBAAgB,GACvB,UAAU,CAgBZ;AAED,eAAO,MAAM,kBAAkB,EAAE,aAUhC,CAAC"}
|
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
import type { Transport } from '@23blocks/contracts';
|
|
2
2
|
import type { SalesCustomer, RegisterSalesCustomerRequest, CustomerSubscription, CreateCustomerSubscriptionRequest, UpdateCustomerSubscriptionRequest } from '../types/customer.js';
|
|
3
3
|
export interface SalesCustomersService {
|
|
4
|
+
/**
|
|
5
|
+
* Get a sales customer by unique ID.
|
|
6
|
+
* @returns The matching SalesCustomer record.
|
|
7
|
+
*/
|
|
4
8
|
get(uniqueId: string): Promise<SalesCustomer>;
|
|
9
|
+
/**
|
|
10
|
+
* Register a user as a sales customer.
|
|
11
|
+
* @returns The newly registered SalesCustomer record.
|
|
12
|
+
*/
|
|
5
13
|
register(uniqueId: string, data?: RegisterSalesCustomerRequest): Promise<SalesCustomer>;
|
|
14
|
+
/**
|
|
15
|
+
* Get a specific subscription for a customer.
|
|
16
|
+
* @returns The matching CustomerSubscription record.
|
|
17
|
+
*/
|
|
6
18
|
getSubscription(uniqueId: string, subscriptionUniqueId: string): Promise<CustomerSubscription>;
|
|
19
|
+
/**
|
|
20
|
+
* Create a new subscription for a customer.
|
|
21
|
+
* @returns The newly created CustomerSubscription record.
|
|
22
|
+
*/
|
|
7
23
|
createSubscription(uniqueId: string, data: CreateCustomerSubscriptionRequest): Promise<CustomerSubscription>;
|
|
24
|
+
/**
|
|
25
|
+
* Update an existing customer subscription.
|
|
26
|
+
* @returns The updated CustomerSubscription record.
|
|
27
|
+
*/
|
|
8
28
|
updateSubscription(uniqueId: string, subscriptionUniqueId: string, data: UpdateCustomerSubscriptionRequest): Promise<CustomerSubscription>;
|
|
9
29
|
}
|
|
10
30
|
export declare function createSalesCustomersService(transport: Transport, _config: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customers.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/customers.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EACV,aAAa,EACb,4BAA4B,EAC5B,oBAAoB,EACpB,iCAAiC,EACjC,iCAAiC,EAClC,MAAM,sBAAsB,CAAC;AAG9B,MAAM,WAAW,qBAAqB;IACpC,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"customers.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/customers.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EACV,aAAa,EACb,4BAA4B,EAC5B,oBAAoB,EACpB,iCAAiC,EACjC,iCAAiC,EAClC,MAAM,sBAAsB,CAAC;AAG9B,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAE9C;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,4BAA4B,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAExF;;;OAGG;IACH,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAE/F;;;OAGG;IACH,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,iCAAiC,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAE7G;;;OAGG;IACH,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,IAAI,EAAE,iCAAiC,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAC5I;AAED,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,qBAAqB,CAwFnH"}
|
|
@@ -1,11 +1,35 @@
|
|
|
1
1
|
import type { Transport, PageResult } from '@23blocks/contracts';
|
|
2
2
|
import type { SalesEntity, RegisterSalesEntityRequest, UpdateSalesEntityRequest, ListSalesEntitiesParams, EntitySubscription, CreateEntitySubscriptionRequest, UpdateEntitySubscriptionRequest } from '../types/entity.js';
|
|
3
3
|
export interface SalesEntitiesService {
|
|
4
|
+
/**
|
|
5
|
+
* List sales entities with optional filtering and sorting.
|
|
6
|
+
* @returns Paginated list of SalesEntity records with metadata.
|
|
7
|
+
*/
|
|
4
8
|
list(params?: ListSalesEntitiesParams): Promise<PageResult<SalesEntity>>;
|
|
9
|
+
/**
|
|
10
|
+
* Get a sales entity by unique ID.
|
|
11
|
+
* @returns The matching SalesEntity record.
|
|
12
|
+
*/
|
|
5
13
|
get(uniqueId: string): Promise<SalesEntity>;
|
|
14
|
+
/**
|
|
15
|
+
* Register a new sales entity.
|
|
16
|
+
* @returns The newly registered SalesEntity record.
|
|
17
|
+
*/
|
|
6
18
|
register(uniqueId: string, data?: RegisterSalesEntityRequest): Promise<SalesEntity>;
|
|
19
|
+
/**
|
|
20
|
+
* Update an existing sales entity.
|
|
21
|
+
* @returns The updated SalesEntity record.
|
|
22
|
+
*/
|
|
7
23
|
update(uniqueId: string, data: UpdateSalesEntityRequest): Promise<SalesEntity>;
|
|
24
|
+
/**
|
|
25
|
+
* Create a subscription for an entity.
|
|
26
|
+
* @returns The newly created EntitySubscription record.
|
|
27
|
+
*/
|
|
8
28
|
createSubscription(uniqueId: string, data: CreateEntitySubscriptionRequest): Promise<EntitySubscription>;
|
|
29
|
+
/**
|
|
30
|
+
* Update an entity subscription.
|
|
31
|
+
* @returns The updated EntitySubscription record.
|
|
32
|
+
*/
|
|
9
33
|
updateSubscription(uniqueId: string, subscriptionUniqueId: string, data: UpdateEntitySubscriptionRequest): Promise<EntitySubscription>;
|
|
10
34
|
}
|
|
11
35
|
export declare function createSalesEntitiesService(transport: Transport, _config: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entities.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/entities.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,WAAW,EACX,0BAA0B,EAC1B,wBAAwB,EACxB,uBAAuB,EACvB,kBAAkB,EAClB,+BAA+B,EAC/B,+BAA+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SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,oBAAoB,CA8FjH"}
|
|
@@ -2,20 +2,79 @@ import type { Transport, PageResult } from '@23blocks/contracts';
|
|
|
2
2
|
import type { FlexibleOrder, CreateFlexibleOrderRequest, UpdateFlexibleOrderRequest, AddFlexibleOrderDetailRequest, AddFlexibleOrderTipsRequest, AddFlexibleOrderPaymentMethodRequest, AddFlexibleOrderPaymentRequest, UpdateFlexibleOrderLogisticsRequest, ListFlexibleOrdersParams } from '../types/flexible-order.js';
|
|
3
3
|
import type { Payment } from '../types/payment.js';
|
|
4
4
|
export interface FlexibleOrdersService {
|
|
5
|
+
/**
|
|
6
|
+
* List flexible orders with optional filtering and sorting.
|
|
7
|
+
* @returns Paginated list of FlexibleOrder records with metadata.
|
|
8
|
+
*/
|
|
5
9
|
list(params?: ListFlexibleOrdersParams): Promise<PageResult<FlexibleOrder>>;
|
|
10
|
+
/**
|
|
11
|
+
* Get a flexible order by unique ID.
|
|
12
|
+
* @returns The matching FlexibleOrder record.
|
|
13
|
+
*/
|
|
6
14
|
get(uniqueId: string): Promise<FlexibleOrder>;
|
|
15
|
+
/**
|
|
16
|
+
* Create a new flexible order.
|
|
17
|
+
* @returns The newly created FlexibleOrder record.
|
|
18
|
+
*/
|
|
7
19
|
create(data: CreateFlexibleOrderRequest): Promise<FlexibleOrder>;
|
|
20
|
+
/**
|
|
21
|
+
* Update an existing flexible order.
|
|
22
|
+
* @returns The updated FlexibleOrder record.
|
|
23
|
+
*/
|
|
8
24
|
update(uniqueId: string, data: UpdateFlexibleOrderRequest): Promise<FlexibleOrder>;
|
|
25
|
+
/**
|
|
26
|
+
* Add line item details to a flexible order.
|
|
27
|
+
* @returns The updated FlexibleOrder record with the new detail.
|
|
28
|
+
*/
|
|
9
29
|
addDetails(uniqueId: string, data: AddFlexibleOrderDetailRequest): Promise<FlexibleOrder>;
|
|
30
|
+
/**
|
|
31
|
+
* Add tips to a flexible order.
|
|
32
|
+
* @returns The updated FlexibleOrder record with tips applied.
|
|
33
|
+
*/
|
|
10
34
|
addTips(uniqueId: string, data: AddFlexibleOrderTipsRequest): Promise<FlexibleOrder>;
|
|
35
|
+
/**
|
|
36
|
+
* Set the payment method for a flexible order.
|
|
37
|
+
* @returns The updated FlexibleOrder record.
|
|
38
|
+
*/
|
|
11
39
|
addPaymentMethod(uniqueId: string, data: AddFlexibleOrderPaymentMethodRequest): Promise<FlexibleOrder>;
|
|
40
|
+
/**
|
|
41
|
+
* Add a payment to a flexible order.
|
|
42
|
+
* @returns The updated FlexibleOrder record with the new payment.
|
|
43
|
+
*/
|
|
12
44
|
addPayment(uniqueId: string, data: AddFlexibleOrderPaymentRequest): Promise<FlexibleOrder>;
|
|
45
|
+
/**
|
|
46
|
+
* Confirm a specific payment on a flexible order.
|
|
47
|
+
* @returns The updated FlexibleOrder record.
|
|
48
|
+
*/
|
|
13
49
|
confirmPayment(uniqueId: string, paymentUniqueId: string): Promise<FlexibleOrder>;
|
|
50
|
+
/**
|
|
51
|
+
* Update the status of a flexible order.
|
|
52
|
+
* @returns The updated FlexibleOrder record.
|
|
53
|
+
*/
|
|
14
54
|
updateStatus(uniqueId: string, status: string): Promise<FlexibleOrder>;
|
|
55
|
+
/**
|
|
56
|
+
* Update the status of a specific order detail.
|
|
57
|
+
* @returns The updated FlexibleOrder record.
|
|
58
|
+
*/
|
|
15
59
|
updateDetailStatus(uniqueId: string, detailUniqueId: string, status: string): Promise<FlexibleOrder>;
|
|
60
|
+
/**
|
|
61
|
+
* Cancel a flexible order.
|
|
62
|
+
*/
|
|
16
63
|
cancel(uniqueId: string): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* Update logistics information for a flexible order.
|
|
66
|
+
* @returns The updated FlexibleOrder record with logistics data.
|
|
67
|
+
*/
|
|
17
68
|
updateLogistics(uniqueId: string, data: UpdateFlexibleOrderLogisticsRequest): Promise<FlexibleOrder>;
|
|
69
|
+
/**
|
|
70
|
+
* Update logistics information for a specific order detail.
|
|
71
|
+
* @returns The updated FlexibleOrder record with detail logistics data.
|
|
72
|
+
*/
|
|
18
73
|
updateDetailLogistics(uniqueId: string, detailUniqueId: string, data: UpdateFlexibleOrderLogisticsRequest): Promise<FlexibleOrder>;
|
|
74
|
+
/**
|
|
75
|
+
* Get payments for a flexible order.
|
|
76
|
+
* @returns Paginated list of Payment records.
|
|
77
|
+
*/
|
|
19
78
|
getPayments(uniqueId: string): Promise<PageResult<Payment>>;
|
|
20
79
|
}
|
|
21
80
|
export declare function createFlexibleOrdersService(transport: Transport, _config: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flexible-orders.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/flexible-orders.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,aAAa,EACb,0BAA0B,EAC1B,0BAA0B,EAC1B,6BAA6B,EAC7B,2BAA2B,EAC3B,oCAAoC,EACpC,8BAA8B,EAC9B,mCAAmC,EACnC,wBAAwB,EACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAInD,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,MAAM,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"flexible-orders.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/flexible-orders.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,aAAa,EACb,0BAA0B,EAC1B,0BAA0B,EAC1B,6BAA6B,EAC7B,2BAA2B,EAC3B,oCAAoC,EACpC,8BAA8B,EAC9B,mCAAmC,EACnC,wBAAwB,E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,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAErG;;OAEG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExC;;;OAGG;IACH,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,mCAAmC,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAErG;;;OAGG;IACH,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,IAAI,EAAE,mCAAmC,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAEnI;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;CAC7D;AAED,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,qBAAqB,CAiJnH"}
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import type { Transport } from '@23blocks/contracts';
|
|
2
2
|
import type { MercadoPagoPaymentMethod, MercadoPagoPaymentIntent, CreateMercadoPagoPaymentRequest, CreateMercadoPagoPSERequest } from '../types/mercadopago.js';
|
|
3
3
|
export interface MercadoPagoService {
|
|
4
|
+
/**
|
|
5
|
+
* List available MercadoPago payment methods.
|
|
6
|
+
* @returns Array of MercadoPagoPaymentMethod records.
|
|
7
|
+
*/
|
|
4
8
|
listPaymentMethods(): Promise<MercadoPagoPaymentMethod[]>;
|
|
9
|
+
/**
|
|
10
|
+
* Create a MercadoPago payment intent.
|
|
11
|
+
* @returns MercadoPagoPaymentIntent with status, amounts, and redirect URLs.
|
|
12
|
+
*/
|
|
5
13
|
createPaymentIntent(data: CreateMercadoPagoPaymentRequest): Promise<MercadoPagoPaymentIntent>;
|
|
14
|
+
/**
|
|
15
|
+
* Create a MercadoPago PSE (bank transfer) payment intent.
|
|
16
|
+
* @returns MercadoPagoPaymentIntent with PSE-specific redirect URLs.
|
|
17
|
+
*/
|
|
6
18
|
createPSEIntent(data: CreateMercadoPagoPSERequest): Promise<MercadoPagoPaymentIntent>;
|
|
7
19
|
}
|
|
8
20
|
export declare function createMercadoPagoService(transport: Transport, _config: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mercadopago.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/mercadopago.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EACV,wBAAwB,EACxB,wBAAwB,EACxB,+BAA+B,EAC/B,2BAA2B,EAC5B,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,kBAAkB;IACjC,kBAAkB,IAAI,OAAO,CAAC,wBAAwB,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"mercadopago.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/mercadopago.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EACV,wBAAwB,EACxB,wBAAwB,EACxB,+BAA+B,EAC/B,2BAA2B,EAC5B,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,kBAAkB,IAAI,OAAO,CAAC,wBAAwB,EAAE,CAAC,CAAC;IAE1D;;;OAGG;IACH,mBAAmB,CAAC,IAAI,EAAE,+BAA+B,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;IAE9F;;;OAGG;IACH,eAAe,CAAC,IAAI,EAAE,2BAA2B,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;CACvF;AAED,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,kBAAkB,CA+G7G"}
|
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
import type { Transport } from '@23blocks/contracts';
|
|
2
2
|
import type { OrderDetail, UpdateOrderDetailRequest } from '../types/order-detail.js';
|
|
3
3
|
export interface OrderDetailsService {
|
|
4
|
+
/**
|
|
5
|
+
* List all order details.
|
|
6
|
+
* @returns Array of OrderDetail records.
|
|
7
|
+
*/
|
|
4
8
|
list(): Promise<OrderDetail[]>;
|
|
9
|
+
/**
|
|
10
|
+
* Get a single order detail by unique ID.
|
|
11
|
+
* @returns The matching OrderDetail record.
|
|
12
|
+
*/
|
|
5
13
|
get(uniqueId: string): Promise<OrderDetail>;
|
|
14
|
+
/**
|
|
15
|
+
* Update an existing order detail.
|
|
16
|
+
* @returns The updated OrderDetail record.
|
|
17
|
+
*/
|
|
6
18
|
update(uniqueId: string, data: UpdateOrderDetailRequest): Promise<OrderDetail>;
|
|
19
|
+
/**
|
|
20
|
+
* List order details belonging to a specific order.
|
|
21
|
+
* @returns Array of OrderDetail records for the order.
|
|
22
|
+
*/
|
|
7
23
|
listByOrder(orderUniqueId: string): Promise<OrderDetail[]>;
|
|
8
24
|
}
|
|
9
25
|
export declare function createOrderDetailsService(transport: Transport, _config: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order-details.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/order-details.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAGtF,MAAM,WAAW,mBAAmB;IAClC,IAAI,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"order-details.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/order-details.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAGtF,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,IAAI,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IAE/B;;;OAGG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAE5C;;;OAGG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,wBAAwB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAE/E;;;OAGG;IACH,WAAW,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;CAC5D;AAED,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,mBAAmB,CA+B/G"}
|
|
@@ -1,10 +1,29 @@
|
|
|
1
1
|
import type { Transport } from '@23blocks/contracts';
|
|
2
2
|
import type { OrderTax, CreateOrderTaxRequest, UpdateOrderTaxRequest } from '../types/order-tax.js';
|
|
3
3
|
export interface OrderTaxesService {
|
|
4
|
+
/**
|
|
5
|
+
* List all taxes for an order.
|
|
6
|
+
* @returns Array of OrderTax records for the order.
|
|
7
|
+
*/
|
|
4
8
|
list(orderUniqueId: string): Promise<OrderTax[]>;
|
|
9
|
+
/**
|
|
10
|
+
* Get a specific tax entry for an order.
|
|
11
|
+
* @returns The matching OrderTax record.
|
|
12
|
+
*/
|
|
5
13
|
get(orderUniqueId: string, uniqueId: string): Promise<OrderTax>;
|
|
14
|
+
/**
|
|
15
|
+
* Create a new tax entry for an order.
|
|
16
|
+
* @returns The newly created OrderTax record.
|
|
17
|
+
*/
|
|
6
18
|
create(orderUniqueId: string, data: CreateOrderTaxRequest): Promise<OrderTax>;
|
|
19
|
+
/**
|
|
20
|
+
* Update an existing tax entry for an order.
|
|
21
|
+
* @returns The updated OrderTax record.
|
|
22
|
+
*/
|
|
7
23
|
update(orderUniqueId: string, uniqueId: string, data: UpdateOrderTaxRequest): Promise<OrderTax>;
|
|
24
|
+
/**
|
|
25
|
+
* Delete a tax entry from an order.
|
|
26
|
+
*/
|
|
8
27
|
delete(orderUniqueId: string, uniqueId: string): Promise<void>;
|
|
9
28
|
}
|
|
10
29
|
export declare function createOrderTaxesService(transport: Transport, _config: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order-taxes.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/order-taxes.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EAAE,QAAQ,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAGpG,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"order-taxes.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/order-taxes.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EAAE,QAAQ,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAGpG,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAEjD;;;OAGG;IACH,GAAG,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEhE;;;OAGG;IACH,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAE9E;;;OAGG;IACH,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEhG;;OAEG;IACH,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChE;AAED,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,iBAAiB,CA0C3G"}
|
|
@@ -1,14 +1,50 @@
|
|
|
1
1
|
import type { Transport, PageResult } from '@23blocks/contracts';
|
|
2
2
|
import type { Order, CreateOrderRequest, UpdateOrderRequest, ListOrdersParams } from '../types/order.js';
|
|
3
3
|
export interface OrdersService {
|
|
4
|
+
/**
|
|
5
|
+
* List orders with optional filtering and sorting.
|
|
6
|
+
* @returns Paginated list of Order records with metadata.
|
|
7
|
+
*/
|
|
4
8
|
list(params?: ListOrdersParams): Promise<PageResult<Order>>;
|
|
9
|
+
/**
|
|
10
|
+
* Get a single order by unique ID.
|
|
11
|
+
* @returns The matching Order record.
|
|
12
|
+
*/
|
|
5
13
|
get(uniqueId: string): Promise<Order>;
|
|
14
|
+
/**
|
|
15
|
+
* Create a new order with line items.
|
|
16
|
+
* @returns The newly created Order record.
|
|
17
|
+
*/
|
|
6
18
|
create(data: CreateOrderRequest): Promise<Order>;
|
|
19
|
+
/**
|
|
20
|
+
* Update an existing order.
|
|
21
|
+
* @returns The updated Order record.
|
|
22
|
+
*/
|
|
7
23
|
update(uniqueId: string, data: UpdateOrderRequest): Promise<Order>;
|
|
24
|
+
/**
|
|
25
|
+
* Cancel an order.
|
|
26
|
+
* @returns The Order record with cancelled status.
|
|
27
|
+
*/
|
|
8
28
|
cancel(uniqueId: string): Promise<Order>;
|
|
29
|
+
/**
|
|
30
|
+
* Confirm an order.
|
|
31
|
+
* @returns The Order record with confirmed status.
|
|
32
|
+
*/
|
|
9
33
|
confirm(uniqueId: string): Promise<Order>;
|
|
34
|
+
/**
|
|
35
|
+
* Mark an order as shipped with an optional tracking number.
|
|
36
|
+
* @returns The Order record with shipped status.
|
|
37
|
+
*/
|
|
10
38
|
ship(uniqueId: string, trackingNumber?: string): Promise<Order>;
|
|
39
|
+
/**
|
|
40
|
+
* Mark an order as delivered.
|
|
41
|
+
* @returns The Order record with delivered status.
|
|
42
|
+
*/
|
|
11
43
|
deliver(uniqueId: string): Promise<Order>;
|
|
44
|
+
/**
|
|
45
|
+
* List orders for a specific user.
|
|
46
|
+
* @returns Paginated list of Order records for the user.
|
|
47
|
+
*/
|
|
12
48
|
listByUser(userUniqueId: string, params?: ListOrdersParams): Promise<PageResult<Order>>;
|
|
13
49
|
}
|
|
14
50
|
export declare function createOrdersService(transport: Transport, _config: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orders.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/orders.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EAAE,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAGzG,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"orders.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/orders.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EAAE,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAGzG,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,IAAI,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;IAE5D;;;OAGG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAEtC;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAEjD;;;OAGG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAEnE;;;OAGG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAEzC;;;OAGG;IACH,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAE1C;;;OAGG;IACH,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAEhE;;;OAGG;IACH,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAE1C;;;OAGG;IACH,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;CACzF;AAED,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,aAAa,CA0FnG"}
|
|
@@ -1,10 +1,31 @@
|
|
|
1
1
|
import type { Transport, PageResult } from '@23blocks/contracts';
|
|
2
2
|
import type { Payment, CreatePaymentRequest, ListPaymentsParams } from '../types/payment.js';
|
|
3
3
|
export interface PaymentsService {
|
|
4
|
+
/**
|
|
5
|
+
* List payments with optional filtering and sorting.
|
|
6
|
+
* @returns Paginated list of Payment records with metadata.
|
|
7
|
+
*/
|
|
4
8
|
list(params?: ListPaymentsParams): Promise<PageResult<Payment>>;
|
|
9
|
+
/**
|
|
10
|
+
* Get a single payment by unique ID.
|
|
11
|
+
* @returns The matching Payment record.
|
|
12
|
+
*/
|
|
5
13
|
get(uniqueId: string): Promise<Payment>;
|
|
14
|
+
/**
|
|
15
|
+
* Create a new payment for an order.
|
|
16
|
+
* @returns The newly created Payment record.
|
|
17
|
+
*/
|
|
6
18
|
create(data: CreatePaymentRequest): Promise<Payment>;
|
|
19
|
+
/**
|
|
20
|
+
* Refund a payment, optionally for a partial amount.
|
|
21
|
+
* @returns The updated Payment record with refund status.
|
|
22
|
+
* @note If amount is omitted, a full refund is processed.
|
|
23
|
+
*/
|
|
7
24
|
refund(uniqueId: string, amount?: number): Promise<Payment>;
|
|
25
|
+
/**
|
|
26
|
+
* List payments for a specific order.
|
|
27
|
+
* @returns Array of Payment records for the order.
|
|
28
|
+
*/
|
|
8
29
|
listByOrder(orderUniqueId: string): Promise<Payment[]>;
|
|
9
30
|
}
|
|
10
31
|
export declare function createPaymentsService(transport: Transport, _config: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payments.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/payments.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EAAE,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAG7F,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"payments.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/payments.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EAAE,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAG7F,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,IAAI,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;IAEhE;;;OAGG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAExC;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAErD;;;;OAIG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAE5D;;;OAGG;IACH,WAAW,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;CACxD;AAED,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,eAAe,CAmDvG"}
|
|
@@ -1,15 +1,54 @@
|
|
|
1
1
|
import type { Transport, PageResult } from '@23blocks/contracts';
|
|
2
2
|
import type { CreateStripeCustomerRequest, CreateStripeCustomerResponse, StripeCheckoutSession, CreateStripeCheckoutSessionRequest, StripePaymentIntent, CreateStripePaymentIntentRequest, StripeSubscription, CreateStripeSubscriptionRequest, UpdateStripeSubscriptionRequest, StripeCustomerPortalSession, CreateStripeCustomerPortalRequest, StripeWebhook, CreateStripeWebhookRequest, ListStripeSubscriptionsParams } from '../types/stripe.js';
|
|
3
3
|
export interface StripeService {
|
|
4
|
+
/**
|
|
5
|
+
* Create a Stripe customer.
|
|
6
|
+
* @returns CreateStripeCustomerResponse with `customerId` and `customer` details.
|
|
7
|
+
*/
|
|
4
8
|
createCustomer(data: CreateStripeCustomerRequest): Promise<CreateStripeCustomerResponse>;
|
|
9
|
+
/**
|
|
10
|
+
* Create a Stripe checkout session.
|
|
11
|
+
* @returns StripeCheckoutSession with `id`, `url`, `status`, and `expiresAt`.
|
|
12
|
+
*/
|
|
5
13
|
createCheckoutSession(data: CreateStripeCheckoutSessionRequest): Promise<StripeCheckoutSession>;
|
|
14
|
+
/**
|
|
15
|
+
* Create a Stripe payment intent.
|
|
16
|
+
* @returns StripePaymentIntent with `id`, `clientSecret`, `status`, `amount`, and `currency`.
|
|
17
|
+
*/
|
|
6
18
|
createPaymentIntent(data: CreateStripePaymentIntentRequest): Promise<StripePaymentIntent>;
|
|
19
|
+
/**
|
|
20
|
+
* Create a Stripe customer portal session for managing billing.
|
|
21
|
+
* @returns StripeCustomerPortalSession with `id` and `url`.
|
|
22
|
+
*/
|
|
7
23
|
createCustomerPortal(uniqueId: string, data: CreateStripeCustomerPortalRequest): Promise<StripeCustomerPortalSession>;
|
|
24
|
+
/**
|
|
25
|
+
* List Stripe subscriptions with optional filtering.
|
|
26
|
+
* @returns Paginated list of StripeSubscription records.
|
|
27
|
+
*/
|
|
8
28
|
listSubscriptions(params?: ListStripeSubscriptionsParams): Promise<PageResult<StripeSubscription>>;
|
|
29
|
+
/**
|
|
30
|
+
* Create a Stripe subscription.
|
|
31
|
+
* @returns The newly created StripeSubscription record.
|
|
32
|
+
*/
|
|
9
33
|
createSubscription(data: CreateStripeSubscriptionRequest): Promise<StripeSubscription>;
|
|
34
|
+
/**
|
|
35
|
+
* Update an existing Stripe subscription.
|
|
36
|
+
* @returns The updated StripeSubscription record.
|
|
37
|
+
*/
|
|
10
38
|
updateSubscription(stripeSubscriptionId: string, data: UpdateStripeSubscriptionRequest): Promise<StripeSubscription>;
|
|
39
|
+
/**
|
|
40
|
+
* Cancel a Stripe subscription.
|
|
41
|
+
*/
|
|
11
42
|
cancelSubscription(stripeSubscriptionId: string): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* List configured Stripe webhooks.
|
|
45
|
+
* @returns Array of StripeWebhook records.
|
|
46
|
+
*/
|
|
12
47
|
listWebhooks(): Promise<StripeWebhook[]>;
|
|
48
|
+
/**
|
|
49
|
+
* Create a new Stripe webhook endpoint.
|
|
50
|
+
* @returns The newly created StripeWebhook record.
|
|
51
|
+
*/
|
|
13
52
|
createWebhook(data: CreateStripeWebhookRequest): Promise<StripeWebhook>;
|
|
14
53
|
}
|
|
15
54
|
export declare function createStripeService(transport: Transport, _config: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripe.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/stripe.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EAEV,2BAA2B,EAC3B,4BAA4B,EAC5B,qBAAqB,EACrB,kCAAkC,EAClC,mBAAmB,EACnB,gCAAgC,EAChC,kBAAkB,EAClB,+BAA+B,EAC/B,+BAA+B,EAC/B,2BAA2B,EAC3B,iCAAiC,EACjC,aAAa,EACb,0BAA0B,EAC1B,6BAA6B,EAC9B,MAAM,oBAAoB,CAAC;AAE5B,MAAM,WAAW,aAAa;IAC5B,cAAc,CAAC,IAAI,EAAE,2BAA2B,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"stripe.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/stripe.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EAEV,2BAA2B,EAC3B,4BAA4B,EAC5B,qBAAqB,EACrB,kCAAkC,EAClC,mBAAmB,EACnB,gCAAgC,EAChC,kBAAkB,EAClB,+BAA+B,EAC/B,+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nG"}
|
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
import type { Transport, PageResult } from '@23blocks/contracts';
|
|
2
2
|
import type { SubscriptionModel, CreateSubscriptionModelRequest, UpdateSubscriptionModelRequest, ListSubscriptionModelsParams } from '../types/subscription-model.js';
|
|
3
3
|
export interface SubscriptionModelsService {
|
|
4
|
+
/**
|
|
5
|
+
* List subscription models with optional filtering and sorting.
|
|
6
|
+
* @returns Paginated list of SubscriptionModel records with metadata.
|
|
7
|
+
*/
|
|
4
8
|
list(params?: ListSubscriptionModelsParams): Promise<PageResult<SubscriptionModel>>;
|
|
9
|
+
/**
|
|
10
|
+
* Get a single subscription model by unique ID.
|
|
11
|
+
* @returns The matching SubscriptionModel record.
|
|
12
|
+
*/
|
|
5
13
|
get(uniqueId: string): Promise<SubscriptionModel>;
|
|
14
|
+
/**
|
|
15
|
+
* Create a new subscription model.
|
|
16
|
+
* @returns The newly created SubscriptionModel record.
|
|
17
|
+
*/
|
|
6
18
|
create(data: CreateSubscriptionModelRequest): Promise<SubscriptionModel>;
|
|
19
|
+
/**
|
|
20
|
+
* Update an existing subscription model.
|
|
21
|
+
* @returns The updated SubscriptionModel record.
|
|
22
|
+
*/
|
|
7
23
|
update(uniqueId: string, data: UpdateSubscriptionModelRequest): Promise<SubscriptionModel>;
|
|
8
24
|
}
|
|
9
25
|
export declare function createSubscriptionModelsService(transport: Transport, _config: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscription-models.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/subscription-models.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,iBAAiB,EACjB,8BAA8B,EAC9B,8BAA8B,EAC9B,4BAA4B,EAC7B,MAAM,gCAAgC,CAAC;AAGxC,MAAM,WAAW,yBAAyB;IACxC,IAAI,CAAC,MAAM,CAAC,EAAE,4BAA4B,GAAG,OAAO,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"subscription-models.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/subscription-models.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,iBAAiB,EACjB,8BAA8B,EAC9B,8BAA8B,EAC9B,4BAA4B,EAC7B,MAAM,gCAAgC,CAAC;AAGxC,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,IAAI,CAAC,MAAM,CAAC,EAAE,4BAA4B,GAAG,OAAO,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAEpF;;;OAGG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAElD;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,8BAA8B,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAEzE;;;OAGG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,8BAA8B,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC5F;AAED,wBAAgB,+BAA+B,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,yBAAyB,CA0D3H"}
|
|
@@ -1,13 +1,45 @@
|
|
|
1
1
|
import type { Transport, PageResult } from '@23blocks/contracts';
|
|
2
2
|
import type { Subscription, CreateSubscriptionRequest, UpdateSubscriptionRequest, ListSubscriptionsParams } from '../types/subscription.js';
|
|
3
3
|
export interface SubscriptionsService {
|
|
4
|
+
/**
|
|
5
|
+
* List subscriptions with optional filtering and sorting.
|
|
6
|
+
* @returns Paginated list of Subscription records with metadata.
|
|
7
|
+
*/
|
|
4
8
|
list(params?: ListSubscriptionsParams): Promise<PageResult<Subscription>>;
|
|
9
|
+
/**
|
|
10
|
+
* Get a single subscription by unique ID.
|
|
11
|
+
* @returns The matching Subscription record.
|
|
12
|
+
*/
|
|
5
13
|
get(uniqueId: string): Promise<Subscription>;
|
|
14
|
+
/**
|
|
15
|
+
* Create a new subscription.
|
|
16
|
+
* @returns The newly created Subscription record.
|
|
17
|
+
*/
|
|
6
18
|
create(data: CreateSubscriptionRequest): Promise<Subscription>;
|
|
19
|
+
/**
|
|
20
|
+
* Update an existing subscription.
|
|
21
|
+
* @returns The updated Subscription record.
|
|
22
|
+
*/
|
|
7
23
|
update(uniqueId: string, data: UpdateSubscriptionRequest): Promise<Subscription>;
|
|
24
|
+
/**
|
|
25
|
+
* Cancel a subscription.
|
|
26
|
+
* @returns The Subscription record with cancelled status.
|
|
27
|
+
*/
|
|
8
28
|
cancel(uniqueId: string): Promise<Subscription>;
|
|
29
|
+
/**
|
|
30
|
+
* Pause an active subscription.
|
|
31
|
+
* @returns The Subscription record with paused status.
|
|
32
|
+
*/
|
|
9
33
|
pause(uniqueId: string): Promise<Subscription>;
|
|
34
|
+
/**
|
|
35
|
+
* Resume a paused subscription.
|
|
36
|
+
* @returns The Subscription record with resumed status.
|
|
37
|
+
*/
|
|
10
38
|
resume(uniqueId: string): Promise<Subscription>;
|
|
39
|
+
/**
|
|
40
|
+
* List subscriptions for a specific user.
|
|
41
|
+
* @returns Paginated list of Subscription records for the user.
|
|
42
|
+
*/
|
|
11
43
|
listByUser(userUniqueId: string, params?: ListSubscriptionsParams): Promise<PageResult<Subscription>>;
|
|
12
44
|
}
|
|
13
45
|
export declare function createSubscriptionsService(transport: Transport, _config: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/subscriptions.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EAAE,YAAY,EAA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AuB,GAAG,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC;CACvG;AAED,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,oBAAoB,CAkFjH"}
|
|
@@ -2,21 +2,72 @@ import type { Transport, PageResult } from '@23blocks/contracts';
|
|
|
2
2
|
import type { SalesUser, RegisterSalesUserRequest, UpdateSalesUserRequest, ListSalesUsersParams, UserSubscription, CreateUserSubscriptionRequest, UpdateUserSubscriptionRequest, AddSubscriptionConsumptionRequest, ListUserSubscriptionsParams } from '../types/user.js';
|
|
3
3
|
import type { Order } from '../types/order.js';
|
|
4
4
|
export interface SalesUsersService {
|
|
5
|
+
/**
|
|
6
|
+
* List sales users with optional filtering and sorting.
|
|
7
|
+
* @returns Paginated list of SalesUser records with metadata.
|
|
8
|
+
*/
|
|
5
9
|
list(params?: ListSalesUsersParams): Promise<PageResult<SalesUser>>;
|
|
10
|
+
/**
|
|
11
|
+
* Get a sales user by unique ID.
|
|
12
|
+
* @returns The matching SalesUser record.
|
|
13
|
+
*/
|
|
6
14
|
get(uniqueId: string): Promise<SalesUser>;
|
|
15
|
+
/**
|
|
16
|
+
* Register a user in the sales system.
|
|
17
|
+
* @returns The newly registered SalesUser record.
|
|
18
|
+
*/
|
|
7
19
|
register(uniqueId: string, data?: RegisterSalesUserRequest): Promise<SalesUser>;
|
|
20
|
+
/**
|
|
21
|
+
* Update a sales user.
|
|
22
|
+
* @returns The updated SalesUser record.
|
|
23
|
+
*/
|
|
8
24
|
update(uniqueId: string, data: UpdateSalesUserRequest): Promise<SalesUser>;
|
|
25
|
+
/**
|
|
26
|
+
* List orders for a specific user.
|
|
27
|
+
* @returns Paginated list of Order records.
|
|
28
|
+
*/
|
|
9
29
|
listOrders(uniqueId: string, params?: {
|
|
10
30
|
page?: number;
|
|
11
31
|
perPage?: number;
|
|
12
32
|
}): Promise<PageResult<Order>>;
|
|
33
|
+
/**
|
|
34
|
+
* Get a specific order for a user.
|
|
35
|
+
* @returns The matching Order record.
|
|
36
|
+
*/
|
|
13
37
|
getOrder(uniqueId: string, orderUniqueId: string): Promise<Order>;
|
|
38
|
+
/**
|
|
39
|
+
* List subscriptions for a user.
|
|
40
|
+
* @returns Paginated list of UserSubscription records.
|
|
41
|
+
*/
|
|
14
42
|
listSubscriptions(uniqueId: string, params?: ListUserSubscriptionsParams): Promise<PageResult<UserSubscription>>;
|
|
43
|
+
/**
|
|
44
|
+
* Get a specific subscription for a user.
|
|
45
|
+
* @returns The matching UserSubscription record.
|
|
46
|
+
*/
|
|
15
47
|
getSubscription(uniqueId: string, subscriptionUniqueId: string): Promise<UserSubscription>;
|
|
48
|
+
/**
|
|
49
|
+
* Create a subscription for a user based on a subscription model.
|
|
50
|
+
* @returns The newly created UserSubscription record.
|
|
51
|
+
*/
|
|
16
52
|
createSubscription(uniqueId: string, subscriptionUniqueId: string, data?: CreateUserSubscriptionRequest): Promise<UserSubscription>;
|
|
53
|
+
/**
|
|
54
|
+
* Update a user subscription.
|
|
55
|
+
* @returns The updated UserSubscription record.
|
|
56
|
+
*/
|
|
17
57
|
updateSubscription(uniqueId: string, subscriptionUniqueId: string, data: UpdateUserSubscriptionRequest): Promise<UserSubscription>;
|
|
58
|
+
/**
|
|
59
|
+
* Add a consumption record to a user subscription.
|
|
60
|
+
* @returns The updated UserSubscription record with consumption data.
|
|
61
|
+
*/
|
|
18
62
|
addConsumption(uniqueId: string, subscriptionUniqueId: string, data: AddSubscriptionConsumptionRequest): Promise<UserSubscription>;
|
|
63
|
+
/**
|
|
64
|
+
* Cancel a user subscription.
|
|
65
|
+
* @returns The UserSubscription record with cancelled status.
|
|
66
|
+
*/
|
|
19
67
|
cancelSubscription(uniqueId: string, subscriptionUniqueId: string): Promise<UserSubscription>;
|
|
68
|
+
/**
|
|
69
|
+
* Delete a user subscription.
|
|
70
|
+
*/
|
|
20
71
|
deleteSubscription(uniqueId: string, subscriptionUniqueId: string): Promise<void>;
|
|
21
72
|
}
|
|
22
73
|
export declare function createSalesUsersService(transport: Transport, _config: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/users.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,SAAS,EACT,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,gBAAgB,EAChB,6BAA6B,EAC7B,6BAA6B,EAC7B,iCAAiC,EACjC,2BAA2B,EAC5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAI/C,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,MAAM,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"users.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/users.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,SAAS,EACT,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,gBAAgB,EAChB,6BAA6B,EAC7B,6BAA6B,EAC7B,iCAAiC,EACjC,2BAA2B,EAC5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAI/C,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,IAAI,CAAC,MAAM,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;IAEpE;;;OAGG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC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AAC,gBAAgB,CAAC,CAAC;IAEnI;;;OAGG;IACH,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAE9F;;OAEG;IACH,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnF;AAED,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,iBAAiB,CA4N3G"}
|
|
@@ -2,17 +2,64 @@ import type { Transport } from '@23blocks/contracts';
|
|
|
2
2
|
import type { VendorPayment, CreateVendorPaymentRequest, UpdateVendorPaymentRequest, OrderDetailVendor, CreateOrderDetailVendorRequest, UpdateOrderDetailVendorRequest, CreateOrderDetailVendorBySourceRequest } from '../types/vendor-payment.js';
|
|
3
3
|
import type { VendorPaymentReportSummary, VendorPaymentReportList, VendorPaymentReportParams, ProviderReportSummary, ProviderReportList, ProviderReportParams } from '../types/report.js';
|
|
4
4
|
export interface VendorPaymentsService {
|
|
5
|
+
/**
|
|
6
|
+
* Get a vendor payment by unique ID.
|
|
7
|
+
* @returns The matching VendorPayment record.
|
|
8
|
+
*/
|
|
5
9
|
get(paymentUniqueId: string): Promise<VendorPayment>;
|
|
10
|
+
/**
|
|
11
|
+
* Create a vendor payment for an order detail.
|
|
12
|
+
* @returns The newly created VendorPayment record.
|
|
13
|
+
*/
|
|
6
14
|
create(orderUniqueId: string, detailUniqueId: string, vendorUniqueId: string, data: CreateVendorPaymentRequest): Promise<VendorPayment>;
|
|
15
|
+
/**
|
|
16
|
+
* Update an existing vendor payment.
|
|
17
|
+
* @returns The updated VendorPayment record.
|
|
18
|
+
*/
|
|
7
19
|
update(orderUniqueId: string, detailUniqueId: string, vendorUniqueId: string, paymentUniqueId: string, data: UpdateVendorPaymentRequest): Promise<VendorPayment>;
|
|
20
|
+
/**
|
|
21
|
+
* Mark a vendor payment as paid.
|
|
22
|
+
* @returns The VendorPayment record with paid status and paidAt timestamp.
|
|
23
|
+
*/
|
|
8
24
|
pay(orderUniqueId: string, detailUniqueId: string, vendorUniqueId: string, paymentUniqueId: string): Promise<VendorPayment>;
|
|
25
|
+
/**
|
|
26
|
+
* Delete a vendor payment.
|
|
27
|
+
*/
|
|
9
28
|
delete(orderUniqueId: string, detailUniqueId: string, vendorUniqueId: string, paymentUniqueId: string): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Create a provider (vendor) assignment for an order detail.
|
|
31
|
+
* @returns The newly created OrderDetailVendor record.
|
|
32
|
+
*/
|
|
10
33
|
createProvider(orderUniqueId: string, orderDetailUniqueId: string, data: CreateOrderDetailVendorRequest): Promise<OrderDetailVendor>;
|
|
34
|
+
/**
|
|
35
|
+
* Create a provider assignment by source ID.
|
|
36
|
+
* @returns The newly created OrderDetailVendor record.
|
|
37
|
+
*/
|
|
11
38
|
createProviderBySource(sourceId: string, data: CreateOrderDetailVendorBySourceRequest): Promise<OrderDetailVendor>;
|
|
39
|
+
/**
|
|
40
|
+
* Update a provider assignment for an order detail.
|
|
41
|
+
* @returns The updated OrderDetailVendor record.
|
|
42
|
+
*/
|
|
12
43
|
updateProvider(orderUniqueId: string, orderDetailUniqueId: string, providerUniqueId: string, data: UpdateOrderDetailVendorRequest): Promise<OrderDetailVendor>;
|
|
44
|
+
/**
|
|
45
|
+
* Get a detailed vendor payment report list.
|
|
46
|
+
* @returns VendorPaymentReportList with payments array, summary, and pagination meta.
|
|
47
|
+
*/
|
|
13
48
|
reportList(params: VendorPaymentReportParams): Promise<VendorPaymentReportList>;
|
|
49
|
+
/**
|
|
50
|
+
* Get a vendor payment report summary.
|
|
51
|
+
* @returns VendorPaymentReportSummary with totals and breakdown by status.
|
|
52
|
+
*/
|
|
14
53
|
reportSummary(params: VendorPaymentReportParams): Promise<VendorPaymentReportSummary>;
|
|
54
|
+
/**
|
|
55
|
+
* Get a detailed provider report list.
|
|
56
|
+
* @returns ProviderReportList with providers array, summary, and pagination meta.
|
|
57
|
+
*/
|
|
15
58
|
providerReportList(params: ProviderReportParams): Promise<ProviderReportList>;
|
|
59
|
+
/**
|
|
60
|
+
* Get a provider report summary.
|
|
61
|
+
* @returns ProviderReportSummary with totals, commissions, and breakdown by status.
|
|
62
|
+
*/
|
|
16
63
|
providerReportSummary(params: ProviderReportParams): Promise<ProviderReportSummary>;
|
|
17
64
|
}
|
|
18
65
|
export declare function createVendorPaymentsService(transport: Transport, _config: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vendor-payments.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/vendor-payments.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAc,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EACV,aAAa,EACb,0BAA0B,EAC1B,0BAA0B,EAC1B,iBAAiB,EACjB,8BAA8B,EAC9B,8BAA8B,EAC9B,sCAAsC,EACvC,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,0BAA0B,EAC1B,uBAAuB,EACvB,yBAAyB,EACzB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,WAAW,qBAAqB;IACpC,GAAG,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"vendor-payments.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/vendor-payments.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAc,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EACV,aAAa,EACb,0BAA0B,EAC1B,0BAA0B,EAC1B,iBAAiB,EACjB,8BAA8B,EAC9B,8BAA8B,EAC9B,sCAAsC,EACvC,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,E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