rentease/internal/config/host.go
Ruidy a0b7672e9e
Some checks are pending
CI / checks (push) Waiting to run
feat(payments): add Stripe dashboard links for card payments
- Add `APP_STRIPE_ACCOUNT_ID` to config and README.
- Pass Stripe account ID to payment view models.
- Show "View in Stripe" badge linking to the payment in Stripe dashboard
  for card payments when account ID and payment ID are present.
- Update Makefile to run format/lint locally instead of in container.
- Update templates and generated code to support new dashboard link.
2025-11-16 18:04:35 +01:00

85 lines
1.9 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
StripeAccountID string
}
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
StripeAccountID: os.Getenv("APP_STRIPE_ACCOUNT_ID"),
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,
},
},
}
}