Fix rejected Apple:

Penambahan fitur checklist terms of service dan penambahan database blockuser

Add:
- prisma/migrations/20251124061947_add_terms_of_service_accepted/
- prisma/migrations/20251124081155_add_blocked_user_and_menu_feature/
- prisma/migrations/20251124083155_fix_master_kategori_app_and_delete_menu_feature/
- public/terms-of-service.html
- src/app/api/auth/term-service/

Fix:
- prisma/schema.prisma
- src/app/api/auth/register/route.ts
- src/app/api/auth/validasi/route.ts
- src/app_modules/_global/fun/generate_seeder.ts
- src/bin/seeder/master/master_kategori_app.json
- src/bin/seeder/user_seeder.json
- src/middleware.tsx

### No Issue
This commit is contained in:
2025-11-24 16:44:00 +08:00
parent 38734cda8c
commit 09be7739d5
12 changed files with 255 additions and 16 deletions

View File

@@ -0,0 +1,5 @@
-- AlterTable
ALTER TABLE "Donasi_Invoice" ALTER COLUMN "masterBankId" SET DEFAULT 'null';
-- AlterTable
ALTER TABLE "User" ADD COLUMN "termsOfServiceAccepted" BOOLEAN NOT NULL DEFAULT false;

View File

@@ -0,0 +1,35 @@
-- CreateTable
CREATE TABLE "BlockedUser" (
"id" TEXT NOT NULL,
"isActive" BOOLEAN NOT NULL DEFAULT true,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"blockerId" TEXT NOT NULL,
"blockedId" TEXT NOT NULL,
"menuFeatureId" TEXT NOT NULL,
CONSTRAINT "BlockedUser_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "MenuFeature" (
"id" TEXT NOT NULL,
"isActive" BOOLEAN NOT NULL DEFAULT true,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"name" TEXT NOT NULL,
CONSTRAINT "MenuFeature_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "BlockedUser_blockerId_blockedId_key" ON "BlockedUser"("blockerId", "blockedId");
-- AddForeignKey
ALTER TABLE "BlockedUser" ADD CONSTRAINT "BlockedUser_menuFeatureId_fkey" FOREIGN KEY ("menuFeatureId") REFERENCES "MenuFeature"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "BlockedUser" ADD CONSTRAINT "BlockedUser_blockerId_fkey" FOREIGN KEY ("blockerId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "BlockedUser" ADD CONSTRAINT "BlockedUser_blockedId_fkey" FOREIGN KEY ("blockedId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

View File

@@ -0,0 +1,14 @@
/*
Warnings:
- You are about to drop the `MenuFeature` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropForeignKey
ALTER TABLE "BlockedUser" DROP CONSTRAINT "BlockedUser_menuFeatureId_fkey";
-- DropTable
DROP TABLE "MenuFeature";
-- AddForeignKey
ALTER TABLE "BlockedUser" ADD CONSTRAINT "BlockedUser_menuFeatureId_fkey" FOREIGN KEY ("menuFeatureId") REFERENCES "MasterKategoriApp"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

View File

@@ -49,8 +49,12 @@ model User {
BusinessMaps BusinessMaps[]
Investasi_Invoice Investasi_Invoice[]
EventSponsor EventSponsor[]
EventTransaksi EventTransaksi[]
EventSponsor EventSponsor[]
EventTransaksi EventTransaksi[]
termsOfServiceAccepted Boolean @default(false)
blockedUsers BlockedUser[] @relation("Blocking")
blockedBy BlockedUser[] @relation("BlockedBy")
}
model MasterUserRole {
@@ -1011,6 +1015,8 @@ model MasterKategoriApp {
updatedAt DateTime @updatedAt
name String
value String?
blockedUsers BlockedUser[]
}
// ======================= EVENT ======================= //
@@ -1073,3 +1079,20 @@ model Sticker {
MasterEmotions MasterEmotions[] @relation("StikerEmotions")
}
model BlockedUser {
id String @id @default(uuid())
isActive Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
blockerId String // ID user yang memblokir
blockedId String // ID user yang diblokir
menuFeatureId String
menuFeature MasterKategoriApp @relation(fields: [menuFeatureId], references: [id])
blocker User @relation("BlockedBy", fields: [blockerId], references: [id])
blocked User @relation("Blocking", fields: [blockedId], references: [id])
@@unique([blockerId, blockedId])
}