@viridial/shared 1.0.25 → 1.0.26

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.
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Service pour les statistiques optimisées
3
+ */
4
+ import type { DashboardStats } from '../types/stats.types';
5
+ export declare const statsService: {
6
+ /**
7
+ * Récupère toutes les statistiques du dashboard en une seule requête optimisée
8
+ */
9
+ getDashboardStats(): Promise<DashboardStats>;
10
+ };
11
+ //# sourceMappingURL=stats.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stats.service.d.ts","sourceRoot":"","sources":["../../api/stats.service.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D,eAAO,MAAM,YAAY;IACvB;;OAEG;yBACwB,OAAO,CAAC,cAAc,CAAC;CAInD,CAAA"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Service pour les statistiques optimisées
3
+ */
4
+ import { httpClient } from './http.client';
5
+ import { API_ENDPOINTS } from '../constants/api.constants';
6
+ export const statsService = {
7
+ /**
8
+ * Récupère toutes les statistiques du dashboard en une seule requête optimisée
9
+ */
10
+ async getDashboardStats() {
11
+ const response = await httpClient.get(API_ENDPOINTS.PROPERTIES.STATS);
12
+ return response.data;
13
+ }
14
+ };
@@ -15,6 +15,7 @@ export declare const API_ENDPOINTS: {
15
15
  readonly SEARCH: "/api/properties/search";
16
16
  readonly BY_ID: (id: number) => string;
17
17
  readonly FEATURES: (id: number) => string;
18
+ readonly STATS: "/api/properties/stats/dashboard";
18
19
  };
19
20
  readonly USERS: {
20
21
  readonly BASE: "/api/identity/users";
@@ -1 +1 @@
1
- {"version":3,"file":"api.constants.d.ts","sourceRoot":"","sources":["../../constants/api.constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;6BAcV,MAAM;gCACH,MAAM;;;;6BAKT,MAAM;;;;gCAIH,MAAM;;;;6BAKT,MAAM;sCACG,MAAM;;sCAEN,MAAM;;;;;;6BAOf,MAAM;;gCAEH,MAAM;;CAEf,CAAA;AAEV;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,SAAS,CAAA"}
1
+ {"version":3,"file":"api.constants.d.ts","sourceRoot":"","sources":["../../constants/api.constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;6BAcV,MAAM;gCACH,MAAM;;;;;6BAMT,MAAM;;;;gCAIH,MAAM;;;;6BAKT,MAAM;sCACG,MAAM;;sCAEN,MAAM;;;;;;6BAOf,MAAM;;gCAEH,MAAM;;CAEf,CAAA;AAEV;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,SAAS,CAAA"}
@@ -16,7 +16,8 @@ export const API_ENDPOINTS = {
16
16
  BASE: '/api/properties',
17
17
  SEARCH: '/api/properties/search',
18
18
  BY_ID: (id) => `/api/properties/${id}`,
19
- FEATURES: (id) => `/api/properties/${id}/features`
19
+ FEATURES: (id) => `/api/properties/${id}/features`,
20
+ STATS: '/api/properties/stats/dashboard'
20
21
  },
21
22
  // Users
22
23
  USERS: {
package/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export { propertyService } from './api/property.service';
7
7
  export { userService } from './api/user.service';
8
8
  export { organizationService } from './api/organization.service';
9
9
  export { documentService } from './api/document.service';
10
+ export { statsService } from './api/stats.service';
10
11
  export type { Organization, OrganizationCreate, OrganizationUpdate, OrganizationSearchParams, Team, TeamCreate, TeamUpdate, OrganizationUser } from './api/organization.service';
11
12
  export { useAuthStore } from './stores/auth.store';
12
13
  export { useUserStore } from './stores/user.store';
@@ -18,6 +19,7 @@ export type * from './types/property.types';
18
19
  export type * from './types/property-feature.types';
19
20
  export type * from './types/user.types';
20
21
  export type * from './types/document.types';
22
+ export type * from './types/stats.types';
21
23
  export { PropertyType, PropertyStatus } from './types/property.types';
22
24
  export { tokenUtils } from './utils/token.utils';
23
25
  export { API_ENDPOINTS, API_BASE_URL } from './constants/api.constants';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,YAAY,EACV,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,IAAI,EACJ,UAAU,EACV,UAAU,EACV,gBAAgB,EACjB,MAAM,4BAA4B,CAAA;AAGnC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAG/C,mBAAmB,mBAAmB,CAAA;AACtC,mBAAmB,oBAAoB,CAAA;AACvC,mBAAmB,wBAAwB,CAAA;AAC3C,mBAAmB,gCAAgC,CAAA;AACnD,mBAAmB,oBAAoB,CAAA;AACvC,mBAAmB,wBAAwB,CAAA;AAG3C,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAGrE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAGhD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAGvE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA"}
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package/dist/index.js CHANGED
@@ -8,6 +8,7 @@ export { propertyService } from './api/property.service';
8
8
  export { userService } from './api/user.service';
9
9
  export { organizationService } from './api/organization.service';
10
10
  export { documentService } from './api/document.service';
11
+ export { statsService } from './api/stats.service';
11
12
  // Stores
12
13
  export { useAuthStore } from './stores/auth.store';
13
14
  export { useUserStore } from './stores/user.store';
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Types pour les statistiques du dashboard
3
+ */
4
+ export interface DashboardStats {
5
+ propertyStats: PropertyStats;
6
+ userStats: DashboardUserStats;
7
+ organizationStats: OrganizationStats;
8
+ }
9
+ export interface PropertyStats {
10
+ total: number;
11
+ available: number;
12
+ sold: number;
13
+ rented: number;
14
+ published: number;
15
+ draft: number;
16
+ pending: number;
17
+ averagePrice: number;
18
+ averageSurface: number;
19
+ newThisMonth: number;
20
+ newThisWeek: number;
21
+ byType: Record<string, number>;
22
+ byStatus: Record<string, number>;
23
+ byCity: Record<string, number>;
24
+ }
25
+ export interface DashboardUserStats {
26
+ total: number;
27
+ active: number;
28
+ inactive: number;
29
+ newThisMonth: number;
30
+ newThisWeek: number;
31
+ }
32
+ export interface OrganizationStats {
33
+ total: number;
34
+ active: number;
35
+ newThisMonth: number;
36
+ newThisWeek: number;
37
+ }
38
+ //# sourceMappingURL=stats.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stats.types.d.ts","sourceRoot":"","sources":["../../types/stats.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,cAAc;IAC7B,aAAa,EAAE,aAAa,CAAA;IAC5B,SAAS,EAAE,kBAAkB,CAAA;IAC7B,iBAAiB,EAAE,iBAAiB,CAAA;CACrC;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,MAAM,CAAA;IACtB,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC9B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAChC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC/B;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;CACpB"}
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Types pour les statistiques du dashboard
3
+ */
4
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viridial/shared",
3
- "version": "1.0.25",
3
+ "version": "1.0.26",
4
4
  "type": "module",
5
5
  "description": "Shared modules for Real Estate frontend applications - Vue 3, TypeScript, Pinia, Axios",
6
6
  "main": "./dist/index.js",