Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

store the verification status in the DB and display it on the UI

Kiran Kccce6e664aec
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/bank-accounts/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/bank-accounts/page-client.tsx
index 4f637195b6..e038c25a2a 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/bank-accounts/page-client.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/bank-accounts/page-client.tsx
@@ -2,10 +2,11 @@
import useWorkspace from "@/lib/swr/use-workspace";
import { useAddBankAccountModal } from "@/ui/modals/add-bank-account-modal";
-import { Button, MaxWidthWrapper } from "@dub/ui";
+import { Badge, Button, MaxWidthWrapper } from "@dub/ui";
export const BankAccountsClient = () => {
- const { bankAccountName, maskedAccountNumber } = useWorkspace();
+ const { bankAccountName, maskedAccountNumber, bankAccountVerified } =
+ useWorkspace();
const { AddBankAccountModal, setShowAddBankAccountModal } =
useAddBankAccountModal();
@@ -33,7 +34,11 @@ export const BankAccountsClient = () => {
<div>
{bankAccountName ? (
- <Button text="Disconnect" />
+ bankAccountVerified ? (
+ <Badge variant="blue">VERIFIED</Badge>
+ ) : (
+ <Badge variant="gray">PENDING VERIFICATION</Badge>
+ )
) : (
<Button
text="Add bank account"
diff --git a/apps/web/lib/zod/schemas/workspaces.ts b/apps/web/lib/zod/schemas/workspaces.ts
index 1915717b96..4af0a84a48 100644
--- a/apps/web/lib/zod/schemas/workspaces.ts
+++ b/apps/web/lib/zod/schemas/workspaces.ts
@@ -114,6 +114,7 @@ export const WorkspaceSchema = z
.describe("The publishable key of the workspace."),
bankAccountName: z.string().nullable(),
maskedAccountNumber: z.string().nullable(),
+ bankAccountVerified: z.boolean(),
})
.openapi({
title: "Workspace",
diff --git a/apps/web/prisma/schema/workspace.prisma b/apps/web/prisma/schema/workspace.prisma
index 8157bd525f..fdd8f33410 100644
--- a/apps/web/prisma/schema/workspace.prisma
+++ b/apps/web/prisma/schema/workspace.prisma
@@ -40,6 +40,7 @@ model Project {
dotsAppId String? @unique
bankAccountName String?
maskedAccountNumber String?
+ bankAccountVerified Boolean @default(false)
users ProjectUsers[]
invites ProjectInvite[]