models

package
v0.0.0-...-993f9dd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2024 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Country

type Country struct {
	core.BaseModel

	//ID          string `gorm:"column:id;type:text;primaryKey" json:"id"`
	Iso2        string  `gorm:"column:iso_2;type:text;not null;uniqueIndex:IDX_region_country_region_id_iso_2_unique,priority:1" json:"iso_2"`
	Iso3        string  `gorm:"column:iso_3;type:text;not null" json:"iso_3"`
	NumCode     int32   `gorm:"column:num_code;type:integer;not null" json:"num_code"`
	Name        string  `gorm:"column:name;type:text;not null" json:"name"`
	DisplayName string  `gorm:"column:display_name;type:text;not null" json:"display_name"`
	RegionId    string  `gorm:"column:region_id;type:text;uniqueIndex:IDX_region_country_region_id_iso_2_unique,priority:2" json:"region_id"`
	Region      *Region `gorm:"foreignKey:RegionId" json:"region"`
}

func (*Country) TableName

func (*Country) TableName() string

type Currency

type Currency struct {
	Code         string `gorm:"column:code;type:text;primaryKey" json:"code"`
	Symbol       string `gorm:"column:symbol;type:text;not null" json:"symbol"`
	SymbolNative string `gorm:"column:symbol_native;type:text;not null" json:"symbol_native"`
	Name         string `gorm:"column:name;type:text;not null" json:"name"`
}

func (*Currency) TableName

func (*Currency) TableName() string

type Region

type Region struct {
	core.BaseModel

	Name         string         `gorm:"column:name;type:text;not null" json:"name"`
	CurrencyCode string         `gorm:"column:currency_code;type:text;not null;index:IDX_region_currency_code,priority:1" json:"currency_code"`
	Currency     *Currency      `gorm:"foreignKey:CurrencyCode" json:"currency"`
	Countries    []Country      `gorm:"foreignKey:RegionId" json:"countries"`
	DeletedAt    gorm.DeletedAt `gorm:"column:deleted_at;type:timestamp with time zone;index:IDX_region_deleted_at,priority:1" json:"deleted_at"`
}

func (*Region) TableName

func (*Region) TableName() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL