Add configuration interface for enterprise task webhook

Implement a new UI component and backend routes for configuring and testing enterprise task webhooks, including database schema and migration scripts.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: cfbfe47c-0c9a-4ebf-8a41-2937407eccff
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/cfbfe47c-0c9a-4ebf-8a41-2937407eccff/vzUkIk6
This commit is contained in:
michaelschal committed 2025-09-03 13:15:50 +00:00
1 parent 6ce9ec90a4
commit f938fdb95d
9 files changed
+582 -7

No files matched your search

+63
View File
@@ -66,6 +66,9 @@ import {
type InsertWeatherData,
type WeatherSettings,
type InsertWeatherSettings,
webhookBapConfig,
type WebhookBapConfig,
type InsertWebhookBapConfig,
} from "@shared/schema";
import { db } from "./db";
import { eq, and, inArray, desc, sql, gte, lte, lt, gt, or, isNull, isNotNull, asc, ne } from "drizzle-orm";
@@ -219,6 +222,11 @@ export interface IStorage {
updateWeatherData(id: number, data: Partial<InsertWeatherData>): Promise<WeatherData>;
deleteOldWeatherData(daysToKeep: number): Promise<void>;
clearWeatherCache(): Promise<void>;
// Webhook BAP Configuration
getWebhookBapConfig(): Promise<WebhookBapConfig | undefined>;
createWebhookBapConfig(config: InsertWebhookBapConfig): Promise<WebhookBapConfig>;
updateWebhookBapConfig(id: number, config: Partial<InsertWebhookBapConfig>): Promise<WebhookBapConfig>;
}
export class DatabaseStorage implements IStorage {
@@ -2211,6 +2219,29 @@ export class DatabaseStorage implements IStorage {
await db.delete(weatherData);
console.log('🧹 Weather cache cleared due to location change');
}
// Webhook BAP Configuration
async getWebhookBapConfig(): Promise<WebhookBapConfig | undefined> {
const [config] = await db.select().from(webhookBapConfig).limit(1);
return config;
}
async createWebhookBapConfig(configData: InsertWebhookBapConfig): Promise<WebhookBapConfig> {
const [config] = await db
.insert(webhookBapConfig)
.values(configData)
.returning();
return config;
}
async updateWebhookBapConfig(id: number, configData: Partial<InsertWebhookBapConfig>): Promise<WebhookBapConfig> {
const [config] = await db
.update(webhookBapConfig)
.set({ ...configData, updatedAt: new Date() })
.where(eq(webhookBapConfig.id, id))
.returning();
return config;
}
}
// MemStorage class for development
@@ -3859,6 +3890,38 @@ export class MemStorage implements IStorage {
console.log('🧹 DEV: Weather cache cleared due to location change');
}
// Webhook BAP Configuration
async getWebhookBapConfig(): Promise<WebhookBapConfig | undefined> {
// En développement, retourner une config par défaut
return {
id: 1,
name: "Configuration BAP",
webhookUrl: "https://workflow.ffnancy.fr/webhook/a3d03176-b72f-412d-8fb9-f920b9fbab4d",
description: "Configuration par défaut pour développement",
isActive: true,
createdAt: new Date(),
updatedAt: new Date()
};
}
async createWebhookBapConfig(config: InsertWebhookBapConfig): Promise<WebhookBapConfig> {
return {
id: 1,
...config,
createdAt: new Date(),
updatedAt: new Date()
};
}
async updateWebhookBapConfig(id: number, config: Partial<InsertWebhookBapConfig>): Promise<WebhookBapConfig> {
const existing = await this.getWebhookBapConfig();
return {
...existing!,
...config,
updatedAt: new Date()
};
}
// Announcement operations
async createAnnouncement(announcementData: InsertAnnouncement): Promise<Announcement> {
const announcementStorage = getAnnouncementStorage(