package model // Represents a country together with its associated currency type Country struct { ID uint `gorm:"primaryKey;column:id" json:"id"` Name string `gorm:"column:name" json:"name"` Flag string `gorm:"size:16;not null;column:flag" json:"flag"` CurrencyID uint `gorm:"column:id_currency" json:"currency_id"` CurrencyISOCode string `gorm:"column:iso_code" json:"currency_iso_code"` CurrencyName string `gorm:"column:name" json:"currency_name"` // PSCountryID int `gorm:"column:id_country" json:"ps_country_id"` // PSCountry *PSCountry `gorm:"foreignKey:PSCountryID;references:ID" json:"ps_country"` PSCurrencyID uint `gorm:"column:currency" json:"currency"` PSCurrency *PSCurrency `gorm:"foreignKey:PSCurrencyID;references:currency_id" json:"ps_currency"` } func (Country) TableName() string { return "b2b_countries" } type PSCountry struct { CurrencyID uint `gorm:"column:id_currency" json:"currency_id"` } func (PSCountry) TableName() string { return "ps_country" } type PSCurrency struct { Currency int `gorm:"column:currency" json:"currency"` }