rentease/config/host.go
Ruidy d4e6b35a96
Create taxes for taxable items automatically (#16)
* refactor return error when building booking service

* fix the description

* set taxable item by amount

* auto create tax items if the item is taxable

* fix linter

* remove legacy tax entry

* display multiple items

* use the price from the form

* improve item sorting

* lintfix
2024-08-26 21:44:31 +02:00

75 lines
1.7 KiB
Go

package config
import "os"
type Host struct {
Items map[string]HostItem
Name string
Address string
City string
ZipCode string
PhoneNumber string
Email string
InvoicePrefix string
PaymentMethods []string
Platforms []string
CustomerSeed int
}
type HostItem struct {
Name string
CalendarId string
// Price is the daily price in EUR
Price float64
// If true, the item will be added to the calendar
MustSyncCalendar bool
HasEndDate bool
// Amount of taxes in EUR. If not zero, a tax item will be added to the invoice
Taxes float64
}
func NewHost() *Host {
return &Host{
Name: "VillaFleurie",
Address: "4 rue Gerty Archimede",
City: "Le Gosier",
ZipCode: "97190",
PhoneNumber: "+590 690 44 15 30",
Email: "location.villafleurie@gmail.com",
CustomerSeed: 239,
InvoicePrefix: "VFNI",
PaymentMethods: []string{"Card", "Cash", "Cheque", "Transfer"}, // TODO: add to DB
Platforms: []string{"Booking", "AirBnb", "TripAdvisor", "Other"}, // TODO: add to DB
Items: map[string]HostItem{ // TODO: move to DB
"T2": {
Name: "T2",
Price: 59.0,
CalendarId: os.Getenv("CALENDAR_ID_T2"),
MustSyncCalendar: true,
HasEndDate: true,
Taxes: 1.5,
},
"T3": {
Name: "T3",
Price: 80.0,
CalendarId: os.Getenv("CALENDAR_ID_T3"),
MustSyncCalendar: true,
HasEndDate: true,
Taxes: 1.5,
},
"Airport": {
Name: "Airport",
Price: 25.0,
},
"Port": {
Name: "Port",
Price: 20.0,
},
"Transport": {
Name: "Transport",
Price: 20.0,
},
},
}
}