to much to describe, everything in PR

This commit is contained in:
2026-03-24 20:25:18 +05:00
parent 36f2551c60
commit 87df56f41e
13 changed files with 1138 additions and 290 deletions

View File

@@ -57,6 +57,13 @@ type Config struct {
Issuer string `koanf:"issuer"`
Audience string `koanf:"audience"`
} `koanf:"jwt"`
Pricing struct {
BaseFee float64 `koanf:"baseFee"`
PerKm float64 `koanf:"perKm"`
PerKg float64 `koanf:"perKg"`
PerM3 float64 `koanf:"perM3"`
} `koanf:"pricing"`
}
func NewConfig(ctx context.Context, configPath string) (*Config, error) {
@@ -152,6 +159,18 @@ func (c *Config) setDefaults() {
if c.Redis.Addr == "" {
c.Redis.Addr = "localhost:6379"
}
if c.Pricing.BaseFee == 0 {
c.Pricing.BaseFee = 500.0
}
if c.Pricing.PerKm == 0 {
c.Pricing.PerKm = 25.0
}
if c.Pricing.PerKg == 0 {
c.Pricing.PerKg = 3.0
}
if c.Pricing.PerM3 == 0 {
c.Pricing.PerM3 = 150.0
}
}
func (c *Config) parseDurations() error {