feat: add INK2 declaration, full archive export, AI consent gate, fix VAT declaration rutor

- Fix VAT declaration ruta mappings to match SKV 4700 form correctly
  (ruta 05 = total taxable sales, ruta 10/11/12 = output VAT per rate)
- Add INK2 declaration report for aktiebolag with SRU export
- Add full archive ZIP export for 7-year retention compliance
- Add AI consent gate requiring user approval before AI extension API calls
- Add DPA and privacy policy public pages
- Add audit trail API routes
- Update VAT registration threshold from 80k to 120k kr in onboarding
- Update CLAUDE.md documentation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jakob Wennberg
2026-03-05 14:20:47 +01:00
co-authored by Claude Opus 4.6
parent 50bf7b3b0f
commit 29240738fa
32 changed files with 3496 additions and 97 deletions
+20 -16
View File
@@ -1550,17 +1550,17 @@ export const RECEIPT_STATUS_LABELS: Record<ReceiptStatus, string> = {
// VAT period type
export type VatPeriodType = 'monthly' | 'quarterly' | 'yearly'
// VAT declaration rutor (boxes) according to Swedish tax authority
// VAT declaration rutor (boxes) according to SKV 4700
export interface VatDeclarationRutor {
// Utgående moms (Output VAT)
ruta05: number // Utgående moms 25%
ruta06: number // Utgående moms 12%
ruta07: number // Utgående moms 6%
// Momspliktig försäljning (taxable sales basis, all rates combined)
ruta05: number // Momspliktig försäljning (excl. ruta 06, 07, 08)
ruta06: number // Momspliktiga uttag (unused, always 0)
ruta07: number // Vinstmarginalbeskattning (unused, always 0)
// Momspliktigt underlag (VAT-liable base amounts)
ruta10: number // Momspliktigt underlag 25%
ruta11: number // Momspliktigt underlag 12%
ruta12: number // Momspliktigt underlag 6%
// Utgående moms (Output VAT per rate)
ruta10: number // Utgående moms 25%
ruta11: number // Utgående moms 12%
ruta12: number // Utgående moms 6%
// EU och export
ruta39: number // Försäljning av tjänster till annat EU-land (reverse charge)
@@ -1597,6 +1597,10 @@ export interface VatDeclaration {
ruta12: number
ruta39: number
ruta40: number
// Per-rate base amounts for UI display
base25: number
base12: number
base6: number
}
transactions: {
ruta48: number // Ingående moms from categorized expenses
@@ -1616,16 +1620,16 @@ export interface VatDeclarationRequest {
// Labels for VAT rutor
export const VAT_RUTA_LABELS: Record<keyof VatDeclarationRutor, string> = {
ruta05: 'Utgående moms 25%',
ruta06: 'Utgående moms 12%',
ruta07: 'Utgående moms 6%',
ruta10: 'Momspliktigt underlag 25%',
ruta11: 'Momspliktigt underlag 12%',
ruta12: 'Momspliktigt underlag 6%',
ruta05: 'Momspliktig försäljning',
ruta06: 'Momspliktiga uttag',
ruta07: 'Vinstmarginalbeskattning',
ruta10: 'Utgående moms 25%',
ruta11: 'Utgående moms 12%',
ruta12: 'Utgående moms 6%',
ruta39: 'Försäljning av tjänster till EU-land',
ruta40: 'Export utanför EU',
ruta48: 'Ingående moms att dra av',
ruta49: 'Moms att betala/återfå'
ruta49: 'Moms att betala/återfå',
}
// ============================================================