Fases 7 e 8 — PDFs Prawn + QR + Painel Motorista + Notificações

This commit is contained in:
2026-06-11 18:31:38 -03:00
parent 90ed705ed8
commit 8b3d4bc87f
21 changed files with 942 additions and 23 deletions

View File

@@ -0,0 +1,17 @@
# config/initializers/smtp.rb
# Configuração de e-mail 100% via ENV — só ativa se SMTP_USERNAME existir
if ENV['SMTP_USERNAME'].present?
Rails.application.config.action_mailer.delivery_method = :smtp
Rails.application.config.action_mailer.smtp_settings = {
address: ENV['SMTP_ADDRESS'],
port: ENV.fetch('SMTP_PORT', 587).to_i,
user_name: ENV['SMTP_USERNAME'],
password: ENV['SMTP_PASSWORD'],
domain: ENV['SMTP_DOMAIN'],
authentication: 'plain',
enable_starttls_auto: true
}
Rails.application.config.action_mailer.default_url_options = {
host: ENV.fetch('APP_HOST', 'localhost:3000')
}
end

View File

@@ -14,7 +14,12 @@ Rails.application.routes.draw do
get '/dashboard', to: 'dashboard#index', as: :dashboard
# Painel motorista
get '/motorista', to: 'motorista/dashboard#index', as: :motorista_dashboard
get '/motorista', to: 'motorista/dashboard#index', as: :motorista_dashboard
# Login motorista — PIN de 4 dígitos + acesso via QR Code do holerite
get '/motorista/login', to: 'motorista/sessoes#new', as: :motorista_login
post '/motorista/login', to: 'motorista/sessoes#create'
get '/motorista/acesso/:token', to: 'motorista/sessoes#acesso_qr', as: :motorista_acesso_qr
# Consolidações
resources :consolidacoes do