- Add PriceHistory model + migration, price-changed domain event, and event handler - Add GetPriceHistory query handler and controller endpoint - Implement StringeeSmsService and ZaloOaService with unit tests - Add Zalo ZNS templates for Vietnamese notification messages - Add WebSocket notification gateway for real-time push - Add FeatureListingCommand for promoted listings - Apply remaining consistent-type-imports lint fixes across API modules Co-Authored-By: Paperclip <noreply@paperclip.ing>
17 lines
631 B
SQL
17 lines
631 B
SQL
-- CreateTable: PriceHistory (listing price change tracking)
|
|
CREATE TABLE "PriceHistory" (
|
|
"id" TEXT NOT NULL,
|
|
"listingId" TEXT NOT NULL,
|
|
"oldPrice" BIGINT NOT NULL,
|
|
"newPrice" BIGINT NOT NULL,
|
|
"changedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
|
|
CONSTRAINT "PriceHistory_pkey" PRIMARY KEY ("id")
|
|
);
|
|
|
|
-- CreateIndex
|
|
CREATE INDEX "PriceHistory_listingId_changedAt_idx" ON "PriceHistory"("listingId", "changedAt" DESC);
|
|
|
|
-- AddForeignKey
|
|
ALTER TABLE "PriceHistory" ADD CONSTRAINT "PriceHistory_listingId_fkey" FOREIGN KEY ("listingId") REFERENCES "Listing"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|