stay_commerce 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +53 -0
- data/Rakefile +8 -0
- data/app/assets/config/stay_manifest.js +1 -0
- data/app/assets/fonts/bootstrap-icons.woff +0 -0
- data/app/assets/fonts/bootstrap-icons.woff2 +0 -0
- data/app/assets/images/chevron-down.svg +3 -0
- data/app/assets/images/circle-fill.svg +3 -0
- data/app/assets/images/circle.svg +3 -0
- data/app/assets/images/plus-circle.svg +4 -0
- data/app/assets/images/save.svg +3 -0
- data/app/assets/images/store.svg +3 -0
- data/app/assets/javascripts/stay/admin/address.js +165 -0
- data/app/assets/javascripts/stay/admin/ckeditor.min.js +7 -0
- data/app/assets/javascripts/stay/admin/flatpickr.min.js +2 -0
- data/app/assets/javascripts/stay/admin/index.js +28 -0
- data/app/assets/javascripts/stay/admin/property.js +37 -0
- data/app/assets/javascripts/stay/admin/select2.min.js +2 -0
- data/app/assets/javascripts/stay/application.js +14 -0
- data/app/assets/javascripts/stay/bootstrap.bundle.min.js +7 -0
- data/app/assets/javascripts/stay/ckeditor.js +11 -0
- data/app/assets/javascripts/stay/custom.js +56 -0
- data/app/assets/javascripts/stay/jquery-ui.min.js +13 -0
- data/app/assets/javascripts/stay/jquery.min.js +2 -0
- data/app/assets/stylesheets/stay/admin/flatpickr.min.css +13 -0
- data/app/assets/stylesheets/stay/admin/index.css +100 -0
- data/app/assets/stylesheets/stay/admin/select2.min.css +1 -0
- data/app/assets/stylesheets/stay/application.css +24 -0
- data/app/assets/stylesheets/stay/badges.css +72 -0
- data/app/assets/stylesheets/stay/bootstrap-icons.min.css +5 -0
- data/app/assets/stylesheets/stay/bootstrap-icons_fix.css +5 -0
- data/app/assets/stylesheets/stay/common.css +283 -0
- data/app/assets/stylesheets/stay/jquery-ui.css +1311 -0
- data/app/assets/stylesheets/stay/webpixels.css +7 -0
- data/app/channels/chat_channel.rb +13 -0
- data/app/controllers/concerns/stay/booking_validations.rb +86 -0
- data/app/controllers/concerns/stay/stripe_concern.rb +72 -0
- data/app/controllers/stay/admin/addresses_controller.rb +76 -0
- data/app/controllers/stay/admin/amenities_controller.rb +52 -0
- data/app/controllers/stay/admin/amenity_categories_controller.rb +52 -0
- data/app/controllers/stay/admin/base_controller.rb +38 -0
- data/app/controllers/stay/admin/bed_types_controller.rb +51 -0
- data/app/controllers/stay/admin/bookings_controller.rb +54 -0
- data/app/controllers/stay/admin/cancellation_policies_controller.rb +51 -0
- data/app/controllers/stay/admin/chats_controller.rb +53 -0
- data/app/controllers/stay/admin/cities_controller.rb +66 -0
- data/app/controllers/stay/admin/confirmations_controller.rb +30 -0
- data/app/controllers/stay/admin/countries_controller.rb +53 -0
- data/app/controllers/stay/admin/dashboard_controller.rb +8 -0
- data/app/controllers/stay/admin/features_controller.rb +54 -0
- data/app/controllers/stay/admin/home_controller.rb +15 -0
- data/app/controllers/stay/admin/house_rules_controller.rb +51 -0
- data/app/controllers/stay/admin/messages_controller.rb +53 -0
- data/app/controllers/stay/admin/passwords_controller.rb +32 -0
- data/app/controllers/stay/admin/payment_methods_controller.rb +53 -0
- data/app/controllers/stay/admin/payments_controller.rb +63 -0
- data/app/controllers/stay/admin/properties_controller.rb +118 -0
- data/app/controllers/stay/admin/property_categories_controller.rb +51 -0
- data/app/controllers/stay/admin/property_types_controller.rb +51 -0
- data/app/controllers/stay/admin/registrations_controller.rb +19 -0
- data/app/controllers/stay/admin/reviews_Controller.rb +63 -0
- data/app/controllers/stay/admin/roles_controller.rb +54 -0
- data/app/controllers/stay/admin/room_amenities_controller.rb +43 -0
- data/app/controllers/stay/admin/room_types_controller.rb +58 -0
- data/app/controllers/stay/admin/rooms_controller.rb +62 -0
- data/app/controllers/stay/admin/sessions_controller.rb +29 -0
- data/app/controllers/stay/admin/states_controller.rb +68 -0
- data/app/controllers/stay/admin/stores_controller.rb +132 -0
- data/app/controllers/stay/admin/taxes_controller.rb +51 -0
- data/app/controllers/stay/admin/users_controller.rb +85 -0
- data/app/controllers/stay/api/v1/amenities_controller.rb +13 -0
- data/app/controllers/stay/api/v1/amenity_categories_controller.rb +13 -0
- data/app/controllers/stay/api/v1/bed_types_controller.rb +9 -0
- data/app/controllers/stay/api/v1/booking_queries_controller.rb +205 -0
- data/app/controllers/stay/api/v1/bookings_controller.rb +299 -0
- data/app/controllers/stay/api/v1/cancellation_policies_controller.rb +10 -0
- data/app/controllers/stay/api/v1/chats_controller.rb +116 -0
- data/app/controllers/stay/api/v1/credit_cards_controller.rb +62 -0
- data/app/controllers/stay/api/v1/features_controller.rb +21 -0
- data/app/controllers/stay/api/v1/house_rules_controller.rb +9 -0
- data/app/controllers/stay/api/v1/invoices_controller.rb +47 -0
- data/app/controllers/stay/api/v1/messages_controller.rb +144 -0
- data/app/controllers/stay/api/v1/payments_controller.rb +61 -0
- data/app/controllers/stay/api/v1/profiles_controller.rb +23 -0
- data/app/controllers/stay/api/v1/properties_controller.rb +233 -0
- data/app/controllers/stay/api/v1/property_categories_controller.rb +14 -0
- data/app/controllers/stay/api/v1/property_types_controller.rb +14 -0
- data/app/controllers/stay/api/v1/room_types_controller.rb +14 -0
- data/app/controllers/stay/api/v1/rooms_controller.rb +23 -0
- data/app/controllers/stay/api/v1/user_paypal_controller.rb +53 -0
- data/app/controllers/stay/api/v1/users_controller.rb +17 -0
- data/app/controllers/stay/application_controller.rb +44 -0
- data/app/controllers/stay/base_api_controller.rb +14 -0
- data/app/controllers/stay/bookings_controller.rb +29 -0
- data/app/controllers/stay/payments_controller.rb +50 -0
- data/app/controllers/stay/profiles_controller.rb +26 -0
- data/app/controllers/stay/properties_controller.rb +15 -0
- data/app/controllers/stay/rooms_controller.rb +22 -0
- data/app/controllers/stay/users/confirmations_controller.rb +30 -0
- data/app/controllers/stay/users/omniauth_callbacks_controller.rb +30 -0
- data/app/controllers/stay/users/passwords_controller.rb +51 -0
- data/app/controllers/stay/users/registrations_controller.rb +62 -0
- data/app/controllers/stay/users/sessions_controller.rb +27 -0
- data/app/controllers/stay/users/unlocks_controller.rb +30 -0
- data/app/helpers/stay/admin/cities_helper.rb +4 -0
- data/app/helpers/stay/admin/countries_helper.rb +4 -0
- data/app/helpers/stay/admin/states_helper.rb +4 -0
- data/app/helpers/stay/admin/stores_helper.rb +25 -0
- data/app/helpers/stay/application_helper.rb +63 -0
- data/app/helpers/stay/currency_helper.rb +34 -0
- data/app/helpers/stay/locale_helper.rb +107 -0
- data/app/jobs/stay/application_job.rb +4 -0
- data/app/mailers/stay/application_mailer.rb +6 -0
- data/app/mailers/stay/user_mailer.rb +13 -0
- data/app/models/concerns/stay/translatable_resource.rb +25 -0
- data/app/models/stay/additional_rule.rb +5 -0
- data/app/models/stay/address.rb +40 -0
- data/app/models/stay/amenity.rb +13 -0
- data/app/models/stay/amenity_category.rb +6 -0
- data/app/models/stay/application_record.rb +5 -0
- data/app/models/stay/bed_type.rb +7 -0
- data/app/models/stay/booking.rb +199 -0
- data/app/models/stay/booking_query.rb +23 -0
- data/app/models/stay/cancellation_policy.rb +6 -0
- data/app/models/stay/chat.rb +23 -0
- data/app/models/stay/city.rb +9 -0
- data/app/models/stay/country.rb +23 -0
- data/app/models/stay/credit_card.rb +6 -0
- data/app/models/stay/discount.rb +4 -0
- data/app/models/stay/expense.rb +4 -0
- data/app/models/stay/feature.rb +11 -0
- data/app/models/stay/house_rule.rb +4 -0
- data/app/models/stay/invoice.rb +23 -0
- data/app/models/stay/line_item.rb +7 -0
- data/app/models/stay/message.rb +30 -0
- data/app/models/stay/payment.rb +54 -0
- data/app/models/stay/payment_method.rb +13 -0
- data/app/models/stay/price.rb +18 -0
- data/app/models/stay/property.rb +243 -0
- data/app/models/stay/property_amenity.rb +6 -0
- data/app/models/stay/property_category.rb +6 -0
- data/app/models/stay/property_feature.rb +6 -0
- data/app/models/stay/property_house_rule.rb +6 -0
- data/app/models/stay/property_tax.rb +6 -0
- data/app/models/stay/property_type.rb +15 -0
- data/app/models/stay/review.rb +5 -0
- data/app/models/stay/role.rb +11 -0
- data/app/models/stay/role_user.rb +6 -0
- data/app/models/stay/room.rb +93 -0
- data/app/models/stay/room_amenity.rb +6 -0
- data/app/models/stay/room_feature.rb +6 -0
- data/app/models/stay/room_type.rb +7 -0
- data/app/models/stay/state.rb +13 -0
- data/app/models/stay/store.rb +139 -0
- data/app/models/stay/store_property.rb +9 -0
- data/app/models/stay/tax.rb +8 -0
- data/app/models/stay/user.rb +111 -0
- data/app/models/stay/user_paypal.rb +5 -0
- data/app/serializers/amenity_category_serializer.rb +13 -0
- data/app/serializers/amenity_serializer.rb +3 -0
- data/app/serializers/bed_type_serializer.rb +5 -0
- data/app/serializers/booking_query_serializer.rb +6 -0
- data/app/serializers/booking_serializer.rb +68 -0
- data/app/serializers/cancellation_policy_serializer.rb +3 -0
- data/app/serializers/chat_serializer.rb +63 -0
- data/app/serializers/credit_card_serializer.rb +7 -0
- data/app/serializers/house_rules_serializer.rb +3 -0
- data/app/serializers/invoice_serializer.rb +41 -0
- data/app/serializers/last_5_messages_serializer.rb +7 -0
- data/app/serializers/line_item_serializer.rb +6 -0
- data/app/serializers/message_serializer.rb +44 -0
- data/app/serializers/property_category_serializer.rb +7 -0
- data/app/serializers/property_feature_serializer.rb +5 -0
- data/app/serializers/property_listing_serializer.rb +13 -0
- data/app/serializers/property_serializer.rb +77 -0
- data/app/serializers/property_type_serializer.rb +7 -0
- data/app/serializers/room_serializer.rb +36 -0
- data/app/serializers/room_type_serializer.rb +5 -0
- data/app/serializers/user_listing_serializer.rb +23 -0
- data/app/serializers/user_serializer.rb +41 -0
- data/app/services/stay/bookings/create_booking_service.rb +49 -0
- data/app/services/stay/bookings/create_line_item_service.rb +15 -0
- data/app/services/stay/bookings/existing_booking_service.rb +50 -0
- data/app/services/stay/chat/chat_messaging_service.rb +82 -0
- data/app/services/stay/chat/query_messaging_service.rb +56 -0
- data/app/services/stay/seeds/all.rb +27 -0
- data/app/services/stay/seeds/cancellation_policy.rb +21 -0
- data/app/services/stay/seeds/countries.rb +33 -0
- data/app/services/stay/seeds/roles.rb +9 -0
- data/app/services/stay/seeds/states.rb +63 -0
- data/app/services/stay/seeds/stores.rb +34 -0
- data/app/views/devise/mailer/reset_password_instructions.html.rb +10 -0
- data/app/views/kaminari/_first_page.html.erb +3 -0
- data/app/views/kaminari/_gap.html.erb +3 -0
- data/app/views/kaminari/_last_page.html.erb +3 -0
- data/app/views/kaminari/_next_page.html.erb +3 -0
- data/app/views/kaminari/_page.html.erb +9 -0
- data/app/views/kaminari/_paginator.html.erb +17 -0
- data/app/views/kaminari/_prev_page.html.erb +3 -0
- data/app/views/layouts/stay/admin.html.erb +45 -0
- data/app/views/layouts/stay/application.html.erb +34 -0
- data/app/views/stay/admin/addresses/_form.html.erb +49 -0
- data/app/views/stay/admin/addresses/edit.html.erb +5 -0
- data/app/views/stay/admin/addresses/index.html.erb +68 -0
- data/app/views/stay/admin/addresses/new.html.erb +5 -0
- data/app/views/stay/admin/addresses/show.html.erb +40 -0
- data/app/views/stay/admin/amenities/_form.html.erb +38 -0
- data/app/views/stay/admin/amenities/edit.html.erb +14 -0
- data/app/views/stay/admin/amenities/index.html.erb +58 -0
- data/app/views/stay/admin/amenities/new.html.erb +14 -0
- data/app/views/stay/admin/amenities/show.html.erb +19 -0
- data/app/views/stay/admin/amenity_categories/_form.html.erb +29 -0
- data/app/views/stay/admin/amenity_categories/edit.html.erb +14 -0
- data/app/views/stay/admin/amenity_categories/index.html.erb +53 -0
- data/app/views/stay/admin/amenity_categories/new.html.erb +14 -0
- data/app/views/stay/admin/amenity_categories/show.html.erb +18 -0
- data/app/views/stay/admin/bed_types/_form.html.erb +29 -0
- data/app/views/stay/admin/bed_types/edit.html.erb +14 -0
- data/app/views/stay/admin/bed_types/index.html.erb +56 -0
- data/app/views/stay/admin/bed_types/new.html.erb +14 -0
- data/app/views/stay/admin/bed_types/show.html.erb +0 -0
- data/app/views/stay/admin/bookings/_booking_invoice.html.erb +37 -0
- data/app/views/stay/admin/bookings/_booking_summary.html.erb +61 -0
- data/app/views/stay/admin/bookings/_form.html.erb +59 -0
- data/app/views/stay/admin/bookings/edit.html.erb +14 -0
- data/app/views/stay/admin/bookings/index.html.erb +74 -0
- data/app/views/stay/admin/bookings/new.html.erb +14 -0
- data/app/views/stay/admin/bookings/show.html.erb +80 -0
- data/app/views/stay/admin/cancellation_policies/_form.html.erb +38 -0
- data/app/views/stay/admin/cancellation_policies/edit.html.erb +14 -0
- data/app/views/stay/admin/cancellation_policies/index.html.erb +58 -0
- data/app/views/stay/admin/cancellation_policies/new.html.erb +14 -0
- data/app/views/stay/admin/cancellation_policies/show.html.erb +0 -0
- data/app/views/stay/admin/chats/_form.html.erb +31 -0
- data/app/views/stay/admin/chats/edit.html.erb +5 -0
- data/app/views/stay/admin/chats/index.html.erb +58 -0
- data/app/views/stay/admin/chats/new.html.erb +5 -0
- data/app/views/stay/admin/chats/show.html.erb +19 -0
- data/app/views/stay/admin/cities/_form.html.erb +30 -0
- data/app/views/stay/admin/cities/edit.html.erb +14 -0
- data/app/views/stay/admin/cities/index.html.erb +62 -0
- data/app/views/stay/admin/cities/new.html.erb +14 -0
- data/app/views/stay/admin/countries/_form.html.erb +64 -0
- data/app/views/stay/admin/countries/edit.html.erb +14 -0
- data/app/views/stay/admin/countries/index.html.erb +62 -0
- data/app/views/stay/admin/countries/new.html.erb +14 -0
- data/app/views/stay/admin/countries/show.html.erb +23 -0
- data/app/views/stay/admin/dashboard/index.html.erb +1 -0
- data/app/views/stay/admin/features/_form.html.erb +38 -0
- data/app/views/stay/admin/features/edit.html.erb +14 -0
- data/app/views/stay/admin/features/index.html.erb +58 -0
- data/app/views/stay/admin/features/new.html.erb +14 -0
- data/app/views/stay/admin/features/show.html.erb +19 -0
- data/app/views/stay/admin/house_rules/_form.html.erb +29 -0
- data/app/views/stay/admin/house_rules/edit.html.erb +14 -0
- data/app/views/stay/admin/house_rules/index.html.erb +54 -0
- data/app/views/stay/admin/house_rules/new.html.erb +14 -0
- data/app/views/stay/admin/house_rules/show.html.erb +18 -0
- data/app/views/stay/admin/mailer/confirmation_instructions.html.erb +5 -0
- data/app/views/stay/admin/mailer/email_changed.html.erb +7 -0
- data/app/views/stay/admin/mailer/password_change.html.erb +3 -0
- data/app/views/stay/admin/mailer/reset_password_instructions.html.erb +7 -0
- data/app/views/stay/admin/messages/_form.html.erb +36 -0
- data/app/views/stay/admin/messages/edit.html.erb +5 -0
- data/app/views/stay/admin/messages/index.html.erb +60 -0
- data/app/views/stay/admin/messages/new.html.erb +5 -0
- data/app/views/stay/admin/messages/show.html.erb +24 -0
- data/app/views/stay/admin/passwords/edit.html.erb +37 -0
- data/app/views/stay/admin/passwords/new.html.erb +28 -0
- data/app/views/stay/admin/payment_methods/_form.html.erb +22 -0
- data/app/views/stay/admin/payment_methods/edit.html.erb +14 -0
- data/app/views/stay/admin/payment_methods/index.html.erb +54 -0
- data/app/views/stay/admin/payment_methods/new.html.erb +14 -0
- data/app/views/stay/admin/payment_methods/show.html.erb +18 -0
- data/app/views/stay/admin/payments/_form.html.erb +36 -0
- data/app/views/stay/admin/payments/edit.html.erb +5 -0
- data/app/views/stay/admin/payments/index.html.erb +60 -0
- data/app/views/stay/admin/payments/new.html.erb +5 -0
- data/app/views/stay/admin/payments/show.html.erb +24 -0
- data/app/views/stay/admin/properties/_amenities.html.erb +38 -0
- data/app/views/stay/admin/properties/_calendar.html.erb +37 -0
- data/app/views/stay/admin/properties/_description.html.erb +126 -0
- data/app/views/stay/admin/properties/_details.html.erb +75 -0
- data/app/views/stay/admin/properties/_features.html.erb +39 -0
- data/app/views/stay/admin/properties/_form.html.erb +118 -0
- data/app/views/stay/admin/properties/_images.html.erb +48 -0
- data/app/views/stay/admin/properties/_location.html.erb +55 -0
- data/app/views/stay/admin/properties/_price.html.erb +88 -0
- data/app/views/stay/admin/properties/_sidebar.html.erb +47 -0
- data/app/views/stay/admin/properties/edit.html.erb +17 -0
- data/app/views/stay/admin/properties/index.html.erb +82 -0
- data/app/views/stay/admin/properties/new.html.erb +14 -0
- data/app/views/stay/admin/properties/show.html.erb +149 -0
- data/app/views/stay/admin/property_categories/_form.html.erb +29 -0
- data/app/views/stay/admin/property_categories/edit.html.erb +14 -0
- data/app/views/stay/admin/property_categories/index.html.erb +57 -0
- data/app/views/stay/admin/property_categories/new.html.erb +14 -0
- data/app/views/stay/admin/property_categories/show.html.erb +18 -0
- data/app/views/stay/admin/property_types/_form.html.erb +29 -0
- data/app/views/stay/admin/property_types/edit.html.erb +14 -0
- data/app/views/stay/admin/property_types/index.html.erb +56 -0
- data/app/views/stay/admin/property_types/new.html.erb +14 -0
- data/app/views/stay/admin/property_types/show.html.erb +18 -0
- data/app/views/stay/admin/registrations/edit.html.erb +43 -0
- data/app/views/stay/admin/registrations/new.html.erb +35 -0
- data/app/views/stay/admin/reviews/_form.html.erb +37 -0
- data/app/views/stay/admin/reviews/edit.html.erb +14 -0
- data/app/views/stay/admin/reviews/index.html.erb +58 -0
- data/app/views/stay/admin/reviews/new.html.erb +14 -0
- data/app/views/stay/admin/reviews/show.html.erb +20 -0
- data/app/views/stay/admin/roles/_form.html.erb +24 -0
- data/app/views/stay/admin/roles/edit.html.erb +14 -0
- data/app/views/stay/admin/roles/index.html.erb +55 -0
- data/app/views/stay/admin/roles/new.html.erb +14 -0
- data/app/views/stay/admin/roles/show.html.erb +18 -0
- data/app/views/stay/admin/room_types/_form.html.erb +37 -0
- data/app/views/stay/admin/room_types/edit.html.erb +14 -0
- data/app/views/stay/admin/room_types/index.html.erb +58 -0
- data/app/views/stay/admin/room_types/new.html.erb +14 -0
- data/app/views/stay/admin/room_types/show.html.erb +19 -0
- data/app/views/stay/admin/rooms/_form.html.erb +136 -0
- data/app/views/stay/admin/rooms/edit.html.erb +14 -0
- data/app/views/stay/admin/rooms/index.html.erb +69 -0
- data/app/views/stay/admin/rooms/new.html.erb +14 -0
- data/app/views/stay/admin/rooms/show.html.erb +25 -0
- data/app/views/stay/admin/sessions/new.html.erb +36 -0
- data/app/views/stay/admin/shared/_common-table.html.erb +334 -0
- data/app/views/stay/admin/shared/_error_messages.html.erb +15 -0
- data/app/views/stay/admin/shared/_header.html.erb +55 -0
- data/app/views/stay/admin/shared/_links.html.erb +15 -0
- data/app/views/stay/admin/shared/_sidebar.html.erb +154 -0
- data/app/views/stay/admin/shared/_store_switcher.html.erb +30 -0
- data/app/views/stay/admin/states/_form.html.erb +39 -0
- data/app/views/stay/admin/states/edit.html.erb +14 -0
- data/app/views/stay/admin/states/index.html.erb +61 -0
- data/app/views/stay/admin/states/new.html.erb +14 -0
- data/app/views/stay/admin/states/show.html.erb +0 -0
- data/app/views/stay/admin/stores/_form.html.erb +30 -0
- data/app/views/stay/admin/stores/_tabs.html.erb +17 -0
- data/app/views/stay/admin/stores/edit.html.erb +14 -0
- data/app/views/stay/admin/stores/form/_basic.html.erb +35 -0
- data/app/views/stay/admin/stores/form/_emails.html.erb +34 -0
- data/app/views/stay/admin/stores/form/_footer.html.erb +28 -0
- data/app/views/stay/admin/stores/form/_internationalization.html.erb +52 -0
- data/app/views/stay/admin/stores/form/_seo.html.erb +42 -0
- data/app/views/stay/admin/stores/form/_social.html.erb +34 -0
- data/app/views/stay/admin/stores/index.html.erb +66 -0
- data/app/views/stay/admin/stores/new.html.erb +14 -0
- data/app/views/stay/admin/stores/translations.html.erb +8 -0
- data/app/views/stay/admin/taxes/_form.html.erb +29 -0
- data/app/views/stay/admin/taxes/edit.html.erb +14 -0
- data/app/views/stay/admin/taxes/index.html.erb +56 -0
- data/app/views/stay/admin/taxes/new.html.erb +14 -0
- data/app/views/stay/admin/taxes/show.html.erb +18 -0
- data/app/views/stay/admin/users/_address.html.erb +57 -0
- data/app/views/stay/admin/users/_address_form.html.erb +29 -0
- data/app/views/stay/admin/users/_form.html.erb +73 -0
- data/app/views/stay/admin/users/_sidebar.html.erb +12 -0
- data/app/views/stay/admin/users/addresses.html.erb +17 -0
- data/app/views/stay/admin/users/edit.html.erb +17 -0
- data/app/views/stay/admin/users/index.html.erb +74 -0
- data/app/views/stay/admin/users/new.html.erb +14 -0
- data/app/views/stay/admin/users/show.html.erb +23 -0
- data/app/views/stay/bookings/new.html.erb +92 -0
- data/app/views/stay/payments/_payment.js.erb +127 -0
- data/app/views/stay/payments/new.html.erb +187 -0
- data/app/views/stay/properties/index.html.erb +56 -0
- data/app/views/stay/properties/show.html.erb +137 -0
- data/app/views/stay/shared/_navbar.html.erb +35 -0
- data/app/views/stay/user_mailer/new_host_signup.html.erb +12 -0
- data/app/views/stay/user_mailer/welcome_email.html.erb +9 -0
- data/app/views/stay/users/confirmations/new.html.erb +16 -0
- data/app/views/stay/users/mailer/confirmation_instructions.html.erb +5 -0
- data/app/views/stay/users/mailer/email_changed.html.erb +7 -0
- data/app/views/stay/users/mailer/password_change.html.erb +3 -0
- data/app/views/stay/users/mailer/reset_password_instructions.html.erb +7 -0
- data/app/views/stay/users/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/stay/users/passwords/edit.html.erb +37 -0
- data/app/views/stay/users/passwords/new.html.erb +28 -0
- data/app/views/stay/users/registrations/edit.html.erb +43 -0
- data/app/views/stay/users/registrations/new.html.erb +42 -0
- data/app/views/stay/users/sessions/new.html.erb +43 -0
- data/app/views/stay/users/shared/_error_messages.html.erb +15 -0
- data/app/views/stay/users/shared/_links.html.erb +25 -0
- data/app/views/stay/users/unlocks/new.html.erb +16 -0
- data/config/initializers/devise.rb +358 -0
- data/config/initializers/friendly_id.rb +107 -0
- data/config/initializers/geocoder.rb +4 -0
- data/config/initializers/kaminari_config.rb +14 -0
- data/config/initializers/mobility.rb +17 -0
- data/config/initializers/stripe.rb +8 -0
- data/config/locales/devise.en.yml +65 -0
- data/config/locales/devise_api.en.yml +23 -0
- data/config/locales/en.yml +38 -0
- data/config/routes.rb +187 -0
- data/db/migrate/20240912073149_devise_create_stay_users.rb +50 -0
- data/db/migrate/20240912073248_create_devise_api_tables.rb +29 -0
- data/db/migrate/20240912092842_create_stay_roles.rb +9 -0
- data/db/migrate/20240912093003_create_stay_role_users.rb +10 -0
- data/db/migrate/20240912093151_create_stay_properties.rb +16 -0
- data/db/migrate/20240912093213_create_stay_rooms.rb +12 -0
- data/db/migrate/20240912093240_create_stay_bookings.rb +15 -0
- data/db/migrate/20240912093346_create_stay_payment_methods.rb +9 -0
- data/db/migrate/20240912093408_create_stay_payments.rb +12 -0
- data/db/migrate/20240912093603_create_stay_reviews.rb +11 -0
- data/db/migrate/20240912093644_create_stay_chats.rb +11 -0
- data/db/migrate/20240912093717_create_stay_messages.rb +12 -0
- data/db/migrate/20240912093759_create_stay_countries.rb +14 -0
- data/db/migrate/20240912093824_create_stay_states.rb +11 -0
- data/db/migrate/20240912093903_create_stay_cities.rb +10 -0
- data/db/migrate/20240912094149_create_stay_addresses.rb +19 -0
- data/db/migrate/20240916071141_create_active_storage_tables.rb +57 -0
- data/db/migrate/20240918080551_add_columns_to_stay_bookings.rb +12 -0
- data/db/migrate/20240918101502_add_columns_to_stay_payments.rb +16 -0
- data/db/migrate/20240918110958_create_stay_prices.rb +13 -0
- data/db/migrate/20240918112045_add_columns_to_stay_rooms.rb +5 -0
- data/db/migrate/20240918114609_add_payment_intent_in_bookings.rb +6 -0
- data/db/migrate/20240919045205_add_user_to_stay_addresses.rb +5 -0
- data/db/migrate/20240919063400_create_stay_room_types.rb +10 -0
- data/db/migrate/20240919070423_rename_room_type_to_room_type_id_in_stay_rooms.rb +5 -0
- data/db/migrate/20240919071642_rename_status_to_state_in_stay_payments.rb +5 -0
- data/db/migrate/20240919100508_remove_room_id_from_stay_properties.rb +5 -0
- data/db/migrate/20240919111801_create_stay_line_items.rb +16 -0
- data/db/migrate/20240919124704_remove_room_id_from_stay_bookings.rb +5 -0
- data/db/migrate/20240924053658_add_is_master_in_stay_rooms.rb +5 -0
- data/db/migrate/20240925063733_add_zipcode_required_in_countries.rb +5 -0
- data/db/migrate/20240926055951_remove_city_reference_from_stay_addresses.rb +5 -0
- data/db/migrate/20240927055935_change_price_per_night_to_decimal_in_stay_rooms.rb +5 -0
- data/db/migrate/20240927063023_add_first_name_to_stay_addresses.rb +8 -0
- data/db/migrate/20240927070538_change_description_to_text_in_stay_properties.rb +6 -0
- data/db/migrate/20240927111110_create_stay_stores.rb +33 -0
- data/db/migrate/20240930095921_create_stay_cancellation_policies.rb +9 -0
- data/db/migrate/20240930100157_add_cancellation_id_to_stay_properties.rb +5 -0
- data/db/migrate/20240930152331_create_stay_store_translations.rb +22 -0
- data/db/migrate/20240930162337_create_stay_store_properties.rb +10 -0
- data/db/migrate/20241001101816_create_stay_property_categories.rb +8 -0
- data/db/migrate/20241001102646_add_property_category_id_to_property.rb +5 -0
- data/db/migrate/20241001103758_create_stay_property_types.rb +9 -0
- data/db/migrate/20241001111306_add_store_id_to_stay_bookings.rb +5 -0
- data/db/migrate/20241001160330_add_deleted_at_to_stay_store_translations.rb +5 -0
- data/db/migrate/20241004061647_add_field_to_stay_properties.rb +20 -0
- data/db/migrate/20241004062057_create_stay_bed_types.rb +9 -0
- data/db/migrate/20241004062251_add_details_to_stay_rooms.rb +9 -0
- data/db/migrate/20241004070456_add_property_type_id_to_stay_property_categories.rb +6 -0
- data/db/migrate/20241004105821_create_stay_amenity_categories.rb +8 -0
- data/db/migrate/20241004112600_create_stay_amenities.rb +9 -0
- data/db/migrate/20241004115207_create_stay_house_rules.rb +8 -0
- data/db/migrate/20241004115317_create_stay_additional_rules.rb +9 -0
- data/db/migrate/20241004115608_create_stay_property_amenities.rb +9 -0
- data/db/migrate/20241004115615_create_stay_room_amenities.rb +9 -0
- data/db/migrate/20241007051646_add_preferences_to_stay_users.rb +5 -0
- data/db/migrate/20241007165530_create_stay_creates.rb +10 -0
- data/db/migrate/20241008111346_add_deleted_at_to_stay_users.rb +7 -0
- data/db/migrate/20241008151958_add_price_per_night_in_stay_properties.rb +5 -0
- data/db/migrate/20241010071855_add_zipcode_to_stay_property.rb +8 -0
- data/db/migrate/20241014085441_add_amenity_type_in_amenities.rb +5 -0
- data/db/migrate/20241015055940_create_stay_features.rb +10 -0
- data/db/migrate/20241015060804_create_stay_property_features.rb +9 -0
- data/db/migrate/20241015060854_create_stay_room_features.rb +9 -0
- data/db/migrate/20241016055948_create_stay_tax.rb +9 -0
- data/db/migrate/20241016060354_create_stay_property_tax.rb +11 -0
- data/db/migrate/20241016091120_remove_column_from_stay_properties_categories.rb +6 -0
- data/db/migrate/20241016091829_add_column_to_stay_property.rb +5 -0
- data/db/migrate/20241016112707_add_country_to_stay_properties.rb +6 -0
- data/db/migrate/20241016153847_add_state_to_properties.rb +7 -0
- data/db/migrate/20241016170528_up_date_price_column_in_stay_property.rb +5 -0
- data/db/migrate/20241017031520_add_new_field_to_stay_properties.rb +8 -0
- data/db/migrate/20241017051450_add_column_to_stay_chat.rb +7 -0
- data/db/migrate/20241018090158_create_stay_stay_credit_cards.rb +16 -0
- data/db/migrate/20241021090444_create_stay_stay_user_paypals.rb +9 -0
- data/db/migrate/20241024065949_add_stay_property_to_stay_b0okings.rb +5 -0
- data/db/migrate/20241027062126_add_events_to_stay_messages.rb +8 -0
- data/db/migrate/20241028105007_create_stay_invoices.rb +15 -0
- data/db/migrate/20241028105323_create_stay_expenses.rb +10 -0
- data/db/migrate/20241028105331_create_stay_discounts.rb +10 -0
- data/db/migrate/20241101044618_create_stay_booking_queries.rb +17 -0
- data/db/migrate/20241101093057_add_read_at_to_stay_messages.rb +5 -0
- data/db/migrate/20241113061248_modify_cancellation_policy_on_properties.rb +7 -0
- data/db/migrate/20241118064033_rename_columns_in_stay_properties.rb +7 -0
- data/db/migrate/20241127060541_add_new_fields_to_property.rb +11 -0
- data/db/migrate/20241128111832_add_name_to_stay_rooms.rb +5 -0
- data/db/migrate/20241129063922_change_amenity_category_null_on_stay_amenities.rb +5 -0
- data/db/migrate/20241205092935_add_slug_to_stay_properties.rb +6 -0
- data/db/migrate/20241205092943_create_friendly_id_slugs.rb +21 -0
- data/db/migrate/20241217044817_add_deleted_atto_stay_property.rb +6 -0
- data/db/migrate/20241230064432_modify_property_category_on_properties.rb +7 -0
- data/db/seeds.rb +1 -0
- data/lib/stay/controller_helpers/currency.rb +54 -0
- data/lib/stay/controller_helpers/store.rb +37 -0
- data/lib/stay/engine.rb +16 -0
- data/lib/stay/money.rb +77 -0
- data/lib/stay/version.rb +3 -0
- data/lib/stay.rb +16 -0
- data/lib/tasks/stay_tasks.rake +4 -0
- metadata +967 -0
@@ -0,0 +1,65 @@
|
|
1
|
+
# Additional translations at https://github.com/heartcombo/devise/wiki/I18n
|
2
|
+
|
3
|
+
en:
|
4
|
+
devise:
|
5
|
+
confirmations:
|
6
|
+
confirmed: "Your email address has been successfully confirmed."
|
7
|
+
send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes."
|
8
|
+
send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
|
9
|
+
failure:
|
10
|
+
already_authenticated: "You are already signed in."
|
11
|
+
inactive: "Your account is not activated yet."
|
12
|
+
invalid: "Invalid %{authentication_keys} or password."
|
13
|
+
locked: "Your account is locked."
|
14
|
+
last_attempt: "You have one more attempt before your account is locked."
|
15
|
+
not_found_in_database: "Invalid %{authentication_keys} or password."
|
16
|
+
timeout: "Your session expired. Please sign in again to continue."
|
17
|
+
unauthenticated: "You need to sign in or sign up before continuing."
|
18
|
+
unconfirmed: "You have to confirm your email address before continuing."
|
19
|
+
mailer:
|
20
|
+
confirmation_instructions:
|
21
|
+
subject: "Confirmation instructions"
|
22
|
+
reset_password_instructions:
|
23
|
+
subject: "Reset password instructions"
|
24
|
+
unlock_instructions:
|
25
|
+
subject: "Unlock instructions"
|
26
|
+
email_changed:
|
27
|
+
subject: "Email Changed"
|
28
|
+
password_change:
|
29
|
+
subject: "Password Changed"
|
30
|
+
omniauth_callbacks:
|
31
|
+
failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
|
32
|
+
success: "Successfully authenticated from %{kind} account."
|
33
|
+
passwords:
|
34
|
+
no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
|
35
|
+
send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
|
36
|
+
send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
|
37
|
+
updated: "Your password has been changed successfully. You are now signed in."
|
38
|
+
updated_not_active: "Your password has been changed successfully."
|
39
|
+
registrations:
|
40
|
+
destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
|
41
|
+
signed_up: "Welcome! You have signed up successfully."
|
42
|
+
signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
|
43
|
+
signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
|
44
|
+
signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
|
45
|
+
update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirmation link to confirm your new email address."
|
46
|
+
updated: "Your account has been updated successfully."
|
47
|
+
updated_but_not_signed_in: "Your account has been updated successfully, but since your password was changed, you need to sign in again."
|
48
|
+
sessions:
|
49
|
+
signed_in: "Signed in successfully."
|
50
|
+
signed_out: "Signed out successfully."
|
51
|
+
already_signed_out: "Signed out successfully."
|
52
|
+
unlocks:
|
53
|
+
send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
|
54
|
+
send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
|
55
|
+
unlocked: "Your account has been unlocked successfully. Please sign in to continue."
|
56
|
+
errors:
|
57
|
+
messages:
|
58
|
+
already_confirmed: "was already confirmed, please try signing in"
|
59
|
+
confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
|
60
|
+
expired: "has expired, please request a new one"
|
61
|
+
not_found: "not found"
|
62
|
+
not_locked: "was not locked"
|
63
|
+
not_saved:
|
64
|
+
one: "1 error prohibited this %{resource} from being saved:"
|
65
|
+
other: "%{count} errors prohibited this %{resource} from being saved:"
|
@@ -0,0 +1,23 @@
|
|
1
|
+
en:
|
2
|
+
devise:
|
3
|
+
api:
|
4
|
+
error_response:
|
5
|
+
invalid_authentication: "Email or password is invalid"
|
6
|
+
invalid_token: "Invalid token"
|
7
|
+
expired_token: "Token has expired"
|
8
|
+
expired_refresh_token: "Refresh token has expired"
|
9
|
+
revoked_token: "Token has been revoked"
|
10
|
+
refresh_token_disabled: "Refresh token is disabled for this application"
|
11
|
+
sign_up_disabled: "Sign up is disabled for this application"
|
12
|
+
invalid_refresh_token: "Refresh token is invalid"
|
13
|
+
invalid_email: "Email is invalid"
|
14
|
+
invalid_resource_owner: "Resource owner is invalid"
|
15
|
+
resource_owner_create_error: "Resource owner could not be created"
|
16
|
+
devise_api_token_create_error: "Token could not be created"
|
17
|
+
devise_api_token_revoke_error: "Token could not be revoked"
|
18
|
+
lockable:
|
19
|
+
locked: "Your account is locked"
|
20
|
+
confirmable:
|
21
|
+
unconfirmed: "You have to confirm your account before continuing"
|
22
|
+
registerable:
|
23
|
+
signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account"
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# Files in the config/locales directory are used for internationalization and
|
2
|
+
# are automatically loaded by Rails. If you want to use locales other than
|
3
|
+
# English, add the necessary files in this directory.
|
4
|
+
#
|
5
|
+
# To use the locales, use `I18n.t`:
|
6
|
+
#
|
7
|
+
# I18n.t "hello"
|
8
|
+
#
|
9
|
+
# In views, this is aliased to just `t`:
|
10
|
+
#
|
11
|
+
# <%= t("hello") %>
|
12
|
+
#
|
13
|
+
# To use a different locale, set it with `I18n.locale`:
|
14
|
+
#
|
15
|
+
# I18n.locale = :es
|
16
|
+
#
|
17
|
+
# This would use the information in config/locales/es.yml.
|
18
|
+
#
|
19
|
+
# To learn more about the API, please read the Rails Internationalization guide
|
20
|
+
# at https://guides.rubyonrails.org/i18n.html.
|
21
|
+
#
|
22
|
+
# Be aware that YAML interprets the following case-insensitive strings as
|
23
|
+
# booleans: `true`, `false`, `on`, `off`, `yes`, `no`. Therefore, these strings
|
24
|
+
# must be quoted to be interpreted as strings. For example:
|
25
|
+
#
|
26
|
+
# en:
|
27
|
+
# "yes": yup
|
28
|
+
# enabled: "ON"
|
29
|
+
|
30
|
+
en:
|
31
|
+
hello: "Hello world"
|
32
|
+
new_store: "New Store"
|
33
|
+
admin:
|
34
|
+
store: Store
|
35
|
+
add_store: Add Store
|
36
|
+
say_no: 'No'
|
37
|
+
say_yes: 'Yes'
|
38
|
+
store_set_default_button: 'Set Default'
|
data/config/routes.rb
ADDED
@@ -0,0 +1,187 @@
|
|
1
|
+
Stay::Engine.routes.draw do
|
2
|
+
devise_for :users, class_name: "Stay::User", controllers: {
|
3
|
+
registrations: "stay/users/registrations",
|
4
|
+
sessions: "stay/users/sessions",
|
5
|
+
passwords: "stay/users/passwords" }
|
6
|
+
|
7
|
+
namespace :admin do
|
8
|
+
root to: "home#index"
|
9
|
+
|
10
|
+
get "/", to: "dashboard#index"
|
11
|
+
resources :addresses
|
12
|
+
resources :roles
|
13
|
+
resources :users do
|
14
|
+
member do
|
15
|
+
get :addresses
|
16
|
+
put :addresses
|
17
|
+
end
|
18
|
+
end
|
19
|
+
resources :properties do
|
20
|
+
member do
|
21
|
+
put :approve
|
22
|
+
put :reject
|
23
|
+
put :resubmit
|
24
|
+
end
|
25
|
+
resources :rooms
|
26
|
+
end
|
27
|
+
resources :rooms
|
28
|
+
resources :bookings
|
29
|
+
resources :payment_methods
|
30
|
+
resources :payments
|
31
|
+
resources :reviews
|
32
|
+
resources :chats
|
33
|
+
resources :messages
|
34
|
+
resources :room_types
|
35
|
+
resources :cancellation_policies
|
36
|
+
resources :property_categories
|
37
|
+
resources :property_types
|
38
|
+
resources :bed_types
|
39
|
+
resources :amenities
|
40
|
+
resources :amenity_categories
|
41
|
+
resources :house_rules
|
42
|
+
resources :features
|
43
|
+
resources :taxes
|
44
|
+
resources :countries do
|
45
|
+
resources :states
|
46
|
+
end
|
47
|
+
resources :states, only: [] do
|
48
|
+
resources :cities
|
49
|
+
end
|
50
|
+
resources :stores do
|
51
|
+
member do
|
52
|
+
put :set_default
|
53
|
+
end
|
54
|
+
end
|
55
|
+
devise_for :users,
|
56
|
+
class_name: "Stay::User",
|
57
|
+
controllers: { sessions: "stay/admin/sessions",
|
58
|
+
passwords: "stay/admin/passwords",
|
59
|
+
registrations: "stay/admin/registrations",
|
60
|
+
tokens: "customers/api/tokens" },
|
61
|
+
skip: [ :unlocks, :omniauth_callbacks ],
|
62
|
+
path_names: { sign_out: "logout" }
|
63
|
+
|
64
|
+
devise_scope :user do
|
65
|
+
get "/authorization_failure", to: "sessions#authorization_failure", as: :unauthorized
|
66
|
+
get "/login" => "sessions#new", :as => :login
|
67
|
+
post "/login" => "sessions#create", :as => :create_new_session
|
68
|
+
delete "/logout" => "sessions#destroy", :as => :logout
|
69
|
+
get "sign_up", to: "registrations#new", as: :new_registration
|
70
|
+
post "sign_up", to: "registrations#create", as: :registration
|
71
|
+
get "/password/new", to: "passwords#new", as: :new_password
|
72
|
+
post "/password", to: "passwords#create", as: :password
|
73
|
+
get "/password/edit", to: "passwords#edit", as: :edit_password
|
74
|
+
put "/password", to: "passwords#update"
|
75
|
+
patch "/password", to: "passwords#update"
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
namespace :api do
|
80
|
+
namespace :v1 do
|
81
|
+
resources :invoices, only: [ :show, :index ]
|
82
|
+
resources :cancellation_policies, only: [ :index ]
|
83
|
+
resources :property_categories, only: [ :index, :show ]
|
84
|
+
resources :amenity_categories do
|
85
|
+
collection do
|
86
|
+
get :property
|
87
|
+
get :room
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
resources :amenities do
|
92
|
+
collection do
|
93
|
+
get :property
|
94
|
+
get :room
|
95
|
+
end
|
96
|
+
end
|
97
|
+
resources :booking_queries do
|
98
|
+
collection do
|
99
|
+
get :host_query
|
100
|
+
end
|
101
|
+
end
|
102
|
+
resources :property_types, only: [ :index, :show ]
|
103
|
+
resources :room_types, only: [ :index, :show ]
|
104
|
+
resources :users, only: [ :destroy ]
|
105
|
+
resources :house_rules, only: :index
|
106
|
+
resources :bed_types, only: :index
|
107
|
+
resources :payments do
|
108
|
+
collection do
|
109
|
+
get :payment_method
|
110
|
+
end
|
111
|
+
end
|
112
|
+
resources :credit_cards
|
113
|
+
resources :user_paypal
|
114
|
+
resources :bookings do
|
115
|
+
collection do
|
116
|
+
get :host_request
|
117
|
+
get :host_booking
|
118
|
+
get :my_reservation, to: "bookings#my_reservation"
|
119
|
+
end
|
120
|
+
resources :line_items
|
121
|
+
resources :invoices
|
122
|
+
end
|
123
|
+
resources :features do
|
124
|
+
collection do
|
125
|
+
get :property
|
126
|
+
get :room
|
127
|
+
end
|
128
|
+
end
|
129
|
+
resources :chats, only: [ :index, :create, :show ] do
|
130
|
+
collection do
|
131
|
+
get :user_chat
|
132
|
+
end
|
133
|
+
member do
|
134
|
+
get "chat_messages", to: "chats#chat_messages"
|
135
|
+
end
|
136
|
+
resources :messages, only: [ :index, :new, :create ] do
|
137
|
+
member do
|
138
|
+
put :mark_as_read
|
139
|
+
end
|
140
|
+
end
|
141
|
+
end
|
142
|
+
resources :properties do
|
143
|
+
collection do
|
144
|
+
get :my_properties, to: "properties#my_properties"
|
145
|
+
get :similar_property
|
146
|
+
end
|
147
|
+
resources :booking_queries
|
148
|
+
collection do
|
149
|
+
get "search", to: "properties#search"
|
150
|
+
get :property_tax
|
151
|
+
end
|
152
|
+
member do
|
153
|
+
put :resubmit
|
154
|
+
end
|
155
|
+
resources :rooms, only: [ :index, :show ] do
|
156
|
+
resources :bookings, only: [ :create, :show, :update ] do
|
157
|
+
resources :payments, only: [ :new, :create ] do
|
158
|
+
collection do
|
159
|
+
post :confirm
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
resources :profiles, only: [ :show, :update ]
|
166
|
+
resources :bookings do
|
167
|
+
member do
|
168
|
+
get :booking_chat
|
169
|
+
delete "line_items/:room_id", to: "bookings#delete_line_item", as: :delete_line_item
|
170
|
+
end
|
171
|
+
end
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
root "properties#index"
|
176
|
+
resources :properties, only: [ :index, :show ] do
|
177
|
+
resources :bookings, only: [ :new, :create, :show, :update ] do
|
178
|
+
resources :payments, only: [ :new, :create ] do
|
179
|
+
collection do
|
180
|
+
post :confirm
|
181
|
+
end
|
182
|
+
end
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
resources :profiles, only: [ :show, :update ]
|
187
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class DeviseCreateStayUsers < ActiveRecord::Migration[7.2]
|
4
|
+
def change
|
5
|
+
create_table :stay_users do |t|
|
6
|
+
## Database authenticatable
|
7
|
+
t.string :email, null: false, default: ""
|
8
|
+
t.string :encrypted_password, null: false, default: ""
|
9
|
+
|
10
|
+
## Recoverable
|
11
|
+
t.string :reset_password_token
|
12
|
+
t.datetime :reset_password_sent_at
|
13
|
+
|
14
|
+
## Rememberable
|
15
|
+
t.datetime :remember_created_at
|
16
|
+
|
17
|
+
## Trackable
|
18
|
+
# t.integer :sign_in_count, default: 0, null: false
|
19
|
+
# t.datetime :current_sign_in_at
|
20
|
+
# t.datetime :last_sign_in_at
|
21
|
+
# t.string :current_sign_in_ip
|
22
|
+
# t.string :last_sign_in_ip
|
23
|
+
|
24
|
+
## Confirmable
|
25
|
+
# t.string :confirmation_token
|
26
|
+
# t.datetime :confirmed_at
|
27
|
+
# t.datetime :confirmation_sent_at
|
28
|
+
# t.string :unconfirmed_email # Only if using reconfirmable
|
29
|
+
|
30
|
+
## Lockable
|
31
|
+
# t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
|
32
|
+
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
33
|
+
# t.datetime :locked_at
|
34
|
+
|
35
|
+
t.string :first_name
|
36
|
+
t.string :last_name
|
37
|
+
t.string :phone
|
38
|
+
t.datetime :date_of_birth
|
39
|
+
t.string :gender
|
40
|
+
t.string :source
|
41
|
+
|
42
|
+
t.timestamps null: false
|
43
|
+
end
|
44
|
+
|
45
|
+
add_index :stay_users, :email, unique: true
|
46
|
+
add_index :stay_users, :reset_password_token, unique: true
|
47
|
+
# add_index :stay_users, :confirmation_token, unique: true
|
48
|
+
# add_index :stay_users, :unlock_token, unique: true
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class CreateDeviseApiTables < ActiveRecord::Migration[7.2]
|
4
|
+
def change
|
5
|
+
# Use Active Record's configured type for primary and foreign keys
|
6
|
+
primary_key_type, foreign_key_type = primary_and_foreign_key_types
|
7
|
+
|
8
|
+
create_table :devise_api_tokens, id: primary_key_type do |t|
|
9
|
+
t.belongs_to :resource_owner, null: false, polymorphic: true, index: true, type: foreign_key_type
|
10
|
+
t.string :access_token, null: false, index: true
|
11
|
+
t.string :refresh_token, null: true, index: true
|
12
|
+
t.integer :expires_in, null: false
|
13
|
+
t.datetime :revoked_at, null: true
|
14
|
+
t.string :previous_refresh_token, null: true, index: true
|
15
|
+
|
16
|
+
t.timestamps
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def primary_and_foreign_key_types
|
23
|
+
config = Rails.configuration.generators
|
24
|
+
setting = config.options[config.orm][:primary_key_type]
|
25
|
+
primary_key_type = setting || :primary_key
|
26
|
+
foreign_key_type = setting || :bigint
|
27
|
+
[primary_key_type, foreign_key_type]
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
class CreateStayRoleUsers < ActiveRecord::Migration[7.2]
|
2
|
+
def change
|
3
|
+
create_table :stay_role_users do |t|
|
4
|
+
t.references :role, null: false, foreign_key: { to_table: :stay_roles }
|
5
|
+
t.references :user, null: false, foreign_key: { to_table: :stay_users }
|
6
|
+
|
7
|
+
t.timestamps
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateStayProperties < ActiveRecord::Migration[7.2]
|
2
|
+
def change
|
3
|
+
create_table :stay_properties do |t|
|
4
|
+
t.string :title
|
5
|
+
t.string :description
|
6
|
+
t.boolean :active, default: true
|
7
|
+
t.date :availability_start
|
8
|
+
t.date :availability_end
|
9
|
+
t.integer :user_id
|
10
|
+
t.integer :room_id
|
11
|
+
t.integer :address_id
|
12
|
+
|
13
|
+
t.timestamps
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class CreateStayRooms < ActiveRecord::Migration[7.2]
|
2
|
+
def change
|
3
|
+
create_table :stay_rooms do |t|
|
4
|
+
t.references :property, null: false, foreign_key: { to_table: :stay_properties }
|
5
|
+
t.integer :max_guests, null: false
|
6
|
+
t.integer :price_per_night, null: false
|
7
|
+
t.integer :room_type, null: false
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class CreateStayBookings < ActiveRecord::Migration[7.2]
|
2
|
+
def change
|
3
|
+
create_table :stay_bookings do |t|
|
4
|
+
t.references :user, null: false, foreign_key: { to_table: :stay_users }
|
5
|
+
t.references :room, null: false, foreign_key: { to_table: :stay_rooms }
|
6
|
+
t.string :email
|
7
|
+
t.date :check_in_date, null: false
|
8
|
+
t.date :check_out_date, null: false
|
9
|
+
t.integer :number_of_guests, null: false
|
10
|
+
t.string :status, null: false
|
11
|
+
|
12
|
+
t.timestamps
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class CreateStayPayments < ActiveRecord::Migration[7.2]
|
2
|
+
def change
|
3
|
+
create_table :stay_payments do |t|
|
4
|
+
t.references :booking, null: false, foreign_key: { to_table: :stay_bookings }
|
5
|
+
t.references :payment_method, null: false, foreign_key: { to_table: :stay_payment_methods }
|
6
|
+
t.string :amount, null: false
|
7
|
+
t.string :status, null: false
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class CreateStayReviews < ActiveRecord::Migration[7.2]
|
2
|
+
def change
|
3
|
+
create_table :stay_reviews do |t|
|
4
|
+
t.references :booking, null: false, foreign_key: { to_table: :stay_bookings }
|
5
|
+
t.integer :rating, null: false
|
6
|
+
t.string :comment
|
7
|
+
|
8
|
+
t.timestamps
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class CreateStayChats < ActiveRecord::Migration[7.2]
|
2
|
+
def change
|
3
|
+
create_table :stay_chats do |t|
|
4
|
+
t.references :sender, null: false, foreign_key: { to_table: :stay_users }
|
5
|
+
t.references :receiver, null: false, foreign_key: { to_table: :stay_users }
|
6
|
+
t.references :property, null: false, foreign_key: { to_table: :stay_properties }
|
7
|
+
|
8
|
+
t.timestamps
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class CreateStayMessages < ActiveRecord::Migration[7.2]
|
2
|
+
def change
|
3
|
+
create_table :stay_messages do |t|
|
4
|
+
t.string :body, null: false
|
5
|
+
t.references :sender, null: false, foreign_key: { to_table: :stay_users }
|
6
|
+
t.references :receiver, null: false, foreign_key: { to_table: :stay_users }
|
7
|
+
t.references :chat, null: false, foreign_key: { to_table: :stay_chats }
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class CreateStayCountries < ActiveRecord::Migration[7.2]
|
2
|
+
def change
|
3
|
+
create_table :stay_countries do |t|
|
4
|
+
t.string :iso_name
|
5
|
+
t.string :iso, null: false
|
6
|
+
t.string :iso3, null: false
|
7
|
+
t.string :name
|
8
|
+
t.integer :numcode
|
9
|
+
t.boolean :states_required, default: false
|
10
|
+
|
11
|
+
t.timestamps
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class CreateStayStates < ActiveRecord::Migration[7.2]
|
2
|
+
def change
|
3
|
+
create_table :stay_states do |t|
|
4
|
+
t.string :name
|
5
|
+
t.string :abbr
|
6
|
+
t.references :country, null: false, foreign_key: { to_table: :stay_countries }, type: :bigint
|
7
|
+
|
8
|
+
t.timestamps
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class CreateStayAddresses < ActiveRecord::Migration[7.2]
|
2
|
+
def change
|
3
|
+
create_table :stay_addresses do |t|
|
4
|
+
t.string :address1
|
5
|
+
t.string :address2
|
6
|
+
t.string :city
|
7
|
+
t.string :state
|
8
|
+
t.string :country
|
9
|
+
t.string :zipcode
|
10
|
+
t.string :longitude
|
11
|
+
t.string :latitude
|
12
|
+
t.references :city, foreign_key: { to_table: :stay_cities }
|
13
|
+
t.references :state, foreign_key: { to_table: :stay_states }
|
14
|
+
t.references :country, foreign_key: { to_table: :stay_countries }
|
15
|
+
|
16
|
+
t.timestamps
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# This migration comes from active_storage (originally 20170806125915)
|
2
|
+
class CreateActiveStorageTables < ActiveRecord::Migration[7.2]
|
3
|
+
def change
|
4
|
+
# Use Active Record's configured type for primary and foreign keys
|
5
|
+
primary_key_type, foreign_key_type = primary_and_foreign_key_types
|
6
|
+
|
7
|
+
create_table :active_storage_blobs, id: primary_key_type do |t|
|
8
|
+
t.string :key, null: false
|
9
|
+
t.string :filename, null: false
|
10
|
+
t.string :content_type
|
11
|
+
t.text :metadata
|
12
|
+
t.string :service_name, null: false
|
13
|
+
t.bigint :byte_size, null: false
|
14
|
+
t.string :checksum
|
15
|
+
|
16
|
+
if connection.supports_datetime_with_precision?
|
17
|
+
t.datetime :created_at, precision: 6, null: false
|
18
|
+
else
|
19
|
+
t.datetime :created_at, null: false
|
20
|
+
end
|
21
|
+
|
22
|
+
t.index [ :key ], unique: true
|
23
|
+
end
|
24
|
+
|
25
|
+
create_table :active_storage_attachments, id: primary_key_type do |t|
|
26
|
+
t.string :name, null: false
|
27
|
+
t.references :record, null: false, polymorphic: true, index: false, type: foreign_key_type
|
28
|
+
t.references :blob, null: false, type: foreign_key_type
|
29
|
+
|
30
|
+
if connection.supports_datetime_with_precision?
|
31
|
+
t.datetime :created_at, precision: 6, null: false
|
32
|
+
else
|
33
|
+
t.datetime :created_at, null: false
|
34
|
+
end
|
35
|
+
|
36
|
+
t.index [ :record_type, :record_id, :name, :blob_id ], name: :index_active_storage_attachments_uniqueness, unique: true
|
37
|
+
t.foreign_key :active_storage_blobs, column: :blob_id
|
38
|
+
end
|
39
|
+
|
40
|
+
create_table :active_storage_variant_records, id: primary_key_type do |t|
|
41
|
+
t.belongs_to :blob, null: false, index: false, type: foreign_key_type
|
42
|
+
t.string :variation_digest, null: false
|
43
|
+
|
44
|
+
t.index [ :blob_id, :variation_digest ], name: :index_active_storage_variant_records_uniqueness, unique: true
|
45
|
+
t.foreign_key :active_storage_blobs, column: :blob_id
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
private
|
50
|
+
def primary_and_foreign_key_types
|
51
|
+
config = Rails.configuration.generators
|
52
|
+
setting = config.options[config.orm][:primary_key_type]
|
53
|
+
primary_key_type = setting || :primary_key
|
54
|
+
foreign_key_type = setting || :bigint
|
55
|
+
[ primary_key_type, foreign_key_type ]
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class AddColumnsToStayBookings < ActiveRecord::Migration[7.2]
|
2
|
+
def change
|
3
|
+
add_column :stay_bookings, :number, :string
|
4
|
+
add_column :stay_bookings, :payment_state, :string
|
5
|
+
add_column :stay_bookings, :item_total, :decimal
|
6
|
+
add_column :stay_bookings, :total, :decimal
|
7
|
+
add_column :stay_bookings, :room_count, :integer
|
8
|
+
add_column :stay_bookings, :completed_at, :datetime
|
9
|
+
add_column :stay_bookings, :canceled_at, :datetime
|
10
|
+
add_column :stay_bookings, :canceler_id, :integer
|
11
|
+
end
|
12
|
+
end
|