rentease/internal/config/host.go
Ruidy ac94faedb0
refactor: unify ID and API key naming conventions
This commit standardizes the naming of identifier and API key fields
across the codebase to use consistent camel case (e.g., `ID`, `APIKey`,
`DatabaseURL`). This includes updates to struct fields, method names,
function parameters, and environment variable references. The changes
improve code clarity and maintainability by reducing ambiguity and
aligning with Go naming conventions. No functional behavior is changed.
2025-10-03 19:47:41 +02:00

83 lines
1.8 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 []PaymentMethod
Platforms []Platform
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: []PaymentMethod{"Card", "Cash", "Cheque", "Transfer"}, // TODO: add to DB
Platforms: []Platform{"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,
},
"LuggageStorage": {
Name: "LuggageStorage",
Price: 30.0,
},
},
}
}