rentease/config/host.go

72 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 {
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
// If true, a tax item will be added to the invoice
Taxable bool // TODO: create taxes auto if taxable item
}
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": {
Price: 59.0,
CalendarId: os.Getenv("CALENDAR_ID_T2"),
MustSyncCalendar: true,
HasEndDate: true,
Taxable: true,
},
"T3": {
Price: 80.0,
CalendarId: os.Getenv("CALENDAR_ID_T3"),
MustSyncCalendar: true,
HasEndDate: true,
Taxable: true,
},
"Airport": {
Price: 25.0,
},
"Port": {
Price: 20.0,
},
"Transport": {
Price: 20.0,
},
"Taxes": { // TODO: remove after auto creation enabled
Price: 1.5,
},
},
}
}