feat(api): add price history, Stringee SMS, Zalo OA, WebSocket notifications, and feature-listing command
- 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>
This commit is contained in:
@@ -333,9 +333,10 @@ model Listing {
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
transactions Transaction[]
|
||||
inquiries Inquiry[]
|
||||
orders Order[]
|
||||
transactions Transaction[]
|
||||
inquiries Inquiry[]
|
||||
orders Order[]
|
||||
priceHistories PriceHistory[]
|
||||
|
||||
// --- Single-column indexes ---
|
||||
@@index([status])
|
||||
@@ -357,6 +358,17 @@ model Listing {
|
||||
@@index([status, transactionType, priceVND])
|
||||
}
|
||||
|
||||
model PriceHistory {
|
||||
id String @id @default(cuid())
|
||||
listingId String
|
||||
listing Listing @relation(fields: [listingId], references: [id], onDelete: Cascade)
|
||||
oldPrice BigInt
|
||||
newPrice BigInt
|
||||
changedAt DateTime @default(now())
|
||||
|
||||
@@index([listingId, changedAt(sort: Desc)])
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
// SEARCH
|
||||
// =============================================================================
|
||||
|
||||
Reference in New Issue
Block a user