Skip to content

Commit f27c598

Browse files
authored
Merge branch 'main' into new-dashboard-ui-#116
2 parents fd396a9 + 9813b97 commit f27c598

File tree

53 files changed

+2755
-99
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+2755
-99
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
name: Bug Report
3+
description: Report a bug or issue
4+
title: "[BUG] "
5+
labels: ["bug"]
6+
assignees: []
7+
body:
8+
- type: textarea
9+
id: description
10+
attributes:
11+
label: Description
12+
description: A clear and concise description of the bug.
13+
placeholder: Describe what happened...
14+
validations:
15+
required: true
16+
- type: textarea
17+
id: steps
18+
attributes:
19+
label: Steps to Reproduce
20+
description: Steps to reproduce the behavior.
21+
placeholder: |
22+
1. Go to '...'
23+
2. Click on '...'
24+
3. Scroll down to '...'
25+
4. See error
26+
validations:
27+
required: true
28+
- type: textarea
29+
id: expected
30+
attributes:
31+
label: Expected Behavior
32+
description: What you expected to happen.
33+
validations:
34+
required: true
35+
- type: textarea
36+
id: actual
37+
attributes:
38+
label: Actual Behavior
39+
description: What actually happened.
40+
validations:
41+
required: true
42+
- type: input
43+
id: version
44+
attributes:
45+
label: Version
46+
description: What version of the software are you using?
47+
placeholder: e.g., v1.0.0
48+
- type: input
49+
id: environment
50+
attributes:
51+
label: Environment
52+
description: What environment are you running in?
53+
placeholder: e.g., Browser, Node.js version, OS
54+
- type: textarea
55+
id: additional
56+
attributes:
57+
label: Additional Context
58+
description: Add any other context about the problem here.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
name: Feature Request
3+
description: Suggest a new feature or enhancement
4+
title: "[FEATURE] "
5+
labels: ["enhancement"]
6+
assignees: []
7+
body:
8+
- type: textarea
9+
id: summary
10+
attributes:
11+
label: Summary
12+
description: A brief summary of the feature request.
13+
placeholder: What feature would you like to see?
14+
validations:
15+
required: true
16+
- type: textarea
17+
id: problem
18+
attributes:
19+
label: Problem
20+
description: What problem does this feature solve?
21+
placeholder: Is there a problem this feature would solve? If so, describe it.
22+
validations:
23+
required: true
24+
- type: textarea
25+
id: solution
26+
attributes:
27+
label: Proposed Solution
28+
description: Describe the solution you'd like.
29+
placeholder: How would you like this feature to work?
30+
validations:
31+
required: true
32+
- type: textarea
33+
id: alternatives
34+
attributes:
35+
label: Alternatives Considered
36+
description: Have you considered any alternative solutions?
37+
placeholder: Describe any alternative solutions or features you've considered.
38+
- type: textarea
39+
id: additional
40+
attributes:
41+
label: Additional Context
42+
description: Add any other context or screenshots about the feature request here.

.github/ISSUE_TEMPLATE/general.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: General Issue
3+
description: For general questions, discussions, or other issues
4+
title: "[GENERAL] "
5+
labels: []
6+
assignees: []
7+
body:
8+
- type: textarea
9+
id: description
10+
attributes:
11+
label: Description
12+
description: Describe your issue or question.
13+
placeholder: What is your question or issue?
14+
validations:
15+
required: true
16+
- type: textarea
17+
id: context
18+
attributes:
19+
label: Context
20+
description: Provide any additional context or details.
21+
- type: textarea
22+
id: additional
23+
attributes:
24+
label: Additional Information
25+
description: Any other information that might be helpful.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## Description
2+
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
3+
4+
## Type of Change
5+
- [ ] Bug fix (non-breaking change which fixes an issue)
6+
- [ ] New feature (non-breaking change which adds functionality)
7+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
8+
- [ ] Documentation update
9+
- [ ] Refactor
10+
- [ ] Other (please specify):
11+
12+
## Checklist
13+
- [ ] My code follows the project's style guidelines
14+
- [ ] I have performed a self-review of my own code
15+
- [ ] I have commented my code, particularly in hard-to-understand areas
16+
- [ ] I have made corresponding changes to the documentation
17+
- [ ] My changes generate no new warnings
18+
- [ ] I have added tests that prove my fix is effective or that my feature works
19+
- [ ] New and existing unit tests pass locally with my changes
20+
- [ ] Any dependent changes have been merged and published in downstream modules
21+
22+
## Related Issues
23+
Closes #
24+
25+
## Screenshots (if applicable)
26+
<!-- Add screenshots to help explain your changes -->

apps/api/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
"express-rate-limit": "^7.5.0",
3535
"helmet": "^7.2.0",
3636
"jsonwebtoken": "^9.0.2",
37+
"razorpay": "^2.9.6",
38+
"superjson": "^2.2.5",
39+
"zeptomail": "^6.2.1",
3740
"zod": "^4.1.9"
3841
}
3942
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
-- CreateTable
2+
CREATE TABLE "QueryCount" (
3+
"id" INTEGER NOT NULL DEFAULT 1,
4+
"total_queries" INTEGER NOT NULL,
5+
6+
CONSTRAINT "QueryCount_pkey" PRIMARY KEY ("id")
7+
);
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- AlterTable
2+
ALTER TABLE "QueryCount" ALTER COLUMN "total_queries" SET DATA TYPE BIGINT;
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
-- CreateTable
2+
CREATE TABLE "User" (
3+
"id" TEXT NOT NULL,
4+
"email" TEXT NOT NULL,
5+
"firstName" TEXT NOT NULL,
6+
"authMethod" TEXT NOT NULL,
7+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
8+
"lastLogin" TIMESTAMP(3) NOT NULL,
9+
10+
CONSTRAINT "User_pkey" PRIMARY KEY ("id")
11+
);
12+
13+
-- CreateTable
14+
CREATE TABLE "Account" (
15+
"id" TEXT NOT NULL,
16+
"userId" TEXT NOT NULL,
17+
"type" TEXT NOT NULL,
18+
"provider" TEXT NOT NULL,
19+
"providerAccountId" TEXT NOT NULL,
20+
"refresh_token" TEXT,
21+
"access_token" TEXT,
22+
"expires_at" INTEGER,
23+
"token_type" TEXT,
24+
"scope" TEXT,
25+
"id_token" TEXT,
26+
"session_state" TEXT,
27+
28+
CONSTRAINT "Account_pkey" PRIMARY KEY ("id")
29+
);
30+
31+
-- CreateIndex
32+
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
33+
34+
-- CreateIndex
35+
CREATE UNIQUE INDEX "Account_provider_providerAccountId_key" ON "Account"("provider", "providerAccountId");
36+
37+
-- AddForeignKey
38+
ALTER TABLE "Account" ADD CONSTRAINT "Account_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
-- CreateTable
2+
CREATE TABLE "Payment" (
3+
"id" TEXT NOT NULL,
4+
"userId" TEXT NOT NULL,
5+
"subscriptionId" TEXT,
6+
"razorpayPaymentId" TEXT NOT NULL,
7+
"razorpayOrderId" TEXT NOT NULL,
8+
"amount" INTEGER NOT NULL,
9+
"currency" TEXT NOT NULL DEFAULT 'INR',
10+
"status" TEXT NOT NULL,
11+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
12+
"updatedAt" TIMESTAMP(3) NOT NULL,
13+
14+
CONSTRAINT "Payment_pkey" PRIMARY KEY ("id")
15+
);
16+
17+
-- CreateTable
18+
CREATE TABLE "Subscription" (
19+
"id" TEXT NOT NULL,
20+
"userId" TEXT NOT NULL,
21+
"planId" TEXT NOT NULL,
22+
"status" TEXT NOT NULL,
23+
"startDate" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
24+
"endDate" TIMESTAMP(3) NOT NULL,
25+
"autoRenew" BOOLEAN NOT NULL DEFAULT true,
26+
27+
CONSTRAINT "Subscription_pkey" PRIMARY KEY ("id")
28+
);
29+
30+
-- CreateTable
31+
CREATE TABLE "Plan" (
32+
"id" TEXT NOT NULL,
33+
"name" TEXT NOT NULL,
34+
"interval" TEXT NOT NULL,
35+
"price" INTEGER NOT NULL,
36+
"currency" TEXT NOT NULL DEFAULT 'INR',
37+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
38+
"updatedAt" TIMESTAMP(3) NOT NULL,
39+
40+
CONSTRAINT "Plan_pkey" PRIMARY KEY ("id")
41+
);
42+
43+
-- CreateIndex
44+
CREATE UNIQUE INDEX "Payment_razorpayPaymentId_key" ON "Payment"("razorpayPaymentId");
45+
46+
-- CreateIndex
47+
CREATE INDEX "Subscription_userId_idx" ON "Subscription"("userId");
48+
49+
-- AddForeignKey
50+
ALTER TABLE "Payment" ADD CONSTRAINT "Payment_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
51+
52+
-- AddForeignKey
53+
ALTER TABLE "Payment" ADD CONSTRAINT "Payment_subscriptionId_fkey" FOREIGN KEY ("subscriptionId") REFERENCES "Subscription"("id") ON DELETE SET NULL ON UPDATE CASCADE;
54+
55+
-- AddForeignKey
56+
ALTER TABLE "Subscription" ADD CONSTRAINT "Subscription_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
57+
58+
-- AddForeignKey
59+
ALTER TABLE "Subscription" ADD CONSTRAINT "Subscription_planId_fkey" FOREIGN KEY ("planId") REFERENCES "Plan"("id") ON DELETE CASCADE ON UPDATE CASCADE;

apps/api/prisma/migrations/20251030121123_add_payment_constraints/migration.sql

Whitespace-only changes.

0 commit comments

Comments
 (0)