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

Validate date of birth #129

Merged
merged 2 commits into from Apr 3, 2019
Merged

Validate date of birth #129

merged 2 commits into from Apr 3, 2019

Conversation

@sandeshsoni
Copy link
Contributor

@sandeshsoni sandeshsoni commented Apr 1, 2019

Fixes issue number

fixes #127

Describe the changes made on this PR

  • add a validation, date-of-birth can be same date or past date only

Visuals

If your merge request had visual changes we need the screenshot of the affected pages and if behaviour changed
we will need a gif showing the new features

Screenshots

Screenshot 2019-04-01 21 53 43

Mobile view

Attach screenshot of changes as they appear on a small screen

Desktop view

Attach screenshot of the changes as they appear on larger screens

GIF

If there were changes on how the application behaves then attach a gif showing the new changes

Reviews

  • I have formated by code as expected
    We have a handy tool that helps you check if your elixir code is well formatted. If the tool passes on your local build
    then it will definitly pass our linting checks online

  • I have filled in all the required information above

  • I have marked my work as ready for review

@sandeshsoni
Copy link
Contributor Author

@sandeshsoni sandeshsoni commented Apr 1, 2019

@GettyOrawo Please confirm if a child born today can be added or not.
I used my judgement and added logic. Correct me if the logic looks wrong to you.

Loading

@sigu
Copy link
Member

@sigu sigu commented Apr 2, 2019

@sandeshsoni yes a child born today can be added on the system

Loading

|> validate_date_is_not_future
end

defp validate_date_is_not_future(changeset) do
Copy link
Member

@sigu sigu Apr 2, 2019

Choose a reason for hiding this comment

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

Though not strict requirement, we like having private functions start with _ .
This allows us to know whether its a private function defined within the module or its been imported from other modules

In this case we can have

defp _validate_date_is_not_future(changeset) do
......
end

Loading

Copy link
Contributor Author

@sandeshsoni sandeshsoni Apr 2, 2019

Choose a reason for hiding this comment

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

I have updated the PR.

use _ prefix for private function
squashed commits to a single commit.

Loading

@sigu sigu added this to In progress in Registrations via automation Apr 2, 2019
@sigu sigu added this to the registrations milestone Apr 2, 2019
add prefix underscore to private function
@GettyOrawo
Copy link
Collaborator

@GettyOrawo GettyOrawo commented Apr 2, 2019

This is great @sandeshsoni 😃 I love your approach towards this. Will merge it in after the other approvals. Good job!

Loading

Registrations automation moved this from In progress to Reviewer approved Apr 2, 2019
@sigu
Copy link
Member

@sigu sigu commented Apr 2, 2019

Lets wait for the conference demonstration by @LindaKadz before merging this in :-)

Loading

@misswayua
Copy link
Collaborator

@misswayua misswayua commented Apr 3, 2019

It seems your branch does not have the latest changes from the base branch. I would request you to update your branch (pull from develop) and push so that we can merge your work.

Loading

@misswayua misswayua merged commit b460aed into Podiihq:develop Apr 3, 2019
1 check passed
Loading
Registrations automation moved this from Reviewer approved to Done Apr 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Registrations
  
Done
Linked issues

Successfully merging this pull request may close these issues.

5 participants