Skip to content

Commit af67ba3

Browse files
integrations table
1 parent 6a170ec commit af67ba3

File tree

17 files changed

+704
-2
lines changed

17 files changed

+704
-2
lines changed

docker-compose.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ services:
2323
- AWS_S3_SECRET_ACCESS_KEY=minioadmin
2424
- NODE_ENV=production
2525
- WEAVIATE_LOCAL_URL=weaviate:8080
26+
# OAUTH Apps
27+
- QUICKBOOKS_CLIENT_ID=
28+
- QUICKBOOKS_CLIENT_SECRET=
29+
- QUICKBOOKS_REDIRECT_URI=
30+
- XERO_CLIENT_ID=
31+
- XERO_CLIENT_SECRET=
32+
- XERO_REDIRECT_URI=
33+
- ZOHO_CLIENT_ID=
34+
- ZOHO_CLIENT_SECRET=
35+
- ZOHO_REDIRECT_URI=
2636
depends_on:
2737
- postgres
2838
- redis
@@ -56,6 +66,16 @@ services:
5666
- AWS_S3_SECRET_ACCESS_KEY=minioadmin
5767
- NODE_ENV=production
5868
- WEAVIATE_LOCAL_URL=weaviate:8080
69+
# OAUTH Apps
70+
- QUICKBOOKS_CLIENT_ID=
71+
- QUICKBOOKS_CLIENT_SECRET=
72+
- QUICKBOOKS_REDIRECT_URI=
73+
- XERO_CLIENT_ID=
74+
- XERO_CLIENT_SECRET=
75+
- XERO_REDIRECT_URI=
76+
- ZOHO_CLIENT_ID=
77+
- ZOHO_CLIENT_SECRET=
78+
- ZOHO_REDIRECT_URI=
5979
depends_on:
6080
- postgres
6181
- redis
@@ -88,6 +108,16 @@ services:
88108
- AWS_S3_SECRET_ACCESS_KEY=minioadmin
89109
- NODE_ENV=production
90110
- WEAVIATE_LOCAL_URL=weaviate:8080
111+
# OAUTH Apps
112+
- QUICKBOOKS_CLIENT_ID=
113+
- QUICKBOOKS_CLIENT_SECRET=
114+
- QUICKBOOKS_REDIRECT_URI=
115+
- XERO_CLIENT_ID=
116+
- XERO_CLIENT_SECRET=
117+
- XERO_REDIRECT_URI=
118+
- ZOHO_CLIENT_ID=
119+
- ZOHO_CLIENT_SECRET=
120+
- ZOHO_REDIRECT_URI=
91121
depends_on:
92122
- postgres
93123
- redis

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@
5757
"immer": "^10.1.1",
5858
"input-otp": "^1.4.1",
5959
"ioredis": "^5.4.2",
60+
"js-yaml": "^4.1.0",
61+
"jsonata": "^2.0.6",
62+
"jsonschema": "^1.5.0",
6063
"jsonwebtoken": "^9.0.2",
6164
"lucide-react": "^0.469.0",
6265
"next": "15.1.4",
@@ -85,6 +88,7 @@
8588
"zustand": "^5.0.3"
8689
},
8790
"devDependencies": {
91+
"@types/js-yaml": "^4.0.9",
8892
"@types/jsonwebtoken": "^9.0.7",
8993
"@types/node": "^20.17.12",
9094
"@types/node-cron": "^3.0.11",

pnpm-lock.yaml

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
-- CreateEnum
2+
CREATE TYPE "AuthType" AS ENUM ('OAUTH2', 'APIKEY');
3+
4+
-- CreateTable
5+
CREATE TABLE "Integration" (
6+
"name" TEXT NOT NULL,
7+
"organizationId" TEXT NOT NULL,
8+
"authType" "AuthType" NOT NULL,
9+
"accessToken" TEXT NOT NULL,
10+
"refreshToken" TEXT,
11+
"accessTokenExpiresAt" TIMESTAMP(3),
12+
13+
CONSTRAINT "Integration_pkey" PRIMARY KEY ("name","organizationId")
14+
);
15+
16+
-- AddForeignKey
17+
ALTER TABLE "Integration" ADD CONSTRAINT "Integration_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES "Organization"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

prisma/schema.prisma

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ enum Plan {
3636
ENTERPRISE
3737
}
3838

39+
enum AuthType {
40+
OAUTH2
41+
APIKEY
42+
}
43+
3944
model User {
4045
id String @id @default(cuid())
4146
name String?
@@ -64,6 +69,7 @@ model Organization {
6469
indexedSources IndexedSource[]
6570
extractedSheetRows ExtractedSheetRow[]
6671
billing Billing?
72+
integrations Integration[]
6773
}
6874

6975
model Member {
@@ -202,3 +208,15 @@ model IndexedSource {
202208
sheetColumnValues SheetColumnValue[]
203209
extractedSheetRows ExtractedSheetRow[]
204210
}
211+
212+
model Integration {
213+
name String
214+
organizationId String
215+
organization Organization @relation(fields: [organizationId], references: [id])
216+
authType AuthType
217+
accessToken String
218+
refreshToken String?
219+
accessTokenExpiresAt DateTime?
220+
221+
@@id([name, organizationId])
222+
}

public/quickbooks.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)