Documentation
¶
Overview ¶
Package fake provides a home-domain data generator built on gofakeit. It produces realistic but randomized data for houses, projects, vendors, appliances, maintenance items, service logs, and quotes.
All output types are defined within this package (no dependency on internal/data) so callers can map to their own model types without creating import cycles.
Index ¶
- Constants
- func MaintenanceCategories() []string
- func ProjectTypes() []string
- func VendorTrades() []string
- type Appliance
- type HomeFaker
- func (h *HomeFaker) Appliance() Appliance
- func (h *HomeFaker) HouseProfile() HouseProfile
- func (h *HomeFaker) IntN(n int) int
- func (h *HomeFaker) MaintenanceItem(categoryName string) MaintenanceItem
- func (h *HomeFaker) Project(typeName string) Project
- func (h *HomeFaker) Quote() Quote
- func (h *HomeFaker) ServiceLogEntry() ServiceLogEntry
- func (h *HomeFaker) Vendor() Vendor
- func (h *HomeFaker) VendorForTrade(trade string) Vendor
- type HouseProfile
- type MaintenanceItem
- type Project
- type Quote
- type ServiceLogEntry
- type Vendor
Constants ¶
const ( StatusIdeating = "ideating" StatusPlanned = "planned" StatusQuoted = "quoted" StatusInProgress = "underway" StatusDelayed = "delayed" StatusCompleted = "completed" StatusAbandoned = "abandoned" )
Project statuses (mirrors data.ProjectStatus* constants).
Variables ¶
This section is empty.
Functions ¶
func MaintenanceCategories ¶
func MaintenanceCategories() []string
MaintenanceCategories returns the list of known maintenance category names.
func ProjectTypes ¶
func ProjectTypes() []string
ProjectTypes returns the list of known project type names.
func VendorTrades ¶
func VendorTrades() []string
VendorTrades returns the list of vendor trade specializations.
Types ¶
type Appliance ¶
type Appliance struct {
Name string
Brand string
ModelNumber string
SerialNumber string
Location string
PurchaseDate *time.Time
WarrantyExpiry *time.Time
CostCents *int64
}
Appliance holds generated appliance data.
type HomeFaker ¶
type HomeFaker struct {
// contains filtered or unexported fields
}
HomeFaker wraps gofakeit with home-domain generators.
func (*HomeFaker) Appliance ¶
Appliance generates an appliance with brand, model, serial, and location.
func (*HomeFaker) HouseProfile ¶
func (h *HomeFaker) HouseProfile() HouseProfile
HouseProfile generates a complete house profile with realistic specs.
func (*HomeFaker) IntN ¶
IntN returns a random int in [0, n). Exposed so callers can use the faker's RNG for loop counts and other randomized decisions.
func (*HomeFaker) MaintenanceItem ¶
func (h *HomeFaker) MaintenanceItem(categoryName string) MaintenanceItem
MaintenanceItem generates a maintenance item for the given category.
func (*HomeFaker) ServiceLogEntry ¶
func (h *HomeFaker) ServiceLogEntry() ServiceLogEntry
ServiceLogEntry generates a service log entry.
func (*HomeFaker) VendorForTrade ¶
VendorForTrade generates a vendor specializing in the given trade.
type HouseProfile ¶
type HouseProfile struct {
Nickname string
AddressLine1 string
City string
State string
PostalCode string
YearBuilt int
SquareFeet int
LotSquareFeet int
Bedrooms int
Bathrooms float64
FoundationType string
WiringType string
RoofType string
ExteriorType string
HeatingType string
CoolingType string
WaterSource string
SewerType string
ParkingType string
BasementType string
InsuranceCarrier string
InsurancePolicy string
InsuranceRenewal *time.Time
PropertyTaxCents *int64
HOAName string
HOAFeeCents *int64
}
HouseProfile holds generated house data.
type MaintenanceItem ¶
type MaintenanceItem struct {
Name string
CategoryName string
IntervalMonths int
Notes string
LastServicedAt *time.Time
CostCents *int64
}
MaintenanceItem holds generated maintenance item data.
type Project ¶
type Project struct {
Title string
TypeName string
Status string
Description string
StartDate *time.Time
EndDate *time.Time
BudgetCents *int64
ActualCents *int64
}
Project holds generated project data.
type Quote ¶
type Quote struct {
TotalCents int64
LaborCents *int64
MaterialsCents *int64
ReceivedDate *time.Time
Notes string
}
Quote holds generated quote data.
type ServiceLogEntry ¶
ServiceLogEntry holds generated service log data.