diff --git a/backend/app/DomainObjects/Enums/EventCategory.php b/backend/app/DomainObjects/Enums/EventCategory.php index 680f8d70a1..6834db8f9e 100644 --- a/backend/app/DomainObjects/Enums/EventCategory.php +++ b/backend/app/DomainObjects/Enums/EventCategory.php @@ -70,6 +70,17 @@ public function label(): string }; } + public function terminology(): ProductTerminology + { + return match ($this) { + self::WELLNESS, self::SPIRITUALITY, self::DANCE => ProductTerminology::CLASSES, + self::WORKSHOP, self::EDUCATION => ProductTerminology::REGISTRATIONS, + self::TOURS => ProductTerminology::BOOKINGS, + self::BUSINESS, self::TECH => ProductTerminology::PASSES, + default => ProductTerminology::TICKETS, + }; + } + public function emoji(): string { return match ($this) { diff --git a/backend/app/DomainObjects/Enums/ProductTerminology.php b/backend/app/DomainObjects/Enums/ProductTerminology.php new file mode 100644 index 0000000000..5d8094dd01 --- /dev/null +++ b/backend/app/DomainObjects/Enums/ProductTerminology.php @@ -0,0 +1,60 @@ +terminology() ?? self::TICKETS; + } + + public function defaultProductCategoryName(): string + { + return match ($this) { + self::TICKETS, self::BOOKINGS => __('Tickets'), + self::CLASSES => __('Classes'), + self::REGISTRATIONS => __('Registration'), + self::PASSES => __('Passes'), + }; + } + + public function defaultNoProductsMessage(): string + { + return match ($this) { + self::TICKETS, self::BOOKINGS => __('There are no tickets available for this event'), + self::CLASSES => __('There are no classes available for this event'), + self::REGISTRATIONS => __('Registration is not open for this event'), + self::PASSES => __('There are no passes available for this event'), + }; + } + + public function defaultContinueButtonText(): string + { + return match ($this) { + self::TICKETS => __('Continue'), + self::CLASSES, self::BOOKINGS => __('Book Now'), + self::REGISTRATIONS, self::PASSES => __('Register'), + }; + } + + public function defaultGetTicketsButtonText(): ?string + { + return match ($this) { + self::TICKETS => null, + self::CLASSES, self::BOOKINGS => __('Book Now'), + self::REGISTRATIONS => __('Register'), + self::PASSES => __('Get Passes'), + }; + } +} diff --git a/backend/app/Services/Domain/Event/CreateEventService.php b/backend/app/Services/Domain/Event/CreateEventService.php index ceacf58b43..2996990a1d 100644 --- a/backend/app/Services/Domain/Event/CreateEventService.php +++ b/backend/app/Services/Domain/Event/CreateEventService.php @@ -7,6 +7,7 @@ use HiEvents\DomainObjects\Enums\HomepageBackgroundType; use HiEvents\DomainObjects\Enums\ImageType; use HiEvents\DomainObjects\Enums\PaymentProviders; +use HiEvents\DomainObjects\Enums\ProductTerminology; use HiEvents\DomainObjects\EventDomainObject; use HiEvents\DomainObjects\EventSettingDomainObject; use HiEvents\DomainObjects\OrganizerDomainObject; @@ -207,6 +208,7 @@ private function createEventSettings( $organizerSettings = $organizer->getOrganizerSettings(); $organizerThemeSettings = $organizerSettings->getHomepageThemeSettings() ?? []; + $terminology = ProductTerminology::forCategory($event->getCategory()); // Build the new homepage_theme_settings from organizer settings $homepageThemeSettings = [ @@ -237,7 +239,8 @@ private function createEventSettings( 'homepage_secondary_text_color' => '#ffffff', 'homepage_secondary_color' => $homepageThemeSettings['accent'], - 'continue_button_text' => __('Continue'), + 'continue_button_text' => $terminology->defaultContinueButtonText(), + 'get_tickets_button_text' => $terminology->defaultGetTicketsButtonText(), 'support_email' => $organizer->getEmail(), 'payment_providers' => [PaymentProviders::STRIPE->value], diff --git a/backend/app/Services/Domain/Organizer/CreateDefaultOrganizerSettingsService.php b/backend/app/Services/Domain/Organizer/CreateDefaultOrganizerSettingsService.php index 1e1d7af806..361b0365d3 100644 --- a/backend/app/Services/Domain/Organizer/CreateDefaultOrganizerSettingsService.php +++ b/backend/app/Services/Domain/Organizer/CreateDefaultOrganizerSettingsService.php @@ -2,6 +2,7 @@ namespace HiEvents\Services\Domain\Organizer; +use HiEvents\DomainObjects\Enums\AttendeeDetailsCollectionMethod; use HiEvents\DomainObjects\Enums\ColorTheme; use HiEvents\DomainObjects\Enums\OrganizerHomepageVisibility; use HiEvents\DomainObjects\OrganizerDomainObject; @@ -21,12 +22,9 @@ public function createOrganizerSettings(OrganizerDomainObject $organizer): void $this->organizerSettingsRepository->create([ 'organizer_id' => $organizer->getId(), 'homepage_visibility' => OrganizerHomepageVisibility::PUBLIC->name, - - // Use the "Modern" theme as default 'homepage_theme_settings' => $defaultTheme->getThemeData(), - - // Platform fee pass-through default from config - 'default_pass_platform_fee_to_buyer' => config('app.saas_default_pass_platform_fee_to_buyer', false), + 'default_attendee_details_collection_method' => AttendeeDetailsCollectionMethod::PER_ORDER->name, + 'default_pass_platform_fee_to_buyer' => config('app.saas_default_pass_platform_fee_to_buyer', true), ]); } } diff --git a/backend/app/Services/Domain/ProductCategory/CreateProductCategoryService.php b/backend/app/Services/Domain/ProductCategory/CreateProductCategoryService.php index d186e63a40..01363c8a4f 100644 --- a/backend/app/Services/Domain/ProductCategory/CreateProductCategoryService.php +++ b/backend/app/Services/Domain/ProductCategory/CreateProductCategoryService.php @@ -2,6 +2,7 @@ namespace HiEvents\Services\Domain\ProductCategory; +use HiEvents\DomainObjects\Enums\ProductTerminology; use HiEvents\DomainObjects\EventDomainObject; use HiEvents\DomainObjects\ProductCategoryDomainObject; use HiEvents\Repository\Interfaces\ProductCategoryRepositoryInterface; @@ -19,11 +20,13 @@ public function createCategory(ProductCategoryDomainObject $productCategoryDomai public function createDefaultProductCategory(EventDomainObject $event): void { + $terminology = ProductTerminology::forCategory($event->getCategory()); + $this->createCategory((new ProductCategoryDomainObject) ->setEventId($event->getId()) - ->setName(__('Tickets')) + ->setName($terminology->defaultProductCategoryName()) ->setIsHidden(false) - ->setNoProductsMessage(__('There are no tickets available for this event')) + ->setNoProductsMessage($terminology->defaultNoProductsMessage()) ); } } diff --git a/backend/config/app.php b/backend/config/app.php index 3f6a7de149..3cb0ad6e96 100644 --- a/backend/config/app.php +++ b/backend/config/app.php @@ -22,7 +22,7 @@ 'saas_mode_enabled' => env('APP_SAAS_MODE_ENABLED', false), 'saas_stripe_application_fee_percent' => env('APP_SAAS_STRIPE_APPLICATION_FEE_PERCENT', 1.5), 'saas_stripe_application_fee_fixed' => env('APP_SAAS_STRIPE_APPLICATION_FEE_FIXED', 0), - 'saas_default_pass_platform_fee_to_buyer' => env('APP_SAAS_DEFAULT_PASS_PLATFORM_FEE_TO_BUYER', false), + 'saas_default_pass_platform_fee_to_buyer' => env('APP_SAAS_DEFAULT_PASS_PLATFORM_FEE_TO_BUYER', true), 'disable_registration' => env('APP_DISABLE_REGISTRATION', false), 'api_rate_limit_per_minute' => env('APP_API_RATE_LIMIT_PER_MINUTE', 180), 'stripe_connect_account_type' => env('APP_STRIPE_CONNECT_ACCOUNT_TYPE', 'express'), diff --git a/backend/lang/de.json b/backend/lang/de.json index e877005a54..6ec74e627e 100644 --- a/backend/lang/de.json +++ b/backend/lang/de.json @@ -690,5 +690,14 @@ "Your :appName account has been permanently deleted.": "Ihr :appName-Konto wurde endgültig gelöscht.", "All personal information has been removed. Anonymized transaction records (amounts, dates, and invoice details) have been retained as required for legal and tax purposes.": "Alle personenbezogenen Daten wurden entfernt. Anonymisierte Transaktionsdaten (Beträge, Daten und Rechnungsdetails) wurden gemäß rechtlichen und steuerlichen Anforderungen aufbewahrt.", "All of your account data has been permanently removed.": "Alle Ihre Kontodaten wurden dauerhaft entfernt.", - "Thank you for using :appName. You are welcome back at any time.": "Vielen Dank, dass Sie :appName genutzt haben. Sie sind jederzeit wieder willkommen." + "Thank you for using :appName. You are welcome back at any time.": "Vielen Dank, dass Sie :appName genutzt haben. Sie sind jederzeit wieder willkommen.", + "Classes": "Kurse", + "There are no classes available for this event": "Für diese Veranstaltung sind keine Kurse verfügbar", + "Book Now": "Jetzt buchen", + "Registration": "Anmeldung", + "Registration is not open for this event": "Die Anmeldung für diese Veranstaltung ist nicht geöffnet", + "Register": "Anmelden", + "Passes": "Pässe", + "There are no passes available for this event": "Für diese Veranstaltung sind keine Pässe verfügbar", + "Get Passes": "Pässe sichern" } \ No newline at end of file diff --git a/backend/lang/el.json b/backend/lang/el.json index c926de8023..1ddadf749f 100644 --- a/backend/lang/el.json +++ b/backend/lang/el.json @@ -690,5 +690,14 @@ "Your :appName account has been permanently deleted.": "Ο λογαριασμός σας στο :appName διαγράφηκε οριστικά.", "All personal information has been removed. Anonymized transaction records (amounts, dates, and invoice details) have been retained as required for legal and tax purposes.": "Όλα τα προσωπικά δεδομένα έχουν διαγραφεί. Ανωνυμοποιημένα αρχεία συναλλαγών (ποσά, ημερομηνίες και στοιχεία τιμολογίων) έχουν διατηρηθεί όπως απαιτείται για νομικούς και φορολογικούς σκοπούς.", "All of your account data has been permanently removed.": "Όλα τα δεδομένα του λογαριασμού σας έχουν διαγραφεί οριστικά.", - "Thank you for using :appName. You are welcome back at any time.": "Ευχαριστούμε που χρησιμοποιήσατε το :appName. Είστε ευπρόσδεκτοι ξανά οποιαδήποτε στιγμή." + "Thank you for using :appName. You are welcome back at any time.": "Ευχαριστούμε που χρησιμοποιήσατε το :appName. Είστε ευπρόσδεκτοι ξανά οποιαδήποτε στιγμή.", + "Classes": "Μαθήματα", + "There are no classes available for this event": "Δεν υπάρχουν διαθέσιμα μαθήματα για αυτήν την εκδήλωση", + "Book Now": "Κράτηση τώρα", + "Registration": "Εγγραφή", + "Registration is not open for this event": "Οι εγγραφές για αυτήν την εκδήλωση δεν είναι ανοιχτές", + "Register": "Εγγραφή", + "Passes": "Πάσα", + "There are no passes available for this event": "Δεν υπάρχουν διαθέσιμα πάσα για αυτήν την εκδήλωση", + "Get Passes": "Αποκτήστε πάσα" } \ No newline at end of file diff --git a/backend/lang/es.json b/backend/lang/es.json index e021112208..c86fd5ad7d 100644 --- a/backend/lang/es.json +++ b/backend/lang/es.json @@ -735,5 +735,14 @@ "Your :appName account has been permanently deleted.": "Tu cuenta de :appName ha sido eliminada permanentemente.", "All personal information has been removed. Anonymized transaction records (amounts, dates, and invoice details) have been retained as required for legal and tax purposes.": "Toda la información personal ha sido eliminada. Los registros de transacciones anonimizados (importes, fechas y detalles de facturas) se han conservado según lo exigido por motivos legales y fiscales.", "All of your account data has been permanently removed.": "Todos los datos de tu cuenta han sido eliminados permanentemente.", - "Thank you for using :appName. You are welcome back at any time.": "Gracias por usar :appName. Eres bienvenido de nuevo en cualquier momento." + "Thank you for using :appName. You are welcome back at any time.": "Gracias por usar :appName. Eres bienvenido de nuevo en cualquier momento.", + "Classes": "Clases", + "There are no classes available for this event": "No hay clases disponibles para este evento", + "Book Now": "Reservar ahora", + "Registration": "Inscripción", + "Registration is not open for this event": "La inscripción para este evento no está abierta", + "Register": "Inscribirse", + "Passes": "Pases", + "There are no passes available for this event": "No hay pases disponibles para este evento", + "Get Passes": "Obtener pases" } \ No newline at end of file diff --git a/backend/lang/fr.json b/backend/lang/fr.json index ee23787422..af96866aeb 100644 --- a/backend/lang/fr.json +++ b/backend/lang/fr.json @@ -690,5 +690,14 @@ "Your :appName account has been permanently deleted.": "Votre compte :appName a été définitivement supprimé.", "All personal information has been removed. Anonymized transaction records (amounts, dates, and invoice details) have been retained as required for legal and tax purposes.": "Toutes les informations personnelles ont été supprimées. Des enregistrements de transactions anonymisés (montants, dates et détails de factures) ont été conservés conformément aux exigences légales et fiscales.", "All of your account data has been permanently removed.": "Toutes les données de votre compte ont été définitivement supprimées.", - "Thank you for using :appName. You are welcome back at any time.": "Merci d'avoir utilisé :appName. Vous êtes le bienvenu à tout moment." + "Thank you for using :appName. You are welcome back at any time.": "Merci d'avoir utilisé :appName. Vous êtes le bienvenu à tout moment.", + "Classes": "Cours", + "There are no classes available for this event": "Aucun cours disponible pour cet événement", + "Book Now": "Réserver maintenant", + "Registration": "Inscription", + "Registration is not open for this event": "Les inscriptions pour cet événement ne sont pas ouvertes", + "Register": "S'inscrire", + "Passes": "Pass", + "There are no passes available for this event": "Aucun pass disponible pour cet événement", + "Get Passes": "Obtenir un pass" } \ No newline at end of file diff --git a/backend/lang/hu.json b/backend/lang/hu.json index dc0f0a6bdc..f9057b5f44 100644 --- a/backend/lang/hu.json +++ b/backend/lang/hu.json @@ -690,5 +690,14 @@ "Your :appName account has been permanently deleted.": "Az Ön :appName fiókja véglegesen törölve lett.", "All personal information has been removed. Anonymized transaction records (amounts, dates, and invoice details) have been retained as required for legal and tax purposes.": "Minden személyes adat törlésre került. Az anonimizált tranzakciós adatok (összegek, dátumok és számlaadatok) jogi és adózási követelményeknek megfelelően megőrzésre kerültek.", "All of your account data has been permanently removed.": "Fiókjának minden adata véglegesen törlésre került.", - "Thank you for using :appName. You are welcome back at any time.": "Köszönjük, hogy a :appName szolgáltatást használta. Bármikor szívesen látjuk újra." + "Thank you for using :appName. You are welcome back at any time.": "Köszönjük, hogy a :appName szolgáltatást használta. Bármikor szívesen látjuk újra.", + "Classes": "Órák", + "There are no classes available for this event": "Ehhez az eseményhez nincsenek elérhető órák", + "Book Now": "Foglalás most", + "Registration": "Regisztráció", + "Registration is not open for this event": "A regisztráció nem elérhető ehhez az eseményhez", + "Register": "Regisztráció", + "Passes": "Belépők", + "There are no passes available for this event": "Ehhez az eseményhez nincsenek elérhető belépők", + "Get Passes": "Belépők vásárlása" } \ No newline at end of file diff --git a/backend/lang/it.json b/backend/lang/it.json index 8a114f7f39..4dc74ebf01 100644 --- a/backend/lang/it.json +++ b/backend/lang/it.json @@ -691,5 +691,14 @@ "Your :appName account has been permanently deleted.": "Il tuo account :appName è stato eliminato in modo permanente.", "All personal information has been removed. Anonymized transaction records (amounts, dates, and invoice details) have been retained as required for legal and tax purposes.": "Tutte le informazioni personali sono state rimosse. I record delle transazioni anonimizzati (importi, date e dettagli delle fatture) sono stati conservati come richiesto per scopi legali e fiscali.", "All of your account data has been permanently removed.": "Tutti i dati del tuo account sono stati rimossi in modo permanente.", - "Thank you for using :appName. You are welcome back at any time.": "Grazie per aver usato :appName. Sarai sempre il benvenuto." + "Thank you for using :appName. You are welcome back at any time.": "Grazie per aver usato :appName. Sarai sempre il benvenuto.", + "Classes": "Lezioni", + "There are no classes available for this event": "Non ci sono lezioni disponibili per questo evento", + "Book Now": "Prenota ora", + "Registration": "Iscrizione", + "Registration is not open for this event": "Le iscrizioni per questo evento non sono aperte", + "Register": "Iscriviti", + "Passes": "Pass", + "There are no passes available for this event": "Non ci sono pass disponibili per questo evento", + "Get Passes": "Ottieni pass" } \ No newline at end of file diff --git a/backend/lang/nl.json b/backend/lang/nl.json index 152295f4b5..d7ce8a1c16 100644 --- a/backend/lang/nl.json +++ b/backend/lang/nl.json @@ -690,5 +690,14 @@ "Your :appName account has been permanently deleted.": "Je :appName-account is permanent verwijderd.", "All personal information has been removed. Anonymized transaction records (amounts, dates, and invoice details) have been retained as required for legal and tax purposes.": "Alle persoonlijke gegevens zijn verwijderd. Geanonimiseerde transactiegegevens (bedragen, datums en factuurgegevens) zijn bewaard zoals vereist voor juridische en fiscale doeleinden.", "All of your account data has been permanently removed.": "Alle gegevens van je account zijn permanent verwijderd.", - "Thank you for using :appName. You are welcome back at any time.": "Bedankt voor het gebruik van :appName. Je bent altijd weer welkom." + "Thank you for using :appName. You are welcome back at any time.": "Bedankt voor het gebruik van :appName. Je bent altijd weer welkom.", + "Classes": "Lessen", + "There are no classes available for this event": "Er zijn geen lessen beschikbaar voor dit evenement", + "Book Now": "Nu boeken", + "Registration": "Inschrijving", + "Registration is not open for this event": "De inschrijving voor dit evenement is niet geopend", + "Register": "Inschrijven", + "Passes": "Passen", + "There are no passes available for this event": "Er zijn geen passen beschikbaar voor dit evenement", + "Get Passes": "Passen kopen" } \ No newline at end of file diff --git a/backend/lang/pl.json b/backend/lang/pl.json index 8b94c451bd..abef737349 100644 --- a/backend/lang/pl.json +++ b/backend/lang/pl.json @@ -690,5 +690,14 @@ "Your :appName account has been permanently deleted.": "Twoje konto :appName zostało trwale usunięte.", "All personal information has been removed. Anonymized transaction records (amounts, dates, and invoice details) have been retained as required for legal and tax purposes.": "Wszystkie dane osobowe zostały usunięte. Zanonimizowane zapisy transakcji (kwoty, daty i szczegóły faktur) zostały zachowane zgodnie z wymogami prawnymi i podatkowymi.", "All of your account data has been permanently removed.": "Wszystkie dane Twojego konta zostały trwale usunięte.", - "Thank you for using :appName. You are welcome back at any time.": "Dziękujemy za korzystanie z :appName. Zapraszamy ponownie w każdej chwili." + "Thank you for using :appName. You are welcome back at any time.": "Dziękujemy za korzystanie z :appName. Zapraszamy ponownie w każdej chwili.", + "Classes": "Zajęcia", + "There are no classes available for this event": "Brak dostępnych zajęć dla tego wydarzenia", + "Book Now": "Zarezerwuj teraz", + "Registration": "Rejestracja", + "Registration is not open for this event": "Rejestracja na to wydarzenie nie jest otwarta", + "Register": "Zarejestruj się", + "Passes": "Karnety", + "There are no passes available for this event": "Brak dostępnych karnetów dla tego wydarzenia", + "Get Passes": "Kup karnet" } \ No newline at end of file diff --git a/backend/lang/pt-br.json b/backend/lang/pt-br.json index 0a7c4e0ee1..e6290881d8 100644 --- a/backend/lang/pt-br.json +++ b/backend/lang/pt-br.json @@ -690,5 +690,14 @@ "Your :appName account has been permanently deleted.": "Sua conta :appName foi excluída permanentemente.", "All personal information has been removed. Anonymized transaction records (amounts, dates, and invoice details) have been retained as required for legal and tax purposes.": "Todas as informações pessoais foram removidas. Os registros de transações anonimizados (valores, datas e detalhes de faturas) foram mantidos conforme exigido para fins legais e fiscais.", "All of your account data has been permanently removed.": "Todos os dados da sua conta foram removidos permanentemente.", - "Thank you for using :appName. You are welcome back at any time.": "Obrigado por usar o :appName. Você é bem-vindo de volta a qualquer momento." + "Thank you for using :appName. You are welcome back at any time.": "Obrigado por usar o :appName. Você é bem-vindo de volta a qualquer momento.", + "Classes": "Aulas", + "There are no classes available for this event": "Não há aulas disponíveis para este evento", + "Book Now": "Reservar agora", + "Registration": "Inscrição", + "Registration is not open for this event": "As inscrições para este evento não estão abertas", + "Register": "Inscrever-se", + "Passes": "Passes", + "There are no passes available for this event": "Não há passes disponíveis para este evento", + "Get Passes": "Obter passes" } \ No newline at end of file diff --git a/backend/lang/pt.json b/backend/lang/pt.json index 28eb82a674..d33cb006dd 100644 --- a/backend/lang/pt.json +++ b/backend/lang/pt.json @@ -690,5 +690,14 @@ "Your :appName account has been permanently deleted.": "A sua conta :appName foi eliminada permanentemente.", "All personal information has been removed. Anonymized transaction records (amounts, dates, and invoice details) have been retained as required for legal and tax purposes.": "Todas as informações pessoais foram removidas. Os registos de transações anonimizados (montantes, datas e detalhes de faturas) foram mantidos conforme exigido para fins legais e fiscais.", "All of your account data has been permanently removed.": "Todos os dados da sua conta foram removidos permanentemente.", - "Thank you for using :appName. You are welcome back at any time.": "Obrigado por utilizar o :appName. Será sempre bem-vindo de volta." + "Thank you for using :appName. You are welcome back at any time.": "Obrigado por utilizar o :appName. Será sempre bem-vindo de volta.", + "Classes": "Aulas", + "There are no classes available for this event": "Não há aulas disponíveis para este evento", + "Book Now": "Reservar agora", + "Registration": "Inscrição", + "Registration is not open for this event": "As inscrições para este evento não estão abertas", + "Register": "Inscrever-se", + "Passes": "Passes", + "There are no passes available for this event": "Não há passes disponíveis para este evento", + "Get Passes": "Obter passes" } \ No newline at end of file diff --git a/backend/lang/ru.json b/backend/lang/ru.json index 79c4668b28..b4765089b4 100644 --- a/backend/lang/ru.json +++ b/backend/lang/ru.json @@ -678,5 +678,14 @@ "No completed paid orders on this account": "", "Event was created less than 24 hours ago": "", "Review Message": "", - "(deactivated)": "(деактивирован)" + "(deactivated)": "(деактивирован)", + "Classes": "Занятия", + "There are no classes available for this event": "Для этого мероприятия нет доступных занятий", + "Book Now": "Забронировать", + "Registration": "Регистрация", + "Registration is not open for this event": "Регистрация на это мероприятие закрыта", + "Register": "Зарегистрироваться", + "Passes": "Пропуска", + "There are no passes available for this event": "Для этого мероприятия нет доступных пропусков", + "Get Passes": "Получить пропуск" } diff --git a/backend/lang/se.json b/backend/lang/se.json index f7201353cc..d8d60fbcc0 100644 --- a/backend/lang/se.json +++ b/backend/lang/se.json @@ -518,5 +518,14 @@ "Your :appName account has been permanently deleted.": "Ditt :appName-konto har raderats permanent.", "All personal information has been removed. Anonymized transaction records (amounts, dates, and invoice details) have been retained as required for legal and tax purposes.": "All personlig information har tagits bort. Anonymiserade transaktionsuppgifter (belopp, datum och fakturadetaljer) har bevarats enligt juridiska och skattemässiga krav.", "All of your account data has been permanently removed.": "All din kontodata har tagits bort permanent.", - "Thank you for using :appName. You are welcome back at any time.": "Tack för att du använde :appName. Du är välkommen tillbaka när som helst." + "Thank you for using :appName. You are welcome back at any time.": "Tack för att du använde :appName. Du är välkommen tillbaka när som helst.", + "Classes": "Klasser", + "There are no classes available for this event": "Det finns inga klasser tillgängliga för detta evenemang", + "Book Now": "Boka nu", + "Registration": "Registrering", + "Registration is not open for this event": "Registreringen är inte öppen för detta evenemang", + "Register": "Anmäl dig", + "Passes": "Pass", + "There are no passes available for this event": "Det finns inga pass tillgängliga för detta evenemang", + "Get Passes": "Skaffa pass" } \ No newline at end of file diff --git a/backend/lang/sk.json b/backend/lang/sk.json index 624e4c844e..0f4151049a 100644 --- a/backend/lang/sk.json +++ b/backend/lang/sk.json @@ -690,5 +690,14 @@ "Your :appName account has been permanently deleted.": "Váš účet :appName bol natrvalo vymazaný.", "All personal information has been removed. Anonymized transaction records (amounts, dates, and invoice details) have been retained as required for legal and tax purposes.": "Všetky osobné údaje boli odstránené. Anonymizované záznamy o transakciách (sumy, dátumy a údaje faktúr) boli uchované podľa právnych a daňových požiadaviek.", "All of your account data has been permanently removed.": "Všetky údaje vášho účtu boli natrvalo odstránené.", - "Thank you for using :appName. You are welcome back at any time.": "Ďakujeme, že ste používali :appName. Kedykoľvek sa k nám môžete vrátiť." + "Thank you for using :appName. You are welcome back at any time.": "Ďakujeme, že ste používali :appName. Kedykoľvek sa k nám môžete vrátiť.", + "Classes": "Lekcie", + "There are no classes available for this event": "Pre toto podujatie nie sú dostupné žiadne lekcie", + "Book Now": "Rezervovať teraz", + "Registration": "Registrácia", + "Registration is not open for this event": "Registrácia na toto podujatie nie je otvorená", + "Register": "Registrovať sa", + "Passes": "Vstupenky", + "There are no passes available for this event": "Pre toto podujatie nie sú dostupné žiadne vstupenky", + "Get Passes": "Získať vstupenky" } \ No newline at end of file diff --git a/backend/lang/tr.json b/backend/lang/tr.json index 31b36e32a6..288e5d930e 100644 --- a/backend/lang/tr.json +++ b/backend/lang/tr.json @@ -705,5 +705,14 @@ "Your :appName account has been permanently deleted.": ":appName hesabınız kalıcı olarak silindi.", "All personal information has been removed. Anonymized transaction records (amounts, dates, and invoice details) have been retained as required for legal and tax purposes.": "Tüm kişisel bilgiler kaldırıldı. Anonimleştirilmiş işlem kayıtları (tutarlar, tarihler ve fatura ayrıntıları) yasal ve vergisel amaçlar için gerektiği şekilde saklandı.", "All of your account data has been permanently removed.": "Tüm hesap verileriniz kalıcı olarak kaldırıldı.", - "Thank you for using :appName. You are welcome back at any time.": ":appName kullandığınız için teşekkürler. İstediğiniz zaman tekrar bekleriz." + "Thank you for using :appName. You are welcome back at any time.": ":appName kullandığınız için teşekkürler. İstediğiniz zaman tekrar bekleriz.", + "Classes": "Dersler", + "There are no classes available for this event": "Bu etkinlik için uygun ders bulunmamaktadır", + "Book Now": "Hemen Rezervasyon Yap", + "Registration": "Kayıt", + "Registration is not open for this event": "Bu etkinlik için kayıt açık değil", + "Register": "Kayıt Ol", + "Passes": "Biletler", + "There are no passes available for this event": "Bu etkinlik için uygun bilet bulunmamaktadır", + "Get Passes": "Bilet Al" } \ No newline at end of file diff --git a/backend/lang/vi.json b/backend/lang/vi.json index f228084e63..e6ec01c46f 100644 --- a/backend/lang/vi.json +++ b/backend/lang/vi.json @@ -654,5 +654,14 @@ "Your :appName account has been permanently deleted.": "Tài khoản :appName của bạn đã bị xóa vĩnh viễn.", "All personal information has been removed. Anonymized transaction records (amounts, dates, and invoice details) have been retained as required for legal and tax purposes.": "Tất cả thông tin cá nhân đã bị xóa. Hồ sơ giao dịch ẩn danh (số tiền, ngày tháng và chi tiết hóa đơn) đã được lưu giữ theo yêu cầu cho các mục đích pháp lý và thuế.", "All of your account data has been permanently removed.": "Tất cả dữ liệu tài khoản của bạn đã bị xóa vĩnh viễn.", - "Thank you for using :appName. You are welcome back at any time.": "Cảm ơn bạn đã sử dụng :appName. Chúng tôi luôn chào đón bạn quay lại." + "Thank you for using :appName. You are welcome back at any time.": "Cảm ơn bạn đã sử dụng :appName. Chúng tôi luôn chào đón bạn quay lại.", + "Classes": "Lớp học", + "There are no classes available for this event": "Không có lớp học nào cho sự kiện này", + "Book Now": "Đặt chỗ ngay", + "Registration": "Đăng ký", + "Registration is not open for this event": "Sự kiện này chưa mở đăng ký", + "Register": "Đăng ký", + "Passes": "Vé", + "There are no passes available for this event": "Không có vé nào cho sự kiện này", + "Get Passes": "Mua vé" } \ No newline at end of file diff --git a/backend/lang/zh-cn.json b/backend/lang/zh-cn.json index fe3ba62981..d4a59beecc 100644 --- a/backend/lang/zh-cn.json +++ b/backend/lang/zh-cn.json @@ -690,5 +690,14 @@ "Your :appName account has been permanently deleted.": "您的 :appName 账户已被永久删除。", "All personal information has been removed. Anonymized transaction records (amounts, dates, and invoice details) have been retained as required for legal and tax purposes.": "所有个人信息已被删除。匿名化的交易记录(金额、日期和发票详情)已按法律和税务要求保留。", "All of your account data has been permanently removed.": "您的所有账户数据已被永久删除。", - "Thank you for using :appName. You are welcome back at any time.": "感谢您使用 :appName。随时欢迎您回来。" + "Thank you for using :appName. You are welcome back at any time.": "感谢您使用 :appName。随时欢迎您回来。", + "Classes": "课程", + "There are no classes available for this event": "该活动暂无可用课程", + "Book Now": "立即预订", + "Registration": "报名", + "Registration is not open for this event": "该活动暂未开放报名", + "Register": "报名", + "Passes": "通行证", + "There are no passes available for this event": "该活动暂无可用通行证", + "Get Passes": "获取通行证" } \ No newline at end of file diff --git a/backend/lang/zh-hk.json b/backend/lang/zh-hk.json index 43a8e9620e..69c8d9e2cd 100644 --- a/backend/lang/zh-hk.json +++ b/backend/lang/zh-hk.json @@ -690,5 +690,14 @@ "Your :appName account has been permanently deleted.": "您的 :appName 帳戶已被永久刪除。", "All personal information has been removed. Anonymized transaction records (amounts, dates, and invoice details) have been retained as required for legal and tax purposes.": "所有個人資料已被刪除。匿名化的交易記錄(金額、日期及發票詳情)已按法律及稅務要求保留。", "All of your account data has been permanently removed.": "您的所有帳戶資料已被永久刪除。", - "Thank you for using :appName. You are welcome back at any time.": "感謝您使用 :appName。隨時歡迎您回來。" + "Thank you for using :appName. You are welcome back at any time.": "感謝您使用 :appName。隨時歡迎您回來。", + "Classes": "課程", + "There are no classes available for this event": "此活動暫無可用課程", + "Book Now": "立即預訂", + "Registration": "報名", + "Registration is not open for this event": "此活動暫未開放報名", + "Register": "報名", + "Passes": "通行證", + "There are no passes available for this event": "此活動暫無可用通行證", + "Get Passes": "領取通行證" } \ No newline at end of file diff --git a/backend/tests/Unit/DomainObjects/Enums/ProductTerminologyTest.php b/backend/tests/Unit/DomainObjects/Enums/ProductTerminologyTest.php new file mode 100644 index 0000000000..42c433ab4e --- /dev/null +++ b/backend/tests/Unit/DomainObjects/Enums/ProductTerminologyTest.php @@ -0,0 +1,57 @@ +assertSame(ProductTerminology::CLASSES, ProductTerminology::forCategory('WELLNESS')); + $this->assertSame(ProductTerminology::CLASSES, ProductTerminology::forCategory('SPIRITUALITY')); + $this->assertSame(ProductTerminology::CLASSES, ProductTerminology::forCategory('DANCE')); + $this->assertSame(ProductTerminology::REGISTRATIONS, ProductTerminology::forCategory('WORKSHOP')); + $this->assertSame(ProductTerminology::REGISTRATIONS, ProductTerminology::forCategory('EDUCATION')); + $this->assertSame(ProductTerminology::BOOKINGS, ProductTerminology::forCategory('TOURS')); + $this->assertSame(ProductTerminology::PASSES, ProductTerminology::forCategory('BUSINESS')); + $this->assertSame(ProductTerminology::PASSES, ProductTerminology::forCategory('TECH')); + $this->assertSame(ProductTerminology::TICKETS, ProductTerminology::forCategory('MUSIC')); + $this->assertSame(ProductTerminology::TICKETS, ProductTerminology::forCategory('OTHER')); + } + + public function test_for_category_falls_back_to_tickets_for_null_and_unknown_values(): void + { + $this->assertSame(ProductTerminology::TICKETS, ProductTerminology::forCategory(null)); + $this->assertSame(ProductTerminology::TICKETS, ProductTerminology::forCategory('NOT_A_CATEGORY')); + } + + public function test_every_event_category_resolves_to_a_terminology(): void + { + foreach (EventCategory::cases() as $category) { + $terminology = $category->terminology(); + + $this->assertNotSame('', $terminology->defaultProductCategoryName()); + $this->assertNotSame('', $terminology->defaultNoProductsMessage()); + $this->assertNotSame('', $terminology->defaultContinueButtonText()); + } + } + + public function test_tickets_terminology_keeps_existing_defaults(): void + { + $this->assertSame('Tickets', ProductTerminology::TICKETS->defaultProductCategoryName()); + $this->assertSame('There are no tickets available for this event', ProductTerminology::TICKETS->defaultNoProductsMessage()); + $this->assertSame('Continue', ProductTerminology::TICKETS->defaultContinueButtonText()); + $this->assertNull(ProductTerminology::TICKETS->defaultGetTicketsButtonText()); + } + + public function test_non_ticket_terminologies_provide_get_tickets_button_text(): void + { + $this->assertSame('Book Now', ProductTerminology::CLASSES->defaultGetTicketsButtonText()); + $this->assertSame('Book Now', ProductTerminology::BOOKINGS->defaultGetTicketsButtonText()); + $this->assertSame('Register', ProductTerminology::REGISTRATIONS->defaultGetTicketsButtonText()); + $this->assertSame('Get Passes', ProductTerminology::PASSES->defaultGetTicketsButtonText()); + } +} diff --git a/backend/tests/Unit/Services/Domain/Organizer/CreateDefaultOrganizerSettingsServiceTest.php b/backend/tests/Unit/Services/Domain/Organizer/CreateDefaultOrganizerSettingsServiceTest.php new file mode 100644 index 0000000000..253e83ade1 --- /dev/null +++ b/backend/tests/Unit/Services/Domain/Organizer/CreateDefaultOrganizerSettingsServiceTest.php @@ -0,0 +1,48 @@ + true]); + + $repository = Mockery::mock(OrganizerSettingsRepositoryInterface::class); + $repository + ->shouldReceive('create') + ->once() + ->with(Mockery::on( + static fn (array $attributes) => $attributes['organizer_id'] === 55 + && $attributes['default_attendee_details_collection_method'] === 'PER_ORDER' + && $attributes['default_pass_platform_fee_to_buyer'] === true + )); + + $service = new CreateDefaultOrganizerSettingsService($repository); + + $service->createOrganizerSettings((new OrganizerDomainObject)->setId(55)); + } + + public function test_pass_platform_fee_default_respects_config_override(): void + { + config(['app.saas_default_pass_platform_fee_to_buyer' => false]); + + $repository = Mockery::mock(OrganizerSettingsRepositoryInterface::class); + $repository + ->shouldReceive('create') + ->once() + ->with(Mockery::on( + static fn (array $attributes) => $attributes['default_pass_platform_fee_to_buyer'] === false + )); + + $service = new CreateDefaultOrganizerSettingsService($repository); + + $service->createOrganizerSettings((new OrganizerDomainObject)->setId(55)); + } +} diff --git a/backend/tests/Unit/Services/Domain/ProductCategory/CreateProductCategoryServiceTest.php b/backend/tests/Unit/Services/Domain/ProductCategory/CreateProductCategoryServiceTest.php new file mode 100644 index 0000000000..54ddc95eb0 --- /dev/null +++ b/backend/tests/Unit/Services/Domain/ProductCategory/CreateProductCategoryServiceTest.php @@ -0,0 +1,74 @@ +productCategoryRepository = Mockery::mock(ProductCategoryRepositoryInterface::class); + $this->service = new CreateProductCategoryService($this->productCategoryRepository); + } + + public function test_default_category_uses_ticket_wording_for_ticket_categories(): void + { + $this->assertDefaultCategoryCreated( + eventCategory: 'MUSIC', + expectedName: 'Tickets', + expectedNoProductsMessage: 'There are no tickets available for this event', + ); + } + + public function test_default_category_uses_class_wording_for_wellness_events(): void + { + $this->assertDefaultCategoryCreated( + eventCategory: 'WELLNESS', + expectedName: 'Classes', + expectedNoProductsMessage: 'There are no classes available for this event', + ); + } + + public function test_default_category_uses_registration_wording_for_workshop_events(): void + { + $this->assertDefaultCategoryCreated( + eventCategory: 'WORKSHOP', + expectedName: 'Registration', + expectedNoProductsMessage: 'Registration is not open for this event', + ); + } + + private function assertDefaultCategoryCreated( + string $eventCategory, + string $expectedName, + string $expectedNoProductsMessage, + ): void { + $event = (new EventDomainObject) + ->setId(100) + ->setCategory($eventCategory); + + $this->productCategoryRepository + ->shouldReceive('create') + ->once() + ->with(Mockery::on( + static fn (array $attributes) => $attributes['event_id'] === 100 + && $attributes['name'] === $expectedName + && $attributes['no_products_message'] === $expectedNoProductsMessage + )) + ->andReturn(new ProductCategoryDomainObject); + + $this->service->createDefaultProductCategory($event); + } +} diff --git a/frontend/src/components/routes/organizer/Settings/Sections/EventDefaults/index.tsx b/frontend/src/components/routes/organizer/Settings/Sections/EventDefaults/index.tsx index cdcb611207..c5712892bb 100644 --- a/frontend/src/components/routes/organizer/Settings/Sections/EventDefaults/index.tsx +++ b/frontend/src/components/routes/organizer/Settings/Sections/EventDefaults/index.tsx @@ -20,7 +20,7 @@ export const EventDefaults = () => { const form = useForm({ initialValues: { - default_attendee_details_collection_method: 'PER_TICKET' as 'PER_TICKET' | 'PER_ORDER', + default_attendee_details_collection_method: 'PER_ORDER' as 'PER_TICKET' | 'PER_ORDER', default_show_marketing_opt_in: true, default_allow_attendee_self_edit: false, } @@ -46,7 +46,7 @@ export const EventDefaults = () => { useEffect(() => { if (organizerSettingsQuery?.isFetched && organizerSettingsQuery?.data) { form.setValues({ - default_attendee_details_collection_method: organizerSettingsQuery.data.default_attendee_details_collection_method || 'PER_TICKET', + default_attendee_details_collection_method: organizerSettingsQuery.data.default_attendee_details_collection_method || 'PER_ORDER', default_show_marketing_opt_in: organizerSettingsQuery.data.default_show_marketing_opt_in ?? true, default_allow_attendee_self_edit: organizerSettingsQuery.data.default_allow_attendee_self_edit ?? false, });