fix(platform): resolve master compile errors blocking load test (GOO-171)
- listings index.ts now re-exports PROPERTY_REPOSITORY/IPropertyRepository
and MEDIA_STORAGE_SERVICE/IMediaStorageService/MinioMediaStorageService
(documents module depends on these)
- add PropertyDocument model + DocumentType + DocumentVerificationStatus
enums to Prisma schema and create companion migration
- add TooManyRequestsException to shared domain exceptions
- add RL_SENSITIVE_WRITE preset to endpoint-rate-limit decorator and
re-export from shared/infrastructure
- add certificateVerified to PropertyExtras + Create/UpdateListingDto so
listings.controller line 135/341 type-check
- create PhoneLoginOtpRequestedEvent + matching notifications listener
(notifications.module already imports the listener)
- oauth.service constructs UserEntity with deletedAt: null
- web: fix LegalStatus fixtures ('Sổ hồng' -> 'SO_HONG'), make
ListingDetail.property.certificateVerified optional so existing fixtures
compile, type admin layout auth-store mock to accept null user
Verified: `pnpm typecheck` green across @goodgo/api, @goodgo/web,
@goodgo/mcp-servers; `pnpm --filter @goodgo/api build` succeeds.
Unblocks [GOO-137](/GOO/issues/GOO-137) load test.
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
-- CreateEnum
|
||||
CREATE TYPE "DocumentType" AS ENUM ('SO_DO', 'SO_HONG', 'GCNQSD', 'OTHER');
|
||||
|
||||
-- CreateEnum
|
||||
CREATE TYPE "DocumentVerificationStatus" AS ENUM ('PENDING_REVIEW', 'APPROVED', 'REJECTED');
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "PropertyDocument" (
|
||||
"id" TEXT NOT NULL,
|
||||
"propertyId" TEXT NOT NULL,
|
||||
"uploadedById" TEXT NOT NULL,
|
||||
"documentType" "DocumentType" NOT NULL,
|
||||
"status" "DocumentVerificationStatus" NOT NULL DEFAULT 'PENDING_REVIEW',
|
||||
"url" TEXT NOT NULL,
|
||||
"fileName" TEXT NOT NULL,
|
||||
"mimeType" TEXT NOT NULL,
|
||||
"fileSizeBytes" INTEGER NOT NULL,
|
||||
"description" TEXT,
|
||||
"rejectionReason" TEXT,
|
||||
"reviewedById" TEXT,
|
||||
"reviewedAt" TIMESTAMP(3),
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "PropertyDocument_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "PropertyDocument_propertyId_idx" ON "PropertyDocument"("propertyId");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "PropertyDocument_status_createdAt_idx" ON "PropertyDocument"("status", "createdAt");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "PropertyDocument_uploadedById_idx" ON "PropertyDocument"("uploadedById");
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "PropertyDocument" ADD CONSTRAINT "PropertyDocument_propertyId_fkey" FOREIGN KEY ("propertyId") REFERENCES "Property"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
@@ -370,6 +370,7 @@ model Property {
|
||||
listings Listing[]
|
||||
valuations Valuation[]
|
||||
media PropertyMedia[]
|
||||
documents PropertyDocument[]
|
||||
|
||||
// --- Single-column indexes ---
|
||||
@@index([propertyType])
|
||||
@@ -398,6 +399,42 @@ model PropertyMedia {
|
||||
@@index([propertyId])
|
||||
}
|
||||
|
||||
enum DocumentType {
|
||||
SO_DO
|
||||
SO_HONG
|
||||
GCNQSD
|
||||
OTHER
|
||||
}
|
||||
|
||||
enum DocumentVerificationStatus {
|
||||
PENDING_REVIEW
|
||||
APPROVED
|
||||
REJECTED
|
||||
}
|
||||
|
||||
model PropertyDocument {
|
||||
id String @id @default(cuid())
|
||||
propertyId String
|
||||
property Property @relation(fields: [propertyId], references: [id], onDelete: Cascade)
|
||||
uploadedById String
|
||||
documentType DocumentType
|
||||
status DocumentVerificationStatus @default(PENDING_REVIEW)
|
||||
url String
|
||||
fileName String
|
||||
mimeType String
|
||||
fileSizeBytes Int
|
||||
description String? @db.Text
|
||||
rejectionReason String? @db.Text
|
||||
reviewedById String?
|
||||
reviewedAt DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@index([propertyId])
|
||||
@@index([status, createdAt])
|
||||
@@index([uploadedById])
|
||||
}
|
||||
|
||||
model Listing {
|
||||
id String @id @default(cuid())
|
||||
propertyId String
|
||||
|
||||
Reference in New Issue
Block a user