@silexpert/core 1.0.153 → 1.0.155

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 (78) hide show
  1. package/es/api/resources/Rule.d.ts +4 -2
  2. package/es/api/resources/Rule.d.ts.map +1 -1
  3. package/es/api/resources/Rule.js +6 -0
  4. package/es/api/resources/Rule.js.map +1 -1
  5. package/es/api/resources/Shine.js +4 -4
  6. package/es/api/resources/Shine.js.map +1 -1
  7. package/es/types/Enum/PrestationType.d.ts +5 -2626
  8. package/es/types/Enum/PrestationType.d.ts.map +1 -1
  9. package/es/types/Enum/PrestationType.js +1674 -1511
  10. package/es/types/Enum/PrestationType.js.map +1 -1
  11. package/es/types/Interface/api/rule/Create.d.ts +10 -0
  12. package/es/types/Interface/api/rule/Create.d.ts.map +1 -0
  13. package/es/types/Interface/api/rule/Create.js +46 -0
  14. package/es/types/Interface/api/rule/Create.js.map +1 -0
  15. package/es/types/Interface/api/rule/Update.d.ts +4 -0
  16. package/es/types/Interface/api/rule/Update.d.ts.map +1 -0
  17. package/es/types/Interface/api/rule/Update.js +21 -0
  18. package/es/types/Interface/api/rule/Update.js.map +1 -0
  19. package/es/types/Interface/models/IAccountingTransaction.d.ts +1 -0
  20. package/es/types/Interface/models/IAccountingTransaction.d.ts.map +1 -1
  21. package/es/types/Interface/models/IAccountingTransaction.js.map +1 -1
  22. package/es/types/Interface/models/IExercicePrestation.d.ts +2 -1
  23. package/es/types/Interface/models/IExercicePrestation.d.ts.map +1 -1
  24. package/es/types/Interface/models/IExercicePrestation.js.map +1 -1
  25. package/es/types/Interface/models/IPrestation.d.ts +13 -10
  26. package/es/types/Interface/models/IPrestation.d.ts.map +1 -1
  27. package/es/types/Interface/models/IPrestation.js.map +1 -1
  28. package/es/types/Interface/models/IPrestationList.d.ts +3 -2
  29. package/es/types/Interface/models/IPrestationList.d.ts.map +1 -1
  30. package/es/types/Interface/models/IPrestationList.js.map +1 -1
  31. package/es/types/Interface/models/IRule.d.ts +2 -0
  32. package/es/types/Interface/models/IRule.d.ts.map +1 -1
  33. package/es/types/Interface/models/IRule.js.map +1 -1
  34. package/es/types/Interface/models/ITerminationList.d.ts +7 -4
  35. package/es/types/Interface/models/ITerminationList.d.ts.map +1 -1
  36. package/es/types/Interface/models/ITerminationList.js.map +1 -1
  37. package/es/types/index.d.ts +3 -0
  38. package/es/types/index.d.ts.map +1 -1
  39. package/es/types/index.js +3 -0
  40. package/es/types/index.js.map +1 -1
  41. package/es/utils/prestation.d.ts +4 -1
  42. package/es/utils/prestation.d.ts.map +1 -1
  43. package/es/utils/prestation.js +18 -1
  44. package/es/utils/prestation.js.map +1 -1
  45. package/js/api/resources/Rule.js +6 -0
  46. package/js/api/resources/Rule.js.map +1 -1
  47. package/js/api/resources/Shine.js +4 -4
  48. package/js/api/resources/Shine.js.map +1 -1
  49. package/js/types/Enum/PrestationType.js +1837 -1674
  50. package/js/types/Enum/PrestationType.js.map +1 -1
  51. package/js/types/Interface/api/rule/Create.js +29 -0
  52. package/js/types/Interface/api/rule/Create.js.map +1 -0
  53. package/js/types/Interface/api/rule/Update.js +23 -0
  54. package/js/types/Interface/api/rule/Update.js.map +1 -0
  55. package/js/types/Interface/models/IAccountingTransaction.js.map +1 -1
  56. package/js/types/Interface/models/IExercicePrestation.js.map +1 -1
  57. package/js/types/Interface/models/IPrestation.js.map +1 -1
  58. package/js/types/Interface/models/IPrestationList.js.map +1 -1
  59. package/js/types/Interface/models/IRule.js.map +1 -1
  60. package/js/types/Interface/models/ITerminationList.js.map +1 -1
  61. package/js/types/index.js +30 -0
  62. package/js/types/index.js.map +1 -1
  63. package/js/utils/prestation.js +17 -1
  64. package/js/utils/prestation.js.map +1 -1
  65. package/package.json +1 -1
  66. package/ts/api/resources/Rule.ts +12 -2
  67. package/ts/api/resources/Shine.ts +4 -4
  68. package/ts/types/Enum/PrestationType.ts +1681 -1512
  69. package/ts/types/Interface/api/rule/Create.ts +29 -0
  70. package/ts/types/Interface/api/rule/Update.ts +10 -0
  71. package/ts/types/Interface/models/IAccountingTransaction.ts +1 -0
  72. package/ts/types/Interface/models/IExercicePrestation.ts +2 -1
  73. package/ts/types/Interface/models/IPrestation.ts +13 -10
  74. package/ts/types/Interface/models/IPrestationList.ts +3 -2
  75. package/ts/types/Interface/models/IRule.ts +2 -0
  76. package/ts/types/Interface/models/ITerminationList.ts +7 -4
  77. package/ts/types/index.ts +3 -0
  78. package/ts/utils/prestation.ts +23 -1
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.isExpress = exports.isCreation = exports.isOnlyJuridic = exports.isOnlySocial = exports.isOnlyPrevi = exports.isOtherSocialMission = exports.isAdditionalPresta = exports.isOtherJuridicalMissions = exports.isOtherAccountingMissions = undefined;
6
+ exports.calculateScoringOfPrestation = exports.isExpress = exports.isCreation = exports.isOnlyJuridic = exports.isOnlySocial = exports.isOnlyPrevi = exports.isOtherSocialMission = exports.isAdditionalPresta = exports.isOtherJuridicalMissions = exports.isOtherAccountingMissions = undefined;
7
7
  var _PrestationType = require("../types/Enum/PrestationType");
8
8
  const isOtherAccountingMissions = idPrestationList => [_PrestationType.PrestationType.PREVISIONNEL, _PrestationType.PrestationType.BILAN_INTERMEDIAIRE, _PrestationType.PrestationType.AVANCE_OU_ABANDON_COMPTE_COURANT_ASSOCIE, _PrestationType.PrestationType.AUTRE_MISSION_COMPTABLE, _PrestationType.PrestationType.TVS, _PrestationType.PrestationType.ETUDE_FISCALE, _PrestationType.PrestationType.BILAN_PREVISIONNEL].includes(idPrestationList);
9
9
  const isOtherJuridicalMissions = (isJuridique, isCatalog, idPrestationList) => idPrestationList !== _PrestationType.PrestationType.GESTION_JURIDIQUE && isCatalog && isJuridique;
@@ -18,6 +18,21 @@ const isExpress = idPrestationList => {
18
18
  const prestaList = prestationDetailValues.find(pr => pr.id === idPrestationList);
19
19
  return !!prestaList.isBack;
20
20
  };
21
+ const calculateScoringOfPrestation = (idPrestationType, prestations) => {
22
+ // Get the list of prestations that are half price
23
+ const prestationHalfPriceList = Object.values(_PrestationType.PrestationDetail).filter(p => p.isComptable && !p.isCatalog);
24
+ const prestationHalfPriceIds = prestationHalfPriceList.map(t => t.id);
25
+ // Get the number of points for the prestation
26
+ const prestaDetails = Object.values(_PrestationType.PrestationDetail).find(prestaDetail => prestaDetail.id === idPrestationType);
27
+ const numberPoint = (prestaDetails === null || prestaDetails === void 0 ? void 0 : prestaDetails.point) || 0;
28
+ // Find the prestation with the same idPrestationList and they need to be paid and signed
29
+ const samePrestation = prestations.filter(prestation => prestation.idPrestationList === idPrestationType && prestation.paid === true && prestation.signed === true && prestation.terminationsList === null);
30
+ // If there is no prestation with the same idPrestationList, return 100% of points
31
+ if (samePrestation.length === 0) return numberPoint;
32
+ // If the prestation is in the list of half price prestation, return 50% of points
33
+ if (prestationHalfPriceIds.includes(idPrestationType)) return numberPoint * 0.5;
34
+ return 0;
35
+ };
21
36
  exports.isOtherAccountingMissions = isOtherAccountingMissions;
22
37
  exports.isOtherJuridicalMissions = isOtherJuridicalMissions;
23
38
  exports.isAdditionalPresta = isAdditionalPresta;
@@ -27,4 +42,5 @@ exports.isOnlySocial = isOnlySocial;
27
42
  exports.isOnlyJuridic = isOnlyJuridic;
28
43
  exports.isCreation = isCreation;
29
44
  exports.isExpress = isExpress;
45
+ exports.calculateScoringOfPrestation = calculateScoringOfPrestation;
30
46
  //# sourceMappingURL=prestation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"prestation.js","names":["_PrestationType","require","isOtherAccountingMissions","idPrestationList","PrestationType","PREVISIONNEL","BILAN_INTERMEDIAIRE","AVANCE_OU_ABANDON_COMPTE_COURANT_ASSOCIE","AUTRE_MISSION_COMPTABLE","TVS","ETUDE_FISCALE","BILAN_PREVISIONNEL","includes","isOtherJuridicalMissions","isJuridique","isCatalog","GESTION_JURIDIQUE","isOtherSocialMission","AUTRE_MISSION_SOCIALE_HORS_PAIE","isAdditionalPresta","hidden","isOnlyPrevi","filter","idPL","PV_AG","length","isOnlySocial","FRUCTUPAIE","SOCIAL","isOnlyJuridic","isCreation","CREATION_SOCIETE","isExpress","prestationDetailValues","Object","values","PrestationDetail","prestaList","find","pr","id","isBack","exports"],"sources":["../../ts/utils/prestation.ts"],"sourcesContent":["import { PrestationDetail, PrestationType } from '../types/Enum/PrestationType';\n\nconst isOtherAccountingMissions = (idPrestationList: number): boolean => [\n PrestationType.PREVISIONNEL,\n PrestationType.BILAN_INTERMEDIAIRE,\n PrestationType.AVANCE_OU_ABANDON_COMPTE_COURANT_ASSOCIE,\n PrestationType.AUTRE_MISSION_COMPTABLE,\n PrestationType.TVS,\n PrestationType.ETUDE_FISCALE,\n PrestationType.BILAN_PREVISIONNEL].includes(idPrestationList);\n\nconst isOtherJuridicalMissions = (isJuridique:boolean, isCatalog:boolean, idPrestationList: number): boolean => idPrestationList !== PrestationType.GESTION_JURIDIQUE && isCatalog && isJuridique;\n\nconst isOtherSocialMission = (idPrestationList: number): boolean => idPrestationList === PrestationType.AUTRE_MISSION_SOCIALE_HORS_PAIE;\n\nconst isAdditionalPresta = (hidden:boolean, isCatalog:boolean): boolean => !hidden && isCatalog;\n\nconst isOnlyPrevi = (idPrestationList: number[]):boolean => !idPrestationList.filter((idPL:number) => ![PrestationType.PREVISIONNEL, PrestationType.BILAN_PREVISIONNEL, PrestationType.PV_AG].includes(idPL)).length;\n\nconst isOnlySocial = (idPrestationList: number[]):boolean => !idPrestationList.filter((idPL:number) => ![PrestationType.FRUCTUPAIE, PrestationType.SOCIAL].includes(idPL)).length;\n\nconst isOnlyJuridic = (idPrestationList: number[]):boolean => !idPrestationList.filter((idPL:number) => ![PrestationType.GESTION_JURIDIQUE].includes(idPL)).length;\n\nconst isCreation = (idPrestationList: number[]):boolean => idPrestationList.includes(PrestationType.CREATION_SOCIETE);\n\nconst isExpress = (idPrestationList: number):boolean => {\n const prestationDetailValues = Object.values(PrestationDetail) as any;\n const prestaList = prestationDetailValues.find((pr:any) => pr.id === idPrestationList);\n return !!prestaList.isBack;\n};\n\nexport {\n isOtherAccountingMissions, isOtherJuridicalMissions, isAdditionalPresta, isOtherSocialMission, isOnlyPrevi, isOnlySocial, isOnlyJuridic, isCreation, isExpress,\n};"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AAEA,MAAMC,yBAAyB,GAAIC,gBAAwB,IAAc,CACvEC,8BAAc,CAACC,YAAY,EAC3BD,8BAAc,CAACE,mBAAmB,EAClCF,8BAAc,CAACG,wCAAwC,EACvDH,8BAAc,CAACI,uBAAuB,EACtCJ,8BAAc,CAACK,GAAG,EAClBL,8BAAc,CAACM,aAAa,EAC5BN,8BAAc,CAACO,kBAAkB,CAAC,CAACC,QAAQ,CAACT,gBAAgB,CAAC;AAE/D,MAAMU,wBAAwB,GAAGA,CAACC,WAAmB,EAAEC,SAAiB,EAAEZ,gBAAwB,KAAcA,gBAAgB,KAAKC,8BAAc,CAACY,iBAAiB,IAAID,SAAS,IAAID,WAAW;AAEjM,MAAMG,oBAAoB,GAAId,gBAAwB,IAAcA,gBAAgB,KAAKC,8BAAc,CAACc,+BAA+B;AAEvI,MAAMC,kBAAkB,GAAGA,CAACC,MAAc,EAAEL,SAAiB,KAAc,CAACK,MAAM,IAAIL,SAAS;AAE/F,MAAMM,WAAW,GAAIlB,gBAA0B,IAAa,CAACA,gBAAgB,CAACmB,MAAM,CAAEC,IAAW,IAAK,CAAC,CAACnB,8BAAc,CAACC,YAAY,EAAED,8BAAc,CAACO,kBAAkB,EAAEP,8BAAc,CAACoB,KAAK,CAAC,CAACZ,QAAQ,CAACW,IAAI,CAAC,CAAC,CAACE,MAAM;AAEpN,MAAMC,YAAY,GAAIvB,gBAA0B,IAAa,CAACA,gBAAgB,CAACmB,MAAM,CAAEC,IAAW,IAAK,CAAC,CAACnB,8BAAc,CAACuB,UAAU,EAAEvB,8BAAc,CAACwB,MAAM,CAAC,CAAChB,QAAQ,CAACW,IAAI,CAAC,CAAC,CAACE,MAAM;AAEjL,MAAMI,aAAa,GAAI1B,gBAA0B,IAAa,CAACA,gBAAgB,CAACmB,MAAM,CAAEC,IAAW,IAAK,CAAC,CAACnB,8BAAc,CAACY,iBAAiB,CAAC,CAACJ,QAAQ,CAACW,IAAI,CAAC,CAAC,CAACE,MAAM;AAElK,MAAMK,UAAU,GAAI3B,gBAA0B,IAAaA,gBAAgB,CAACS,QAAQ,CAACR,8BAAc,CAAC2B,gBAAgB,CAAC;AAErH,MAAMC,SAAS,GAAI7B,gBAAwB,IAAY;EACrD,MAAM8B,sBAAsB,GAAGC,MAAM,CAACC,MAAM,CAACC,gCAAgB,CAAQ;EACrE,MAAMC,UAAU,GAAGJ,sBAAsB,CAACK,IAAI,CAAEC,EAAM,IAAKA,EAAE,CAACC,EAAE,KAAKrC,gBAAgB,CAAC;EACtF,OAAO,CAAC,CAACkC,UAAU,CAACI,MAAM;AAC5B,CAAC;AAACC,OAAA,CAGAxC,yBAAyB,GAAzBA,yBAAyB;AAAAwC,OAAA,CAAE7B,wBAAwB,GAAxBA,wBAAwB;AAAA6B,OAAA,CAAEvB,kBAAkB,GAAlBA,kBAAkB;AAAAuB,OAAA,CAAEzB,oBAAoB,GAApBA,oBAAoB;AAAAyB,OAAA,CAAErB,WAAW,GAAXA,WAAW;AAAAqB,OAAA,CAAEhB,YAAY,GAAZA,YAAY;AAAAgB,OAAA,CAAEb,aAAa,GAAbA,aAAa;AAAAa,OAAA,CAAEZ,UAAU,GAAVA,UAAU;AAAAY,OAAA,CAAEV,SAAS,GAATA,SAAS"}
1
+ {"version":3,"file":"prestation.js","names":["_PrestationType","require","isOtherAccountingMissions","idPrestationList","PrestationType","PREVISIONNEL","BILAN_INTERMEDIAIRE","AVANCE_OU_ABANDON_COMPTE_COURANT_ASSOCIE","AUTRE_MISSION_COMPTABLE","TVS","ETUDE_FISCALE","BILAN_PREVISIONNEL","includes","isOtherJuridicalMissions","isJuridique","isCatalog","GESTION_JURIDIQUE","isOtherSocialMission","AUTRE_MISSION_SOCIALE_HORS_PAIE","isAdditionalPresta","hidden","isOnlyPrevi","filter","idPL","PV_AG","length","isOnlySocial","FRUCTUPAIE","SOCIAL","isOnlyJuridic","isCreation","CREATION_SOCIETE","isExpress","prestationDetailValues","Object","values","PrestationDetail","prestaList","find","pr","id","isBack","calculateScoringOfPrestation","idPrestationType","prestations","prestationHalfPriceList","p","isComptable","prestationHalfPriceIds","map","t","prestaDetails","prestaDetail","numberPoint","point","samePrestation","prestation","paid","signed","terminationsList","exports"],"sources":["../../ts/utils/prestation.ts"],"sourcesContent":["import { IPrestation } from '../types';\nimport { PrestationDetail, PrestationType } from '../types/Enum/PrestationType';\n\nconst isOtherAccountingMissions = (idPrestationList: number): boolean => [\n PrestationType.PREVISIONNEL,\n PrestationType.BILAN_INTERMEDIAIRE,\n PrestationType.AVANCE_OU_ABANDON_COMPTE_COURANT_ASSOCIE,\n PrestationType.AUTRE_MISSION_COMPTABLE,\n PrestationType.TVS,\n PrestationType.ETUDE_FISCALE,\n PrestationType.BILAN_PREVISIONNEL].includes(idPrestationList);\n\nconst isOtherJuridicalMissions = (isJuridique:boolean, isCatalog:boolean, idPrestationList: number): boolean => idPrestationList !== PrestationType.GESTION_JURIDIQUE && isCatalog && isJuridique;\n\nconst isOtherSocialMission = (idPrestationList: number): boolean => idPrestationList === PrestationType.AUTRE_MISSION_SOCIALE_HORS_PAIE;\n\nconst isAdditionalPresta = (hidden:boolean, isCatalog:boolean): boolean => !hidden && isCatalog;\n\nconst isOnlyPrevi = (idPrestationList: number[]):boolean => !idPrestationList.filter((idPL:number) => ![PrestationType.PREVISIONNEL, PrestationType.BILAN_PREVISIONNEL, PrestationType.PV_AG].includes(idPL)).length;\n\nconst isOnlySocial = (idPrestationList: number[]):boolean => !idPrestationList.filter((idPL:number) => ![PrestationType.FRUCTUPAIE, PrestationType.SOCIAL].includes(idPL)).length;\n\nconst isOnlyJuridic = (idPrestationList: number[]):boolean => !idPrestationList.filter((idPL:number) => ![PrestationType.GESTION_JURIDIQUE].includes(idPL)).length;\n\nconst isCreation = (idPrestationList: number[]):boolean => idPrestationList.includes(PrestationType.CREATION_SOCIETE);\n\nconst isExpress = (idPrestationList: number):boolean => {\n const prestationDetailValues = Object.values(PrestationDetail) as any;\n const prestaList = prestationDetailValues.find((pr:any) => pr.id === idPrestationList);\n return !!prestaList.isBack;\n};\n\nconst calculateScoringOfPrestation = (idPrestationType: PrestationType, prestations: IPrestation[]): number => {\n // Get the list of prestations that are half price\n const prestationHalfPriceList = Object.values(PrestationDetail).filter((p) => p.isComptable && !p.isCatalog);\n const prestationHalfPriceIds = prestationHalfPriceList.map((t) => t.id);\n\n // Get the number of points for the prestation\n const prestaDetails = Object.values(PrestationDetail).find((prestaDetail) => prestaDetail.id === idPrestationType);\n const numberPoint = prestaDetails?.point || 0;\n\n // Find the prestation with the same idPrestationList and they need to be paid and signed\n const samePrestation = prestations.filter((prestation) => (prestation.idPrestationList === idPrestationType) && (prestation.paid === true && prestation.signed === true && prestation.terminationsList === null));\n\n // If there is no prestation with the same idPrestationList, return 100% of points\n if (samePrestation.length === 0) return numberPoint;\n\n // If the prestation is in the list of half price prestation, return 50% of points\n if (prestationHalfPriceIds.includes(idPrestationType)) return numberPoint * 0.5;\n\n return 0;\n};\n\nexport {\n isOtherAccountingMissions, isOtherJuridicalMissions, isAdditionalPresta, isOtherSocialMission, isOnlyPrevi, isOnlySocial, isOnlyJuridic, isCreation, isExpress, calculateScoringOfPrestation,\n};"],"mappings":";;;;;;AACA,IAAAA,eAAA,GAAAC,OAAA;AAEA,MAAMC,yBAAyB,GAAIC,gBAAwB,IAAc,CACvEC,8BAAc,CAACC,YAAY,EAC3BD,8BAAc,CAACE,mBAAmB,EAClCF,8BAAc,CAACG,wCAAwC,EACvDH,8BAAc,CAACI,uBAAuB,EACtCJ,8BAAc,CAACK,GAAG,EAClBL,8BAAc,CAACM,aAAa,EAC5BN,8BAAc,CAACO,kBAAkB,CAAC,CAACC,QAAQ,CAACT,gBA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AyC,OAAA,CAAE3C,oBAAoB,GAApBA,oBAAoB;AAAA2C,OAAA,CAAEvC,WAAW,GAAXA,WAAW;AAAAuC,OAAA,CAAElC,YAAY,GAAZA,YAAY;AAAAkC,OAAA,CAAE/B,aAAa,GAAbA,aAAa;AAAA+B,OAAA,CAAE9B,UAAU,GAAVA,UAAU;AAAA8B,OAAA,CAAE5B,SAAS,GAATA,SAAS;AAAA4B,OAAA,CAAElB,4BAA4B,GAA5BA,4BAA4B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@silexpert/core",
3
- "version": "1.0.153",
3
+ "version": "1.0.155",
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,14 +1,24 @@
1
- import { BasePaginate } from '../../types';
1
+ import {
2
+ BasePaginate, CreateRule, IRule, UpdateRule,
3
+ } from '../../types';
2
4
  import { QueryRule, QueryMostFrequent } from '../../types/Interface/api/rule/Query';
3
5
  import { ReadMostFrequentOccurence } from '../../types/Interface/api/rule/Read';
4
6
  import { Resource } from '../Resource';
5
7
 
6
8
  export class Rule extends Resource {
7
- getAll(params: QueryRule): Promise<BasePaginate<Rule>> {
9
+ getAll(params: QueryRule): Promise<BasePaginate<IRule>> {
8
10
  return this.axios.$get('rules', { params });
9
11
  }
10
12
 
11
13
  getMostFrequent(params: QueryMostFrequent): Promise<ReadMostFrequentOccurence[]> {
12
14
  return this.axios.$get('rules/most-frequent', { params });
13
15
  }
16
+
17
+ create(params: CreateRule): Promise<IRule> {
18
+ return this.axios.$post('rules', params);
19
+ }
20
+
21
+ update(idRule: number, params: UpdateRule): Promise<IRule> {
22
+ return this.axios.$post(`rules/${idRule}`, params);
23
+ }
14
24
  }
@@ -5,15 +5,15 @@ import {
5
5
 
6
6
  export class Shine extends Resource {
7
7
  connect(idSociety: number, params: GetConnect): Promise<ConnectResponse> {
8
- return this.axios.$get(`/shine/${idSociety}/connect`, { params });
8
+ return this.axios.$get(`/connectors/shine/${idSociety}/connect`, { params });
9
9
  }
10
10
  importBankAccount(idSociety: number, params: CreateShineAccount): Promise<IBankAccount> {
11
- return this.axios.$post(`/shine/${idSociety}/importBankAccount`, params);
11
+ return this.axios.$post(`/connectors/shine/${idSociety}/importBankAccount`, params);
12
12
  }
13
13
  importTransactions(params: CreateShineTransactions): Promise<number> {
14
- return this.axios.$post('/shine/importTransactions', params);
14
+ return this.axios.$post('/connectors/shine/importTransactions', params);
15
15
  }
16
16
  refreshConnection(idBankConnection: number): Promise<IBankConnection> {
17
- return this.axios.$put(`/shine/${idBankConnection}/refresh-connection`);
17
+ return this.axios.$put(`/connectors/shine/${idBankConnection}/refresh-connection`);
18
18
  }
19
19
  }