@silexpert/core 0.4.242 → 0.4.245
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/es/api/resources/ThirdParty.js +1 -1
- package/es/api/resources/ThirdParty.js.map +1 -1
- package/es/types/Enum/TaskResponseType.d.ts +9 -0
- package/es/types/Enum/TaskResponseType.d.ts.map +1 -1
- package/es/types/Enum/TaskResponseType.js +9 -9
- package/es/types/Enum/TaskResponseType.js.map +1 -1
- package/es/types/Interface/api/calendarEvent/interval.d.ts +9 -0
- package/es/types/Interface/api/calendarEvent/interval.d.ts.map +1 -0
- package/es/types/Interface/api/calendarEvent/interval.js +40 -0
- package/es/types/Interface/api/calendarEvent/interval.js.map +1 -0
- package/es/types/Interface/api/thirdParty/UpdateThirdPartyForm.d.ts.map +1 -1
- package/es/types/Interface/api/thirdParty/UpdateThirdPartyForm.js +21 -1
- package/es/types/Interface/api/thirdParty/UpdateThirdPartyForm.js.map +1 -1
- package/es/types/Interface/api/workingSchedule/QueryDailyHour.d.ts +2 -0
- package/es/types/Interface/api/workingSchedule/QueryDailyHour.d.ts.map +1 -1
- package/es/types/Interface/api/workingSchedule/QueryDailyHour.js.map +1 -1
- package/es/types/index.d.ts +1 -0
- package/es/types/index.d.ts.map +1 -1
- package/es/types/index.js +1 -0
- package/es/types/index.js.map +1 -1
- package/es/utils/date.d.ts +2 -2
- package/es/utils/date.d.ts.map +1 -1
- package/es/utils/date.js +3 -3
- package/es/utils/date.js.map +1 -1
- package/es/utils/siretValidation.d.ts +1 -0
- package/es/utils/siretValidation.d.ts.map +1 -1
- package/es/utils/siretValidation.js +5 -0
- package/es/utils/siretValidation.js.map +1 -1
- package/js/api/resources/ThirdParty.js +1 -1
- package/js/api/resources/ThirdParty.js.map +1 -1
- package/js/types/Enum/TaskResponseType.js +9 -9
- package/js/types/Enum/TaskResponseType.js.map +1 -1
- package/js/types/Interface/api/calendarEvent/interval.js +39 -0
- package/js/types/Interface/api/calendarEvent/interval.js.map +1 -0
- package/js/types/Interface/api/thirdParty/UpdateThirdPartyForm.js +20 -20
- package/js/types/Interface/api/thirdParty/UpdateThirdPartyForm.js.map +1 -1
- package/js/types/index.js +12 -0
- package/js/types/index.js.map +1 -1
- package/js/utils/date.js +4 -4
- package/js/utils/date.js.map +1 -1
- package/js/utils/siretValidation.js +7 -0
- package/js/utils/siretValidation.js.map +1 -1
- package/package.json +1 -1
- package/ts/api/resources/ThirdParty.ts +1 -1
- package/ts/types/Enum/TaskResponseType.ts +9 -9
- package/ts/types/Interface/api/calendarEvent/interval.ts +26 -0
- package/ts/types/Interface/api/thirdParty/UpdateThirdPartyForm.ts +21 -1
- package/ts/types/Interface/api/workingSchedule/QueryDailyHour.ts +2 -0
- package/ts/types/index.ts +1 -0
- package/ts/utils/date.ts +7 -5
- package/ts/utils/siretValidation.ts +6 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IsDate, IsOptional } from 'class-validator';
|
|
2
|
+
import { ApiPropertyOptional } from '../../../../utils';
|
|
3
|
+
|
|
4
|
+
export class DateInterval {
|
|
5
|
+
@ApiPropertyOptional()
|
|
6
|
+
@IsOptional()
|
|
7
|
+
@IsDate()
|
|
8
|
+
dateStart?: Date;
|
|
9
|
+
|
|
10
|
+
@ApiPropertyOptional()
|
|
11
|
+
@IsOptional()
|
|
12
|
+
@IsDate()
|
|
13
|
+
dateEnd?: Date;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export class TimeInterval {
|
|
17
|
+
@ApiPropertyOptional()
|
|
18
|
+
@IsOptional()
|
|
19
|
+
@IsDate()
|
|
20
|
+
startTime?: Date;
|
|
21
|
+
|
|
22
|
+
@ApiPropertyOptional()
|
|
23
|
+
@IsOptional()
|
|
24
|
+
@IsDate()
|
|
25
|
+
endTime?: Date;
|
|
26
|
+
}
|
|
@@ -1,66 +1,86 @@
|
|
|
1
|
-
import { IsEnum } from 'class-validator';
|
|
1
|
+
import { IsEnum, IsOptional } from 'class-validator';
|
|
2
2
|
import { ThirdPartyType } from '../../..';
|
|
3
3
|
import { ApiPropertyOptional } from '../../../../utils';
|
|
4
4
|
|
|
5
5
|
export class UpdateThirdPartyForm {
|
|
6
6
|
@ApiPropertyOptional()
|
|
7
|
+
@IsOptional()
|
|
7
8
|
budgeaSouscriptionId?: number | null;
|
|
8
9
|
|
|
9
10
|
@ApiPropertyOptional()
|
|
11
|
+
@IsOptional()
|
|
10
12
|
fullname?: string | null;
|
|
11
13
|
|
|
12
14
|
@ApiPropertyOptional()
|
|
15
|
+
@IsOptional()
|
|
13
16
|
fullnameAccountant?: string | null;
|
|
14
17
|
|
|
15
18
|
@ApiPropertyOptional()
|
|
19
|
+
@IsOptional()
|
|
16
20
|
company?: string;
|
|
17
21
|
|
|
18
22
|
@ApiPropertyOptional()
|
|
23
|
+
@IsOptional()
|
|
19
24
|
address?: string | null;
|
|
20
25
|
|
|
21
26
|
@ApiPropertyOptional()
|
|
27
|
+
@IsOptional()
|
|
22
28
|
zipCode?: string | null;
|
|
23
29
|
|
|
24
30
|
@ApiPropertyOptional()
|
|
31
|
+
@IsOptional()
|
|
25
32
|
city?: string | null;
|
|
26
33
|
|
|
27
34
|
@ApiPropertyOptional()
|
|
35
|
+
@IsOptional()
|
|
28
36
|
phone?: string | null;
|
|
29
37
|
|
|
30
38
|
@ApiPropertyOptional()
|
|
39
|
+
@IsOptional()
|
|
31
40
|
email?: string | null;
|
|
32
41
|
|
|
33
42
|
@ApiPropertyOptional()
|
|
43
|
+
@IsOptional()
|
|
34
44
|
nSiret?: string | null;
|
|
35
45
|
|
|
36
46
|
@ApiPropertyOptional()
|
|
47
|
+
@IsOptional()
|
|
37
48
|
nTva?: string | null;
|
|
38
49
|
|
|
39
50
|
@ApiPropertyOptional()
|
|
51
|
+
@IsOptional()
|
|
40
52
|
soldeInit?: number;
|
|
41
53
|
|
|
42
54
|
@ApiPropertyOptional()
|
|
55
|
+
@IsOptional()
|
|
43
56
|
state?: boolean | null;
|
|
44
57
|
|
|
45
58
|
@ApiPropertyOptional()
|
|
59
|
+
@IsOptional()
|
|
46
60
|
dateImport?: Date | null;
|
|
47
61
|
|
|
48
62
|
@ApiPropertyOptional()
|
|
63
|
+
@IsOptional()
|
|
49
64
|
isGeneric?: boolean;
|
|
50
65
|
|
|
51
66
|
@ApiPropertyOptional()
|
|
67
|
+
@IsOptional()
|
|
52
68
|
juridicalSociety?: number | null;
|
|
53
69
|
|
|
54
70
|
@ApiPropertyOptional()
|
|
71
|
+
@IsOptional()
|
|
55
72
|
idTypePayment?: number | null;
|
|
56
73
|
|
|
57
74
|
@ApiPropertyOptional()
|
|
75
|
+
@IsOptional()
|
|
58
76
|
idAccount?: number | null;
|
|
59
77
|
|
|
60
78
|
@ApiPropertyOptional()
|
|
79
|
+
@IsOptional()
|
|
61
80
|
idCountry?: number | null;
|
|
62
81
|
|
|
63
82
|
@ApiPropertyOptional()
|
|
83
|
+
@IsOptional()
|
|
64
84
|
@IsEnum(ThirdPartyType)
|
|
65
85
|
idThirdPartyType?: ThirdPartyType;
|
|
66
86
|
}
|
package/ts/types/index.ts
CHANGED
|
@@ -725,6 +725,7 @@ export * from './Interface/api/sheetMonthSchedule/QuerySheetMonthSchedule';
|
|
|
725
725
|
export * from './Interface/api/calendarEvent/createCalendarEvent';
|
|
726
726
|
export * from './Interface/api/calendarEvent/createCalendarEventForUsers';
|
|
727
727
|
export * from './Interface/api/calendarEvent/updateCalendarEvent';
|
|
728
|
+
export * from './Interface/api/calendarEvent/interval';
|
|
728
729
|
export * from './Interface/api/calendarEvent/queryCalendarEvent';
|
|
729
730
|
export * from './Interface/api/calendarEvent/getAllCalendarEvent';
|
|
730
731
|
export * from './Interface/api/calendarEvent/readAllCalendarEvent';
|
package/ts/utils/date.ts
CHANGED
|
@@ -3,14 +3,16 @@
|
|
|
3
3
|
* @param dateEnd (format YYYY-MM-DD)
|
|
4
4
|
* @returns object of date (09:00-10:00, 12:00-13:00 et 14:00-17:00)
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
DateInterval, TimeInterval,
|
|
8
|
+
} from '../types';
|
|
7
9
|
|
|
8
|
-
export function
|
|
9
|
-
const res = { ...customPayload };
|
|
10
|
-
if (
|
|
10
|
+
export function putIntervalBetweenOtherInterval(customPayload: DateInterval, listHours:TimeInterval[]):DateInterval {
|
|
11
|
+
const res:DateInterval = { ...customPayload };
|
|
12
|
+
if (listHours.length > 0 && customPayload?.dateStart && customPayload?.dateEnd) {
|
|
11
13
|
const dateToCompareStart = new Date(customPayload.dateStart).getTime();
|
|
12
14
|
const dateToCompareEnd = new Date(customPayload.dateEnd).getTime();
|
|
13
|
-
const realHoursObject =
|
|
15
|
+
const realHoursObject = listHours;
|
|
14
16
|
|
|
15
17
|
// on cherche la bonne specialhour pour comparer les horaires
|
|
16
18
|
const realHoursOfPeriod = realHoursObject.filter((sh) => (sh.endTime && (dateToCompareStart - new Date(sh.endTime).getTime() <= 0)) && (sh.startTime && (dateToCompareEnd - new Date(sh.startTime).getTime() >= 0)));
|
|
@@ -25,4 +25,10 @@ export function validateSiret(siret: string) {
|
|
|
25
25
|
throw new Error('Invalid SIRET');
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function getVatCodeBySiren(siren: string, countryCode = 'FR'): string {
|
|
31
|
+
const validSiren = siren.replace(/\s/g, '');
|
|
32
|
+
// @ts-ignore
|
|
33
|
+
return `${countryCode}${[12 + 3 * (validSiren % 97)] % 97}${validSiren}`;
|
|
28
34
|
}
|