discount

package
v0.0.0-...-bf9540a Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Label holds the string label denoting the discount type in the database.
	Label = "discount"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldPeriodStart holds the string denoting the period_start field in the database.
	FieldPeriodStart = "period_start"
	// FieldPeriodEnd holds the string denoting the period_end field in the database.
	FieldPeriodEnd = "period_end"
	// FieldMethod holds the string denoting the method field in the database.
	FieldMethod = "method"
	// FieldDiscountPrice holds the string denoting the discount_price field in the database.
	FieldDiscountPrice = "discount_price"
	// FieldDiscountPercentage holds the string denoting the discount_percentage field in the database.
	FieldDiscountPercentage = "discount_percentage"
	// EdgeOrders holds the string denoting the orders edge name in mutations.
	EdgeOrders = "orders"
	// Table holds the table name of the discount in the database.
	Table = "discounts"
	// OrdersTable is the table that holds the orders relation/edge. The primary key declared below.
	OrdersTable = "order_discounts"
	// OrdersInverseTable is the table name for the Order entity.
	// It exists in this package in order to avoid circular dependency with the "order" package.
	OrdersInverseTable = "orders"
)

Variables

Columns holds all SQL columns for discount fields.

View Source
var (
	// OrdersPrimaryKey and OrdersColumn2 are the table columns denoting the
	// primary key for the orders relation (M2M).
	OrdersPrimaryKey = []string{"order_id", "discount_id"}
)

Functions

func And

func And(predicates ...predicate.Discount) predicate.Discount

And groups predicates with the AND operator between them.

func DiscountPercentage

func DiscountPercentage(v float64) predicate.Discount

DiscountPercentage applies equality check predicate on the "discount_percentage" field. It's identical to DiscountPercentageEQ.

func DiscountPercentageEQ

func DiscountPercentageEQ(v float64) predicate.Discount

DiscountPercentageEQ applies the EQ predicate on the "discount_percentage" field.

func DiscountPercentageGT

func DiscountPercentageGT(v float64) predicate.Discount

DiscountPercentageGT applies the GT predicate on the "discount_percentage" field.

func DiscountPercentageGTE

func DiscountPercentageGTE(v float64) predicate.Discount

DiscountPercentageGTE applies the GTE predicate on the "discount_percentage" field.

func DiscountPercentageIn

func DiscountPercentageIn(vs ...float64) predicate.Discount

DiscountPercentageIn applies the In predicate on the "discount_percentage" field.

func DiscountPercentageLT

func DiscountPercentageLT(v float64) predicate.Discount

DiscountPercentageLT applies the LT predicate on the "discount_percentage" field.

func DiscountPercentageLTE

func DiscountPercentageLTE(v float64) predicate.Discount

DiscountPercentageLTE applies the LTE predicate on the "discount_percentage" field.

func DiscountPercentageNEQ

func DiscountPercentageNEQ(v float64) predicate.Discount

DiscountPercentageNEQ applies the NEQ predicate on the "discount_percentage" field.

func DiscountPercentageNotIn

func DiscountPercentageNotIn(vs ...float64) predicate.Discount

DiscountPercentageNotIn applies the NotIn predicate on the "discount_percentage" field.

func DiscountPrice

func DiscountPrice(v int) predicate.Discount

DiscountPrice applies equality check predicate on the "discount_price" field. It's identical to DiscountPriceEQ.

func DiscountPriceEQ

func DiscountPriceEQ(v int) predicate.Discount

DiscountPriceEQ applies the EQ predicate on the "discount_price" field.

func DiscountPriceGT

func DiscountPriceGT(v int) predicate.Discount

DiscountPriceGT applies the GT predicate on the "discount_price" field.

func DiscountPriceGTE

func DiscountPriceGTE(v int) predicate.Discount

DiscountPriceGTE applies the GTE predicate on the "discount_price" field.

func DiscountPriceIn

func DiscountPriceIn(vs ...int) predicate.Discount

DiscountPriceIn applies the In predicate on the "discount_price" field.

func DiscountPriceLT

func DiscountPriceLT(v int) predicate.Discount

DiscountPriceLT applies the LT predicate on the "discount_price" field.

func DiscountPriceLTE

func DiscountPriceLTE(v int) predicate.Discount

DiscountPriceLTE applies the LTE predicate on the "discount_price" field.

func DiscountPriceNEQ

func DiscountPriceNEQ(v int) predicate.Discount

DiscountPriceNEQ applies the NEQ predicate on the "discount_price" field.

func DiscountPriceNotIn

func DiscountPriceNotIn(vs ...int) predicate.Discount

DiscountPriceNotIn applies the NotIn predicate on the "discount_price" field.

func HasOrders

func HasOrders() predicate.Discount

HasOrders applies the HasEdge predicate on the "orders" edge.

func HasOrdersWith

func HasOrdersWith(preds ...predicate.Order) predicate.Discount

HasOrdersWith applies the HasEdge predicate on the "orders" edge with a given conditions (other predicates).

func ID

func ID(id uuid.UUID) predicate.Discount

ID filters vertices based on their ID field.

func IDEQ

func IDEQ(id uuid.UUID) predicate.Discount

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id uuid.UUID) predicate.Discount

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id uuid.UUID) predicate.Discount

IDGTE applies the GTE predicate on the ID field.

func IDIn

func IDIn(ids ...uuid.UUID) predicate.Discount

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id uuid.UUID) predicate.Discount

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id uuid.UUID) predicate.Discount

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id uuid.UUID) predicate.Discount

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

func IDNotIn(ids ...uuid.UUID) predicate.Discount

IDNotIn applies the NotIn predicate on the ID field.

func MethodEQ

func MethodEQ(v Method) predicate.Discount

MethodEQ applies the EQ predicate on the "method" field.

func MethodIn

func MethodIn(vs ...Method) predicate.Discount

MethodIn applies the In predicate on the "method" field.

func MethodNEQ

func MethodNEQ(v Method) predicate.Discount

MethodNEQ applies the NEQ predicate on the "method" field.

func MethodNotIn

func MethodNotIn(vs ...Method) predicate.Discount

MethodNotIn applies the NotIn predicate on the "method" field.

func MethodValidator

func MethodValidator(m Method) error

MethodValidator is a validator for the "method" field enum values. It is called by the builders before save.

func Not

Not applies the not operator on the given predicate.

func Or

func Or(predicates ...predicate.Discount) predicate.Discount

Or groups predicates with the OR operator between them.

func PeriodEnd

func PeriodEnd(v time.Time) predicate.Discount

PeriodEnd applies equality check predicate on the "period_end" field. It's identical to PeriodEndEQ.

func PeriodEndEQ

func PeriodEndEQ(v time.Time) predicate.Discount

PeriodEndEQ applies the EQ predicate on the "period_end" field.

func PeriodEndGT

func PeriodEndGT(v time.Time) predicate.Discount

PeriodEndGT applies the GT predicate on the "period_end" field.

func PeriodEndGTE

func PeriodEndGTE(v time.Time) predicate.Discount

PeriodEndGTE applies the GTE predicate on the "period_end" field.

func PeriodEndIn

func PeriodEndIn(vs ...time.Time) predicate.Discount

PeriodEndIn applies the In predicate on the "period_end" field.

func PeriodEndIsNil

func PeriodEndIsNil() predicate.Discount

PeriodEndIsNil applies the IsNil predicate on the "period_end" field.

func PeriodEndLT

func PeriodEndLT(v time.Time) predicate.Discount

PeriodEndLT applies the LT predicate on the "period_end" field.

func PeriodEndLTE

func PeriodEndLTE(v time.Time) predicate.Discount

PeriodEndLTE applies the LTE predicate on the "period_end" field.

func PeriodEndNEQ

func PeriodEndNEQ(v time.Time) predicate.Discount

PeriodEndNEQ applies the NEQ predicate on the "period_end" field.

func PeriodEndNotIn

func PeriodEndNotIn(vs ...time.Time) predicate.Discount

PeriodEndNotIn applies the NotIn predicate on the "period_end" field.

func PeriodEndNotNil

func PeriodEndNotNil() predicate.Discount

PeriodEndNotNil applies the NotNil predicate on the "period_end" field.

func PeriodStart

func PeriodStart(v time.Time) predicate.Discount

PeriodStart applies equality check predicate on the "period_start" field. It's identical to PeriodStartEQ.

func PeriodStartEQ

func PeriodStartEQ(v time.Time) predicate.Discount

PeriodStartEQ applies the EQ predicate on the "period_start" field.

func PeriodStartGT

func PeriodStartGT(v time.Time) predicate.Discount

PeriodStartGT applies the GT predicate on the "period_start" field.

func PeriodStartGTE

func PeriodStartGTE(v time.Time) predicate.Discount

PeriodStartGTE applies the GTE predicate on the "period_start" field.

func PeriodStartIn

func PeriodStartIn(vs ...time.Time) predicate.Discount

PeriodStartIn applies the In predicate on the "period_start" field.

func PeriodStartIsNil

func PeriodStartIsNil() predicate.Discount

PeriodStartIsNil applies the IsNil predicate on the "period_start" field.

func PeriodStartLT

func PeriodStartLT(v time.Time) predicate.Discount

PeriodStartLT applies the LT predicate on the "period_start" field.

func PeriodStartLTE

func PeriodStartLTE(v time.Time) predicate.Discount

PeriodStartLTE applies the LTE predicate on the "period_start" field.

func PeriodStartNEQ

func PeriodStartNEQ(v time.Time) predicate.Discount

PeriodStartNEQ applies the NEQ predicate on the "period_start" field.

func PeriodStartNotIn

func PeriodStartNotIn(vs ...time.Time) predicate.Discount

PeriodStartNotIn applies the NotIn predicate on the "period_start" field.

func PeriodStartNotNil

func PeriodStartNotNil() predicate.Discount

PeriodStartNotNil applies the NotNil predicate on the "period_start" field.

func ValidColumn

func ValidColumn(column string) bool

ValidColumn reports if the column name is valid (part of the table columns).

Types

type Method

type Method string

Method defines the type for the "method" enum field.

const (
	MethodPERCENTAGE Method = "PERCENTAGE"
	MethodPRICE      Method = "PRICE"
)

Method values.

func (Method) String

func (m Method) String() string

Jump to

Keyboard shortcuts

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