feat(listings): complete PATCH /api/v1/listings/:id endpoint
- Add mediaOrder field to UpdateListingDto, Command, and Handler for reordering media items - Add updateMediaOrder method to IPropertyRepository and Prisma impl - Fix PrismaPropertyRepository.update() to persist amenities, nearbyPOIs, floors, floor, totalFloors, and metroDistanceM columns - Add unit tests for media order updates in handler spec - Add DTO validation tests for mediaOrder with nested validation - Add e2e integration tests covering content updates, auth, ownership guard, and forbidden field rejection Existing guards enforced: - Only seller or assigned agent can update (403 for others) - ACTIVE listings transition to PENDING_REVIEW on edit - propertyType, address, location blocked via DTO whitelist Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -11,4 +11,5 @@ export interface IPropertyRepository {
|
||||
findMediaByPropertyId(propertyId: string): Promise<PropertyMediaEntity[]>;
|
||||
deleteMedia(mediaId: string): Promise<void>;
|
||||
countMediaByPropertyId(propertyId: string): Promise<number>;
|
||||
updateMediaOrder(propertyId: string, mediaOrder: { mediaId: string; order: number }[]): Promise<void>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user