@experteam-mx/ngx-services 18.7.10 → 18.7.11

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.
@@ -9,9 +9,9 @@ export declare class ApiDiscountsService {
9
9
  private http;
10
10
  constructor(environments: Environment, http: HttpClient);
11
11
  /**
12
- * Retrieves the URL for the shipments API from the environment configurations.
12
+ * Gets the API endpoint URL for discounts from the environments configuration.
13
13
  *
14
- * @return {string} The URL of the shipments API.
14
+ * @return {string} The URL for the discounts API. Returns an empty string if not defined.
15
15
  */
16
16
  get url(): string;
17
17
  /**
@@ -0,0 +1,70 @@
1
+ import { HttpClient } from '@angular/common/http';
2
+ import { Environment } from '../ngx-services.models';
3
+ import { QueryParams } from './models/api.models';
4
+ import { NotificationConfigurationIn, NotificationConfigurationOut, NotificationIn, NotificationOut, NotificationsOut, NotificationsTypeOut } from './models/api-notifications.types';
5
+ import { Observable } from 'rxjs';
6
+ import * as i0 from "@angular/core";
7
+ export declare class ApiNotificationsService {
8
+ private environments;
9
+ private http;
10
+ constructor(environments: Environment, http: HttpClient);
11
+ /**
12
+ * Retrieves the URL for the notifications API from the environment settings.
13
+ * If the URL is not defined, an empty string is returned.
14
+ *
15
+ * @return {string} The API Notifications URL or an empty string if not defined.
16
+ */
17
+ get url(): string;
18
+ /**
19
+ * Retrieves notifications based on the provided query parameters.
20
+ *
21
+ * @param {QueryParams} params - The query parameters used to filter and retrieve notifications.
22
+ * @return {Observable<NotificationsOut>} An observable that emits the fetched notifications.
23
+ */
24
+ getNotifications(params: QueryParams): Observable<NotificationsOut>;
25
+ /**
26
+ * Sends a notification request to the server using the provided body.
27
+ *
28
+ * @param {NotificationIn} body - The notification data to be sent in the request body.
29
+ * @return {Observable<NotificationOut>} An observable emitting the response containing the notification output data.
30
+ */
31
+ postNotification(body: NotificationIn): Observable<NotificationOut>;
32
+ /**
33
+ * Sends a PUT request to update a notification with the provided ID and body.
34
+ *
35
+ * @param {number} id - The unique identifier of the notification to be updated.
36
+ * @param {NotificationIn} body - The data to update the notification with.
37
+ * @return {Observable<NotificationOut>} An observable containing the updated notification data.
38
+ */
39
+ putNotification(id: number, body: NotificationIn): Observable<NotificationOut>;
40
+ /**
41
+ * Deletes a notification by its unique identifier.
42
+ *
43
+ * @param {number} id - The unique identifier of the notification to delete.
44
+ * @return {Observable<{}>} An observable that emits the response after deleting the notification.
45
+ */
46
+ deleteNotification(id: number): Observable<{}>;
47
+ /**
48
+ * Marks the notification as finished for the specified notification ID.
49
+ *
50
+ * @param {number} id - The unique identifier of the notification to be marked as finished.
51
+ * @return {Observable<NotificationOut>} An Observable emitting the updated notification object.
52
+ */
53
+ putNotificationFinish(id: number): Observable<NotificationOut>;
54
+ /**
55
+ * Sends a POST request to create or update notification configurations.
56
+ *
57
+ * @param {NotificationConfigurationIn} body - The notification configuration payload to be sent in the request.
58
+ * @return {Observable<NotificationConfigurationOut>} An observable emitting the response containing the created or updated notification configuration.
59
+ */
60
+ postNotificationConfigurations(body: NotificationConfigurationIn): Observable<NotificationConfigurationOut>;
61
+ /**
62
+ * Retrieves the notification types based on the provided query parameters.
63
+ *
64
+ * @param {QueryParams} params - The query parameters for fetching the notification types.
65
+ * @return {Observable<NotificationsTypeOut>} An observable that emits the fetched notification types.
66
+ */
67
+ getNotificationsType(params: QueryParams): Observable<NotificationsTypeOut>;
68
+ static ɵfac: i0.ɵɵFactoryDeclaration<ApiNotificationsService, never>;
69
+ static ɵprov: i0.ɵɵInjectableDeclaration<ApiNotificationsService>;
70
+ }
@@ -0,0 +1,36 @@
1
+ import { SymfonyModel } from './api.models';
2
+ export interface Notification extends SymfonyModel {
3
+ name: string;
4
+ notificationType: NotificationType;
5
+ notificationStatus: NotificationStatus;
6
+ userId: string;
7
+ content: string;
8
+ url: string;
9
+ image: string;
10
+ starDate: string;
11
+ endDate: string;
12
+ countryId: string;
13
+ }
14
+ export interface NotificationConfiguration extends SymfonyModel {
15
+ notification: Notification;
16
+ entity: Entity;
17
+ }
18
+ export interface NotificationType extends SymfonyModel {
19
+ name: string;
20
+ }
21
+ export interface NotificationStatus extends SymfonyModel {
22
+ name: string;
23
+ }
24
+ export interface Entity {
25
+ id: number;
26
+ level: string;
27
+ modelId: string;
28
+ modelType: string;
29
+ extraFields: {
30
+ countryId: number;
31
+ companyCountryId: number;
32
+ locationId: number;
33
+ installationId: number;
34
+ systemId: number;
35
+ };
36
+ }
@@ -0,0 +1,34 @@
1
+ import { Notification, NotificationConfiguration, NotificationType } from './api-notifications.interfaces';
2
+ export type NotificationsOut = {
3
+ notifications: Notification[];
4
+ total: number;
5
+ };
6
+ export type NotificationIn = {
7
+ name: string;
8
+ notificationTypeId: number;
9
+ userId?: string;
10
+ content: string;
11
+ url: string;
12
+ image: string;
13
+ starDate: string;
14
+ endDate: string;
15
+ isActive: boolean;
16
+ };
17
+ export type NotificationOut = {
18
+ notification: Notification;
19
+ };
20
+ export type NotificationConfigurationIn = {
21
+ modelId: number[];
22
+ modelType: string;
23
+ notificationId: number;
24
+ extraFields: {
25
+ [key: string]: string;
26
+ };
27
+ };
28
+ export type NotificationConfigurationOut = {
29
+ notificationConfiguration: NotificationConfiguration;
30
+ };
31
+ export type NotificationsTypeOut = {
32
+ notificationTypes: NotificationType[];
33
+ total: number;
34
+ };
@@ -28,6 +28,7 @@ export type Environment = {
28
28
  apiExternalOperationsUrl?: string;
29
29
  apiInventoriesUrl?: string;
30
30
  apiInvoicesUrl?: string;
31
+ apiNotificationsUrl?: string;
31
32
  apiOpenItemsUrl?: string;
32
33
  apiReportsUrl?: string;
33
34
  apiSecurityUrl?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@experteam-mx/ngx-services",
3
- "version": "18.7.10",
3
+ "version": "18.7.11",
4
4
  "description": "Angular common services for Experteam apps",
5
5
  "author": "Experteam Cía. Ltda.",
6
6
  "keywords": [
package/public-api.d.ts CHANGED
@@ -12,6 +12,7 @@ export * from './lib/apis/api-e-tools-auto-billing.service';
12
12
  export * from './lib/apis/api-external-pickups.service';
13
13
  export * from './lib/apis/api-inventories.service';
14
14
  export * from './lib/apis/api-invoices.service';
15
+ export * from './lib/apis/api-notifications.service';
15
16
  export * from './lib/apis/api-open-items.service';
16
17
  export * from './lib/apis/api-reports.service';
17
18
  export * from './lib/apis/api-security.service';
@@ -37,6 +38,8 @@ export * from './lib/apis/models/api-inventories.interfaces';
37
38
  export * from './lib/apis/models/api-inventories.types';
38
39
  export * from './lib/apis/models/api-invoices.interfaces';
39
40
  export * from './lib/apis/models/api-invoices.types';
41
+ export * from './lib/apis/models/api-notifications.interfaces';
42
+ export * from './lib/apis/models/api-notifications.types';
40
43
  export * from './lib/apis/models/api-open-items.interfaces';
41
44
  export * from './lib/apis/models/api-open-items.types';
42
45
  export * from './lib/apis/models/api-reports.interfaces';