Add weather information display and configuration options

Integrate weather data fetching, display in a widget, and provide a settings page for configuration.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: d43bd811-9372-45a7-8ac9-4a954c0538e1
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/d43bd811-9372-45a7-8ac9-4a954c0538e1/BIZe1t3
This commit is contained in:
michaelschal committed 2025-08-15 06:34:37 +00:00
1 parent 48bfc884ed
commit e70e860097
9 files changed
+863 -4

No files matched your search

+42
View File
@@ -700,3 +700,45 @@ export type SavTicketWithRelations = SavTicket & {
export type SavTicketHistoryWithCreator = SavTicketHistory & {
creator: User;
};
// Weather Tables
export const weatherData = pgTable("weather_data", {
id: serial("id").primaryKey(),
date: date("date").notNull(),
location: text("location").notNull(),
tempMax: text("temp_max").notNull(),
tempMin: text("temp_min").notNull(),
icon: text("icon").notNull(),
conditions: text("conditions").notNull(),
isCurrentYear: boolean("is_current_year").notNull().default(true),
createdAt: timestamp("created_at").defaultNow(),
updatedAt: timestamp("updated_at").defaultNow(),
});
export const weatherSettings = pgTable("weather_settings", {
id: serial("id").primaryKey(),
apiKey: text("api_key").notNull(),
location: text("location").notNull().default("Paris, France"),
isActive: boolean("is_active").notNull().default(true),
createdAt: timestamp("created_at").defaultNow(),
updatedAt: timestamp("updated_at").defaultNow(),
});
// Weather Schemas
export const insertWeatherDataSchema = createInsertSchema(weatherData).omit({
id: true,
createdAt: true,
updatedAt: true,
});
export const insertWeatherSettingsSchema = createInsertSchema(weatherSettings).omit({
id: true,
createdAt: true,
updatedAt: true,
});
// Weather Types
export type WeatherData = typeof weatherData.$inferSelect;
export type InsertWeatherData = z.infer<typeof insertWeatherDataSchema>;
export type WeatherSettings = typeof weatherSettings.$inferSelect;
export type InsertWeatherSettings = z.infer<typeof insertWeatherSettingsSchema>;