models

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Zone

type Zone struct {
	ID       uint64 `json:"id"`
	Codename string `json:"codename" gorm:"unique_index"`

	Title       string `json:"title"`
	Description string `json:"description"`

	AccountID uint64 `json:"account_id,omitempty"`

	Type   types.ZoneType      `gorm:"type:ZoneType" json:"type,omitempty"`
	Status types.ApproveStatus `gorm:"type:ApproveStatus" json:"status"`
	Active types.ActiveStatus  `gorm:"type:ActiveStatus" json:"active"`

	DefaultCode  gosql.NullableJSON[map[string]string]  `gorm:"type:JSONB" json:"default_code,omitempty"`
	Context      gosql.NullableJSON[map[string]any]     `gorm:"type:JSONB" json:"context,omitempty"`
	MinECPM      float64                                `json:"min_ecpm,omitempty"`
	MinECPMByGeo gosql.NullableJSON[map[string]float64] `gorm:"type:JSONB" json:"min_ecpm_by_geo,omitempty"`

	// The cost of the traffic acceptance
	FixedPurchasePrice float64 `json:"fixed_purchase_price,omitempty"`

	// Filtering
	AllowedFormats    gosql.NullableStringArray                `gorm:"type:TEXT[]" json:"allowed_formats,omitempty"`
	AllowedTypes      gosql.NullableOrderedNumberArray[uint64] `gorm:"type:BIGINT[]" json:"allowed_types,omitempty"`
	AllowedSources    gosql.NullableOrderedNumberArray[uint64] `gorm:"type:BIGINT[]" json:"allowed_sources,omitempty"`
	DisallowedSources gosql.NullableOrderedNumberArray[uint64] `gorm:"type:BIGINT[]" json:"disallowed_sources,omitempty"`

	// Strict campaigns targeting (smartlinks only)
	Campaigns gosql.NullableOrderedNumberArray[uint64] `gorm:"type:BIGINT[]" json:"campaigns,omitempty"`

	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `json:"deleted_at,omitempty"`
}

Zone model

func (*Zone) BeforeCreate

func (z *Zone) BeforeCreate(tx *gorm.DB) error

BeforeCreate hook

func (*Zone) GetAccountID

func (z *Zone) GetAccountID() uint64

GetAccountID returns the account ID

func (*Zone) RBACResourceName

func (z *Zone) RBACResourceName() string

RBACResourceName returns the name of the resource for the RBAC

func (*Zone) RevenueShare

func (z *Zone) RevenueShare() float64

RevenueShare amount %

func (*Zone) TableName

func (z *Zone) TableName() string

TableName in database

Jump to

Keyboard shortcuts

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