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 salary range #31

Merged
merged 4 commits into from
Aug 22, 2017
Merged

Add salary range #31

merged 4 commits into from
Aug 22, 2017

Conversation

coreyar
Copy link
Contributor

@coreyar coreyar commented Aug 15, 2017

  • Add Salary Range
  • Add API_URL to .env.example
  • Fix filepath in knexfile.js

@egdelwonk
Copy link
Collaborator

Looks good!

Any chance you could update the migration to set the lower/upper salary value to the same values based on the salary_range before dropping the column ?

The original salary_range was to have a enum of ranges, as well, which may work.

@coreyar
Copy link
Contributor Author

coreyar commented Aug 18, 2017

Totally. Before I do that, should I make it an enum of ranges or keep it as is?

@egdelwonk
Copy link
Collaborator

Ranges are fine as long as we have the migration for existing data.

@coreyar
Copy link
Contributor Author

coreyar commented Aug 20, 2017

I ended up switching to an enum so that it follows the same pattern as experience range which I think is important for consistency.

I also added a seed for test data.

@@ -99,8 +98,7 @@ exports.update = async function(req, res, next) {
req
.assert("experience_range", "Please enter a valid experience_range")
.isInt();
req.assert("lower_salary", "Please enter a valid lower_salary").isInt();
req.assert("upper_salary", "Please enter a valid upper_salary").isInt();
req.assert("salary_range", "Please enter a valid lower_salary").isInt();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this read "Please enter a valid salary range."?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🙈 Yes, it should.

@egdelwonk
Copy link
Collaborator

egdelwonk commented Aug 22, 2017

Great! Thanks. We may need to convert the existing jobs salary data (migration?) to use the new ENUM values. Any ideas?

@coreyar
Copy link
Contributor Author

coreyar commented Aug 22, 2017

I think that is covered in the migration. The seeder that I added has a salary saved as a dollar value so you could run the seeder, then run the migrations to test.
https://github.com/egdelwonk/nashdev-jobs/pull/31/files#diff-25d624080caf012072cb280e94b5795a

@egdelwonk
Copy link
Collaborator

Argh, you are right! So sorry, I overlooked that file. Thank you for doing this!

@egdelwonk egdelwonk merged commit 858e6e1 into nashdev:master Aug 22, 2017
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