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) DateInYear(year int) time.Time
- func (h *HomeFaker) HouseProfile() HouseProfile
- func (h *HomeFaker) Incident() Incident
- 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) ServiceLogEntryAt(servicedAt time.Time) ServiceLogEntry
- func (h *HomeFaker) Vendor() Vendor
- func (h *HomeFaker) VendorForTrade(trade string) Vendor
- type HouseProfile
- type Incident
- 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).
const ( IncidentStatusOpen = "open" IncidentStatusInProgress = "in_progress" )
Incident statuses (mirrors data.IncidentStatus* constants). Duplicated here because data imports fake, so fake cannot import data without creating a circular dependency.
const ( IncidentSeverityUrgent = "urgent" IncidentSeveritySoon = "soon" IncidentSeverityWhenever = "whenever" )
Incident severities (mirrors data.IncidentSeverity* constants). Duplicated here because data imports fake, so fake cannot import data without creating a circular dependency.
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) DateInYear ¶ added in v1.33.0
DateInYear returns a random date within the given calendar year.
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) ServiceLogEntryAt ¶ added in v1.33.0
func (h *HomeFaker) ServiceLogEntryAt(servicedAt time.Time) ServiceLogEntry
ServiceLogEntryAt generates a service log entry with the given service date.
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 Incident ¶ added in v1.36.0
type Incident struct {
Title string
Description string
Status string
Severity string
DateNoticed time.Time
Location string
CostCents *int64
}
Incident holds generated incident 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.