region

package
v1.35.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IgnoreFieldMismatch = datastore.IgnoreFieldMismatch

Functions

func Query

Types

type Country

type Country struct {
	ISO2        string `json:"iso2"`
	ISO3        string `json:"iso3"`
	NumCode     int    `json:"numCode"`
	Name        string `json:"name"`
	DisplayName string `json:"displayName"`
	RegionId    string `json:"regionId"`
}

type Region

type Region struct {
	mixin.Model[Region]

	// Name of region
	Name string `json:"name"`

	// ISO 4217 currency code
	CurrencyCode string `json:"currencyCode"`

	// Whether automatic taxes are enabled
	AutomaticTaxes bool `json:"automaticTaxes"`

	// Whether tax-inclusive pricing is enabled
	TaxInclusiveEnabled bool `json:"taxInclusiveEnabled"`

	// Countries in this region (serialized to datastore)
	Countries  []Country `json:"countries" datastore:"-" orm:"default:[]"`
	Countries_ string    `json:"-" datastore:",noindex"`

	// Arbitrary metadata
	Metadata  Map    `json:"metadata,omitempty" datastore:"-" orm:"default:{}"`
	Metadata_ string `json:"-" datastore:",noindex"`
}

func New

func New(db *datastore.Datastore) *Region

func (*Region) Load

func (r *Region) Load(ps []datastore.Property) (err error)

func (*Region) Save

func (r *Region) Save() ([]datastore.Property, error)

Jump to

Keyboard shortcuts

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