“Finish” the new booking form
Had to bring the same fields that i have for a payment to booking,
except that some of those should be nullable, because it is unreasonable
to ask front desk to gather all customer data when they have a booking
via phone, for instance.
Therefore, i can not take advantage of the validation for customer data
that i use in the public-facing form, but, fortunately, most of the
validations where in separated functions, thus only had to rewrite that
one for this case.
I already have to create a booking from a payment, when receiving a
payment from the public instance, thus i made that function and reused
it here. Then i “overwrite” the newly created pre-booking with the
customer data from the form, and set is as confirmed, as we do not see
any point of allowing pre-bookings from employees.
2024-04-24 18:12:29 +00:00
|
|
|
-- Revert camper:booking__payment_fields from pg
|
|
|
|
|
|
|
|
begin;
|
|
|
|
|
|
|
|
alter table camper.booking
|
|
|
|
drop column if exists address
|
|
|
|
, drop column if exists postal_code
|
|
|
|
, drop column if exists city
|
|
|
|
, drop column if exists country_code
|
|
|
|
, drop column if exists email
|
|
|
|
, drop column if exists phone
|
|
|
|
, drop column if exists lang_tag
|
|
|
|
, drop column if exists zone_preferences
|
|
|
|
, drop column if exists subtotal_nights
|
|
|
|
, drop column if exists number_adults
|
|
|
|
, drop column if exists subtotal_adults
|
|
|
|
, drop column if exists number_teenagers
|
|
|
|
, drop column if exists subtotal_teenagers
|
|
|
|
, drop column if exists number_children
|
|
|
|
, drop column if exists subtotal_children
|
2024-04-24 18:29:23 +00:00
|
|
|
, alter column number_dogs type integer
|
“Finish” the new booking form
Had to bring the same fields that i have for a payment to booking,
except that some of those should be nullable, because it is unreasonable
to ask front desk to gather all customer data when they have a booking
via phone, for instance.
Therefore, i can not take advantage of the validation for customer data
that i use in the public-facing form, but, fortunately, most of the
validations where in separated functions, thus only had to rewrite that
one for this case.
I already have to create a booking from a payment, when receiving a
payment from the public instance, thus i made that function and reused
it here. Then i “overwrite” the newly created pre-booking with the
customer data from the form, and set is as confirmed, as we do not see
any point of allowing pre-bookings from employees.
2024-04-24 18:12:29 +00:00
|
|
|
, drop column if exists subtotal_dogs
|
|
|
|
, drop column if exists subtotal_tourist_tax
|
|
|
|
, drop column if exists total
|
|
|
|
, drop column if exists currency_code
|
|
|
|
;
|
|
|
|
|
|
|
|
commit;
|