diff --git a/demo/demo.sql b/demo/demo.sql index 40a30f1..4ac4fb2 100644 --- a/demo/demo.sql +++ b/demo/demo.sql @@ -121,23 +121,23 @@ select translate_services_carousel_slide(63, 'en', 'Safari Tents'); select translate_services_carousel_slide(63, 'es', 'Tiendas Safari'); alter table campsite_type alter column campsite_type_id restart with 72; -select add_campsite_type(52, 62, 'Parceŀles', '
Ubicats al costat muntanya del càmping i amb vista a la natura que ens envolta.
Parcel·les amples amb serveis a prop d’on ets per fer allò que vols.
', '* Tovalloles: preu extra
', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
', '', 6, true); -select add_campsite_type(52, 63, 'Safari Tents', 'Un luxe de tendes per viure aventures.
Dues tendes amb terra de fusta, llits, cuina i tot de comoditats per gaudir de les teves vacances.
', '* Tovalloles: preu extra
', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
', '', 6, false); -select add_campsite_type(52, 64, 'Bungalous', 'Ubicats al costat muntanya del càmping i amb vista a la natura que ens envolta.
Dues cabanes de fusta massissa de dues plantes i amb porxo cobert per gaudir entre arbres.
', '* Tovalloles: preu extra
', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
', '', 5, false); -select add_campsite_type(52, 65, 'Bungalous prèmium', 'Ubicats al costat muntanya del càmping i amb vista a la natura que ens envolta.
Dues cabanes de fusta massissa de dues plantes i amb porxo cobert per gaudir entre arbres.
', '* Tovalloles: preu extra
', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
', '', 5, false); -select add_campsite_type(52, 66, 'Cabanes de fusta', 'Ubicats al costat muntanya del càmping i amb vista a la natura que ens envolta.
Dues cabanes de fusta massissa de dues plantes i amb porxo cobert per gaudir entre arbres.
', '* Tovalloles: preu extra
', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
', '', 5, false); +select add_campsite_type(52, 62, 'Parceŀles', 'Ubicats al costat muntanya del càmping i amb vista a la natura que ens envolta.
Parcel·les amples amb serveis a prop d’on ets per fer allò que vols.
', '* Tovalloles: preu extra
', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
', '', '15 h a 21 h', '12 h', 6, true); +select add_campsite_type(52, 63, 'Safari Tents', 'Un luxe de tendes per viure aventures.
Dues tendes amb terra de fusta, llits, cuina i tot de comoditats per gaudir de les teves vacances.
', '* Tovalloles: preu extra
', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
', '', '16 h a 21 h', '10 h', 6, false); +select add_campsite_type(52, 64, 'Bungalous', 'Ubicats al costat muntanya del càmping i amb vista a la natura que ens envolta.
Dues cabanes de fusta massissa de dues plantes i amb porxo cobert per gaudir entre arbres.
', '* Tovalloles: preu extra
', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
', '', '15 h a 21 h', '12 h', 5, false); +select add_campsite_type(52, 65, 'Bungalous prèmium', 'Ubicats al costat muntanya del càmping i amb vista a la natura que ens envolta.
Dues cabanes de fusta massissa de dues plantes i amb porxo cobert per gaudir entre arbres.
', '* Tovalloles: preu extra
', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
', '', '15 h a 21 h', '12 h', 5, false); +select add_campsite_type(52, 66, 'Cabanes de fusta', 'Ubicats al costat muntanya del càmping i amb vista a la natura que ens envolta.
Dues cabanes de fusta massissa de dues plantes i amb porxo cobert per gaudir entre arbres.
', '* Tovalloles: preu extra
', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
', '', '15 h a 21 h', '12 h', 5, false); -insert into campsite_type_i18n (campsite_type_id, lang_tag, name, spiel, info, facilities, description, additional_info) -values (72, 'en', 'Plots', 'Located on the campground’s mountain-side and overlooking the nature that surrounds us.
Large plots with serivces close to where you are to do what you want.
', '* Towels: extra cost
', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
', '') - , (72, 'es', 'Parcelas', 'Ubicadas al lado montaña del camping y con vista a la naturaleza que nos rodea.
Parcelas amplias con servicios cerca de donde eres para hacer aquello que quieres.
', '* Toallas: precio extra
', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
', '') - , (73, 'en', 'Safari Tents', 'A luxury of tent for unforgettable adventures.
Two tents with wooden floors, beds, kitchen, and all the amenities to enjoy your vacation.
', '* Towels: extra cost
', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
', '') - , (73, 'es', 'Tiendas Safari', 'Un lujo de tiendas para vivir aventuras.
Dos tiendas con suelo de madera, camas, cocina y todo de comodidades para disfrutar de tus vacanciones.
', '* Toallas: precio extra
', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
', '') - , (74, 'en', 'Bungalows', 'Located on the campground’s mountain-side and overlooking the nature that surrounds us.
Two two-story solid wood cabins with a covered porch to enjoy among the trees.
', '* Towels: extra cost
', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
', '') - , (74, 'es', 'Bungalós', 'Ubicadas al lado montaña del camping y con vista a la naturaleza que nos rodea.
Dos cabañas de madera maciza de dos plantas y con porche cubierto para disfutrar entre árboles.
', '* Toallas: precio extra
', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
', '') - , (75, 'en', 'Bungalows premium', 'Located on the campground’s mountain-side and overlooking the nature that surrounds us.
Two two-story solid wood cabins with a covered porch to enjoy among the trees.
', '* Towels: extra cost
', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
', '') - , (75, 'es', 'Bungalós prémium', 'Ubicadas al lado montaña del camping y con vista a la naturaleza que nos rodea.
Dos cabañas de madera maciza de dos plantas y con porche cubierto para disfutrar entre árboles.
', '* Toallas: precio extra
', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
', '') - , (76, 'en', 'Wooden Lodges', 'Located on the campground’s mountain-side and overlooking the nature that surrounds us.
Two two-story solid wood cabins with a covered porch to enjoy among the trees.
', '* Towels: extra cost
', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
', '') - , (76, 'es', 'Cabañas de madera', 'Ubicadas al lado montaña del camping y con vista a la naturaleza que nos rodea.
Dos cabañas de madera maciza de dos plantas y con porche cubierto para disfutrar entre árboles.
', '* Toallas: precio extra
', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
', '') +insert into campsite_type_i18n (campsite_type_id, lang_tag, name, spiel, info, facilities, description, additional_info, check_in, check_out) +values (72, 'en', 'Plots', 'Located on the campground’s mountain-side and overlooking the nature that surrounds us.
Large plots with serivces close to where you are to do what you want.
', '* Towels: extra cost
', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
', '', '3 p.m. to 9 p.m.', '12 a.m.') + , (72, 'es', 'Parcelas', 'Ubicadas al lado montaña del camping y con vista a la naturaleza que nos rodea.
Parcelas amplias con servicios cerca de donde eres para hacer aquello que quieres.
', '* Toallas: precio extra
', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
', '', '15 h a 21 h', '12 h') + , (73, 'en', 'Safari Tents', 'A luxury of tent for unforgettable adventures.
Two tents with wooden floors, beds, kitchen, and all the amenities to enjoy your vacation.
', '* Towels: extra cost
', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
', '', '4 p.m. to 9 p.m.', '12 a.m.') + , (73, 'es', 'Tiendas Safari', 'Un lujo de tiendas para vivir aventuras.
Dos tiendas con suelo de madera, camas, cocina y todo de comodidades para disfrutar de tus vacanciones.
', '* Toallas: precio extra
', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
', '', '16 h a 21 h', '12 h') + , (74, 'en', 'Bungalows', 'Located on the campground’s mountain-side and overlooking the nature that surrounds us.
Two two-story solid wood cabins with a covered porch to enjoy among the trees.
', '* Towels: extra cost
', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
', '', '3 p.m. to 9 p.m.', '12 a.m.') + , (74, 'es', 'Bungalós', 'Ubicadas al lado montaña del camping y con vista a la naturaleza que nos rodea.
Dos cabañas de madera maciza de dos plantas y con porche cubierto para disfutrar entre árboles.
', '* Toallas: precio extra
', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
', '', '15 h a 21 h', '12 h') + , (75, 'en', 'Bungalows premium', 'Located on the campground’s mountain-side and overlooking the nature that surrounds us.
Two two-story solid wood cabins with a covered porch to enjoy among the trees.
', '* Towels: extra cost
', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
', '', '3 p.m. to 9 p.m.', '12 a.m.') + , (75, 'es', 'Bungalós prémium', 'Ubicadas al lado montaña del camping y con vista a la naturaleza que nos rodea.
Dos cabañas de madera maciza de dos plantas y con porche cubierto para disfutrar entre árboles.
', '* Toallas: precio extra
', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
', '', '15 h a 21 h', '12 h') + , (76, 'en', 'Wooden Lodges', 'Located on the campground’s mountain-side and overlooking the nature that surrounds us.
Two two-story solid wood cabins with a covered porch to enjoy among the trees.
', '* Towels: extra cost
', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
', '', '3 p.m. to 9 p.m.', '12 a.m.') + , (76, 'es', 'Cabañas de madera', 'Ubicadas al lado montaña del camping y con vista a la naturaleza que nos rodea.
Dos cabañas de madera maciza de dos plantas y con porche cubierto para disfutrar entre árboles.
', '* Toallas: precio extra
', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
', '', '15 h a 21 h', '12 h') ; alter table campsite_type_feature alter column campsite_type_feature_id restart with 82; diff --git a/deploy/add_campsite_type.sql b/deploy/add_campsite_type.sql index 2304815..ad5825b 100644 --- a/deploy/add_campsite_type.sql +++ b/deploy/add_campsite_type.sql @@ -8,18 +8,18 @@ begin; set search_path to camper, public; -drop function if exists add_campsite_type(integer, integer, text, text, text, text, text, integer, boolean); +drop function if exists add_campsite_type(integer, integer, text, text, text, text, text, text, integer, boolean); -create or replace function add_campsite_type(company integer, media_id integer, name text, spiel text, info text, facilities text, description text, additional_info text, max_campers integer, dogs_allowed boolean) returns uuid as +create or replace function add_campsite_type(company integer, media_id integer, name text, spiel text, info text, facilities text, description text, additional_info text, check_in text, check_out text, max_campers integer, dogs_allowed boolean) returns uuid as $$ - insert into campsite_type (company_id, media_id, name, spiel, info, facilities, description, additional_info, max_campers, dogs_allowed) - values (company, media_id, name, xmlparse(content spiel), xmlparse(content info), xmlparse(content facilities), xmlparse(content description), xmlparse(content additional_info), max_campers, dogs_allowed) + insert into campsite_type (company_id, media_id, name, spiel, info, facilities, description, additional_info, check_in, check_out, max_campers, dogs_allowed) + values (company, media_id, name, xmlparse(content spiel), xmlparse(content info), xmlparse(content facilities), xmlparse(content description), xmlparse(content additional_info), check_in, check_out, max_campers, dogs_allowed) returning slug; $$ language sql ; -revoke execute on function add_campsite_type(integer, integer, text, text, text, text, text, text, integer, boolean) from public; -grant execute on function add_campsite_type(integer, integer, text, text, text, text, text, text, integer, boolean) to admin; +revoke execute on function add_campsite_type(integer, integer, text, text, text, text, text, text, text, text, integer, boolean) from public; +grant execute on function add_campsite_type(integer, integer, text, text, text, text, text, text, text, text, integer, boolean) to admin; commit; diff --git a/deploy/add_campsite_type@v1.sql b/deploy/add_campsite_type@v1.sql new file mode 100644 index 0000000..2304815 --- /dev/null +++ b/deploy/add_campsite_type@v1.sql @@ -0,0 +1,25 @@ +-- Deploy camper:add_campsite_type to pg +-- requires: roles +-- requires: schema_camper +-- requires: campsite_type +-- requires: company + +begin; + +set search_path to camper, public; + +drop function if exists add_campsite_type(integer, integer, text, text, text, text, text, integer, boolean); + +create or replace function add_campsite_type(company integer, media_id integer, name text, spiel text, info text, facilities text, description text, additional_info text, max_campers integer, dogs_allowed boolean) returns uuid as +$$ + insert into campsite_type (company_id, media_id, name, spiel, info, facilities, description, additional_info, max_campers, dogs_allowed) + values (company, media_id, name, xmlparse(content spiel), xmlparse(content info), xmlparse(content facilities), xmlparse(content description), xmlparse(content additional_info), max_campers, dogs_allowed) + returning slug; +$$ + language sql +; + +revoke execute on function add_campsite_type(integer, integer, text, text, text, text, text, text, integer, boolean) from public; +grant execute on function add_campsite_type(integer, integer, text, text, text, text, text, text, integer, boolean) to admin; + +commit; diff --git a/deploy/campsite_type__check_in_out.sql b/deploy/campsite_type__check_in_out.sql new file mode 100644 index 0000000..55b5c92 --- /dev/null +++ b/deploy/campsite_type__check_in_out.sql @@ -0,0 +1,11 @@ +-- Deploy camper:campsite_type__check_in_out to pg +-- requires: campsite_type + +begin; + +alter table camper.campsite_type + add column check_in text not null default '' +, add column check_out text not null default '' +; + +commit; diff --git a/deploy/campsite_type_i18n__check_in_out.sql b/deploy/campsite_type_i18n__check_in_out.sql new file mode 100644 index 0000000..1b4ba8d --- /dev/null +++ b/deploy/campsite_type_i18n__check_in_out.sql @@ -0,0 +1,16 @@ +-- Deploy camper:campsite_type_i18n__check_in_out to pg +-- requires: campsite_type_i18n + +begin; + +alter table camper.campsite_type_i18n + add column check_in text not null default '' +, add column check_out text not null default '' +; + +alter table camper.campsite_type_i18n + alter column check_in drop default +, alter column check_out drop default +; + +commit; diff --git a/deploy/edit_campsite_type.sql b/deploy/edit_campsite_type.sql index b248a61..0abfe8a 100644 --- a/deploy/edit_campsite_type.sql +++ b/deploy/edit_campsite_type.sql @@ -8,9 +8,9 @@ begin; set search_path to camper, public; -drop function if exists edit_campsite_type(uuid, integer, text, text, text, text, text, integer, boolean, boolean); +drop function if exists edit_campsite_type(uuid, integer, text, text, text, text, text, text, integer, boolean, boolean); -create or replace function edit_campsite_type(slug uuid, media_id integer, name text, spiel text, info text, facilities text, description text, additional_info text, max_campers integer, dogs_allowed boolean, active boolean) returns uuid as +create or replace function edit_campsite_type(slug uuid, media_id integer, name text, spiel text, info text, facilities text, description text, additional_info text, check_in text, check_out text, max_campers integer, dogs_allowed boolean, active boolean) returns uuid as $$ update campsite_type set name = edit_campsite_type.name @@ -18,6 +18,8 @@ $$ , description = xmlparse(content edit_campsite_type.description) , info = xmlparse(content edit_campsite_type.info) , additional_info = xmlparse(content edit_campsite_type.additional_info) + , check_in = edit_campsite_type.check_in + , check_out = edit_campsite_type.check_out , facilities = xmlparse(content edit_campsite_type.facilities) , media_id = coalesce(edit_campsite_type.media_id, campsite_type.media_id) , max_campers = edit_campsite_type.max_campers @@ -29,7 +31,7 @@ $$ language sql ; -revoke execute on function edit_campsite_type(uuid, integer, text, text, text, text, text, text, integer, boolean, boolean) from public; -grant execute on function edit_campsite_type(uuid, integer, text, text, text, text, text, text, integer, boolean, boolean) to admin; +revoke execute on function edit_campsite_type(uuid, integer, text, text, text, text, text, text, text, text, integer, boolean, boolean) from public; +grant execute on function edit_campsite_type(uuid, integer, text, text, text, text, text, text, text, text, integer, boolean, boolean) to admin; commit; diff --git a/deploy/edit_campsite_type@v1.sql b/deploy/edit_campsite_type@v1.sql new file mode 100644 index 0000000..b248a61 --- /dev/null +++ b/deploy/edit_campsite_type@v1.sql @@ -0,0 +1,35 @@ +-- Deploy camper:edit_campsite_type to pg +-- requires: roles +-- requires: schema_camper +-- requires: campsite_type +-- requires: company + +begin; + +set search_path to camper, public; + +drop function if exists edit_campsite_type(uuid, integer, text, text, text, text, text, integer, boolean, boolean); + +create or replace function edit_campsite_type(slug uuid, media_id integer, name text, spiel text, info text, facilities text, description text, additional_info text, max_campers integer, dogs_allowed boolean, active boolean) returns uuid as +$$ + update campsite_type + set name = edit_campsite_type.name + , spiel = xmlparse(content edit_campsite_type.spiel) + , description = xmlparse(content edit_campsite_type.description) + , info = xmlparse(content edit_campsite_type.info) + , additional_info = xmlparse(content edit_campsite_type.additional_info) + , facilities = xmlparse(content edit_campsite_type.facilities) + , media_id = coalesce(edit_campsite_type.media_id, campsite_type.media_id) + , max_campers = edit_campsite_type.max_campers + , dogs_allowed = edit_campsite_type.dogs_allowed + , active = edit_campsite_type.active + where slug = edit_campsite_type.slug + returning slug; +$$ +language sql +; + +revoke execute on function edit_campsite_type(uuid, integer, text, text, text, text, text, text, integer, boolean, boolean) from public; +grant execute on function edit_campsite_type(uuid, integer, text, text, text, text, text, text, integer, boolean, boolean) to admin; + +commit; diff --git a/deploy/translate_campsite_type.sql b/deploy/translate_campsite_type.sql index e4d6883..ba01615 100644 --- a/deploy/translate_campsite_type.sql +++ b/deploy/translate_campsite_type.sql @@ -7,12 +7,12 @@ begin; set search_path to camper, public; -drop function if exists translate_campsite_type (uuid, text, text, text, text, text, text); +drop function if exists translate_campsite_type (uuid, text, text, text, text, text, text, text); -create or replace function translate_campsite_type (slug uuid, lang_tag text, name text, spiel text, info text, facilities text, description text, additional_info text) returns void as +create or replace function translate_campsite_type (slug uuid, lang_tag text, name text, spiel text, info text, facilities text, description text, additional_info text, check_in text, check_out text) returns void as $$ - insert into campsite_type_i18n (campsite_type_id, lang_tag, name, spiel, info, facilities, description, additional_info) - select campsite_type_id, translate_campsite_type.lang_tag, translate_campsite_type.name, xmlparse(content coalesce(translate_campsite_type.spiel, '')), xmlparse(content coalesce(translate_campsite_type.info, '')), xmlparse(content coalesce(translate_campsite_type.facilities, '')), xmlparse(content coalesce(translate_campsite_type.description, '')), xmlparse(content coalesce(translate_campsite_type.additional_info, '')) + insert into campsite_type_i18n (campsite_type_id, lang_tag, name, spiel, info, facilities, description, additional_info, check_in, check_out) + select campsite_type_id, translate_campsite_type.lang_tag, translate_campsite_type.name, xmlparse(content coalesce(translate_campsite_type.spiel, '')), xmlparse(content coalesce(translate_campsite_type.info, '')), xmlparse(content coalesce(translate_campsite_type.facilities, '')), xmlparse(content coalesce(translate_campsite_type.description, '')), xmlparse(content coalesce(translate_campsite_type.additional_info, '')), coalesce(translate_campsite_type.check_in, ''), coalesce(translate_campsite_type.check_out, '') from campsite_type where slug = translate_campsite_type.slug on conflict (campsite_type_id, lang_tag) do update @@ -22,11 +22,13 @@ $$ , facilities = excluded.facilities , description = excluded.description , additional_info = excluded.additional_info + , check_in = excluded.check_in + , check_out = excluded.check_out $$ language sql ; -revoke execute on function translate_campsite_type (uuid, text, text, text, text, text, text, text) from public; -grant execute on function translate_campsite_type(uuid, text, text, text, text, text, text, text) to admin; +revoke execute on function translate_campsite_type (uuid, text, text, text, text, text, text, text, text, text) from public; +grant execute on function translate_campsite_type(uuid, text, text, text, text, text, text, text, text, text) to admin; commit; diff --git a/deploy/translate_campsite_type@v1.sql b/deploy/translate_campsite_type@v1.sql new file mode 100644 index 0000000..e4d6883 --- /dev/null +++ b/deploy/translate_campsite_type@v1.sql @@ -0,0 +1,32 @@ +-- Deploy camper:translate_campsite_type to pg +-- requires: roles +-- requires: schema_camper +-- requires: campsite_type_i18n + +begin; + +set search_path to camper, public; + +drop function if exists translate_campsite_type (uuid, text, text, text, text, text, text); + +create or replace function translate_campsite_type (slug uuid, lang_tag text, name text, spiel text, info text, facilities text, description text, additional_info text) returns void as +$$ + insert into campsite_type_i18n (campsite_type_id, lang_tag, name, spiel, info, facilities, description, additional_info) + select campsite_type_id, translate_campsite_type.lang_tag, translate_campsite_type.name, xmlparse(content coalesce(translate_campsite_type.spiel, '')), xmlparse(content coalesce(translate_campsite_type.info, '')), xmlparse(content coalesce(translate_campsite_type.facilities, '')), xmlparse(content coalesce(translate_campsite_type.description, '')), xmlparse(content coalesce(translate_campsite_type.additional_info, '')) + from campsite_type + where slug = translate_campsite_type.slug + on conflict (campsite_type_id, lang_tag) do update + set name = excluded.name + , spiel = excluded.spiel + , info = excluded.info + , facilities = excluded.facilities + , description = excluded.description + , additional_info = excluded.additional_info +$$ + language sql +; + +revoke execute on function translate_campsite_type (uuid, text, text, text, text, text, text, text) from public; +grant execute on function translate_campsite_type(uuid, text, text, text, text, text, text, text) to admin; + +commit; diff --git a/pkg/campsite/types/admin.go b/pkg/campsite/types/admin.go index b8e6da4..0634f39 100644 --- a/pkg/campsite/types/admin.go +++ b/pkg/campsite/types/admin.go @@ -167,7 +167,7 @@ func addType(w http.ResponseWriter, r *http.Request, user *auth.User, company *a } processTypeForm(w, r, user, company, conn, f, func(ctx context.Context, tx *database.Tx) error { var err error - f.Slug, err = tx.AddCampsiteType(ctx, company.ID, f.Media.Int(), f.Name[f.DefaultLang].Val, f.Spiel[f.DefaultLang].Val, f.Info[f.DefaultLang].Val, f.Facilities[f.DefaultLang].Val, f.Description[f.DefaultLang].Val, f.AdditionalInfo[f.DefaultLang].Val, f.MaxCampers.Int(), f.DogsAllowed.Checked) + f.Slug, err = tx.AddCampsiteType(ctx, company.ID, f.Media.Int(), f.Name[f.DefaultLang].Val, f.Spiel[f.DefaultLang].Val, f.Info[f.DefaultLang].Val, f.Facilities[f.DefaultLang].Val, f.Description[f.DefaultLang].Val, f.AdditionalInfo[f.DefaultLang].Val, f.CheckIn[f.DefaultLang].Val, f.CheckOut[f.DefaultLang].Val, f.MaxCampers.Int(), f.DogsAllowed.Checked) if err != nil { return err } @@ -184,7 +184,7 @@ func translateTypes(ctx context.Context, tx *database.Tx, company *auth.Company, if l == f.DefaultLang { continue } - if err := tx.TranslateCampsiteType(ctx, f.Slug, lang, f.Name[l].Val, f.Spiel[l].Val, f.Info[l].Val, f.Facilities[l].Val, f.Description[l].Val, f.AdditionalInfo[l].Val); err != nil { + if err := tx.TranslateCampsiteType(ctx, f.Slug, lang, f.Name[l].Val, f.Spiel[l].Val, f.Info[l].Val, f.Facilities[l].Val, f.Description[l].Val, f.AdditionalInfo[l].Val, f.CheckIn[l].Val, f.CheckOut[l].Val); err != nil { return err } } @@ -202,7 +202,7 @@ func setTypePrices(ctx context.Context, tx *database.Tx, slug string, prices map func editType(w http.ResponseWriter, r *http.Request, user *auth.User, company *auth.Company, conn *database.Conn, f *typeForm) { processTypeForm(w, r, user, company, conn, f, func(ctx context.Context, tx *database.Tx) error { - if _, err := tx.EditCampsiteType(ctx, f.Slug, f.Media.Int(), f.Name[f.DefaultLang].Val, f.Spiel[f.DefaultLang].Val, f.Info[f.DefaultLang].Val, f.Facilities[f.DefaultLang].Val, f.Description[f.DefaultLang].Val, f.AdditionalInfo[f.DefaultLang].Val, f.MaxCampers.Int(), f.DogsAllowed.Checked, f.Active.Checked); err != nil { + if _, err := tx.EditCampsiteType(ctx, f.Slug, f.Media.Int(), f.Name[f.DefaultLang].Val, f.Spiel[f.DefaultLang].Val, f.Info[f.DefaultLang].Val, f.Facilities[f.DefaultLang].Val, f.Description[f.DefaultLang].Val, f.AdditionalInfo[f.DefaultLang].Val, f.CheckIn[f.DefaultLang].Val, f.CheckOut[f.DefaultLang].Val, f.MaxCampers.Int(), f.DogsAllowed.Checked, f.Active.Checked); err != nil { return err } if err := translateTypes(ctx, tx, company, f); err != nil { @@ -282,6 +282,8 @@ type typeForm struct { Facilities form.I18nInput Description form.I18nInput AdditionalInfo form.I18nInput + CheckIn form.I18nInput + CheckOut form.I18nInput Prices map[int]*typePriceForm } @@ -317,6 +319,8 @@ func newTypeForm(ctx context.Context, company *auth.Company, conn *database.Conn Facilities: form.NewI18nInput(company.Locales, "facilities"), Description: form.NewI18nInput(company.Locales, "description"), AdditionalInfo: form.NewI18nInput(company.Locales, "additional_info"), + CheckIn: form.NewI18nInput(company.Locales, "check_in"), + CheckOut: form.NewI18nInput(company.Locales, "check_out"), } rows, err := conn.Query(ctx, "select season_id, name from season where active and company_id = $1", company.ID) @@ -356,6 +360,8 @@ func (f *typeForm) FillFromDatabase(ctx context.Context, conn *database.Conn, sl var facilities database.RecordArray var description database.RecordArray var additionalInfo database.RecordArray + var checkIn database.RecordArray + var checkOut database.RecordArray row := conn.QueryRow(ctx, ` select campsite_type.name , campsite_type.spiel::text @@ -363,6 +369,8 @@ func (f *typeForm) FillFromDatabase(ctx context.Context, conn *database.Conn, sl , campsite_type.facilities::text , campsite_type.description::text , campsite_type.additional_info::text + , campsite_type.check_in::text + , campsite_type.check_out::text , media_id::text , max_campers::text , dogs_allowed @@ -373,6 +381,8 @@ func (f *typeForm) FillFromDatabase(ctx context.Context, conn *database.Conn, sl , array_agg((lang_tag, i18n.facilities::text)) , array_agg((lang_tag, i18n.description::text)) , array_agg((lang_tag, i18n.additional_info::text)) + , array_agg((lang_tag, i18n.check_in)) + , array_agg((lang_tag, i18n.check_out)) from campsite_type left join campsite_type_i18n as i18n using (campsite_type_id) where slug = $1 @@ -382,12 +392,14 @@ func (f *typeForm) FillFromDatabase(ctx context.Context, conn *database.Conn, sl , campsite_type.facilities::text , campsite_type.description::text , campsite_type.additional_info::text + , campsite_type.check_in + , campsite_type.check_out , media_id::text , max_campers::text , dogs_allowed , active `, pgx.QueryResultFormats{pgx.BinaryFormatCode}, slug) - if err := row.Scan(&f.Name[f.DefaultLang].Val, &f.Spiel[f.DefaultLang].Val, &f.Info[f.DefaultLang].Val, &f.Facilities[f.DefaultLang].Val, &f.Description[f.DefaultLang].Val, &f.AdditionalInfo[f.DefaultLang].Val, &f.Media.Val, &f.MaxCampers.Val, &f.DogsAllowed.Checked, &f.Active.Checked, &name, &spiel, &info, &facilities, &description, &additionalInfo); err != nil { + if err := row.Scan(&f.Name[f.DefaultLang].Val, &f.Spiel[f.DefaultLang].Val, &f.Info[f.DefaultLang].Val, &f.Facilities[f.DefaultLang].Val, &f.Description[f.DefaultLang].Val, &f.AdditionalInfo[f.DefaultLang].Val, &f.CheckIn[f.DefaultLang].Val, &f.CheckOut[f.DefaultLang].Val, &f.Media.Val, &f.MaxCampers.Val, &f.DogsAllowed.Checked, &f.Active.Checked, &name, &spiel, &info, &facilities, &description, &additionalInfo, &checkIn, &checkOut); err != nil { return err } if err := f.Name.FillArray(name); err != nil { @@ -408,6 +420,12 @@ func (f *typeForm) FillFromDatabase(ctx context.Context, conn *database.Conn, sl if err := f.AdditionalInfo.FillArray(additionalInfo); err != nil { return err } + if err := f.CheckIn.FillArray(checkIn); err != nil { + return err + } + if err := f.CheckOut.FillArray(checkOut); err != nil { + return err + } rows, err := conn.Query(ctx, ` select season_id @@ -450,6 +468,8 @@ func (f *typeForm) Parse(r *http.Request) error { f.Facilities.FillValue(r) f.Description.FillValue(r) f.AdditionalInfo.FillValue(r) + f.CheckIn.FillValue(r) + f.CheckOut.FillValue(r) f.Media.FillValue(r) for _, p := range f.Prices { p.PricePerNight.FillValue(r) @@ -463,6 +483,8 @@ func (f *typeForm) Valid(ctx context.Context, conn *database.Conn, l *locale.Loc if v.CheckRequired(f.Name[f.DefaultLang], l.GettextNoop("Name can not be empty.")) { v.CheckMinLength(f.Name[f.DefaultLang], 1, l.GettextNoop("Name must have at least one letter.")) } + v.CheckRequired(f.CheckIn[f.DefaultLang], l.GettextNoop("Check-in can not be empty.")) + v.CheckRequired(f.CheckOut[f.DefaultLang], l.GettextNoop("Check-out can not be empty.")) if v.CheckRequired(f.Media.Input, l.GettextNoop("Cover image can not be empty.")) { if _, err := v.CheckImageMedia(ctx, conn, f.Media.Input, l.GettextNoop("Cover image must be an image media type.")); err != nil { return false, err diff --git a/pkg/campsite/types/public.go b/pkg/campsite/types/public.go index 2b0237d..96e0b92 100644 --- a/pkg/campsite/types/public.go +++ b/pkg/campsite/types/public.go @@ -76,6 +76,8 @@ type publicPage struct { Facilities gotemplate.HTML Description gotemplate.HTML AdditionalInfo gotemplate.HTML + CheckIn string + CheckOut string } type typePrice struct { @@ -125,6 +127,8 @@ func newPublicPage(ctx context.Context, company *auth.Company, conn *database.Co , coalesce(i18n.facilities, campsite_type.facilities)::text as l10n_facilities , coalesce(i18n.description, campsite_type.description)::text as l10n_description , coalesce(i18n.additional_info, campsite_type.additional_info)::text as l10n_description + , coalesce(i18n.check_in, campsite_type.check_in)::text as l10n_check_in + , coalesce(i18n.check_out, campsite_type.check_out)::text as l10n_check_out , dogs_allowed , '3.50' as dogs_prices from campsite_type @@ -132,7 +136,7 @@ func newPublicPage(ctx context.Context, company *auth.Company, conn *database.Co where slug = $2 and active `, loc.Language, slug) - if err := row.Scan(&page.Name, &page.Spiel, &page.Info, &page.Facilities, &page.Description, &page.AdditionalInfo, &page.DogsAllowed, &page.DogsPrice); err != nil { + if err := row.Scan(&page.Name, &page.Spiel, &page.Info, &page.Facilities, &page.Description, &page.AdditionalInfo, &page.CheckIn, &page.CheckOut, &page.DogsAllowed, &page.DogsPrice); err != nil { return nil, err } if err := conn.QueryRow(ctx, "select to_price(tourist_tax, $1) from company where company_id = $2", company.DecimalDigits, company.ID).Scan(&page.TouristTax); err != nil { diff --git a/pkg/database/funcs.go b/pkg/database/funcs.go index 104bb95..e5341bc 100644 --- a/pkg/database/funcs.go +++ b/pkg/database/funcs.go @@ -11,12 +11,12 @@ import ( "golang.org/x/text/language" ) -func (tx *Tx) AddCampsiteType(ctx context.Context, companyID int, mediaID int, name string, spiel string, info string, facilities string, description string, additionalInfo string, maxCampers int, dogsAllowed bool) (string, error) { - return tx.GetText(ctx, "select add_campsite_type($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)", companyID, mediaID, name, spiel, info, facilities, description, additionalInfo, maxCampers, dogsAllowed) +func (tx *Tx) AddCampsiteType(ctx context.Context, companyID int, mediaID int, name string, spiel string, info string, facilities string, description string, additionalInfo string, checkIn string, checkOut string, maxCampers int, dogsAllowed bool) (string, error) { + return tx.GetText(ctx, "select add_campsite_type($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)", companyID, mediaID, name, spiel, info, facilities, description, additionalInfo, checkIn, checkOut, maxCampers, dogsAllowed) } -func (tx *Tx) EditCampsiteType(ctx context.Context, slug string, mediaID int, name string, spiel string, info string, facilities string, description string, additionalInfo string, maxCampers int, dogsAllowed bool, active bool) (string, error) { - return tx.GetText(ctx, "select edit_campsite_type($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)", slug, mediaID, name, spiel, info, facilities, description, additionalInfo, maxCampers, dogsAllowed, active) +func (tx *Tx) EditCampsiteType(ctx context.Context, slug string, mediaID int, name string, spiel string, info string, facilities string, description string, additionalInfo string, checkIn string, checkOut string, maxCampers int, dogsAllowed bool, active bool) (string, error) { + return tx.GetText(ctx, "select edit_campsite_type($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13)", slug, mediaID, name, spiel, info, facilities, description, additionalInfo, checkIn, checkOut, maxCampers, dogsAllowed, active) } func (c *Conn) OrderCampsiteTypes(ctx context.Context, slugs []string) error { @@ -24,8 +24,8 @@ func (c *Conn) OrderCampsiteTypes(ctx context.Context, slugs []string) error { return err } -func (tx *Tx) TranslateCampsiteType(ctx context.Context, slug string, langTag language.Tag, name string, spiel string, info string, facilities string, description string, additionalInfo string) error { - _, err := tx.Exec(ctx, "select translate_campsite_type($1, $2, $3, $4, $5, $6, $7, $8)", slug, langTag, name, spiel, info, facilities, description, additionalInfo) +func (tx *Tx) TranslateCampsiteType(ctx context.Context, slug string, langTag language.Tag, name string, spiel string, info string, facilities string, description string, additionalInfo string, checkIn string, checkOut string) error { + _, err := tx.Exec(ctx, "select translate_campsite_type($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)", slug, langTag, name, spiel, info, facilities, description, additionalInfo, checkIn, checkOut) return err } func (tx *Tx) SetCampsiteTypeCost(ctx context.Context, slug string, seasonID int, minNights int, costPerNight string) error { diff --git a/po/ca.po b/po/ca.po index 67237e4..f5c63a8 100644 --- a/po/ca.po +++ b/po/ca.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: camper\n" "Report-Msgid-Bugs-To: jordi@tandem.blog\n" -"POT-Creation-Date: 2024-01-22 03:38+0100\n" +"POT-Creation-Date: 2024-01-22 19:51+0100\n" "PO-Revision-Date: 2023-07-22 23:45+0200\n" "Last-Translator: jordi fita masFeatures
', '', 'Dunno
', '', 5, true) $$, + $$ select add_campsite_type(1, 3, 'Type A', '', 'Features
', '', 'Dunno
', '', 'After 4 p.m.', '12 a.m.', 5, true) $$, 'Should be able to add a campsite type to the first company' ); select lives_ok( - $$ select add_campsite_type(2, 4, 'Type B', 'One
Two
', '', 'Pricing
', '', 'More
', 2, false) $$, + $$ select add_campsite_type(2, 4, 'Type B', 'One
Two
', '', 'Pricing
', '', 'More
', 'After 9 p.m.', '9 a.m.', 2, false) $$, 'Should be able to add a campsite type to the second company' ); select bag_eq( - $$ select company_id, media_id, name, spiel::text, info::text, facilities::text, description::text, additional_info::text, active, max_campers, dogs_allowed from campsite_type $$, - $$ values (1, 3, 'Type A', '', 'Features
', '', 'Dunno
', '', true, 5, true) - , (2, 4, 'Type B', 'One
Two
', '', 'Pricing
', '', 'More
', true, 2, false) + $$ select company_id, media_id, name, spiel::text, info::text, facilities::text, description::text, additional_info::text, check_in, check_out, active, max_campers, dogs_allowed from campsite_type $$, + $$ values (1, 3, 'Type A', '', 'Features
', '', 'Dunno
', '', 'After 4 p.m.', '12 a.m.', true, 5, true) + , (2, 4, 'Type B', 'One
Two
', '', 'Pricing
', '', 'More
', 'After 9 p.m.', '9 a.m.', true, 2, false) $$, 'Should have added all two campsite type' ); diff --git a/test/campsite_type.sql b/test/campsite_type.sql index 69bb647..3563043 100644 --- a/test/campsite_type.sql +++ b/test/campsite_type.sql @@ -5,7 +5,7 @@ reset client_min_messages; begin; -select plan(86); +select plan(96); set search_path to camper, public; @@ -88,6 +88,18 @@ select col_type_is('campsite_type', 'dogs_allowed', 'boolean'); select col_not_null('campsite_type', 'dogs_allowed'); select col_hasnt_default('campsite_type', 'dogs_allowed'); +select has_column('campsite_type', 'check_in'); +select col_type_is('campsite_type', 'check_in', 'text'); +select col_not_null('campsite_type', 'check_in'); +select col_has_default('campsite_type', 'check_in'); +select col_default_is('campsite_type', 'check_in', ''); + +select has_column('campsite_type', 'check_out'); +select col_type_is('campsite_type', 'check_out', 'text'); +select col_not_null('campsite_type', 'check_out'); +select col_has_default('campsite_type', 'check_out'); +select col_default_is('campsite_type', 'check_out', ''); + select has_column('campsite_type', 'active'); select col_type_is('campsite_type', 'active', 'boolean'); select col_not_null('campsite_type', 'active'); diff --git a/test/campsite_type_i18n.sql b/test/campsite_type_i18n.sql index ee5201f..cbbbf26 100644 --- a/test/campsite_type_i18n.sql +++ b/test/campsite_type_i18n.sql @@ -5,7 +5,7 @@ reset client_min_messages; begin; -select plan(43); +select plan(51); set search_path to camper, public; @@ -61,6 +61,16 @@ select col_type_is('campsite_type_i18n', 'additional_info', 'xml'); select col_not_null('campsite_type_i18n', 'additional_info'); select col_hasnt_default('campsite_type_i18n', 'additional_info'); +select has_column('campsite_type_i18n', 'check_in'); +select col_type_is('campsite_type_i18n', 'check_in', 'text'); +select col_not_null('campsite_type_i18n', 'check_in'); +select col_hasnt_default('campsite_type_i18n', 'check_in'); + +select has_column('campsite_type_i18n', 'check_out'); +select col_type_is('campsite_type_i18n', 'check_out', 'text'); +select col_not_null('campsite_type_i18n', 'check_out'); +select col_hasnt_default('campsite_type_i18n', 'check_out'); + select * from finish(); diff --git a/test/edit_campsite_type.sql b/test/edit_campsite_type.sql index 385f5ba..1650fd2 100644 --- a/test/edit_campsite_type.sql +++ b/test/edit_campsite_type.sql @@ -9,15 +9,15 @@ set search_path to camper, public; select plan(12); -select has_function('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean']); -select function_lang_is('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean'], 'sql'); -select function_returns('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean'], 'uuid'); -select isnt_definer('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean']); -select volatility_is('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean'], 'volatile'); -select function_privs_are('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean'], 'guest', array[]::text[]); -select function_privs_are('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean'], 'employee', array[]::text[]); -select function_privs_are('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean'], 'admin', array['EXECUTE']); -select function_privs_are('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean'], 'authenticator', array[]::text[]); +select has_function('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean']); +select function_lang_is('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean'], 'sql'); +select function_returns('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean'], 'uuid'); +select isnt_definer('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean']); +select volatility_is('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean'], 'volatile'); +select function_privs_are('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean'], 'guest', array[]::text[]); +select function_privs_are('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean'], 'employee', array[]::text[]); +select function_privs_are('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean'], 'admin', array['EXECUTE']); +select function_privs_are('camper', 'edit_campsite_type', array ['uuid', 'integer', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'integer', 'boolean', 'boolean'], 'authenticator', array[]::text[]); set client_min_messages to warning; truncate campsite_type cascade; @@ -43,25 +43,25 @@ values (2, 1, 'cover2.xpm', sha256('static char *s[]={"1 1 1 1","a c #ffffff","a , (4, 1, 'cover4.xpm', sha256('static char *s[]={"1 1 1 1","a c #ffff00","a"};')) ; -insert into campsite_type (company_id, slug, media_id, name, spiel, info, facilities, description, additional_info, max_campers, dogs_allowed, active) -values (1, '87452b88-b48f-48d3-bb6c-0296de64164e', 2, 'Type A', 'info 1
', 'facilities A
', 'A
', 'Additional A
', 5, false, true) - , (1, '9b6370f7-f941-46f2-bc6e-de455675bd0a', 3, 'Type B', 'info 2
', 'facilities B
', 'B
', 'Additional B
', 4, true, false) +insert into campsite_type (company_id, slug, media_id, name, spiel, info, facilities, description, additional_info, check_in, check_out, max_campers, dogs_allowed, active) +values (1, '87452b88-b48f-48d3-bb6c-0296de64164e', 2, 'Type A', 'info 1
', 'facilities A
', 'A
', 'Additional A
', '', '', 5, false, true) + , (1, '9b6370f7-f941-46f2-bc6e-de455675bd0a', 3, 'Type B', 'info 2
', 'facilities B
', 'B
', 'Additional B
', '', '', 4, true, false) ; select lives_ok( - $$ select edit_campsite_type('87452b88-b48f-48d3-bb6c-0296de64164e', 4, 'Type 1', 'Features A
', 'Pricing 1
', '1
', 'Additional 1
', 2, true, false) $$, + $$ select edit_campsite_type('87452b88-b48f-48d3-bb6c-0296de64164e', 4, 'Type 1', 'Features A
', 'Pricing 1
', '1
', 'Additional 1
', 'Check-in 1', 'Check-out 1', 2, true, false) $$, 'Should be able to edit the first type' ); select lives_ok( - $$ select edit_campsite_type('9b6370f7-f941-46f2-bc6e-de455675bd0a', null, 'Type 2', 'Features B
', 'Pricing 2
', '2
', 'Additional 2
', 9, false, true) $$, + $$ select edit_campsite_type('9b6370f7-f941-46f2-bc6e-de455675bd0a', null, 'Type 2', 'Features B
', 'Pricing 2
', '2
', 'Additional 2
', 'Check-in 2', 'Check-out 2', 9, false, true) $$, 'Should be able to edit the second type' ); select bag_eq( - $$ select slug::text, media_id, name, spiel::text, info::text, facilities::text, description::text, additional_info::text, max_campers, dogs_allowed, active from campsite_type $$, - $$ values ('87452b88-b48f-48d3-bb6c-0296de64164e', 4, 'Type 1', 'Features A
', 'Pricing 1
', '1
', 'Additional 1
', 2, true, false) - , ('9b6370f7-f941-46f2-bc6e-de455675bd0a', 3, 'Type 2', 'Features B
', 'Pricing 2
', '2
', 'Additional 2
', 9, false, true) + $$ select slug::text, media_id, name, spiel::text, info::text, facilities::text, description::text, additional_info::text, check_in, check_out, max_campers, dogs_allowed, active from campsite_type $$, + $$ values ('87452b88-b48f-48d3-bb6c-0296de64164e', 4, 'Type 1', 'Features A
', 'Pricing 1
', '1
', 'Additional 1
', 'Check-in 1', 'Check-out 1', 2, true, false) + , ('9b6370f7-f941-46f2-bc6e-de455675bd0a', 3, 'Type 2', 'Features B
', 'Pricing 2
', '2
', 'Additional 2
', 'Check-in 2', 'Check-out 2', 9, false, true) $$, 'Should have updated all campsite types.' ); diff --git a/test/translate_campsite_type.sql b/test/translate_campsite_type.sql index 8dce5aa..3b134fd 100644 --- a/test/translate_campsite_type.sql +++ b/test/translate_campsite_type.sql @@ -9,15 +9,15 @@ select plan(13); set search_path to camper, public; -select has_function('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text', 'text']); -select function_lang_is('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text', 'text'], 'sql'); -select function_returns('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text', 'text'], 'void'); -select isnt_definer('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text', 'text']); -select volatility_is('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text', 'text'], 'volatile'); -select function_privs_are('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text', 'text'], 'guest', array[]::text[]); -select function_privs_are('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text', 'text'], 'employee', array[]::text[]); -select function_privs_are('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text', 'text'], 'admin', array['EXECUTE']); -select function_privs_are('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text', 'text'], 'authenticator', array[]::text[]); +select has_function('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text']); +select function_lang_is('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text'], 'sql'); +select function_returns('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text'], 'void'); +select isnt_definer('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text']); +select volatility_is('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text'], 'volatile'); +select function_privs_are('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text'], 'guest', array[]::text[]); +select function_privs_are('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text'], 'employee', array[]::text[]); +select function_privs_are('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text'], 'admin', array['EXECUTE']); +select function_privs_are('camper', 'translate_campsite_type', array['uuid', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text'], 'authenticator', array[]::text[]); set client_min_messages to warning; @@ -43,36 +43,36 @@ values (2, 1, 'cover2.xpm', sha256('static char *s[]={"1 1 1 1","a c #ffffff","a , (4, 1, 'cover4.xpm', sha256('static char *s[]={"1 1 1 1","a c #ffff00","a"};')) ; -insert into campsite_type (company_id, slug, media_id, name, spiel, info, facilities, description, additional_info, active, dogs_allowed, max_campers) -values (1, '87452b88-b48f-48d3-bb6c-0296de64164e', 2, 'Type A', 'Features A
', 'Pricing A
', 'A
', 'Additional A
', true, false, 4) - , (1, '9b6370f7-f941-46f2-bc6e-de455675bd0a', 3, 'Type B', 'Features B
', 'Pricing B
', 'B
', 'Additional B
', false, true, 5) +insert into campsite_type (company_id, slug, media_id, name, spiel, info, facilities, description, additional_info, check_in, check_out, active, dogs_allowed, max_campers) +values (1, '87452b88-b48f-48d3-bb6c-0296de64164e', 2, 'Type A', 'Features A
', 'Pricing A
', 'A
', 'Additional A
', '', '', true, false, 4) + , (1, '9b6370f7-f941-46f2-bc6e-de455675bd0a', 3, 'Type B', 'Features B
', 'Pricing B
', 'B
', 'Additional B
', '', '', false, true, 5) ; -insert into campsite_type_i18n (campsite_type_id, lang_tag, name, spiel, info, facilities, description, additional_info) -select campsite_type_id, 'ca', 'tipusb', 'característiques b
', 'preus b
', 'B
', 'B addicional
' from campsite_type +insert into campsite_type_i18n (campsite_type_id, lang_tag, name, spiel, info, facilities, description, additional_info, check_in, check_out) +select campsite_type_id, 'ca', 'tipusb', 'característiques b
', 'preus b
', 'B
', 'B addicional
', 'entrada', 'sortida' from campsite_type where slug = '9b6370f7-f941-46f2-bc6e-de455675bd0a' ; select lives_ok( - $$ select translate_campsite_type('87452b88-b48f-48d3-bb6c-0296de64164e', 'ca', 'Tipus A', null, 'Característiques A
', null, 'a
', null) $$, + $$ select translate_campsite_type('87452b88-b48f-48d3-bb6c-0296de64164e', 'ca', 'Tipus A', null, 'Característiques A
', null, 'a
', null, 'CI1', null) $$, 'Should be able to translate the first type' ); select lives_ok( - $$ select translate_campsite_type('9b6370f7-f941-46f2-bc6e-de455675bd0a', 'es', 'Tipo B', 'Precios B
', null, 'B adicional
') $$, + $$ select translate_campsite_type('9b6370f7-f941-46f2-bc6e-de455675bd0a', 'es', 'Tipo B', 'Precios B
', null, 'B adicional
', null, 'CO2') $$, 'Should be able to translate the second type' ); select lives_ok( - $$ select translate_campsite_type('9b6370f7-f941-46f2-bc6e-de455675bd0a', 'ca', 'Tipus B', 'Característiques B
', 'Preus B
', '2
', '2 addicional
') $$, + $$ select translate_campsite_type('9b6370f7-f941-46f2-bc6e-de455675bd0a', 'ca', 'Tipus B', 'Característiques B
', 'Preus B
', '2
', '2 addicional
', 'E2', 'S2') $$, 'Should be able to overwrite the catalan translation of the second type' ); select bag_eq( - $$ select slug::text, lang_tag, i18n.name, i18n.spiel::text, i18n.info::text, i18n.facilities::text, i18n.description::text, i18n.additional_info::text from campsite_type_i18n as i18n join campsite_type using (campsite_type_id) $$, - $$ values ('87452b88-b48f-48d3-bb6c-0296de64164e', 'ca', 'Tipus A', '', 'Característiques A
', '', 'a
', '') - , ('9b6370f7-f941-46f2-bc6e-de455675bd0a', 'ca', 'Tipus B', 'Característiques B
', 'Preus B
', '2
', '2 addicional
') - , ('9b6370f7-f941-46f2-bc6e-de455675bd0a', 'es', 'Tipo B', 'Precios B
', '', 'B adicional
') + $$ select slug::text, lang_tag, i18n.name, i18n.spiel::text, i18n.info::text, i18n.facilities::text, i18n.description::text, i18n.additional_info::text, i18n.check_in, i18n.check_out from campsite_type_i18n as i18n join campsite_type using (campsite_type_id) $$, + $$ values ('87452b88-b48f-48d3-bb6c-0296de64164e', 'ca', 'Tipus A', '', 'Característiques A
', '', 'a
', '', 'CI1', '') + , ('9b6370f7-f941-46f2-bc6e-de455675bd0a', 'ca', 'Tipus B', 'Característiques B
', 'Preus B
', '2
', '2 addicional
', 'E2', 'S2') + , ('9b6370f7-f941-46f2-bc6e-de455675bd0a', 'es', 'Tipo B', 'Precios B
', '', 'B adicional
', '', 'CO2') $$, 'Should have added and updated all translations.' ); diff --git a/verify/add_campsite_type.sql b/verify/add_campsite_type.sql index df37c7d..fb9b83d 100644 --- a/verify/add_campsite_type.sql +++ b/verify/add_campsite_type.sql @@ -2,6 +2,6 @@ begin; -select has_function_privilege('camper.add_campsite_type(integer, integer, text, text, text, text, text, text, integer, boolean)', 'execute'); +select has_function_privilege('camper.add_campsite_type(integer, integer, text, text, text, text, text, text, text, text, integer, boolean)', 'execute'); rollback; diff --git a/verify/add_campsite_type@v1.sql b/verify/add_campsite_type@v1.sql new file mode 100644 index 0000000..df37c7d --- /dev/null +++ b/verify/add_campsite_type@v1.sql @@ -0,0 +1,7 @@ +-- Verify camper:add_campsite_type on pg + +begin; + +select has_function_privilege('camper.add_campsite_type(integer, integer, text, text, text, text, text, text, integer, boolean)', 'execute'); + +rollback; diff --git a/verify/campsite_type__check_in_out.sql b/verify/campsite_type__check_in_out.sql new file mode 100644 index 0000000..53dc5b1 --- /dev/null +++ b/verify/campsite_type__check_in_out.sql @@ -0,0 +1,11 @@ +-- Verify camper:campsite_type__check_in_out on pg + +begin; + +select check_in + , check_out +from camper.campsite_type +where false +; + +rollback; diff --git a/verify/campsite_type_i18n__check_in_out.sql b/verify/campsite_type_i18n__check_in_out.sql new file mode 100644 index 0000000..790a70a --- /dev/null +++ b/verify/campsite_type_i18n__check_in_out.sql @@ -0,0 +1,11 @@ +-- Verify camper:campsite_type_i18n__check_in_out on pg + +begin; + +select check_in + , check_out +from camper.campsite_type_i18n +where false +; + +rollback; diff --git a/verify/edit_campsite_type.sql b/verify/edit_campsite_type.sql index 35112d0..6702754 100644 --- a/verify/edit_campsite_type.sql +++ b/verify/edit_campsite_type.sql @@ -2,6 +2,6 @@ begin; -select has_function_privilege('camper.edit_campsite_type(uuid, integer, text, text, text, text, text, text, integer, boolean, boolean)', 'execute'); +select has_function_privilege('camper.edit_campsite_type(uuid, integer, text, text, text, text, text, text, text, text, integer, boolean, boolean)', 'execute'); rollback; diff --git a/verify/edit_campsite_type@v1.sql b/verify/edit_campsite_type@v1.sql new file mode 100644 index 0000000..35112d0 --- /dev/null +++ b/verify/edit_campsite_type@v1.sql @@ -0,0 +1,7 @@ +-- Verify camper:edit_campsite_type on pg + +begin; + +select has_function_privilege('camper.edit_campsite_type(uuid, integer, text, text, text, text, text, text, integer, boolean, boolean)', 'execute'); + +rollback; diff --git a/verify/translate_campsite_type.sql b/verify/translate_campsite_type.sql index 6c63455..1a35675 100644 --- a/verify/translate_campsite_type.sql +++ b/verify/translate_campsite_type.sql @@ -2,6 +2,6 @@ begin; -select has_function_privilege('camper.translate_campsite_type(uuid, text, text, text, text, text, text, text)', 'execute'); +select has_function_privilege('camper.translate_campsite_type(uuid, text, text, text, text, text, text, text, text, text)', 'execute'); rollback; diff --git a/verify/translate_campsite_type@v1.sql b/verify/translate_campsite_type@v1.sql new file mode 100644 index 0000000..6c63455 --- /dev/null +++ b/verify/translate_campsite_type@v1.sql @@ -0,0 +1,7 @@ +-- Verify camper:translate_campsite_type on pg + +begin; + +select has_function_privilege('camper.translate_campsite_type(uuid, text, text, text, text, text, text, text)', 'execute'); + +rollback; diff --git a/web/templates/admin/campsite/type/form.gohtml b/web/templates/admin/campsite/type/form.gohtml index 33e4cd8..1ac31dd 100644 --- a/web/templates/admin/campsite/type/form.gohtml +++ b/web/templates/admin/campsite/type/form.gohtml @@ -62,6 +62,32 @@ {{ with .Media -}} {{ template "media-picker" . }} {{- end }} + {{ with .CheckIn -}} + + {{- end }} + {{ with .CheckOut -}} + + {{- end }} {{ with .MaxCampers -}}