@silexpert/core 1.0.190 → 1.0.192

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 (81) hide show
  1. package/es/api/resources/AccountingFiles.d.ts +1 -1
  2. package/es/api/resources/AccountingFiles.d.ts.map +1 -1
  3. package/es/api/resources/AccountingFiles.js +4 -1
  4. package/es/api/resources/AccountingFiles.js.map +1 -1
  5. package/es/api/resources/CashAndExpense.d.ts +8 -0
  6. package/es/api/resources/CashAndExpense.d.ts.map +1 -0
  7. package/es/api/resources/CashAndExpense.js +27 -0
  8. package/es/api/resources/CashAndExpense.js.map +1 -0
  9. package/es/api/resources.d.ts +2 -0
  10. package/es/api/resources.d.ts.map +1 -1
  11. package/es/api/resources.js +2 -0
  12. package/es/api/resources.js.map +1 -1
  13. package/es/types/Enum/Account.d.ts +8 -0
  14. package/es/types/Enum/Account.d.ts.map +1 -1
  15. package/es/types/Enum/Account.js +8 -0
  16. package/es/types/Enum/Account.js.map +1 -1
  17. package/es/types/Enum/CashDeskTransactionType.d.ts +7 -0
  18. package/es/types/Enum/CashDeskTransactionType.d.ts.map +1 -0
  19. package/es/types/Enum/CashDeskTransactionType.js +8 -0
  20. package/es/types/Enum/CashDeskTransactionType.js.map +1 -0
  21. package/es/types/Enum/RoleDetail.js +2 -2
  22. package/es/types/Enum/RoleDetail.js.map +1 -1
  23. package/es/types/Enum/ThirdParty.d.ts +7 -0
  24. package/es/types/Enum/ThirdParty.d.ts.map +1 -0
  25. package/es/types/Enum/ThirdParty.js +7 -0
  26. package/es/types/Enum/ThirdParty.js.map +1 -0
  27. package/es/types/Interface/api/accountingFiles/queryAccountingFiles.d.ts +1 -0
  28. package/es/types/Interface/api/accountingFiles/queryAccountingFiles.d.ts.map +1 -1
  29. package/es/types/Interface/api/accountingFiles/queryAccountingFiles.js +5 -1
  30. package/es/types/Interface/api/accountingFiles/queryAccountingFiles.js.map +1 -1
  31. package/es/types/Interface/api/cashAndExpense/Create.d.ts +27 -0
  32. package/es/types/Interface/api/cashAndExpense/Create.d.ts.map +1 -0
  33. package/es/types/Interface/api/cashAndExpense/Create.js +91 -0
  34. package/es/types/Interface/api/cashAndExpense/Create.js.map +1 -0
  35. package/es/types/Interface/models/IApiError.d.ts +2 -1
  36. package/es/types/Interface/models/IApiError.d.ts.map +1 -1
  37. package/es/types/Interface/models/IApiError.js +2 -0
  38. package/es/types/Interface/models/IApiError.js.map +1 -1
  39. package/es/types/Interface/models/IKilometricAllowanceScale.d.ts +1 -0
  40. package/es/types/Interface/models/IKilometricAllowanceScale.d.ts.map +1 -1
  41. package/es/types/Interface/models/IKilometricAllowanceScale.js.map +1 -1
  42. package/es/types/index.d.ts +3 -0
  43. package/es/types/index.d.ts.map +1 -1
  44. package/es/types/index.js +3 -0
  45. package/es/types/index.js.map +1 -1
  46. package/js/api/resources/AccountingFiles.js +4 -1
  47. package/js/api/resources/AccountingFiles.js.map +1 -1
  48. package/js/api/resources/CashAndExpense.js +37 -0
  49. package/js/api/resources/CashAndExpense.js.map +1 -0
  50. package/js/api/resources.js +3 -1
  51. package/js/api/resources.js.map +1 -1
  52. package/js/types/Enum/Account.js +8 -0
  53. package/js/types/Enum/Account.js.map +1 -1
  54. package/js/types/Enum/CashDeskTransactionType.js +13 -0
  55. package/js/types/Enum/CashDeskTransactionType.js.map +1 -0
  56. package/js/types/Enum/RoleDetail.js +2 -2
  57. package/js/types/Enum/RoleDetail.js.map +1 -1
  58. package/js/types/Enum/ThirdParty.js +12 -0
  59. package/js/types/Enum/ThirdParty.js.map +1 -0
  60. package/js/types/Interface/api/accountingFiles/queryAccountingFiles.js +1 -0
  61. package/js/types/Interface/api/accountingFiles/queryAccountingFiles.js.map +1 -1
  62. package/js/types/Interface/api/cashAndExpense/Create.js +44 -0
  63. package/js/types/Interface/api/cashAndExpense/Create.js.map +1 -0
  64. package/js/types/Interface/models/IApiError.js +2 -0
  65. package/js/types/Interface/models/IApiError.js.map +1 -1
  66. package/js/types/Interface/models/IKilometricAllowanceScale.js.map +1 -1
  67. package/js/types/index.js +30 -0
  68. package/js/types/index.js.map +1 -1
  69. package/package.json +1 -1
  70. package/ts/api/resources/AccountingFiles.ts +5 -2
  71. package/ts/api/resources/CashAndExpense.ts +31 -0
  72. package/ts/api/resources.ts +2 -0
  73. package/ts/types/Enum/Account.ts +8 -0
  74. package/ts/types/Enum/CashDeskTransactionType.ts +6 -0
  75. package/ts/types/Enum/RoleDetail.ts +2 -2
  76. package/ts/types/Enum/ThirdParty.ts +6 -0
  77. package/ts/types/Interface/api/accountingFiles/queryAccountingFiles.ts +4 -1
  78. package/ts/types/Interface/api/cashAndExpense/Create.ts +67 -0
  79. package/ts/types/Interface/models/IApiError.ts +3 -0
  80. package/ts/types/Interface/models/IKilometricAllowanceScale.ts +1 -0
  81. package/ts/types/index.ts +3 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@silexpert/core",
3
- "version": "1.0.190",
3
+ "version": "1.0.192",
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",
@@ -4,19 +4,22 @@ import {
4
4
  } from '../../types';
5
5
 
6
6
  export class AccountingFiles extends Resource {
7
- accountingFile(params: QueryAccountingFiles): Promise<ReadFormattedAccountingTransaction[]> {
7
+ accountingFile(params: QueryAccountingFiles): Promise<ReadFormattedAccountingTransaction[] | IAccountingFile[] > {
8
8
  const sendAccountingFiles = new FormData();
9
9
 
10
10
  sendAccountingFiles.append('idAccountingType', params.idAccountingType.toString());
11
11
  sendAccountingFiles.append('isPayPerso', params.isPayPerso.toString());
12
12
  sendAccountingFiles.append('split', params.split.toString());
13
13
  sendAccountingFiles.append('bypassOcr', params.bypassOcr.toString());
14
+ if (params.emissionDate) {
15
+ sendAccountingFiles.append('emissionDate', params.emissionDate.toString());
16
+ }
14
17
 
15
18
  params.files.forEach((file) => {
16
19
  sendAccountingFiles.append('files', file);
17
20
  });
18
21
 
19
- return this.axios.$post('/society/accountingFiles', params, { headers: { 'Content-Type': 'multipart/form-data' } });
22
+ return this.axios.$post('/society/accountingFiles', sendAccountingFiles, { headers: { 'Content-Type': 'multipart/form-data' } });
20
23
  }
21
24
 
22
25
  delete(id: number): Promise<true> {
@@ -0,0 +1,31 @@
1
+ import { forEach } from 'lodash';
2
+ import {
3
+ CreateCashDesk, CreateCashAndExpenseTransaction, IBankAccount, IAccountingTransaction, CreateKilometricAllowance,
4
+ } from '../../types';
5
+ import { Resource } from '../Resource';
6
+
7
+ export class CashAndExpense extends Resource {
8
+ create(idSociety: number, payload: CreateCashDesk): Promise<IBankAccount> {
9
+ return this.axios.$post(`/societies/${idSociety}/bank-accounts/cash-desk`, payload);
10
+ }
11
+
12
+ createTransaction(payload: CreateCashAndExpenseTransaction): Promise<IAccountingTransaction> {
13
+ const formData = new FormData();
14
+ forEach(payload, (value, key) => {
15
+ if (value) {
16
+ if (key === 'entries') {
17
+ formData.append(key, `${JSON.stringify(value)}`);
18
+ } else {
19
+ formData.append(key, `${value}`);
20
+ }
21
+ }
22
+ });
23
+ // @ts-ignore
24
+ formData.append('file', payload.file);
25
+ return this.axios.$post('/societies/cash-and-expense/transaction', formData, { headers: { 'Content-Type': 'multipart/form-data' } });
26
+ }
27
+
28
+ createKilometricAllowance(idSociety: number, payload: CreateKilometricAllowance): Promise<IAccountingTransaction> {
29
+ return this.axios.$post(`/societies/${idSociety}/kilometric-allowance`, payload);
30
+ }
31
+ }
@@ -124,6 +124,7 @@ import { StatisticCustomerSuccess } from './resources/statistic/CustomerSuccess'
124
124
  import { UnpaidCallHistory } from './resources/UnpaidCallHistory';
125
125
  import { CommercialImport } from './resources/CommercialImport';
126
126
  import { Team } from './resources/Team';
127
+ import { CashAndExpense } from './resources/CashAndExpense';
127
128
 
128
129
  export const resources = {
129
130
  simulation: Simulation,
@@ -252,4 +253,5 @@ export const resources = {
252
253
  unpaidCallHistory: UnpaidCallHistory,
253
254
  commercialImport: CommercialImport,
254
255
  team: Team,
256
+ cashAndExpense: CashAndExpense,
255
257
  };
@@ -95,4 +95,12 @@ export const Account = {
95
95
  id: 214,
96
96
  number: 707100,
97
97
  },
98
+ CASH_WITHDRAWAL: {
99
+ id: 205,
100
+ number: 580000,
101
+ },
102
+ CASH_DEPOSIT: {
103
+ id: 206,
104
+ number: 580000,
105
+ },
98
106
  };
@@ -0,0 +1,6 @@
1
+ export enum CashDeskTransactionType {
2
+ PURCHASE = 1,
3
+ SALE = 2,
4
+ CASH_WITHDRAWAL = 3,
5
+ CASH_DEPOSIT = 4,
6
+ }
@@ -297,13 +297,13 @@ export const RoleDetail = {
297
297
  name: 'Référent litige',
298
298
  colorPrimary: '#FFF',
299
299
  colorSecondary: '#FFF',
300
- subRole: true,
300
+ subRole: false,
301
301
  },
302
302
  REFERENT_CLIENT: {
303
303
  id: 48,
304
304
  name: 'Référent client',
305
305
  colorPrimary: '#FFF',
306
306
  colorSecondary: '#FFF',
307
- subRole: true,
307
+ subRole: false,
308
308
  },
309
309
  };
@@ -0,0 +1,6 @@
1
+ export const ThirdParty = {
2
+ ASSOCIATE_CURRENT_ACCOUNT: {
3
+ id: 1140,
4
+ idAccount: 229,
5
+ },
6
+ };
@@ -1,4 +1,4 @@
1
- import { ApiProperty } from '../../../../utils';
1
+ import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
2
2
  import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
3
3
 
4
4
  export class QueryAccountingFiles {
@@ -19,4 +19,7 @@ export class QueryAccountingFiles {
19
19
 
20
20
  @ApiProperty()
21
21
  files: File[];
22
+
23
+ @ApiPropertyOptional()
24
+ emissionDate?: string;
22
25
  }
@@ -0,0 +1,67 @@
1
+ import { IsBoolean, IsOptional } from 'class-validator';
2
+ import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
3
+ import { CashDeskTransactionType } from '../../../Enum/CashDeskTransactionType';
4
+ import { FormEntry } from '../accountingEntry/AnnotateAccountingTransaction';
5
+ import { TFile } from '../file/TFile';
6
+ import { AccountingJournal } from '../../../Enum/AccountingJournal';
7
+ import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
8
+
9
+ export class CreateCashDesk {
10
+ @ApiProperty()
11
+ dateStart: Date;
12
+
13
+ @ApiProperty()
14
+ amountStart: number;
15
+ }
16
+
17
+ export class CreateCashAndExpenseTransaction {
18
+ @ApiProperty()
19
+ dateValue: string;
20
+
21
+ @ApiProperty()
22
+ idAccountingJournal: AccountingJournal;
23
+
24
+ @ApiProperty()
25
+ entries: FormEntry[];
26
+
27
+ @ApiPropertyOptional()
28
+ @IsOptional()
29
+ idSocietyPartner?: number;
30
+
31
+ @ApiPropertyOptional()
32
+ @IsOptional()
33
+ cashDeskTransactionType?: CashDeskTransactionType;
34
+
35
+ @ApiPropertyOptional()
36
+ @IsOptional()
37
+ @IsBoolean()
38
+ @ToBoolean()
39
+ bypassAmountLimit?: boolean;
40
+
41
+ @ApiPropertyOptional()
42
+ @IsOptional()
43
+ file?: TFile;
44
+ }
45
+
46
+ export class CreateKilometricAllowance {
47
+ @ApiProperty()
48
+ idSocietyVehicle: number;
49
+
50
+ @ApiProperty()
51
+ dateValue: Date;
52
+
53
+ @ApiProperty()
54
+ distance: number;
55
+
56
+ @ApiProperty()
57
+ reason: string;
58
+
59
+ @ApiProperty()
60
+ departureCity: string;
61
+
62
+ @ApiProperty()
63
+ arrivalCity: string;
64
+
65
+ @ApiProperty()
66
+ idSocietyPartner: number;
67
+ }
@@ -184,6 +184,9 @@ export enum Code {
184
184
  CAN_NOT_DELETE_DOCUMENT = 'can_not_delete_document',
185
185
  CAN_NOT_EDIT_INVOICE = 'can_not_edit_invoice',
186
186
  INVALID_INVOICE_TYPE = 'invalid_invoice_type',
187
+
188
+ // Expense Notes
189
+ LIMIT_MONTH_REACHED = 'limit_month_reached',
187
190
  }
188
191
 
189
192
  export interface IApiError {
@@ -4,6 +4,7 @@ export interface IKilometricAllowanceScale {
4
4
  power: number;
5
5
  amount: number;
6
6
  idTypeVehicle: number;
7
+ year: number;
7
8
  createdAt?: Date | null;
8
9
  updatedAt?: Date | null;
9
10
  }
package/ts/types/index.ts CHANGED
@@ -480,6 +480,8 @@ export * from './Enum/ReasonTerminationType';
480
480
  export * from './Enum/RemoteType';
481
481
  export * from './Enum/EntityType';
482
482
  export * from './Enum/Compensation';
483
+ export * from './Enum/CashDeskTransactionType';
484
+ export * from './Enum/ThirdParty';
483
485
 
484
486
  // Interfaces API
485
487
  export * from './Interface/api/partnerTransactionType/ReadPartnerTransactionType';
@@ -903,6 +905,7 @@ export * from './Interface/api/prestations/QueryGetAllPrestations';
903
905
  export * from './Interface/api/commercialImport/Read';
904
906
  export * from './Interface/api/commercialImport/Query';
905
907
  export * from './Interface/api/commercialImport/Create';
908
+ export * from './Interface/api/cashAndExpense/Create';
906
909
 
907
910
  // Enums types
908
911
  export * from './Interface/enum/Util';