v0.11 U2: Angebots-Gate, gemeinsamer Fakteneingang mit Herkunft
- CaseRequirements: Vor einem eigenen verbindlichen Angebot und vor der verbindlichen Bestätigung eines Buchungswunsches müssen Vor- und Nachname, E-Mail, vollständige Anschrift mit Land, Personenzahl und Zeitraum vorliegen – harter Blocker, auch von Hand (G2a, B3). Die Auskunft unter Vorbehalt bleibt ohne dieses Gate. - ContributeCaseFacts (S5): jede Angabe mit Herkunft und Ergebnis in case_facts; fehlend → übernommen, gleich → bestätigt, abweichend vom Gast → Prüfaufgabe (Kartei bleibt), Vermieterin maßgeblich, Zeitraum und Personen → Änderungswunsch; idempotent; danach einmal CaseAutomation. - ProvideGuestContact und Webformular nutzen den Fakteneingang. - Land als ISO-Code mit „Deutschland“ als änderbarem Formularstandard; guests.country ohne stillen Standardwert (B4). - Testdaten bestehender Tests um Anschriften ergänzt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
799869c6a4
commit
ccac78a6c9
33 files changed
+1041
-47
No files matched your search
@@ -16,6 +16,7 @@
|
||||
use App\Pricing\QuoteException;
|
||||
use App\Pricing\StayRequest;
|
||||
use App\Process\ProcessSettings;
|
||||
use App\Support\Countries;
|
||||
use App\Tenancy\TenantContext;
|
||||
use Carbon\CarbonImmutable;
|
||||
use Illuminate\Contracts\View\View;
|
||||
@@ -64,6 +65,9 @@ class BookingRequest extends Component
|
||||
|
||||
public string $city = '';
|
||||
|
||||
/** Pre-filled but changeable; it only counts because the guest sends it with the form (B4). */
|
||||
public string $country = Countries::DEFAULT;
|
||||
|
||||
public string $message = '';
|
||||
|
||||
public bool $privacyAccepted = false;
|
||||
@@ -105,6 +109,16 @@ public function property(): Property
|
||||
return Property::findOrFail($this->propertyId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the full address must be given in the form (channel manager, website entry; default: no – missing
|
||||
* details are asked for afterwards, v0.11 B2).
|
||||
*/
|
||||
#[Computed]
|
||||
public function requiresAddress(): bool
|
||||
{
|
||||
return app(ProcessSettings::class)->forWebsite($this->property)->formRequiresAddress();
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether a request on the website reserves the dates (else it is answered with an information, package 7).
|
||||
*/
|
||||
@@ -261,6 +275,7 @@ public function submit(CreateReservation $createReservation): void
|
||||
'street' => $this->street ?: null,
|
||||
'postal_code' => $this->postalCode ?: null,
|
||||
'city' => $this->city ?: null,
|
||||
'country' => $this->country ?: null,
|
||||
],
|
||||
$this->message ?: null,
|
||||
attribution: [...$this->utm, 'referral_source' => $this->referralSource ?: null],
|
||||
@@ -328,9 +343,10 @@ protected function rules(): array
|
||||
'lastName' => ['required', 'string', 'max:255', 'not_regex:/https?:|www\.|<|>/i'],
|
||||
'email' => ['required', 'email', 'max:255'],
|
||||
'phone' => ['nullable', 'string', 'max:50'],
|
||||
'street' => ['nullable', 'string', 'max:255'],
|
||||
'postalCode' => ['nullable', 'string', 'max:20'],
|
||||
'city' => ['nullable', 'string', 'max:255'],
|
||||
'street' => [$this->requiresAddress() ? 'required' : 'nullable', 'string', 'max:255'],
|
||||
'postalCode' => [$this->requiresAddress() ? 'required' : 'nullable', 'string', 'max:20'],
|
||||
'city' => [$this->requiresAddress() ? 'required' : 'nullable', 'string', 'max:255'],
|
||||
'country' => [$this->requiresAddress() ? 'required' : 'nullable', Rule::in(array_keys(Countries::options()))],
|
||||
'message' => ['nullable', 'string', 'max:5000', function (string $attribute, mixed $value, \Closure $fail): void {
|
||||
if (preg_match_all('~https?://|www\.~i', (string) $value) > config('fewo.spam.max_links')) {
|
||||
$fail('Bitte schreiben Sie Ihre Nachricht ohne Links.');
|
||||
@@ -353,6 +369,10 @@ protected function validationAttributes(): array
|
||||
'firstName' => 'Vorname',
|
||||
'lastName' => 'Nachname',
|
||||
'email' => 'E-Mail',
|
||||
'street' => 'Straße & Hausnr.',
|
||||
'postalCode' => 'PLZ',
|
||||
'city' => 'Ort',
|
||||
'country' => 'Land',
|
||||
'privacyAccepted' => 'Datenschutzerklärung',
|
||||
];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user