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

Add timestamps for proposal reviewer and rubric answers #393

Merged
merged 3 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all 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.97.0",
"version": "0.97.1-rc-proposal-review.0",
"description": "Core API for Charmverse",
"type": "commonjs",
"types": "./dist/cjs/index.d.ts",
Expand Down
8 changes: 8 additions & 0 deletions src/lib/testing/__tests__/proposals.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ describe('generateProposal', () => {
expect(proposal.reviewers).toMatchObject(
expect.arrayContaining<ProposalReviewer>([
{
createdAt: expect.any(Date),
updatedAt: expect.any(Date),
evaluationId: expect.any(String),
id: expect.any(String),
proposalId: proposal.id,
Expand All @@ -215,6 +217,8 @@ describe('generateProposal', () => {
systemRole: null
},
{
createdAt: expect.any(Date),
updatedAt: expect.any(Date),
evaluationId: expect.any(String),
id: expect.any(String),
proposalId: proposal.id,
Expand All @@ -223,6 +227,8 @@ describe('generateProposal', () => {
systemRole: null
},
{
createdAt: expect.any(Date),
updatedAt: expect.any(Date),
evaluationId: passFailStep.id,
id: expect.any(String),
proposalId: proposal.id,
Expand All @@ -231,6 +237,8 @@ describe('generateProposal', () => {
systemRole: null
},
{
createdAt: expect.any(Date),
updatedAt: expect.any(Date),
evaluationId: expect.any(String),
id: expect.any(String),
proposalId: proposal.id,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- AlterTable
ALTER TABLE "ProposalReviewer" ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;

-- AlterTable
ALTER TABLE "ProposalRubricCriteriaAnswer" ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;
4 changes: 4 additions & 0 deletions src/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -1460,6 +1460,8 @@ model ProposalAuthor {

model ProposalReviewer {
id String @id @default(uuid()) @db.Uuid
createdAt DateTime @default(now())
updatedAt DateTime @default(now())
proposalId String @db.Uuid
proposal Proposal @relation(fields: [proposalId], references: [id], onDelete: Cascade)
roleId String? @db.Uuid
Expand Down Expand Up @@ -1535,6 +1537,8 @@ model ProposalRubricCriteria {
}

model ProposalRubricCriteriaAnswer {
createdAt DateTime @default(now())
updatedAt DateTime @default(now())
rubricCriteriaId String @db.Uuid
rubricCriteria ProposalRubricCriteria @relation(fields: [rubricCriteriaId], references: [id], onDelete: Cascade)
proposalId String @db.Uuid
Expand Down