- Add ShippingRate model to Prisma schema with service name, base price, per-kg surcharge, estimated delivery days, and international flag - Create migration to add shipping_rates table - Update seed.ts to populate initial Royal Mail rates (domestic and international) - Refactor getRoyalMailShippingQuotes to fetch rates from database with fallback to defaults - Add /admin/shipping-rates page for managing rates - Add ShippingRatesForm component with inline editing and add/remove functionality - Add server actions for saving and deleting rates - Add "Shipping rates" link to admin navigation Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
17 lines
503 B
SQL
17 lines
503 B
SQL
-- CreateTable
|
|
CREATE TABLE "ShippingRate" (
|
|
"id" TEXT NOT NULL,
|
|
"service" TEXT NOT NULL,
|
|
"basePrice" INTEGER NOT NULL,
|
|
"pricePerKg" INTEGER NOT NULL DEFAULT 0,
|
|
"estimatedDays" INTEGER NOT NULL,
|
|
"isInternational" BOOLEAN NOT NULL DEFAULT false,
|
|
"active" BOOLEAN NOT NULL DEFAULT true,
|
|
"updatedAt" TIMESTAMP(3) NOT NULL,
|
|
|
|
CONSTRAINT "ShippingRate_pkey" PRIMARY KEY ("id")
|
|
);
|
|
|
|
-- CreateIndex
|
|
CREATE UNIQUE INDEX "ShippingRate_service_key" ON "ShippingRate"("service");
|