base: project structure and configuration

This commit is contained in:
admin 2026-04-08 14:30:50 +02:00
commit f0b3dc4e13
5 changed files with 109 additions and 0 deletions

43
.gitignore vendored Normal file
View File

@ -0,0 +1,43 @@
# Binarios
*.exe
*.dll
*.so
*.dylib
verifactu-api.exe
# Build
/build/
/dist/
# Go
*.test
coverage.txt
# IDE
.idea/
.vscode/
*.swp
*.swo
*~
# OS
.DS_Store
Thumbs.db
# Configuración sensible
.env
.env.local
config.local.yml
# Certificados y claves
certs/
keys/
*.p12
*.pem
*.key
# Documentación (no incluir en el repo)
Documentacion de Verifactu/
# Logs
*.log

47
AGENTS.md Normal file
View File

@ -0,0 +1,47 @@
# AGENTS.md
## Project
- Go 1.26.1
- No external dependencies yet
- Entry point: `main.go`
## Architecture
```
proyecto/
├── api/ → HTTP exposure, endpoints, routing
├── internal/ → business logic, validation, normalization
└── verifactu/ → AEAT communication, XML, signing, crypto chaining
```
## VeriFactu Protocol
- **Transport:** SOAP 1.1 / HTTPS
- **Format:** XML (UTF-8), document/literal
- **Auth:** Qualified electronic certificate (.p12)
- **Hash:** SHA-256, hex uppercase, chained with previous record
- **Max records per request:** 1,000
- **Environments:** Testing (sandbox) / Production
- **Current:** Testing only
- **Config:** Change via config file or env var (not code)
- **PDF generation:** Handled by Dolibarr (not this API's responsibility)
## VeriFactu Documentation
See `Documentacion de Verifactu/` folder:
- `01_que_es_verifactu.md` - Overview, legal framework
- `02_como_funciona.md` - Flow, operations, responses
- `03_entornos_y_urls.md` - URLs for test/prod, XSD, WSDL
- `04_encadenamiento_hash.md` - Crypto chaining, hash calculation
- `05_estructura_xml.md` - XML structure, fields
- `06_operaciones.md` - Alta, anulación, subsanación
- `07_consultas.md` - Query sent records
- `08_errores_y_respuestas.md` - Error codes
- `09_control_de_flujo.md` - Rate limits
- `10_pasar_a_produccion.md` - Prod migration steps
## Dependencies
- Use Go modules (`go.mod`), no vendoring
## Pending Decisions (to discuss)
- Exact input JSON format
- Authentication mechanism
- Persistence (database, file, etc.)
- Documentation language

11
config.yml Normal file
View File

@ -0,0 +1,11 @@
server:
port: 6789
verifactu:
environment: test
certificates:
storage_path: ./certs/
crypto:
keys_path: ./keys/

5
go.mod Normal file
View File

@ -0,0 +1,5 @@
module VerifactuMidAPI
go 1.26
require gopkg.in/yaml.v3 v3.0.1 // indirect

3
go.sum Normal file
View File

@ -0,0 +1,3 @@
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=