@silexpert/core 0.4.254 → 0.4.257

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 (47) hide show
  1. package/es/api/resources/CalendarEvent.d.ts +2 -1
  2. package/es/api/resources/CalendarEvent.d.ts.map +1 -1
  3. package/es/api/resources/CalendarEvent.js +3 -0
  4. package/es/api/resources/CalendarEvent.js.map +1 -1
  5. package/es/types/Enum/BrandPourcentage.js +1 -1
  6. package/es/types/Enum/BrandPourcentage.js.map +1 -1
  7. package/es/types/Enum/Office.d.ts +19 -0
  8. package/es/types/Enum/Office.d.ts.map +1 -0
  9. package/es/types/Enum/Office.js +19 -0
  10. package/es/types/Enum/Office.js.map +1 -0
  11. package/es/types/Interface/api/accountingTransaction/DeleteInvoices.d.ts +2 -2
  12. package/es/types/Interface/api/accountingTransaction/DeleteInvoices.d.ts.map +1 -1
  13. package/es/types/Interface/api/accountingTransaction/DeleteInvoices.js +5 -5
  14. package/es/types/Interface/api/accountingTransaction/DeleteInvoices.js.map +1 -1
  15. package/es/types/Interface/api/calendarEvent/verifyCalendarEvent.d.ts +6 -0
  16. package/es/types/Interface/api/calendarEvent/verifyCalendarEvent.d.ts.map +1 -0
  17. package/es/types/Interface/api/calendarEvent/verifyCalendarEvent.js +2 -0
  18. package/es/types/Interface/api/calendarEvent/verifyCalendarEvent.js.map +1 -0
  19. package/es/types/index.d.ts +2 -0
  20. package/es/types/index.d.ts.map +1 -1
  21. package/es/types/index.js +2 -0
  22. package/es/types/index.js.map +1 -1
  23. package/es/utils/date.d.ts.map +1 -1
  24. package/es/utils/date.js +36 -0
  25. package/es/utils/date.js.map +1 -1
  26. package/js/api/resources/CalendarEvent.js +4 -0
  27. package/js/api/resources/CalendarEvent.js.map +1 -1
  28. package/js/types/Enum/BrandPourcentage.js +1 -1
  29. package/js/types/Enum/BrandPourcentage.js.map +1 -1
  30. package/js/types/Enum/Office.js +24 -0
  31. package/js/types/Enum/Office.js.map +1 -0
  32. package/js/types/Interface/api/accountingTransaction/DeleteInvoices.js +2 -2
  33. package/js/types/Interface/api/accountingTransaction/DeleteInvoices.js.map +1 -1
  34. package/js/types/Interface/api/calendarEvent/verifyCalendarEvent.js +6 -0
  35. package/js/types/Interface/api/calendarEvent/verifyCalendarEvent.js.map +1 -0
  36. package/js/types/index.js +24 -0
  37. package/js/types/index.js.map +1 -1
  38. package/js/utils/date.js +34 -0
  39. package/js/utils/date.js.map +1 -1
  40. package/package.json +1 -1
  41. package/ts/api/resources/CalendarEvent.ts +5 -1
  42. package/ts/types/Enum/BrandPourcentage.ts +1 -1
  43. package/ts/types/Enum/Office.ts +18 -0
  44. package/ts/types/Interface/api/accountingTransaction/DeleteInvoices.ts +5 -5
  45. package/ts/types/Interface/api/calendarEvent/verifyCalendarEvent.ts +6 -0
  46. package/ts/types/index.ts +2 -0
  47. package/ts/utils/date.ts +34 -0
@@ -45,7 +45,7 @@ export const BrandPourcentage = [
45
45
  statut: 'SAS',
46
46
  zipCode: '54 520',
47
47
  },
48
- idPrestationsListAuthorized: [197, 205],
48
+ idPrestationsListAuthorized: [197, 205, 12],
49
49
  logoUrl: 'logo-pourcentage.svg',
50
50
  miniLogoUrl: 'logo-pourcentage-mini.svg',
51
51
  hiddenPages: [],
@@ -0,0 +1,18 @@
1
+ export const Office = {
2
+ LAXOU: {
3
+ id: 1,
4
+ name: 'Laxou',
5
+ },
6
+ PARIS: {
7
+ id: 2,
8
+ name: 'Paris',
9
+ },
10
+ MARSEILLE: {
11
+ id: 3,
12
+ name: 'Marseille',
13
+ },
14
+ EPINAL: {
15
+ id: 4,
16
+ name: 'Epinal',
17
+ },
18
+ };
@@ -1,5 +1,5 @@
1
1
  import {
2
- IsBoolean, IsDate, IsIn, IsNumber, IsOptional,
2
+ IsBoolean, IsDateString, IsIn, IsNumber, IsOptional,
3
3
  } from 'class-validator';
4
4
  import { AccountingJournal } from '../../..';
5
5
  import { ApiProperty, ApiPropertyOptional } from '../../../..';
@@ -7,12 +7,12 @@ import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
7
7
 
8
8
  export class QueryDeleteInvoices {
9
9
  @ApiProperty()
10
- @IsDate()
11
- startDate: Date;
10
+ @IsDateString()
11
+ startDate: string;
12
12
 
13
13
  @ApiProperty()
14
- @IsDate()
15
- endDate: Date;
14
+ @IsDateString()
15
+ endDate: string;
16
16
 
17
17
  @ApiProperty()
18
18
  @IsNumber()
@@ -0,0 +1,6 @@
1
+ import { CreateCalendarEventForUsers } from './createCalendarEventForUsers';
2
+
3
+ export interface VerifyCalendarEvent {
4
+ event: CreateCalendarEventForUsers,
5
+ message: string,
6
+ }
package/ts/types/index.ts CHANGED
@@ -327,6 +327,7 @@ export * from './Enum/Quality';
327
327
  export * from './Enum/AbsenceType';
328
328
  export * from './Enum/Role';
329
329
  export * from './Enum/RoleDetail';
330
+ export * from './Enum/Office';
330
331
  export * from './Enum/PrestationOption';
331
332
  export * from './Enum/TimeCounterType';
332
333
  export * from './Enum/MailAuto';
@@ -729,6 +730,7 @@ export * from './Interface/api/bankAccount/ReadExpiredBankAccount';
729
730
  export * from './Interface/api/sheetMonthSchedule/QuerySheetMonthSchedule';
730
731
  export * from './Interface/api/calendarEvent/createCalendarEvent';
731
732
  export * from './Interface/api/calendarEvent/createCalendarEventForUsers';
733
+ export * from './Interface/api/calendarEvent/verifyCalendarEvent';
732
734
  export * from './Interface/api/calendarEvent/updateCalendarEvent';
733
735
  export * from './Interface/api/calendarEvent/interval';
734
736
  export * from './Interface/api/calendarEvent/queryCalendarEvent';
package/ts/utils/date.ts CHANGED
@@ -26,6 +26,40 @@ export function putIntervalBetweenOtherInterval(customPayload: DateInterval, lis
26
26
  // on check si les horaires de l'event sont dans les horaires du collab sinon on les fait commencer à l'heure à laquelle il s'est connecté
27
27
  res.dateStart = !((dateToCompareStart - dateStart) >= 0 && (dateToCompareStart - dateEnd) <= 0) ? new Date(dateStart) : new Date(dateToCompareStart);
28
28
  res.dateEnd = !((dateToCompareEnd - dateStart) >= 0 && (dateToCompareEnd - dateEnd) <= 0) ? new Date(dateEnd) : new Date(dateToCompareEnd);
29
+ } else if (!hoursOfPeriod?.length) {
30
+ const hoursDiff = [];
31
+ // parcours de la liste des heures de connexions
32
+ for (let i = 0; i < listHours.length; i += 1) {
33
+ // ajout de la différence entre la date de début de notre événement et la date de début de notre période
34
+ hoursDiff.push({
35
+ id: i,
36
+ start: true,
37
+ end: false,
38
+ diff: Math.abs(dateToCompareStart - new Date(`${textDate} ${listHours[i].startTime}`).getTime()),
39
+ });
40
+ // ajout de la différence entre la date de début de notre événement et la date de fin de notre période
41
+ hoursDiff.push({
42
+ id: i,
43
+ start: false,
44
+ end: true,
45
+ diff: Math.abs(dateToCompareStart - new Date(`${textDate} ${listHours[i].endTime}`).getTime()),
46
+ });
47
+ }
48
+ // tri de la liste par différence
49
+ hoursDiff.sort((a, b) => a.diff - b.diff);
50
+ // si proche de la date de début :
51
+ // date de début event = date de début période
52
+ // date de fin event = date de début période + 1 heure
53
+ if (hoursDiff[0].start) {
54
+ res.dateStart = new Date(`${textDate} ${listHours[hoursDiff[0].id].startTime}`);
55
+ res.dateEnd = new Date(new Date(`${textDate} ${listHours[hoursDiff[0].id].startTime}`).getTime() + 3600000);
56
+ // si proche de la date de fin :
57
+ // date de début event = date de fin période - 1 heure
58
+ // date de fin event = date de fin période
59
+ } else if (hoursDiff[0].end) {
60
+ res.dateStart = new Date(new Date(`${textDate} ${listHours[hoursDiff[0].id].endTime}`).getTime() - 3600000);
61
+ res.dateEnd = new Date(`${textDate} ${listHours[hoursDiff[0].id].endTime}`);
62
+ }
29
63
  }
30
64
  }
31
65
  return res;