@valentine-efagene/qshelter-common 2.0.152 → 2.0.154
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generated/client/internal/class.js +2 -2
- package/dist/generated/client/internal/prismaNamespace.d.ts +2 -0
- package/dist/generated/client/internal/prismaNamespace.js +2 -0
- package/dist/generated/client/internal/prismaNamespaceBrowser.d.ts +2 -0
- package/dist/generated/client/internal/prismaNamespaceBrowser.js +2 -0
- package/dist/generated/client/models/Organization.d.ts +221 -0
- package/dist/generated/client/models/Property.d.ts +301 -1
- package/package.json +1 -1
- package/prisma/migrations/20260126031132_add_organization_id_to_property/migration.sql +8 -0
- package/prisma/schema.prisma +10 -2
package/package.json
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
-- AlterTable
|
|
2
|
+
ALTER TABLE `properties` ADD COLUMN `organizationId` VARCHAR(191) NULL;
|
|
3
|
+
|
|
4
|
+
-- CreateIndex
|
|
5
|
+
CREATE INDEX `properties_organizationId_idx` ON `properties`(`organizationId`);
|
|
6
|
+
|
|
7
|
+
-- AddForeignKey
|
|
8
|
+
ALTER TABLE `properties` ADD CONSTRAINT `properties_organizationId_fkey` FOREIGN KEY (`organizationId`) REFERENCES `organizations`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
package/prisma/schema.prisma
CHANGED
|
@@ -705,8 +705,8 @@ model Organization {
|
|
|
705
705
|
// Document reviews performed by this organization
|
|
706
706
|
documentReviews DocumentReview[]
|
|
707
707
|
|
|
708
|
-
// Properties developed by this organization
|
|
709
|
-
|
|
708
|
+
// Properties owned/developed by this organization
|
|
709
|
+
properties Property[]
|
|
710
710
|
|
|
711
711
|
@@unique([tenantId, bankCode]) // Bank codes unique within tenant
|
|
712
712
|
@@unique([tenantId, cacNumber]) // CAC numbers unique within tenant
|
|
@@ -1141,6 +1141,13 @@ model Property {
|
|
|
1141
1141
|
tenant Tenant @relation(fields: [tenantId], references: [id], onDelete: Cascade)
|
|
1142
1142
|
userId String
|
|
1143
1143
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
1144
|
+
|
|
1145
|
+
// Optional organization ownership
|
|
1146
|
+
// If set, any member of this organization with DEVELOPER role can manage the property
|
|
1147
|
+
// If null, only the userId owner can manage it (individual seller)
|
|
1148
|
+
organizationId String?
|
|
1149
|
+
organization Organization? @relation(fields: [organizationId], references: [id], onDelete: SetNull)
|
|
1150
|
+
|
|
1144
1151
|
title String
|
|
1145
1152
|
category String // SALE, RENT, LEASE
|
|
1146
1153
|
propertyType String // APARTMENT, HOUSE, LAND, COMMERCIAL, ESTATE, TOWNHOUSE
|
|
@@ -1169,6 +1176,7 @@ model Property {
|
|
|
1169
1176
|
|
|
1170
1177
|
@@index([tenantId])
|
|
1171
1178
|
@@index([userId])
|
|
1179
|
+
@@index([organizationId])
|
|
1172
1180
|
@@index([category])
|
|
1173
1181
|
@@index([propertyType])
|
|
1174
1182
|
@@index([city])
|