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

#32: Add ReservationSettings model #53

Merged
merged 6 commits into from
Jan 29, 2019
Merged

#32: Add ReservationSettings model #53

merged 6 commits into from
Jan 29, 2019

Conversation

vladarefiev
Copy link

@vladarefiev vladarefiev commented Jan 28, 2019

PR for #32

  • Add ReservationSettings model
  • Add migration
  • Refactoring imports to improve readability
  • Set up views.py for reservation module

@0crat 0crat added the scope Issue is in scope label Jan 28, 2019
@0crat
Copy link

0crat commented Jan 28, 2019

Job #53 is now in scope, role is REV

@0crat
Copy link

0crat commented Jan 28, 2019

This pull request #53 is assigned to @amihaiemil/z, here is why; the budget is 15 minutes, see §4; please, read §27 and when you decide to accept the changes, inform @emilianodellacasa/z (the architect) right in this ticket; if you decide that this PR should not be accepted ever, also inform the architect; this blog post will help you understand what is expected from a code reviewer; there will be a monetary reward for this job

Copy link
Contributor

@amihaiemil amihaiemil left a comment

Choose a reason for hiding this comment

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

@vladarefiev some comments :)

and please, specify the original ticket number in the PR's description. Start the description with "PR for ...:" :D

"6": "Good morning",
"12": "Good afternoon",
"18": "Good morning",
}
Copy link
Contributor

Choose a reason for hiding this comment

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

@vladarefiev Indentation here

Copy link
Author

Choose a reason for hiding this comment

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

@amihaiemil excuse me, didn't get your point.

greeting_by_time = DB.Column(DB.JSON)
sex = DB.Column(DB.String)
created_on = DB.Column(
DB.DateTime, default=datetime.utcnow, nullable=False)
Copy link
Contributor

Choose a reason for hiding this comment

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

@vladarefiev Why is this on a new line, can't everything be on one line? Is some linter complaining?

Copy link
Author

Choose a reason for hiding this comment

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

@amihaiemil Actually according to PEP8
Limit all lines to a maximum of 79 characters

bp = Blueprint('reservations', __name__, url_prefix='/reservations')


@bp.route('/settings_page')
Copy link
Contributor

Choose a reason for hiding this comment

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

@vladarefiev just /settings here, I would say. This is the API layer, it doesn't know anything about "pages", it just returns and consumes Json objects, right? :D

Copy link
Author

Choose a reason for hiding this comment

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

@amihaiemil ok, agree :)

"""
@todo #32:30min Continue implementing Settings page
"""
return 'Settings page'
Copy link
Contributor

Choose a reason for hiding this comment

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

@vladarefiev "Settings API entry point" is more suitable.

Copy link
Author

Choose a reason for hiding this comment

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

@amihaiemil Good point

from flask import Blueprint


bp = Blueprint('reservations', __name__, url_prefix='/reservations')
Copy link
Contributor

Choose a reason for hiding this comment

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

@vladarefiev Shouldn't /reservations be tied to locations? Some reservations are made in one particular location, so I would expect the path to be something like {domain}/locations/{location_id}/reservations/...

Copy link
Author

Choose a reason for hiding this comment

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

@amihaiemil As far as I can see this should be {domain}/reservations/settings which will contain default settings for resevation creation.
WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

@vladarefiev well, yes, reservations/settings will be the settings for reservations, but /reservations should be under a location (e.g. /locations/{locationsId}/reservations/.... Let's ask @emilianodellacasa -- if it's necessary, you can leave a puzzle, I believe :)

Copy link
Author

Choose a reason for hiding this comment

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

@amihaiemil Ah, I think, I got your point. Do you mean every location has own settings?
@emilianodellacasa Could you clarify this one?

Anyway I should leave puzzle here to implement nested bluprint routes

Copy link
Contributor

Choose a reason for hiding this comment

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

@vladarefiev @amihaiemil '/reservations' endpoint will be deployed on a different subdomain, as stated in issue #27, no need to tie it to the location

@vladarefiev
Copy link
Author

@amihaiemil pls take a look again.

@amihaiemil
Copy link
Contributor

@vladarefiev there are some conflicts now, pls fix them :)

@amihaiemil
Copy link
Contributor

@emilianodellacasa this is good to merge, from my point of view, but see our discussion first -- wdyt?

@vladarefiev
Copy link
Author

@amihaiemil Take a look pls, conflicts are fixed

@amihaiemil
Copy link
Contributor

@rultor good to merge

@rultor
Copy link
Contributor

rultor commented Jan 29, 2019

@rultor good to merge

@amihaiemil Thanks for your request. @emilianodellacasa Please confirm this.

@emilianodellacasa
Copy link
Contributor

@rultor merge

@rultor
Copy link
Contributor

rultor commented Jan 29, 2019

@rultor merge

@emilianodellacasa OK, I'll try to merge now. You can check the progress of the merge here

@rultor
Copy link
Contributor

rultor commented Jan 29, 2019

@rultor merge

@emilianodellacasa @vladarefiev Oops, I failed. You can see the full log here (spent 3min)

My version is 0.20.4
Ruby version is 2.6.0 at x86_64-linux
Reading timeless
Excluding tests/**/*
Excluding venv/**/*
Excluding migrations/**/*
Excluding instance/**/*
35 file(s) found, 0 excluded
/home/r/repo/timeless/auth/__pycache__/views.cpython-35.pyc is a binary file (2044 bytes)
/home/r/repo/timeless/reservations/__init__.py is a binary file (0 bytes)
/home/r/repo/timeless/reservations/__pycache__/models.cpython-35.pyc is a binary file (1055 bytes)
/home/r/repo/timeless/reservations/__pycache__/views.cpython-35.pyc is a binary file (467 bytes)
/home/r/repo/timeless/reservations/__pycache__/__init__.cpython-35.pyc is a binary file (129 bytes)
/home/r/repo/timeless/companies/__init__.py is a binary file (0 bytes)
/home/r/repo/timeless/companies/__pycache__/models.cpython-35.pyc is a binary file (1594 bytes)
/home/r/repo/timeless/companies/__pycache__/views.cpython-35.pyc is a binary file (375 bytes)
/home/r/repo/timeless/companies/__pycache__/__init__.cpython-35.pyc is a binary file (126 bytes)
/home/r/repo/timeless/schemetypes/__pycache__/models.cpython-35.pyc is a binary file (2090 bytes)
/home/r/repo/timeless/schemetypes/__pycache__/__init__.cpython-35.pyc is a binary file (193 bytes)
/home/r/repo/timeless/roles/__init__.py is a binary file (0 bytes)
/home/r/repo/timeless/employees/__init__.py is a binary file (0 bytes)
/home/r/repo/timeless/employees/__pycache__/models.cpython-35.pyc is a binary file (2401 bytes)
/home/r/repo/timeless/employees/__pycache__/__init__.cpython-35.pyc is a binary file (126 bytes)
/home/r/repo/timeless/restaurants/__init__.py is a binary file (0 bytes)
/home/r/repo/timeless/restaurants/__pycache__/models.cpython-35.pyc is a binary file (2437 bytes)
/home/r/repo/timeless/restaurants/__pycache__/__init__.cpython-35.pyc is a binary file (128 bytes)
/home/r/repo/timeless/__pycache__/__init__.cpython-35.pyc is a binary file (1666 bytes)
Reading static/style.css...
Reading auth/views.py...
Puzzle 5-b6c5b635 30/DEV at auth/views.py
Puzzle 5-5e1a2150 30/DEV at auth/views.py
Reading reservations/models.py...
Reading reservations/views.py...
Puzzle 32-581923fb 30/DEV at reservations/views.py
Reading companies/models.py...
Puzzle 3-8de36b15 30/DEV at companies/models.py
Puzzle 3-3e61ed39 30/DEV at companies/models.py
Reading companies/views.py...
Reading schemetypes/models.py...
Puzzle 18-e4de0db5 30/DEV at schemetypes/models.py
Puzzle 17-965ca61a 30/DEV at schemetypes/models.py
Reading schemetypes/__init__.py...
Reading roles/models.py...
Reading templates/auth/forgot_password.html...
Reading templates/auth/activate.html...
Reading templates/auth/login.html...
Reading templates/base.html...
Reading employees/models.py...
Puzzle 4-49d25317 30/DEV at employees/models.py
Puzzle 4-6ceceaee 30/DEV at employees/models.py
Reading restaurants/models.py...
Puzzle 11-dae961e8 30/DEV at restaurants/models.py
Puzzle 10-5d67d6d0 30/DEV at restaurants/models.py
Reading __init__.py...
\u001b[31mERROR\u001b[0m: Puzzle reservations/views.py:10-10 has a very short description of just 4 words while a minimum of 20 is required
\u001b[31mERROR\u001b[0m: 1 errors, see log above
If you can't understand the cause of this issue or you don't know how to fix it, please submit a GitHub issue, we will try to help you: https://github.com/yegor256/pdd/issues. This tool is still in its beta version and we will appreciate your feedback. Here is where you can find more documentation: https://github.com/yegor256/pdd/blob/master/README.md.
Exit code is 1
container 58b30ae1b18b942b006947c3e0ec87ca3db80b8359009190234cf4d2c750b44f is dead
Tue Jan 29 16:27:36 CET 2019

@emilianodellacasa
Copy link
Contributor

@vladarefiev Puzzle description is too short, please modify it and I will merge

@vladarefiev
Copy link
Author

@emilianodellacasa done

@emilianodellacasa
Copy link
Contributor

@rultor merge

@rultor
Copy link
Contributor

rultor commented Jan 29, 2019

@rultor merge

@emilianodellacasa OK, I'll try to merge now. You can check the progress of the merge here

@rultor
Copy link
Contributor

rultor commented Jan 29, 2019

@rultor merge

@emilianodellacasa @vladarefiev Oops, I failed. You can see the full log here (spent 3min)

My version is 0.20.4
Ruby version is 2.6.0 at x86_64-linux
Reading timeless
Excluding tests/**/*
Excluding venv/**/*
Excluding migrations/**/*
Excluding instance/**/*
35 file(s) found, 0 excluded
/home/r/repo/timeless/auth/__pycache__/views.cpython-35.pyc is a binary file (2044 bytes)
/home/r/repo/timeless/reservations/__init__.py is a binary file (0 bytes)
/home/r/repo/timeless/reservations/__pycache__/models.cpython-35.pyc is a binary file (1055 bytes)
/home/r/repo/timeless/reservations/__pycache__/views.cpython-35.pyc is a binary file (530 bytes)
/home/r/repo/timeless/reservations/__pycache__/__init__.cpython-35.pyc is a binary file (129 bytes)
/home/r/repo/timeless/companies/__init__.py is a binary file (0 bytes)
/home/r/repo/timeless/companies/__pycache__/models.cpython-35.pyc is a binary file (1594 bytes)
/home/r/repo/timeless/companies/__pycache__/views.cpython-35.pyc is a binary file (375 bytes)
/home/r/repo/timeless/companies/__pycache__/__init__.cpython-35.pyc is a binary file (126 bytes)
/home/r/repo/timeless/schemetypes/__pycache__/models.cpython-35.pyc is a binary file (2090 bytes)
/home/r/repo/timeless/schemetypes/__pycache__/__init__.cpython-35.pyc is a binary file (193 bytes)
/home/r/repo/timeless/roles/__init__.py is a binary file (0 bytes)
/home/r/repo/timeless/employees/__init__.py is a binary file (0 bytes)
/home/r/repo/timeless/employees/__pycache__/models.cpython-35.pyc is a binary file (2401 bytes)
/home/r/repo/timeless/employees/__pycache__/__init__.cpython-35.pyc is a binary file (126 bytes)
/home/r/repo/timeless/restaurants/__init__.py is a binary file (0 bytes)
/home/r/repo/timeless/restaurants/__pycache__/models.cpython-35.pyc is a binary file (2437 bytes)
/home/r/repo/timeless/restaurants/__pycache__/__init__.cpython-35.pyc is a binary file (128 bytes)
/home/r/repo/timeless/__pycache__/__init__.cpython-35.pyc is a binary file (1666 bytes)
Reading static/style.css...
Reading auth/views.py...
Puzzle 5-b6c5b635 30/DEV at auth/views.py
Puzzle 5-5e1a2150 30/DEV at auth/views.py
Reading reservations/models.py...
Reading reservations/views.py...
Puzzle 32-6c9d7a77 30/DEV at reservations/views.py
Reading companies/models.py...
Puzzle 3-8de36b15 30/DEV at companies/models.py
Puzzle 3-3e61ed39 30/DEV at companies/models.py
Reading companies/views.py...
Reading schemetypes/models.py...
Puzzle 18-e4de0db5 30/DEV at schemetypes/models.py
Puzzle 17-965ca61a 30/DEV at schemetypes/models.py
Reading schemetypes/__init__.py...
Reading roles/models.py...
Reading templates/auth/forgot_password.html...
Reading templates/auth/activate.html...
Reading templates/auth/login.html...
Reading templates/base.html...
Reading employees/models.py...
Puzzle 4-49d25317 30/DEV at employees/models.py
Puzzle 4-6ceceaee 30/DEV at employees/models.py
Reading restaurants/models.py...
Puzzle 11-dae961e8 30/DEV at restaurants/models.py
Puzzle 10-5d67d6d0 30/DEV at restaurants/models.py
Reading __init__.py...
\u001b[31mERROR\u001b[0m: Puzzle reservations/views.py:10-10 has a very short description of just 14 words while a minimum of 20 is required
\u001b[31mERROR\u001b[0m: 1 errors, see log above
If you can't understand the cause of this issue or you don't know how to fix it, please submit a GitHub issue, we will try to help you: https://github.com/yegor256/pdd/issues. This tool is still in its beta version and we will appreciate your feedback. Here is where you can find more documentation: https://github.com/yegor256/pdd/blob/master/README.md.
Exit code is 1
container 6d56e432cc9b09b09ab4c1180c41dbf78308112cb06127c6962a9e8475cd14f1 is dead
Tue Jan 29 16:42:17 CET 2019

@amihaiemil
Copy link
Contributor

@vladarefiev it seems the puzzle is still too short.

@emilianodellacasa maybe we can take out this check from rultor? I've noticed in other project's of mine that 0pdd can actually parse short (3-5 words) puzzles. Maybe the pdd gem is not up to date with that part.

@emilianodellacasa
Copy link
Contributor

@amihaiemil I don't think that check can be removed, and I don't want to take pdd out of rultor, otherwise puzzles may not be created

@vladarefiev Please add a more meaningful description for the puzzle

@vladarefiev
Copy link
Author

@emilianodellacasa Done, now it's more then 20

@emilianodellacasa
Copy link
Contributor

@rultor merge

@rultor
Copy link
Contributor

rultor commented Jan 29, 2019

@rultor merge

@emilianodellacasa OK, I'll try to merge now. You can check the progress of the merge here

@rultor
Copy link
Contributor

rultor commented Jan 29, 2019

@rultor merge

@emilianodellacasa @vladarefiev Oops, I failed. You can see the full log here (spent 3min)

Parsing documentation for slop-4.6.1
Installing ri documentation for slop-4.6.1
Parsing documentation for pdd-0.20.4
Installing ri documentation for pdd-0.20.4
Done installing documentation for mini_portile2, nokogiri, rainbow, slop, pdd after 14 seconds
5 gems installed
+ pytest
\u001b[1m============================= test session starts ==============================\u001b[0m
platform linux -- Python 3.5.2, pytest-4.1.1, py-1.7.0, pluggy-0.8.1
rootdir: /home/r/repo, inifile: setup.cfg
plugins: cov-2.6.1
\u001b[1mcollecting ... \u001b[0m\u001b[1m
collected 11 items                                                             \u001b[0m

tests/test_app.py \u001b[32m.\u001b[0m\u001b[36m                                                      [  9%]\u001b[0m
tests/test_auth.py \u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[36m                                                   [ 36%]\u001b[0m
tests/test_employees.py \u001b[32m.\u001b[0m\u001b[36m                                                [ 45%]\u001b[0m
tests/test_models.py \u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[36m                                                [ 81%]\u001b[0m
tests/test_schemetypes.py \u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[36m                                             [100%]\u001b[0m

\u001b[1m\u001b[32m========================== 11 passed in 0.48 seconds ===========================\u001b[0m
+ pdd -f /dev/null -v
Found 9 lines in /home/r/repo/.pdd
My version is 0.20.4
Ruby version is 2.6.0 at x86_64-linux
Reading timeless
Excluding tests/**/*
Excluding venv/**/*
Excluding migrations/**/*
Excluding instance/**/*
35 file(s) found, 0 excluded
/home/r/repo/timeless/auth/__pycache__/views.cpython-35.pyc is a binary file (2044 bytes)
/home/r/repo/timeless/reservations/__init__.py is a binary file (0 bytes)
/home/r/repo/timeless/reservations/__pycache__/models.cpython-35.pyc is a binary file (1055 bytes)
/home/r/repo/timeless/reservations/__pycache__/views.cpython-35.pyc is a binary file (602 bytes)
/home/r/repo/timeless/reservations/__pycache__/__init__.cpython-35.pyc is a binary file (129 bytes)
/home/r/repo/timeless/companies/__init__.py is a binary file (0 bytes)
/home/r/repo/timeless/companies/__pycache__/models.cpython-35.pyc is a binary file (1594 bytes)
/home/r/repo/timeless/companies/__pycache__/views.cpython-35.pyc is a binary file (375 bytes)
/home/r/repo/timeless/companies/__pycache__/__init__.cpython-35.pyc is a binary file (126 bytes)
/home/r/repo/timeless/schemetypes/__pycache__/models.cpython-35.pyc is a binary file (2090 bytes)
/home/r/repo/timeless/schemetypes/__pycache__/__init__.cpython-35.pyc is a binary file (193 bytes)
/home/r/repo/timeless/roles/__init__.py is a binary file (0 bytes)
/home/r/repo/timeless/employees/__init__.py is a binary file (0 bytes)
/home/r/repo/timeless/employees/__pycache__/models.cpython-35.pyc is a binary file (2401 bytes)
/home/r/repo/timeless/employees/__pycache__/__init__.cpython-35.pyc is a binary file (126 bytes)
/home/r/repo/timeless/restaurants/__init__.py is a binary file (0 bytes)
/home/r/repo/timeless/restaurants/__pycache__/models.cpython-35.pyc is a binary file (2437 bytes)
/home/r/repo/timeless/restaurants/__pycache__/__init__.cpython-35.pyc is a binary file (128 bytes)
/home/r/repo/timeless/__pycache__/__init__.cpython-35.pyc is a binary file (1666 bytes)
Reading static/style.css...
Reading auth/views.py...
Puzzle 5-b6c5b635 30/DEV at auth/views.py
Puzzle 5-5e1a2150 30/DEV at auth/views.py
Reading reservations/models.py...
Reading reservations/views.py...
\u001b[31mERROR\u001b[0m: reservations/views.py; puzzle at line #10; Space expected at 11:4; make sure all lines in the puzzle body have a single leading space.
If you can't understand the cause of this issue or you don't know how to fix it, please submit a GitHub issue, we will try to help you: https://github.com/yegor256/pdd/issues. This tool is still in its beta version and we will appreciate your feedback. Here is where you can find more documentation: https://github.com/yegor256/pdd/blob/master/README.md.
Exit code is 1
container 81bb29dacbb9f5a2879d3d91f9ce812a2d4d773259d512e134cfb178213fe01c is dead
Tue Jan 29 17:02:17 CET 2019

@emilianodellacasa
Copy link
Contributor

@rultor merge

@rultor
Copy link
Contributor

rultor commented Jan 29, 2019

@rultor merge

@emilianodellacasa OK, I'll try to merge now. You can check the progress of the merge here

@rultor rultor merged commit 43d5568 into timelesslounge:master Jan 29, 2019
@rultor
Copy link
Contributor

rultor commented Jan 29, 2019

@rultor merge

@emilianodellacasa Done! FYI, the full log is here (took me 3min)

@0crat
Copy link

0crat commented Jan 29, 2019

Job was finished in 19 hours, bonus for fast delivery is possible (see §36)

@0crat
Copy link

0crat commented Jan 29, 2019

@ypshenychka/z please review this job completed by @amihaiemil/z, as in §30; the job will be fully closed and all payments will be made when the quality review is completed

@0crat 0crat removed the scope Issue is in scope label Jan 29, 2019
@0crat
Copy link

0crat commented Jan 29, 2019

The job #53 is now out of scope

@0crat
Copy link

0crat commented Jan 29, 2019

Payment to ARC for a closed pull request, as in §28: +10 point(s) just awarded to @emilianodellacasa/z

@ypshenychka
Copy link

@0crat quality good

@0crat
Copy link

0crat commented Jan 29, 2019

Order was finished, quality is "good": +25 point(s) just awarded to @amihaiemil/z

@0crat
Copy link

0crat commented Jan 29, 2019

Quality review completed: +8 point(s) just awarded to @ypshenychka/z

@vladarefiev vladarefiev deleted the issue_32 branch January 31, 2019 09:16
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.

None yet

6 participants