Skip to content

Fix/backend frontend return - #4

Merged
lucasgfaj merged 4 commits into
developfrom
fix/backend-frontend-return
Jun 8, 2026
Merged

Fix/backend frontend return#4
lucasgfaj merged 4 commits into
developfrom
fix/backend-frontend-return

Conversation

@lucasgfaj

Copy link
Copy Markdown
Owner

No description provided.

@lucasgfaj
lucasgfaj merged commit 35b6983 into develop Jun 8, 2026
2 checks passed
@lucasgfaj
lucasgfaj deleted the fix/backend-frontend-return branch June 8, 2026 19:19
lucasgfaj added a commit that referenced this pull request Jun 8, 2026
* ldap auth using credentials

* feat: create crud visitorTypes

* fix: ldap

* docs: add PRD and SSD documentation

- PRD: Product Requirements Document with features, use cases, wireframes
- SSD: System Specification Document with architecture, DB, APIs

* feat: add created_by to vouchers and activity logging

- Add migration to add created_by column to visitor_vouchers
- Update Voucher model with created_by and creator relationship
- Create ActivityLogService for centralized logging
- Add activity logging to VisitorsController (create, update, delete, password)
- Add activity logging to DisableExpiredVisitors command
- Add activity logging to DepartmentsController
- Add activity logging to VisitorTypeController

* feat: implement dashboard with metrics

- Add DashboardController with stats: total, this month, expired
- Add visitors by department (with creator department)
- Add visitors by month (trend chart data)
- Add next to expire (7 days) list
- Add already expired list
- Add recent activities from activity_logs
- Update dashboard frontend with cards and lists

* docs: update PHP and tech versions in PRD and SSD

* docs: add Tailwind CSS version

* docs: remove sensitive data (replace with generic names)

* refactor: implement SOLID principles with interfaces and services

- Add contracts/ directory with interfaces (SambaInterface, ActivityLogInterface, VisitorInterface, VoucherInterface)
- Create VisitorService with single responsibility for visitor operations
- Create VoucherService for voucher management
- Refactor VisitorsController to use VisitorService via dependency injection
- Update DepartmentsController and VisitorTypeController to use ActivityLogInterface
- Update DisableExpiredVisitors command to use interfaces
- Register ServiceServiceProvider for dependency injection

Applies SOLID principles:
- Single Responsibility: Services have focused responsibilities
- Open/Closed: Classes implement interfaces for extensibility
- Liskov Substitution: Interfaces are interchangeable
- Interface Segregation: Small, specific interfaces
- Dependency Injection: Controllers depend on abstractions

* feat: show department access error on login

When user authenticates but department is not mapped in the system,
show error message: 'Seu departamento não tem acesso a este sistema.
Favor verificar com a COGETI.'

* feat: improve login error messages

- Remove pattern validation on username field
- Improve 'invalid credentials' message to be more clear
- Show user's groups when department is not mapped: 'Seu grupo (X, Y) não tem acesso ao sistema. Favor verificar com a COGETI.'

* feat: implement visitor batch import via CSV

- Add CSV import functionality for visitors (name, cpf, email, phone, reason)
- Create import_batches and import_errors tables for tracking
- Implement queue jobs for background processing with email dispatch
- Add VisitorImportService with CPF validation and duplicate checking
- Create import batches management page (list, show, delete)
- Add show() method to VisitorsController for visitor details
- Fix route ordering for visitors/import
- Add department filtering to dashboard for operators
- Update SSD/PRD documentation with new tables and features
- Improve sidebar with imports menu

Features:
- Email is required for import (to send login/password)
- CPF validation with mathematical check
- Email duplicate check
- Reason/motivo mapped to school field
- Default type and expiry date from form
- Errors displayed per line in import details
- Dashboard auto-refresh every 5 seconds

* feat: add xlsx support for visitor import and fix CPF validation bug

* feat: add auto-refresh to import batch pages and queue worker service

* fix: corrige total_rows e mejora UI de importacao

* feat: add auto-refresh to all list pages and fix success_count duplication

- Add 5-second auto-refresh to visitors, vouchers, users, departments, visitorTypes, import-batches
- Remove duplicate filtering in VisitorImportService (was causing double counting)
- Fix total_rows to count only valid rows (after filtering empty lines)
- Improve import file upload UI with drag & drop zone
- Update SSD and PRD documentation with new features

* docs: add duplicate success_count bug to PRD pending items

* chore: remove nginx access.log from git tracking and update visitor import jobs

* feat: add activities page, fix route conflicts, improve visitor import and UI

- Add ActivitiesController with index and show pages
- Fix route conflict: visitors/{visitor} now accepts only numeric IDs
- Add route constraint to prevent 'import' being captured as visitor ID
- Improve VisitorImportService array key handling to avoid undefined errors
- Fix duplicate scopeDepartmentFilter in Visitor model
- Add VisitorException and VisitorError enum
- Add SambaService and update visitor creation workflow
- Enhance UI with auto-refresh, pagination fixes, and better feedback

* feat: format activities index and show like dashboard

- Add action_label and department to activities index
- Format user info with role in show page
- Remove duplicate getActionLabel from frontend
- Use action_label from backend instead

* feat: show only 5 recent activities in dashboard with link to details

- Change limit from 15 to 5
- Add user_role field
- Make items clickable with link to /activities/{id}
- Add admin badge for admin users

* feat: track activity with correct user_id from controllers/jobs

- Pass userId explicitly to activity log methods
- Use User::find() when no auth user available
- More descriptive action descriptions
- Add user_role field to logs

* fix: corrections to activities and visitor expiration logic

- Fix typo in activities index (Acao -> Ação)
- Include user name in activity descriptions
- Fix dashboard visitor expiration logic (today still valid, expired after today)
- Set timezone to America/Sao_Paulo
- Update UserFactory for tests
- Add ActivitiesTest

* fix: cron

* feat: melhorias diversas - validação, abreviação de nomes e flash messages

- Adiciona validação de data de expiração no generatePassword do backend
- Implementa abreviação de nomes (primeiro + último sobrenome) em visitors, dashboard, vouchers e import-batches
- Corrige logs de atividade para usar user_id correto ao invés de created_by
- Ajusta redirect no controller para manter usuário na página do visitante após ações
- Melhora tratamento de flash messages para toasts funcionarem corretamente
- Corrige timezone no DashboardController usando UTC para compatibilidade com PostgreSQL

* feat: melhorias diversas - responsividade, logs e auto-refresh

- Ajusta paginação para responsividade mobile em activities e import-batches
- Adiciona log de senha reenviada em activities
- Corrige auto-refresh para só rodar quando necessário (importações processando, vouchers prestes a expirar)
- Desativa barra de progresso do Inertia para evitar indicador girando
- Corrige lógica de status de import batch (completed vs partial)
- Ajusta visitantes/show para ter ConfirmDialog no botão editar

* fix: ajustes de layout e status de importação

- Ajusta import-batches/show com layout responsivo (p-4 sm:p-6)
- Corrige lógica de status para completed quando processado
- Ajusta atividades para não truncar texto da ação
- Corrige timezone do dashboard para UTC

* fix: corrige argumentos em ActivityLogService e adiciona filtragem por departamento em import-batches

* fix: remove testes iniciais do Laravel e corrige erros de ESLint (any types, imports nao usados)

* fix: remove orphaned register page (registration disabled in Fortify)

* fix: remove unused canRegister prop to fix lint error

* docs: reorganizar SSD com componentes detalhados, ER diagram completo e tabelas de campos separadas por categoria

* docs: sync PRD and SSD with actual code implementation

- Fix versions: React 19.x, Tailwind 4.x, Vite 7.x, PostgreSQL only
- Add sections: fluxo de criação/voucher, VisitorService, notifications,
  ActivityLogService, importação em lote, tratamento de erros
- Fix LDAP, SSH/Samba specs to match real implementation
- Fix operator visibility (department filter, not self-created)
- Fix RF17 renumbering in PRD

* docs: rewrite README.md in Portuguese with full setup guide

Based on PRD and SSD, covering:
- System description and architecture
- VM setup (Docker, PHP, Node, tools)
- SSH key configuration for Samba
- Environment variables (placeholders only)
- Build and run steps with ./run script
- All available commands reference

* Fix/backend frontend return (#4)

* fix: corrige flash messages, timeout SSH, deleção de visitantes e role por departamento

* fix: validação de filtro de departamento em visitantes e endurecimento de regras de request

* fix: substitui hardcoded department_id por isAdmin() no dashboard e adiciona total de vouchers

* fix:linter

---------

Co-authored-by: LUCAS GONTARZ FAJARDO <estag.lucasfajardo@utfpr.edu.br>
lucasgfaj added a commit that referenced this pull request Jun 19, 2026
* Develop Create a PRD and SSD Docs (#3)

* ldap auth using credentials

* feat: create crud visitorTypes

* fix: ldap

* docs: add PRD and SSD documentation

- PRD: Product Requirements Document with features, use cases, wireframes
- SSD: System Specification Document with architecture, DB, APIs

* feat: add created_by to vouchers and activity logging

- Add migration to add created_by column to visitor_vouchers
- Update Voucher model with created_by and creator relationship
- Create ActivityLogService for centralized logging
- Add activity logging to VisitorsController (create, update, delete, password)
- Add activity logging to DisableExpiredVisitors command
- Add activity logging to DepartmentsController
- Add activity logging to VisitorTypeController

* feat: implement dashboard with metrics

- Add DashboardController with stats: total, this month, expired
- Add visitors by department (with creator department)
- Add visitors by month (trend chart data)
- Add next to expire (7 days) list
- Add already expired list
- Add recent activities from activity_logs
- Update dashboard frontend with cards and lists

* docs: update PHP and tech versions in PRD and SSD

* docs: add Tailwind CSS version

* docs: remove sensitive data (replace with generic names)

* refactor: implement SOLID principles with interfaces and services

- Add contracts/ directory with interfaces (SambaInterface, ActivityLogInterface, VisitorInterface, VoucherInterface)
- Create VisitorService with single responsibility for visitor operations
- Create VoucherService for voucher management
- Refactor VisitorsController to use VisitorService via dependency injection
- Update DepartmentsController and VisitorTypeController to use ActivityLogInterface
- Update DisableExpiredVisitors command to use interfaces
- Register ServiceServiceProvider for dependency injection

Applies SOLID principles:
- Single Responsibility: Services have focused responsibilities
- Open/Closed: Classes implement interfaces for extensibility
- Liskov Substitution: Interfaces are interchangeable
- Interface Segregation: Small, specific interfaces
- Dependency Injection: Controllers depend on abstractions

* feat: show department access error on login

When user authenticates but department is not mapped in the system,
show error message: 'Seu departamento não tem acesso a este sistema.
Favor verificar com a COGETI.'

* feat: improve login error messages

- Remove pattern validation on username field
- Improve 'invalid credentials' message to be more clear
- Show user's groups when department is not mapped: 'Seu grupo (X, Y) não tem acesso ao sistema. Favor verificar com a COGETI.'

* feat: implement visitor batch import via CSV

- Add CSV import functionality for visitors (name, cpf, email, phone, reason)
- Create import_batches and import_errors tables for tracking
- Implement queue jobs for background processing with email dispatch
- Add VisitorImportService with CPF validation and duplicate checking
- Create import batches management page (list, show, delete)
- Add show() method to VisitorsController for visitor details
- Fix route ordering for visitors/import
- Add department filtering to dashboard for operators
- Update SSD/PRD documentation with new tables and features
- Improve sidebar with imports menu

Features:
- Email is required for import (to send login/password)
- CPF validation with mathematical check
- Email duplicate check
- Reason/motivo mapped to school field
- Default type and expiry date from form
- Errors displayed per line in import details
- Dashboard auto-refresh every 5 seconds

* feat: add xlsx support for visitor import and fix CPF validation bug

* feat: add auto-refresh to import batch pages and queue worker service

* fix: corrige total_rows e mejora UI de importacao

* feat: add auto-refresh to all list pages and fix success_count duplication

- Add 5-second auto-refresh to visitors, vouchers, users, departments, visitorTypes, import-batches
- Remove duplicate filtering in VisitorImportService (was causing double counting)
- Fix total_rows to count only valid rows (after filtering empty lines)
- Improve import file upload UI with drag & drop zone
- Update SSD and PRD documentation with new features

* docs: add duplicate success_count bug to PRD pending items

* chore: remove nginx access.log from git tracking and update visitor import jobs

* feat: add activities page, fix route conflicts, improve visitor import and UI

- Add ActivitiesController with index and show pages
- Fix route conflict: visitors/{visitor} now accepts only numeric IDs
- Add route constraint to prevent 'import' being captured as visitor ID
- Improve VisitorImportService array key handling to avoid undefined errors
- Fix duplicate scopeDepartmentFilter in Visitor model
- Add VisitorException and VisitorError enum
- Add SambaService and update visitor creation workflow
- Enhance UI with auto-refresh, pagination fixes, and better feedback

* feat: format activities index and show like dashboard

- Add action_label and department to activities index
- Format user info with role in show page
- Remove duplicate getActionLabel from frontend
- Use action_label from backend instead

* feat: show only 5 recent activities in dashboard with link to details

- Change limit from 15 to 5
- Add user_role field
- Make items clickable with link to /activities/{id}
- Add admin badge for admin users

* feat: track activity with correct user_id from controllers/jobs

- Pass userId explicitly to activity log methods
- Use User::find() when no auth user available
- More descriptive action descriptions
- Add user_role field to logs

* fix: corrections to activities and visitor expiration logic

- Fix typo in activities index (Acao -> Ação)
- Include user name in activity descriptions
- Fix dashboard visitor expiration logic (today still valid, expired after today)
- Set timezone to America/Sao_Paulo
- Update UserFactory for tests
- Add ActivitiesTest

* fix: cron

* feat: melhorias diversas - validação, abreviação de nomes e flash messages

- Adiciona validação de data de expiração no generatePassword do backend
- Implementa abreviação de nomes (primeiro + último sobrenome) em visitors, dashboard, vouchers e import-batches
- Corrige logs de atividade para usar user_id correto ao invés de created_by
- Ajusta redirect no controller para manter usuário na página do visitante após ações
- Melhora tratamento de flash messages para toasts funcionarem corretamente
- Corrige timezone no DashboardController usando UTC para compatibilidade com PostgreSQL

* feat: melhorias diversas - responsividade, logs e auto-refresh

- Ajusta paginação para responsividade mobile em activities e import-batches
- Adiciona log de senha reenviada em activities
- Corrige auto-refresh para só rodar quando necessário (importações processando, vouchers prestes a expirar)
- Desativa barra de progresso do Inertia para evitar indicador girando
- Corrige lógica de status de import batch (completed vs partial)
- Ajusta visitantes/show para ter ConfirmDialog no botão editar

* fix: ajustes de layout e status de importação

- Ajusta import-batches/show com layout responsivo (p-4 sm:p-6)
- Corrige lógica de status para completed quando processado
- Ajusta atividades para não truncar texto da ação
- Corrige timezone do dashboard para UTC

* fix: corrige argumentos em ActivityLogService e adiciona filtragem por departamento em import-batches

* fix: remove testes iniciais do Laravel e corrige erros de ESLint (any types, imports nao usados)

* fix: remove orphaned register page (registration disabled in Fortify)

* fix: remove unused canRegister prop to fix lint error

* docs: reorganizar SSD com componentes detalhados, ER diagram completo e tabelas de campos separadas por categoria

* docs: sync PRD and SSD with actual code implementation

- Fix versions: React 19.x, Tailwind 4.x, Vite 7.x, PostgreSQL only
- Add sections: fluxo de criação/voucher, VisitorService, notifications,
  ActivityLogService, importação em lote, tratamento de erros
- Fix LDAP, SSH/Samba specs to match real implementation
- Fix operator visibility (department filter, not self-created)
- Fix RF17 renumbering in PRD

* docs: rewrite README.md in Portuguese with full setup guide

Based on PRD and SSD, covering:
- System description and architecture
- VM setup (Docker, PHP, Node, tools)
- SSH key configuration for Samba
- Environment variables (placeholders only)
- Build and run steps with ./run script
- All available commands reference

---------

Co-authored-by: LUCAS GONTARZ FAJARDO <estag.lucasfajardo@utfpr.edu.br>

* Develop PR (#5)

* ldap auth using credentials

* feat: create crud visitorTypes

* fix: ldap

* docs: add PRD and SSD documentation

- PRD: Product Requirements Document with features, use cases, wireframes
- SSD: System Specification Document with architecture, DB, APIs

* feat: add created_by to vouchers and activity logging

- Add migration to add created_by column to visitor_vouchers
- Update Voucher model with created_by and creator relationship
- Create ActivityLogService for centralized logging
- Add activity logging to VisitorsController (create, update, delete, password)
- Add activity logging to DisableExpiredVisitors command
- Add activity logging to DepartmentsController
- Add activity logging to VisitorTypeController

* feat: implement dashboard with metrics

- Add DashboardController with stats: total, this month, expired
- Add visitors by department (with creator department)
- Add visitors by month (trend chart data)
- Add next to expire (7 days) list
- Add already expired list
- Add recent activities from activity_logs
- Update dashboard frontend with cards and lists

* docs: update PHP and tech versions in PRD and SSD

* docs: add Tailwind CSS version

* docs: remove sensitive data (replace with generic names)

* refactor: implement SOLID principles with interfaces and services

- Add contracts/ directory with interfaces (SambaInterface, ActivityLogInterface, VisitorInterface, VoucherInterface)
- Create VisitorService with single responsibility for visitor operations
- Create VoucherService for voucher management
- Refactor VisitorsController to use VisitorService via dependency injection
- Update DepartmentsController and VisitorTypeController to use ActivityLogInterface
- Update DisableExpiredVisitors command to use interfaces
- Register ServiceServiceProvider for dependency injection

Applies SOLID principles:
- Single Responsibility: Services have focused responsibilities
- Open/Closed: Classes implement interfaces for extensibility
- Liskov Substitution: Interfaces are interchangeable
- Interface Segregation: Small, specific interfaces
- Dependency Injection: Controllers depend on abstractions

* feat: show department access error on login

When user authenticates but department is not mapped in the system,
show error message: 'Seu departamento não tem acesso a este sistema.
Favor verificar com a COGETI.'

* feat: improve login error messages

- Remove pattern validation on username field
- Improve 'invalid credentials' message to be more clear
- Show user's groups when department is not mapped: 'Seu grupo (X, Y) não tem acesso ao sistema. Favor verificar com a COGETI.'

* feat: implement visitor batch import via CSV

- Add CSV import functionality for visitors (name, cpf, email, phone, reason)
- Create import_batches and import_errors tables for tracking
- Implement queue jobs for background processing with email dispatch
- Add VisitorImportService with CPF validation and duplicate checking
- Create import batches management page (list, show, delete)
- Add show() method to VisitorsController for visitor details
- Fix route ordering for visitors/import
- Add department filtering to dashboard for operators
- Update SSD/PRD documentation with new tables and features
- Improve sidebar with imports menu

Features:
- Email is required for import (to send login/password)
- CPF validation with mathematical check
- Email duplicate check
- Reason/motivo mapped to school field
- Default type and expiry date from form
- Errors displayed per line in import details
- Dashboard auto-refresh every 5 seconds

* feat: add xlsx support for visitor import and fix CPF validation bug

* feat: add auto-refresh to import batch pages and queue worker service

* fix: corrige total_rows e mejora UI de importacao

* feat: add auto-refresh to all list pages and fix success_count duplication

- Add 5-second auto-refresh to visitors, vouchers, users, departments, visitorTypes, import-batches
- Remove duplicate filtering in VisitorImportService (was causing double counting)
- Fix total_rows to count only valid rows (after filtering empty lines)
- Improve import file upload UI with drag & drop zone
- Update SSD and PRD documentation with new features

* docs: add duplicate success_count bug to PRD pending items

* chore: remove nginx access.log from git tracking and update visitor import jobs

* feat: add activities page, fix route conflicts, improve visitor import and UI

- Add ActivitiesController with index and show pages
- Fix route conflict: visitors/{visitor} now accepts only numeric IDs
- Add route constraint to prevent 'import' being captured as visitor ID
- Improve VisitorImportService array key handling to avoid undefined errors
- Fix duplicate scopeDepartmentFilter in Visitor model
- Add VisitorException and VisitorError enum
- Add SambaService and update visitor creation workflow
- Enhance UI with auto-refresh, pagination fixes, and better feedback

* feat: format activities index and show like dashboard

- Add action_label and department to activities index
- Format user info with role in show page
- Remove duplicate getActionLabel from frontend
- Use action_label from backend instead

* feat: show only 5 recent activities in dashboard with link to details

- Change limit from 15 to 5
- Add user_role field
- Make items clickable with link to /activities/{id}
- Add admin badge for admin users

* feat: track activity with correct user_id from controllers/jobs

- Pass userId explicitly to activity log methods
- Use User::find() when no auth user available
- More descriptive action descriptions
- Add user_role field to logs

* fix: corrections to activities and visitor expiration logic

- Fix typo in activities index (Acao -> Ação)
- Include user name in activity descriptions
- Fix dashboard visitor expiration logic (today still valid, expired after today)
- Set timezone to America/Sao_Paulo
- Update UserFactory for tests
- Add ActivitiesTest

* fix: cron

* feat: melhorias diversas - validação, abreviação de nomes e flash messages

- Adiciona validação de data de expiração no generatePassword do backend
- Implementa abreviação de nomes (primeiro + último sobrenome) em visitors, dashboard, vouchers e import-batches
- Corrige logs de atividade para usar user_id correto ao invés de created_by
- Ajusta redirect no controller para manter usuário na página do visitante após ações
- Melhora tratamento de flash messages para toasts funcionarem corretamente
- Corrige timezone no DashboardController usando UTC para compatibilidade com PostgreSQL

* feat: melhorias diversas - responsividade, logs e auto-refresh

- Ajusta paginação para responsividade mobile em activities e import-batches
- Adiciona log de senha reenviada em activities
- Corrige auto-refresh para só rodar quando necessário (importações processando, vouchers prestes a expirar)
- Desativa barra de progresso do Inertia para evitar indicador girando
- Corrige lógica de status de import batch (completed vs partial)
- Ajusta visitantes/show para ter ConfirmDialog no botão editar

* fix: ajustes de layout e status de importação

- Ajusta import-batches/show com layout responsivo (p-4 sm:p-6)
- Corrige lógica de status para completed quando processado
- Ajusta atividades para não truncar texto da ação
- Corrige timezone do dashboard para UTC

* fix: corrige argumentos em ActivityLogService e adiciona filtragem por departamento em import-batches

* fix: remove testes iniciais do Laravel e corrige erros de ESLint (any types, imports nao usados)

* fix: remove orphaned register page (registration disabled in Fortify)

* fix: remove unused canRegister prop to fix lint error

* docs: reorganizar SSD com componentes detalhados, ER diagram completo e tabelas de campos separadas por categoria

* docs: sync PRD and SSD with actual code implementation

- Fix versions: React 19.x, Tailwind 4.x, Vite 7.x, PostgreSQL only
- Add sections: fluxo de criação/voucher, VisitorService, notifications,
  ActivityLogService, importação em lote, tratamento de erros
- Fix LDAP, SSH/Samba specs to match real implementation
- Fix operator visibility (department filter, not self-created)
- Fix RF17 renumbering in PRD

* docs: rewrite README.md in Portuguese with full setup guide

Based on PRD and SSD, covering:
- System description and architecture
- VM setup (Docker, PHP, Node, tools)
- SSH key configuration for Samba
- Environment variables (placeholders only)
- Build and run steps with ./run script
- All available commands reference

* Fix/backend frontend return (#4)

* fix: corrige flash messages, timeout SSH, deleção de visitantes e role por departamento

* fix: validação de filtro de departamento em visitantes e endurecimento de regras de request

* fix: substitui hardcoded department_id por isAdmin() no dashboard e adiciona total de vouchers

* fix:linter

---------

Co-authored-by: LUCAS GONTARZ FAJARDO <estag.lucasfajardo@utfpr.edu.br>

* fix: dashboard counts, import error edit/retry/skip, visitor pagination, flash dedup, date validation, password email on edit

* docs: update PRD and SSD with import error management, dashboard fixes, duplicate CPF, pagination, cron fix

* fix: dashboard import errors count excludes skipped errors

* feat: show skipped count on dashboard import stats

---------

Co-authored-by: LUCAS GONTARZ FAJARDO <estag.lucasfajardo@utfpr.edu.br>
lucasgfaj added a commit that referenced this pull request Jun 19, 2026
* ldap auth using credentials

* feat: create crud visitorTypes

* fix: ldap

* docs: add PRD and SSD documentation

- PRD: Product Requirements Document with features, use cases, wireframes
- SSD: System Specification Document with architecture, DB, APIs

* feat: add created_by to vouchers and activity logging

- Add migration to add created_by column to visitor_vouchers
- Update Voucher model with created_by and creator relationship
- Create ActivityLogService for centralized logging
- Add activity logging to VisitorsController (create, update, delete, password)
- Add activity logging to DisableExpiredVisitors command
- Add activity logging to DepartmentsController
- Add activity logging to VisitorTypeController

* feat: implement dashboard with metrics

- Add DashboardController with stats: total, this month, expired
- Add visitors by department (with creator department)
- Add visitors by month (trend chart data)
- Add next to expire (7 days) list
- Add already expired list
- Add recent activities from activity_logs
- Update dashboard frontend with cards and lists

* docs: update PHP and tech versions in PRD and SSD

* docs: add Tailwind CSS version

* docs: remove sensitive data (replace with generic names)

* refactor: implement SOLID principles with interfaces and services

- Add contracts/ directory with interfaces (SambaInterface, ActivityLogInterface, VisitorInterface, VoucherInterface)
- Create VisitorService with single responsibility for visitor operations
- Create VoucherService for voucher management
- Refactor VisitorsController to use VisitorService via dependency injection
- Update DepartmentsController and VisitorTypeController to use ActivityLogInterface
- Update DisableExpiredVisitors command to use interfaces
- Register ServiceServiceProvider for dependency injection

Applies SOLID principles:
- Single Responsibility: Services have focused responsibilities
- Open/Closed: Classes implement interfaces for extensibility
- Liskov Substitution: Interfaces are interchangeable
- Interface Segregation: Small, specific interfaces
- Dependency Injection: Controllers depend on abstractions

* feat: show department access error on login

When user authenticates but department is not mapped in the system,
show error message: 'Seu departamento não tem acesso a este sistema.
Favor verificar com a COGETI.'

* feat: improve login error messages

- Remove pattern validation on username field
- Improve 'invalid credentials' message to be more clear
- Show user's groups when department is not mapped: 'Seu grupo (X, Y) não tem acesso ao sistema. Favor verificar com a COGETI.'

* feat: implement visitor batch import via CSV

- Add CSV import functionality for visitors (name, cpf, email, phone, reason)
- Create import_batches and import_errors tables for tracking
- Implement queue jobs for background processing with email dispatch
- Add VisitorImportService with CPF validation and duplicate checking
- Create import batches management page (list, show, delete)
- Add show() method to VisitorsController for visitor details
- Fix route ordering for visitors/import
- Add department filtering to dashboard for operators
- Update SSD/PRD documentation with new tables and features
- Improve sidebar with imports menu

Features:
- Email is required for import (to send login/password)
- CPF validation with mathematical check
- Email duplicate check
- Reason/motivo mapped to school field
- Default type and expiry date from form
- Errors displayed per line in import details
- Dashboard auto-refresh every 5 seconds

* feat: add xlsx support for visitor import and fix CPF validation bug

* feat: add auto-refresh to import batch pages and queue worker service

* fix: corrige total_rows e mejora UI de importacao

* feat: add auto-refresh to all list pages and fix success_count duplication

- Add 5-second auto-refresh to visitors, vouchers, users, departments, visitorTypes, import-batches
- Remove duplicate filtering in VisitorImportService (was causing double counting)
- Fix total_rows to count only valid rows (after filtering empty lines)
- Improve import file upload UI with drag & drop zone
- Update SSD and PRD documentation with new features

* docs: add duplicate success_count bug to PRD pending items

* chore: remove nginx access.log from git tracking and update visitor import jobs

* feat: add activities page, fix route conflicts, improve visitor import and UI

- Add ActivitiesController with index and show pages
- Fix route conflict: visitors/{visitor} now accepts only numeric IDs
- Add route constraint to prevent 'import' being captured as visitor ID
- Improve VisitorImportService array key handling to avoid undefined errors
- Fix duplicate scopeDepartmentFilter in Visitor model
- Add VisitorException and VisitorError enum
- Add SambaService and update visitor creation workflow
- Enhance UI with auto-refresh, pagination fixes, and better feedback

* feat: format activities index and show like dashboard

- Add action_label and department to activities index
- Format user info with role in show page
- Remove duplicate getActionLabel from frontend
- Use action_label from backend instead

* feat: show only 5 recent activities in dashboard with link to details

- Change limit from 15 to 5
- Add user_role field
- Make items clickable with link to /activities/{id}
- Add admin badge for admin users

* feat: track activity with correct user_id from controllers/jobs

- Pass userId explicitly to activity log methods
- Use User::find() when no auth user available
- More descriptive action descriptions
- Add user_role field to logs

* fix: corrections to activities and visitor expiration logic

- Fix typo in activities index (Acao -> Ação)
- Include user name in activity descriptions
- Fix dashboard visitor expiration logic (today still valid, expired after today)
- Set timezone to America/Sao_Paulo
- Update UserFactory for tests
- Add ActivitiesTest

* fix: cron

* feat: melhorias diversas - validação, abreviação de nomes e flash messages

- Adiciona validação de data de expiração no generatePassword do backend
- Implementa abreviação de nomes (primeiro + último sobrenome) em visitors, dashboard, vouchers e import-batches
- Corrige logs de atividade para usar user_id correto ao invés de created_by
- Ajusta redirect no controller para manter usuário na página do visitante após ações
- Melhora tratamento de flash messages para toasts funcionarem corretamente
- Corrige timezone no DashboardController usando UTC para compatibilidade com PostgreSQL

* feat: melhorias diversas - responsividade, logs e auto-refresh

- Ajusta paginação para responsividade mobile em activities e import-batches
- Adiciona log de senha reenviada em activities
- Corrige auto-refresh para só rodar quando necessário (importações processando, vouchers prestes a expirar)
- Desativa barra de progresso do Inertia para evitar indicador girando
- Corrige lógica de status de import batch (completed vs partial)
- Ajusta visitantes/show para ter ConfirmDialog no botão editar

* fix: ajustes de layout e status de importação

- Ajusta import-batches/show com layout responsivo (p-4 sm:p-6)
- Corrige lógica de status para completed quando processado
- Ajusta atividades para não truncar texto da ação
- Corrige timezone do dashboard para UTC

* fix: corrige argumentos em ActivityLogService e adiciona filtragem por departamento em import-batches

* fix: remove testes iniciais do Laravel e corrige erros de ESLint (any types, imports nao usados)

* fix: remove orphaned register page (registration disabled in Fortify)

* fix: remove unused canRegister prop to fix lint error

* docs: reorganizar SSD com componentes detalhados, ER diagram completo e tabelas de campos separadas por categoria

* docs: sync PRD and SSD with actual code implementation

- Fix versions: React 19.x, Tailwind 4.x, Vite 7.x, PostgreSQL only
- Add sections: fluxo de criação/voucher, VisitorService, notifications,
  ActivityLogService, importação em lote, tratamento de erros
- Fix LDAP, SSH/Samba specs to match real implementation
- Fix operator visibility (department filter, not self-created)
- Fix RF17 renumbering in PRD

* docs: rewrite README.md in Portuguese with full setup guide

Based on PRD and SSD, covering:
- System description and architecture
- VM setup (Docker, PHP, Node, tools)
- SSH key configuration for Samba
- Environment variables (placeholders only)
- Build and run steps with ./run script
- All available commands reference

* Fix/backend frontend return (#4)

* fix: corrige flash messages, timeout SSH, deleção de visitantes e role por departamento

* fix: validação de filtro de departamento em visitantes e endurecimento de regras de request

* fix: substitui hardcoded department_id por isAdmin() no dashboard e adiciona total de vouchers

* fix:linter

* Fix/dashboard imports and pagination (#6)

* Develop Create a PRD and SSD Docs (#3)

* ldap auth using credentials

* feat: create crud visitorTypes

* fix: ldap

* docs: add PRD and SSD documentation

- PRD: Product Requirements Document with features, use cases, wireframes
- SSD: System Specification Document with architecture, DB, APIs

* feat: add created_by to vouchers and activity logging

- Add migration to add created_by column to visitor_vouchers
- Update Voucher model with created_by and creator relationship
- Create ActivityLogService for centralized logging
- Add activity logging to VisitorsController (create, update, delete, password)
- Add activity logging to DisableExpiredVisitors command
- Add activity logging to DepartmentsController
- Add activity logging to VisitorTypeController

* feat: implement dashboard with metrics

- Add DashboardController with stats: total, this month, expired
- Add visitors by department (with creator department)
- Add visitors by month (trend chart data)
- Add next to expire (7 days) list
- Add already expired list
- Add recent activities from activity_logs
- Update dashboard frontend with cards and lists

* docs: update PHP and tech versions in PRD and SSD

* docs: add Tailwind CSS version

* docs: remove sensitive data (replace with generic names)

* refactor: implement SOLID principles with interfaces and services

- Add contracts/ directory with interfaces (SambaInterface, ActivityLogInterface, VisitorInterface, VoucherInterface)
- Create VisitorService with single responsibility for visitor operations
- Create VoucherService for voucher management
- Refactor VisitorsController to use VisitorService via dependency injection
- Update DepartmentsController and VisitorTypeController to use ActivityLogInterface
- Update DisableExpiredVisitors command to use interfaces
- Register ServiceServiceProvider for dependency injection

Applies SOLID principles:
- Single Responsibility: Services have focused responsibilities
- Open/Closed: Classes implement interfaces for extensibility
- Liskov Substitution: Interfaces are interchangeable
- Interface Segregation: Small, specific interfaces
- Dependency Injection: Controllers depend on abstractions

* feat: show department access error on login

When user authenticates but department is not mapped in the system,
show error message: 'Seu departamento não tem acesso a este sistema.
Favor verificar com a COGETI.'

* feat: improve login error messages

- Remove pattern validation on username field
- Improve 'invalid credentials' message to be more clear
- Show user's groups when department is not mapped: 'Seu grupo (X, Y) não tem acesso ao sistema. Favor verificar com a COGETI.'

* feat: implement visitor batch import via CSV

- Add CSV import functionality for visitors (name, cpf, email, phone, reason)
- Create import_batches and import_errors tables for tracking
- Implement queue jobs for background processing with email dispatch
- Add VisitorImportService with CPF validation and duplicate checking
- Create import batches management page (list, show, delete)
- Add show() method to VisitorsController for visitor details
- Fix route ordering for visitors/import
- Add department filtering to dashboard for operators
- Update SSD/PRD documentation with new tables and features
- Improve sidebar with imports menu

Features:
- Email is required for import (to send login/password)
- CPF validation with mathematical check
- Email duplicate check
- Reason/motivo mapped to school field
- Default type and expiry date from form
- Errors displayed per line in import details
- Dashboard auto-refresh every 5 seconds

* feat: add xlsx support for visitor import and fix CPF validation bug

* feat: add auto-refresh to import batch pages and queue worker service

* fix: corrige total_rows e mejora UI de importacao

* feat: add auto-refresh to all list pages and fix success_count duplication

- Add 5-second auto-refresh to visitors, vouchers, users, departments, visitorTypes, import-batches
- Remove duplicate filtering in VisitorImportService (was causing double counting)
- Fix total_rows to count only valid rows (after filtering empty lines)
- Improve import file upload UI with drag & drop zone
- Update SSD and PRD documentation with new features

* docs: add duplicate success_count bug to PRD pending items

* chore: remove nginx access.log from git tracking and update visitor import jobs

* feat: add activities page, fix route conflicts, improve visitor import and UI

- Add ActivitiesController with index and show pages
- Fix route conflict: visitors/{visitor} now accepts only numeric IDs
- Add route constraint to prevent 'import' being captured as visitor ID
- Improve VisitorImportService array key handling to avoid undefined errors
- Fix duplicate scopeDepartmentFilter in Visitor model
- Add VisitorException and VisitorError enum
- Add SambaService and update visitor creation workflow
- Enhance UI with auto-refresh, pagination fixes, and better feedback

* feat: format activities index and show like dashboard

- Add action_label and department to activities index
- Format user info with role in show page
- Remove duplicate getActionLabel from frontend
- Use action_label from backend instead

* feat: show only 5 recent activities in dashboard with link to details

- Change limit from 15 to 5
- Add user_role field
- Make items clickable with link to /activities/{id}
- Add admin badge for admin users

* feat: track activity with correct user_id from controllers/jobs

- Pass userId explicitly to activity log methods
- Use User::find() when no auth user available
- More descriptive action descriptions
- Add user_role field to logs

* fix: corrections to activities and visitor expiration logic

- Fix typo in activities index (Acao -> Ação)
- Include user name in activity descriptions
- Fix dashboard visitor expiration logic (today still valid, expired after today)
- Set timezone to America/Sao_Paulo
- Update UserFactory for tests
- Add ActivitiesTest

* fix: cron

* feat: melhorias diversas - validação, abreviação de nomes e flash messages

- Adiciona validação de data de expiração no generatePassword do backend
- Implementa abreviação de nomes (primeiro + último sobrenome) em visitors, dashboard, vouchers e import-batches
- Corrige logs de atividade para usar user_id correto ao invés de created_by
- Ajusta redirect no controller para manter usuário na página do visitante após ações
- Melhora tratamento de flash messages para toasts funcionarem corretamente
- Corrige timezone no DashboardController usando UTC para compatibilidade com PostgreSQL

* feat: melhorias diversas - responsividade, logs e auto-refresh

- Ajusta paginação para responsividade mobile em activities e import-batches
- Adiciona log de senha reenviada em activities
- Corrige auto-refresh para só rodar quando necessário (importações processando, vouchers prestes a expirar)
- Desativa barra de progresso do Inertia para evitar indicador girando
- Corrige lógica de status de import batch (completed vs partial)
- Ajusta visitantes/show para ter ConfirmDialog no botão editar

* fix: ajustes de layout e status de importação

- Ajusta import-batches/show com layout responsivo (p-4 sm:p-6)
- Corrige lógica de status para completed quando processado
- Ajusta atividades para não truncar texto da ação
- Corrige timezone do dashboard para UTC

* fix: corrige argumentos em ActivityLogService e adiciona filtragem por departamento em import-batches

* fix: remove testes iniciais do Laravel e corrige erros de ESLint (any types, imports nao usados)

* fix: remove orphaned register page (registration disabled in Fortify)

* fix: remove unused canRegister prop to fix lint error

* docs: reorganizar SSD com componentes detalhados, ER diagram completo e tabelas de campos separadas por categoria

* docs: sync PRD and SSD with actual code implementation

- Fix versions: React 19.x, Tailwind 4.x, Vite 7.x, PostgreSQL only
- Add sections: fluxo de criação/voucher, VisitorService, notifications,
  ActivityLogService, importação em lote, tratamento de erros
- Fix LDAP, SSH/Samba specs to match real implementation
- Fix operator visibility (department filter, not self-created)
- Fix RF17 renumbering in PRD

* docs: rewrite README.md in Portuguese with full setup guide

Based on PRD and SSD, covering:
- System description and architecture
- VM setup (Docker, PHP, Node, tools)
- SSH key configuration for Samba
- Environment variables (placeholders only)
- Build and run steps with ./run script
- All available commands reference

---------

Co-authored-by: LUCAS GONTARZ FAJARDO <estag.lucasfajardo@utfpr.edu.br>

* Develop PR (#5)

* ldap auth using credentials

* feat: create crud visitorTypes

* fix: ldap

* docs: add PRD and SSD documentation

- PRD: Product Requirements Document with features, use cases, wireframes
- SSD: System Specification Document with architecture, DB, APIs

* feat: add created_by to vouchers and activity logging

- Add migration to add created_by column to visitor_vouchers
- Update Voucher model with created_by and creator relationship
- Create ActivityLogService for centralized logging
- Add activity logging to VisitorsController (create, update, delete, password)
- Add activity logging to DisableExpiredVisitors command
- Add activity logging to DepartmentsController
- Add activity logging to VisitorTypeController

* feat: implement dashboard with metrics

- Add DashboardController with stats: total, this month, expired
- Add visitors by department (with creator department)
- Add visitors by month (trend chart data)
- Add next to expire (7 days) list
- Add already expired list
- Add recent activities from activity_logs
- Update dashboard frontend with cards and lists

* docs: update PHP and tech versions in PRD and SSD

* docs: add Tailwind CSS version

* docs: remove sensitive data (replace with generic names)

* refactor: implement SOLID principles with interfaces and services

- Add contracts/ directory with interfaces (SambaInterface, ActivityLogInterface, VisitorInterface, VoucherInterface)
- Create VisitorService with single responsibility for visitor operations
- Create VoucherService for voucher management
- Refactor VisitorsController to use VisitorService via dependency injection
- Update DepartmentsController and VisitorTypeController to use ActivityLogInterface
- Update DisableExpiredVisitors command to use interfaces
- Register ServiceServiceProvider for dependency injection

Applies SOLID principles:
- Single Responsibility: Services have focused responsibilities
- Open/Closed: Classes implement interfaces for extensibility
- Liskov Substitution: Interfaces are interchangeable
- Interface Segregation: Small, specific interfaces
- Dependency Injection: Controllers depend on abstractions

* feat: show department access error on login

When user authenticates but department is not mapped in the system,
show error message: 'Seu departamento não tem acesso a este sistema.
Favor verificar com a COGETI.'

* feat: improve login error messages

- Remove pattern validation on username field
- Improve 'invalid credentials' message to be more clear
- Show user's groups when department is not mapped: 'Seu grupo (X, Y) não tem acesso ao sistema. Favor verificar com a COGETI.'

* feat: implement visitor batch import via CSV

- Add CSV import functionality for visitors (name, cpf, email, phone, reason)
- Create import_batches and import_errors tables for tracking
- Implement queue jobs for background processing with email dispatch
- Add VisitorImportService with CPF validation and duplicate checking
- Create import batches management page (list, show, delete)
- Add show() method to VisitorsController for visitor details
- Fix route ordering for visitors/import
- Add department filtering to dashboard for operators
- Update SSD/PRD documentation with new tables and features
- Improve sidebar with imports menu

Features:
- Email is required for import (to send login/password)
- CPF validation with mathematical check
- Email duplicate check
- Reason/motivo mapped to school field
- Default type and expiry date from form
- Errors displayed per line in import details
- Dashboard auto-refresh every 5 seconds

* feat: add xlsx support for visitor import and fix CPF validation bug

* feat: add auto-refresh to import batch pages and queue worker service

* fix: corrige total_rows e mejora UI de importacao

* feat: add auto-refresh to all list pages and fix success_count duplication

- Add 5-second auto-refresh to visitors, vouchers, users, departments, visitorTypes, import-batches
- Remove duplicate filtering in VisitorImportService (was causing double counting)
- Fix total_rows to count only valid rows (after filtering empty lines)
- Improve import file upload UI with drag & drop zone
- Update SSD and PRD documentation with new features

* docs: add duplicate success_count bug to PRD pending items

* chore: remove nginx access.log from git tracking and update visitor import jobs

* feat: add activities page, fix route conflicts, improve visitor import and UI

- Add ActivitiesController with index and show pages
- Fix route conflict: visitors/{visitor} now accepts only numeric IDs
- Add route constraint to prevent 'import' being captured as visitor ID
- Improve VisitorImportService array key handling to avoid undefined errors
- Fix duplicate scopeDepartmentFilter in Visitor model
- Add VisitorException and VisitorError enum
- Add SambaService and update visitor creation workflow
- Enhance UI with auto-refresh, pagination fixes, and better feedback

* feat: format activities index and show like dashboard

- Add action_label and department to activities index
- Format user info with role in show page
- Remove duplicate getActionLabel from frontend
- Use action_label from backend instead

* feat: show only 5 recent activities in dashboard with link to details

- Change limit from 15 to 5
- Add user_role field
- Make items clickable with link to /activities/{id}
- Add admin badge for admin users

* feat: track activity with correct user_id from controllers/jobs

- Pass userId explicitly to activity log methods
- Use User::find() when no auth user available
- More descriptive action descriptions
- Add user_role field to logs

* fix: corrections to activities and visitor expiration logic

- Fix typo in activities index (Acao -> Ação)
- Include user name in activity descriptions
- Fix dashboard visitor expiration logic (today still valid, expired after today)
- Set timezone to America/Sao_Paulo
- Update UserFactory for tests
- Add ActivitiesTest

* fix: cron

* feat: melhorias diversas - validação, abreviação de nomes e flash messages

- Adiciona validação de data de expiração no generatePassword do backend
- Implementa abreviação de nomes (primeiro + último sobrenome) em visitors, dashboard, vouchers e import-batches
- Corrige logs de atividade para usar user_id correto ao invés de created_by
- Ajusta redirect no controller para manter usuário na página do visitante após ações
- Melhora tratamento de flash messages para toasts funcionarem corretamente
- Corrige timezone no DashboardController usando UTC para compatibilidade com PostgreSQL

* feat: melhorias diversas - responsividade, logs e auto-refresh

- Ajusta paginação para responsividade mobile em activities e import-batches
- Adiciona log de senha reenviada em activities
- Corrige auto-refresh para só rodar quando necessário (importações processando, vouchers prestes a expirar)
- Desativa barra de progresso do Inertia para evitar indicador girando
- Corrige lógica de status de import batch (completed vs partial)
- Ajusta visitantes/show para ter ConfirmDialog no botão editar

* fix: ajustes de layout e status de importação

- Ajusta import-batches/show com layout responsivo (p-4 sm:p-6)
- Corrige lógica de status para completed quando processado
- Ajusta atividades para não truncar texto da ação
- Corrige timezone do dashboard para UTC

* fix: corrige argumentos em ActivityLogService e adiciona filtragem por departamento em import-batches

* fix: remove testes iniciais do Laravel e corrige erros de ESLint (any types, imports nao usados)

* fix: remove orphaned register page (registration disabled in Fortify)

* fix: remove unused canRegister prop to fix lint error

* docs: reorganizar SSD com componentes detalhados, ER diagram completo e tabelas de campos separadas por categoria

* docs: sync PRD and SSD with actual code implementation

- Fix versions: React 19.x, Tailwind 4.x, Vite 7.x, PostgreSQL only
- Add sections: fluxo de criação/voucher, VisitorService, notifications,
  ActivityLogService, importação em lote, tratamento de erros
- Fix LDAP, SSH/Samba specs to match real implementation
- Fix operator visibility (department filter, not self-created)
- Fix RF17 renumbering in PRD

* docs: rewrite README.md in Portuguese with full setup guide

Based on PRD and SSD, covering:
- System description and architecture
- VM setup (Docker, PHP, Node, tools)
- SSH key configuration for Samba
- Environment variables (placeholders only)
- Build and run steps with ./run script
- All available commands reference

* Fix/backend frontend return (#4)

* fix: corrige flash messages, timeout SSH, deleção de visitantes e role por departamento

* fix: validação de filtro de departamento em visitantes e endurecimento de regras de request

* fix: substitui hardcoded department_id por isAdmin() no dashboard e adiciona total de vouchers

* fix:linter

---------

Co-authored-by: LUCAS GONTARZ FAJARDO <estag.lucasfajardo@utfpr.edu.br>

* fix: dashboard counts, import error edit/retry/skip, visitor pagination, flash dedup, date validation, password email on edit

* docs: update PRD and SSD with import error management, dashboard fixes, duplicate CPF, pagination, cron fix

* fix: dashboard import errors count excludes skipped errors

* feat: show skipped count on dashboard import stats

---------

Co-authored-by: LUCAS GONTARZ FAJARDO <estag.lucasfajardo@utfpr.edu.br>

---------

Co-authored-by: LUCAS GONTARZ FAJARDO <estag.lucasfajardo@utfpr.edu.br>
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