@silexpert/core 1.3.4 → 1.3.6

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 (132) hide show
  1. package/dist/cjs/api/resources/Account.d.ts +3 -4
  2. package/dist/cjs/api/resources/Account.d.ts.map +1 -1
  3. package/dist/cjs/api/resources/Account.js.map +1 -1
  4. package/dist/cjs/types/Enum/Aspone.d.ts +22 -4
  5. package/dist/cjs/types/Enum/Aspone.d.ts.map +1 -1
  6. package/dist/cjs/types/Enum/Aspone.js +23 -47
  7. package/dist/cjs/types/Enum/Aspone.js.map +1 -1
  8. package/dist/cjs/types/Enum/BalanceSheetQuestion.d.ts +1 -0
  9. package/dist/cjs/types/Enum/BalanceSheetQuestion.d.ts.map +1 -1
  10. package/dist/cjs/types/Enum/BalanceSheetQuestion.js +1 -0
  11. package/dist/cjs/types/Enum/BalanceSheetQuestion.js.map +1 -1
  12. package/dist/cjs/types/Enum/BalanceSheetQuestionWording.d.ts +1 -0
  13. package/dist/cjs/types/Enum/BalanceSheetQuestionWording.d.ts.map +1 -1
  14. package/dist/cjs/types/Enum/BalanceSheetQuestionWording.js +1 -0
  15. package/dist/cjs/types/Enum/BalanceSheetQuestionWording.js.map +1 -1
  16. package/dist/cjs/types/Interface/api/cerfa/2031.d.ts +186 -0
  17. package/dist/cjs/types/Interface/api/cerfa/2031.d.ts.map +1 -1
  18. package/dist/cjs/types/Interface/api/cerfa/2031.js.map +1 -1
  19. package/dist/cjs/types/Interface/api/cerfa/2033.d.ts +112 -16
  20. package/dist/cjs/types/Interface/api/cerfa/2033.d.ts.map +1 -1
  21. package/dist/cjs/types/Interface/api/cerfa/2033.js +4 -1
  22. package/dist/cjs/types/Interface/api/cerfa/2033.js.map +1 -1
  23. package/dist/cjs/types/Interface/api/cerfa/2035.d.ts +216 -1
  24. package/dist/cjs/types/Interface/api/cerfa/2035.d.ts.map +1 -1
  25. package/dist/cjs/types/Interface/api/cerfa/2035.js.map +1 -1
  26. package/dist/cjs/types/Interface/api/cerfa/2065.d.ts +114 -1
  27. package/dist/cjs/types/Interface/api/cerfa/2065.d.ts.map +1 -1
  28. package/dist/cjs/types/Interface/api/cerfa/2065.js.map +1 -1
  29. package/dist/cjs/types/Interface/api/cerfa/2069RCI.d.ts +86 -6
  30. package/dist/cjs/types/Interface/api/cerfa/2069RCI.d.ts.map +1 -1
  31. package/dist/cjs/types/Interface/api/cerfa/2069RCI.js.map +1 -1
  32. package/dist/cjs/types/Interface/api/cerfa/3310.d.ts +15 -4
  33. package/dist/cjs/types/Interface/api/cerfa/3310.d.ts.map +1 -1
  34. package/dist/cjs/types/Interface/api/cerfa/3310.js.map +1 -1
  35. package/dist/cjs/types/Interface/api/cerfa/ReadCerfa.d.ts +5 -5
  36. package/dist/cjs/types/Interface/api/cerfa/ReadCerfa.d.ts.map +1 -1
  37. package/dist/cjs/types/Interface/api/cerfa/ReadCerfa.js.map +1 -1
  38. package/dist/cjs/types/Interface/models/IAccount.d.ts +1 -1
  39. package/dist/cjs/types/Interface/models/IAccount.d.ts.map +1 -1
  40. package/dist/cjs/types/Interface/models/IAccount.js.map +1 -1
  41. package/dist/cjs/types/index.d.ts +0 -1
  42. package/dist/cjs/types/index.d.ts.map +1 -1
  43. package/dist/cjs/types/index.js +0 -1
  44. package/dist/cjs/types/index.js.map +1 -1
  45. package/dist/cjs/utils/cerfa.js +1 -1
  46. package/dist/cjs/utils/cerfa.js.map +1 -1
  47. package/dist/cjs/utils/vat/3310/century25.d.ts +8 -0
  48. package/dist/cjs/utils/vat/3310/century25.d.ts.map +1 -0
  49. package/dist/cjs/utils/vat/3310/century25.js +1718 -0
  50. package/dist/cjs/utils/vat/3310/century25.js.map +1 -0
  51. package/dist/cjs/utils/vat/centuries.d.ts.map +1 -1
  52. package/dist/cjs/utils/vat/centuries.js +21 -1
  53. package/dist/cjs/utils/vat/centuries.js.map +1 -1
  54. package/dist/mjs/api/resources/Account.d.ts +3 -4
  55. package/dist/mjs/api/resources/Account.d.ts.map +1 -1
  56. package/dist/mjs/api/resources/Account.js.map +1 -1
  57. package/dist/mjs/types/Enum/Aspone.d.ts +22 -4
  58. package/dist/mjs/types/Enum/Aspone.d.ts.map +1 -1
  59. package/dist/mjs/types/Enum/Aspone.js +22 -46
  60. package/dist/mjs/types/Enum/Aspone.js.map +1 -1
  61. package/dist/mjs/types/Enum/BalanceSheetQuestion.d.ts +1 -0
  62. package/dist/mjs/types/Enum/BalanceSheetQuestion.d.ts.map +1 -1
  63. package/dist/mjs/types/Enum/BalanceSheetQuestion.js +1 -0
  64. package/dist/mjs/types/Enum/BalanceSheetQuestion.js.map +1 -1
  65. package/dist/mjs/types/Enum/BalanceSheetQuestionWording.d.ts +1 -0
  66. package/dist/mjs/types/Enum/BalanceSheetQuestionWording.d.ts.map +1 -1
  67. package/dist/mjs/types/Enum/BalanceSheetQuestionWording.js +1 -0
  68. package/dist/mjs/types/Enum/BalanceSheetQuestionWording.js.map +1 -1
  69. package/dist/mjs/types/Interface/api/cerfa/2031.d.ts +186 -0
  70. package/dist/mjs/types/Interface/api/cerfa/2031.d.ts.map +1 -1
  71. package/dist/mjs/types/Interface/api/cerfa/2031.js.map +1 -1
  72. package/dist/mjs/types/Interface/api/cerfa/2033.d.ts +112 -16
  73. package/dist/mjs/types/Interface/api/cerfa/2033.d.ts.map +1 -1
  74. package/dist/mjs/types/Interface/api/cerfa/2033.js +4 -0
  75. package/dist/mjs/types/Interface/api/cerfa/2033.js.map +1 -1
  76. package/dist/mjs/types/Interface/api/cerfa/2035.d.ts +216 -1
  77. package/dist/mjs/types/Interface/api/cerfa/2035.d.ts.map +1 -1
  78. package/dist/mjs/types/Interface/api/cerfa/2035.js.map +1 -1
  79. package/dist/mjs/types/Interface/api/cerfa/2065.d.ts +114 -1
  80. package/dist/mjs/types/Interface/api/cerfa/2065.d.ts.map +1 -1
  81. package/dist/mjs/types/Interface/api/cerfa/2065.js.map +1 -1
  82. package/dist/mjs/types/Interface/api/cerfa/2069RCI.d.ts +86 -6
  83. package/dist/mjs/types/Interface/api/cerfa/2069RCI.d.ts.map +1 -1
  84. package/dist/mjs/types/Interface/api/cerfa/2069RCI.js.map +1 -1
  85. package/dist/mjs/types/Interface/api/cerfa/3310.d.ts +15 -4
  86. package/dist/mjs/types/Interface/api/cerfa/3310.d.ts.map +1 -1
  87. package/dist/mjs/types/Interface/api/cerfa/3310.js.map +1 -1
  88. package/dist/mjs/types/Interface/api/cerfa/ReadCerfa.d.ts +5 -5
  89. package/dist/mjs/types/Interface/api/cerfa/ReadCerfa.d.ts.map +1 -1
  90. package/dist/mjs/types/Interface/api/cerfa/ReadCerfa.js.map +1 -1
  91. package/dist/mjs/types/Interface/models/IAccount.d.ts +1 -1
  92. package/dist/mjs/types/Interface/models/IAccount.d.ts.map +1 -1
  93. package/dist/mjs/types/Interface/models/IAccount.js.map +1 -1
  94. package/dist/mjs/types/index.d.ts +0 -1
  95. package/dist/mjs/types/index.d.ts.map +1 -1
  96. package/dist/mjs/types/index.js +0 -1
  97. package/dist/mjs/types/index.js.map +1 -1
  98. package/dist/mjs/utils/cerfa.js +1 -1
  99. package/dist/mjs/utils/cerfa.js.map +1 -1
  100. package/dist/mjs/utils/vat/3310/century25.d.ts +8 -0
  101. package/dist/mjs/utils/vat/3310/century25.d.ts.map +1 -0
  102. package/dist/mjs/utils/vat/3310/century25.js +1711 -0
  103. package/dist/mjs/utils/vat/3310/century25.js.map +1 -0
  104. package/dist/mjs/utils/vat/centuries.d.ts.map +1 -1
  105. package/dist/mjs/utils/vat/centuries.js +21 -1
  106. package/dist/mjs/utils/vat/centuries.js.map +1 -1
  107. package/package.json +1 -1
  108. package/ts/api/resources/Account.ts +3 -4
  109. package/ts/types/Enum/Aspone.ts +24 -47
  110. package/ts/types/Enum/BalanceSheetQuestion.ts +1 -0
  111. package/ts/types/Enum/BalanceSheetQuestionWording.ts +1 -0
  112. package/ts/types/Interface/api/cerfa/2031.ts +179 -0
  113. package/ts/types/Interface/api/cerfa/2033.ts +107 -16
  114. package/ts/types/Interface/api/cerfa/2035.ts +199 -1
  115. package/ts/types/Interface/api/cerfa/2065.ts +101 -1
  116. package/ts/types/Interface/api/cerfa/2069RCI.ts +86 -6
  117. package/ts/types/Interface/api/cerfa/3310.ts +16 -4
  118. package/ts/types/Interface/api/cerfa/ReadCerfa.ts +7 -10
  119. package/ts/types/Interface/models/IAccount.ts +1 -1
  120. package/ts/types/index.ts +0 -1
  121. package/ts/utils/cerfa.ts +1 -1
  122. package/ts/utils/vat/3310/century25.ts +2038 -0
  123. package/ts/utils/vat/centuries.ts +31 -1
  124. package/dist/cjs/types/Interface/models/IAccountExtend.d.ts +0 -6
  125. package/dist/cjs/types/Interface/models/IAccountExtend.d.ts.map +0 -1
  126. package/dist/cjs/types/Interface/models/IAccountExtend.js +0 -3
  127. package/dist/cjs/types/Interface/models/IAccountExtend.js.map +0 -1
  128. package/dist/mjs/types/Interface/models/IAccountExtend.d.ts +0 -6
  129. package/dist/mjs/types/Interface/models/IAccountExtend.d.ts.map +0 -1
  130. package/dist/mjs/types/Interface/models/IAccountExtend.js +0 -2
  131. package/dist/mjs/types/Interface/models/IAccountExtend.js.map +0 -1
  132. package/ts/types/Interface/models/IAccountExtend.ts +0 -6
@@ -1 +1 @@
1
- {"version":3,"file":"cerfa.js","sourceRoot":"","sources":["../../../ts/utils/cerfa.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAA2B,MAAM,4BAA4B,CAAC;AACnF,OAAO,EAAwC,IAAI,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACxB,IAAI,CAAO;IAEX,IAAI,CAAY;IAEjC,YAAY,MAAmB;QAC7B,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC/B,KAAK,CAAC,MAAM,CAAC,CAAC;YACd,OAAO;QACT,CAAC;QACD,KA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AI,EAAE,SAAS,CAAC,aAAa,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC;IACnH,CAAC;IAED,MAAM,WAAW,GAAG,oBAAoB,CAAC,OAAO,CAAC,SAAS,CACxD,CAAC,GAAG,EAAE,EAAE,CACN,GAAG,CAAC,cAAc,KAAK,cAAc,IAAI,GAAG,CAAC,WAAW,KAAK,WAAW,IAAI,GAAG,CAAC,WAAW,KAAK,WAAW,CAC9G,CAAC;IAEF,IAAI,WAAW,GAAG,CAAC;QACjB,MAAM,IAAI,gBAAgB,CAAC;YACzB,IAAI,EAAE,IAAI,CAAC,eAAe;YAC1B,IAAI,EAAE,SAAS,CAAC,aAAa;YAC7B,OAAO,EAAE,iGAAiG;SAC3G,CAAC,CAAC;IACL,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,oBAAoB,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAE1E,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,IAAI,IAAI,EAAE,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,iCAAiC,CAAC,WAAmB;IACnE,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAClD,MAAM,oBAAoB,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;IAE/F,IAAI,CAAC,oBAAoB;QACvB,MAAM,IAAI,gBAAgB,CAAC;YACzB,IAAI,EAAE,IAAI,CAAC,eAAe;YAC1B,IAAI,EAAE,SAAS,CAAC,aAAa;YAC7B,OAAO,EAAE,cAAc,WAAW,kBAAkB;SACrD,CAAC,CAAC;IACL,OAAO,oBAAoB,CAAC;AAC9B,CAAC","sourcesContent":["import { ReadCerfaToComplete } from '../types/Interface/api/cerfa/ReadCerfa';\nimport { GlobalRegime, GlobalRegimeTypeContent } from '../types/Enum/GlobalRegime';\nimport { ProfitsType, FiscalRegime, TaxSystem, Code, ErrorType } from '../types';\nimport { isDefined } from 'class-validator';\n\ntype ErrorParams = { code: Code; type: ErrorType; message?: string } | string;\n\nexport class ServiceException extends Error {\n private readonly code: Code;\n\n private readonly type: ErrorType;\n\n constructor(params: ErrorParams) {\n if (typeof params === 'string') {\n super(params);\n return;\n }\n super(params.message);\n this.code = params.code;\n this.type = params.type;\n }\n}\n\nexport function retrieveCerfaFromSocietyInformations(\n idLegalForm: number,\n idTaxSystem: TaxSystem,\n idFiscalRegime: FiscalRegime,\n profitsType: ProfitsType,\n): ReadCerfaToComplete {\n const globalRegimes = Object.values(GlobalRegime);\n const selectedGlobalRegime = globalRegimes.find((gr) => gr.idLegalForms.includes(idLegalForm));\n\n if (!selectedGlobalRegime)\n throw new ServiceException({\n code: Code.validationError,\n type: ErrorType.resourceError,\n message: 'Votre raison sociale ne vous permet pas de générer votre bilan chez nous',\n });\n\n if (!isDefined(idFiscalRegime) || !isDefined(profitsType) || !isDefined(idTaxSystem)) {\n const missingData: string[] = [];\n if (!isDefined(idFiscalRegime)) missingData.push('Régime de droit commun');\n if (!isDefined(profitsType)) missingData.push(\"Régime d'imposition\");\n if (!isDefined(idTaxSystem)) missingData.push('Activité (BNC, BIC)');\n const errorMEssage = `Les informations suivantes sont manquantes pour déterminer votre régime ficscal: ${missingData.join(', ')}`;\n throw new ServiceException({ code: Code.validationError, type: ErrorType.resourceError, message: errorMEssage });\n }\n\n const choiceIndex = selectedGlobalRegime.choices.findIndex(\n (sgr) =>\n sgr.idFiscalRegime === idFiscalRegime && sgr.profitsType === profitsType && sgr.idTaxSystem === idTaxSystem,\n );\n\n if (choiceIndex < 0)\n throw new ServiceException({\n code: Code.validationError,\n type: ErrorType.resourceError,\n message: \"Au vu des informations remplies, nous sommes dans l'incapacité de générer votre bilan chez nous\",\n });\n const { declaration, annexe } = selectedGlobalRegime.choices[choiceIndex];\n\n return { declaration, annex: annexe ?? null };\n}\n\nexport function retreiveChoicesDependingLegalForm(idLegalForm: number): GlobalRegimeTypeContent {\n const globalRegimes = Object.values(GlobalRegime);\n const selectedGlobalRegime = globalRegimes.find((gr) => gr.idLegalForms.includes(idLegalForm));\n\n if (!selectedGlobalRegime)\n throw new ServiceException({\n code: Code.validationError,\n type: ErrorType.resourceError,\n message: `LegalForm #${idLegalForm} not implemented`,\n });\n return selectedGlobalRegime;\n}\n"]}
1
+ {"version":3,"file":"cerfa.js","sourceRoot":"","sources":["../../../ts/utils/cerfa.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAA2B,MAAM,4BAA4B,CAAC;AACnF,OAAO,EAAwC,IAAI,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACxB,IAAI,CAAO;IAEX,IAAI,CAAY;IAEjC,YAAY,MAAmB;QAC7B,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC/B,KAAK,CAAC,MAAM,CAAC,CAAC;YACd,OAAO;QACT,CAAC;QACD,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACtB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IAC1B,CAAC;CACF;AAED,MAAM,UAAU,oCAAoC,CAClD,WAAmB,EACnB,WAAsB,EACtB,cAA4B,EAC5B,WAAwB;IAExB,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAClD,MAAM,oBAAoB,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;IAE/F,IAAI,CAAC,oBAAoB;QACvB,MAAM,IAAI,gBAAgB,CAAC;YACzB,IAAI,EA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AC,OAAO,CAAC,WAAW,CAAC,CAAC;IAE1E,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,IAAI,IAAI,EAAE,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,iCAAiC,CAAC,WAAmB;IACnE,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAClD,MAAM,oBAAoB,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;IAE/F,IAAI,CAAC,oBAAoB;QACvB,MAAM,IAAI,gBAAgB,CAAC;YACzB,IAAI,EAAE,IAAI,CAAC,eAAe;YAC1B,IAAI,EAAE,SAAS,CAAC,aAAa;YAC7B,OAAO,EAAE,cAAc,WAAW,kBAAkB;SACrD,CAAC,CAAC;IACL,OAAO,oBAAoB,CAAC;AAC9B,CAAC","sourcesContent":["import { ReadCerfaToComplete } from '../types/Interface/api/cerfa/ReadCerfa';\nimport { GlobalRegime, GlobalRegimeTypeContent } from '../types/Enum/GlobalRegime';\nimport { ProfitsType, FiscalRegime, TaxSystem, Code, ErrorType } from '../types';\nimport { isDefined } from 'class-validator';\n\ntype ErrorParams = { code: Code; type: ErrorType; message?: string } | string;\n\nexport class ServiceException extends Error {\n private readonly code: Code;\n\n private readonly type: ErrorType;\n\n constructor(params: ErrorParams) {\n if (typeof params === 'string') {\n super(params);\n return;\n }\n super(params.message);\n this.code = params.code;\n this.type = params.type;\n }\n}\n\nexport function retrieveCerfaFromSocietyInformations(\n idLegalForm: number,\n idTaxSystem: TaxSystem,\n idFiscalRegime: FiscalRegime,\n profitsType: ProfitsType,\n): ReadCerfaToComplete {\n const globalRegimes = Object.values(GlobalRegime);\n const selectedGlobalRegime = globalRegimes.find((gr) => gr.idLegalForms.includes(idLegalForm));\n\n if (!selectedGlobalRegime)\n throw new ServiceException({\n code: Code.validationError,\n type: ErrorType.resourceError,\n message: 'Votre raison sociale ne vous permet pas de générer votre bilan chez nous',\n });\n\n if (!isDefined(idFiscalRegime) || !isDefined(profitsType) || !isDefined(idTaxSystem)) {\n const missingData: string[] = [];\n if (!isDefined(idFiscalRegime)) missingData.push('Régime de droit commun');\n if (!isDefined(profitsType)) missingData.push(\"Régime d'imposition\");\n if (!isDefined(idTaxSystem)) missingData.push('Activité (BNC, BIC)');\n const errorMEssage = `Les informations suivantes sont manquantes pour déterminer votre régime fiscal: ${missingData.join(', ')}`;\n throw new ServiceException({ code: Code.validationError, type: ErrorType.resourceError, message: errorMEssage });\n }\n\n const choiceIndex = selectedGlobalRegime.choices.findIndex(\n (sgr) =>\n sgr.idFiscalRegime === idFiscalRegime && sgr.profitsType === profitsType && sgr.idTaxSystem === idTaxSystem,\n );\n\n if (choiceIndex < 0)\n throw new ServiceException({\n code: Code.validationError,\n type: ErrorType.resourceError,\n message: \"Au vu des informations remplies, nous sommes dans l'incapacité de générer votre bilan chez nous\",\n });\n const { declaration, annexe } = selectedGlobalRegime.choices[choiceIndex];\n\n return { declaration, annex: annexe ?? null };\n}\n\nexport function retreiveChoicesDependingLegalForm(idLegalForm: number): GlobalRegimeTypeContent {\n const globalRegimes = Object.values(GlobalRegime);\n const selectedGlobalRegime = globalRegimes.find((gr) => gr.idLegalForms.includes(idLegalForm));\n\n if (!selectedGlobalRegime)\n throw new ServiceException({\n code: Code.validationError,\n type: ErrorType.resourceError,\n message: `LegalForm #${idLegalForm} not implemented`,\n });\n return selectedGlobalRegime;\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import { IAccountingEntry } from '../../../types/Interface/models/IAccountingEntry';
2
+ import { Cerfa3310_2025, PayloadCerfa3310_2025 } from '../../../types/Interface/api/cerfa/3310';
3
+ import { AsponeFormFields, CerfaPayloadForm } from '../../../types/Interface/api/cerfa/ReadCerfa';
4
+ import { UpdatedAnnotation } from '../../../types/Interface/api/registration/ReadRegistration';
5
+ export declare function getCerfa3310Century25Payload(accountingEntries: IAccountingEntry[], payload: PayloadCerfa3310_2025, updatedEntries?: UpdatedAnnotation): Cerfa3310_2025;
6
+ export declare function getCerfa3310Century25RegistrationFields(data: Cerfa3310_2025): AsponeFormFields;
7
+ export declare const cerfa3310Century25Fields: CerfaPayloadForm[];
8
+ //# sourceMappingURL=century25.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"century25.d.ts","sourceRoot":"","sources":["../../../../../ts/utils/vat/3310/century25.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAGhG,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,4DAA4D,CAAC;AAG/F,wBAAgB,4BAA4B,CAC1C,iBAAiB,EAAE,gBAAgB,EAAE,EACrC,OAAO,EAAE,qBAAqB,EAC9B,cAAc,GAAE,iBAAsB,GACrC,cAAc,CA2zBhB;AAED,wBAAgB,uCAAuC,CAAC,IAAI,EAAE,cAAc,GAAG,gBAAgB,CAq+B9F;AAED,eAAO,MAAM,wBAAwB,EAAE,gBAAgB,EAkMtD,CAAC"}