camper/pkg
jordi fita mas e4636592c5 Add payment relation and use it to compute the booking’s cart
I had to add the payment concept separate from the booking, unlike other
eCommerce solutions that subsume the two into a single “order”, like
WooCommerce, because bookings should be done in a separate Camper
instance that will sync to the public instance, but the payment is done
by the public instance.  There will be a queue or something between
the public and the private instance to pass along the booking
information once the payment is complete, but the public instance still
needs to keep track of payments without creating bookings.

To compute the total for that payment i had to do the same as was doing
until now for the cart.  To prevent duplications, or having functions
with complex return types, i now create a “draft” payment while the
user is filling in the form, and compute the cart there; from Go i only
have to retrieve the data from the relation, that simplifies the work,
actually.

Since the payment is computed way before customers enter their details,
i can not have that data in the same payment relation, unless i allow
NULL values.  Allowing NULL values means that i can create a payment
without customer, thus i moved all customer details to a separate
relation.  It still allows payment without customer, but at least there
are no NULL values.

Draft payments should be removed after a time, but i believe this needs
to be done in a cronjob or similar, not in the Go application.

To update the same payment while filling the same booking form, i now
have a hidden field with the payment slug.  A competent developer would
have used a cookie or something like that; i am not competent.
2024-02-12 05:21:00 +01:00
..
amenity Add amenities section and public page 2024-01-27 22:51:41 +01:00
app Add amenities section and public page 2024-01-27 22:51:41 +01:00
auth Add VAT and tourist tax information 2024-01-15 01:45:58 +01:00
booking Add payment relation and use it to compute the booking’s cart 2024-02-12 05:21:00 +01:00
build Replace min_nights from campsite_type_costs to range in campsite_type 2024-01-31 23:06:45 +01:00
campsite Allow campsite type option to be just per unit, not per unit per night 2024-02-11 21:45:00 +01:00
carousel Fix translation of carousel slides when changing media ID 2024-01-22 21:03:00 +01:00
company Add VAT and tourist tax information 2024-01-15 01:45:58 +01:00
database Add payment relation and use it to compute the booking’s cart 2024-02-12 05:21:00 +01:00
form Handle the booking cart entirely with HTMx 2024-02-10 03:49:44 +01:00
hex Add cover media to campsite types 2023-09-10 03:04:18 +02:00
home Do not freak out just because the is no blooding slogan 2024-01-30 12:24:49 +01:00
http Add the language switched to the public layout 2023-08-06 05:53:52 +02:00
legal Do not translate legal to the default language 2024-01-12 19:57:11 +01:00
locale Replace L10nInput with I18nInput in service 2024-01-12 21:06:12 +01:00
location Add missing MethodPut to location/admin.gohtml’s MethodNotAllowed 2024-01-23 11:31:34 +01:00
media Allow updating images in CKEditor-“powered” textarea 2024-01-16 01:26:35 +01:00
redsys Implement Redsys request signature in PostgreSQL 2023-10-27 01:52:04 +02:00
season Refactor ISO date, and datestamp format in constant 2024-01-31 19:58:46 +01:00
services Add a Go function for delete_service SQL function 2024-01-16 18:12:38 +01:00
surroundings Add ad management for surroundings 2024-01-23 14:53:15 +01:00
template Handle the booking cart entirely with HTMx 2024-02-10 03:49:44 +01:00
user User and login attempt pages only accept GET 2024-01-18 19:34:58 +01:00
uuid Add cover media to campsite types 2023-09-10 03:04:18 +02:00