v1.27.6: Fix currency field in overdue/upcoming widgets, add common.items i18n
This commit is contained in:
parent
cc448b5cd4
commit
9dc9f1a0a1
@ -1,211 +0,0 @@
|
||||
╔═══════════════════════════════════════════════════════════════════════════════╗
|
||||
║ DIRETRIZES DE DESENVOLVIMENTO - v3.0 ║
|
||||
║ ║
|
||||
║ ⚠️ ESTE ARQUIVO NÃO DEVE SER EDITADO APÓS QUALQUER COMMIT/PUSH ║
|
||||
║ ⚠️ Representa o contrato de desenvolvimento desde a versão 1.19.2 ║
|
||||
║ ⚠️ Substitui .DIRETRIZES_DESENVOLVIMENTO_v2 (v2.0) ║
|
||||
║ ║
|
||||
╚═══════════════════════════════════════════════════════════════════════════════╝
|
||||
|
||||
DATA DE CRIAÇÃO: 10 de Dezembro de 2025
|
||||
VERSÃO INICIAL: 1.19.2
|
||||
VERSÃO DAS DIRETRIZES: 3.0
|
||||
STATUS: ATIVO E IMUTÁVEL
|
||||
|
||||
═══════════════════════════════════════════════════════════════════════════════
|
||||
REGRAS DE DESENVOLVIMENTO
|
||||
═══════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
───────────────────────────────────────────────────────────────────────────────
|
||||
REGRA #1: CONTROLE DE VERSÃO SEMÂNTICO
|
||||
───────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
✓ Formato: MAJOR.MINOR.PATCH (exemplo: 1.19.2)
|
||||
✓ Incrementar versão em CADA commit/push
|
||||
✓ Manter sincronizado em: VERSION, CHANGELOG.md
|
||||
|
||||
Regra de Incremento:
|
||||
- MAJOR (X.0.0): Mudanças incompatíveis, redesign completo
|
||||
- MINOR (0.X.0): Novas funcionalidades
|
||||
- PATCH (0.0.X): Correções de bugs, ajustes menores
|
||||
|
||||
───────────────────────────────────────────────────────────────────────────────
|
||||
REGRA #2: VALIDAÇÃO OBRIGATÓRIA EM PRODUÇÃO
|
||||
───────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
✓ TODAS as mudanças devem ser testadas em https://webmoney.cnxifly.com
|
||||
✓ Workflow obrigatório:
|
||||
1. Editar código
|
||||
2. Deploy para servidor (./deploy.sh)
|
||||
3. Testar no domínio
|
||||
4. Commit/push apenas após validação
|
||||
5. Só então editar novamente
|
||||
|
||||
✗ PROIBIDO commit sem teste em produção
|
||||
|
||||
───────────────────────────────────────────────────────────────────────────────
|
||||
REGRA #3: DOCUMENTAÇÃO ESSENCIAL
|
||||
───────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
Arquivos de documentação mantidos (apenas estes):
|
||||
|
||||
| Arquivo | Propósito | Atualizar quando |
|
||||
|---------|-----------|------------------|
|
||||
| VERSION | Número da versão | Cada commit |
|
||||
| CHANGELOG.md | Histórico de mudanças | Cada commit |
|
||||
| README.md | Visão geral do projeto | Mudanças significativas |
|
||||
| ESTRUTURA_PROJETO.md | Estrutura técnica | Novos arquivos/endpoints |
|
||||
| CREDENCIAIS_SERVIDOR.md | Acessos | Mudança de credenciais |
|
||||
| .DIRETRIZES_DESENVOLVIMENTO_v3 | Este arquivo | NUNCA (criar nova versão) |
|
||||
|
||||
Arquivos de referência (não atualizar frequentemente):
|
||||
- ESPECIFICACIONES_WEBMONEY.md (especificação original)
|
||||
- APRENDIZADOS_TECNICOS.md (soluções de problemas)
|
||||
- ROTEIRO_INSTALACAO_SERVIDOR.md (guia de instalação)
|
||||
- DKIM_DNS_RECORD.txt (configuração DNS)
|
||||
|
||||
───────────────────────────────────────────────────────────────────────────────
|
||||
REGRA #4: SCRIPTS DE DEPLOY
|
||||
───────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
✓ SEMPRE usar os scripts de deploy:
|
||||
|
||||
Frontend: cd frontend && ./deploy.sh
|
||||
Backend: cd backend && ./deploy.sh
|
||||
|
||||
✗ NUNCA enviar arquivos manualmente via scp para diretórios errados
|
||||
✓ Os scripts garantem o caminho correto:
|
||||
- Frontend → /var/www/webmoney/frontend/dist
|
||||
- Backend → /var/www/webmoney/backend
|
||||
|
||||
───────────────────────────────────────────────────────────────────────────────
|
||||
REGRA #5: CHECKLIST DE COMMIT
|
||||
───────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
Antes de CADA commit:
|
||||
☑ VERSION atualizado
|
||||
☑ CHANGELOG.md atualizado
|
||||
☑ Deploy executado (./deploy.sh)
|
||||
☑ Testado em webmoney.cnxifly.com
|
||||
☑ Sem erros no console do navegador
|
||||
☑ Mensagem de commit descritiva
|
||||
|
||||
───────────────────────────────────────────────────────────────────────────────
|
||||
REGRA #6: PROIBIÇÕES EXPLÍCITAS
|
||||
───────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
✗ NÃO editar arquivos sem commit anterior
|
||||
✗ NÃO criar documentação específica de versão (ex: DEPLOY_v1.9.0.md)
|
||||
✗ NÃO duplicar informação em múltiplos arquivos
|
||||
✗ NÃO fazer deploy manual (usar scripts)
|
||||
✗ NÃO commitar sem testar em produção
|
||||
|
||||
═══════════════════════════════════════════════════════════════════════════════
|
||||
INFRAESTRUTURA
|
||||
═══════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
───────────────────────────────────────────────────────────────────────────────
|
||||
SERVIDOR DE PRODUÇÃO
|
||||
───────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
IP: 213.165.93.60
|
||||
Acesso: sshpass -p 'Master9354' ssh root@213.165.93.60
|
||||
|
||||
Estrutura:
|
||||
/var/www/webmoney/
|
||||
├── backend/ # Laravel API
|
||||
└── frontend/
|
||||
└── dist/ # React build (Nginx root)
|
||||
|
||||
───────────────────────────────────────────────────────────────────────────────
|
||||
DOMÍNIOS
|
||||
───────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
| Subdomínio | Função |
|
||||
|------------|--------|
|
||||
| webmoney.cnxifly.com | Aplicação principal |
|
||||
| phpmyadmin.cnxifly.com | Banco de dados |
|
||||
| webmail.cnxifly.com | Email |
|
||||
| mail.cnxifly.com | PostfixAdmin |
|
||||
|
||||
───────────────────────────────────────────────────────────────────────────────
|
||||
STACK TECNOLÓGICA
|
||||
───────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
| Camada | Tecnologia |
|
||||
|--------|------------|
|
||||
| Backend | Laravel 12 + PHP 8.4-FPM |
|
||||
| Frontend | React 18 + Vite 7 + Bootstrap 5 |
|
||||
| Banco | MariaDB 11.4 |
|
||||
| Cache | Redis |
|
||||
| Servidor | Nginx + SSL (Let's Encrypt) |
|
||||
| Auth | Laravel Sanctum (Bearer Tokens) |
|
||||
|
||||
═══════════════════════════════════════════════════════════════════════════════
|
||||
SEGURANÇA
|
||||
═══════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
Implementado em v1.19.0:
|
||||
|
||||
| Recurso | Configuração |
|
||||
|---------|--------------|
|
||||
| Rate Limiting | Login: 5/min, Register: 10/hour |
|
||||
| CORS | Restrito a webmoney.cnxifly.com |
|
||||
| Token Expiration | 7 dias |
|
||||
| Cookies | HttpOnly, Secure, SameSite=lax, Encrypt=true |
|
||||
| Headers | X-XSS-Protection, X-Content-Type-Options, X-Frame-Options, CSP |
|
||||
| Cookie Consent | Banner LGPD/GDPR |
|
||||
|
||||
═══════════════════════════════════════════════════════════════════════════════
|
||||
ESTADO ATUAL
|
||||
═══════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
Versão: 1.19.2
|
||||
Data: 10 de Dezembro de 2025
|
||||
Status: Produção estável
|
||||
|
||||
Funcionalidades:
|
||||
✅ Autenticação (login, registro, logout)
|
||||
✅ Dashboard (gráficos, análises)
|
||||
✅ Contas bancárias (CRUD, multi-moeda)
|
||||
✅ Transações (agrupamento por semana, filtros)
|
||||
✅ Categorias (175 pré-configuradas, auto-classificação)
|
||||
✅ Centros de custo
|
||||
✅ Importação de extratos (XLSX, CSV, OFX, PDF)
|
||||
✅ Detecção de duplicatas (auto-delete)
|
||||
✅ Detecção de transferências
|
||||
✅ Contas passivo (financiamentos)
|
||||
✅ Multi-idioma (ES, PT-BR, EN) com detecção por país
|
||||
✅ Tema dark
|
||||
✅ Cookie consent (LGPD/GDPR)
|
||||
✅ Segurança hardening
|
||||
|
||||
═══════════════════════════════════════════════════════════════════════════════
|
||||
HISTÓRICO DE DIRETRIZES
|
||||
═══════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
| Versão | Data | Mudanças |
|
||||
|--------|------|----------|
|
||||
| v1.0 | 2025-12-07 | Criação inicial |
|
||||
| v2.0 | 2025-12-08 | Adicionada REGRA #8 (ESTRUTURA_PROJETO) |
|
||||
| v3.0 | 2025-12-10 | Simplificação, remoção de redundâncias, estado atual |
|
||||
|
||||
Arquivos de diretrizes:
|
||||
- .DIRETRIZES_DESENVOLVIMENTO (v1.0 - EXCLUÍDO)
|
||||
- .DIRETRIZES_DESENVOLVIMENTO_v2 (v2.0 - arquivado)
|
||||
- .DIRETRIZES_DESENVOLVIMENTO_v3 (v3.0 - ATIVO)
|
||||
|
||||
═══════════════════════════════════════════════════════════════════════════════
|
||||
⚠️ LEMBRETE FINAL
|
||||
═══════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
ANTES de editar qualquer arquivo:
|
||||
1. ✓ Último commit foi feito?
|
||||
2. ✓ VERSION será incrementado?
|
||||
3. ✓ CHANGELOG será atualizado?
|
||||
4. ✓ Deploy será feito via script?
|
||||
5. ✓ Teste em produção será realizado?
|
||||
|
||||
Este documento é IMUTÁVEL. Qualquer mudança requer criar v4.0.
|
||||
|
||||
═══════════════════════════════════════════════════════════════════════════════
|
||||
11
CHANGELOG.md
11
CHANGELOG.md
@ -5,6 +5,17 @@ O formato segue [Keep a Changelog](https://keepachangelog.com/pt-BR/).
|
||||
Este projeto adota [Versionamento Semântico](https://semver.org/pt-BR/).
|
||||
|
||||
|
||||
## [1.27.6] - 2025-12-13
|
||||
|
||||
### Fixed
|
||||
- **Divisa en Widgets Overdue/Upcoming** - Corregido campo `currency` faltante
|
||||
- Backend: Agregado campo `currency` directo en items de `upcomingTransactions` y `overdueTransactions`
|
||||
- Liability items ahora incluyen su moneda desde `liabilityAccount->currency`
|
||||
- Frontend: Usa `item.currency` como primera opción, fallback a `item.account?.currency`
|
||||
|
||||
- **Traducción i18n faltante** - Agregado `common.item` y `common.items` en ES, PT-BR, EN
|
||||
|
||||
|
||||
## [1.27.5] - 2025-12-13
|
||||
|
||||
### Fixed
|
||||
|
||||
@ -685,6 +685,7 @@ public function upcomingTransactions(Request $request): JsonResponse
|
||||
'date_formatted' => $t->effective_date->translatedFormat('D, d M'),
|
||||
'description' => $t->description,
|
||||
'amount' => (float) $t->amount,
|
||||
'currency' => $t->account->currency ?? 'EUR',
|
||||
'transaction_type' => $t->type,
|
||||
'status' => $t->status,
|
||||
'is_transfer' => $t->is_transfer,
|
||||
@ -719,6 +720,7 @@ public function upcomingTransactions(Request $request): JsonResponse
|
||||
'date_formatted' => $ri->due_date->translatedFormat('D, d M'),
|
||||
'description' => $ri->template->name ?? 'Recorrência',
|
||||
'amount' => (float) $ri->planned_amount,
|
||||
'currency' => $ri->template->account->currency ?? 'EUR',
|
||||
'transaction_type' => $ri->template->type ?? 'debit',
|
||||
'status' => $ri->status,
|
||||
'occurrence_number' => $ri->occurrence_number,
|
||||
@ -811,6 +813,7 @@ public function overdueTransactions(Request $request): JsonResponse
|
||||
'planned_date_formatted' => $t->planned_date->translatedFormat('D, d M Y'),
|
||||
'description' => $t->description,
|
||||
'amount' => (float) ($t->planned_amount ?? $t->amount),
|
||||
'currency' => $t->account->currency ?? 'EUR',
|
||||
'transaction_type' => $t->type,
|
||||
'status' => $t->status,
|
||||
'days_overdue' => $daysOverdue,
|
||||
@ -848,6 +851,7 @@ public function overdueTransactions(Request $request): JsonResponse
|
||||
'planned_date_formatted' => $ri->due_date->translatedFormat('D, d M Y'),
|
||||
'description' => $ri->template->name ?? 'Recorrência',
|
||||
'amount' => (float) $ri->planned_amount,
|
||||
'currency' => $ri->template->account->currency ?? 'EUR',
|
||||
'transaction_type' => $ri->template->type ?? 'debit',
|
||||
'status' => $ri->status,
|
||||
'occurrence_number' => $ri->occurrence_number,
|
||||
@ -888,6 +892,7 @@ public function overdueTransactions(Request $request): JsonResponse
|
||||
'planned_date_formatted' => $li->due_date->translatedFormat('D, d M Y'),
|
||||
'description' => $li->liabilityAccount->name . ' - Parcela ' . $li->installment_number,
|
||||
'amount' => (float) $li->amount,
|
||||
'currency' => $li->liabilityAccount->currency ?? 'EUR',
|
||||
'transaction_type' => 'debit',
|
||||
'status' => $li->status,
|
||||
'installment_number' => $li->installment_number,
|
||||
|
||||
@ -220,7 +220,7 @@ const OverdueWidget = () => {
|
||||
item.transaction_type === 'credit' ? 'text-success' : 'text-danger'
|
||||
}`}>
|
||||
{item.transaction_type === 'credit' ? '+' : '-'}
|
||||
{currency(item.amount, item.account?.currency || 'BRL')}
|
||||
{currency(item.amount, item.currency || item.account?.currency || 'EUR')}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
|
||||
@ -142,7 +142,7 @@ const UpcomingWidget = () => {
|
||||
item.transaction_type === 'credit' ? 'text-success' : 'text-danger'
|
||||
}`}>
|
||||
{item.transaction_type === 'credit' ? '+' : '-'}
|
||||
{currency(item.amount, item.account?.currency || 'EUR')}
|
||||
{currency(item.amount, item.currency || item.account?.currency || 'EUR')}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
|
||||
@ -49,6 +49,8 @@
|
||||
"processing": "Processing...",
|
||||
"day": "day",
|
||||
"days": "days",
|
||||
"item": "item",
|
||||
"items": "items",
|
||||
"difference": "Difference",
|
||||
"months": "months",
|
||||
"viewAll": "View all",
|
||||
|
||||
@ -49,6 +49,8 @@
|
||||
"processing": "Procesando...",
|
||||
"day": "día",
|
||||
"days": "días",
|
||||
"item": "elemento",
|
||||
"items": "elementos",
|
||||
"difference": "Diferencia",
|
||||
"months": "meses",
|
||||
"viewAll": "Ver todos",
|
||||
|
||||
@ -49,6 +49,8 @@
|
||||
"processing": "Processando...",
|
||||
"day": "dia",
|
||||
"days": "dias",
|
||||
"item": "item",
|
||||
"items": "itens",
|
||||
"difference": "Diferença",
|
||||
"months": "meses",
|
||||
"viewAll": "Ver todos",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user