@aurorajs.dev/catalyst-cli 3.1.0 → 3.1.2

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 (186) hide show
  1. package/README.md +1 -1
  2. package/dist/templates/backend/application/package.json +0 -1
  3. package/dist/templates/backend/business-rules/business-partner-portal/purchase-invoice-header.md +599 -10
  4. package/dist/templates/backend/business-rules/business-partner-portal/supplier-document.md +446 -14
  5. package/dist/templates/backend/manual/business-partner-portal/CONTEXT.md +114 -46
  6. package/dist/templates/backend/manual/business-partner-portal/en/extraction-template-field.md +1 -1
  7. package/dist/templates/backend/manual/business-partner-portal/en/purchase-invoice-header.md +18 -3
  8. package/dist/templates/backend/manual/business-partner-portal/en/supplier-document.md +2 -2
  9. package/dist/templates/backend/manual/business-partner-portal/es/extraction-template-field.md +1 -1
  10. package/dist/templates/backend/manual/business-partner-portal/es/purchase-invoice-header.md +18 -3
  11. package/dist/templates/backend/manual/business-partner-portal/es/supplier-document.md +2 -2
  12. package/dist/templates/backend/manual/business-partner-portal/processes.yaml +2 -1
  13. package/dist/templates/backend/packages/business-partner-portal/package.yaml +0 -2
  14. package/dist/templates/backend/packages/business-partner-portal/src/@api/business-partner-portal/business-partner-portal.module.ts +2 -0
  15. package/dist/templates/backend/packages/business-partner-portal/src/@api/business-partner-portal/purchase-invoice-header/dto/business-partner-portal-create-purchase-invoice-header.dto.ts +2 -9
  16. package/dist/templates/backend/packages/business-partner-portal/src/@api/business-partner-portal/purchase-invoice-header/dto/business-partner-portal-purchase-invoice-header.dto.ts +10 -10
  17. package/dist/templates/backend/packages/business-partner-portal/src/@api/business-partner-portal/purchase-invoice-header/dto/business-partner-portal-update-purchase-invoice-header-by-id.dto.ts +2 -9
  18. package/dist/templates/backend/packages/business-partner-portal/src/@api/business-partner-portal/purchase-invoice-header/dto/business-partner-portal-update-purchase-invoice-headers.dto.ts +2 -9
  19. package/dist/templates/backend/packages/business-partner-portal/src/@api/business-partner-portal/purchase-invoice-header/graphql/business-partner-portal-purchase-invoice-header.graphql +14 -15
  20. package/dist/templates/backend/packages/business-partner-portal/src/@api/business-partner-portal/purchase-invoice-trace/dto/business-partner-portal-purchase-invoice-trace.dto.ts +1 -1
  21. package/dist/templates/backend/packages/business-partner-portal/src/@api/business-partner-portal/purchase-invoice-trace/dto/business-partner-portal-update-purchase-invoice-traces.dto.ts +1 -1
  22. package/dist/templates/backend/packages/business-partner-portal/src/@api/business-partner-portal/purchase-invoice-trace/graphql/business-partner-portal-purchase-invoice-trace.graphql +1 -1
  23. package/dist/templates/backend/packages/business-partner-portal/src/@api/business-partner-portal/shared/types/business-partner-portal.types.ts +1 -3
  24. package/dist/templates/backend/packages/business-partner-portal/src/@api/business-partner-portal/supplier-document/dto/business-partner-portal-create-supplier-document.dto.ts +1 -8
  25. package/dist/templates/backend/packages/business-partner-portal/src/@api/business-partner-portal/supplier-document/dto/business-partner-portal-supplier-document.dto.ts +1 -8
  26. package/dist/templates/backend/packages/business-partner-portal/src/@api/business-partner-portal/supplier-document/dto/business-partner-portal-update-supplier-document-by-id.dto.ts +1 -8
  27. package/dist/templates/backend/packages/business-partner-portal/src/@api/business-partner-portal/supplier-document/dto/business-partner-portal-update-supplier-documents.dto.ts +1 -8
  28. package/dist/templates/backend/packages/business-partner-portal/src/@api/business-partner-portal/supplier-document/graphql/business-partner-portal-supplier-document.graphql +2 -9
  29. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/infrastructure/business-partner-portal-anthropic-extraction-step-two.service.spec.ts +73 -16
  30. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/infrastructure/business-partner-portal-anthropic-extraction-step-two.service.ts +32 -27
  31. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/infrastructure/business-partner-portal-anthropic-invoice-ocr.service.spec.ts +199 -0
  32. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/infrastructure/business-partner-portal-anthropic-invoice-ocr.service.ts +84 -0
  33. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/infrastructure/index.ts +1 -0
  34. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/shared/functions/business-partner-portal-anthropic-build-document-block.function.spec.ts +39 -0
  35. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/shared/functions/business-partner-portal-anthropic-build-document-block.function.ts +37 -0
  36. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/shared/functions/business-partner-portal-anthropic-build-step-one-request.function.spec.ts +139 -0
  37. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/shared/functions/business-partner-portal-anthropic-build-step-one-request.function.ts +84 -0
  38. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/shared/functions/business-partner-portal-anthropic-build-step-two-request.function.spec.ts +134 -3
  39. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/shared/functions/business-partner-portal-anthropic-build-step-two-request.function.ts +55 -35
  40. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/shared/functions/business-partner-portal-anthropic-map-step-one-answer.function.spec.ts +239 -0
  41. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/shared/functions/business-partner-portal-anthropic-map-step-one-answer.function.ts +201 -0
  42. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/shared/functions/business-partner-portal-anthropic-map-step-two-answer.function.spec.ts +87 -0
  43. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/shared/functions/business-partner-portal-anthropic-map-step-two-answer.function.ts +110 -1
  44. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/shared/functions/business-partner-portal-anthropic-read-key-value.function.spec.ts +58 -0
  45. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/shared/functions/business-partner-portal-anthropic-read-key-value.function.ts +30 -0
  46. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/shared/functions/index.ts +4 -0
  47. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/shared/types/business-partner-portal-anthropic-step-one-answer.types.ts +96 -0
  48. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/shared/types/business-partner-portal-anthropic-step-two-answer.types.ts +109 -14
  49. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/shared/types/index.ts +1 -0
  50. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/business-partner-portal.seed.spec.ts +21 -11
  51. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/business-partner-portal.seed.ts +5 -26
  52. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/extraction-field/shared/services/business-partner-portal-extraction-field-fixed-seed.data.spec.ts +1 -1
  53. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/extraction-field/shared/services/business-partner-portal-extraction-field-fixed-seed.data.ts +2 -2
  54. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/purchase-invoice-header/application/accept-review/business-partner-portal-accept-review-purchase-invoice-header.handler.spec.ts +10 -1
  55. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/purchase-invoice-header/application/accept-review/business-partner-portal-accept-review-purchase-invoice-header.handler.ts +6 -3
  56. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/purchase-invoice-header/application/business-partner-portal-purchase-invoice-header.payload-types.ts +3 -0
  57. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/purchase-invoice-header/application/create/business-partner-portal-create-purchase-invoice-header.handler.spec.ts +0 -1
  58. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/purchase-invoice-header/application/preview/business-partner-portal-preview-purchase-invoice-header.handler.spec.ts +1 -1
  59. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/purchase-invoice-header/application/preview/business-partner-portal-preview-purchase-invoice-header.handler.ts +1 -1
  60. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/purchase-invoice-header/application/save/business-partner-portal-save-purchase-invoice-header.handler.spec.ts +1 -1
  61. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/purchase-invoice-header/application/save/business-partner-portal-save-purchase-invoice-header.handler.ts +1 -1
  62. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/purchase-invoice-header/domain/business-partner-portal-purchase-invoice-header.field-schema.ts +6 -6
  63. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/purchase-invoice-header/infrastructure/drizzle/business-partner-portal-drizzle-purchase-invoice-header.schema.ts +1 -1
  64. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/purchase-invoice-header/shared/functions/business-partner-portal-build-purchase-invoice-review-derive-input.function.spec.ts +2 -2
  65. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/purchase-invoice-header/shared/functions/business-partner-portal-build-purchase-invoice-review-derive-input.function.ts +2 -2
  66. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/purchase-invoice-header/shared/functions/business-partner-portal-derive-purchase-invoice-review.function.spec.ts +118 -13
  67. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/purchase-invoice-header/shared/functions/business-partner-portal-derive-purchase-invoice-review.function.ts +47 -7
  68. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/purchase-invoice-header/shared/services/business-partner-portal-purchase-invoice-header-state-cycle.spec.ts +5 -0
  69. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/purchase-invoice-header/shared/services/business-partner-portal-purchase-invoice-header-state-mover.service.spec.ts +15 -0
  70. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/purchase-invoice-header/shared/services/business-partner-portal-purchase-invoice-header-state-mover.service.ts +2 -0
  71. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/purchase-invoice-header/shared/services/business-partner-portal-purchase-invoice-review-context.service.spec.ts +16 -40
  72. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/purchase-invoice-header/shared/services/business-partner-portal-purchase-invoice-review-context.service.ts +16 -16
  73. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-check-extraction-step-two-operations.function.spec.ts +533 -0
  74. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-check-extraction-step-two-operations.function.ts +254 -0
  75. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-check-required-extraction-fields.function.spec.ts +5 -1
  76. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-decide-extraction-step-two.function.spec.ts +122 -218
  77. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-decide-extraction-step-two.function.ts +76 -185
  78. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-doubt-reader.service.spec.ts +6 -55
  79. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-doubt-reader.service.ts +7 -40
  80. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-doubt.types.ts +124 -0
  81. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two-context.service.spec.ts +66 -15
  82. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two-context.service.ts +16 -7
  83. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two-current-values.service.spec.ts +35 -0
  84. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two-current-values.service.ts +21 -2
  85. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two-decision.service.spec.ts +104 -70
  86. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two-decision.service.ts +20 -63
  87. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two-decision.types.ts +7 -16
  88. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two-empty.service.spec.ts +1 -0
  89. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two-failure-issues.service.spec.ts +47 -0
  90. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two-failure-issues.service.ts +31 -0
  91. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two-field-values.function.ts +4 -4
  92. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two-job.types.ts +15 -7
  93. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two-producer.service.spec.ts +18 -0
  94. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two-producer.service.ts +5 -3
  95. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two-reconciliation.types.ts +31 -2
  96. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two-values.types.ts +43 -9
  97. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two-writer.service.spec.ts +109 -5
  98. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two-writer.service.ts +47 -6
  99. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two.types.ts +40 -0
  100. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two.worker.spec.ts +709 -51
  101. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two.worker.ts +214 -60
  102. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-merge-extraction-step-two-discrepancies.function.spec.ts +91 -0
  103. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-merge-extraction-step-two-discrepancies.function.ts +32 -0
  104. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-reconcile-extraction-step-two.function.spec.ts +300 -41
  105. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-reconcile-extraction-step-two.function.ts +210 -31
  106. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-record-extraction-step-two.function.spec.ts +263 -0
  107. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-record-extraction-step-two.function.ts +124 -0
  108. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/index.ts +3 -2
  109. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/index.ts +1 -0
  110. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/invoice-ocr/business-partner-portal-invoice-ocr.types.spec.ts +47 -0
  111. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/invoice-ocr/business-partner-portal-invoice-ocr.types.ts +29 -21
  112. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/purchase-invoice-extraction/business-partner-portal-assess-extraction-doubt.function.spec.ts +198 -0
  113. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/purchase-invoice-extraction/business-partner-portal-assess-extraction-doubt.function.ts +78 -0
  114. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/purchase-invoice-extraction/business-partner-portal-deduce-breakdown-tax-rate.function.spec.ts +3 -5
  115. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/purchase-invoice-extraction/business-partner-portal-map-invoice-ocr-result-to-purchase-invoice.function.spec.ts +108 -399
  116. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/purchase-invoice-extraction/business-partner-portal-map-invoice-ocr-result-to-purchase-invoice.function.ts +76 -111
  117. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/purchase-invoice-extraction/business-partner-portal-purchase-invoice-create-from-extraction.service.spec.ts +39 -50
  118. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/purchase-invoice-extraction/business-partner-portal-purchase-invoice-create-from-extraction.service.ts +7 -1
  119. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/purchase-invoice-extraction/business-partner-portal-purchase-invoice-extraction-completion.service.spec.ts +2 -5
  120. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/purchase-invoice-extraction/business-partner-portal-purchase-invoice-extraction-completion.service.ts +6 -8
  121. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/purchase-invoice-extraction/business-partner-portal-purchase-invoice-extraction-routing.service.spec.ts +19 -51
  122. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/purchase-invoice-extraction/business-partner-portal-purchase-invoice-extraction-routing.service.ts +9 -41
  123. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/purchase-invoice-extraction/index.ts +1 -0
  124. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/purchase-invoice-identification/business-partner-portal-supplier-issues-of.function.ts +0 -1
  125. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/purchase-invoice-processing/business-partner-portal-purchase-invoice-processing.service.spec.ts +39 -0
  126. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/purchase-invoice-processing/business-partner-portal-purchase-invoice-processing.service.ts +17 -0
  127. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/purchase-invoice-sending/business-partner-portal-purchase-invoice-send-payload.service.ts +1 -1
  128. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/purchase-invoice-tax-validation/business-partner-portal-purchase-invoice-tax-rules.function.spec.ts +24 -0
  129. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/purchase-invoice-tax-validation/business-partner-portal-purchase-invoice-tax-rules.function.ts +2 -4
  130. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/supplier-document/domain/business-partner-portal-supplier-document.field-schema.ts +0 -6
  131. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/supplier-document/infrastructure/drizzle/business-partner-portal-drizzle-supplier-document.schema.ts +0 -1
  132. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/supplier-document/shared/services/business-partner-portal-supplier-document-extraction.worker.spec.ts +149 -123
  133. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/supplier-document/shared/services/business-partner-portal-supplier-document-extraction.worker.ts +56 -90
  134. package/dist/templates/backend/packages/business-partner-portal/src/@config/bullmq/business-partner-portal-queue.module.ts +1 -1
  135. package/dist/templates/backend/packages/business-partner-portal/src/@config/business-partner-portal/business-partner-portal.providers.spec.ts +21 -21
  136. package/dist/templates/backend/packages/business-partner-portal/src/@config/business-partner-portal/business-partner-portal.providers.ts +7 -7
  137. package/dist/templates/backend/packages/business-partner-portal/test/acceptance/business-partner-portal/purchase-invoice-download-supplier-document.e2e-spec.ts +0 -1
  138. package/dist/templates/backend/packages/business-partner-portal/test/acceptance/business-partner-portal/purchase-invoice-header-state-machine.e2e-spec.ts +0 -1
  139. package/dist/templates/backend/packages/business-partner-portal/test/acceptance/business-partner-portal/purchase-invoice-processing-claim.e2e-spec.ts +0 -1
  140. package/dist/templates/backend/packages/business-partner-portal/test/acceptance/business-partner-portal/purchase-invoice-report-erp-status.e2e-spec.ts +0 -1
  141. package/dist/templates/backend/packages/business-partner-portal/test/acceptance/business-partner-portal/purchase-invoice-review.e2e-spec.ts +54 -1
  142. package/dist/templates/backend/packages/business-partner-portal/test/acceptance/business-partner-portal/purchase-invoice-trace.e2e-spec.ts +0 -1
  143. package/dist/templates/backend/packages/identity/package.yaml +1 -0
  144. package/dist/templates/backend/packages/identity/test/acceptance/authentication/authentication-access-token.fixture.ts +80 -0
  145. package/dist/templates/frontend/packages/business-partner-portal/package.yaml +0 -2
  146. package/dist/templates/frontend/packages/business-partner-portal/public/i18n/business-partner-portal/en.json +14 -3
  147. package/dist/templates/frontend/packages/business-partner-portal/public/i18n/business-partner-portal/es.json +14 -3
  148. package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-header/data-access/purchase-invoice-header.graphql.ts +1 -2
  149. package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-header/data-access/purchase-invoice-review.derive.spec.ts +56 -0
  150. package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-header/data-access/purchase-invoice-review.derive.ts +38 -1
  151. package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-header/features/purchase-invoice-header-form.component.spec.ts +192 -12
  152. package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-header/features/purchase-invoice-header-form.component.ts +121 -14
  153. package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-header/features/purchase-invoice-header-supplier-document.view.spec.ts +1 -1
  154. package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-header/purchase-invoice-header.columns.ts +0 -12
  155. package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-position/data-access/purchase-invoice-position.graphql.ts +0 -1
  156. package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-position-tax/data-access/purchase-invoice-position-tax.graphql.ts +0 -1
  157. package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-tax-breakdown/data-access/purchase-invoice-tax-breakdown.graphql.ts +0 -1
  158. package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-trace/data-access/purchase-invoice-trace.graphql.ts +0 -1
  159. package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/supplier-document/data-access/supplier-document.graphql.ts +0 -2
  160. package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/supplier-document/features/supplier-document-form.component.ts +0 -19
  161. package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/supplier-document/supplier-document.columns.ts +0 -12
  162. package/dist/templates/frontend/packages/identity/package.yaml +1 -0
  163. package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/tools.navigation.ts +7 -7
  164. package/oclif.manifest.json +111 -111
  165. package/package.json +1 -1
  166. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/azure/index.ts +0 -2
  167. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/azure/infrastructure/business-partner-portal-azure-invoice-ocr.service.spec.ts +0 -259
  168. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/azure/infrastructure/business-partner-portal-azure-invoice-ocr.service.ts +0 -86
  169. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/azure/infrastructure/index.ts +0 -1
  170. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/azure/shared/functions/business-partner-portal-azure-classify-invoice.function.spec.ts +0 -99
  171. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/azure/shared/functions/business-partner-portal-azure-classify-invoice.function.ts +0 -23
  172. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/azure/shared/functions/business-partner-portal-azure-map-invoice-result.function.spec.ts +0 -670
  173. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/azure/shared/functions/business-partner-portal-azure-map-invoice-result.function.ts +0 -243
  174. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/azure/shared/functions/business-partner-portal-azure-tax-id-from-content.function.spec.ts +0 -64
  175. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/azure/shared/functions/business-partner-portal-azure-tax-id-from-content.function.ts +0 -41
  176. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/azure/shared/functions/business-partner-portal-resolve-azure-document-intelligence-credentials.function.spec.ts +0 -76
  177. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/azure/shared/functions/business-partner-portal-resolve-azure-document-intelligence-credentials.function.ts +0 -26
  178. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/azure/shared/functions/index.ts +0 -4
  179. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/azure/shared/index.ts +0 -2
  180. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/azure/shared/types/business-partner-portal-azure-analyze-result.types.ts +0 -58
  181. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/azure/shared/types/index.ts +0 -1
  182. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/business-partner-portal-azure-sdk-isolation.spec.ts +0 -22
  183. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-find-doubt-causing-fields.function.spec.ts +0 -60
  184. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-find-doubt-causing-fields.function.ts +0 -35
  185. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-is-doubt-unresolved.function.spec.ts +0 -86
  186. package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-is-doubt-unresolved.function.ts +0 -38
@@ -233,6 +233,13 @@ export class BusinessPartnerPortalPurchaseInvoiceHeaderDto {
233
233
  })
234
234
  isDuplicateForced: boolean;
235
235
 
236
+ @ApiProperty({
237
+ type: Boolean,
238
+ description:
239
+ 'True once a person accepted the review of an invoice the extraction found doubtful, closing the doubt for good. While it is false and the source document is classified DOUBTFUL the invoice is doubtful: it always ends in IN_REVIEW with DOUBTFUL_DOCUMENT and is never resolved by the business rules table. With it true, no later return to the flow asks for the doubt review again or puts DOUBTFUL_DOCUMENT back. readOnly: no generic create or update can write it, only the accept-review operation sets it, in the same movement that leaves IN_REVIEW. Defaults to false.',
240
+ })
241
+ isDoubtResolved: boolean;
242
+
236
243
  @ApiProperty({
237
244
  type: Array,
238
245
  description:
@@ -250,7 +257,7 @@ export class BusinessPartnerPortalPurchaseInvoiceHeaderDto {
250
257
  @ApiProperty({
251
258
  type: Number,
252
259
  description:
253
- 'Sum of all line items before taxes and discounts. Calculated automatically from invoice lines (sum of line subtotals). Stored in the invoice currency. Required field, defaults to 0.00 for new invoices. Used as base for tax calculations and for expense categorization. Represents the gross cost of goods/services received.',
260
+ 'Taxable base of the invoice, after any discount or commission: the sum of the net amount (positionTotal) of the lines that carry no pass-through tax. A global discount or commission is a line of its own with a negative amount, so it lowers this sum; the header has no discount field. Calculated by the server in the review (the client never sends it) and, on extraction, read from the document. Stored in the invoice currency. Required field, defaults to 0.00 for new invoices. Base for the tax calculations.',
254
261
  })
255
262
  subtotal: number;
256
263
 
@@ -271,14 +278,7 @@ export class BusinessPartnerPortalPurchaseInvoiceHeaderDto {
271
278
  @ApiProperty({
272
279
  type: Number,
273
280
  description:
274
- 'Total discount amount applied by the supplier. Can include line-level discounts and invoice-level discounts (early payment, volume, promotional). Stored in the invoice currency. Required field, defaults to 0.00. Reduces the total amount owed to supplier. Important for cost analysis and supplier performance evaluation.',
275
- })
276
- discountAmount: number;
277
-
278
- @ApiProperty({
279
- type: Number,
280
- description:
281
- 'Final total amount owed to the supplier. Calculated as: subtotal + taxAmount - discountAmount. Stored in the invoice currency. Required field, defaults to 0.00. This is the amount we must pay. Used in accounts payable, payment processing, cash flow planning, and expense reporting. Indexed for filtering and sorting.',
281
+ 'Total the invoice charges, which is the amount we must pay: subtotal + taxAmount, where taxAmount adds each tax breakdown row with its sign (a credit line contributes negatively and its withholding positively) and a pass-through row adds its base as is. A discount or commission is already a negative line inside subtotal and its tax, so nothing else is subtracted. Calculated by the server in the review; on extraction, read from the document. Stored in the invoice currency. Required field, defaults to 0.00. Used in accounts payable, payment processing, cash flow planning, and expense reporting. Indexed for filtering and sorting.',
282
282
  })
283
283
  totalAmount: number;
284
284
 
@@ -376,7 +376,7 @@ export class BusinessPartnerPortalPurchaseInvoiceHeaderDto {
376
376
  @ApiProperty({
377
377
  type: Object,
378
378
  description:
379
- "Structured snapshot of what the extraction pipeline read from the document, with the shape { header, positions[], taxBreakdowns[], extraFields[] } in Aurora field names (each position carries its taxes). Each of those rows (the header, every position, every position tax and every tax breakdown) also carries a sibling `confidence` object with one key per value of the row: the OCR confidence (0 to 1) of a value copied from the OCR, or null when the OCR gave none or the value was computed, deduced or set without reading it. `extraFields` lists the extra fields the OCR returned, each as { name (the custom field key), value as read, confidence as given by the provider }, an empty list when there were none; it is absent from snapshots written before it existed, which read as having no step 1 value for any custom field. A value the second extraction step replaces is updated here with a null confidence, since a model answer is not an OCR confidence, and a header custom field it fills gets a new `extraFields` entry. Written only by the pipeline, in the same transaction that creates the invoice, and never by the human review (readOnly: no generic create or update can write it). It is a deliberate snapshot: it is never synchronized with later edits, so it keeps what was read after the reviewer corrects the invoice. Distinct from supplier-document.ocrData, the write-once raw OCR response, and from meta, the fallback for non-standard fields. The review screen reads it to compare the tax identification number read with the supplier master's. NULL for invoices extracted before this column existed or not created by the pipeline.",
379
+ "Structured snapshot of what the extraction pipeline read from the document, with the shape { header, positions[], taxBreakdowns[], extraFields[], doubt, readings[], stepTwo } in Aurora field names (each position carries its taxes). It carries no confidence of any kind. `extraFields` lists the extra fields the model returned, each as { name (the custom field key), value as read }, an empty list when there were none; it is absent from snapshots written before it existed, which read as having no step 1 value for any custom field. `doubt` is { reasons[], review }: `reasons` are the doubts the extraction found (MODEL_NEEDS_REVIEW, KEY_FIELD_MISSING, TOTALS_MISMATCH and, after step 2, OPERATION_INVALID and NOT_RECONCILED) and `review` is null until step 2 reviews a doubtful invoice, then holds its actions, whether it reconciled and why a person still has to look. `readings` has one entry per model reading { step, model, promptVersion, replacedFields }: the first one is step 1. `stepTwo` is { requested[] }: the profile field requests the successful step 2 runs made, each as { scope, origin, code, dictionaryContext, profileContext, admittedValues }, so a later run asks the model only for a request that is not in the list; it is absent until a run asks a profile field. A value the second extraction step replaces is updated here, and a header custom field it fills gets a new `extraFields` entry. Written only by the pipeline, in the same transaction that creates the invoice and by the later pipeline steps, and never by the human review (readOnly: no generic create or update can write it). It is a deliberate snapshot: it is never synchronized with later edits, so it keeps what was read after the reviewer corrects the invoice. Distinct from supplier-document.ocrData, the write-once raw model response, and from meta, the fallback for non-standard fields. The review screen reads it to compare the tax identification number read with the supplier master's and to show the doubt. NULL for invoices extracted before this column existed or not created by the pipeline.",
380
380
  })
381
381
  extractedData?: any;
382
382
 
@@ -161,7 +161,7 @@ export class BusinessPartnerPortalUpdatePurchaseInvoiceHeaderByIdDto {
161
161
  @ApiProperty({
162
162
  type: Number,
163
163
  description:
164
- 'Sum of all line items before taxes and discounts. Calculated automatically from invoice lines (sum of line subtotals). Stored in the invoice currency. Required field, defaults to 0.00 for new invoices. Used as base for tax calculations and for expense categorization. Represents the gross cost of goods/services received.',
164
+ 'Taxable base of the invoice, after any discount or commission: the sum of the net amount (positionTotal) of the lines that carry no pass-through tax. A global discount or commission is a line of its own with a negative amount, so it lowers this sum; the header has no discount field. Calculated by the server in the review (the client never sends it) and, on extraction, read from the document. Stored in the invoice currency. Required field, defaults to 0.00 for new invoices. Base for the tax calculations.',
165
165
  })
166
166
  subtotal?: number;
167
167
 
@@ -182,14 +182,7 @@ export class BusinessPartnerPortalUpdatePurchaseInvoiceHeaderByIdDto {
182
182
  @ApiProperty({
183
183
  type: Number,
184
184
  description:
185
- 'Total discount amount applied by the supplier. Can include line-level discounts and invoice-level discounts (early payment, volume, promotional). Stored in the invoice currency. Required field, defaults to 0.00. Reduces the total amount owed to supplier. Important for cost analysis and supplier performance evaluation.',
186
- })
187
- discountAmount?: number;
188
-
189
- @ApiProperty({
190
- type: Number,
191
- description:
192
- 'Final total amount owed to the supplier. Calculated as: subtotal + taxAmount - discountAmount. Stored in the invoice currency. Required field, defaults to 0.00. This is the amount we must pay. Used in accounts payable, payment processing, cash flow planning, and expense reporting. Indexed for filtering and sorting.',
185
+ 'Total the invoice charges, which is the amount we must pay: subtotal + taxAmount, where taxAmount adds each tax breakdown row with its sign (a credit line contributes negatively and its withholding positively) and a pass-through row adds its base as is. A discount or commission is already a negative line inside subtotal and its tax, so nothing else is subtracted. Calculated by the server in the review; on extraction, read from the document. Stored in the invoice currency. Required field, defaults to 0.00. Used in accounts payable, payment processing, cash flow planning, and expense reporting. Indexed for filtering and sorting.',
193
186
  })
194
187
  totalAmount?: number;
195
188
 
@@ -160,7 +160,7 @@ export class BusinessPartnerPortalUpdatePurchaseInvoiceHeadersDto {
160
160
  @ApiProperty({
161
161
  type: Number,
162
162
  description:
163
- 'Sum of all line items before taxes and discounts. Calculated automatically from invoice lines (sum of line subtotals). Stored in the invoice currency. Required field, defaults to 0.00 for new invoices. Used as base for tax calculations and for expense categorization. Represents the gross cost of goods/services received.',
163
+ 'Taxable base of the invoice, after any discount or commission: the sum of the net amount (positionTotal) of the lines that carry no pass-through tax. A global discount or commission is a line of its own with a negative amount, so it lowers this sum; the header has no discount field. Calculated by the server in the review (the client never sends it) and, on extraction, read from the document. Stored in the invoice currency. Required field, defaults to 0.00 for new invoices. Base for the tax calculations.',
164
164
  })
165
165
  subtotal?: number;
166
166
 
@@ -181,14 +181,7 @@ export class BusinessPartnerPortalUpdatePurchaseInvoiceHeadersDto {
181
181
  @ApiProperty({
182
182
  type: Number,
183
183
  description:
184
- 'Total discount amount applied by the supplier. Can include line-level discounts and invoice-level discounts (early payment, volume, promotional). Stored in the invoice currency. Required field, defaults to 0.00. Reduces the total amount owed to supplier. Important for cost analysis and supplier performance evaluation.',
185
- })
186
- discountAmount?: number;
187
-
188
- @ApiProperty({
189
- type: Number,
190
- description:
191
- 'Final total amount owed to the supplier. Calculated as: subtotal + taxAmount - discountAmount. Stored in the invoice currency. Required field, defaults to 0.00. This is the amount we must pay. Used in accounts payable, payment processing, cash flow planning, and expense reporting. Indexed for filtering and sorting.',
184
+ 'Total the invoice charges, which is the amount we must pay: subtotal + taxAmount, where taxAmount adds each tax breakdown row with its sign (a credit line contributes negatively and its withholding positively) and a pass-through row adds its base as is. A discount or commission is already a negative line inside subtotal and its tax, so nothing else is subtracted. Calculated by the server in the review; on extraction, read from the document. Stored in the invoice currency. Required field, defaults to 0.00. Used in accounts payable, payment processing, cash flow planning, and expense reporting. Indexed for filtering and sorting.',
192
185
  })
193
186
  totalAmount?: number;
194
187
 
@@ -129,6 +129,10 @@ type BusinessPartnerPortalPurchaseInvoiceHeader {
129
129
  """
130
130
  isDuplicateForced: GraphQLBoolean!
131
131
  """
132
+ True once a person accepted the review of an invoice the extraction found doubtful, closing the doubt for good. While it is false and the source document is classified DOUBTFUL the invoice is doubtful: it always ends in IN_REVIEW with DOUBTFUL_DOCUMENT and is never resolved by the business rules table. With it true, no later return to the flow asks for the doubt review again or puts DOUBTFUL_DOCUMENT back. readOnly: no generic create or update can write it, only the accept-review operation sets it, in the same movement that leaves IN_REVIEW. Defaults to false.
133
+ """
134
+ isDoubtResolved: GraphQLBoolean!
135
+ """
132
136
  Reasons why the invoice is in its current state, one code per reason; the state (stateId) says where the invoice is, the issues say why. Each code belongs to one state: IN_REVIEW (SUPPLIER_TIN_MISMATCH, CUSTOMER_TIN_WITHOUT_LEGAL_ENTITY, SEVERAL_SUPPLIERS, REQUIRED_FIELDS_MISSING, TAX_ERROR, DOUBTFUL_DOCUMENT, EXTRACTION_FAILED, EXTENDING_FAILED, RULE_REVIEW, WITHOUT_SUPPLIER, DUPLICATED), BLOCKED (HELD), SENT (ARCHIVE_FAILED) and ERROR (TIMEOUT, SEND_ERP_ERROR). Each check of the flow sets and clears its own codes; DOUBTFUL_DOCUMENT, EXTRACTION_FAILED and EXTENDING_FAILED are cleared only by a person with the manual transition to EXTRACTED (which also clears TIMEOUT and SEND_ERP_ERROR when it leaves ERROR) or, for EXTENDING_FAILED, with the manual repeat IN_REVIEW -> EXTENDING. readOnly: only the portal code writes it, with typed constants. Filter with { issues: { contains: [...] } }. Empty list by default.
133
137
  """
134
138
  issues: [GraphQLString!]!
@@ -137,7 +141,7 @@ type BusinessPartnerPortalPurchaseInvoiceHeader {
137
141
  """
138
142
  stepTwoDiscrepancies: JSON!
139
143
  """
140
- Sum of all line items before taxes and discounts. Calculated automatically from invoice lines (sum of line subtotals). Stored in the invoice currency. Required field, defaults to 0.00 for new invoices. Used as base for tax calculations and for expense categorization. Represents the gross cost of goods/services received.
144
+ Taxable base of the invoice, after any discount or commission: the sum of the net amount (positionTotal) of the lines that carry no pass-through tax. A global discount or commission is a line of its own with a negative amount, so it lowers this sum; the header has no discount field. Calculated by the server in the review (the client never sends it) and, on extraction, read from the document. Stored in the invoice currency. Required field, defaults to 0.00 for new invoices. Base for the tax calculations.
141
145
  """
142
146
  subtotal: GraphQLFloat!
143
147
  """
@@ -149,11 +153,7 @@ type BusinessPartnerPortalPurchaseInvoiceHeader {
149
153
  """
150
154
  hasManualTaxAmounts: GraphQLBoolean!
151
155
  """
152
- Total discount amount applied by the supplier. Can include line-level discounts and invoice-level discounts (early payment, volume, promotional). Stored in the invoice currency. Required field, defaults to 0.00. Reduces the total amount owed to supplier. Important for cost analysis and supplier performance evaluation.
153
- """
154
- discountAmount: GraphQLFloat!
155
- """
156
- Final total amount owed to the supplier. Calculated as: subtotal + taxAmount - discountAmount. Stored in the invoice currency. Required field, defaults to 0.00. This is the amount we must pay. Used in accounts payable, payment processing, cash flow planning, and expense reporting. Indexed for filtering and sorting.
156
+ Total the invoice charges, which is the amount we must pay: subtotal + taxAmount, where taxAmount adds each tax breakdown row with its sign (a credit line contributes negatively and its withholding positively) and a pass-through row adds its base as is. A discount or commission is already a negative line inside subtotal and its tax, so nothing else is subtracted. Calculated by the server in the review; on extraction, read from the document. Stored in the invoice currency. Required field, defaults to 0.00. Used in accounts payable, payment processing, cash flow planning, and expense reporting. Indexed for filtering and sorting.
157
157
  """
158
158
  totalAmount: GraphQLFloat!
159
159
  """
@@ -206,7 +206,7 @@ type BusinessPartnerPortalPurchaseInvoiceHeader {
206
206
  """
207
207
  supplierDocument: BusinessPartnerPortalSupplierDocument
208
208
  """
209
- Structured snapshot of what the extraction pipeline read from the document, with the shape { header, positions[], taxBreakdowns[], extraFields[] } in Aurora field names (each position carries its taxes). Each of those rows (the header, every position, every position tax and every tax breakdown) also carries a sibling `confidence` object with one key per value of the row: the OCR confidence (0 to 1) of a value copied from the OCR, or null when the OCR gave none or the value was computed, deduced or set without reading it. `extraFields` lists the extra fields the OCR returned, each as { name (the custom field key), value as read, confidence as given by the provider }, an empty list when there were none; it is absent from snapshots written before it existed, which read as having no step 1 value for any custom field. A value the second extraction step replaces is updated here with a null confidence, since a model answer is not an OCR confidence, and a header custom field it fills gets a new `extraFields` entry. Written only by the pipeline, in the same transaction that creates the invoice, and never by the human review (readOnly: no generic create or update can write it). It is a deliberate snapshot: it is never synchronized with later edits, so it keeps what was read after the reviewer corrects the invoice. Distinct from supplier-document.ocrData, the write-once raw OCR response, and from meta, the fallback for non-standard fields. The review screen reads it to compare the tax identification number read with the supplier master's. NULL for invoices extracted before this column existed or not created by the pipeline.
209
+ Structured snapshot of what the extraction pipeline read from the document, with the shape { header, positions[], taxBreakdowns[], extraFields[], doubt, readings[], stepTwo } in Aurora field names (each position carries its taxes). It carries no confidence of any kind. `extraFields` lists the extra fields the model returned, each as { name (the custom field key), value as read }, an empty list when there were none; it is absent from snapshots written before it existed, which read as having no step 1 value for any custom field. `doubt` is { reasons[], review }: `reasons` are the doubts the extraction found (MODEL_NEEDS_REVIEW, KEY_FIELD_MISSING, TOTALS_MISMATCH and, after step 2, OPERATION_INVALID and NOT_RECONCILED) and `review` is null until step 2 reviews a doubtful invoice, then holds its actions, whether it reconciled and why a person still has to look. `readings` has one entry per model reading { step, model, promptVersion, replacedFields }: the first one is step 1. `stepTwo` is { requested[] }: the profile field requests the successful step 2 runs made, each as { scope, origin, code, dictionaryContext, profileContext, admittedValues }, so a later run asks the model only for a request that is not in the list; it is absent until a run asks a profile field. A value the second extraction step replaces is updated here, and a header custom field it fills gets a new `extraFields` entry. Written only by the pipeline, in the same transaction that creates the invoice and by the later pipeline steps, and never by the human review (readOnly: no generic create or update can write it). It is a deliberate snapshot: it is never synchronized with later edits, so it keeps what was read after the reviewer corrects the invoice. Distinct from supplier-document.ocrData, the write-once raw model response, and from meta, the fallback for non-standard fields. The review screen reads it to compare the tax identification number read with the supplier master's and to show the doubt. NULL for invoices extracted before this column existed or not created by the pipeline.
210
210
  """
211
211
  extractedData: JSON
212
212
  """
@@ -273,7 +273,6 @@ input BusinessPartnerPortalCreatePurchaseInvoiceHeaderInput {
273
273
  subtotal: GraphQLFloat!
274
274
  taxAmount: GraphQLFloat!
275
275
  hasManualTaxAmounts: GraphQLBoolean!
276
- discountAmount: GraphQLFloat!
277
276
  totalAmount: GraphQLFloat!
278
277
  paidAmount: GraphQLFloat!
279
278
  currencyCode: GraphQLString
@@ -312,7 +311,6 @@ input BusinessPartnerPortalUpdatePurchaseInvoiceHeaderByIdInput {
312
311
  subtotal: GraphQLFloat
313
312
  taxAmount: GraphQLFloat
314
313
  hasManualTaxAmounts: GraphQLBoolean
315
- discountAmount: GraphQLFloat
316
314
  totalAmount: GraphQLFloat
317
315
  paidAmount: GraphQLFloat
318
316
  currencyCode: GraphQLString
@@ -513,10 +511,11 @@ type BusinessPartnerPortalPurchaseInvoiceHeaderPreviewUnassignedReadTaxBreakdown
513
511
  """
514
512
  The findings the review derivation can emit. The first six keep the name of the trace event type
515
513
  that records the same finding when the pipeline writes it; UNASSIGNED_READ_TAX_BREAKDOWN and
516
- LEGAL_ENTITY_TIN_MISMATCH and DOUBTFUL_FIELD are findings that exist only in the preview: some read
517
- breakdown rows are explained by no derived row, the customer tax id read differs from the one of the
518
- legal entity, and a key field of a doubtful document was read under the doubt threshold (its detail
519
- carries the field and its confidence).
514
+ LEGAL_ENTITY_TIN_MISMATCH, DOUBT_REASON and DOUBT_ACTION are findings that exist only in the preview:
515
+ some read breakdown rows are explained by no derived row, the customer tax id read differs from the
516
+ one of the legal entity, each reason the invoice is doubtful carries a DOUBT_REASON (its detail has
517
+ the reason code and its figures) and each action of the step 2 doubt review a DOUBT_ACTION (its
518
+ detail has the field, the kind, the values, the literal evidence, the explanation and the operation).
520
519
  """
521
520
  enum BusinessPartnerPortalPurchaseInvoiceReviewWarningCodeEnum {
522
521
  TAX_UNMATCHED
@@ -527,7 +526,8 @@ enum BusinessPartnerPortalPurchaseInvoiceReviewWarningCodeEnum {
527
526
  CUSTOMER_TIN_WITHOUT_LEGAL_ENTITY
528
527
  UNASSIGNED_READ_TAX_BREAKDOWN
529
528
  LEGAL_ENTITY_TIN_MISMATCH
530
- DOUBTFUL_FIELD
529
+ DOUBT_REASON
530
+ DOUBT_ACTION
531
531
  }
532
532
 
533
533
  """
@@ -614,7 +614,6 @@ input BusinessPartnerPortalUpdatePurchaseInvoiceHeadersInput {
614
614
  subtotal: GraphQLFloat
615
615
  taxAmount: GraphQLFloat
616
616
  hasManualTaxAmounts: GraphQLBoolean
617
- discountAmount: GraphQLFloat
618
617
  totalAmount: GraphQLFloat
619
618
  paidAmount: GraphQLFloat
620
619
  currencyCode: GraphQLString
@@ -61,7 +61,7 @@ export class BusinessPartnerPortalPurchaseInvoiceTraceDto {
61
61
  @ApiProperty({
62
62
  type: Object,
63
63
  description:
64
- 'Content of the event, whose shape depends on eventType. For RULE_ACTION it holds the rule (ruleId, ruleName, priority), the action (actionId, actionTypeCode, sort, parameters) and its result (status, output, error). For EXTRACTION_HANDLER_ERROR it holds the event name and the error (name, message). For SUPPLIER_DATA_COPIED and LEGAL_ENTITY_DATA_COPIED it holds the origin of the copy (IDENTIFICATION, MANUAL_ASSIGNMENT or RE_IDENTIFICATION), the id of the master (businessPartnerId or legalEntityId) and the written fields (fields: name, previous value, new value). For SUPPLIER_TIN_MISMATCH it holds readTin (the tax id read from the document) and supplierTin (the tax id of the assigned supplier, null when the master has none). For CUSTOMER_TIN_WITHOUT_LEGAL_ENTITY it holds readTin (the customer tax id read, null when none was read). For SUPPLIER_NAME_TIEBREAK it holds readName (the supplier name read, null when none was read), candidates (one entry per supplier that shares the tax id: id, name and score, the share of the words of the shorter name found in the other one, from 0 to 1) and winnerId (the supplier assigned, null when no candidate won clearly and the invoice stays with several suppliers). For TAX_UNMATCHED, TAX_AMBIGUOUS and TAX_AMOUNT_MISMATCH it holds rowKind (POSITION_TAX or TAX_BREAKDOWN), rowId (id of the tax row) and percentage (as read); TAX_UNMATCHED adds sent (true when the legal entity sends invoices with unmatched taxes, so the invoice did not go to review for this row); TAX_AMBIGUOUS adds candidateCodes (codes of the catalog taxes that match); TAX_AMOUNT_MISMATCH adds base, expectedAmount, readAmount and tolerance. For TOTAL_AMOUNT_MISMATCH it holds check (LINES_VS_SUBTOTAL or TOTAL), expectedAmount, readAmount and tolerance. For LINE_AMOUNTS_TAX_INCLUSIVE_CONVERTED it holds subtotal and total (as read from the document), tolerance (the largest difference that counted as equal when the sum of the lines was compared with them) and lines (positionNumber, before: the amount as read, after: the stored net amount; both null for a line without amount). For TAX_RATE_DEDUCED it holds subtotal, taxAmount and total (as read from the document), tolerance (the largest difference that counted as equal when subtotal plus tax amount were compared with the total) and percentage (the deduced one). For PDF_FORWARD_FAILED it holds recipients (the mailboxes the forward was meant for) and cause (the message of the failure). For EXTRACTION_HANDLER_ERROR it also holds step when the failing part is not a listener of the extracted event: EXTRACTION_STEP_TWO (the step 2 job failed for good, with its attempts exhausted or an unrecoverable answer), EXTRACTION_STEP_TWO_ENQUEUE (the step 2 job could not be enqueued) or EXTRACTION_STEP_TWO_CUSTOM_FIELD_VALUES (the value store rejected the custom values step 2 wrote); the step 2 steps carry no event name and hold step and error. For EXTRACTION_STEP_TWO_REQUESTED it holds outcome (the resolve result of the pass: invoiceId, legalEntityId, the supplier status and tin mismatch, the legal entity status and the customer tax id read), isSupplierAssociated (true when an identification rule assigned the supplier) and reasons (one entry per field step 2 reads: kind PROFILE_FIELD when the effective profile declares the field, LOW_CONFIDENCE when a dictionary field holding a value has a step 1 confidence under the threshold, plus scope, origin FIXED or CUSTOM and code and, for LOW_CONFIDENCE, confidence: the lowest step 1 confidence of the field; a field can have both). For EXTRACTION_STEP_TWO_FIELDS_READ it holds fields (one entry per requested header field and per requested line field and stored position: scope HEADER or LINE, origin FIXED or CUSTOM, code, positionId and positionNumber (both null for a header field), stepOneValue and stepOneConfidence as stored by step 1, stepTwoValue as the model answered it, typed (the option codes for a choice field), or the raw answer when it could not be read as the field type, discardedValues (the codes of a multiple-choice answer that matched no active option), outcome REPLACED, KEPT_HUMAN_CORRECTION, NOT_FOUND or EQUAL, and isDiscrepant, true only when both values exist and differ) and droppedLines (the answers for a positionNumber the invoice does not have: positionNumber, code and value as answered). For REQUIRED_EXTRACTION_FIELDS_MISSING it holds missing (one entry per required field without value: scope HEADER or LINE, origin FIXED or CUSTOM, code and positionNumbers, the ascending positions that lack the value for a LINE field and null for a header field). For SENT_TO_ERP it holds externalId (the acknowledgement id the adapter returned, stored in the invoice externalId too) and messages (the non-error messages the ERP answered, when there are any). For SEND_FAILED it holds kind (TRANSPORT when a retry could help, REJECTED when the ERP refused the invoice or it cannot be sent, ENQUEUE when the send job could not be enqueued), httpStatus (when the failure has one), messages (the messages the ERP answered, each with messageType and message, when there are any) and error (name and message of the failure, never headers or credentials). For ARCHIVED it holds remotePath (where the archive stored the file). For ARCHIVE_FAILED it holds kind (CONFIGURATION when the legal entity archive configuration is incomplete or its credentials are rejected, TRANSPORT when a retry could help and the attempts ran out, DATA when the invoice lacks what its archive path needs (invoice date, supplier or legal entity external id) or its stored document file, ENQUEUE when the archive job could not be enqueued), code (the archive port error code, when the failure has one) and error (name and message of the failure, never credentials). For RULE_ACTION it is stored as a snapshot of what the rules engine reported, so the trace stays readable after the rule or the action is edited or deleted.',
64
+ 'Content of the event, whose shape depends on eventType. For RULE_ACTION it holds the rule (ruleId, ruleName, priority), the action (actionId, actionTypeCode, sort, parameters) and its result (status, output, error). For EXTRACTION_HANDLER_ERROR it holds the event name and the error (name, message). For SUPPLIER_DATA_COPIED and LEGAL_ENTITY_DATA_COPIED it holds the origin of the copy (IDENTIFICATION, MANUAL_ASSIGNMENT or RE_IDENTIFICATION), the id of the master (businessPartnerId or legalEntityId) and the written fields (fields: name, previous value, new value). For SUPPLIER_TIN_MISMATCH it holds readTin (the tax id read from the document) and supplierTin (the tax id of the assigned supplier, null when the master has none). For CUSTOMER_TIN_WITHOUT_LEGAL_ENTITY it holds readTin (the customer tax id read, null when none was read). For SUPPLIER_NAME_TIEBREAK it holds readName (the supplier name read, null when none was read), candidates (one entry per supplier that shares the tax id: id, name and score, the share of the words of the shorter name found in the other one, from 0 to 1) and winnerId (the supplier assigned, null when no candidate won clearly and the invoice stays with several suppliers). For TAX_UNMATCHED, TAX_AMBIGUOUS and TAX_AMOUNT_MISMATCH it holds rowKind (POSITION_TAX or TAX_BREAKDOWN), rowId (id of the tax row) and percentage (as read); TAX_UNMATCHED adds sent (true when the legal entity sends invoices with unmatched taxes, so the invoice did not go to review for this row); TAX_AMBIGUOUS adds candidateCodes (codes of the catalog taxes that match); TAX_AMOUNT_MISMATCH adds base, expectedAmount, readAmount and tolerance. For TOTAL_AMOUNT_MISMATCH it holds check (LINES_VS_SUBTOTAL or TOTAL), expectedAmount, readAmount and tolerance. For LINE_AMOUNTS_TAX_INCLUSIVE_CONVERTED it holds subtotal and total (as read from the document), tolerance (the largest difference that counted as equal when the sum of the lines was compared with them) and lines (positionNumber, before: the amount as read, after: the stored net amount; both null for a line without amount). For TAX_RATE_DEDUCED it holds subtotal, taxAmount and total (as read from the document), tolerance (the largest difference that counted as equal when subtotal plus tax amount were compared with the total) and percentage (the deduced one). For PDF_FORWARD_FAILED it holds recipients (the mailboxes the forward was meant for) and cause (the message of the failure). For EXTRACTION_HANDLER_ERROR it also holds step when the failing part is not a listener of the extracted event: EXTRACTION_STEP_TWO (the step 2 job failed for good, with its attempts exhausted or an unrecoverable answer), EXTRACTION_STEP_TWO_ENQUEUE (the step 2 job could not be enqueued) or EXTRACTION_STEP_TWO_CUSTOM_FIELD_VALUES (the value store rejected the custom values step 2 wrote); the step 2 steps carry no event name and hold step and error. For EXTRACTION_STEP_TWO_REQUESTED it holds outcome (the resolve result of the pass: invoiceId, legalEntityId, the supplier status and tin mismatch, the legal entity status and the customer tax id read), isSupplierAssociated (true when an identification rule assigned the supplier) and reasons (one entry per field step 2 reads: kind PROFILE_FIELD, because the effective profile declares the field, plus scope, origin FIXED or CUSTOM and code). For EXTRACTION_STEP_TWO_FIELDS_READ it holds fields (one entry per requested header field and per requested line field and stored position: scope HEADER or LINE, origin FIXED or CUSTOM, code, positionId and positionNumber (both null for a header field), stepOneValue as stored by step 1, stepTwoValue as the model answered it, typed (the option codes for a choice field), or the raw answer when it could not be read as the field type, discardedValues (the codes of a multiple-choice answer that matched no active option), outcome REPLACED, KEPT_HUMAN_CORRECTION, NOT_FOUND or EQUAL, and isDiscrepant, true only when both values exist and differ), droppedLines (the answers for a positionNumber the invoice does not have: positionNumber, code and value as answered), taxBreakdowns (one entry per field of a stored tax breakdown row the doubt review set: breakdownId, breakdownNumber, code, stepOneValue, stepTwoValue as a number or null, outcome and isDiscrepant), droppedTaxBreakdowns (the answers for a breakdownNumber the invoice does not have: breakdownNumber, code and value as answered) and review (the doubt review of step 2, null when it did not run: actions, each with field, kind, from, to, evidence, explanation and operation, reconciled, humanReviewReason and rejected, the reasons of the actions whose operation the code rejected). For REQUIRED_EXTRACTION_FIELDS_MISSING it holds missing (one entry per required field without value: scope HEADER or LINE, origin FIXED or CUSTOM, code and positionNumbers, the ascending positions that lack the value for a LINE field and null for a header field). For SENT_TO_ERP it holds externalId (the acknowledgement id the adapter returned, stored in the invoice externalId too) and messages (the non-error messages the ERP answered, when there are any). For SEND_FAILED it holds kind (TRANSPORT when a retry could help, REJECTED when the ERP refused the invoice or it cannot be sent, ENQUEUE when the send job could not be enqueued), httpStatus (when the failure has one), messages (the messages the ERP answered, each with messageType and message, when there are any) and error (name and message of the failure, never headers or credentials). For ARCHIVED it holds remotePath (where the archive stored the file). For ARCHIVE_FAILED it holds kind (CONFIGURATION when the legal entity archive configuration is incomplete or its credentials are rejected, TRANSPORT when a retry could help and the attempts ran out, DATA when the invoice lacks what its archive path needs (invoice date, supplier or legal entity external id) or its stored document file, ENQUEUE when the archive job could not be enqueued), code (the archive port error code, when the failure has one) and error (name and message of the failure, never credentials). For RULE_ACTION it is stored as a snapshot of what the rules engine reported, so the trace stays readable after the rule or the action is edited or deleted.',
65
65
  })
66
66
  detail: any;
67
67
 
@@ -39,7 +39,7 @@ export class BusinessPartnerPortalUpdatePurchaseInvoiceTracesDto {
39
39
  @ApiProperty({
40
40
  type: Object,
41
41
  description:
42
- 'Content of the event, whose shape depends on eventType. For RULE_ACTION it holds the rule (ruleId, ruleName, priority), the action (actionId, actionTypeCode, sort, parameters) and its result (status, output, error). For EXTRACTION_HANDLER_ERROR it holds the event name and the error (name, message). For SUPPLIER_DATA_COPIED and LEGAL_ENTITY_DATA_COPIED it holds the origin of the copy (IDENTIFICATION, MANUAL_ASSIGNMENT or RE_IDENTIFICATION), the id of the master (businessPartnerId or legalEntityId) and the written fields (fields: name, previous value, new value). For SUPPLIER_TIN_MISMATCH it holds readTin (the tax id read from the document) and supplierTin (the tax id of the assigned supplier, null when the master has none). For CUSTOMER_TIN_WITHOUT_LEGAL_ENTITY it holds readTin (the customer tax id read, null when none was read). For SUPPLIER_NAME_TIEBREAK it holds readName (the supplier name read, null when none was read), candidates (one entry per supplier that shares the tax id: id, name and score, the share of the words of the shorter name found in the other one, from 0 to 1) and winnerId (the supplier assigned, null when no candidate won clearly and the invoice stays with several suppliers). For TAX_UNMATCHED, TAX_AMBIGUOUS and TAX_AMOUNT_MISMATCH it holds rowKind (POSITION_TAX or TAX_BREAKDOWN), rowId (id of the tax row) and percentage (as read); TAX_UNMATCHED adds sent (true when the legal entity sends invoices with unmatched taxes, so the invoice did not go to review for this row); TAX_AMBIGUOUS adds candidateCodes (codes of the catalog taxes that match); TAX_AMOUNT_MISMATCH adds base, expectedAmount, readAmount and tolerance. For TOTAL_AMOUNT_MISMATCH it holds check (LINES_VS_SUBTOTAL or TOTAL), expectedAmount, readAmount and tolerance. For LINE_AMOUNTS_TAX_INCLUSIVE_CONVERTED it holds subtotal and total (as read from the document), tolerance (the largest difference that counted as equal when the sum of the lines was compared with them) and lines (positionNumber, before: the amount as read, after: the stored net amount; both null for a line without amount). For TAX_RATE_DEDUCED it holds subtotal, taxAmount and total (as read from the document), tolerance (the largest difference that counted as equal when subtotal plus tax amount were compared with the total) and percentage (the deduced one). For PDF_FORWARD_FAILED it holds recipients (the mailboxes the forward was meant for) and cause (the message of the failure). For EXTRACTION_HANDLER_ERROR it also holds step when the failing part is not a listener of the extracted event: EXTRACTION_STEP_TWO (the step 2 job failed for good, with its attempts exhausted or an unrecoverable answer), EXTRACTION_STEP_TWO_ENQUEUE (the step 2 job could not be enqueued) or EXTRACTION_STEP_TWO_CUSTOM_FIELD_VALUES (the value store rejected the custom values step 2 wrote); the step 2 steps carry no event name and hold step and error. For EXTRACTION_STEP_TWO_REQUESTED it holds outcome (the resolve result of the pass: invoiceId, legalEntityId, the supplier status and tin mismatch, the legal entity status and the customer tax id read), isSupplierAssociated (true when an identification rule assigned the supplier) and reasons (one entry per field step 2 reads: kind PROFILE_FIELD when the effective profile declares the field, LOW_CONFIDENCE when a dictionary field holding a value has a step 1 confidence under the threshold, plus scope, origin FIXED or CUSTOM and code and, for LOW_CONFIDENCE, confidence: the lowest step 1 confidence of the field; a field can have both). For EXTRACTION_STEP_TWO_FIELDS_READ it holds fields (one entry per requested header field and per requested line field and stored position: scope HEADER or LINE, origin FIXED or CUSTOM, code, positionId and positionNumber (both null for a header field), stepOneValue and stepOneConfidence as stored by step 1, stepTwoValue as the model answered it, typed (the option codes for a choice field), or the raw answer when it could not be read as the field type, discardedValues (the codes of a multiple-choice answer that matched no active option), outcome REPLACED, KEPT_HUMAN_CORRECTION, NOT_FOUND or EQUAL, and isDiscrepant, true only when both values exist and differ) and droppedLines (the answers for a positionNumber the invoice does not have: positionNumber, code and value as answered). For REQUIRED_EXTRACTION_FIELDS_MISSING it holds missing (one entry per required field without value: scope HEADER or LINE, origin FIXED or CUSTOM, code and positionNumbers, the ascending positions that lack the value for a LINE field and null for a header field). For SENT_TO_ERP it holds externalId (the acknowledgement id the adapter returned, stored in the invoice externalId too) and messages (the non-error messages the ERP answered, when there are any). For SEND_FAILED it holds kind (TRANSPORT when a retry could help, REJECTED when the ERP refused the invoice or it cannot be sent, ENQUEUE when the send job could not be enqueued), httpStatus (when the failure has one), messages (the messages the ERP answered, each with messageType and message, when there are any) and error (name and message of the failure, never headers or credentials). For ARCHIVED it holds remotePath (where the archive stored the file). For ARCHIVE_FAILED it holds kind (CONFIGURATION when the legal entity archive configuration is incomplete or its credentials are rejected, TRANSPORT when a retry could help and the attempts ran out, DATA when the invoice lacks what its archive path needs (invoice date, supplier or legal entity external id) or its stored document file, ENQUEUE when the archive job could not be enqueued), code (the archive port error code, when the failure has one) and error (name and message of the failure, never credentials). For RULE_ACTION it is stored as a snapshot of what the rules engine reported, so the trace stays readable after the rule or the action is edited or deleted.',
42
+ 'Content of the event, whose shape depends on eventType. For RULE_ACTION it holds the rule (ruleId, ruleName, priority), the action (actionId, actionTypeCode, sort, parameters) and its result (status, output, error). For EXTRACTION_HANDLER_ERROR it holds the event name and the error (name, message). For SUPPLIER_DATA_COPIED and LEGAL_ENTITY_DATA_COPIED it holds the origin of the copy (IDENTIFICATION, MANUAL_ASSIGNMENT or RE_IDENTIFICATION), the id of the master (businessPartnerId or legalEntityId) and the written fields (fields: name, previous value, new value). For SUPPLIER_TIN_MISMATCH it holds readTin (the tax id read from the document) and supplierTin (the tax id of the assigned supplier, null when the master has none). For CUSTOMER_TIN_WITHOUT_LEGAL_ENTITY it holds readTin (the customer tax id read, null when none was read). For SUPPLIER_NAME_TIEBREAK it holds readName (the supplier name read, null when none was read), candidates (one entry per supplier that shares the tax id: id, name and score, the share of the words of the shorter name found in the other one, from 0 to 1) and winnerId (the supplier assigned, null when no candidate won clearly and the invoice stays with several suppliers). For TAX_UNMATCHED, TAX_AMBIGUOUS and TAX_AMOUNT_MISMATCH it holds rowKind (POSITION_TAX or TAX_BREAKDOWN), rowId (id of the tax row) and percentage (as read); TAX_UNMATCHED adds sent (true when the legal entity sends invoices with unmatched taxes, so the invoice did not go to review for this row); TAX_AMBIGUOUS adds candidateCodes (codes of the catalog taxes that match); TAX_AMOUNT_MISMATCH adds base, expectedAmount, readAmount and tolerance. For TOTAL_AMOUNT_MISMATCH it holds check (LINES_VS_SUBTOTAL or TOTAL), expectedAmount, readAmount and tolerance. For LINE_AMOUNTS_TAX_INCLUSIVE_CONVERTED it holds subtotal and total (as read from the document), tolerance (the largest difference that counted as equal when the sum of the lines was compared with them) and lines (positionNumber, before: the amount as read, after: the stored net amount; both null for a line without amount). For TAX_RATE_DEDUCED it holds subtotal, taxAmount and total (as read from the document), tolerance (the largest difference that counted as equal when subtotal plus tax amount were compared with the total) and percentage (the deduced one). For PDF_FORWARD_FAILED it holds recipients (the mailboxes the forward was meant for) and cause (the message of the failure). For EXTRACTION_HANDLER_ERROR it also holds step when the failing part is not a listener of the extracted event: EXTRACTION_STEP_TWO (the step 2 job failed for good, with its attempts exhausted or an unrecoverable answer), EXTRACTION_STEP_TWO_ENQUEUE (the step 2 job could not be enqueued) or EXTRACTION_STEP_TWO_CUSTOM_FIELD_VALUES (the value store rejected the custom values step 2 wrote); the step 2 steps carry no event name and hold step and error. For EXTRACTION_STEP_TWO_REQUESTED it holds outcome (the resolve result of the pass: invoiceId, legalEntityId, the supplier status and tin mismatch, the legal entity status and the customer tax id read), isSupplierAssociated (true when an identification rule assigned the supplier) and reasons (one entry per field step 2 reads: kind PROFILE_FIELD, because the effective profile declares the field, plus scope, origin FIXED or CUSTOM and code). For EXTRACTION_STEP_TWO_FIELDS_READ it holds fields (one entry per requested header field and per requested line field and stored position: scope HEADER or LINE, origin FIXED or CUSTOM, code, positionId and positionNumber (both null for a header field), stepOneValue as stored by step 1, stepTwoValue as the model answered it, typed (the option codes for a choice field), or the raw answer when it could not be read as the field type, discardedValues (the codes of a multiple-choice answer that matched no active option), outcome REPLACED, KEPT_HUMAN_CORRECTION, NOT_FOUND or EQUAL, and isDiscrepant, true only when both values exist and differ), droppedLines (the answers for a positionNumber the invoice does not have: positionNumber, code and value as answered), taxBreakdowns (one entry per field of a stored tax breakdown row the doubt review set: breakdownId, breakdownNumber, code, stepOneValue, stepTwoValue as a number or null, outcome and isDiscrepant), droppedTaxBreakdowns (the answers for a breakdownNumber the invoice does not have: breakdownNumber, code and value as answered) and review (the doubt review of step 2, null when it did not run: actions, each with field, kind, from, to, evidence, explanation and operation, reconciled, humanReviewReason and rejected, the reasons of the actions whose operation the code rejected). For REQUIRED_EXTRACTION_FIELDS_MISSING it holds missing (one entry per required field without value: scope HEADER or LINE, origin FIXED or CUSTOM, code and positionNumbers, the ascending positions that lack the value for a LINE field and null for a header field). For SENT_TO_ERP it holds externalId (the acknowledgement id the adapter returned, stored in the invoice externalId too) and messages (the non-error messages the ERP answered, when there are any). For SEND_FAILED it holds kind (TRANSPORT when a retry could help, REJECTED when the ERP refused the invoice or it cannot be sent, ENQUEUE when the send job could not be enqueued), httpStatus (when the failure has one), messages (the messages the ERP answered, each with messageType and message, when there are any) and error (name and message of the failure, never headers or credentials). For ARCHIVED it holds remotePath (where the archive stored the file). For ARCHIVE_FAILED it holds kind (CONFIGURATION when the legal entity archive configuration is incomplete or its credentials are rejected, TRANSPORT when a retry could help and the attempts ran out, DATA when the invoice lacks what its archive path needs (invoice date, supplier or legal entity external id) or its stored document file, ENQUEUE when the archive job could not be enqueued), code (the archive port error code, when the failure has one) and error (name and message of the failure, never credentials). For RULE_ACTION it is stored as a snapshot of what the rules engine reported, so the trace stays readable after the rule or the action is edited or deleted.',
43
43
  })
44
44
  detail?: any;
45
45
  }
@@ -48,7 +48,7 @@ type BusinessPartnerPortalPurchaseInvoiceTrace {
48
48
  accountId: ID
49
49
  account: IamAccount
50
50
  """
51
- Content of the event, whose shape depends on eventType. For RULE_ACTION it holds the rule (ruleId, ruleName, priority), the action (actionId, actionTypeCode, sort, parameters) and its result (status, output, error). For EXTRACTION_HANDLER_ERROR it holds the event name and the error (name, message). For SUPPLIER_DATA_COPIED and LEGAL_ENTITY_DATA_COPIED it holds the origin of the copy (IDENTIFICATION, MANUAL_ASSIGNMENT or RE_IDENTIFICATION), the id of the master (businessPartnerId or legalEntityId) and the written fields (fields: name, previous value, new value). For SUPPLIER_TIN_MISMATCH it holds readTin (the tax id read from the document) and supplierTin (the tax id of the assigned supplier, null when the master has none). For CUSTOMER_TIN_WITHOUT_LEGAL_ENTITY it holds readTin (the customer tax id read, null when none was read). For SUPPLIER_NAME_TIEBREAK it holds readName (the supplier name read, null when none was read), candidates (one entry per supplier that shares the tax id: id, name and score, the share of the words of the shorter name found in the other one, from 0 to 1) and winnerId (the supplier assigned, null when no candidate won clearly and the invoice stays with several suppliers). For TAX_UNMATCHED, TAX_AMBIGUOUS and TAX_AMOUNT_MISMATCH it holds rowKind (POSITION_TAX or TAX_BREAKDOWN), rowId (id of the tax row) and percentage (as read); TAX_UNMATCHED adds sent (true when the legal entity sends invoices with unmatched taxes, so the invoice did not go to review for this row); TAX_AMBIGUOUS adds candidateCodes (codes of the catalog taxes that match); TAX_AMOUNT_MISMATCH adds base, expectedAmount, readAmount and tolerance. For TOTAL_AMOUNT_MISMATCH it holds check (LINES_VS_SUBTOTAL or TOTAL), expectedAmount, readAmount and tolerance. For LINE_AMOUNTS_TAX_INCLUSIVE_CONVERTED it holds subtotal and total (as read from the document), tolerance (the largest difference that counted as equal when the sum of the lines was compared with them) and lines (positionNumber, before: the amount as read, after: the stored net amount; both null for a line without amount). For TAX_RATE_DEDUCED it holds subtotal, taxAmount and total (as read from the document), tolerance (the largest difference that counted as equal when subtotal plus tax amount were compared with the total) and percentage (the deduced one). For PDF_FORWARD_FAILED it holds recipients (the mailboxes the forward was meant for) and cause (the message of the failure). For EXTRACTION_HANDLER_ERROR it also holds step when the failing part is not a listener of the extracted event: EXTRACTION_STEP_TWO (the step 2 job failed for good, with its attempts exhausted or an unrecoverable answer), EXTRACTION_STEP_TWO_ENQUEUE (the step 2 job could not be enqueued) or EXTRACTION_STEP_TWO_CUSTOM_FIELD_VALUES (the value store rejected the custom values step 2 wrote); the step 2 steps carry no event name and hold step and error. For EXTRACTION_STEP_TWO_REQUESTED it holds outcome (the resolve result of the pass: invoiceId, legalEntityId, the supplier status and tin mismatch, the legal entity status and the customer tax id read), isSupplierAssociated (true when an identification rule assigned the supplier) and reasons (one entry per field step 2 reads: kind PROFILE_FIELD when the effective profile declares the field, LOW_CONFIDENCE when a dictionary field holding a value has a step 1 confidence under the threshold, plus scope, origin FIXED or CUSTOM and code and, for LOW_CONFIDENCE, confidence: the lowest step 1 confidence of the field; a field can have both). For EXTRACTION_STEP_TWO_FIELDS_READ it holds fields (one entry per requested header field and per requested line field and stored position: scope HEADER or LINE, origin FIXED or CUSTOM, code, positionId and positionNumber (both null for a header field), stepOneValue and stepOneConfidence as stored by step 1, stepTwoValue as the model answered it, typed (the option codes for a choice field), or the raw answer when it could not be read as the field type, discardedValues (the codes of a multiple-choice answer that matched no active option), outcome REPLACED, KEPT_HUMAN_CORRECTION, NOT_FOUND or EQUAL, and isDiscrepant, true only when both values exist and differ) and droppedLines (the answers for a positionNumber the invoice does not have: positionNumber, code and value as answered). For REQUIRED_EXTRACTION_FIELDS_MISSING it holds missing (one entry per required field without value: scope HEADER or LINE, origin FIXED or CUSTOM, code and positionNumbers, the ascending positions that lack the value for a LINE field and null for a header field). For SENT_TO_ERP it holds externalId (the acknowledgement id the adapter returned, stored in the invoice externalId too) and messages (the non-error messages the ERP answered, when there are any). For SEND_FAILED it holds kind (TRANSPORT when a retry could help, REJECTED when the ERP refused the invoice or it cannot be sent, ENQUEUE when the send job could not be enqueued), httpStatus (when the failure has one), messages (the messages the ERP answered, each with messageType and message, when there are any) and error (name and message of the failure, never headers or credentials). For ARCHIVED it holds remotePath (where the archive stored the file). For ARCHIVE_FAILED it holds kind (CONFIGURATION when the legal entity archive configuration is incomplete or its credentials are rejected, TRANSPORT when a retry could help and the attempts ran out, DATA when the invoice lacks what its archive path needs (invoice date, supplier or legal entity external id) or its stored document file, ENQUEUE when the archive job could not be enqueued), code (the archive port error code, when the failure has one) and error (name and message of the failure, never credentials). For RULE_ACTION it is stored as a snapshot of what the rules engine reported, so the trace stays readable after the rule or the action is edited or deleted.
51
+ Content of the event, whose shape depends on eventType. For RULE_ACTION it holds the rule (ruleId, ruleName, priority), the action (actionId, actionTypeCode, sort, parameters) and its result (status, output, error). For EXTRACTION_HANDLER_ERROR it holds the event name and the error (name, message). For SUPPLIER_DATA_COPIED and LEGAL_ENTITY_DATA_COPIED it holds the origin of the copy (IDENTIFICATION, MANUAL_ASSIGNMENT or RE_IDENTIFICATION), the id of the master (businessPartnerId or legalEntityId) and the written fields (fields: name, previous value, new value). For SUPPLIER_TIN_MISMATCH it holds readTin (the tax id read from the document) and supplierTin (the tax id of the assigned supplier, null when the master has none). For CUSTOMER_TIN_WITHOUT_LEGAL_ENTITY it holds readTin (the customer tax id read, null when none was read). For SUPPLIER_NAME_TIEBREAK it holds readName (the supplier name read, null when none was read), candidates (one entry per supplier that shares the tax id: id, name and score, the share of the words of the shorter name found in the other one, from 0 to 1) and winnerId (the supplier assigned, null when no candidate won clearly and the invoice stays with several suppliers). For TAX_UNMATCHED, TAX_AMBIGUOUS and TAX_AMOUNT_MISMATCH it holds rowKind (POSITION_TAX or TAX_BREAKDOWN), rowId (id of the tax row) and percentage (as read); TAX_UNMATCHED adds sent (true when the legal entity sends invoices with unmatched taxes, so the invoice did not go to review for this row); TAX_AMBIGUOUS adds candidateCodes (codes of the catalog taxes that match); TAX_AMOUNT_MISMATCH adds base, expectedAmount, readAmount and tolerance. For TOTAL_AMOUNT_MISMATCH it holds check (LINES_VS_SUBTOTAL or TOTAL), expectedAmount, readAmount and tolerance. For LINE_AMOUNTS_TAX_INCLUSIVE_CONVERTED it holds subtotal and total (as read from the document), tolerance (the largest difference that counted as equal when the sum of the lines was compared with them) and lines (positionNumber, before: the amount as read, after: the stored net amount; both null for a line without amount). For TAX_RATE_DEDUCED it holds subtotal, taxAmount and total (as read from the document), tolerance (the largest difference that counted as equal when subtotal plus tax amount were compared with the total) and percentage (the deduced one). For PDF_FORWARD_FAILED it holds recipients (the mailboxes the forward was meant for) and cause (the message of the failure). For EXTRACTION_HANDLER_ERROR it also holds step when the failing part is not a listener of the extracted event: EXTRACTION_STEP_TWO (the step 2 job failed for good, with its attempts exhausted or an unrecoverable answer), EXTRACTION_STEP_TWO_ENQUEUE (the step 2 job could not be enqueued) or EXTRACTION_STEP_TWO_CUSTOM_FIELD_VALUES (the value store rejected the custom values step 2 wrote); the step 2 steps carry no event name and hold step and error. For EXTRACTION_STEP_TWO_REQUESTED it holds outcome (the resolve result of the pass: invoiceId, legalEntityId, the supplier status and tin mismatch, the legal entity status and the customer tax id read), isSupplierAssociated (true when an identification rule assigned the supplier) and reasons (one entry per field step 2 reads: kind PROFILE_FIELD, because the effective profile declares the field, plus scope, origin FIXED or CUSTOM and code). For EXTRACTION_STEP_TWO_FIELDS_READ it holds fields (one entry per requested header field and per requested line field and stored position: scope HEADER or LINE, origin FIXED or CUSTOM, code, positionId and positionNumber (both null for a header field), stepOneValue as stored by step 1, stepTwoValue as the model answered it, typed (the option codes for a choice field), or the raw answer when it could not be read as the field type, discardedValues (the codes of a multiple-choice answer that matched no active option), outcome REPLACED, KEPT_HUMAN_CORRECTION, NOT_FOUND or EQUAL, and isDiscrepant, true only when both values exist and differ), droppedLines (the answers for a positionNumber the invoice does not have: positionNumber, code and value as answered), taxBreakdowns (one entry per field of a stored tax breakdown row the doubt review set: breakdownId, breakdownNumber, code, stepOneValue, stepTwoValue as a number or null, outcome and isDiscrepant), droppedTaxBreakdowns (the answers for a breakdownNumber the invoice does not have: breakdownNumber, code and value as answered) and review (the doubt review of step 2, null when it did not run: actions, each with field, kind, from, to, evidence, explanation and operation, reconciled, humanReviewReason and rejected, the reasons of the actions whose operation the code rejected). For REQUIRED_EXTRACTION_FIELDS_MISSING it holds missing (one entry per required field without value: scope HEADER or LINE, origin FIXED or CUSTOM, code and positionNumbers, the ascending positions that lack the value for a LINE field and null for a header field). For SENT_TO_ERP it holds externalId (the acknowledgement id the adapter returned, stored in the invoice externalId too) and messages (the non-error messages the ERP answered, when there are any). For SEND_FAILED it holds kind (TRANSPORT when a retry could help, REJECTED when the ERP refused the invoice or it cannot be sent, ENQUEUE when the send job could not be enqueued), httpStatus (when the failure has one), messages (the messages the ERP answered, each with messageType and message, when there are any) and error (name and message of the failure, never headers or credentials). For ARCHIVED it holds remotePath (where the archive stored the file). For ARCHIVE_FAILED it holds kind (CONFIGURATION when the legal entity archive configuration is incomplete or its credentials are rejected, TRANSPORT when a retry could help and the attempts ran out, DATA when the invoice lacks what its archive path needs (invoice date, supplier or legal entity external id) or its stored document file, ENQUEUE when the archive job could not be enqueued), code (the archive port error code, when the failure has one) and error (name and message of the failure, never credentials). For RULE_ACTION it is stored as a snapshot of what the rules engine reported, so the trace stays readable after the rule or the action is edited or deleted.
52
52
  """
53
53
  detail: JSON!
54
54
  """
@@ -3,12 +3,10 @@
3
3
  * (see `@app/business-partner-portal/business-partner-portal.seed.ts` → `keyValues`).
4
4
  */
5
5
  export enum BusinessPartnerKeysEnum {
6
- BUSINESS_PARTNER_PORTAL_DOCUMENT_EXTRACTION_DISCARD_THRESHOLD = 'businessPartnerPortal.documentExtraction.discardThreshold',
7
- BUSINESS_PARTNER_PORTAL_DOCUMENT_EXTRACTION_DOUBT_THRESHOLD = 'businessPartnerPortal.documentExtraction.doubtThreshold',
8
6
  BUSINESS_PARTNER_PORTAL_CONTACT_ROLE_ID = 'businessPartnerPortal.iamProvisioning.contactRoleId',
9
7
  BUSINESS_PARTNER_PORTAL_OAUTH_CLIENT_ID = 'businessPartnerPortal.iamProvisioning.oAuthClientId',
10
8
  BUSINESS_PARTNER_PORTAL_PARENT_TENANT_ID = 'businessPartnerPortal.iamProvisioning.parentTenantId',
11
- BUSINESS_PARTNER_PORTAL_EXTRACTION_STEP_TWO_CONFIDENCE_THRESHOLD = 'businessPartnerPortal.extractionStepTwo.confidenceThreshold',
9
+ BUSINESS_PARTNER_PORTAL_EXTRACTION_STEP_ONE_MODEL = 'businessPartnerPortal.extractionStepOne.model',
12
10
  BUSINESS_PARTNER_PORTAL_EXTRACTION_STEP_TWO_MODEL = 'businessPartnerPortal.extractionStepTwo.model',
13
11
  BUSINESS_PARTNER_PORTAL_EXTRACTION_STEP_TWO_BATCH_MODE = 'businessPartnerPortal.extractionStepTwo.batchMode',
14
12
  BUSINESS_PARTNER_PORTAL_IDENTIFICATION_SUPPLIER_NAME_MATCH_THRESHOLD = 'businessPartnerPortal.identification.supplierNameMatch.threshold',
@@ -73,7 +73,7 @@ export class BusinessPartnerPortalCreateSupplierDocumentDto {
73
73
  @ApiProperty({
74
74
  enum: BusinessPartnerPortalSupplierDocumentClassificationEnum,
75
75
  description:
76
- 'Verdict of the extraction job about whether the document is an invoice. INVOICE: classified as an invoice with enough confidence for the invoice creation flow to proceed. DOUBTFUL: classified as an invoice but with confidence below the doubt threshold, so the invoice created from it needs human review. NOT_INVOICE: not an invoice, or confidence below the discard threshold; the document ends in status DISCARDED. Both thresholds are runtime configuration (key-value), not constants. NULL until the extraction job has classified the document. Set by the extraction job together with ocrData; read by the invoice creation step.',
76
+ 'Verdict of the extraction job about whether the document is an invoice. INVOICE: classified as an invoice whose reading passed the doubt check, so the invoice creation flow proceeds. DOUBTFUL: classified as an invoice but the doubt check tripped (the model asked for review, the number, date or total is missing, or base + tax differ from the total by more than a cent), so the invoice created from it needs human review. NOT_INVOICE: the model answered isInvoice = false; the document ends in status DISCARDED. No confidence is involved. NULL until the extraction job has classified the document. Set by the extraction job together with ocrData; read by the invoice creation step.',
77
77
  })
78
78
  classification?: BusinessPartnerPortalSupplierDocumentClassificationEnum;
79
79
 
@@ -148,13 +148,6 @@ export class BusinessPartnerPortalCreateSupplierDocumentDto {
148
148
  })
149
149
  purchaseInvoiceHeaderId?: string;
150
150
 
151
- @ApiProperty({
152
- type: Number,
153
- description:
154
- 'Overall OCR confidence score from the processing system (0.00 to 100.00). Indicates reliability of extracted data. NULL until OCR completes. Low scores may trigger manual review. Used for quality metrics and processing decisions. Display as percentage in UI. Scores below threshold (e.g., 80%) may require manual verification.',
155
- })
156
- ocrConfidenceScore?: number;
157
-
158
151
  @ApiProperty({
159
152
  type: Object,
160
153
  description:
@@ -103,7 +103,7 @@ export class BusinessPartnerPortalSupplierDocumentDto {
103
103
  @ApiProperty({
104
104
  enum: BusinessPartnerPortalSupplierDocumentClassificationEnum,
105
105
  description:
106
- 'Verdict of the extraction job about whether the document is an invoice. INVOICE: classified as an invoice with enough confidence for the invoice creation flow to proceed. DOUBTFUL: classified as an invoice but with confidence below the doubt threshold, so the invoice created from it needs human review. NOT_INVOICE: not an invoice, or confidence below the discard threshold; the document ends in status DISCARDED. Both thresholds are runtime configuration (key-value), not constants. NULL until the extraction job has classified the document. Set by the extraction job together with ocrData; read by the invoice creation step.',
106
+ 'Verdict of the extraction job about whether the document is an invoice. INVOICE: classified as an invoice whose reading passed the doubt check, so the invoice creation flow proceeds. DOUBTFUL: classified as an invoice but the doubt check tripped (the model asked for review, the number, date or total is missing, or base + tax differ from the total by more than a cent), so the invoice created from it needs human review. NOT_INVOICE: the model answered isInvoice = false; the document ends in status DISCARDED. No confidence is involved. NULL until the extraction job has classified the document. Set by the extraction job together with ocrData; read by the invoice creation step.',
107
107
  })
108
108
  classification?: BusinessPartnerPortalSupplierDocumentClassificationEnum;
109
109
 
@@ -185,13 +185,6 @@ export class BusinessPartnerPortalSupplierDocumentDto {
185
185
  })
186
186
  purchaseInvoiceHeader?: WrapperType<BusinessPartnerPortalPurchaseInvoiceHeaderDto>;
187
187
 
188
- @ApiProperty({
189
- type: Number,
190
- description:
191
- 'Overall OCR confidence score from the processing system (0.00 to 100.00). Indicates reliability of extracted data. NULL until OCR completes. Low scores may trigger manual review. Used for quality metrics and processing decisions. Display as percentage in UI. Scores below threshold (e.g., 80%) may require manual verification.',
192
- })
193
- ocrConfidenceScore?: number;
194
-
195
188
  @ApiProperty({
196
189
  type: Object,
197
190
  description:
@@ -73,7 +73,7 @@ export class BusinessPartnerPortalUpdateSupplierDocumentByIdDto {
73
73
  @ApiProperty({
74
74
  enum: BusinessPartnerPortalSupplierDocumentClassificationEnum,
75
75
  description:
76
- 'Verdict of the extraction job about whether the document is an invoice. INVOICE: classified as an invoice with enough confidence for the invoice creation flow to proceed. DOUBTFUL: classified as an invoice but with confidence below the doubt threshold, so the invoice created from it needs human review. NOT_INVOICE: not an invoice, or confidence below the discard threshold; the document ends in status DISCARDED. Both thresholds are runtime configuration (key-value), not constants. NULL until the extraction job has classified the document. Set by the extraction job together with ocrData; read by the invoice creation step.',
76
+ 'Verdict of the extraction job about whether the document is an invoice. INVOICE: classified as an invoice whose reading passed the doubt check, so the invoice creation flow proceeds. DOUBTFUL: classified as an invoice but the doubt check tripped (the model asked for review, the number, date or total is missing, or base + tax differ from the total by more than a cent), so the invoice created from it needs human review. NOT_INVOICE: the model answered isInvoice = false; the document ends in status DISCARDED. No confidence is involved. NULL until the extraction job has classified the document. Set by the extraction job together with ocrData; read by the invoice creation step.',
77
77
  })
78
78
  classification?: BusinessPartnerPortalSupplierDocumentClassificationEnum;
79
79
 
@@ -141,13 +141,6 @@ export class BusinessPartnerPortalUpdateSupplierDocumentByIdDto {
141
141
  })
142
142
  purchaseInvoiceHeaderId?: string;
143
143
 
144
- @ApiProperty({
145
- type: Number,
146
- description:
147
- 'Overall OCR confidence score from the processing system (0.00 to 100.00). Indicates reliability of extracted data. NULL until OCR completes. Low scores may trigger manual review. Used for quality metrics and processing decisions. Display as percentage in UI. Scores below threshold (e.g., 80%) may require manual verification.',
148
- })
149
- ocrConfidenceScore?: number;
150
-
151
144
  @ApiProperty({
152
145
  type: Object,
153
146
  description:
@@ -73,7 +73,7 @@ export class BusinessPartnerPortalUpdateSupplierDocumentsDto {
73
73
  @ApiProperty({
74
74
  enum: BusinessPartnerPortalSupplierDocumentClassificationEnum,
75
75
  description:
76
- 'Verdict of the extraction job about whether the document is an invoice. INVOICE: classified as an invoice with enough confidence for the invoice creation flow to proceed. DOUBTFUL: classified as an invoice but with confidence below the doubt threshold, so the invoice created from it needs human review. NOT_INVOICE: not an invoice, or confidence below the discard threshold; the document ends in status DISCARDED. Both thresholds are runtime configuration (key-value), not constants. NULL until the extraction job has classified the document. Set by the extraction job together with ocrData; read by the invoice creation step.',
76
+ 'Verdict of the extraction job about whether the document is an invoice. INVOICE: classified as an invoice whose reading passed the doubt check, so the invoice creation flow proceeds. DOUBTFUL: classified as an invoice but the doubt check tripped (the model asked for review, the number, date or total is missing, or base + tax differ from the total by more than a cent), so the invoice created from it needs human review. NOT_INVOICE: the model answered isInvoice = false; the document ends in status DISCARDED. No confidence is involved. NULL until the extraction job has classified the document. Set by the extraction job together with ocrData; read by the invoice creation step.',
77
77
  })
78
78
  classification?: BusinessPartnerPortalSupplierDocumentClassificationEnum;
79
79
 
@@ -141,13 +141,6 @@ export class BusinessPartnerPortalUpdateSupplierDocumentsDto {
141
141
  })
142
142
  purchaseInvoiceHeaderId?: string;
143
143
 
144
- @ApiProperty({
145
- type: Number,
146
- description:
147
- 'Overall OCR confidence score from the processing system (0.00 to 100.00). Indicates reliability of extracted data. NULL until OCR completes. Low scores may trigger manual review. Used for quality metrics and processing decisions. Display as percentage in UI. Scores below threshold (e.g., 80%) may require manual verification.',
148
- })
149
- ocrConfidenceScore?: number;
150
-
151
144
  @ApiProperty({
152
145
  type: Object,
153
146
  description:
@@ -70,11 +70,11 @@ type BusinessPartnerPortalSupplierDocument {
70
70
  """
71
71
  documentType: BusinessPartnerPortalSupplierDocumentDocumentTypeEnum
72
72
  """
73
- Current processing status of the document. PENDING_UPLOAD: Upload initiated but file not yet received. UPLOADED: File received and stored successfully. VALIDATED: Document manually validated by operator, ready to be sent for processing. SENT_FOR_PROCESSING: Document transmitted to external system for OCR processing. PROCESSING: External system actively processing (OCR, data extraction). PROCESSED: Processing completed, data available. LINKED: Purchase invoice created and linked to this document. ERROR: Processing failed (see errorCode/errorMessage). REJECTED: Document rejected by external system or manually. DISCARDED: The extraction job decided the document is not an invoice (or the classifier's confidence is below the discard threshold); the pipeline stops there and no purchase invoice is created.
73
+ Current processing status of the document. PENDING_UPLOAD: Upload initiated but file not yet received. UPLOADED: File received and stored successfully. VALIDATED: Document manually validated by operator, ready to be sent for processing. SENT_FOR_PROCESSING: Document transmitted to external system for OCR processing. PROCESSING: External system actively processing (OCR, data extraction). PROCESSED: Processing completed, data available. LINKED: Purchase invoice created and linked to this document. ERROR: Processing failed (see errorCode/errorMessage). REJECTED: Document rejected by external system or manually. DISCARDED: The extraction job decided the document is not an invoice (the model answered isInvoice = false); the pipeline stops there and no purchase invoice is created.
74
74
  """
75
75
  status: BusinessPartnerPortalSupplierDocumentStatusEnum!
76
76
  """
77
- Verdict of the extraction job about whether the document is an invoice. INVOICE: classified as an invoice with enough confidence for the invoice creation flow to proceed. DOUBTFUL: classified as an invoice but with confidence below the doubt threshold, so the invoice created from it needs human review. NOT_INVOICE: not an invoice, or confidence below the discard threshold; the document ends in status DISCARDED. Both thresholds are runtime configuration (key-value), not constants. NULL until the extraction job has classified the document. Set by the extraction job together with ocrData; read by the invoice creation step.
77
+ Verdict of the extraction job about whether the document is an invoice. INVOICE: classified as an invoice whose reading passed the doubt check, so the invoice creation flow proceeds. DOUBTFUL: classified as an invoice but the doubt check tripped (the model asked for review, the number, date or total is missing, or base + tax differ from the total by more than a cent), so the invoice created from it needs human review. NOT_INVOICE: the model answered isInvoice = false; the document ends in status DISCARDED. No confidence is involved. NULL until the extraction job has classified the document. Set by the extraction job together with ocrData; read by the invoice creation step.
78
78
  """
79
79
  classification: BusinessPartnerPortalSupplierDocumentClassificationEnum
80
80
  """
@@ -119,10 +119,6 @@ type BusinessPartnerPortalSupplierDocument {
119
119
  purchaseInvoiceHeaderId: ID
120
120
  purchaseInvoiceHeader: BusinessPartnerPortalPurchaseInvoiceHeader
121
121
  """
122
- Overall OCR confidence score from the processing system (0.00 to 100.00). Indicates reliability of extracted data. NULL until OCR completes. Low scores may trigger manual review. Used for quality metrics and processing decisions. Display as percentage in UI. Scores below threshold (e.g., 80%) may require manual verification.
123
- """
124
- ocrConfidenceScore: GraphQLFloat
125
- """
126
122
  The ORIGINAL OCR extraction results from the processing system, in JSON format. Contains structured data extracted from the document: invoice number, date, line items, amounts, vendor info, tax details, etc. NULL until OCR completes. Write-once: once a value is persisted here, it is never modified afterward — the update-by-id handler rejects a second write that differs from the stored value (an identical echo is accepted). Used to create the purchase invoice and for displaying the extracted data to the supplier for verification. Schema depends on processing system configuration.
127
123
  """
128
124
  ocrData: JSON
@@ -204,7 +200,6 @@ input BusinessPartnerPortalCreateSupplierDocumentInput {
204
200
  externalCompanyCode: GraphQLString
205
201
  externalProcessingStatus: GraphQLString
206
202
  purchaseInvoiceHeaderId: ID
207
- ocrConfidenceScore: GraphQLFloat
208
203
  ocrData: JSON
209
204
  sentForProcessingAt: GraphQLISODateTime
210
205
  processedAt: GraphQLISODateTime
@@ -238,7 +233,6 @@ input BusinessPartnerPortalUpdateSupplierDocumentByIdInput {
238
233
  externalCompanyCode: GraphQLString
239
234
  externalProcessingStatus: GraphQLString
240
235
  purchaseInvoiceHeaderId: ID
241
- ocrConfidenceScore: GraphQLFloat
242
236
  ocrData: JSON
243
237
  sentForProcessingAt: GraphQLISODateTime
244
238
  processedAt: GraphQLISODateTime
@@ -298,7 +292,6 @@ input BusinessPartnerPortalUpdateSupplierDocumentsInput {
298
292
  externalCompanyCode: GraphQLString
299
293
  externalProcessingStatus: GraphQLString
300
294
  purchaseInvoiceHeaderId: ID
301
- ocrConfidenceScore: GraphQLFloat
302
295
  ocrData: JSON
303
296
  sentForProcessingAt: GraphQLISODateTime
304
297
  processedAt: GraphQLISODateTime