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

Feat/score proponent - Create endpoint #484

Merged
merged 88 commits into from
Aug 22, 2024

Conversation

IanFonzie
Copy link
Collaborator

@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.

individual-flow drawio

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:

  • When the opportunity closes, use a new status, i.e. SWUOpportunityStatus.TeamQuestionsPanelEvaluation to represent that it's in the panel evaluation state
    • Note: I haven't actually changed this to being the opportunity state when it closes yet
  • When the user is viewing a proposal for evaluation (haven't determined the format for the URL yet), the application will load an existing evaluation if there is one, or allow the user to submit a new draft. (Relates to DMM-417 and DMM-418).
  • The endpoint in this PR will be used to submit drafts; the design seems to imply that submission should be handled from the overview screen detailed in DMM-417's Figma design.
  • I can discuss with the rest of the team to see if submission from the overview screen is a strict requirement, as I think there could be some issues with validation user experience.

Assuming everything's good to go here, my plan is to:

  • Add read and readMany endpoints for use in the UIs
  • Add an update endpoint for editing drafts and submitting evaluations
  • Implement some sort of check that ensures all individual evaluations have been submitted to move the proposal into the consensus stage when submitting evaluations (Relates to DMM-420
  • The consensus will follow a similar format to individual evaluation, except it looks like individual evaluators need to be able to agree to consensus (relates to DMM-445.
  • This is another requirement I'll need to check on as there doesn't seem to be any way to reject the consensus and I'm not sure how up to date it is.

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.

Copy link

sonarcloud bot commented Aug 20, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

Validation
} from "shared/lib/validation";

function makeValidateSWUTeamQuestionResponseEvaluationEnum<T>(
Copy link
Contributor

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
Copy link
Contributor

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.

Comment on lines +51 to +55
await connection.schema.raw(` \
ALTER TABLE "swuOpportunityStatuses" \
ADD CONSTRAINT "swuOpportunityStatuses_status_check" \
CHECK (status IN ('${Object.values(SWUOpportunityStatus).join("','")}')) \
`);
Copy link
Contributor

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.

@IanFonzie IanFonzie merged commit 3a4ae65 into in-app-evaluation Aug 22, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants