@silexpert/core 1.0.182 → 1.0.183

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 (72) hide show
  1. package/es/api/resources/Notification.d.ts +3 -0
  2. package/es/api/resources/Notification.d.ts.map +1 -1
  3. package/es/api/resources/Notification.js +7 -1
  4. package/es/api/resources/Notification.js.map +1 -1
  5. package/es/types/Enum/BrandPourcentage.js +4 -4
  6. package/es/types/Enum/BrandPourcentage.js.map +1 -1
  7. package/es/types/Enum/NotificationType.d.ts +14 -2
  8. package/es/types/Enum/NotificationType.d.ts.map +1 -1
  9. package/es/types/Enum/NotificationType.js +35 -5
  10. package/es/types/Enum/NotificationType.js.map +1 -1
  11. package/es/types/Interface/api/appNotification/Update.d.ts +5 -0
  12. package/es/types/Interface/api/appNotification/Update.d.ts.map +1 -0
  13. package/es/types/Interface/api/appNotification/Update.js +25 -0
  14. package/es/types/Interface/api/appNotification/Update.js.map +1 -0
  15. package/es/types/Interface/api/notification/CreateNotification.d.ts +2 -2
  16. package/es/types/Interface/api/notification/CreateNotification.d.ts.map +1 -1
  17. package/es/types/Interface/api/notification/CreateNotification.js +2 -2
  18. package/es/types/Interface/api/notification/CreateNotification.js.map +1 -1
  19. package/es/types/Interface/api/notificationSetting/CreateNotificationSetting.d.ts +2 -2
  20. package/es/types/Interface/api/notificationSetting/CreateNotificationSetting.d.ts.map +1 -1
  21. package/es/types/Interface/api/notificationSetting/CreateNotificationSetting.js +2 -2
  22. package/es/types/Interface/api/notificationSetting/CreateNotificationSetting.js.map +1 -1
  23. package/es/types/Interface/api/notificationSetting/UpdateNotificationSetting.d.ts +2 -2
  24. package/es/types/Interface/api/notificationSetting/UpdateNotificationSetting.d.ts.map +1 -1
  25. package/es/types/Interface/api/notificationSetting/UpdateNotificationSetting.js +2 -2
  26. package/es/types/Interface/api/notificationSetting/UpdateNotificationSetting.js.map +1 -1
  27. package/es/types/Interface/models/IAppNotification.d.ts +19 -0
  28. package/es/types/Interface/models/IAppNotification.d.ts.map +1 -0
  29. package/es/types/Interface/models/IAppNotification.js +2 -0
  30. package/es/types/Interface/models/IAppNotification.js.map +1 -0
  31. package/es/types/Interface/models/IMobileNotificationLog.d.ts +2 -2
  32. package/es/types/Interface/models/IMobileNotificationLog.d.ts.map +1 -1
  33. package/es/types/Interface/models/IMobileNotificationLog.js.map +1 -1
  34. package/es/types/Interface/models/IMobileNotificationSetting.d.ts +2 -2
  35. package/es/types/Interface/models/IMobileNotificationSetting.d.ts.map +1 -1
  36. package/es/types/Interface/models/IMobileNotificationSetting.js.map +1 -1
  37. package/es/types/index.d.ts +2 -0
  38. package/es/types/index.d.ts.map +1 -1
  39. package/es/types/index.js +2 -0
  40. package/es/types/index.js.map +1 -1
  41. package/js/api/resources/Notification.js +7 -1
  42. package/js/api/resources/Notification.js.map +1 -1
  43. package/js/types/Enum/BrandPourcentage.js +4 -4
  44. package/js/types/Enum/BrandPourcentage.js.map +1 -1
  45. package/js/types/Enum/NotificationType.js +35 -5
  46. package/js/types/Enum/NotificationType.js.map +1 -1
  47. package/js/types/Interface/api/appNotification/Update.js +24 -0
  48. package/js/types/Interface/api/appNotification/Update.js.map +1 -0
  49. package/js/types/Interface/api/notification/CreateNotification.js +1 -1
  50. package/js/types/Interface/api/notification/CreateNotification.js.map +1 -1
  51. package/js/types/Interface/api/notificationSetting/CreateNotificationSetting.js +1 -1
  52. package/js/types/Interface/api/notificationSetting/CreateNotificationSetting.js.map +1 -1
  53. package/js/types/Interface/api/notificationSetting/UpdateNotificationSetting.js +1 -1
  54. package/js/types/Interface/api/notificationSetting/UpdateNotificationSetting.js.map +1 -1
  55. package/js/types/Interface/models/IAppNotification.js +6 -0
  56. package/js/types/Interface/models/IAppNotification.js.map +1 -0
  57. package/js/types/Interface/models/IMobileNotificationLog.js.map +1 -1
  58. package/js/types/Interface/models/IMobileNotificationSetting.js.map +1 -1
  59. package/js/types/index.js +20 -0
  60. package/js/types/index.js.map +1 -1
  61. package/package.json +1 -1
  62. package/ts/api/resources/Notification.ts +10 -1
  63. package/ts/types/Enum/BrandPourcentage.ts +4 -4
  64. package/ts/types/Enum/NotificationType.ts +43 -2
  65. package/ts/types/Interface/api/appNotification/Update.ts +13 -0
  66. package/ts/types/Interface/api/notification/CreateNotification.ts +3 -3
  67. package/ts/types/Interface/api/notificationSetting/CreateNotificationSetting.ts +3 -3
  68. package/ts/types/Interface/api/notificationSetting/UpdateNotificationSetting.ts +3 -3
  69. package/ts/types/Interface/models/IAppNotification.ts +21 -0
  70. package/ts/types/Interface/models/IMobileNotificationLog.ts +2 -2
  71. package/ts/types/Interface/models/IMobileNotificationSetting.ts +2 -2
  72. package/ts/types/index.ts +3 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@silexpert/core",
3
- "version": "1.0.182",
3
+ "version": "1.0.183",
4
4
  "description": "Silex Core perform HTTP Request and object binding. Silex core helps developers to retrieve and return formatted object",
5
5
  "homepage": "https://gitlab.compta-clementine.fr/dev/silex-api",
6
6
  "main": "js/index.js",
@@ -1,7 +1,16 @@
1
+ import { IAppNotification, UpdateAppNotificationStatus } from '../../types';
1
2
  import { Resource } from '../Resource';
2
3
 
3
4
  export class Notification extends Resource {
4
5
  createTestNotification(idUser: number): Promise<string> {
5
- return this.axios.$post(`/notifications/${idUser}`);
6
+ return this.axios.$post(`/mobile/notifications/${idUser}`);
7
+ }
8
+
9
+ getAllBySociety(id: number): Promise<IAppNotification[]> {
10
+ return this.axios.$get(`societies/${id}/notifications`);
11
+ }
12
+
13
+ updateStatus(params: UpdateAppNotificationStatus): Promise<number> {
14
+ return this.axios.$put('/notifications/status', params);
6
15
  }
7
16
  }
@@ -3,7 +3,7 @@ export const BrandPourcentage = [
3
3
  idTypeBrand: 1,
4
4
  urlS3: 'https://s3.eu-west-3.amazonaws.com/resources-pourcentage/',
5
5
  logoS3: 'config/pourcentage-logo.png',
6
- name: 'Pourcentage OnLine',
6
+ name: 'Pourcentage Online',
7
7
  colors: {
8
8
  primary: '#1e6f5c',
9
9
  primary50: '#DFF9F1',
@@ -264,7 +264,7 @@ export const BrandPourcentage = [
264
264
  idTypeBrand: 4,
265
265
  urlS3: 'https://s3.eu-west-3.amazonaws.com/resources-pourcentage/',
266
266
  logoS3: 'config/pourcentage-logo.png',
267
- name: 'EPINAL', // Pourcentage EPINAL
267
+ name: 'Epinal', // Pourcentage EPINAL
268
268
  colors: {
269
269
  primary: '#1e6f5c',
270
270
  primary50: '#DFF9F1',
@@ -351,7 +351,7 @@ export const BrandPourcentage = [
351
351
  idTypeBrand: 5,
352
352
  urlS3: 'https://s3.eu-west-3.amazonaws.com/resources-pourcentage/',
353
353
  logoS3: 'config/pourcentage-logo.png',
354
- name: 'NICE', // AMEX
354
+ name: 'Nice', // AMEX
355
355
  colors: {
356
356
  primary: '#1e6f5c',
357
357
  primary50: '#DFF9F1',
@@ -435,7 +435,7 @@ export const BrandPourcentage = [
435
435
  },
436
436
  },
437
437
  {
438
- idTypeBrand: 1,
438
+ idTypeBrand: 6,
439
439
  urlS3: 'https://s3.eu-west-3.amazonaws.com/resources-pourcentage/',
440
440
  logoS3: 'config/pourcentage-logo.png',
441
441
  name: 'Marseille', // Pourcentage Marseille
@@ -1,4 +1,45 @@
1
- export enum NotificationType {
1
+ export enum NotificationTypeEnum {
2
2
  ANNOTATE_COUNT = 1,
3
3
  BANK_ACCOUNT_SYNCHRONISATION = 2,
4
- }
4
+ INVOICE_HAS_BEEN_PAID = 3,
5
+ ESTIMATE_ALMOST_EXPIRED = 4,
6
+ INVOICE_ALMOST_EXPIRED = 5,
7
+ }
8
+
9
+ export type NotificationTypeType = {
10
+ id: number;
11
+ title: string;
12
+ linkTitle: string;
13
+ };
14
+
15
+ export type NotificationTypeTypeEnum = {
16
+ [key: string]: NotificationTypeType
17
+ };
18
+
19
+ export const NotificationType: NotificationTypeTypeEnum = {
20
+ ANNOTATE_COUNT: {
21
+ id: NotificationTypeEnum.ANNOTATE_COUNT,
22
+ title: 'Vous avez des lignes non annotées',
23
+ linkTitle: 'Annoter',
24
+ },
25
+ BANK_ACCOUNT_SYNCHRONISATION: {
26
+ id: NotificationTypeEnum.BANK_ACCOUNT_SYNCHRONISATION,
27
+ title: 'Un de vos comptes bancaires est désynchronisé',
28
+ linkTitle: 'Synchroniser mon compte',
29
+ },
30
+ INVOICE_HAS_BEEN_PAID: {
31
+ id: NotificationTypeEnum.INVOICE_HAS_BEEN_PAID,
32
+ title: 'Vous avez été payé !',
33
+ linkTitle: 'Consulter la facture',
34
+ },
35
+ ESTIMATE_ALMOST_EXPIRED: {
36
+ id: NotificationTypeEnum.ESTIMATE_ALMOST_EXPIRED,
37
+ title: 'Un devis est bientôt expiré',
38
+ linkTitle: 'Consulter le devis',
39
+ },
40
+ INVOICE_ALMOST_EXPIRED: {
41
+ id: NotificationTypeEnum.INVOICE_ALMOST_EXPIRED,
42
+ title: 'Une facture arrive à échéance',
43
+ linkTitle: 'Consulter la facture',
44
+ },
45
+ };
@@ -0,0 +1,13 @@
1
+ import { IsBoolean } from 'class-validator';
2
+ import { ApiPropertyOptional, ApiProperty } from '../../../../utils';
3
+ import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
4
+
5
+ export class UpdateAppNotificationStatus {
6
+ @ApiPropertyOptional()
7
+ idNotifications?: number[] | null;
8
+
9
+ @ApiProperty()
10
+ @IsBoolean()
11
+ @ToBoolean()
12
+ markAsRead: boolean;
13
+ }
@@ -1,12 +1,12 @@
1
1
  import { IsEnum, IsInt } from 'class-validator';
2
2
  import { ApiProperty } from '../../../../utils';
3
- import { NotificationType } from '../../../Enum/NotificationType';
3
+ import { NotificationTypeEnum } from '../../../Enum/NotificationType';
4
4
 
5
5
  export class CreateNotification {
6
6
  @ApiProperty()
7
7
  @IsInt()
8
- @IsEnum(NotificationType)
9
- notificationType: NotificationType;
8
+ @IsEnum(NotificationTypeEnum)
9
+ notificationType: NotificationTypeEnum;
10
10
 
11
11
  @ApiProperty()
12
12
  token: string;
@@ -1,13 +1,13 @@
1
1
  import { IsBoolean, IsEnum, IsInt } from 'class-validator';
2
2
  import { ApiProperty } from '../../../../utils';
3
3
  import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
4
- import { NotificationType } from '../../../Enum/NotificationType';
4
+ import { NotificationTypeEnum } from '../../../Enum/NotificationType';
5
5
 
6
6
  export class CreateNotificationSetting {
7
7
  @ApiProperty()
8
8
  @IsInt()
9
- @IsEnum(NotificationType)
10
- notificationType: NotificationType;
9
+ @IsEnum(NotificationTypeEnum)
10
+ notificationType: NotificationTypeEnum;
11
11
 
12
12
  @ApiProperty()
13
13
  @IsBoolean()
@@ -1,13 +1,13 @@
1
1
  import { IsBoolean, IsEnum, IsInt } from 'class-validator';
2
2
  import { ApiProperty } from '../../../../utils';
3
3
  import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
4
- import { NotificationType } from '../../../Enum/NotificationType';
4
+ import { NotificationTypeEnum } from '../../../Enum/NotificationType';
5
5
 
6
6
  export class UpdateNotificationSetting {
7
7
  @ApiProperty()
8
8
  @IsInt()
9
- @IsEnum(NotificationType)
10
- notificationType: NotificationType;
9
+ @IsEnum(NotificationTypeEnum)
10
+ notificationType: NotificationTypeEnum;
11
11
 
12
12
  @ApiProperty()
13
13
  @IsBoolean()
@@ -0,0 +1,21 @@
1
+ import { NotificationTypeEnum } from '../../Enum/NotificationType';
2
+ import { ISociety } from './ISociety';
3
+ import { IUser } from './IUser';
4
+
5
+ export interface IAppNotification {
6
+ id: number;
7
+ title: string;
8
+ message: string;
9
+ link?: string;
10
+ documentId?: number;
11
+ read: boolean;
12
+ idNotificationtype: NotificationTypeEnum;
13
+ idSociety: number;
14
+ idUser: number;
15
+ createdAt?: Date | null;
16
+ updatedAt?: Date | null;
17
+
18
+ // associations
19
+ society: ISociety;
20
+ user: IUser;
21
+ }
@@ -1,8 +1,8 @@
1
- import { NotificationType } from '../../Enum/NotificationType';
1
+ import { NotificationTypeEnum } from '../../Enum/NotificationType';
2
2
 
3
3
  export interface IMobileNotificationLog {
4
4
  id: number;
5
- idType: NotificationType;
5
+ idType: NotificationTypeEnum;
6
6
  lastSent: Date | null;
7
7
  nextSend: Date | null;
8
8
  success: boolean;
@@ -1,8 +1,8 @@
1
- import { NotificationType } from '../../Enum/NotificationType';
1
+ import { NotificationTypeEnum } from '../../Enum/NotificationType';
2
2
 
3
3
  export interface IMobileNotificationSetting {
4
4
  id: number;
5
- idType: NotificationType;
5
+ idType: NotificationTypeEnum;
6
6
  active: boolean;
7
7
  idUser: number;
8
8
  createdAt?: Date | null;
package/ts/types/index.ts CHANGED
@@ -322,6 +322,7 @@ export * from './Interface/models/IRegistration';
322
322
  export * from './Interface/models/IVatRegimeHistory';
323
323
  export * from './Interface/models/ICustomerAcceptance';
324
324
  export * from './Interface/models/IUnpaidCallHistory';
325
+ export * from './Interface/models/IAppNotification';
325
326
  // Forms
326
327
  export * from './Form/FormAuthenticate';
327
328
  export * from './Form/FormConnector';
@@ -915,4 +916,5 @@ export * from './Interface/api/affectedPatrimony/CreateInKindAffectedPatrimony';
915
916
  export * from './Interface/api/affectedPatrimony/ResultCreateAffectedPatrimony';
916
917
  export * from './Interface/api/affectedPatrimony/ReadAffectedPatrimony';
917
918
  export * from './Interface/api/notificationSetting/CreateNotificationSetting';
918
- export * from './Interface/api/notificationSetting/UpdateNotificationSetting';
919
+ export * from './Interface/api/notificationSetting/UpdateNotificationSetting';
920
+ export * from './Interface/api/appNotification/Update';