Skip to content

Commit

Permalink
Add timestamps for proposal reviewer and rubric answers (#393)
Browse files Browse the repository at this point in the history
* Add timestamps for proposal reviewer and rubric answers

* Fix type errors

* ci: version bump to 0.97.1-rc-proposal-review.0

---------

Co-authored-by: Automated Version Bump <[email protected]>
  • Loading branch information
motechFR and Automated Version Bump authored Nov 27, 2024
1 parent d6c6b4c commit fc600f6
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
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

0 comments on commit fc600f6

Please sign in to comment.