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

Conversation

@sandeshsoni
Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor Author

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.

@sigu

This comment has been minimized.

Copy link
Member

commented Apr 2, 2019

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

|> validate_date_is_not_future
end

defp validate_date_is_not_future(changeset) do

This comment has been minimized.

Copy link
@sigu

sigu Apr 2, 2019

Member

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

This comment has been minimized.

Copy link
@sandeshsoni

sandeshsoni Apr 2, 2019

Author Contributor

I have updated the PR.

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

@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

@sandeshsoni sandeshsoni force-pushed the sandeshsoni:develop branch from 66bddf9 to 3d33ecc Apr 2, 2019

Add validation, date_of_birth cannot be future date
add prefix underscore to private function
@GettyOrawo

This comment has been minimized.

Copy link
Collaborator

commented Apr 2, 2019

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

Registrations automation moved this from In progress to Reviewer approved Apr 2, 2019

@sigu

This comment has been minimized.

Copy link
Member

commented Apr 2, 2019

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

@misswayua

This comment has been minimized.

Copy link
Collaborator

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.

@misswayua misswayua referenced this pull request Apr 3, 2019
0 of 3 tasks complete

@misswayua misswayua merged commit b460aed into Podiihq:develop Apr 3, 2019

1 check passed

Travis CI - Pull Request Build Passed
Details

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
5 participants
You can’t perform that action at this time.