Make RateProfiles storable in MySQL and Postgres

This commit is contained in:
arberkatellari
2025-11-14 11:39:07 +02:00
committed by Dan Christian Bogos
parent a559563810
commit da41db3f56
13 changed files with 502 additions and 40 deletions

View File

@@ -536,3 +536,27 @@ type RouteProfileMdl struct {
func (RouteProfileMdl) TableName() string {
return utils.TBLRouteProfiles
}
// Doesnt include Rates in RateProfile json, Rates taken from Rate using foreign keys
type RateProfileJSONMdl struct {
PK uint `gorm:"primary_key"`
Tenant string `index:"0" re:".*"`
ID string `index:"1" re:".*"`
RateProfile utils.JSONB `gorm:"type:jsonb" index:"2" re:".*"`
}
func (RateProfileJSONMdl) TableName() string {
return utils.TBLRateProfiles
}
type RateMdl struct {
PK uint `gorm:"primary_key"`
Tenant string `index:"0" re:".*"`
ID string `index:"1" re:".*"`
Rate utils.JSONB `gorm:"type:jsonb" index:"2" re:".*"`
RateProfileID string `gorm:"foreign_key" index:"3" re:".*"`
}
func (RateMdl) TableName() string {
return utils.TBLRates
}