- Adiciona check_in_at/duration_hours ao schema do tool CreateReservationIntent para que a IA capture o horário EXATO de chegada informado pelo cliente - Cria captain_notification_templates: label, content, timing_minutes, timing_direction (before/after), active, position - Implementa SendNotificationService com interpolação de variáveis (guest_name, check_in_time, check_out_time, suite_name, unit_name) - Implementa NotificationScannerJob (Sidekiq-cron a cada 5min) com janela de tolerância de ±5min e idempotência via metadata JSONB - API REST: /captain/units/:unit_id/notification_templates (CRUD) - Store Vuex captainNotificationTemplates + API client - UI: página de gestão de templates com editor inline e botão '+' - Configura rota captain_settings_notifications - i18n PT/EN para todas as strings novas - Rubocop e ESLint: zero offenses
19 lines
689 B
Ruby
19 lines
689 B
Ruby
class CreateCaptainNotificationTemplates < ActiveRecord::Migration[7.1]
|
|
def change
|
|
create_table :captain_notification_templates do |t|
|
|
t.references :captain_unit, null: false, foreign_key: { to_table: :captain_units }
|
|
t.string :label, null: false
|
|
t.text :content, null: false
|
|
t.integer :timing_minutes, null: false, default: 10
|
|
t.integer :timing_direction, null: false, default: 0
|
|
t.boolean :active, null: false, default: true
|
|
t.integer :position, null: false, default: 0
|
|
|
|
t.timestamps
|
|
end
|
|
|
|
add_index :captain_notification_templates, [:captain_unit_id, :active],
|
|
name: 'idx_notif_templates_unit_active'
|
|
end
|
|
end
|