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 status field to Posting and update Posting types and resolvers #97

Merged
merged 2 commits into from
Jan 21, 2022

Conversation

briantu
Copy link
Member

@briantu briantu commented Jan 21, 2022

Ticket link

Closes #93

Implementation description

  • Added status column in the Posting table as enum of values:
    • DRAFT
    • PUBLISHED
    • ARCHIVED
  • Generated new migration file for status field
  • Updated PostingRequestDTO and PostingResponseDTO and corresponding GraphQL types with the status field
  • Modified PostingService CRUD methods to read/write the status value

Steps to test

  1. We need row(s) in the skills, branches, and employees tables for testing which can be created using the GraphQL mutations or with raw SQL:
docker exec -it sistering_db /bin/bash
psql -U postgres -d sistering
INSERT INTO branches (name) VALUES ('Branch1');
INSERT INTO skills (name) VALUES ('Skill1');
INSERT INTO employees ("userId", branch_id) VALUES ('1','1');
  1. Run docker exec -it sistering_backend /bin/bash -c "npx prisma generate"
  2. Go to http://localhost:5000/graphql and verify that we can read/write the status field using GraphQL queries and mutations

What should reviewers focus on?

  • Verify that we can read/write status field as expected

Checklist

  • My PR name is descriptive and in imperative tense
  • My commit messages are descriptive and in imperative tense. My commits are atomic and trivial commits are squashed or fixup'd into non-trivial commits
  • I have run the appropriate linter(s)
  • I have requested a review from the PL, as well as other devs who have background knowledge on this PR or who will be building on top of this PR

sherryhli
sherryhli previously approved these changes Jan 21, 2022
Copy link
Member

@sherryhli sherryhli left a comment

Choose a reason for hiding this comment

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

Code looks good for this ticket! 🔥 However, there's a small unrelated change that would be nice to sneak in as well (see comments for details)

backend/services/implementations/postingService.ts Outdated Show resolved Hide resolved
backend/services/implementations/postingService.ts Outdated Show resolved Hide resolved
@briantu briantu merged commit b3c6b42 into main Jan 21, 2022
@briantu briantu deleted the brian/add-status-field-to-posting branch January 21, 2022 16:52
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.

Add status field to Posting
2 participants