feat(listings): add source field to PriceHistory + unit tests
- Add `source` column to PriceHistory Prisma model (manual_update, admin_override, market_adjustment) - Add migration for the new column with default 'manual_update' - Update ListingPriceChangedEvent domain event with optional source parameter - Update RecordPriceHistoryHandler to persist source - Update GetPriceHistoryHandler to return source in query results - Add unit tests for RecordPriceHistoryHandler (5 cases) - Add unit tests for GetPriceHistoryHandler (3 cases) - Add ListingPriceChangedEvent tests to domain events spec (4 cases) - Add getPriceHistory controller tests (2 cases) All 1805 tests pass, typecheck clean. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -366,6 +366,7 @@ model PriceHistory {
|
||||
listing Listing @relation(fields: [listingId], references: [id], onDelete: Cascade)
|
||||
oldPrice BigInt
|
||||
newPrice BigInt
|
||||
source String @default("manual_update")
|
||||
changedAt DateTime @default(now())
|
||||
|
||||
@@index([listingId, changedAt(sort: Desc)])
|
||||
|
||||
Reference in New Issue
Block a user