ent

package
v1.99.1 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: MIT Imports: 27 Imported by: 0

README

Ent ORM Files

Add new Ent Model

go run -mod=mod entgo.io/ent/cmd/ent new ModelName

Add mixin

  1. First, you need ent/intercept added to the project. If you have no, add --feature intercept to the ent/generate.go and run make ent.
  2. Then copy needed mixin file, fix import paths inside.
  3. Then run make ent.

Documentation

Index

Constants

View Source
const (
	// Operation types.
	OpCreate    = ent.OpCreate
	OpDelete    = ent.OpDelete
	OpDeleteOne = ent.OpDeleteOne
	OpUpdate    = ent.OpUpdate
	OpUpdateOne = ent.OpUpdateOne

	// Node types.
	TypeBundle             = "Bundle"
	TypeInvoice            = "Invoice"
	TypeItem               = "Item"
	TypePaymentProfile     = "PaymentProfile"
	TypeProduct            = "Product"
	TypeProductReservation = "ProductReservation"
	TypeSubscriptions      = "Subscriptions"
)

Variables

View Source
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")

ErrTxStarted is returned when trying to start a new transaction from a transactional client.

Functions

func Asc

func Asc(fields ...string) func(*sql.Selector)

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) func(*sql.Selector)

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

IsConstraintError returns a boolean indicating whether the error is a constraint failure.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns a boolean indicating whether the error is a not found error.

func IsNotLoaded

func IsNotLoaded(err error) bool

IsNotLoaded returns a boolean indicating whether the error is a not loaded error.

func IsNotSingular

func IsNotSingular(err error) bool

IsNotSingular returns a boolean indicating whether the error is a not singular error.

func IsValidationError

func IsValidationError(err error) bool

IsValidationError returns a boolean indicating whether the error is a validation error.

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

func NewContext(parent context.Context, c *Client) context.Context

NewContext returns a new context with the given Client attached.

func NewTxContext

func NewTxContext(parent context.Context, tx *Tx) context.Context

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

AggregateFunc applies an aggregation step on the group-by traversal/selector.

func As

As is a pseudo aggregation function for renaming another other functions with custom names. For example:

GroupBy(field1, field2).
Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")).
Scan(ctx, &v)

func Count

func Count() AggregateFunc

Count applies the "count" aggregation function on each group.

func Max

func Max(field string) AggregateFunc

Max applies the "max" aggregation function on the given field of each group.

func Mean

func Mean(field string) AggregateFunc

Mean applies the "mean" aggregation function on the given field of each group.

func Min

func Min(field string) AggregateFunc

Min applies the "min" aggregation function on the given field of each group.

func Sum

func Sum(field string) AggregateFunc

Sum applies the "sum" aggregation function on the given field of each group.

type Bundle

type Bundle struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// ProductID holds the value of the "product_id" field.
	ProductID int64 `json:"product_id,omitempty"`
	// ItemID holds the value of the "item_id" field.
	ItemID int64 `json:"item_id,omitempty"`
	// Amount holds the value of the "amount" field.
	Amount float64 `json:"amount,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the BundleQuery when eager-loading is set.
	Edges BundleEdges `json:"edges"`
	// contains filtered or unexported fields
}

Bundle is the model entity for the Bundle schema.

func (*Bundle) QueryItem

func (b *Bundle) QueryItem() *ItemQuery

QueryItem queries the "item" edge of the Bundle entity.

func (*Bundle) QueryProduct

func (b *Bundle) QueryProduct() *ProductQuery

QueryProduct queries the "product" edge of the Bundle entity.

func (*Bundle) String

func (b *Bundle) String() string

String implements the fmt.Stringer.

func (*Bundle) Unwrap

func (b *Bundle) Unwrap() *Bundle

Unwrap unwraps the Bundle entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Bundle) Update

func (b *Bundle) Update() *BundleUpdateOne

Update returns a builder for updating this Bundle. Note that you need to call Bundle.Unwrap() before calling this method if this Bundle was returned from a transaction, and the transaction was committed or rolled back.

func (*Bundle) Value

func (b *Bundle) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Bundle. This includes values selected through modifiers, order, etc.

type BundleClient

type BundleClient struct {
	// contains filtered or unexported fields
}

BundleClient is a client for the Bundle schema.

func NewBundleClient

func NewBundleClient(c config) *BundleClient

NewBundleClient returns a client for the Bundle from the given config.

func (*BundleClient) Create

func (c *BundleClient) Create() *BundleCreate

Create returns a builder for creating a Bundle entity.

func (*BundleClient) CreateBulk

func (c *BundleClient) CreateBulk(builders ...*BundleCreate) *BundleCreateBulk

CreateBulk returns a builder for creating a bulk of Bundle entities.

func (*BundleClient) Delete

func (c *BundleClient) Delete() *BundleDelete

Delete returns a delete builder for Bundle.

func (*BundleClient) DeleteOne

func (c *BundleClient) DeleteOne(b *Bundle) *BundleDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*BundleClient) DeleteOneID

func (c *BundleClient) DeleteOneID(id int64) *BundleDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*BundleClient) Get

func (c *BundleClient) Get(ctx context.Context, id int64) (*Bundle, error)

Get returns a Bundle entity by its id.

func (*BundleClient) GetX

func (c *BundleClient) GetX(ctx context.Context, id int64) *Bundle

GetX is like Get, but panics if an error occurs.

func (*BundleClient) Hooks

func (c *BundleClient) Hooks() []Hook

Hooks returns the client hooks.

func (*BundleClient) Intercept

func (c *BundleClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `bundle.Intercept(f(g(h())))`.

func (*BundleClient) Interceptors

func (c *BundleClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*BundleClient) MapCreateBulk

func (c *BundleClient) MapCreateBulk(slice any, setFunc func(*BundleCreate, int)) *BundleCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*BundleClient) Query

func (c *BundleClient) Query() *BundleQuery

Query returns a query builder for Bundle.

func (*BundleClient) QueryItem

func (c *BundleClient) QueryItem(b *Bundle) *ItemQuery

QueryItem queries the item edge of a Bundle.

func (*BundleClient) QueryProduct

func (c *BundleClient) QueryProduct(b *Bundle) *ProductQuery

QueryProduct queries the product edge of a Bundle.

func (*BundleClient) Update

func (c *BundleClient) Update() *BundleUpdate

Update returns an update builder for Bundle.

func (*BundleClient) UpdateOne

func (c *BundleClient) UpdateOne(b *Bundle) *BundleUpdateOne

UpdateOne returns an update builder for the given entity.

func (*BundleClient) UpdateOneID

func (c *BundleClient) UpdateOneID(id int64) *BundleUpdateOne

UpdateOneID returns an update builder for the given id.

func (*BundleClient) Use

func (c *BundleClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `bundle.Hooks(f(g(h())))`.

type BundleCreate

type BundleCreate struct {
	// contains filtered or unexported fields
}

BundleCreate is the builder for creating a Bundle entity.

func (*BundleCreate) Exec

func (bc *BundleCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*BundleCreate) ExecX

func (bc *BundleCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*BundleCreate) Mutation

func (bc *BundleCreate) Mutation() *BundleMutation

Mutation returns the BundleMutation object of the builder.

func (*BundleCreate) OnConflict

func (bc *BundleCreate) OnConflict(opts ...sql.ConflictOption) *BundleUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Bundle.Create().
	SetDeletedAt(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.BundleUpsert) {
		SetDeletedAt(v+v).
	}).
	Exec(ctx)

func (*BundleCreate) OnConflictColumns

func (bc *BundleCreate) OnConflictColumns(columns ...string) *BundleUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Bundle.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*BundleCreate) Save

func (bc *BundleCreate) Save(ctx context.Context) (*Bundle, error)

Save creates the Bundle in the database.

func (*BundleCreate) SaveX

func (bc *BundleCreate) SaveX(ctx context.Context) *Bundle

SaveX calls Save and panics if Save returns an error.

func (*BundleCreate) SetAmount

func (bc *BundleCreate) SetAmount(f float64) *BundleCreate

SetAmount sets the "amount" field.

func (*BundleCreate) SetCreatedAt

func (bc *BundleCreate) SetCreatedAt(t time.Time) *BundleCreate

SetCreatedAt sets the "created_at" field.

func (*BundleCreate) SetDeletedAt

func (bc *BundleCreate) SetDeletedAt(t time.Time) *BundleCreate

SetDeletedAt sets the "deleted_at" field.

func (*BundleCreate) SetID

func (bc *BundleCreate) SetID(i int64) *BundleCreate

SetID sets the "id" field.

func (*BundleCreate) SetItem

func (bc *BundleCreate) SetItem(i *Item) *BundleCreate

SetItem sets the "item" edge to the Item entity.

func (*BundleCreate) SetItemID

func (bc *BundleCreate) SetItemID(i int64) *BundleCreate

SetItemID sets the "item_id" field.

func (*BundleCreate) SetNillableAmount

func (bc *BundleCreate) SetNillableAmount(f *float64) *BundleCreate

SetNillableAmount sets the "amount" field if the given value is not nil.

func (*BundleCreate) SetNillableCreatedAt

func (bc *BundleCreate) SetNillableCreatedAt(t *time.Time) *BundleCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*BundleCreate) SetNillableDeletedAt

func (bc *BundleCreate) SetNillableDeletedAt(t *time.Time) *BundleCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*BundleCreate) SetNillableUpdatedAt

func (bc *BundleCreate) SetNillableUpdatedAt(t *time.Time) *BundleCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*BundleCreate) SetProduct

func (bc *BundleCreate) SetProduct(p *Product) *BundleCreate

SetProduct sets the "product" edge to the Product entity.

func (*BundleCreate) SetProductID

func (bc *BundleCreate) SetProductID(i int64) *BundleCreate

SetProductID sets the "product_id" field.

func (*BundleCreate) SetUpdatedAt

func (bc *BundleCreate) SetUpdatedAt(t time.Time) *BundleCreate

SetUpdatedAt sets the "updated_at" field.

type BundleCreateBulk

type BundleCreateBulk struct {
	// contains filtered or unexported fields
}

BundleCreateBulk is the builder for creating many Bundle entities in bulk.

func (*BundleCreateBulk) Exec

func (bcb *BundleCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*BundleCreateBulk) ExecX

func (bcb *BundleCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*BundleCreateBulk) OnConflict

func (bcb *BundleCreateBulk) OnConflict(opts ...sql.ConflictOption) *BundleUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Bundle.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.BundleUpsert) {
		SetDeletedAt(v+v).
	}).
	Exec(ctx)

func (*BundleCreateBulk) OnConflictColumns

func (bcb *BundleCreateBulk) OnConflictColumns(columns ...string) *BundleUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Bundle.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*BundleCreateBulk) Save

func (bcb *BundleCreateBulk) Save(ctx context.Context) ([]*Bundle, error)

Save creates the Bundle entities in the database.

func (*BundleCreateBulk) SaveX

func (bcb *BundleCreateBulk) SaveX(ctx context.Context) []*Bundle

SaveX is like Save, but panics if an error occurs.

type BundleDelete

type BundleDelete struct {
	// contains filtered or unexported fields
}

BundleDelete is the builder for deleting a Bundle entity.

func (*BundleDelete) Exec

func (bd *BundleDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*BundleDelete) ExecX

func (bd *BundleDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*BundleDelete) Where

func (bd *BundleDelete) Where(ps ...predicate.Bundle) *BundleDelete

Where appends a list predicates to the BundleDelete builder.

type BundleDeleteOne

type BundleDeleteOne struct {
	// contains filtered or unexported fields
}

BundleDeleteOne is the builder for deleting a single Bundle entity.

func (*BundleDeleteOne) Exec

func (bdo *BundleDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*BundleDeleteOne) ExecX

func (bdo *BundleDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*BundleDeleteOne) Where

func (bdo *BundleDeleteOne) Where(ps ...predicate.Bundle) *BundleDeleteOne

Where appends a list predicates to the BundleDelete builder.

type BundleEdges

type BundleEdges struct {
	// Product holds the value of the product edge.
	Product *Product `json:"product,omitempty"`
	// Item holds the value of the item edge.
	Item *Item `json:"item,omitempty"`
	// contains filtered or unexported fields
}

BundleEdges holds the relations/edges for other nodes in the graph.

func (BundleEdges) ItemOrErr

func (e BundleEdges) ItemOrErr() (*Item, error)

ItemOrErr returns the Item value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (BundleEdges) ProductOrErr

func (e BundleEdges) ProductOrErr() (*Product, error)

ProductOrErr returns the Product value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type BundleFilter

type BundleFilter struct {
	// contains filtered or unexported fields
}

BundleFilter provides a generic filtering capability at runtime for BundleQuery.

func (*BundleFilter) Where

func (f *BundleFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*BundleFilter) WhereAmount

func (f *BundleFilter) WhereAmount(p entql.Float64P)

WhereAmount applies the entql float64 predicate on the amount field.

func (*BundleFilter) WhereCreatedAt

func (f *BundleFilter) WhereCreatedAt(p entql.TimeP)

WhereCreatedAt applies the entql time.Time predicate on the created_at field.

func (*BundleFilter) WhereDeletedAt

func (f *BundleFilter) WhereDeletedAt(p entql.TimeP)

WhereDeletedAt applies the entql time.Time predicate on the deleted_at field.

func (*BundleFilter) WhereHasItem

func (f *BundleFilter) WhereHasItem()

WhereHasItem applies a predicate to check if query has an edge item.

func (*BundleFilter) WhereHasItemWith

func (f *BundleFilter) WhereHasItemWith(preds ...predicate.Item)

WhereHasItemWith applies a predicate to check if query has an edge item with a given conditions (other predicates).

func (*BundleFilter) WhereHasProduct

func (f *BundleFilter) WhereHasProduct()

WhereHasProduct applies a predicate to check if query has an edge product.

func (*BundleFilter) WhereHasProductWith

func (f *BundleFilter) WhereHasProductWith(preds ...predicate.Product)

WhereHasProductWith applies a predicate to check if query has an edge product with a given conditions (other predicates).

func (*BundleFilter) WhereID

func (f *BundleFilter) WhereID(p entql.Int64P)

WhereID applies the entql int64 predicate on the id field.

func (*BundleFilter) WhereItemID

func (f *BundleFilter) WhereItemID(p entql.Int64P)

WhereItemID applies the entql int64 predicate on the item_id field.

func (*BundleFilter) WhereProductID

func (f *BundleFilter) WhereProductID(p entql.Int64P)

WhereProductID applies the entql int64 predicate on the product_id field.

func (*BundleFilter) WhereUpdatedAt

func (f *BundleFilter) WhereUpdatedAt(p entql.TimeP)

WhereUpdatedAt applies the entql time.Time predicate on the updated_at field.

type BundleGroupBy

type BundleGroupBy struct {
	// contains filtered or unexported fields
}

BundleGroupBy is the group-by builder for Bundle entities.

func (*BundleGroupBy) Aggregate

func (bgb *BundleGroupBy) Aggregate(fns ...AggregateFunc) *BundleGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*BundleGroupBy) Bool

func (s *BundleGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*BundleGroupBy) BoolX

func (s *BundleGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*BundleGroupBy) Bools

func (s *BundleGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*BundleGroupBy) BoolsX

func (s *BundleGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*BundleGroupBy) Float64

func (s *BundleGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*BundleGroupBy) Float64X

func (s *BundleGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*BundleGroupBy) Float64s

func (s *BundleGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*BundleGroupBy) Float64sX

func (s *BundleGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*BundleGroupBy) Int

func (s *BundleGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*BundleGroupBy) IntX

func (s *BundleGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*BundleGroupBy) Ints

func (s *BundleGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*BundleGroupBy) IntsX

func (s *BundleGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*BundleGroupBy) Scan

func (bgb *BundleGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*BundleGroupBy) ScanX

func (s *BundleGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*BundleGroupBy) String

func (s *BundleGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*BundleGroupBy) StringX

func (s *BundleGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*BundleGroupBy) Strings

func (s *BundleGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*BundleGroupBy) StringsX

func (s *BundleGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type BundleMutation

type BundleMutation struct {
	// contains filtered or unexported fields
}

BundleMutation represents an operation that mutates the Bundle nodes in the graph.

func (*BundleMutation) AddAmount

func (m *BundleMutation) AddAmount(f float64)

AddAmount adds f to the "amount" field.

func (*BundleMutation) AddField

func (m *BundleMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*BundleMutation) AddedAmount

func (m *BundleMutation) AddedAmount() (r float64, exists bool)

AddedAmount returns the value that was added to the "amount" field in this mutation.

func (*BundleMutation) AddedEdges

func (m *BundleMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*BundleMutation) AddedField

func (m *BundleMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*BundleMutation) AddedFields

func (m *BundleMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*BundleMutation) AddedIDs

func (m *BundleMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*BundleMutation) Amount

func (m *BundleMutation) Amount() (r float64, exists bool)

Amount returns the value of the "amount" field in the mutation.

func (*BundleMutation) ClearDeletedAt

func (m *BundleMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*BundleMutation) ClearEdge

func (m *BundleMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*BundleMutation) ClearField

func (m *BundleMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*BundleMutation) ClearItem

func (m *BundleMutation) ClearItem()

ClearItem clears the "item" edge to the Item entity.

func (*BundleMutation) ClearProduct

func (m *BundleMutation) ClearProduct()

ClearProduct clears the "product" edge to the Product entity.

func (*BundleMutation) ClearedEdges

func (m *BundleMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*BundleMutation) ClearedFields

func (m *BundleMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (BundleMutation) Client

func (m BundleMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*BundleMutation) CreatedAt

func (m *BundleMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*BundleMutation) DeletedAt

func (m *BundleMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*BundleMutation) DeletedAtCleared

func (m *BundleMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*BundleMutation) EdgeCleared

func (m *BundleMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*BundleMutation) Field

func (m *BundleMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*BundleMutation) FieldCleared

func (m *BundleMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*BundleMutation) Fields

func (m *BundleMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*BundleMutation) Filter

func (m *BundleMutation) Filter() *BundleFilter

Filter returns an entql.Where implementation to apply filters on the BundleMutation builder.

func (*BundleMutation) ID

func (m *BundleMutation) ID() (id int64, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*BundleMutation) IDs

func (m *BundleMutation) IDs(ctx context.Context) ([]int64, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*BundleMutation) ItemCleared

func (m *BundleMutation) ItemCleared() bool

ItemCleared reports if the "item" edge to the Item entity was cleared.

func (*BundleMutation) ItemID

func (m *BundleMutation) ItemID() (r int64, exists bool)

ItemID returns the value of the "item_id" field in the mutation.

func (*BundleMutation) ItemIDs

func (m *BundleMutation) ItemIDs() (ids []int64)

ItemIDs returns the "item" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ItemID instead. It exists only for internal usage by the builders.

func (*BundleMutation) OldAmount

func (m *BundleMutation) OldAmount(ctx context.Context) (v float64, err error)

OldAmount returns the old "amount" field's value of the Bundle entity. If the Bundle object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BundleMutation) OldCreatedAt

func (m *BundleMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Bundle entity. If the Bundle object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BundleMutation) OldDeletedAt

func (m *BundleMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Bundle entity. If the Bundle object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BundleMutation) OldField

func (m *BundleMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*BundleMutation) OldItemID

func (m *BundleMutation) OldItemID(ctx context.Context) (v int64, err error)

OldItemID returns the old "item_id" field's value of the Bundle entity. If the Bundle object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BundleMutation) OldProductID

func (m *BundleMutation) OldProductID(ctx context.Context) (v int64, err error)

OldProductID returns the old "product_id" field's value of the Bundle entity. If the Bundle object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BundleMutation) OldUpdatedAt

func (m *BundleMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Bundle entity. If the Bundle object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BundleMutation) Op

func (m *BundleMutation) Op() Op

Op returns the operation name.

func (*BundleMutation) ProductCleared

func (m *BundleMutation) ProductCleared() bool

ProductCleared reports if the "product" edge to the Product entity was cleared.

func (*BundleMutation) ProductID

func (m *BundleMutation) ProductID() (r int64, exists bool)

ProductID returns the value of the "product_id" field in the mutation.

func (*BundleMutation) ProductIDs

func (m *BundleMutation) ProductIDs() (ids []int64)

ProductIDs returns the "product" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ProductID instead. It exists only for internal usage by the builders.

func (*BundleMutation) RemovedEdges

func (m *BundleMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*BundleMutation) RemovedIDs

func (m *BundleMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*BundleMutation) ResetAmount

func (m *BundleMutation) ResetAmount()

ResetAmount resets all changes to the "amount" field.

func (*BundleMutation) ResetCreatedAt

func (m *BundleMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*BundleMutation) ResetDeletedAt

func (m *BundleMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*BundleMutation) ResetEdge

func (m *BundleMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*BundleMutation) ResetField

func (m *BundleMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*BundleMutation) ResetItem

func (m *BundleMutation) ResetItem()

ResetItem resets all changes to the "item" edge.

func (*BundleMutation) ResetItemID

func (m *BundleMutation) ResetItemID()

ResetItemID resets all changes to the "item_id" field.

func (*BundleMutation) ResetProduct

func (m *BundleMutation) ResetProduct()

ResetProduct resets all changes to the "product" edge.

func (*BundleMutation) ResetProductID

func (m *BundleMutation) ResetProductID()

ResetProductID resets all changes to the "product_id" field.

func (*BundleMutation) ResetUpdatedAt

func (m *BundleMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*BundleMutation) SetAmount

func (m *BundleMutation) SetAmount(f float64)

SetAmount sets the "amount" field.

func (*BundleMutation) SetCreatedAt

func (m *BundleMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*BundleMutation) SetDeletedAt

func (m *BundleMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*BundleMutation) SetField

func (m *BundleMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*BundleMutation) SetID

func (m *BundleMutation) SetID(id int64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Bundle entities.

func (*BundleMutation) SetItemID

func (m *BundleMutation) SetItemID(i int64)

SetItemID sets the "item_id" field.

func (*BundleMutation) SetOp

func (m *BundleMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*BundleMutation) SetProductID

func (m *BundleMutation) SetProductID(i int64)

SetProductID sets the "product_id" field.

func (*BundleMutation) SetUpdatedAt

func (m *BundleMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (BundleMutation) Tx

func (m BundleMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*BundleMutation) Type

func (m *BundleMutation) Type() string

Type returns the node type of this mutation (Bundle).

func (*BundleMutation) UpdatedAt

func (m *BundleMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*BundleMutation) Where

func (m *BundleMutation) Where(ps ...predicate.Bundle)

Where appends a list predicates to the BundleMutation builder.

func (*BundleMutation) WhereP

func (m *BundleMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the BundleMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type BundleQuery

type BundleQuery struct {
	// contains filtered or unexported fields
}

BundleQuery is the builder for querying Bundle entities.

func (*BundleQuery) Aggregate

func (bq *BundleQuery) Aggregate(fns ...AggregateFunc) *BundleSelect

Aggregate returns a BundleSelect configured with the given aggregations.

func (*BundleQuery) All

func (bq *BundleQuery) All(ctx context.Context) ([]*Bundle, error)

All executes the query and returns a list of Bundles.

func (*BundleQuery) AllX

func (bq *BundleQuery) AllX(ctx context.Context) []*Bundle

AllX is like All, but panics if an error occurs.

func (*BundleQuery) Clone

func (bq *BundleQuery) Clone() *BundleQuery

Clone returns a duplicate of the BundleQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*BundleQuery) Count

func (bq *BundleQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*BundleQuery) CountX

func (bq *BundleQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*BundleQuery) Exist

func (bq *BundleQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*BundleQuery) ExistX

func (bq *BundleQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*BundleQuery) Filter

func (bq *BundleQuery) Filter() *BundleFilter

Filter returns a Filter implementation to apply filters on the BundleQuery builder.

func (*BundleQuery) First

func (bq *BundleQuery) First(ctx context.Context) (*Bundle, error)

First returns the first Bundle entity from the query. Returns a *NotFoundError when no Bundle was found.

func (*BundleQuery) FirstID

func (bq *BundleQuery) FirstID(ctx context.Context) (id int64, err error)

FirstID returns the first Bundle ID from the query. Returns a *NotFoundError when no Bundle ID was found.

func (*BundleQuery) FirstIDX

func (bq *BundleQuery) FirstIDX(ctx context.Context) int64

FirstIDX is like FirstID, but panics if an error occurs.

func (*BundleQuery) FirstX

func (bq *BundleQuery) FirstX(ctx context.Context) *Bundle

FirstX is like First, but panics if an error occurs.

func (*BundleQuery) GroupBy

func (bq *BundleQuery) GroupBy(field string, fields ...string) *BundleGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Bundle.Query().
	GroupBy(bundle.FieldDeletedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*BundleQuery) IDs

func (bq *BundleQuery) IDs(ctx context.Context) (ids []int64, err error)

IDs executes the query and returns a list of Bundle IDs.

func (*BundleQuery) IDsX

func (bq *BundleQuery) IDsX(ctx context.Context) []int64

IDsX is like IDs, but panics if an error occurs.

func (*BundleQuery) Limit

func (bq *BundleQuery) Limit(limit int) *BundleQuery

Limit the number of records to be returned by this query.

func (*BundleQuery) Modify

func (bq *BundleQuery) Modify(modifiers ...func(s *sql.Selector)) *BundleSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*BundleQuery) Offset

func (bq *BundleQuery) Offset(offset int) *BundleQuery

Offset to start from.

func (*BundleQuery) Only

func (bq *BundleQuery) Only(ctx context.Context) (*Bundle, error)

Only returns a single Bundle entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Bundle entity is found. Returns a *NotFoundError when no Bundle entities are found.

func (*BundleQuery) OnlyID

func (bq *BundleQuery) OnlyID(ctx context.Context) (id int64, err error)

OnlyID is like Only, but returns the only Bundle ID in the query. Returns a *NotSingularError when more than one Bundle ID is found. Returns a *NotFoundError when no entities are found.

func (*BundleQuery) OnlyIDX

func (bq *BundleQuery) OnlyIDX(ctx context.Context) int64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*BundleQuery) OnlyX

func (bq *BundleQuery) OnlyX(ctx context.Context) *Bundle

OnlyX is like Only, but panics if an error occurs.

func (*BundleQuery) Order

func (bq *BundleQuery) Order(o ...bundle.OrderOption) *BundleQuery

Order specifies how the records should be ordered.

func (*BundleQuery) QueryItem

func (bq *BundleQuery) QueryItem() *ItemQuery

QueryItem chains the current query on the "item" edge.

func (*BundleQuery) QueryProduct

func (bq *BundleQuery) QueryProduct() *ProductQuery

QueryProduct chains the current query on the "product" edge.

func (*BundleQuery) Select

func (bq *BundleQuery) Select(fields ...string) *BundleSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	DeletedAt time.Time `json:"deleted_at,omitempty"`
}

client.Bundle.Query().
	Select(bundle.FieldDeletedAt).
	Scan(ctx, &v)

func (*BundleQuery) Unique

func (bq *BundleQuery) Unique(unique bool) *BundleQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*BundleQuery) Where

func (bq *BundleQuery) Where(ps ...predicate.Bundle) *BundleQuery

Where adds a new predicate for the BundleQuery builder.

func (*BundleQuery) WithItem

func (bq *BundleQuery) WithItem(opts ...func(*ItemQuery)) *BundleQuery

WithItem tells the query-builder to eager-load the nodes that are connected to the "item" edge. The optional arguments are used to configure the query builder of the edge.

func (*BundleQuery) WithProduct

func (bq *BundleQuery) WithProduct(opts ...func(*ProductQuery)) *BundleQuery

WithProduct tells the query-builder to eager-load the nodes that are connected to the "product" edge. The optional arguments are used to configure the query builder of the edge.

type BundleSelect

type BundleSelect struct {
	*BundleQuery
	// contains filtered or unexported fields
}

BundleSelect is the builder for selecting fields of Bundle entities.

func (*BundleSelect) Aggregate

func (bs *BundleSelect) Aggregate(fns ...AggregateFunc) *BundleSelect

Aggregate adds the given aggregation functions to the selector query.

func (*BundleSelect) Bool

func (s *BundleSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*BundleSelect) BoolX

func (s *BundleSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*BundleSelect) Bools

func (s *BundleSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*BundleSelect) BoolsX

func (s *BundleSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*BundleSelect) Float64

func (s *BundleSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*BundleSelect) Float64X

func (s *BundleSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*BundleSelect) Float64s

func (s *BundleSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*BundleSelect) Float64sX

func (s *BundleSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*BundleSelect) Int

func (s *BundleSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*BundleSelect) IntX

func (s *BundleSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*BundleSelect) Ints

func (s *BundleSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*BundleSelect) IntsX

func (s *BundleSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*BundleSelect) Modify

func (bs *BundleSelect) Modify(modifiers ...func(s *sql.Selector)) *BundleSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*BundleSelect) Scan

func (bs *BundleSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*BundleSelect) ScanX

func (s *BundleSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*BundleSelect) String

func (s *BundleSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*BundleSelect) StringX

func (s *BundleSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*BundleSelect) Strings

func (s *BundleSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*BundleSelect) StringsX

func (s *BundleSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type BundleUpdate

type BundleUpdate struct {
	// contains filtered or unexported fields
}

BundleUpdate is the builder for updating Bundle entities.

func (*BundleUpdate) AddAmount

func (bu *BundleUpdate) AddAmount(f float64) *BundleUpdate

AddAmount adds f to the "amount" field.

func (*BundleUpdate) ClearDeletedAt

func (bu *BundleUpdate) ClearDeletedAt() *BundleUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*BundleUpdate) Exec

func (bu *BundleUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*BundleUpdate) ExecX

func (bu *BundleUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*BundleUpdate) Modify

func (bu *BundleUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *BundleUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*BundleUpdate) Mutation

func (bu *BundleUpdate) Mutation() *BundleMutation

Mutation returns the BundleMutation object of the builder.

func (*BundleUpdate) Save

func (bu *BundleUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*BundleUpdate) SaveX

func (bu *BundleUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*BundleUpdate) SetAmount

func (bu *BundleUpdate) SetAmount(f float64) *BundleUpdate

SetAmount sets the "amount" field.

func (*BundleUpdate) SetDeletedAt

func (bu *BundleUpdate) SetDeletedAt(t time.Time) *BundleUpdate

SetDeletedAt sets the "deleted_at" field.

func (*BundleUpdate) SetNillableAmount

func (bu *BundleUpdate) SetNillableAmount(f *float64) *BundleUpdate

SetNillableAmount sets the "amount" field if the given value is not nil.

func (*BundleUpdate) SetNillableDeletedAt

func (bu *BundleUpdate) SetNillableDeletedAt(t *time.Time) *BundleUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*BundleUpdate) SetUpdatedAt

func (bu *BundleUpdate) SetUpdatedAt(t time.Time) *BundleUpdate

SetUpdatedAt sets the "updated_at" field.

func (*BundleUpdate) Where

func (bu *BundleUpdate) Where(ps ...predicate.Bundle) *BundleUpdate

Where appends a list predicates to the BundleUpdate builder.

type BundleUpdateOne

type BundleUpdateOne struct {
	// contains filtered or unexported fields
}

BundleUpdateOne is the builder for updating a single Bundle entity.

func (*BundleUpdateOne) AddAmount

func (buo *BundleUpdateOne) AddAmount(f float64) *BundleUpdateOne

AddAmount adds f to the "amount" field.

func (*BundleUpdateOne) ClearDeletedAt

func (buo *BundleUpdateOne) ClearDeletedAt() *BundleUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*BundleUpdateOne) Exec

func (buo *BundleUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*BundleUpdateOne) ExecX

func (buo *BundleUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*BundleUpdateOne) Modify

func (buo *BundleUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *BundleUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*BundleUpdateOne) Mutation

func (buo *BundleUpdateOne) Mutation() *BundleMutation

Mutation returns the BundleMutation object of the builder.

func (*BundleUpdateOne) Save

func (buo *BundleUpdateOne) Save(ctx context.Context) (*Bundle, error)

Save executes the query and returns the updated Bundle entity.

func (*BundleUpdateOne) SaveX

func (buo *BundleUpdateOne) SaveX(ctx context.Context) *Bundle

SaveX is like Save, but panics if an error occurs.

func (*BundleUpdateOne) Select

func (buo *BundleUpdateOne) Select(field string, fields ...string) *BundleUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*BundleUpdateOne) SetAmount

func (buo *BundleUpdateOne) SetAmount(f float64) *BundleUpdateOne

SetAmount sets the "amount" field.

func (*BundleUpdateOne) SetDeletedAt

func (buo *BundleUpdateOne) SetDeletedAt(t time.Time) *BundleUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*BundleUpdateOne) SetNillableAmount

func (buo *BundleUpdateOne) SetNillableAmount(f *float64) *BundleUpdateOne

SetNillableAmount sets the "amount" field if the given value is not nil.

func (*BundleUpdateOne) SetNillableDeletedAt

func (buo *BundleUpdateOne) SetNillableDeletedAt(t *time.Time) *BundleUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*BundleUpdateOne) SetUpdatedAt

func (buo *BundleUpdateOne) SetUpdatedAt(t time.Time) *BundleUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*BundleUpdateOne) Where

func (buo *BundleUpdateOne) Where(ps ...predicate.Bundle) *BundleUpdateOne

Where appends a list predicates to the BundleUpdate builder.

type BundleUpsert

type BundleUpsert struct {
	*sql.UpdateSet
}

BundleUpsert is the "OnConflict" setter.

func (*BundleUpsert) AddAmount

func (u *BundleUpsert) AddAmount(v float64) *BundleUpsert

AddAmount adds v to the "amount" field.

func (*BundleUpsert) ClearDeletedAt

func (u *BundleUpsert) ClearDeletedAt() *BundleUpsert

ClearDeletedAt clears the value of the "deleted_at" field.

func (*BundleUpsert) SetAmount

func (u *BundleUpsert) SetAmount(v float64) *BundleUpsert

SetAmount sets the "amount" field.

func (*BundleUpsert) SetDeletedAt

func (u *BundleUpsert) SetDeletedAt(v time.Time) *BundleUpsert

SetDeletedAt sets the "deleted_at" field.

func (*BundleUpsert) SetUpdatedAt

func (u *BundleUpsert) SetUpdatedAt(v time.Time) *BundleUpsert

SetUpdatedAt sets the "updated_at" field.

func (*BundleUpsert) UpdateAmount

func (u *BundleUpsert) UpdateAmount() *BundleUpsert

UpdateAmount sets the "amount" field to the value that was provided on create.

func (*BundleUpsert) UpdateDeletedAt

func (u *BundleUpsert) UpdateDeletedAt() *BundleUpsert

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*BundleUpsert) UpdateUpdatedAt

func (u *BundleUpsert) UpdateUpdatedAt() *BundleUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type BundleUpsertBulk

type BundleUpsertBulk struct {
	// contains filtered or unexported fields
}

BundleUpsertBulk is the builder for "upsert"-ing a bulk of Bundle nodes.

func (*BundleUpsertBulk) AddAmount

func (u *BundleUpsertBulk) AddAmount(v float64) *BundleUpsertBulk

AddAmount adds v to the "amount" field.

func (*BundleUpsertBulk) ClearDeletedAt

func (u *BundleUpsertBulk) ClearDeletedAt() *BundleUpsertBulk

ClearDeletedAt clears the value of the "deleted_at" field.

func (*BundleUpsertBulk) DoNothing

func (u *BundleUpsertBulk) DoNothing() *BundleUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*BundleUpsertBulk) Exec

func (u *BundleUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*BundleUpsertBulk) ExecX

func (u *BundleUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*BundleUpsertBulk) Ignore

func (u *BundleUpsertBulk) Ignore() *BundleUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Bundle.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*BundleUpsertBulk) SetAmount

func (u *BundleUpsertBulk) SetAmount(v float64) *BundleUpsertBulk

SetAmount sets the "amount" field.

func (*BundleUpsertBulk) SetDeletedAt

func (u *BundleUpsertBulk) SetDeletedAt(v time.Time) *BundleUpsertBulk

SetDeletedAt sets the "deleted_at" field.

func (*BundleUpsertBulk) SetUpdatedAt

func (u *BundleUpsertBulk) SetUpdatedAt(v time.Time) *BundleUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*BundleUpsertBulk) Update

func (u *BundleUpsertBulk) Update(set func(*BundleUpsert)) *BundleUpsertBulk

Update allows overriding fields `UPDATE` values. See the BundleCreateBulk.OnConflict documentation for more info.

func (*BundleUpsertBulk) UpdateAmount

func (u *BundleUpsertBulk) UpdateAmount() *BundleUpsertBulk

UpdateAmount sets the "amount" field to the value that was provided on create.

func (*BundleUpsertBulk) UpdateDeletedAt

func (u *BundleUpsertBulk) UpdateDeletedAt() *BundleUpsertBulk

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*BundleUpsertBulk) UpdateNewValues

func (u *BundleUpsertBulk) UpdateNewValues() *BundleUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Bundle.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(bundle.FieldID)
		}),
	).
	Exec(ctx)

func (*BundleUpsertBulk) UpdateUpdatedAt

func (u *BundleUpsertBulk) UpdateUpdatedAt() *BundleUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type BundleUpsertOne

type BundleUpsertOne struct {
	// contains filtered or unexported fields
}

BundleUpsertOne is the builder for "upsert"-ing

one Bundle node.

func (*BundleUpsertOne) AddAmount

func (u *BundleUpsertOne) AddAmount(v float64) *BundleUpsertOne

AddAmount adds v to the "amount" field.

func (*BundleUpsertOne) ClearDeletedAt

func (u *BundleUpsertOne) ClearDeletedAt() *BundleUpsertOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*BundleUpsertOne) DoNothing

func (u *BundleUpsertOne) DoNothing() *BundleUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*BundleUpsertOne) Exec

func (u *BundleUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*BundleUpsertOne) ExecX

func (u *BundleUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*BundleUpsertOne) ID

func (u *BundleUpsertOne) ID(ctx context.Context) (id int64, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*BundleUpsertOne) IDX

func (u *BundleUpsertOne) IDX(ctx context.Context) int64

IDX is like ID, but panics if an error occurs.

func (*BundleUpsertOne) Ignore

func (u *BundleUpsertOne) Ignore() *BundleUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Bundle.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*BundleUpsertOne) SetAmount

func (u *BundleUpsertOne) SetAmount(v float64) *BundleUpsertOne

SetAmount sets the "amount" field.

func (*BundleUpsertOne) SetDeletedAt

func (u *BundleUpsertOne) SetDeletedAt(v time.Time) *BundleUpsertOne

SetDeletedAt sets the "deleted_at" field.

func (*BundleUpsertOne) SetUpdatedAt

func (u *BundleUpsertOne) SetUpdatedAt(v time.Time) *BundleUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*BundleUpsertOne) Update

func (u *BundleUpsertOne) Update(set func(*BundleUpsert)) *BundleUpsertOne

Update allows overriding fields `UPDATE` values. See the BundleCreate.OnConflict documentation for more info.

func (*BundleUpsertOne) UpdateAmount

func (u *BundleUpsertOne) UpdateAmount() *BundleUpsertOne

UpdateAmount sets the "amount" field to the value that was provided on create.

func (*BundleUpsertOne) UpdateDeletedAt

func (u *BundleUpsertOne) UpdateDeletedAt() *BundleUpsertOne

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*BundleUpsertOne) UpdateNewValues

func (u *BundleUpsertOne) UpdateNewValues() *BundleUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Bundle.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(bundle.FieldID)
		}),
	).
	Exec(ctx)

func (*BundleUpsertOne) UpdateUpdatedAt

func (u *BundleUpsertOne) UpdateUpdatedAt() *BundleUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type Bundles

type Bundles []*Bundle

Bundles is a parsable slice of Bundle.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Bundle is the client for interacting with the Bundle builders.
	Bundle *BundleClient
	// Invoice is the client for interacting with the Invoice builders.
	Invoice *InvoiceClient
	// Item is the client for interacting with the Item builders.
	Item *ItemClient
	// PaymentProfile is the client for interacting with the PaymentProfile builders.
	PaymentProfile *PaymentProfileClient
	// Product is the client for interacting with the Product builders.
	Product *ProductClient
	// ProductReservation is the client for interacting with the ProductReservation builders.
	ProductReservation *ProductReservationClient
	// Subscriptions is the client for interacting with the Subscriptions builders.
	Subscriptions *SubscriptionsClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

FromContext returns a Client stored inside a context, or nil if there isn't one.

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

func Open(driverName, dataSourceName string, options ...Option) (*Client, error)

Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.

func (*Client) BeginTx

func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

Close closes the database connection and prevents new queries from starting.

func (*Client) Debug

func (c *Client) Debug() *Client

Debug returns a new debug-client. It's used to get verbose logging on specific operations.

client.Debug().
	Bundle.
	Query().
	Count(ctx)

func (*Client) Intercept

func (c *Client) Intercept(interceptors ...Interceptor)

Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.

func (*Client) Mutate

func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)

Mutate implements the ent.Mutator interface.

func (*Client) Tx

func (c *Client) Tx(ctx context.Context) (*Tx, error)

Tx returns a new transactional client. The provided context is used until the transaction is committed or rolled back.

func (*Client) Use

func (c *Client) Use(hooks ...Hook)

Use adds the mutation hooks to all the entity clients. In order to add hooks to a specific client, call: `client.Node.Use(...)`.

type CommitFunc

type CommitFunc func(context.Context, *Tx) error

The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.

func (CommitFunc) Commit

func (f CommitFunc) Commit(ctx context.Context, tx *Tx) error

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:

hook := func(next ent.Committer) ent.Committer {
	return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Commit(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Committer

type Committer interface {
	Commit(context.Context, *Tx) error
}

Committer is the interface that wraps the Commit method.

type ConstraintError

type ConstraintError struct {
	// contains filtered or unexported fields
}

ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

ent aliases to avoid import conflicts in user's code.

type Interceptor

type Interceptor = ent.Interceptor

ent aliases to avoid import conflicts in user's code.

type Invoice

type Invoice struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID int64 `json:"user_id,omitempty"`
	// TenantID holds the value of the "tenant_id" field.
	TenantID int64 `json:"tenant_id,omitempty"`
	// AppID holds the value of the "app_id" field.
	AppID string `json:"app_id,omitempty"`
	// ProductID holds the value of the "product_id" field.
	ProductID int64 `json:"product_id,omitempty"`
	// Amount holds the value of the "amount" field.
	Amount int64 `json:"amount,omitempty"`
	// Price holds the value of the "price" field.
	Price decimal.Decimal `json:"price,omitempty"`
	// Currency holds the value of the "currency" field.
	Currency string `json:"currency,omitempty"`
	// Status holds the value of the "status" field.
	Status enum.InvoiceStatus `json:"status,omitempty"`
	// PaidAt holds the value of the "paid_at" field.
	PaidAt *time.Time `json:"paid_at,omitempty"`
	// PaidTill holds the value of the "paid_till" field.
	PaidTill *time.Time `json:"paid_till,omitempty"`
	// IsRevoked holds the value of the "is_revoked" field.
	IsRevoked bool `json:"is_revoked,omitempty"`
	// RevokedAt holds the value of the "revoked_at" field.
	RevokedAt *time.Time `json:"revoked_at,omitempty"`
	// IsRevokedProcessed holds the value of the "is_revoked_processed" field.
	IsRevokedProcessed bool `json:"is_revoked_processed,omitempty"`
	// IsPaidAtProcessed holds the value of the "is_paid_at_processed" field.
	IsPaidAtProcessed bool `json:"is_paid_at_processed,omitempty"`
	// IsPaidTillProcessed holds the value of the "is_paid_till_processed" field.
	IsPaidTillProcessed bool `json:"is_paid_till_processed,omitempty"`
	// SubscriptionID holds the value of the "subscription_id" field.
	SubscriptionID *int64 `json:"subscription_id,omitempty"`
	// ExternalTransactionID holds the value of the "external_transaction_id" field.
	ExternalTransactionID *string `json:"external_transaction_id,omitempty"`
	// PaymentProvider holds the value of the "payment_provider" field.
	PaymentProvider enum.PaymentProvider `json:"payment_provider,omitempty"`
	// IsTrial holds the value of the "is_trial" field.
	IsTrial bool `json:"is_trial,omitempty"`
	// PaymentProfileID holds the value of the "payment_profile_id" field.
	PaymentProfileID *int64 `json:"payment_profile_id,omitempty"`
	// TtpSubscriptionID holds the value of the "ttp_subscription_id" field.
	TtpSubscriptionID *string `json:"ttp_subscription_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the InvoiceQuery when eager-loading is set.
	Edges InvoiceEdges `json:"edges"`
	// contains filtered or unexported fields
}

Invoice is the model entity for the Invoice schema.

func (*Invoice) QueryPaymentProfile

func (i *Invoice) QueryPaymentProfile() *PaymentProfileQuery

QueryPaymentProfile queries the "payment_profile" edge of the Invoice entity.

func (*Invoice) QueryProduct

func (i *Invoice) QueryProduct() *ProductQuery

QueryProduct queries the "product" edge of the Invoice entity.

func (*Invoice) QueryReservations

func (i *Invoice) QueryReservations() *ProductReservationQuery

QueryReservations queries the "reservations" edge of the Invoice entity.

func (*Invoice) QuerySubscriptions

func (i *Invoice) QuerySubscriptions() *SubscriptionsQuery

QuerySubscriptions queries the "subscriptions" edge of the Invoice entity.

func (*Invoice) String

func (i *Invoice) String() string

String implements the fmt.Stringer.

func (*Invoice) Unwrap

func (i *Invoice) Unwrap() *Invoice

Unwrap unwraps the Invoice entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Invoice) Update

func (i *Invoice) Update() *InvoiceUpdateOne

Update returns a builder for updating this Invoice. Note that you need to call Invoice.Unwrap() before calling this method if this Invoice was returned from a transaction, and the transaction was committed or rolled back.

func (*Invoice) Value

func (i *Invoice) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Invoice. This includes values selected through modifiers, order, etc.

type InvoiceClient

type InvoiceClient struct {
	// contains filtered or unexported fields
}

InvoiceClient is a client for the Invoice schema.

func NewInvoiceClient

func NewInvoiceClient(c config) *InvoiceClient

NewInvoiceClient returns a client for the Invoice from the given config.

func (*InvoiceClient) Create

func (c *InvoiceClient) Create() *InvoiceCreate

Create returns a builder for creating a Invoice entity.

func (*InvoiceClient) CreateBulk

func (c *InvoiceClient) CreateBulk(builders ...*InvoiceCreate) *InvoiceCreateBulk

CreateBulk returns a builder for creating a bulk of Invoice entities.

func (*InvoiceClient) Delete

func (c *InvoiceClient) Delete() *InvoiceDelete

Delete returns a delete builder for Invoice.

func (*InvoiceClient) DeleteOne

func (c *InvoiceClient) DeleteOne(i *Invoice) *InvoiceDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*InvoiceClient) DeleteOneID

func (c *InvoiceClient) DeleteOneID(id int64) *InvoiceDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*InvoiceClient) Get

func (c *InvoiceClient) Get(ctx context.Context, id int64) (*Invoice, error)

Get returns a Invoice entity by its id.

func (*InvoiceClient) GetX

func (c *InvoiceClient) GetX(ctx context.Context, id int64) *Invoice

GetX is like Get, but panics if an error occurs.

func (*InvoiceClient) Hooks

func (c *InvoiceClient) Hooks() []Hook

Hooks returns the client hooks.

func (*InvoiceClient) Intercept

func (c *InvoiceClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `invoice.Intercept(f(g(h())))`.

func (*InvoiceClient) Interceptors

func (c *InvoiceClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*InvoiceClient) MapCreateBulk

func (c *InvoiceClient) MapCreateBulk(slice any, setFunc func(*InvoiceCreate, int)) *InvoiceCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*InvoiceClient) Query

func (c *InvoiceClient) Query() *InvoiceQuery

Query returns a query builder for Invoice.

func (*InvoiceClient) QueryPaymentProfile

func (c *InvoiceClient) QueryPaymentProfile(i *Invoice) *PaymentProfileQuery

QueryPaymentProfile queries the payment_profile edge of a Invoice.

func (*InvoiceClient) QueryProduct

func (c *InvoiceClient) QueryProduct(i *Invoice) *ProductQuery

QueryProduct queries the product edge of a Invoice.

func (*InvoiceClient) QueryReservations

func (c *InvoiceClient) QueryReservations(i *Invoice) *ProductReservationQuery

QueryReservations queries the reservations edge of a Invoice.

func (*InvoiceClient) QuerySubscriptions

func (c *InvoiceClient) QuerySubscriptions(i *Invoice) *SubscriptionsQuery

QuerySubscriptions queries the subscriptions edge of a Invoice.

func (*InvoiceClient) Update

func (c *InvoiceClient) Update() *InvoiceUpdate

Update returns an update builder for Invoice.

func (*InvoiceClient) UpdateOne

func (c *InvoiceClient) UpdateOne(i *Invoice) *InvoiceUpdateOne

UpdateOne returns an update builder for the given entity.

func (*InvoiceClient) UpdateOneID

func (c *InvoiceClient) UpdateOneID(id int64) *InvoiceUpdateOne

UpdateOneID returns an update builder for the given id.

func (*InvoiceClient) Use

func (c *InvoiceClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `invoice.Hooks(f(g(h())))`.

type InvoiceCreate

type InvoiceCreate struct {
	// contains filtered or unexported fields
}

InvoiceCreate is the builder for creating a Invoice entity.

func (*InvoiceCreate) AddReservationIDs

func (ic *InvoiceCreate) AddReservationIDs(ids ...int64) *InvoiceCreate

AddReservationIDs adds the "reservations" edge to the ProductReservation entity by IDs.

func (*InvoiceCreate) AddReservations

func (ic *InvoiceCreate) AddReservations(p ...*ProductReservation) *InvoiceCreate

AddReservations adds the "reservations" edges to the ProductReservation entity.

func (*InvoiceCreate) Exec

func (ic *InvoiceCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*InvoiceCreate) ExecX

func (ic *InvoiceCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*InvoiceCreate) Mutation

func (ic *InvoiceCreate) Mutation() *InvoiceMutation

Mutation returns the InvoiceMutation object of the builder.

func (*InvoiceCreate) OnConflict

func (ic *InvoiceCreate) OnConflict(opts ...sql.ConflictOption) *InvoiceUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Invoice.Create().
	SetUserID(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.InvoiceUpsert) {
		SetUserID(v+v).
	}).
	Exec(ctx)

func (*InvoiceCreate) OnConflictColumns

func (ic *InvoiceCreate) OnConflictColumns(columns ...string) *InvoiceUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Invoice.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*InvoiceCreate) Save

func (ic *InvoiceCreate) Save(ctx context.Context) (*Invoice, error)

Save creates the Invoice in the database.

func (*InvoiceCreate) SaveX

func (ic *InvoiceCreate) SaveX(ctx context.Context) *Invoice

SaveX calls Save and panics if Save returns an error.

func (*InvoiceCreate) SetAmount

func (ic *InvoiceCreate) SetAmount(i int64) *InvoiceCreate

SetAmount sets the "amount" field.

func (*InvoiceCreate) SetAppID

func (ic *InvoiceCreate) SetAppID(s string) *InvoiceCreate

SetAppID sets the "app_id" field.

func (*InvoiceCreate) SetCurrency

func (ic *InvoiceCreate) SetCurrency(s string) *InvoiceCreate

SetCurrency sets the "currency" field.

func (*InvoiceCreate) SetExternalTransactionID

func (ic *InvoiceCreate) SetExternalTransactionID(s string) *InvoiceCreate

SetExternalTransactionID sets the "external_transaction_id" field.

func (*InvoiceCreate) SetID

func (ic *InvoiceCreate) SetID(i int64) *InvoiceCreate

SetID sets the "id" field.

func (*InvoiceCreate) SetIsPaidAtProcessed

func (ic *InvoiceCreate) SetIsPaidAtProcessed(b bool) *InvoiceCreate

SetIsPaidAtProcessed sets the "is_paid_at_processed" field.

func (*InvoiceCreate) SetIsPaidTillProcessed

func (ic *InvoiceCreate) SetIsPaidTillProcessed(b bool) *InvoiceCreate

SetIsPaidTillProcessed sets the "is_paid_till_processed" field.

func (*InvoiceCreate) SetIsRevoked

func (ic *InvoiceCreate) SetIsRevoked(b bool) *InvoiceCreate

SetIsRevoked sets the "is_revoked" field.

func (*InvoiceCreate) SetIsRevokedProcessed

func (ic *InvoiceCreate) SetIsRevokedProcessed(b bool) *InvoiceCreate

SetIsRevokedProcessed sets the "is_revoked_processed" field.

func (*InvoiceCreate) SetIsTrial

func (ic *InvoiceCreate) SetIsTrial(b bool) *InvoiceCreate

SetIsTrial sets the "is_trial" field.

func (*InvoiceCreate) SetNillableCurrency

func (ic *InvoiceCreate) SetNillableCurrency(s *string) *InvoiceCreate

SetNillableCurrency sets the "currency" field if the given value is not nil.

func (*InvoiceCreate) SetNillableExternalTransactionID

func (ic *InvoiceCreate) SetNillableExternalTransactionID(s *string) *InvoiceCreate

SetNillableExternalTransactionID sets the "external_transaction_id" field if the given value is not nil.

func (*InvoiceCreate) SetNillableIsPaidAtProcessed

func (ic *InvoiceCreate) SetNillableIsPaidAtProcessed(b *bool) *InvoiceCreate

SetNillableIsPaidAtProcessed sets the "is_paid_at_processed" field if the given value is not nil.

func (*InvoiceCreate) SetNillableIsPaidTillProcessed

func (ic *InvoiceCreate) SetNillableIsPaidTillProcessed(b *bool) *InvoiceCreate

SetNillableIsPaidTillProcessed sets the "is_paid_till_processed" field if the given value is not nil.

func (*InvoiceCreate) SetNillableIsRevoked

func (ic *InvoiceCreate) SetNillableIsRevoked(b *bool) *InvoiceCreate

SetNillableIsRevoked sets the "is_revoked" field if the given value is not nil.

func (*InvoiceCreate) SetNillableIsRevokedProcessed

func (ic *InvoiceCreate) SetNillableIsRevokedProcessed(b *bool) *InvoiceCreate

SetNillableIsRevokedProcessed sets the "is_revoked_processed" field if the given value is not nil.

func (*InvoiceCreate) SetNillableIsTrial

func (ic *InvoiceCreate) SetNillableIsTrial(b *bool) *InvoiceCreate

SetNillableIsTrial sets the "is_trial" field if the given value is not nil.

func (*InvoiceCreate) SetNillablePaidAt

func (ic *InvoiceCreate) SetNillablePaidAt(t *time.Time) *InvoiceCreate

SetNillablePaidAt sets the "paid_at" field if the given value is not nil.

func (*InvoiceCreate) SetNillablePaidTill

func (ic *InvoiceCreate) SetNillablePaidTill(t *time.Time) *InvoiceCreate

SetNillablePaidTill sets the "paid_till" field if the given value is not nil.

func (*InvoiceCreate) SetNillablePaymentProfileID

func (ic *InvoiceCreate) SetNillablePaymentProfileID(i *int64) *InvoiceCreate

SetNillablePaymentProfileID sets the "payment_profile_id" field if the given value is not nil.

func (*InvoiceCreate) SetNillablePaymentProvider

func (ic *InvoiceCreate) SetNillablePaymentProvider(ep *enum.PaymentProvider) *InvoiceCreate

SetNillablePaymentProvider sets the "payment_provider" field if the given value is not nil.

func (*InvoiceCreate) SetNillableRevokedAt

func (ic *InvoiceCreate) SetNillableRevokedAt(t *time.Time) *InvoiceCreate

SetNillableRevokedAt sets the "revoked_at" field if the given value is not nil.

func (*InvoiceCreate) SetNillableStatus

func (ic *InvoiceCreate) SetNillableStatus(es *enum.InvoiceStatus) *InvoiceCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*InvoiceCreate) SetNillableSubscriptionID

func (ic *InvoiceCreate) SetNillableSubscriptionID(i *int64) *InvoiceCreate

SetNillableSubscriptionID sets the "subscription_id" field if the given value is not nil.

func (*InvoiceCreate) SetNillableSubscriptionsID

func (ic *InvoiceCreate) SetNillableSubscriptionsID(id *int64) *InvoiceCreate

SetNillableSubscriptionsID sets the "subscriptions" edge to the Subscriptions entity by ID if the given value is not nil.

func (*InvoiceCreate) SetNillableTtpSubscriptionID

func (ic *InvoiceCreate) SetNillableTtpSubscriptionID(s *string) *InvoiceCreate

SetNillableTtpSubscriptionID sets the "ttp_subscription_id" field if the given value is not nil.

func (*InvoiceCreate) SetPaidAt

func (ic *InvoiceCreate) SetPaidAt(t time.Time) *InvoiceCreate

SetPaidAt sets the "paid_at" field.

func (*InvoiceCreate) SetPaidTill

func (ic *InvoiceCreate) SetPaidTill(t time.Time) *InvoiceCreate

SetPaidTill sets the "paid_till" field.

func (*InvoiceCreate) SetPaymentProfile

func (ic *InvoiceCreate) SetPaymentProfile(p *PaymentProfile) *InvoiceCreate

SetPaymentProfile sets the "payment_profile" edge to the PaymentProfile entity.

func (*InvoiceCreate) SetPaymentProfileID

func (ic *InvoiceCreate) SetPaymentProfileID(i int64) *InvoiceCreate

SetPaymentProfileID sets the "payment_profile_id" field.

func (*InvoiceCreate) SetPaymentProvider

func (ic *InvoiceCreate) SetPaymentProvider(ep enum.PaymentProvider) *InvoiceCreate

SetPaymentProvider sets the "payment_provider" field.

func (*InvoiceCreate) SetPrice

func (ic *InvoiceCreate) SetPrice(d decimal.Decimal) *InvoiceCreate

SetPrice sets the "price" field.

func (*InvoiceCreate) SetProduct

func (ic *InvoiceCreate) SetProduct(p *Product) *InvoiceCreate

SetProduct sets the "product" edge to the Product entity.

func (*InvoiceCreate) SetProductID

func (ic *InvoiceCreate) SetProductID(i int64) *InvoiceCreate

SetProductID sets the "product_id" field.

func (*InvoiceCreate) SetRevokedAt

func (ic *InvoiceCreate) SetRevokedAt(t time.Time) *InvoiceCreate

SetRevokedAt sets the "revoked_at" field.

func (*InvoiceCreate) SetStatus

func (ic *InvoiceCreate) SetStatus(es enum.InvoiceStatus) *InvoiceCreate

SetStatus sets the "status" field.

func (*InvoiceCreate) SetSubscriptionID

func (ic *InvoiceCreate) SetSubscriptionID(i int64) *InvoiceCreate

SetSubscriptionID sets the "subscription_id" field.

func (*InvoiceCreate) SetSubscriptions

func (ic *InvoiceCreate) SetSubscriptions(s *Subscriptions) *InvoiceCreate

SetSubscriptions sets the "subscriptions" edge to the Subscriptions entity.

func (*InvoiceCreate) SetSubscriptionsID

func (ic *InvoiceCreate) SetSubscriptionsID(id int64) *InvoiceCreate

SetSubscriptionsID sets the "subscriptions" edge to the Subscriptions entity by ID.

func (*InvoiceCreate) SetTenantID

func (ic *InvoiceCreate) SetTenantID(i int64) *InvoiceCreate

SetTenantID sets the "tenant_id" field.

func (*InvoiceCreate) SetTtpSubscriptionID

func (ic *InvoiceCreate) SetTtpSubscriptionID(s string) *InvoiceCreate

SetTtpSubscriptionID sets the "ttp_subscription_id" field.

func (*InvoiceCreate) SetUserID

func (ic *InvoiceCreate) SetUserID(i int64) *InvoiceCreate

SetUserID sets the "user_id" field.

type InvoiceCreateBulk

type InvoiceCreateBulk struct {
	// contains filtered or unexported fields
}

InvoiceCreateBulk is the builder for creating many Invoice entities in bulk.

func (*InvoiceCreateBulk) Exec

func (icb *InvoiceCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*InvoiceCreateBulk) ExecX

func (icb *InvoiceCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*InvoiceCreateBulk) OnConflict

func (icb *InvoiceCreateBulk) OnConflict(opts ...sql.ConflictOption) *InvoiceUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Invoice.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.InvoiceUpsert) {
		SetUserID(v+v).
	}).
	Exec(ctx)

func (*InvoiceCreateBulk) OnConflictColumns

func (icb *InvoiceCreateBulk) OnConflictColumns(columns ...string) *InvoiceUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Invoice.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*InvoiceCreateBulk) Save

func (icb *InvoiceCreateBulk) Save(ctx context.Context) ([]*Invoice, error)

Save creates the Invoice entities in the database.

func (*InvoiceCreateBulk) SaveX

func (icb *InvoiceCreateBulk) SaveX(ctx context.Context) []*Invoice

SaveX is like Save, but panics if an error occurs.

type InvoiceDelete

type InvoiceDelete struct {
	// contains filtered or unexported fields
}

InvoiceDelete is the builder for deleting a Invoice entity.

func (*InvoiceDelete) Exec

func (id *InvoiceDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*InvoiceDelete) ExecX

func (id *InvoiceDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*InvoiceDelete) Where

func (id *InvoiceDelete) Where(ps ...predicate.Invoice) *InvoiceDelete

Where appends a list predicates to the InvoiceDelete builder.

type InvoiceDeleteOne

type InvoiceDeleteOne struct {
	// contains filtered or unexported fields
}

InvoiceDeleteOne is the builder for deleting a single Invoice entity.

func (*InvoiceDeleteOne) Exec

func (ido *InvoiceDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*InvoiceDeleteOne) ExecX

func (ido *InvoiceDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*InvoiceDeleteOne) Where

Where appends a list predicates to the InvoiceDelete builder.

type InvoiceEdges

type InvoiceEdges struct {
	// Product holds the value of the product edge.
	Product *Product `json:"product,omitempty"`
	// Subscriptions holds the value of the subscriptions edge.
	Subscriptions *Subscriptions `json:"subscriptions,omitempty"`
	// PaymentProfile holds the value of the payment_profile edge.
	PaymentProfile *PaymentProfile `json:"payment_profile,omitempty"`
	// Reservations holds the value of the reservations edge.
	Reservations []*ProductReservation `json:"reservations,omitempty"`
	// contains filtered or unexported fields
}

InvoiceEdges holds the relations/edges for other nodes in the graph.

func (InvoiceEdges) PaymentProfileOrErr

func (e InvoiceEdges) PaymentProfileOrErr() (*PaymentProfile, error)

PaymentProfileOrErr returns the PaymentProfile value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (InvoiceEdges) ProductOrErr

func (e InvoiceEdges) ProductOrErr() (*Product, error)

ProductOrErr returns the Product value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (InvoiceEdges) ReservationsOrErr

func (e InvoiceEdges) ReservationsOrErr() ([]*ProductReservation, error)

ReservationsOrErr returns the Reservations value or an error if the edge was not loaded in eager-loading.

func (InvoiceEdges) SubscriptionsOrErr

func (e InvoiceEdges) SubscriptionsOrErr() (*Subscriptions, error)

SubscriptionsOrErr returns the Subscriptions value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type InvoiceFilter

type InvoiceFilter struct {
	// contains filtered or unexported fields
}

InvoiceFilter provides a generic filtering capability at runtime for InvoiceQuery.

func (*InvoiceFilter) Where

func (f *InvoiceFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*InvoiceFilter) WhereAmount

func (f *InvoiceFilter) WhereAmount(p entql.Int64P)

WhereAmount applies the entql int64 predicate on the amount field.

func (*InvoiceFilter) WhereAppID

func (f *InvoiceFilter) WhereAppID(p entql.StringP)

WhereAppID applies the entql string predicate on the app_id field.

func (*InvoiceFilter) WhereCurrency

func (f *InvoiceFilter) WhereCurrency(p entql.StringP)

WhereCurrency applies the entql string predicate on the currency field.

func (*InvoiceFilter) WhereExternalTransactionID

func (f *InvoiceFilter) WhereExternalTransactionID(p entql.StringP)

WhereExternalTransactionID applies the entql string predicate on the external_transaction_id field.

func (*InvoiceFilter) WhereHasPaymentProfile

func (f *InvoiceFilter) WhereHasPaymentProfile()

WhereHasPaymentProfile applies a predicate to check if query has an edge payment_profile.

func (*InvoiceFilter) WhereHasPaymentProfileWith

func (f *InvoiceFilter) WhereHasPaymentProfileWith(preds ...predicate.PaymentProfile)

WhereHasPaymentProfileWith applies a predicate to check if query has an edge payment_profile with a given conditions (other predicates).

func (*InvoiceFilter) WhereHasProduct

func (f *InvoiceFilter) WhereHasProduct()

WhereHasProduct applies a predicate to check if query has an edge product.

func (*InvoiceFilter) WhereHasProductWith

func (f *InvoiceFilter) WhereHasProductWith(preds ...predicate.Product)

WhereHasProductWith applies a predicate to check if query has an edge product with a given conditions (other predicates).

func (*InvoiceFilter) WhereHasReservations

func (f *InvoiceFilter) WhereHasReservations()

WhereHasReservations applies a predicate to check if query has an edge reservations.

func (*InvoiceFilter) WhereHasReservationsWith

func (f *InvoiceFilter) WhereHasReservationsWith(preds ...predicate.ProductReservation)

WhereHasReservationsWith applies a predicate to check if query has an edge reservations with a given conditions (other predicates).

func (*InvoiceFilter) WhereHasSubscriptions

func (f *InvoiceFilter) WhereHasSubscriptions()

WhereHasSubscriptions applies a predicate to check if query has an edge subscriptions.

func (*InvoiceFilter) WhereHasSubscriptionsWith

func (f *InvoiceFilter) WhereHasSubscriptionsWith(preds ...predicate.Subscriptions)

WhereHasSubscriptionsWith applies a predicate to check if query has an edge subscriptions with a given conditions (other predicates).

func (*InvoiceFilter) WhereID

func (f *InvoiceFilter) WhereID(p entql.Int64P)

WhereID applies the entql int64 predicate on the id field.

func (*InvoiceFilter) WhereIsPaidAtProcessed

func (f *InvoiceFilter) WhereIsPaidAtProcessed(p entql.BoolP)

WhereIsPaidAtProcessed applies the entql bool predicate on the is_paid_at_processed field.

func (*InvoiceFilter) WhereIsPaidTillProcessed

func (f *InvoiceFilter) WhereIsPaidTillProcessed(p entql.BoolP)

WhereIsPaidTillProcessed applies the entql bool predicate on the is_paid_till_processed field.

func (*InvoiceFilter) WhereIsRevoked

func (f *InvoiceFilter) WhereIsRevoked(p entql.BoolP)

WhereIsRevoked applies the entql bool predicate on the is_revoked field.

func (*InvoiceFilter) WhereIsRevokedProcessed

func (f *InvoiceFilter) WhereIsRevokedProcessed(p entql.BoolP)

WhereIsRevokedProcessed applies the entql bool predicate on the is_revoked_processed field.

func (*InvoiceFilter) WhereIsTrial

func (f *InvoiceFilter) WhereIsTrial(p entql.BoolP)

WhereIsTrial applies the entql bool predicate on the is_trial field.

func (*InvoiceFilter) WherePaidAt

func (f *InvoiceFilter) WherePaidAt(p entql.TimeP)

WherePaidAt applies the entql time.Time predicate on the paid_at field.

func (*InvoiceFilter) WherePaidTill

func (f *InvoiceFilter) WherePaidTill(p entql.TimeP)

WherePaidTill applies the entql time.Time predicate on the paid_till field.

func (*InvoiceFilter) WherePaymentProfileID

func (f *InvoiceFilter) WherePaymentProfileID(p entql.Int64P)

WherePaymentProfileID applies the entql int64 predicate on the payment_profile_id field.

func (*InvoiceFilter) WherePaymentProvider

func (f *InvoiceFilter) WherePaymentProvider(p entql.StringP)

WherePaymentProvider applies the entql string predicate on the payment_provider field.

func (*InvoiceFilter) WherePrice

func (f *InvoiceFilter) WherePrice(p entql.Float64P)

WherePrice applies the entql float64 predicate on the price field.

func (*InvoiceFilter) WhereProductID

func (f *InvoiceFilter) WhereProductID(p entql.Int64P)

WhereProductID applies the entql int64 predicate on the product_id field.

func (*InvoiceFilter) WhereRevokedAt

func (f *InvoiceFilter) WhereRevokedAt(p entql.TimeP)

WhereRevokedAt applies the entql time.Time predicate on the revoked_at field.

func (*InvoiceFilter) WhereStatus

func (f *InvoiceFilter) WhereStatus(p entql.StringP)

WhereStatus applies the entql string predicate on the status field.

func (*InvoiceFilter) WhereSubscriptionID

func (f *InvoiceFilter) WhereSubscriptionID(p entql.Int64P)

WhereSubscriptionID applies the entql int64 predicate on the subscription_id field.

func (*InvoiceFilter) WhereTenantID

func (f *InvoiceFilter) WhereTenantID(p entql.Int64P)

WhereTenantID applies the entql int64 predicate on the tenant_id field.

func (*InvoiceFilter) WhereTtpSubscriptionID

func (f *InvoiceFilter) WhereTtpSubscriptionID(p entql.StringP)

WhereTtpSubscriptionID applies the entql string predicate on the ttp_subscription_id field.

func (*InvoiceFilter) WhereUserID

func (f *InvoiceFilter) WhereUserID(p entql.Int64P)

WhereUserID applies the entql int64 predicate on the user_id field.

type InvoiceGroupBy

type InvoiceGroupBy struct {
	// contains filtered or unexported fields
}

InvoiceGroupBy is the group-by builder for Invoice entities.

func (*InvoiceGroupBy) Aggregate

func (igb *InvoiceGroupBy) Aggregate(fns ...AggregateFunc) *InvoiceGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*InvoiceGroupBy) Bool

func (s *InvoiceGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*InvoiceGroupBy) BoolX

func (s *InvoiceGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*InvoiceGroupBy) Bools

func (s *InvoiceGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*InvoiceGroupBy) BoolsX

func (s *InvoiceGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*InvoiceGroupBy) Float64

func (s *InvoiceGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*InvoiceGroupBy) Float64X

func (s *InvoiceGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*InvoiceGroupBy) Float64s

func (s *InvoiceGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*InvoiceGroupBy) Float64sX

func (s *InvoiceGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*InvoiceGroupBy) Int

func (s *InvoiceGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*InvoiceGroupBy) IntX

func (s *InvoiceGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*InvoiceGroupBy) Ints

func (s *InvoiceGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*InvoiceGroupBy) IntsX

func (s *InvoiceGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*InvoiceGroupBy) Scan

func (igb *InvoiceGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*InvoiceGroupBy) ScanX

func (s *InvoiceGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*InvoiceGroupBy) String

func (s *InvoiceGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*InvoiceGroupBy) StringX

func (s *InvoiceGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*InvoiceGroupBy) Strings

func (s *InvoiceGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*InvoiceGroupBy) StringsX

func (s *InvoiceGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type InvoiceMutation

type InvoiceMutation struct {
	// contains filtered or unexported fields
}

InvoiceMutation represents an operation that mutates the Invoice nodes in the graph.

func (*InvoiceMutation) AddAmount

func (m *InvoiceMutation) AddAmount(i int64)

AddAmount adds i to the "amount" field.

func (*InvoiceMutation) AddField

func (m *InvoiceMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*InvoiceMutation) AddPrice

func (m *InvoiceMutation) AddPrice(d decimal.Decimal)

AddPrice adds d to the "price" field.

func (*InvoiceMutation) AddReservationIDs

func (m *InvoiceMutation) AddReservationIDs(ids ...int64)

AddReservationIDs adds the "reservations" edge to the ProductReservation entity by ids.

func (*InvoiceMutation) AddTenantID

func (m *InvoiceMutation) AddTenantID(i int64)

AddTenantID adds i to the "tenant_id" field.

func (*InvoiceMutation) AddUserID

func (m *InvoiceMutation) AddUserID(i int64)

AddUserID adds i to the "user_id" field.

func (*InvoiceMutation) AddedAmount

func (m *InvoiceMutation) AddedAmount() (r int64, exists bool)

AddedAmount returns the value that was added to the "amount" field in this mutation.

func (*InvoiceMutation) AddedEdges

func (m *InvoiceMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*InvoiceMutation) AddedField

func (m *InvoiceMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*InvoiceMutation) AddedFields

func (m *InvoiceMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*InvoiceMutation) AddedIDs

func (m *InvoiceMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*InvoiceMutation) AddedPrice

func (m *InvoiceMutation) AddedPrice() (r decimal.Decimal, exists bool)

AddedPrice returns the value that was added to the "price" field in this mutation.

func (*InvoiceMutation) AddedTenantID

func (m *InvoiceMutation) AddedTenantID() (r int64, exists bool)

AddedTenantID returns the value that was added to the "tenant_id" field in this mutation.

func (*InvoiceMutation) AddedUserID

func (m *InvoiceMutation) AddedUserID() (r int64, exists bool)

AddedUserID returns the value that was added to the "user_id" field in this mutation.

func (*InvoiceMutation) Amount

func (m *InvoiceMutation) Amount() (r int64, exists bool)

Amount returns the value of the "amount" field in the mutation.

func (*InvoiceMutation) AppID

func (m *InvoiceMutation) AppID() (r string, exists bool)

AppID returns the value of the "app_id" field in the mutation.

func (*InvoiceMutation) ClearEdge

func (m *InvoiceMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*InvoiceMutation) ClearExternalTransactionID

func (m *InvoiceMutation) ClearExternalTransactionID()

ClearExternalTransactionID clears the value of the "external_transaction_id" field.

func (*InvoiceMutation) ClearField

func (m *InvoiceMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*InvoiceMutation) ClearPaidAt

func (m *InvoiceMutation) ClearPaidAt()

ClearPaidAt clears the value of the "paid_at" field.

func (*InvoiceMutation) ClearPaidTill

func (m *InvoiceMutation) ClearPaidTill()

ClearPaidTill clears the value of the "paid_till" field.

func (*InvoiceMutation) ClearPaymentProfile

func (m *InvoiceMutation) ClearPaymentProfile()

ClearPaymentProfile clears the "payment_profile" edge to the PaymentProfile entity.

func (*InvoiceMutation) ClearPaymentProfileID

func (m *InvoiceMutation) ClearPaymentProfileID()

ClearPaymentProfileID clears the value of the "payment_profile_id" field.

func (*InvoiceMutation) ClearProduct

func (m *InvoiceMutation) ClearProduct()

ClearProduct clears the "product" edge to the Product entity.

func (*InvoiceMutation) ClearReservations

func (m *InvoiceMutation) ClearReservations()

ClearReservations clears the "reservations" edge to the ProductReservation entity.

func (*InvoiceMutation) ClearRevokedAt

func (m *InvoiceMutation) ClearRevokedAt()

ClearRevokedAt clears the value of the "revoked_at" field.

func (*InvoiceMutation) ClearSubscriptionID

func (m *InvoiceMutation) ClearSubscriptionID()

ClearSubscriptionID clears the value of the "subscription_id" field.

func (*InvoiceMutation) ClearSubscriptions

func (m *InvoiceMutation) ClearSubscriptions()

ClearSubscriptions clears the "subscriptions" edge to the Subscriptions entity.

func (*InvoiceMutation) ClearTtpSubscriptionID

func (m *InvoiceMutation) ClearTtpSubscriptionID()

ClearTtpSubscriptionID clears the value of the "ttp_subscription_id" field.

func (*InvoiceMutation) ClearedEdges

func (m *InvoiceMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*InvoiceMutation) ClearedFields

func (m *InvoiceMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (InvoiceMutation) Client

func (m InvoiceMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*InvoiceMutation) Currency

func (m *InvoiceMutation) Currency() (r string, exists bool)

Currency returns the value of the "currency" field in the mutation.

func (*InvoiceMutation) EdgeCleared

func (m *InvoiceMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*InvoiceMutation) ExternalTransactionID

func (m *InvoiceMutation) ExternalTransactionID() (r string, exists bool)

ExternalTransactionID returns the value of the "external_transaction_id" field in the mutation.

func (*InvoiceMutation) ExternalTransactionIDCleared

func (m *InvoiceMutation) ExternalTransactionIDCleared() bool

ExternalTransactionIDCleared returns if the "external_transaction_id" field was cleared in this mutation.

func (*InvoiceMutation) Field

func (m *InvoiceMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*InvoiceMutation) FieldCleared

func (m *InvoiceMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*InvoiceMutation) Fields

func (m *InvoiceMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*InvoiceMutation) Filter

func (m *InvoiceMutation) Filter() *InvoiceFilter

Filter returns an entql.Where implementation to apply filters on the InvoiceMutation builder.

func (*InvoiceMutation) ID

func (m *InvoiceMutation) ID() (id int64, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*InvoiceMutation) IDs

func (m *InvoiceMutation) IDs(ctx context.Context) ([]int64, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*InvoiceMutation) IsPaidAtProcessed

func (m *InvoiceMutation) IsPaidAtProcessed() (r bool, exists bool)

IsPaidAtProcessed returns the value of the "is_paid_at_processed" field in the mutation.

func (*InvoiceMutation) IsPaidTillProcessed

func (m *InvoiceMutation) IsPaidTillProcessed() (r bool, exists bool)

IsPaidTillProcessed returns the value of the "is_paid_till_processed" field in the mutation.

func (*InvoiceMutation) IsRevoked

func (m *InvoiceMutation) IsRevoked() (r bool, exists bool)

IsRevoked returns the value of the "is_revoked" field in the mutation.

func (*InvoiceMutation) IsRevokedProcessed

func (m *InvoiceMutation) IsRevokedProcessed() (r bool, exists bool)

IsRevokedProcessed returns the value of the "is_revoked_processed" field in the mutation.

func (*InvoiceMutation) IsTrial

func (m *InvoiceMutation) IsTrial() (r bool, exists bool)

IsTrial returns the value of the "is_trial" field in the mutation.

func (*InvoiceMutation) OldAmount

func (m *InvoiceMutation) OldAmount(ctx context.Context) (v int64, err error)

OldAmount returns the old "amount" field's value of the Invoice entity. If the Invoice object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*InvoiceMutation) OldAppID

func (m *InvoiceMutation) OldAppID(ctx context.Context) (v string, err error)

OldAppID returns the old "app_id" field's value of the Invoice entity. If the Invoice object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*InvoiceMutation) OldCurrency

func (m *InvoiceMutation) OldCurrency(ctx context.Context) (v string, err error)

OldCurrency returns the old "currency" field's value of the Invoice entity. If the Invoice object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*InvoiceMutation) OldExternalTransactionID

func (m *InvoiceMutation) OldExternalTransactionID(ctx context.Context) (v *string, err error)

OldExternalTransactionID returns the old "external_transaction_id" field's value of the Invoice entity. If the Invoice object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*InvoiceMutation) OldField

func (m *InvoiceMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*InvoiceMutation) OldIsPaidAtProcessed

func (m *InvoiceMutation) OldIsPaidAtProcessed(ctx context.Context) (v bool, err error)

OldIsPaidAtProcessed returns the old "is_paid_at_processed" field's value of the Invoice entity. If the Invoice object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*InvoiceMutation) OldIsPaidTillProcessed

func (m *InvoiceMutation) OldIsPaidTillProcessed(ctx context.Context) (v bool, err error)

OldIsPaidTillProcessed returns the old "is_paid_till_processed" field's value of the Invoice entity. If the Invoice object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*InvoiceMutation) OldIsRevoked

func (m *InvoiceMutation) OldIsRevoked(ctx context.Context) (v bool, err error)

OldIsRevoked returns the old "is_revoked" field's value of the Invoice entity. If the Invoice object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*InvoiceMutation) OldIsRevokedProcessed

func (m *InvoiceMutation) OldIsRevokedProcessed(ctx context.Context) (v bool, err error)

OldIsRevokedProcessed returns the old "is_revoked_processed" field's value of the Invoice entity. If the Invoice object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*InvoiceMutation) OldIsTrial

func (m *InvoiceMutation) OldIsTrial(ctx context.Context) (v bool, err error)

OldIsTrial returns the old "is_trial" field's value of the Invoice entity. If the Invoice object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*InvoiceMutation) OldPaidAt

func (m *InvoiceMutation) OldPaidAt(ctx context.Context) (v *time.Time, err error)

OldPaidAt returns the old "paid_at" field's value of the Invoice entity. If the Invoice object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*InvoiceMutation) OldPaidTill

func (m *InvoiceMutation) OldPaidTill(ctx context.Context) (v *time.Time, err error)

OldPaidTill returns the old "paid_till" field's value of the Invoice entity. If the Invoice object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*InvoiceMutation) OldPaymentProfileID

func (m *InvoiceMutation) OldPaymentProfileID(ctx context.Context) (v *int64, err error)

OldPaymentProfileID returns the old "payment_profile_id" field's value of the Invoice entity. If the Invoice object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*InvoiceMutation) OldPaymentProvider

func (m *InvoiceMutation) OldPaymentProvider(ctx context.Context) (v enum.PaymentProvider, err error)

OldPaymentProvider returns the old "payment_provider" field's value of the Invoice entity. If the Invoice object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*InvoiceMutation) OldPrice

func (m *InvoiceMutation) OldPrice(ctx context.Context) (v decimal.Decimal, err error)

OldPrice returns the old "price" field's value of the Invoice entity. If the Invoice object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*InvoiceMutation) OldProductID

func (m *InvoiceMutation) OldProductID(ctx context.Context) (v int64, err error)

OldProductID returns the old "product_id" field's value of the Invoice entity. If the Invoice object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*InvoiceMutation) OldRevokedAt

func (m *InvoiceMutation) OldRevokedAt(ctx context.Context) (v *time.Time, err error)

OldRevokedAt returns the old "revoked_at" field's value of the Invoice entity. If the Invoice object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*InvoiceMutation) OldStatus

func (m *InvoiceMutation) OldStatus(ctx context.Context) (v enum.InvoiceStatus, err error)

OldStatus returns the old "status" field's value of the Invoice entity. If the Invoice object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*InvoiceMutation) OldSubscriptionID

func (m *InvoiceMutation) OldSubscriptionID(ctx context.Context) (v *int64, err error)

OldSubscriptionID returns the old "subscription_id" field's value of the Invoice entity. If the Invoice object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*InvoiceMutation) OldTenantID

func (m *InvoiceMutation) OldTenantID(ctx context.Context) (v int64, err error)

OldTenantID returns the old "tenant_id" field's value of the Invoice entity. If the Invoice object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*InvoiceMutation) OldTtpSubscriptionID

func (m *InvoiceMutation) OldTtpSubscriptionID(ctx context.Context) (v *string, err error)

OldTtpSubscriptionID returns the old "ttp_subscription_id" field's value of the Invoice entity. If the Invoice object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*InvoiceMutation) OldUserID

func (m *InvoiceMutation) OldUserID(ctx context.Context) (v int64, err error)

OldUserID returns the old "user_id" field's value of the Invoice entity. If the Invoice object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*InvoiceMutation) Op

func (m *InvoiceMutation) Op() Op

Op returns the operation name.

func (*InvoiceMutation) PaidAt

func (m *InvoiceMutation) PaidAt() (r time.Time, exists bool)

PaidAt returns the value of the "paid_at" field in the mutation.

func (*InvoiceMutation) PaidAtCleared

func (m *InvoiceMutation) PaidAtCleared() bool

PaidAtCleared returns if the "paid_at" field was cleared in this mutation.

func (*InvoiceMutation) PaidTill

func (m *InvoiceMutation) PaidTill() (r time.Time, exists bool)

PaidTill returns the value of the "paid_till" field in the mutation.

func (*InvoiceMutation) PaidTillCleared

func (m *InvoiceMutation) PaidTillCleared() bool

PaidTillCleared returns if the "paid_till" field was cleared in this mutation.

func (*InvoiceMutation) PaymentProfileCleared

func (m *InvoiceMutation) PaymentProfileCleared() bool

PaymentProfileCleared reports if the "payment_profile" edge to the PaymentProfile entity was cleared.

func (*InvoiceMutation) PaymentProfileID

func (m *InvoiceMutation) PaymentProfileID() (r int64, exists bool)

PaymentProfileID returns the value of the "payment_profile_id" field in the mutation.

func (*InvoiceMutation) PaymentProfileIDCleared

func (m *InvoiceMutation) PaymentProfileIDCleared() bool

PaymentProfileIDCleared returns if the "payment_profile_id" field was cleared in this mutation.

func (*InvoiceMutation) PaymentProfileIDs

func (m *InvoiceMutation) PaymentProfileIDs() (ids []int64)

PaymentProfileIDs returns the "payment_profile" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use PaymentProfileID instead. It exists only for internal usage by the builders.

func (*InvoiceMutation) PaymentProvider

func (m *InvoiceMutation) PaymentProvider() (r enum.PaymentProvider, exists bool)

PaymentProvider returns the value of the "payment_provider" field in the mutation.

func (*InvoiceMutation) Price

func (m *InvoiceMutation) Price() (r decimal.Decimal, exists bool)

Price returns the value of the "price" field in the mutation.

func (*InvoiceMutation) ProductCleared

func (m *InvoiceMutation) ProductCleared() bool

ProductCleared reports if the "product" edge to the Product entity was cleared.

func (*InvoiceMutation) ProductID

func (m *InvoiceMutation) ProductID() (r int64, exists bool)

ProductID returns the value of the "product_id" field in the mutation.

func (*InvoiceMutation) ProductIDs

func (m *InvoiceMutation) ProductIDs() (ids []int64)

ProductIDs returns the "product" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ProductID instead. It exists only for internal usage by the builders.

func (*InvoiceMutation) RemoveReservationIDs

func (m *InvoiceMutation) RemoveReservationIDs(ids ...int64)

RemoveReservationIDs removes the "reservations" edge to the ProductReservation entity by IDs.

func (*InvoiceMutation) RemovedEdges

func (m *InvoiceMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*InvoiceMutation) RemovedIDs

func (m *InvoiceMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*InvoiceMutation) RemovedReservationsIDs

func (m *InvoiceMutation) RemovedReservationsIDs() (ids []int64)

RemovedReservations returns the removed IDs of the "reservations" edge to the ProductReservation entity.

func (*InvoiceMutation) ReservationsCleared

func (m *InvoiceMutation) ReservationsCleared() bool

ReservationsCleared reports if the "reservations" edge to the ProductReservation entity was cleared.

func (*InvoiceMutation) ReservationsIDs

func (m *InvoiceMutation) ReservationsIDs() (ids []int64)

ReservationsIDs returns the "reservations" edge IDs in the mutation.

func (*InvoiceMutation) ResetAmount

func (m *InvoiceMutation) ResetAmount()

ResetAmount resets all changes to the "amount" field.

func (*InvoiceMutation) ResetAppID

func (m *InvoiceMutation) ResetAppID()

ResetAppID resets all changes to the "app_id" field.

func (*InvoiceMutation) ResetCurrency

func (m *InvoiceMutation) ResetCurrency()

ResetCurrency resets all changes to the "currency" field.

func (*InvoiceMutation) ResetEdge

func (m *InvoiceMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*InvoiceMutation) ResetExternalTransactionID

func (m *InvoiceMutation) ResetExternalTransactionID()

ResetExternalTransactionID resets all changes to the "external_transaction_id" field.

func (*InvoiceMutation) ResetField

func (m *InvoiceMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*InvoiceMutation) ResetIsPaidAtProcessed

func (m *InvoiceMutation) ResetIsPaidAtProcessed()

ResetIsPaidAtProcessed resets all changes to the "is_paid_at_processed" field.

func (*InvoiceMutation) ResetIsPaidTillProcessed

func (m *InvoiceMutation) ResetIsPaidTillProcessed()

ResetIsPaidTillProcessed resets all changes to the "is_paid_till_processed" field.

func (*InvoiceMutation) ResetIsRevoked

func (m *InvoiceMutation) ResetIsRevoked()

ResetIsRevoked resets all changes to the "is_revoked" field.

func (*InvoiceMutation) ResetIsRevokedProcessed

func (m *InvoiceMutation) ResetIsRevokedProcessed()

ResetIsRevokedProcessed resets all changes to the "is_revoked_processed" field.

func (*InvoiceMutation) ResetIsTrial

func (m *InvoiceMutation) ResetIsTrial()

ResetIsTrial resets all changes to the "is_trial" field.

func (*InvoiceMutation) ResetPaidAt

func (m *InvoiceMutation) ResetPaidAt()

ResetPaidAt resets all changes to the "paid_at" field.

func (*InvoiceMutation) ResetPaidTill

func (m *InvoiceMutation) ResetPaidTill()

ResetPaidTill resets all changes to the "paid_till" field.

func (*InvoiceMutation) ResetPaymentProfile

func (m *InvoiceMutation) ResetPaymentProfile()

ResetPaymentProfile resets all changes to the "payment_profile" edge.

func (*InvoiceMutation) ResetPaymentProfileID

func (m *InvoiceMutation) ResetPaymentProfileID()

ResetPaymentProfileID resets all changes to the "payment_profile_id" field.

func (*InvoiceMutation) ResetPaymentProvider

func (m *InvoiceMutation) ResetPaymentProvider()

ResetPaymentProvider resets all changes to the "payment_provider" field.

func (*InvoiceMutation) ResetPrice

func (m *InvoiceMutation) ResetPrice()

ResetPrice resets all changes to the "price" field.

func (*InvoiceMutation) ResetProduct

func (m *InvoiceMutation) ResetProduct()

ResetProduct resets all changes to the "product" edge.

func (*InvoiceMutation) ResetProductID

func (m *InvoiceMutation) ResetProductID()

ResetProductID resets all changes to the "product_id" field.

func (*InvoiceMutation) ResetReservations

func (m *InvoiceMutation) ResetReservations()

ResetReservations resets all changes to the "reservations" edge.

func (*InvoiceMutation) ResetRevokedAt

func (m *InvoiceMutation) ResetRevokedAt()

ResetRevokedAt resets all changes to the "revoked_at" field.

func (*InvoiceMutation) ResetStatus

func (m *InvoiceMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*InvoiceMutation) ResetSubscriptionID

func (m *InvoiceMutation) ResetSubscriptionID()

ResetSubscriptionID resets all changes to the "subscription_id" field.

func (*InvoiceMutation) ResetSubscriptions

func (m *InvoiceMutation) ResetSubscriptions()

ResetSubscriptions resets all changes to the "subscriptions" edge.

func (*InvoiceMutation) ResetTenantID

func (m *InvoiceMutation) ResetTenantID()

ResetTenantID resets all changes to the "tenant_id" field.

func (*InvoiceMutation) ResetTtpSubscriptionID

func (m *InvoiceMutation) ResetTtpSubscriptionID()

ResetTtpSubscriptionID resets all changes to the "ttp_subscription_id" field.

func (*InvoiceMutation) ResetUserID

func (m *InvoiceMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*InvoiceMutation) RevokedAt

func (m *InvoiceMutation) RevokedAt() (r time.Time, exists bool)

RevokedAt returns the value of the "revoked_at" field in the mutation.

func (*InvoiceMutation) RevokedAtCleared

func (m *InvoiceMutation) RevokedAtCleared() bool

RevokedAtCleared returns if the "revoked_at" field was cleared in this mutation.

func (*InvoiceMutation) SetAmount

func (m *InvoiceMutation) SetAmount(i int64)

SetAmount sets the "amount" field.

func (*InvoiceMutation) SetAppID

func (m *InvoiceMutation) SetAppID(s string)

SetAppID sets the "app_id" field.

func (*InvoiceMutation) SetCurrency

func (m *InvoiceMutation) SetCurrency(s string)

SetCurrency sets the "currency" field.

func (*InvoiceMutation) SetExternalTransactionID

func (m *InvoiceMutation) SetExternalTransactionID(s string)

SetExternalTransactionID sets the "external_transaction_id" field.

func (*InvoiceMutation) SetField

func (m *InvoiceMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*InvoiceMutation) SetID

func (m *InvoiceMutation) SetID(id int64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Invoice entities.

func (*InvoiceMutation) SetIsPaidAtProcessed

func (m *InvoiceMutation) SetIsPaidAtProcessed(b bool)

SetIsPaidAtProcessed sets the "is_paid_at_processed" field.

func (*InvoiceMutation) SetIsPaidTillProcessed

func (m *InvoiceMutation) SetIsPaidTillProcessed(b bool)

SetIsPaidTillProcessed sets the "is_paid_till_processed" field.

func (*InvoiceMutation) SetIsRevoked

func (m *InvoiceMutation) SetIsRevoked(b bool)

SetIsRevoked sets the "is_revoked" field.

func (*InvoiceMutation) SetIsRevokedProcessed

func (m *InvoiceMutation) SetIsRevokedProcessed(b bool)

SetIsRevokedProcessed sets the "is_revoked_processed" field.

func (*InvoiceMutation) SetIsTrial

func (m *InvoiceMutation) SetIsTrial(b bool)

SetIsTrial sets the "is_trial" field.

func (*InvoiceMutation) SetOp

func (m *InvoiceMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*InvoiceMutation) SetPaidAt

func (m *InvoiceMutation) SetPaidAt(t time.Time)

SetPaidAt sets the "paid_at" field.

func (*InvoiceMutation) SetPaidTill

func (m *InvoiceMutation) SetPaidTill(t time.Time)

SetPaidTill sets the "paid_till" field.

func (*InvoiceMutation) SetPaymentProfileID

func (m *InvoiceMutation) SetPaymentProfileID(i int64)

SetPaymentProfileID sets the "payment_profile_id" field.

func (*InvoiceMutation) SetPaymentProvider

func (m *InvoiceMutation) SetPaymentProvider(ep enum.PaymentProvider)

SetPaymentProvider sets the "payment_provider" field.

func (*InvoiceMutation) SetPrice

func (m *InvoiceMutation) SetPrice(d decimal.Decimal)

SetPrice sets the "price" field.

func (*InvoiceMutation) SetProductID

func (m *InvoiceMutation) SetProductID(i int64)

SetProductID sets the "product_id" field.

func (*InvoiceMutation) SetRevokedAt

func (m *InvoiceMutation) SetRevokedAt(t time.Time)

SetRevokedAt sets the "revoked_at" field.

func (*InvoiceMutation) SetStatus

func (m *InvoiceMutation) SetStatus(es enum.InvoiceStatus)

SetStatus sets the "status" field.

func (*InvoiceMutation) SetSubscriptionID

func (m *InvoiceMutation) SetSubscriptionID(i int64)

SetSubscriptionID sets the "subscription_id" field.

func (*InvoiceMutation) SetSubscriptionsID

func (m *InvoiceMutation) SetSubscriptionsID(id int64)

SetSubscriptionsID sets the "subscriptions" edge to the Subscriptions entity by id.

func (*InvoiceMutation) SetTenantID

func (m *InvoiceMutation) SetTenantID(i int64)

SetTenantID sets the "tenant_id" field.

func (*InvoiceMutation) SetTtpSubscriptionID

func (m *InvoiceMutation) SetTtpSubscriptionID(s string)

SetTtpSubscriptionID sets the "ttp_subscription_id" field.

func (*InvoiceMutation) SetUserID

func (m *InvoiceMutation) SetUserID(i int64)

SetUserID sets the "user_id" field.

func (*InvoiceMutation) Status

func (m *InvoiceMutation) Status() (r enum.InvoiceStatus, exists bool)

Status returns the value of the "status" field in the mutation.

func (*InvoiceMutation) SubscriptionID

func (m *InvoiceMutation) SubscriptionID() (r int64, exists bool)

SubscriptionID returns the value of the "subscription_id" field in the mutation.

func (*InvoiceMutation) SubscriptionIDCleared

func (m *InvoiceMutation) SubscriptionIDCleared() bool

SubscriptionIDCleared returns if the "subscription_id" field was cleared in this mutation.

func (*InvoiceMutation) SubscriptionsCleared

func (m *InvoiceMutation) SubscriptionsCleared() bool

SubscriptionsCleared reports if the "subscriptions" edge to the Subscriptions entity was cleared.

func (*InvoiceMutation) SubscriptionsID

func (m *InvoiceMutation) SubscriptionsID() (id int64, exists bool)

SubscriptionsID returns the "subscriptions" edge ID in the mutation.

func (*InvoiceMutation) SubscriptionsIDs

func (m *InvoiceMutation) SubscriptionsIDs() (ids []int64)

SubscriptionsIDs returns the "subscriptions" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use SubscriptionsID instead. It exists only for internal usage by the builders.

func (*InvoiceMutation) TenantID

func (m *InvoiceMutation) TenantID() (r int64, exists bool)

TenantID returns the value of the "tenant_id" field in the mutation.

func (*InvoiceMutation) TtpSubscriptionID

func (m *InvoiceMutation) TtpSubscriptionID() (r string, exists bool)

TtpSubscriptionID returns the value of the "ttp_subscription_id" field in the mutation.

func (*InvoiceMutation) TtpSubscriptionIDCleared

func (m *InvoiceMutation) TtpSubscriptionIDCleared() bool

TtpSubscriptionIDCleared returns if the "ttp_subscription_id" field was cleared in this mutation.

func (InvoiceMutation) Tx

func (m InvoiceMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*InvoiceMutation) Type

func (m *InvoiceMutation) Type() string

Type returns the node type of this mutation (Invoice).

func (*InvoiceMutation) UserID

func (m *InvoiceMutation) UserID() (r int64, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*InvoiceMutation) Where

func (m *InvoiceMutation) Where(ps ...predicate.Invoice)

Where appends a list predicates to the InvoiceMutation builder.

func (*InvoiceMutation) WhereP

func (m *InvoiceMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the InvoiceMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type InvoiceQuery

type InvoiceQuery struct {
	// contains filtered or unexported fields
}

InvoiceQuery is the builder for querying Invoice entities.

func (*InvoiceQuery) Aggregate

func (iq *InvoiceQuery) Aggregate(fns ...AggregateFunc) *InvoiceSelect

Aggregate returns a InvoiceSelect configured with the given aggregations.

func (*InvoiceQuery) All

func (iq *InvoiceQuery) All(ctx context.Context) ([]*Invoice, error)

All executes the query and returns a list of Invoices.

func (*InvoiceQuery) AllX

func (iq *InvoiceQuery) AllX(ctx context.Context) []*Invoice

AllX is like All, but panics if an error occurs.

func (*InvoiceQuery) Clone

func (iq *InvoiceQuery) Clone() *InvoiceQuery

Clone returns a duplicate of the InvoiceQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*InvoiceQuery) Count

func (iq *InvoiceQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*InvoiceQuery) CountX

func (iq *InvoiceQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*InvoiceQuery) Exist

func (iq *InvoiceQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*InvoiceQuery) ExistX

func (iq *InvoiceQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*InvoiceQuery) Filter

func (iq *InvoiceQuery) Filter() *InvoiceFilter

Filter returns a Filter implementation to apply filters on the InvoiceQuery builder.

func (*InvoiceQuery) First

func (iq *InvoiceQuery) First(ctx context.Context) (*Invoice, error)

First returns the first Invoice entity from the query. Returns a *NotFoundError when no Invoice was found.

func (*InvoiceQuery) FirstID

func (iq *InvoiceQuery) FirstID(ctx context.Context) (id int64, err error)

FirstID returns the first Invoice ID from the query. Returns a *NotFoundError when no Invoice ID was found.

func (*InvoiceQuery) FirstIDX

func (iq *InvoiceQuery) FirstIDX(ctx context.Context) int64

FirstIDX is like FirstID, but panics if an error occurs.

func (*InvoiceQuery) FirstX

func (iq *InvoiceQuery) FirstX(ctx context.Context) *Invoice

FirstX is like First, but panics if an error occurs.

func (*InvoiceQuery) GroupBy

func (iq *InvoiceQuery) GroupBy(field string, fields ...string) *InvoiceGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	UserID int64 `json:"user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Invoice.Query().
	GroupBy(invoice.FieldUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*InvoiceQuery) IDs

func (iq *InvoiceQuery) IDs(ctx context.Context) (ids []int64, err error)

IDs executes the query and returns a list of Invoice IDs.

func (*InvoiceQuery) IDsX

func (iq *InvoiceQuery) IDsX(ctx context.Context) []int64

IDsX is like IDs, but panics if an error occurs.

func (*InvoiceQuery) Limit

func (iq *InvoiceQuery) Limit(limit int) *InvoiceQuery

Limit the number of records to be returned by this query.

func (*InvoiceQuery) Modify

func (iq *InvoiceQuery) Modify(modifiers ...func(s *sql.Selector)) *InvoiceSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*InvoiceQuery) Offset

func (iq *InvoiceQuery) Offset(offset int) *InvoiceQuery

Offset to start from.

func (*InvoiceQuery) Only

func (iq *InvoiceQuery) Only(ctx context.Context) (*Invoice, error)

Only returns a single Invoice entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Invoice entity is found. Returns a *NotFoundError when no Invoice entities are found.

func (*InvoiceQuery) OnlyID

func (iq *InvoiceQuery) OnlyID(ctx context.Context) (id int64, err error)

OnlyID is like Only, but returns the only Invoice ID in the query. Returns a *NotSingularError when more than one Invoice ID is found. Returns a *NotFoundError when no entities are found.

func (*InvoiceQuery) OnlyIDX

func (iq *InvoiceQuery) OnlyIDX(ctx context.Context) int64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*InvoiceQuery) OnlyX

func (iq *InvoiceQuery) OnlyX(ctx context.Context) *Invoice

OnlyX is like Only, but panics if an error occurs.

func (*InvoiceQuery) Order

func (iq *InvoiceQuery) Order(o ...invoice.OrderOption) *InvoiceQuery

Order specifies how the records should be ordered.

func (*InvoiceQuery) QueryPaymentProfile

func (iq *InvoiceQuery) QueryPaymentProfile() *PaymentProfileQuery

QueryPaymentProfile chains the current query on the "payment_profile" edge.

func (*InvoiceQuery) QueryProduct

func (iq *InvoiceQuery) QueryProduct() *ProductQuery

QueryProduct chains the current query on the "product" edge.

func (*InvoiceQuery) QueryReservations

func (iq *InvoiceQuery) QueryReservations() *ProductReservationQuery

QueryReservations chains the current query on the "reservations" edge.

func (*InvoiceQuery) QuerySubscriptions

func (iq *InvoiceQuery) QuerySubscriptions() *SubscriptionsQuery

QuerySubscriptions chains the current query on the "subscriptions" edge.

func (*InvoiceQuery) Select

func (iq *InvoiceQuery) Select(fields ...string) *InvoiceSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	UserID int64 `json:"user_id,omitempty"`
}

client.Invoice.Query().
	Select(invoice.FieldUserID).
	Scan(ctx, &v)

func (*InvoiceQuery) Unique

func (iq *InvoiceQuery) Unique(unique bool) *InvoiceQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*InvoiceQuery) Where

func (iq *InvoiceQuery) Where(ps ...predicate.Invoice) *InvoiceQuery

Where adds a new predicate for the InvoiceQuery builder.

func (*InvoiceQuery) WithPaymentProfile

func (iq *InvoiceQuery) WithPaymentProfile(opts ...func(*PaymentProfileQuery)) *InvoiceQuery

WithPaymentProfile tells the query-builder to eager-load the nodes that are connected to the "payment_profile" edge. The optional arguments are used to configure the query builder of the edge.

func (*InvoiceQuery) WithProduct

func (iq *InvoiceQuery) WithProduct(opts ...func(*ProductQuery)) *InvoiceQuery

WithProduct tells the query-builder to eager-load the nodes that are connected to the "product" edge. The optional arguments are used to configure the query builder of the edge.

func (*InvoiceQuery) WithReservations

func (iq *InvoiceQuery) WithReservations(opts ...func(*ProductReservationQuery)) *InvoiceQuery

WithReservations tells the query-builder to eager-load the nodes that are connected to the "reservations" edge. The optional arguments are used to configure the query builder of the edge.

func (*InvoiceQuery) WithSubscriptions

func (iq *InvoiceQuery) WithSubscriptions(opts ...func(*SubscriptionsQuery)) *InvoiceQuery

WithSubscriptions tells the query-builder to eager-load the nodes that are connected to the "subscriptions" edge. The optional arguments are used to configure the query builder of the edge.

type InvoiceSelect

type InvoiceSelect struct {
	*InvoiceQuery
	// contains filtered or unexported fields
}

InvoiceSelect is the builder for selecting fields of Invoice entities.

func (*InvoiceSelect) Aggregate

func (is *InvoiceSelect) Aggregate(fns ...AggregateFunc) *InvoiceSelect

Aggregate adds the given aggregation functions to the selector query.

func (*InvoiceSelect) Bool

func (s *InvoiceSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*InvoiceSelect) BoolX

func (s *InvoiceSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*InvoiceSelect) Bools

func (s *InvoiceSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*InvoiceSelect) BoolsX

func (s *InvoiceSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*InvoiceSelect) Float64

func (s *InvoiceSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*InvoiceSelect) Float64X

func (s *InvoiceSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*InvoiceSelect) Float64s

func (s *InvoiceSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*InvoiceSelect) Float64sX

func (s *InvoiceSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*InvoiceSelect) Int

func (s *InvoiceSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*InvoiceSelect) IntX

func (s *InvoiceSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*InvoiceSelect) Ints

func (s *InvoiceSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*InvoiceSelect) IntsX

func (s *InvoiceSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*InvoiceSelect) Modify

func (is *InvoiceSelect) Modify(modifiers ...func(s *sql.Selector)) *InvoiceSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*InvoiceSelect) Scan

func (is *InvoiceSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*InvoiceSelect) ScanX

func (s *InvoiceSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*InvoiceSelect) String

func (s *InvoiceSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*InvoiceSelect) StringX

func (s *InvoiceSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*InvoiceSelect) Strings

func (s *InvoiceSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*InvoiceSelect) StringsX

func (s *InvoiceSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type InvoiceUpdate

type InvoiceUpdate struct {
	// contains filtered or unexported fields
}

InvoiceUpdate is the builder for updating Invoice entities.

func (*InvoiceUpdate) AddPrice

func (iu *InvoiceUpdate) AddPrice(d decimal.Decimal) *InvoiceUpdate

AddPrice adds d to the "price" field.

func (*InvoiceUpdate) AddReservationIDs

func (iu *InvoiceUpdate) AddReservationIDs(ids ...int64) *InvoiceUpdate

AddReservationIDs adds the "reservations" edge to the ProductReservation entity by IDs.

func (*InvoiceUpdate) AddReservations

func (iu *InvoiceUpdate) AddReservations(p ...*ProductReservation) *InvoiceUpdate

AddReservations adds the "reservations" edges to the ProductReservation entity.

func (*InvoiceUpdate) ClearExternalTransactionID

func (iu *InvoiceUpdate) ClearExternalTransactionID() *InvoiceUpdate

ClearExternalTransactionID clears the value of the "external_transaction_id" field.

func (*InvoiceUpdate) ClearPaidAt

func (iu *InvoiceUpdate) ClearPaidAt() *InvoiceUpdate

ClearPaidAt clears the value of the "paid_at" field.

func (*InvoiceUpdate) ClearPaidTill

func (iu *InvoiceUpdate) ClearPaidTill() *InvoiceUpdate

ClearPaidTill clears the value of the "paid_till" field.

func (*InvoiceUpdate) ClearPaymentProfile

func (iu *InvoiceUpdate) ClearPaymentProfile() *InvoiceUpdate

ClearPaymentProfile clears the "payment_profile" edge to the PaymentProfile entity.

func (*InvoiceUpdate) ClearPaymentProfileID

func (iu *InvoiceUpdate) ClearPaymentProfileID() *InvoiceUpdate

ClearPaymentProfileID clears the value of the "payment_profile_id" field.

func (*InvoiceUpdate) ClearReservations

func (iu *InvoiceUpdate) ClearReservations() *InvoiceUpdate

ClearReservations clears all "reservations" edges to the ProductReservation entity.

func (*InvoiceUpdate) ClearRevokedAt

func (iu *InvoiceUpdate) ClearRevokedAt() *InvoiceUpdate

ClearRevokedAt clears the value of the "revoked_at" field.

func (*InvoiceUpdate) ClearSubscriptionID

func (iu *InvoiceUpdate) ClearSubscriptionID() *InvoiceUpdate

ClearSubscriptionID clears the value of the "subscription_id" field.

func (*InvoiceUpdate) ClearSubscriptions

func (iu *InvoiceUpdate) ClearSubscriptions() *InvoiceUpdate

ClearSubscriptions clears the "subscriptions" edge to the Subscriptions entity.

func (*InvoiceUpdate) ClearTtpSubscriptionID

func (iu *InvoiceUpdate) ClearTtpSubscriptionID() *InvoiceUpdate

ClearTtpSubscriptionID clears the value of the "ttp_subscription_id" field.

func (*InvoiceUpdate) Exec

func (iu *InvoiceUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*InvoiceUpdate) ExecX

func (iu *InvoiceUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*InvoiceUpdate) Modify

func (iu *InvoiceUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *InvoiceUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*InvoiceUpdate) Mutation

func (iu *InvoiceUpdate) Mutation() *InvoiceMutation

Mutation returns the InvoiceMutation object of the builder.

func (*InvoiceUpdate) RemoveReservationIDs

func (iu *InvoiceUpdate) RemoveReservationIDs(ids ...int64) *InvoiceUpdate

RemoveReservationIDs removes the "reservations" edge to ProductReservation entities by IDs.

func (*InvoiceUpdate) RemoveReservations

func (iu *InvoiceUpdate) RemoveReservations(p ...*ProductReservation) *InvoiceUpdate

RemoveReservations removes "reservations" edges to ProductReservation entities.

func (*InvoiceUpdate) Save

func (iu *InvoiceUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*InvoiceUpdate) SaveX

func (iu *InvoiceUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*InvoiceUpdate) SetCurrency

func (iu *InvoiceUpdate) SetCurrency(s string) *InvoiceUpdate

SetCurrency sets the "currency" field.

func (*InvoiceUpdate) SetExternalTransactionID

func (iu *InvoiceUpdate) SetExternalTransactionID(s string) *InvoiceUpdate

SetExternalTransactionID sets the "external_transaction_id" field.

func (*InvoiceUpdate) SetIsPaidAtProcessed

func (iu *InvoiceUpdate) SetIsPaidAtProcessed(b bool) *InvoiceUpdate

SetIsPaidAtProcessed sets the "is_paid_at_processed" field.

func (*InvoiceUpdate) SetIsPaidTillProcessed

func (iu *InvoiceUpdate) SetIsPaidTillProcessed(b bool) *InvoiceUpdate

SetIsPaidTillProcessed sets the "is_paid_till_processed" field.

func (*InvoiceUpdate) SetIsRevoked

func (iu *InvoiceUpdate) SetIsRevoked(b bool) *InvoiceUpdate

SetIsRevoked sets the "is_revoked" field.

func (*InvoiceUpdate) SetIsRevokedProcessed

func (iu *InvoiceUpdate) SetIsRevokedProcessed(b bool) *InvoiceUpdate

SetIsRevokedProcessed sets the "is_revoked_processed" field.

func (*InvoiceUpdate) SetIsTrial

func (iu *InvoiceUpdate) SetIsTrial(b bool) *InvoiceUpdate

SetIsTrial sets the "is_trial" field.

func (*InvoiceUpdate) SetNillableCurrency

func (iu *InvoiceUpdate) SetNillableCurrency(s *string) *InvoiceUpdate

SetNillableCurrency sets the "currency" field if the given value is not nil.

func (*InvoiceUpdate) SetNillableExternalTransactionID

func (iu *InvoiceUpdate) SetNillableExternalTransactionID(s *string) *InvoiceUpdate

SetNillableExternalTransactionID sets the "external_transaction_id" field if the given value is not nil.

func (*InvoiceUpdate) SetNillableIsPaidAtProcessed

func (iu *InvoiceUpdate) SetNillableIsPaidAtProcessed(b *bool) *InvoiceUpdate

SetNillableIsPaidAtProcessed sets the "is_paid_at_processed" field if the given value is not nil.

func (*InvoiceUpdate) SetNillableIsPaidTillProcessed

func (iu *InvoiceUpdate) SetNillableIsPaidTillProcessed(b *bool) *InvoiceUpdate

SetNillableIsPaidTillProcessed sets the "is_paid_till_processed" field if the given value is not nil.

func (*InvoiceUpdate) SetNillableIsRevoked

func (iu *InvoiceUpdate) SetNillableIsRevoked(b *bool) *InvoiceUpdate

SetNillableIsRevoked sets the "is_revoked" field if the given value is not nil.

func (*InvoiceUpdate) SetNillableIsRevokedProcessed

func (iu *InvoiceUpdate) SetNillableIsRevokedProcessed(b *bool) *InvoiceUpdate

SetNillableIsRevokedProcessed sets the "is_revoked_processed" field if the given value is not nil.

func (*InvoiceUpdate) SetNillableIsTrial

func (iu *InvoiceUpdate) SetNillableIsTrial(b *bool) *InvoiceUpdate

SetNillableIsTrial sets the "is_trial" field if the given value is not nil.

func (*InvoiceUpdate) SetNillablePaidAt

func (iu *InvoiceUpdate) SetNillablePaidAt(t *time.Time) *InvoiceUpdate

SetNillablePaidAt sets the "paid_at" field if the given value is not nil.

func (*InvoiceUpdate) SetNillablePaidTill

func (iu *InvoiceUpdate) SetNillablePaidTill(t *time.Time) *InvoiceUpdate

SetNillablePaidTill sets the "paid_till" field if the given value is not nil.

func (*InvoiceUpdate) SetNillablePaymentProfileID

func (iu *InvoiceUpdate) SetNillablePaymentProfileID(i *int64) *InvoiceUpdate

SetNillablePaymentProfileID sets the "payment_profile_id" field if the given value is not nil.

func (*InvoiceUpdate) SetNillablePaymentProvider

func (iu *InvoiceUpdate) SetNillablePaymentProvider(ep *enum.PaymentProvider) *InvoiceUpdate

SetNillablePaymentProvider sets the "payment_provider" field if the given value is not nil.

func (*InvoiceUpdate) SetNillablePrice

func (iu *InvoiceUpdate) SetNillablePrice(d *decimal.Decimal) *InvoiceUpdate

SetNillablePrice sets the "price" field if the given value is not nil.

func (*InvoiceUpdate) SetNillableRevokedAt

func (iu *InvoiceUpdate) SetNillableRevokedAt(t *time.Time) *InvoiceUpdate

SetNillableRevokedAt sets the "revoked_at" field if the given value is not nil.

func (*InvoiceUpdate) SetNillableStatus

func (iu *InvoiceUpdate) SetNillableStatus(es *enum.InvoiceStatus) *InvoiceUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*InvoiceUpdate) SetNillableSubscriptionID

func (iu *InvoiceUpdate) SetNillableSubscriptionID(i *int64) *InvoiceUpdate

SetNillableSubscriptionID sets the "subscription_id" field if the given value is not nil.

func (*InvoiceUpdate) SetNillableSubscriptionsID

func (iu *InvoiceUpdate) SetNillableSubscriptionsID(id *int64) *InvoiceUpdate

SetNillableSubscriptionsID sets the "subscriptions" edge to the Subscriptions entity by ID if the given value is not nil.

func (*InvoiceUpdate) SetNillableTtpSubscriptionID

func (iu *InvoiceUpdate) SetNillableTtpSubscriptionID(s *string) *InvoiceUpdate

SetNillableTtpSubscriptionID sets the "ttp_subscription_id" field if the given value is not nil.

func (*InvoiceUpdate) SetPaidAt

func (iu *InvoiceUpdate) SetPaidAt(t time.Time) *InvoiceUpdate

SetPaidAt sets the "paid_at" field.

func (*InvoiceUpdate) SetPaidTill

func (iu *InvoiceUpdate) SetPaidTill(t time.Time) *InvoiceUpdate

SetPaidTill sets the "paid_till" field.

func (*InvoiceUpdate) SetPaymentProfile

func (iu *InvoiceUpdate) SetPaymentProfile(p *PaymentProfile) *InvoiceUpdate

SetPaymentProfile sets the "payment_profile" edge to the PaymentProfile entity.

func (*InvoiceUpdate) SetPaymentProfileID

func (iu *InvoiceUpdate) SetPaymentProfileID(i int64) *InvoiceUpdate

SetPaymentProfileID sets the "payment_profile_id" field.

func (*InvoiceUpdate) SetPaymentProvider

func (iu *InvoiceUpdate) SetPaymentProvider(ep enum.PaymentProvider) *InvoiceUpdate

SetPaymentProvider sets the "payment_provider" field.

func (*InvoiceUpdate) SetPrice

func (iu *InvoiceUpdate) SetPrice(d decimal.Decimal) *InvoiceUpdate

SetPrice sets the "price" field.

func (*InvoiceUpdate) SetRevokedAt

func (iu *InvoiceUpdate) SetRevokedAt(t time.Time) *InvoiceUpdate

SetRevokedAt sets the "revoked_at" field.

func (*InvoiceUpdate) SetStatus

func (iu *InvoiceUpdate) SetStatus(es enum.InvoiceStatus) *InvoiceUpdate

SetStatus sets the "status" field.

func (*InvoiceUpdate) SetSubscriptionID

func (iu *InvoiceUpdate) SetSubscriptionID(i int64) *InvoiceUpdate

SetSubscriptionID sets the "subscription_id" field.

func (*InvoiceUpdate) SetSubscriptions

func (iu *InvoiceUpdate) SetSubscriptions(s *Subscriptions) *InvoiceUpdate

SetSubscriptions sets the "subscriptions" edge to the Subscriptions entity.

func (*InvoiceUpdate) SetSubscriptionsID

func (iu *InvoiceUpdate) SetSubscriptionsID(id int64) *InvoiceUpdate

SetSubscriptionsID sets the "subscriptions" edge to the Subscriptions entity by ID.

func (*InvoiceUpdate) SetTtpSubscriptionID

func (iu *InvoiceUpdate) SetTtpSubscriptionID(s string) *InvoiceUpdate

SetTtpSubscriptionID sets the "ttp_subscription_id" field.

func (*InvoiceUpdate) Where

func (iu *InvoiceUpdate) Where(ps ...predicate.Invoice) *InvoiceUpdate

Where appends a list predicates to the InvoiceUpdate builder.

type InvoiceUpdateOne

type InvoiceUpdateOne struct {
	// contains filtered or unexported fields
}

InvoiceUpdateOne is the builder for updating a single Invoice entity.

func (*InvoiceUpdateOne) AddPrice

AddPrice adds d to the "price" field.

func (*InvoiceUpdateOne) AddReservationIDs

func (iuo *InvoiceUpdateOne) AddReservationIDs(ids ...int64) *InvoiceUpdateOne

AddReservationIDs adds the "reservations" edge to the ProductReservation entity by IDs.

func (*InvoiceUpdateOne) AddReservations

func (iuo *InvoiceUpdateOne) AddReservations(p ...*ProductReservation) *InvoiceUpdateOne

AddReservations adds the "reservations" edges to the ProductReservation entity.

func (*InvoiceUpdateOne) ClearExternalTransactionID

func (iuo *InvoiceUpdateOne) ClearExternalTransactionID() *InvoiceUpdateOne

ClearExternalTransactionID clears the value of the "external_transaction_id" field.

func (*InvoiceUpdateOne) ClearPaidAt

func (iuo *InvoiceUpdateOne) ClearPaidAt() *InvoiceUpdateOne

ClearPaidAt clears the value of the "paid_at" field.

func (*InvoiceUpdateOne) ClearPaidTill

func (iuo *InvoiceUpdateOne) ClearPaidTill() *InvoiceUpdateOne

ClearPaidTill clears the value of the "paid_till" field.

func (*InvoiceUpdateOne) ClearPaymentProfile

func (iuo *InvoiceUpdateOne) ClearPaymentProfile() *InvoiceUpdateOne

ClearPaymentProfile clears the "payment_profile" edge to the PaymentProfile entity.

func (*InvoiceUpdateOne) ClearPaymentProfileID

func (iuo *InvoiceUpdateOne) ClearPaymentProfileID() *InvoiceUpdateOne

ClearPaymentProfileID clears the value of the "payment_profile_id" field.

func (*InvoiceUpdateOne) ClearReservations

func (iuo *InvoiceUpdateOne) ClearReservations() *InvoiceUpdateOne

ClearReservations clears all "reservations" edges to the ProductReservation entity.

func (*InvoiceUpdateOne) ClearRevokedAt

func (iuo *InvoiceUpdateOne) ClearRevokedAt() *InvoiceUpdateOne

ClearRevokedAt clears the value of the "revoked_at" field.

func (*InvoiceUpdateOne) ClearSubscriptionID

func (iuo *InvoiceUpdateOne) ClearSubscriptionID() *InvoiceUpdateOne

ClearSubscriptionID clears the value of the "subscription_id" field.

func (*InvoiceUpdateOne) ClearSubscriptions

func (iuo *InvoiceUpdateOne) ClearSubscriptions() *InvoiceUpdateOne

ClearSubscriptions clears the "subscriptions" edge to the Subscriptions entity.

func (*InvoiceUpdateOne) ClearTtpSubscriptionID

func (iuo *InvoiceUpdateOne) ClearTtpSubscriptionID() *InvoiceUpdateOne

ClearTtpSubscriptionID clears the value of the "ttp_subscription_id" field.

func (*InvoiceUpdateOne) Exec

func (iuo *InvoiceUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*InvoiceUpdateOne) ExecX

func (iuo *InvoiceUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*InvoiceUpdateOne) Modify

func (iuo *InvoiceUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *InvoiceUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*InvoiceUpdateOne) Mutation

func (iuo *InvoiceUpdateOne) Mutation() *InvoiceMutation

Mutation returns the InvoiceMutation object of the builder.

func (*InvoiceUpdateOne) RemoveReservationIDs

func (iuo *InvoiceUpdateOne) RemoveReservationIDs(ids ...int64) *InvoiceUpdateOne

RemoveReservationIDs removes the "reservations" edge to ProductReservation entities by IDs.

func (*InvoiceUpdateOne) RemoveReservations

func (iuo *InvoiceUpdateOne) RemoveReservations(p ...*ProductReservation) *InvoiceUpdateOne

RemoveReservations removes "reservations" edges to ProductReservation entities.

func (*InvoiceUpdateOne) Save

func (iuo *InvoiceUpdateOne) Save(ctx context.Context) (*Invoice, error)

Save executes the query and returns the updated Invoice entity.

func (*InvoiceUpdateOne) SaveX

func (iuo *InvoiceUpdateOne) SaveX(ctx context.Context) *Invoice

SaveX is like Save, but panics if an error occurs.

func (*InvoiceUpdateOne) Select

func (iuo *InvoiceUpdateOne) Select(field string, fields ...string) *InvoiceUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*InvoiceUpdateOne) SetCurrency

func (iuo *InvoiceUpdateOne) SetCurrency(s string) *InvoiceUpdateOne

SetCurrency sets the "currency" field.

func (*InvoiceUpdateOne) SetExternalTransactionID

func (iuo *InvoiceUpdateOne) SetExternalTransactionID(s string) *InvoiceUpdateOne

SetExternalTransactionID sets the "external_transaction_id" field.

func (*InvoiceUpdateOne) SetIsPaidAtProcessed

func (iuo *InvoiceUpdateOne) SetIsPaidAtProcessed(b bool) *InvoiceUpdateOne

SetIsPaidAtProcessed sets the "is_paid_at_processed" field.

func (*InvoiceUpdateOne) SetIsPaidTillProcessed

func (iuo *InvoiceUpdateOne) SetIsPaidTillProcessed(b bool) *InvoiceUpdateOne

SetIsPaidTillProcessed sets the "is_paid_till_processed" field.

func (*InvoiceUpdateOne) SetIsRevoked

func (iuo *InvoiceUpdateOne) SetIsRevoked(b bool) *InvoiceUpdateOne

SetIsRevoked sets the "is_revoked" field.

func (*InvoiceUpdateOne) SetIsRevokedProcessed

func (iuo *InvoiceUpdateOne) SetIsRevokedProcessed(b bool) *InvoiceUpdateOne

SetIsRevokedProcessed sets the "is_revoked_processed" field.

func (*InvoiceUpdateOne) SetIsTrial

func (iuo *InvoiceUpdateOne) SetIsTrial(b bool) *InvoiceUpdateOne

SetIsTrial sets the "is_trial" field.

func (*InvoiceUpdateOne) SetNillableCurrency

func (iuo *InvoiceUpdateOne) SetNillableCurrency(s *string) *InvoiceUpdateOne

SetNillableCurrency sets the "currency" field if the given value is not nil.

func (*InvoiceUpdateOne) SetNillableExternalTransactionID

func (iuo *InvoiceUpdateOne) SetNillableExternalTransactionID(s *string) *InvoiceUpdateOne

SetNillableExternalTransactionID sets the "external_transaction_id" field if the given value is not nil.

func (*InvoiceUpdateOne) SetNillableIsPaidAtProcessed

func (iuo *InvoiceUpdateOne) SetNillableIsPaidAtProcessed(b *bool) *InvoiceUpdateOne

SetNillableIsPaidAtProcessed sets the "is_paid_at_processed" field if the given value is not nil.

func (*InvoiceUpdateOne) SetNillableIsPaidTillProcessed

func (iuo *InvoiceUpdateOne) SetNillableIsPaidTillProcessed(b *bool) *InvoiceUpdateOne

SetNillableIsPaidTillProcessed sets the "is_paid_till_processed" field if the given value is not nil.

func (*InvoiceUpdateOne) SetNillableIsRevoked

func (iuo *InvoiceUpdateOne) SetNillableIsRevoked(b *bool) *InvoiceUpdateOne

SetNillableIsRevoked sets the "is_revoked" field if the given value is not nil.

func (*InvoiceUpdateOne) SetNillableIsRevokedProcessed

func (iuo *InvoiceUpdateOne) SetNillableIsRevokedProcessed(b *bool) *InvoiceUpdateOne

SetNillableIsRevokedProcessed sets the "is_revoked_processed" field if the given value is not nil.

func (*InvoiceUpdateOne) SetNillableIsTrial

func (iuo *InvoiceUpdateOne) SetNillableIsTrial(b *bool) *InvoiceUpdateOne

SetNillableIsTrial sets the "is_trial" field if the given value is not nil.

func (*InvoiceUpdateOne) SetNillablePaidAt

func (iuo *InvoiceUpdateOne) SetNillablePaidAt(t *time.Time) *InvoiceUpdateOne

SetNillablePaidAt sets the "paid_at" field if the given value is not nil.

func (*InvoiceUpdateOne) SetNillablePaidTill

func (iuo *InvoiceUpdateOne) SetNillablePaidTill(t *time.Time) *InvoiceUpdateOne

SetNillablePaidTill sets the "paid_till" field if the given value is not nil.

func (*InvoiceUpdateOne) SetNillablePaymentProfileID

func (iuo *InvoiceUpdateOne) SetNillablePaymentProfileID(i *int64) *InvoiceUpdateOne

SetNillablePaymentProfileID sets the "payment_profile_id" field if the given value is not nil.

func (*InvoiceUpdateOne) SetNillablePaymentProvider

func (iuo *InvoiceUpdateOne) SetNillablePaymentProvider(ep *enum.PaymentProvider) *InvoiceUpdateOne

SetNillablePaymentProvider sets the "payment_provider" field if the given value is not nil.

func (*InvoiceUpdateOne) SetNillablePrice

func (iuo *InvoiceUpdateOne) SetNillablePrice(d *decimal.Decimal) *InvoiceUpdateOne

SetNillablePrice sets the "price" field if the given value is not nil.

func (*InvoiceUpdateOne) SetNillableRevokedAt

func (iuo *InvoiceUpdateOne) SetNillableRevokedAt(t *time.Time) *InvoiceUpdateOne

SetNillableRevokedAt sets the "revoked_at" field if the given value is not nil.

func (*InvoiceUpdateOne) SetNillableStatus

func (iuo *InvoiceUpdateOne) SetNillableStatus(es *enum.InvoiceStatus) *InvoiceUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*InvoiceUpdateOne) SetNillableSubscriptionID

func (iuo *InvoiceUpdateOne) SetNillableSubscriptionID(i *int64) *InvoiceUpdateOne

SetNillableSubscriptionID sets the "subscription_id" field if the given value is not nil.

func (*InvoiceUpdateOne) SetNillableSubscriptionsID

func (iuo *InvoiceUpdateOne) SetNillableSubscriptionsID(id *int64) *InvoiceUpdateOne

SetNillableSubscriptionsID sets the "subscriptions" edge to the Subscriptions entity by ID if the given value is not nil.

func (*InvoiceUpdateOne) SetNillableTtpSubscriptionID

func (iuo *InvoiceUpdateOne) SetNillableTtpSubscriptionID(s *string) *InvoiceUpdateOne

SetNillableTtpSubscriptionID sets the "ttp_subscription_id" field if the given value is not nil.

func (*InvoiceUpdateOne) SetPaidAt

func (iuo *InvoiceUpdateOne) SetPaidAt(t time.Time) *InvoiceUpdateOne

SetPaidAt sets the "paid_at" field.

func (*InvoiceUpdateOne) SetPaidTill

func (iuo *InvoiceUpdateOne) SetPaidTill(t time.Time) *InvoiceUpdateOne

SetPaidTill sets the "paid_till" field.

func (*InvoiceUpdateOne) SetPaymentProfile

func (iuo *InvoiceUpdateOne) SetPaymentProfile(p *PaymentProfile) *InvoiceUpdateOne

SetPaymentProfile sets the "payment_profile" edge to the PaymentProfile entity.

func (*InvoiceUpdateOne) SetPaymentProfileID

func (iuo *InvoiceUpdateOne) SetPaymentProfileID(i int64) *InvoiceUpdateOne

SetPaymentProfileID sets the "payment_profile_id" field.

func (*InvoiceUpdateOne) SetPaymentProvider

func (iuo *InvoiceUpdateOne) SetPaymentProvider(ep enum.PaymentProvider) *InvoiceUpdateOne

SetPaymentProvider sets the "payment_provider" field.

func (*InvoiceUpdateOne) SetPrice

SetPrice sets the "price" field.

func (*InvoiceUpdateOne) SetRevokedAt

func (iuo *InvoiceUpdateOne) SetRevokedAt(t time.Time) *InvoiceUpdateOne

SetRevokedAt sets the "revoked_at" field.

func (*InvoiceUpdateOne) SetStatus

SetStatus sets the "status" field.

func (*InvoiceUpdateOne) SetSubscriptionID

func (iuo *InvoiceUpdateOne) SetSubscriptionID(i int64) *InvoiceUpdateOne

SetSubscriptionID sets the "subscription_id" field.

func (*InvoiceUpdateOne) SetSubscriptions

func (iuo *InvoiceUpdateOne) SetSubscriptions(s *Subscriptions) *InvoiceUpdateOne

SetSubscriptions sets the "subscriptions" edge to the Subscriptions entity.

func (*InvoiceUpdateOne) SetSubscriptionsID

func (iuo *InvoiceUpdateOne) SetSubscriptionsID(id int64) *InvoiceUpdateOne

SetSubscriptionsID sets the "subscriptions" edge to the Subscriptions entity by ID.

func (*InvoiceUpdateOne) SetTtpSubscriptionID

func (iuo *InvoiceUpdateOne) SetTtpSubscriptionID(s string) *InvoiceUpdateOne

SetTtpSubscriptionID sets the "ttp_subscription_id" field.

func (*InvoiceUpdateOne) Where

Where appends a list predicates to the InvoiceUpdate builder.

type InvoiceUpsert

type InvoiceUpsert struct {
	*sql.UpdateSet
}

InvoiceUpsert is the "OnConflict" setter.

func (*InvoiceUpsert) AddPrice

func (u *InvoiceUpsert) AddPrice(v decimal.Decimal) *InvoiceUpsert

AddPrice adds v to the "price" field.

func (*InvoiceUpsert) ClearExternalTransactionID

func (u *InvoiceUpsert) ClearExternalTransactionID() *InvoiceUpsert

ClearExternalTransactionID clears the value of the "external_transaction_id" field.

func (*InvoiceUpsert) ClearPaidAt

func (u *InvoiceUpsert) ClearPaidAt() *InvoiceUpsert

ClearPaidAt clears the value of the "paid_at" field.

func (*InvoiceUpsert) ClearPaidTill

func (u *InvoiceUpsert) ClearPaidTill() *InvoiceUpsert

ClearPaidTill clears the value of the "paid_till" field.

func (*InvoiceUpsert) ClearPaymentProfileID

func (u *InvoiceUpsert) ClearPaymentProfileID() *InvoiceUpsert

ClearPaymentProfileID clears the value of the "payment_profile_id" field.

func (*InvoiceUpsert) ClearRevokedAt

func (u *InvoiceUpsert) ClearRevokedAt() *InvoiceUpsert

ClearRevokedAt clears the value of the "revoked_at" field.

func (*InvoiceUpsert) ClearSubscriptionID

func (u *InvoiceUpsert) ClearSubscriptionID() *InvoiceUpsert

ClearSubscriptionID clears the value of the "subscription_id" field.

func (*InvoiceUpsert) ClearTtpSubscriptionID

func (u *InvoiceUpsert) ClearTtpSubscriptionID() *InvoiceUpsert

ClearTtpSubscriptionID clears the value of the "ttp_subscription_id" field.

func (*InvoiceUpsert) SetCurrency

func (u *InvoiceUpsert) SetCurrency(v string) *InvoiceUpsert

SetCurrency sets the "currency" field.

func (*InvoiceUpsert) SetExternalTransactionID

func (u *InvoiceUpsert) SetExternalTransactionID(v string) *InvoiceUpsert

SetExternalTransactionID sets the "external_transaction_id" field.

func (*InvoiceUpsert) SetIsPaidAtProcessed

func (u *InvoiceUpsert) SetIsPaidAtProcessed(v bool) *InvoiceUpsert

SetIsPaidAtProcessed sets the "is_paid_at_processed" field.

func (*InvoiceUpsert) SetIsPaidTillProcessed

func (u *InvoiceUpsert) SetIsPaidTillProcessed(v bool) *InvoiceUpsert

SetIsPaidTillProcessed sets the "is_paid_till_processed" field.

func (*InvoiceUpsert) SetIsRevoked

func (u *InvoiceUpsert) SetIsRevoked(v bool) *InvoiceUpsert

SetIsRevoked sets the "is_revoked" field.

func (*InvoiceUpsert) SetIsRevokedProcessed

func (u *InvoiceUpsert) SetIsRevokedProcessed(v bool) *InvoiceUpsert

SetIsRevokedProcessed sets the "is_revoked_processed" field.

func (*InvoiceUpsert) SetIsTrial

func (u *InvoiceUpsert) SetIsTrial(v bool) *InvoiceUpsert

SetIsTrial sets the "is_trial" field.

func (*InvoiceUpsert) SetPaidAt

func (u *InvoiceUpsert) SetPaidAt(v time.Time) *InvoiceUpsert

SetPaidAt sets the "paid_at" field.

func (*InvoiceUpsert) SetPaidTill

func (u *InvoiceUpsert) SetPaidTill(v time.Time) *InvoiceUpsert

SetPaidTill sets the "paid_till" field.

func (*InvoiceUpsert) SetPaymentProfileID

func (u *InvoiceUpsert) SetPaymentProfileID(v int64) *InvoiceUpsert

SetPaymentProfileID sets the "payment_profile_id" field.

func (*InvoiceUpsert) SetPaymentProvider

func (u *InvoiceUpsert) SetPaymentProvider(v enum.PaymentProvider) *InvoiceUpsert

SetPaymentProvider sets the "payment_provider" field.

func (*InvoiceUpsert) SetPrice

func (u *InvoiceUpsert) SetPrice(v decimal.Decimal) *InvoiceUpsert

SetPrice sets the "price" field.

func (*InvoiceUpsert) SetRevokedAt

func (u *InvoiceUpsert) SetRevokedAt(v time.Time) *InvoiceUpsert

SetRevokedAt sets the "revoked_at" field.

func (*InvoiceUpsert) SetStatus

func (u *InvoiceUpsert) SetStatus(v enum.InvoiceStatus) *InvoiceUpsert

SetStatus sets the "status" field.

func (*InvoiceUpsert) SetSubscriptionID

func (u *InvoiceUpsert) SetSubscriptionID(v int64) *InvoiceUpsert

SetSubscriptionID sets the "subscription_id" field.

func (*InvoiceUpsert) SetTtpSubscriptionID

func (u *InvoiceUpsert) SetTtpSubscriptionID(v string) *InvoiceUpsert

SetTtpSubscriptionID sets the "ttp_subscription_id" field.

func (*InvoiceUpsert) UpdateCurrency

func (u *InvoiceUpsert) UpdateCurrency() *InvoiceUpsert

UpdateCurrency sets the "currency" field to the value that was provided on create.

func (*InvoiceUpsert) UpdateExternalTransactionID

func (u *InvoiceUpsert) UpdateExternalTransactionID() *InvoiceUpsert

UpdateExternalTransactionID sets the "external_transaction_id" field to the value that was provided on create.

func (*InvoiceUpsert) UpdateIsPaidAtProcessed

func (u *InvoiceUpsert) UpdateIsPaidAtProcessed() *InvoiceUpsert

UpdateIsPaidAtProcessed sets the "is_paid_at_processed" field to the value that was provided on create.

func (*InvoiceUpsert) UpdateIsPaidTillProcessed

func (u *InvoiceUpsert) UpdateIsPaidTillProcessed() *InvoiceUpsert

UpdateIsPaidTillProcessed sets the "is_paid_till_processed" field to the value that was provided on create.

func (*InvoiceUpsert) UpdateIsRevoked

func (u *InvoiceUpsert) UpdateIsRevoked() *InvoiceUpsert

UpdateIsRevoked sets the "is_revoked" field to the value that was provided on create.

func (*InvoiceUpsert) UpdateIsRevokedProcessed

func (u *InvoiceUpsert) UpdateIsRevokedProcessed() *InvoiceUpsert

UpdateIsRevokedProcessed sets the "is_revoked_processed" field to the value that was provided on create.

func (*InvoiceUpsert) UpdateIsTrial

func (u *InvoiceUpsert) UpdateIsTrial() *InvoiceUpsert

UpdateIsTrial sets the "is_trial" field to the value that was provided on create.

func (*InvoiceUpsert) UpdatePaidAt

func (u *InvoiceUpsert) UpdatePaidAt() *InvoiceUpsert

UpdatePaidAt sets the "paid_at" field to the value that was provided on create.

func (*InvoiceUpsert) UpdatePaidTill

func (u *InvoiceUpsert) UpdatePaidTill() *InvoiceUpsert

UpdatePaidTill sets the "paid_till" field to the value that was provided on create.

func (*InvoiceUpsert) UpdatePaymentProfileID

func (u *InvoiceUpsert) UpdatePaymentProfileID() *InvoiceUpsert

UpdatePaymentProfileID sets the "payment_profile_id" field to the value that was provided on create.

func (*InvoiceUpsert) UpdatePaymentProvider

func (u *InvoiceUpsert) UpdatePaymentProvider() *InvoiceUpsert

UpdatePaymentProvider sets the "payment_provider" field to the value that was provided on create.

func (*InvoiceUpsert) UpdatePrice

func (u *InvoiceUpsert) UpdatePrice() *InvoiceUpsert

UpdatePrice sets the "price" field to the value that was provided on create.

func (*InvoiceUpsert) UpdateRevokedAt

func (u *InvoiceUpsert) UpdateRevokedAt() *InvoiceUpsert

UpdateRevokedAt sets the "revoked_at" field to the value that was provided on create.

func (*InvoiceUpsert) UpdateStatus

func (u *InvoiceUpsert) UpdateStatus() *InvoiceUpsert

UpdateStatus sets the "status" field to the value that was provided on create.

func (*InvoiceUpsert) UpdateSubscriptionID

func (u *InvoiceUpsert) UpdateSubscriptionID() *InvoiceUpsert

UpdateSubscriptionID sets the "subscription_id" field to the value that was provided on create.

func (*InvoiceUpsert) UpdateTtpSubscriptionID

func (u *InvoiceUpsert) UpdateTtpSubscriptionID() *InvoiceUpsert

UpdateTtpSubscriptionID sets the "ttp_subscription_id" field to the value that was provided on create.

type InvoiceUpsertBulk

type InvoiceUpsertBulk struct {
	// contains filtered or unexported fields
}

InvoiceUpsertBulk is the builder for "upsert"-ing a bulk of Invoice nodes.

func (*InvoiceUpsertBulk) AddPrice

AddPrice adds v to the "price" field.

func (*InvoiceUpsertBulk) ClearExternalTransactionID

func (u *InvoiceUpsertBulk) ClearExternalTransactionID() *InvoiceUpsertBulk

ClearExternalTransactionID clears the value of the "external_transaction_id" field.

func (*InvoiceUpsertBulk) ClearPaidAt

func (u *InvoiceUpsertBulk) ClearPaidAt() *InvoiceUpsertBulk

ClearPaidAt clears the value of the "paid_at" field.

func (*InvoiceUpsertBulk) ClearPaidTill

func (u *InvoiceUpsertBulk) ClearPaidTill() *InvoiceUpsertBulk

ClearPaidTill clears the value of the "paid_till" field.

func (*InvoiceUpsertBulk) ClearPaymentProfileID

func (u *InvoiceUpsertBulk) ClearPaymentProfileID() *InvoiceUpsertBulk

ClearPaymentProfileID clears the value of the "payment_profile_id" field.

func (*InvoiceUpsertBulk) ClearRevokedAt

func (u *InvoiceUpsertBulk) ClearRevokedAt() *InvoiceUpsertBulk

ClearRevokedAt clears the value of the "revoked_at" field.

func (*InvoiceUpsertBulk) ClearSubscriptionID

func (u *InvoiceUpsertBulk) ClearSubscriptionID() *InvoiceUpsertBulk

ClearSubscriptionID clears the value of the "subscription_id" field.

func (*InvoiceUpsertBulk) ClearTtpSubscriptionID

func (u *InvoiceUpsertBulk) ClearTtpSubscriptionID() *InvoiceUpsertBulk

ClearTtpSubscriptionID clears the value of the "ttp_subscription_id" field.

func (*InvoiceUpsertBulk) DoNothing

func (u *InvoiceUpsertBulk) DoNothing() *InvoiceUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*InvoiceUpsertBulk) Exec

func (u *InvoiceUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*InvoiceUpsertBulk) ExecX

func (u *InvoiceUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*InvoiceUpsertBulk) Ignore

func (u *InvoiceUpsertBulk) Ignore() *InvoiceUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Invoice.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*InvoiceUpsertBulk) SetCurrency

func (u *InvoiceUpsertBulk) SetCurrency(v string) *InvoiceUpsertBulk

SetCurrency sets the "currency" field.

func (*InvoiceUpsertBulk) SetExternalTransactionID

func (u *InvoiceUpsertBulk) SetExternalTransactionID(v string) *InvoiceUpsertBulk

SetExternalTransactionID sets the "external_transaction_id" field.

func (*InvoiceUpsertBulk) SetIsPaidAtProcessed

func (u *InvoiceUpsertBulk) SetIsPaidAtProcessed(v bool) *InvoiceUpsertBulk

SetIsPaidAtProcessed sets the "is_paid_at_processed" field.

func (*InvoiceUpsertBulk) SetIsPaidTillProcessed

func (u *InvoiceUpsertBulk) SetIsPaidTillProcessed(v bool) *InvoiceUpsertBulk

SetIsPaidTillProcessed sets the "is_paid_till_processed" field.

func (*InvoiceUpsertBulk) SetIsRevoked

func (u *InvoiceUpsertBulk) SetIsRevoked(v bool) *InvoiceUpsertBulk

SetIsRevoked sets the "is_revoked" field.

func (*InvoiceUpsertBulk) SetIsRevokedProcessed

func (u *InvoiceUpsertBulk) SetIsRevokedProcessed(v bool) *InvoiceUpsertBulk

SetIsRevokedProcessed sets the "is_revoked_processed" field.

func (*InvoiceUpsertBulk) SetIsTrial

func (u *InvoiceUpsertBulk) SetIsTrial(v bool) *InvoiceUpsertBulk

SetIsTrial sets the "is_trial" field.

func (*InvoiceUpsertBulk) SetPaidAt

func (u *InvoiceUpsertBulk) SetPaidAt(v time.Time) *InvoiceUpsertBulk

SetPaidAt sets the "paid_at" field.

func (*InvoiceUpsertBulk) SetPaidTill

func (u *InvoiceUpsertBulk) SetPaidTill(v time.Time) *InvoiceUpsertBulk

SetPaidTill sets the "paid_till" field.

func (*InvoiceUpsertBulk) SetPaymentProfileID

func (u *InvoiceUpsertBulk) SetPaymentProfileID(v int64) *InvoiceUpsertBulk

SetPaymentProfileID sets the "payment_profile_id" field.

func (*InvoiceUpsertBulk) SetPaymentProvider

func (u *InvoiceUpsertBulk) SetPaymentProvider(v enum.PaymentProvider) *InvoiceUpsertBulk

SetPaymentProvider sets the "payment_provider" field.

func (*InvoiceUpsertBulk) SetPrice

SetPrice sets the "price" field.

func (*InvoiceUpsertBulk) SetRevokedAt

func (u *InvoiceUpsertBulk) SetRevokedAt(v time.Time) *InvoiceUpsertBulk

SetRevokedAt sets the "revoked_at" field.

func (*InvoiceUpsertBulk) SetStatus

SetStatus sets the "status" field.

func (*InvoiceUpsertBulk) SetSubscriptionID

func (u *InvoiceUpsertBulk) SetSubscriptionID(v int64) *InvoiceUpsertBulk

SetSubscriptionID sets the "subscription_id" field.

func (*InvoiceUpsertBulk) SetTtpSubscriptionID

func (u *InvoiceUpsertBulk) SetTtpSubscriptionID(v string) *InvoiceUpsertBulk

SetTtpSubscriptionID sets the "ttp_subscription_id" field.

func (*InvoiceUpsertBulk) Update

func (u *InvoiceUpsertBulk) Update(set func(*InvoiceUpsert)) *InvoiceUpsertBulk

Update allows overriding fields `UPDATE` values. See the InvoiceCreateBulk.OnConflict documentation for more info.

func (*InvoiceUpsertBulk) UpdateCurrency

func (u *InvoiceUpsertBulk) UpdateCurrency() *InvoiceUpsertBulk

UpdateCurrency sets the "currency" field to the value that was provided on create.

func (*InvoiceUpsertBulk) UpdateExternalTransactionID

func (u *InvoiceUpsertBulk) UpdateExternalTransactionID() *InvoiceUpsertBulk

UpdateExternalTransactionID sets the "external_transaction_id" field to the value that was provided on create.

func (*InvoiceUpsertBulk) UpdateIsPaidAtProcessed

func (u *InvoiceUpsertBulk) UpdateIsPaidAtProcessed() *InvoiceUpsertBulk

UpdateIsPaidAtProcessed sets the "is_paid_at_processed" field to the value that was provided on create.

func (*InvoiceUpsertBulk) UpdateIsPaidTillProcessed

func (u *InvoiceUpsertBulk) UpdateIsPaidTillProcessed() *InvoiceUpsertBulk

UpdateIsPaidTillProcessed sets the "is_paid_till_processed" field to the value that was provided on create.

func (*InvoiceUpsertBulk) UpdateIsRevoked

func (u *InvoiceUpsertBulk) UpdateIsRevoked() *InvoiceUpsertBulk

UpdateIsRevoked sets the "is_revoked" field to the value that was provided on create.

func (*InvoiceUpsertBulk) UpdateIsRevokedProcessed

func (u *InvoiceUpsertBulk) UpdateIsRevokedProcessed() *InvoiceUpsertBulk

UpdateIsRevokedProcessed sets the "is_revoked_processed" field to the value that was provided on create.

func (*InvoiceUpsertBulk) UpdateIsTrial

func (u *InvoiceUpsertBulk) UpdateIsTrial() *InvoiceUpsertBulk

UpdateIsTrial sets the "is_trial" field to the value that was provided on create.

func (*InvoiceUpsertBulk) UpdateNewValues

func (u *InvoiceUpsertBulk) UpdateNewValues() *InvoiceUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Invoice.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(invoice.FieldID)
		}),
	).
	Exec(ctx)

func (*InvoiceUpsertBulk) UpdatePaidAt

func (u *InvoiceUpsertBulk) UpdatePaidAt() *InvoiceUpsertBulk

UpdatePaidAt sets the "paid_at" field to the value that was provided on create.

func (*InvoiceUpsertBulk) UpdatePaidTill

func (u *InvoiceUpsertBulk) UpdatePaidTill() *InvoiceUpsertBulk

UpdatePaidTill sets the "paid_till" field to the value that was provided on create.

func (*InvoiceUpsertBulk) UpdatePaymentProfileID

func (u *InvoiceUpsertBulk) UpdatePaymentProfileID() *InvoiceUpsertBulk

UpdatePaymentProfileID sets the "payment_profile_id" field to the value that was provided on create.

func (*InvoiceUpsertBulk) UpdatePaymentProvider

func (u *InvoiceUpsertBulk) UpdatePaymentProvider() *InvoiceUpsertBulk

UpdatePaymentProvider sets the "payment_provider" field to the value that was provided on create.

func (*InvoiceUpsertBulk) UpdatePrice

func (u *InvoiceUpsertBulk) UpdatePrice() *InvoiceUpsertBulk

UpdatePrice sets the "price" field to the value that was provided on create.

func (*InvoiceUpsertBulk) UpdateRevokedAt

func (u *InvoiceUpsertBulk) UpdateRevokedAt() *InvoiceUpsertBulk

UpdateRevokedAt sets the "revoked_at" field to the value that was provided on create.

func (*InvoiceUpsertBulk) UpdateStatus

func (u *InvoiceUpsertBulk) UpdateStatus() *InvoiceUpsertBulk

UpdateStatus sets the "status" field to the value that was provided on create.

func (*InvoiceUpsertBulk) UpdateSubscriptionID

func (u *InvoiceUpsertBulk) UpdateSubscriptionID() *InvoiceUpsertBulk

UpdateSubscriptionID sets the "subscription_id" field to the value that was provided on create.

func (*InvoiceUpsertBulk) UpdateTtpSubscriptionID

func (u *InvoiceUpsertBulk) UpdateTtpSubscriptionID() *InvoiceUpsertBulk

UpdateTtpSubscriptionID sets the "ttp_subscription_id" field to the value that was provided on create.

type InvoiceUpsertOne

type InvoiceUpsertOne struct {
	// contains filtered or unexported fields
}

InvoiceUpsertOne is the builder for "upsert"-ing

one Invoice node.

func (*InvoiceUpsertOne) AddPrice

AddPrice adds v to the "price" field.

func (*InvoiceUpsertOne) ClearExternalTransactionID

func (u *InvoiceUpsertOne) ClearExternalTransactionID() *InvoiceUpsertOne

ClearExternalTransactionID clears the value of the "external_transaction_id" field.

func (*InvoiceUpsertOne) ClearPaidAt

func (u *InvoiceUpsertOne) ClearPaidAt() *InvoiceUpsertOne

ClearPaidAt clears the value of the "paid_at" field.

func (*InvoiceUpsertOne) ClearPaidTill

func (u *InvoiceUpsertOne) ClearPaidTill() *InvoiceUpsertOne

ClearPaidTill clears the value of the "paid_till" field.

func (*InvoiceUpsertOne) ClearPaymentProfileID

func (u *InvoiceUpsertOne) ClearPaymentProfileID() *InvoiceUpsertOne

ClearPaymentProfileID clears the value of the "payment_profile_id" field.

func (*InvoiceUpsertOne) ClearRevokedAt

func (u *InvoiceUpsertOne) ClearRevokedAt() *InvoiceUpsertOne

ClearRevokedAt clears the value of the "revoked_at" field.

func (*InvoiceUpsertOne) ClearSubscriptionID

func (u *InvoiceUpsertOne) ClearSubscriptionID() *InvoiceUpsertOne

ClearSubscriptionID clears the value of the "subscription_id" field.

func (*InvoiceUpsertOne) ClearTtpSubscriptionID

func (u *InvoiceUpsertOne) ClearTtpSubscriptionID() *InvoiceUpsertOne

ClearTtpSubscriptionID clears the value of the "ttp_subscription_id" field.

func (*InvoiceUpsertOne) DoNothing

func (u *InvoiceUpsertOne) DoNothing() *InvoiceUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*InvoiceUpsertOne) Exec

func (u *InvoiceUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*InvoiceUpsertOne) ExecX

func (u *InvoiceUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*InvoiceUpsertOne) ID

func (u *InvoiceUpsertOne) ID(ctx context.Context) (id int64, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*InvoiceUpsertOne) IDX

func (u *InvoiceUpsertOne) IDX(ctx context.Context) int64

IDX is like ID, but panics if an error occurs.

func (*InvoiceUpsertOne) Ignore

func (u *InvoiceUpsertOne) Ignore() *InvoiceUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Invoice.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*InvoiceUpsertOne) SetCurrency

func (u *InvoiceUpsertOne) SetCurrency(v string) *InvoiceUpsertOne

SetCurrency sets the "currency" field.

func (*InvoiceUpsertOne) SetExternalTransactionID

func (u *InvoiceUpsertOne) SetExternalTransactionID(v string) *InvoiceUpsertOne

SetExternalTransactionID sets the "external_transaction_id" field.

func (*InvoiceUpsertOne) SetIsPaidAtProcessed

func (u *InvoiceUpsertOne) SetIsPaidAtProcessed(v bool) *InvoiceUpsertOne

SetIsPaidAtProcessed sets the "is_paid_at_processed" field.

func (*InvoiceUpsertOne) SetIsPaidTillProcessed

func (u *InvoiceUpsertOne) SetIsPaidTillProcessed(v bool) *InvoiceUpsertOne

SetIsPaidTillProcessed sets the "is_paid_till_processed" field.

func (*InvoiceUpsertOne) SetIsRevoked

func (u *InvoiceUpsertOne) SetIsRevoked(v bool) *InvoiceUpsertOne

SetIsRevoked sets the "is_revoked" field.

func (*InvoiceUpsertOne) SetIsRevokedProcessed

func (u *InvoiceUpsertOne) SetIsRevokedProcessed(v bool) *InvoiceUpsertOne

SetIsRevokedProcessed sets the "is_revoked_processed" field.

func (*InvoiceUpsertOne) SetIsTrial

func (u *InvoiceUpsertOne) SetIsTrial(v bool) *InvoiceUpsertOne

SetIsTrial sets the "is_trial" field.

func (*InvoiceUpsertOne) SetPaidAt

func (u *InvoiceUpsertOne) SetPaidAt(v time.Time) *InvoiceUpsertOne

SetPaidAt sets the "paid_at" field.

func (*InvoiceUpsertOne) SetPaidTill

func (u *InvoiceUpsertOne) SetPaidTill(v time.Time) *InvoiceUpsertOne

SetPaidTill sets the "paid_till" field.

func (*InvoiceUpsertOne) SetPaymentProfileID

func (u *InvoiceUpsertOne) SetPaymentProfileID(v int64) *InvoiceUpsertOne

SetPaymentProfileID sets the "payment_profile_id" field.

func (*InvoiceUpsertOne) SetPaymentProvider

func (u *InvoiceUpsertOne) SetPaymentProvider(v enum.PaymentProvider) *InvoiceUpsertOne

SetPaymentProvider sets the "payment_provider" field.

func (*InvoiceUpsertOne) SetPrice

SetPrice sets the "price" field.

func (*InvoiceUpsertOne) SetRevokedAt

func (u *InvoiceUpsertOne) SetRevokedAt(v time.Time) *InvoiceUpsertOne

SetRevokedAt sets the "revoked_at" field.

func (*InvoiceUpsertOne) SetStatus

SetStatus sets the "status" field.

func (*InvoiceUpsertOne) SetSubscriptionID

func (u *InvoiceUpsertOne) SetSubscriptionID(v int64) *InvoiceUpsertOne

SetSubscriptionID sets the "subscription_id" field.

func (*InvoiceUpsertOne) SetTtpSubscriptionID

func (u *InvoiceUpsertOne) SetTtpSubscriptionID(v string) *InvoiceUpsertOne

SetTtpSubscriptionID sets the "ttp_subscription_id" field.

func (*InvoiceUpsertOne) Update

func (u *InvoiceUpsertOne) Update(set func(*InvoiceUpsert)) *InvoiceUpsertOne

Update allows overriding fields `UPDATE` values. See the InvoiceCreate.OnConflict documentation for more info.

func (*InvoiceUpsertOne) UpdateCurrency

func (u *InvoiceUpsertOne) UpdateCurrency() *InvoiceUpsertOne

UpdateCurrency sets the "currency" field to the value that was provided on create.

func (*InvoiceUpsertOne) UpdateExternalTransactionID

func (u *InvoiceUpsertOne) UpdateExternalTransactionID() *InvoiceUpsertOne

UpdateExternalTransactionID sets the "external_transaction_id" field to the value that was provided on create.

func (*InvoiceUpsertOne) UpdateIsPaidAtProcessed

func (u *InvoiceUpsertOne) UpdateIsPaidAtProcessed() *InvoiceUpsertOne

UpdateIsPaidAtProcessed sets the "is_paid_at_processed" field to the value that was provided on create.

func (*InvoiceUpsertOne) UpdateIsPaidTillProcessed

func (u *InvoiceUpsertOne) UpdateIsPaidTillProcessed() *InvoiceUpsertOne

UpdateIsPaidTillProcessed sets the "is_paid_till_processed" field to the value that was provided on create.

func (*InvoiceUpsertOne) UpdateIsRevoked

func (u *InvoiceUpsertOne) UpdateIsRevoked() *InvoiceUpsertOne

UpdateIsRevoked sets the "is_revoked" field to the value that was provided on create.

func (*InvoiceUpsertOne) UpdateIsRevokedProcessed

func (u *InvoiceUpsertOne) UpdateIsRevokedProcessed() *InvoiceUpsertOne

UpdateIsRevokedProcessed sets the "is_revoked_processed" field to the value that was provided on create.

func (*InvoiceUpsertOne) UpdateIsTrial

func (u *InvoiceUpsertOne) UpdateIsTrial() *InvoiceUpsertOne

UpdateIsTrial sets the "is_trial" field to the value that was provided on create.

func (*InvoiceUpsertOne) UpdateNewValues

func (u *InvoiceUpsertOne) UpdateNewValues() *InvoiceUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Invoice.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(invoice.FieldID)
		}),
	).
	Exec(ctx)

func (*InvoiceUpsertOne) UpdatePaidAt

func (u *InvoiceUpsertOne) UpdatePaidAt() *InvoiceUpsertOne

UpdatePaidAt sets the "paid_at" field to the value that was provided on create.

func (*InvoiceUpsertOne) UpdatePaidTill

func (u *InvoiceUpsertOne) UpdatePaidTill() *InvoiceUpsertOne

UpdatePaidTill sets the "paid_till" field to the value that was provided on create.

func (*InvoiceUpsertOne) UpdatePaymentProfileID

func (u *InvoiceUpsertOne) UpdatePaymentProfileID() *InvoiceUpsertOne

UpdatePaymentProfileID sets the "payment_profile_id" field to the value that was provided on create.

func (*InvoiceUpsertOne) UpdatePaymentProvider

func (u *InvoiceUpsertOne) UpdatePaymentProvider() *InvoiceUpsertOne

UpdatePaymentProvider sets the "payment_provider" field to the value that was provided on create.

func (*InvoiceUpsertOne) UpdatePrice

func (u *InvoiceUpsertOne) UpdatePrice() *InvoiceUpsertOne

UpdatePrice sets the "price" field to the value that was provided on create.

func (*InvoiceUpsertOne) UpdateRevokedAt

func (u *InvoiceUpsertOne) UpdateRevokedAt() *InvoiceUpsertOne

UpdateRevokedAt sets the "revoked_at" field to the value that was provided on create.

func (*InvoiceUpsertOne) UpdateStatus

func (u *InvoiceUpsertOne) UpdateStatus() *InvoiceUpsertOne

UpdateStatus sets the "status" field to the value that was provided on create.

func (*InvoiceUpsertOne) UpdateSubscriptionID

func (u *InvoiceUpsertOne) UpdateSubscriptionID() *InvoiceUpsertOne

UpdateSubscriptionID sets the "subscription_id" field to the value that was provided on create.

func (*InvoiceUpsertOne) UpdateTtpSubscriptionID

func (u *InvoiceUpsertOne) UpdateTtpSubscriptionID() *InvoiceUpsertOne

UpdateTtpSubscriptionID sets the "ttp_subscription_id" field to the value that was provided on create.

type Invoices

type Invoices []*Invoice

Invoices is a parsable slice of Invoice.

type Item

type Item struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// TopicName holds the value of the "topic_name" field.
	TopicName *string `json:"topic_name,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ItemQuery when eager-loading is set.
	Edges ItemEdges `json:"edges"`
	// contains filtered or unexported fields
}

Item is the model entity for the Item schema.

func (*Item) QueryBundles

func (i *Item) QueryBundles() *BundleQuery

QueryBundles queries the "bundles" edge of the Item entity.

func (*Item) String

func (i *Item) String() string

String implements the fmt.Stringer.

func (*Item) Unwrap

func (i *Item) Unwrap() *Item

Unwrap unwraps the Item entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Item) Update

func (i *Item) Update() *ItemUpdateOne

Update returns a builder for updating this Item. Note that you need to call Item.Unwrap() before calling this method if this Item was returned from a transaction, and the transaction was committed or rolled back.

func (*Item) Value

func (i *Item) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Item. This includes values selected through modifiers, order, etc.

type ItemClient

type ItemClient struct {
	// contains filtered or unexported fields
}

ItemClient is a client for the Item schema.

func NewItemClient

func NewItemClient(c config) *ItemClient

NewItemClient returns a client for the Item from the given config.

func (*ItemClient) Create

func (c *ItemClient) Create() *ItemCreate

Create returns a builder for creating a Item entity.

func (*ItemClient) CreateBulk

func (c *ItemClient) CreateBulk(builders ...*ItemCreate) *ItemCreateBulk

CreateBulk returns a builder for creating a bulk of Item entities.

func (*ItemClient) Delete

func (c *ItemClient) Delete() *ItemDelete

Delete returns a delete builder for Item.

func (*ItemClient) DeleteOne

func (c *ItemClient) DeleteOne(i *Item) *ItemDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ItemClient) DeleteOneID

func (c *ItemClient) DeleteOneID(id int64) *ItemDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ItemClient) Get

func (c *ItemClient) Get(ctx context.Context, id int64) (*Item, error)

Get returns a Item entity by its id.

func (*ItemClient) GetX

func (c *ItemClient) GetX(ctx context.Context, id int64) *Item

GetX is like Get, but panics if an error occurs.

func (*ItemClient) Hooks

func (c *ItemClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ItemClient) Intercept

func (c *ItemClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `item.Intercept(f(g(h())))`.

func (*ItemClient) Interceptors

func (c *ItemClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ItemClient) MapCreateBulk

func (c *ItemClient) MapCreateBulk(slice any, setFunc func(*ItemCreate, int)) *ItemCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*ItemClient) Query

func (c *ItemClient) Query() *ItemQuery

Query returns a query builder for Item.

func (*ItemClient) QueryBundles

func (c *ItemClient) QueryBundles(i *Item) *BundleQuery

QueryBundles queries the bundles edge of a Item.

func (*ItemClient) Update

func (c *ItemClient) Update() *ItemUpdate

Update returns an update builder for Item.

func (*ItemClient) UpdateOne

func (c *ItemClient) UpdateOne(i *Item) *ItemUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ItemClient) UpdateOneID

func (c *ItemClient) UpdateOneID(id int64) *ItemUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ItemClient) Use

func (c *ItemClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `item.Hooks(f(g(h())))`.

type ItemCreate

type ItemCreate struct {
	// contains filtered or unexported fields
}

ItemCreate is the builder for creating a Item entity.

func (*ItemCreate) AddBundleIDs

func (ic *ItemCreate) AddBundleIDs(ids ...int64) *ItemCreate

AddBundleIDs adds the "bundles" edge to the Bundle entity by IDs.

func (*ItemCreate) AddBundles

func (ic *ItemCreate) AddBundles(b ...*Bundle) *ItemCreate

AddBundles adds the "bundles" edges to the Bundle entity.

func (*ItemCreate) Exec

func (ic *ItemCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ItemCreate) ExecX

func (ic *ItemCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ItemCreate) Mutation

func (ic *ItemCreate) Mutation() *ItemMutation

Mutation returns the ItemMutation object of the builder.

func (*ItemCreate) OnConflict

func (ic *ItemCreate) OnConflict(opts ...sql.ConflictOption) *ItemUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Item.Create().
	SetCreatedAt(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.ItemUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*ItemCreate) OnConflictColumns

func (ic *ItemCreate) OnConflictColumns(columns ...string) *ItemUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Item.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*ItemCreate) Save

func (ic *ItemCreate) Save(ctx context.Context) (*Item, error)

Save creates the Item in the database.

func (*ItemCreate) SaveX

func (ic *ItemCreate) SaveX(ctx context.Context) *Item

SaveX calls Save and panics if Save returns an error.

func (*ItemCreate) SetCreatedAt

func (ic *ItemCreate) SetCreatedAt(t time.Time) *ItemCreate

SetCreatedAt sets the "created_at" field.

func (*ItemCreate) SetDeletedAt

func (ic *ItemCreate) SetDeletedAt(t time.Time) *ItemCreate

SetDeletedAt sets the "deleted_at" field.

func (*ItemCreate) SetDescription

func (ic *ItemCreate) SetDescription(s string) *ItemCreate

SetDescription sets the "description" field.

func (*ItemCreate) SetID

func (ic *ItemCreate) SetID(i int64) *ItemCreate

SetID sets the "id" field.

func (*ItemCreate) SetName

func (ic *ItemCreate) SetName(s string) *ItemCreate

SetName sets the "name" field.

func (*ItemCreate) SetNillableCreatedAt

func (ic *ItemCreate) SetNillableCreatedAt(t *time.Time) *ItemCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ItemCreate) SetNillableDeletedAt

func (ic *ItemCreate) SetNillableDeletedAt(t *time.Time) *ItemCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*ItemCreate) SetNillableTopicName

func (ic *ItemCreate) SetNillableTopicName(s *string) *ItemCreate

SetNillableTopicName sets the "topic_name" field if the given value is not nil.

func (*ItemCreate) SetNillableUpdatedAt

func (ic *ItemCreate) SetNillableUpdatedAt(t *time.Time) *ItemCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*ItemCreate) SetTopicName

func (ic *ItemCreate) SetTopicName(s string) *ItemCreate

SetTopicName sets the "topic_name" field.

func (*ItemCreate) SetUpdatedAt

func (ic *ItemCreate) SetUpdatedAt(t time.Time) *ItemCreate

SetUpdatedAt sets the "updated_at" field.

type ItemCreateBulk

type ItemCreateBulk struct {
	// contains filtered or unexported fields
}

ItemCreateBulk is the builder for creating many Item entities in bulk.

func (*ItemCreateBulk) Exec

func (icb *ItemCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ItemCreateBulk) ExecX

func (icb *ItemCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ItemCreateBulk) OnConflict

func (icb *ItemCreateBulk) OnConflict(opts ...sql.ConflictOption) *ItemUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Item.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.ItemUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*ItemCreateBulk) OnConflictColumns

func (icb *ItemCreateBulk) OnConflictColumns(columns ...string) *ItemUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Item.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*ItemCreateBulk) Save

func (icb *ItemCreateBulk) Save(ctx context.Context) ([]*Item, error)

Save creates the Item entities in the database.

func (*ItemCreateBulk) SaveX

func (icb *ItemCreateBulk) SaveX(ctx context.Context) []*Item

SaveX is like Save, but panics if an error occurs.

type ItemDelete

type ItemDelete struct {
	// contains filtered or unexported fields
}

ItemDelete is the builder for deleting a Item entity.

func (*ItemDelete) Exec

func (id *ItemDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ItemDelete) ExecX

func (id *ItemDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ItemDelete) Where

func (id *ItemDelete) Where(ps ...predicate.Item) *ItemDelete

Where appends a list predicates to the ItemDelete builder.

type ItemDeleteOne

type ItemDeleteOne struct {
	// contains filtered or unexported fields
}

ItemDeleteOne is the builder for deleting a single Item entity.

func (*ItemDeleteOne) Exec

func (ido *ItemDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ItemDeleteOne) ExecX

func (ido *ItemDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ItemDeleteOne) Where

func (ido *ItemDeleteOne) Where(ps ...predicate.Item) *ItemDeleteOne

Where appends a list predicates to the ItemDelete builder.

type ItemEdges

type ItemEdges struct {
	// Bundles holds the value of the bundles edge.
	Bundles []*Bundle `json:"bundles,omitempty"`
	// contains filtered or unexported fields
}

ItemEdges holds the relations/edges for other nodes in the graph.

func (ItemEdges) BundlesOrErr

func (e ItemEdges) BundlesOrErr() ([]*Bundle, error)

BundlesOrErr returns the Bundles value or an error if the edge was not loaded in eager-loading.

type ItemFilter

type ItemFilter struct {
	// contains filtered or unexported fields
}

ItemFilter provides a generic filtering capability at runtime for ItemQuery.

func (*ItemFilter) Where

func (f *ItemFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*ItemFilter) WhereCreatedAt

func (f *ItemFilter) WhereCreatedAt(p entql.TimeP)

WhereCreatedAt applies the entql time.Time predicate on the created_at field.

func (*ItemFilter) WhereDeletedAt

func (f *ItemFilter) WhereDeletedAt(p entql.TimeP)

WhereDeletedAt applies the entql time.Time predicate on the deleted_at field.

func (*ItemFilter) WhereDescription

func (f *ItemFilter) WhereDescription(p entql.StringP)

WhereDescription applies the entql string predicate on the description field.

func (*ItemFilter) WhereHasBundles

func (f *ItemFilter) WhereHasBundles()

WhereHasBundles applies a predicate to check if query has an edge bundles.

func (*ItemFilter) WhereHasBundlesWith

func (f *ItemFilter) WhereHasBundlesWith(preds ...predicate.Bundle)

WhereHasBundlesWith applies a predicate to check if query has an edge bundles with a given conditions (other predicates).

func (*ItemFilter) WhereID

func (f *ItemFilter) WhereID(p entql.Int64P)

WhereID applies the entql int64 predicate on the id field.

func (*ItemFilter) WhereName

func (f *ItemFilter) WhereName(p entql.StringP)

WhereName applies the entql string predicate on the name field.

func (*ItemFilter) WhereTopicName

func (f *ItemFilter) WhereTopicName(p entql.StringP)

WhereTopicName applies the entql string predicate on the topic_name field.

func (*ItemFilter) WhereUpdatedAt

func (f *ItemFilter) WhereUpdatedAt(p entql.TimeP)

WhereUpdatedAt applies the entql time.Time predicate on the updated_at field.

type ItemGroupBy

type ItemGroupBy struct {
	// contains filtered or unexported fields
}

ItemGroupBy is the group-by builder for Item entities.

func (*ItemGroupBy) Aggregate

func (igb *ItemGroupBy) Aggregate(fns ...AggregateFunc) *ItemGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ItemGroupBy) Bool

func (s *ItemGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ItemGroupBy) BoolX

func (s *ItemGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ItemGroupBy) Bools

func (s *ItemGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ItemGroupBy) BoolsX

func (s *ItemGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ItemGroupBy) Float64

func (s *ItemGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ItemGroupBy) Float64X

func (s *ItemGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ItemGroupBy) Float64s

func (s *ItemGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ItemGroupBy) Float64sX

func (s *ItemGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ItemGroupBy) Int

func (s *ItemGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ItemGroupBy) IntX

func (s *ItemGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ItemGroupBy) Ints

func (s *ItemGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ItemGroupBy) IntsX

func (s *ItemGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ItemGroupBy) Scan

func (igb *ItemGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ItemGroupBy) ScanX

func (s *ItemGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ItemGroupBy) String

func (s *ItemGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ItemGroupBy) StringX

func (s *ItemGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ItemGroupBy) Strings

func (s *ItemGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ItemGroupBy) StringsX

func (s *ItemGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ItemMutation

type ItemMutation struct {
	// contains filtered or unexported fields
}

ItemMutation represents an operation that mutates the Item nodes in the graph.

func (*ItemMutation) AddBundleIDs

func (m *ItemMutation) AddBundleIDs(ids ...int64)

AddBundleIDs adds the "bundles" edge to the Bundle entity by ids.

func (*ItemMutation) AddField

func (m *ItemMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ItemMutation) AddedEdges

func (m *ItemMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ItemMutation) AddedField

func (m *ItemMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ItemMutation) AddedFields

func (m *ItemMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ItemMutation) AddedIDs

func (m *ItemMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ItemMutation) BundlesCleared

func (m *ItemMutation) BundlesCleared() bool

BundlesCleared reports if the "bundles" edge to the Bundle entity was cleared.

func (*ItemMutation) BundlesIDs

func (m *ItemMutation) BundlesIDs() (ids []int64)

BundlesIDs returns the "bundles" edge IDs in the mutation.

func (*ItemMutation) ClearBundles

func (m *ItemMutation) ClearBundles()

ClearBundles clears the "bundles" edge to the Bundle entity.

func (*ItemMutation) ClearDeletedAt

func (m *ItemMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*ItemMutation) ClearEdge

func (m *ItemMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*ItemMutation) ClearField

func (m *ItemMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*ItemMutation) ClearTopicName

func (m *ItemMutation) ClearTopicName()

ClearTopicName clears the value of the "topic_name" field.

func (*ItemMutation) ClearedEdges

func (m *ItemMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ItemMutation) ClearedFields

func (m *ItemMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ItemMutation) Client

func (m ItemMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*ItemMutation) CreatedAt

func (m *ItemMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ItemMutation) DeletedAt

func (m *ItemMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*ItemMutation) DeletedAtCleared

func (m *ItemMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*ItemMutation) Description

func (m *ItemMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*ItemMutation) EdgeCleared

func (m *ItemMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ItemMutation) Field

func (m *ItemMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ItemMutation) FieldCleared

func (m *ItemMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ItemMutation) Fields

func (m *ItemMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*ItemMutation) Filter

func (m *ItemMutation) Filter() *ItemFilter

Filter returns an entql.Where implementation to apply filters on the ItemMutation builder.

func (*ItemMutation) ID

func (m *ItemMutation) ID() (id int64, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*ItemMutation) IDs

func (m *ItemMutation) IDs(ctx context.Context) ([]int64, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*ItemMutation) Name

func (m *ItemMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*ItemMutation) OldCreatedAt

func (m *ItemMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Item entity. If the Item object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemMutation) OldDeletedAt

func (m *ItemMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Item entity. If the Item object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemMutation) OldDescription

func (m *ItemMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Item entity. If the Item object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemMutation) OldField

func (m *ItemMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*ItemMutation) OldName

func (m *ItemMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Item entity. If the Item object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemMutation) OldTopicName

func (m *ItemMutation) OldTopicName(ctx context.Context) (v *string, err error)

OldTopicName returns the old "topic_name" field's value of the Item entity. If the Item object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemMutation) OldUpdatedAt

func (m *ItemMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Item entity. If the Item object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemMutation) Op

func (m *ItemMutation) Op() Op

Op returns the operation name.

func (*ItemMutation) RemoveBundleIDs

func (m *ItemMutation) RemoveBundleIDs(ids ...int64)

RemoveBundleIDs removes the "bundles" edge to the Bundle entity by IDs.

func (*ItemMutation) RemovedBundlesIDs

func (m *ItemMutation) RemovedBundlesIDs() (ids []int64)

RemovedBundles returns the removed IDs of the "bundles" edge to the Bundle entity.

func (*ItemMutation) RemovedEdges

func (m *ItemMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ItemMutation) RemovedIDs

func (m *ItemMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*ItemMutation) ResetBundles

func (m *ItemMutation) ResetBundles()

ResetBundles resets all changes to the "bundles" edge.

func (*ItemMutation) ResetCreatedAt

func (m *ItemMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ItemMutation) ResetDeletedAt

func (m *ItemMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*ItemMutation) ResetDescription

func (m *ItemMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*ItemMutation) ResetEdge

func (m *ItemMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*ItemMutation) ResetField

func (m *ItemMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*ItemMutation) ResetName

func (m *ItemMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ItemMutation) ResetTopicName

func (m *ItemMutation) ResetTopicName()

ResetTopicName resets all changes to the "topic_name" field.

func (*ItemMutation) ResetUpdatedAt

func (m *ItemMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ItemMutation) SetCreatedAt

func (m *ItemMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ItemMutation) SetDeletedAt

func (m *ItemMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*ItemMutation) SetDescription

func (m *ItemMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*ItemMutation) SetField

func (m *ItemMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ItemMutation) SetID

func (m *ItemMutation) SetID(id int64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Item entities.

func (*ItemMutation) SetName

func (m *ItemMutation) SetName(s string)

SetName sets the "name" field.

func (*ItemMutation) SetOp

func (m *ItemMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ItemMutation) SetTopicName

func (m *ItemMutation) SetTopicName(s string)

SetTopicName sets the "topic_name" field.

func (*ItemMutation) SetUpdatedAt

func (m *ItemMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*ItemMutation) TopicName

func (m *ItemMutation) TopicName() (r string, exists bool)

TopicName returns the value of the "topic_name" field in the mutation.

func (*ItemMutation) TopicNameCleared

func (m *ItemMutation) TopicNameCleared() bool

TopicNameCleared returns if the "topic_name" field was cleared in this mutation.

func (ItemMutation) Tx

func (m ItemMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ItemMutation) Type

func (m *ItemMutation) Type() string

Type returns the node type of this mutation (Item).

func (*ItemMutation) UpdatedAt

func (m *ItemMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*ItemMutation) Where

func (m *ItemMutation) Where(ps ...predicate.Item)

Where appends a list predicates to the ItemMutation builder.

func (*ItemMutation) WhereP

func (m *ItemMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ItemMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ItemQuery

type ItemQuery struct {
	// contains filtered or unexported fields
}

ItemQuery is the builder for querying Item entities.

func (*ItemQuery) Aggregate

func (iq *ItemQuery) Aggregate(fns ...AggregateFunc) *ItemSelect

Aggregate returns a ItemSelect configured with the given aggregations.

func (*ItemQuery) All

func (iq *ItemQuery) All(ctx context.Context) ([]*Item, error)

All executes the query and returns a list of Items.

func (*ItemQuery) AllX

func (iq *ItemQuery) AllX(ctx context.Context) []*Item

AllX is like All, but panics if an error occurs.

func (*ItemQuery) Clone

func (iq *ItemQuery) Clone() *ItemQuery

Clone returns a duplicate of the ItemQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ItemQuery) Count

func (iq *ItemQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ItemQuery) CountX

func (iq *ItemQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ItemQuery) Exist

func (iq *ItemQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ItemQuery) ExistX

func (iq *ItemQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ItemQuery) Filter

func (iq *ItemQuery) Filter() *ItemFilter

Filter returns a Filter implementation to apply filters on the ItemQuery builder.

func (*ItemQuery) First

func (iq *ItemQuery) First(ctx context.Context) (*Item, error)

First returns the first Item entity from the query. Returns a *NotFoundError when no Item was found.

func (*ItemQuery) FirstID

func (iq *ItemQuery) FirstID(ctx context.Context) (id int64, err error)

FirstID returns the first Item ID from the query. Returns a *NotFoundError when no Item ID was found.

func (*ItemQuery) FirstIDX

func (iq *ItemQuery) FirstIDX(ctx context.Context) int64

FirstIDX is like FirstID, but panics if an error occurs.

func (*ItemQuery) FirstX

func (iq *ItemQuery) FirstX(ctx context.Context) *Item

FirstX is like First, but panics if an error occurs.

func (*ItemQuery) GroupBy

func (iq *ItemQuery) GroupBy(field string, fields ...string) *ItemGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Item.Query().
	GroupBy(item.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ItemQuery) IDs

func (iq *ItemQuery) IDs(ctx context.Context) (ids []int64, err error)

IDs executes the query and returns a list of Item IDs.

func (*ItemQuery) IDsX

func (iq *ItemQuery) IDsX(ctx context.Context) []int64

IDsX is like IDs, but panics if an error occurs.

func (*ItemQuery) Limit

func (iq *ItemQuery) Limit(limit int) *ItemQuery

Limit the number of records to be returned by this query.

func (*ItemQuery) Modify

func (iq *ItemQuery) Modify(modifiers ...func(s *sql.Selector)) *ItemSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*ItemQuery) Offset

func (iq *ItemQuery) Offset(offset int) *ItemQuery

Offset to start from.

func (*ItemQuery) Only

func (iq *ItemQuery) Only(ctx context.Context) (*Item, error)

Only returns a single Item entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Item entity is found. Returns a *NotFoundError when no Item entities are found.

func (*ItemQuery) OnlyID

func (iq *ItemQuery) OnlyID(ctx context.Context) (id int64, err error)

OnlyID is like Only, but returns the only Item ID in the query. Returns a *NotSingularError when more than one Item ID is found. Returns a *NotFoundError when no entities are found.

func (*ItemQuery) OnlyIDX

func (iq *ItemQuery) OnlyIDX(ctx context.Context) int64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ItemQuery) OnlyX

func (iq *ItemQuery) OnlyX(ctx context.Context) *Item

OnlyX is like Only, but panics if an error occurs.

func (*ItemQuery) Order

func (iq *ItemQuery) Order(o ...item.OrderOption) *ItemQuery

Order specifies how the records should be ordered.

func (*ItemQuery) QueryBundles

func (iq *ItemQuery) QueryBundles() *BundleQuery

QueryBundles chains the current query on the "bundles" edge.

func (*ItemQuery) Select

func (iq *ItemQuery) Select(fields ...string) *ItemSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Item.Query().
	Select(item.FieldCreatedAt).
	Scan(ctx, &v)

func (*ItemQuery) Unique

func (iq *ItemQuery) Unique(unique bool) *ItemQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*ItemQuery) Where

func (iq *ItemQuery) Where(ps ...predicate.Item) *ItemQuery

Where adds a new predicate for the ItemQuery builder.

func (*ItemQuery) WithBundles

func (iq *ItemQuery) WithBundles(opts ...func(*BundleQuery)) *ItemQuery

WithBundles tells the query-builder to eager-load the nodes that are connected to the "bundles" edge. The optional arguments are used to configure the query builder of the edge.

type ItemSelect

type ItemSelect struct {
	*ItemQuery
	// contains filtered or unexported fields
}

ItemSelect is the builder for selecting fields of Item entities.

func (*ItemSelect) Aggregate

func (is *ItemSelect) Aggregate(fns ...AggregateFunc) *ItemSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ItemSelect) Bool

func (s *ItemSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ItemSelect) BoolX

func (s *ItemSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ItemSelect) Bools

func (s *ItemSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ItemSelect) BoolsX

func (s *ItemSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ItemSelect) Float64

func (s *ItemSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ItemSelect) Float64X

func (s *ItemSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ItemSelect) Float64s

func (s *ItemSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ItemSelect) Float64sX

func (s *ItemSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ItemSelect) Int

func (s *ItemSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ItemSelect) IntX

func (s *ItemSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ItemSelect) Ints

func (s *ItemSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ItemSelect) IntsX

func (s *ItemSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ItemSelect) Modify

func (is *ItemSelect) Modify(modifiers ...func(s *sql.Selector)) *ItemSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*ItemSelect) Scan

func (is *ItemSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ItemSelect) ScanX

func (s *ItemSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ItemSelect) String

func (s *ItemSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ItemSelect) StringX

func (s *ItemSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ItemSelect) Strings

func (s *ItemSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ItemSelect) StringsX

func (s *ItemSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ItemUpdate

type ItemUpdate struct {
	// contains filtered or unexported fields
}

ItemUpdate is the builder for updating Item entities.

func (*ItemUpdate) AddBundleIDs

func (iu *ItemUpdate) AddBundleIDs(ids ...int64) *ItemUpdate

AddBundleIDs adds the "bundles" edge to the Bundle entity by IDs.

func (*ItemUpdate) AddBundles

func (iu *ItemUpdate) AddBundles(b ...*Bundle) *ItemUpdate

AddBundles adds the "bundles" edges to the Bundle entity.

func (*ItemUpdate) ClearBundles

func (iu *ItemUpdate) ClearBundles() *ItemUpdate

ClearBundles clears all "bundles" edges to the Bundle entity.

func (*ItemUpdate) ClearDeletedAt

func (iu *ItemUpdate) ClearDeletedAt() *ItemUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*ItemUpdate) ClearTopicName

func (iu *ItemUpdate) ClearTopicName() *ItemUpdate

ClearTopicName clears the value of the "topic_name" field.

func (*ItemUpdate) Exec

func (iu *ItemUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ItemUpdate) ExecX

func (iu *ItemUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ItemUpdate) Modify

func (iu *ItemUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *ItemUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*ItemUpdate) Mutation

func (iu *ItemUpdate) Mutation() *ItemMutation

Mutation returns the ItemMutation object of the builder.

func (*ItemUpdate) RemoveBundleIDs

func (iu *ItemUpdate) RemoveBundleIDs(ids ...int64) *ItemUpdate

RemoveBundleIDs removes the "bundles" edge to Bundle entities by IDs.

func (*ItemUpdate) RemoveBundles

func (iu *ItemUpdate) RemoveBundles(b ...*Bundle) *ItemUpdate

RemoveBundles removes "bundles" edges to Bundle entities.

func (*ItemUpdate) Save

func (iu *ItemUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ItemUpdate) SaveX

func (iu *ItemUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ItemUpdate) SetDeletedAt

func (iu *ItemUpdate) SetDeletedAt(t time.Time) *ItemUpdate

SetDeletedAt sets the "deleted_at" field.

func (*ItemUpdate) SetDescription

func (iu *ItemUpdate) SetDescription(s string) *ItemUpdate

SetDescription sets the "description" field.

func (*ItemUpdate) SetName

func (iu *ItemUpdate) SetName(s string) *ItemUpdate

SetName sets the "name" field.

func (*ItemUpdate) SetNillableDeletedAt

func (iu *ItemUpdate) SetNillableDeletedAt(t *time.Time) *ItemUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*ItemUpdate) SetNillableDescription

func (iu *ItemUpdate) SetNillableDescription(s *string) *ItemUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*ItemUpdate) SetNillableName

func (iu *ItemUpdate) SetNillableName(s *string) *ItemUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*ItemUpdate) SetNillableTopicName

func (iu *ItemUpdate) SetNillableTopicName(s *string) *ItemUpdate

SetNillableTopicName sets the "topic_name" field if the given value is not nil.

func (*ItemUpdate) SetTopicName

func (iu *ItemUpdate) SetTopicName(s string) *ItemUpdate

SetTopicName sets the "topic_name" field.

func (*ItemUpdate) SetUpdatedAt

func (iu *ItemUpdate) SetUpdatedAt(t time.Time) *ItemUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ItemUpdate) Where

func (iu *ItemUpdate) Where(ps ...predicate.Item) *ItemUpdate

Where appends a list predicates to the ItemUpdate builder.

type ItemUpdateOne

type ItemUpdateOne struct {
	// contains filtered or unexported fields
}

ItemUpdateOne is the builder for updating a single Item entity.

func (*ItemUpdateOne) AddBundleIDs

func (iuo *ItemUpdateOne) AddBundleIDs(ids ...int64) *ItemUpdateOne

AddBundleIDs adds the "bundles" edge to the Bundle entity by IDs.

func (*ItemUpdateOne) AddBundles

func (iuo *ItemUpdateOne) AddBundles(b ...*Bundle) *ItemUpdateOne

AddBundles adds the "bundles" edges to the Bundle entity.

func (*ItemUpdateOne) ClearBundles

func (iuo *ItemUpdateOne) ClearBundles() *ItemUpdateOne

ClearBundles clears all "bundles" edges to the Bundle entity.

func (*ItemUpdateOne) ClearDeletedAt

func (iuo *ItemUpdateOne) ClearDeletedAt() *ItemUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*ItemUpdateOne) ClearTopicName

func (iuo *ItemUpdateOne) ClearTopicName() *ItemUpdateOne

ClearTopicName clears the value of the "topic_name" field.

func (*ItemUpdateOne) Exec

func (iuo *ItemUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ItemUpdateOne) ExecX

func (iuo *ItemUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ItemUpdateOne) Modify

func (iuo *ItemUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *ItemUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*ItemUpdateOne) Mutation

func (iuo *ItemUpdateOne) Mutation() *ItemMutation

Mutation returns the ItemMutation object of the builder.

func (*ItemUpdateOne) RemoveBundleIDs

func (iuo *ItemUpdateOne) RemoveBundleIDs(ids ...int64) *ItemUpdateOne

RemoveBundleIDs removes the "bundles" edge to Bundle entities by IDs.

func (*ItemUpdateOne) RemoveBundles

func (iuo *ItemUpdateOne) RemoveBundles(b ...*Bundle) *ItemUpdateOne

RemoveBundles removes "bundles" edges to Bundle entities.

func (*ItemUpdateOne) Save

func (iuo *ItemUpdateOne) Save(ctx context.Context) (*Item, error)

Save executes the query and returns the updated Item entity.

func (*ItemUpdateOne) SaveX

func (iuo *ItemUpdateOne) SaveX(ctx context.Context) *Item

SaveX is like Save, but panics if an error occurs.

func (*ItemUpdateOne) Select

func (iuo *ItemUpdateOne) Select(field string, fields ...string) *ItemUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ItemUpdateOne) SetDeletedAt

func (iuo *ItemUpdateOne) SetDeletedAt(t time.Time) *ItemUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*ItemUpdateOne) SetDescription

func (iuo *ItemUpdateOne) SetDescription(s string) *ItemUpdateOne

SetDescription sets the "description" field.

func (*ItemUpdateOne) SetName

func (iuo *ItemUpdateOne) SetName(s string) *ItemUpdateOne

SetName sets the "name" field.

func (*ItemUpdateOne) SetNillableDeletedAt

func (iuo *ItemUpdateOne) SetNillableDeletedAt(t *time.Time) *ItemUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*ItemUpdateOne) SetNillableDescription

func (iuo *ItemUpdateOne) SetNillableDescription(s *string) *ItemUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*ItemUpdateOne) SetNillableName

func (iuo *ItemUpdateOne) SetNillableName(s *string) *ItemUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*ItemUpdateOne) SetNillableTopicName

func (iuo *ItemUpdateOne) SetNillableTopicName(s *string) *ItemUpdateOne

SetNillableTopicName sets the "topic_name" field if the given value is not nil.

func (*ItemUpdateOne) SetTopicName

func (iuo *ItemUpdateOne) SetTopicName(s string) *ItemUpdateOne

SetTopicName sets the "topic_name" field.

func (*ItemUpdateOne) SetUpdatedAt

func (iuo *ItemUpdateOne) SetUpdatedAt(t time.Time) *ItemUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ItemUpdateOne) Where

func (iuo *ItemUpdateOne) Where(ps ...predicate.Item) *ItemUpdateOne

Where appends a list predicates to the ItemUpdate builder.

type ItemUpsert

type ItemUpsert struct {
	*sql.UpdateSet
}

ItemUpsert is the "OnConflict" setter.

func (*ItemUpsert) ClearDeletedAt

func (u *ItemUpsert) ClearDeletedAt() *ItemUpsert

ClearDeletedAt clears the value of the "deleted_at" field.

func (*ItemUpsert) ClearTopicName

func (u *ItemUpsert) ClearTopicName() *ItemUpsert

ClearTopicName clears the value of the "topic_name" field.

func (*ItemUpsert) SetDeletedAt

func (u *ItemUpsert) SetDeletedAt(v time.Time) *ItemUpsert

SetDeletedAt sets the "deleted_at" field.

func (*ItemUpsert) SetDescription

func (u *ItemUpsert) SetDescription(v string) *ItemUpsert

SetDescription sets the "description" field.

func (*ItemUpsert) SetName

func (u *ItemUpsert) SetName(v string) *ItemUpsert

SetName sets the "name" field.

func (*ItemUpsert) SetTopicName

func (u *ItemUpsert) SetTopicName(v string) *ItemUpsert

SetTopicName sets the "topic_name" field.

func (*ItemUpsert) SetUpdatedAt

func (u *ItemUpsert) SetUpdatedAt(v time.Time) *ItemUpsert

SetUpdatedAt sets the "updated_at" field.

func (*ItemUpsert) UpdateDeletedAt

func (u *ItemUpsert) UpdateDeletedAt() *ItemUpsert

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*ItemUpsert) UpdateDescription

func (u *ItemUpsert) UpdateDescription() *ItemUpsert

UpdateDescription sets the "description" field to the value that was provided on create.

func (*ItemUpsert) UpdateName

func (u *ItemUpsert) UpdateName() *ItemUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*ItemUpsert) UpdateTopicName

func (u *ItemUpsert) UpdateTopicName() *ItemUpsert

UpdateTopicName sets the "topic_name" field to the value that was provided on create.

func (*ItemUpsert) UpdateUpdatedAt

func (u *ItemUpsert) UpdateUpdatedAt() *ItemUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type ItemUpsertBulk

type ItemUpsertBulk struct {
	// contains filtered or unexported fields
}

ItemUpsertBulk is the builder for "upsert"-ing a bulk of Item nodes.

func (*ItemUpsertBulk) ClearDeletedAt

func (u *ItemUpsertBulk) ClearDeletedAt() *ItemUpsertBulk

ClearDeletedAt clears the value of the "deleted_at" field.

func (*ItemUpsertBulk) ClearTopicName

func (u *ItemUpsertBulk) ClearTopicName() *ItemUpsertBulk

ClearTopicName clears the value of the "topic_name" field.

func (*ItemUpsertBulk) DoNothing

func (u *ItemUpsertBulk) DoNothing() *ItemUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ItemUpsertBulk) Exec

func (u *ItemUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ItemUpsertBulk) ExecX

func (u *ItemUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ItemUpsertBulk) Ignore

func (u *ItemUpsertBulk) Ignore() *ItemUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Item.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*ItemUpsertBulk) SetDeletedAt

func (u *ItemUpsertBulk) SetDeletedAt(v time.Time) *ItemUpsertBulk

SetDeletedAt sets the "deleted_at" field.

func (*ItemUpsertBulk) SetDescription

func (u *ItemUpsertBulk) SetDescription(v string) *ItemUpsertBulk

SetDescription sets the "description" field.

func (*ItemUpsertBulk) SetName

func (u *ItemUpsertBulk) SetName(v string) *ItemUpsertBulk

SetName sets the "name" field.

func (*ItemUpsertBulk) SetTopicName

func (u *ItemUpsertBulk) SetTopicName(v string) *ItemUpsertBulk

SetTopicName sets the "topic_name" field.

func (*ItemUpsertBulk) SetUpdatedAt

func (u *ItemUpsertBulk) SetUpdatedAt(v time.Time) *ItemUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*ItemUpsertBulk) Update

func (u *ItemUpsertBulk) Update(set func(*ItemUpsert)) *ItemUpsertBulk

Update allows overriding fields `UPDATE` values. See the ItemCreateBulk.OnConflict documentation for more info.

func (*ItemUpsertBulk) UpdateDeletedAt

func (u *ItemUpsertBulk) UpdateDeletedAt() *ItemUpsertBulk

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*ItemUpsertBulk) UpdateDescription

func (u *ItemUpsertBulk) UpdateDescription() *ItemUpsertBulk

UpdateDescription sets the "description" field to the value that was provided on create.

func (*ItemUpsertBulk) UpdateName

func (u *ItemUpsertBulk) UpdateName() *ItemUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*ItemUpsertBulk) UpdateNewValues

func (u *ItemUpsertBulk) UpdateNewValues() *ItemUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Item.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(item.FieldID)
		}),
	).
	Exec(ctx)

func (*ItemUpsertBulk) UpdateTopicName

func (u *ItemUpsertBulk) UpdateTopicName() *ItemUpsertBulk

UpdateTopicName sets the "topic_name" field to the value that was provided on create.

func (*ItemUpsertBulk) UpdateUpdatedAt

func (u *ItemUpsertBulk) UpdateUpdatedAt() *ItemUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type ItemUpsertOne

type ItemUpsertOne struct {
	// contains filtered or unexported fields
}

ItemUpsertOne is the builder for "upsert"-ing

one Item node.

func (*ItemUpsertOne) ClearDeletedAt

func (u *ItemUpsertOne) ClearDeletedAt() *ItemUpsertOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*ItemUpsertOne) ClearTopicName

func (u *ItemUpsertOne) ClearTopicName() *ItemUpsertOne

ClearTopicName clears the value of the "topic_name" field.

func (*ItemUpsertOne) DoNothing

func (u *ItemUpsertOne) DoNothing() *ItemUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ItemUpsertOne) Exec

func (u *ItemUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*ItemUpsertOne) ExecX

func (u *ItemUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ItemUpsertOne) ID

func (u *ItemUpsertOne) ID(ctx context.Context) (id int64, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*ItemUpsertOne) IDX

func (u *ItemUpsertOne) IDX(ctx context.Context) int64

IDX is like ID, but panics if an error occurs.

func (*ItemUpsertOne) Ignore

func (u *ItemUpsertOne) Ignore() *ItemUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Item.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*ItemUpsertOne) SetDeletedAt

func (u *ItemUpsertOne) SetDeletedAt(v time.Time) *ItemUpsertOne

SetDeletedAt sets the "deleted_at" field.

func (*ItemUpsertOne) SetDescription

func (u *ItemUpsertOne) SetDescription(v string) *ItemUpsertOne

SetDescription sets the "description" field.

func (*ItemUpsertOne) SetName

func (u *ItemUpsertOne) SetName(v string) *ItemUpsertOne

SetName sets the "name" field.

func (*ItemUpsertOne) SetTopicName

func (u *ItemUpsertOne) SetTopicName(v string) *ItemUpsertOne

SetTopicName sets the "topic_name" field.

func (*ItemUpsertOne) SetUpdatedAt

func (u *ItemUpsertOne) SetUpdatedAt(v time.Time) *ItemUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*ItemUpsertOne) Update

func (u *ItemUpsertOne) Update(set func(*ItemUpsert)) *ItemUpsertOne

Update allows overriding fields `UPDATE` values. See the ItemCreate.OnConflict documentation for more info.

func (*ItemUpsertOne) UpdateDeletedAt

func (u *ItemUpsertOne) UpdateDeletedAt() *ItemUpsertOne

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*ItemUpsertOne) UpdateDescription

func (u *ItemUpsertOne) UpdateDescription() *ItemUpsertOne

UpdateDescription sets the "description" field to the value that was provided on create.

func (*ItemUpsertOne) UpdateName

func (u *ItemUpsertOne) UpdateName() *ItemUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*ItemUpsertOne) UpdateNewValues

func (u *ItemUpsertOne) UpdateNewValues() *ItemUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Item.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(item.FieldID)
		}),
	).
	Exec(ctx)

func (*ItemUpsertOne) UpdateTopicName

func (u *ItemUpsertOne) UpdateTopicName() *ItemUpsertOne

UpdateTopicName sets the "topic_name" field to the value that was provided on create.

func (*ItemUpsertOne) UpdateUpdatedAt

func (u *ItemUpsertOne) UpdateUpdatedAt() *ItemUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type Items

type Items []*Item

Items is a parsable slice of Item.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflicts in user's code.

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

type NotLoadedError struct {
	// contains filtered or unexported fields
}

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

type NotSingularError struct {
	// contains filtered or unexported fields
}

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type PaymentProfile

type PaymentProfile struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID int64 `json:"user_id,omitempty"`
	// PanMasked holds the value of the "pan_masked" field.
	PanMasked string `json:"pan_masked,omitempty"`
	// Holder holds the value of the "holder" field.
	Holder string `json:"holder,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// Phone holds the value of the "phone" field.
	Phone string `json:"phone,omitempty"`
	// UserToken holds the value of the "user_token" field.
	UserToken string `json:"user_token,omitempty"`
	// RecurrentToken holds the value of the "recurrent_token" field.
	RecurrentToken *string `json:"recurrent_token,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PaymentProfileQuery when eager-loading is set.
	Edges PaymentProfileEdges `json:"edges"`
	// contains filtered or unexported fields
}

PaymentProfile is the model entity for the PaymentProfile schema.

func (*PaymentProfile) QueryInvoices

func (pp *PaymentProfile) QueryInvoices() *InvoiceQuery

QueryInvoices queries the "invoices" edge of the PaymentProfile entity.

func (*PaymentProfile) String

func (pp *PaymentProfile) String() string

String implements the fmt.Stringer.

func (*PaymentProfile) Unwrap

func (pp *PaymentProfile) Unwrap() *PaymentProfile

Unwrap unwraps the PaymentProfile entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*PaymentProfile) Update

Update returns a builder for updating this PaymentProfile. Note that you need to call PaymentProfile.Unwrap() before calling this method if this PaymentProfile was returned from a transaction, and the transaction was committed or rolled back.

func (*PaymentProfile) Value

func (pp *PaymentProfile) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the PaymentProfile. This includes values selected through modifiers, order, etc.

type PaymentProfileClient

type PaymentProfileClient struct {
	// contains filtered or unexported fields
}

PaymentProfileClient is a client for the PaymentProfile schema.

func NewPaymentProfileClient

func NewPaymentProfileClient(c config) *PaymentProfileClient

NewPaymentProfileClient returns a client for the PaymentProfile from the given config.

func (*PaymentProfileClient) Create

Create returns a builder for creating a PaymentProfile entity.

func (*PaymentProfileClient) CreateBulk

CreateBulk returns a builder for creating a bulk of PaymentProfile entities.

func (*PaymentProfileClient) Delete

Delete returns a delete builder for PaymentProfile.

func (*PaymentProfileClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PaymentProfileClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*PaymentProfileClient) Get

Get returns a PaymentProfile entity by its id.

func (*PaymentProfileClient) GetX

GetX is like Get, but panics if an error occurs.

func (*PaymentProfileClient) Hooks

func (c *PaymentProfileClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PaymentProfileClient) Intercept

func (c *PaymentProfileClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `paymentprofile.Intercept(f(g(h())))`.

func (*PaymentProfileClient) Interceptors

func (c *PaymentProfileClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PaymentProfileClient) MapCreateBulk

func (c *PaymentProfileClient) MapCreateBulk(slice any, setFunc func(*PaymentProfileCreate, int)) *PaymentProfileCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*PaymentProfileClient) Query

Query returns a query builder for PaymentProfile.

func (*PaymentProfileClient) QueryInvoices

func (c *PaymentProfileClient) QueryInvoices(pp *PaymentProfile) *InvoiceQuery

QueryInvoices queries the invoices edge of a PaymentProfile.

func (*PaymentProfileClient) Update

Update returns an update builder for PaymentProfile.

func (*PaymentProfileClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*PaymentProfileClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*PaymentProfileClient) Use

func (c *PaymentProfileClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `paymentprofile.Hooks(f(g(h())))`.

type PaymentProfileCreate

type PaymentProfileCreate struct {
	// contains filtered or unexported fields
}

PaymentProfileCreate is the builder for creating a PaymentProfile entity.

func (*PaymentProfileCreate) AddInvoiceIDs

func (ppc *PaymentProfileCreate) AddInvoiceIDs(ids ...int64) *PaymentProfileCreate

AddInvoiceIDs adds the "invoices" edge to the Invoice entity by IDs.

func (*PaymentProfileCreate) AddInvoices

func (ppc *PaymentProfileCreate) AddInvoices(i ...*Invoice) *PaymentProfileCreate

AddInvoices adds the "invoices" edges to the Invoice entity.

func (*PaymentProfileCreate) Exec

func (ppc *PaymentProfileCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PaymentProfileCreate) ExecX

func (ppc *PaymentProfileCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PaymentProfileCreate) Mutation

Mutation returns the PaymentProfileMutation object of the builder.

func (*PaymentProfileCreate) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.PaymentProfile.Create().
	SetCreatedAt(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.PaymentProfileUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*PaymentProfileCreate) OnConflictColumns

func (ppc *PaymentProfileCreate) OnConflictColumns(columns ...string) *PaymentProfileUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.PaymentProfile.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*PaymentProfileCreate) Save

Save creates the PaymentProfile in the database.

func (*PaymentProfileCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*PaymentProfileCreate) SetCreatedAt

func (ppc *PaymentProfileCreate) SetCreatedAt(t time.Time) *PaymentProfileCreate

SetCreatedAt sets the "created_at" field.

func (*PaymentProfileCreate) SetDeletedAt

func (ppc *PaymentProfileCreate) SetDeletedAt(t time.Time) *PaymentProfileCreate

SetDeletedAt sets the "deleted_at" field.

func (*PaymentProfileCreate) SetEmail

SetEmail sets the "email" field.

func (*PaymentProfileCreate) SetHolder

SetHolder sets the "holder" field.

func (*PaymentProfileCreate) SetID

SetID sets the "id" field.

func (*PaymentProfileCreate) SetNillableCreatedAt

func (ppc *PaymentProfileCreate) SetNillableCreatedAt(t *time.Time) *PaymentProfileCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*PaymentProfileCreate) SetNillableDeletedAt

func (ppc *PaymentProfileCreate) SetNillableDeletedAt(t *time.Time) *PaymentProfileCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*PaymentProfileCreate) SetNillableEmail

func (ppc *PaymentProfileCreate) SetNillableEmail(s *string) *PaymentProfileCreate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*PaymentProfileCreate) SetNillablePhone

func (ppc *PaymentProfileCreate) SetNillablePhone(s *string) *PaymentProfileCreate

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*PaymentProfileCreate) SetNillableRecurrentToken

func (ppc *PaymentProfileCreate) SetNillableRecurrentToken(s *string) *PaymentProfileCreate

SetNillableRecurrentToken sets the "recurrent_token" field if the given value is not nil.

func (*PaymentProfileCreate) SetNillableUpdatedAt

func (ppc *PaymentProfileCreate) SetNillableUpdatedAt(t *time.Time) *PaymentProfileCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*PaymentProfileCreate) SetNillableUserToken

func (ppc *PaymentProfileCreate) SetNillableUserToken(s *string) *PaymentProfileCreate

SetNillableUserToken sets the "user_token" field if the given value is not nil.

func (*PaymentProfileCreate) SetPanMasked

func (ppc *PaymentProfileCreate) SetPanMasked(s string) *PaymentProfileCreate

SetPanMasked sets the "pan_masked" field.

func (*PaymentProfileCreate) SetPhone

SetPhone sets the "phone" field.

func (*PaymentProfileCreate) SetRecurrentToken

func (ppc *PaymentProfileCreate) SetRecurrentToken(s string) *PaymentProfileCreate

SetRecurrentToken sets the "recurrent_token" field.

func (*PaymentProfileCreate) SetUpdatedAt

func (ppc *PaymentProfileCreate) SetUpdatedAt(t time.Time) *PaymentProfileCreate

SetUpdatedAt sets the "updated_at" field.

func (*PaymentProfileCreate) SetUserID

func (ppc *PaymentProfileCreate) SetUserID(i int64) *PaymentProfileCreate

SetUserID sets the "user_id" field.

func (*PaymentProfileCreate) SetUserToken

func (ppc *PaymentProfileCreate) SetUserToken(s string) *PaymentProfileCreate

SetUserToken sets the "user_token" field.

type PaymentProfileCreateBulk

type PaymentProfileCreateBulk struct {
	// contains filtered or unexported fields
}

PaymentProfileCreateBulk is the builder for creating many PaymentProfile entities in bulk.

func (*PaymentProfileCreateBulk) Exec

Exec executes the query.

func (*PaymentProfileCreateBulk) ExecX

func (ppcb *PaymentProfileCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PaymentProfileCreateBulk) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.PaymentProfile.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.PaymentProfileUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*PaymentProfileCreateBulk) OnConflictColumns

func (ppcb *PaymentProfileCreateBulk) OnConflictColumns(columns ...string) *PaymentProfileUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.PaymentProfile.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*PaymentProfileCreateBulk) Save

Save creates the PaymentProfile entities in the database.

func (*PaymentProfileCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type PaymentProfileDelete

type PaymentProfileDelete struct {
	// contains filtered or unexported fields
}

PaymentProfileDelete is the builder for deleting a PaymentProfile entity.

func (*PaymentProfileDelete) Exec

func (ppd *PaymentProfileDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PaymentProfileDelete) ExecX

func (ppd *PaymentProfileDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PaymentProfileDelete) Where

Where appends a list predicates to the PaymentProfileDelete builder.

type PaymentProfileDeleteOne

type PaymentProfileDeleteOne struct {
	// contains filtered or unexported fields
}

PaymentProfileDeleteOne is the builder for deleting a single PaymentProfile entity.

func (*PaymentProfileDeleteOne) Exec

func (ppdo *PaymentProfileDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PaymentProfileDeleteOne) ExecX

func (ppdo *PaymentProfileDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PaymentProfileDeleteOne) Where

Where appends a list predicates to the PaymentProfileDelete builder.

type PaymentProfileEdges

type PaymentProfileEdges struct {
	// Invoices holds the value of the invoices edge.
	Invoices []*Invoice `json:"invoices,omitempty"`
	// contains filtered or unexported fields
}

PaymentProfileEdges holds the relations/edges for other nodes in the graph.

func (PaymentProfileEdges) InvoicesOrErr

func (e PaymentProfileEdges) InvoicesOrErr() ([]*Invoice, error)

InvoicesOrErr returns the Invoices value or an error if the edge was not loaded in eager-loading.

type PaymentProfileFilter

type PaymentProfileFilter struct {
	// contains filtered or unexported fields
}

PaymentProfileFilter provides a generic filtering capability at runtime for PaymentProfileQuery.

func (*PaymentProfileFilter) Where

func (f *PaymentProfileFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*PaymentProfileFilter) WhereCreatedAt

func (f *PaymentProfileFilter) WhereCreatedAt(p entql.TimeP)

WhereCreatedAt applies the entql time.Time predicate on the created_at field.

func (*PaymentProfileFilter) WhereDeletedAt

func (f *PaymentProfileFilter) WhereDeletedAt(p entql.TimeP)

WhereDeletedAt applies the entql time.Time predicate on the deleted_at field.

func (*PaymentProfileFilter) WhereEmail

func (f *PaymentProfileFilter) WhereEmail(p entql.StringP)

WhereEmail applies the entql string predicate on the email field.

func (*PaymentProfileFilter) WhereHasInvoices

func (f *PaymentProfileFilter) WhereHasInvoices()

WhereHasInvoices applies a predicate to check if query has an edge invoices.

func (*PaymentProfileFilter) WhereHasInvoicesWith

func (f *PaymentProfileFilter) WhereHasInvoicesWith(preds ...predicate.Invoice)

WhereHasInvoicesWith applies a predicate to check if query has an edge invoices with a given conditions (other predicates).

func (*PaymentProfileFilter) WhereHolder

func (f *PaymentProfileFilter) WhereHolder(p entql.StringP)

WhereHolder applies the entql string predicate on the holder field.

func (*PaymentProfileFilter) WhereID

func (f *PaymentProfileFilter) WhereID(p entql.Int64P)

WhereID applies the entql int64 predicate on the id field.

func (*PaymentProfileFilter) WherePanMasked

func (f *PaymentProfileFilter) WherePanMasked(p entql.StringP)

WherePanMasked applies the entql string predicate on the pan_masked field.

func (*PaymentProfileFilter) WherePhone

func (f *PaymentProfileFilter) WherePhone(p entql.StringP)

WherePhone applies the entql string predicate on the phone field.

func (*PaymentProfileFilter) WhereRecurrentToken

func (f *PaymentProfileFilter) WhereRecurrentToken(p entql.StringP)

WhereRecurrentToken applies the entql string predicate on the recurrent_token field.

func (*PaymentProfileFilter) WhereUpdatedAt

func (f *PaymentProfileFilter) WhereUpdatedAt(p entql.TimeP)

WhereUpdatedAt applies the entql time.Time predicate on the updated_at field.

func (*PaymentProfileFilter) WhereUserID

func (f *PaymentProfileFilter) WhereUserID(p entql.Int64P)

WhereUserID applies the entql int64 predicate on the user_id field.

func (*PaymentProfileFilter) WhereUserToken

func (f *PaymentProfileFilter) WhereUserToken(p entql.StringP)

WhereUserToken applies the entql string predicate on the user_token field.

type PaymentProfileGroupBy

type PaymentProfileGroupBy struct {
	// contains filtered or unexported fields
}

PaymentProfileGroupBy is the group-by builder for PaymentProfile entities.

func (*PaymentProfileGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*PaymentProfileGroupBy) Bool

func (s *PaymentProfileGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PaymentProfileGroupBy) BoolX

func (s *PaymentProfileGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PaymentProfileGroupBy) Bools

func (s *PaymentProfileGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PaymentProfileGroupBy) BoolsX

func (s *PaymentProfileGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PaymentProfileGroupBy) Float64

func (s *PaymentProfileGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PaymentProfileGroupBy) Float64X

func (s *PaymentProfileGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PaymentProfileGroupBy) Float64s

func (s *PaymentProfileGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PaymentProfileGroupBy) Float64sX

func (s *PaymentProfileGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PaymentProfileGroupBy) Int

func (s *PaymentProfileGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PaymentProfileGroupBy) IntX

func (s *PaymentProfileGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PaymentProfileGroupBy) Ints

func (s *PaymentProfileGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PaymentProfileGroupBy) IntsX

func (s *PaymentProfileGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PaymentProfileGroupBy) Scan

func (ppgb *PaymentProfileGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PaymentProfileGroupBy) ScanX

func (s *PaymentProfileGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PaymentProfileGroupBy) String

func (s *PaymentProfileGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PaymentProfileGroupBy) StringX

func (s *PaymentProfileGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PaymentProfileGroupBy) Strings

func (s *PaymentProfileGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PaymentProfileGroupBy) StringsX

func (s *PaymentProfileGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PaymentProfileMutation

type PaymentProfileMutation struct {
	// contains filtered or unexported fields
}

PaymentProfileMutation represents an operation that mutates the PaymentProfile nodes in the graph.

func (*PaymentProfileMutation) AddField

func (m *PaymentProfileMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*PaymentProfileMutation) AddInvoiceIDs

func (m *PaymentProfileMutation) AddInvoiceIDs(ids ...int64)

AddInvoiceIDs adds the "invoices" edge to the Invoice entity by ids.

func (*PaymentProfileMutation) AddUserID

func (m *PaymentProfileMutation) AddUserID(i int64)

AddUserID adds i to the "user_id" field.

func (*PaymentProfileMutation) AddedEdges

func (m *PaymentProfileMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PaymentProfileMutation) AddedField

func (m *PaymentProfileMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*PaymentProfileMutation) AddedFields

func (m *PaymentProfileMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PaymentProfileMutation) AddedIDs

func (m *PaymentProfileMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PaymentProfileMutation) AddedUserID

func (m *PaymentProfileMutation) AddedUserID() (r int64, exists bool)

AddedUserID returns the value that was added to the "user_id" field in this mutation.

func (*PaymentProfileMutation) ClearDeletedAt

func (m *PaymentProfileMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PaymentProfileMutation) ClearEdge

func (m *PaymentProfileMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*PaymentProfileMutation) ClearEmail

func (m *PaymentProfileMutation) ClearEmail()

ClearEmail clears the value of the "email" field.

func (*PaymentProfileMutation) ClearField

func (m *PaymentProfileMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*PaymentProfileMutation) ClearInvoices

func (m *PaymentProfileMutation) ClearInvoices()

ClearInvoices clears the "invoices" edge to the Invoice entity.

func (*PaymentProfileMutation) ClearPhone

func (m *PaymentProfileMutation) ClearPhone()

ClearPhone clears the value of the "phone" field.

func (*PaymentProfileMutation) ClearRecurrentToken

func (m *PaymentProfileMutation) ClearRecurrentToken()

ClearRecurrentToken clears the value of the "recurrent_token" field.

func (*PaymentProfileMutation) ClearUserToken

func (m *PaymentProfileMutation) ClearUserToken()

ClearUserToken clears the value of the "user_token" field.

func (*PaymentProfileMutation) ClearedEdges

func (m *PaymentProfileMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PaymentProfileMutation) ClearedFields

func (m *PaymentProfileMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PaymentProfileMutation) Client

func (m PaymentProfileMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*PaymentProfileMutation) CreatedAt

func (m *PaymentProfileMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*PaymentProfileMutation) DeletedAt

func (m *PaymentProfileMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*PaymentProfileMutation) DeletedAtCleared

func (m *PaymentProfileMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*PaymentProfileMutation) EdgeCleared

func (m *PaymentProfileMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PaymentProfileMutation) Email

func (m *PaymentProfileMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*PaymentProfileMutation) EmailCleared

func (m *PaymentProfileMutation) EmailCleared() bool

EmailCleared returns if the "email" field was cleared in this mutation.

func (*PaymentProfileMutation) Field

func (m *PaymentProfileMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*PaymentProfileMutation) FieldCleared

func (m *PaymentProfileMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PaymentProfileMutation) Fields

func (m *PaymentProfileMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*PaymentProfileMutation) Filter

Filter returns an entql.Where implementation to apply filters on the PaymentProfileMutation builder.

func (*PaymentProfileMutation) Holder

func (m *PaymentProfileMutation) Holder() (r string, exists bool)

Holder returns the value of the "holder" field in the mutation.

func (*PaymentProfileMutation) ID

func (m *PaymentProfileMutation) ID() (id int64, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*PaymentProfileMutation) IDs

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*PaymentProfileMutation) InvoicesCleared

func (m *PaymentProfileMutation) InvoicesCleared() bool

InvoicesCleared reports if the "invoices" edge to the Invoice entity was cleared.

func (*PaymentProfileMutation) InvoicesIDs

func (m *PaymentProfileMutation) InvoicesIDs() (ids []int64)

InvoicesIDs returns the "invoices" edge IDs in the mutation.

func (*PaymentProfileMutation) OldCreatedAt

func (m *PaymentProfileMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the PaymentProfile entity. If the PaymentProfile object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentProfileMutation) OldDeletedAt

func (m *PaymentProfileMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the PaymentProfile entity. If the PaymentProfile object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentProfileMutation) OldEmail

func (m *PaymentProfileMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the PaymentProfile entity. If the PaymentProfile object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentProfileMutation) OldField

func (m *PaymentProfileMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*PaymentProfileMutation) OldHolder

func (m *PaymentProfileMutation) OldHolder(ctx context.Context) (v string, err error)

OldHolder returns the old "holder" field's value of the PaymentProfile entity. If the PaymentProfile object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentProfileMutation) OldPanMasked

func (m *PaymentProfileMutation) OldPanMasked(ctx context.Context) (v string, err error)

OldPanMasked returns the old "pan_masked" field's value of the PaymentProfile entity. If the PaymentProfile object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentProfileMutation) OldPhone

func (m *PaymentProfileMutation) OldPhone(ctx context.Context) (v string, err error)

OldPhone returns the old "phone" field's value of the PaymentProfile entity. If the PaymentProfile object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentProfileMutation) OldRecurrentToken

func (m *PaymentProfileMutation) OldRecurrentToken(ctx context.Context) (v *string, err error)

OldRecurrentToken returns the old "recurrent_token" field's value of the PaymentProfile entity. If the PaymentProfile object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentProfileMutation) OldUpdatedAt

func (m *PaymentProfileMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the PaymentProfile entity. If the PaymentProfile object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentProfileMutation) OldUserID

func (m *PaymentProfileMutation) OldUserID(ctx context.Context) (v int64, err error)

OldUserID returns the old "user_id" field's value of the PaymentProfile entity. If the PaymentProfile object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentProfileMutation) OldUserToken

func (m *PaymentProfileMutation) OldUserToken(ctx context.Context) (v string, err error)

OldUserToken returns the old "user_token" field's value of the PaymentProfile entity. If the PaymentProfile object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PaymentProfileMutation) Op

func (m *PaymentProfileMutation) Op() Op

Op returns the operation name.

func (*PaymentProfileMutation) PanMasked

func (m *PaymentProfileMutation) PanMasked() (r string, exists bool)

PanMasked returns the value of the "pan_masked" field in the mutation.

func (*PaymentProfileMutation) Phone

func (m *PaymentProfileMutation) Phone() (r string, exists bool)

Phone returns the value of the "phone" field in the mutation.

func (*PaymentProfileMutation) PhoneCleared

func (m *PaymentProfileMutation) PhoneCleared() bool

PhoneCleared returns if the "phone" field was cleared in this mutation.

func (*PaymentProfileMutation) RecurrentToken

func (m *PaymentProfileMutation) RecurrentToken() (r string, exists bool)

RecurrentToken returns the value of the "recurrent_token" field in the mutation.

func (*PaymentProfileMutation) RecurrentTokenCleared

func (m *PaymentProfileMutation) RecurrentTokenCleared() bool

RecurrentTokenCleared returns if the "recurrent_token" field was cleared in this mutation.

func (*PaymentProfileMutation) RemoveInvoiceIDs

func (m *PaymentProfileMutation) RemoveInvoiceIDs(ids ...int64)

RemoveInvoiceIDs removes the "invoices" edge to the Invoice entity by IDs.

func (*PaymentProfileMutation) RemovedEdges

func (m *PaymentProfileMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PaymentProfileMutation) RemovedIDs

func (m *PaymentProfileMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*PaymentProfileMutation) RemovedInvoicesIDs

func (m *PaymentProfileMutation) RemovedInvoicesIDs() (ids []int64)

RemovedInvoices returns the removed IDs of the "invoices" edge to the Invoice entity.

func (*PaymentProfileMutation) ResetCreatedAt

func (m *PaymentProfileMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*PaymentProfileMutation) ResetDeletedAt

func (m *PaymentProfileMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*PaymentProfileMutation) ResetEdge

func (m *PaymentProfileMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*PaymentProfileMutation) ResetEmail

func (m *PaymentProfileMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*PaymentProfileMutation) ResetField

func (m *PaymentProfileMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*PaymentProfileMutation) ResetHolder

func (m *PaymentProfileMutation) ResetHolder()

ResetHolder resets all changes to the "holder" field.

func (*PaymentProfileMutation) ResetInvoices

func (m *PaymentProfileMutation) ResetInvoices()

ResetInvoices resets all changes to the "invoices" edge.

func (*PaymentProfileMutation) ResetPanMasked

func (m *PaymentProfileMutation) ResetPanMasked()

ResetPanMasked resets all changes to the "pan_masked" field.

func (*PaymentProfileMutation) ResetPhone

func (m *PaymentProfileMutation) ResetPhone()

ResetPhone resets all changes to the "phone" field.

func (*PaymentProfileMutation) ResetRecurrentToken

func (m *PaymentProfileMutation) ResetRecurrentToken()

ResetRecurrentToken resets all changes to the "recurrent_token" field.

func (*PaymentProfileMutation) ResetUpdatedAt

func (m *PaymentProfileMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*PaymentProfileMutation) ResetUserID

func (m *PaymentProfileMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*PaymentProfileMutation) ResetUserToken

func (m *PaymentProfileMutation) ResetUserToken()

ResetUserToken resets all changes to the "user_token" field.

func (*PaymentProfileMutation) SetCreatedAt

func (m *PaymentProfileMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*PaymentProfileMutation) SetDeletedAt

func (m *PaymentProfileMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*PaymentProfileMutation) SetEmail

func (m *PaymentProfileMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*PaymentProfileMutation) SetField

func (m *PaymentProfileMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*PaymentProfileMutation) SetHolder

func (m *PaymentProfileMutation) SetHolder(s string)

SetHolder sets the "holder" field.

func (*PaymentProfileMutation) SetID

func (m *PaymentProfileMutation) SetID(id int64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of PaymentProfile entities.

func (*PaymentProfileMutation) SetOp

func (m *PaymentProfileMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PaymentProfileMutation) SetPanMasked

func (m *PaymentProfileMutation) SetPanMasked(s string)

SetPanMasked sets the "pan_masked" field.

func (*PaymentProfileMutation) SetPhone

func (m *PaymentProfileMutation) SetPhone(s string)

SetPhone sets the "phone" field.

func (*PaymentProfileMutation) SetRecurrentToken

func (m *PaymentProfileMutation) SetRecurrentToken(s string)

SetRecurrentToken sets the "recurrent_token" field.

func (*PaymentProfileMutation) SetUpdatedAt

func (m *PaymentProfileMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*PaymentProfileMutation) SetUserID

func (m *PaymentProfileMutation) SetUserID(i int64)

SetUserID sets the "user_id" field.

func (*PaymentProfileMutation) SetUserToken

func (m *PaymentProfileMutation) SetUserToken(s string)

SetUserToken sets the "user_token" field.

func (PaymentProfileMutation) Tx

func (m PaymentProfileMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PaymentProfileMutation) Type

func (m *PaymentProfileMutation) Type() string

Type returns the node type of this mutation (PaymentProfile).

func (*PaymentProfileMutation) UpdatedAt

func (m *PaymentProfileMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*PaymentProfileMutation) UserID

func (m *PaymentProfileMutation) UserID() (r int64, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*PaymentProfileMutation) UserToken

func (m *PaymentProfileMutation) UserToken() (r string, exists bool)

UserToken returns the value of the "user_token" field in the mutation.

func (*PaymentProfileMutation) UserTokenCleared

func (m *PaymentProfileMutation) UserTokenCleared() bool

UserTokenCleared returns if the "user_token" field was cleared in this mutation.

func (*PaymentProfileMutation) Where

Where appends a list predicates to the PaymentProfileMutation builder.

func (*PaymentProfileMutation) WhereP

func (m *PaymentProfileMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PaymentProfileMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type PaymentProfileQuery

type PaymentProfileQuery struct {
	// contains filtered or unexported fields
}

PaymentProfileQuery is the builder for querying PaymentProfile entities.

func (*PaymentProfileQuery) Aggregate

func (ppq *PaymentProfileQuery) Aggregate(fns ...AggregateFunc) *PaymentProfileSelect

Aggregate returns a PaymentProfileSelect configured with the given aggregations.

func (*PaymentProfileQuery) All

All executes the query and returns a list of PaymentProfiles.

func (*PaymentProfileQuery) AllX

AllX is like All, but panics if an error occurs.

func (*PaymentProfileQuery) Clone

Clone returns a duplicate of the PaymentProfileQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PaymentProfileQuery) Count

func (ppq *PaymentProfileQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PaymentProfileQuery) CountX

func (ppq *PaymentProfileQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PaymentProfileQuery) Exist

func (ppq *PaymentProfileQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PaymentProfileQuery) ExistX

func (ppq *PaymentProfileQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PaymentProfileQuery) Filter

Filter returns a Filter implementation to apply filters on the PaymentProfileQuery builder.

func (*PaymentProfileQuery) First

First returns the first PaymentProfile entity from the query. Returns a *NotFoundError when no PaymentProfile was found.

func (*PaymentProfileQuery) FirstID

func (ppq *PaymentProfileQuery) FirstID(ctx context.Context) (id int64, err error)

FirstID returns the first PaymentProfile ID from the query. Returns a *NotFoundError when no PaymentProfile ID was found.

func (*PaymentProfileQuery) FirstIDX

func (ppq *PaymentProfileQuery) FirstIDX(ctx context.Context) int64

FirstIDX is like FirstID, but panics if an error occurs.

func (*PaymentProfileQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*PaymentProfileQuery) GroupBy

func (ppq *PaymentProfileQuery) GroupBy(field string, fields ...string) *PaymentProfileGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.PaymentProfile.Query().
	GroupBy(paymentprofile.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PaymentProfileQuery) IDs

func (ppq *PaymentProfileQuery) IDs(ctx context.Context) (ids []int64, err error)

IDs executes the query and returns a list of PaymentProfile IDs.

func (*PaymentProfileQuery) IDsX

func (ppq *PaymentProfileQuery) IDsX(ctx context.Context) []int64

IDsX is like IDs, but panics if an error occurs.

func (*PaymentProfileQuery) Limit

func (ppq *PaymentProfileQuery) Limit(limit int) *PaymentProfileQuery

Limit the number of records to be returned by this query.

func (*PaymentProfileQuery) Modify

func (ppq *PaymentProfileQuery) Modify(modifiers ...func(s *sql.Selector)) *PaymentProfileSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*PaymentProfileQuery) Offset

func (ppq *PaymentProfileQuery) Offset(offset int) *PaymentProfileQuery

Offset to start from.

func (*PaymentProfileQuery) Only

Only returns a single PaymentProfile entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one PaymentProfile entity is found. Returns a *NotFoundError when no PaymentProfile entities are found.

func (*PaymentProfileQuery) OnlyID

func (ppq *PaymentProfileQuery) OnlyID(ctx context.Context) (id int64, err error)

OnlyID is like Only, but returns the only PaymentProfile ID in the query. Returns a *NotSingularError when more than one PaymentProfile ID is found. Returns a *NotFoundError when no entities are found.

func (*PaymentProfileQuery) OnlyIDX

func (ppq *PaymentProfileQuery) OnlyIDX(ctx context.Context) int64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PaymentProfileQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*PaymentProfileQuery) Order

Order specifies how the records should be ordered.

func (*PaymentProfileQuery) QueryInvoices

func (ppq *PaymentProfileQuery) QueryInvoices() *InvoiceQuery

QueryInvoices chains the current query on the "invoices" edge.

func (*PaymentProfileQuery) Select

func (ppq *PaymentProfileQuery) Select(fields ...string) *PaymentProfileSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.PaymentProfile.Query().
	Select(paymentprofile.FieldCreatedAt).
	Scan(ctx, &v)

func (*PaymentProfileQuery) Unique

func (ppq *PaymentProfileQuery) Unique(unique bool) *PaymentProfileQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*PaymentProfileQuery) Where

Where adds a new predicate for the PaymentProfileQuery builder.

func (*PaymentProfileQuery) WithInvoices

func (ppq *PaymentProfileQuery) WithInvoices(opts ...func(*InvoiceQuery)) *PaymentProfileQuery

WithInvoices tells the query-builder to eager-load the nodes that are connected to the "invoices" edge. The optional arguments are used to configure the query builder of the edge.

type PaymentProfileSelect

type PaymentProfileSelect struct {
	*PaymentProfileQuery
	// contains filtered or unexported fields
}

PaymentProfileSelect is the builder for selecting fields of PaymentProfile entities.

func (*PaymentProfileSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*PaymentProfileSelect) Bool

func (s *PaymentProfileSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PaymentProfileSelect) BoolX

func (s *PaymentProfileSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PaymentProfileSelect) Bools

func (s *PaymentProfileSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PaymentProfileSelect) BoolsX

func (s *PaymentProfileSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PaymentProfileSelect) Float64

func (s *PaymentProfileSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PaymentProfileSelect) Float64X

func (s *PaymentProfileSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PaymentProfileSelect) Float64s

func (s *PaymentProfileSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PaymentProfileSelect) Float64sX

func (s *PaymentProfileSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PaymentProfileSelect) Int

func (s *PaymentProfileSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PaymentProfileSelect) IntX

func (s *PaymentProfileSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PaymentProfileSelect) Ints

func (s *PaymentProfileSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PaymentProfileSelect) IntsX

func (s *PaymentProfileSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PaymentProfileSelect) Modify

func (pps *PaymentProfileSelect) Modify(modifiers ...func(s *sql.Selector)) *PaymentProfileSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*PaymentProfileSelect) Scan

func (pps *PaymentProfileSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PaymentProfileSelect) ScanX

func (s *PaymentProfileSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PaymentProfileSelect) String

func (s *PaymentProfileSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PaymentProfileSelect) StringX

func (s *PaymentProfileSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PaymentProfileSelect) Strings

func (s *PaymentProfileSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PaymentProfileSelect) StringsX

func (s *PaymentProfileSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PaymentProfileUpdate

type PaymentProfileUpdate struct {
	// contains filtered or unexported fields
}

PaymentProfileUpdate is the builder for updating PaymentProfile entities.

func (*PaymentProfileUpdate) AddInvoiceIDs

func (ppu *PaymentProfileUpdate) AddInvoiceIDs(ids ...int64) *PaymentProfileUpdate

AddInvoiceIDs adds the "invoices" edge to the Invoice entity by IDs.

func (*PaymentProfileUpdate) AddInvoices

func (ppu *PaymentProfileUpdate) AddInvoices(i ...*Invoice) *PaymentProfileUpdate

AddInvoices adds the "invoices" edges to the Invoice entity.

func (*PaymentProfileUpdate) ClearDeletedAt

func (ppu *PaymentProfileUpdate) ClearDeletedAt() *PaymentProfileUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PaymentProfileUpdate) ClearEmail

func (ppu *PaymentProfileUpdate) ClearEmail() *PaymentProfileUpdate

ClearEmail clears the value of the "email" field.

func (*PaymentProfileUpdate) ClearInvoices

func (ppu *PaymentProfileUpdate) ClearInvoices() *PaymentProfileUpdate

ClearInvoices clears all "invoices" edges to the Invoice entity.

func (*PaymentProfileUpdate) ClearPhone

func (ppu *PaymentProfileUpdate) ClearPhone() *PaymentProfileUpdate

ClearPhone clears the value of the "phone" field.

func (*PaymentProfileUpdate) ClearRecurrentToken

func (ppu *PaymentProfileUpdate) ClearRecurrentToken() *PaymentProfileUpdate

ClearRecurrentToken clears the value of the "recurrent_token" field.

func (*PaymentProfileUpdate) ClearUserToken

func (ppu *PaymentProfileUpdate) ClearUserToken() *PaymentProfileUpdate

ClearUserToken clears the value of the "user_token" field.

func (*PaymentProfileUpdate) Exec

func (ppu *PaymentProfileUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PaymentProfileUpdate) ExecX

func (ppu *PaymentProfileUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PaymentProfileUpdate) Modify

func (ppu *PaymentProfileUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *PaymentProfileUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*PaymentProfileUpdate) Mutation

Mutation returns the PaymentProfileMutation object of the builder.

func (*PaymentProfileUpdate) RemoveInvoiceIDs

func (ppu *PaymentProfileUpdate) RemoveInvoiceIDs(ids ...int64) *PaymentProfileUpdate

RemoveInvoiceIDs removes the "invoices" edge to Invoice entities by IDs.

func (*PaymentProfileUpdate) RemoveInvoices

func (ppu *PaymentProfileUpdate) RemoveInvoices(i ...*Invoice) *PaymentProfileUpdate

RemoveInvoices removes "invoices" edges to Invoice entities.

func (*PaymentProfileUpdate) Save

func (ppu *PaymentProfileUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PaymentProfileUpdate) SaveX

func (ppu *PaymentProfileUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PaymentProfileUpdate) SetDeletedAt

func (ppu *PaymentProfileUpdate) SetDeletedAt(t time.Time) *PaymentProfileUpdate

SetDeletedAt sets the "deleted_at" field.

func (*PaymentProfileUpdate) SetEmail

SetEmail sets the "email" field.

func (*PaymentProfileUpdate) SetNillableDeletedAt

func (ppu *PaymentProfileUpdate) SetNillableDeletedAt(t *time.Time) *PaymentProfileUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*PaymentProfileUpdate) SetNillableEmail

func (ppu *PaymentProfileUpdate) SetNillableEmail(s *string) *PaymentProfileUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*PaymentProfileUpdate) SetNillablePhone

func (ppu *PaymentProfileUpdate) SetNillablePhone(s *string) *PaymentProfileUpdate

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*PaymentProfileUpdate) SetNillableRecurrentToken

func (ppu *PaymentProfileUpdate) SetNillableRecurrentToken(s *string) *PaymentProfileUpdate

SetNillableRecurrentToken sets the "recurrent_token" field if the given value is not nil.

func (*PaymentProfileUpdate) SetNillableUserToken

func (ppu *PaymentProfileUpdate) SetNillableUserToken(s *string) *PaymentProfileUpdate

SetNillableUserToken sets the "user_token" field if the given value is not nil.

func (*PaymentProfileUpdate) SetPhone

SetPhone sets the "phone" field.

func (*PaymentProfileUpdate) SetRecurrentToken

func (ppu *PaymentProfileUpdate) SetRecurrentToken(s string) *PaymentProfileUpdate

SetRecurrentToken sets the "recurrent_token" field.

func (*PaymentProfileUpdate) SetUpdatedAt

func (ppu *PaymentProfileUpdate) SetUpdatedAt(t time.Time) *PaymentProfileUpdate

SetUpdatedAt sets the "updated_at" field.

func (*PaymentProfileUpdate) SetUserToken

func (ppu *PaymentProfileUpdate) SetUserToken(s string) *PaymentProfileUpdate

SetUserToken sets the "user_token" field.

func (*PaymentProfileUpdate) Where

Where appends a list predicates to the PaymentProfileUpdate builder.

type PaymentProfileUpdateOne

type PaymentProfileUpdateOne struct {
	// contains filtered or unexported fields
}

PaymentProfileUpdateOne is the builder for updating a single PaymentProfile entity.

func (*PaymentProfileUpdateOne) AddInvoiceIDs

func (ppuo *PaymentProfileUpdateOne) AddInvoiceIDs(ids ...int64) *PaymentProfileUpdateOne

AddInvoiceIDs adds the "invoices" edge to the Invoice entity by IDs.

func (*PaymentProfileUpdateOne) AddInvoices

func (ppuo *PaymentProfileUpdateOne) AddInvoices(i ...*Invoice) *PaymentProfileUpdateOne

AddInvoices adds the "invoices" edges to the Invoice entity.

func (*PaymentProfileUpdateOne) ClearDeletedAt

func (ppuo *PaymentProfileUpdateOne) ClearDeletedAt() *PaymentProfileUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PaymentProfileUpdateOne) ClearEmail

ClearEmail clears the value of the "email" field.

func (*PaymentProfileUpdateOne) ClearInvoices

func (ppuo *PaymentProfileUpdateOne) ClearInvoices() *PaymentProfileUpdateOne

ClearInvoices clears all "invoices" edges to the Invoice entity.

func (*PaymentProfileUpdateOne) ClearPhone

ClearPhone clears the value of the "phone" field.

func (*PaymentProfileUpdateOne) ClearRecurrentToken

func (ppuo *PaymentProfileUpdateOne) ClearRecurrentToken() *PaymentProfileUpdateOne

ClearRecurrentToken clears the value of the "recurrent_token" field.

func (*PaymentProfileUpdateOne) ClearUserToken

func (ppuo *PaymentProfileUpdateOne) ClearUserToken() *PaymentProfileUpdateOne

ClearUserToken clears the value of the "user_token" field.

func (*PaymentProfileUpdateOne) Exec

func (ppuo *PaymentProfileUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PaymentProfileUpdateOne) ExecX

func (ppuo *PaymentProfileUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PaymentProfileUpdateOne) Modify

func (ppuo *PaymentProfileUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *PaymentProfileUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*PaymentProfileUpdateOne) Mutation

Mutation returns the PaymentProfileMutation object of the builder.

func (*PaymentProfileUpdateOne) RemoveInvoiceIDs

func (ppuo *PaymentProfileUpdateOne) RemoveInvoiceIDs(ids ...int64) *PaymentProfileUpdateOne

RemoveInvoiceIDs removes the "invoices" edge to Invoice entities by IDs.

func (*PaymentProfileUpdateOne) RemoveInvoices

func (ppuo *PaymentProfileUpdateOne) RemoveInvoices(i ...*Invoice) *PaymentProfileUpdateOne

RemoveInvoices removes "invoices" edges to Invoice entities.

func (*PaymentProfileUpdateOne) Save

Save executes the query and returns the updated PaymentProfile entity.

func (*PaymentProfileUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*PaymentProfileUpdateOne) Select

func (ppuo *PaymentProfileUpdateOne) Select(field string, fields ...string) *PaymentProfileUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PaymentProfileUpdateOne) SetDeletedAt

SetDeletedAt sets the "deleted_at" field.

func (*PaymentProfileUpdateOne) SetEmail

SetEmail sets the "email" field.

func (*PaymentProfileUpdateOne) SetNillableDeletedAt

func (ppuo *PaymentProfileUpdateOne) SetNillableDeletedAt(t *time.Time) *PaymentProfileUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*PaymentProfileUpdateOne) SetNillableEmail

func (ppuo *PaymentProfileUpdateOne) SetNillableEmail(s *string) *PaymentProfileUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*PaymentProfileUpdateOne) SetNillablePhone

func (ppuo *PaymentProfileUpdateOne) SetNillablePhone(s *string) *PaymentProfileUpdateOne

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*PaymentProfileUpdateOne) SetNillableRecurrentToken

func (ppuo *PaymentProfileUpdateOne) SetNillableRecurrentToken(s *string) *PaymentProfileUpdateOne

SetNillableRecurrentToken sets the "recurrent_token" field if the given value is not nil.

func (*PaymentProfileUpdateOne) SetNillableUserToken

func (ppuo *PaymentProfileUpdateOne) SetNillableUserToken(s *string) *PaymentProfileUpdateOne

SetNillableUserToken sets the "user_token" field if the given value is not nil.

func (*PaymentProfileUpdateOne) SetPhone

SetPhone sets the "phone" field.

func (*PaymentProfileUpdateOne) SetRecurrentToken

func (ppuo *PaymentProfileUpdateOne) SetRecurrentToken(s string) *PaymentProfileUpdateOne

SetRecurrentToken sets the "recurrent_token" field.

func (*PaymentProfileUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*PaymentProfileUpdateOne) SetUserToken

SetUserToken sets the "user_token" field.

func (*PaymentProfileUpdateOne) Where

Where appends a list predicates to the PaymentProfileUpdate builder.

type PaymentProfileUpsert

type PaymentProfileUpsert struct {
	*sql.UpdateSet
}

PaymentProfileUpsert is the "OnConflict" setter.

func (*PaymentProfileUpsert) ClearDeletedAt

func (u *PaymentProfileUpsert) ClearDeletedAt() *PaymentProfileUpsert

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PaymentProfileUpsert) ClearEmail

func (u *PaymentProfileUpsert) ClearEmail() *PaymentProfileUpsert

ClearEmail clears the value of the "email" field.

func (*PaymentProfileUpsert) ClearPhone

func (u *PaymentProfileUpsert) ClearPhone() *PaymentProfileUpsert

ClearPhone clears the value of the "phone" field.

func (*PaymentProfileUpsert) ClearRecurrentToken

func (u *PaymentProfileUpsert) ClearRecurrentToken() *PaymentProfileUpsert

ClearRecurrentToken clears the value of the "recurrent_token" field.

func (*PaymentProfileUpsert) ClearUserToken

func (u *PaymentProfileUpsert) ClearUserToken() *PaymentProfileUpsert

ClearUserToken clears the value of the "user_token" field.

func (*PaymentProfileUpsert) SetDeletedAt

func (u *PaymentProfileUpsert) SetDeletedAt(v time.Time) *PaymentProfileUpsert

SetDeletedAt sets the "deleted_at" field.

func (*PaymentProfileUpsert) SetEmail

SetEmail sets the "email" field.

func (*PaymentProfileUpsert) SetPhone

SetPhone sets the "phone" field.

func (*PaymentProfileUpsert) SetRecurrentToken

func (u *PaymentProfileUpsert) SetRecurrentToken(v string) *PaymentProfileUpsert

SetRecurrentToken sets the "recurrent_token" field.

func (*PaymentProfileUpsert) SetUpdatedAt

func (u *PaymentProfileUpsert) SetUpdatedAt(v time.Time) *PaymentProfileUpsert

SetUpdatedAt sets the "updated_at" field.

func (*PaymentProfileUpsert) SetUserToken

func (u *PaymentProfileUpsert) SetUserToken(v string) *PaymentProfileUpsert

SetUserToken sets the "user_token" field.

func (*PaymentProfileUpsert) UpdateDeletedAt

func (u *PaymentProfileUpsert) UpdateDeletedAt() *PaymentProfileUpsert

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*PaymentProfileUpsert) UpdateEmail

func (u *PaymentProfileUpsert) UpdateEmail() *PaymentProfileUpsert

UpdateEmail sets the "email" field to the value that was provided on create.

func (*PaymentProfileUpsert) UpdatePhone

func (u *PaymentProfileUpsert) UpdatePhone() *PaymentProfileUpsert

UpdatePhone sets the "phone" field to the value that was provided on create.

func (*PaymentProfileUpsert) UpdateRecurrentToken

func (u *PaymentProfileUpsert) UpdateRecurrentToken() *PaymentProfileUpsert

UpdateRecurrentToken sets the "recurrent_token" field to the value that was provided on create.

func (*PaymentProfileUpsert) UpdateUpdatedAt

func (u *PaymentProfileUpsert) UpdateUpdatedAt() *PaymentProfileUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*PaymentProfileUpsert) UpdateUserToken

func (u *PaymentProfileUpsert) UpdateUserToken() *PaymentProfileUpsert

UpdateUserToken sets the "user_token" field to the value that was provided on create.

type PaymentProfileUpsertBulk

type PaymentProfileUpsertBulk struct {
	// contains filtered or unexported fields
}

PaymentProfileUpsertBulk is the builder for "upsert"-ing a bulk of PaymentProfile nodes.

func (*PaymentProfileUpsertBulk) ClearDeletedAt

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PaymentProfileUpsertBulk) ClearEmail

ClearEmail clears the value of the "email" field.

func (*PaymentProfileUpsertBulk) ClearPhone

ClearPhone clears the value of the "phone" field.

func (*PaymentProfileUpsertBulk) ClearRecurrentToken

func (u *PaymentProfileUpsertBulk) ClearRecurrentToken() *PaymentProfileUpsertBulk

ClearRecurrentToken clears the value of the "recurrent_token" field.

func (*PaymentProfileUpsertBulk) ClearUserToken

ClearUserToken clears the value of the "user_token" field.

func (*PaymentProfileUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*PaymentProfileUpsertBulk) Exec

Exec executes the query.

func (*PaymentProfileUpsertBulk) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*PaymentProfileUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.PaymentProfile.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*PaymentProfileUpsertBulk) SetDeletedAt

SetDeletedAt sets the "deleted_at" field.

func (*PaymentProfileUpsertBulk) SetEmail

SetEmail sets the "email" field.

func (*PaymentProfileUpsertBulk) SetPhone

SetPhone sets the "phone" field.

func (*PaymentProfileUpsertBulk) SetRecurrentToken

func (u *PaymentProfileUpsertBulk) SetRecurrentToken(v string) *PaymentProfileUpsertBulk

SetRecurrentToken sets the "recurrent_token" field.

func (*PaymentProfileUpsertBulk) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*PaymentProfileUpsertBulk) SetUserToken

SetUserToken sets the "user_token" field.

func (*PaymentProfileUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the PaymentProfileCreateBulk.OnConflict documentation for more info.

func (*PaymentProfileUpsertBulk) UpdateDeletedAt

func (u *PaymentProfileUpsertBulk) UpdateDeletedAt() *PaymentProfileUpsertBulk

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*PaymentProfileUpsertBulk) UpdateEmail

UpdateEmail sets the "email" field to the value that was provided on create.

func (*PaymentProfileUpsertBulk) UpdateNewValues

func (u *PaymentProfileUpsertBulk) UpdateNewValues() *PaymentProfileUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.PaymentProfile.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(paymentprofile.FieldID)
		}),
	).
	Exec(ctx)

func (*PaymentProfileUpsertBulk) UpdatePhone

UpdatePhone sets the "phone" field to the value that was provided on create.

func (*PaymentProfileUpsertBulk) UpdateRecurrentToken

func (u *PaymentProfileUpsertBulk) UpdateRecurrentToken() *PaymentProfileUpsertBulk

UpdateRecurrentToken sets the "recurrent_token" field to the value that was provided on create.

func (*PaymentProfileUpsertBulk) UpdateUpdatedAt

func (u *PaymentProfileUpsertBulk) UpdateUpdatedAt() *PaymentProfileUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*PaymentProfileUpsertBulk) UpdateUserToken

func (u *PaymentProfileUpsertBulk) UpdateUserToken() *PaymentProfileUpsertBulk

UpdateUserToken sets the "user_token" field to the value that was provided on create.

type PaymentProfileUpsertOne

type PaymentProfileUpsertOne struct {
	// contains filtered or unexported fields
}

PaymentProfileUpsertOne is the builder for "upsert"-ing

one PaymentProfile node.

func (*PaymentProfileUpsertOne) ClearDeletedAt

func (u *PaymentProfileUpsertOne) ClearDeletedAt() *PaymentProfileUpsertOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PaymentProfileUpsertOne) ClearEmail

ClearEmail clears the value of the "email" field.

func (*PaymentProfileUpsertOne) ClearPhone

ClearPhone clears the value of the "phone" field.

func (*PaymentProfileUpsertOne) ClearRecurrentToken

func (u *PaymentProfileUpsertOne) ClearRecurrentToken() *PaymentProfileUpsertOne

ClearRecurrentToken clears the value of the "recurrent_token" field.

func (*PaymentProfileUpsertOne) ClearUserToken

func (u *PaymentProfileUpsertOne) ClearUserToken() *PaymentProfileUpsertOne

ClearUserToken clears the value of the "user_token" field.

func (*PaymentProfileUpsertOne) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*PaymentProfileUpsertOne) Exec

Exec executes the query.

func (*PaymentProfileUpsertOne) ExecX

func (u *PaymentProfileUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PaymentProfileUpsertOne) ID

func (u *PaymentProfileUpsertOne) ID(ctx context.Context) (id int64, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*PaymentProfileUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*PaymentProfileUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.PaymentProfile.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*PaymentProfileUpsertOne) SetDeletedAt

SetDeletedAt sets the "deleted_at" field.

func (*PaymentProfileUpsertOne) SetEmail

SetEmail sets the "email" field.

func (*PaymentProfileUpsertOne) SetPhone

SetPhone sets the "phone" field.

func (*PaymentProfileUpsertOne) SetRecurrentToken

func (u *PaymentProfileUpsertOne) SetRecurrentToken(v string) *PaymentProfileUpsertOne

SetRecurrentToken sets the "recurrent_token" field.

func (*PaymentProfileUpsertOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*PaymentProfileUpsertOne) SetUserToken

SetUserToken sets the "user_token" field.

func (*PaymentProfileUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the PaymentProfileCreate.OnConflict documentation for more info.

func (*PaymentProfileUpsertOne) UpdateDeletedAt

func (u *PaymentProfileUpsertOne) UpdateDeletedAt() *PaymentProfileUpsertOne

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*PaymentProfileUpsertOne) UpdateEmail

UpdateEmail sets the "email" field to the value that was provided on create.

func (*PaymentProfileUpsertOne) UpdateNewValues

func (u *PaymentProfileUpsertOne) UpdateNewValues() *PaymentProfileUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.PaymentProfile.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(paymentprofile.FieldID)
		}),
	).
	Exec(ctx)

func (*PaymentProfileUpsertOne) UpdatePhone

UpdatePhone sets the "phone" field to the value that was provided on create.

func (*PaymentProfileUpsertOne) UpdateRecurrentToken

func (u *PaymentProfileUpsertOne) UpdateRecurrentToken() *PaymentProfileUpsertOne

UpdateRecurrentToken sets the "recurrent_token" field to the value that was provided on create.

func (*PaymentProfileUpsertOne) UpdateUpdatedAt

func (u *PaymentProfileUpsertOne) UpdateUpdatedAt() *PaymentProfileUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*PaymentProfileUpsertOne) UpdateUserToken

func (u *PaymentProfileUpsertOne) UpdateUserToken() *PaymentProfileUpsertOne

UpdateUserToken sets the "user_token" field to the value that was provided on create.

type PaymentProfiles

type PaymentProfiles []*PaymentProfile

PaymentProfiles is a parsable slice of PaymentProfile.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Product

type Product struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// AppID holds the value of the "app_id" field.
	AppID string `json:"app_id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Price holds the value of the "price" field.
	Price decimal.Decimal `json:"price,omitempty"`
	// Currency holds the value of the "currency" field.
	Currency string `json:"currency,omitempty"`
	// Indicates that this product is active.
	IsActive bool `json:"is_active,omitempty"`
	// Indicates that this product is limited.
	IsLimited bool `json:"is_limited,omitempty"`
	// End of limited period.
	LimitedTill *time.Time `json:"limited_till,omitempty"`
	// Number of items left in stock.
	Left int64 `json:"left,omitempty"`
	// Indicates that this product can only be limited amount of times.
	IsUnique bool `json:"is_unique,omitempty"`
	// Number of times this product can be purchased.
	UniqueLimit int64 `json:"unique_limit,omitempty"`
	// Indicates that this product requires renewal.
	IsExpiring bool `json:"is_expiring,omitempty"`
	// Time when this product expires.
	ExpiringTime *time.Time `json:"expiring_time,omitempty"`
	// Payment model for this product.
	PaymentModel enum.PaymentModel `json:"payment_model,omitempty"`
	// Period of product.
	ProductPeriod enum.ProductPeriod `json:"product_period,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ProductQuery when eager-loading is set.
	Edges ProductEdges `json:"edges"`
	// contains filtered or unexported fields
}

Product is the model entity for the Product schema.

func (*Product) QueryBundles

func (pr *Product) QueryBundles() *BundleQuery

QueryBundles queries the "bundles" edge of the Product entity.

func (*Product) QueryInvoices

func (pr *Product) QueryInvoices() *InvoiceQuery

QueryInvoices queries the "invoices" edge of the Product entity.

func (*Product) QueryReservations

func (pr *Product) QueryReservations() *ProductReservationQuery

QueryReservations queries the "reservations" edge of the Product entity.

func (*Product) QuerySubscriptions

func (pr *Product) QuerySubscriptions() *SubscriptionsQuery

QuerySubscriptions queries the "subscriptions" edge of the Product entity.

func (*Product) String

func (pr *Product) String() string

String implements the fmt.Stringer.

func (*Product) Unwrap

func (pr *Product) Unwrap() *Product

Unwrap unwraps the Product entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Product) Update

func (pr *Product) Update() *ProductUpdateOne

Update returns a builder for updating this Product. Note that you need to call Product.Unwrap() before calling this method if this Product was returned from a transaction, and the transaction was committed or rolled back.

func (*Product) Value

func (pr *Product) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Product. This includes values selected through modifiers, order, etc.

type ProductClient

type ProductClient struct {
	// contains filtered or unexported fields
}

ProductClient is a client for the Product schema.

func NewProductClient

func NewProductClient(c config) *ProductClient

NewProductClient returns a client for the Product from the given config.

func (*ProductClient) Create

func (c *ProductClient) Create() *ProductCreate

Create returns a builder for creating a Product entity.

func (*ProductClient) CreateBulk

func (c *ProductClient) CreateBulk(builders ...*ProductCreate) *ProductCreateBulk

CreateBulk returns a builder for creating a bulk of Product entities.

func (*ProductClient) Delete

func (c *ProductClient) Delete() *ProductDelete

Delete returns a delete builder for Product.

func (*ProductClient) DeleteOne

func (c *ProductClient) DeleteOne(pr *Product) *ProductDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ProductClient) DeleteOneID

func (c *ProductClient) DeleteOneID(id int64) *ProductDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ProductClient) Get

func (c *ProductClient) Get(ctx context.Context, id int64) (*Product, error)

Get returns a Product entity by its id.

func (*ProductClient) GetX

func (c *ProductClient) GetX(ctx context.Context, id int64) *Product

GetX is like Get, but panics if an error occurs.

func (*ProductClient) Hooks

func (c *ProductClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ProductClient) Intercept

func (c *ProductClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `product.Intercept(f(g(h())))`.

func (*ProductClient) Interceptors

func (c *ProductClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ProductClient) MapCreateBulk

func (c *ProductClient) MapCreateBulk(slice any, setFunc func(*ProductCreate, int)) *ProductCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*ProductClient) Query

func (c *ProductClient) Query() *ProductQuery

Query returns a query builder for Product.

func (*ProductClient) QueryBundles

func (c *ProductClient) QueryBundles(pr *Product) *BundleQuery

QueryBundles queries the bundles edge of a Product.

func (*ProductClient) QueryInvoices

func (c *ProductClient) QueryInvoices(pr *Product) *InvoiceQuery

QueryInvoices queries the invoices edge of a Product.

func (*ProductClient) QueryReservations

func (c *ProductClient) QueryReservations(pr *Product) *ProductReservationQuery

QueryReservations queries the reservations edge of a Product.

func (*ProductClient) QuerySubscriptions

func (c *ProductClient) QuerySubscriptions(pr *Product) *SubscriptionsQuery

QuerySubscriptions queries the subscriptions edge of a Product.

func (*ProductClient) Update

func (c *ProductClient) Update() *ProductUpdate

Update returns an update builder for Product.

func (*ProductClient) UpdateOne

func (c *ProductClient) UpdateOne(pr *Product) *ProductUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ProductClient) UpdateOneID

func (c *ProductClient) UpdateOneID(id int64) *ProductUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ProductClient) Use

func (c *ProductClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `product.Hooks(f(g(h())))`.

type ProductCreate

type ProductCreate struct {
	// contains filtered or unexported fields
}

ProductCreate is the builder for creating a Product entity.

func (*ProductCreate) AddBundleIDs

func (pc *ProductCreate) AddBundleIDs(ids ...int64) *ProductCreate

AddBundleIDs adds the "bundles" edge to the Bundle entity by IDs.

func (*ProductCreate) AddBundles

func (pc *ProductCreate) AddBundles(b ...*Bundle) *ProductCreate

AddBundles adds the "bundles" edges to the Bundle entity.

func (*ProductCreate) AddInvoiceIDs

func (pc *ProductCreate) AddInvoiceIDs(ids ...int64) *ProductCreate

AddInvoiceIDs adds the "invoices" edge to the Invoice entity by IDs.

func (*ProductCreate) AddInvoices

func (pc *ProductCreate) AddInvoices(i ...*Invoice) *ProductCreate

AddInvoices adds the "invoices" edges to the Invoice entity.

func (*ProductCreate) AddReservationIDs

func (pc *ProductCreate) AddReservationIDs(ids ...int64) *ProductCreate

AddReservationIDs adds the "reservations" edge to the ProductReservation entity by IDs.

func (*ProductCreate) AddReservations

func (pc *ProductCreate) AddReservations(p ...*ProductReservation) *ProductCreate

AddReservations adds the "reservations" edges to the ProductReservation entity.

func (*ProductCreate) AddSubscriptionIDs

func (pc *ProductCreate) AddSubscriptionIDs(ids ...int64) *ProductCreate

AddSubscriptionIDs adds the "subscriptions" edge to the Subscriptions entity by IDs.

func (*ProductCreate) AddSubscriptions

func (pc *ProductCreate) AddSubscriptions(s ...*Subscriptions) *ProductCreate

AddSubscriptions adds the "subscriptions" edges to the Subscriptions entity.

func (*ProductCreate) Exec

func (pc *ProductCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductCreate) ExecX

func (pc *ProductCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductCreate) Mutation

func (pc *ProductCreate) Mutation() *ProductMutation

Mutation returns the ProductMutation object of the builder.

func (*ProductCreate) OnConflict

func (pc *ProductCreate) OnConflict(opts ...sql.ConflictOption) *ProductUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Product.Create().
	SetCreatedAt(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.ProductUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*ProductCreate) OnConflictColumns

func (pc *ProductCreate) OnConflictColumns(columns ...string) *ProductUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Product.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*ProductCreate) Save

func (pc *ProductCreate) Save(ctx context.Context) (*Product, error)

Save creates the Product in the database.

func (*ProductCreate) SaveX

func (pc *ProductCreate) SaveX(ctx context.Context) *Product

SaveX calls Save and panics if Save returns an error.

func (*ProductCreate) SetAppID

func (pc *ProductCreate) SetAppID(s string) *ProductCreate

SetAppID sets the "app_id" field.

func (*ProductCreate) SetCreatedAt

func (pc *ProductCreate) SetCreatedAt(t time.Time) *ProductCreate

SetCreatedAt sets the "created_at" field.

func (*ProductCreate) SetCurrency

func (pc *ProductCreate) SetCurrency(s string) *ProductCreate

SetCurrency sets the "currency" field.

func (*ProductCreate) SetDeletedAt

func (pc *ProductCreate) SetDeletedAt(t time.Time) *ProductCreate

SetDeletedAt sets the "deleted_at" field.

func (*ProductCreate) SetDescription

func (pc *ProductCreate) SetDescription(s string) *ProductCreate

SetDescription sets the "description" field.

func (*ProductCreate) SetExpiringTime

func (pc *ProductCreate) SetExpiringTime(t time.Time) *ProductCreate

SetExpiringTime sets the "expiring_time" field.

func (*ProductCreate) SetID

func (pc *ProductCreate) SetID(i int64) *ProductCreate

SetID sets the "id" field.

func (*ProductCreate) SetIsActive

func (pc *ProductCreate) SetIsActive(b bool) *ProductCreate

SetIsActive sets the "is_active" field.

func (*ProductCreate) SetIsExpiring

func (pc *ProductCreate) SetIsExpiring(b bool) *ProductCreate

SetIsExpiring sets the "is_expiring" field.

func (*ProductCreate) SetIsLimited

func (pc *ProductCreate) SetIsLimited(b bool) *ProductCreate

SetIsLimited sets the "is_limited" field.

func (*ProductCreate) SetIsUnique

func (pc *ProductCreate) SetIsUnique(b bool) *ProductCreate

SetIsUnique sets the "is_unique" field.

func (*ProductCreate) SetLeft

func (pc *ProductCreate) SetLeft(i int64) *ProductCreate

SetLeft sets the "left" field.

func (*ProductCreate) SetLimitedTill

func (pc *ProductCreate) SetLimitedTill(t time.Time) *ProductCreate

SetLimitedTill sets the "limited_till" field.

func (*ProductCreate) SetName

func (pc *ProductCreate) SetName(s string) *ProductCreate

SetName sets the "name" field.

func (*ProductCreate) SetNillableCreatedAt

func (pc *ProductCreate) SetNillableCreatedAt(t *time.Time) *ProductCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ProductCreate) SetNillableCurrency

func (pc *ProductCreate) SetNillableCurrency(s *string) *ProductCreate

SetNillableCurrency sets the "currency" field if the given value is not nil.

func (*ProductCreate) SetNillableDeletedAt

func (pc *ProductCreate) SetNillableDeletedAt(t *time.Time) *ProductCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*ProductCreate) SetNillableExpiringTime

func (pc *ProductCreate) SetNillableExpiringTime(t *time.Time) *ProductCreate

SetNillableExpiringTime sets the "expiring_time" field if the given value is not nil.

func (*ProductCreate) SetNillableIsActive

func (pc *ProductCreate) SetNillableIsActive(b *bool) *ProductCreate

SetNillableIsActive sets the "is_active" field if the given value is not nil.

func (*ProductCreate) SetNillableIsExpiring

func (pc *ProductCreate) SetNillableIsExpiring(b *bool) *ProductCreate

SetNillableIsExpiring sets the "is_expiring" field if the given value is not nil.

func (*ProductCreate) SetNillableIsLimited

func (pc *ProductCreate) SetNillableIsLimited(b *bool) *ProductCreate

SetNillableIsLimited sets the "is_limited" field if the given value is not nil.

func (*ProductCreate) SetNillableIsUnique

func (pc *ProductCreate) SetNillableIsUnique(b *bool) *ProductCreate

SetNillableIsUnique sets the "is_unique" field if the given value is not nil.

func (*ProductCreate) SetNillableLeft

func (pc *ProductCreate) SetNillableLeft(i *int64) *ProductCreate

SetNillableLeft sets the "left" field if the given value is not nil.

func (*ProductCreate) SetNillableLimitedTill

func (pc *ProductCreate) SetNillableLimitedTill(t *time.Time) *ProductCreate

SetNillableLimitedTill sets the "limited_till" field if the given value is not nil.

func (*ProductCreate) SetNillablePaymentModel

func (pc *ProductCreate) SetNillablePaymentModel(em *enum.PaymentModel) *ProductCreate

SetNillablePaymentModel sets the "payment_model" field if the given value is not nil.

func (*ProductCreate) SetNillableProductPeriod

func (pc *ProductCreate) SetNillableProductPeriod(ep *enum.ProductPeriod) *ProductCreate

SetNillableProductPeriod sets the "product_period" field if the given value is not nil.

func (*ProductCreate) SetNillableUniqueLimit

func (pc *ProductCreate) SetNillableUniqueLimit(i *int64) *ProductCreate

SetNillableUniqueLimit sets the "unique_limit" field if the given value is not nil.

func (*ProductCreate) SetNillableUpdatedAt

func (pc *ProductCreate) SetNillableUpdatedAt(t *time.Time) *ProductCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*ProductCreate) SetPaymentModel

func (pc *ProductCreate) SetPaymentModel(em enum.PaymentModel) *ProductCreate

SetPaymentModel sets the "payment_model" field.

func (*ProductCreate) SetPrice

func (pc *ProductCreate) SetPrice(d decimal.Decimal) *ProductCreate

SetPrice sets the "price" field.

func (*ProductCreate) SetProductPeriod

func (pc *ProductCreate) SetProductPeriod(ep enum.ProductPeriod) *ProductCreate

SetProductPeriod sets the "product_period" field.

func (*ProductCreate) SetUniqueLimit

func (pc *ProductCreate) SetUniqueLimit(i int64) *ProductCreate

SetUniqueLimit sets the "unique_limit" field.

func (*ProductCreate) SetUpdatedAt

func (pc *ProductCreate) SetUpdatedAt(t time.Time) *ProductCreate

SetUpdatedAt sets the "updated_at" field.

type ProductCreateBulk

type ProductCreateBulk struct {
	// contains filtered or unexported fields
}

ProductCreateBulk is the builder for creating many Product entities in bulk.

func (*ProductCreateBulk) Exec

func (pcb *ProductCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductCreateBulk) ExecX

func (pcb *ProductCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductCreateBulk) OnConflict

func (pcb *ProductCreateBulk) OnConflict(opts ...sql.ConflictOption) *ProductUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Product.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.ProductUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*ProductCreateBulk) OnConflictColumns

func (pcb *ProductCreateBulk) OnConflictColumns(columns ...string) *ProductUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Product.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*ProductCreateBulk) Save

func (pcb *ProductCreateBulk) Save(ctx context.Context) ([]*Product, error)

Save creates the Product entities in the database.

func (*ProductCreateBulk) SaveX

func (pcb *ProductCreateBulk) SaveX(ctx context.Context) []*Product

SaveX is like Save, but panics if an error occurs.

type ProductDelete

type ProductDelete struct {
	// contains filtered or unexported fields
}

ProductDelete is the builder for deleting a Product entity.

func (*ProductDelete) Exec

func (pd *ProductDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ProductDelete) ExecX

func (pd *ProductDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ProductDelete) Where

func (pd *ProductDelete) Where(ps ...predicate.Product) *ProductDelete

Where appends a list predicates to the ProductDelete builder.

type ProductDeleteOne

type ProductDeleteOne struct {
	// contains filtered or unexported fields
}

ProductDeleteOne is the builder for deleting a single Product entity.

func (*ProductDeleteOne) Exec

func (pdo *ProductDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ProductDeleteOne) ExecX

func (pdo *ProductDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductDeleteOne) Where

Where appends a list predicates to the ProductDelete builder.

type ProductEdges

type ProductEdges struct {
	// Invoices holds the value of the invoices edge.
	Invoices []*Invoice `json:"invoices,omitempty"`
	// Subscriptions holds the value of the subscriptions edge.
	Subscriptions []*Subscriptions `json:"subscriptions,omitempty"`
	// Bundles holds the value of the bundles edge.
	Bundles []*Bundle `json:"bundles,omitempty"`
	// Reservations holds the value of the reservations edge.
	Reservations []*ProductReservation `json:"reservations,omitempty"`
	// contains filtered or unexported fields
}

ProductEdges holds the relations/edges for other nodes in the graph.

func (ProductEdges) BundlesOrErr

func (e ProductEdges) BundlesOrErr() ([]*Bundle, error)

BundlesOrErr returns the Bundles value or an error if the edge was not loaded in eager-loading.

func (ProductEdges) InvoicesOrErr

func (e ProductEdges) InvoicesOrErr() ([]*Invoice, error)

InvoicesOrErr returns the Invoices value or an error if the edge was not loaded in eager-loading.

func (ProductEdges) ReservationsOrErr

func (e ProductEdges) ReservationsOrErr() ([]*ProductReservation, error)

ReservationsOrErr returns the Reservations value or an error if the edge was not loaded in eager-loading.

func (ProductEdges) SubscriptionsOrErr

func (e ProductEdges) SubscriptionsOrErr() ([]*Subscriptions, error)

SubscriptionsOrErr returns the Subscriptions value or an error if the edge was not loaded in eager-loading.

type ProductFilter

type ProductFilter struct {
	// contains filtered or unexported fields
}

ProductFilter provides a generic filtering capability at runtime for ProductQuery.

func (*ProductFilter) Where

func (f *ProductFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*ProductFilter) WhereAppID

func (f *ProductFilter) WhereAppID(p entql.StringP)

WhereAppID applies the entql string predicate on the app_id field.

func (*ProductFilter) WhereCreatedAt

func (f *ProductFilter) WhereCreatedAt(p entql.TimeP)

WhereCreatedAt applies the entql time.Time predicate on the created_at field.

func (*ProductFilter) WhereCurrency

func (f *ProductFilter) WhereCurrency(p entql.StringP)

WhereCurrency applies the entql string predicate on the currency field.

func (*ProductFilter) WhereDeletedAt

func (f *ProductFilter) WhereDeletedAt(p entql.TimeP)

WhereDeletedAt applies the entql time.Time predicate on the deleted_at field.

func (*ProductFilter) WhereDescription

func (f *ProductFilter) WhereDescription(p entql.StringP)

WhereDescription applies the entql string predicate on the description field.

func (*ProductFilter) WhereExpiringTime

func (f *ProductFilter) WhereExpiringTime(p entql.TimeP)

WhereExpiringTime applies the entql time.Time predicate on the expiring_time field.

func (*ProductFilter) WhereHasBundles

func (f *ProductFilter) WhereHasBundles()

WhereHasBundles applies a predicate to check if query has an edge bundles.

func (*ProductFilter) WhereHasBundlesWith

func (f *ProductFilter) WhereHasBundlesWith(preds ...predicate.Bundle)

WhereHasBundlesWith applies a predicate to check if query has an edge bundles with a given conditions (other predicates).

func (*ProductFilter) WhereHasInvoices

func (f *ProductFilter) WhereHasInvoices()

WhereHasInvoices applies a predicate to check if query has an edge invoices.

func (*ProductFilter) WhereHasInvoicesWith

func (f *ProductFilter) WhereHasInvoicesWith(preds ...predicate.Invoice)

WhereHasInvoicesWith applies a predicate to check if query has an edge invoices with a given conditions (other predicates).

func (*ProductFilter) WhereHasReservations

func (f *ProductFilter) WhereHasReservations()

WhereHasReservations applies a predicate to check if query has an edge reservations.

func (*ProductFilter) WhereHasReservationsWith

func (f *ProductFilter) WhereHasReservationsWith(preds ...predicate.ProductReservation)

WhereHasReservationsWith applies a predicate to check if query has an edge reservations with a given conditions (other predicates).

func (*ProductFilter) WhereHasSubscriptions

func (f *ProductFilter) WhereHasSubscriptions()

WhereHasSubscriptions applies a predicate to check if query has an edge subscriptions.

func (*ProductFilter) WhereHasSubscriptionsWith

func (f *ProductFilter) WhereHasSubscriptionsWith(preds ...predicate.Subscriptions)

WhereHasSubscriptionsWith applies a predicate to check if query has an edge subscriptions with a given conditions (other predicates).

func (*ProductFilter) WhereID

func (f *ProductFilter) WhereID(p entql.Int64P)

WhereID applies the entql int64 predicate on the id field.

func (*ProductFilter) WhereIsActive

func (f *ProductFilter) WhereIsActive(p entql.BoolP)

WhereIsActive applies the entql bool predicate on the is_active field.

func (*ProductFilter) WhereIsExpiring

func (f *ProductFilter) WhereIsExpiring(p entql.BoolP)

WhereIsExpiring applies the entql bool predicate on the is_expiring field.

func (*ProductFilter) WhereIsLimited

func (f *ProductFilter) WhereIsLimited(p entql.BoolP)

WhereIsLimited applies the entql bool predicate on the is_limited field.

func (*ProductFilter) WhereIsUnique

func (f *ProductFilter) WhereIsUnique(p entql.BoolP)

WhereIsUnique applies the entql bool predicate on the is_unique field.

func (*ProductFilter) WhereLeft

func (f *ProductFilter) WhereLeft(p entql.Int64P)

WhereLeft applies the entql int64 predicate on the left field.

func (*ProductFilter) WhereLimitedTill

func (f *ProductFilter) WhereLimitedTill(p entql.TimeP)

WhereLimitedTill applies the entql time.Time predicate on the limited_till field.

func (*ProductFilter) WhereName

func (f *ProductFilter) WhereName(p entql.StringP)

WhereName applies the entql string predicate on the name field.

func (*ProductFilter) WherePaymentModel

func (f *ProductFilter) WherePaymentModel(p entql.StringP)

WherePaymentModel applies the entql string predicate on the payment_model field.

func (*ProductFilter) WherePrice

func (f *ProductFilter) WherePrice(p entql.Float64P)

WherePrice applies the entql float64 predicate on the price field.

func (*ProductFilter) WhereProductPeriod

func (f *ProductFilter) WhereProductPeriod(p entql.StringP)

WhereProductPeriod applies the entql string predicate on the product_period field.

func (*ProductFilter) WhereUniqueLimit

func (f *ProductFilter) WhereUniqueLimit(p entql.Int64P)

WhereUniqueLimit applies the entql int64 predicate on the unique_limit field.

func (*ProductFilter) WhereUpdatedAt

func (f *ProductFilter) WhereUpdatedAt(p entql.TimeP)

WhereUpdatedAt applies the entql time.Time predicate on the updated_at field.

type ProductGroupBy

type ProductGroupBy struct {
	// contains filtered or unexported fields
}

ProductGroupBy is the group-by builder for Product entities.

func (*ProductGroupBy) Aggregate

func (pgb *ProductGroupBy) Aggregate(fns ...AggregateFunc) *ProductGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ProductGroupBy) Bool

func (s *ProductGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) BoolX

func (s *ProductGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ProductGroupBy) Bools

func (s *ProductGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) BoolsX

func (s *ProductGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ProductGroupBy) Float64

func (s *ProductGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) Float64X

func (s *ProductGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ProductGroupBy) Float64s

func (s *ProductGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) Float64sX

func (s *ProductGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ProductGroupBy) Int

func (s *ProductGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) IntX

func (s *ProductGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ProductGroupBy) Ints

func (s *ProductGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) IntsX

func (s *ProductGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ProductGroupBy) Scan

func (pgb *ProductGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ProductGroupBy) ScanX

func (s *ProductGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ProductGroupBy) String

func (s *ProductGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) StringX

func (s *ProductGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ProductGroupBy) Strings

func (s *ProductGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) StringsX

func (s *ProductGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ProductMutation

type ProductMutation struct {
	// contains filtered or unexported fields
}

ProductMutation represents an operation that mutates the Product nodes in the graph.

func (*ProductMutation) AddBundleIDs

func (m *ProductMutation) AddBundleIDs(ids ...int64)

AddBundleIDs adds the "bundles" edge to the Bundle entity by ids.

func (*ProductMutation) AddField

func (m *ProductMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ProductMutation) AddInvoiceIDs

func (m *ProductMutation) AddInvoiceIDs(ids ...int64)

AddInvoiceIDs adds the "invoices" edge to the Invoice entity by ids.

func (*ProductMutation) AddLeft

func (m *ProductMutation) AddLeft(i int64)

AddLeft adds i to the "left" field.

func (*ProductMutation) AddPrice

func (m *ProductMutation) AddPrice(d decimal.Decimal)

AddPrice adds d to the "price" field.

func (*ProductMutation) AddReservationIDs

func (m *ProductMutation) AddReservationIDs(ids ...int64)

AddReservationIDs adds the "reservations" edge to the ProductReservation entity by ids.

func (*ProductMutation) AddSubscriptionIDs

func (m *ProductMutation) AddSubscriptionIDs(ids ...int64)

AddSubscriptionIDs adds the "subscriptions" edge to the Subscriptions entity by ids.

func (*ProductMutation) AddUniqueLimit

func (m *ProductMutation) AddUniqueLimit(i int64)

AddUniqueLimit adds i to the "unique_limit" field.

func (*ProductMutation) AddedEdges

func (m *ProductMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ProductMutation) AddedField

func (m *ProductMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ProductMutation) AddedFields

func (m *ProductMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ProductMutation) AddedIDs

func (m *ProductMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ProductMutation) AddedLeft

func (m *ProductMutation) AddedLeft() (r int64, exists bool)

AddedLeft returns the value that was added to the "left" field in this mutation.

func (*ProductMutation) AddedPrice

func (m *ProductMutation) AddedPrice() (r decimal.Decimal, exists bool)

AddedPrice returns the value that was added to the "price" field in this mutation.

func (*ProductMutation) AddedUniqueLimit

func (m *ProductMutation) AddedUniqueLimit() (r int64, exists bool)

AddedUniqueLimit returns the value that was added to the "unique_limit" field in this mutation.

func (*ProductMutation) AppID

func (m *ProductMutation) AppID() (r string, exists bool)

AppID returns the value of the "app_id" field in the mutation.

func (*ProductMutation) BundlesCleared

func (m *ProductMutation) BundlesCleared() bool

BundlesCleared reports if the "bundles" edge to the Bundle entity was cleared.

func (*ProductMutation) BundlesIDs

func (m *ProductMutation) BundlesIDs() (ids []int64)

BundlesIDs returns the "bundles" edge IDs in the mutation.

func (*ProductMutation) ClearBundles

func (m *ProductMutation) ClearBundles()

ClearBundles clears the "bundles" edge to the Bundle entity.

func (*ProductMutation) ClearDeletedAt

func (m *ProductMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*ProductMutation) ClearEdge

func (m *ProductMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*ProductMutation) ClearExpiringTime

func (m *ProductMutation) ClearExpiringTime()

ClearExpiringTime clears the value of the "expiring_time" field.

func (*ProductMutation) ClearField

func (m *ProductMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*ProductMutation) ClearInvoices

func (m *ProductMutation) ClearInvoices()

ClearInvoices clears the "invoices" edge to the Invoice entity.

func (*ProductMutation) ClearIsExpiring

func (m *ProductMutation) ClearIsExpiring()

ClearIsExpiring clears the value of the "is_expiring" field.

func (*ProductMutation) ClearIsUnique

func (m *ProductMutation) ClearIsUnique()

ClearIsUnique clears the value of the "is_unique" field.

func (*ProductMutation) ClearLimitedTill

func (m *ProductMutation) ClearLimitedTill()

ClearLimitedTill clears the value of the "limited_till" field.

func (*ProductMutation) ClearReservations

func (m *ProductMutation) ClearReservations()

ClearReservations clears the "reservations" edge to the ProductReservation entity.

func (*ProductMutation) ClearSubscriptions

func (m *ProductMutation) ClearSubscriptions()

ClearSubscriptions clears the "subscriptions" edge to the Subscriptions entity.

func (*ProductMutation) ClearedEdges

func (m *ProductMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ProductMutation) ClearedFields

func (m *ProductMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ProductMutation) Client

func (m ProductMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*ProductMutation) CreatedAt

func (m *ProductMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ProductMutation) Currency

func (m *ProductMutation) Currency() (r string, exists bool)

Currency returns the value of the "currency" field in the mutation.

func (*ProductMutation) DeletedAt

func (m *ProductMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*ProductMutation) DeletedAtCleared

func (m *ProductMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*ProductMutation) Description

func (m *ProductMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*ProductMutation) EdgeCleared

func (m *ProductMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ProductMutation) ExpiringTime

func (m *ProductMutation) ExpiringTime() (r time.Time, exists bool)

ExpiringTime returns the value of the "expiring_time" field in the mutation.

func (*ProductMutation) ExpiringTimeCleared

func (m *ProductMutation) ExpiringTimeCleared() bool

ExpiringTimeCleared returns if the "expiring_time" field was cleared in this mutation.

func (*ProductMutation) Field

func (m *ProductMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ProductMutation) FieldCleared

func (m *ProductMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ProductMutation) Fields

func (m *ProductMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*ProductMutation) Filter

func (m *ProductMutation) Filter() *ProductFilter

Filter returns an entql.Where implementation to apply filters on the ProductMutation builder.

func (*ProductMutation) ID

func (m *ProductMutation) ID() (id int64, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*ProductMutation) IDs

func (m *ProductMutation) IDs(ctx context.Context) ([]int64, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*ProductMutation) InvoicesCleared

func (m *ProductMutation) InvoicesCleared() bool

InvoicesCleared reports if the "invoices" edge to the Invoice entity was cleared.

func (*ProductMutation) InvoicesIDs

func (m *ProductMutation) InvoicesIDs() (ids []int64)

InvoicesIDs returns the "invoices" edge IDs in the mutation.

func (*ProductMutation) IsActive

func (m *ProductMutation) IsActive() (r bool, exists bool)

IsActive returns the value of the "is_active" field in the mutation.

func (*ProductMutation) IsExpiring

func (m *ProductMutation) IsExpiring() (r bool, exists bool)

IsExpiring returns the value of the "is_expiring" field in the mutation.

func (*ProductMutation) IsExpiringCleared

func (m *ProductMutation) IsExpiringCleared() bool

IsExpiringCleared returns if the "is_expiring" field was cleared in this mutation.

func (*ProductMutation) IsLimited

func (m *ProductMutation) IsLimited() (r bool, exists bool)

IsLimited returns the value of the "is_limited" field in the mutation.

func (*ProductMutation) IsUnique

func (m *ProductMutation) IsUnique() (r bool, exists bool)

IsUnique returns the value of the "is_unique" field in the mutation.

func (*ProductMutation) IsUniqueCleared

func (m *ProductMutation) IsUniqueCleared() bool

IsUniqueCleared returns if the "is_unique" field was cleared in this mutation.

func (*ProductMutation) Left

func (m *ProductMutation) Left() (r int64, exists bool)

Left returns the value of the "left" field in the mutation.

func (*ProductMutation) LimitedTill

func (m *ProductMutation) LimitedTill() (r time.Time, exists bool)

LimitedTill returns the value of the "limited_till" field in the mutation.

func (*ProductMutation) LimitedTillCleared

func (m *ProductMutation) LimitedTillCleared() bool

LimitedTillCleared returns if the "limited_till" field was cleared in this mutation.

func (*ProductMutation) Name

func (m *ProductMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*ProductMutation) OldAppID

func (m *ProductMutation) OldAppID(ctx context.Context) (v string, err error)

OldAppID returns the old "app_id" field's value of the Product entity. If the Product object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProductMutation) OldCreatedAt

func (m *ProductMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Product entity. If the Product object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProductMutation) OldCurrency

func (m *ProductMutation) OldCurrency(ctx context.Context) (v string, err error)

OldCurrency returns the old "currency" field's value of the Product entity. If the Product object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProductMutation) OldDeletedAt

func (m *ProductMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Product entity. If the Product object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProductMutation) OldDescription

func (m *ProductMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Product entity. If the Product object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProductMutation) OldExpiringTime

func (m *ProductMutation) OldExpiringTime(ctx context.Context) (v *time.Time, err error)

OldExpiringTime returns the old "expiring_time" field's value of the Product entity. If the Product object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProductMutation) OldField

func (m *ProductMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*ProductMutation) OldIsActive

func (m *ProductMutation) OldIsActive(ctx context.Context) (v bool, err error)

OldIsActive returns the old "is_active" field's value of the Product entity. If the Product object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProductMutation) OldIsExpiring

func (m *ProductMutation) OldIsExpiring(ctx context.Context) (v bool, err error)

OldIsExpiring returns the old "is_expiring" field's value of the Product entity. If the Product object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProductMutation) OldIsLimited

func (m *ProductMutation) OldIsLimited(ctx context.Context) (v bool, err error)

OldIsLimited returns the old "is_limited" field's value of the Product entity. If the Product object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProductMutation) OldIsUnique

func (m *ProductMutation) OldIsUnique(ctx context.Context) (v bool, err error)

OldIsUnique returns the old "is_unique" field's value of the Product entity. If the Product object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProductMutation) OldLeft

func (m *ProductMutation) OldLeft(ctx context.Context) (v int64, err error)

OldLeft returns the old "left" field's value of the Product entity. If the Product object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProductMutation) OldLimitedTill

func (m *ProductMutation) OldLimitedTill(ctx context.Context) (v *time.Time, err error)

OldLimitedTill returns the old "limited_till" field's value of the Product entity. If the Product object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProductMutation) OldName

func (m *ProductMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Product entity. If the Product object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProductMutation) OldPaymentModel

func (m *ProductMutation) OldPaymentModel(ctx context.Context) (v enum.PaymentModel, err error)

OldPaymentModel returns the old "payment_model" field's value of the Product entity. If the Product object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProductMutation) OldPrice

func (m *ProductMutation) OldPrice(ctx context.Context) (v decimal.Decimal, err error)

OldPrice returns the old "price" field's value of the Product entity. If the Product object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProductMutation) OldProductPeriod

func (m *ProductMutation) OldProductPeriod(ctx context.Context) (v enum.ProductPeriod, err error)

OldProductPeriod returns the old "product_period" field's value of the Product entity. If the Product object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProductMutation) OldUniqueLimit

func (m *ProductMutation) OldUniqueLimit(ctx context.Context) (v int64, err error)

OldUniqueLimit returns the old "unique_limit" field's value of the Product entity. If the Product object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProductMutation) OldUpdatedAt

func (m *ProductMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Product entity. If the Product object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProductMutation) Op

func (m *ProductMutation) Op() Op

Op returns the operation name.

func (*ProductMutation) PaymentModel

func (m *ProductMutation) PaymentModel() (r enum.PaymentModel, exists bool)

PaymentModel returns the value of the "payment_model" field in the mutation.

func (*ProductMutation) Price

func (m *ProductMutation) Price() (r decimal.Decimal, exists bool)

Price returns the value of the "price" field in the mutation.

func (*ProductMutation) ProductPeriod

func (m *ProductMutation) ProductPeriod() (r enum.ProductPeriod, exists bool)

ProductPeriod returns the value of the "product_period" field in the mutation.

func (*ProductMutation) RemoveBundleIDs

func (m *ProductMutation) RemoveBundleIDs(ids ...int64)

RemoveBundleIDs removes the "bundles" edge to the Bundle entity by IDs.

func (*ProductMutation) RemoveInvoiceIDs

func (m *ProductMutation) RemoveInvoiceIDs(ids ...int64)

RemoveInvoiceIDs removes the "invoices" edge to the Invoice entity by IDs.

func (*ProductMutation) RemoveReservationIDs

func (m *ProductMutation) RemoveReservationIDs(ids ...int64)

RemoveReservationIDs removes the "reservations" edge to the ProductReservation entity by IDs.

func (*ProductMutation) RemoveSubscriptionIDs

func (m *ProductMutation) RemoveSubscriptionIDs(ids ...int64)

RemoveSubscriptionIDs removes the "subscriptions" edge to the Subscriptions entity by IDs.

func (*ProductMutation) RemovedBundlesIDs

func (m *ProductMutation) RemovedBundlesIDs() (ids []int64)

RemovedBundles returns the removed IDs of the "bundles" edge to the Bundle entity.

func (*ProductMutation) RemovedEdges

func (m *ProductMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ProductMutation) RemovedIDs

func (m *ProductMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*ProductMutation) RemovedInvoicesIDs

func (m *ProductMutation) RemovedInvoicesIDs() (ids []int64)

RemovedInvoices returns the removed IDs of the "invoices" edge to the Invoice entity.

func (*ProductMutation) RemovedReservationsIDs

func (m *ProductMutation) RemovedReservationsIDs() (ids []int64)

RemovedReservations returns the removed IDs of the "reservations" edge to the ProductReservation entity.

func (*ProductMutation) RemovedSubscriptionsIDs

func (m *ProductMutation) RemovedSubscriptionsIDs() (ids []int64)

RemovedSubscriptions returns the removed IDs of the "subscriptions" edge to the Subscriptions entity.

func (*ProductMutation) ReservationsCleared

func (m *ProductMutation) ReservationsCleared() bool

ReservationsCleared reports if the "reservations" edge to the ProductReservation entity was cleared.

func (*ProductMutation) ReservationsIDs

func (m *ProductMutation) ReservationsIDs() (ids []int64)

ReservationsIDs returns the "reservations" edge IDs in the mutation.

func (*ProductMutation) ResetAppID

func (m *ProductMutation) ResetAppID()

ResetAppID resets all changes to the "app_id" field.

func (*ProductMutation) ResetBundles

func (m *ProductMutation) ResetBundles()

ResetBundles resets all changes to the "bundles" edge.

func (*ProductMutation) ResetCreatedAt

func (m *ProductMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ProductMutation) ResetCurrency

func (m *ProductMutation) ResetCurrency()

ResetCurrency resets all changes to the "currency" field.

func (*ProductMutation) ResetDeletedAt

func (m *ProductMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*ProductMutation) ResetDescription

func (m *ProductMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*ProductMutation) ResetEdge

func (m *ProductMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*ProductMutation) ResetExpiringTime

func (m *ProductMutation) ResetExpiringTime()

ResetExpiringTime resets all changes to the "expiring_time" field.

func (*ProductMutation) ResetField

func (m *ProductMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*ProductMutation) ResetInvoices

func (m *ProductMutation) ResetInvoices()

ResetInvoices resets all changes to the "invoices" edge.

func (*ProductMutation) ResetIsActive

func (m *ProductMutation) ResetIsActive()

ResetIsActive resets all changes to the "is_active" field.

func (*ProductMutation) ResetIsExpiring

func (m *ProductMutation) ResetIsExpiring()

ResetIsExpiring resets all changes to the "is_expiring" field.

func (*ProductMutation) ResetIsLimited

func (m *ProductMutation) ResetIsLimited()

ResetIsLimited resets all changes to the "is_limited" field.

func (*ProductMutation) ResetIsUnique

func (m *ProductMutation) ResetIsUnique()

ResetIsUnique resets all changes to the "is_unique" field.

func (*ProductMutation) ResetLeft

func (m *ProductMutation) ResetLeft()

ResetLeft resets all changes to the "left" field.

func (*ProductMutation) ResetLimitedTill

func (m *ProductMutation) ResetLimitedTill()

ResetLimitedTill resets all changes to the "limited_till" field.

func (*ProductMutation) ResetName

func (m *ProductMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ProductMutation) ResetPaymentModel

func (m *ProductMutation) ResetPaymentModel()

ResetPaymentModel resets all changes to the "payment_model" field.

func (*ProductMutation) ResetPrice

func (m *ProductMutation) ResetPrice()

ResetPrice resets all changes to the "price" field.

func (*ProductMutation) ResetProductPeriod

func (m *ProductMutation) ResetProductPeriod()

ResetProductPeriod resets all changes to the "product_period" field.

func (*ProductMutation) ResetReservations

func (m *ProductMutation) ResetReservations()

ResetReservations resets all changes to the "reservations" edge.

func (*ProductMutation) ResetSubscriptions

func (m *ProductMutation) ResetSubscriptions()

ResetSubscriptions resets all changes to the "subscriptions" edge.

func (*ProductMutation) ResetUniqueLimit

func (m *ProductMutation) ResetUniqueLimit()

ResetUniqueLimit resets all changes to the "unique_limit" field.

func (*ProductMutation) ResetUpdatedAt

func (m *ProductMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ProductMutation) SetAppID

func (m *ProductMutation) SetAppID(s string)

SetAppID sets the "app_id" field.

func (*ProductMutation) SetCreatedAt

func (m *ProductMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ProductMutation) SetCurrency

func (m *ProductMutation) SetCurrency(s string)

SetCurrency sets the "currency" field.

func (*ProductMutation) SetDeletedAt

func (m *ProductMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*ProductMutation) SetDescription

func (m *ProductMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*ProductMutation) SetExpiringTime

func (m *ProductMutation) SetExpiringTime(t time.Time)

SetExpiringTime sets the "expiring_time" field.

func (*ProductMutation) SetField

func (m *ProductMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ProductMutation) SetID

func (m *ProductMutation) SetID(id int64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Product entities.

func (*ProductMutation) SetIsActive

func (m *ProductMutation) SetIsActive(b bool)

SetIsActive sets the "is_active" field.

func (*ProductMutation) SetIsExpiring

func (m *ProductMutation) SetIsExpiring(b bool)

SetIsExpiring sets the "is_expiring" field.

func (*ProductMutation) SetIsLimited

func (m *ProductMutation) SetIsLimited(b bool)

SetIsLimited sets the "is_limited" field.

func (*ProductMutation) SetIsUnique

func (m *ProductMutation) SetIsUnique(b bool)

SetIsUnique sets the "is_unique" field.

func (*ProductMutation) SetLeft

func (m *ProductMutation) SetLeft(i int64)

SetLeft sets the "left" field.

func (*ProductMutation) SetLimitedTill

func (m *ProductMutation) SetLimitedTill(t time.Time)

SetLimitedTill sets the "limited_till" field.

func (*ProductMutation) SetName

func (m *ProductMutation) SetName(s string)

SetName sets the "name" field.

func (*ProductMutation) SetOp

func (m *ProductMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ProductMutation) SetPaymentModel

func (m *ProductMutation) SetPaymentModel(em enum.PaymentModel)

SetPaymentModel sets the "payment_model" field.

func (*ProductMutation) SetPrice

func (m *ProductMutation) SetPrice(d decimal.Decimal)

SetPrice sets the "price" field.

func (*ProductMutation) SetProductPeriod

func (m *ProductMutation) SetProductPeriod(ep enum.ProductPeriod)

SetProductPeriod sets the "product_period" field.

func (*ProductMutation) SetUniqueLimit

func (m *ProductMutation) SetUniqueLimit(i int64)

SetUniqueLimit sets the "unique_limit" field.

func (*ProductMutation) SetUpdatedAt

func (m *ProductMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*ProductMutation) SubscriptionsCleared

func (m *ProductMutation) SubscriptionsCleared() bool

SubscriptionsCleared reports if the "subscriptions" edge to the Subscriptions entity was cleared.

func (*ProductMutation) SubscriptionsIDs

func (m *ProductMutation) SubscriptionsIDs() (ids []int64)

SubscriptionsIDs returns the "subscriptions" edge IDs in the mutation.

func (ProductMutation) Tx

func (m ProductMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ProductMutation) Type

func (m *ProductMutation) Type() string

Type returns the node type of this mutation (Product).

func (*ProductMutation) UniqueLimit

func (m *ProductMutation) UniqueLimit() (r int64, exists bool)

UniqueLimit returns the value of the "unique_limit" field in the mutation.

func (*ProductMutation) UpdatedAt

func (m *ProductMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*ProductMutation) Where

func (m *ProductMutation) Where(ps ...predicate.Product)

Where appends a list predicates to the ProductMutation builder.

func (*ProductMutation) WhereP

func (m *ProductMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ProductMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ProductQuery

type ProductQuery struct {
	// contains filtered or unexported fields
}

ProductQuery is the builder for querying Product entities.

func (*ProductQuery) Aggregate

func (pq *ProductQuery) Aggregate(fns ...AggregateFunc) *ProductSelect

Aggregate returns a ProductSelect configured with the given aggregations.

func (*ProductQuery) All

func (pq *ProductQuery) All(ctx context.Context) ([]*Product, error)

All executes the query and returns a list of Products.

func (*ProductQuery) AllX

func (pq *ProductQuery) AllX(ctx context.Context) []*Product

AllX is like All, but panics if an error occurs.

func (*ProductQuery) Clone

func (pq *ProductQuery) Clone() *ProductQuery

Clone returns a duplicate of the ProductQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ProductQuery) Count

func (pq *ProductQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ProductQuery) CountX

func (pq *ProductQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ProductQuery) Exist

func (pq *ProductQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ProductQuery) ExistX

func (pq *ProductQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ProductQuery) Filter

func (pq *ProductQuery) Filter() *ProductFilter

Filter returns a Filter implementation to apply filters on the ProductQuery builder.

func (*ProductQuery) First

func (pq *ProductQuery) First(ctx context.Context) (*Product, error)

First returns the first Product entity from the query. Returns a *NotFoundError when no Product was found.

func (*ProductQuery) FirstID

func (pq *ProductQuery) FirstID(ctx context.Context) (id int64, err error)

FirstID returns the first Product ID from the query. Returns a *NotFoundError when no Product ID was found.

func (*ProductQuery) FirstIDX

func (pq *ProductQuery) FirstIDX(ctx context.Context) int64

FirstIDX is like FirstID, but panics if an error occurs.

func (*ProductQuery) FirstX

func (pq *ProductQuery) FirstX(ctx context.Context) *Product

FirstX is like First, but panics if an error occurs.

func (*ProductQuery) GroupBy

func (pq *ProductQuery) GroupBy(field string, fields ...string) *ProductGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Product.Query().
	GroupBy(product.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ProductQuery) IDs

func (pq *ProductQuery) IDs(ctx context.Context) (ids []int64, err error)

IDs executes the query and returns a list of Product IDs.

func (*ProductQuery) IDsX

func (pq *ProductQuery) IDsX(ctx context.Context) []int64

IDsX is like IDs, but panics if an error occurs.

func (*ProductQuery) Limit

func (pq *ProductQuery) Limit(limit int) *ProductQuery

Limit the number of records to be returned by this query.

func (*ProductQuery) Modify

func (pq *ProductQuery) Modify(modifiers ...func(s *sql.Selector)) *ProductSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*ProductQuery) Offset

func (pq *ProductQuery) Offset(offset int) *ProductQuery

Offset to start from.

func (*ProductQuery) Only

func (pq *ProductQuery) Only(ctx context.Context) (*Product, error)

Only returns a single Product entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Product entity is found. Returns a *NotFoundError when no Product entities are found.

func (*ProductQuery) OnlyID

func (pq *ProductQuery) OnlyID(ctx context.Context) (id int64, err error)

OnlyID is like Only, but returns the only Product ID in the query. Returns a *NotSingularError when more than one Product ID is found. Returns a *NotFoundError when no entities are found.

func (*ProductQuery) OnlyIDX

func (pq *ProductQuery) OnlyIDX(ctx context.Context) int64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ProductQuery) OnlyX

func (pq *ProductQuery) OnlyX(ctx context.Context) *Product

OnlyX is like Only, but panics if an error occurs.

func (*ProductQuery) Order

func (pq *ProductQuery) Order(o ...product.OrderOption) *ProductQuery

Order specifies how the records should be ordered.

func (*ProductQuery) QueryBundles

func (pq *ProductQuery) QueryBundles() *BundleQuery

QueryBundles chains the current query on the "bundles" edge.

func (*ProductQuery) QueryInvoices

func (pq *ProductQuery) QueryInvoices() *InvoiceQuery

QueryInvoices chains the current query on the "invoices" edge.

func (*ProductQuery) QueryReservations

func (pq *ProductQuery) QueryReservations() *ProductReservationQuery

QueryReservations chains the current query on the "reservations" edge.

func (*ProductQuery) QuerySubscriptions

func (pq *ProductQuery) QuerySubscriptions() *SubscriptionsQuery

QuerySubscriptions chains the current query on the "subscriptions" edge.

func (*ProductQuery) Select

func (pq *ProductQuery) Select(fields ...string) *ProductSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Product.Query().
	Select(product.FieldCreatedAt).
	Scan(ctx, &v)

func (*ProductQuery) Unique

func (pq *ProductQuery) Unique(unique bool) *ProductQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*ProductQuery) Where

func (pq *ProductQuery) Where(ps ...predicate.Product) *ProductQuery

Where adds a new predicate for the ProductQuery builder.

func (*ProductQuery) WithBundles

func (pq *ProductQuery) WithBundles(opts ...func(*BundleQuery)) *ProductQuery

WithBundles tells the query-builder to eager-load the nodes that are connected to the "bundles" edge. The optional arguments are used to configure the query builder of the edge.

func (*ProductQuery) WithInvoices

func (pq *ProductQuery) WithInvoices(opts ...func(*InvoiceQuery)) *ProductQuery

WithInvoices tells the query-builder to eager-load the nodes that are connected to the "invoices" edge. The optional arguments are used to configure the query builder of the edge.

func (*ProductQuery) WithReservations

func (pq *ProductQuery) WithReservations(opts ...func(*ProductReservationQuery)) *ProductQuery

WithReservations tells the query-builder to eager-load the nodes that are connected to the "reservations" edge. The optional arguments are used to configure the query builder of the edge.

func (*ProductQuery) WithSubscriptions

func (pq *ProductQuery) WithSubscriptions(opts ...func(*SubscriptionsQuery)) *ProductQuery

WithSubscriptions tells the query-builder to eager-load the nodes that are connected to the "subscriptions" edge. The optional arguments are used to configure the query builder of the edge.

type ProductReservation

type ProductReservation struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// References the product being reserved.
	ProductID int64 `json:"product_id,omitempty"`
	// References the invoice associated with the reservation.
	InvoiceID int64 `json:"invoice_id,omitempty"`
	// References the user who created the reservation.
	UserID int64 `json:"user_id,omitempty"`
	// The quantity of the product reserved.
	ReservedQuantity int64 `json:"reserved_quantity,omitempty"`
	// The status of the reservation.
	Status enum.ReservationStatus `json:"status,omitempty"`
	// The time until the reservation expires.
	ExpirationTime time.Time `json:"expiration_time,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ProductReservationQuery when eager-loading is set.
	Edges ProductReservationEdges `json:"edges"`
	// contains filtered or unexported fields
}

ProductReservation is the model entity for the ProductReservation schema.

func (*ProductReservation) QueryInvoice

func (pr *ProductReservation) QueryInvoice() *InvoiceQuery

QueryInvoice queries the "invoice" edge of the ProductReservation entity.

func (*ProductReservation) QueryProduct

func (pr *ProductReservation) QueryProduct() *ProductQuery

QueryProduct queries the "product" edge of the ProductReservation entity.

func (*ProductReservation) String

func (pr *ProductReservation) String() string

String implements the fmt.Stringer.

func (*ProductReservation) Unwrap

func (pr *ProductReservation) Unwrap() *ProductReservation

Unwrap unwraps the ProductReservation entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*ProductReservation) Update

Update returns a builder for updating this ProductReservation. Note that you need to call ProductReservation.Unwrap() before calling this method if this ProductReservation was returned from a transaction, and the transaction was committed or rolled back.

func (*ProductReservation) Value

func (pr *ProductReservation) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the ProductReservation. This includes values selected through modifiers, order, etc.

type ProductReservationClient

type ProductReservationClient struct {
	// contains filtered or unexported fields
}

ProductReservationClient is a client for the ProductReservation schema.

func NewProductReservationClient

func NewProductReservationClient(c config) *ProductReservationClient

NewProductReservationClient returns a client for the ProductReservation from the given config.

func (*ProductReservationClient) Create

Create returns a builder for creating a ProductReservation entity.

func (*ProductReservationClient) CreateBulk

CreateBulk returns a builder for creating a bulk of ProductReservation entities.

func (*ProductReservationClient) Delete

Delete returns a delete builder for ProductReservation.

func (*ProductReservationClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ProductReservationClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ProductReservationClient) Get

Get returns a ProductReservation entity by its id.

func (*ProductReservationClient) GetX

GetX is like Get, but panics if an error occurs.

func (*ProductReservationClient) Hooks

func (c *ProductReservationClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ProductReservationClient) Intercept

func (c *ProductReservationClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `productreservation.Intercept(f(g(h())))`.

func (*ProductReservationClient) Interceptors

func (c *ProductReservationClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ProductReservationClient) MapCreateBulk

func (c *ProductReservationClient) MapCreateBulk(slice any, setFunc func(*ProductReservationCreate, int)) *ProductReservationCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*ProductReservationClient) Query

Query returns a query builder for ProductReservation.

func (*ProductReservationClient) QueryInvoice

QueryInvoice queries the invoice edge of a ProductReservation.

func (*ProductReservationClient) QueryProduct

QueryProduct queries the product edge of a ProductReservation.

func (*ProductReservationClient) Update

Update returns an update builder for ProductReservation.

func (*ProductReservationClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ProductReservationClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*ProductReservationClient) Use

func (c *ProductReservationClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `productreservation.Hooks(f(g(h())))`.

type ProductReservationCreate

type ProductReservationCreate struct {
	// contains filtered or unexported fields
}

ProductReservationCreate is the builder for creating a ProductReservation entity.

func (*ProductReservationCreate) Exec

Exec executes the query.

func (*ProductReservationCreate) ExecX

func (prc *ProductReservationCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductReservationCreate) Mutation

Mutation returns the ProductReservationMutation object of the builder.

func (*ProductReservationCreate) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.ProductReservation.Create().
	SetCreatedAt(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.ProductReservationUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*ProductReservationCreate) OnConflictColumns

func (prc *ProductReservationCreate) OnConflictColumns(columns ...string) *ProductReservationUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.ProductReservation.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*ProductReservationCreate) Save

Save creates the ProductReservation in the database.

func (*ProductReservationCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*ProductReservationCreate) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*ProductReservationCreate) SetExpirationTime

func (prc *ProductReservationCreate) SetExpirationTime(t time.Time) *ProductReservationCreate

SetExpirationTime sets the "expiration_time" field.

func (*ProductReservationCreate) SetID

SetID sets the "id" field.

func (*ProductReservationCreate) SetInvoice

SetInvoice sets the "invoice" edge to the Invoice entity.

func (*ProductReservationCreate) SetInvoiceID

SetInvoiceID sets the "invoice_id" field.

func (*ProductReservationCreate) SetNillableCreatedAt

func (prc *ProductReservationCreate) SetNillableCreatedAt(t *time.Time) *ProductReservationCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ProductReservationCreate) SetNillableExpirationTime

func (prc *ProductReservationCreate) SetNillableExpirationTime(t *time.Time) *ProductReservationCreate

SetNillableExpirationTime sets the "expiration_time" field if the given value is not nil.

func (*ProductReservationCreate) SetNillableReservedQuantity

func (prc *ProductReservationCreate) SetNillableReservedQuantity(i *int64) *ProductReservationCreate

SetNillableReservedQuantity sets the "reserved_quantity" field if the given value is not nil.

func (*ProductReservationCreate) SetNillableStatus

SetNillableStatus sets the "status" field if the given value is not nil.

func (*ProductReservationCreate) SetNillableUpdatedAt

func (prc *ProductReservationCreate) SetNillableUpdatedAt(t *time.Time) *ProductReservationCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*ProductReservationCreate) SetProduct

SetProduct sets the "product" edge to the Product entity.

func (*ProductReservationCreate) SetProductID

SetProductID sets the "product_id" field.

func (*ProductReservationCreate) SetReservedQuantity

func (prc *ProductReservationCreate) SetReservedQuantity(i int64) *ProductReservationCreate

SetReservedQuantity sets the "reserved_quantity" field.

func (*ProductReservationCreate) SetStatus

SetStatus sets the "status" field.

func (*ProductReservationCreate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*ProductReservationCreate) SetUserID

SetUserID sets the "user_id" field.

type ProductReservationCreateBulk

type ProductReservationCreateBulk struct {
	// contains filtered or unexported fields
}

ProductReservationCreateBulk is the builder for creating many ProductReservation entities in bulk.

func (*ProductReservationCreateBulk) Exec

Exec executes the query.

func (*ProductReservationCreateBulk) ExecX

func (prcb *ProductReservationCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductReservationCreateBulk) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.ProductReservation.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.ProductReservationUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*ProductReservationCreateBulk) OnConflictColumns

func (prcb *ProductReservationCreateBulk) OnConflictColumns(columns ...string) *ProductReservationUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.ProductReservation.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*ProductReservationCreateBulk) Save

Save creates the ProductReservation entities in the database.

func (*ProductReservationCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type ProductReservationDelete

type ProductReservationDelete struct {
	// contains filtered or unexported fields
}

ProductReservationDelete is the builder for deleting a ProductReservation entity.

func (*ProductReservationDelete) Exec

func (prd *ProductReservationDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ProductReservationDelete) ExecX

func (prd *ProductReservationDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ProductReservationDelete) Where

Where appends a list predicates to the ProductReservationDelete builder.

type ProductReservationDeleteOne

type ProductReservationDeleteOne struct {
	// contains filtered or unexported fields
}

ProductReservationDeleteOne is the builder for deleting a single ProductReservation entity.

func (*ProductReservationDeleteOne) Exec

Exec executes the deletion query.

func (*ProductReservationDeleteOne) ExecX

func (prdo *ProductReservationDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductReservationDeleteOne) Where

Where appends a list predicates to the ProductReservationDelete builder.

type ProductReservationEdges

type ProductReservationEdges struct {
	// Product holds the value of the product edge.
	Product *Product `json:"product,omitempty"`
	// Invoice holds the value of the invoice edge.
	Invoice *Invoice `json:"invoice,omitempty"`
	// contains filtered or unexported fields
}

ProductReservationEdges holds the relations/edges for other nodes in the graph.

func (ProductReservationEdges) InvoiceOrErr

func (e ProductReservationEdges) InvoiceOrErr() (*Invoice, error)

InvoiceOrErr returns the Invoice value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ProductReservationEdges) ProductOrErr

func (e ProductReservationEdges) ProductOrErr() (*Product, error)

ProductOrErr returns the Product value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type ProductReservationFilter

type ProductReservationFilter struct {
	// contains filtered or unexported fields
}

ProductReservationFilter provides a generic filtering capability at runtime for ProductReservationQuery.

func (*ProductReservationFilter) Where

func (f *ProductReservationFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*ProductReservationFilter) WhereCreatedAt

func (f *ProductReservationFilter) WhereCreatedAt(p entql.TimeP)

WhereCreatedAt applies the entql time.Time predicate on the created_at field.

func (*ProductReservationFilter) WhereExpirationTime

func (f *ProductReservationFilter) WhereExpirationTime(p entql.TimeP)

WhereExpirationTime applies the entql time.Time predicate on the expiration_time field.

func (*ProductReservationFilter) WhereHasInvoice

func (f *ProductReservationFilter) WhereHasInvoice()

WhereHasInvoice applies a predicate to check if query has an edge invoice.

func (*ProductReservationFilter) WhereHasInvoiceWith

func (f *ProductReservationFilter) WhereHasInvoiceWith(preds ...predicate.Invoice)

WhereHasInvoiceWith applies a predicate to check if query has an edge invoice with a given conditions (other predicates).

func (*ProductReservationFilter) WhereHasProduct

func (f *ProductReservationFilter) WhereHasProduct()

WhereHasProduct applies a predicate to check if query has an edge product.

func (*ProductReservationFilter) WhereHasProductWith

func (f *ProductReservationFilter) WhereHasProductWith(preds ...predicate.Product)

WhereHasProductWith applies a predicate to check if query has an edge product with a given conditions (other predicates).

func (*ProductReservationFilter) WhereID

func (f *ProductReservationFilter) WhereID(p entql.Int64P)

WhereID applies the entql int64 predicate on the id field.

func (*ProductReservationFilter) WhereInvoiceID

func (f *ProductReservationFilter) WhereInvoiceID(p entql.Int64P)

WhereInvoiceID applies the entql int64 predicate on the invoice_id field.

func (*ProductReservationFilter) WhereProductID

func (f *ProductReservationFilter) WhereProductID(p entql.Int64P)

WhereProductID applies the entql int64 predicate on the product_id field.

func (*ProductReservationFilter) WhereReservedQuantity

func (f *ProductReservationFilter) WhereReservedQuantity(p entql.Int64P)

WhereReservedQuantity applies the entql int64 predicate on the reserved_quantity field.

func (*ProductReservationFilter) WhereStatus

func (f *ProductReservationFilter) WhereStatus(p entql.StringP)

WhereStatus applies the entql string predicate on the status field.

func (*ProductReservationFilter) WhereUpdatedAt

func (f *ProductReservationFilter) WhereUpdatedAt(p entql.TimeP)

WhereUpdatedAt applies the entql time.Time predicate on the updated_at field.

func (*ProductReservationFilter) WhereUserID

func (f *ProductReservationFilter) WhereUserID(p entql.Int64P)

WhereUserID applies the entql int64 predicate on the user_id field.

type ProductReservationGroupBy

type ProductReservationGroupBy struct {
	// contains filtered or unexported fields
}

ProductReservationGroupBy is the group-by builder for ProductReservation entities.

func (*ProductReservationGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*ProductReservationGroupBy) Bool

func (s *ProductReservationGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ProductReservationGroupBy) BoolX

func (s *ProductReservationGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ProductReservationGroupBy) Bools

func (s *ProductReservationGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ProductReservationGroupBy) BoolsX

func (s *ProductReservationGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ProductReservationGroupBy) Float64

func (s *ProductReservationGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ProductReservationGroupBy) Float64X

func (s *ProductReservationGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ProductReservationGroupBy) Float64s

func (s *ProductReservationGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ProductReservationGroupBy) Float64sX

func (s *ProductReservationGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ProductReservationGroupBy) Int

func (s *ProductReservationGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ProductReservationGroupBy) IntX

func (s *ProductReservationGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ProductReservationGroupBy) Ints

func (s *ProductReservationGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ProductReservationGroupBy) IntsX

func (s *ProductReservationGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ProductReservationGroupBy) Scan

func (prgb *ProductReservationGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ProductReservationGroupBy) ScanX

func (s *ProductReservationGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ProductReservationGroupBy) String

func (s *ProductReservationGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ProductReservationGroupBy) StringX

func (s *ProductReservationGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ProductReservationGroupBy) Strings

func (s *ProductReservationGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ProductReservationGroupBy) StringsX

func (s *ProductReservationGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ProductReservationMutation

type ProductReservationMutation struct {
	// contains filtered or unexported fields
}

ProductReservationMutation represents an operation that mutates the ProductReservation nodes in the graph.

func (*ProductReservationMutation) AddField

func (m *ProductReservationMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ProductReservationMutation) AddReservedQuantity

func (m *ProductReservationMutation) AddReservedQuantity(i int64)

AddReservedQuantity adds i to the "reserved_quantity" field.

func (*ProductReservationMutation) AddUserID

func (m *ProductReservationMutation) AddUserID(i int64)

AddUserID adds i to the "user_id" field.

func (*ProductReservationMutation) AddedEdges

func (m *ProductReservationMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ProductReservationMutation) AddedField

func (m *ProductReservationMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ProductReservationMutation) AddedFields

func (m *ProductReservationMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ProductReservationMutation) AddedIDs

func (m *ProductReservationMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ProductReservationMutation) AddedReservedQuantity

func (m *ProductReservationMutation) AddedReservedQuantity() (r int64, exists bool)

AddedReservedQuantity returns the value that was added to the "reserved_quantity" field in this mutation.

func (*ProductReservationMutation) AddedUserID

func (m *ProductReservationMutation) AddedUserID() (r int64, exists bool)

AddedUserID returns the value that was added to the "user_id" field in this mutation.

func (*ProductReservationMutation) ClearEdge

func (m *ProductReservationMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*ProductReservationMutation) ClearField

func (m *ProductReservationMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*ProductReservationMutation) ClearInvoice

func (m *ProductReservationMutation) ClearInvoice()

ClearInvoice clears the "invoice" edge to the Invoice entity.

func (*ProductReservationMutation) ClearProduct

func (m *ProductReservationMutation) ClearProduct()

ClearProduct clears the "product" edge to the Product entity.

func (*ProductReservationMutation) ClearedEdges

func (m *ProductReservationMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ProductReservationMutation) ClearedFields

func (m *ProductReservationMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ProductReservationMutation) Client

func (m ProductReservationMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*ProductReservationMutation) CreatedAt

func (m *ProductReservationMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ProductReservationMutation) EdgeCleared

func (m *ProductReservationMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ProductReservationMutation) ExpirationTime

func (m *ProductReservationMutation) ExpirationTime() (r time.Time, exists bool)

ExpirationTime returns the value of the "expiration_time" field in the mutation.

func (*ProductReservationMutation) Field

func (m *ProductReservationMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ProductReservationMutation) FieldCleared

func (m *ProductReservationMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ProductReservationMutation) Fields

func (m *ProductReservationMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*ProductReservationMutation) Filter

Filter returns an entql.Where implementation to apply filters on the ProductReservationMutation builder.

func (*ProductReservationMutation) ID

func (m *ProductReservationMutation) ID() (id int64, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*ProductReservationMutation) IDs

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*ProductReservationMutation) InvoiceCleared

func (m *ProductReservationMutation) InvoiceCleared() bool

InvoiceCleared reports if the "invoice" edge to the Invoice entity was cleared.

func (*ProductReservationMutation) InvoiceID

func (m *ProductReservationMutation) InvoiceID() (r int64, exists bool)

InvoiceID returns the value of the "invoice_id" field in the mutation.

func (*ProductReservationMutation) InvoiceIDs

func (m *ProductReservationMutation) InvoiceIDs() (ids []int64)

InvoiceIDs returns the "invoice" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use InvoiceID instead. It exists only for internal usage by the builders.

func (*ProductReservationMutation) OldCreatedAt

func (m *ProductReservationMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the ProductReservation entity. If the ProductReservation object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProductReservationMutation) OldExpirationTime

func (m *ProductReservationMutation) OldExpirationTime(ctx context.Context) (v time.Time, err error)

OldExpirationTime returns the old "expiration_time" field's value of the ProductReservation entity. If the ProductReservation object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProductReservationMutation) OldField

func (m *ProductReservationMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*ProductReservationMutation) OldInvoiceID

func (m *ProductReservationMutation) OldInvoiceID(ctx context.Context) (v int64, err error)

OldInvoiceID returns the old "invoice_id" field's value of the ProductReservation entity. If the ProductReservation object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProductReservationMutation) OldProductID

func (m *ProductReservationMutation) OldProductID(ctx context.Context) (v int64, err error)

OldProductID returns the old "product_id" field's value of the ProductReservation entity. If the ProductReservation object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProductReservationMutation) OldReservedQuantity

func (m *ProductReservationMutation) OldReservedQuantity(ctx context.Context) (v int64, err error)

OldReservedQuantity returns the old "reserved_quantity" field's value of the ProductReservation entity. If the ProductReservation object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProductReservationMutation) OldStatus

OldStatus returns the old "status" field's value of the ProductReservation entity. If the ProductReservation object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProductReservationMutation) OldUpdatedAt

func (m *ProductReservationMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the ProductReservation entity. If the ProductReservation object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProductReservationMutation) OldUserID

func (m *ProductReservationMutation) OldUserID(ctx context.Context) (v int64, err error)

OldUserID returns the old "user_id" field's value of the ProductReservation entity. If the ProductReservation object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ProductReservationMutation) Op

Op returns the operation name.

func (*ProductReservationMutation) ProductCleared

func (m *ProductReservationMutation) ProductCleared() bool

ProductCleared reports if the "product" edge to the Product entity was cleared.

func (*ProductReservationMutation) ProductID

func (m *ProductReservationMutation) ProductID() (r int64, exists bool)

ProductID returns the value of the "product_id" field in the mutation.

func (*ProductReservationMutation) ProductIDs

func (m *ProductReservationMutation) ProductIDs() (ids []int64)

ProductIDs returns the "product" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ProductID instead. It exists only for internal usage by the builders.

func (*ProductReservationMutation) RemovedEdges

func (m *ProductReservationMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ProductReservationMutation) RemovedIDs

func (m *ProductReservationMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*ProductReservationMutation) ReservedQuantity

func (m *ProductReservationMutation) ReservedQuantity() (r int64, exists bool)

ReservedQuantity returns the value of the "reserved_quantity" field in the mutation.

func (*ProductReservationMutation) ResetCreatedAt

func (m *ProductReservationMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ProductReservationMutation) ResetEdge

func (m *ProductReservationMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*ProductReservationMutation) ResetExpirationTime

func (m *ProductReservationMutation) ResetExpirationTime()

ResetExpirationTime resets all changes to the "expiration_time" field.

func (*ProductReservationMutation) ResetField

func (m *ProductReservationMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*ProductReservationMutation) ResetInvoice

func (m *ProductReservationMutation) ResetInvoice()

ResetInvoice resets all changes to the "invoice" edge.

func (*ProductReservationMutation) ResetInvoiceID

func (m *ProductReservationMutation) ResetInvoiceID()

ResetInvoiceID resets all changes to the "invoice_id" field.

func (*ProductReservationMutation) ResetProduct

func (m *ProductReservationMutation) ResetProduct()

ResetProduct resets all changes to the "product" edge.

func (*ProductReservationMutation) ResetProductID

func (m *ProductReservationMutation) ResetProductID()

ResetProductID resets all changes to the "product_id" field.

func (*ProductReservationMutation) ResetReservedQuantity

func (m *ProductReservationMutation) ResetReservedQuantity()

ResetReservedQuantity resets all changes to the "reserved_quantity" field.

func (*ProductReservationMutation) ResetStatus

func (m *ProductReservationMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*ProductReservationMutation) ResetUpdatedAt

func (m *ProductReservationMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ProductReservationMutation) ResetUserID

func (m *ProductReservationMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*ProductReservationMutation) SetCreatedAt

func (m *ProductReservationMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ProductReservationMutation) SetExpirationTime

func (m *ProductReservationMutation) SetExpirationTime(t time.Time)

SetExpirationTime sets the "expiration_time" field.

func (*ProductReservationMutation) SetField

func (m *ProductReservationMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ProductReservationMutation) SetID

func (m *ProductReservationMutation) SetID(id int64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of ProductReservation entities.

func (*ProductReservationMutation) SetInvoiceID

func (m *ProductReservationMutation) SetInvoiceID(i int64)

SetInvoiceID sets the "invoice_id" field.

func (*ProductReservationMutation) SetOp

func (m *ProductReservationMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ProductReservationMutation) SetProductID

func (m *ProductReservationMutation) SetProductID(i int64)

SetProductID sets the "product_id" field.

func (*ProductReservationMutation) SetReservedQuantity

func (m *ProductReservationMutation) SetReservedQuantity(i int64)

SetReservedQuantity sets the "reserved_quantity" field.

func (*ProductReservationMutation) SetStatus

SetStatus sets the "status" field.

func (*ProductReservationMutation) SetUpdatedAt

func (m *ProductReservationMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*ProductReservationMutation) SetUserID

func (m *ProductReservationMutation) SetUserID(i int64)

SetUserID sets the "user_id" field.

func (*ProductReservationMutation) Status

func (m *ProductReservationMutation) Status() (r enum.ReservationStatus, exists bool)

Status returns the value of the "status" field in the mutation.

func (ProductReservationMutation) Tx

func (m ProductReservationMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ProductReservationMutation) Type

Type returns the node type of this mutation (ProductReservation).

func (*ProductReservationMutation) UpdatedAt

func (m *ProductReservationMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*ProductReservationMutation) UserID

func (m *ProductReservationMutation) UserID() (r int64, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*ProductReservationMutation) Where

Where appends a list predicates to the ProductReservationMutation builder.

func (*ProductReservationMutation) WhereP

func (m *ProductReservationMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ProductReservationMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ProductReservationQuery

type ProductReservationQuery struct {
	// contains filtered or unexported fields
}

ProductReservationQuery is the builder for querying ProductReservation entities.

func (*ProductReservationQuery) Aggregate

Aggregate returns a ProductReservationSelect configured with the given aggregations.

func (*ProductReservationQuery) All

All executes the query and returns a list of ProductReservations.

func (*ProductReservationQuery) AllX

AllX is like All, but panics if an error occurs.

func (*ProductReservationQuery) Clone

Clone returns a duplicate of the ProductReservationQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ProductReservationQuery) Count

func (prq *ProductReservationQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ProductReservationQuery) CountX

func (prq *ProductReservationQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ProductReservationQuery) Exist

func (prq *ProductReservationQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ProductReservationQuery) ExistX

func (prq *ProductReservationQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ProductReservationQuery) Filter

Filter returns a Filter implementation to apply filters on the ProductReservationQuery builder.

func (*ProductReservationQuery) First

First returns the first ProductReservation entity from the query. Returns a *NotFoundError when no ProductReservation was found.

func (*ProductReservationQuery) FirstID

func (prq *ProductReservationQuery) FirstID(ctx context.Context) (id int64, err error)

FirstID returns the first ProductReservation ID from the query. Returns a *NotFoundError when no ProductReservation ID was found.

func (*ProductReservationQuery) FirstIDX

func (prq *ProductReservationQuery) FirstIDX(ctx context.Context) int64

FirstIDX is like FirstID, but panics if an error occurs.

func (*ProductReservationQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*ProductReservationQuery) GroupBy

func (prq *ProductReservationQuery) GroupBy(field string, fields ...string) *ProductReservationGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.ProductReservation.Query().
	GroupBy(productreservation.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ProductReservationQuery) IDs

func (prq *ProductReservationQuery) IDs(ctx context.Context) (ids []int64, err error)

IDs executes the query and returns a list of ProductReservation IDs.

func (*ProductReservationQuery) IDsX

func (prq *ProductReservationQuery) IDsX(ctx context.Context) []int64

IDsX is like IDs, but panics if an error occurs.

func (*ProductReservationQuery) Limit

Limit the number of records to be returned by this query.

func (*ProductReservationQuery) Modify

func (prq *ProductReservationQuery) Modify(modifiers ...func(s *sql.Selector)) *ProductReservationSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*ProductReservationQuery) Offset

Offset to start from.

func (*ProductReservationQuery) Only

Only returns a single ProductReservation entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ProductReservation entity is found. Returns a *NotFoundError when no ProductReservation entities are found.

func (*ProductReservationQuery) OnlyID

func (prq *ProductReservationQuery) OnlyID(ctx context.Context) (id int64, err error)

OnlyID is like Only, but returns the only ProductReservation ID in the query. Returns a *NotSingularError when more than one ProductReservation ID is found. Returns a *NotFoundError when no entities are found.

func (*ProductReservationQuery) OnlyIDX

func (prq *ProductReservationQuery) OnlyIDX(ctx context.Context) int64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ProductReservationQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*ProductReservationQuery) Order

Order specifies how the records should be ordered.

func (*ProductReservationQuery) QueryInvoice

func (prq *ProductReservationQuery) QueryInvoice() *InvoiceQuery

QueryInvoice chains the current query on the "invoice" edge.

func (*ProductReservationQuery) QueryProduct

func (prq *ProductReservationQuery) QueryProduct() *ProductQuery

QueryProduct chains the current query on the "product" edge.

func (*ProductReservationQuery) Select

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.ProductReservation.Query().
	Select(productreservation.FieldCreatedAt).
	Scan(ctx, &v)

func (*ProductReservationQuery) Unique

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*ProductReservationQuery) Where

Where adds a new predicate for the ProductReservationQuery builder.

func (*ProductReservationQuery) WithInvoice

func (prq *ProductReservationQuery) WithInvoice(opts ...func(*InvoiceQuery)) *ProductReservationQuery

WithInvoice tells the query-builder to eager-load the nodes that are connected to the "invoice" edge. The optional arguments are used to configure the query builder of the edge.

func (*ProductReservationQuery) WithProduct

func (prq *ProductReservationQuery) WithProduct(opts ...func(*ProductQuery)) *ProductReservationQuery

WithProduct tells the query-builder to eager-load the nodes that are connected to the "product" edge. The optional arguments are used to configure the query builder of the edge.

type ProductReservationSelect

type ProductReservationSelect struct {
	*ProductReservationQuery
	// contains filtered or unexported fields
}

ProductReservationSelect is the builder for selecting fields of ProductReservation entities.

func (*ProductReservationSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*ProductReservationSelect) Bool

func (s *ProductReservationSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ProductReservationSelect) BoolX

func (s *ProductReservationSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ProductReservationSelect) Bools

func (s *ProductReservationSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ProductReservationSelect) BoolsX

func (s *ProductReservationSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ProductReservationSelect) Float64

func (s *ProductReservationSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ProductReservationSelect) Float64X

func (s *ProductReservationSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ProductReservationSelect) Float64s

func (s *ProductReservationSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ProductReservationSelect) Float64sX

func (s *ProductReservationSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ProductReservationSelect) Int

func (s *ProductReservationSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ProductReservationSelect) IntX

func (s *ProductReservationSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ProductReservationSelect) Ints

func (s *ProductReservationSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ProductReservationSelect) IntsX

func (s *ProductReservationSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ProductReservationSelect) Modify

func (prs *ProductReservationSelect) Modify(modifiers ...func(s *sql.Selector)) *ProductReservationSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*ProductReservationSelect) Scan

func (prs *ProductReservationSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ProductReservationSelect) ScanX

func (s *ProductReservationSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ProductReservationSelect) String

func (s *ProductReservationSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ProductReservationSelect) StringX

func (s *ProductReservationSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ProductReservationSelect) Strings

func (s *ProductReservationSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ProductReservationSelect) StringsX

func (s *ProductReservationSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ProductReservationUpdate

type ProductReservationUpdate struct {
	// contains filtered or unexported fields
}

ProductReservationUpdate is the builder for updating ProductReservation entities.

func (*ProductReservationUpdate) AddReservedQuantity

func (pru *ProductReservationUpdate) AddReservedQuantity(i int64) *ProductReservationUpdate

AddReservedQuantity adds i to the "reserved_quantity" field.

func (*ProductReservationUpdate) Exec

Exec executes the query.

func (*ProductReservationUpdate) ExecX

func (pru *ProductReservationUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductReservationUpdate) Modify

func (pru *ProductReservationUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *ProductReservationUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*ProductReservationUpdate) Mutation

Mutation returns the ProductReservationMutation object of the builder.

func (*ProductReservationUpdate) Save

func (pru *ProductReservationUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ProductReservationUpdate) SaveX

func (pru *ProductReservationUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ProductReservationUpdate) SetExpirationTime

func (pru *ProductReservationUpdate) SetExpirationTime(t time.Time) *ProductReservationUpdate

SetExpirationTime sets the "expiration_time" field.

func (*ProductReservationUpdate) SetNillableExpirationTime

func (pru *ProductReservationUpdate) SetNillableExpirationTime(t *time.Time) *ProductReservationUpdate

SetNillableExpirationTime sets the "expiration_time" field if the given value is not nil.

func (*ProductReservationUpdate) SetNillableReservedQuantity

func (pru *ProductReservationUpdate) SetNillableReservedQuantity(i *int64) *ProductReservationUpdate

SetNillableReservedQuantity sets the "reserved_quantity" field if the given value is not nil.

func (*ProductReservationUpdate) SetNillableStatus

SetNillableStatus sets the "status" field if the given value is not nil.

func (*ProductReservationUpdate) SetReservedQuantity

func (pru *ProductReservationUpdate) SetReservedQuantity(i int64) *ProductReservationUpdate

SetReservedQuantity sets the "reserved_quantity" field.

func (*ProductReservationUpdate) SetStatus

SetStatus sets the "status" field.

func (*ProductReservationUpdate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*ProductReservationUpdate) Where

Where appends a list predicates to the ProductReservationUpdate builder.

type ProductReservationUpdateOne

type ProductReservationUpdateOne struct {
	// contains filtered or unexported fields
}

ProductReservationUpdateOne is the builder for updating a single ProductReservation entity.

func (*ProductReservationUpdateOne) AddReservedQuantity

func (pruo *ProductReservationUpdateOne) AddReservedQuantity(i int64) *ProductReservationUpdateOne

AddReservedQuantity adds i to the "reserved_quantity" field.

func (*ProductReservationUpdateOne) Exec

Exec executes the query on the entity.

func (*ProductReservationUpdateOne) ExecX

func (pruo *ProductReservationUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductReservationUpdateOne) Modify

func (pruo *ProductReservationUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *ProductReservationUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*ProductReservationUpdateOne) Mutation

Mutation returns the ProductReservationMutation object of the builder.

func (*ProductReservationUpdateOne) Save

Save executes the query and returns the updated ProductReservation entity.

func (*ProductReservationUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*ProductReservationUpdateOne) Select

func (pruo *ProductReservationUpdateOne) Select(field string, fields ...string) *ProductReservationUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ProductReservationUpdateOne) SetExpirationTime

SetExpirationTime sets the "expiration_time" field.

func (*ProductReservationUpdateOne) SetNillableExpirationTime

func (pruo *ProductReservationUpdateOne) SetNillableExpirationTime(t *time.Time) *ProductReservationUpdateOne

SetNillableExpirationTime sets the "expiration_time" field if the given value is not nil.

func (*ProductReservationUpdateOne) SetNillableReservedQuantity

func (pruo *ProductReservationUpdateOne) SetNillableReservedQuantity(i *int64) *ProductReservationUpdateOne

SetNillableReservedQuantity sets the "reserved_quantity" field if the given value is not nil.

func (*ProductReservationUpdateOne) SetNillableStatus

SetNillableStatus sets the "status" field if the given value is not nil.

func (*ProductReservationUpdateOne) SetReservedQuantity

func (pruo *ProductReservationUpdateOne) SetReservedQuantity(i int64) *ProductReservationUpdateOne

SetReservedQuantity sets the "reserved_quantity" field.

func (*ProductReservationUpdateOne) SetStatus

SetStatus sets the "status" field.

func (*ProductReservationUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*ProductReservationUpdateOne) Where

Where appends a list predicates to the ProductReservationUpdate builder.

type ProductReservationUpsert

type ProductReservationUpsert struct {
	*sql.UpdateSet
}

ProductReservationUpsert is the "OnConflict" setter.

func (*ProductReservationUpsert) AddReservedQuantity

func (u *ProductReservationUpsert) AddReservedQuantity(v int64) *ProductReservationUpsert

AddReservedQuantity adds v to the "reserved_quantity" field.

func (*ProductReservationUpsert) SetExpirationTime

SetExpirationTime sets the "expiration_time" field.

func (*ProductReservationUpsert) SetReservedQuantity

func (u *ProductReservationUpsert) SetReservedQuantity(v int64) *ProductReservationUpsert

SetReservedQuantity sets the "reserved_quantity" field.

func (*ProductReservationUpsert) SetStatus

SetStatus sets the "status" field.

func (*ProductReservationUpsert) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*ProductReservationUpsert) UpdateExpirationTime

func (u *ProductReservationUpsert) UpdateExpirationTime() *ProductReservationUpsert

UpdateExpirationTime sets the "expiration_time" field to the value that was provided on create.

func (*ProductReservationUpsert) UpdateReservedQuantity

func (u *ProductReservationUpsert) UpdateReservedQuantity() *ProductReservationUpsert

UpdateReservedQuantity sets the "reserved_quantity" field to the value that was provided on create.

func (*ProductReservationUpsert) UpdateStatus

UpdateStatus sets the "status" field to the value that was provided on create.

func (*ProductReservationUpsert) UpdateUpdatedAt

func (u *ProductReservationUpsert) UpdateUpdatedAt() *ProductReservationUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type ProductReservationUpsertBulk

type ProductReservationUpsertBulk struct {
	// contains filtered or unexported fields
}

ProductReservationUpsertBulk is the builder for "upsert"-ing a bulk of ProductReservation nodes.

func (*ProductReservationUpsertBulk) AddReservedQuantity

AddReservedQuantity adds v to the "reserved_quantity" field.

func (*ProductReservationUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ProductReservationUpsertBulk) Exec

Exec executes the query.

func (*ProductReservationUpsertBulk) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*ProductReservationUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.ProductReservation.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*ProductReservationUpsertBulk) SetExpirationTime

SetExpirationTime sets the "expiration_time" field.

func (*ProductReservationUpsertBulk) SetReservedQuantity

SetReservedQuantity sets the "reserved_quantity" field.

func (*ProductReservationUpsertBulk) SetStatus

SetStatus sets the "status" field.

func (*ProductReservationUpsertBulk) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*ProductReservationUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the ProductReservationCreateBulk.OnConflict documentation for more info.

func (*ProductReservationUpsertBulk) UpdateExpirationTime

UpdateExpirationTime sets the "expiration_time" field to the value that was provided on create.

func (*ProductReservationUpsertBulk) UpdateNewValues

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.ProductReservation.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(productreservation.FieldID)
		}),
	).
	Exec(ctx)

func (*ProductReservationUpsertBulk) UpdateReservedQuantity

func (u *ProductReservationUpsertBulk) UpdateReservedQuantity() *ProductReservationUpsertBulk

UpdateReservedQuantity sets the "reserved_quantity" field to the value that was provided on create.

func (*ProductReservationUpsertBulk) UpdateStatus

UpdateStatus sets the "status" field to the value that was provided on create.

func (*ProductReservationUpsertBulk) UpdateUpdatedAt

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type ProductReservationUpsertOne

type ProductReservationUpsertOne struct {
	// contains filtered or unexported fields
}

ProductReservationUpsertOne is the builder for "upsert"-ing

one ProductReservation node.

func (*ProductReservationUpsertOne) AddReservedQuantity

AddReservedQuantity adds v to the "reserved_quantity" field.

func (*ProductReservationUpsertOne) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ProductReservationUpsertOne) Exec

Exec executes the query.

func (*ProductReservationUpsertOne) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*ProductReservationUpsertOne) ID

func (u *ProductReservationUpsertOne) ID(ctx context.Context) (id int64, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*ProductReservationUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*ProductReservationUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.ProductReservation.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*ProductReservationUpsertOne) SetExpirationTime

SetExpirationTime sets the "expiration_time" field.

func (*ProductReservationUpsertOne) SetReservedQuantity

SetReservedQuantity sets the "reserved_quantity" field.

func (*ProductReservationUpsertOne) SetStatus

SetStatus sets the "status" field.

func (*ProductReservationUpsertOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*ProductReservationUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the ProductReservationCreate.OnConflict documentation for more info.

func (*ProductReservationUpsertOne) UpdateExpirationTime

func (u *ProductReservationUpsertOne) UpdateExpirationTime() *ProductReservationUpsertOne

UpdateExpirationTime sets the "expiration_time" field to the value that was provided on create.

func (*ProductReservationUpsertOne) UpdateNewValues

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.ProductReservation.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(productreservation.FieldID)
		}),
	).
	Exec(ctx)

func (*ProductReservationUpsertOne) UpdateReservedQuantity

func (u *ProductReservationUpsertOne) UpdateReservedQuantity() *ProductReservationUpsertOne

UpdateReservedQuantity sets the "reserved_quantity" field to the value that was provided on create.

func (*ProductReservationUpsertOne) UpdateStatus

UpdateStatus sets the "status" field to the value that was provided on create.

func (*ProductReservationUpsertOne) UpdateUpdatedAt

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type ProductReservations

type ProductReservations []*ProductReservation

ProductReservations is a parsable slice of ProductReservation.

type ProductSelect

type ProductSelect struct {
	*ProductQuery
	// contains filtered or unexported fields
}

ProductSelect is the builder for selecting fields of Product entities.

func (*ProductSelect) Aggregate

func (ps *ProductSelect) Aggregate(fns ...AggregateFunc) *ProductSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ProductSelect) Bool

func (s *ProductSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ProductSelect) BoolX

func (s *ProductSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ProductSelect) Bools

func (s *ProductSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ProductSelect) BoolsX

func (s *ProductSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ProductSelect) Float64

func (s *ProductSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ProductSelect) Float64X

func (s *ProductSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ProductSelect) Float64s

func (s *ProductSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ProductSelect) Float64sX

func (s *ProductSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ProductSelect) Int

func (s *ProductSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ProductSelect) IntX

func (s *ProductSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ProductSelect) Ints

func (s *ProductSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ProductSelect) IntsX

func (s *ProductSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ProductSelect) Modify

func (ps *ProductSelect) Modify(modifiers ...func(s *sql.Selector)) *ProductSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*ProductSelect) Scan

func (ps *ProductSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ProductSelect) ScanX

func (s *ProductSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ProductSelect) String

func (s *ProductSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ProductSelect) StringX

func (s *ProductSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ProductSelect) Strings

func (s *ProductSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ProductSelect) StringsX

func (s *ProductSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ProductUpdate

type ProductUpdate struct {
	// contains filtered or unexported fields
}

ProductUpdate is the builder for updating Product entities.

func (*ProductUpdate) AddBundleIDs

func (pu *ProductUpdate) AddBundleIDs(ids ...int64) *ProductUpdate

AddBundleIDs adds the "bundles" edge to the Bundle entity by IDs.

func (*ProductUpdate) AddBundles

func (pu *ProductUpdate) AddBundles(b ...*Bundle) *ProductUpdate

AddBundles adds the "bundles" edges to the Bundle entity.

func (*ProductUpdate) AddInvoiceIDs

func (pu *ProductUpdate) AddInvoiceIDs(ids ...int64) *ProductUpdate

AddInvoiceIDs adds the "invoices" edge to the Invoice entity by IDs.

func (*ProductUpdate) AddInvoices

func (pu *ProductUpdate) AddInvoices(i ...*Invoice) *ProductUpdate

AddInvoices adds the "invoices" edges to the Invoice entity.

func (*ProductUpdate) AddLeft

func (pu *ProductUpdate) AddLeft(i int64) *ProductUpdate

AddLeft adds i to the "left" field.

func (*ProductUpdate) AddPrice

func (pu *ProductUpdate) AddPrice(d decimal.Decimal) *ProductUpdate

AddPrice adds d to the "price" field.

func (*ProductUpdate) AddReservationIDs

func (pu *ProductUpdate) AddReservationIDs(ids ...int64) *ProductUpdate

AddReservationIDs adds the "reservations" edge to the ProductReservation entity by IDs.

func (*ProductUpdate) AddReservations

func (pu *ProductUpdate) AddReservations(p ...*ProductReservation) *ProductUpdate

AddReservations adds the "reservations" edges to the ProductReservation entity.

func (*ProductUpdate) AddSubscriptionIDs

func (pu *ProductUpdate) AddSubscriptionIDs(ids ...int64) *ProductUpdate

AddSubscriptionIDs adds the "subscriptions" edge to the Subscriptions entity by IDs.

func (*ProductUpdate) AddSubscriptions

func (pu *ProductUpdate) AddSubscriptions(s ...*Subscriptions) *ProductUpdate

AddSubscriptions adds the "subscriptions" edges to the Subscriptions entity.

func (*ProductUpdate) AddUniqueLimit

func (pu *ProductUpdate) AddUniqueLimit(i int64) *ProductUpdate

AddUniqueLimit adds i to the "unique_limit" field.

func (*ProductUpdate) ClearBundles

func (pu *ProductUpdate) ClearBundles() *ProductUpdate

ClearBundles clears all "bundles" edges to the Bundle entity.

func (*ProductUpdate) ClearDeletedAt

func (pu *ProductUpdate) ClearDeletedAt() *ProductUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*ProductUpdate) ClearExpiringTime

func (pu *ProductUpdate) ClearExpiringTime() *ProductUpdate

ClearExpiringTime clears the value of the "expiring_time" field.

func (*ProductUpdate) ClearInvoices

func (pu *ProductUpdate) ClearInvoices() *ProductUpdate

ClearInvoices clears all "invoices" edges to the Invoice entity.

func (*ProductUpdate) ClearIsExpiring

func (pu *ProductUpdate) ClearIsExpiring() *ProductUpdate

ClearIsExpiring clears the value of the "is_expiring" field.

func (*ProductUpdate) ClearIsUnique

func (pu *ProductUpdate) ClearIsUnique() *ProductUpdate

ClearIsUnique clears the value of the "is_unique" field.

func (*ProductUpdate) ClearLimitedTill

func (pu *ProductUpdate) ClearLimitedTill() *ProductUpdate

ClearLimitedTill clears the value of the "limited_till" field.

func (*ProductUpdate) ClearReservations

func (pu *ProductUpdate) ClearReservations() *ProductUpdate

ClearReservations clears all "reservations" edges to the ProductReservation entity.

func (*ProductUpdate) ClearSubscriptions

func (pu *ProductUpdate) ClearSubscriptions() *ProductUpdate

ClearSubscriptions clears all "subscriptions" edges to the Subscriptions entity.

func (*ProductUpdate) Exec

func (pu *ProductUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductUpdate) ExecX

func (pu *ProductUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductUpdate) Modify

func (pu *ProductUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *ProductUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*ProductUpdate) Mutation

func (pu *ProductUpdate) Mutation() *ProductMutation

Mutation returns the ProductMutation object of the builder.

func (*ProductUpdate) RemoveBundleIDs

func (pu *ProductUpdate) RemoveBundleIDs(ids ...int64) *ProductUpdate

RemoveBundleIDs removes the "bundles" edge to Bundle entities by IDs.

func (*ProductUpdate) RemoveBundles

func (pu *ProductUpdate) RemoveBundles(b ...*Bundle) *ProductUpdate

RemoveBundles removes "bundles" edges to Bundle entities.

func (*ProductUpdate) RemoveInvoiceIDs

func (pu *ProductUpdate) RemoveInvoiceIDs(ids ...int64) *ProductUpdate

RemoveInvoiceIDs removes the "invoices" edge to Invoice entities by IDs.

func (*ProductUpdate) RemoveInvoices

func (pu *ProductUpdate) RemoveInvoices(i ...*Invoice) *ProductUpdate

RemoveInvoices removes "invoices" edges to Invoice entities.

func (*ProductUpdate) RemoveReservationIDs

func (pu *ProductUpdate) RemoveReservationIDs(ids ...int64) *ProductUpdate

RemoveReservationIDs removes the "reservations" edge to ProductReservation entities by IDs.

func (*ProductUpdate) RemoveReservations

func (pu *ProductUpdate) RemoveReservations(p ...*ProductReservation) *ProductUpdate

RemoveReservations removes "reservations" edges to ProductReservation entities.

func (*ProductUpdate) RemoveSubscriptionIDs

func (pu *ProductUpdate) RemoveSubscriptionIDs(ids ...int64) *ProductUpdate

RemoveSubscriptionIDs removes the "subscriptions" edge to Subscriptions entities by IDs.

func (*ProductUpdate) RemoveSubscriptions

func (pu *ProductUpdate) RemoveSubscriptions(s ...*Subscriptions) *ProductUpdate

RemoveSubscriptions removes "subscriptions" edges to Subscriptions entities.

func (*ProductUpdate) Save

func (pu *ProductUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ProductUpdate) SaveX

func (pu *ProductUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ProductUpdate) SetAppID

func (pu *ProductUpdate) SetAppID(s string) *ProductUpdate

SetAppID sets the "app_id" field.

func (*ProductUpdate) SetCurrency

func (pu *ProductUpdate) SetCurrency(s string) *ProductUpdate

SetCurrency sets the "currency" field.

func (*ProductUpdate) SetDeletedAt

func (pu *ProductUpdate) SetDeletedAt(t time.Time) *ProductUpdate

SetDeletedAt sets the "deleted_at" field.

func (*ProductUpdate) SetDescription

func (pu *ProductUpdate) SetDescription(s string) *ProductUpdate

SetDescription sets the "description" field.

func (*ProductUpdate) SetExpiringTime

func (pu *ProductUpdate) SetExpiringTime(t time.Time) *ProductUpdate

SetExpiringTime sets the "expiring_time" field.

func (*ProductUpdate) SetIsActive

func (pu *ProductUpdate) SetIsActive(b bool) *ProductUpdate

SetIsActive sets the "is_active" field.

func (*ProductUpdate) SetIsExpiring

func (pu *ProductUpdate) SetIsExpiring(b bool) *ProductUpdate

SetIsExpiring sets the "is_expiring" field.

func (*ProductUpdate) SetIsLimited

func (pu *ProductUpdate) SetIsLimited(b bool) *ProductUpdate

SetIsLimited sets the "is_limited" field.

func (*ProductUpdate) SetIsUnique

func (pu *ProductUpdate) SetIsUnique(b bool) *ProductUpdate

SetIsUnique sets the "is_unique" field.

func (*ProductUpdate) SetLeft

func (pu *ProductUpdate) SetLeft(i int64) *ProductUpdate

SetLeft sets the "left" field.

func (*ProductUpdate) SetLimitedTill

func (pu *ProductUpdate) SetLimitedTill(t time.Time) *ProductUpdate

SetLimitedTill sets the "limited_till" field.

func (*ProductUpdate) SetName

func (pu *ProductUpdate) SetName(s string) *ProductUpdate

SetName sets the "name" field.

func (*ProductUpdate) SetNillableAppID

func (pu *ProductUpdate) SetNillableAppID(s *string) *ProductUpdate

SetNillableAppID sets the "app_id" field if the given value is not nil.

func (*ProductUpdate) SetNillableCurrency

func (pu *ProductUpdate) SetNillableCurrency(s *string) *ProductUpdate

SetNillableCurrency sets the "currency" field if the given value is not nil.

func (*ProductUpdate) SetNillableDeletedAt

func (pu *ProductUpdate) SetNillableDeletedAt(t *time.Time) *ProductUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*ProductUpdate) SetNillableDescription

func (pu *ProductUpdate) SetNillableDescription(s *string) *ProductUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*ProductUpdate) SetNillableExpiringTime

func (pu *ProductUpdate) SetNillableExpiringTime(t *time.Time) *ProductUpdate

SetNillableExpiringTime sets the "expiring_time" field if the given value is not nil.

func (*ProductUpdate) SetNillableIsActive

func (pu *ProductUpdate) SetNillableIsActive(b *bool) *ProductUpdate

SetNillableIsActive sets the "is_active" field if the given value is not nil.

func (*ProductUpdate) SetNillableIsExpiring

func (pu *ProductUpdate) SetNillableIsExpiring(b *bool) *ProductUpdate

SetNillableIsExpiring sets the "is_expiring" field if the given value is not nil.

func (*ProductUpdate) SetNillableIsLimited

func (pu *ProductUpdate) SetNillableIsLimited(b *bool) *ProductUpdate

SetNillableIsLimited sets the "is_limited" field if the given value is not nil.

func (*ProductUpdate) SetNillableIsUnique

func (pu *ProductUpdate) SetNillableIsUnique(b *bool) *ProductUpdate

SetNillableIsUnique sets the "is_unique" field if the given value is not nil.

func (*ProductUpdate) SetNillableLeft

func (pu *ProductUpdate) SetNillableLeft(i *int64) *ProductUpdate

SetNillableLeft sets the "left" field if the given value is not nil.

func (*ProductUpdate) SetNillableLimitedTill

func (pu *ProductUpdate) SetNillableLimitedTill(t *time.Time) *ProductUpdate

SetNillableLimitedTill sets the "limited_till" field if the given value is not nil.

func (*ProductUpdate) SetNillableName

func (pu *ProductUpdate) SetNillableName(s *string) *ProductUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*ProductUpdate) SetNillablePaymentModel

func (pu *ProductUpdate) SetNillablePaymentModel(em *enum.PaymentModel) *ProductUpdate

SetNillablePaymentModel sets the "payment_model" field if the given value is not nil.

func (*ProductUpdate) SetNillablePrice

func (pu *ProductUpdate) SetNillablePrice(d *decimal.Decimal) *ProductUpdate

SetNillablePrice sets the "price" field if the given value is not nil.

func (*ProductUpdate) SetNillableProductPeriod

func (pu *ProductUpdate) SetNillableProductPeriod(ep *enum.ProductPeriod) *ProductUpdate

SetNillableProductPeriod sets the "product_period" field if the given value is not nil.

func (*ProductUpdate) SetNillableUniqueLimit

func (pu *ProductUpdate) SetNillableUniqueLimit(i *int64) *ProductUpdate

SetNillableUniqueLimit sets the "unique_limit" field if the given value is not nil.

func (*ProductUpdate) SetPaymentModel

func (pu *ProductUpdate) SetPaymentModel(em enum.PaymentModel) *ProductUpdate

SetPaymentModel sets the "payment_model" field.

func (*ProductUpdate) SetPrice

func (pu *ProductUpdate) SetPrice(d decimal.Decimal) *ProductUpdate

SetPrice sets the "price" field.

func (*ProductUpdate) SetProductPeriod

func (pu *ProductUpdate) SetProductPeriod(ep enum.ProductPeriod) *ProductUpdate

SetProductPeriod sets the "product_period" field.

func (*ProductUpdate) SetUniqueLimit

func (pu *ProductUpdate) SetUniqueLimit(i int64) *ProductUpdate

SetUniqueLimit sets the "unique_limit" field.

func (*ProductUpdate) SetUpdatedAt

func (pu *ProductUpdate) SetUpdatedAt(t time.Time) *ProductUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ProductUpdate) Where

func (pu *ProductUpdate) Where(ps ...predicate.Product) *ProductUpdate

Where appends a list predicates to the ProductUpdate builder.

type ProductUpdateOne

type ProductUpdateOne struct {
	// contains filtered or unexported fields
}

ProductUpdateOne is the builder for updating a single Product entity.

func (*ProductUpdateOne) AddBundleIDs

func (puo *ProductUpdateOne) AddBundleIDs(ids ...int64) *ProductUpdateOne

AddBundleIDs adds the "bundles" edge to the Bundle entity by IDs.

func (*ProductUpdateOne) AddBundles

func (puo *ProductUpdateOne) AddBundles(b ...*Bundle) *ProductUpdateOne

AddBundles adds the "bundles" edges to the Bundle entity.

func (*ProductUpdateOne) AddInvoiceIDs

func (puo *ProductUpdateOne) AddInvoiceIDs(ids ...int64) *ProductUpdateOne

AddInvoiceIDs adds the "invoices" edge to the Invoice entity by IDs.

func (*ProductUpdateOne) AddInvoices

func (puo *ProductUpdateOne) AddInvoices(i ...*Invoice) *ProductUpdateOne

AddInvoices adds the "invoices" edges to the Invoice entity.

func (*ProductUpdateOne) AddLeft

func (puo *ProductUpdateOne) AddLeft(i int64) *ProductUpdateOne

AddLeft adds i to the "left" field.

func (*ProductUpdateOne) AddPrice

AddPrice adds d to the "price" field.

func (*ProductUpdateOne) AddReservationIDs

func (puo *ProductUpdateOne) AddReservationIDs(ids ...int64) *ProductUpdateOne

AddReservationIDs adds the "reservations" edge to the ProductReservation entity by IDs.

func (*ProductUpdateOne) AddReservations

func (puo *ProductUpdateOne) AddReservations(p ...*ProductReservation) *ProductUpdateOne

AddReservations adds the "reservations" edges to the ProductReservation entity.

func (*ProductUpdateOne) AddSubscriptionIDs

func (puo *ProductUpdateOne) AddSubscriptionIDs(ids ...int64) *ProductUpdateOne

AddSubscriptionIDs adds the "subscriptions" edge to the Subscriptions entity by IDs.

func (*ProductUpdateOne) AddSubscriptions

func (puo *ProductUpdateOne) AddSubscriptions(s ...*Subscriptions) *ProductUpdateOne

AddSubscriptions adds the "subscriptions" edges to the Subscriptions entity.

func (*ProductUpdateOne) AddUniqueLimit

func (puo *ProductUpdateOne) AddUniqueLimit(i int64) *ProductUpdateOne

AddUniqueLimit adds i to the "unique_limit" field.

func (*ProductUpdateOne) ClearBundles

func (puo *ProductUpdateOne) ClearBundles() *ProductUpdateOne

ClearBundles clears all "bundles" edges to the Bundle entity.

func (*ProductUpdateOne) ClearDeletedAt

func (puo *ProductUpdateOne) ClearDeletedAt() *ProductUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*ProductUpdateOne) ClearExpiringTime

func (puo *ProductUpdateOne) ClearExpiringTime() *ProductUpdateOne

ClearExpiringTime clears the value of the "expiring_time" field.

func (*ProductUpdateOne) ClearInvoices

func (puo *ProductUpdateOne) ClearInvoices() *ProductUpdateOne

ClearInvoices clears all "invoices" edges to the Invoice entity.

func (*ProductUpdateOne) ClearIsExpiring

func (puo *ProductUpdateOne) ClearIsExpiring() *ProductUpdateOne

ClearIsExpiring clears the value of the "is_expiring" field.

func (*ProductUpdateOne) ClearIsUnique

func (puo *ProductUpdateOne) ClearIsUnique() *ProductUpdateOne

ClearIsUnique clears the value of the "is_unique" field.

func (*ProductUpdateOne) ClearLimitedTill

func (puo *ProductUpdateOne) ClearLimitedTill() *ProductUpdateOne

ClearLimitedTill clears the value of the "limited_till" field.

func (*ProductUpdateOne) ClearReservations

func (puo *ProductUpdateOne) ClearReservations() *ProductUpdateOne

ClearReservations clears all "reservations" edges to the ProductReservation entity.

func (*ProductUpdateOne) ClearSubscriptions

func (puo *ProductUpdateOne) ClearSubscriptions() *ProductUpdateOne

ClearSubscriptions clears all "subscriptions" edges to the Subscriptions entity.

func (*ProductUpdateOne) Exec

func (puo *ProductUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ProductUpdateOne) ExecX

func (puo *ProductUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductUpdateOne) Modify

func (puo *ProductUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *ProductUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*ProductUpdateOne) Mutation

func (puo *ProductUpdateOne) Mutation() *ProductMutation

Mutation returns the ProductMutation object of the builder.

func (*ProductUpdateOne) RemoveBundleIDs

func (puo *ProductUpdateOne) RemoveBundleIDs(ids ...int64) *ProductUpdateOne

RemoveBundleIDs removes the "bundles" edge to Bundle entities by IDs.

func (*ProductUpdateOne) RemoveBundles

func (puo *ProductUpdateOne) RemoveBundles(b ...*Bundle) *ProductUpdateOne

RemoveBundles removes "bundles" edges to Bundle entities.

func (*ProductUpdateOne) RemoveInvoiceIDs

func (puo *ProductUpdateOne) RemoveInvoiceIDs(ids ...int64) *ProductUpdateOne

RemoveInvoiceIDs removes the "invoices" edge to Invoice entities by IDs.

func (*ProductUpdateOne) RemoveInvoices

func (puo *ProductUpdateOne) RemoveInvoices(i ...*Invoice) *ProductUpdateOne

RemoveInvoices removes "invoices" edges to Invoice entities.

func (*ProductUpdateOne) RemoveReservationIDs

func (puo *ProductUpdateOne) RemoveReservationIDs(ids ...int64) *ProductUpdateOne

RemoveReservationIDs removes the "reservations" edge to ProductReservation entities by IDs.

func (*ProductUpdateOne) RemoveReservations

func (puo *ProductUpdateOne) RemoveReservations(p ...*ProductReservation) *ProductUpdateOne

RemoveReservations removes "reservations" edges to ProductReservation entities.

func (*ProductUpdateOne) RemoveSubscriptionIDs

func (puo *ProductUpdateOne) RemoveSubscriptionIDs(ids ...int64) *ProductUpdateOne

RemoveSubscriptionIDs removes the "subscriptions" edge to Subscriptions entities by IDs.

func (*ProductUpdateOne) RemoveSubscriptions

func (puo *ProductUpdateOne) RemoveSubscriptions(s ...*Subscriptions) *ProductUpdateOne

RemoveSubscriptions removes "subscriptions" edges to Subscriptions entities.

func (*ProductUpdateOne) Save

func (puo *ProductUpdateOne) Save(ctx context.Context) (*Product, error)

Save executes the query and returns the updated Product entity.

func (*ProductUpdateOne) SaveX

func (puo *ProductUpdateOne) SaveX(ctx context.Context) *Product

SaveX is like Save, but panics if an error occurs.

func (*ProductUpdateOne) Select

func (puo *ProductUpdateOne) Select(field string, fields ...string) *ProductUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ProductUpdateOne) SetAppID

func (puo *ProductUpdateOne) SetAppID(s string) *ProductUpdateOne

SetAppID sets the "app_id" field.

func (*ProductUpdateOne) SetCurrency

func (puo *ProductUpdateOne) SetCurrency(s string) *ProductUpdateOne

SetCurrency sets the "currency" field.

func (*ProductUpdateOne) SetDeletedAt

func (puo *ProductUpdateOne) SetDeletedAt(t time.Time) *ProductUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*ProductUpdateOne) SetDescription

func (puo *ProductUpdateOne) SetDescription(s string) *ProductUpdateOne

SetDescription sets the "description" field.

func (*ProductUpdateOne) SetExpiringTime

func (puo *ProductUpdateOne) SetExpiringTime(t time.Time) *ProductUpdateOne

SetExpiringTime sets the "expiring_time" field.

func (*ProductUpdateOne) SetIsActive

func (puo *ProductUpdateOne) SetIsActive(b bool) *ProductUpdateOne

SetIsActive sets the "is_active" field.

func (*ProductUpdateOne) SetIsExpiring

func (puo *ProductUpdateOne) SetIsExpiring(b bool) *ProductUpdateOne

SetIsExpiring sets the "is_expiring" field.

func (*ProductUpdateOne) SetIsLimited

func (puo *ProductUpdateOne) SetIsLimited(b bool) *ProductUpdateOne

SetIsLimited sets the "is_limited" field.

func (*ProductUpdateOne) SetIsUnique

func (puo *ProductUpdateOne) SetIsUnique(b bool) *ProductUpdateOne

SetIsUnique sets the "is_unique" field.

func (*ProductUpdateOne) SetLeft

func (puo *ProductUpdateOne) SetLeft(i int64) *ProductUpdateOne

SetLeft sets the "left" field.

func (*ProductUpdateOne) SetLimitedTill

func (puo *ProductUpdateOne) SetLimitedTill(t time.Time) *ProductUpdateOne

SetLimitedTill sets the "limited_till" field.

func (*ProductUpdateOne) SetName

func (puo *ProductUpdateOne) SetName(s string) *ProductUpdateOne

SetName sets the "name" field.

func (*ProductUpdateOne) SetNillableAppID

func (puo *ProductUpdateOne) SetNillableAppID(s *string) *ProductUpdateOne

SetNillableAppID sets the "app_id" field if the given value is not nil.

func (*ProductUpdateOne) SetNillableCurrency

func (puo *ProductUpdateOne) SetNillableCurrency(s *string) *ProductUpdateOne

SetNillableCurrency sets the "currency" field if the given value is not nil.

func (*ProductUpdateOne) SetNillableDeletedAt

func (puo *ProductUpdateOne) SetNillableDeletedAt(t *time.Time) *ProductUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*ProductUpdateOne) SetNillableDescription

func (puo *ProductUpdateOne) SetNillableDescription(s *string) *ProductUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*ProductUpdateOne) SetNillableExpiringTime

func (puo *ProductUpdateOne) SetNillableExpiringTime(t *time.Time) *ProductUpdateOne

SetNillableExpiringTime sets the "expiring_time" field if the given value is not nil.

func (*ProductUpdateOne) SetNillableIsActive

func (puo *ProductUpdateOne) SetNillableIsActive(b *bool) *ProductUpdateOne

SetNillableIsActive sets the "is_active" field if the given value is not nil.

func (*ProductUpdateOne) SetNillableIsExpiring

func (puo *ProductUpdateOne) SetNillableIsExpiring(b *bool) *ProductUpdateOne

SetNillableIsExpiring sets the "is_expiring" field if the given value is not nil.

func (*ProductUpdateOne) SetNillableIsLimited

func (puo *ProductUpdateOne) SetNillableIsLimited(b *bool) *ProductUpdateOne

SetNillableIsLimited sets the "is_limited" field if the given value is not nil.

func (*ProductUpdateOne) SetNillableIsUnique

func (puo *ProductUpdateOne) SetNillableIsUnique(b *bool) *ProductUpdateOne

SetNillableIsUnique sets the "is_unique" field if the given value is not nil.

func (*ProductUpdateOne) SetNillableLeft

func (puo *ProductUpdateOne) SetNillableLeft(i *int64) *ProductUpdateOne

SetNillableLeft sets the "left" field if the given value is not nil.

func (*ProductUpdateOne) SetNillableLimitedTill

func (puo *ProductUpdateOne) SetNillableLimitedTill(t *time.Time) *ProductUpdateOne

SetNillableLimitedTill sets the "limited_till" field if the given value is not nil.

func (*ProductUpdateOne) SetNillableName

func (puo *ProductUpdateOne) SetNillableName(s *string) *ProductUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*ProductUpdateOne) SetNillablePaymentModel

func (puo *ProductUpdateOne) SetNillablePaymentModel(em *enum.PaymentModel) *ProductUpdateOne

SetNillablePaymentModel sets the "payment_model" field if the given value is not nil.

func (*ProductUpdateOne) SetNillablePrice

func (puo *ProductUpdateOne) SetNillablePrice(d *decimal.Decimal) *ProductUpdateOne

SetNillablePrice sets the "price" field if the given value is not nil.

func (*ProductUpdateOne) SetNillableProductPeriod

func (puo *ProductUpdateOne) SetNillableProductPeriod(ep *enum.ProductPeriod) *ProductUpdateOne

SetNillableProductPeriod sets the "product_period" field if the given value is not nil.

func (*ProductUpdateOne) SetNillableUniqueLimit

func (puo *ProductUpdateOne) SetNillableUniqueLimit(i *int64) *ProductUpdateOne

SetNillableUniqueLimit sets the "unique_limit" field if the given value is not nil.

func (*ProductUpdateOne) SetPaymentModel

func (puo *ProductUpdateOne) SetPaymentModel(em enum.PaymentModel) *ProductUpdateOne

SetPaymentModel sets the "payment_model" field.

func (*ProductUpdateOne) SetPrice

SetPrice sets the "price" field.

func (*ProductUpdateOne) SetProductPeriod

func (puo *ProductUpdateOne) SetProductPeriod(ep enum.ProductPeriod) *ProductUpdateOne

SetProductPeriod sets the "product_period" field.

func (*ProductUpdateOne) SetUniqueLimit

func (puo *ProductUpdateOne) SetUniqueLimit(i int64) *ProductUpdateOne

SetUniqueLimit sets the "unique_limit" field.

func (*ProductUpdateOne) SetUpdatedAt

func (puo *ProductUpdateOne) SetUpdatedAt(t time.Time) *ProductUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ProductUpdateOne) Where

Where appends a list predicates to the ProductUpdate builder.

type ProductUpsert

type ProductUpsert struct {
	*sql.UpdateSet
}

ProductUpsert is the "OnConflict" setter.

func (*ProductUpsert) AddLeft

func (u *ProductUpsert) AddLeft(v int64) *ProductUpsert

AddLeft adds v to the "left" field.

func (*ProductUpsert) AddPrice

func (u *ProductUpsert) AddPrice(v decimal.Decimal) *ProductUpsert

AddPrice adds v to the "price" field.

func (*ProductUpsert) AddUniqueLimit

func (u *ProductUpsert) AddUniqueLimit(v int64) *ProductUpsert

AddUniqueLimit adds v to the "unique_limit" field.

func (*ProductUpsert) ClearDeletedAt

func (u *ProductUpsert) ClearDeletedAt() *ProductUpsert

ClearDeletedAt clears the value of the "deleted_at" field.

func (*ProductUpsert) ClearExpiringTime

func (u *ProductUpsert) ClearExpiringTime() *ProductUpsert

ClearExpiringTime clears the value of the "expiring_time" field.

func (*ProductUpsert) ClearIsExpiring

func (u *ProductUpsert) ClearIsExpiring() *ProductUpsert

ClearIsExpiring clears the value of the "is_expiring" field.

func (*ProductUpsert) ClearIsUnique

func (u *ProductUpsert) ClearIsUnique() *ProductUpsert

ClearIsUnique clears the value of the "is_unique" field.

func (*ProductUpsert) ClearLimitedTill

func (u *ProductUpsert) ClearLimitedTill() *ProductUpsert

ClearLimitedTill clears the value of the "limited_till" field.

func (*ProductUpsert) SetAppID

func (u *ProductUpsert) SetAppID(v string) *ProductUpsert

SetAppID sets the "app_id" field.

func (*ProductUpsert) SetCurrency

func (u *ProductUpsert) SetCurrency(v string) *ProductUpsert

SetCurrency sets the "currency" field.

func (*ProductUpsert) SetDeletedAt

func (u *ProductUpsert) SetDeletedAt(v time.Time) *ProductUpsert

SetDeletedAt sets the "deleted_at" field.

func (*ProductUpsert) SetDescription

func (u *ProductUpsert) SetDescription(v string) *ProductUpsert

SetDescription sets the "description" field.

func (*ProductUpsert) SetExpiringTime

func (u *ProductUpsert) SetExpiringTime(v time.Time) *ProductUpsert

SetExpiringTime sets the "expiring_time" field.

func (*ProductUpsert) SetIsActive

func (u *ProductUpsert) SetIsActive(v bool) *ProductUpsert

SetIsActive sets the "is_active" field.

func (*ProductUpsert) SetIsExpiring

func (u *ProductUpsert) SetIsExpiring(v bool) *ProductUpsert

SetIsExpiring sets the "is_expiring" field.

func (*ProductUpsert) SetIsLimited

func (u *ProductUpsert) SetIsLimited(v bool) *ProductUpsert

SetIsLimited sets the "is_limited" field.

func (*ProductUpsert) SetIsUnique

func (u *ProductUpsert) SetIsUnique(v bool) *ProductUpsert

SetIsUnique sets the "is_unique" field.

func (*ProductUpsert) SetLeft

func (u *ProductUpsert) SetLeft(v int64) *ProductUpsert

SetLeft sets the "left" field.

func (*ProductUpsert) SetLimitedTill

func (u *ProductUpsert) SetLimitedTill(v time.Time) *ProductUpsert

SetLimitedTill sets the "limited_till" field.

func (*ProductUpsert) SetName

func (u *ProductUpsert) SetName(v string) *ProductUpsert

SetName sets the "name" field.

func (*ProductUpsert) SetPaymentModel

func (u *ProductUpsert) SetPaymentModel(v enum.PaymentModel) *ProductUpsert

SetPaymentModel sets the "payment_model" field.

func (*ProductUpsert) SetPrice

func (u *ProductUpsert) SetPrice(v decimal.Decimal) *ProductUpsert

SetPrice sets the "price" field.

func (*ProductUpsert) SetProductPeriod

func (u *ProductUpsert) SetProductPeriod(v enum.ProductPeriod) *ProductUpsert

SetProductPeriod sets the "product_period" field.

func (*ProductUpsert) SetUniqueLimit

func (u *ProductUpsert) SetUniqueLimit(v int64) *ProductUpsert

SetUniqueLimit sets the "unique_limit" field.

func (*ProductUpsert) SetUpdatedAt

func (u *ProductUpsert) SetUpdatedAt(v time.Time) *ProductUpsert

SetUpdatedAt sets the "updated_at" field.

func (*ProductUpsert) UpdateAppID

func (u *ProductUpsert) UpdateAppID() *ProductUpsert

UpdateAppID sets the "app_id" field to the value that was provided on create.

func (*ProductUpsert) UpdateCurrency

func (u *ProductUpsert) UpdateCurrency() *ProductUpsert

UpdateCurrency sets the "currency" field to the value that was provided on create.

func (*ProductUpsert) UpdateDeletedAt

func (u *ProductUpsert) UpdateDeletedAt() *ProductUpsert

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*ProductUpsert) UpdateDescription

func (u *ProductUpsert) UpdateDescription() *ProductUpsert

UpdateDescription sets the "description" field to the value that was provided on create.

func (*ProductUpsert) UpdateExpiringTime

func (u *ProductUpsert) UpdateExpiringTime() *ProductUpsert

UpdateExpiringTime sets the "expiring_time" field to the value that was provided on create.

func (*ProductUpsert) UpdateIsActive

func (u *ProductUpsert) UpdateIsActive() *ProductUpsert

UpdateIsActive sets the "is_active" field to the value that was provided on create.

func (*ProductUpsert) UpdateIsExpiring

func (u *ProductUpsert) UpdateIsExpiring() *ProductUpsert

UpdateIsExpiring sets the "is_expiring" field to the value that was provided on create.

func (*ProductUpsert) UpdateIsLimited

func (u *ProductUpsert) UpdateIsLimited() *ProductUpsert

UpdateIsLimited sets the "is_limited" field to the value that was provided on create.

func (*ProductUpsert) UpdateIsUnique

func (u *ProductUpsert) UpdateIsUnique() *ProductUpsert

UpdateIsUnique sets the "is_unique" field to the value that was provided on create.

func (*ProductUpsert) UpdateLeft

func (u *ProductUpsert) UpdateLeft() *ProductUpsert

UpdateLeft sets the "left" field to the value that was provided on create.

func (*ProductUpsert) UpdateLimitedTill

func (u *ProductUpsert) UpdateLimitedTill() *ProductUpsert

UpdateLimitedTill sets the "limited_till" field to the value that was provided on create.

func (*ProductUpsert) UpdateName

func (u *ProductUpsert) UpdateName() *ProductUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*ProductUpsert) UpdatePaymentModel

func (u *ProductUpsert) UpdatePaymentModel() *ProductUpsert

UpdatePaymentModel sets the "payment_model" field to the value that was provided on create.

func (*ProductUpsert) UpdatePrice

func (u *ProductUpsert) UpdatePrice() *ProductUpsert

UpdatePrice sets the "price" field to the value that was provided on create.

func (*ProductUpsert) UpdateProductPeriod

func (u *ProductUpsert) UpdateProductPeriod() *ProductUpsert

UpdateProductPeriod sets the "product_period" field to the value that was provided on create.

func (*ProductUpsert) UpdateUniqueLimit

func (u *ProductUpsert) UpdateUniqueLimit() *ProductUpsert

UpdateUniqueLimit sets the "unique_limit" field to the value that was provided on create.

func (*ProductUpsert) UpdateUpdatedAt

func (u *ProductUpsert) UpdateUpdatedAt() *ProductUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type ProductUpsertBulk

type ProductUpsertBulk struct {
	// contains filtered or unexported fields
}

ProductUpsertBulk is the builder for "upsert"-ing a bulk of Product nodes.

func (*ProductUpsertBulk) AddLeft

func (u *ProductUpsertBulk) AddLeft(v int64) *ProductUpsertBulk

AddLeft adds v to the "left" field.

func (*ProductUpsertBulk) AddPrice

AddPrice adds v to the "price" field.

func (*ProductUpsertBulk) AddUniqueLimit

func (u *ProductUpsertBulk) AddUniqueLimit(v int64) *ProductUpsertBulk

AddUniqueLimit adds v to the "unique_limit" field.

func (*ProductUpsertBulk) ClearDeletedAt

func (u *ProductUpsertBulk) ClearDeletedAt() *ProductUpsertBulk

ClearDeletedAt clears the value of the "deleted_at" field.

func (*ProductUpsertBulk) ClearExpiringTime

func (u *ProductUpsertBulk) ClearExpiringTime() *ProductUpsertBulk

ClearExpiringTime clears the value of the "expiring_time" field.

func (*ProductUpsertBulk) ClearIsExpiring

func (u *ProductUpsertBulk) ClearIsExpiring() *ProductUpsertBulk

ClearIsExpiring clears the value of the "is_expiring" field.

func (*ProductUpsertBulk) ClearIsUnique

func (u *ProductUpsertBulk) ClearIsUnique() *ProductUpsertBulk

ClearIsUnique clears the value of the "is_unique" field.

func (*ProductUpsertBulk) ClearLimitedTill

func (u *ProductUpsertBulk) ClearLimitedTill() *ProductUpsertBulk

ClearLimitedTill clears the value of the "limited_till" field.

func (*ProductUpsertBulk) DoNothing

func (u *ProductUpsertBulk) DoNothing() *ProductUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ProductUpsertBulk) Exec

func (u *ProductUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductUpsertBulk) ExecX

func (u *ProductUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductUpsertBulk) Ignore

func (u *ProductUpsertBulk) Ignore() *ProductUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Product.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*ProductUpsertBulk) SetAppID

func (u *ProductUpsertBulk) SetAppID(v string) *ProductUpsertBulk

SetAppID sets the "app_id" field.

func (*ProductUpsertBulk) SetCurrency

func (u *ProductUpsertBulk) SetCurrency(v string) *ProductUpsertBulk

SetCurrency sets the "currency" field.

func (*ProductUpsertBulk) SetDeletedAt

func (u *ProductUpsertBulk) SetDeletedAt(v time.Time) *ProductUpsertBulk

SetDeletedAt sets the "deleted_at" field.

func (*ProductUpsertBulk) SetDescription

func (u *ProductUpsertBulk) SetDescription(v string) *ProductUpsertBulk

SetDescription sets the "description" field.

func (*ProductUpsertBulk) SetExpiringTime

func (u *ProductUpsertBulk) SetExpiringTime(v time.Time) *ProductUpsertBulk

SetExpiringTime sets the "expiring_time" field.

func (*ProductUpsertBulk) SetIsActive

func (u *ProductUpsertBulk) SetIsActive(v bool) *ProductUpsertBulk

SetIsActive sets the "is_active" field.

func (*ProductUpsertBulk) SetIsExpiring

func (u *ProductUpsertBulk) SetIsExpiring(v bool) *ProductUpsertBulk

SetIsExpiring sets the "is_expiring" field.

func (*ProductUpsertBulk) SetIsLimited

func (u *ProductUpsertBulk) SetIsLimited(v bool) *ProductUpsertBulk

SetIsLimited sets the "is_limited" field.

func (*ProductUpsertBulk) SetIsUnique

func (u *ProductUpsertBulk) SetIsUnique(v bool) *ProductUpsertBulk

SetIsUnique sets the "is_unique" field.

func (*ProductUpsertBulk) SetLeft

func (u *ProductUpsertBulk) SetLeft(v int64) *ProductUpsertBulk

SetLeft sets the "left" field.

func (*ProductUpsertBulk) SetLimitedTill

func (u *ProductUpsertBulk) SetLimitedTill(v time.Time) *ProductUpsertBulk

SetLimitedTill sets the "limited_till" field.

func (*ProductUpsertBulk) SetName

SetName sets the "name" field.

func (*ProductUpsertBulk) SetPaymentModel

func (u *ProductUpsertBulk) SetPaymentModel(v enum.PaymentModel) *ProductUpsertBulk

SetPaymentModel sets the "payment_model" field.

func (*ProductUpsertBulk) SetPrice

SetPrice sets the "price" field.

func (*ProductUpsertBulk) SetProductPeriod

func (u *ProductUpsertBulk) SetProductPeriod(v enum.ProductPeriod) *ProductUpsertBulk

SetProductPeriod sets the "product_period" field.

func (*ProductUpsertBulk) SetUniqueLimit

func (u *ProductUpsertBulk) SetUniqueLimit(v int64) *ProductUpsertBulk

SetUniqueLimit sets the "unique_limit" field.

func (*ProductUpsertBulk) SetUpdatedAt

func (u *ProductUpsertBulk) SetUpdatedAt(v time.Time) *ProductUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*ProductUpsertBulk) Update

func (u *ProductUpsertBulk) Update(set func(*ProductUpsert)) *ProductUpsertBulk

Update allows overriding fields `UPDATE` values. See the ProductCreateBulk.OnConflict documentation for more info.

func (*ProductUpsertBulk) UpdateAppID

func (u *ProductUpsertBulk) UpdateAppID() *ProductUpsertBulk

UpdateAppID sets the "app_id" field to the value that was provided on create.

func (*ProductUpsertBulk) UpdateCurrency

func (u *ProductUpsertBulk) UpdateCurrency() *ProductUpsertBulk

UpdateCurrency sets the "currency" field to the value that was provided on create.

func (*ProductUpsertBulk) UpdateDeletedAt

func (u *ProductUpsertBulk) UpdateDeletedAt() *ProductUpsertBulk

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*ProductUpsertBulk) UpdateDescription

func (u *ProductUpsertBulk) UpdateDescription() *ProductUpsertBulk

UpdateDescription sets the "description" field to the value that was provided on create.

func (*ProductUpsertBulk) UpdateExpiringTime

func (u *ProductUpsertBulk) UpdateExpiringTime() *ProductUpsertBulk

UpdateExpiringTime sets the "expiring_time" field to the value that was provided on create.

func (*ProductUpsertBulk) UpdateIsActive

func (u *ProductUpsertBulk) UpdateIsActive() *ProductUpsertBulk

UpdateIsActive sets the "is_active" field to the value that was provided on create.

func (*ProductUpsertBulk) UpdateIsExpiring

func (u *ProductUpsertBulk) UpdateIsExpiring() *ProductUpsertBulk

UpdateIsExpiring sets the "is_expiring" field to the value that was provided on create.

func (*ProductUpsertBulk) UpdateIsLimited

func (u *ProductUpsertBulk) UpdateIsLimited() *ProductUpsertBulk

UpdateIsLimited sets the "is_limited" field to the value that was provided on create.

func (*ProductUpsertBulk) UpdateIsUnique

func (u *ProductUpsertBulk) UpdateIsUnique() *ProductUpsertBulk

UpdateIsUnique sets the "is_unique" field to the value that was provided on create.

func (*ProductUpsertBulk) UpdateLeft

func (u *ProductUpsertBulk) UpdateLeft() *ProductUpsertBulk

UpdateLeft sets the "left" field to the value that was provided on create.

func (*ProductUpsertBulk) UpdateLimitedTill

func (u *ProductUpsertBulk) UpdateLimitedTill() *ProductUpsertBulk

UpdateLimitedTill sets the "limited_till" field to the value that was provided on create.

func (*ProductUpsertBulk) UpdateName

func (u *ProductUpsertBulk) UpdateName() *ProductUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*ProductUpsertBulk) UpdateNewValues

func (u *ProductUpsertBulk) UpdateNewValues() *ProductUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Product.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(product.FieldID)
		}),
	).
	Exec(ctx)

func (*ProductUpsertBulk) UpdatePaymentModel

func (u *ProductUpsertBulk) UpdatePaymentModel() *ProductUpsertBulk

UpdatePaymentModel sets the "payment_model" field to the value that was provided on create.

func (*ProductUpsertBulk) UpdatePrice

func (u *ProductUpsertBulk) UpdatePrice() *ProductUpsertBulk

UpdatePrice sets the "price" field to the value that was provided on create.

func (*ProductUpsertBulk) UpdateProductPeriod

func (u *ProductUpsertBulk) UpdateProductPeriod() *ProductUpsertBulk

UpdateProductPeriod sets the "product_period" field to the value that was provided on create.

func (*ProductUpsertBulk) UpdateUniqueLimit

func (u *ProductUpsertBulk) UpdateUniqueLimit() *ProductUpsertBulk

UpdateUniqueLimit sets the "unique_limit" field to the value that was provided on create.

func (*ProductUpsertBulk) UpdateUpdatedAt

func (u *ProductUpsertBulk) UpdateUpdatedAt() *ProductUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type ProductUpsertOne

type ProductUpsertOne struct {
	// contains filtered or unexported fields
}

ProductUpsertOne is the builder for "upsert"-ing

one Product node.

func (*ProductUpsertOne) AddLeft

func (u *ProductUpsertOne) AddLeft(v int64) *ProductUpsertOne

AddLeft adds v to the "left" field.

func (*ProductUpsertOne) AddPrice

AddPrice adds v to the "price" field.

func (*ProductUpsertOne) AddUniqueLimit

func (u *ProductUpsertOne) AddUniqueLimit(v int64) *ProductUpsertOne

AddUniqueLimit adds v to the "unique_limit" field.

func (*ProductUpsertOne) ClearDeletedAt

func (u *ProductUpsertOne) ClearDeletedAt() *ProductUpsertOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*ProductUpsertOne) ClearExpiringTime

func (u *ProductUpsertOne) ClearExpiringTime() *ProductUpsertOne

ClearExpiringTime clears the value of the "expiring_time" field.

func (*ProductUpsertOne) ClearIsExpiring

func (u *ProductUpsertOne) ClearIsExpiring() *ProductUpsertOne

ClearIsExpiring clears the value of the "is_expiring" field.

func (*ProductUpsertOne) ClearIsUnique

func (u *ProductUpsertOne) ClearIsUnique() *ProductUpsertOne

ClearIsUnique clears the value of the "is_unique" field.

func (*ProductUpsertOne) ClearLimitedTill

func (u *ProductUpsertOne) ClearLimitedTill() *ProductUpsertOne

ClearLimitedTill clears the value of the "limited_till" field.

func (*ProductUpsertOne) DoNothing

func (u *ProductUpsertOne) DoNothing() *ProductUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ProductUpsertOne) Exec

func (u *ProductUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductUpsertOne) ExecX

func (u *ProductUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductUpsertOne) ID

func (u *ProductUpsertOne) ID(ctx context.Context) (id int64, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*ProductUpsertOne) IDX

func (u *ProductUpsertOne) IDX(ctx context.Context) int64

IDX is like ID, but panics if an error occurs.

func (*ProductUpsertOne) Ignore

func (u *ProductUpsertOne) Ignore() *ProductUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Product.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*ProductUpsertOne) SetAppID

func (u *ProductUpsertOne) SetAppID(v string) *ProductUpsertOne

SetAppID sets the "app_id" field.

func (*ProductUpsertOne) SetCurrency

func (u *ProductUpsertOne) SetCurrency(v string) *ProductUpsertOne

SetCurrency sets the "currency" field.

func (*ProductUpsertOne) SetDeletedAt

func (u *ProductUpsertOne) SetDeletedAt(v time.Time) *ProductUpsertOne

SetDeletedAt sets the "deleted_at" field.

func (*ProductUpsertOne) SetDescription

func (u *ProductUpsertOne) SetDescription(v string) *ProductUpsertOne

SetDescription sets the "description" field.

func (*ProductUpsertOne) SetExpiringTime

func (u *ProductUpsertOne) SetExpiringTime(v time.Time) *ProductUpsertOne

SetExpiringTime sets the "expiring_time" field.

func (*ProductUpsertOne) SetIsActive

func (u *ProductUpsertOne) SetIsActive(v bool) *ProductUpsertOne

SetIsActive sets the "is_active" field.

func (*ProductUpsertOne) SetIsExpiring

func (u *ProductUpsertOne) SetIsExpiring(v bool) *ProductUpsertOne

SetIsExpiring sets the "is_expiring" field.

func (*ProductUpsertOne) SetIsLimited

func (u *ProductUpsertOne) SetIsLimited(v bool) *ProductUpsertOne

SetIsLimited sets the "is_limited" field.

func (*ProductUpsertOne) SetIsUnique

func (u *ProductUpsertOne) SetIsUnique(v bool) *ProductUpsertOne

SetIsUnique sets the "is_unique" field.

func (*ProductUpsertOne) SetLeft

func (u *ProductUpsertOne) SetLeft(v int64) *ProductUpsertOne

SetLeft sets the "left" field.

func (*ProductUpsertOne) SetLimitedTill

func (u *ProductUpsertOne) SetLimitedTill(v time.Time) *ProductUpsertOne

SetLimitedTill sets the "limited_till" field.

func (*ProductUpsertOne) SetName

func (u *ProductUpsertOne) SetName(v string) *ProductUpsertOne

SetName sets the "name" field.

func (*ProductUpsertOne) SetPaymentModel

func (u *ProductUpsertOne) SetPaymentModel(v enum.PaymentModel) *ProductUpsertOne

SetPaymentModel sets the "payment_model" field.

func (*ProductUpsertOne) SetPrice

SetPrice sets the "price" field.

func (*ProductUpsertOne) SetProductPeriod

func (u *ProductUpsertOne) SetProductPeriod(v enum.ProductPeriod) *ProductUpsertOne

SetProductPeriod sets the "product_period" field.

func (*ProductUpsertOne) SetUniqueLimit

func (u *ProductUpsertOne) SetUniqueLimit(v int64) *ProductUpsertOne

SetUniqueLimit sets the "unique_limit" field.

func (*ProductUpsertOne) SetUpdatedAt

func (u *ProductUpsertOne) SetUpdatedAt(v time.Time) *ProductUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*ProductUpsertOne) Update

func (u *ProductUpsertOne) Update(set func(*ProductUpsert)) *ProductUpsertOne

Update allows overriding fields `UPDATE` values. See the ProductCreate.OnConflict documentation for more info.

func (*ProductUpsertOne) UpdateAppID

func (u *ProductUpsertOne) UpdateAppID() *ProductUpsertOne

UpdateAppID sets the "app_id" field to the value that was provided on create.

func (*ProductUpsertOne) UpdateCurrency

func (u *ProductUpsertOne) UpdateCurrency() *ProductUpsertOne

UpdateCurrency sets the "currency" field to the value that was provided on create.

func (*ProductUpsertOne) UpdateDeletedAt

func (u *ProductUpsertOne) UpdateDeletedAt() *ProductUpsertOne

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*ProductUpsertOne) UpdateDescription

func (u *ProductUpsertOne) UpdateDescription() *ProductUpsertOne

UpdateDescription sets the "description" field to the value that was provided on create.

func (*ProductUpsertOne) UpdateExpiringTime

func (u *ProductUpsertOne) UpdateExpiringTime() *ProductUpsertOne

UpdateExpiringTime sets the "expiring_time" field to the value that was provided on create.

func (*ProductUpsertOne) UpdateIsActive

func (u *ProductUpsertOne) UpdateIsActive() *ProductUpsertOne

UpdateIsActive sets the "is_active" field to the value that was provided on create.

func (*ProductUpsertOne) UpdateIsExpiring

func (u *ProductUpsertOne) UpdateIsExpiring() *ProductUpsertOne

UpdateIsExpiring sets the "is_expiring" field to the value that was provided on create.

func (*ProductUpsertOne) UpdateIsLimited

func (u *ProductUpsertOne) UpdateIsLimited() *ProductUpsertOne

UpdateIsLimited sets the "is_limited" field to the value that was provided on create.

func (*ProductUpsertOne) UpdateIsUnique

func (u *ProductUpsertOne) UpdateIsUnique() *ProductUpsertOne

UpdateIsUnique sets the "is_unique" field to the value that was provided on create.

func (*ProductUpsertOne) UpdateLeft

func (u *ProductUpsertOne) UpdateLeft() *ProductUpsertOne

UpdateLeft sets the "left" field to the value that was provided on create.

func (*ProductUpsertOne) UpdateLimitedTill

func (u *ProductUpsertOne) UpdateLimitedTill() *ProductUpsertOne

UpdateLimitedTill sets the "limited_till" field to the value that was provided on create.

func (*ProductUpsertOne) UpdateName

func (u *ProductUpsertOne) UpdateName() *ProductUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*ProductUpsertOne) UpdateNewValues

func (u *ProductUpsertOne) UpdateNewValues() *ProductUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Product.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(product.FieldID)
		}),
	).
	Exec(ctx)

func (*ProductUpsertOne) UpdatePaymentModel

func (u *ProductUpsertOne) UpdatePaymentModel() *ProductUpsertOne

UpdatePaymentModel sets the "payment_model" field to the value that was provided on create.

func (*ProductUpsertOne) UpdatePrice

func (u *ProductUpsertOne) UpdatePrice() *ProductUpsertOne

UpdatePrice sets the "price" field to the value that was provided on create.

func (*ProductUpsertOne) UpdateProductPeriod

func (u *ProductUpsertOne) UpdateProductPeriod() *ProductUpsertOne

UpdateProductPeriod sets the "product_period" field to the value that was provided on create.

func (*ProductUpsertOne) UpdateUniqueLimit

func (u *ProductUpsertOne) UpdateUniqueLimit() *ProductUpsertOne

UpdateUniqueLimit sets the "unique_limit" field to the value that was provided on create.

func (*ProductUpsertOne) UpdateUpdatedAt

func (u *ProductUpsertOne) UpdateUpdatedAt() *ProductUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type Products

type Products []*Product

Products is a parsable slice of Product.

type Querier

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type QueryContext

type QueryContext = ent.QueryContext

ent aliases to avoid import conflicts in user's code.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type Subscriptions

type Subscriptions struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID int64 `json:"user_id,omitempty"`
	// TenantID holds the value of the "tenant_id" field.
	TenantID int64 `json:"tenant_id,omitempty"`
	// AppID holds the value of the "app_id" field.
	AppID string `json:"app_id,omitempty"`
	// ProductID holds the value of the "product_id" field.
	ProductID int64 `json:"product_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SubscriptionsQuery when eager-loading is set.
	Edges SubscriptionsEdges `json:"edges"`
	// contains filtered or unexported fields
}

Subscriptions is the model entity for the Subscriptions schema.

func (*Subscriptions) QueryInvoices

func (s *Subscriptions) QueryInvoices() *InvoiceQuery

QueryInvoices queries the "invoices" edge of the Subscriptions entity.

func (*Subscriptions) QueryProduct

func (s *Subscriptions) QueryProduct() *ProductQuery

QueryProduct queries the "product" edge of the Subscriptions entity.

func (*Subscriptions) String

func (s *Subscriptions) String() string

String implements the fmt.Stringer.

func (*Subscriptions) Unwrap

func (s *Subscriptions) Unwrap() *Subscriptions

Unwrap unwraps the Subscriptions entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Subscriptions) Update

Update returns a builder for updating this Subscriptions. Note that you need to call Subscriptions.Unwrap() before calling this method if this Subscriptions was returned from a transaction, and the transaction was committed or rolled back.

func (*Subscriptions) Value

func (s *Subscriptions) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Subscriptions. This includes values selected through modifiers, order, etc.

type SubscriptionsClient

type SubscriptionsClient struct {
	// contains filtered or unexported fields
}

SubscriptionsClient is a client for the Subscriptions schema.

func NewSubscriptionsClient

func NewSubscriptionsClient(c config) *SubscriptionsClient

NewSubscriptionsClient returns a client for the Subscriptions from the given config.

func (*SubscriptionsClient) Create

Create returns a builder for creating a Subscriptions entity.

func (*SubscriptionsClient) CreateBulk

CreateBulk returns a builder for creating a bulk of Subscriptions entities.

func (*SubscriptionsClient) Delete

Delete returns a delete builder for Subscriptions.

func (*SubscriptionsClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SubscriptionsClient) DeleteOneID

func (c *SubscriptionsClient) DeleteOneID(id int64) *SubscriptionsDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*SubscriptionsClient) Get

Get returns a Subscriptions entity by its id.

func (*SubscriptionsClient) GetX

GetX is like Get, but panics if an error occurs.

func (*SubscriptionsClient) Hooks

func (c *SubscriptionsClient) Hooks() []Hook

Hooks returns the client hooks.

func (*SubscriptionsClient) Intercept

func (c *SubscriptionsClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `subscriptions.Intercept(f(g(h())))`.

func (*SubscriptionsClient) Interceptors

func (c *SubscriptionsClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*SubscriptionsClient) MapCreateBulk

func (c *SubscriptionsClient) MapCreateBulk(slice any, setFunc func(*SubscriptionsCreate, int)) *SubscriptionsCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*SubscriptionsClient) Query

Query returns a query builder for Subscriptions.

func (*SubscriptionsClient) QueryInvoices

func (c *SubscriptionsClient) QueryInvoices(s *Subscriptions) *InvoiceQuery

QueryInvoices queries the invoices edge of a Subscriptions.

func (*SubscriptionsClient) QueryProduct

func (c *SubscriptionsClient) QueryProduct(s *Subscriptions) *ProductQuery

QueryProduct queries the product edge of a Subscriptions.

func (*SubscriptionsClient) Update

Update returns an update builder for Subscriptions.

func (*SubscriptionsClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*SubscriptionsClient) UpdateOneID

func (c *SubscriptionsClient) UpdateOneID(id int64) *SubscriptionsUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SubscriptionsClient) Use

func (c *SubscriptionsClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `subscriptions.Hooks(f(g(h())))`.

type SubscriptionsCreate

type SubscriptionsCreate struct {
	// contains filtered or unexported fields
}

SubscriptionsCreate is the builder for creating a Subscriptions entity.

func (*SubscriptionsCreate) AddInvoiceIDs

func (sc *SubscriptionsCreate) AddInvoiceIDs(ids ...int64) *SubscriptionsCreate

AddInvoiceIDs adds the "invoices" edge to the Invoice entity by IDs.

func (*SubscriptionsCreate) AddInvoices

func (sc *SubscriptionsCreate) AddInvoices(i ...*Invoice) *SubscriptionsCreate

AddInvoices adds the "invoices" edges to the Invoice entity.

func (*SubscriptionsCreate) Exec

func (sc *SubscriptionsCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SubscriptionsCreate) ExecX

func (sc *SubscriptionsCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SubscriptionsCreate) Mutation

Mutation returns the SubscriptionsMutation object of the builder.

func (*SubscriptionsCreate) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Subscriptions.Create().
	SetUserID(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.SubscriptionsUpsert) {
		SetUserID(v+v).
	}).
	Exec(ctx)

func (*SubscriptionsCreate) OnConflictColumns

func (sc *SubscriptionsCreate) OnConflictColumns(columns ...string) *SubscriptionsUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Subscriptions.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*SubscriptionsCreate) Save

Save creates the Subscriptions in the database.

func (*SubscriptionsCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*SubscriptionsCreate) SetAppID

SetAppID sets the "app_id" field.

func (*SubscriptionsCreate) SetID

SetID sets the "id" field.

func (*SubscriptionsCreate) SetProduct

func (sc *SubscriptionsCreate) SetProduct(p *Product) *SubscriptionsCreate

SetProduct sets the "product" edge to the Product entity.

func (*SubscriptionsCreate) SetProductID

func (sc *SubscriptionsCreate) SetProductID(i int64) *SubscriptionsCreate

SetProductID sets the "product_id" field.

func (*SubscriptionsCreate) SetTenantID

func (sc *SubscriptionsCreate) SetTenantID(i int64) *SubscriptionsCreate

SetTenantID sets the "tenant_id" field.

func (*SubscriptionsCreate) SetUserID

func (sc *SubscriptionsCreate) SetUserID(i int64) *SubscriptionsCreate

SetUserID sets the "user_id" field.

type SubscriptionsCreateBulk

type SubscriptionsCreateBulk struct {
	// contains filtered or unexported fields
}

SubscriptionsCreateBulk is the builder for creating many Subscriptions entities in bulk.

func (*SubscriptionsCreateBulk) Exec

Exec executes the query.

func (*SubscriptionsCreateBulk) ExecX

func (scb *SubscriptionsCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SubscriptionsCreateBulk) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Subscriptions.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.SubscriptionsUpsert) {
		SetUserID(v+v).
	}).
	Exec(ctx)

func (*SubscriptionsCreateBulk) OnConflictColumns

func (scb *SubscriptionsCreateBulk) OnConflictColumns(columns ...string) *SubscriptionsUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Subscriptions.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*SubscriptionsCreateBulk) Save

Save creates the Subscriptions entities in the database.

func (*SubscriptionsCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type SubscriptionsDelete

type SubscriptionsDelete struct {
	// contains filtered or unexported fields
}

SubscriptionsDelete is the builder for deleting a Subscriptions entity.

func (*SubscriptionsDelete) Exec

func (sd *SubscriptionsDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*SubscriptionsDelete) ExecX

func (sd *SubscriptionsDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*SubscriptionsDelete) Where

Where appends a list predicates to the SubscriptionsDelete builder.

type SubscriptionsDeleteOne

type SubscriptionsDeleteOne struct {
	// contains filtered or unexported fields
}

SubscriptionsDeleteOne is the builder for deleting a single Subscriptions entity.

func (*SubscriptionsDeleteOne) Exec

Exec executes the deletion query.

func (*SubscriptionsDeleteOne) ExecX

func (sdo *SubscriptionsDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SubscriptionsDeleteOne) Where

Where appends a list predicates to the SubscriptionsDelete builder.

type SubscriptionsEdges

type SubscriptionsEdges struct {
	// Invoices holds the value of the invoices edge.
	Invoices []*Invoice `json:"invoices,omitempty"`
	// Product holds the value of the product edge.
	Product *Product `json:"product,omitempty"`
	// contains filtered or unexported fields
}

SubscriptionsEdges holds the relations/edges for other nodes in the graph.

func (SubscriptionsEdges) InvoicesOrErr

func (e SubscriptionsEdges) InvoicesOrErr() ([]*Invoice, error)

InvoicesOrErr returns the Invoices value or an error if the edge was not loaded in eager-loading.

func (SubscriptionsEdges) ProductOrErr

func (e SubscriptionsEdges) ProductOrErr() (*Product, error)

ProductOrErr returns the Product value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type SubscriptionsFilter

type SubscriptionsFilter struct {
	// contains filtered or unexported fields
}

SubscriptionsFilter provides a generic filtering capability at runtime for SubscriptionsQuery.

func (*SubscriptionsFilter) Where

func (f *SubscriptionsFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*SubscriptionsFilter) WhereAppID

func (f *SubscriptionsFilter) WhereAppID(p entql.StringP)

WhereAppID applies the entql string predicate on the app_id field.

func (*SubscriptionsFilter) WhereHasInvoices

func (f *SubscriptionsFilter) WhereHasInvoices()

WhereHasInvoices applies a predicate to check if query has an edge invoices.

func (*SubscriptionsFilter) WhereHasInvoicesWith

func (f *SubscriptionsFilter) WhereHasInvoicesWith(preds ...predicate.Invoice)

WhereHasInvoicesWith applies a predicate to check if query has an edge invoices with a given conditions (other predicates).

func (*SubscriptionsFilter) WhereHasProduct

func (f *SubscriptionsFilter) WhereHasProduct()

WhereHasProduct applies a predicate to check if query has an edge product.

func (*SubscriptionsFilter) WhereHasProductWith

func (f *SubscriptionsFilter) WhereHasProductWith(preds ...predicate.Product)

WhereHasProductWith applies a predicate to check if query has an edge product with a given conditions (other predicates).

func (*SubscriptionsFilter) WhereID

func (f *SubscriptionsFilter) WhereID(p entql.Int64P)

WhereID applies the entql int64 predicate on the id field.

func (*SubscriptionsFilter) WhereProductID

func (f *SubscriptionsFilter) WhereProductID(p entql.Int64P)

WhereProductID applies the entql int64 predicate on the product_id field.

func (*SubscriptionsFilter) WhereTenantID

func (f *SubscriptionsFilter) WhereTenantID(p entql.Int64P)

WhereTenantID applies the entql int64 predicate on the tenant_id field.

func (*SubscriptionsFilter) WhereUserID

func (f *SubscriptionsFilter) WhereUserID(p entql.Int64P)

WhereUserID applies the entql int64 predicate on the user_id field.

type SubscriptionsGroupBy

type SubscriptionsGroupBy struct {
	// contains filtered or unexported fields
}

SubscriptionsGroupBy is the group-by builder for Subscriptions entities.

func (*SubscriptionsGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*SubscriptionsGroupBy) Bool

func (s *SubscriptionsGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SubscriptionsGroupBy) BoolX

func (s *SubscriptionsGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SubscriptionsGroupBy) Bools

func (s *SubscriptionsGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SubscriptionsGroupBy) BoolsX

func (s *SubscriptionsGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SubscriptionsGroupBy) Float64

func (s *SubscriptionsGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SubscriptionsGroupBy) Float64X

func (s *SubscriptionsGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SubscriptionsGroupBy) Float64s

func (s *SubscriptionsGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SubscriptionsGroupBy) Float64sX

func (s *SubscriptionsGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SubscriptionsGroupBy) Int

func (s *SubscriptionsGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SubscriptionsGroupBy) IntX

func (s *SubscriptionsGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SubscriptionsGroupBy) Ints

func (s *SubscriptionsGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SubscriptionsGroupBy) IntsX

func (s *SubscriptionsGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SubscriptionsGroupBy) Scan

func (sgb *SubscriptionsGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SubscriptionsGroupBy) ScanX

func (s *SubscriptionsGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SubscriptionsGroupBy) String

func (s *SubscriptionsGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SubscriptionsGroupBy) StringX

func (s *SubscriptionsGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SubscriptionsGroupBy) Strings

func (s *SubscriptionsGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SubscriptionsGroupBy) StringsX

func (s *SubscriptionsGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SubscriptionsMutation

type SubscriptionsMutation struct {
	// contains filtered or unexported fields
}

SubscriptionsMutation represents an operation that mutates the Subscriptions nodes in the graph.

func (*SubscriptionsMutation) AddField

func (m *SubscriptionsMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*SubscriptionsMutation) AddInvoiceIDs

func (m *SubscriptionsMutation) AddInvoiceIDs(ids ...int64)

AddInvoiceIDs adds the "invoices" edge to the Invoice entity by ids.

func (*SubscriptionsMutation) AddTenantID

func (m *SubscriptionsMutation) AddTenantID(i int64)

AddTenantID adds i to the "tenant_id" field.

func (*SubscriptionsMutation) AddUserID

func (m *SubscriptionsMutation) AddUserID(i int64)

AddUserID adds i to the "user_id" field.

func (*SubscriptionsMutation) AddedEdges

func (m *SubscriptionsMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*SubscriptionsMutation) AddedField

func (m *SubscriptionsMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*SubscriptionsMutation) AddedFields

func (m *SubscriptionsMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*SubscriptionsMutation) AddedIDs

func (m *SubscriptionsMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*SubscriptionsMutation) AddedTenantID

func (m *SubscriptionsMutation) AddedTenantID() (r int64, exists bool)

AddedTenantID returns the value that was added to the "tenant_id" field in this mutation.

func (*SubscriptionsMutation) AddedUserID

func (m *SubscriptionsMutation) AddedUserID() (r int64, exists bool)

AddedUserID returns the value that was added to the "user_id" field in this mutation.

func (*SubscriptionsMutation) AppID

func (m *SubscriptionsMutation) AppID() (r string, exists bool)

AppID returns the value of the "app_id" field in the mutation.

func (*SubscriptionsMutation) ClearEdge

func (m *SubscriptionsMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*SubscriptionsMutation) ClearField

func (m *SubscriptionsMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*SubscriptionsMutation) ClearInvoices

func (m *SubscriptionsMutation) ClearInvoices()

ClearInvoices clears the "invoices" edge to the Invoice entity.

func (*SubscriptionsMutation) ClearProduct

func (m *SubscriptionsMutation) ClearProduct()

ClearProduct clears the "product" edge to the Product entity.

func (*SubscriptionsMutation) ClearedEdges

func (m *SubscriptionsMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*SubscriptionsMutation) ClearedFields

func (m *SubscriptionsMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (SubscriptionsMutation) Client

func (m SubscriptionsMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*SubscriptionsMutation) EdgeCleared

func (m *SubscriptionsMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*SubscriptionsMutation) Field

func (m *SubscriptionsMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*SubscriptionsMutation) FieldCleared

func (m *SubscriptionsMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*SubscriptionsMutation) Fields

func (m *SubscriptionsMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*SubscriptionsMutation) Filter

Filter returns an entql.Where implementation to apply filters on the SubscriptionsMutation builder.

func (*SubscriptionsMutation) ID

func (m *SubscriptionsMutation) ID() (id int64, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*SubscriptionsMutation) IDs

func (m *SubscriptionsMutation) IDs(ctx context.Context) ([]int64, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*SubscriptionsMutation) InvoicesCleared

func (m *SubscriptionsMutation) InvoicesCleared() bool

InvoicesCleared reports if the "invoices" edge to the Invoice entity was cleared.

func (*SubscriptionsMutation) InvoicesIDs

func (m *SubscriptionsMutation) InvoicesIDs() (ids []int64)

InvoicesIDs returns the "invoices" edge IDs in the mutation.

func (*SubscriptionsMutation) OldAppID

func (m *SubscriptionsMutation) OldAppID(ctx context.Context) (v string, err error)

OldAppID returns the old "app_id" field's value of the Subscriptions entity. If the Subscriptions object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SubscriptionsMutation) OldField

func (m *SubscriptionsMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*SubscriptionsMutation) OldProductID

func (m *SubscriptionsMutation) OldProductID(ctx context.Context) (v int64, err error)

OldProductID returns the old "product_id" field's value of the Subscriptions entity. If the Subscriptions object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SubscriptionsMutation) OldTenantID

func (m *SubscriptionsMutation) OldTenantID(ctx context.Context) (v int64, err error)

OldTenantID returns the old "tenant_id" field's value of the Subscriptions entity. If the Subscriptions object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SubscriptionsMutation) OldUserID

func (m *SubscriptionsMutation) OldUserID(ctx context.Context) (v int64, err error)

OldUserID returns the old "user_id" field's value of the Subscriptions entity. If the Subscriptions object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SubscriptionsMutation) Op

func (m *SubscriptionsMutation) Op() Op

Op returns the operation name.

func (*SubscriptionsMutation) ProductCleared

func (m *SubscriptionsMutation) ProductCleared() bool

ProductCleared reports if the "product" edge to the Product entity was cleared.

func (*SubscriptionsMutation) ProductID

func (m *SubscriptionsMutation) ProductID() (r int64, exists bool)

ProductID returns the value of the "product_id" field in the mutation.

func (*SubscriptionsMutation) ProductIDs

func (m *SubscriptionsMutation) ProductIDs() (ids []int64)

ProductIDs returns the "product" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ProductID instead. It exists only for internal usage by the builders.

func (*SubscriptionsMutation) RemoveInvoiceIDs

func (m *SubscriptionsMutation) RemoveInvoiceIDs(ids ...int64)

RemoveInvoiceIDs removes the "invoices" edge to the Invoice entity by IDs.

func (*SubscriptionsMutation) RemovedEdges

func (m *SubscriptionsMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*SubscriptionsMutation) RemovedIDs

func (m *SubscriptionsMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*SubscriptionsMutation) RemovedInvoicesIDs

func (m *SubscriptionsMutation) RemovedInvoicesIDs() (ids []int64)

RemovedInvoices returns the removed IDs of the "invoices" edge to the Invoice entity.

func (*SubscriptionsMutation) ResetAppID

func (m *SubscriptionsMutation) ResetAppID()

ResetAppID resets all changes to the "app_id" field.

func (*SubscriptionsMutation) ResetEdge

func (m *SubscriptionsMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*SubscriptionsMutation) ResetField

func (m *SubscriptionsMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*SubscriptionsMutation) ResetInvoices

func (m *SubscriptionsMutation) ResetInvoices()

ResetInvoices resets all changes to the "invoices" edge.

func (*SubscriptionsMutation) ResetProduct

func (m *SubscriptionsMutation) ResetProduct()

ResetProduct resets all changes to the "product" edge.

func (*SubscriptionsMutation) ResetProductID

func (m *SubscriptionsMutation) ResetProductID()

ResetProductID resets all changes to the "product_id" field.

func (*SubscriptionsMutation) ResetTenantID

func (m *SubscriptionsMutation) ResetTenantID()

ResetTenantID resets all changes to the "tenant_id" field.

func (*SubscriptionsMutation) ResetUserID

func (m *SubscriptionsMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*SubscriptionsMutation) SetAppID

func (m *SubscriptionsMutation) SetAppID(s string)

SetAppID sets the "app_id" field.

func (*SubscriptionsMutation) SetField

func (m *SubscriptionsMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*SubscriptionsMutation) SetID

func (m *SubscriptionsMutation) SetID(id int64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Subscriptions entities.

func (*SubscriptionsMutation) SetOp

func (m *SubscriptionsMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SubscriptionsMutation) SetProductID

func (m *SubscriptionsMutation) SetProductID(i int64)

SetProductID sets the "product_id" field.

func (*SubscriptionsMutation) SetTenantID

func (m *SubscriptionsMutation) SetTenantID(i int64)

SetTenantID sets the "tenant_id" field.

func (*SubscriptionsMutation) SetUserID

func (m *SubscriptionsMutation) SetUserID(i int64)

SetUserID sets the "user_id" field.

func (*SubscriptionsMutation) TenantID

func (m *SubscriptionsMutation) TenantID() (r int64, exists bool)

TenantID returns the value of the "tenant_id" field in the mutation.

func (SubscriptionsMutation) Tx

func (m SubscriptionsMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*SubscriptionsMutation) Type

func (m *SubscriptionsMutation) Type() string

Type returns the node type of this mutation (Subscriptions).

func (*SubscriptionsMutation) UserID

func (m *SubscriptionsMutation) UserID() (r int64, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*SubscriptionsMutation) Where

Where appends a list predicates to the SubscriptionsMutation builder.

func (*SubscriptionsMutation) WhereP

func (m *SubscriptionsMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the SubscriptionsMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type SubscriptionsQuery

type SubscriptionsQuery struct {
	// contains filtered or unexported fields
}

SubscriptionsQuery is the builder for querying Subscriptions entities.

func (*SubscriptionsQuery) Aggregate

func (sq *SubscriptionsQuery) Aggregate(fns ...AggregateFunc) *SubscriptionsSelect

Aggregate returns a SubscriptionsSelect configured with the given aggregations.

func (*SubscriptionsQuery) All

All executes the query and returns a list of SubscriptionsSlice.

func (*SubscriptionsQuery) AllX

AllX is like All, but panics if an error occurs.

func (*SubscriptionsQuery) Clone

Clone returns a duplicate of the SubscriptionsQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SubscriptionsQuery) Count

func (sq *SubscriptionsQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SubscriptionsQuery) CountX

func (sq *SubscriptionsQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SubscriptionsQuery) Exist

func (sq *SubscriptionsQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*SubscriptionsQuery) ExistX

func (sq *SubscriptionsQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*SubscriptionsQuery) Filter

Filter returns a Filter implementation to apply filters on the SubscriptionsQuery builder.

func (*SubscriptionsQuery) First

First returns the first Subscriptions entity from the query. Returns a *NotFoundError when no Subscriptions was found.

func (*SubscriptionsQuery) FirstID

func (sq *SubscriptionsQuery) FirstID(ctx context.Context) (id int64, err error)

FirstID returns the first Subscriptions ID from the query. Returns a *NotFoundError when no Subscriptions ID was found.

func (*SubscriptionsQuery) FirstIDX

func (sq *SubscriptionsQuery) FirstIDX(ctx context.Context) int64

FirstIDX is like FirstID, but panics if an error occurs.

func (*SubscriptionsQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*SubscriptionsQuery) GroupBy

func (sq *SubscriptionsQuery) GroupBy(field string, fields ...string) *SubscriptionsGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	UserID int64 `json:"user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Subscriptions.Query().
	GroupBy(subscriptions.FieldUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SubscriptionsQuery) IDs

func (sq *SubscriptionsQuery) IDs(ctx context.Context) (ids []int64, err error)

IDs executes the query and returns a list of Subscriptions IDs.

func (*SubscriptionsQuery) IDsX

func (sq *SubscriptionsQuery) IDsX(ctx context.Context) []int64

IDsX is like IDs, but panics if an error occurs.

func (*SubscriptionsQuery) Limit

func (sq *SubscriptionsQuery) Limit(limit int) *SubscriptionsQuery

Limit the number of records to be returned by this query.

func (*SubscriptionsQuery) Modify

func (sq *SubscriptionsQuery) Modify(modifiers ...func(s *sql.Selector)) *SubscriptionsSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*SubscriptionsQuery) Offset

func (sq *SubscriptionsQuery) Offset(offset int) *SubscriptionsQuery

Offset to start from.

func (*SubscriptionsQuery) Only

Only returns a single Subscriptions entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Subscriptions entity is found. Returns a *NotFoundError when no Subscriptions entities are found.

func (*SubscriptionsQuery) OnlyID

func (sq *SubscriptionsQuery) OnlyID(ctx context.Context) (id int64, err error)

OnlyID is like Only, but returns the only Subscriptions ID in the query. Returns a *NotSingularError when more than one Subscriptions ID is found. Returns a *NotFoundError when no entities are found.

func (*SubscriptionsQuery) OnlyIDX

func (sq *SubscriptionsQuery) OnlyIDX(ctx context.Context) int64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SubscriptionsQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*SubscriptionsQuery) Order

Order specifies how the records should be ordered.

func (*SubscriptionsQuery) QueryInvoices

func (sq *SubscriptionsQuery) QueryInvoices() *InvoiceQuery

QueryInvoices chains the current query on the "invoices" edge.

func (*SubscriptionsQuery) QueryProduct

func (sq *SubscriptionsQuery) QueryProduct() *ProductQuery

QueryProduct chains the current query on the "product" edge.

func (*SubscriptionsQuery) Select

func (sq *SubscriptionsQuery) Select(fields ...string) *SubscriptionsSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	UserID int64 `json:"user_id,omitempty"`
}

client.Subscriptions.Query().
	Select(subscriptions.FieldUserID).
	Scan(ctx, &v)

func (*SubscriptionsQuery) Unique

func (sq *SubscriptionsQuery) Unique(unique bool) *SubscriptionsQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*SubscriptionsQuery) Where

Where adds a new predicate for the SubscriptionsQuery builder.

func (*SubscriptionsQuery) WithInvoices

func (sq *SubscriptionsQuery) WithInvoices(opts ...func(*InvoiceQuery)) *SubscriptionsQuery

WithInvoices tells the query-builder to eager-load the nodes that are connected to the "invoices" edge. The optional arguments are used to configure the query builder of the edge.

func (*SubscriptionsQuery) WithProduct

func (sq *SubscriptionsQuery) WithProduct(opts ...func(*ProductQuery)) *SubscriptionsQuery

WithProduct tells the query-builder to eager-load the nodes that are connected to the "product" edge. The optional arguments are used to configure the query builder of the edge.

type SubscriptionsSelect

type SubscriptionsSelect struct {
	*SubscriptionsQuery
	// contains filtered or unexported fields
}

SubscriptionsSelect is the builder for selecting fields of Subscriptions entities.

func (*SubscriptionsSelect) Aggregate

func (ss *SubscriptionsSelect) Aggregate(fns ...AggregateFunc) *SubscriptionsSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SubscriptionsSelect) Bool

func (s *SubscriptionsSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SubscriptionsSelect) BoolX

func (s *SubscriptionsSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SubscriptionsSelect) Bools

func (s *SubscriptionsSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SubscriptionsSelect) BoolsX

func (s *SubscriptionsSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SubscriptionsSelect) Float64

func (s *SubscriptionsSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SubscriptionsSelect) Float64X

func (s *SubscriptionsSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SubscriptionsSelect) Float64s

func (s *SubscriptionsSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SubscriptionsSelect) Float64sX

func (s *SubscriptionsSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SubscriptionsSelect) Int

func (s *SubscriptionsSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SubscriptionsSelect) IntX

func (s *SubscriptionsSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SubscriptionsSelect) Ints

func (s *SubscriptionsSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SubscriptionsSelect) IntsX

func (s *SubscriptionsSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SubscriptionsSelect) Modify

func (ss *SubscriptionsSelect) Modify(modifiers ...func(s *sql.Selector)) *SubscriptionsSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*SubscriptionsSelect) Scan

func (ss *SubscriptionsSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SubscriptionsSelect) ScanX

func (s *SubscriptionsSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SubscriptionsSelect) String

func (s *SubscriptionsSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SubscriptionsSelect) StringX

func (s *SubscriptionsSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SubscriptionsSelect) Strings

func (s *SubscriptionsSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SubscriptionsSelect) StringsX

func (s *SubscriptionsSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SubscriptionsSlice

type SubscriptionsSlice []*Subscriptions

SubscriptionsSlice is a parsable slice of Subscriptions.

type SubscriptionsUpdate

type SubscriptionsUpdate struct {
	// contains filtered or unexported fields
}

SubscriptionsUpdate is the builder for updating Subscriptions entities.

func (*SubscriptionsUpdate) AddInvoiceIDs

func (su *SubscriptionsUpdate) AddInvoiceIDs(ids ...int64) *SubscriptionsUpdate

AddInvoiceIDs adds the "invoices" edge to the Invoice entity by IDs.

func (*SubscriptionsUpdate) AddInvoices

func (su *SubscriptionsUpdate) AddInvoices(i ...*Invoice) *SubscriptionsUpdate

AddInvoices adds the "invoices" edges to the Invoice entity.

func (*SubscriptionsUpdate) ClearInvoices

func (su *SubscriptionsUpdate) ClearInvoices() *SubscriptionsUpdate

ClearInvoices clears all "invoices" edges to the Invoice entity.

func (*SubscriptionsUpdate) Exec

func (su *SubscriptionsUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SubscriptionsUpdate) ExecX

func (su *SubscriptionsUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SubscriptionsUpdate) Modify

func (su *SubscriptionsUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *SubscriptionsUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*SubscriptionsUpdate) Mutation

Mutation returns the SubscriptionsMutation object of the builder.

func (*SubscriptionsUpdate) RemoveInvoiceIDs

func (su *SubscriptionsUpdate) RemoveInvoiceIDs(ids ...int64) *SubscriptionsUpdate

RemoveInvoiceIDs removes the "invoices" edge to Invoice entities by IDs.

func (*SubscriptionsUpdate) RemoveInvoices

func (su *SubscriptionsUpdate) RemoveInvoices(i ...*Invoice) *SubscriptionsUpdate

RemoveInvoices removes "invoices" edges to Invoice entities.

func (*SubscriptionsUpdate) Save

func (su *SubscriptionsUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SubscriptionsUpdate) SaveX

func (su *SubscriptionsUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SubscriptionsUpdate) Where

Where appends a list predicates to the SubscriptionsUpdate builder.

type SubscriptionsUpdateOne

type SubscriptionsUpdateOne struct {
	// contains filtered or unexported fields
}

SubscriptionsUpdateOne is the builder for updating a single Subscriptions entity.

func (*SubscriptionsUpdateOne) AddInvoiceIDs

func (suo *SubscriptionsUpdateOne) AddInvoiceIDs(ids ...int64) *SubscriptionsUpdateOne

AddInvoiceIDs adds the "invoices" edge to the Invoice entity by IDs.

func (*SubscriptionsUpdateOne) AddInvoices

func (suo *SubscriptionsUpdateOne) AddInvoices(i ...*Invoice) *SubscriptionsUpdateOne

AddInvoices adds the "invoices" edges to the Invoice entity.

func (*SubscriptionsUpdateOne) ClearInvoices

func (suo *SubscriptionsUpdateOne) ClearInvoices() *SubscriptionsUpdateOne

ClearInvoices clears all "invoices" edges to the Invoice entity.

func (*SubscriptionsUpdateOne) Exec

Exec executes the query on the entity.

func (*SubscriptionsUpdateOne) ExecX

func (suo *SubscriptionsUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SubscriptionsUpdateOne) Modify

func (suo *SubscriptionsUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *SubscriptionsUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*SubscriptionsUpdateOne) Mutation

Mutation returns the SubscriptionsMutation object of the builder.

func (*SubscriptionsUpdateOne) RemoveInvoiceIDs

func (suo *SubscriptionsUpdateOne) RemoveInvoiceIDs(ids ...int64) *SubscriptionsUpdateOne

RemoveInvoiceIDs removes the "invoices" edge to Invoice entities by IDs.

func (*SubscriptionsUpdateOne) RemoveInvoices

func (suo *SubscriptionsUpdateOne) RemoveInvoices(i ...*Invoice) *SubscriptionsUpdateOne

RemoveInvoices removes "invoices" edges to Invoice entities.

func (*SubscriptionsUpdateOne) Save

Save executes the query and returns the updated Subscriptions entity.

func (*SubscriptionsUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*SubscriptionsUpdateOne) Select

func (suo *SubscriptionsUpdateOne) Select(field string, fields ...string) *SubscriptionsUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SubscriptionsUpdateOne) Where

Where appends a list predicates to the SubscriptionsUpdate builder.

type SubscriptionsUpsert

type SubscriptionsUpsert struct {
	*sql.UpdateSet
}

SubscriptionsUpsert is the "OnConflict" setter.

type SubscriptionsUpsertBulk

type SubscriptionsUpsertBulk struct {
	// contains filtered or unexported fields
}

SubscriptionsUpsertBulk is the builder for "upsert"-ing a bulk of Subscriptions nodes.

func (*SubscriptionsUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*SubscriptionsUpsertBulk) Exec

Exec executes the query.

func (*SubscriptionsUpsertBulk) ExecX

func (u *SubscriptionsUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SubscriptionsUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Subscriptions.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*SubscriptionsUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the SubscriptionsCreateBulk.OnConflict documentation for more info.

func (*SubscriptionsUpsertBulk) UpdateNewValues

func (u *SubscriptionsUpsertBulk) UpdateNewValues() *SubscriptionsUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Subscriptions.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(subscriptions.FieldID)
		}),
	).
	Exec(ctx)

type SubscriptionsUpsertOne

type SubscriptionsUpsertOne struct {
	// contains filtered or unexported fields
}

SubscriptionsUpsertOne is the builder for "upsert"-ing

one Subscriptions node.

func (*SubscriptionsUpsertOne) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*SubscriptionsUpsertOne) Exec

Exec executes the query.

func (*SubscriptionsUpsertOne) ExecX

func (u *SubscriptionsUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SubscriptionsUpsertOne) ID

func (u *SubscriptionsUpsertOne) ID(ctx context.Context) (id int64, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*SubscriptionsUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*SubscriptionsUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Subscriptions.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*SubscriptionsUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the SubscriptionsCreate.OnConflict documentation for more info.

func (*SubscriptionsUpsertOne) UpdateNewValues

func (u *SubscriptionsUpsertOne) UpdateNewValues() *SubscriptionsUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Subscriptions.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(subscriptions.FieldID)
		}),
	).
	Exec(ctx)

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

type Tx

type Tx struct {

	// Bundle is the client for interacting with the Bundle builders.
	Bundle *BundleClient
	// Invoice is the client for interacting with the Invoice builders.
	Invoice *InvoiceClient
	// Item is the client for interacting with the Item builders.
	Item *ItemClient
	// PaymentProfile is the client for interacting with the PaymentProfile builders.
	PaymentProfile *PaymentProfileClient
	// Product is the client for interacting with the Product builders.
	Product *ProductClient
	// ProductReservation is the client for interacting with the ProductReservation builders.
	ProductReservation *ProductReservationClient
	// Subscriptions is the client for interacting with the Subscriptions builders.
	Subscriptions *SubscriptionsClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Jump to

Keyboard shortcuts

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