@silexpert/core 1.1.87 → 1.1.88

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.
@@ -1 +1 @@
1
- {"version":3,"file":"bankAccount.d.ts","sourceRoot":"","sources":["../../ts/utils/bankAccount.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAMzD,oBAAY,YAAY;IACtB,YAAY,IAAI;IAChB,cAAc,IAAI;CACnB;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,YAAY,EAAE,iBAAiB,CAAC,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,eAAe,GAAI,YAAY,CAqBzH"}
1
+ {"version":3,"file":"bankAccount.d.ts","sourceRoot":"","sources":["../../ts/utils/bankAccount.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAIzD,oBAAY,YAAY;IACtB,YAAY,IAAI;IAChB,cAAc,IAAI;CACnB;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,YAAY,EAAE,iBAAiB,CAAC,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,eAAe,GAAI,YAAY,CAqBzH"}
@@ -1,7 +1,5 @@
1
1
  import * as dayjs from 'dayjs';
2
2
  import { PartnerTransactionType } from '../types/Enum/PartnerTransactionType';
3
- import * as isSameOrAfter from 'dayjs/plugin/isSameOrAfter';
4
- dayjs.extend(isSameOrAfter);
5
3
  export var StateSynchro;
6
4
  (function (StateSynchro) {
7
5
  StateSynchro[StateSynchro["SYNCHRONIZED"] = 1] = "SYNCHRONIZED";
@@ -23,7 +21,7 @@ export function isSynchro(params, dateOfTermination, bankConnection) {
23
21
  dayjs(params.lastUpdate).format('YYYY-MM-DD') === dayjs().format('YYYY-MM-DD')
24
22
  && (!bankConnection || (bankConnection === null || bankConnection === void 0 ? void 0 : bankConnection.errorCode) === null))
25
23
  return StateSynchro.SYNCHRONIZED;
26
- if (dateOfTermination && dayjs(params.lastUpdate).isSameOrAfter(dateOfTermination))
24
+ if (dateOfTermination && (dayjs(params.lastUpdate).isAfter(dateOfTermination) || dayjs(params.lastUpdate).isSame(dateOfTermination)))
27
25
  return StateSynchro.SYNCHRONIZED;
28
26
  return StateSynchro.DESYNCHRONIZED;
29
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"bankAccount.js","sourceRoot":"","sources":["../../ts/utils/bankAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,KAAK,aAAa,MAAM,4BAA4B,CAAC;AAE5D,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;AAE5B,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,+DAAgB,CAAA;IAChB,mEAAkB,CAAA;AACpB,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB;AAED,MAAM,UAAU,SAAS,CAAC,MAAoB,EAAE,iBAAwB,EAAE,cAAgC;IACxG,4EAA4E;IAC5E,IAAI,MAAM,CAAC,UAAU,KAAK,IAAI;QAAE,OAAO,YAAY,CAAC,YAAY,CAAC;IAEjE,qCAAqC;IACrC,IAAI,MAAM,CAAC,aAAa,KAAK,IAAI;QAAE,OAAO,YAAY,CAAC,YAAY,CAAC;IAEpE,8CAA8C;IAC9C,IAAI,MAAM,CAAC,aAAa,IAAI,CAAC,sBAAsB,CAAC,UAAU,EAAE,sBAAsB,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC;QAAE,OAAO,YAAY,CAAC,YAAY,CAAC;IAE/J,6DAA6D;IAC7D,IAAI,MAAM,CAAC,aAAa,IAAI,MAAM,CAAC,UAAU;QAC3C,CAAC,sBAAsB,CAAC,KAAK,EAAE,sBAAsB,CAAC,KAAK,EAAE,sBAAsB,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC;QACpI,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,KAAK,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC;WAC3E,CAAC,CAAC,cAAc,IAAI,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,SAAS,MAAK,IAAI,CAAC;QACxD,OAAO,YAAY,CAAC,YAAY,CAAC;IAEnC,IAAI,iBAAiB,IAAI,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,aAAa,CAAC,iBAAiB,CAAC;QAAE,OAAO,YAAY,CAAC,YAAY,CAAC;IAGrH,OAAO,YAAY,CAAC,cAAc,CAAC;AACrC,CAAC","sourcesContent":["import * as dayjs from 'dayjs';\nimport { IBankAccount, IBankConnection } from '../types';\nimport { PartnerTransactionType } from '../types/Enum/PartnerTransactionType';\nimport * as isSameOrAfter from 'dayjs/plugin/isSameOrAfter';\n\ndayjs.extend(isSameOrAfter);\n\nexport enum StateSynchro {\n SYNCHRONIZED = 1,\n DESYNCHRONIZED = 2,\n}\n\nexport function isSynchro(params: IBankAccount, dateOfTermination?: Date, bankConnection?: IBankConnection ): StateSynchro {\n // si le compte est désactivé au niveau budget on le considére comme syncrho\n if (params.disabledAt !== null) return StateSynchro.SYNCHRONIZED;\n\n // // si non Défini alors tjs synchro\n if (params.idPartnerType === null) return StateSynchro.SYNCHRONIZED;\n\n // // Si JE DECLARE ou AUTRE alors tjs synchro\n if (params.idPartnerType && [PartnerTransactionType.JE_DECLARE, PartnerTransactionType.OTHER].includes(params.idPartnerType)) return StateSynchro.SYNCHRONIZED;\n\n // // Si budget et lastUpdate = la date du jour alors synchro\n if (params.idPartnerType && params.lastUpdate &&\n [PartnerTransactionType.QONTO, PartnerTransactionType.SHINE, PartnerTransactionType.BUDGET_INSIGHT].includes(params.idPartnerType) && \n dayjs(params.lastUpdate).format('YYYY-MM-DD') === dayjs().format('YYYY-MM-DD')\n && (!bankConnection || bankConnection?.errorCode === null)\n ) return StateSynchro.SYNCHRONIZED;\n \n if (dateOfTermination && dayjs(params.lastUpdate).isSameOrAfter(dateOfTermination)) return StateSynchro.SYNCHRONIZED;\n \n \n return StateSynchro.DESYNCHRONIZED;\n}\n"]}
1
+ {"version":3,"file":"bankAccount.js","sourceRoot":"","sources":["../../ts/utils/bankAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAG9E,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,+DAAgB,CAAA;IAChB,mEAAkB,CAAA;AACpB,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB;AAED,MAAM,UAAU,SAAS,CAAC,MAAoB,EAAE,iBAAwB,EAAE,cAAgC;IACxG,4EAA4E;IAC5E,IAAI,MAAM,CAAC,UAAU,KAAK,IAAI;QAAE,OAAO,YAAY,CAAC,YAAY,CAAC;IAEjE,qCAAqC;IACrC,IAAI,MAAM,CAAC,aAAa,KAAK,IAAI;QAAE,OAAO,YAAY,CAAC,YAAY,CAAC;IAEpE,8CAA8C;IAC9C,IAAI,MAAM,CAAC,aAAa,IAAI,CAAC,sBAAsB,CAAC,UAAU,EAAE,sBAAsB,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC;QAAE,OAAO,YAAY,CAAC,YAAY,CAAC;IAE/J,6DAA6D;IAC7D,IAAI,MAAM,CAAC,aAAa,IAAI,MAAM,CAAC,UAAU;QAC3C,CAAC,sBAAsB,CAAC,KAAK,EAAE,sBAAsB,CAAC,KAAK,EAAE,sBAAsB,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC;QACpI,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,KAAK,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC;WAC3E,CAAC,CAAC,cAAc,IAAI,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,SAAS,MAAK,IAAI,CAAC;QACxD,OAAO,YAAY,CAAC,YAAY,CAAC;IAEnC,IAAI,iBAAiB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;QAAE,OAAO,YAAY,CAAC,YAAY,CAAC;IAGvK,OAAO,YAAY,CAAC,cAAc,CAAC;AACrC,CAAC","sourcesContent":["import * as dayjs from 'dayjs';\nimport { IBankAccount, IBankConnection } from '../types';\nimport { PartnerTransactionType } from '../types/Enum/PartnerTransactionType';\n\n\nexport enum StateSynchro {\n SYNCHRONIZED = 1,\n DESYNCHRONIZED = 2,\n}\n\nexport function isSynchro(params: IBankAccount, dateOfTermination?: Date, bankConnection?: IBankConnection ): StateSynchro {\n // si le compte est désactivé au niveau budget on le considére comme syncrho\n if (params.disabledAt !== null) return StateSynchro.SYNCHRONIZED;\n\n // // si non Défini alors tjs synchro\n if (params.idPartnerType === null) return StateSynchro.SYNCHRONIZED;\n\n // // Si JE DECLARE ou AUTRE alors tjs synchro\n if (params.idPartnerType && [PartnerTransactionType.JE_DECLARE, PartnerTransactionType.OTHER].includes(params.idPartnerType)) return StateSynchro.SYNCHRONIZED;\n\n // // Si budget et lastUpdate = la date du jour alors synchro\n if (params.idPartnerType && params.lastUpdate &&\n [PartnerTransactionType.QONTO, PartnerTransactionType.SHINE, PartnerTransactionType.BUDGET_INSIGHT].includes(params.idPartnerType) && \n dayjs(params.lastUpdate).format('YYYY-MM-DD') === dayjs().format('YYYY-MM-DD')\n && (!bankConnection || bankConnection?.errorCode === null)\n ) return StateSynchro.SYNCHRONIZED;\n \n if (dateOfTermination && (dayjs(params.lastUpdate).isAfter(dateOfTermination) || dayjs(params.lastUpdate).isSame(dateOfTermination))) return StateSynchro.SYNCHRONIZED;\n \n \n return StateSynchro.DESYNCHRONIZED;\n}\n"]}
@@ -8,11 +8,8 @@ exports.isSynchro = isSynchro;
8
8
  var _dayjs = require("dayjs");
9
9
  var dayjs = _interopRequireWildcard(_dayjs);
10
10
  var _PartnerTransactionType = require("../types/Enum/PartnerTransactionType");
11
- var _isSameOrAfter = require("dayjs/plugin/isSameOrAfter");
12
- var isSameOrAfter = _interopRequireWildcard(_isSameOrAfter);
13
11
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
14
12
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
- dayjs.extend(isSameOrAfter);
16
13
  var StateSynchro = exports.StateSynchro = undefined;
17
14
  (function (StateSynchro) {
18
15
  StateSynchro[StateSynchro["SYNCHRONIZED"] = 1] = "SYNCHRONIZED";
@@ -27,7 +24,7 @@ function isSynchro(params, dateOfTermination, bankConnection) {
27
24
  if (params.idPartnerType && [_PartnerTransactionType.PartnerTransactionType.JE_DECLARE, _PartnerTransactionType.PartnerTransactionType.OTHER].includes(params.idPartnerType)) return StateSynchro.SYNCHRONIZED;
28
25
  // // Si budget et lastUpdate = la date du jour alors synchro
29
26
  if (params.idPartnerType && params.lastUpdate && [_PartnerTransactionType.PartnerTransactionType.QONTO, _PartnerTransactionType.PartnerTransactionType.SHINE, _PartnerTransactionType.PartnerTransactionType.BUDGET_INSIGHT].includes(params.idPartnerType) && dayjs(params.lastUpdate).format('YYYY-MM-DD') === dayjs().format('YYYY-MM-DD') && (!bankConnection || (bankConnection === null || bankConnection === void 0 ? void 0 : bankConnection.errorCode) === null)) return StateSynchro.SYNCHRONIZED;
30
- if (dateOfTermination && dayjs(params.lastUpdate).isSameOrAfter(dateOfTermination)) return StateSynchro.SYNCHRONIZED;
27
+ if (dateOfTermination && (dayjs(params.lastUpdate).isAfter(dateOfTermination) || dayjs(params.lastUpdate).isSame(dateOfTermination))) return StateSynchro.SYNCHRONIZED;
31
28
  return StateSynchro.DESYNCHRONIZED;
32
29
  }
33
30
  //# sourceMappingURL=bankAccount.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bankAccount.js","names":["isSynchro","_dayjs","require","dayjs","_interopRequireWildcard","_PartnerTransactionType","_isSameOrAfter","isSameOrAfter","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","extend","StateSynchro","exports","undefined","params","dateOfTermination","bankConnection","disabledAt","SYNCHRONIZED","idPartnerType","PartnerTransactionType","JE_DECLARE","OTHER","includes","lastUpdate","QONTO","SHINE","BUDGET_INSIGHT","format","errorCode","DESYNCHRONIZED"],"sources":["../../ts/utils/bankAccount.ts"],"sourcesContent":["import * as dayjs from 'dayjs';\nimport { IBankAccount, IBankConnection } from '../types';\nimport { PartnerTransactionType } from '../types/Enum/PartnerTransactionType';\nimport * as isSameOrAfter from 'dayjs/plugin/isSameOrAfter';\n\ndayjs.extend(isSameOrAfter);\n\nexport enum StateSynchro {\n SYNCHRONIZED = 1,\n DESYNCHRONIZED = 2,\n}\n\nexport function isSynchro(params: IBankAccount, dateOfTermination?: Date, bankConnection?: IBankConnection ): StateSynchro {\n // si le compte est désactivé au niveau budget on le considére comme syncrho\n if (params.disabledAt !== null) return StateSynchro.SYNCHRONIZED;\n\n // // si non Défini alors tjs synchro\n if (params.idPartnerType === null) return StateSynchro.SYNCHRONIZED;\n\n // // Si JE DECLARE ou AUTRE alors tjs synchro\n if (params.idPartnerType && [PartnerTransactionType.JE_DECLARE, PartnerTransactionType.OTHER].includes(params.idPartnerType)) return StateSynchro.SYNCHRONIZED;\n\n // // Si budget et lastUpdate = la date du jour alors synchro\n if (params.idPartnerType && params.lastUpdate &&\n [PartnerTransactionType.QONTO, PartnerTransactionType.SHINE, PartnerTransactionType.BUDGET_INSIGHT].includes(params.idPartnerType) && \n dayjs(params.lastUpdate).format('YYYY-MM-DD') === dayjs().format('YYYY-MM-DD')\n && (!bankConnection || bankConnection?.errorCode === null)\n ) return StateSynchro.SYNCHRONIZED;\n \n if (dateOfTermination && dayjs(params.lastUpdate).isSameOrAfter(dateOfTermination)) return StateSynchro.SYNCHRONIZED;\n \n \n return StateSynchro.DESYNCHRONIZED;\n}\n"],"mappings":";;;;;;QAYgBA,SAAS,GAATA,SAAS;AAZzB,IAAAC,MAAA,GAAAC,OAAA;AAA+B,IAAnBC,KAAK,GAAAC,uBAAA,CAAAH,MAAA;AAEjB,IAAAI,uBAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AAA4D,IAAhDK,aAAa,GAAAH,uBAAA,CAAAE,cAAA;AAAA,SAAAE,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;A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;EACxG;EACA,IAAIF,MAAM,CAACG,UAAU,KAAK,IAAI,EAAE,OAAON,YAAY,CAACO,YAAY;EAEhE;EACA,IAAIJ,MAAM,CAACK,aAAa,KAAK,IAAI,EAAE,OAAOR,YAAY,CAACO,YAAY;EAEnE;EACA,IAAIJ,MAAM,CAACK,aAAa,IAAI,CAACC,8CAAsB,CAACC,UAAU,EAAED,8CAAsB,CAACE,KAAK,CAAC,CAACC,QAAQ,CAACT,MAAM,CAACK,aAAa,CAAC,EAAE,OAAOR,YAAY,CAACO,YAAY;EAE9J;EACA,IAAIJ,MAAM,CAACK,aAAa,IAAIL,MAAM,CAACU,UAAU,IAC3C,CAACJ,8CAAsB,CAACK,KAAK,EAAEL,8CAAsB,CAACM,KAAK,EAAEN,8CAAsB,CAACO,cAAc,CAAC,CAACJ,QAAQ,CAACT,MAAM,CAACK,aAAa,CAAC,IACpIpC,KAAK,CAAC+B,MAAM,CAACU,UAAU,CAAC,CAACI,MAAM,CAAC,YAAY,CAAC,KAAK7C,KAAK,EAAE,CAAC6C,MAAM,CAAC,YAAY,CAAC,KAC1E,CAACZ,cAAc,IAAI,CAAAA,cAAc,aAAdA,cAAc,uBAAdA,cAAc,CAAEa,SAAS,MAAK,IAAI,CAAC,EACxD,OAAOlB,YAAY,CAACO,YAAY;EAElC,IAAIH,iBAAiB,IAAIhC,KAAK,CAAC+B,MAAM,CAACU,UAAU,CAAC,CAACrC,aAAa,CAAC4B,iBAAiB,CAAC,EAAE,OAAOJ,YAAY,CAACO,YAAY;EAGpH,OAAOP,YAAY,CAACmB,cAAc;AACpC"}
1
+ {"version":3,"file":"bankAccount.js","names":["isSynchro","_dayjs","require","dayjs","_interopRequireWildcard","_PartnerTransactionType","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","StateSynchro","exports","undefined","params","dateOfTermination","bankConnection","disabledAt","SYNCHRONIZED","idPartnerType","PartnerTransactionType","JE_DECLARE","OTHER","includes","lastUpdate","QONTO","SHINE","BUDGET_INSIGHT","format","errorCode","isAfter","isSame","DESYNCHRONIZED"],"sources":["../../ts/utils/bankAccount.ts"],"sourcesContent":["import * as dayjs from 'dayjs';\nimport { IBankAccount, IBankConnection } from '../types';\nimport { PartnerTransactionType } from '../types/Enum/PartnerTransactionType';\n\n\nexport enum StateSynchro {\n SYNCHRONIZED = 1,\n DESYNCHRONIZED = 2,\n}\n\nexport function isSynchro(params: IBankAccount, dateOfTermination?: Date, bankConnection?: IBankConnection ): StateSynchro {\n // si le compte est désactivé au niveau budget on le considére comme syncrho\n if (params.disabledAt !== null) return StateSynchro.SYNCHRONIZED;\n\n // // si non Défini alors tjs synchro\n if (params.idPartnerType === null) return StateSynchro.SYNCHRONIZED;\n\n // // Si JE DECLARE ou AUTRE alors tjs synchro\n if (params.idPartnerType && [PartnerTransactionType.JE_DECLARE, PartnerTransactionType.OTHER].includes(params.idPartnerType)) return StateSynchro.SYNCHRONIZED;\n\n // // Si budget et lastUpdate = la date du jour alors synchro\n if (params.idPartnerType && params.lastUpdate &&\n [PartnerTransactionType.QONTO, PartnerTransactionType.SHINE, PartnerTransactionType.BUDGET_INSIGHT].includes(params.idPartnerType) && \n dayjs(params.lastUpdate).format('YYYY-MM-DD') === dayjs().format('YYYY-MM-DD')\n && (!bankConnection || bankConnection?.errorCode === null)\n ) return StateSynchro.SYNCHRONIZED;\n \n if (dateOfTermination && (dayjs(params.lastUpdate).isAfter(dateOfTermination) || dayjs(params.lastUpdate).isSame(dateOfTermination))) return StateSynchro.SYNCHRONIZED;\n \n \n return StateSynchro.DESYNCHRONIZED;\n}\n"],"mappings":";;;;;;QAUgBA,SAAS,GAATA,SAAS;AAVzB,IAAAC,MAAA,GAAAC,OAAA;AAA+B,IAAnBC,KAAK,GAAAC,uBAAA,CAAAH,MAAA;AAEjB,IAAAI,uBAAA,GAAA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 -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@silexpert/core",
3
- "version": "1.1.87",
3
+ "version": "1.1.88",
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,9 +1,7 @@
1
1
  import * as dayjs from 'dayjs';
2
2
  import { IBankAccount, IBankConnection } from '../types';
3
3
  import { PartnerTransactionType } from '../types/Enum/PartnerTransactionType';
4
- import * as isSameOrAfter from 'dayjs/plugin/isSameOrAfter';
5
4
 
6
- dayjs.extend(isSameOrAfter);
7
5
 
8
6
  export enum StateSynchro {
9
7
  SYNCHRONIZED = 1,
@@ -27,7 +25,7 @@ export function isSynchro(params: IBankAccount, dateOfTermination?: Date, bankCo
27
25
  && (!bankConnection || bankConnection?.errorCode === null)
28
26
  ) return StateSynchro.SYNCHRONIZED;
29
27
 
30
- if (dateOfTermination && dayjs(params.lastUpdate).isSameOrAfter(dateOfTermination)) return StateSynchro.SYNCHRONIZED;
28
+ if (dateOfTermination && (dayjs(params.lastUpdate).isAfter(dateOfTermination) || dayjs(params.lastUpdate).isSame(dateOfTermination))) return StateSynchro.SYNCHRONIZED;
31
29
 
32
30
 
33
31
  return StateSynchro.DESYNCHRONIZED;