@viridial/shared 1.0.27 → 1.0.28
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.
|
@@ -5,8 +5,6 @@ import type { Subscription, Invoice, Plan, BillingStats, SubscriptionCreate, Sub
|
|
|
5
5
|
export declare const billingService: {
|
|
6
6
|
/**
|
|
7
7
|
* Récupérer toutes les abonnements
|
|
8
|
-
* Note: Le backend n'a pas d'endpoint GET /api/billing/subscriptions
|
|
9
|
-
* On utilise /expiring avec une date très lointaine comme workaround
|
|
10
8
|
*/
|
|
11
9
|
getAllSubscriptions(params?: {
|
|
12
10
|
organizationId?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing.service.d.ts","sourceRoot":"","sources":["../../api/billing.service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAE/H;;GAEG;AACH,eAAO,MAAM,cAAc;IACzB
|
|
1
|
+
{"version":3,"file":"billing.service.d.ts","sourceRoot":"","sources":["../../api/billing.service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAE/H;;GAEG;AACH,eAAO,MAAM,cAAc;IACzB;;OAEG;iCACgC;QACjC,cAAc,CAAC,EAAE,MAAM,CAAA;QACvB,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,IAAI,CAAC,EAAE,MAAM,CAAA;KACd,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAoB3B;;OAEG;4BAC2B,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAK5D;;OAEG;wDACuD,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAOxF;;OAEG;6BAC4B,kBAAkB,GAAG,OAAO,CAAC,YAAY,CAAC;IAKzE;;OAEG;2BAC0B,MAAM,QAAQ,kBAAkB,GAAG,OAAO,CAAC,YAAY,CAAC;IAKrF;;OAEG;2BAC0B,MAAM,eAAe,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAQhF;;OAEG;0BACyB,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAK1D;;OAEG;oCACmC,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAStE;;OAEG;4BAC2B;QAC5B,cAAc,CAAC,EAAE,MAAM,CAAA;QACvB,cAAc,CAAC,EAAE,MAAM,CAAA;QACvB,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,IAAI,CAAC,EAAE,MAAM,CAAA;KACd,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAKtB;;OAEG;uBACsB,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKlD;;OAEG;8CAC6C,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAO3E;;OAEG;0BACyB,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKrD;;;;OAIG;gBACe,OAAO,CAAC,YAAY,CAAC;IA8BvC;;OAEG;mBACkB,OAAO,CAAC,IAAI,EAAE,CAAC;IAKpC;;OAEG;oBACmB,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAI7C,CAAA"}
|
|
@@ -6,21 +6,15 @@ import { API_ENDPOINTS } from '../constants/api.constants';
|
|
|
6
6
|
export const billingService = {
|
|
7
7
|
/**
|
|
8
8
|
* Récupérer toutes les abonnements
|
|
9
|
-
* Note: Le backend n'a pas d'endpoint GET /api/billing/subscriptions
|
|
10
|
-
* On utilise /expiring avec une date très lointaine comme workaround
|
|
11
9
|
*/
|
|
12
10
|
async getAllSubscriptions(params) {
|
|
13
|
-
|
|
14
|
-
// TODO: Créer un endpoint GET /api/billing/subscriptions dans le backend
|
|
15
|
-
const futureDate = new Date();
|
|
16
|
-
futureDate.setFullYear(futureDate.getFullYear() + 100); // 100 ans dans le futur
|
|
17
|
-
const response = await httpClient.get(API_ENDPOINTS.BILLING.SUBSCRIPTIONS.EXPIRING, { params: { date: futureDate.toISOString() } });
|
|
18
|
-
let subscriptions = response.data || [];
|
|
19
|
-
// Filtrer par status si fourni
|
|
11
|
+
const queryParams = {};
|
|
20
12
|
if (params?.status) {
|
|
21
|
-
|
|
13
|
+
queryParams.status = params.status;
|
|
22
14
|
}
|
|
23
|
-
|
|
15
|
+
const response = await httpClient.get(API_ENDPOINTS.BILLING.SUBSCRIPTIONS.BASE, { params: queryParams });
|
|
16
|
+
let subscriptions = response.data || [];
|
|
17
|
+
// Filtrer par organizationId côté client si fourni (le backend ne le supporte pas encore)
|
|
24
18
|
if (params?.organizationId) {
|
|
25
19
|
subscriptions = subscriptions.filter(s => s.organizationId === params.organizationId);
|
|
26
20
|
}
|