Commit Graph

27 Commits

Author SHA1 Message Date
lite 1d3e781c7b fix: soporte PascalCase en registro de certificados y actualizacion de documentacion
- Añadir campos PascalCase (CertName, CertFile, PasswordEncrypted) para compatibilidad con frontend
- Metodos CertNameResolved(), CertFileResolved(), PasswordResolved() para resolver campos
- Actualizar documentacion/api.md con ejemplos PascalCase, anulacion completa y errores AEAT
- Actualizar documentacion/certificado_pruebas.md con solucion de problemas P12 legacy
- Actualizar README.md con estado actual del proyecto
2026-05-21 19:31:11 -04:00
lite bed50a49a3 fix: StoreFromBase64 writes to tmp/ instead of permanent location
- Fix bug where certificate was written directly to data/certs/
- MoveToPerm now correctly renames from tmp/ to permanent location
2026-05-19 17:19:44 -04:00
lite 3ede32ef20 refactor: only accept certificate as base64, remove cert_path field
- RegisterInput now only has cert_file (base64 content)
- Removed cert_path fallback and raw map parsing
- Clean struct-based JSON unmarshaling
2026-05-19 17:16:48 -04:00
lite 9c4f11d7c7 refactor: accept certificates as base64, remove external dependencies
- Replace file path with base64 content in register endpoint
- Use native Go pkcs12 for certificate validation and loading
- Remove PowerShell script dependency (validator.go)
- Remove Python script dependency (client.go)
- Remove hardcoded Windows paths
- Cross-platform: works on Linux, macOS, Windows without external tools
- Update documentation (api.md, seguridad.md, prerequisites.md)
2026-05-19 16:03:28 -04:00
lite b99d09789b refactor(dolibarr): use typed fields matching web→BFF format
- Remove totalHt/totalTax/total from input (calculated from lines)
- Remove line.total (calculated as quantity × unitPrice)
- All numeric fields are proper numbers (not strings)
- Dates are ISO 8601 (converted to dd-mm-yyyy internally)
- Totals calculated and validated automatically
2026-05-17 17:40:33 -04:00
lite 572358f96a fix(ci): fix packaging step for cross-compilation
- Use verifactu-api-bin as build output name to avoid mkdir conflict
- Remove .exe suffix from mv (Go doesn't add it during cross-compile)
- Use mkdir -p for safety
- Pin release files to exact paths instead of glob
2026-05-17 17:29:26 -04:00
lite 4e5d7bd8b1 ci: add release job and package binaries
- Package Linux as tar.gz and Windows as zip
- Include config.yml in releases
- Create GitHub release on push to main with auto-generated tag
- Add contents write permission
2026-05-17 17:25:34 -04:00
lite 1c29f9926a ci: add GitHub Actions build workflow for Linux and Windows
- Build on push/PR to main
- Cross-compile for linux/amd64 and windows/amd64
- Upload build artifacts
2026-05-17 16:27:44 -04:00
lite 2fcd61ae81 docs: update documentation for format system
- Add formatos.md with native and dolibarr format specs
- Update api.md with both format examples and formats endpoint
- Update arqui.md with formats layer and new data flow
- Update formato_datos.md to reference formatos.md
2026-05-17 16:27:38 -04:00
lite 4427857ba2 feat: add formats endpoint and update factura handler
- Add GET /api/v1/formats to list available formats
- Simplify HandleFacturas to accept raw JSON (format auto-detected)
- Remove format query param handling
2026-05-17 16:27:33 -04:00
lite 16049fa3ef feat: add format system with auto-detection
- Add internal/formats/registry.go with Transformer interface
- Add internal/formats/native/ for current API format
- Add internal/formats/dolibarr/ for Dolibarr BFF format
- Refactor factura.go to use TransformAuto() for auto-detection
- Remove format query param — detection is now automatic
2026-05-17 16:27:27 -04:00
lite 74487015df docs: reorganize documentation and add prerequisites guide
- Move ERRORES.md to documentacion/
- Add PREREQUISITES.md with system requirements and setup steps
- Update documentacion/README.md as documentation index
- Simplify root README.md as project summary
2026-05-17 16:27:18 -04:00
admin 4225af5b05 Update documentation and organize test files
- Fix JSON syntax errors in api.md
- Fix typos in verifactu.md and formato_datos.md
- Update README.md with current status (anulation implemented)
- Move all Python test files to test/ folder
- Remove certificates from data/certs/ and test/certs/
2026-05-14 20:50:55 +02:00
admin 1ad84a3b14 Fix integración VeriFactu AEAT: XML, hash y encadenamiento
Bugs corregidos tras validación directa contra la plataforma de pruebas:

- Hash: formato key=valor& en lugar de separador |
- TipoHuella: código 01 en lugar de literal SHA-256
- FechaHoraHusoGenRegistro: formato ISO 8601 con huso horario
- IdSistemaInformatico: 2 caracteres (01)
- Namespaces SOAP: URLs correctas de www2.agenciatributaria.gob.es
- Estructura XML: eliminados wrappers Content/AltaReq sobrantes
- Encadenamiento: xs:choice correcto (PrimerRegistro XOR RegistroAnterior)
- RegistroAnterior: referencia datos de la factura anterior, no la actual
- Destinatarios: bloque obligatorio para facturas F1/F3/rectificativas
- wsu:Id: eliminado atributo con namespace no declarado
- Parser respuesta: mapeado a RespuestaRegFactuSistemaFacturacion real
- Campo emisor_nombre añadido al input de factura

La API envía y recibe correctamente contra prewww1.aeat.es
con respuesta EstadoEnvio=Correcto y CSV asignado por la AEAT.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 01:13:09 +02:00
admin b9899684cc Add FNMT certificate for entities without legal personality 2026-04-17 13:23:52 +02:00
admin ecc8ce475d Add FNMT valid certificates URL to documentation 2026-04-17 13:08:22 +02:00
admin 4ab7670232 Implement VeriFactu API with certificate management, invoice submission and local fallback
- Add API handlers for facturas (alta/anulacion)
- Implement certificate storage with temp/permanent flow
- Add token generation for authenticated sessions
- Add fallback to local storage when AEAT unavailable
- Update config with certificate path/password
- Add client certificate conversion for TLS
- Add comprehensive documentation
2026-04-17 13:03:06 +02:00
admin cd91c9921e update 2026-04-08 15:43:37 +02:00
admin 0de298687c api: add HTTP handlers and router for endpoints 2026-04-08 14:49:27 +02:00
admin e2d6fd7d02 docs: update README with config example 2026-04-08 14:40:49 +02:00
admin 0a7cf96211 config: add name and email for RSA key generation 2026-04-08 14:35:16 +02:00
admin 24c895abd7 internal: add config loader, crypto RSA and certificate storage 2026-04-08 14:31:09 +02:00
admin fbd5e72774 verifactu: add client and XML structures for AEAT communication 2026-04-08 14:31:05 +02:00
admin fa59c984bc internal: add models, validation, transformer and hash logic 2026-04-08 14:31:02 +02:00
admin 40e9067e04 docs: add error codes documentation 2026-04-08 14:30:58 +02:00
admin f509c21d9f docs: add README with API usage and structure 2026-04-08 14:30:54 +02:00
admin f0b3dc4e13 base: project structure and configuration 2026-04-08 14:30:50 +02:00