electric-coop-api 0.1.77 → 0.1.78

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.
Files changed (106) hide show
  1. package/.openapi-generator/FILES +3 -13
  2. package/README.md +2 -2
  3. package/dist/apis/AdminNotificationsApi.d.ts +99 -5
  4. package/dist/apis/AdminNotificationsApi.js +149 -2
  5. package/dist/apis/index.d.ts +0 -2
  6. package/dist/apis/index.js +0 -2
  7. package/dist/esm/apis/AdminNotificationsApi.d.ts +99 -5
  8. package/dist/esm/apis/AdminNotificationsApi.js +150 -3
  9. package/dist/esm/apis/index.d.ts +0 -2
  10. package/dist/esm/apis/index.js +0 -2
  11. package/dist/esm/models/AdminNotificationMarkedAsRead.d.ts +45 -0
  12. package/dist/esm/models/{RatesSuccessResponse.js → AdminNotificationMarkedAsRead.js} +11 -11
  13. package/dist/esm/models/AdminNotificationUnreadCount.d.ts +45 -0
  14. package/dist/esm/models/{RateAdjustmentsSuccessResponse.js → AdminNotificationUnreadCount.js} +11 -11
  15. package/dist/esm/models/AuditLogEntityTypeEnum.d.ts +1 -0
  16. package/dist/esm/models/AuditLogEntityTypeEnum.js +1 -0
  17. package/dist/esm/models/NotificationTypeEnum.d.ts +5 -0
  18. package/dist/esm/models/NotificationTypeEnum.js +6 -1
  19. package/dist/esm/models/PaginatedAdminNotifications.d.ts +52 -0
  20. package/dist/esm/models/PaginatedAdminNotifications.js +55 -0
  21. package/dist/esm/models/index.d.ts +3 -11
  22. package/dist/esm/models/index.js +3 -11
  23. package/dist/models/AdminNotificationMarkedAsRead.d.ts +45 -0
  24. package/dist/models/AdminNotificationMarkedAsRead.js +57 -0
  25. package/dist/models/AdminNotificationUnreadCount.d.ts +45 -0
  26. package/dist/models/AdminNotificationUnreadCount.js +57 -0
  27. package/dist/models/AuditLogEntityTypeEnum.d.ts +1 -0
  28. package/dist/models/AuditLogEntityTypeEnum.js +1 -0
  29. package/dist/models/NotificationTypeEnum.d.ts +5 -0
  30. package/dist/models/NotificationTypeEnum.js +6 -1
  31. package/dist/models/PaginatedAdminNotifications.d.ts +52 -0
  32. package/dist/models/PaginatedAdminNotifications.js +62 -0
  33. package/dist/models/index.d.ts +3 -11
  34. package/dist/models/index.js +3 -11
  35. package/package.json +1 -1
  36. package/src/apis/AdminNotificationsApi.ts +256 -4
  37. package/src/apis/index.ts +0 -2
  38. package/src/models/AdminNotificationMarkedAsRead.ts +91 -0
  39. package/src/models/AdminNotificationUnreadCount.ts +91 -0
  40. package/src/models/AuditLogEntityTypeEnum.ts +1 -0
  41. package/src/models/NotificationTypeEnum.ts +6 -1
  42. package/src/models/PaginatedAdminNotifications.ts +107 -0
  43. package/src/models/index.ts +3 -11
  44. package/dist/apis/RateAdjustmentsApi.d.ts +0 -150
  45. package/dist/apis/RateAdjustmentsApi.js +0 -227
  46. package/dist/apis/RatesApi.d.ts +0 -94
  47. package/dist/apis/RatesApi.js +0 -140
  48. package/dist/esm/apis/RateAdjustmentsApi.d.ts +0 -150
  49. package/dist/esm/apis/RateAdjustmentsApi.js +0 -223
  50. package/dist/esm/apis/RatesApi.d.ts +0 -94
  51. package/dist/esm/apis/RatesApi.js +0 -136
  52. package/dist/esm/models/ApproveRateAdjustmentDto.d.ts +0 -32
  53. package/dist/esm/models/ApproveRateAdjustmentDto.js +0 -41
  54. package/dist/esm/models/CreateRateAdjustmentDto.d.ts +0 -52
  55. package/dist/esm/models/CreateRateAdjustmentDto.js +0 -57
  56. package/dist/esm/models/Rate.d.ts +0 -172
  57. package/dist/esm/models/Rate.js +0 -135
  58. package/dist/esm/models/RateAdjustment.d.ts +0 -143
  59. package/dist/esm/models/RateAdjustment.js +0 -100
  60. package/dist/esm/models/RateAdjustmentChargeDto.d.ts +0 -45
  61. package/dist/esm/models/RateAdjustmentChargeDto.js +0 -52
  62. package/dist/esm/models/RateAdjustmentStatusEnum.d.ts +0 -27
  63. package/dist/esm/models/RateAdjustmentStatusEnum.js +0 -45
  64. package/dist/esm/models/RateAdjustmentsSuccessResponse.d.ts +0 -45
  65. package/dist/esm/models/RateChargeTypeEnum.d.ts +0 -40
  66. package/dist/esm/models/RateChargeTypeEnum.js +0 -58
  67. package/dist/esm/models/RateStatusEnum.d.ts +0 -26
  68. package/dist/esm/models/RateStatusEnum.js +0 -44
  69. package/dist/esm/models/RatesSuccessResponse.d.ts +0 -45
  70. package/dist/esm/models/RejectRateAdjustmentDto.d.ts +0 -32
  71. package/dist/esm/models/RejectRateAdjustmentDto.js +0 -43
  72. package/dist/models/ApproveRateAdjustmentDto.d.ts +0 -32
  73. package/dist/models/ApproveRateAdjustmentDto.js +0 -48
  74. package/dist/models/CreateRateAdjustmentDto.d.ts +0 -52
  75. package/dist/models/CreateRateAdjustmentDto.js +0 -64
  76. package/dist/models/Rate.d.ts +0 -172
  77. package/dist/models/Rate.js +0 -142
  78. package/dist/models/RateAdjustment.d.ts +0 -143
  79. package/dist/models/RateAdjustment.js +0 -107
  80. package/dist/models/RateAdjustmentChargeDto.d.ts +0 -45
  81. package/dist/models/RateAdjustmentChargeDto.js +0 -59
  82. package/dist/models/RateAdjustmentStatusEnum.d.ts +0 -27
  83. package/dist/models/RateAdjustmentStatusEnum.js +0 -53
  84. package/dist/models/RateAdjustmentsSuccessResponse.d.ts +0 -45
  85. package/dist/models/RateAdjustmentsSuccessResponse.js +0 -57
  86. package/dist/models/RateChargeTypeEnum.d.ts +0 -40
  87. package/dist/models/RateChargeTypeEnum.js +0 -66
  88. package/dist/models/RateStatusEnum.d.ts +0 -26
  89. package/dist/models/RateStatusEnum.js +0 -52
  90. package/dist/models/RatesSuccessResponse.d.ts +0 -45
  91. package/dist/models/RatesSuccessResponse.js +0 -57
  92. package/dist/models/RejectRateAdjustmentDto.d.ts +0 -32
  93. package/dist/models/RejectRateAdjustmentDto.js +0 -50
  94. package/src/apis/RateAdjustmentsApi.ts +0 -395
  95. package/src/apis/RatesApi.ts +0 -224
  96. package/src/models/ApproveRateAdjustmentDto.ts +0 -65
  97. package/src/models/CreateRateAdjustmentDto.ts +0 -110
  98. package/src/models/Rate.ts +0 -289
  99. package/src/models/RateAdjustment.ts +0 -243
  100. package/src/models/RateAdjustmentChargeDto.ts +0 -94
  101. package/src/models/RateAdjustmentStatusEnum.ts +0 -55
  102. package/src/models/RateAdjustmentsSuccessResponse.ts +0 -91
  103. package/src/models/RateChargeTypeEnum.ts +0 -68
  104. package/src/models/RateStatusEnum.ts +0 -54
  105. package/src/models/RatesSuccessResponse.ts +0 -91
  106. package/src/models/RejectRateAdjustmentDto.ts +0 -66
@@ -15,23 +15,43 @@
15
15
 
16
16
  import * as runtime from '../runtime';
17
17
  import type {
18
+ AdminNotificationMarkedAsRead,
19
+ AdminNotificationUnreadCount,
18
20
  AdminSendNotificationDto,
19
21
  AdminSendNotificationResponse,
20
22
  ErrorResponseDto,
23
+ PaginatedAdminNotifications,
21
24
  } from '../models/index';
22
25
  import {
26
+ AdminNotificationMarkedAsReadFromJSON,
27
+ AdminNotificationMarkedAsReadToJSON,
28
+ AdminNotificationUnreadCountFromJSON,
29
+ AdminNotificationUnreadCountToJSON,
23
30
  AdminSendNotificationDtoFromJSON,
24
31
  AdminSendNotificationDtoToJSON,
25
32
  AdminSendNotificationResponseFromJSON,
26
33
  AdminSendNotificationResponseToJSON,
27
34
  ErrorResponseDtoFromJSON,
28
35
  ErrorResponseDtoToJSON,
36
+ PaginatedAdminNotificationsFromJSON,
37
+ PaginatedAdminNotificationsToJSON,
29
38
  } from '../models/index';
30
39
 
31
40
  export interface AdminSendNotificationRequest {
32
41
  adminSendNotificationDto: AdminSendNotificationDto;
33
42
  }
34
43
 
44
+ export interface GetAdminNotificationsRequest {
45
+ page?: number;
46
+ limit?: number;
47
+ search?: string;
48
+ unreadOnly?: boolean;
49
+ }
50
+
51
+ export interface MarkAdminNotificationReadRequest {
52
+ id: string;
53
+ }
54
+
35
55
  /**
36
56
  * AdminNotificationsApi - interface
37
57
  *
@@ -41,7 +61,7 @@ export interface AdminSendNotificationRequest {
41
61
  export interface AdminNotificationsApiInterface {
42
62
  /**
43
63
  *
44
- * @summary Send/broadcast a notification (admin)
64
+ * @summary Broadcast a notification to admins, consumers or a specific user
45
65
  * @param {AdminSendNotificationDto} adminSendNotificationDto
46
66
  * @param {*} [options] Override http request option.
47
67
  * @throws {RequiredError}
@@ -50,10 +70,71 @@ export interface AdminNotificationsApiInterface {
50
70
  adminSendNotificationRaw(requestParameters: AdminSendNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdminSendNotificationResponse>>;
51
71
 
52
72
  /**
53
- * Send/broadcast a notification (admin)
73
+ * Broadcast a notification to admins, consumers or a specific user
54
74
  */
55
75
  adminSendNotification(requestParameters: AdminSendNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdminSendNotificationResponse>;
56
76
 
77
+ /**
78
+ *
79
+ * @summary List admin notifications (paginated)
80
+ * @param {number} [page]
81
+ * @param {number} [limit]
82
+ * @param {string} [search]
83
+ * @param {boolean} [unreadOnly]
84
+ * @param {*} [options] Override http request option.
85
+ * @throws {RequiredError}
86
+ * @memberof AdminNotificationsApiInterface
87
+ */
88
+ getAdminNotificationsRaw(requestParameters: GetAdminNotificationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedAdminNotifications>>;
89
+
90
+ /**
91
+ * List admin notifications (paginated)
92
+ */
93
+ getAdminNotifications(requestParameters: GetAdminNotificationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedAdminNotifications>;
94
+
95
+ /**
96
+ *
97
+ * @summary Get unread admin notification count
98
+ * @param {*} [options] Override http request option.
99
+ * @throws {RequiredError}
100
+ * @memberof AdminNotificationsApiInterface
101
+ */
102
+ getAdminUnreadNotificationCountRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdminNotificationUnreadCount>>;
103
+
104
+ /**
105
+ * Get unread admin notification count
106
+ */
107
+ getAdminUnreadNotificationCount(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdminNotificationUnreadCount>;
108
+
109
+ /**
110
+ *
111
+ * @summary Mark admin notification as read
112
+ * @param {string} id
113
+ * @param {*} [options] Override http request option.
114
+ * @throws {RequiredError}
115
+ * @memberof AdminNotificationsApiInterface
116
+ */
117
+ markAdminNotificationReadRaw(requestParameters: MarkAdminNotificationReadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdminNotificationMarkedAsRead>>;
118
+
119
+ /**
120
+ * Mark admin notification as read
121
+ */
122
+ markAdminNotificationRead(requestParameters: MarkAdminNotificationReadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdminNotificationMarkedAsRead>;
123
+
124
+ /**
125
+ *
126
+ * @summary Mark all admin notifications as read
127
+ * @param {*} [options] Override http request option.
128
+ * @throws {RequiredError}
129
+ * @memberof AdminNotificationsApiInterface
130
+ */
131
+ markAllAdminNotificationsReadRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
132
+
133
+ /**
134
+ * Mark all admin notifications as read
135
+ */
136
+ markAllAdminNotificationsRead(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
137
+
57
138
  }
58
139
 
59
140
  /**
@@ -62,7 +143,7 @@ export interface AdminNotificationsApiInterface {
62
143
  export class AdminNotificationsApi extends runtime.BaseAPI implements AdminNotificationsApiInterface {
63
144
 
64
145
  /**
65
- * Send/broadcast a notification (admin)
146
+ * Broadcast a notification to admins, consumers or a specific user
66
147
  */
67
148
  async adminSendNotificationRaw(requestParameters: AdminSendNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdminSendNotificationResponse>> {
68
149
  if (requestParameters['adminSendNotificationDto'] == null) {
@@ -101,11 +182,182 @@ export class AdminNotificationsApi extends runtime.BaseAPI implements AdminNotif
101
182
  }
102
183
 
103
184
  /**
104
- * Send/broadcast a notification (admin)
185
+ * Broadcast a notification to admins, consumers or a specific user
105
186
  */
106
187
  async adminSendNotification(requestParameters: AdminSendNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdminSendNotificationResponse> {
107
188
  const response = await this.adminSendNotificationRaw(requestParameters, initOverrides);
108
189
  return await response.value();
109
190
  }
110
191
 
192
+ /**
193
+ * List admin notifications (paginated)
194
+ */
195
+ async getAdminNotificationsRaw(requestParameters: GetAdminNotificationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedAdminNotifications>> {
196
+ const queryParameters: any = {};
197
+
198
+ if (requestParameters['page'] != null) {
199
+ queryParameters['page'] = requestParameters['page'];
200
+ }
201
+
202
+ if (requestParameters['limit'] != null) {
203
+ queryParameters['limit'] = requestParameters['limit'];
204
+ }
205
+
206
+ if (requestParameters['search'] != null) {
207
+ queryParameters['search'] = requestParameters['search'];
208
+ }
209
+
210
+ if (requestParameters['unreadOnly'] != null) {
211
+ queryParameters['unreadOnly'] = requestParameters['unreadOnly'];
212
+ }
213
+
214
+ const headerParameters: runtime.HTTPHeaders = {};
215
+
216
+ if (this.configuration && this.configuration.accessToken) {
217
+ const token = this.configuration.accessToken;
218
+ const tokenString = await token("bearer", []);
219
+
220
+ if (tokenString) {
221
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
222
+ }
223
+ }
224
+
225
+ let urlPath = `/api/v1/admin/notifications`;
226
+
227
+ const response = await this.request({
228
+ path: urlPath,
229
+ method: 'GET',
230
+ headers: headerParameters,
231
+ query: queryParameters,
232
+ }, initOverrides);
233
+
234
+ return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedAdminNotificationsFromJSON(jsonValue));
235
+ }
236
+
237
+ /**
238
+ * List admin notifications (paginated)
239
+ */
240
+ async getAdminNotifications(requestParameters: GetAdminNotificationsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedAdminNotifications> {
241
+ const response = await this.getAdminNotificationsRaw(requestParameters, initOverrides);
242
+ return await response.value();
243
+ }
244
+
245
+ /**
246
+ * Get unread admin notification count
247
+ */
248
+ async getAdminUnreadNotificationCountRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdminNotificationUnreadCount>> {
249
+ const queryParameters: any = {};
250
+
251
+ const headerParameters: runtime.HTTPHeaders = {};
252
+
253
+ if (this.configuration && this.configuration.accessToken) {
254
+ const token = this.configuration.accessToken;
255
+ const tokenString = await token("bearer", []);
256
+
257
+ if (tokenString) {
258
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
259
+ }
260
+ }
261
+
262
+ let urlPath = `/api/v1/admin/notifications/unread-count`;
263
+
264
+ const response = await this.request({
265
+ path: urlPath,
266
+ method: 'GET',
267
+ headers: headerParameters,
268
+ query: queryParameters,
269
+ }, initOverrides);
270
+
271
+ return new runtime.JSONApiResponse(response, (jsonValue) => AdminNotificationUnreadCountFromJSON(jsonValue));
272
+ }
273
+
274
+ /**
275
+ * Get unread admin notification count
276
+ */
277
+ async getAdminUnreadNotificationCount(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdminNotificationUnreadCount> {
278
+ const response = await this.getAdminUnreadNotificationCountRaw(initOverrides);
279
+ return await response.value();
280
+ }
281
+
282
+ /**
283
+ * Mark admin notification as read
284
+ */
285
+ async markAdminNotificationReadRaw(requestParameters: MarkAdminNotificationReadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdminNotificationMarkedAsRead>> {
286
+ if (requestParameters['id'] == null) {
287
+ throw new runtime.RequiredError(
288
+ 'id',
289
+ 'Required parameter "id" was null or undefined when calling markAdminNotificationRead().'
290
+ );
291
+ }
292
+
293
+ const queryParameters: any = {};
294
+
295
+ const headerParameters: runtime.HTTPHeaders = {};
296
+
297
+ if (this.configuration && this.configuration.accessToken) {
298
+ const token = this.configuration.accessToken;
299
+ const tokenString = await token("bearer", []);
300
+
301
+ if (tokenString) {
302
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
303
+ }
304
+ }
305
+
306
+ let urlPath = `/api/v1/admin/notifications/{id}/read`;
307
+ urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
308
+
309
+ const response = await this.request({
310
+ path: urlPath,
311
+ method: 'PATCH',
312
+ headers: headerParameters,
313
+ query: queryParameters,
314
+ }, initOverrides);
315
+
316
+ return new runtime.JSONApiResponse(response, (jsonValue) => AdminNotificationMarkedAsReadFromJSON(jsonValue));
317
+ }
318
+
319
+ /**
320
+ * Mark admin notification as read
321
+ */
322
+ async markAdminNotificationRead(requestParameters: MarkAdminNotificationReadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdminNotificationMarkedAsRead> {
323
+ const response = await this.markAdminNotificationReadRaw(requestParameters, initOverrides);
324
+ return await response.value();
325
+ }
326
+
327
+ /**
328
+ * Mark all admin notifications as read
329
+ */
330
+ async markAllAdminNotificationsReadRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
331
+ const queryParameters: any = {};
332
+
333
+ const headerParameters: runtime.HTTPHeaders = {};
334
+
335
+ if (this.configuration && this.configuration.accessToken) {
336
+ const token = this.configuration.accessToken;
337
+ const tokenString = await token("bearer", []);
338
+
339
+ if (tokenString) {
340
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
341
+ }
342
+ }
343
+
344
+ let urlPath = `/api/v1/admin/notifications/mark-all-read`;
345
+
346
+ const response = await this.request({
347
+ path: urlPath,
348
+ method: 'PATCH',
349
+ headers: headerParameters,
350
+ query: queryParameters,
351
+ }, initOverrides);
352
+
353
+ return new runtime.VoidApiResponse(response);
354
+ }
355
+
356
+ /**
357
+ * Mark all admin notifications as read
358
+ */
359
+ async markAllAdminNotificationsRead(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
360
+ await this.markAllAdminNotificationsReadRaw(initOverrides);
361
+ }
362
+
111
363
  }
package/src/apis/index.ts CHANGED
@@ -21,9 +21,7 @@ export * from './FieldWorkOrdersApi';
21
21
  export * from './ManagementDashboardApi';
22
22
  export * from './MetersApi';
23
23
  export * from './NotificationsApi';
24
- export * from './RateAdjustmentsApi';
25
24
  export * from './RateDisplayApi';
26
- export * from './RatesApi';
27
25
  export * from './ReportsApi';
28
26
  export * from './SettingsApi';
29
27
  export * from './UsersApi';
@@ -0,0 +1,91 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Electric Cooperative Consumer Portal API
5
+ * Multi-tenant SaaS platform for Philippine electric cooperatives
6
+ *
7
+ * The version of the OpenAPI document: 1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { Notification } from './Notification';
17
+ import {
18
+ NotificationFromJSON,
19
+ NotificationFromJSONTyped,
20
+ NotificationToJSON,
21
+ NotificationToJSONTyped,
22
+ } from './Notification';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface AdminNotificationMarkedAsRead
28
+ */
29
+ export interface AdminNotificationMarkedAsRead {
30
+ /**
31
+ *
32
+ * @type {boolean}
33
+ * @memberof AdminNotificationMarkedAsRead
34
+ */
35
+ success: boolean;
36
+ /**
37
+ *
38
+ * @type {string}
39
+ * @memberof AdminNotificationMarkedAsRead
40
+ */
41
+ error?: string;
42
+ /**
43
+ *
44
+ * @type {Notification}
45
+ * @memberof AdminNotificationMarkedAsRead
46
+ */
47
+ data: Notification;
48
+ }
49
+
50
+ /**
51
+ * Check if a given object implements the AdminNotificationMarkedAsRead interface.
52
+ */
53
+ export function instanceOfAdminNotificationMarkedAsRead(value: object): value is AdminNotificationMarkedAsRead {
54
+ if (!('success' in value) || value['success'] === undefined) return false;
55
+ if (!('data' in value) || value['data'] === undefined) return false;
56
+ return true;
57
+ }
58
+
59
+ export function AdminNotificationMarkedAsReadFromJSON(json: any): AdminNotificationMarkedAsRead {
60
+ return AdminNotificationMarkedAsReadFromJSONTyped(json, false);
61
+ }
62
+
63
+ export function AdminNotificationMarkedAsReadFromJSONTyped(json: any, ignoreDiscriminator: boolean): AdminNotificationMarkedAsRead {
64
+ if (json == null) {
65
+ return json;
66
+ }
67
+ return {
68
+
69
+ 'success': json['success'],
70
+ 'error': json['error'] == null ? undefined : json['error'],
71
+ 'data': NotificationFromJSON(json['data']),
72
+ };
73
+ }
74
+
75
+ export function AdminNotificationMarkedAsReadToJSON(json: any): AdminNotificationMarkedAsRead {
76
+ return AdminNotificationMarkedAsReadToJSONTyped(json, false);
77
+ }
78
+
79
+ export function AdminNotificationMarkedAsReadToJSONTyped(value?: AdminNotificationMarkedAsRead | null, ignoreDiscriminator: boolean = false): any {
80
+ if (value == null) {
81
+ return value;
82
+ }
83
+
84
+ return {
85
+
86
+ 'success': value['success'],
87
+ 'error': value['error'],
88
+ 'data': NotificationToJSON(value['data']),
89
+ };
90
+ }
91
+
@@ -0,0 +1,91 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Electric Cooperative Consumer Portal API
5
+ * Multi-tenant SaaS platform for Philippine electric cooperatives
6
+ *
7
+ * The version of the OpenAPI document: 1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { NotificationUnreadCountResponseDto } from './NotificationUnreadCountResponseDto';
17
+ import {
18
+ NotificationUnreadCountResponseDtoFromJSON,
19
+ NotificationUnreadCountResponseDtoFromJSONTyped,
20
+ NotificationUnreadCountResponseDtoToJSON,
21
+ NotificationUnreadCountResponseDtoToJSONTyped,
22
+ } from './NotificationUnreadCountResponseDto';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface AdminNotificationUnreadCount
28
+ */
29
+ export interface AdminNotificationUnreadCount {
30
+ /**
31
+ *
32
+ * @type {boolean}
33
+ * @memberof AdminNotificationUnreadCount
34
+ */
35
+ success: boolean;
36
+ /**
37
+ *
38
+ * @type {string}
39
+ * @memberof AdminNotificationUnreadCount
40
+ */
41
+ error?: string;
42
+ /**
43
+ *
44
+ * @type {NotificationUnreadCountResponseDto}
45
+ * @memberof AdminNotificationUnreadCount
46
+ */
47
+ data: NotificationUnreadCountResponseDto;
48
+ }
49
+
50
+ /**
51
+ * Check if a given object implements the AdminNotificationUnreadCount interface.
52
+ */
53
+ export function instanceOfAdminNotificationUnreadCount(value: object): value is AdminNotificationUnreadCount {
54
+ if (!('success' in value) || value['success'] === undefined) return false;
55
+ if (!('data' in value) || value['data'] === undefined) return false;
56
+ return true;
57
+ }
58
+
59
+ export function AdminNotificationUnreadCountFromJSON(json: any): AdminNotificationUnreadCount {
60
+ return AdminNotificationUnreadCountFromJSONTyped(json, false);
61
+ }
62
+
63
+ export function AdminNotificationUnreadCountFromJSONTyped(json: any, ignoreDiscriminator: boolean): AdminNotificationUnreadCount {
64
+ if (json == null) {
65
+ return json;
66
+ }
67
+ return {
68
+
69
+ 'success': json['success'],
70
+ 'error': json['error'] == null ? undefined : json['error'],
71
+ 'data': NotificationUnreadCountResponseDtoFromJSON(json['data']),
72
+ };
73
+ }
74
+
75
+ export function AdminNotificationUnreadCountToJSON(json: any): AdminNotificationUnreadCount {
76
+ return AdminNotificationUnreadCountToJSONTyped(json, false);
77
+ }
78
+
79
+ export function AdminNotificationUnreadCountToJSONTyped(value?: AdminNotificationUnreadCount | null, ignoreDiscriminator: boolean = false): any {
80
+ if (value == null) {
81
+ return value;
82
+ }
83
+
84
+ return {
85
+
86
+ 'success': value['success'],
87
+ 'error': value['error'],
88
+ 'data': NotificationUnreadCountResponseDtoToJSON(value['data']),
89
+ };
90
+ }
91
+
@@ -26,6 +26,7 @@ export const AuditLogEntityTypeEnum = {
26
26
  Complaint: 'complaint',
27
27
  Consumer: 'consumer',
28
28
  RateAdjustment: 'rate_adjustment',
29
+ RateDisplay: 'rate_display',
29
30
  Bill: 'bill',
30
31
  Settings: 'settings'
31
32
  } as const;
@@ -20,7 +20,12 @@
20
20
  export const NotificationTypeEnum = {
21
21
  Bill: 'bill',
22
22
  Complaint: 'complaint',
23
- System: 'system'
23
+ System: 'system',
24
+ ServiceRequest: 'service_request',
25
+ WorkOrder: 'work_order',
26
+ Outage: 'outage',
27
+ Payment: 'payment',
28
+ MeterReading: 'meter_reading'
24
29
  } as const;
25
30
  export type NotificationTypeEnum = typeof NotificationTypeEnum[keyof typeof NotificationTypeEnum];
26
31
 
@@ -0,0 +1,107 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Electric Cooperative Consumer Portal API
5
+ * Multi-tenant SaaS platform for Philippine electric cooperatives
6
+ *
7
+ * The version of the OpenAPI document: 1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { PaginationMetaDto } from './PaginationMetaDto';
17
+ import {
18
+ PaginationMetaDtoFromJSON,
19
+ PaginationMetaDtoFromJSONTyped,
20
+ PaginationMetaDtoToJSON,
21
+ PaginationMetaDtoToJSONTyped,
22
+ } from './PaginationMetaDto';
23
+ import type { PaginatedResponseDto } from './PaginatedResponseDto';
24
+ import {
25
+ PaginatedResponseDtoFromJSON,
26
+ PaginatedResponseDtoFromJSONTyped,
27
+ PaginatedResponseDtoToJSON,
28
+ PaginatedResponseDtoToJSONTyped,
29
+ } from './PaginatedResponseDto';
30
+
31
+ /**
32
+ *
33
+ * @export
34
+ * @interface PaginatedAdminNotifications
35
+ */
36
+ export interface PaginatedAdminNotifications {
37
+ /**
38
+ *
39
+ * @type {boolean}
40
+ * @memberof PaginatedAdminNotifications
41
+ */
42
+ success: boolean;
43
+ /**
44
+ *
45
+ * @type {string}
46
+ * @memberof PaginatedAdminNotifications
47
+ */
48
+ error?: string;
49
+ /**
50
+ *
51
+ * @type {Array<PaginatedResponseDto>}
52
+ * @memberof PaginatedAdminNotifications
53
+ */
54
+ data: Array<PaginatedResponseDto>;
55
+ /**
56
+ *
57
+ * @type {PaginationMetaDto}
58
+ * @memberof PaginatedAdminNotifications
59
+ */
60
+ meta: PaginationMetaDto;
61
+ }
62
+
63
+ /**
64
+ * Check if a given object implements the PaginatedAdminNotifications interface.
65
+ */
66
+ export function instanceOfPaginatedAdminNotifications(value: object): value is PaginatedAdminNotifications {
67
+ if (!('success' in value) || value['success'] === undefined) return false;
68
+ if (!('data' in value) || value['data'] === undefined) return false;
69
+ if (!('meta' in value) || value['meta'] === undefined) return false;
70
+ return true;
71
+ }
72
+
73
+ export function PaginatedAdminNotificationsFromJSON(json: any): PaginatedAdminNotifications {
74
+ return PaginatedAdminNotificationsFromJSONTyped(json, false);
75
+ }
76
+
77
+ export function PaginatedAdminNotificationsFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedAdminNotifications {
78
+ if (json == null) {
79
+ return json;
80
+ }
81
+ return {
82
+
83
+ 'success': json['success'],
84
+ 'error': json['error'] == null ? undefined : json['error'],
85
+ 'data': ((json['data'] as Array<any>).map(PaginatedResponseDtoFromJSON)),
86
+ 'meta': PaginationMetaDtoFromJSON(json['meta']),
87
+ };
88
+ }
89
+
90
+ export function PaginatedAdminNotificationsToJSON(json: any): PaginatedAdminNotifications {
91
+ return PaginatedAdminNotificationsToJSONTyped(json, false);
92
+ }
93
+
94
+ export function PaginatedAdminNotificationsToJSONTyped(value?: PaginatedAdminNotifications | null, ignoreDiscriminator: boolean = false): any {
95
+ if (value == null) {
96
+ return value;
97
+ }
98
+
99
+ return {
100
+
101
+ 'success': value['success'],
102
+ 'error': value['error'],
103
+ 'data': ((value['data'] as Array<any>).map(PaginatedResponseDtoToJSON)),
104
+ 'meta': PaginationMetaDtoToJSON(value['meta']),
105
+ };
106
+ }
107
+