- 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
31 lines
780 B
JavaScript
31 lines
780 B
JavaScript
/* global axios */
|
|
import ApiClient from '../ApiClient';
|
|
|
|
class CaptainNotificationTemplatesAPI extends ApiClient {
|
|
constructor() {
|
|
super('captain/units', { accountScoped: true });
|
|
}
|
|
|
|
getTemplates(unitId) {
|
|
return axios.get(`${this.url}/${unitId}/notification_templates`);
|
|
}
|
|
|
|
createTemplate(unitId, data) {
|
|
return axios.post(`${this.url}/${unitId}/notification_templates`, {
|
|
notification_template: data,
|
|
});
|
|
}
|
|
|
|
updateTemplate(unitId, id, data) {
|
|
return axios.patch(`${this.url}/${unitId}/notification_templates/${id}`, {
|
|
notification_template: data,
|
|
});
|
|
}
|
|
|
|
deleteTemplate(unitId, id) {
|
|
return axios.delete(`${this.url}/${unitId}/notification_templates/${id}`);
|
|
}
|
|
}
|
|
|
|
export default new CaptainNotificationTemplatesAPI();
|