Files
accounted/scripts/checks/typecheck-baseline.json
T
Jakob Wennberg 91e2c66afc fix(parties): readable suggestions from assistant vouchers, auto-build queue, SCB fetch after promotion (#2259)
* fix(parties): readable suggestions from assistant-written vouchers, auto-build queue, SCB fetch after promotion

Live feedback on a real company (2026-09-03): the queue showed 35 one-off
suggestions with sentence-long names, wide empty rows, a "Hämta förslag"
step nobody could predict, no SCB fetch after promotion, and an empty
supplier created from a Finansinspektionen fee line.

- ledger_key v2 (migration 20260904002000): keep the counterpart head of
  "<counterpart> · <note>" descriptions, drop bank method tokens and long
  references before normalising; JS mirror in lib/parties/ledger-key.ts
  with shared LEDGER_KEY_CASES. Suggested parties nobody has touched are
  rebuilt under the new keys (repair in the same migration).
- apply_party_suggestions attaches by VAT number too, so ledger keys with
  a VAT number but no org number reach existing roles.
- Queue: fixed name/reason column widths, inline "Hitta i
  företagsregistret" for rows without an org number.
- Page: builds the queue automatically on first visit when nothing has
  been suggested yet; after promotion, fetches SCB facts for every
  promoted legal person (spaced under the 10 calls/10 s limit) and fills
  the role's VAT number; confirm dialog says how many rows lack an org
  number.
- Classifier: more authorities (Finansinspektionen, Arbetsförmedlingen,
  Pensionsmyndigheten, ...) and fee words (registreringsavgift,
  tillsynsavgift, ...) so fee lines stop becoming suppliers.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fix(parties): scope the suggestion repair to keys the new ledger_key no longer produces

Superagent flagged the repair DELETE as global. It now only removes
untouched pipeline suggestions that no posted voucher of the company maps
to under the new function; suggestions whose key is unchanged stay.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

---------

Co-authored-by: Jakob Wennberg <311770904+jakobwennberg-oss@users.noreply.github.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-03 21:19:12 +02:00

88 lines
5.3 KiB
JSON

{
"totalErrors": 535,
"perFile": {
"app/api/assets/__tests__/id.test.ts": 9,
"app/api/auth/email-hook/__tests__/route.test.ts": 1,
"app/api/auth/heartbeat/__tests__/route.test.ts": 1,
"app/api/bookkeeping/fiscal-periods/__tests__/route.test.ts": 23,
"app/api/bookkeeping/fiscal-periods/[id]/bokslutsdispositioner/__tests__/route.test.ts": 4,
"app/api/bookkeeping/journal-entries/__tests__/route.test.ts": 26,
"app/api/bookkeeping/journal-entries/[id]/chain/__tests__/route.test.ts": 2,
"app/api/bookkeeping/no-doc-required/batch/__tests__/route.test.ts": 6,
"app/api/bookkeeping/no-doc-required/bulk-missing/__tests__/route.test.ts": 9,
"app/api/bookkeeping/voucher-gaps/__tests__/route.test.ts": 9,
"app/api/customers/__tests__/viewer.test.ts": 2,
"app/api/documents/counts/__tests__/route.test.ts": 11,
"app/api/export/articles/__tests__/route.test.ts": 3,
"app/api/export/suppliers/__tests__/route.test.ts": 2,
"app/api/extensions/shopify/orders/cron/__tests__/route.test.ts": 2,
"app/api/extensions/skatteverket/agi/kvittenser/cron/__tests__/route.test.ts": 4,
"app/api/import/articles/__tests__/execute.test.ts": 23,
"app/api/import/bank-file/__tests__/route.test.ts": 1,
"app/api/import/bank-file/check-duplicates/__tests__/route.test.ts": 8,
"app/api/import/opening-balance/__tests__/correct.test.ts": 28,
"app/api/import/opening-balance/__tests__/execute.test.ts": 18,
"app/api/import/opening-balance/correct/__tests__/route.test.ts": 10,
"app/api/invoices/__tests__/route.test.ts": 24,
"app/api/invoices/[id]/peppol/__tests__/route.test.ts": 1,
"app/api/invoices/[id]/send-payment-confirmation/__tests__/route.test.ts": 8,
"app/api/invoices/bulk-book/__tests__/route.test.ts": 1,
"app/api/invoices/self-billed/__tests__/route.test.ts": 8,
"app/api/onboarding/state/__tests__/route.test.ts": 5,
"app/api/pending-operations/bulk-commit/__tests__/route.test.ts": 11,
"app/api/pending-operations/bulk-reject/__tests__/route.test.ts": 10,
"app/api/reports/audit-trail/__tests__/route.test.ts": 4,
"app/api/reports/bokslutsbilagor/__tests__/route.test.ts": 8,
"app/api/reports/full-archive/__tests__/route.test.ts": 11,
"app/api/rot-rut/__tests__/routes.test.ts": 13,
"app/api/rot-rut/beslut/__tests__/route.test.ts": 4,
"app/api/settings/api-keys/__tests__/route.test.ts": 6,
"app/api/settings/booking-templates/sync/cron/__tests__/route.test.ts": 1,
"app/api/settings/eu-trade-signal/__tests__/route.test.ts": 3,
"app/api/settings/ku-signal/__tests__/route.test.ts": 4,
"app/api/settings/rot-rut-signal/__tests__/route.test.ts": 4,
"app/api/supplier-invoices/__tests__/route.test.ts": 41,
"app/api/supplier-invoices/payment-batches/__tests__/route.test.ts": 12,
"app/api/tax-assessment-notices/__tests__/route.test.ts": 5,
"app/api/transactions/bulk-book/__tests__/route.test.ts": 16,
"app/api/v1/companies/[companyId]/customers/__tests__/route.test.ts": 1,
"app/api/webshop-orders/__tests__/bulk-book.test.ts": 1,
"app/api/webshop-orders/__tests__/list-and-settings.test.ts": 11,
"extensions/general/enable-banking/__tests__/session-expired.test.ts": 4,
"extensions/general/enable-banking/__tests__/supersede.test.ts": 1,
"extensions/general/invoice-inbox/__tests__/match-transaction.test.ts": 1,
"extensions/general/invoice-inbox/__tests__/retry-extraction.test.ts": 1,
"extensions/general/invoice-inbox/__tests__/sandbox-skip-extraction.test.ts": 1,
"extensions/general/invoice-inbox/__tests__/upload-page-count-gate.test.ts": 1,
"extensions/general/mcp-server/__tests__/account-tools.test.ts": 2,
"extensions/general/mcp-server/__tests__/connect-links.test.ts": 1,
"extensions/general/mcp-server/__tests__/payroll-staged-tools.test.ts": 21,
"extensions/general/mcp-server/__tests__/salary-tools.test.ts": 4,
"extensions/general/mcp-server/__tests__/set-voucher-note.test.ts": 1,
"extensions/general/mcp-server/__tests__/skills.test.ts": 2,
"extensions/general/skatteverket/__tests__/api-client.test.ts": 5,
"extensions/general/skatteverket/__tests__/skattekonto-mappers.test.ts": 1,
"lib/__tests__/logger.test.ts": 1,
"lib/api/v1/__tests__/with-api-v1.test.ts": 9,
"lib/auth/__tests__/require-write.test.ts": 15,
"lib/bokslut/__tests__/k3-framework-dispositions.test.ts": 2,
"lib/bokslut/__tests__/readiness-aggregator.test.ts": 6,
"lib/bookkeeping/__tests__/supplier-payment-lines.test.ts": 14,
"lib/branding/__tests__/public-brand.test.ts": 1,
"lib/email/__tests__/brand-mail-snapshots.test.ts": 1,
"lib/email/__tests__/brand-sender.test.ts": 1,
"lib/email/__tests__/reminder-templates.test.ts": 6,
"lib/import/__tests__/account-mapper.test.ts": 1,
"lib/import/__tests__/sie-import.test.ts": 1,
"lib/invoices/__tests__/pdf-template-amounts.test.ts": 1,
"lib/invoices/__tests__/peppol-bis-billing.test.ts": 1,
"lib/invoices/__tests__/reminder-processor.test.ts": 3,
"lib/invoices/__tests__/supplier-invoice-matching.test.ts": 1,
"lib/pending-operations/__tests__/commit-authorization-recoverable.test.ts": 1,
"lib/reports/__tests__/vat-declaration.test.ts": 5,
"lib/supabase/__tests__/middleware.test.ts": 1,
"tests/pg/categorize-calibration-samples.pg.test.ts": 2,
"tests/pg/match-batch-allocate.pg.test.ts": 1
}
}