-
Notifications
You must be signed in to change notification settings - Fork 17
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
Feat/score proponent - Create endpoint #484
Conversation
Quality Gate failedFailed conditions |
Validation | ||
} from "shared/lib/validation"; | ||
|
||
function makeValidateSWUTeamQuestionResponseEvaluationEnum<T>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is only used for making validators for response evaluations, but you could name it something more generic and make it available for other types of validators. Nothing seems strictly specific to response evaluations.
@@ -462,3 +462,19 @@ export function validatePriceWeight(raw: string | number): Validation<number> { | |||
export function validateNote(raw: string): Validation<string> { | |||
return validateGenericString(raw, "Status Note", 0, 1000); | |||
} | |||
|
|||
export function validateSWUEvaluationPanelMemberEvaluator( | |||
raw: any |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to avoid the use of any
, unknown
is a good alternative for a type here.
await connection.schema.raw(` \ | ||
ALTER TABLE "swuOpportunityStatuses" \ | ||
ADD CONSTRAINT "swuOpportunityStatuses_status_check" \ | ||
CHECK (status IN ('${Object.values(SWUOpportunityStatus).join("','")}')) \ | ||
`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need the \
's to denote newlines since you are using backticks ` here.
@sutherlanda, not sure if you ran any migrations for the last meeting, but if you did, you should migrate down before applying these because I changed src/migrations/tasks/20240718222006_swu-evaluation-tables.ts.
There's a lot to critique, but I want to see if this create endpoint fits into the overall flow for "in-app evaluations" and if it fulfills some of the requirements we discussed last time; I'll try to map it to JIRA tickets when possible and I've included a rough diagram to try help you visualize things:
Assuming everything's good to go here, my plan is to:
FYI, I've tested this manually using postman and by manipulating the database, but I decided to hold back on automated tests because I wanted to make sure I was on the right track first. I'll include those in the next PR when we're on the same page.