diff --git a/.fabmanager-version b/.fabmanager-version index 35cee72dcb..79a614418f 100644 --- a/.fabmanager-version +++ b/.fabmanager-version @@ -1 +1 @@ -2.4.3 +2.4.4 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b2a2d826c..a54faf3d9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog Fab Manager +## v2.4.4 2016 November 24 + +- Fix a bug: unable to rollback migration 20160906145713 +- Fix a bug: Title's translation for plan's forms is not loaded in French +- Fix a bug: invoice of reservation show payment by debit card when user pay with wallet + ## v2.4.3 2016 November 21 - Export user's invoicing status in members' excel export diff --git a/README.md b/README.md index da7d6562d1..fb6d7023ca 100644 --- a/README.md +++ b/README.md @@ -677,7 +677,7 @@ Developers may find information on how to implement their own authentication pro To solve this issue copy `config/application.yml.default` to `config/application.yml`. This is required before the first start. -- Due to a stripe limitation, you won't be ble to create plans longer than one year. +- Due to a stripe limitation, you won't be able to create plans longer than one year. - When running the tests suite with `rake test`, all tests may fail with errors similar to the following: diff --git a/app/exceptions/debit_wallet_error.rb b/app/exceptions/debit_wallet_error.rb new file mode 100644 index 0000000000..b225b19586 --- /dev/null +++ b/app/exceptions/debit_wallet_error.rb @@ -0,0 +1,3 @@ +# Raised when debit wallet fail +class DebitWalletError < StandardError +end diff --git a/app/models/reservation.rb b/app/models/reservation.rb index 61f0713b68..35f3f87a77 100644 --- a/app/models/reservation.rb +++ b/app/models/reservation.rb @@ -406,8 +406,14 @@ def debit_user_wallet if @wallet_amount_debit.present? and @wallet_amount_debit != 0 amount = @wallet_amount_debit / 100.0 wallet_transaction = WalletService.new(user: user, wallet: user.wallet).debit(amount, self) - if !user.invoicing_disabled? and wallet_transaction - self.invoice.update_columns(wallet_amount: @wallet_amount_debit, wallet_transaction_id: wallet_transaction.id) + # wallet debit success + if wallet_transaction + # payment by online or (payment by local and invoice isnt disabled) + if stp_invoice_id or !user.invoicing_disabled? + self.invoice.update_columns(wallet_amount: @wallet_amount_debit, wallet_transaction_id: wallet_transaction.id) + end + else + raise DebitWalletError end end end diff --git a/config/locales/app.public.en.yml b/config/locales/app.public.en.yml index e85c740016..5a3e7d1f0c 100644 --- a/config/locales/app.public.en.yml +++ b/config/locales/app.public.en.yml @@ -204,7 +204,7 @@ en: your_subscription_expires_on_the_DATE: "Your subscription expires on the {{DATE}}" # angular interpolation my_group: "My group" his_group: "{GENDER, select, male{His} female{Her} other{Its}} group" # messageFormat interpolation - he_wants_to_change_group: "{ROLE, select, admin{He wants} other{I want}} to change group" # messageFormat interpolation + he_wants_to_change_group: "{ROLE, select, admin{The user wants} other{I want}} to change group" # messageFormat interpolation change_my_group: "Change {ROLE, select, admin{{GENDER, select, male{his} female{her} other{its}}} other{my}} group" # messageFormat interpolation your_subscription_has_expired_on_the_DATE: "Your subscription has expired on the {{DATE}}" # angular interpolation you_ve_just_payed_the_: "You've just payed the" diff --git a/config/locales/app.public.fr.yml b/config/locales/app.public.fr.yml index 0a3d8b0839..27d7d2b5b3 100644 --- a/config/locales/app.public.fr.yml +++ b/config/locales/app.public.fr.yml @@ -205,7 +205,7 @@ fr: your_subscription_expires_on_the_DATE: "Votre abonnement expire au {{DATE}}" # angular interpolation my_group: "Mon groupe" his_group: "Son groupe" # messageFormat interpolation - he_wants_to_change_group: "{ROLE, select, admin{Il veut} other{Je veux}} changer de groupe" # messageFormat interpolation + he_wants_to_change_group: "{ROLE, select, admin{L'utilisateur veut} other{Je veux}} changer de groupe" # messageFormat interpolation change_my_group: "Changer {ROLE, select, admin{son} other{mon}} groupe" # messageFormat interpolation your_subscription_has_expired_on_the_DATE: "Votre abonnement a expiré au {{DATE}}" # angular interpolation you_ve_just_payed_the_: "Vous venez de régler l'" diff --git a/config/locales/app.shared.fr.yml b/config/locales/app.shared.fr.yml index e6ce0c8ea4..9e3c864f5a 100644 --- a/config/locales/app.shared.fr.yml +++ b/config/locales/app.shared.fr.yml @@ -199,7 +199,7 @@ fr: plan: # formulaire d'édition d'une formule d'abonnement - general_informations: "Informations générales" + general_information: "Informations générales" name_length_must_be_less_than_24_characters: "Le nom doit faire moins de 24 caractères." type_is_required: "Le type est requis." group: "Groupe" diff --git a/db/migrate/20160906145713_insert_custom_aggregations.rb b/db/migrate/20160906145713_insert_custom_aggregations.rb index 90c95e456e..1b23072c10 100644 --- a/db/migrate/20160906145713_insert_custom_aggregations.rb +++ b/db/migrate/20160906145713_insert_custom_aggregations.rb @@ -1,5 +1,5 @@ class InsertCustomAggregations < ActiveRecord::Migration - def change + def up # available reservations hours for machines machine = StatisticIndex.find_by_es_type_key('machine') machine_hours = StatisticType.find_by(key: 'hour', statistic_index_id: machine.id) @@ -26,4 +26,17 @@ def change }) available_tickets.save! end + + def down + + machine = StatisticIndex.find_by_es_type_key('machine') + machine_hours = StatisticType.find_by(key: 'hour', statistic_index_id: machine.id) + + StatisticCustomAggregation.where(field: 'available_hours', statistic_type_id: machine_hours.id).first.destroy! + + training = StatisticIndex.find_by_es_type_key('training') + training_bookings = StatisticType.find_by(key: 'booking', statistic_index_id: training.id) + + StatisticCustomAggregation.where(field: 'available_tickets', statistic_type_id: training_bookings.id).first.destroy! + end end diff --git a/doc/controllers_brief.svg b/doc/controllers_brief.svg index 4337670803..096ed4773f 100644 --- a/doc/controllers_brief.svg +++ b/doc/controllers_brief.svg @@ -4,23 +4,23 @@ - - + + controllers_diagram - + _diagram_info Controllers diagram -Date: Sep 15 2016 - 17:48 -Migration version: 20160915105234 +Date: Nov 23 2016 - 10:21 +Migration version: 20160922155555 Generated by RailRoady 1.4.0 http://railroady.prestonlee.com SessionsController - -SessionsController + +SessionsController OpenAPI::V1::BookableMachinesController @@ -74,8 +74,8 @@ API::TagsController - -API::TagsController + +API::TagsController API::StatisticsController @@ -89,8 +89,8 @@ API::PlansController - -API::PlansController + +API::PlansController API::AuthProvidersController @@ -144,8 +144,8 @@ API::FeedsController - -API::FeedsController + +API::FeedsController API::MembersController @@ -154,8 +154,8 @@ API::PricesController - -API::PricesController + +API::PricesController API::TranslationsController @@ -209,96 +209,116 @@ API::SlotsController - -API::SlotsController + +API::SlotsController + + +API::VersionController + +API::VersionController -API::AdminsController +API::AdminsController API::AdminsController -API::GroupsController - -API::GroupsController +API::GroupsController + +API::GroupsController -API::AvailabilitiesController +API::AvailabilitiesController API::AvailabilitiesController -API::UsersController - -API::UsersController +API::UsersController + +API::UsersController -API::ProjectsController +API::ProjectsController API::ProjectsController -API::WalletController - -API::WalletController +API::WalletController + +API::WalletController -API::NotificationsController +API::NotificationsController API::NotificationsController -API::TrainingsController +API::TrainingsController API::TrainingsController -API::SettingsController +API::SettingsController API::SettingsController -API::OpenAPIClientsController +API::OpenAPIClientsController API::OpenAPIClientsController -API::InvoicesController +API::InvoicesController API::InvoicesController -API::LicencesController +API::LicencesController API::LicencesController -SocialBotController - -SocialBotController +SocialBotController + +SocialBotController -PasswordsController - -PasswordsController +PasswordsController + +PasswordsController -ApplicationController - -ApplicationController +ApplicationController + +ApplicationController -Users::OmniauthCallbacksController +Users::OmniauthCallbacksController Users::OmniauthCallbacksController -WebhooksController - -WebhooksController +WebhooksController + +WebhooksController + + +Rss::RssController + +Rss::RssController + + +Rss::EventsController + +Rss::EventsController + + +Rss::ProjectsController + +Rss::ProjectsController -ConfirmationsController +ConfirmationsController ConfirmationsController diff --git a/doc/controllers_complete.svg b/doc/controllers_complete.svg index 0421faae86..c6d8662318 100644 --- a/doc/controllers_complete.svg +++ b/doc/controllers_complete.svg @@ -4,158 +4,158 @@ - - + + controllers_diagram - + _diagram_info -Controllers diagram -Date: Sep 15 2016 - 17:48 -Migration version: 20160915105234 -Generated by RailRoady 1.4.0 -http://railroady.prestonlee.com +Controllers diagram +Date: Nov 23 2016 - 10:21 +Migration version: 20160922155555 +Generated by RailRoady 1.4.0 +http://railroady.prestonlee.com SessionsController - -SessionsController - -new - -set_csrf_headers - -_layout + +SessionsController + +new + +set_csrf_headers + +_layout OpenAPI::V1::BookableMachinesController - -OpenAPI::V1::BookableMachinesController - -index - - -_layout + +OpenAPI::V1::BookableMachinesController + +index + + +_layout OpenAPI::V1::ReservationsController - -OpenAPI::V1::ReservationsController - -index - - -_layout -format_type -per_page + +OpenAPI::V1::ReservationsController + +index + + +_layout +format_type +per_page OpenAPI::V1::EventsController - -OpenAPI::V1::EventsController - -index - - -_layout -per_page + +OpenAPI::V1::EventsController + +index + + +_layout +per_page OpenAPI::V1::MachinesController - -OpenAPI::V1::MachinesController - -index - - -_layout + +OpenAPI::V1::MachinesController + +index + + +_layout OpenAPI::V1::UserTrainingsController - -OpenAPI::V1::UserTrainingsController - -index - - -_layout -per_page + +OpenAPI::V1::UserTrainingsController + +index + + +_layout +per_page OpenAPI::V1::BaseController - -OpenAPI::V1::BaseController - - -authenticate -authenticate_token -bad_request -current_api_client -not_found -render_unauthorized - -_layout -increment_calls_count + +OpenAPI::V1::BaseController + + +authenticate +authenticate_token +bad_request +current_api_client +not_found +render_unauthorized + +_layout +increment_calls_count OpenAPI::V1::UsersController - -OpenAPI::V1::UsersController - -index - - -_layout -per_page + +OpenAPI::V1::UsersController + +index + + +_layout +per_page OpenAPI::V1::TrainingsController - -OpenAPI::V1::TrainingsController - -index - - -_layout + +OpenAPI::V1::TrainingsController + +index + + +_layout OpenAPI::V1::InvoicesController - -OpenAPI::V1::InvoicesController - -download -index - - -_layout -per_page + +OpenAPI::V1::InvoicesController + +download +index + + +_layout +per_page RegistrationsController - -RegistrationsController - -create - - -_layout + +RegistrationsController + +create + + +_layout API::TagsController - -API::TagsController - -create -destroy -index -show -update - - -_layout -set_tag -tag_params + +API::TagsController + +create +destroy +index +show +update + + +_layout +set_tag +tag_params API::StatisticsController @@ -185,30 +185,30 @@ API::TrainingsPricingsController - -API::TrainingsPricingsController - -index -trainings_pricing_params -update - - -_layout + +API::TrainingsPricingsController + +index +trainings_pricing_params +update + + +_layout API::PlansController - -API::PlansController - -create -destroy -index -show -update - - -_layout -plan_params + +API::PlansController + +create +destroy +index +show +update + + +_layout +plan_params API::AuthProvidersController @@ -230,144 +230,144 @@ API::CouponsController - -API::CouponsController - -create -destroy -index -send_to -show -update -validate - - -_layout -coupon_editable_params -coupon_params -set_coupon + +API::CouponsController + +create +destroy +index +send_to +show +update +validate + + +_layout +coupon_editable_params +coupon_params +set_coupon API::AgeRangesController - -API::AgeRangesController - -create -destroy -index -show -update - - -_layout -age_range_params -set_age_range + +API::AgeRangesController + +create +destroy +index +show +update + + +_layout +age_range_params +set_age_range API::CreditsController - -API::CreditsController - -create -destroy -index -update - - -_layout -credit_params -set_credit + +API::CreditsController + +create +destroy +index +update + + +_layout +credit_params +set_credit API::OpenlabProjectsController - -API::OpenlabProjectsController - -index - - -_layout + +API::OpenlabProjectsController + +index + + +_layout API::ComponentsController - -API::ComponentsController - -create -destroy -index -show -update - - -_layout -component_params -set_component + +API::ComponentsController + +create +destroy +index +show +update + + +_layout +component_params +set_component API::CustomAssetsController - -API::CustomAssetsController - -create -destroy -index -show -update - - -_layout -custom_asset_params -set_custom_asset + +API::CustomAssetsController + +create +destroy +index +show +update + + +_layout +custom_asset_params +set_custom_asset API::PricingController - -API::PricingController - -index -update - - -_layout + +API::PricingController + +index +update + + +_layout API::AbusesController - -API::AbusesController - -create -index - - -_layout -abuse_params + +API::AbusesController + +create +index + + +_layout +abuse_params API::PriceCategoriesController - -API::PriceCategoriesController - -create -destroy -index -show -update - - -_layout -price_category_params -set_price_category + +API::PriceCategoriesController + +create +destroy +index +show +update + + +_layout +price_category_params +set_price_category API::FeedsController - -API::FeedsController - -twitter_timelines - - -_layout + +API::FeedsController + +twitter_timelines + + +_layout API::MembersController @@ -395,139 +395,139 @@ API::PricesController - -API::PricesController - -compute -index -update - - -_layout -compute_price_params -coupon_params -price_params + +API::PricesController + +compute +index +update + + +_layout +compute_price_params +coupon_params +price_params API::TranslationsController - -API::TranslationsController - -set_locale -show - - -_layout + +API::TranslationsController + +set_locale +show + + +_layout API::ExportsController - -API::ExportsController - -download -status - - -_layout -set_export + +API::ExportsController + +download +status + + +_layout +set_export API::ReservationsController - -API::ReservationsController - -create -index -show -update - - -_layout -coupon_params -reservation_params -set_reservation + +API::ReservationsController + +create +index +show +update + + +_layout +coupon_params +reservation_params +set_reservation API::EventsController - -API::EventsController - -create -destroy -index -show -upcoming -update - - -_layout -event_params -set_event + +API::EventsController + +create +destroy +index +show +upcoming +update + + +_layout +event_params +set_event API::MachinesController - -API::MachinesController - -create -destroy -index -show -update - - -_layout -is_reserved -machine_params -set_machine + +API::MachinesController + +create +destroy +index +show +update + + +_layout +is_reserved +machine_params +set_machine API::EventThemesController - -API::EventThemesController - -create -destroy -index -show -update - - -_layout -event_theme_params -set_event_theme + +API::EventThemesController + +create +destroy +index +show +update + + +_layout +event_theme_params +set_event_theme API::ThemesController - -API::ThemesController - -create -destroy -index -show -update - - -_layout -set_theme -theme_params + +API::ThemesController + +create +destroy +index +show +update + + +_layout +set_theme +theme_params API::CategoriesController - -API::CategoriesController - -create -destroy -index -show -update - - -_layout -category_params -set_category + +API::CategoriesController + +create +destroy +index +show +update + + +_layout +category_params +set_category API::SubscriptionsController @@ -548,42 +548,52 @@ API::StylesheetsController - -API::StylesheetsController - -show - - -_layout + +API::StylesheetsController + +show + + +_layout API::SlotsController - -API::SlotsController - -cancel -update - - -_layout -set_slot -slot_params + +API::SlotsController + +cancel +update + + +_layout +set_slot +slot_params + + +API::VersionController + +API::VersionController + +show + + +_layout -API::AdminsController - -API::AdminsController - -create -destroy -index - - -_layout -admin_params +API::AdminsController + +API::AdminsController + +create +destroy +index + + +_layout +admin_params -API::GroupsController +API::GroupsController API::GroupsController @@ -597,7 +607,7 @@ group_params -API::AvailabilitiesController +API::AvailabilitiesController API::AvailabilitiesController @@ -624,207 +634,237 @@ verify_training_event_is_reserved -API::UsersController - -API::UsersController - -create -index - - -_layout -partner_params +API::UsersController + +API::UsersController + +create +index + + +_layout +partner_params -API::ProjectsController - -API::ProjectsController - -collaborator_valid -create -destroy -index -last_published -search -show -update - - -_layout -project_params -set_project +API::ProjectsController + +API::ProjectsController + +allowed_extensions +collaborator_valid +create +destroy +index +last_published +search +show +update + + +_layout +project_params +set_project -API::WalletController - -API::WalletController - -by_user -credit -transactions - - -_layout +API::WalletController + +API::WalletController + +by_user +credit +transactions + + +_layout -API::NotificationsController - -API::NotificationsController - -index -show -update -update_all - - -_layout -set_notification +API::NotificationsController + +API::NotificationsController + +index +show +update +update_all + + +_layout +set_notification -API::TrainingsController - -API::TrainingsController - -availabilities -create -destroy -index -show -update - - -_layout -set_training -training_params -valid_training_params +API::TrainingsController + +API::TrainingsController + +availabilities +create +destroy +index +show +update + + +_layout +set_training +training_params +valid_training_params -API::SettingsController - -API::SettingsController - -index -show -update - - -_layout -names_as_string_to_array -setting_params +API::SettingsController + +API::SettingsController + +index +show +update + + +_layout +names_as_string_to_array +setting_params -API::OpenAPIClientsController - -API::OpenAPIClientsController - -create -destroy -index -reset_token -update - - -_layout -client_params +API::OpenAPIClientsController + +API::OpenAPIClientsController + +create +destroy +index +reset_token +update + + +_layout +client_params -API::InvoicesController - -API::InvoicesController - -create -download -index -list - - -_layout -avoir_params -set_invoice +API::InvoicesController + +API::InvoicesController + +create +download +index +list + + +_layout +avoir_params +set_invoice -API::LicencesController - -API::LicencesController - -create -destroy -index -show -update - - -_layout -licence_params -set_licence +API::LicencesController + +API::LicencesController + +create +destroy +index +show +update + + +_layout +licence_params +set_licence -SocialBotController - -SocialBotController - -share - - -_layout +SocialBotController + +SocialBotController + +share + + +_layout -PasswordsController - -PasswordsController - -create - - -_layout +PasswordsController + +PasswordsController + +create + + +_layout -ApplicationController - -ApplicationController - -index - -configure_permitted_parameters -default_url_options -permission_denied -set_csrf_cookie -verified_request? - -_layout +ApplicationController + +ApplicationController + +index + +configure_permitted_parameters +default_url_options +permission_denied +set_csrf_cookie +verified_request? + +_layout -Users::OmniauthCallbacksController - -Users::OmniauthCallbacksController - -database-fablab - - -_layout -email_exists? -generate_unique_username -username_exists? +Users::OmniauthCallbacksController + +Users::OmniauthCallbacksController + +database-fablab + + +_layout +email_exists? +generate_unique_username +username_exists? -WebhooksController - -WebhooksController - -create - - -_layout +WebhooksController + +WebhooksController + +create + + +_layout + + +Rss::RssController + +Rss::RssController + + + +_layout + + +Rss::EventsController + +Rss::EventsController + +index + + +_layout + + +Rss::ProjectsController + +Rss::ProjectsController + +index + + +_layout -ConfirmationsController - -ConfirmationsController - -after_confirmation_path_for - - -_layout +ConfirmationsController + +ConfirmationsController + +after_confirmation_path_for + + +_layout diff --git a/doc/models_brief.svg b/doc/models_brief.svg index bca0302105..2ed4ad3080 100644 --- a/doc/models_brief.svg +++ b/doc/models_brief.svg @@ -12,8 +12,8 @@ _diagram_info Models diagram -Date: Sep 15 2016 - 17:48 -Migration version: 20160915105234 +Date: Nov 23 2016 - 10:21 +Migration version: 20160922155555 Generated by RailRoady 1.4.0 http://railroady.prestonlee.com @@ -29,9 +29,9 @@ Group->Price - - - + + + machines_prices @@ -41,9 +41,9 @@ Group->TrainingsPricing - - - + + + Plan @@ -52,9 +52,9 @@ Group->Plan - - - + + + User @@ -63,9 +63,9 @@ Group->User - - - + + + InvoiceItem @@ -74,9 +74,9 @@ InvoiceItem->InvoiceItem - - - + + + AvailabilityTag @@ -105,9 +105,9 @@ OpenAPI::Client->OpenAPI::CallsCountTracing - - - + + + OpenAPI::ParameterError @@ -131,15 +131,15 @@ Tag->AvailabilityTag - - - + + + Tag->User - - - + + + Availability @@ -148,9 +148,9 @@ Tag->Availability - - - + + + UserTag @@ -159,9 +159,9 @@ Tag->UserTag - - - + + + Event @@ -175,9 +175,9 @@ Event->PriceCategory - - - + + + EventTheme @@ -186,9 +186,9 @@ Event->EventTheme - - - + + + EventImage @@ -197,9 +197,9 @@ Event->EventImage - - - + + + Reservation @@ -208,9 +208,9 @@ Event->Reservation - - - + + + EventPriceCategory @@ -219,9 +219,9 @@ Event->EventPriceCategory - - - + + + EventFile @@ -230,9 +230,9 @@ Event->EventFile - - - + + + StatisticSubType @@ -246,9 +246,9 @@ StatisticSubType->StatisticType - - - + + + StatisticTypeSubType @@ -257,9 +257,9 @@ StatisticSubType->StatisticTypeSubType - - - + + + Project @@ -268,15 +268,15 @@ Project->ProjectImage - - - + + + Project->User - - - + + + Theme @@ -285,9 +285,9 @@ Project->Theme - - - + + + ProjectCao @@ -296,9 +296,9 @@ Project->ProjectCao - - - + + + ProjectStep @@ -307,9 +307,9 @@ Project->ProjectStep - - - + + + ProjectUser @@ -318,9 +318,9 @@ Project->ProjectUser - - - + + + Machine @@ -329,9 +329,9 @@ Project->Machine - - - + + + Component @@ -340,9 +340,9 @@ Project->Component - - - + + + CustomAsset @@ -356,9 +356,9 @@ CustomAsset->CustomAssetFile - - - + + + AgeRange @@ -367,9 +367,9 @@ AgeRange->Event - - - + + + Wallet @@ -383,9 +383,9 @@ Wallet->WalletTransaction - - - + + + Stats::Event @@ -424,9 +424,9 @@ PriceCategory->EventPriceCategory - - - + + + Invoice @@ -435,15 +435,15 @@ Invoice->InvoiceItem - - - + + + Invoice->Invoice - - - + + + avoir @@ -458,9 +458,9 @@ OfferDay->Invoice - - - + + + StatisticIndex @@ -469,15 +469,15 @@ StatisticType->StatisticIndex - - - + + + StatisticType->StatisticTypeSubType - - - + + + StatisticCustomAggregation @@ -486,9 +486,9 @@ StatisticType->StatisticCustomAggregation - - - + + + Address @@ -497,15 +497,15 @@ Plan->Price - - - + + + Plan->PlanFile - - - + + + Credit @@ -514,22 +514,22 @@ Plan->Credit - - - + + + Plan->Credit - - - + + + training_credits Plan->Credit - - - + + + machine_credits @@ -539,9 +539,9 @@ Plan->Subscription - - - + + + PlanImage @@ -550,9 +550,9 @@ Plan->PlanImage - - - + + + MachineFile @@ -566,9 +566,9 @@ Organization->Address - - - + + + StatisticGraph @@ -587,47 +587,47 @@ Licence->Project - - - + + + User->Project - - - + + + my_projects User->Wallet - - - + + + User->Invoice - - - + + + User->Credit - - - + + + User->Credit - - - + + + training_credits User->Credit - - - + + + machine_credits @@ -637,9 +637,9 @@ User->Role - - - + + + Notification @@ -648,15 +648,15 @@ User->Notification - - - + + + User->Subscription - - - + + + Training @@ -665,15 +665,15 @@ User->Training - - - + + + User->Reservation - - - + + + UsersCredit @@ -682,15 +682,15 @@ User->UsersCredit - - - + + + User->UserTag - - - + + + Export @@ -699,9 +699,9 @@ User->Export - - - + + + UserTraining @@ -710,15 +710,15 @@ User->UserTraining - - - + + + User->ProjectUser - - - + + + Profile @@ -727,9 +727,9 @@ User->Profile - - - + + + ProjectStepImage @@ -738,9 +738,9 @@ Credit->UsersCredit - - - + + + PartnerPlan @@ -749,53 +749,53 @@ PartnerPlan->Price - - - + + + PartnerPlan->PlanFile - - - + + + PartnerPlan->Credit - - - + + + PartnerPlan->Credit - - - + + + training_credits PartnerPlan->Credit - - - + + + machine_credits PartnerPlan->Role - - - + + + PartnerPlan->Subscription - - - + + + PartnerPlan->PlanImage - - - + + + OAuth2Provider @@ -804,9 +804,9 @@ OAuth2Provider->OAuth2Mapping - - - + + + AuthProvider @@ -815,9 +815,9 @@ OAuth2Provider->AuthProvider - - - + + + Asset @@ -836,33 +836,33 @@ DatabaseProvider->AuthProvider - - - + + + Availability->AvailabilityTag - - - + + + Availability->Event - - - + + + Availability->Training - - - + + + Availability->Reservation - - - + + + Slot @@ -871,9 +871,9 @@ Availability->Slot - - - + + + MachinesAvailability @@ -882,9 +882,9 @@ Availability->MachinesAvailability - - - + + + TrainingsAvailability @@ -893,93 +893,93 @@ Availability->TrainingsAvailability - - - + + + Availability->Machine - - - + + + Subscription->Invoice - - - + + + Subscription->OfferDay - - - + + + Training->TrainingImage - - - + + + Training->TrainingsPricing - - - + + + Training->Plan - - - + + + Training->Credit - - - + + + Training->Reservation - - - + + + Training->UserTraining - - - + + + Training->TrainingsAvailability - - - + + + Training->Machine - - - + + + ProjectStep->ProjectStepImage - - - + + + Reservation->Invoice - - - + + + Reservation->Slot - - - + + + Ticket @@ -988,21 +988,21 @@ Reservation->Ticket - - - + + + StatisticIndex->StatisticType - - - + + + StatisticIndex->StatisticGraph - - - + + + StatisticField @@ -1011,27 +1011,27 @@ StatisticIndex->StatisticField - - - + + + StatisticField->StatisticIndex - - - + + + WalletTransaction->Invoice - - - + + + EventPriceCategory->Ticket - - - + + + Avoir @@ -1040,15 +1040,15 @@ Avoir->InvoiceItem - - - + + + Avoir->Invoice - - - + + + avoir @@ -1068,9 +1068,9 @@ Coupon->Invoice - - - + + + Category @@ -1079,9 +1079,9 @@ Category->Event - - - + + + MachineImage @@ -1095,45 +1095,45 @@ Machine->Price - - - + + + Machine->Plan - - - + + + Machine->MachineFile - - - + + + Machine->Credit - - - + + + Machine->Reservation - - - + + + Machine->MachinesAvailability - - - + + + Machine->MachineImage - - - + + + Abuse @@ -1142,21 +1142,21 @@ Profile->UserAvatar - - - + + + Profile->Address - - - + + + Profile->Organization - - - + + + Setting diff --git a/doc/models_complete.svg b/doc/models_complete.svg index dd4b1aa9c6..e686ad63d9 100644 --- a/doc/models_complete.svg +++ b/doc/models_complete.svg @@ -4,29 +4,29 @@ - - + + models_diagram - + _diagram_info -Models diagram -Date: Sep 15 2016 - 17:48 -Migration version: 20160915105234 -Generated by RailRoady 1.4.0 -http://railroady.prestonlee.com +Models diagram +Date: Nov 23 2016 - 10:20 +Migration version: 20160922155555 +Generated by RailRoady 1.4.0 +http://railroady.prestonlee.com Group - -Group - -id :integer -name :character varying(255) -created_at :timestamp without time zone -updated_at :timestamp without time zone -slug :character varying(255) + +Group + +id :integer +name :character varying(255) +created_at :timestamp without time zone +updated_at :timestamp without time zone +slug :character varying(255) Price @@ -44,9 +44,9 @@ Group->Price - - - + + + machines_prices @@ -63,9 +63,9 @@ Group->TrainingsPricing - - - + + + Plan @@ -90,9 +90,9 @@ Group->Plan - - - + + + User @@ -134,9 +134,9 @@ Group->User - - - + + + InvoiceItem @@ -155,9 +155,9 @@ InvoiceItem->InvoiceItem - - - + + + AvailabilityTag @@ -172,8 +172,8 @@ OpenAPI - -OpenAPI + +OpenAPI TrainingImage @@ -190,15 +190,15 @@ OpenAPI::Client - -OpenAPI::Client - -id :integer -name :character varying -calls_count :integer -token :character varying -created_at :timestamp without time zone -updated_at :timestamp without time zone + +OpenAPI::Client + +id :integer +name :character varying +calls_count :integer +token :character varying +created_at :timestamp without time zone +updated_at :timestamp without time zone OpenAPI::CallsCountTracing @@ -214,16 +214,16 @@ OpenAPI::Client->OpenAPI::CallsCountTracing - - - + + + OpenAPI::ParameterError - -OpenAPI::ParameterError - - + +OpenAPI::ParameterError + + UserAvatar @@ -253,25 +253,25 @@ Tag - -Tag - -id :integer -name :character varying -created_at :timestamp without time zone -updated_at :timestamp without time zone + +Tag + +id :integer +name :character varying +created_at :timestamp without time zone +updated_at :timestamp without time zone Tag->AvailabilityTag - - - + + + Tag->User - - - + + + Availability @@ -289,9 +289,9 @@ Tag->Availability - - - + + + UserTag @@ -306,9 +306,9 @@ Tag->UserTag - - - + + + Event @@ -341,9 +341,9 @@ Event->PriceCategory - - - + + + EventTheme @@ -358,9 +358,9 @@ Event->EventTheme - - - + + + EventImage @@ -377,9 +377,9 @@ Event->EventImage - - - + + + Reservation @@ -398,9 +398,9 @@ Event->Reservation - - - + + + EventPriceCategory @@ -416,9 +416,9 @@ Event->EventPriceCategory - - - + + + EventFile @@ -435,20 +435,20 @@ Event->EventFile - - - + + + StatisticSubType - -StatisticSubType - -id :integer -key :character varying(255) -label :character varying(255) -created_at :timestamp without time zone -updated_at :timestamp without time zone + +StatisticSubType + +id :integer +key :character varying(255) +label :character varying(255) +created_at :timestamp without time zone +updated_at :timestamp without time zone StatisticType @@ -466,9 +466,9 @@ StatisticSubType->StatisticType - - - + + + StatisticTypeSubType @@ -483,9 +483,9 @@ StatisticSubType->StatisticTypeSubType - - - + + + Project @@ -506,15 +506,15 @@ Project->ProjectImage - - - + + + Project->User - - - + + + Theme @@ -526,9 +526,9 @@ Project->Theme - - - + + + ProjectCao @@ -545,9 +545,9 @@ Project->ProjectCao - - - + + + ProjectStep @@ -564,9 +564,9 @@ Project->ProjectStep - - - + + + ProjectUser @@ -583,9 +583,9 @@ Project->ProjectUser - - - + + + Machine @@ -602,9 +602,9 @@ Project->Machine - - - + + + Component @@ -616,19 +616,19 @@ Project->Component - - - + + + CustomAsset - -CustomAsset - -id :integer -name :character varying -created_at :timestamp without time zone -updated_at :timestamp without time zone + +CustomAsset + +id :integer +name :character varying +created_at :timestamp without time zone +updated_at :timestamp without time zone CustomAssetFile @@ -645,9 +645,9 @@ CustomAsset->CustomAssetFile - - - + + + AgeRange @@ -662,9 +662,9 @@ AgeRange->Event - - - + + + Wallet @@ -694,64 +694,64 @@ Wallet->WalletTransaction - - - + + + Stats::Event - -Stats::Event - - + +Stats::Event + + Stats::Project - -Stats::Project - - + +Stats::Project + + Stats::User - -Stats::User - - + +Stats::User + + Stats::Subscription - -Stats::Subscription - - + +Stats::Subscription + + Stats::Training - -Stats::Training - - + +Stats::Training + + Stats::Account - -Stats::Account - - + +Stats::Account + + Stats::Machine - -Stats::Machine - - + +Stats::Machine + + PriceCategory->EventPriceCategory - - - + + + Invoice @@ -779,15 +779,15 @@ Invoice->InvoiceItem - - - + + + Invoice->Invoice - - - + + + avoir @@ -817,9 +817,9 @@ OfferDay->Invoice - - - + + + StatisticIndex @@ -836,15 +836,15 @@ StatisticType->StatisticIndex - - - + + + StatisticType->StatisticTypeSubType - - - + + + StatisticCustomAggregation @@ -862,9 +862,9 @@ StatisticType->StatisticCustomAggregation - - - + + + Address @@ -885,15 +885,15 @@ Plan->Price - - - + + + Plan->PlanFile - - - + + + Credit @@ -910,22 +910,22 @@ Plan->Credit - - - + + + Plan->Credit - - - + + + training_credits Plan->Credit - - - + + + machine_credits @@ -944,9 +944,9 @@ Plan->Subscription - - - + + + PlanImage @@ -963,9 +963,9 @@ Plan->PlanImage - - - + + + MachineFile @@ -993,9 +993,9 @@ Organization->Address - - - + + + StatisticGraph @@ -1036,47 +1036,47 @@ Licence->Project - - - + + + User->Project - - - + + + my_projects User->Wallet - - - + + + User->Invoice - - - + + + User->Credit - - - + + + User->Credit - - - + + + training_credits User->Credit - - - + + + machine_credits @@ -1093,9 +1093,9 @@ User->Role - - - + + + Notification @@ -1116,15 +1116,15 @@ User->Notification - - - + + + User->Subscription - - - + + + Training @@ -1142,15 +1142,15 @@ User->Training - - - + + + User->Reservation - - - + + + UsersCredit @@ -1166,15 +1166,15 @@ User->UsersCredit - - - + + + User->UserTag - - - + + + Export @@ -1192,9 +1192,9 @@ User->Export - - - + + + UserTraining @@ -1209,15 +1209,15 @@ User->UserTraining - - - + + + User->ProjectUser - - - + + + Profile @@ -1254,9 +1254,9 @@ User->Profile - - - + + + ProjectStepImage @@ -1273,9 +1273,9 @@ Credit->UsersCredit - - - + + + PartnerPlan @@ -1300,74 +1300,75 @@ PartnerPlan->Price - - - + + + PartnerPlan->PlanFile - - - + + + PartnerPlan->Credit - - - + + + PartnerPlan->Credit - - - + + + training_credits PartnerPlan->Credit - - - + + + machine_credits PartnerPlan->Role - - - + + + PartnerPlan->Subscription - - - + + + PartnerPlan->PlanImage - - - + + + OAuth2Provider - -OAuth2Provider - -id :integer -base_url :character varying -token_endpoint :character varying -authorization_endpoint :character varying -client_id :character varying -client_secret :character varying -created_at :timestamp without time zone -updated_at :timestamp without time zone -profile_url :character varying + +OAuth2Provider + +id :integer +base_url :character varying +token_endpoint :character varying +authorization_endpoint :character varying +client_id :character varying +client_secret :character varying +created_at :timestamp without time zone +updated_at :timestamp without time zone +profile_url :character varying +logout_endpoint :character varying OAuth2Provider->OAuth2Mapping - - - + + + AuthProvider @@ -1384,66 +1385,66 @@ OAuth2Provider->AuthProvider - - - + + + Asset - -Asset - -id :integer -viewable_id :integer -viewable_type :character varying(255) -attachment :character varying(255) -type :character varying(255) -created_at :timestamp without time zone -updated_at :timestamp without time zone + +Asset + +id :integer +viewable_id :integer +viewable_type :character varying(255) +attachment :character varying(255) +type :character varying(255) +created_at :timestamp without time zone +updated_at :timestamp without time zone Project::OpenlabSync - -Project::OpenlabSync + +Project::OpenlabSync DatabaseProvider - -DatabaseProvider - -id :integer -created_at :timestamp without time zone -updated_at :timestamp without time zone + +DatabaseProvider + +id :integer +created_at :timestamp without time zone +updated_at :timestamp without time zone DatabaseProvider->AuthProvider - - - + + + Availability->AvailabilityTag - - - + + + Availability->Event - - - + + + Availability->Training - - - + + + Availability->Reservation - - - + + + Slot @@ -1464,9 +1465,9 @@ Availability->Slot - - - + + + MachinesAvailability @@ -1479,9 +1480,9 @@ Availability->MachinesAvailability - - - + + + TrainingsAvailability @@ -1496,93 +1497,93 @@ Availability->TrainingsAvailability - - - + + + Availability->Machine - - - + + + Subscription->Invoice - - - + + + Subscription->OfferDay - - - + + + Training->TrainingImage - - - + + + Training->TrainingsPricing - - - + + + Training->Plan - - - + + + Training->Credit - - - + + + Training->Reservation - - - + + + Training->UserTraining - - - + + + Training->TrainingsAvailability - - - + + + Training->Machine - - - + + + ProjectStep->ProjectStepImage - - - + + + Reservation->Invoice - - - + + + Reservation->Slot - - - + + + Ticket @@ -1598,21 +1599,21 @@ Reservation->Ticket - - - + + + StatisticIndex->StatisticType - - - + + + StatisticIndex->StatisticGraph - - - + + + StatisticField @@ -1629,27 +1630,27 @@ StatisticIndex->StatisticField - - - + + + StatisticField->StatisticIndex - - - + + + WalletTransaction->Invoice - - - + + + EventPriceCategory->Ticket - - - + + + Avoir @@ -1677,33 +1678,33 @@ Avoir->InvoiceItem - - - + + + Avoir->Invoice - - - + + + avoir NotificationType - -NotificationType - - + +NotificationType + + Stylesheet - -Stylesheet - -id :integer -contents :text -created_at :timestamp without time zone -updated_at :timestamp without time zone + +Stylesheet + +id :integer +contents :text +created_at :timestamp without time zone +updated_at :timestamp without time zone Coupon @@ -1723,9 +1724,9 @@ Coupon->Invoice - - - + + + Category @@ -1740,9 +1741,9 @@ Category->Event - - - + + + MachineImage @@ -1759,96 +1760,96 @@ Feed - -Feed - - + +Feed + + Machine->Price - - - + + + Machine->Plan - - - + + + Machine->MachineFile - - - + + + Machine->Credit - - - + + + Machine->Reservation - - - + + + Machine->MachinesAvailability - - - + + + Machine->MachineImage - - - + + + Abuse - -Abuse - -id :integer -signaled_id :integer -signaled_type :character varying -first_name :character varying -last_name :character varying -email :character varying -message :text -created_at :timestamp without time zone -updated_at :timestamp without time zone + +Abuse + +id :integer +signaled_id :integer +signaled_type :character varying +first_name :character varying +last_name :character varying +email :character varying +message :text +created_at :timestamp without time zone +updated_at :timestamp without time zone Profile->UserAvatar - - - + + + Profile->Address - - - + + + Profile->Organization - - - + + + Setting - -Setting - -id :integer -name :character varying -value :text -created_at :timestamp without time zone -updated_at :timestamp without time zone + +Setting + +id :integer +name :character varying +value :text +created_at :timestamp without time zone +updated_at :timestamp without time zone