🛂 (radar) Add isVerified field in workspace
This commit is contained in:
@ -48,6 +48,7 @@ export const publishTypebot = authenticatedProcedure
|
|||||||
workspace: {
|
workspace: {
|
||||||
select: {
|
select: {
|
||||||
plan: true,
|
plan: true,
|
||||||
|
isVerified: true,
|
||||||
isSuspended: true,
|
isSuspended: true,
|
||||||
isPastDue: true,
|
isPastDue: true,
|
||||||
members: {
|
members: {
|
||||||
@ -87,7 +88,8 @@ export const publishTypebot = authenticatedProcedure
|
|||||||
'Radar detected a potential malicious typebot. This bot is being manually reviewed by Fraud Prevention team.',
|
'Radar detected a potential malicious typebot. This bot is being manually reviewed by Fraud Prevention team.',
|
||||||
})
|
})
|
||||||
|
|
||||||
const typebotWasVerified = existingTypebot.riskLevel === -1
|
const typebotWasVerified =
|
||||||
|
existingTypebot.riskLevel === -1 || existingTypebot.workspace.isVerified
|
||||||
|
|
||||||
const riskLevel = typebotWasVerified ? 0 : computeRiskLevel(existingTypebot)
|
const riskLevel = typebotWasVerified ? 0 : computeRiskLevel(existingTypebot)
|
||||||
|
|
||||||
|
@ -7072,6 +7072,10 @@
|
|||||||
},
|
},
|
||||||
"isPastDue": {
|
"isPastDue": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"isVerified": {
|
||||||
|
"type": "boolean",
|
||||||
|
"nullable": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@ -7093,7 +7097,8 @@
|
|||||||
"customSeatsLimit",
|
"customSeatsLimit",
|
||||||
"isQuarantined",
|
"isQuarantined",
|
||||||
"isSuspended",
|
"isSuspended",
|
||||||
"isPastDue"
|
"isPastDue",
|
||||||
|
"isVerified"
|
||||||
],
|
],
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
}
|
}
|
||||||
@ -7225,6 +7230,10 @@
|
|||||||
},
|
},
|
||||||
"isPastDue": {
|
"isPastDue": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"isVerified": {
|
||||||
|
"type": "boolean",
|
||||||
|
"nullable": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@ -7246,7 +7255,8 @@
|
|||||||
"customSeatsLimit",
|
"customSeatsLimit",
|
||||||
"isQuarantined",
|
"isQuarantined",
|
||||||
"isSuspended",
|
"isSuspended",
|
||||||
"isPastDue"
|
"isPastDue",
|
||||||
|
"isVerified"
|
||||||
],
|
],
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
}
|
}
|
||||||
@ -7395,6 +7405,10 @@
|
|||||||
},
|
},
|
||||||
"isPastDue": {
|
"isPastDue": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"isVerified": {
|
||||||
|
"type": "boolean",
|
||||||
|
"nullable": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@ -7416,7 +7430,8 @@
|
|||||||
"customSeatsLimit",
|
"customSeatsLimit",
|
||||||
"isQuarantined",
|
"isQuarantined",
|
||||||
"isSuspended",
|
"isSuspended",
|
||||||
"isPastDue"
|
"isPastDue",
|
||||||
|
"isVerified"
|
||||||
],
|
],
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
}
|
}
|
||||||
@ -54488,6 +54503,10 @@
|
|||||||
},
|
},
|
||||||
"isPastDue": {
|
"isPastDue": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"isVerified": {
|
||||||
|
"type": "boolean",
|
||||||
|
"nullable": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@ -54509,7 +54528,8 @@
|
|||||||
"customSeatsLimit",
|
"customSeatsLimit",
|
||||||
"isQuarantined",
|
"isQuarantined",
|
||||||
"isSuspended",
|
"isSuspended",
|
||||||
"isPastDue"
|
"isPastDue",
|
||||||
|
"isVerified"
|
||||||
],
|
],
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"nullable": true
|
"nullable": true
|
||||||
|
@ -99,6 +99,7 @@ model Workspace {
|
|||||||
isQuarantined Boolean @default(false)
|
isQuarantined Boolean @default(false)
|
||||||
isSuspended Boolean @default(false)
|
isSuspended Boolean @default(false)
|
||||||
isPastDue Boolean @default(false)
|
isPastDue Boolean @default(false)
|
||||||
|
isVerified Boolean?
|
||||||
themeTemplates ThemeTemplate[]
|
themeTemplates ThemeTemplate[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,9 +12,6 @@ CREATE TABLE "BannedIp" (
|
|||||||
-- CreateIndex
|
-- CreateIndex
|
||||||
CREATE UNIQUE INDEX "BannedIp_ip_key" ON "BannedIp"("ip");
|
CREATE UNIQUE INDEX "BannedIp_ip_key" ON "BannedIp"("ip");
|
||||||
|
|
||||||
-- CreateIndex
|
|
||||||
CREATE INDEX "Answer_storageUsed_idx" ON "Answer"("storageUsed");
|
|
||||||
|
|
||||||
-- AddForeignKey
|
-- AddForeignKey
|
||||||
ALTER TABLE "BannedIp" ADD CONSTRAINT "BannedIp_responsibleTypebotId_fkey" FOREIGN KEY ("responsibleTypebotId") REFERENCES "Typebot"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
ALTER TABLE "BannedIp" ADD CONSTRAINT "BannedIp_responsibleTypebotId_fkey" FOREIGN KEY ("responsibleTypebotId") REFERENCES "Typebot"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "Workspace" ADD COLUMN "isVerified" BOOLEAN;
|
@ -93,6 +93,7 @@ model Workspace {
|
|||||||
isQuarantined Boolean @default(false)
|
isQuarantined Boolean @default(false)
|
||||||
isSuspended Boolean @default(false)
|
isSuspended Boolean @default(false)
|
||||||
isPastDue Boolean @default(false)
|
isPastDue Boolean @default(false)
|
||||||
|
isVerified Boolean?
|
||||||
themeTemplates ThemeTemplate[]
|
themeTemplates ThemeTemplate[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,6 +51,7 @@ export const workspaceSchema = z.object({
|
|||||||
isQuarantined: z.boolean(),
|
isQuarantined: z.boolean(),
|
||||||
isSuspended: z.boolean(),
|
isSuspended: z.boolean(),
|
||||||
isPastDue: z.boolean(),
|
isPastDue: z.boolean(),
|
||||||
|
isVerified: z.boolean().nullable(),
|
||||||
}) satisfies z.ZodType<WorkspacePrisma>
|
}) satisfies z.ZodType<WorkspacePrisma>
|
||||||
|
|
||||||
export type Workspace = z.infer<typeof workspaceSchema>
|
export type Workspace = z.infer<typeof workspaceSchema>
|
||||||
|
Reference in New Issue
Block a user