Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SG - New place for wallet addresses #380

Merged
merged 12 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@charmverse/core",
"version": "0.90.0",
"version": "0.90.1-rc-feat-sg-wallet.0",
"description": "Core API for Charmverse",
"type": "commonjs",
"types": "./dist/cjs/index.d.ts",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-- CreateTable
CREATE TABLE "ScoutWallet" (
"id" UUID NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"address" TEXT NOT NULL,
"scoutId" UUID NOT NULL,

CONSTRAINT "ScoutWallet_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE UNIQUE INDEX "ScoutWallet_address_key" ON "ScoutWallet"("address");

-- AddForeignKey
ALTER TABLE "ScoutWallet" ADD CONSTRAINT "ScoutWallet_scoutId_fkey" FOREIGN KEY ("scoutId") REFERENCES "Scout"("id") ON DELETE CASCADE ON UPDATE CASCADE;
87 changes: 48 additions & 39 deletions src/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -1356,46 +1356,46 @@ model ProposalEvaluationPermission {
}

model ProposalEvaluation {
id String @id @default(uuid()) @db.Uuid
index Int // tells us what order
title String
type ProposalEvaluationType
completedAt DateTime?
declinedAt DateTime? // Required to keep track of when the evaluation was declined for an appealable step
snapshotId String?
snapshotExpiry DateTime?
decidedBy String? @db.Uuid
decider User? @relation(fields: [decidedBy], references: [id], onDelete: SetNull, name: "decidedBy")
proposalId String @db.Uuid
proposal Proposal @relation(fields: [proposalId], references: [id], onDelete: Cascade)
voteSettings Json?
voteId String? @unique @db.Uuid
vote Vote? @relation(fields: [voteId], references: [id], onDelete: SetNull)
actionLabels Json?
notificationLabels Json?
requiredReviews Int @default(1)
finalStep Boolean?
appealRequiredReviews Int?
appealable Boolean? @default(false)
appealedAt DateTime?
appealedBy String? @db.Uuid
appealReason String?
appealer User? @relation(fields: [appealedBy], references: [id], onDelete: SetNull, name: "appealedBy")
shareReviews Boolean? @default(false)
dueDate DateTime?
id String @id @default(uuid()) @db.Uuid
index Int // tells us what order
title String
type ProposalEvaluationType
completedAt DateTime?
declinedAt DateTime? // Required to keep track of when the evaluation was declined for an appealable step
snapshotId String?
snapshotExpiry DateTime?
decidedBy String? @db.Uuid
decider User? @relation(fields: [decidedBy], references: [id], onDelete: SetNull, name: "decidedBy")
proposalId String @db.Uuid
proposal Proposal @relation(fields: [proposalId], references: [id], onDelete: Cascade)
voteSettings Json?
voteId String? @unique @db.Uuid
vote Vote? @relation(fields: [voteId], references: [id], onDelete: SetNull)
actionLabels Json?
notificationLabels Json?
requiredReviews Int @default(1)
finalStep Boolean?
appealRequiredReviews Int?
appealable Boolean? @default(false)
appealedAt DateTime?
appealedBy String? @db.Uuid
appealReason String?
appealer User? @relation(fields: [appealedBy], references: [id], onDelete: SetNull, name: "appealedBy")
shareReviews Boolean? @default(false)
dueDate DateTime?
showAuthorResultsOnRubricFail Boolean?
rubricCriteria ProposalRubricCriteria[]
rubricAnswers ProposalRubricCriteriaAnswer[]
draftRubricAnswers DraftProposalRubricCriteriaAnswer[]
result ProposalEvaluationResult?
reviewers ProposalReviewer[]
appealReviewers ProposalAppealReviewer[]
permissions ProposalEvaluationPermission[]
proposalNotification ProposalNotification[]
reviews ProposalEvaluationReview[]
appealReviews ProposalEvaluationAppealReview[]
documentsToSign DocumentToSign[]
evaluationApprovers ProposalEvaluationApprover[]
rubricCriteria ProposalRubricCriteria[]
rubricAnswers ProposalRubricCriteriaAnswer[]
draftRubricAnswers DraftProposalRubricCriteriaAnswer[]
result ProposalEvaluationResult?
reviewers ProposalReviewer[]
appealReviewers ProposalAppealReviewer[]
permissions ProposalEvaluationPermission[]
proposalNotification ProposalNotification[]
reviews ProposalEvaluationReview[]
appealReviews ProposalEvaluationAppealReview[]
documentsToSign DocumentToSign[]
evaluationApprovers ProposalEvaluationApprover[]

@@index([proposalId])
@@index([index])
Expand Down Expand Up @@ -2804,6 +2804,7 @@ model Scout {
agreedToTermsAt DateTime?
onboardedAt DateTime?
currentBalance Int @default(0)
scoutWallet ScoutWallet[]
strikes BuilderStrike[]
events BuilderEvent[]
githubUser GithubUser[]
Expand Down Expand Up @@ -3166,3 +3167,11 @@ model BuilderCardActivity {

@@unique([builderId])
}

model ScoutWallet {
id String @id @default(uuid()) @db.Uuid
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we don't even need an id?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I think it is not necessary. I removed id and added address as an index since we will search by address on login

createdAt DateTime @default(now())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea to store this

address String @unique
scoutId String @db.Uuid
scout Scout @relation(fields: [scoutId], references: [id], onDelete: Cascade)
}