Add functionality to upload and display articles with associated images

Update article page to handle image uploads and display articles from text files. Refactor currency and date formatting, and add a method to fetch prediction markets by ID.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 0fb68265-c270-4198-9584-3d9be9bddb41
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/3df548ff-50ae-432f-9be4-25d34eccc983/0fb68265-c270-4198-9584-3d9be9bddb41/rOJiPGe
This commit is contained in:
kimjaehyeon0101
2025-09-30 04:12:43 +00:00
parent 117f2e468d
commit 6c4d4dcadf
16 changed files with 87 additions and 12 deletions

View File

@ -74,11 +74,15 @@ export const articles = pgTable("articles", {
// Prediction markets
export const predictionMarkets = pgTable("prediction_markets", {
id: varchar("id").primaryKey().default(sql`gen_random_uuid()`),
question: varchar("question"),
title: varchar("title").notNull(),
description: text("description"),
articleId: varchar("article_id"),
yesPrice: decimal("yes_price", { precision: 5, scale: 2 }),
noPrice: decimal("no_price", { precision: 5, scale: 2 }),
yesPrice: decimal("yes_price", { precision: 5, scale: 4 }).default("0.5"),
noPrice: decimal("no_price", { precision: 5, scale: 4 }).default("0.5"),
totalVolume: decimal("total_volume", { precision: 12, scale: 2 }).default("0"),
totalBets: integer("total_bets").default(0),
resolutionDate: timestamp("resolution_date"),
volume: decimal("volume", { precision: 12, scale: 2 }),
endDate: timestamp("end_date"),
isActive: boolean("is_active").default(true),