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

feat(bookings): add configurable limits on booked assets #145

Merged
merged 14 commits into from
Jan 23, 2022

Conversation

chillfox
Copy link
Contributor

Add configurable booking limits.

@chillfox chillfox linked an issue Jan 18, 2022 that may be closed by this pull request
@chillfox chillfox requested a review from tassja January 18, 2022 05:52
spec/controllers/bookings_spec.cr Outdated Show resolved Hide resolved
src/controllers/bookings.cr Outdated Show resolved Hide resolved
src/controllers/bookings.cr Show resolved Hide resolved
@tassja
Copy link
Contributor

tassja commented Jan 19, 2022

Also our PR names follow a similar format to commits, something like feat(bookings): add configurable limits on booked assets would be good for this one

@chillfox chillfox changed the title Feat/booking limits feat(bookings): add configurable limits on booked assets Jan 19, 2022
@chillfox
Copy link
Contributor Author

Also our PR names follow a similar format to commits, something like feat(bookings): add configurable limits on booked assets would be good for this one

Ok, I have updated the name.

@chillfox chillfox marked this pull request as ready for review January 19, 2022 04:52
@tassja tassja requested a review from stakach January 19, 2022 05:42
@caspiano caspiano added the type: enhancement new feature or request label Jan 19, 2022
Copy link
Contributor

@caspiano caspiano left a comment

Choose a reason for hiding this comment

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

This looks really great!
I think the only thing missing is some validation of booking_limits.
You're handling the JSON::Any column safely, but I think catching unexpected JSON at the ORM level would be good.
This can be achieved by either traversing the JSON::Any at validation time or creating a type converter for the column (i.e. Hash(String, Int32))

@chillfox
Copy link
Contributor Author

@caspiano I tried using a converter, but it broke a bunch of tests, so I have added a method to validate.

src/models/tenant.cr Outdated Show resolved Hide resolved
src/models/tenant.cr Outdated Show resolved Hide resolved
src/models/tenant.cr Outdated Show resolved Hide resolved
chillfox and others added 3 commits January 20, 2022 16:21
Co-authored-by: Caspian Baska <caspian@place.tech>
Co-authored-by: Caspian Baska <caspian@place.tech>
Copy link
Contributor

@caspiano caspiano left a comment

Choose a reason for hiding this comment

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

Great work!

Copy link
Member

@stakach stakach left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@tassja tassja left a comment

Choose a reason for hiding this comment

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

Awesome job!!

@stakach stakach merged commit 0a59bd6 into master Jan 23, 2022
@stakach stakach deleted the feat/booking_limits branch January 23, 2022 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement new feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add support for configurable booking limits on resources
4 participants