@wasto/sdk 1.0.3 → 1.0.5
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.d.mts +60 -3
- package/dist/index.d.ts +60 -3
- package/dist/index.js +79 -0
- package/dist/index.mjs +79 -0
- package/package.json +1 -1
- package/src/client.ts +791 -692
- package/src/dashboard-apps.ts +367 -350
- package/src/dto/cms-app-settings.ts +91 -91
- package/src/enums.ts +298 -298
- package/src/free-tier.ts +56 -56
- package/src/index.ts +35 -35
- package/src/opening-hours/constants.ts +48 -48
- package/src/opening-hours/convert.ts +276 -276
- package/src/opening-hours/format.ts +99 -99
- package/src/opening-hours/index.ts +9 -9
- package/src/opening-hours/is-open-now.ts +38 -38
- package/src/opening-hours/resolve.ts +71 -71
- package/src/opening-hours/time.ts +74 -74
- package/src/opening-hours/timezone.ts +34 -34
- package/src/opening-hours/types.ts +53 -53
- package/src/opening-hours/validate.ts +182 -182
- package/src/roi/calculations.ts +732 -732
- package/src/roi/index.ts +1 -1
- package/src/types/app-preload.types.ts +10 -0
- package/src/types/asset-bookings.types.ts +19 -19
- package/src/types/asset-interventions.types.ts +24 -24
- package/src/types/assets.types.ts +68 -68
- package/src/types/auth.types.ts +37 -37
- package/src/types/blog-posts.types.ts +19 -19
- package/src/types/calendar-pdf.types.ts +24 -24
- package/src/types/calendo-events.types.ts +64 -64
- package/src/types/challenges.types.ts +30 -30
- package/src/types/chatbot.types.ts +82 -82
- package/src/types/cities.types.ts +27 -27
- package/src/types/city-groups.types.ts +46 -46
- package/src/types/cms.types.ts +87 -87
- package/src/types/field-reports.types.ts +66 -66
- package/src/types/free-tier.types.ts +54 -54
- package/src/types/index.ts +33 -32
- package/src/types/iot.types.ts +31 -31
- package/src/types/maintenance.types.ts +44 -44
- package/src/types/mapso.types.ts +146 -146
- package/src/types/notifications.types.ts +68 -68
- package/src/types/onboarding.types.ts +117 -117
- package/src/types/operational-zones.types.ts +70 -70
- package/src/types/pagination.types.ts +33 -33
- package/src/types/providers.types.ts +29 -29
- package/src/types/quiz-questions.types.ts +59 -59
- package/src/types/recycling-points.types.ts +47 -47
- package/src/types/roi.types.ts +60 -60
- package/src/types/surveys.types.ts +103 -103
- package/src/types/tickets.types.ts +65 -65
- package/src/types/users.types.ts +30 -30
- package/src/types/waste-collection-places-query.types.ts +4 -4
- package/src/types/waste-collection-places.types.ts +34 -33
- package/src/types/waste-types.types.ts +21 -21
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
import type { RecipientGroupType } from '../enums';
|
|
2
|
-
|
|
3
|
-
export interface CreateNotificationRequest {
|
|
4
|
-
title: string;
|
|
5
|
-
body: string;
|
|
6
|
-
data?: Record<string, unknown>;
|
|
7
|
-
recipientGroupId: string;
|
|
8
|
-
scheduledAt?: string;
|
|
9
|
-
/** Envoyer une notification push (défaut: true) */
|
|
10
|
-
sendPush?: boolean;
|
|
11
|
-
/** Afficher en modale dans l'app (défaut: false) */
|
|
12
|
-
showAsModal?: boolean;
|
|
13
|
-
/** Média CMS affiché dans la modale */
|
|
14
|
-
imageMediaId?: string | null;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface UpdateNotificationRequest {
|
|
18
|
-
title?: string;
|
|
19
|
-
body?: string;
|
|
20
|
-
data?: Record<string, unknown>;
|
|
21
|
-
recipientGroupId?: string;
|
|
22
|
-
scheduledAt?: string;
|
|
23
|
-
sendPush?: boolean;
|
|
24
|
-
showAsModal?: boolean;
|
|
25
|
-
imageMediaId?: string | null;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface CreateRecipientGroupRequest {
|
|
29
|
-
name: string;
|
|
30
|
-
description?: string;
|
|
31
|
-
type: RecipientGroupType;
|
|
32
|
-
/** Requis pour CITY_GROUP (tout le groupement) */
|
|
33
|
-
cityGroupId?: string;
|
|
34
|
-
/** Requis non vide pour CITY */
|
|
35
|
-
cityIds?: string[];
|
|
36
|
-
/** Requis non vide pour ZONE (lieux de collecte) */
|
|
37
|
-
wasteCollectionPlaceIds?: string[];
|
|
38
|
-
/** @deprecated Prefer cityIds */
|
|
39
|
-
cityId?: string;
|
|
40
|
-
/** @deprecated Prefer wasteCollectionPlaceIds */
|
|
41
|
-
wasteCollectionPlaceId?: string;
|
|
42
|
-
/** @deprecated Legacy operational zone targeting */
|
|
43
|
-
operationalZoneId?: string;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export interface UpdateRecipientGroupRequest {
|
|
47
|
-
name?: string;
|
|
48
|
-
description?: string;
|
|
49
|
-
type?: RecipientGroupType;
|
|
50
|
-
cityGroupId?: string;
|
|
51
|
-
cityIds?: string[];
|
|
52
|
-
wasteCollectionPlaceIds?: string[];
|
|
53
|
-
/** @deprecated Prefer cityIds */
|
|
54
|
-
cityId?: string;
|
|
55
|
-
/** @deprecated Prefer wasteCollectionPlaceIds */
|
|
56
|
-
wasteCollectionPlaceId?: string;
|
|
57
|
-
/** @deprecated Legacy operational zone targeting */
|
|
58
|
-
operationalZoneId?: string;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/** Annonce modale active pour l'app mobile */
|
|
62
|
-
export interface PublicAnnouncement {
|
|
63
|
-
id: string;
|
|
64
|
-
title: string;
|
|
65
|
-
body: string;
|
|
66
|
-
imageUrl?: string | null;
|
|
67
|
-
sentAt?: string | null;
|
|
68
|
-
}
|
|
1
|
+
import type { RecipientGroupType } from '../enums';
|
|
2
|
+
|
|
3
|
+
export interface CreateNotificationRequest {
|
|
4
|
+
title: string;
|
|
5
|
+
body: string;
|
|
6
|
+
data?: Record<string, unknown>;
|
|
7
|
+
recipientGroupId: string;
|
|
8
|
+
scheduledAt?: string;
|
|
9
|
+
/** Envoyer une notification push (défaut: true) */
|
|
10
|
+
sendPush?: boolean;
|
|
11
|
+
/** Afficher en modale dans l'app (défaut: false) */
|
|
12
|
+
showAsModal?: boolean;
|
|
13
|
+
/** Média CMS affiché dans la modale */
|
|
14
|
+
imageMediaId?: string | null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface UpdateNotificationRequest {
|
|
18
|
+
title?: string;
|
|
19
|
+
body?: string;
|
|
20
|
+
data?: Record<string, unknown>;
|
|
21
|
+
recipientGroupId?: string;
|
|
22
|
+
scheduledAt?: string;
|
|
23
|
+
sendPush?: boolean;
|
|
24
|
+
showAsModal?: boolean;
|
|
25
|
+
imageMediaId?: string | null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface CreateRecipientGroupRequest {
|
|
29
|
+
name: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
type: RecipientGroupType;
|
|
32
|
+
/** Requis pour CITY_GROUP (tout le groupement) */
|
|
33
|
+
cityGroupId?: string;
|
|
34
|
+
/** Requis non vide pour CITY */
|
|
35
|
+
cityIds?: string[];
|
|
36
|
+
/** Requis non vide pour ZONE (lieux de collecte) */
|
|
37
|
+
wasteCollectionPlaceIds?: string[];
|
|
38
|
+
/** @deprecated Prefer cityIds */
|
|
39
|
+
cityId?: string;
|
|
40
|
+
/** @deprecated Prefer wasteCollectionPlaceIds */
|
|
41
|
+
wasteCollectionPlaceId?: string;
|
|
42
|
+
/** @deprecated Legacy operational zone targeting */
|
|
43
|
+
operationalZoneId?: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface UpdateRecipientGroupRequest {
|
|
47
|
+
name?: string;
|
|
48
|
+
description?: string;
|
|
49
|
+
type?: RecipientGroupType;
|
|
50
|
+
cityGroupId?: string;
|
|
51
|
+
cityIds?: string[];
|
|
52
|
+
wasteCollectionPlaceIds?: string[];
|
|
53
|
+
/** @deprecated Prefer cityIds */
|
|
54
|
+
cityId?: string;
|
|
55
|
+
/** @deprecated Prefer wasteCollectionPlaceIds */
|
|
56
|
+
wasteCollectionPlaceId?: string;
|
|
57
|
+
/** @deprecated Legacy operational zone targeting */
|
|
58
|
+
operationalZoneId?: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** Annonce modale active pour l'app mobile */
|
|
62
|
+
export interface PublicAnnouncement {
|
|
63
|
+
id: string;
|
|
64
|
+
title: string;
|
|
65
|
+
body: string;
|
|
66
|
+
imageUrl?: string | null;
|
|
67
|
+
sentAt?: string | null;
|
|
68
|
+
}
|
|
@@ -1,117 +1,117 @@
|
|
|
1
|
-
import type { CityGroupType } from '../enums';
|
|
2
|
-
import type { DashboardAppSlug } from '../dashboard-apps';
|
|
3
|
-
import { FREE_SELF_SERVE_DASHBOARD_APP_SLUGS } from '../dashboard-apps';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Contrats API onboarding self-serve (compte gratuit → collectivité → mode restreint → PWA light).
|
|
7
|
-
* Routes : `POST /onboarding/bootstrap-city-group`, `POST /onboarding/request-join`,
|
|
8
|
-
* `GET /onboarding/search-city-groups`, `GET /onboarding/search-sinoe`,
|
|
9
|
-
* `POST /onboarding/bootstrap-pwa-light`, `POST /onboarding/sync-restricted-access`.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/** Étapes du parcours post-inscription (console). */
|
|
13
|
-
export type OnboardingStepId =
|
|
14
|
-
| 'account'
|
|
15
|
-
| 'collectivite'
|
|
16
|
-
| 'restricted'
|
|
17
|
-
| 'pwa_light'
|
|
18
|
-
| 'done';
|
|
19
|
-
|
|
20
|
-
export type BootstrapCityGroupRequest = {
|
|
21
|
-
/** Nom du groupement (ex. « CA du Pays de … »). */
|
|
22
|
-
name: string;
|
|
23
|
-
type?: CityGroupType;
|
|
24
|
-
/** Code / SIREN optionnels pour dédoublonnage. */
|
|
25
|
-
code?: string | null;
|
|
26
|
-
siren?: string | null;
|
|
27
|
-
/** Première commune rattachée (minimale). */
|
|
28
|
-
city?: {
|
|
29
|
-
name: string;
|
|
30
|
-
country?: string;
|
|
31
|
-
codeInsee?: string | null;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export type BootstrapCityGroupResponse = {
|
|
36
|
-
cityGroupId: string;
|
|
37
|
-
cityId?: string | null;
|
|
38
|
-
/** Apps activées (= preset free / restreint). */
|
|
39
|
-
enabledDashboardAppSlugs: DashboardAppSlug[];
|
|
40
|
-
/** Membership créateur : GESTIONNAIRE + authorizations. */
|
|
41
|
-
membershipId: string;
|
|
42
|
-
/** Prochaine étape console recommandée. */
|
|
43
|
-
nextStep: OnboardingStepId;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export type OnboardingCityGroupSearchHit = {
|
|
47
|
-
id: string;
|
|
48
|
-
name: string;
|
|
49
|
-
type: CityGroupType;
|
|
50
|
-
code?: string | null;
|
|
51
|
-
siren?: string | null;
|
|
52
|
-
citiesCount: number;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Hit ADEME / SINOE (Data Fair flux collecte) pour le sélecteur onboarding.
|
|
57
|
-
* `codeActeur` = `c_acteur` SINOE (pas un SIREN légal) — stocké en `CityGroup.code` au create.
|
|
58
|
-
*/
|
|
59
|
-
export type OnboardingSinoeSearchHit = {
|
|
60
|
-
id: string;
|
|
61
|
-
name: string;
|
|
62
|
-
codeActeur: string;
|
|
63
|
-
departement?: string | null;
|
|
64
|
-
codeDepartement?: string | null;
|
|
65
|
-
region?: string | null;
|
|
66
|
-
population?: number | null;
|
|
67
|
-
year: number;
|
|
68
|
-
typologie?: string | null;
|
|
69
|
-
/** CityGroup Wasto déjà présent (match code/siren = codeActeur). */
|
|
70
|
-
existingCityGroup?: OnboardingCityGroupSearchHit | null;
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export type RequestJoinCityGroupRequest = {
|
|
74
|
-
cityGroupId: string;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export type RequestJoinCityGroupResponse = {
|
|
78
|
-
membershipId: string;
|
|
79
|
-
cityGroupId: string;
|
|
80
|
-
/** MVP : false — en attente d’acceptation par un gestionnaire. */
|
|
81
|
-
isAccepted: boolean;
|
|
82
|
-
nextStep: OnboardingStepId;
|
|
83
|
-
/** TODO produit : workflow d’approbation / notification gestionnaire. */
|
|
84
|
-
note?: string;
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
export type PwaLightBootstrapRequest = {
|
|
88
|
-
cityGroupId: string;
|
|
89
|
-
/** Slug public PWA (unique). */
|
|
90
|
-
slug: string;
|
|
91
|
-
name?: string;
|
|
92
|
-
/** Publier immédiatement (`pwaPublished`). Défaut true. */
|
|
93
|
-
publish?: boolean;
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
export type PwaLightBootstrapResponse = {
|
|
97
|
-
cmsAppId: string;
|
|
98
|
-
slug: string;
|
|
99
|
-
/** Écrans light : tri + calendrier (hors carte / défis sur free). */
|
|
100
|
-
screens: ReadonlyArray<'tri' | 'calendrier' | 'carte' | 'defis'>;
|
|
101
|
-
previewPath: string;
|
|
102
|
-
pwaPublished: boolean;
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
export type SyncRestrictedAccessRequest = {
|
|
106
|
-
cityGroupId: string;
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
export type SyncRestrictedAccessResponse = {
|
|
110
|
-
cityGroupId: string;
|
|
111
|
-
enabledDashboardAppSlugs: DashboardAppSlug[];
|
|
112
|
-
membershipAuthorizations: string[];
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
/** Preset appliqué au bootstrap self-serve. */
|
|
116
|
-
export const ONBOARDING_RESTRICTED_APP_SLUGS: readonly DashboardAppSlug[] =
|
|
117
|
-
FREE_SELF_SERVE_DASHBOARD_APP_SLUGS;
|
|
1
|
+
import type { CityGroupType } from '../enums';
|
|
2
|
+
import type { DashboardAppSlug } from '../dashboard-apps';
|
|
3
|
+
import { FREE_SELF_SERVE_DASHBOARD_APP_SLUGS } from '../dashboard-apps';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Contrats API onboarding self-serve (compte gratuit → collectivité → mode restreint → PWA light).
|
|
7
|
+
* Routes : `POST /onboarding/bootstrap-city-group`, `POST /onboarding/request-join`,
|
|
8
|
+
* `GET /onboarding/search-city-groups`, `GET /onboarding/search-sinoe`,
|
|
9
|
+
* `POST /onboarding/bootstrap-pwa-light`, `POST /onboarding/sync-restricted-access`.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/** Étapes du parcours post-inscription (console). */
|
|
13
|
+
export type OnboardingStepId =
|
|
14
|
+
| 'account'
|
|
15
|
+
| 'collectivite'
|
|
16
|
+
| 'restricted'
|
|
17
|
+
| 'pwa_light'
|
|
18
|
+
| 'done';
|
|
19
|
+
|
|
20
|
+
export type BootstrapCityGroupRequest = {
|
|
21
|
+
/** Nom du groupement (ex. « CA du Pays de … »). */
|
|
22
|
+
name: string;
|
|
23
|
+
type?: CityGroupType;
|
|
24
|
+
/** Code / SIREN optionnels pour dédoublonnage. */
|
|
25
|
+
code?: string | null;
|
|
26
|
+
siren?: string | null;
|
|
27
|
+
/** Première commune rattachée (minimale). */
|
|
28
|
+
city?: {
|
|
29
|
+
name: string;
|
|
30
|
+
country?: string;
|
|
31
|
+
codeInsee?: string | null;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type BootstrapCityGroupResponse = {
|
|
36
|
+
cityGroupId: string;
|
|
37
|
+
cityId?: string | null;
|
|
38
|
+
/** Apps activées (= preset free / restreint). */
|
|
39
|
+
enabledDashboardAppSlugs: DashboardAppSlug[];
|
|
40
|
+
/** Membership créateur : GESTIONNAIRE + authorizations. */
|
|
41
|
+
membershipId: string;
|
|
42
|
+
/** Prochaine étape console recommandée. */
|
|
43
|
+
nextStep: OnboardingStepId;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export type OnboardingCityGroupSearchHit = {
|
|
47
|
+
id: string;
|
|
48
|
+
name: string;
|
|
49
|
+
type: CityGroupType;
|
|
50
|
+
code?: string | null;
|
|
51
|
+
siren?: string | null;
|
|
52
|
+
citiesCount: number;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Hit ADEME / SINOE (Data Fair flux collecte) pour le sélecteur onboarding.
|
|
57
|
+
* `codeActeur` = `c_acteur` SINOE (pas un SIREN légal) — stocké en `CityGroup.code` au create.
|
|
58
|
+
*/
|
|
59
|
+
export type OnboardingSinoeSearchHit = {
|
|
60
|
+
id: string;
|
|
61
|
+
name: string;
|
|
62
|
+
codeActeur: string;
|
|
63
|
+
departement?: string | null;
|
|
64
|
+
codeDepartement?: string | null;
|
|
65
|
+
region?: string | null;
|
|
66
|
+
population?: number | null;
|
|
67
|
+
year: number;
|
|
68
|
+
typologie?: string | null;
|
|
69
|
+
/** CityGroup Wasto déjà présent (match code/siren = codeActeur). */
|
|
70
|
+
existingCityGroup?: OnboardingCityGroupSearchHit | null;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export type RequestJoinCityGroupRequest = {
|
|
74
|
+
cityGroupId: string;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export type RequestJoinCityGroupResponse = {
|
|
78
|
+
membershipId: string;
|
|
79
|
+
cityGroupId: string;
|
|
80
|
+
/** MVP : false — en attente d’acceptation par un gestionnaire. */
|
|
81
|
+
isAccepted: boolean;
|
|
82
|
+
nextStep: OnboardingStepId;
|
|
83
|
+
/** TODO produit : workflow d’approbation / notification gestionnaire. */
|
|
84
|
+
note?: string;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export type PwaLightBootstrapRequest = {
|
|
88
|
+
cityGroupId: string;
|
|
89
|
+
/** Slug public PWA (unique). */
|
|
90
|
+
slug: string;
|
|
91
|
+
name?: string;
|
|
92
|
+
/** Publier immédiatement (`pwaPublished`). Défaut true. */
|
|
93
|
+
publish?: boolean;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export type PwaLightBootstrapResponse = {
|
|
97
|
+
cmsAppId: string;
|
|
98
|
+
slug: string;
|
|
99
|
+
/** Écrans light : tri + calendrier (hors carte / défis sur free). */
|
|
100
|
+
screens: ReadonlyArray<'tri' | 'calendrier' | 'carte' | 'defis'>;
|
|
101
|
+
previewPath: string;
|
|
102
|
+
pwaPublished: boolean;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export type SyncRestrictedAccessRequest = {
|
|
106
|
+
cityGroupId: string;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export type SyncRestrictedAccessResponse = {
|
|
110
|
+
cityGroupId: string;
|
|
111
|
+
enabledDashboardAppSlugs: DashboardAppSlug[];
|
|
112
|
+
membershipAuthorizations: string[];
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
/** Preset appliqué au bootstrap self-serve. */
|
|
116
|
+
export const ONBOARDING_RESTRICTED_APP_SLUGS: readonly DashboardAppSlug[] =
|
|
117
|
+
FREE_SELF_SERVE_DASHBOARD_APP_SLUGS;
|
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
import type { OperationalZoneStatus, OperationalZoneType } from '../enums';
|
|
2
|
-
|
|
3
|
-
export interface OperationalZoneStreetLink {
|
|
4
|
-
street: {
|
|
5
|
-
id: string;
|
|
6
|
-
name: string;
|
|
7
|
-
latitude?: number | null;
|
|
8
|
-
longitude?: number | null;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface OperationalZone {
|
|
13
|
-
id: string;
|
|
14
|
-
name: string;
|
|
15
|
-
type: OperationalZoneType;
|
|
16
|
-
status: OperationalZoneStatus;
|
|
17
|
-
geoJson: Record<string, unknown>;
|
|
18
|
-
color?: string | null;
|
|
19
|
-
description?: string | null;
|
|
20
|
-
dateFrom?: string | null;
|
|
21
|
-
dateTo?: string | null;
|
|
22
|
-
cityId: string;
|
|
23
|
-
city?: { id: string; name: string };
|
|
24
|
-
wasteCollectionPlaceId?: string | null;
|
|
25
|
-
wasteCollectionPlace?: { id: string; name: string; reference?: string | null } | null;
|
|
26
|
-
wasteTypeId?: string | null;
|
|
27
|
-
wasteType?: { id: string; name: string; color?: string | null } | null;
|
|
28
|
-
syncCalendarException?: boolean;
|
|
29
|
-
collectionExceptionId?: string | null;
|
|
30
|
-
collectionException?: {
|
|
31
|
-
id: string;
|
|
32
|
-
name: string;
|
|
33
|
-
dateFrom: string;
|
|
34
|
-
dateTo: string;
|
|
35
|
-
} | null;
|
|
36
|
-
streets?: OperationalZoneStreetLink[];
|
|
37
|
-
createdAt?: string;
|
|
38
|
-
updatedAt?: string;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface CreateOperationalZoneRequest {
|
|
42
|
-
name: string;
|
|
43
|
-
type: OperationalZoneType;
|
|
44
|
-
status?: OperationalZoneStatus;
|
|
45
|
-
geoJson: Record<string, unknown>;
|
|
46
|
-
color?: string;
|
|
47
|
-
description?: string;
|
|
48
|
-
dateFrom?: string;
|
|
49
|
-
dateTo?: string;
|
|
50
|
-
cityId: string;
|
|
51
|
-
streetIds?: string[];
|
|
52
|
-
wasteCollectionPlaceId?: string;
|
|
53
|
-
wasteTypeId?: string;
|
|
54
|
-
syncCalendarException?: boolean;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export interface UpdateOperationalZoneRequest {
|
|
58
|
-
name?: string;
|
|
59
|
-
type?: OperationalZoneType;
|
|
60
|
-
status?: OperationalZoneStatus;
|
|
61
|
-
geoJson?: Record<string, unknown>;
|
|
62
|
-
color?: string;
|
|
63
|
-
description?: string;
|
|
64
|
-
dateFrom?: string | null;
|
|
65
|
-
dateTo?: string | null;
|
|
66
|
-
streetIds?: string[];
|
|
67
|
-
wasteCollectionPlaceId?: string | null;
|
|
68
|
-
wasteTypeId?: string | null;
|
|
69
|
-
syncCalendarException?: boolean;
|
|
70
|
-
}
|
|
1
|
+
import type { OperationalZoneStatus, OperationalZoneType } from '../enums';
|
|
2
|
+
|
|
3
|
+
export interface OperationalZoneStreetLink {
|
|
4
|
+
street: {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
latitude?: number | null;
|
|
8
|
+
longitude?: number | null;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface OperationalZone {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
type: OperationalZoneType;
|
|
16
|
+
status: OperationalZoneStatus;
|
|
17
|
+
geoJson: Record<string, unknown>;
|
|
18
|
+
color?: string | null;
|
|
19
|
+
description?: string | null;
|
|
20
|
+
dateFrom?: string | null;
|
|
21
|
+
dateTo?: string | null;
|
|
22
|
+
cityId: string;
|
|
23
|
+
city?: { id: string; name: string };
|
|
24
|
+
wasteCollectionPlaceId?: string | null;
|
|
25
|
+
wasteCollectionPlace?: { id: string; name: string; reference?: string | null } | null;
|
|
26
|
+
wasteTypeId?: string | null;
|
|
27
|
+
wasteType?: { id: string; name: string; color?: string | null } | null;
|
|
28
|
+
syncCalendarException?: boolean;
|
|
29
|
+
collectionExceptionId?: string | null;
|
|
30
|
+
collectionException?: {
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
dateFrom: string;
|
|
34
|
+
dateTo: string;
|
|
35
|
+
} | null;
|
|
36
|
+
streets?: OperationalZoneStreetLink[];
|
|
37
|
+
createdAt?: string;
|
|
38
|
+
updatedAt?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface CreateOperationalZoneRequest {
|
|
42
|
+
name: string;
|
|
43
|
+
type: OperationalZoneType;
|
|
44
|
+
status?: OperationalZoneStatus;
|
|
45
|
+
geoJson: Record<string, unknown>;
|
|
46
|
+
color?: string;
|
|
47
|
+
description?: string;
|
|
48
|
+
dateFrom?: string;
|
|
49
|
+
dateTo?: string;
|
|
50
|
+
cityId: string;
|
|
51
|
+
streetIds?: string[];
|
|
52
|
+
wasteCollectionPlaceId?: string;
|
|
53
|
+
wasteTypeId?: string;
|
|
54
|
+
syncCalendarException?: boolean;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface UpdateOperationalZoneRequest {
|
|
58
|
+
name?: string;
|
|
59
|
+
type?: OperationalZoneType;
|
|
60
|
+
status?: OperationalZoneStatus;
|
|
61
|
+
geoJson?: Record<string, unknown>;
|
|
62
|
+
color?: string;
|
|
63
|
+
description?: string;
|
|
64
|
+
dateFrom?: string | null;
|
|
65
|
+
dateTo?: string | null;
|
|
66
|
+
streetIds?: string[];
|
|
67
|
+
wasteCollectionPlaceId?: string | null;
|
|
68
|
+
wasteTypeId?: string | null;
|
|
69
|
+
syncCalendarException?: boolean;
|
|
70
|
+
}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
export const DEFAULT_PAGE = 1;
|
|
2
|
-
export const DEFAULT_PAGE_SIZE = 20;
|
|
3
|
-
export const MAX_PAGE_SIZE = 100;
|
|
4
|
-
|
|
5
|
-
export interface PaginationQuery {
|
|
6
|
-
page?: number;
|
|
7
|
-
pageSize?: number;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface PaginationMeta {
|
|
11
|
-
page: number;
|
|
12
|
-
pageSize: number;
|
|
13
|
-
total: number;
|
|
14
|
-
totalPages: number;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface PaginatedResponse<T> {
|
|
18
|
-
data: T[];
|
|
19
|
-
meta: PaginationMeta;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function buildPaginationMeta(
|
|
23
|
-
page: number,
|
|
24
|
-
pageSize: number,
|
|
25
|
-
total: number,
|
|
26
|
-
): PaginationMeta {
|
|
27
|
-
return {
|
|
28
|
-
page,
|
|
29
|
-
pageSize,
|
|
30
|
-
total,
|
|
31
|
-
totalPages: Math.ceil(total / pageSize) || 1,
|
|
32
|
-
};
|
|
33
|
-
}
|
|
1
|
+
export const DEFAULT_PAGE = 1;
|
|
2
|
+
export const DEFAULT_PAGE_SIZE = 20;
|
|
3
|
+
export const MAX_PAGE_SIZE = 100;
|
|
4
|
+
|
|
5
|
+
export interface PaginationQuery {
|
|
6
|
+
page?: number;
|
|
7
|
+
pageSize?: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface PaginationMeta {
|
|
11
|
+
page: number;
|
|
12
|
+
pageSize: number;
|
|
13
|
+
total: number;
|
|
14
|
+
totalPages: number;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface PaginatedResponse<T> {
|
|
18
|
+
data: T[];
|
|
19
|
+
meta: PaginationMeta;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function buildPaginationMeta(
|
|
23
|
+
page: number,
|
|
24
|
+
pageSize: number,
|
|
25
|
+
total: number,
|
|
26
|
+
): PaginationMeta {
|
|
27
|
+
return {
|
|
28
|
+
page,
|
|
29
|
+
pageSize,
|
|
30
|
+
total,
|
|
31
|
+
totalPages: Math.ceil(total / pageSize) || 1,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import type { ProviderType } from '../enums';
|
|
2
|
-
|
|
3
|
-
export interface CreateProviderRequest {
|
|
4
|
-
name: string;
|
|
5
|
-
description?: string;
|
|
6
|
-
type?: ProviderType;
|
|
7
|
-
email?: string;
|
|
8
|
-
phone?: string;
|
|
9
|
-
address?: string;
|
|
10
|
-
siret?: string;
|
|
11
|
-
siren?: string;
|
|
12
|
-
website?: string;
|
|
13
|
-
cityGroupIds?: string[];
|
|
14
|
-
cityIds?: string[];
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface UpdateProviderRequest {
|
|
18
|
-
name?: string;
|
|
19
|
-
description?: string;
|
|
20
|
-
type?: ProviderType;
|
|
21
|
-
email?: string;
|
|
22
|
-
phone?: string;
|
|
23
|
-
address?: string;
|
|
24
|
-
siret?: string;
|
|
25
|
-
siren?: string;
|
|
26
|
-
website?: string;
|
|
27
|
-
cityGroupIds?: string[];
|
|
28
|
-
cityIds?: string[];
|
|
29
|
-
}
|
|
1
|
+
import type { ProviderType } from '../enums';
|
|
2
|
+
|
|
3
|
+
export interface CreateProviderRequest {
|
|
4
|
+
name: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
type?: ProviderType;
|
|
7
|
+
email?: string;
|
|
8
|
+
phone?: string;
|
|
9
|
+
address?: string;
|
|
10
|
+
siret?: string;
|
|
11
|
+
siren?: string;
|
|
12
|
+
website?: string;
|
|
13
|
+
cityGroupIds?: string[];
|
|
14
|
+
cityIds?: string[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface UpdateProviderRequest {
|
|
18
|
+
name?: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
type?: ProviderType;
|
|
21
|
+
email?: string;
|
|
22
|
+
phone?: string;
|
|
23
|
+
address?: string;
|
|
24
|
+
siret?: string;
|
|
25
|
+
siren?: string;
|
|
26
|
+
website?: string;
|
|
27
|
+
cityGroupIds?: string[];
|
|
28
|
+
cityIds?: string[];
|
|
29
|
+
}
|