Skip to content

feat(config): SII cert+CAF upload + medios de pago + ficha de negocio - #272

Open
pabloalvarez99 wants to merge 1 commit into
feat/config-wire-sectionsfrom
feat/config-wire-sii-pay
Open

feat(config): SII cert+CAF upload + medios de pago + ficha de negocio#272
pabloalvarez99 wants to merge 1 commit into
feat/config-wire-sectionsfrom
feat/config-wire-sii-pay

Conversation

@pabloalvarez99

Copy link
Copy Markdown
Owner

W6 ye (2/2) — completar el Config Center

Cascada sobre #270 (feat/config-wire-sections). Convierte la card "próximamente" de Facturación SII en carga real de certificado + folios, y enriquece Negocio con ficha de contacto y medios de pago. Cliente puro sobre backend ya en base (#268 + config.rs); sin migraciones.

Base = feat/config-wire-sections (PR #270). Mergear #270 primero; GitHub re-apunta esta PR a feature/erp-parity al hacerlo.

Qué hace

  • Certificado digital (.pfx) (POST /api/v1/dte/cert): selector de archivo + contraseña + RUT + vigencia. El .pfx se lee en base64 en el webview; el server valida el material, lo cifra (AES-256-GCM + Argon2id) y descarta la passphrase (nunca se persiste). Mismo flujo que pharma cert import.
  • Folios CAF (.xml) (POST /api/v1/dte/caf): selector XML del SII; refresca el contador de folios al cargar.
  • Ficha del negocio (GET/PUT /api/v1/config/business): razón social (requerida) + giro/dirección/teléfono/correo. Tarjeta de contacto UI/comprobantes, distinta de dte.emisor.
  • Medios de pago (GET/PUT /api/v1/config/payment-methods): checkboxes del catálogo del servidor; exige ≥1.

Capas (scope ye)

config-center.ts (helpers puros paymentLabel/validatePaymentSelection/validateCertForm) · api.ts (wrappers) · src-tauri/lib.rs (6 comandos + structs) · configuracion.ts (cards reales en renderNegocio + renderSii + lectores de archivo base64/texto) · brand.css (inputs file/date).

GATE

  • npm run build ✓ · npm test ✓ (661 ok, 7 todo)
  • cargo fmt --check ✓ · cargo clippy --manifest-path client/src-tauri/Cargo.toml --all-targets -- -D warnings ✓ (0 warnings)
  • TDD: config-center.test.ts +8 (payment labels, validatePaymentSelection, validateCertForm passphrase/RUT/vigencia).

Cierra W6: el Config Center queda sin secciones "por CLI".

🤖 Generated with Claude Code

Second W6 PR (stacked on feat/config-wire-sections). Completes the config
hub: turns Facturación SII's "próximamente" card into real certificate +
folio upload, and enriches Negocio with a contact profile and accepted
tender. Client-only over backend already in base (#268 + config.rs).

- Certificado digital (.pfx): file picker + passphrase + RUT + validity. The
  PFX is read base64 in the webview; the server verifies the material,
  encrypts it (AES-256-GCM + Argon2id) and discards the passphrase.
- Folios CAF (.xml): SII XML upload; refreshes the remaining-folios counter.
- Ficha del negocio (GET/PUT /config/business): razón social + giro/address/
  phone/email — the UI/receipt card, distinct from SII dte.emisor identity.
- Medios de pago (GET/PUT /config/payment-methods): server-catalog checkboxes,
  ≥1 required.

Layers (ye scope): config-center.ts pure helpers (TDD, +8 tests); api.ts
wrappers; src-tauri/lib.rs 6 commands + structs; configuracion.ts real cards
in renderNegocio + renderSii + base64/text file readers; brand.css file/date
inputs. No migrations.

GATE: npm run build + npm test (661 ok, 7 todo) + cargo fmt --check + clippy
--manifest-path client/src-tauri/Cargo.toml -D warnings (0 warnings).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant