@silexpert/core 1.1.110 → 1.1.113

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/Authenticate.d.ts +2 -1
  2. package/es/api/resources/Authenticate.d.ts.map +1 -1
  3. package/es/api/resources/Authenticate.js +5 -0
  4. package/es/api/resources/Authenticate.js.map +1 -1
  5. package/es/api/resources/Society.d.ts +2 -2
  6. package/es/api/resources/Society.d.ts.map +1 -1
  7. package/es/api/resources/Society.js.map +1 -1
  8. package/es/types/Enum/Role.d.ts +1 -0
  9. package/es/types/Enum/Role.d.ts.map +1 -1
  10. package/es/types/Enum/Role.js +11 -0
  11. package/es/types/Enum/Role.js.map +1 -1
  12. package/es/types/Interface/api/accountingEntry/AnnotateAccountingTransaction.d.ts +1 -1
  13. package/es/types/Interface/api/accountingEntry/AnnotateAccountingTransaction.d.ts.map +1 -1
  14. package/es/types/Interface/api/accountingEntry/AnnotateAccountingTransaction.js.map +1 -1
  15. package/es/types/Interface/api/authentification/ReadAuthenticateCollaborater.d.ts +5 -0
  16. package/es/types/Interface/api/authentification/ReadAuthenticateCollaborater.d.ts.map +1 -1
  17. package/es/types/Interface/api/authentification/ReadAuthenticateCollaborater.js +2 -0
  18. package/es/types/Interface/api/authentification/ReadAuthenticateCollaborater.js.map +1 -1
  19. package/es/types/Interface/api/balanceSheet/Read.d.ts +4 -2
  20. package/es/types/Interface/api/balanceSheet/Read.d.ts.map +1 -1
  21. package/es/types/Interface/api/balanceSheet/Read.js.map +1 -1
  22. package/es/types/Interface/api/budgetInsight/Query.d.ts +1 -0
  23. package/es/types/Interface/api/budgetInsight/Query.d.ts.map +1 -1
  24. package/es/types/Interface/api/budgetInsight/Query.js.map +1 -1
  25. package/es/utils/vat/3310/century23.js +2 -2
  26. package/es/utils/vat/3310/century23.js.map +1 -1
  27. package/js/api/resources/Authenticate.js +5 -0
  28. package/js/api/resources/Authenticate.js.map +1 -1
  29. package/js/api/resources/Society.js.map +1 -1
  30. package/js/types/Enum/Role.js +1 -0
  31. package/js/types/Enum/Role.js.map +1 -1
  32. package/js/types/Interface/api/accountingEntry/AnnotateAccountingTransaction.js.map +1 -1
  33. package/js/types/Interface/api/authentification/ReadAuthenticateCollaborater.js +2 -0
  34. package/js/types/Interface/api/authentification/ReadAuthenticateCollaborater.js.map +1 -1
  35. package/js/types/Interface/api/balanceSheet/Read.js.map +1 -1
  36. package/js/types/Interface/api/budgetInsight/Query.js.map +1 -1
  37. package/js/utils/vat/3310/century23.js +2 -2
  38. package/js/utils/vat/3310/century23.js.map +1 -1
  39. package/package.json +1 -1
  40. package/ts/api/resources/Authenticate.ts +5 -1
  41. package/ts/api/resources/Society.ts +2 -1
  42. package/ts/types/Enum/Role.ts +13 -1
  43. package/ts/types/Interface/api/accountingEntry/AnnotateAccountingTransaction.ts +1 -1
  44. package/ts/types/Interface/api/authentification/ReadAuthenticateCollaborater.ts +7 -0
  45. package/ts/types/Interface/api/balanceSheet/Read.ts +1 -2
  46. package/ts/types/Interface/api/budgetInsight/Query.ts +1 -0
  47. package/ts/utils/vat/3310/century23.ts +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@silexpert/core",
3
- "version": "1.1.110",
3
+ "version": "1.1.113",
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,8 +1,12 @@
1
- import { FormAuthenticate } from '../../types';
1
+ import { FormAuthenticate, ReadConnectAs } from '../../types';
2
2
  import { Resource } from '../Resource';
3
3
 
4
4
  export class Authenticate extends Resource {
5
5
  async authentificateCollaborater(payload: FormAuthenticate) {
6
6
  return this.axios.$post('/authenticate/collaborater', payload);
7
7
  }
8
+
9
+ async connectAs(idSociety: number): Promise<ReadConnectAs> {
10
+ return this.axios.$post(`/authenticate/societies/${idSociety}`);
11
+ }
8
12
  }
@@ -20,6 +20,7 @@ import {
20
20
  UpdateSocietyPayload,
21
21
  QueryPaginatedSociety,
22
22
  ReadInvalidFieldState,
23
+ BasePaginate,
23
24
  } from '../../types';
24
25
 
25
26
  export class Society extends Resource {
@@ -27,7 +28,7 @@ export class Society extends Resource {
27
28
  return this.axios.$get('/society', { params });
28
29
  }
29
30
 
30
- public getPaginated(params: QueryPaginatedSociety, cancelToken?: CancelToken): Promise<ISociety[]> {
31
+ public getPaginated(params: QueryPaginatedSociety, cancelToken?: CancelToken): Promise<BasePaginate<ISociety>> {
31
32
  return this.axios.$get('/society/paginated', {
32
33
  ...(cancelToken ? { cancelToken } : {}),
33
34
  params,
@@ -41,4 +41,16 @@ export enum Role {
41
41
  DIRECTOR = 46,
42
42
  REFERENT_LITIGE = 47,
43
43
  REFERENT_CLIENT = 48,
44
- }
44
+ }
45
+
46
+ export const RoleAllowedToLogInAsClient = [
47
+ Role.ADMIN,
48
+ Role.ACCOUNTANT,
49
+ Role.SUPER_ADMIN,
50
+ Role.COMMERCIAL,
51
+ Role.CUSTOMER_SUCCESS,
52
+ Role.SOCIAL,
53
+ Role.JURIDIC,
54
+ Role.DEVELOPER,
55
+ Role.PARTNERED_ACCOUNTANT,
56
+ ];
@@ -7,7 +7,7 @@ import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
7
7
  export type FormImmobilization = IImmobilization;
8
8
 
9
9
  export class FormEntry {
10
- vat? : number | {
10
+ vat? : number | null | {
11
11
  idVat: number;
12
12
  amount: number;
13
13
  }[];
@@ -1,3 +1,10 @@
1
+ import { IUser } from '../../models/IUser';
2
+
1
3
  export class ReadAuthenticateCollaborater {
2
4
  token: string;
5
+ }
6
+
7
+ export class ReadConnectAs {
8
+ token: string;
9
+ user: IUser;
3
10
  }
@@ -1,6 +1,5 @@
1
1
  export type ReadBalanceSheetYearStatistic = {
2
- done: number;
3
- todo: number;
2
+ doneIsBack: number; doneNoBack: number; todoIsBack: number; todoNoBack: number;
4
3
  };
5
4
 
6
5
  export type ReadBalanceSheetStatistic = {
@@ -213,4 +213,5 @@ export type BudgetInsightGetAllTransactions = {
213
213
  max_value?: number, // Maximum (inclusive) value.
214
214
  search?: string, // Search in wording, dates, values, categories.
215
215
  value?: number, // Decimal or Value of the transaction. "XX|-XX" and "±XX" syntaxes are also accepted.
216
+ limit: number // devient obligatoire depuis le 1er octobre 2023. Max 1000 et si 100 si expand
216
217
  };
@@ -28,8 +28,8 @@ export function getCerfa3310Century23Payload(accountingEntries: IAccountingEntry
28
28
  const oldEntries = flatten(updatedEntries?.map((u) => u.old));
29
29
  const newEntries = flatten(updatedEntries?.map((u) => u.new));
30
30
 
31
- const collectedOldAmount = getAmountByAccountNumber(oldEntries, ['4457'], 0);
32
- const collectedNewAmount = getAmountByAccountNumber(newEntries, ['4457'], 0);
31
+ const collectedOldAmount = getAmountByAccountNumber(oldEntries, ['4457'], 0, true);
32
+ const collectedNewAmount = getAmountByAccountNumber(newEntries, ['4457'], 0, true);
33
33
 
34
34
  const deductedOldAmount = getAmountByAccountNumber(oldEntries, ['4456'], 0);
35
35
  const deductedNewAmount = getAmountByAccountNumber(newEntries, ['4456'], 0);