mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-22 11:52:21 +01:00
Merge branch 'family_compte_pre_inscription' into staging
This commit is contained in:
commit
7a37175056
@ -23,11 +23,10 @@ class Reservation < ApplicationRecord
|
||||
|
||||
has_many :prepaid_pack_reservations, dependent: :destroy
|
||||
|
||||
belongs_to :reservation_context
|
||||
has_many :booking_users, dependent: :destroy
|
||||
accepts_nested_attributes_for :booking_users, allow_destroy: true
|
||||
|
||||
belongs_to :reservation_context
|
||||
|
||||
validates :reservable_id, :reservable_type, presence: true
|
||||
validate :machine_not_already_reserved, if: -> { reservable.is_a?(Machine) }
|
||||
validate :training_not_fully_reserved, if: -> { reservable.is_a?(Training) }
|
||||
|
@ -47,7 +47,7 @@ class SettingPolicy < ApplicationPolicy
|
||||
machines_banner_cta_url trainings_banner_active trainings_banner_text trainings_banner_cta_active trainings_banner_cta_label
|
||||
trainings_banner_cta_url events_banner_active events_banner_text events_banner_cta_active events_banner_cta_label
|
||||
events_banner_cta_url projects_list_member_filter_presence projects_list_date_filters_presence advanced_accounting
|
||||
project_categories_filter_placeholder project_categories_wording family_account child_validation_required reservation_context_feature]
|
||||
project_categories_filter_placeholder project_categories_wording reservation_context_feature family_account child_validation_required]
|
||||
end
|
||||
|
||||
##
|
||||
|
@ -8,7 +8,7 @@ class SupportingDocumentsReminderWorker
|
||||
users_to_notify = User.members
|
||||
.supporting_documents_reminder_not_sent
|
||||
.where("users.created_at < ?", 2.days.ago)
|
||||
.left_outer_joins(supporting_document_files: { supporting_document_type: :groups })
|
||||
.joins("LEFT OUTER JOIN supporting_document_files ON supporting_document_files.supportable_id = users.id AND supporting_document_files.supportable_type = 'User' LEFT OUTER JOIN supporting_document_types ON supporting_document_types.id = supporting_document_files.supporting_document_type_id LEFT OUTER JOIN supporting_document_types_groups ON supporting_document_types_groups.supporting_document_type_id = supporting_document_types.id LEFT OUTER JOIN groups ON groups.id = supporting_document_types_groups.group_id")
|
||||
.where("groups.id = users.group_id OR groups.id IS NULL")
|
||||
.select("users.*, count(supporting_document_files.id)")
|
||||
.group("users.id")
|
||||
|
@ -77,5 +77,24 @@ NOTIFICATIONS_TYPES = [
|
||||
{ name: 'notify_admin_low_stock_threshold', category: 'shop', is_configurable: true, roles: ['admin', 'manager'] },
|
||||
{ name: 'notify_admin_training_auto_cancelled', category: 'trainings', is_configurable: true, roles: ['admin', 'manager'] },
|
||||
{ name: 'notify_member_training_auto_cancelled', category: 'trainings', is_configurable: false },
|
||||
{ name: 'notify_user_supporting_document_reminder', category: 'supporting_documents', is_configurable: false }
|
||||
{ name: 'notify_user_supporting_document_reminder', category: 'supporting_documents', is_configurable: false },
|
||||
|
||||
{ name: 'notify_member_training_authorization_expired', category: 'trainings', is_configurable: false },
|
||||
{ name: 'notify_member_training_invalidated', category: 'trainings', is_configurable: false },
|
||||
{ name: 'notify_member_reservation_limit_reached', category: 'agenda', is_configurable: false },
|
||||
{ name: 'notify_admin_user_child_supporting_document_refusal', category: 'supporting_documents', is_configurable: true, roles: ['admin', 'manager'] },
|
||||
{ name: 'notify_user_child_supporting_document_refusal', category: 'supporting_documents', is_configurable: false },
|
||||
{ name: 'notify_admin_child_created', category: 'users_accounts', is_configurable: true, roles: ['admin', 'manager'] },
|
||||
{ name: 'notify_user_child_is_validated', category: 'users_accounts', is_configurable: false },
|
||||
{ name: 'notify_user_child_is_invalidated', category: 'users_accounts', is_configurable: false },
|
||||
{ name: 'notify_admin_user_child_supporting_document_files_updated', category: 'supporting_documents', is_configurable: true, roles: ['admin', 'manager'] },
|
||||
{ name: 'notify_admin_user_child_supporting_document_files_created', category: 'supporting_documents', is_configurable: true, roles: ['admin', 'manager'] },
|
||||
|
||||
{ name: 'notify_member_reservation_validated', category: 'agenda', is_configurable: false },
|
||||
{ name: 'notify_admin_reservation_validated', category: 'agenda', is_configurable: true, roles: ['admin', 'manager'] },
|
||||
{ name: 'notify_member_pre_booked_reservation', category: 'agenda', is_configurable: false },
|
||||
{ name: 'notify_admin_member_pre_booked_reservation', category: 'agenda', is_configurable: true, roles: ['admin', 'manager'] },
|
||||
{ name: 'notify_member_reservation_invalidated', category: 'agenda', is_configurable: false },
|
||||
{ name: 'notify_admin_reservation_invalidated', category: 'agenda', is_configurable: true, roles: ['admin', 'manager'] },
|
||||
{ name: 'notify_user_when_child_age_will_be_18', category: 'users_accounts', is_configurable: false }
|
||||
].freeze
|
||||
|
@ -1857,11 +1857,6 @@ en:
|
||||
projects_list_date_filters_presence: "Presence of date filters on projects list"
|
||||
project_categories_filter_placeholder: "Placeholder for categories filter in project gallery"
|
||||
project_categories_wording: "Wording used to replace \"Categories\" on public pages"
|
||||
family_account: "family account"
|
||||
family_account_info_html: "The Family account allows your members to add their children under 18 years old to their own account and directly register them for Family events. You can also request supporting documents for each child and validate their account."
|
||||
enable_family_account: "Enable the Family Account option"
|
||||
child_validation_required: "the account validation option for children"
|
||||
child_validation_required_label: "Activate the account validation option for children"
|
||||
reservation_context_feature_title: Reservation context
|
||||
reservation_context_feature_info: "If you enable this feature, members will have to enter the context of their reservation when reserving."
|
||||
reservation_context_feature: "Enable the feature \"Reservation context\""
|
||||
@ -1871,6 +1866,11 @@ en:
|
||||
do_you_really_want_to_delete_this_reservation_context: "Do you really want to delete this context?"
|
||||
unable_to_delete_reservation_context_already_related_to_reservations: "Unable to delete this context because it is already associated to a reservation"
|
||||
unable_to_delete_reservation_context_an_error_occured: "Unable to delete: an error occurred"
|
||||
family_account: "family account"
|
||||
family_account_info_html: "The Family account allows your members to add their children under 18 years old to their own account and directly register them for Family events. You can also request supporting documents for each child and validate their account."
|
||||
enable_family_account: "Enable the Family Account option"
|
||||
child_validation_required: "the account validation option for children"
|
||||
child_validation_required_label: "Activate the account validation option for children"
|
||||
overlapping_options:
|
||||
training_reservations: "Trainings"
|
||||
machine_reservations: "Machines"
|
||||
|
@ -1849,11 +1849,6 @@ fr:
|
||||
projects_list_date_filters_presence: "Permettre la recherche de projets par dates"
|
||||
project_categories_filter_placeholder: "Dans la galerie de projets, renommer le filtre \"Toutes les catégories\""
|
||||
project_categories_wording: "Dans la fiche projet, renommer l'intitulé de l'encart Catégories"
|
||||
family_account: "Compte famille"
|
||||
family_account_info_html: "Le compte Famille permet à vos membres d'ajouter leurs enfants de moins de 18 ans sur leur propre compte et de les inscrire directement aux évènements de type Famille. Vous pouvez aussi demander des justificatifs pour chaque enfant et valider leur compte."
|
||||
enable_family_account: "Activer l'option Compte Famille"
|
||||
child_validation_required: "l'option de validation des comptes enfants"
|
||||
child_validation_required_label: "Activer l'option de validation des comptes enfants"
|
||||
reservation_context_feature_title: Nature de la réservation
|
||||
reservation_context_feature_info: "Si vous activez cette fonctionnalité, les membres devront entrer la nature de leur réservation lors de la réservation."
|
||||
reservation_context_feature: "Activer la fonctionnalité \"Nature de réservation\""
|
||||
@ -1862,6 +1857,15 @@ fr:
|
||||
do_you_really_want_to_delete_this_reservation_context: "Êtes-vous sûr de vouloir supprimer cette nature ?"
|
||||
unable_to_delete_reservation_context_already_related_to_reservations: "Impossible de supprimer ce contexte car il est déjà associé à une réservation"
|
||||
unable_to_delete_reservation_context_an_error_occured: "Impossible de supprimer : une erreur est survenue"
|
||||
projects_list_member_filter_presence: "Presence of member filter on projects list"
|
||||
projects_list_date_filters_presence: "Presence of date filters on projects list"
|
||||
project_categories_filter_placeholder: "Placeholder for categories filter in project gallery"
|
||||
project_categories_wording: "Wording used to replace \"Categories\" on public pages"
|
||||
family_account: "Compte famille"
|
||||
family_account_info_html: "Le compte Famille permet à vos membres d'ajouter leurs enfants de moins de 18 ans sur leur propre compte et de les inscrire directement aux évènements de type Famille. Vous pouvez aussi demander des justificatifs pour chaque enfant et valider leur compte."
|
||||
enable_family_account: "Activer l'option Compte Famille"
|
||||
child_validation_required: "l'option de validation des comptes enfants"
|
||||
child_validation_required_label: "Activer l'option de validation des comptes enfants"
|
||||
overlapping_options:
|
||||
training_reservations: "Formations"
|
||||
machine_reservations: "Machines"
|
||||
|
@ -371,13 +371,12 @@ en:
|
||||
slot_tags: "Slot tags"
|
||||
user_tags: "User tags"
|
||||
no_tags: "No tags"
|
||||
user_validation_required_alert: "Your administrator must validate your account. Then, you'll then be able to access all the booking features."
|
||||
child_validation_required_alert: "Your administrator must validate your child account. Then, you'll then be able to book the event."
|
||||
child_birthday_must_be_under_18_years_ago_alert: "Your child must be under 18. Then, you'll then be able to book the event."
|
||||
user_validation_required_alert: "Warning!<br>Your administrator must validate your account. Then, you'll then be able to access all the booking features."
|
||||
select_the_reservation_context: "Select the context of the reservation"
|
||||
please_select_a_reservation_context: "Please select the context of the reservation first"
|
||||
#feature-tour modal
|
||||
child_validation_required_alert: "Your administrator must validate your child account. Then, you'll then be able to book the event."
|
||||
child_birthday_must_be_under_18_years_ago_alert: "Your child must be under 18. Then, you'll then be able to book the event."
|
||||
# feature-tour modal
|
||||
tour:
|
||||
previous: "Previous"
|
||||
next: "Next"
|
||||
|
@ -372,10 +372,10 @@ fr:
|
||||
user_tags: "Étiquettes de l'utilisateur"
|
||||
no_tags: "Aucune étiquette"
|
||||
user_validation_required_alert: "Attention !<br>Votre administrateur doit valider votre compte. Vous pourrez alors accéder à l'ensemble des fonctionnalités de réservation."
|
||||
select_the_reservation_context: "Sélectionnez la nature de la réservation"
|
||||
please_select_a_reservation_context: "Veuillez d'abord sélectionner la nature de la réservation"
|
||||
child_validation_required_alert: "Attention !<br>Votre administrateur doit valider votre compte enfant. Vous pourrez alors réserver l'événement."
|
||||
child_birthday_must_be_under_18_years_ago_alert: "Attention !<br>La date de naissance de l'enfant doit être inférieure à 18 ans. Vous pourrez alors réserver l'événement."
|
||||
select_the_reservation_context: Sélectionnez la nature de la réservation
|
||||
please_select_a_reservation_context: "Veuillez tout d'abord sélectionner la nature de la réservation"
|
||||
#feature-tour modal
|
||||
tour:
|
||||
previous: "Précédent"
|
||||
|
@ -740,8 +740,8 @@ en:
|
||||
projects_list_date_filters_presence: "Presence of dates filter on projects list"
|
||||
project_categories_filter_placeholder: "Placeholder for categories filter in project gallery"
|
||||
project_categories_wording: "Wording used to replace \"Categories\" on public pages"
|
||||
family_account: "Family account"
|
||||
reservation_context_feature: "Force member to select the nature of his reservation when reserving"
|
||||
family_account: "Family account"
|
||||
#statuses of projects
|
||||
statuses:
|
||||
new: "New"
|
||||
|
@ -733,7 +733,8 @@ Setting.set('projects_list_member_filter_presence', false) unless Setting.find_b
|
||||
Setting.set('projects_list_date_filters_presence', false) unless Setting.find_by(name: 'projects_list_date_filters_presence')
|
||||
Setting.set('project_categories_filter_placeholder', 'Toutes les catégories') unless Setting.find_by(name: 'project_categories_filter_placeholder').try(:value)
|
||||
Setting.set('project_categories_wording', 'Catégories') unless Setting.find_by(name: 'project_categories_wording').try(:value)
|
||||
Setting.set('family_account', false) unless Setting.find_by(name: 'family_account').try(:value)
|
||||
Setting.set('child_validation_required', false) unless Setting.find_by(name: 'child_validation_required').try(:value)
|
||||
|
||||
Setting.set('reservation_context_feature', false) unless Setting.find_by(name: 'reservation_context_feature')
|
||||
|
||||
Setting.set('family_account', false) unless Setting.find_by(name: 'family_account').try(:value)
|
||||
Setting.set('child_validation_required', false) unless Setting.find_by(name: 'child_validation_required').try(:value)
|
||||
|
8
test/fixtures/history_values.yml
vendored
8
test/fixtures/history_values.yml
vendored
@ -898,3 +898,11 @@ history_value_106:
|
||||
created_at: '2023-03-31 14:38:40.000421'
|
||||
updated_at: '2023-03-31 14:38:40.000421'
|
||||
invoicing_profile_id: 1
|
||||
|
||||
history_value_107:
|
||||
id: 107
|
||||
setting_id: 106
|
||||
value: 'false'
|
||||
created_at: '2023-03-31 14:38:40.000421'
|
||||
updated_at: '2023-03-31 14:38:40.000421'
|
||||
invoicing_profile_id: 1
|
||||
|
14
test/fixtures/settings.yml
vendored
14
test/fixtures/settings.yml
vendored
@ -613,18 +613,18 @@ setting_103:
|
||||
|
||||
setting_104:
|
||||
id: 104
|
||||
name: family_account
|
||||
created_at: 2023-03-31 14:38:40.000421500 Z
|
||||
updated_at: 2023-03-31 14:38:40.000421500 Z
|
||||
name: reservation_context_feature
|
||||
created_at: 2023-04-05 09:16:08.000511500 Z
|
||||
updated_at: 2023-04-05 09:16:08.000511500 Z
|
||||
|
||||
setting_105:
|
||||
id: 105
|
||||
name: child_validation_required
|
||||
name: family_account
|
||||
created_at: 2023-03-31 14:38:40.000421500 Z
|
||||
updated_at: 2023-03-31 14:38:40.000421500 Z
|
||||
|
||||
setting_106:
|
||||
id: 106
|
||||
name: reservation_context_feature
|
||||
created_at: 2023-04-05 09:16:08.000511500 Z
|
||||
updated_at: 2023-04-05 09:16:08.000511500 Z
|
||||
name: child_validation_required
|
||||
created_at: 2023-03-31 14:38:40.000421500 Z
|
||||
updated_at: 2023-03-31 14:38:40.000421500 Z
|
||||
|
@ -850,17 +850,17 @@ export const settings: Array<Setting> = [
|
||||
last_update: '2022-12-23T14:39:12+0100',
|
||||
localized: 'Project categories overridden name'
|
||||
},
|
||||
{
|
||||
name: 'family_account',
|
||||
value: 'false',
|
||||
last_update: '2023-03-31T14:39:12+0100',
|
||||
localized: 'Family account'
|
||||
},
|
||||
{
|
||||
name: 'reservation_context_feature',
|
||||
value: 'false',
|
||||
last_update: '2022-12-23T14:39:12+0100',
|
||||
localized: 'Reservation context feature'
|
||||
},
|
||||
{
|
||||
name: 'family_account',
|
||||
value: 'false',
|
||||
last_update: '2023-03-31T14:39:12+0100',
|
||||
localized: 'Family account'
|
||||
}
|
||||
];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user