ent

package
v0.0.0-...-05e3429 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 43 Imported by: 0

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.
	TypeAddress             = "Address"
	TypeConversation        = "Conversation"
	TypeInvoice             = "Invoice"
	TypeInvoiceHistory      = "InvoiceHistory"
	TypeInvoiceStatusCode   = "InvoiceStatusCode"
	TypeMessage             = "Message"
	TypeOrder               = "Order"
	TypeOrderHistory        = "OrderHistory"
	TypeOrderItem           = "OrderItem"
	TypeOrderStatusCode     = "OrderStatusCode"
	TypePerson              = "Person"
	TypePersonAddress       = "PersonAddress"
	TypeProductColor        = "ProductColor"
	TypeProductImage        = "ProductImage"
	TypeProductInfo         = "ProductInfo"
	TypeProductQty          = "ProductQty"
	TypeProductTag          = "ProductTag"
	TypeShipment            = "Shipment"
	TypeShipmentHistory     = "ShipmentHistory"
	TypeShipmentItem        = "ShipmentItem"
	TypeShipmentStatusCode  = "ShipmentStatusCode"
	TypeTag                 = "Tag"
	TypeWarehouseAssignment = "WarehouseAssignment"
	TypeWorkUnitInfo        = "WorkUnitInfo"
)

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 Address

type Address struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// Line1 holds the value of the "line1" field.
	Line1 string `json:"line1,omitempty"`
	// Line2 holds the value of the "line2" field.
	Line2 *string `json:"line2,omitempty"`
	// City holds the value of the "city" field.
	City string `json:"city,omitempty"`
	// StateOrProvince holds the value of the "state_or_province" field.
	StateOrProvince string `json:"state_or_province,omitempty"`
	// ZipOrPostcode holds the value of the "zip_or_postcode" field.
	ZipOrPostcode string `json:"zip_or_postcode,omitempty"`
	// Country holds the value of the "country" field.
	Country string `json:"country,omitempty"`
	// OtherAddressDetails holds the value of the "other_address_details" field.
	OtherAddressDetails *string `json:"other_address_details,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AddressQuery when eager-loading is set.
	Edges AddressEdges `json:"edges"`
	// contains filtered or unexported fields
}

Address is the model entity for the Address schema.

func (*Address) QueryPersonAddresses

func (a *Address) QueryPersonAddresses() *PersonAddressQuery

QueryPersonAddresses queries the "person_addresses" edge of the Address entity.

func (*Address) QueryPersons

func (a *Address) QueryPersons() *PersonQuery

QueryPersons queries the "persons" edge of the Address entity.

func (*Address) String

func (a *Address) String() string

String implements the fmt.Stringer.

func (*Address) Unwrap

func (a *Address) Unwrap() *Address

Unwrap unwraps the Address 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 (*Address) Update

func (a *Address) Update() *AddressUpdateOne

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

func (*Address) Value

func (a *Address) Value(name string) (ent.Value, error)

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

type AddressClient

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

AddressClient is a client for the Address schema.

func NewAddressClient

func NewAddressClient(c config) *AddressClient

NewAddressClient returns a client for the Address from the given config.

func (*AddressClient) Create

func (c *AddressClient) Create() *AddressCreate

Create returns a builder for creating a Address entity.

func (*AddressClient) CreateBulk

func (c *AddressClient) CreateBulk(builders ...*AddressCreate) *AddressCreateBulk

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

func (*AddressClient) Delete

func (c *AddressClient) Delete() *AddressDelete

Delete returns a delete builder for Address.

func (*AddressClient) DeleteOne

func (c *AddressClient) DeleteOne(a *Address) *AddressDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AddressClient) DeleteOneID

func (c *AddressClient) DeleteOneID(id uuid.UUID) *AddressDeleteOne

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

func (*AddressClient) Get

func (c *AddressClient) Get(ctx context.Context, id uuid.UUID) (*Address, error)

Get returns a Address entity by its id.

func (*AddressClient) GetX

func (c *AddressClient) GetX(ctx context.Context, id uuid.UUID) *Address

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

func (*AddressClient) Hooks

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

Hooks returns the client hooks.

func (*AddressClient) Intercept

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

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

func (*AddressClient) Interceptors

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

Interceptors returns the client interceptors.

func (*AddressClient) MapCreateBulk

func (c *AddressClient) MapCreateBulk(slice any, setFunc func(*AddressCreate, int)) *AddressCreateBulk

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 (*AddressClient) Query

func (c *AddressClient) Query() *AddressQuery

Query returns a query builder for Address.

func (*AddressClient) QueryPersonAddresses

func (c *AddressClient) QueryPersonAddresses(a *Address) *PersonAddressQuery

QueryPersonAddresses queries the person_addresses edge of a Address.

func (*AddressClient) QueryPersons

func (c *AddressClient) QueryPersons(a *Address) *PersonQuery

QueryPersons queries the persons edge of a Address.

func (*AddressClient) Update

func (c *AddressClient) Update() *AddressUpdate

Update returns an update builder for Address.

func (*AddressClient) UpdateOne

func (c *AddressClient) UpdateOne(a *Address) *AddressUpdateOne

UpdateOne returns an update builder for the given entity.

func (*AddressClient) UpdateOneID

func (c *AddressClient) UpdateOneID(id uuid.UUID) *AddressUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AddressClient) Use

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

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

type AddressCreate

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

AddressCreate is the builder for creating a Address entity.

func (*AddressCreate) AddPersonIDs

func (ac *AddressCreate) AddPersonIDs(ids ...uuid.UUID) *AddressCreate

AddPersonIDs adds the "persons" edge to the Person entity by IDs.

func (*AddressCreate) AddPersons

func (ac *AddressCreate) AddPersons(p ...*Person) *AddressCreate

AddPersons adds the "persons" edges to the Person entity.

func (*AddressCreate) Exec

func (ac *AddressCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*AddressCreate) ExecX

func (ac *AddressCreate) ExecX(ctx context.Context)

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

func (*AddressCreate) Mutation

func (ac *AddressCreate) Mutation() *AddressMutation

Mutation returns the AddressMutation object of the builder.

func (*AddressCreate) Save

func (ac *AddressCreate) Save(ctx context.Context) (*Address, error)

Save creates the Address in the database.

func (*AddressCreate) SaveX

func (ac *AddressCreate) SaveX(ctx context.Context) *Address

SaveX calls Save and panics if Save returns an error.

func (*AddressCreate) SetCity

func (ac *AddressCreate) SetCity(s string) *AddressCreate

SetCity sets the "city" field.

func (*AddressCreate) SetCountry

func (ac *AddressCreate) SetCountry(s string) *AddressCreate

SetCountry sets the "country" field.

func (*AddressCreate) SetCreatedAt

func (ac *AddressCreate) SetCreatedAt(t time.Time) *AddressCreate

SetCreatedAt sets the "created_at" field.

func (*AddressCreate) SetID

func (ac *AddressCreate) SetID(u uuid.UUID) *AddressCreate

SetID sets the "id" field.

func (*AddressCreate) SetLine1

func (ac *AddressCreate) SetLine1(s string) *AddressCreate

SetLine1 sets the "line1" field.

func (*AddressCreate) SetLine2

func (ac *AddressCreate) SetLine2(s string) *AddressCreate

SetLine2 sets the "line2" field.

func (*AddressCreate) SetNillableCreatedAt

func (ac *AddressCreate) SetNillableCreatedAt(t *time.Time) *AddressCreate

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

func (*AddressCreate) SetNillableID

func (ac *AddressCreate) SetNillableID(u *uuid.UUID) *AddressCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*AddressCreate) SetNillableLine2

func (ac *AddressCreate) SetNillableLine2(s *string) *AddressCreate

SetNillableLine2 sets the "line2" field if the given value is not nil.

func (*AddressCreate) SetNillableOtherAddressDetails

func (ac *AddressCreate) SetNillableOtherAddressDetails(s *string) *AddressCreate

SetNillableOtherAddressDetails sets the "other_address_details" field if the given value is not nil.

func (*AddressCreate) SetOtherAddressDetails

func (ac *AddressCreate) SetOtherAddressDetails(s string) *AddressCreate

SetOtherAddressDetails sets the "other_address_details" field.

func (*AddressCreate) SetStateOrProvince

func (ac *AddressCreate) SetStateOrProvince(s string) *AddressCreate

SetStateOrProvince sets the "state_or_province" field.

func (*AddressCreate) SetZipOrPostcode

func (ac *AddressCreate) SetZipOrPostcode(s string) *AddressCreate

SetZipOrPostcode sets the "zip_or_postcode" field.

type AddressCreateBulk

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

AddressCreateBulk is the builder for creating many Address entities in bulk.

func (*AddressCreateBulk) Exec

func (acb *AddressCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*AddressCreateBulk) ExecX

func (acb *AddressCreateBulk) ExecX(ctx context.Context)

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

func (*AddressCreateBulk) Save

func (acb *AddressCreateBulk) Save(ctx context.Context) ([]*Address, error)

Save creates the Address entities in the database.

func (*AddressCreateBulk) SaveX

func (acb *AddressCreateBulk) SaveX(ctx context.Context) []*Address

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

type AddressDelete

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

AddressDelete is the builder for deleting a Address entity.

func (*AddressDelete) Exec

func (ad *AddressDelete) Exec(ctx context.Context) (int, error)

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

func (*AddressDelete) ExecX

func (ad *AddressDelete) ExecX(ctx context.Context) int

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

func (*AddressDelete) Where

func (ad *AddressDelete) Where(ps ...predicate.Address) *AddressDelete

Where appends a list predicates to the AddressDelete builder.

type AddressDeleteOne

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

AddressDeleteOne is the builder for deleting a single Address entity.

func (*AddressDeleteOne) Exec

func (ado *AddressDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*AddressDeleteOne) ExecX

func (ado *AddressDeleteOne) ExecX(ctx context.Context)

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

func (*AddressDeleteOne) Where

Where appends a list predicates to the AddressDelete builder.

type AddressEdges

type AddressEdges struct {
	// Persons holds the value of the persons edge.
	Persons []*Person `json:"persons,omitempty"`
	// PersonAddresses holds the value of the person_addresses edge.
	PersonAddresses []*PersonAddress `json:"person_addresses,omitempty"`
	// contains filtered or unexported fields
}

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

func (AddressEdges) PersonAddressesOrErr

func (e AddressEdges) PersonAddressesOrErr() ([]*PersonAddress, error)

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

func (AddressEdges) PersonsOrErr

func (e AddressEdges) PersonsOrErr() ([]*Person, error)

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

type AddressGroupBy

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

AddressGroupBy is the group-by builder for Address entities.

func (*AddressGroupBy) Aggregate

func (agb *AddressGroupBy) Aggregate(fns ...AggregateFunc) *AddressGroupBy

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

func (*AddressGroupBy) Bool

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

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

func (*AddressGroupBy) BoolX

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

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

func (*AddressGroupBy) Bools

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

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

func (*AddressGroupBy) BoolsX

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

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

func (*AddressGroupBy) Float64

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

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

func (*AddressGroupBy) Float64X

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

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

func (*AddressGroupBy) Float64s

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

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

func (*AddressGroupBy) Float64sX

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

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

func (*AddressGroupBy) Int

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

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

func (*AddressGroupBy) IntX

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

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

func (*AddressGroupBy) Ints

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

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

func (*AddressGroupBy) IntsX

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

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

func (*AddressGroupBy) Scan

func (agb *AddressGroupBy) Scan(ctx context.Context, v any) error

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

func (*AddressGroupBy) ScanX

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

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

func (*AddressGroupBy) String

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

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

func (*AddressGroupBy) StringX

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

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

func (*AddressGroupBy) Strings

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

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

func (*AddressGroupBy) StringsX

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

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

type AddressMutation

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

AddressMutation represents an operation that mutates the Address nodes in the graph.

func (*AddressMutation) AddField

func (m *AddressMutation) 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 (*AddressMutation) AddPersonIDs

func (m *AddressMutation) AddPersonIDs(ids ...uuid.UUID)

AddPersonIDs adds the "persons" edge to the Person entity by ids.

func (*AddressMutation) AddedEdges

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

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

func (*AddressMutation) AddedField

func (m *AddressMutation) 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 (*AddressMutation) AddedFields

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

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

func (*AddressMutation) AddedIDs

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

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

func (*AddressMutation) City

func (m *AddressMutation) City() (r string, exists bool)

City returns the value of the "city" field in the mutation.

func (*AddressMutation) ClearEdge

func (m *AddressMutation) 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 (*AddressMutation) ClearField

func (m *AddressMutation) 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 (*AddressMutation) ClearLine2

func (m *AddressMutation) ClearLine2()

ClearLine2 clears the value of the "line2" field.

func (*AddressMutation) ClearOtherAddressDetails

func (m *AddressMutation) ClearOtherAddressDetails()

ClearOtherAddressDetails clears the value of the "other_address_details" field.

func (*AddressMutation) ClearPersons

func (m *AddressMutation) ClearPersons()

ClearPersons clears the "persons" edge to the Person entity.

func (*AddressMutation) ClearedEdges

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

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

func (*AddressMutation) ClearedFields

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

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

func (AddressMutation) Client

func (m AddressMutation) 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 (*AddressMutation) Country

func (m *AddressMutation) Country() (r string, exists bool)

Country returns the value of the "country" field in the mutation.

func (*AddressMutation) CreatedAt

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

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

func (*AddressMutation) EdgeCleared

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

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

func (*AddressMutation) Field

func (m *AddressMutation) 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 (*AddressMutation) FieldCleared

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

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

func (*AddressMutation) Fields

func (m *AddressMutation) 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 (*AddressMutation) ID

func (m *AddressMutation) ID() (id uuid.UUID, 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 (*AddressMutation) IDs

func (m *AddressMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*AddressMutation) Line1

func (m *AddressMutation) Line1() (r string, exists bool)

Line1 returns the value of the "line1" field in the mutation.

func (*AddressMutation) Line2

func (m *AddressMutation) Line2() (r string, exists bool)

Line2 returns the value of the "line2" field in the mutation.

func (*AddressMutation) Line2Cleared

func (m *AddressMutation) Line2Cleared() bool

Line2Cleared returns if the "line2" field was cleared in this mutation.

func (*AddressMutation) OldCity

func (m *AddressMutation) OldCity(ctx context.Context) (v string, err error)

OldCity returns the old "city" field's value of the Address entity. If the Address 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 (*AddressMutation) OldCountry

func (m *AddressMutation) OldCountry(ctx context.Context) (v string, err error)

OldCountry returns the old "country" field's value of the Address entity. If the Address 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 (*AddressMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the Address entity. If the Address 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 (*AddressMutation) OldField

func (m *AddressMutation) 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 (*AddressMutation) OldLine1

func (m *AddressMutation) OldLine1(ctx context.Context) (v string, err error)

OldLine1 returns the old "line1" field's value of the Address entity. If the Address 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 (*AddressMutation) OldLine2

func (m *AddressMutation) OldLine2(ctx context.Context) (v *string, err error)

OldLine2 returns the old "line2" field's value of the Address entity. If the Address 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 (*AddressMutation) OldOtherAddressDetails

func (m *AddressMutation) OldOtherAddressDetails(ctx context.Context) (v *string, err error)

OldOtherAddressDetails returns the old "other_address_details" field's value of the Address entity. If the Address 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 (*AddressMutation) OldStateOrProvince

func (m *AddressMutation) OldStateOrProvince(ctx context.Context) (v string, err error)

OldStateOrProvince returns the old "state_or_province" field's value of the Address entity. If the Address 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 (*AddressMutation) OldZipOrPostcode

func (m *AddressMutation) OldZipOrPostcode(ctx context.Context) (v string, err error)

OldZipOrPostcode returns the old "zip_or_postcode" field's value of the Address entity. If the Address 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 (*AddressMutation) Op

func (m *AddressMutation) Op() Op

Op returns the operation name.

func (*AddressMutation) OtherAddressDetails

func (m *AddressMutation) OtherAddressDetails() (r string, exists bool)

OtherAddressDetails returns the value of the "other_address_details" field in the mutation.

func (*AddressMutation) OtherAddressDetailsCleared

func (m *AddressMutation) OtherAddressDetailsCleared() bool

OtherAddressDetailsCleared returns if the "other_address_details" field was cleared in this mutation.

func (*AddressMutation) PersonsCleared

func (m *AddressMutation) PersonsCleared() bool

PersonsCleared reports if the "persons" edge to the Person entity was cleared.

func (*AddressMutation) PersonsIDs

func (m *AddressMutation) PersonsIDs() (ids []uuid.UUID)

PersonsIDs returns the "persons" edge IDs in the mutation.

func (*AddressMutation) RemovePersonIDs

func (m *AddressMutation) RemovePersonIDs(ids ...uuid.UUID)

RemovePersonIDs removes the "persons" edge to the Person entity by IDs.

func (*AddressMutation) RemovedEdges

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

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

func (*AddressMutation) RemovedIDs

func (m *AddressMutation) 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 (*AddressMutation) RemovedPersonsIDs

func (m *AddressMutation) RemovedPersonsIDs() (ids []uuid.UUID)

RemovedPersons returns the removed IDs of the "persons" edge to the Person entity.

func (*AddressMutation) ResetCity

func (m *AddressMutation) ResetCity()

ResetCity resets all changes to the "city" field.

func (*AddressMutation) ResetCountry

func (m *AddressMutation) ResetCountry()

ResetCountry resets all changes to the "country" field.

func (*AddressMutation) ResetCreatedAt

func (m *AddressMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*AddressMutation) ResetEdge

func (m *AddressMutation) 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 (*AddressMutation) ResetField

func (m *AddressMutation) 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 (*AddressMutation) ResetLine1

func (m *AddressMutation) ResetLine1()

ResetLine1 resets all changes to the "line1" field.

func (*AddressMutation) ResetLine2

func (m *AddressMutation) ResetLine2()

ResetLine2 resets all changes to the "line2" field.

func (*AddressMutation) ResetOtherAddressDetails

func (m *AddressMutation) ResetOtherAddressDetails()

ResetOtherAddressDetails resets all changes to the "other_address_details" field.

func (*AddressMutation) ResetPersons

func (m *AddressMutation) ResetPersons()

ResetPersons resets all changes to the "persons" edge.

func (*AddressMutation) ResetStateOrProvince

func (m *AddressMutation) ResetStateOrProvince()

ResetStateOrProvince resets all changes to the "state_or_province" field.

func (*AddressMutation) ResetZipOrPostcode

func (m *AddressMutation) ResetZipOrPostcode()

ResetZipOrPostcode resets all changes to the "zip_or_postcode" field.

func (*AddressMutation) SetCity

func (m *AddressMutation) SetCity(s string)

SetCity sets the "city" field.

func (*AddressMutation) SetCountry

func (m *AddressMutation) SetCountry(s string)

SetCountry sets the "country" field.

func (*AddressMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*AddressMutation) SetField

func (m *AddressMutation) 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 (*AddressMutation) SetID

func (m *AddressMutation) SetID(id uuid.UUID)

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

func (*AddressMutation) SetLine1

func (m *AddressMutation) SetLine1(s string)

SetLine1 sets the "line1" field.

func (*AddressMutation) SetLine2

func (m *AddressMutation) SetLine2(s string)

SetLine2 sets the "line2" field.

func (*AddressMutation) SetOp

func (m *AddressMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AddressMutation) SetOtherAddressDetails

func (m *AddressMutation) SetOtherAddressDetails(s string)

SetOtherAddressDetails sets the "other_address_details" field.

func (*AddressMutation) SetStateOrProvince

func (m *AddressMutation) SetStateOrProvince(s string)

SetStateOrProvince sets the "state_or_province" field.

func (*AddressMutation) SetZipOrPostcode

func (m *AddressMutation) SetZipOrPostcode(s string)

SetZipOrPostcode sets the "zip_or_postcode" field.

func (*AddressMutation) StateOrProvince

func (m *AddressMutation) StateOrProvince() (r string, exists bool)

StateOrProvince returns the value of the "state_or_province" field in the mutation.

func (AddressMutation) Tx

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

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

func (*AddressMutation) Type

func (m *AddressMutation) Type() string

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

func (*AddressMutation) Where

func (m *AddressMutation) Where(ps ...predicate.Address)

Where appends a list predicates to the AddressMutation builder.

func (*AddressMutation) WhereP

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

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

func (*AddressMutation) ZipOrPostcode

func (m *AddressMutation) ZipOrPostcode() (r string, exists bool)

ZipOrPostcode returns the value of the "zip_or_postcode" field in the mutation.

type AddressQuery

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

AddressQuery is the builder for querying Address entities.

func (*AddressQuery) Aggregate

func (aq *AddressQuery) Aggregate(fns ...AggregateFunc) *AddressSelect

Aggregate returns a AddressSelect configured with the given aggregations.

func (*AddressQuery) All

func (aq *AddressQuery) All(ctx context.Context) ([]*Address, error)

All executes the query and returns a list of Addresses.

func (*AddressQuery) AllX

func (aq *AddressQuery) AllX(ctx context.Context) []*Address

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

func (*AddressQuery) Clone

func (aq *AddressQuery) Clone() *AddressQuery

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

func (*AddressQuery) Count

func (aq *AddressQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AddressQuery) CountX

func (aq *AddressQuery) CountX(ctx context.Context) int

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

func (*AddressQuery) Exist

func (aq *AddressQuery) Exist(ctx context.Context) (bool, error)

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

func (*AddressQuery) ExistX

func (aq *AddressQuery) ExistX(ctx context.Context) bool

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

func (*AddressQuery) First

func (aq *AddressQuery) First(ctx context.Context) (*Address, error)

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

func (*AddressQuery) FirstID

func (aq *AddressQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*AddressQuery) FirstIDX

func (aq *AddressQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*AddressQuery) FirstX

func (aq *AddressQuery) FirstX(ctx context.Context) *Address

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

func (*AddressQuery) GroupBy

func (aq *AddressQuery) GroupBy(field string, fields ...string) *AddressGroupBy

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.Address.Query().
	GroupBy(address.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AddressQuery) IDs

func (aq *AddressQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

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

func (*AddressQuery) IDsX

func (aq *AddressQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*AddressQuery) Limit

func (aq *AddressQuery) Limit(limit int) *AddressQuery

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

func (*AddressQuery) Offset

func (aq *AddressQuery) Offset(offset int) *AddressQuery

Offset to start from.

func (*AddressQuery) Only

func (aq *AddressQuery) Only(ctx context.Context) (*Address, error)

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

func (*AddressQuery) OnlyID

func (aq *AddressQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*AddressQuery) OnlyIDX

func (aq *AddressQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*AddressQuery) OnlyX

func (aq *AddressQuery) OnlyX(ctx context.Context) *Address

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

func (*AddressQuery) Order

func (aq *AddressQuery) Order(o ...address.OrderOption) *AddressQuery

Order specifies how the records should be ordered.

func (*AddressQuery) QueryPersonAddresses

func (aq *AddressQuery) QueryPersonAddresses() *PersonAddressQuery

QueryPersonAddresses chains the current query on the "person_addresses" edge.

func (*AddressQuery) QueryPersons

func (aq *AddressQuery) QueryPersons() *PersonQuery

QueryPersons chains the current query on the "persons" edge.

func (*AddressQuery) Select

func (aq *AddressQuery) Select(fields ...string) *AddressSelect

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.Address.Query().
	Select(address.FieldCreatedAt).
	Scan(ctx, &v)

func (*AddressQuery) Unique

func (aq *AddressQuery) Unique(unique bool) *AddressQuery

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 (*AddressQuery) Where

func (aq *AddressQuery) Where(ps ...predicate.Address) *AddressQuery

Where adds a new predicate for the AddressQuery builder.

func (*AddressQuery) WithPersonAddresses

func (aq *AddressQuery) WithPersonAddresses(opts ...func(*PersonAddressQuery)) *AddressQuery

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

func (*AddressQuery) WithPersons

func (aq *AddressQuery) WithPersons(opts ...func(*PersonQuery)) *AddressQuery

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

type AddressSelect

type AddressSelect struct {
	*AddressQuery
	// contains filtered or unexported fields
}

AddressSelect is the builder for selecting fields of Address entities.

func (*AddressSelect) Aggregate

func (as *AddressSelect) Aggregate(fns ...AggregateFunc) *AddressSelect

Aggregate adds the given aggregation functions to the selector query.

func (*AddressSelect) Bool

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

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

func (*AddressSelect) BoolX

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

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

func (*AddressSelect) Bools

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

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

func (*AddressSelect) BoolsX

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

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

func (*AddressSelect) Float64

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

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

func (*AddressSelect) Float64X

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

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

func (*AddressSelect) Float64s

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

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

func (*AddressSelect) Float64sX

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

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

func (*AddressSelect) Int

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

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

func (*AddressSelect) IntX

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

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

func (*AddressSelect) Ints

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

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

func (*AddressSelect) IntsX

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

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

func (*AddressSelect) Scan

func (as *AddressSelect) Scan(ctx context.Context, v any) error

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

func (*AddressSelect) ScanX

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

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

func (*AddressSelect) String

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

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

func (*AddressSelect) StringX

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

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

func (*AddressSelect) Strings

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

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

func (*AddressSelect) StringsX

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

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

type AddressUpdate

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

AddressUpdate is the builder for updating Address entities.

func (*AddressUpdate) AddPersonIDs

func (au *AddressUpdate) AddPersonIDs(ids ...uuid.UUID) *AddressUpdate

AddPersonIDs adds the "persons" edge to the Person entity by IDs.

func (*AddressUpdate) AddPersons

func (au *AddressUpdate) AddPersons(p ...*Person) *AddressUpdate

AddPersons adds the "persons" edges to the Person entity.

func (*AddressUpdate) ClearPersons

func (au *AddressUpdate) ClearPersons() *AddressUpdate

ClearPersons clears all "persons" edges to the Person entity.

func (*AddressUpdate) Exec

func (au *AddressUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*AddressUpdate) ExecX

func (au *AddressUpdate) ExecX(ctx context.Context)

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

func (*AddressUpdate) Mutation

func (au *AddressUpdate) Mutation() *AddressMutation

Mutation returns the AddressMutation object of the builder.

func (*AddressUpdate) RemovePersonIDs

func (au *AddressUpdate) RemovePersonIDs(ids ...uuid.UUID) *AddressUpdate

RemovePersonIDs removes the "persons" edge to Person entities by IDs.

func (*AddressUpdate) RemovePersons

func (au *AddressUpdate) RemovePersons(p ...*Person) *AddressUpdate

RemovePersons removes "persons" edges to Person entities.

func (*AddressUpdate) Save

func (au *AddressUpdate) Save(ctx context.Context) (int, error)

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

func (*AddressUpdate) SaveX

func (au *AddressUpdate) SaveX(ctx context.Context) int

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

func (*AddressUpdate) Where

func (au *AddressUpdate) Where(ps ...predicate.Address) *AddressUpdate

Where appends a list predicates to the AddressUpdate builder.

type AddressUpdateOne

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

AddressUpdateOne is the builder for updating a single Address entity.

func (*AddressUpdateOne) AddPersonIDs

func (auo *AddressUpdateOne) AddPersonIDs(ids ...uuid.UUID) *AddressUpdateOne

AddPersonIDs adds the "persons" edge to the Person entity by IDs.

func (*AddressUpdateOne) AddPersons

func (auo *AddressUpdateOne) AddPersons(p ...*Person) *AddressUpdateOne

AddPersons adds the "persons" edges to the Person entity.

func (*AddressUpdateOne) ClearPersons

func (auo *AddressUpdateOne) ClearPersons() *AddressUpdateOne

ClearPersons clears all "persons" edges to the Person entity.

func (*AddressUpdateOne) Exec

func (auo *AddressUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*AddressUpdateOne) ExecX

func (auo *AddressUpdateOne) ExecX(ctx context.Context)

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

func (*AddressUpdateOne) Mutation

func (auo *AddressUpdateOne) Mutation() *AddressMutation

Mutation returns the AddressMutation object of the builder.

func (*AddressUpdateOne) RemovePersonIDs

func (auo *AddressUpdateOne) RemovePersonIDs(ids ...uuid.UUID) *AddressUpdateOne

RemovePersonIDs removes the "persons" edge to Person entities by IDs.

func (*AddressUpdateOne) RemovePersons

func (auo *AddressUpdateOne) RemovePersons(p ...*Person) *AddressUpdateOne

RemovePersons removes "persons" edges to Person entities.

func (*AddressUpdateOne) Save

func (auo *AddressUpdateOne) Save(ctx context.Context) (*Address, error)

Save executes the query and returns the updated Address entity.

func (*AddressUpdateOne) SaveX

func (auo *AddressUpdateOne) SaveX(ctx context.Context) *Address

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

func (*AddressUpdateOne) Select

func (auo *AddressUpdateOne) Select(field string, fields ...string) *AddressUpdateOne

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

func (*AddressUpdateOne) Where

Where appends a list predicates to the AddressUpdate builder.

type Addresses

type Addresses []*Address

Addresses is a parsable slice of Address.

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 Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Address is the client for interacting with the Address builders.
	Address *AddressClient
	// Conversation is the client for interacting with the Conversation builders.
	Conversation *ConversationClient
	// Invoice is the client for interacting with the Invoice builders.
	Invoice *InvoiceClient
	// InvoiceHistory is the client for interacting with the InvoiceHistory builders.
	InvoiceHistory *InvoiceHistoryClient
	// InvoiceStatusCode is the client for interacting with the InvoiceStatusCode builders.
	InvoiceStatusCode *InvoiceStatusCodeClient
	// Message is the client for interacting with the Message builders.
	Message *MessageClient
	// Order is the client for interacting with the Order builders.
	Order *OrderClient
	// OrderHistory is the client for interacting with the OrderHistory builders.
	OrderHistory *OrderHistoryClient
	// OrderItem is the client for interacting with the OrderItem builders.
	OrderItem *OrderItemClient
	// OrderStatusCode is the client for interacting with the OrderStatusCode builders.
	OrderStatusCode *OrderStatusCodeClient
	// Person is the client for interacting with the Person builders.
	Person *PersonClient
	// PersonAddress is the client for interacting with the PersonAddress builders.
	PersonAddress *PersonAddressClient
	// ProductColor is the client for interacting with the ProductColor builders.
	ProductColor *ProductColorClient
	// ProductImage is the client for interacting with the ProductImage builders.
	ProductImage *ProductImageClient
	// ProductInfo is the client for interacting with the ProductInfo builders.
	ProductInfo *ProductInfoClient
	// ProductQty is the client for interacting with the ProductQty builders.
	ProductQty *ProductQtyClient
	// ProductTag is the client for interacting with the ProductTag builders.
	ProductTag *ProductTagClient
	// Shipment is the client for interacting with the Shipment builders.
	Shipment *ShipmentClient
	// ShipmentHistory is the client for interacting with the ShipmentHistory builders.
	ShipmentHistory *ShipmentHistoryClient
	// ShipmentItem is the client for interacting with the ShipmentItem builders.
	ShipmentItem *ShipmentItemClient
	// ShipmentStatusCode is the client for interacting with the ShipmentStatusCode builders.
	ShipmentStatusCode *ShipmentStatusCodeClient
	// Tag is the client for interacting with the Tag builders.
	Tag *TagClient
	// WarehouseAssignment is the client for interacting with the WarehouseAssignment builders.
	WarehouseAssignment *WarehouseAssignmentClient
	// WorkUnitInfo is the client for interacting with the WorkUnitInfo builders.
	WorkUnitInfo *WorkUnitInfoClient
	// 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().
	Address.
	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 Conversation

type Conversation struct {

	// ID of the ent.
	ID uuid.UUID `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"`
	// Title holds the value of the "title" field.
	Title *string `json:"title,omitempty"`
	// PersonOneID holds the value of the "person_one_id" field.
	PersonOneID uuid.UUID `json:"person_one_id,omitempty"`
	// PersonTwoID holds the value of the "person_two_id" field.
	PersonTwoID uuid.UUID `json:"person_two_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ConversationQuery when eager-loading is set.
	Edges ConversationEdges `json:"edges"`
	// contains filtered or unexported fields
}

Conversation is the model entity for the Conversation schema.

func (*Conversation) QueryPersonOne

func (c *Conversation) QueryPersonOne() *PersonQuery

QueryPersonOne queries the "person_one" edge of the Conversation entity.

func (*Conversation) QueryPersonTwo

func (c *Conversation) QueryPersonTwo() *PersonQuery

QueryPersonTwo queries the "person_two" edge of the Conversation entity.

func (*Conversation) String

func (c *Conversation) String() string

String implements the fmt.Stringer.

func (*Conversation) Unwrap

func (c *Conversation) Unwrap() *Conversation

Unwrap unwraps the Conversation 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 (*Conversation) Update

func (c *Conversation) Update() *ConversationUpdateOne

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

func (*Conversation) Value

func (c *Conversation) Value(name string) (ent.Value, error)

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

type ConversationClient

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

ConversationClient is a client for the Conversation schema.

func NewConversationClient

func NewConversationClient(c config) *ConversationClient

NewConversationClient returns a client for the Conversation from the given config.

func (*ConversationClient) Create

Create returns a builder for creating a Conversation entity.

func (*ConversationClient) CreateBulk

func (c *ConversationClient) CreateBulk(builders ...*ConversationCreate) *ConversationCreateBulk

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

func (*ConversationClient) Delete

Delete returns a delete builder for Conversation.

func (*ConversationClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ConversationClient) DeleteOneID

func (c *ConversationClient) DeleteOneID(id uuid.UUID) *ConversationDeleteOne

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

func (*ConversationClient) Get

Get returns a Conversation entity by its id.

func (*ConversationClient) GetX

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

func (*ConversationClient) Hooks

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

Hooks returns the client hooks.

func (*ConversationClient) Intercept

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

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

func (*ConversationClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ConversationClient) MapCreateBulk

func (c *ConversationClient) MapCreateBulk(slice any, setFunc func(*ConversationCreate, int)) *ConversationCreateBulk

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 (*ConversationClient) Query

Query returns a query builder for Conversation.

func (*ConversationClient) QueryPersonOne

func (c *ConversationClient) QueryPersonOne(co *Conversation) *PersonQuery

QueryPersonOne queries the person_one edge of a Conversation.

func (*ConversationClient) QueryPersonTwo

func (c *ConversationClient) QueryPersonTwo(co *Conversation) *PersonQuery

QueryPersonTwo queries the person_two edge of a Conversation.

func (*ConversationClient) Update

Update returns an update builder for Conversation.

func (*ConversationClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ConversationClient) UpdateOneID

func (c *ConversationClient) UpdateOneID(id uuid.UUID) *ConversationUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ConversationClient) Use

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

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

type ConversationCreate

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

ConversationCreate is the builder for creating a Conversation entity.

func (*ConversationCreate) Exec

func (cc *ConversationCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ConversationCreate) ExecX

func (cc *ConversationCreate) ExecX(ctx context.Context)

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

func (*ConversationCreate) Mutation

func (cc *ConversationCreate) Mutation() *ConversationMutation

Mutation returns the ConversationMutation object of the builder.

func (*ConversationCreate) Save

Save creates the Conversation in the database.

func (*ConversationCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*ConversationCreate) SetCreatedAt

func (cc *ConversationCreate) SetCreatedAt(t time.Time) *ConversationCreate

SetCreatedAt sets the "created_at" field.

func (*ConversationCreate) SetID

SetID sets the "id" field.

func (*ConversationCreate) SetNillableCreatedAt

func (cc *ConversationCreate) SetNillableCreatedAt(t *time.Time) *ConversationCreate

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

func (*ConversationCreate) SetNillableID

func (cc *ConversationCreate) SetNillableID(u *uuid.UUID) *ConversationCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ConversationCreate) SetNillableTitle

func (cc *ConversationCreate) SetNillableTitle(s *string) *ConversationCreate

SetNillableTitle sets the "title" field if the given value is not nil.

func (*ConversationCreate) SetNillableUpdatedAt

func (cc *ConversationCreate) SetNillableUpdatedAt(t *time.Time) *ConversationCreate

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

func (*ConversationCreate) SetPersonOne

func (cc *ConversationCreate) SetPersonOne(p *Person) *ConversationCreate

SetPersonOne sets the "person_one" edge to the Person entity.

func (*ConversationCreate) SetPersonOneID

func (cc *ConversationCreate) SetPersonOneID(u uuid.UUID) *ConversationCreate

SetPersonOneID sets the "person_one_id" field.

func (*ConversationCreate) SetPersonTwo

func (cc *ConversationCreate) SetPersonTwo(p *Person) *ConversationCreate

SetPersonTwo sets the "person_two" edge to the Person entity.

func (*ConversationCreate) SetPersonTwoID

func (cc *ConversationCreate) SetPersonTwoID(u uuid.UUID) *ConversationCreate

SetPersonTwoID sets the "person_two_id" field.

func (*ConversationCreate) SetTitle

func (cc *ConversationCreate) SetTitle(s string) *ConversationCreate

SetTitle sets the "title" field.

func (*ConversationCreate) SetUpdatedAt

func (cc *ConversationCreate) SetUpdatedAt(t time.Time) *ConversationCreate

SetUpdatedAt sets the "updated_at" field.

type ConversationCreateBulk

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

ConversationCreateBulk is the builder for creating many Conversation entities in bulk.

func (*ConversationCreateBulk) Exec

Exec executes the query.

func (*ConversationCreateBulk) ExecX

func (ccb *ConversationCreateBulk) ExecX(ctx context.Context)

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

func (*ConversationCreateBulk) Save

Save creates the Conversation entities in the database.

func (*ConversationCreateBulk) SaveX

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

type ConversationDelete

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

ConversationDelete is the builder for deleting a Conversation entity.

func (*ConversationDelete) Exec

func (cd *ConversationDelete) Exec(ctx context.Context) (int, error)

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

func (*ConversationDelete) ExecX

func (cd *ConversationDelete) ExecX(ctx context.Context) int

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

func (*ConversationDelete) Where

Where appends a list predicates to the ConversationDelete builder.

type ConversationDeleteOne

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

ConversationDeleteOne is the builder for deleting a single Conversation entity.

func (*ConversationDeleteOne) Exec

func (cdo *ConversationDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ConversationDeleteOne) ExecX

func (cdo *ConversationDeleteOne) ExecX(ctx context.Context)

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

func (*ConversationDeleteOne) Where

Where appends a list predicates to the ConversationDelete builder.

type ConversationEdges

type ConversationEdges struct {
	// PersonOne holds the value of the person_one edge.
	PersonOne *Person `json:"person_one,omitempty"`
	// PersonTwo holds the value of the person_two edge.
	PersonTwo *Person `json:"person_two,omitempty"`
	// contains filtered or unexported fields
}

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

func (ConversationEdges) PersonOneOrErr

func (e ConversationEdges) PersonOneOrErr() (*Person, error)

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

func (ConversationEdges) PersonTwoOrErr

func (e ConversationEdges) PersonTwoOrErr() (*Person, error)

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

type ConversationGroupBy

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

ConversationGroupBy is the group-by builder for Conversation entities.

func (*ConversationGroupBy) Aggregate

func (cgb *ConversationGroupBy) Aggregate(fns ...AggregateFunc) *ConversationGroupBy

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

func (*ConversationGroupBy) Bool

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

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

func (*ConversationGroupBy) BoolX

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

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

func (*ConversationGroupBy) Bools

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

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

func (*ConversationGroupBy) BoolsX

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

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

func (*ConversationGroupBy) Float64

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

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

func (*ConversationGroupBy) Float64X

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

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

func (*ConversationGroupBy) Float64s

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

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

func (*ConversationGroupBy) Float64sX

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

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

func (*ConversationGroupBy) Int

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

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

func (*ConversationGroupBy) IntX

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

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

func (*ConversationGroupBy) Ints

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

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

func (*ConversationGroupBy) IntsX

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

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

func (*ConversationGroupBy) Scan

func (cgb *ConversationGroupBy) Scan(ctx context.Context, v any) error

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

func (*ConversationGroupBy) ScanX

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

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

func (*ConversationGroupBy) String

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

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

func (*ConversationGroupBy) StringX

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

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

func (*ConversationGroupBy) Strings

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

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

func (*ConversationGroupBy) StringsX

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

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

type ConversationMutation

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

ConversationMutation represents an operation that mutates the Conversation nodes in the graph.

func (*ConversationMutation) AddField

func (m *ConversationMutation) 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 (*ConversationMutation) AddedEdges

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

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

func (*ConversationMutation) AddedField

func (m *ConversationMutation) 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 (*ConversationMutation) AddedFields

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

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

func (*ConversationMutation) AddedIDs

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

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

func (*ConversationMutation) ClearEdge

func (m *ConversationMutation) 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 (*ConversationMutation) ClearField

func (m *ConversationMutation) 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 (*ConversationMutation) ClearPersonOne

func (m *ConversationMutation) ClearPersonOne()

ClearPersonOne clears the "person_one" edge to the Person entity.

func (*ConversationMutation) ClearPersonTwo

func (m *ConversationMutation) ClearPersonTwo()

ClearPersonTwo clears the "person_two" edge to the Person entity.

func (*ConversationMutation) ClearTitle

func (m *ConversationMutation) ClearTitle()

ClearTitle clears the value of the "title" field.

func (*ConversationMutation) ClearedEdges

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

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

func (*ConversationMutation) ClearedFields

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

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

func (ConversationMutation) Client

func (m ConversationMutation) 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 (*ConversationMutation) CreatedAt

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

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

func (*ConversationMutation) EdgeCleared

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

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

func (*ConversationMutation) Field

func (m *ConversationMutation) 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 (*ConversationMutation) FieldCleared

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

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

func (*ConversationMutation) Fields

func (m *ConversationMutation) 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 (*ConversationMutation) ID

func (m *ConversationMutation) ID() (id uuid.UUID, 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 (*ConversationMutation) 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 (*ConversationMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the Conversation entity. If the Conversation 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 (*ConversationMutation) OldField

func (m *ConversationMutation) 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 (*ConversationMutation) OldPersonOneID

func (m *ConversationMutation) OldPersonOneID(ctx context.Context) (v uuid.UUID, err error)

OldPersonOneID returns the old "person_one_id" field's value of the Conversation entity. If the Conversation 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 (*ConversationMutation) OldPersonTwoID

func (m *ConversationMutation) OldPersonTwoID(ctx context.Context) (v uuid.UUID, err error)

OldPersonTwoID returns the old "person_two_id" field's value of the Conversation entity. If the Conversation 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 (*ConversationMutation) OldTitle

func (m *ConversationMutation) OldTitle(ctx context.Context) (v *string, err error)

OldTitle returns the old "title" field's value of the Conversation entity. If the Conversation 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 (*ConversationMutation) OldUpdatedAt

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

OldUpdatedAt returns the old "updated_at" field's value of the Conversation entity. If the Conversation 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 (*ConversationMutation) Op

func (m *ConversationMutation) Op() Op

Op returns the operation name.

func (*ConversationMutation) PersonOneCleared

func (m *ConversationMutation) PersonOneCleared() bool

PersonOneCleared reports if the "person_one" edge to the Person entity was cleared.

func (*ConversationMutation) PersonOneID

func (m *ConversationMutation) PersonOneID() (r uuid.UUID, exists bool)

PersonOneID returns the value of the "person_one_id" field in the mutation.

func (*ConversationMutation) PersonOneIDs

func (m *ConversationMutation) PersonOneIDs() (ids []uuid.UUID)

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

func (*ConversationMutation) PersonTwoCleared

func (m *ConversationMutation) PersonTwoCleared() bool

PersonTwoCleared reports if the "person_two" edge to the Person entity was cleared.

func (*ConversationMutation) PersonTwoID

func (m *ConversationMutation) PersonTwoID() (r uuid.UUID, exists bool)

PersonTwoID returns the value of the "person_two_id" field in the mutation.

func (*ConversationMutation) PersonTwoIDs

func (m *ConversationMutation) PersonTwoIDs() (ids []uuid.UUID)

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

func (*ConversationMutation) RemovedEdges

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

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

func (*ConversationMutation) RemovedIDs

func (m *ConversationMutation) 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 (*ConversationMutation) ResetCreatedAt

func (m *ConversationMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ConversationMutation) ResetEdge

func (m *ConversationMutation) 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 (*ConversationMutation) ResetField

func (m *ConversationMutation) 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 (*ConversationMutation) ResetPersonOne

func (m *ConversationMutation) ResetPersonOne()

ResetPersonOne resets all changes to the "person_one" edge.

func (*ConversationMutation) ResetPersonOneID

func (m *ConversationMutation) ResetPersonOneID()

ResetPersonOneID resets all changes to the "person_one_id" field.

func (*ConversationMutation) ResetPersonTwo

func (m *ConversationMutation) ResetPersonTwo()

ResetPersonTwo resets all changes to the "person_two" edge.

func (*ConversationMutation) ResetPersonTwoID

func (m *ConversationMutation) ResetPersonTwoID()

ResetPersonTwoID resets all changes to the "person_two_id" field.

func (*ConversationMutation) ResetTitle

func (m *ConversationMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*ConversationMutation) ResetUpdatedAt

func (m *ConversationMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ConversationMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*ConversationMutation) SetField

func (m *ConversationMutation) 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 (*ConversationMutation) SetID

func (m *ConversationMutation) SetID(id uuid.UUID)

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

func (*ConversationMutation) SetOp

func (m *ConversationMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ConversationMutation) SetPersonOneID

func (m *ConversationMutation) SetPersonOneID(u uuid.UUID)

SetPersonOneID sets the "person_one_id" field.

func (*ConversationMutation) SetPersonTwoID

func (m *ConversationMutation) SetPersonTwoID(u uuid.UUID)

SetPersonTwoID sets the "person_two_id" field.

func (*ConversationMutation) SetTitle

func (m *ConversationMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*ConversationMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*ConversationMutation) Title

func (m *ConversationMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (*ConversationMutation) TitleCleared

func (m *ConversationMutation) TitleCleared() bool

TitleCleared returns if the "title" field was cleared in this mutation.

func (ConversationMutation) Tx

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

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

func (*ConversationMutation) Type

func (m *ConversationMutation) Type() string

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

func (*ConversationMutation) UpdatedAt

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

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

func (*ConversationMutation) Where

Where appends a list predicates to the ConversationMutation builder.

func (*ConversationMutation) WhereP

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

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

type ConversationQuery

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

ConversationQuery is the builder for querying Conversation entities.

func (*ConversationQuery) Aggregate

func (cq *ConversationQuery) Aggregate(fns ...AggregateFunc) *ConversationSelect

Aggregate returns a ConversationSelect configured with the given aggregations.

func (*ConversationQuery) All

func (cq *ConversationQuery) All(ctx context.Context) ([]*Conversation, error)

All executes the query and returns a list of Conversations.

func (*ConversationQuery) AllX

func (cq *ConversationQuery) AllX(ctx context.Context) []*Conversation

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

func (*ConversationQuery) Clone

func (cq *ConversationQuery) Clone() *ConversationQuery

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

func (*ConversationQuery) Count

func (cq *ConversationQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ConversationQuery) CountX

func (cq *ConversationQuery) CountX(ctx context.Context) int

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

func (*ConversationQuery) Exist

func (cq *ConversationQuery) Exist(ctx context.Context) (bool, error)

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

func (*ConversationQuery) ExistX

func (cq *ConversationQuery) ExistX(ctx context.Context) bool

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

func (*ConversationQuery) First

func (cq *ConversationQuery) First(ctx context.Context) (*Conversation, error)

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

func (*ConversationQuery) FirstID

func (cq *ConversationQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ConversationQuery) FirstIDX

func (cq *ConversationQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*ConversationQuery) FirstX

func (cq *ConversationQuery) FirstX(ctx context.Context) *Conversation

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

func (*ConversationQuery) GroupBy

func (cq *ConversationQuery) GroupBy(field string, fields ...string) *ConversationGroupBy

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.Conversation.Query().
	GroupBy(conversation.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ConversationQuery) IDs

func (cq *ConversationQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

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

func (*ConversationQuery) IDsX

func (cq *ConversationQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*ConversationQuery) Limit

func (cq *ConversationQuery) Limit(limit int) *ConversationQuery

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

func (*ConversationQuery) Offset

func (cq *ConversationQuery) Offset(offset int) *ConversationQuery

Offset to start from.

func (*ConversationQuery) Only

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

func (*ConversationQuery) OnlyID

func (cq *ConversationQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ConversationQuery) OnlyIDX

func (cq *ConversationQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*ConversationQuery) OnlyX

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

func (*ConversationQuery) Order

Order specifies how the records should be ordered.

func (*ConversationQuery) QueryPersonOne

func (cq *ConversationQuery) QueryPersonOne() *PersonQuery

QueryPersonOne chains the current query on the "person_one" edge.

func (*ConversationQuery) QueryPersonTwo

func (cq *ConversationQuery) QueryPersonTwo() *PersonQuery

QueryPersonTwo chains the current query on the "person_two" edge.

func (*ConversationQuery) Select

func (cq *ConversationQuery) Select(fields ...string) *ConversationSelect

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.Conversation.Query().
	Select(conversation.FieldCreatedAt).
	Scan(ctx, &v)

func (*ConversationQuery) Unique

func (cq *ConversationQuery) Unique(unique bool) *ConversationQuery

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 (*ConversationQuery) Where

Where adds a new predicate for the ConversationQuery builder.

func (*ConversationQuery) WithPersonOne

func (cq *ConversationQuery) WithPersonOne(opts ...func(*PersonQuery)) *ConversationQuery

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

func (*ConversationQuery) WithPersonTwo

func (cq *ConversationQuery) WithPersonTwo(opts ...func(*PersonQuery)) *ConversationQuery

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

type ConversationSelect

type ConversationSelect struct {
	*ConversationQuery
	// contains filtered or unexported fields
}

ConversationSelect is the builder for selecting fields of Conversation entities.

func (*ConversationSelect) Aggregate

func (cs *ConversationSelect) Aggregate(fns ...AggregateFunc) *ConversationSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ConversationSelect) Bool

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

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

func (*ConversationSelect) BoolX

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

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

func (*ConversationSelect) Bools

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

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

func (*ConversationSelect) BoolsX

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

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

func (*ConversationSelect) Float64

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

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

func (*ConversationSelect) Float64X

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

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

func (*ConversationSelect) Float64s

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

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

func (*ConversationSelect) Float64sX

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

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

func (*ConversationSelect) Int

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

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

func (*ConversationSelect) IntX

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

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

func (*ConversationSelect) Ints

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

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

func (*ConversationSelect) IntsX

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

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

func (*ConversationSelect) Scan

func (cs *ConversationSelect) Scan(ctx context.Context, v any) error

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

func (*ConversationSelect) ScanX

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

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

func (*ConversationSelect) String

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

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

func (*ConversationSelect) StringX

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

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

func (*ConversationSelect) Strings

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

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

func (*ConversationSelect) StringsX

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

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

type ConversationUpdate

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

ConversationUpdate is the builder for updating Conversation entities.

func (*ConversationUpdate) ClearTitle

func (cu *ConversationUpdate) ClearTitle() *ConversationUpdate

ClearTitle clears the value of the "title" field.

func (*ConversationUpdate) Exec

func (cu *ConversationUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ConversationUpdate) ExecX

func (cu *ConversationUpdate) ExecX(ctx context.Context)

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

func (*ConversationUpdate) Mutation

func (cu *ConversationUpdate) Mutation() *ConversationMutation

Mutation returns the ConversationMutation object of the builder.

func (*ConversationUpdate) Save

func (cu *ConversationUpdate) Save(ctx context.Context) (int, error)

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

func (*ConversationUpdate) SaveX

func (cu *ConversationUpdate) SaveX(ctx context.Context) int

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

func (*ConversationUpdate) SetNillableTitle

func (cu *ConversationUpdate) SetNillableTitle(s *string) *ConversationUpdate

SetNillableTitle sets the "title" field if the given value is not nil.

func (*ConversationUpdate) SetTitle

func (cu *ConversationUpdate) SetTitle(s string) *ConversationUpdate

SetTitle sets the "title" field.

func (*ConversationUpdate) SetUpdatedAt

func (cu *ConversationUpdate) SetUpdatedAt(t time.Time) *ConversationUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ConversationUpdate) Where

Where appends a list predicates to the ConversationUpdate builder.

type ConversationUpdateOne

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

ConversationUpdateOne is the builder for updating a single Conversation entity.

func (*ConversationUpdateOne) ClearTitle

func (cuo *ConversationUpdateOne) ClearTitle() *ConversationUpdateOne

ClearTitle clears the value of the "title" field.

func (*ConversationUpdateOne) Exec

func (cuo *ConversationUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ConversationUpdateOne) ExecX

func (cuo *ConversationUpdateOne) ExecX(ctx context.Context)

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

func (*ConversationUpdateOne) Mutation

Mutation returns the ConversationMutation object of the builder.

func (*ConversationUpdateOne) Save

Save executes the query and returns the updated Conversation entity.

func (*ConversationUpdateOne) SaveX

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

func (*ConversationUpdateOne) Select

func (cuo *ConversationUpdateOne) Select(field string, fields ...string) *ConversationUpdateOne

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

func (*ConversationUpdateOne) SetNillableTitle

func (cuo *ConversationUpdateOne) SetNillableTitle(s *string) *ConversationUpdateOne

SetNillableTitle sets the "title" field if the given value is not nil.

func (*ConversationUpdateOne) SetTitle

SetTitle sets the "title" field.

func (*ConversationUpdateOne) SetUpdatedAt

func (cuo *ConversationUpdateOne) SetUpdatedAt(t time.Time) *ConversationUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ConversationUpdateOne) Where

Where appends a list predicates to the ConversationUpdate builder.

type Conversations

type Conversations []*Conversation

Conversations is a parsable slice of Conversation.

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 uuid.UUID `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"`
	// OrderID holds the value of the "order_id" field.
	OrderID uuid.UUID `json:"order_id,omitempty"`
	// Total holds the value of the "total" field.
	Total *decimal.Decimal `json:"total,omitempty"`
	// Note holds the value of the "note" field.
	Note *string `json:"note,omitempty"`
	// Type holds the value of the "type" field.
	Type *invoice.Type `json:"type,omitempty"`
	// StatusCode holds the value of the "status_code" field.
	StatusCode *int `json:"status_code,omitempty"`
	// PaymentMethod holds the value of the "payment_method" field.
	PaymentMethod *invoice.PaymentMethod `json:"payment_method,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) QueryInvoiceStatus

func (i *Invoice) QueryInvoiceStatus() *InvoiceStatusCodeQuery

QueryInvoiceStatus queries the "invoice_status" edge of the Invoice entity.

func (*Invoice) QueryOrder

func (i *Invoice) QueryOrder() *OrderQuery

QueryOrder queries the "order" 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 uuid.UUID) *InvoiceDeleteOne

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

func (*InvoiceClient) Get

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

Get returns a Invoice entity by its id.

func (*InvoiceClient) GetX

func (c *InvoiceClient) GetX(ctx context.Context, id uuid.UUID) *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) QueryInvoiceStatus

func (c *InvoiceClient) QueryInvoiceStatus(i *Invoice) *InvoiceStatusCodeQuery

QueryInvoiceStatus queries the invoice_status edge of a Invoice.

func (*InvoiceClient) QueryOrder

func (c *InvoiceClient) QueryOrder(i *Invoice) *OrderQuery

QueryOrder queries the order 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 uuid.UUID) *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) 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) 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) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*InvoiceCreate) SetID

func (ic *InvoiceCreate) SetID(u uuid.UUID) *InvoiceCreate

SetID sets the "id" field.

func (*InvoiceCreate) SetInvoiceStatus

func (ic *InvoiceCreate) SetInvoiceStatus(i *InvoiceStatusCode) *InvoiceCreate

SetInvoiceStatus sets the "invoice_status" edge to the InvoiceStatusCode entity.

func (*InvoiceCreate) SetInvoiceStatusID

func (ic *InvoiceCreate) SetInvoiceStatusID(id int) *InvoiceCreate

SetInvoiceStatusID sets the "invoice_status" edge to the InvoiceStatusCode entity by ID.

func (*InvoiceCreate) SetNillableCreatedAt

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

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

func (*InvoiceCreate) SetNillableID

func (ic *InvoiceCreate) SetNillableID(u *uuid.UUID) *InvoiceCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*InvoiceCreate) SetNillableNote

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

SetNillableNote sets the "note" field if the given value is not nil.

func (*InvoiceCreate) SetNillablePaymentMethod

func (ic *InvoiceCreate) SetNillablePaymentMethod(im *invoice.PaymentMethod) *InvoiceCreate

SetNillablePaymentMethod sets the "payment_method" field if the given value is not nil.

func (*InvoiceCreate) SetNillableStatusCode

func (ic *InvoiceCreate) SetNillableStatusCode(i *int) *InvoiceCreate

SetNillableStatusCode sets the "status_code" field if the given value is not nil.

func (*InvoiceCreate) SetNillableType

func (ic *InvoiceCreate) SetNillableType(i *invoice.Type) *InvoiceCreate

SetNillableType sets the "type" field if the given value is not nil.

func (*InvoiceCreate) SetNillableUpdatedAt

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

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

func (*InvoiceCreate) SetNote

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

SetNote sets the "note" field.

func (*InvoiceCreate) SetOrder

func (ic *InvoiceCreate) SetOrder(o *Order) *InvoiceCreate

SetOrder sets the "order" edge to the Order entity.

func (*InvoiceCreate) SetOrderID

func (ic *InvoiceCreate) SetOrderID(u uuid.UUID) *InvoiceCreate

SetOrderID sets the "order_id" field.

func (*InvoiceCreate) SetPaymentMethod

func (ic *InvoiceCreate) SetPaymentMethod(im invoice.PaymentMethod) *InvoiceCreate

SetPaymentMethod sets the "payment_method" field.

func (*InvoiceCreate) SetStatusCode

func (ic *InvoiceCreate) SetStatusCode(i int) *InvoiceCreate

SetStatusCode sets the "status_code" field.

func (*InvoiceCreate) SetTotal

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

SetTotal sets the "total" field.

func (*InvoiceCreate) SetType

func (ic *InvoiceCreate) SetType(i invoice.Type) *InvoiceCreate

SetType sets the "type" field.

func (*InvoiceCreate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" 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) 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 {
	// Order holds the value of the order edge.
	Order *Order `json:"order,omitempty"`
	// InvoiceStatus holds the value of the invoice_status edge.
	InvoiceStatus *InvoiceStatusCode `json:"invoice_status,omitempty"`
	// contains filtered or unexported fields
}

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

func (InvoiceEdges) InvoiceStatusOrErr

func (e InvoiceEdges) InvoiceStatusOrErr() (*InvoiceStatusCode, error)

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

func (InvoiceEdges) OrderOrErr

func (e InvoiceEdges) OrderOrErr() (*Order, error)

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

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 InvoiceHistories

type InvoiceHistories []*InvoiceHistory

InvoiceHistories is a parsable slice of InvoiceHistory.

type InvoiceHistory

type InvoiceHistory struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// InvoiceID holds the value of the "invoice_id" field.
	InvoiceID uuid.UUID `json:"invoice_id,omitempty"`
	// PersonID holds the value of the "person_id" field.
	PersonID uuid.UUID `json:"person_id,omitempty"`
	// OldStatusCode holds the value of the "old_status_code" field.
	OldStatusCode *int `json:"old_status_code,omitempty"`
	// NewStatusCode holds the value of the "new_status_code" field.
	NewStatusCode *int `json:"new_status_code,omitempty"`
	// Description holds the value of the "description" field.
	Description *string `json:"description,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the InvoiceHistoryQuery when eager-loading is set.
	Edges InvoiceHistoryEdges `json:"edges"`
	// contains filtered or unexported fields
}

InvoiceHistory is the model entity for the InvoiceHistory schema.

func (*InvoiceHistory) QueryInvoice

func (ih *InvoiceHistory) QueryInvoice() *InvoiceQuery

QueryInvoice queries the "invoice" edge of the InvoiceHistory entity.

func (*InvoiceHistory) QueryNewStatus

func (ih *InvoiceHistory) QueryNewStatus() *InvoiceStatusCodeQuery

QueryNewStatus queries the "new_status" edge of the InvoiceHistory entity.

func (*InvoiceHistory) QueryOldStatus

func (ih *InvoiceHistory) QueryOldStatus() *InvoiceStatusCodeQuery

QueryOldStatus queries the "old_status" edge of the InvoiceHistory entity.

func (*InvoiceHistory) QueryPerson

func (ih *InvoiceHistory) QueryPerson() *PersonQuery

QueryPerson queries the "person" edge of the InvoiceHistory entity.

func (*InvoiceHistory) String

func (ih *InvoiceHistory) String() string

String implements the fmt.Stringer.

func (*InvoiceHistory) Unwrap

func (ih *InvoiceHistory) Unwrap() *InvoiceHistory

Unwrap unwraps the InvoiceHistory 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 (*InvoiceHistory) Update

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

func (*InvoiceHistory) Value

func (ih *InvoiceHistory) Value(name string) (ent.Value, error)

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

type InvoiceHistoryClient

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

InvoiceHistoryClient is a client for the InvoiceHistory schema.

func NewInvoiceHistoryClient

func NewInvoiceHistoryClient(c config) *InvoiceHistoryClient

NewInvoiceHistoryClient returns a client for the InvoiceHistory from the given config.

func (*InvoiceHistoryClient) Create

Create returns a builder for creating a InvoiceHistory entity.

func (*InvoiceHistoryClient) CreateBulk

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

func (*InvoiceHistoryClient) Delete

Delete returns a delete builder for InvoiceHistory.

func (*InvoiceHistoryClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*InvoiceHistoryClient) DeleteOneID

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

func (*InvoiceHistoryClient) Get

Get returns a InvoiceHistory entity by its id.

func (*InvoiceHistoryClient) GetX

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

func (*InvoiceHistoryClient) Hooks

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

Hooks returns the client hooks.

func (*InvoiceHistoryClient) Intercept

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

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

func (*InvoiceHistoryClient) Interceptors

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

Interceptors returns the client interceptors.

func (*InvoiceHistoryClient) MapCreateBulk

func (c *InvoiceHistoryClient) MapCreateBulk(slice any, setFunc func(*InvoiceHistoryCreate, int)) *InvoiceHistoryCreateBulk

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 (*InvoiceHistoryClient) Query

Query returns a query builder for InvoiceHistory.

func (*InvoiceHistoryClient) QueryInvoice

func (c *InvoiceHistoryClient) QueryInvoice(ih *InvoiceHistory) *InvoiceQuery

QueryInvoice queries the invoice edge of a InvoiceHistory.

func (*InvoiceHistoryClient) QueryNewStatus

QueryNewStatus queries the new_status edge of a InvoiceHistory.

func (*InvoiceHistoryClient) QueryOldStatus

QueryOldStatus queries the old_status edge of a InvoiceHistory.

func (*InvoiceHistoryClient) QueryPerson

func (c *InvoiceHistoryClient) QueryPerson(ih *InvoiceHistory) *PersonQuery

QueryPerson queries the person edge of a InvoiceHistory.

func (*InvoiceHistoryClient) Update

Update returns an update builder for InvoiceHistory.

func (*InvoiceHistoryClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*InvoiceHistoryClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*InvoiceHistoryClient) Use

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

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

type InvoiceHistoryCreate

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

InvoiceHistoryCreate is the builder for creating a InvoiceHistory entity.

func (*InvoiceHistoryCreate) Exec

func (ihc *InvoiceHistoryCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*InvoiceHistoryCreate) ExecX

func (ihc *InvoiceHistoryCreate) ExecX(ctx context.Context)

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

func (*InvoiceHistoryCreate) Mutation

Mutation returns the InvoiceHistoryMutation object of the builder.

func (*InvoiceHistoryCreate) Save

Save creates the InvoiceHistory in the database.

func (*InvoiceHistoryCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*InvoiceHistoryCreate) SetCreatedAt

func (ihc *InvoiceHistoryCreate) SetCreatedAt(t time.Time) *InvoiceHistoryCreate

SetCreatedAt sets the "created_at" field.

func (*InvoiceHistoryCreate) SetDescription

func (ihc *InvoiceHistoryCreate) SetDescription(s string) *InvoiceHistoryCreate

SetDescription sets the "description" field.

func (*InvoiceHistoryCreate) SetID

SetID sets the "id" field.

func (*InvoiceHistoryCreate) SetInvoice

func (ihc *InvoiceHistoryCreate) SetInvoice(i *Invoice) *InvoiceHistoryCreate

SetInvoice sets the "invoice" edge to the Invoice entity.

func (*InvoiceHistoryCreate) SetInvoiceID

func (ihc *InvoiceHistoryCreate) SetInvoiceID(u uuid.UUID) *InvoiceHistoryCreate

SetInvoiceID sets the "invoice_id" field.

func (*InvoiceHistoryCreate) SetNewStatus

SetNewStatus sets the "new_status" edge to the InvoiceStatusCode entity.

func (*InvoiceHistoryCreate) SetNewStatusCode

func (ihc *InvoiceHistoryCreate) SetNewStatusCode(i int) *InvoiceHistoryCreate

SetNewStatusCode sets the "new_status_code" field.

func (*InvoiceHistoryCreate) SetNewStatusID

func (ihc *InvoiceHistoryCreate) SetNewStatusID(id int) *InvoiceHistoryCreate

SetNewStatusID sets the "new_status" edge to the InvoiceStatusCode entity by ID.

func (*InvoiceHistoryCreate) SetNillableCreatedAt

func (ihc *InvoiceHistoryCreate) SetNillableCreatedAt(t *time.Time) *InvoiceHistoryCreate

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

func (*InvoiceHistoryCreate) SetNillableDescription

func (ihc *InvoiceHistoryCreate) SetNillableDescription(s *string) *InvoiceHistoryCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*InvoiceHistoryCreate) SetNillableID

func (ihc *InvoiceHistoryCreate) SetNillableID(u *uuid.UUID) *InvoiceHistoryCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*InvoiceHistoryCreate) SetNillableNewStatusCode

func (ihc *InvoiceHistoryCreate) SetNillableNewStatusCode(i *int) *InvoiceHistoryCreate

SetNillableNewStatusCode sets the "new_status_code" field if the given value is not nil.

func (*InvoiceHistoryCreate) SetNillableNewStatusID

func (ihc *InvoiceHistoryCreate) SetNillableNewStatusID(id *int) *InvoiceHistoryCreate

SetNillableNewStatusID sets the "new_status" edge to the InvoiceStatusCode entity by ID if the given value is not nil.

func (*InvoiceHistoryCreate) SetNillableOldStatusCode

func (ihc *InvoiceHistoryCreate) SetNillableOldStatusCode(i *int) *InvoiceHistoryCreate

SetNillableOldStatusCode sets the "old_status_code" field if the given value is not nil.

func (*InvoiceHistoryCreate) SetNillableOldStatusID

func (ihc *InvoiceHistoryCreate) SetNillableOldStatusID(id *int) *InvoiceHistoryCreate

SetNillableOldStatusID sets the "old_status" edge to the InvoiceStatusCode entity by ID if the given value is not nil.

func (*InvoiceHistoryCreate) SetOldStatus

SetOldStatus sets the "old_status" edge to the InvoiceStatusCode entity.

func (*InvoiceHistoryCreate) SetOldStatusCode

func (ihc *InvoiceHistoryCreate) SetOldStatusCode(i int) *InvoiceHistoryCreate

SetOldStatusCode sets the "old_status_code" field.

func (*InvoiceHistoryCreate) SetOldStatusID

func (ihc *InvoiceHistoryCreate) SetOldStatusID(id int) *InvoiceHistoryCreate

SetOldStatusID sets the "old_status" edge to the InvoiceStatusCode entity by ID.

func (*InvoiceHistoryCreate) SetPerson

func (ihc *InvoiceHistoryCreate) SetPerson(p *Person) *InvoiceHistoryCreate

SetPerson sets the "person" edge to the Person entity.

func (*InvoiceHistoryCreate) SetPersonID

func (ihc *InvoiceHistoryCreate) SetPersonID(u uuid.UUID) *InvoiceHistoryCreate

SetPersonID sets the "person_id" field.

type InvoiceHistoryCreateBulk

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

InvoiceHistoryCreateBulk is the builder for creating many InvoiceHistory entities in bulk.

func (*InvoiceHistoryCreateBulk) Exec

Exec executes the query.

func (*InvoiceHistoryCreateBulk) ExecX

func (ihcb *InvoiceHistoryCreateBulk) ExecX(ctx context.Context)

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

func (*InvoiceHistoryCreateBulk) Save

Save creates the InvoiceHistory entities in the database.

func (*InvoiceHistoryCreateBulk) SaveX

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

type InvoiceHistoryDelete

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

InvoiceHistoryDelete is the builder for deleting a InvoiceHistory entity.

func (*InvoiceHistoryDelete) Exec

func (ihd *InvoiceHistoryDelete) Exec(ctx context.Context) (int, error)

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

func (*InvoiceHistoryDelete) ExecX

func (ihd *InvoiceHistoryDelete) ExecX(ctx context.Context) int

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

func (*InvoiceHistoryDelete) Where

Where appends a list predicates to the InvoiceHistoryDelete builder.

type InvoiceHistoryDeleteOne

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

InvoiceHistoryDeleteOne is the builder for deleting a single InvoiceHistory entity.

func (*InvoiceHistoryDeleteOne) Exec

func (ihdo *InvoiceHistoryDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*InvoiceHistoryDeleteOne) ExecX

func (ihdo *InvoiceHistoryDeleteOne) ExecX(ctx context.Context)

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

func (*InvoiceHistoryDeleteOne) Where

Where appends a list predicates to the InvoiceHistoryDelete builder.

type InvoiceHistoryEdges

type InvoiceHistoryEdges struct {
	// Invoice holds the value of the invoice edge.
	Invoice *Invoice `json:"invoice,omitempty"`
	// Person holds the value of the person edge.
	Person *Person `json:"person,omitempty"`
	// OldStatus holds the value of the old_status edge.
	OldStatus *InvoiceStatusCode `json:"old_status,omitempty"`
	// NewStatus holds the value of the new_status edge.
	NewStatus *InvoiceStatusCode `json:"new_status,omitempty"`
	// contains filtered or unexported fields
}

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

func (InvoiceHistoryEdges) InvoiceOrErr

func (e InvoiceHistoryEdges) 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 (InvoiceHistoryEdges) NewStatusOrErr

func (e InvoiceHistoryEdges) NewStatusOrErr() (*InvoiceStatusCode, error)

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

func (InvoiceHistoryEdges) OldStatusOrErr

func (e InvoiceHistoryEdges) OldStatusOrErr() (*InvoiceStatusCode, error)

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

func (InvoiceHistoryEdges) PersonOrErr

func (e InvoiceHistoryEdges) PersonOrErr() (*Person, error)

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

type InvoiceHistoryGroupBy

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

InvoiceHistoryGroupBy is the group-by builder for InvoiceHistory entities.

func (*InvoiceHistoryGroupBy) Aggregate

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

func (*InvoiceHistoryGroupBy) Bool

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

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

func (*InvoiceHistoryGroupBy) BoolX

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

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

func (*InvoiceHistoryGroupBy) Bools

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

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

func (*InvoiceHistoryGroupBy) BoolsX

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

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

func (*InvoiceHistoryGroupBy) Float64

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

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

func (*InvoiceHistoryGroupBy) Float64X

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

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

func (*InvoiceHistoryGroupBy) Float64s

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

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

func (*InvoiceHistoryGroupBy) Float64sX

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

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

func (*InvoiceHistoryGroupBy) Int

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

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

func (*InvoiceHistoryGroupBy) IntX

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

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

func (*InvoiceHistoryGroupBy) Ints

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

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

func (*InvoiceHistoryGroupBy) IntsX

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

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

func (*InvoiceHistoryGroupBy) Scan

func (ihgb *InvoiceHistoryGroupBy) Scan(ctx context.Context, v any) error

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

func (*InvoiceHistoryGroupBy) ScanX

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

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

func (*InvoiceHistoryGroupBy) String

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

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

func (*InvoiceHistoryGroupBy) StringX

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

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

func (*InvoiceHistoryGroupBy) Strings

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

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

func (*InvoiceHistoryGroupBy) StringsX

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

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

type InvoiceHistoryMutation

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

InvoiceHistoryMutation represents an operation that mutates the InvoiceHistory nodes in the graph.

func (*InvoiceHistoryMutation) AddField

func (m *InvoiceHistoryMutation) 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 (*InvoiceHistoryMutation) AddedEdges

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

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

func (*InvoiceHistoryMutation) AddedField

func (m *InvoiceHistoryMutation) 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 (*InvoiceHistoryMutation) AddedFields

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

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

func (*InvoiceHistoryMutation) AddedIDs

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

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

func (*InvoiceHistoryMutation) ClearDescription

func (m *InvoiceHistoryMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*InvoiceHistoryMutation) ClearEdge

func (m *InvoiceHistoryMutation) 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 (*InvoiceHistoryMutation) ClearField

func (m *InvoiceHistoryMutation) 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 (*InvoiceHistoryMutation) ClearInvoice

func (m *InvoiceHistoryMutation) ClearInvoice()

ClearInvoice clears the "invoice" edge to the Invoice entity.

func (*InvoiceHistoryMutation) ClearNewStatus

func (m *InvoiceHistoryMutation) ClearNewStatus()

ClearNewStatus clears the "new_status" edge to the InvoiceStatusCode entity.

func (*InvoiceHistoryMutation) ClearNewStatusCode

func (m *InvoiceHistoryMutation) ClearNewStatusCode()

ClearNewStatusCode clears the value of the "new_status_code" field.

func (*InvoiceHistoryMutation) ClearOldStatus

func (m *InvoiceHistoryMutation) ClearOldStatus()

ClearOldStatus clears the "old_status" edge to the InvoiceStatusCode entity.

func (*InvoiceHistoryMutation) ClearOldStatusCode

func (m *InvoiceHistoryMutation) ClearOldStatusCode()

ClearOldStatusCode clears the value of the "old_status_code" field.

func (*InvoiceHistoryMutation) ClearPerson

func (m *InvoiceHistoryMutation) ClearPerson()

ClearPerson clears the "person" edge to the Person entity.

func (*InvoiceHistoryMutation) ClearedEdges

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

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

func (*InvoiceHistoryMutation) ClearedFields

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

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

func (InvoiceHistoryMutation) Client

func (m InvoiceHistoryMutation) 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 (*InvoiceHistoryMutation) CreatedAt

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

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

func (*InvoiceHistoryMutation) Description

func (m *InvoiceHistoryMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*InvoiceHistoryMutation) DescriptionCleared

func (m *InvoiceHistoryMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*InvoiceHistoryMutation) EdgeCleared

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

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

func (*InvoiceHistoryMutation) Field

func (m *InvoiceHistoryMutation) 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 (*InvoiceHistoryMutation) FieldCleared

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

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

func (*InvoiceHistoryMutation) Fields

func (m *InvoiceHistoryMutation) 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 (*InvoiceHistoryMutation) ID

func (m *InvoiceHistoryMutation) ID() (id uuid.UUID, 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 (*InvoiceHistoryMutation) 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 (*InvoiceHistoryMutation) InvoiceCleared

func (m *InvoiceHistoryMutation) InvoiceCleared() bool

InvoiceCleared reports if the "invoice" edge to the Invoice entity was cleared.

func (*InvoiceHistoryMutation) InvoiceID

func (m *InvoiceHistoryMutation) InvoiceID() (r uuid.UUID, exists bool)

InvoiceID returns the value of the "invoice_id" field in the mutation.

func (*InvoiceHistoryMutation) InvoiceIDs

func (m *InvoiceHistoryMutation) InvoiceIDs() (ids []uuid.UUID)

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 (*InvoiceHistoryMutation) NewStatusCleared

func (m *InvoiceHistoryMutation) NewStatusCleared() bool

NewStatusCleared reports if the "new_status" edge to the InvoiceStatusCode entity was cleared.

func (*InvoiceHistoryMutation) NewStatusCode

func (m *InvoiceHistoryMutation) NewStatusCode() (r int, exists bool)

NewStatusCode returns the value of the "new_status_code" field in the mutation.

func (*InvoiceHistoryMutation) NewStatusCodeCleared

func (m *InvoiceHistoryMutation) NewStatusCodeCleared() bool

NewStatusCodeCleared returns if the "new_status_code" field was cleared in this mutation.

func (*InvoiceHistoryMutation) NewStatusID

func (m *InvoiceHistoryMutation) NewStatusID() (id int, exists bool)

NewStatusID returns the "new_status" edge ID in the mutation.

func (*InvoiceHistoryMutation) NewStatusIDs

func (m *InvoiceHistoryMutation) NewStatusIDs() (ids []int)

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

func (*InvoiceHistoryMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the InvoiceHistory entity. If the InvoiceHistory 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 (*InvoiceHistoryMutation) OldDescription

func (m *InvoiceHistoryMutation) OldDescription(ctx context.Context) (v *string, err error)

OldDescription returns the old "description" field's value of the InvoiceHistory entity. If the InvoiceHistory 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 (*InvoiceHistoryMutation) OldField

func (m *InvoiceHistoryMutation) 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 (*InvoiceHistoryMutation) OldInvoiceID

func (m *InvoiceHistoryMutation) OldInvoiceID(ctx context.Context) (v uuid.UUID, err error)

OldInvoiceID returns the old "invoice_id" field's value of the InvoiceHistory entity. If the InvoiceHistory 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 (*InvoiceHistoryMutation) OldNewStatusCode

func (m *InvoiceHistoryMutation) OldNewStatusCode(ctx context.Context) (v *int, err error)

OldNewStatusCode returns the old "new_status_code" field's value of the InvoiceHistory entity. If the InvoiceHistory 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 (*InvoiceHistoryMutation) OldOldStatusCode

func (m *InvoiceHistoryMutation) OldOldStatusCode(ctx context.Context) (v *int, err error)

OldOldStatusCode returns the old "old_status_code" field's value of the InvoiceHistory entity. If the InvoiceHistory 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 (*InvoiceHistoryMutation) OldPersonID

func (m *InvoiceHistoryMutation) OldPersonID(ctx context.Context) (v uuid.UUID, err error)

OldPersonID returns the old "person_id" field's value of the InvoiceHistory entity. If the InvoiceHistory 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 (*InvoiceHistoryMutation) OldStatusCleared

func (m *InvoiceHistoryMutation) OldStatusCleared() bool

OldStatusCleared reports if the "old_status" edge to the InvoiceStatusCode entity was cleared.

func (*InvoiceHistoryMutation) OldStatusCode

func (m *InvoiceHistoryMutation) OldStatusCode() (r int, exists bool)

OldStatusCode returns the value of the "old_status_code" field in the mutation.

func (*InvoiceHistoryMutation) OldStatusCodeCleared

func (m *InvoiceHistoryMutation) OldStatusCodeCleared() bool

OldStatusCodeCleared returns if the "old_status_code" field was cleared in this mutation.

func (*InvoiceHistoryMutation) OldStatusID

func (m *InvoiceHistoryMutation) OldStatusID() (id int, exists bool)

OldStatusID returns the "old_status" edge ID in the mutation.

func (*InvoiceHistoryMutation) OldStatusIDs

func (m *InvoiceHistoryMutation) OldStatusIDs() (ids []int)

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

func (*InvoiceHistoryMutation) Op

func (m *InvoiceHistoryMutation) Op() Op

Op returns the operation name.

func (*InvoiceHistoryMutation) PersonCleared

func (m *InvoiceHistoryMutation) PersonCleared() bool

PersonCleared reports if the "person" edge to the Person entity was cleared.

func (*InvoiceHistoryMutation) PersonID

func (m *InvoiceHistoryMutation) PersonID() (r uuid.UUID, exists bool)

PersonID returns the value of the "person_id" field in the mutation.

func (*InvoiceHistoryMutation) PersonIDs

func (m *InvoiceHistoryMutation) PersonIDs() (ids []uuid.UUID)

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

func (*InvoiceHistoryMutation) RemovedEdges

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

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

func (*InvoiceHistoryMutation) RemovedIDs

func (m *InvoiceHistoryMutation) 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 (*InvoiceHistoryMutation) ResetCreatedAt

func (m *InvoiceHistoryMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*InvoiceHistoryMutation) ResetDescription

func (m *InvoiceHistoryMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*InvoiceHistoryMutation) ResetEdge

func (m *InvoiceHistoryMutation) 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 (*InvoiceHistoryMutation) ResetField

func (m *InvoiceHistoryMutation) 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 (*InvoiceHistoryMutation) ResetInvoice

func (m *InvoiceHistoryMutation) ResetInvoice()

ResetInvoice resets all changes to the "invoice" edge.

func (*InvoiceHistoryMutation) ResetInvoiceID

func (m *InvoiceHistoryMutation) ResetInvoiceID()

ResetInvoiceID resets all changes to the "invoice_id" field.

func (*InvoiceHistoryMutation) ResetNewStatus

func (m *InvoiceHistoryMutation) ResetNewStatus()

ResetNewStatus resets all changes to the "new_status" edge.

func (*InvoiceHistoryMutation) ResetNewStatusCode

func (m *InvoiceHistoryMutation) ResetNewStatusCode()

ResetNewStatusCode resets all changes to the "new_status_code" field.

func (*InvoiceHistoryMutation) ResetOldStatus

func (m *InvoiceHistoryMutation) ResetOldStatus()

ResetOldStatus resets all changes to the "old_status" edge.

func (*InvoiceHistoryMutation) ResetOldStatusCode

func (m *InvoiceHistoryMutation) ResetOldStatusCode()

ResetOldStatusCode resets all changes to the "old_status_code" field.

func (*InvoiceHistoryMutation) ResetPerson

func (m *InvoiceHistoryMutation) ResetPerson()

ResetPerson resets all changes to the "person" edge.

func (*InvoiceHistoryMutation) ResetPersonID

func (m *InvoiceHistoryMutation) ResetPersonID()

ResetPersonID resets all changes to the "person_id" field.

func (*InvoiceHistoryMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*InvoiceHistoryMutation) SetDescription

func (m *InvoiceHistoryMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*InvoiceHistoryMutation) SetField

func (m *InvoiceHistoryMutation) 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 (*InvoiceHistoryMutation) SetID

func (m *InvoiceHistoryMutation) SetID(id uuid.UUID)

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

func (*InvoiceHistoryMutation) SetInvoiceID

func (m *InvoiceHistoryMutation) SetInvoiceID(u uuid.UUID)

SetInvoiceID sets the "invoice_id" field.

func (*InvoiceHistoryMutation) SetNewStatusCode

func (m *InvoiceHistoryMutation) SetNewStatusCode(i int)

SetNewStatusCode sets the "new_status_code" field.

func (*InvoiceHistoryMutation) SetNewStatusID

func (m *InvoiceHistoryMutation) SetNewStatusID(id int)

SetNewStatusID sets the "new_status" edge to the InvoiceStatusCode entity by id.

func (*InvoiceHistoryMutation) SetOldStatusCode

func (m *InvoiceHistoryMutation) SetOldStatusCode(i int)

SetOldStatusCode sets the "old_status_code" field.

func (*InvoiceHistoryMutation) SetOldStatusID

func (m *InvoiceHistoryMutation) SetOldStatusID(id int)

SetOldStatusID sets the "old_status" edge to the InvoiceStatusCode entity by id.

func (*InvoiceHistoryMutation) SetOp

func (m *InvoiceHistoryMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*InvoiceHistoryMutation) SetPersonID

func (m *InvoiceHistoryMutation) SetPersonID(u uuid.UUID)

SetPersonID sets the "person_id" field.

func (InvoiceHistoryMutation) Tx

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

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

func (*InvoiceHistoryMutation) Type

func (m *InvoiceHistoryMutation) Type() string

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

func (*InvoiceHistoryMutation) Where

Where appends a list predicates to the InvoiceHistoryMutation builder.

func (*InvoiceHistoryMutation) WhereP

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

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

type InvoiceHistoryQuery

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

InvoiceHistoryQuery is the builder for querying InvoiceHistory entities.

func (*InvoiceHistoryQuery) Aggregate

func (ihq *InvoiceHistoryQuery) Aggregate(fns ...AggregateFunc) *InvoiceHistorySelect

Aggregate returns a InvoiceHistorySelect configured with the given aggregations.

func (*InvoiceHistoryQuery) All

All executes the query and returns a list of InvoiceHistories.

func (*InvoiceHistoryQuery) AllX

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

func (*InvoiceHistoryQuery) Clone

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

func (*InvoiceHistoryQuery) Count

func (ihq *InvoiceHistoryQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*InvoiceHistoryQuery) CountX

func (ihq *InvoiceHistoryQuery) CountX(ctx context.Context) int

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

func (*InvoiceHistoryQuery) Exist

func (ihq *InvoiceHistoryQuery) Exist(ctx context.Context) (bool, error)

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

func (*InvoiceHistoryQuery) ExistX

func (ihq *InvoiceHistoryQuery) ExistX(ctx context.Context) bool

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

func (*InvoiceHistoryQuery) First

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

func (*InvoiceHistoryQuery) FirstID

func (ihq *InvoiceHistoryQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*InvoiceHistoryQuery) FirstIDX

func (ihq *InvoiceHistoryQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*InvoiceHistoryQuery) FirstX

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

func (*InvoiceHistoryQuery) GroupBy

func (ihq *InvoiceHistoryQuery) GroupBy(field string, fields ...string) *InvoiceHistoryGroupBy

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.InvoiceHistory.Query().
	GroupBy(invoicehistory.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*InvoiceHistoryQuery) IDs

func (ihq *InvoiceHistoryQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

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

func (*InvoiceHistoryQuery) IDsX

func (ihq *InvoiceHistoryQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*InvoiceHistoryQuery) Limit

func (ihq *InvoiceHistoryQuery) Limit(limit int) *InvoiceHistoryQuery

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

func (*InvoiceHistoryQuery) Offset

func (ihq *InvoiceHistoryQuery) Offset(offset int) *InvoiceHistoryQuery

Offset to start from.

func (*InvoiceHistoryQuery) Only

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

func (*InvoiceHistoryQuery) OnlyID

func (ihq *InvoiceHistoryQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*InvoiceHistoryQuery) OnlyIDX

func (ihq *InvoiceHistoryQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*InvoiceHistoryQuery) OnlyX

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

func (*InvoiceHistoryQuery) Order

Order specifies how the records should be ordered.

func (*InvoiceHistoryQuery) QueryInvoice

func (ihq *InvoiceHistoryQuery) QueryInvoice() *InvoiceQuery

QueryInvoice chains the current query on the "invoice" edge.

func (*InvoiceHistoryQuery) QueryNewStatus

func (ihq *InvoiceHistoryQuery) QueryNewStatus() *InvoiceStatusCodeQuery

QueryNewStatus chains the current query on the "new_status" edge.

func (*InvoiceHistoryQuery) QueryOldStatus

func (ihq *InvoiceHistoryQuery) QueryOldStatus() *InvoiceStatusCodeQuery

QueryOldStatus chains the current query on the "old_status" edge.

func (*InvoiceHistoryQuery) QueryPerson

func (ihq *InvoiceHistoryQuery) QueryPerson() *PersonQuery

QueryPerson chains the current query on the "person" edge.

func (*InvoiceHistoryQuery) Select

func (ihq *InvoiceHistoryQuery) Select(fields ...string) *InvoiceHistorySelect

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.InvoiceHistory.Query().
	Select(invoicehistory.FieldCreatedAt).
	Scan(ctx, &v)

func (*InvoiceHistoryQuery) Unique

func (ihq *InvoiceHistoryQuery) Unique(unique bool) *InvoiceHistoryQuery

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 (*InvoiceHistoryQuery) Where

Where adds a new predicate for the InvoiceHistoryQuery builder.

func (*InvoiceHistoryQuery) WithInvoice

func (ihq *InvoiceHistoryQuery) WithInvoice(opts ...func(*InvoiceQuery)) *InvoiceHistoryQuery

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 (*InvoiceHistoryQuery) WithNewStatus

func (ihq *InvoiceHistoryQuery) WithNewStatus(opts ...func(*InvoiceStatusCodeQuery)) *InvoiceHistoryQuery

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

func (*InvoiceHistoryQuery) WithOldStatus

func (ihq *InvoiceHistoryQuery) WithOldStatus(opts ...func(*InvoiceStatusCodeQuery)) *InvoiceHistoryQuery

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

func (*InvoiceHistoryQuery) WithPerson

func (ihq *InvoiceHistoryQuery) WithPerson(opts ...func(*PersonQuery)) *InvoiceHistoryQuery

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

type InvoiceHistorySelect

type InvoiceHistorySelect struct {
	*InvoiceHistoryQuery
	// contains filtered or unexported fields
}

InvoiceHistorySelect is the builder for selecting fields of InvoiceHistory entities.

func (*InvoiceHistorySelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*InvoiceHistorySelect) Bool

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

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

func (*InvoiceHistorySelect) BoolX

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

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

func (*InvoiceHistorySelect) Bools

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

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

func (*InvoiceHistorySelect) BoolsX

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

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

func (*InvoiceHistorySelect) Float64

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

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

func (*InvoiceHistorySelect) Float64X

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

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

func (*InvoiceHistorySelect) Float64s

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

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

func (*InvoiceHistorySelect) Float64sX

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

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

func (*InvoiceHistorySelect) Int

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

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

func (*InvoiceHistorySelect) IntX

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

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

func (*InvoiceHistorySelect) Ints

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

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

func (*InvoiceHistorySelect) IntsX

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

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

func (*InvoiceHistorySelect) Scan

func (ihs *InvoiceHistorySelect) Scan(ctx context.Context, v any) error

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

func (*InvoiceHistorySelect) ScanX

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

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

func (*InvoiceHistorySelect) String

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

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

func (*InvoiceHistorySelect) StringX

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

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

func (*InvoiceHistorySelect) Strings

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

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

func (*InvoiceHistorySelect) StringsX

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

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

type InvoiceHistoryUpdate

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

InvoiceHistoryUpdate is the builder for updating InvoiceHistory entities.

func (*InvoiceHistoryUpdate) Exec

func (ihu *InvoiceHistoryUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*InvoiceHistoryUpdate) ExecX

func (ihu *InvoiceHistoryUpdate) ExecX(ctx context.Context)

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

func (*InvoiceHistoryUpdate) Mutation

Mutation returns the InvoiceHistoryMutation object of the builder.

func (*InvoiceHistoryUpdate) Save

func (ihu *InvoiceHistoryUpdate) Save(ctx context.Context) (int, error)

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

func (*InvoiceHistoryUpdate) SaveX

func (ihu *InvoiceHistoryUpdate) SaveX(ctx context.Context) int

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

func (*InvoiceHistoryUpdate) Where

Where appends a list predicates to the InvoiceHistoryUpdate builder.

type InvoiceHistoryUpdateOne

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

InvoiceHistoryUpdateOne is the builder for updating a single InvoiceHistory entity.

func (*InvoiceHistoryUpdateOne) Exec

func (ihuo *InvoiceHistoryUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*InvoiceHistoryUpdateOne) ExecX

func (ihuo *InvoiceHistoryUpdateOne) ExecX(ctx context.Context)

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

func (*InvoiceHistoryUpdateOne) Mutation

Mutation returns the InvoiceHistoryMutation object of the builder.

func (*InvoiceHistoryUpdateOne) Save

Save executes the query and returns the updated InvoiceHistory entity.

func (*InvoiceHistoryUpdateOne) SaveX

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

func (*InvoiceHistoryUpdateOne) Select

func (ihuo *InvoiceHistoryUpdateOne) Select(field string, fields ...string) *InvoiceHistoryUpdateOne

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

func (*InvoiceHistoryUpdateOne) Where

Where appends a list predicates to the InvoiceHistoryUpdate builder.

type InvoiceMutation

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

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

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) AddTotal

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

AddTotal adds d to the "total" field.

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) AddedTotal

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

AddedTotal returns the value that was added to the "total" field in this 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) 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) ClearInvoiceStatus

func (m *InvoiceMutation) ClearInvoiceStatus()

ClearInvoiceStatus clears the "invoice_status" edge to the InvoiceStatusCode entity.

func (*InvoiceMutation) ClearNote

func (m *InvoiceMutation) ClearNote()

ClearNote clears the value of the "note" field.

func (*InvoiceMutation) ClearOrder

func (m *InvoiceMutation) ClearOrder()

ClearOrder clears the "order" edge to the Order entity.

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) CreatedAt

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

CreatedAt returns the value of the "created_at" 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) 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) GetType

func (m *InvoiceMutation) GetType() (r invoice.Type, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*InvoiceMutation) ID

func (m *InvoiceMutation) ID() (id uuid.UUID, 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) ([]uuid.UUID, 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) InvoiceStatusCleared

func (m *InvoiceMutation) InvoiceStatusCleared() bool

InvoiceStatusCleared reports if the "invoice_status" edge to the InvoiceStatusCode entity was cleared.

func (*InvoiceMutation) InvoiceStatusID

func (m *InvoiceMutation) InvoiceStatusID() (id int, exists bool)

InvoiceStatusID returns the "invoice_status" edge ID in the mutation.

func (*InvoiceMutation) InvoiceStatusIDs

func (m *InvoiceMutation) InvoiceStatusIDs() (ids []int)

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

func (*InvoiceMutation) Note

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

Note returns the value of the "note" field in the mutation.

func (*InvoiceMutation) NoteCleared

func (m *InvoiceMutation) NoteCleared() bool

NoteCleared returns if the "note" field was cleared in this mutation.

func (*InvoiceMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_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) 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) OldNote

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

OldNote returns the old "note" 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) OldOrderID

func (m *InvoiceMutation) OldOrderID(ctx context.Context) (v uuid.UUID, err error)

OldOrderID returns the old "order_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) OldPaymentMethod

func (m *InvoiceMutation) OldPaymentMethod(ctx context.Context) (v *invoice.PaymentMethod, err error)

OldPaymentMethod returns the old "payment_method" 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) OldStatusCode

func (m *InvoiceMutation) OldStatusCode(ctx context.Context) (v *int, err error)

OldStatusCode returns the old "status_code" 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) OldTotal

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

OldTotal returns the old "total" 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) OldType

func (m *InvoiceMutation) OldType(ctx context.Context) (v *invoice.Type, err error)

OldType returns the old "type" 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) OldUpdatedAt

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

OldUpdatedAt returns the old "updated_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) Op

func (m *InvoiceMutation) Op() Op

Op returns the operation name.

func (*InvoiceMutation) OrderCleared

func (m *InvoiceMutation) OrderCleared() bool

OrderCleared reports if the "order" edge to the Order entity was cleared.

func (*InvoiceMutation) OrderID

func (m *InvoiceMutation) OrderID() (r uuid.UUID, exists bool)

OrderID returns the value of the "order_id" field in the mutation.

func (*InvoiceMutation) OrderIDs

func (m *InvoiceMutation) OrderIDs() (ids []uuid.UUID)

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

func (*InvoiceMutation) PaymentMethod

func (m *InvoiceMutation) PaymentMethod() (r invoice.PaymentMethod, exists bool)

PaymentMethod returns the value of the "payment_method" field in the mutation.

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) ResetCreatedAt

func (m *InvoiceMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" 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) 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) ResetInvoiceStatus

func (m *InvoiceMutation) ResetInvoiceStatus()

ResetInvoiceStatus resets all changes to the "invoice_status" edge.

func (*InvoiceMutation) ResetNote

func (m *InvoiceMutation) ResetNote()

ResetNote resets all changes to the "note" field.

func (*InvoiceMutation) ResetOrder

func (m *InvoiceMutation) ResetOrder()

ResetOrder resets all changes to the "order" edge.

func (*InvoiceMutation) ResetOrderID

func (m *InvoiceMutation) ResetOrderID()

ResetOrderID resets all changes to the "order_id" field.

func (*InvoiceMutation) ResetPaymentMethod

func (m *InvoiceMutation) ResetPaymentMethod()

ResetPaymentMethod resets all changes to the "payment_method" field.

func (*InvoiceMutation) ResetStatusCode

func (m *InvoiceMutation) ResetStatusCode()

ResetStatusCode resets all changes to the "status_code" field.

func (*InvoiceMutation) ResetTotal

func (m *InvoiceMutation) ResetTotal()

ResetTotal resets all changes to the "total" field.

func (*InvoiceMutation) ResetType

func (m *InvoiceMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*InvoiceMutation) ResetUpdatedAt

func (m *InvoiceMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*InvoiceMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" 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 uuid.UUID)

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

func (*InvoiceMutation) SetInvoiceStatusID

func (m *InvoiceMutation) SetInvoiceStatusID(id int)

SetInvoiceStatusID sets the "invoice_status" edge to the InvoiceStatusCode entity by id.

func (*InvoiceMutation) SetNote

func (m *InvoiceMutation) SetNote(s string)

SetNote sets the "note" field.

func (*InvoiceMutation) SetOp

func (m *InvoiceMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*InvoiceMutation) SetOrderID

func (m *InvoiceMutation) SetOrderID(u uuid.UUID)

SetOrderID sets the "order_id" field.

func (*InvoiceMutation) SetPaymentMethod

func (m *InvoiceMutation) SetPaymentMethod(im invoice.PaymentMethod)

SetPaymentMethod sets the "payment_method" field.

func (*InvoiceMutation) SetStatusCode

func (m *InvoiceMutation) SetStatusCode(i int)

SetStatusCode sets the "status_code" field.

func (*InvoiceMutation) SetTotal

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

SetTotal sets the "total" field.

func (*InvoiceMutation) SetType

func (m *InvoiceMutation) SetType(i invoice.Type)

SetType sets the "type" field.

func (*InvoiceMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*InvoiceMutation) StatusCode

func (m *InvoiceMutation) StatusCode() (r int, exists bool)

StatusCode returns the value of the "status_code" field in the mutation.

func (*InvoiceMutation) Total

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

Total returns the value of the "total" field in the 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) UpdatedAt

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

UpdatedAt returns the value of the "updated_at" 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) 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 uuid.UUID, 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) uuid.UUID

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Invoice.Query().
	GroupBy(invoice.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*InvoiceQuery) IDs

func (iq *InvoiceQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

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

func (*InvoiceQuery) IDsX

func (iq *InvoiceQuery) IDsX(ctx context.Context) []uuid.UUID

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) 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 uuid.UUID, 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) uuid.UUID

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) QueryInvoiceStatus

func (iq *InvoiceQuery) QueryInvoiceStatus() *InvoiceStatusCodeQuery

QueryInvoiceStatus chains the current query on the "invoice_status" edge.

func (*InvoiceQuery) QueryOrder

func (iq *InvoiceQuery) QueryOrder() *OrderQuery

QueryOrder chains the current query on the "order" 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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Invoice.Query().
	Select(invoice.FieldCreatedAt).
	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) WithInvoiceStatus

func (iq *InvoiceQuery) WithInvoiceStatus(opts ...func(*InvoiceStatusCodeQuery)) *InvoiceQuery

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

func (*InvoiceQuery) WithOrder

func (iq *InvoiceQuery) WithOrder(opts ...func(*OrderQuery)) *InvoiceQuery

WithOrder tells the query-builder to eager-load the nodes that are connected to the "order" 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) 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 InvoiceStatusCode

type InvoiceStatusCode struct {

	// ID of the ent.
	ID int `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"`
	// InvoiceStatus holds the value of the "invoice_status" field.
	InvoiceStatus string `json:"invoice_status,omitempty"`
	// contains filtered or unexported fields
}

InvoiceStatusCode is the model entity for the InvoiceStatusCode schema.

func (*InvoiceStatusCode) String

func (isc *InvoiceStatusCode) String() string

String implements the fmt.Stringer.

func (*InvoiceStatusCode) Unwrap

func (isc *InvoiceStatusCode) Unwrap() *InvoiceStatusCode

Unwrap unwraps the InvoiceStatusCode 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 (*InvoiceStatusCode) Update

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

func (*InvoiceStatusCode) Value

func (isc *InvoiceStatusCode) Value(name string) (ent.Value, error)

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

type InvoiceStatusCodeClient

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

InvoiceStatusCodeClient is a client for the InvoiceStatusCode schema.

func NewInvoiceStatusCodeClient

func NewInvoiceStatusCodeClient(c config) *InvoiceStatusCodeClient

NewInvoiceStatusCodeClient returns a client for the InvoiceStatusCode from the given config.

func (*InvoiceStatusCodeClient) Create

Create returns a builder for creating a InvoiceStatusCode entity.

func (*InvoiceStatusCodeClient) CreateBulk

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

func (*InvoiceStatusCodeClient) Delete

Delete returns a delete builder for InvoiceStatusCode.

func (*InvoiceStatusCodeClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*InvoiceStatusCodeClient) DeleteOneID

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

func (*InvoiceStatusCodeClient) Get

Get returns a InvoiceStatusCode entity by its id.

func (*InvoiceStatusCodeClient) GetX

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

func (*InvoiceStatusCodeClient) Hooks

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

Hooks returns the client hooks.

func (*InvoiceStatusCodeClient) Intercept

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

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

func (*InvoiceStatusCodeClient) Interceptors

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

Interceptors returns the client interceptors.

func (*InvoiceStatusCodeClient) MapCreateBulk

func (c *InvoiceStatusCodeClient) MapCreateBulk(slice any, setFunc func(*InvoiceStatusCodeCreate, int)) *InvoiceStatusCodeCreateBulk

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 (*InvoiceStatusCodeClient) Query

Query returns a query builder for InvoiceStatusCode.

func (*InvoiceStatusCodeClient) Update

Update returns an update builder for InvoiceStatusCode.

func (*InvoiceStatusCodeClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*InvoiceStatusCodeClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*InvoiceStatusCodeClient) Use

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

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

type InvoiceStatusCodeCreate

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

InvoiceStatusCodeCreate is the builder for creating a InvoiceStatusCode entity.

func (*InvoiceStatusCodeCreate) Exec

func (iscc *InvoiceStatusCodeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*InvoiceStatusCodeCreate) ExecX

func (iscc *InvoiceStatusCodeCreate) ExecX(ctx context.Context)

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

func (*InvoiceStatusCodeCreate) Mutation

Mutation returns the InvoiceStatusCodeMutation object of the builder.

func (*InvoiceStatusCodeCreate) Save

Save creates the InvoiceStatusCode in the database.

func (*InvoiceStatusCodeCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*InvoiceStatusCodeCreate) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*InvoiceStatusCodeCreate) SetID

SetID sets the "id" field.

func (*InvoiceStatusCodeCreate) SetInvoiceStatus

func (iscc *InvoiceStatusCodeCreate) SetInvoiceStatus(s string) *InvoiceStatusCodeCreate

SetInvoiceStatus sets the "invoice_status" field.

func (*InvoiceStatusCodeCreate) SetNillableCreatedAt

func (iscc *InvoiceStatusCodeCreate) SetNillableCreatedAt(t *time.Time) *InvoiceStatusCodeCreate

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

func (*InvoiceStatusCodeCreate) SetNillableUpdatedAt

func (iscc *InvoiceStatusCodeCreate) SetNillableUpdatedAt(t *time.Time) *InvoiceStatusCodeCreate

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

func (*InvoiceStatusCodeCreate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

type InvoiceStatusCodeCreateBulk

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

InvoiceStatusCodeCreateBulk is the builder for creating many InvoiceStatusCode entities in bulk.

func (*InvoiceStatusCodeCreateBulk) Exec

Exec executes the query.

func (*InvoiceStatusCodeCreateBulk) ExecX

func (isccb *InvoiceStatusCodeCreateBulk) ExecX(ctx context.Context)

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

func (*InvoiceStatusCodeCreateBulk) Save

Save creates the InvoiceStatusCode entities in the database.

func (*InvoiceStatusCodeCreateBulk) SaveX

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

type InvoiceStatusCodeDelete

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

InvoiceStatusCodeDelete is the builder for deleting a InvoiceStatusCode entity.

func (*InvoiceStatusCodeDelete) Exec

func (iscd *InvoiceStatusCodeDelete) Exec(ctx context.Context) (int, error)

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

func (*InvoiceStatusCodeDelete) ExecX

func (iscd *InvoiceStatusCodeDelete) ExecX(ctx context.Context) int

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

func (*InvoiceStatusCodeDelete) Where

Where appends a list predicates to the InvoiceStatusCodeDelete builder.

type InvoiceStatusCodeDeleteOne

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

InvoiceStatusCodeDeleteOne is the builder for deleting a single InvoiceStatusCode entity.

func (*InvoiceStatusCodeDeleteOne) Exec

Exec executes the deletion query.

func (*InvoiceStatusCodeDeleteOne) ExecX

func (iscdo *InvoiceStatusCodeDeleteOne) ExecX(ctx context.Context)

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

func (*InvoiceStatusCodeDeleteOne) Where

Where appends a list predicates to the InvoiceStatusCodeDelete builder.

type InvoiceStatusCodeGroupBy

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

InvoiceStatusCodeGroupBy is the group-by builder for InvoiceStatusCode entities.

func (*InvoiceStatusCodeGroupBy) Aggregate

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

func (*InvoiceStatusCodeGroupBy) Bool

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

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

func (*InvoiceStatusCodeGroupBy) BoolX

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

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

func (*InvoiceStatusCodeGroupBy) Bools

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

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

func (*InvoiceStatusCodeGroupBy) BoolsX

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

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

func (*InvoiceStatusCodeGroupBy) Float64

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

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

func (*InvoiceStatusCodeGroupBy) Float64X

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

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

func (*InvoiceStatusCodeGroupBy) Float64s

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

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

func (*InvoiceStatusCodeGroupBy) Float64sX

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

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

func (*InvoiceStatusCodeGroupBy) Int

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

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

func (*InvoiceStatusCodeGroupBy) IntX

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

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

func (*InvoiceStatusCodeGroupBy) Ints

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

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

func (*InvoiceStatusCodeGroupBy) IntsX

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

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

func (*InvoiceStatusCodeGroupBy) Scan

func (iscgb *InvoiceStatusCodeGroupBy) Scan(ctx context.Context, v any) error

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

func (*InvoiceStatusCodeGroupBy) ScanX

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

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

func (*InvoiceStatusCodeGroupBy) String

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

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

func (*InvoiceStatusCodeGroupBy) StringX

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

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

func (*InvoiceStatusCodeGroupBy) Strings

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

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

func (*InvoiceStatusCodeGroupBy) StringsX

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

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

type InvoiceStatusCodeMutation

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

InvoiceStatusCodeMutation represents an operation that mutates the InvoiceStatusCode nodes in the graph.

func (*InvoiceStatusCodeMutation) AddField

func (m *InvoiceStatusCodeMutation) 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 (*InvoiceStatusCodeMutation) AddedEdges

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

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

func (*InvoiceStatusCodeMutation) AddedField

func (m *InvoiceStatusCodeMutation) 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 (*InvoiceStatusCodeMutation) AddedFields

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

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

func (*InvoiceStatusCodeMutation) AddedIDs

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

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

func (*InvoiceStatusCodeMutation) ClearEdge

func (m *InvoiceStatusCodeMutation) 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 (*InvoiceStatusCodeMutation) ClearField

func (m *InvoiceStatusCodeMutation) 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 (*InvoiceStatusCodeMutation) ClearedEdges

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

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

func (*InvoiceStatusCodeMutation) ClearedFields

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

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

func (InvoiceStatusCodeMutation) Client

func (m InvoiceStatusCodeMutation) 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 (*InvoiceStatusCodeMutation) CreatedAt

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

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

func (*InvoiceStatusCodeMutation) EdgeCleared

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

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

func (*InvoiceStatusCodeMutation) Field

func (m *InvoiceStatusCodeMutation) 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 (*InvoiceStatusCodeMutation) FieldCleared

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

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

func (*InvoiceStatusCodeMutation) Fields

func (m *InvoiceStatusCodeMutation) 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 (*InvoiceStatusCodeMutation) ID

func (m *InvoiceStatusCodeMutation) ID() (id int, 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 (*InvoiceStatusCodeMutation) 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 (*InvoiceStatusCodeMutation) InvoiceStatus

func (m *InvoiceStatusCodeMutation) InvoiceStatus() (r string, exists bool)

InvoiceStatus returns the value of the "invoice_status" field in the mutation.

func (*InvoiceStatusCodeMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the InvoiceStatusCode entity. If the InvoiceStatusCode 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 (*InvoiceStatusCodeMutation) OldField

func (m *InvoiceStatusCodeMutation) 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 (*InvoiceStatusCodeMutation) OldInvoiceStatus

func (m *InvoiceStatusCodeMutation) OldInvoiceStatus(ctx context.Context) (v string, err error)

OldInvoiceStatus returns the old "invoice_status" field's value of the InvoiceStatusCode entity. If the InvoiceStatusCode 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 (*InvoiceStatusCodeMutation) OldUpdatedAt

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

OldUpdatedAt returns the old "updated_at" field's value of the InvoiceStatusCode entity. If the InvoiceStatusCode 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 (*InvoiceStatusCodeMutation) Op

func (m *InvoiceStatusCodeMutation) Op() Op

Op returns the operation name.

func (*InvoiceStatusCodeMutation) RemovedEdges

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

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

func (*InvoiceStatusCodeMutation) RemovedIDs

func (m *InvoiceStatusCodeMutation) 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 (*InvoiceStatusCodeMutation) ResetCreatedAt

func (m *InvoiceStatusCodeMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*InvoiceStatusCodeMutation) ResetEdge

func (m *InvoiceStatusCodeMutation) 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 (*InvoiceStatusCodeMutation) ResetField

func (m *InvoiceStatusCodeMutation) 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 (*InvoiceStatusCodeMutation) ResetInvoiceStatus

func (m *InvoiceStatusCodeMutation) ResetInvoiceStatus()

ResetInvoiceStatus resets all changes to the "invoice_status" field.

func (*InvoiceStatusCodeMutation) ResetUpdatedAt

func (m *InvoiceStatusCodeMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*InvoiceStatusCodeMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*InvoiceStatusCodeMutation) SetField

func (m *InvoiceStatusCodeMutation) 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 (*InvoiceStatusCodeMutation) SetID

func (m *InvoiceStatusCodeMutation) SetID(id int)

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

func (*InvoiceStatusCodeMutation) SetInvoiceStatus

func (m *InvoiceStatusCodeMutation) SetInvoiceStatus(s string)

SetInvoiceStatus sets the "invoice_status" field.

func (*InvoiceStatusCodeMutation) SetOp

func (m *InvoiceStatusCodeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*InvoiceStatusCodeMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (InvoiceStatusCodeMutation) Tx

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

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

func (*InvoiceStatusCodeMutation) Type

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

func (*InvoiceStatusCodeMutation) UpdatedAt

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

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

func (*InvoiceStatusCodeMutation) Where

Where appends a list predicates to the InvoiceStatusCodeMutation builder.

func (*InvoiceStatusCodeMutation) WhereP

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

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

type InvoiceStatusCodeQuery

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

InvoiceStatusCodeQuery is the builder for querying InvoiceStatusCode entities.

func (*InvoiceStatusCodeQuery) Aggregate

Aggregate returns a InvoiceStatusCodeSelect configured with the given aggregations.

func (*InvoiceStatusCodeQuery) All

All executes the query and returns a list of InvoiceStatusCodes.

func (*InvoiceStatusCodeQuery) AllX

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

func (*InvoiceStatusCodeQuery) Clone

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

func (*InvoiceStatusCodeQuery) Count

func (iscq *InvoiceStatusCodeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*InvoiceStatusCodeQuery) CountX

func (iscq *InvoiceStatusCodeQuery) CountX(ctx context.Context) int

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

func (*InvoiceStatusCodeQuery) Exist

func (iscq *InvoiceStatusCodeQuery) Exist(ctx context.Context) (bool, error)

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

func (*InvoiceStatusCodeQuery) ExistX

func (iscq *InvoiceStatusCodeQuery) ExistX(ctx context.Context) bool

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

func (*InvoiceStatusCodeQuery) First

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

func (*InvoiceStatusCodeQuery) FirstID

func (iscq *InvoiceStatusCodeQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*InvoiceStatusCodeQuery) FirstIDX

func (iscq *InvoiceStatusCodeQuery) FirstIDX(ctx context.Context) int

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

func (*InvoiceStatusCodeQuery) FirstX

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

func (*InvoiceStatusCodeQuery) GroupBy

func (iscq *InvoiceStatusCodeQuery) GroupBy(field string, fields ...string) *InvoiceStatusCodeGroupBy

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.InvoiceStatusCode.Query().
	GroupBy(invoicestatuscode.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*InvoiceStatusCodeQuery) IDs

func (iscq *InvoiceStatusCodeQuery) IDs(ctx context.Context) (ids []int, err error)

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

func (*InvoiceStatusCodeQuery) IDsX

func (iscq *InvoiceStatusCodeQuery) IDsX(ctx context.Context) []int

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

func (*InvoiceStatusCodeQuery) Limit

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

func (*InvoiceStatusCodeQuery) Offset

func (iscq *InvoiceStatusCodeQuery) Offset(offset int) *InvoiceStatusCodeQuery

Offset to start from.

func (*InvoiceStatusCodeQuery) Only

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

func (*InvoiceStatusCodeQuery) OnlyID

func (iscq *InvoiceStatusCodeQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*InvoiceStatusCodeQuery) OnlyIDX

func (iscq *InvoiceStatusCodeQuery) OnlyIDX(ctx context.Context) int

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

func (*InvoiceStatusCodeQuery) OnlyX

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

func (*InvoiceStatusCodeQuery) Order

Order specifies how the records should be ordered.

func (*InvoiceStatusCodeQuery) Select

func (iscq *InvoiceStatusCodeQuery) Select(fields ...string) *InvoiceStatusCodeSelect

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.InvoiceStatusCode.Query().
	Select(invoicestatuscode.FieldCreatedAt).
	Scan(ctx, &v)

func (*InvoiceStatusCodeQuery) Unique

func (iscq *InvoiceStatusCodeQuery) Unique(unique bool) *InvoiceStatusCodeQuery

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 (*InvoiceStatusCodeQuery) Where

Where adds a new predicate for the InvoiceStatusCodeQuery builder.

type InvoiceStatusCodeSelect

type InvoiceStatusCodeSelect struct {
	*InvoiceStatusCodeQuery
	// contains filtered or unexported fields
}

InvoiceStatusCodeSelect is the builder for selecting fields of InvoiceStatusCode entities.

func (*InvoiceStatusCodeSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*InvoiceStatusCodeSelect) Bool

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

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

func (*InvoiceStatusCodeSelect) BoolX

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

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

func (*InvoiceStatusCodeSelect) Bools

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

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

func (*InvoiceStatusCodeSelect) BoolsX

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

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

func (*InvoiceStatusCodeSelect) Float64

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

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

func (*InvoiceStatusCodeSelect) Float64X

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

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

func (*InvoiceStatusCodeSelect) Float64s

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

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

func (*InvoiceStatusCodeSelect) Float64sX

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

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

func (*InvoiceStatusCodeSelect) Int

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

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

func (*InvoiceStatusCodeSelect) IntX

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

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

func (*InvoiceStatusCodeSelect) Ints

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

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

func (*InvoiceStatusCodeSelect) IntsX

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

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

func (*InvoiceStatusCodeSelect) Scan

func (iscs *InvoiceStatusCodeSelect) Scan(ctx context.Context, v any) error

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

func (*InvoiceStatusCodeSelect) ScanX

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

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

func (*InvoiceStatusCodeSelect) String

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

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

func (*InvoiceStatusCodeSelect) StringX

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

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

func (*InvoiceStatusCodeSelect) Strings

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

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

func (*InvoiceStatusCodeSelect) StringsX

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

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

type InvoiceStatusCodeUpdate

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

InvoiceStatusCodeUpdate is the builder for updating InvoiceStatusCode entities.

func (*InvoiceStatusCodeUpdate) Exec

func (iscu *InvoiceStatusCodeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*InvoiceStatusCodeUpdate) ExecX

func (iscu *InvoiceStatusCodeUpdate) ExecX(ctx context.Context)

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

func (*InvoiceStatusCodeUpdate) Mutation

Mutation returns the InvoiceStatusCodeMutation object of the builder.

func (*InvoiceStatusCodeUpdate) Save

func (iscu *InvoiceStatusCodeUpdate) Save(ctx context.Context) (int, error)

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

func (*InvoiceStatusCodeUpdate) SaveX

func (iscu *InvoiceStatusCodeUpdate) SaveX(ctx context.Context) int

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

func (*InvoiceStatusCodeUpdate) SetInvoiceStatus

func (iscu *InvoiceStatusCodeUpdate) SetInvoiceStatus(s string) *InvoiceStatusCodeUpdate

SetInvoiceStatus sets the "invoice_status" field.

func (*InvoiceStatusCodeUpdate) SetNillableInvoiceStatus

func (iscu *InvoiceStatusCodeUpdate) SetNillableInvoiceStatus(s *string) *InvoiceStatusCodeUpdate

SetNillableInvoiceStatus sets the "invoice_status" field if the given value is not nil.

func (*InvoiceStatusCodeUpdate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*InvoiceStatusCodeUpdate) Where

Where appends a list predicates to the InvoiceStatusCodeUpdate builder.

type InvoiceStatusCodeUpdateOne

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

InvoiceStatusCodeUpdateOne is the builder for updating a single InvoiceStatusCode entity.

func (*InvoiceStatusCodeUpdateOne) Exec

Exec executes the query on the entity.

func (*InvoiceStatusCodeUpdateOne) ExecX

func (iscuo *InvoiceStatusCodeUpdateOne) ExecX(ctx context.Context)

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

func (*InvoiceStatusCodeUpdateOne) Mutation

Mutation returns the InvoiceStatusCodeMutation object of the builder.

func (*InvoiceStatusCodeUpdateOne) Save

Save executes the query and returns the updated InvoiceStatusCode entity.

func (*InvoiceStatusCodeUpdateOne) SaveX

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

func (*InvoiceStatusCodeUpdateOne) Select

func (iscuo *InvoiceStatusCodeUpdateOne) Select(field string, fields ...string) *InvoiceStatusCodeUpdateOne

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

func (*InvoiceStatusCodeUpdateOne) SetInvoiceStatus

func (iscuo *InvoiceStatusCodeUpdateOne) SetInvoiceStatus(s string) *InvoiceStatusCodeUpdateOne

SetInvoiceStatus sets the "invoice_status" field.

func (*InvoiceStatusCodeUpdateOne) SetNillableInvoiceStatus

func (iscuo *InvoiceStatusCodeUpdateOne) SetNillableInvoiceStatus(s *string) *InvoiceStatusCodeUpdateOne

SetNillableInvoiceStatus sets the "invoice_status" field if the given value is not nil.

func (*InvoiceStatusCodeUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*InvoiceStatusCodeUpdateOne) Where

Where appends a list predicates to the InvoiceStatusCodeUpdate builder.

type InvoiceStatusCodes

type InvoiceStatusCodes []*InvoiceStatusCode

InvoiceStatusCodes is a parsable slice of InvoiceStatusCode.

type InvoiceUpdate

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

InvoiceUpdate is the builder for updating Invoice entities.

func (*InvoiceUpdate) ClearInvoiceStatus

func (iu *InvoiceUpdate) ClearInvoiceStatus() *InvoiceUpdate

ClearInvoiceStatus clears the "invoice_status" edge to the InvoiceStatusCode entity.

func (*InvoiceUpdate) ClearNote

func (iu *InvoiceUpdate) ClearNote() *InvoiceUpdate

ClearNote clears the value of the "note" 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) Mutation

func (iu *InvoiceUpdate) Mutation() *InvoiceMutation

Mutation returns the InvoiceMutation object of the builder.

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) SetInvoiceStatus

func (iu *InvoiceUpdate) SetInvoiceStatus(i *InvoiceStatusCode) *InvoiceUpdate

SetInvoiceStatus sets the "invoice_status" edge to the InvoiceStatusCode entity.

func (*InvoiceUpdate) SetInvoiceStatusID

func (iu *InvoiceUpdate) SetInvoiceStatusID(id int) *InvoiceUpdate

SetInvoiceStatusID sets the "invoice_status" edge to the InvoiceStatusCode entity by ID.

func (*InvoiceUpdate) SetNillableNote

func (iu *InvoiceUpdate) SetNillableNote(s *string) *InvoiceUpdate

SetNillableNote sets the "note" field if the given value is not nil.

func (*InvoiceUpdate) SetNillablePaymentMethod

func (iu *InvoiceUpdate) SetNillablePaymentMethod(im *invoice.PaymentMethod) *InvoiceUpdate

SetNillablePaymentMethod sets the "payment_method" field if the given value is not nil.

func (*InvoiceUpdate) SetNillableStatusCode

func (iu *InvoiceUpdate) SetNillableStatusCode(i *int) *InvoiceUpdate

SetNillableStatusCode sets the "status_code" field if the given value is not nil.

func (*InvoiceUpdate) SetNote

func (iu *InvoiceUpdate) SetNote(s string) *InvoiceUpdate

SetNote sets the "note" field.

func (*InvoiceUpdate) SetPaymentMethod

func (iu *InvoiceUpdate) SetPaymentMethod(im invoice.PaymentMethod) *InvoiceUpdate

SetPaymentMethod sets the "payment_method" field.

func (*InvoiceUpdate) SetStatusCode

func (iu *InvoiceUpdate) SetStatusCode(i int) *InvoiceUpdate

SetStatusCode sets the "status_code" field.

func (*InvoiceUpdate) SetUpdatedAt

func (iu *InvoiceUpdate) SetUpdatedAt(t time.Time) *InvoiceUpdate

SetUpdatedAt sets the "updated_at" 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) ClearInvoiceStatus

func (iuo *InvoiceUpdateOne) ClearInvoiceStatus() *InvoiceUpdateOne

ClearInvoiceStatus clears the "invoice_status" edge to the InvoiceStatusCode entity.

func (*InvoiceUpdateOne) ClearNote

func (iuo *InvoiceUpdateOne) ClearNote() *InvoiceUpdateOne

ClearNote clears the value of the "note" 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) Mutation

func (iuo *InvoiceUpdateOne) Mutation() *InvoiceMutation

Mutation returns the InvoiceMutation object of the builder.

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) SetInvoiceStatus

func (iuo *InvoiceUpdateOne) SetInvoiceStatus(i *InvoiceStatusCode) *InvoiceUpdateOne

SetInvoiceStatus sets the "invoice_status" edge to the InvoiceStatusCode entity.

func (*InvoiceUpdateOne) SetInvoiceStatusID

func (iuo *InvoiceUpdateOne) SetInvoiceStatusID(id int) *InvoiceUpdateOne

SetInvoiceStatusID sets the "invoice_status" edge to the InvoiceStatusCode entity by ID.

func (*InvoiceUpdateOne) SetNillableNote

func (iuo *InvoiceUpdateOne) SetNillableNote(s *string) *InvoiceUpdateOne

SetNillableNote sets the "note" field if the given value is not nil.

func (*InvoiceUpdateOne) SetNillablePaymentMethod

func (iuo *InvoiceUpdateOne) SetNillablePaymentMethod(im *invoice.PaymentMethod) *InvoiceUpdateOne

SetNillablePaymentMethod sets the "payment_method" field if the given value is not nil.

func (*InvoiceUpdateOne) SetNillableStatusCode

func (iuo *InvoiceUpdateOne) SetNillableStatusCode(i *int) *InvoiceUpdateOne

SetNillableStatusCode sets the "status_code" field if the given value is not nil.

func (*InvoiceUpdateOne) SetNote

func (iuo *InvoiceUpdateOne) SetNote(s string) *InvoiceUpdateOne

SetNote sets the "note" field.

func (*InvoiceUpdateOne) SetPaymentMethod

func (iuo *InvoiceUpdateOne) SetPaymentMethod(im invoice.PaymentMethod) *InvoiceUpdateOne

SetPaymentMethod sets the "payment_method" field.

func (*InvoiceUpdateOne) SetStatusCode

func (iuo *InvoiceUpdateOne) SetStatusCode(i int) *InvoiceUpdateOne

SetStatusCode sets the "status_code" field.

func (*InvoiceUpdateOne) SetUpdatedAt

func (iuo *InvoiceUpdateOne) SetUpdatedAt(t time.Time) *InvoiceUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*InvoiceUpdateOne) Where

Where appends a list predicates to the InvoiceUpdate builder.

type Invoices

type Invoices []*Invoice

Invoices is a parsable slice of Invoice.

type Message

type Message struct {

	// ID of the ent.
	ID uuid.UUID `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"`
	// ConversationID holds the value of the "conversation_id" field.
	ConversationID uuid.UUID `json:"conversation_id,omitempty"`
	// SenderID holds the value of the "sender_id" field.
	SenderID uuid.UUID `json:"sender_id,omitempty"`
	// Type holds the value of the "type" field.
	Type *message.Type `json:"type,omitempty"`
	// Content holds the value of the "content" field.
	Content string `json:"content,omitempty"`
	// IsRead holds the value of the "is_read" field.
	IsRead *bool `json:"is_read,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MessageQuery when eager-loading is set.
	Edges MessageEdges `json:"edges"`
	// contains filtered or unexported fields
}

Message is the model entity for the Message schema.

func (*Message) QueryConversation

func (m *Message) QueryConversation() *ConversationQuery

QueryConversation queries the "conversation" edge of the Message entity.

func (*Message) QuerySender

func (m *Message) QuerySender() *PersonQuery

QuerySender queries the "sender" edge of the Message entity.

func (*Message) String

func (m *Message) String() string

String implements the fmt.Stringer.

func (*Message) Unwrap

func (m *Message) Unwrap() *Message

Unwrap unwraps the Message 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 (*Message) Update

func (m *Message) Update() *MessageUpdateOne

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

func (*Message) Value

func (m *Message) Value(name string) (ent.Value, error)

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

type MessageClient

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

MessageClient is a client for the Message schema.

func NewMessageClient

func NewMessageClient(c config) *MessageClient

NewMessageClient returns a client for the Message from the given config.

func (*MessageClient) Create

func (c *MessageClient) Create() *MessageCreate

Create returns a builder for creating a Message entity.

func (*MessageClient) CreateBulk

func (c *MessageClient) CreateBulk(builders ...*MessageCreate) *MessageCreateBulk

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

func (*MessageClient) Delete

func (c *MessageClient) Delete() *MessageDelete

Delete returns a delete builder for Message.

func (*MessageClient) DeleteOne

func (c *MessageClient) DeleteOne(m *Message) *MessageDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MessageClient) DeleteOneID

func (c *MessageClient) DeleteOneID(id uuid.UUID) *MessageDeleteOne

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

func (*MessageClient) Get

func (c *MessageClient) Get(ctx context.Context, id uuid.UUID) (*Message, error)

Get returns a Message entity by its id.

func (*MessageClient) GetX

func (c *MessageClient) GetX(ctx context.Context, id uuid.UUID) *Message

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

func (*MessageClient) Hooks

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

Hooks returns the client hooks.

func (*MessageClient) Intercept

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

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

func (*MessageClient) Interceptors

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

Interceptors returns the client interceptors.

func (*MessageClient) MapCreateBulk

func (c *MessageClient) MapCreateBulk(slice any, setFunc func(*MessageCreate, int)) *MessageCreateBulk

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 (*MessageClient) Query

func (c *MessageClient) Query() *MessageQuery

Query returns a query builder for Message.

func (*MessageClient) QueryConversation

func (c *MessageClient) QueryConversation(m *Message) *ConversationQuery

QueryConversation queries the conversation edge of a Message.

func (*MessageClient) QuerySender

func (c *MessageClient) QuerySender(m *Message) *PersonQuery

QuerySender queries the sender edge of a Message.

func (*MessageClient) Update

func (c *MessageClient) Update() *MessageUpdate

Update returns an update builder for Message.

func (*MessageClient) UpdateOne

func (c *MessageClient) UpdateOne(m *Message) *MessageUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MessageClient) UpdateOneID

func (c *MessageClient) UpdateOneID(id uuid.UUID) *MessageUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MessageClient) Use

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

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

type MessageCreate

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

MessageCreate is the builder for creating a Message entity.

func (*MessageCreate) Exec

func (mc *MessageCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageCreate) ExecX

func (mc *MessageCreate) ExecX(ctx context.Context)

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

func (*MessageCreate) Mutation

func (mc *MessageCreate) Mutation() *MessageMutation

Mutation returns the MessageMutation object of the builder.

func (*MessageCreate) Save

func (mc *MessageCreate) Save(ctx context.Context) (*Message, error)

Save creates the Message in the database.

func (*MessageCreate) SaveX

func (mc *MessageCreate) SaveX(ctx context.Context) *Message

SaveX calls Save and panics if Save returns an error.

func (*MessageCreate) SetContent

func (mc *MessageCreate) SetContent(s string) *MessageCreate

SetContent sets the "content" field.

func (*MessageCreate) SetConversation

func (mc *MessageCreate) SetConversation(c *Conversation) *MessageCreate

SetConversation sets the "conversation" edge to the Conversation entity.

func (*MessageCreate) SetConversationID

func (mc *MessageCreate) SetConversationID(u uuid.UUID) *MessageCreate

SetConversationID sets the "conversation_id" field.

func (*MessageCreate) SetCreatedAt

func (mc *MessageCreate) SetCreatedAt(t time.Time) *MessageCreate

SetCreatedAt sets the "created_at" field.

func (*MessageCreate) SetID

func (mc *MessageCreate) SetID(u uuid.UUID) *MessageCreate

SetID sets the "id" field.

func (*MessageCreate) SetIsRead

func (mc *MessageCreate) SetIsRead(b bool) *MessageCreate

SetIsRead sets the "is_read" field.

func (*MessageCreate) SetNillableCreatedAt

func (mc *MessageCreate) SetNillableCreatedAt(t *time.Time) *MessageCreate

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

func (*MessageCreate) SetNillableID

func (mc *MessageCreate) SetNillableID(u *uuid.UUID) *MessageCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*MessageCreate) SetNillableIsRead

func (mc *MessageCreate) SetNillableIsRead(b *bool) *MessageCreate

SetNillableIsRead sets the "is_read" field if the given value is not nil.

func (*MessageCreate) SetNillableType

func (mc *MessageCreate) SetNillableType(m *message.Type) *MessageCreate

SetNillableType sets the "type" field if the given value is not nil.

func (*MessageCreate) SetNillableUpdatedAt

func (mc *MessageCreate) SetNillableUpdatedAt(t *time.Time) *MessageCreate

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

func (*MessageCreate) SetSender

func (mc *MessageCreate) SetSender(p *Person) *MessageCreate

SetSender sets the "sender" edge to the Person entity.

func (*MessageCreate) SetSenderID

func (mc *MessageCreate) SetSenderID(u uuid.UUID) *MessageCreate

SetSenderID sets the "sender_id" field.

func (*MessageCreate) SetType

func (mc *MessageCreate) SetType(m message.Type) *MessageCreate

SetType sets the "type" field.

func (*MessageCreate) SetUpdatedAt

func (mc *MessageCreate) SetUpdatedAt(t time.Time) *MessageCreate

SetUpdatedAt sets the "updated_at" field.

type MessageCreateBulk

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

MessageCreateBulk is the builder for creating many Message entities in bulk.

func (*MessageCreateBulk) Exec

func (mcb *MessageCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageCreateBulk) ExecX

func (mcb *MessageCreateBulk) ExecX(ctx context.Context)

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

func (*MessageCreateBulk) Save

func (mcb *MessageCreateBulk) Save(ctx context.Context) ([]*Message, error)

Save creates the Message entities in the database.

func (*MessageCreateBulk) SaveX

func (mcb *MessageCreateBulk) SaveX(ctx context.Context) []*Message

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

type MessageDelete

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

MessageDelete is the builder for deleting a Message entity.

func (*MessageDelete) Exec

func (md *MessageDelete) Exec(ctx context.Context) (int, error)

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

func (*MessageDelete) ExecX

func (md *MessageDelete) ExecX(ctx context.Context) int

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

func (*MessageDelete) Where

func (md *MessageDelete) Where(ps ...predicate.Message) *MessageDelete

Where appends a list predicates to the MessageDelete builder.

type MessageDeleteOne

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

MessageDeleteOne is the builder for deleting a single Message entity.

func (*MessageDeleteOne) Exec

func (mdo *MessageDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MessageDeleteOne) ExecX

func (mdo *MessageDeleteOne) ExecX(ctx context.Context)

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

func (*MessageDeleteOne) Where

Where appends a list predicates to the MessageDelete builder.

type MessageEdges

type MessageEdges struct {
	// Conversation holds the value of the conversation edge.
	Conversation *Conversation `json:"conversation,omitempty"`
	// Sender holds the value of the sender edge.
	Sender *Person `json:"sender,omitempty"`
	// contains filtered or unexported fields
}

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

func (MessageEdges) ConversationOrErr

func (e MessageEdges) ConversationOrErr() (*Conversation, error)

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

func (MessageEdges) SenderOrErr

func (e MessageEdges) SenderOrErr() (*Person, error)

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

type MessageGroupBy

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

MessageGroupBy is the group-by builder for Message entities.

func (*MessageGroupBy) Aggregate

func (mgb *MessageGroupBy) Aggregate(fns ...AggregateFunc) *MessageGroupBy

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

func (*MessageGroupBy) Bool

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

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

func (*MessageGroupBy) BoolX

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

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

func (*MessageGroupBy) Bools

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

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

func (*MessageGroupBy) BoolsX

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

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

func (*MessageGroupBy) Float64

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

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

func (*MessageGroupBy) Float64X

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

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

func (*MessageGroupBy) Float64s

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

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

func (*MessageGroupBy) Float64sX

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

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

func (*MessageGroupBy) Int

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

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

func (*MessageGroupBy) IntX

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

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

func (*MessageGroupBy) Ints

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

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

func (*MessageGroupBy) IntsX

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

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

func (*MessageGroupBy) Scan

func (mgb *MessageGroupBy) Scan(ctx context.Context, v any) error

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

func (*MessageGroupBy) ScanX

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

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

func (*MessageGroupBy) String

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

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

func (*MessageGroupBy) StringX

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

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

func (*MessageGroupBy) Strings

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

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

func (*MessageGroupBy) StringsX

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

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

type MessageMutation

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

MessageMutation represents an operation that mutates the Message nodes in the graph.

func (*MessageMutation) AddField

func (m *MessageMutation) 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 (*MessageMutation) AddedEdges

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

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

func (*MessageMutation) AddedField

func (m *MessageMutation) 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 (*MessageMutation) AddedFields

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

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

func (*MessageMutation) AddedIDs

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

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

func (*MessageMutation) ClearConversation

func (m *MessageMutation) ClearConversation()

ClearConversation clears the "conversation" edge to the Conversation entity.

func (*MessageMutation) ClearEdge

func (m *MessageMutation) 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 (*MessageMutation) ClearField

func (m *MessageMutation) 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 (*MessageMutation) ClearSender

func (m *MessageMutation) ClearSender()

ClearSender clears the "sender" edge to the Person entity.

func (*MessageMutation) ClearedEdges

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

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

func (*MessageMutation) ClearedFields

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

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

func (MessageMutation) Client

func (m MessageMutation) 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 (*MessageMutation) Content

func (m *MessageMutation) Content() (r string, exists bool)

Content returns the value of the "content" field in the mutation.

func (*MessageMutation) ConversationCleared

func (m *MessageMutation) ConversationCleared() bool

ConversationCleared reports if the "conversation" edge to the Conversation entity was cleared.

func (*MessageMutation) ConversationID

func (m *MessageMutation) ConversationID() (r uuid.UUID, exists bool)

ConversationID returns the value of the "conversation_id" field in the mutation.

func (*MessageMutation) ConversationIDs

func (m *MessageMutation) ConversationIDs() (ids []uuid.UUID)

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

func (*MessageMutation) CreatedAt

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

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

func (*MessageMutation) EdgeCleared

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

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

func (*MessageMutation) Field

func (m *MessageMutation) 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 (*MessageMutation) FieldCleared

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

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

func (*MessageMutation) Fields

func (m *MessageMutation) 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 (*MessageMutation) GetType

func (m *MessageMutation) GetType() (r message.Type, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*MessageMutation) ID

func (m *MessageMutation) ID() (id uuid.UUID, 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 (*MessageMutation) IDs

func (m *MessageMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*MessageMutation) IsRead

func (m *MessageMutation) IsRead() (r bool, exists bool)

IsRead returns the value of the "is_read" field in the mutation.

func (*MessageMutation) OldContent

func (m *MessageMutation) OldContent(ctx context.Context) (v string, err error)

OldContent returns the old "content" field's value of the Message entity. If the Message 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 (*MessageMutation) OldConversationID

func (m *MessageMutation) OldConversationID(ctx context.Context) (v uuid.UUID, err error)

OldConversationID returns the old "conversation_id" field's value of the Message entity. If the Message 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 (*MessageMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the Message entity. If the Message 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 (*MessageMutation) OldField

func (m *MessageMutation) 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 (*MessageMutation) OldIsRead

func (m *MessageMutation) OldIsRead(ctx context.Context) (v *bool, err error)

OldIsRead returns the old "is_read" field's value of the Message entity. If the Message 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 (*MessageMutation) OldSenderID

func (m *MessageMutation) OldSenderID(ctx context.Context) (v uuid.UUID, err error)

OldSenderID returns the old "sender_id" field's value of the Message entity. If the Message 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 (*MessageMutation) OldType

func (m *MessageMutation) OldType(ctx context.Context) (v *message.Type, err error)

OldType returns the old "type" field's value of the Message entity. If the Message 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 (*MessageMutation) OldUpdatedAt

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

OldUpdatedAt returns the old "updated_at" field's value of the Message entity. If the Message 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 (*MessageMutation) Op

func (m *MessageMutation) Op() Op

Op returns the operation name.

func (*MessageMutation) RemovedEdges

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

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

func (*MessageMutation) RemovedIDs

func (m *MessageMutation) 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 (*MessageMutation) ResetContent

func (m *MessageMutation) ResetContent()

ResetContent resets all changes to the "content" field.

func (*MessageMutation) ResetConversation

func (m *MessageMutation) ResetConversation()

ResetConversation resets all changes to the "conversation" edge.

func (*MessageMutation) ResetConversationID

func (m *MessageMutation) ResetConversationID()

ResetConversationID resets all changes to the "conversation_id" field.

func (*MessageMutation) ResetCreatedAt

func (m *MessageMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*MessageMutation) ResetEdge

func (m *MessageMutation) 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 (*MessageMutation) ResetField

func (m *MessageMutation) 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 (*MessageMutation) ResetIsRead

func (m *MessageMutation) ResetIsRead()

ResetIsRead resets all changes to the "is_read" field.

func (*MessageMutation) ResetSender

func (m *MessageMutation) ResetSender()

ResetSender resets all changes to the "sender" edge.

func (*MessageMutation) ResetSenderID

func (m *MessageMutation) ResetSenderID()

ResetSenderID resets all changes to the "sender_id" field.

func (*MessageMutation) ResetType

func (m *MessageMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*MessageMutation) ResetUpdatedAt

func (m *MessageMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*MessageMutation) SenderCleared

func (m *MessageMutation) SenderCleared() bool

SenderCleared reports if the "sender" edge to the Person entity was cleared.

func (*MessageMutation) SenderID

func (m *MessageMutation) SenderID() (r uuid.UUID, exists bool)

SenderID returns the value of the "sender_id" field in the mutation.

func (*MessageMutation) SenderIDs

func (m *MessageMutation) SenderIDs() (ids []uuid.UUID)

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

func (*MessageMutation) SetContent

func (m *MessageMutation) SetContent(s string)

SetContent sets the "content" field.

func (*MessageMutation) SetConversationID

func (m *MessageMutation) SetConversationID(u uuid.UUID)

SetConversationID sets the "conversation_id" field.

func (*MessageMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*MessageMutation) SetField

func (m *MessageMutation) 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 (*MessageMutation) SetID

func (m *MessageMutation) SetID(id uuid.UUID)

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

func (*MessageMutation) SetIsRead

func (m *MessageMutation) SetIsRead(b bool)

SetIsRead sets the "is_read" field.

func (*MessageMutation) SetOp

func (m *MessageMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MessageMutation) SetSenderID

func (m *MessageMutation) SetSenderID(u uuid.UUID)

SetSenderID sets the "sender_id" field.

func (*MessageMutation) SetType

func (m *MessageMutation) SetType(value message.Type)

SetType sets the "type" field.

func (*MessageMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (MessageMutation) Tx

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

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

func (*MessageMutation) Type

func (m *MessageMutation) Type() string

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

func (*MessageMutation) UpdatedAt

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

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

func (*MessageMutation) Where

func (m *MessageMutation) Where(ps ...predicate.Message)

Where appends a list predicates to the MessageMutation builder.

func (*MessageMutation) WhereP

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

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

type MessageQuery

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

MessageQuery is the builder for querying Message entities.

func (*MessageQuery) Aggregate

func (mq *MessageQuery) Aggregate(fns ...AggregateFunc) *MessageSelect

Aggregate returns a MessageSelect configured with the given aggregations.

func (*MessageQuery) All

func (mq *MessageQuery) All(ctx context.Context) ([]*Message, error)

All executes the query and returns a list of Messages.

func (*MessageQuery) AllX

func (mq *MessageQuery) AllX(ctx context.Context) []*Message

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

func (*MessageQuery) Clone

func (mq *MessageQuery) Clone() *MessageQuery

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

func (*MessageQuery) Count

func (mq *MessageQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MessageQuery) CountX

func (mq *MessageQuery) CountX(ctx context.Context) int

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

func (*MessageQuery) Exist

func (mq *MessageQuery) Exist(ctx context.Context) (bool, error)

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

func (*MessageQuery) ExistX

func (mq *MessageQuery) ExistX(ctx context.Context) bool

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

func (*MessageQuery) First

func (mq *MessageQuery) First(ctx context.Context) (*Message, error)

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

func (*MessageQuery) FirstID

func (mq *MessageQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*MessageQuery) FirstIDX

func (mq *MessageQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*MessageQuery) FirstX

func (mq *MessageQuery) FirstX(ctx context.Context) *Message

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

func (*MessageQuery) GroupBy

func (mq *MessageQuery) GroupBy(field string, fields ...string) *MessageGroupBy

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.Message.Query().
	GroupBy(message.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MessageQuery) IDs

func (mq *MessageQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

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

func (*MessageQuery) IDsX

func (mq *MessageQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*MessageQuery) Limit

func (mq *MessageQuery) Limit(limit int) *MessageQuery

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

func (*MessageQuery) Offset

func (mq *MessageQuery) Offset(offset int) *MessageQuery

Offset to start from.

func (*MessageQuery) Only

func (mq *MessageQuery) Only(ctx context.Context) (*Message, error)

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

func (*MessageQuery) OnlyID

func (mq *MessageQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*MessageQuery) OnlyIDX

func (mq *MessageQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*MessageQuery) OnlyX

func (mq *MessageQuery) OnlyX(ctx context.Context) *Message

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

func (*MessageQuery) Order

func (mq *MessageQuery) Order(o ...message.OrderOption) *MessageQuery

Order specifies how the records should be ordered.

func (*MessageQuery) QueryConversation

func (mq *MessageQuery) QueryConversation() *ConversationQuery

QueryConversation chains the current query on the "conversation" edge.

func (*MessageQuery) QuerySender

func (mq *MessageQuery) QuerySender() *PersonQuery

QuerySender chains the current query on the "sender" edge.

func (*MessageQuery) Select

func (mq *MessageQuery) Select(fields ...string) *MessageSelect

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.Message.Query().
	Select(message.FieldCreatedAt).
	Scan(ctx, &v)

func (*MessageQuery) Unique

func (mq *MessageQuery) Unique(unique bool) *MessageQuery

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 (*MessageQuery) Where

func (mq *MessageQuery) Where(ps ...predicate.Message) *MessageQuery

Where adds a new predicate for the MessageQuery builder.

func (*MessageQuery) WithConversation

func (mq *MessageQuery) WithConversation(opts ...func(*ConversationQuery)) *MessageQuery

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

func (*MessageQuery) WithSender

func (mq *MessageQuery) WithSender(opts ...func(*PersonQuery)) *MessageQuery

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

type MessageSelect

type MessageSelect struct {
	*MessageQuery
	// contains filtered or unexported fields
}

MessageSelect is the builder for selecting fields of Message entities.

func (*MessageSelect) Aggregate

func (ms *MessageSelect) Aggregate(fns ...AggregateFunc) *MessageSelect

Aggregate adds the given aggregation functions to the selector query.

func (*MessageSelect) Bool

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

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

func (*MessageSelect) BoolX

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

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

func (*MessageSelect) Bools

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

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

func (*MessageSelect) BoolsX

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

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

func (*MessageSelect) Float64

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

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

func (*MessageSelect) Float64X

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

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

func (*MessageSelect) Float64s

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

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

func (*MessageSelect) Float64sX

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

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

func (*MessageSelect) Int

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

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

func (*MessageSelect) IntX

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

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

func (*MessageSelect) Ints

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

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

func (*MessageSelect) IntsX

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

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

func (*MessageSelect) Scan

func (ms *MessageSelect) Scan(ctx context.Context, v any) error

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

func (*MessageSelect) ScanX

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

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

func (*MessageSelect) String

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

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MessageSelect) StringX

func (s *MessageSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MessageSelect) Strings

func (s *MessageSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MessageSelect) StringsX

func (s *MessageSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MessageUpdate

type MessageUpdate struct {
	// contains filtered or unexported fields
}

MessageUpdate is the builder for updating Message entities.

func (*MessageUpdate) Exec

func (mu *MessageUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageUpdate) ExecX

func (mu *MessageUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageUpdate) Mutation

func (mu *MessageUpdate) Mutation() *MessageMutation

Mutation returns the MessageMutation object of the builder.

func (*MessageUpdate) Save

func (mu *MessageUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*MessageUpdate) SaveX

func (mu *MessageUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*MessageUpdate) SetContent

func (mu *MessageUpdate) SetContent(s string) *MessageUpdate

SetContent sets the "content" field.

func (*MessageUpdate) SetIsRead

func (mu *MessageUpdate) SetIsRead(b bool) *MessageUpdate

SetIsRead sets the "is_read" field.

func (*MessageUpdate) SetNillableContent

func (mu *MessageUpdate) SetNillableContent(s *string) *MessageUpdate

SetNillableContent sets the "content" field if the given value is not nil.

func (*MessageUpdate) SetNillableIsRead

func (mu *MessageUpdate) SetNillableIsRead(b *bool) *MessageUpdate

SetNillableIsRead sets the "is_read" field if the given value is not nil.

func (*MessageUpdate) SetUpdatedAt

func (mu *MessageUpdate) SetUpdatedAt(t time.Time) *MessageUpdate

SetUpdatedAt sets the "updated_at" field.

func (*MessageUpdate) Where

func (mu *MessageUpdate) Where(ps ...predicate.Message) *MessageUpdate

Where appends a list predicates to the MessageUpdate builder.

type MessageUpdateOne

type MessageUpdateOne struct {
	// contains filtered or unexported fields
}

MessageUpdateOne is the builder for updating a single Message entity.

func (*MessageUpdateOne) Exec

func (muo *MessageUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MessageUpdateOne) ExecX

func (muo *MessageUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageUpdateOne) Mutation

func (muo *MessageUpdateOne) Mutation() *MessageMutation

Mutation returns the MessageMutation object of the builder.

func (*MessageUpdateOne) Save

func (muo *MessageUpdateOne) Save(ctx context.Context) (*Message, error)

Save executes the query and returns the updated Message entity.

func (*MessageUpdateOne) SaveX

func (muo *MessageUpdateOne) SaveX(ctx context.Context) *Message

SaveX is like Save, but panics if an error occurs.

func (*MessageUpdateOne) Select

func (muo *MessageUpdateOne) Select(field string, fields ...string) *MessageUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MessageUpdateOne) SetContent

func (muo *MessageUpdateOne) SetContent(s string) *MessageUpdateOne

SetContent sets the "content" field.

func (*MessageUpdateOne) SetIsRead

func (muo *MessageUpdateOne) SetIsRead(b bool) *MessageUpdateOne

SetIsRead sets the "is_read" field.

func (*MessageUpdateOne) SetNillableContent

func (muo *MessageUpdateOne) SetNillableContent(s *string) *MessageUpdateOne

SetNillableContent sets the "content" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableIsRead

func (muo *MessageUpdateOne) SetNillableIsRead(b *bool) *MessageUpdateOne

SetNillableIsRead sets the "is_read" field if the given value is not nil.

func (*MessageUpdateOne) SetUpdatedAt

func (muo *MessageUpdateOne) SetUpdatedAt(t time.Time) *MessageUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*MessageUpdateOne) Where

Where appends a list predicates to the MessageUpdate builder.

type Messages

type Messages []*Message

Messages is a parsable slice of Message.

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 Order

type Order struct {

	// ID of the ent.
	ID uuid.UUID `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"`
	// CustomerID holds the value of the "customer_id" field.
	CustomerID uuid.UUID `json:"customer_id,omitempty"`
	// Note holds the value of the "note" field.
	Note *string `json:"note,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy uuid.UUID `json:"created_by,omitempty"`
	// ParentOrderID holds the value of the "parent_order_id" field.
	ParentOrderID *uuid.UUID `json:"parent_order_id,omitempty"`
	// Priority holds the value of the "priority" field.
	Priority *int `json:"priority,omitempty"`
	// Type holds the value of the "type" field.
	Type *order.Type `json:"type,omitempty"`
	// StatusCode holds the value of the "status_code" field.
	StatusCode int `json:"status_code,omitempty"`
	// StaffID holds the value of the "staff_id" field.
	StaffID *uuid.UUID `json:"staff_id,omitempty"`
	// InternalNote holds the value of the "internal_note" field.
	InternalNote *string `json:"internal_note,omitempty"`
	// IsInternal holds the value of the "is_internal" field.
	IsInternal *bool `json:"is_internal,omitempty"`
	// AddressID holds the value of the "address_id" field.
	AddressID uuid.UUID `json:"address_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the OrderQuery when eager-loading is set.
	Edges OrderEdges `json:"edges"`
	// contains filtered or unexported fields
}

Order is the model entity for the Order schema.

func (*Order) QueryCreator

func (o *Order) QueryCreator() *PersonQuery

QueryCreator queries the "creator" edge of the Order entity.

func (*Order) QueryCustomer

func (o *Order) QueryCustomer() *PersonQuery

QueryCustomer queries the "customer" edge of the Order entity.

func (*Order) QueryOrderAddress

func (o *Order) QueryOrderAddress() *AddressQuery

QueryOrderAddress queries the "order_address" edge of the Order entity.

func (*Order) QueryOrderStatus

func (o *Order) QueryOrderStatus() *OrderStatusCodeQuery

QueryOrderStatus queries the "order_status" edge of the Order entity.

func (*Order) QueryParentOrder

func (o *Order) QueryParentOrder() *OrderQuery

QueryParentOrder queries the "parent_order" edge of the Order entity.

func (*Order) QueryStaff

func (o *Order) QueryStaff() *PersonQuery

QueryStaff queries the "staff" edge of the Order entity.

func (*Order) String

func (o *Order) String() string

String implements the fmt.Stringer.

func (*Order) Unwrap

func (o *Order) Unwrap() *Order

Unwrap unwraps the Order 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 (*Order) Update

func (o *Order) Update() *OrderUpdateOne

Update returns a builder for updating this Order. Note that you need to call Order.Unwrap() before calling this method if this Order was returned from a transaction, and the transaction was committed or rolled back.

func (*Order) Value

func (o *Order) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Order. This includes values selected through modifiers, order, etc.

type OrderClient

type OrderClient struct {
	// contains filtered or unexported fields
}

OrderClient is a client for the Order schema.

func NewOrderClient

func NewOrderClient(c config) *OrderClient

NewOrderClient returns a client for the Order from the given config.

func (*OrderClient) Create

func (c *OrderClient) Create() *OrderCreate

Create returns a builder for creating a Order entity.

func (*OrderClient) CreateBulk

func (c *OrderClient) CreateBulk(builders ...*OrderCreate) *OrderCreateBulk

CreateBulk returns a builder for creating a bulk of Order entities.

func (*OrderClient) Delete

func (c *OrderClient) Delete() *OrderDelete

Delete returns a delete builder for Order.

func (*OrderClient) DeleteOne

func (c *OrderClient) DeleteOne(o *Order) *OrderDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*OrderClient) DeleteOneID

func (c *OrderClient) DeleteOneID(id uuid.UUID) *OrderDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*OrderClient) Get

func (c *OrderClient) Get(ctx context.Context, id uuid.UUID) (*Order, error)

Get returns a Order entity by its id.

func (*OrderClient) GetX

func (c *OrderClient) GetX(ctx context.Context, id uuid.UUID) *Order

GetX is like Get, but panics if an error occurs.

func (*OrderClient) Hooks

func (c *OrderClient) Hooks() []Hook

Hooks returns the client hooks.

func (*OrderClient) Intercept

func (c *OrderClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `order.Intercept(f(g(h())))`.

func (*OrderClient) Interceptors

func (c *OrderClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*OrderClient) MapCreateBulk

func (c *OrderClient) MapCreateBulk(slice any, setFunc func(*OrderCreate, int)) *OrderCreateBulk

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 (*OrderClient) Query

func (c *OrderClient) Query() *OrderQuery

Query returns a query builder for Order.

func (*OrderClient) QueryCreator

func (c *OrderClient) QueryCreator(o *Order) *PersonQuery

QueryCreator queries the creator edge of a Order.

func (*OrderClient) QueryCustomer

func (c *OrderClient) QueryCustomer(o *Order) *PersonQuery

QueryCustomer queries the customer edge of a Order.

func (*OrderClient) QueryOrderAddress

func (c *OrderClient) QueryOrderAddress(o *Order) *AddressQuery

QueryOrderAddress queries the order_address edge of a Order.

func (*OrderClient) QueryOrderStatus

func (c *OrderClient) QueryOrderStatus(o *Order) *OrderStatusCodeQuery

QueryOrderStatus queries the order_status edge of a Order.

func (*OrderClient) QueryParentOrder

func (c *OrderClient) QueryParentOrder(o *Order) *OrderQuery

QueryParentOrder queries the parent_order edge of a Order.

func (*OrderClient) QueryStaff

func (c *OrderClient) QueryStaff(o *Order) *PersonQuery

QueryStaff queries the staff edge of a Order.

func (*OrderClient) Update

func (c *OrderClient) Update() *OrderUpdate

Update returns an update builder for Order.

func (*OrderClient) UpdateOne

func (c *OrderClient) UpdateOne(o *Order) *OrderUpdateOne

UpdateOne returns an update builder for the given entity.

func (*OrderClient) UpdateOneID

func (c *OrderClient) UpdateOneID(id uuid.UUID) *OrderUpdateOne

UpdateOneID returns an update builder for the given id.

func (*OrderClient) Use

func (c *OrderClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `order.Hooks(f(g(h())))`.

type OrderCreate

type OrderCreate struct {
	// contains filtered or unexported fields
}

OrderCreate is the builder for creating a Order entity.

func (*OrderCreate) Exec

func (oc *OrderCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*OrderCreate) ExecX

func (oc *OrderCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderCreate) Mutation

func (oc *OrderCreate) Mutation() *OrderMutation

Mutation returns the OrderMutation object of the builder.

func (*OrderCreate) Save

func (oc *OrderCreate) Save(ctx context.Context) (*Order, error)

Save creates the Order in the database.

func (*OrderCreate) SaveX

func (oc *OrderCreate) SaveX(ctx context.Context) *Order

SaveX calls Save and panics if Save returns an error.

func (*OrderCreate) SetAddressID

func (oc *OrderCreate) SetAddressID(u uuid.UUID) *OrderCreate

SetAddressID sets the "address_id" field.

func (*OrderCreate) SetCreatedAt

func (oc *OrderCreate) SetCreatedAt(t time.Time) *OrderCreate

SetCreatedAt sets the "created_at" field.

func (*OrderCreate) SetCreatedBy

func (oc *OrderCreate) SetCreatedBy(u uuid.UUID) *OrderCreate

SetCreatedBy sets the "created_by" field.

func (*OrderCreate) SetCreator

func (oc *OrderCreate) SetCreator(p *Person) *OrderCreate

SetCreator sets the "creator" edge to the Person entity.

func (*OrderCreate) SetCreatorID

func (oc *OrderCreate) SetCreatorID(id uuid.UUID) *OrderCreate

SetCreatorID sets the "creator" edge to the Person entity by ID.

func (*OrderCreate) SetCustomer

func (oc *OrderCreate) SetCustomer(p *Person) *OrderCreate

SetCustomer sets the "customer" edge to the Person entity.

func (*OrderCreate) SetCustomerID

func (oc *OrderCreate) SetCustomerID(u uuid.UUID) *OrderCreate

SetCustomerID sets the "customer_id" field.

func (*OrderCreate) SetID

func (oc *OrderCreate) SetID(u uuid.UUID) *OrderCreate

SetID sets the "id" field.

func (*OrderCreate) SetInternalNote

func (oc *OrderCreate) SetInternalNote(s string) *OrderCreate

SetInternalNote sets the "internal_note" field.

func (*OrderCreate) SetIsInternal

func (oc *OrderCreate) SetIsInternal(b bool) *OrderCreate

SetIsInternal sets the "is_internal" field.

func (*OrderCreate) SetNillableCreatedAt

func (oc *OrderCreate) SetNillableCreatedAt(t *time.Time) *OrderCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*OrderCreate) SetNillableID

func (oc *OrderCreate) SetNillableID(u *uuid.UUID) *OrderCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*OrderCreate) SetNillableInternalNote

func (oc *OrderCreate) SetNillableInternalNote(s *string) *OrderCreate

SetNillableInternalNote sets the "internal_note" field if the given value is not nil.

func (*OrderCreate) SetNillableIsInternal

func (oc *OrderCreate) SetNillableIsInternal(b *bool) *OrderCreate

SetNillableIsInternal sets the "is_internal" field if the given value is not nil.

func (*OrderCreate) SetNillableNote

func (oc *OrderCreate) SetNillableNote(s *string) *OrderCreate

SetNillableNote sets the "note" field if the given value is not nil.

func (*OrderCreate) SetNillableParentOrderID

func (oc *OrderCreate) SetNillableParentOrderID(u *uuid.UUID) *OrderCreate

SetNillableParentOrderID sets the "parent_order_id" field if the given value is not nil.

func (*OrderCreate) SetNillablePriority

func (oc *OrderCreate) SetNillablePriority(i *int) *OrderCreate

SetNillablePriority sets the "priority" field if the given value is not nil.

func (*OrderCreate) SetNillableStaffID

func (oc *OrderCreate) SetNillableStaffID(u *uuid.UUID) *OrderCreate

SetNillableStaffID sets the "staff_id" field if the given value is not nil.

func (*OrderCreate) SetNillableStatusCode

func (oc *OrderCreate) SetNillableStatusCode(i *int) *OrderCreate

SetNillableStatusCode sets the "status_code" field if the given value is not nil.

func (*OrderCreate) SetNillableType

func (oc *OrderCreate) SetNillableType(o *order.Type) *OrderCreate

SetNillableType sets the "type" field if the given value is not nil.

func (*OrderCreate) SetNillableUpdatedAt

func (oc *OrderCreate) SetNillableUpdatedAt(t *time.Time) *OrderCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*OrderCreate) SetNote

func (oc *OrderCreate) SetNote(s string) *OrderCreate

SetNote sets the "note" field.

func (*OrderCreate) SetOrderAddress

func (oc *OrderCreate) SetOrderAddress(a *Address) *OrderCreate

SetOrderAddress sets the "order_address" edge to the Address entity.

func (*OrderCreate) SetOrderAddressID

func (oc *OrderCreate) SetOrderAddressID(id uuid.UUID) *OrderCreate

SetOrderAddressID sets the "order_address" edge to the Address entity by ID.

func (*OrderCreate) SetOrderStatus

func (oc *OrderCreate) SetOrderStatus(o *OrderStatusCode) *OrderCreate

SetOrderStatus sets the "order_status" edge to the OrderStatusCode entity.

func (*OrderCreate) SetOrderStatusID

func (oc *OrderCreate) SetOrderStatusID(id int) *OrderCreate

SetOrderStatusID sets the "order_status" edge to the OrderStatusCode entity by ID.

func (*OrderCreate) SetParentOrder

func (oc *OrderCreate) SetParentOrder(o *Order) *OrderCreate

SetParentOrder sets the "parent_order" edge to the Order entity.

func (*OrderCreate) SetParentOrderID

func (oc *OrderCreate) SetParentOrderID(u uuid.UUID) *OrderCreate

SetParentOrderID sets the "parent_order_id" field.

func (*OrderCreate) SetPriority

func (oc *OrderCreate) SetPriority(i int) *OrderCreate

SetPriority sets the "priority" field.

func (*OrderCreate) SetStaff

func (oc *OrderCreate) SetStaff(p *Person) *OrderCreate

SetStaff sets the "staff" edge to the Person entity.

func (*OrderCreate) SetStaffID

func (oc *OrderCreate) SetStaffID(u uuid.UUID) *OrderCreate

SetStaffID sets the "staff_id" field.

func (*OrderCreate) SetStatusCode

func (oc *OrderCreate) SetStatusCode(i int) *OrderCreate

SetStatusCode sets the "status_code" field.

func (*OrderCreate) SetType

func (oc *OrderCreate) SetType(o order.Type) *OrderCreate

SetType sets the "type" field.

func (*OrderCreate) SetUpdatedAt

func (oc *OrderCreate) SetUpdatedAt(t time.Time) *OrderCreate

SetUpdatedAt sets the "updated_at" field.

type OrderCreateBulk

type OrderCreateBulk struct {
	// contains filtered or unexported fields
}

OrderCreateBulk is the builder for creating many Order entities in bulk.

func (*OrderCreateBulk) Exec

func (ocb *OrderCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*OrderCreateBulk) ExecX

func (ocb *OrderCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderCreateBulk) Save

func (ocb *OrderCreateBulk) Save(ctx context.Context) ([]*Order, error)

Save creates the Order entities in the database.

func (*OrderCreateBulk) SaveX

func (ocb *OrderCreateBulk) SaveX(ctx context.Context) []*Order

SaveX is like Save, but panics if an error occurs.

type OrderDelete

type OrderDelete struct {
	// contains filtered or unexported fields
}

OrderDelete is the builder for deleting a Order entity.

func (*OrderDelete) Exec

func (od *OrderDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*OrderDelete) ExecX

func (od *OrderDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*OrderDelete) Where

func (od *OrderDelete) Where(ps ...predicate.Order) *OrderDelete

Where appends a list predicates to the OrderDelete builder.

type OrderDeleteOne

type OrderDeleteOne struct {
	// contains filtered or unexported fields
}

OrderDeleteOne is the builder for deleting a single Order entity.

func (*OrderDeleteOne) Exec

func (odo *OrderDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*OrderDeleteOne) ExecX

func (odo *OrderDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderDeleteOne) Where

func (odo *OrderDeleteOne) Where(ps ...predicate.Order) *OrderDeleteOne

Where appends a list predicates to the OrderDelete builder.

type OrderEdges

type OrderEdges struct {
	// Customer holds the value of the customer edge.
	Customer *Person `json:"customer,omitempty"`
	// Creator holds the value of the creator edge.
	Creator *Person `json:"creator,omitempty"`
	// ParentOrder holds the value of the parent_order edge.
	ParentOrder *Order `json:"parent_order,omitempty"`
	// OrderStatus holds the value of the order_status edge.
	OrderStatus *OrderStatusCode `json:"order_status,omitempty"`
	// Staff holds the value of the staff edge.
	Staff *Person `json:"staff,omitempty"`
	// OrderAddress holds the value of the order_address edge.
	OrderAddress *Address `json:"order_address,omitempty"`
	// contains filtered or unexported fields
}

OrderEdges holds the relations/edges for other nodes in the graph.

func (OrderEdges) CreatorOrErr

func (e OrderEdges) CreatorOrErr() (*Person, error)

CreatorOrErr returns the Creator value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (OrderEdges) CustomerOrErr

func (e OrderEdges) CustomerOrErr() (*Person, error)

CustomerOrErr returns the Customer value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (OrderEdges) OrderAddressOrErr

func (e OrderEdges) OrderAddressOrErr() (*Address, error)

OrderAddressOrErr returns the OrderAddress value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (OrderEdges) OrderStatusOrErr

func (e OrderEdges) OrderStatusOrErr() (*OrderStatusCode, error)

OrderStatusOrErr returns the OrderStatus value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (OrderEdges) ParentOrderOrErr

func (e OrderEdges) ParentOrderOrErr() (*Order, error)

ParentOrderOrErr returns the ParentOrder value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (OrderEdges) StaffOrErr

func (e OrderEdges) StaffOrErr() (*Person, error)

StaffOrErr returns the Staff value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

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 OrderGroupBy

type OrderGroupBy struct {
	// contains filtered or unexported fields
}

OrderGroupBy is the group-by builder for Order entities.

func (*OrderGroupBy) Aggregate

func (ogb *OrderGroupBy) Aggregate(fns ...AggregateFunc) *OrderGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*OrderGroupBy) Bool

func (s *OrderGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OrderGroupBy) BoolX

func (s *OrderGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OrderGroupBy) Bools

func (s *OrderGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OrderGroupBy) BoolsX

func (s *OrderGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OrderGroupBy) Float64

func (s *OrderGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OrderGroupBy) Float64X

func (s *OrderGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OrderGroupBy) Float64s

func (s *OrderGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OrderGroupBy) Float64sX

func (s *OrderGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OrderGroupBy) Int

func (s *OrderGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OrderGroupBy) IntX

func (s *OrderGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OrderGroupBy) Ints

func (s *OrderGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OrderGroupBy) IntsX

func (s *OrderGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*OrderGroupBy) Scan

func (ogb *OrderGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*OrderGroupBy) ScanX

func (s *OrderGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OrderGroupBy) String

func (s *OrderGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OrderGroupBy) StringX

func (s *OrderGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OrderGroupBy) Strings

func (s *OrderGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OrderGroupBy) StringsX

func (s *OrderGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type OrderHistories

type OrderHistories []*OrderHistory

OrderHistories is a parsable slice of OrderHistory.

type OrderHistory

type OrderHistory struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// OrderID holds the value of the "order_id" field.
	OrderID uuid.UUID `json:"order_id,omitempty"`
	// PersonID holds the value of the "person_id" field.
	PersonID uuid.UUID `json:"person_id,omitempty"`
	// OldStatusCode holds the value of the "old_status_code" field.
	OldStatusCode *int `json:"old_status_code,omitempty"`
	// NewStatusCode holds the value of the "new_status_code" field.
	NewStatusCode *int `json:"new_status_code,omitempty"`
	// Description holds the value of the "description" field.
	Description *string `json:"description,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the OrderHistoryQuery when eager-loading is set.
	Edges OrderHistoryEdges `json:"edges"`
	// contains filtered or unexported fields
}

OrderHistory is the model entity for the OrderHistory schema.

func (*OrderHistory) QueryNewStatus

func (oh *OrderHistory) QueryNewStatus() *OrderStatusCodeQuery

QueryNewStatus queries the "new_status" edge of the OrderHistory entity.

func (*OrderHistory) QueryOldStatus

func (oh *OrderHistory) QueryOldStatus() *OrderStatusCodeQuery

QueryOldStatus queries the "old_status" edge of the OrderHistory entity.

func (*OrderHistory) QueryOrder

func (oh *OrderHistory) QueryOrder() *OrderQuery

QueryOrder queries the "order" edge of the OrderHistory entity.

func (*OrderHistory) QueryPerson

func (oh *OrderHistory) QueryPerson() *PersonQuery

QueryPerson queries the "person" edge of the OrderHistory entity.

func (*OrderHistory) String

func (oh *OrderHistory) String() string

String implements the fmt.Stringer.

func (*OrderHistory) Unwrap

func (oh *OrderHistory) Unwrap() *OrderHistory

Unwrap unwraps the OrderHistory 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 (*OrderHistory) Update

func (oh *OrderHistory) Update() *OrderHistoryUpdateOne

Update returns a builder for updating this OrderHistory. Note that you need to call OrderHistory.Unwrap() before calling this method if this OrderHistory was returned from a transaction, and the transaction was committed or rolled back.

func (*OrderHistory) Value

func (oh *OrderHistory) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the OrderHistory. This includes values selected through modifiers, order, etc.

type OrderHistoryClient

type OrderHistoryClient struct {
	// contains filtered or unexported fields
}

OrderHistoryClient is a client for the OrderHistory schema.

func NewOrderHistoryClient

func NewOrderHistoryClient(c config) *OrderHistoryClient

NewOrderHistoryClient returns a client for the OrderHistory from the given config.

func (*OrderHistoryClient) Create

Create returns a builder for creating a OrderHistory entity.

func (*OrderHistoryClient) CreateBulk

func (c *OrderHistoryClient) CreateBulk(builders ...*OrderHistoryCreate) *OrderHistoryCreateBulk

CreateBulk returns a builder for creating a bulk of OrderHistory entities.

func (*OrderHistoryClient) Delete

Delete returns a delete builder for OrderHistory.

func (*OrderHistoryClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*OrderHistoryClient) DeleteOneID

func (c *OrderHistoryClient) DeleteOneID(id uuid.UUID) *OrderHistoryDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*OrderHistoryClient) Get

Get returns a OrderHistory entity by its id.

func (*OrderHistoryClient) GetX

GetX is like Get, but panics if an error occurs.

func (*OrderHistoryClient) Hooks

func (c *OrderHistoryClient) Hooks() []Hook

Hooks returns the client hooks.

func (*OrderHistoryClient) Intercept

func (c *OrderHistoryClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `orderhistory.Intercept(f(g(h())))`.

func (*OrderHistoryClient) Interceptors

func (c *OrderHistoryClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*OrderHistoryClient) MapCreateBulk

func (c *OrderHistoryClient) MapCreateBulk(slice any, setFunc func(*OrderHistoryCreate, int)) *OrderHistoryCreateBulk

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 (*OrderHistoryClient) Query

Query returns a query builder for OrderHistory.

func (*OrderHistoryClient) QueryNewStatus

func (c *OrderHistoryClient) QueryNewStatus(oh *OrderHistory) *OrderStatusCodeQuery

QueryNewStatus queries the new_status edge of a OrderHistory.

func (*OrderHistoryClient) QueryOldStatus

func (c *OrderHistoryClient) QueryOldStatus(oh *OrderHistory) *OrderStatusCodeQuery

QueryOldStatus queries the old_status edge of a OrderHistory.

func (*OrderHistoryClient) QueryOrder

func (c *OrderHistoryClient) QueryOrder(oh *OrderHistory) *OrderQuery

QueryOrder queries the order edge of a OrderHistory.

func (*OrderHistoryClient) QueryPerson

func (c *OrderHistoryClient) QueryPerson(oh *OrderHistory) *PersonQuery

QueryPerson queries the person edge of a OrderHistory.

func (*OrderHistoryClient) Update

Update returns an update builder for OrderHistory.

func (*OrderHistoryClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*OrderHistoryClient) UpdateOneID

func (c *OrderHistoryClient) UpdateOneID(id uuid.UUID) *OrderHistoryUpdateOne

UpdateOneID returns an update builder for the given id.

func (*OrderHistoryClient) Use

func (c *OrderHistoryClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `orderhistory.Hooks(f(g(h())))`.

type OrderHistoryCreate

type OrderHistoryCreate struct {
	// contains filtered or unexported fields
}

OrderHistoryCreate is the builder for creating a OrderHistory entity.

func (*OrderHistoryCreate) Exec

func (ohc *OrderHistoryCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*OrderHistoryCreate) ExecX

func (ohc *OrderHistoryCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderHistoryCreate) Mutation

func (ohc *OrderHistoryCreate) Mutation() *OrderHistoryMutation

Mutation returns the OrderHistoryMutation object of the builder.

func (*OrderHistoryCreate) Save

Save creates the OrderHistory in the database.

func (*OrderHistoryCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*OrderHistoryCreate) SetCreatedAt

func (ohc *OrderHistoryCreate) SetCreatedAt(t time.Time) *OrderHistoryCreate

SetCreatedAt sets the "created_at" field.

func (*OrderHistoryCreate) SetDescription

func (ohc *OrderHistoryCreate) SetDescription(s string) *OrderHistoryCreate

SetDescription sets the "description" field.

func (*OrderHistoryCreate) SetID

SetID sets the "id" field.

func (*OrderHistoryCreate) SetNewStatus

func (ohc *OrderHistoryCreate) SetNewStatus(o *OrderStatusCode) *OrderHistoryCreate

SetNewStatus sets the "new_status" edge to the OrderStatusCode entity.

func (*OrderHistoryCreate) SetNewStatusCode

func (ohc *OrderHistoryCreate) SetNewStatusCode(i int) *OrderHistoryCreate

SetNewStatusCode sets the "new_status_code" field.

func (*OrderHistoryCreate) SetNewStatusID

func (ohc *OrderHistoryCreate) SetNewStatusID(id int) *OrderHistoryCreate

SetNewStatusID sets the "new_status" edge to the OrderStatusCode entity by ID.

func (*OrderHistoryCreate) SetNillableCreatedAt

func (ohc *OrderHistoryCreate) SetNillableCreatedAt(t *time.Time) *OrderHistoryCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*OrderHistoryCreate) SetNillableDescription

func (ohc *OrderHistoryCreate) SetNillableDescription(s *string) *OrderHistoryCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*OrderHistoryCreate) SetNillableID

func (ohc *OrderHistoryCreate) SetNillableID(u *uuid.UUID) *OrderHistoryCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*OrderHistoryCreate) SetNillableNewStatusCode

func (ohc *OrderHistoryCreate) SetNillableNewStatusCode(i *int) *OrderHistoryCreate

SetNillableNewStatusCode sets the "new_status_code" field if the given value is not nil.

func (*OrderHistoryCreate) SetNillableNewStatusID

func (ohc *OrderHistoryCreate) SetNillableNewStatusID(id *int) *OrderHistoryCreate

SetNillableNewStatusID sets the "new_status" edge to the OrderStatusCode entity by ID if the given value is not nil.

func (*OrderHistoryCreate) SetNillableOldStatusCode

func (ohc *OrderHistoryCreate) SetNillableOldStatusCode(i *int) *OrderHistoryCreate

SetNillableOldStatusCode sets the "old_status_code" field if the given value is not nil.

func (*OrderHistoryCreate) SetNillableOldStatusID

func (ohc *OrderHistoryCreate) SetNillableOldStatusID(id *int) *OrderHistoryCreate

SetNillableOldStatusID sets the "old_status" edge to the OrderStatusCode entity by ID if the given value is not nil.

func (*OrderHistoryCreate) SetOldStatus

func (ohc *OrderHistoryCreate) SetOldStatus(o *OrderStatusCode) *OrderHistoryCreate

SetOldStatus sets the "old_status" edge to the OrderStatusCode entity.

func (*OrderHistoryCreate) SetOldStatusCode

func (ohc *OrderHistoryCreate) SetOldStatusCode(i int) *OrderHistoryCreate

SetOldStatusCode sets the "old_status_code" field.

func (*OrderHistoryCreate) SetOldStatusID

func (ohc *OrderHistoryCreate) SetOldStatusID(id int) *OrderHistoryCreate

SetOldStatusID sets the "old_status" edge to the OrderStatusCode entity by ID.

func (*OrderHistoryCreate) SetOrder

func (ohc *OrderHistoryCreate) SetOrder(o *Order) *OrderHistoryCreate

SetOrder sets the "order" edge to the Order entity.

func (*OrderHistoryCreate) SetOrderID

func (ohc *OrderHistoryCreate) SetOrderID(u uuid.UUID) *OrderHistoryCreate

SetOrderID sets the "order_id" field.

func (*OrderHistoryCreate) SetPerson

func (ohc *OrderHistoryCreate) SetPerson(p *Person) *OrderHistoryCreate

SetPerson sets the "person" edge to the Person entity.

func (*OrderHistoryCreate) SetPersonID

func (ohc *OrderHistoryCreate) SetPersonID(u uuid.UUID) *OrderHistoryCreate

SetPersonID sets the "person_id" field.

type OrderHistoryCreateBulk

type OrderHistoryCreateBulk struct {
	// contains filtered or unexported fields
}

OrderHistoryCreateBulk is the builder for creating many OrderHistory entities in bulk.

func (*OrderHistoryCreateBulk) Exec

func (ohcb *OrderHistoryCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*OrderHistoryCreateBulk) ExecX

func (ohcb *OrderHistoryCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderHistoryCreateBulk) Save

Save creates the OrderHistory entities in the database.

func (*OrderHistoryCreateBulk) SaveX

func (ohcb *OrderHistoryCreateBulk) SaveX(ctx context.Context) []*OrderHistory

SaveX is like Save, but panics if an error occurs.

type OrderHistoryDelete

type OrderHistoryDelete struct {
	// contains filtered or unexported fields
}

OrderHistoryDelete is the builder for deleting a OrderHistory entity.

func (*OrderHistoryDelete) Exec

func (ohd *OrderHistoryDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*OrderHistoryDelete) ExecX

func (ohd *OrderHistoryDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*OrderHistoryDelete) Where

Where appends a list predicates to the OrderHistoryDelete builder.

type OrderHistoryDeleteOne

type OrderHistoryDeleteOne struct {
	// contains filtered or unexported fields
}

OrderHistoryDeleteOne is the builder for deleting a single OrderHistory entity.

func (*OrderHistoryDeleteOne) Exec

func (ohdo *OrderHistoryDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*OrderHistoryDeleteOne) ExecX

func (ohdo *OrderHistoryDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderHistoryDeleteOne) Where

Where appends a list predicates to the OrderHistoryDelete builder.

type OrderHistoryEdges

type OrderHistoryEdges struct {
	// Order holds the value of the order edge.
	Order *Order `json:"order,omitempty"`
	// Person holds the value of the person edge.
	Person *Person `json:"person,omitempty"`
	// OldStatus holds the value of the old_status edge.
	OldStatus *OrderStatusCode `json:"old_status,omitempty"`
	// NewStatus holds the value of the new_status edge.
	NewStatus *OrderStatusCode `json:"new_status,omitempty"`
	// contains filtered or unexported fields
}

OrderHistoryEdges holds the relations/edges for other nodes in the graph.

func (OrderHistoryEdges) NewStatusOrErr

func (e OrderHistoryEdges) NewStatusOrErr() (*OrderStatusCode, error)

NewStatusOrErr returns the NewStatus value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (OrderHistoryEdges) OldStatusOrErr

func (e OrderHistoryEdges) OldStatusOrErr() (*OrderStatusCode, error)

OldStatusOrErr returns the OldStatus value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (OrderHistoryEdges) OrderOrErr

func (e OrderHistoryEdges) OrderOrErr() (*Order, error)

OrderOrErr returns the Order value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (OrderHistoryEdges) PersonOrErr

func (e OrderHistoryEdges) PersonOrErr() (*Person, error)

PersonOrErr returns the Person value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type OrderHistoryGroupBy

type OrderHistoryGroupBy struct {
	// contains filtered or unexported fields
}

OrderHistoryGroupBy is the group-by builder for OrderHistory entities.

func (*OrderHistoryGroupBy) Aggregate

func (ohgb *OrderHistoryGroupBy) Aggregate(fns ...AggregateFunc) *OrderHistoryGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*OrderHistoryGroupBy) Bool

func (s *OrderHistoryGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OrderHistoryGroupBy) BoolX

func (s *OrderHistoryGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OrderHistoryGroupBy) Bools

func (s *OrderHistoryGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OrderHistoryGroupBy) BoolsX

func (s *OrderHistoryGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OrderHistoryGroupBy) Float64

func (s *OrderHistoryGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OrderHistoryGroupBy) Float64X

func (s *OrderHistoryGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OrderHistoryGroupBy) Float64s

func (s *OrderHistoryGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OrderHistoryGroupBy) Float64sX

func (s *OrderHistoryGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OrderHistoryGroupBy) Int

func (s *OrderHistoryGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OrderHistoryGroupBy) IntX

func (s *OrderHistoryGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OrderHistoryGroupBy) Ints

func (s *OrderHistoryGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OrderHistoryGroupBy) IntsX

func (s *OrderHistoryGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*OrderHistoryGroupBy) Scan

func (ohgb *OrderHistoryGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*OrderHistoryGroupBy) ScanX

func (s *OrderHistoryGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OrderHistoryGroupBy) String

func (s *OrderHistoryGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OrderHistoryGroupBy) StringX

func (s *OrderHistoryGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OrderHistoryGroupBy) Strings

func (s *OrderHistoryGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OrderHistoryGroupBy) StringsX

func (s *OrderHistoryGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type OrderHistoryMutation

type OrderHistoryMutation struct {
	// contains filtered or unexported fields
}

OrderHistoryMutation represents an operation that mutates the OrderHistory nodes in the graph.

func (*OrderHistoryMutation) AddField

func (m *OrderHistoryMutation) 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 (*OrderHistoryMutation) AddedEdges

func (m *OrderHistoryMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*OrderHistoryMutation) AddedField

func (m *OrderHistoryMutation) 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 (*OrderHistoryMutation) AddedFields

func (m *OrderHistoryMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*OrderHistoryMutation) AddedIDs

func (m *OrderHistoryMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*OrderHistoryMutation) ClearDescription

func (m *OrderHistoryMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*OrderHistoryMutation) ClearEdge

func (m *OrderHistoryMutation) 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 (*OrderHistoryMutation) ClearField

func (m *OrderHistoryMutation) 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 (*OrderHistoryMutation) ClearNewStatus

func (m *OrderHistoryMutation) ClearNewStatus()

ClearNewStatus clears the "new_status" edge to the OrderStatusCode entity.

func (*OrderHistoryMutation) ClearNewStatusCode

func (m *OrderHistoryMutation) ClearNewStatusCode()

ClearNewStatusCode clears the value of the "new_status_code" field.

func (*OrderHistoryMutation) ClearOldStatus

func (m *OrderHistoryMutation) ClearOldStatus()

ClearOldStatus clears the "old_status" edge to the OrderStatusCode entity.

func (*OrderHistoryMutation) ClearOldStatusCode

func (m *OrderHistoryMutation) ClearOldStatusCode()

ClearOldStatusCode clears the value of the "old_status_code" field.

func (*OrderHistoryMutation) ClearOrder

func (m *OrderHistoryMutation) ClearOrder()

ClearOrder clears the "order" edge to the Order entity.

func (*OrderHistoryMutation) ClearPerson

func (m *OrderHistoryMutation) ClearPerson()

ClearPerson clears the "person" edge to the Person entity.

func (*OrderHistoryMutation) ClearedEdges

func (m *OrderHistoryMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*OrderHistoryMutation) ClearedFields

func (m *OrderHistoryMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (OrderHistoryMutation) Client

func (m OrderHistoryMutation) 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 (*OrderHistoryMutation) CreatedAt

func (m *OrderHistoryMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*OrderHistoryMutation) Description

func (m *OrderHistoryMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*OrderHistoryMutation) DescriptionCleared

func (m *OrderHistoryMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*OrderHistoryMutation) EdgeCleared

func (m *OrderHistoryMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*OrderHistoryMutation) Field

func (m *OrderHistoryMutation) 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 (*OrderHistoryMutation) FieldCleared

func (m *OrderHistoryMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*OrderHistoryMutation) Fields

func (m *OrderHistoryMutation) 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 (*OrderHistoryMutation) ID

func (m *OrderHistoryMutation) ID() (id uuid.UUID, 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 (*OrderHistoryMutation) 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 (*OrderHistoryMutation) NewStatusCleared

func (m *OrderHistoryMutation) NewStatusCleared() bool

NewStatusCleared reports if the "new_status" edge to the OrderStatusCode entity was cleared.

func (*OrderHistoryMutation) NewStatusCode

func (m *OrderHistoryMutation) NewStatusCode() (r int, exists bool)

NewStatusCode returns the value of the "new_status_code" field in the mutation.

func (*OrderHistoryMutation) NewStatusCodeCleared

func (m *OrderHistoryMutation) NewStatusCodeCleared() bool

NewStatusCodeCleared returns if the "new_status_code" field was cleared in this mutation.

func (*OrderHistoryMutation) NewStatusID

func (m *OrderHistoryMutation) NewStatusID() (id int, exists bool)

NewStatusID returns the "new_status" edge ID in the mutation.

func (*OrderHistoryMutation) NewStatusIDs

func (m *OrderHistoryMutation) NewStatusIDs() (ids []int)

NewStatusIDs returns the "new_status" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use NewStatusID instead. It exists only for internal usage by the builders.

func (*OrderHistoryMutation) OldCreatedAt

func (m *OrderHistoryMutation) OldCreatedAt(ctx context.Context) (v *time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the OrderHistory entity. If the OrderHistory 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 (*OrderHistoryMutation) OldDescription

func (m *OrderHistoryMutation) OldDescription(ctx context.Context) (v *string, err error)

OldDescription returns the old "description" field's value of the OrderHistory entity. If the OrderHistory 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 (*OrderHistoryMutation) OldField

func (m *OrderHistoryMutation) 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 (*OrderHistoryMutation) OldNewStatusCode

func (m *OrderHistoryMutation) OldNewStatusCode(ctx context.Context) (v *int, err error)

OldNewStatusCode returns the old "new_status_code" field's value of the OrderHistory entity. If the OrderHistory 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 (*OrderHistoryMutation) OldOldStatusCode

func (m *OrderHistoryMutation) OldOldStatusCode(ctx context.Context) (v *int, err error)

OldOldStatusCode returns the old "old_status_code" field's value of the OrderHistory entity. If the OrderHistory 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 (*OrderHistoryMutation) OldOrderID

func (m *OrderHistoryMutation) OldOrderID(ctx context.Context) (v uuid.UUID, err error)

OldOrderID returns the old "order_id" field's value of the OrderHistory entity. If the OrderHistory 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 (*OrderHistoryMutation) OldPersonID

func (m *OrderHistoryMutation) OldPersonID(ctx context.Context) (v uuid.UUID, err error)

OldPersonID returns the old "person_id" field's value of the OrderHistory entity. If the OrderHistory 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 (*OrderHistoryMutation) OldStatusCleared

func (m *OrderHistoryMutation) OldStatusCleared() bool

OldStatusCleared reports if the "old_status" edge to the OrderStatusCode entity was cleared.

func (*OrderHistoryMutation) OldStatusCode

func (m *OrderHistoryMutation) OldStatusCode() (r int, exists bool)

OldStatusCode returns the value of the "old_status_code" field in the mutation.

func (*OrderHistoryMutation) OldStatusCodeCleared

func (m *OrderHistoryMutation) OldStatusCodeCleared() bool

OldStatusCodeCleared returns if the "old_status_code" field was cleared in this mutation.

func (*OrderHistoryMutation) OldStatusID

func (m *OrderHistoryMutation) OldStatusID() (id int, exists bool)

OldStatusID returns the "old_status" edge ID in the mutation.

func (*OrderHistoryMutation) OldStatusIDs

func (m *OrderHistoryMutation) OldStatusIDs() (ids []int)

OldStatusIDs returns the "old_status" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OldStatusID instead. It exists only for internal usage by the builders.

func (*OrderHistoryMutation) Op

func (m *OrderHistoryMutation) Op() Op

Op returns the operation name.

func (*OrderHistoryMutation) OrderCleared

func (m *OrderHistoryMutation) OrderCleared() bool

OrderCleared reports if the "order" edge to the Order entity was cleared.

func (*OrderHistoryMutation) OrderID

func (m *OrderHistoryMutation) OrderID() (r uuid.UUID, exists bool)

OrderID returns the value of the "order_id" field in the mutation.

func (*OrderHistoryMutation) OrderIDs

func (m *OrderHistoryMutation) OrderIDs() (ids []uuid.UUID)

OrderIDs returns the "order" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OrderID instead. It exists only for internal usage by the builders.

func (*OrderHistoryMutation) PersonCleared

func (m *OrderHistoryMutation) PersonCleared() bool

PersonCleared reports if the "person" edge to the Person entity was cleared.

func (*OrderHistoryMutation) PersonID

func (m *OrderHistoryMutation) PersonID() (r uuid.UUID, exists bool)

PersonID returns the value of the "person_id" field in the mutation.

func (*OrderHistoryMutation) PersonIDs

func (m *OrderHistoryMutation) PersonIDs() (ids []uuid.UUID)

PersonIDs returns the "person" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use PersonID instead. It exists only for internal usage by the builders.

func (*OrderHistoryMutation) RemovedEdges

func (m *OrderHistoryMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*OrderHistoryMutation) RemovedIDs

func (m *OrderHistoryMutation) 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 (*OrderHistoryMutation) ResetCreatedAt

func (m *OrderHistoryMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*OrderHistoryMutation) ResetDescription

func (m *OrderHistoryMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*OrderHistoryMutation) ResetEdge

func (m *OrderHistoryMutation) 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 (*OrderHistoryMutation) ResetField

func (m *OrderHistoryMutation) 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 (*OrderHistoryMutation) ResetNewStatus

func (m *OrderHistoryMutation) ResetNewStatus()

ResetNewStatus resets all changes to the "new_status" edge.

func (*OrderHistoryMutation) ResetNewStatusCode

func (m *OrderHistoryMutation) ResetNewStatusCode()

ResetNewStatusCode resets all changes to the "new_status_code" field.

func (*OrderHistoryMutation) ResetOldStatus

func (m *OrderHistoryMutation) ResetOldStatus()

ResetOldStatus resets all changes to the "old_status" edge.

func (*OrderHistoryMutation) ResetOldStatusCode

func (m *OrderHistoryMutation) ResetOldStatusCode()

ResetOldStatusCode resets all changes to the "old_status_code" field.

func (*OrderHistoryMutation) ResetOrder

func (m *OrderHistoryMutation) ResetOrder()

ResetOrder resets all changes to the "order" edge.

func (*OrderHistoryMutation) ResetOrderID

func (m *OrderHistoryMutation) ResetOrderID()

ResetOrderID resets all changes to the "order_id" field.

func (*OrderHistoryMutation) ResetPerson

func (m *OrderHistoryMutation) ResetPerson()

ResetPerson resets all changes to the "person" edge.

func (*OrderHistoryMutation) ResetPersonID

func (m *OrderHistoryMutation) ResetPersonID()

ResetPersonID resets all changes to the "person_id" field.

func (*OrderHistoryMutation) SetCreatedAt

func (m *OrderHistoryMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*OrderHistoryMutation) SetDescription

func (m *OrderHistoryMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*OrderHistoryMutation) SetField

func (m *OrderHistoryMutation) 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 (*OrderHistoryMutation) SetID

func (m *OrderHistoryMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of OrderHistory entities.

func (*OrderHistoryMutation) SetNewStatusCode

func (m *OrderHistoryMutation) SetNewStatusCode(i int)

SetNewStatusCode sets the "new_status_code" field.

func (*OrderHistoryMutation) SetNewStatusID

func (m *OrderHistoryMutation) SetNewStatusID(id int)

SetNewStatusID sets the "new_status" edge to the OrderStatusCode entity by id.

func (*OrderHistoryMutation) SetOldStatusCode

func (m *OrderHistoryMutation) SetOldStatusCode(i int)

SetOldStatusCode sets the "old_status_code" field.

func (*OrderHistoryMutation) SetOldStatusID

func (m *OrderHistoryMutation) SetOldStatusID(id int)

SetOldStatusID sets the "old_status" edge to the OrderStatusCode entity by id.

func (*OrderHistoryMutation) SetOp

func (m *OrderHistoryMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*OrderHistoryMutation) SetOrderID

func (m *OrderHistoryMutation) SetOrderID(u uuid.UUID)

SetOrderID sets the "order_id" field.

func (*OrderHistoryMutation) SetPersonID

func (m *OrderHistoryMutation) SetPersonID(u uuid.UUID)

SetPersonID sets the "person_id" field.

func (OrderHistoryMutation) Tx

func (m OrderHistoryMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*OrderHistoryMutation) Type

func (m *OrderHistoryMutation) Type() string

Type returns the node type of this mutation (OrderHistory).

func (*OrderHistoryMutation) Where

Where appends a list predicates to the OrderHistoryMutation builder.

func (*OrderHistoryMutation) WhereP

func (m *OrderHistoryMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the OrderHistoryMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type OrderHistoryQuery

type OrderHistoryQuery struct {
	// contains filtered or unexported fields
}

OrderHistoryQuery is the builder for querying OrderHistory entities.

func (*OrderHistoryQuery) Aggregate

func (ohq *OrderHistoryQuery) Aggregate(fns ...AggregateFunc) *OrderHistorySelect

Aggregate returns a OrderHistorySelect configured with the given aggregations.

func (*OrderHistoryQuery) All

func (ohq *OrderHistoryQuery) All(ctx context.Context) ([]*OrderHistory, error)

All executes the query and returns a list of OrderHistories.

func (*OrderHistoryQuery) AllX

func (ohq *OrderHistoryQuery) AllX(ctx context.Context) []*OrderHistory

AllX is like All, but panics if an error occurs.

func (*OrderHistoryQuery) Clone

func (ohq *OrderHistoryQuery) Clone() *OrderHistoryQuery

Clone returns a duplicate of the OrderHistoryQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*OrderHistoryQuery) Count

func (ohq *OrderHistoryQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*OrderHistoryQuery) CountX

func (ohq *OrderHistoryQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*OrderHistoryQuery) Exist

func (ohq *OrderHistoryQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*OrderHistoryQuery) ExistX

func (ohq *OrderHistoryQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*OrderHistoryQuery) First

func (ohq *OrderHistoryQuery) First(ctx context.Context) (*OrderHistory, error)

First returns the first OrderHistory entity from the query. Returns a *NotFoundError when no OrderHistory was found.

func (*OrderHistoryQuery) FirstID

func (ohq *OrderHistoryQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first OrderHistory ID from the query. Returns a *NotFoundError when no OrderHistory ID was found.

func (*OrderHistoryQuery) FirstIDX

func (ohq *OrderHistoryQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*OrderHistoryQuery) FirstX

func (ohq *OrderHistoryQuery) FirstX(ctx context.Context) *OrderHistory

FirstX is like First, but panics if an error occurs.

func (*OrderHistoryQuery) GroupBy

func (ohq *OrderHistoryQuery) GroupBy(field string, fields ...string) *OrderHistoryGroupBy

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.OrderHistory.Query().
	GroupBy(orderhistory.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*OrderHistoryQuery) IDs

func (ohq *OrderHistoryQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of OrderHistory IDs.

func (*OrderHistoryQuery) IDsX

func (ohq *OrderHistoryQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*OrderHistoryQuery) Limit

func (ohq *OrderHistoryQuery) Limit(limit int) *OrderHistoryQuery

Limit the number of records to be returned by this query.

func (*OrderHistoryQuery) Offset

func (ohq *OrderHistoryQuery) Offset(offset int) *OrderHistoryQuery

Offset to start from.

func (*OrderHistoryQuery) Only

func (ohq *OrderHistoryQuery) Only(ctx context.Context) (*OrderHistory, error)

Only returns a single OrderHistory entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one OrderHistory entity is found. Returns a *NotFoundError when no OrderHistory entities are found.

func (*OrderHistoryQuery) OnlyID

func (ohq *OrderHistoryQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only OrderHistory ID in the query. Returns a *NotSingularError when more than one OrderHistory ID is found. Returns a *NotFoundError when no entities are found.

func (*OrderHistoryQuery) OnlyIDX

func (ohq *OrderHistoryQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*OrderHistoryQuery) OnlyX

func (ohq *OrderHistoryQuery) OnlyX(ctx context.Context) *OrderHistory

OnlyX is like Only, but panics if an error occurs.

func (*OrderHistoryQuery) Order

Order specifies how the records should be ordered.

func (*OrderHistoryQuery) QueryNewStatus

func (ohq *OrderHistoryQuery) QueryNewStatus() *OrderStatusCodeQuery

QueryNewStatus chains the current query on the "new_status" edge.

func (*OrderHistoryQuery) QueryOldStatus

func (ohq *OrderHistoryQuery) QueryOldStatus() *OrderStatusCodeQuery

QueryOldStatus chains the current query on the "old_status" edge.

func (*OrderHistoryQuery) QueryOrder

func (ohq *OrderHistoryQuery) QueryOrder() *OrderQuery

QueryOrder chains the current query on the "order" edge.

func (*OrderHistoryQuery) QueryPerson

func (ohq *OrderHistoryQuery) QueryPerson() *PersonQuery

QueryPerson chains the current query on the "person" edge.

func (*OrderHistoryQuery) Select

func (ohq *OrderHistoryQuery) Select(fields ...string) *OrderHistorySelect

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.OrderHistory.Query().
	Select(orderhistory.FieldCreatedAt).
	Scan(ctx, &v)

func (*OrderHistoryQuery) Unique

func (ohq *OrderHistoryQuery) Unique(unique bool) *OrderHistoryQuery

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 (*OrderHistoryQuery) Where

Where adds a new predicate for the OrderHistoryQuery builder.

func (*OrderHistoryQuery) WithNewStatus

func (ohq *OrderHistoryQuery) WithNewStatus(opts ...func(*OrderStatusCodeQuery)) *OrderHistoryQuery

WithNewStatus tells the query-builder to eager-load the nodes that are connected to the "new_status" edge. The optional arguments are used to configure the query builder of the edge.

func (*OrderHistoryQuery) WithOldStatus

func (ohq *OrderHistoryQuery) WithOldStatus(opts ...func(*OrderStatusCodeQuery)) *OrderHistoryQuery

WithOldStatus tells the query-builder to eager-load the nodes that are connected to the "old_status" edge. The optional arguments are used to configure the query builder of the edge.

func (*OrderHistoryQuery) WithOrder

func (ohq *OrderHistoryQuery) WithOrder(opts ...func(*OrderQuery)) *OrderHistoryQuery

WithOrder tells the query-builder to eager-load the nodes that are connected to the "order" edge. The optional arguments are used to configure the query builder of the edge.

func (*OrderHistoryQuery) WithPerson

func (ohq *OrderHistoryQuery) WithPerson(opts ...func(*PersonQuery)) *OrderHistoryQuery

WithPerson tells the query-builder to eager-load the nodes that are connected to the "person" edge. The optional arguments are used to configure the query builder of the edge.

type OrderHistorySelect

type OrderHistorySelect struct {
	*OrderHistoryQuery
	// contains filtered or unexported fields
}

OrderHistorySelect is the builder for selecting fields of OrderHistory entities.

func (*OrderHistorySelect) Aggregate

func (ohs *OrderHistorySelect) Aggregate(fns ...AggregateFunc) *OrderHistorySelect

Aggregate adds the given aggregation functions to the selector query.

func (*OrderHistorySelect) Bool

func (s *OrderHistorySelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OrderHistorySelect) BoolX

func (s *OrderHistorySelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OrderHistorySelect) Bools

func (s *OrderHistorySelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OrderHistorySelect) BoolsX

func (s *OrderHistorySelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OrderHistorySelect) Float64

func (s *OrderHistorySelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OrderHistorySelect) Float64X

func (s *OrderHistorySelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OrderHistorySelect) Float64s

func (s *OrderHistorySelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OrderHistorySelect) Float64sX

func (s *OrderHistorySelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OrderHistorySelect) Int

func (s *OrderHistorySelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OrderHistorySelect) IntX

func (s *OrderHistorySelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OrderHistorySelect) Ints

func (s *OrderHistorySelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OrderHistorySelect) IntsX

func (s *OrderHistorySelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*OrderHistorySelect) Scan

func (ohs *OrderHistorySelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*OrderHistorySelect) ScanX

func (s *OrderHistorySelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OrderHistorySelect) String

func (s *OrderHistorySelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OrderHistorySelect) StringX

func (s *OrderHistorySelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OrderHistorySelect) Strings

func (s *OrderHistorySelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OrderHistorySelect) StringsX

func (s *OrderHistorySelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type OrderHistoryUpdate

type OrderHistoryUpdate struct {
	// contains filtered or unexported fields
}

OrderHistoryUpdate is the builder for updating OrderHistory entities.

func (*OrderHistoryUpdate) Exec

func (ohu *OrderHistoryUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*OrderHistoryUpdate) ExecX

func (ohu *OrderHistoryUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderHistoryUpdate) Mutation

func (ohu *OrderHistoryUpdate) Mutation() *OrderHistoryMutation

Mutation returns the OrderHistoryMutation object of the builder.

func (*OrderHistoryUpdate) Save

func (ohu *OrderHistoryUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*OrderHistoryUpdate) SaveX

func (ohu *OrderHistoryUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*OrderHistoryUpdate) Where

Where appends a list predicates to the OrderHistoryUpdate builder.

type OrderHistoryUpdateOne

type OrderHistoryUpdateOne struct {
	// contains filtered or unexported fields
}

OrderHistoryUpdateOne is the builder for updating a single OrderHistory entity.

func (*OrderHistoryUpdateOne) Exec

func (ohuo *OrderHistoryUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*OrderHistoryUpdateOne) ExecX

func (ohuo *OrderHistoryUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderHistoryUpdateOne) Mutation

func (ohuo *OrderHistoryUpdateOne) Mutation() *OrderHistoryMutation

Mutation returns the OrderHistoryMutation object of the builder.

func (*OrderHistoryUpdateOne) Save

Save executes the query and returns the updated OrderHistory entity.

func (*OrderHistoryUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*OrderHistoryUpdateOne) Select

func (ohuo *OrderHistoryUpdateOne) Select(field string, fields ...string) *OrderHistoryUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*OrderHistoryUpdateOne) Where

Where appends a list predicates to the OrderHistoryUpdate builder.

type OrderItem

type OrderItem struct {

	// ID of the ent.
	ID uuid.UUID `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"`
	// OrderID holds the value of the "order_id" field.
	OrderID uuid.UUID `json:"order_id,omitempty"`
	// ProductID holds the value of the "product_id" field.
	ProductID string `json:"product_id,omitempty"`
	// ProductColorID holds the value of the "product_color_id" field.
	ProductColorID string `json:"product_color_id,omitempty"`
	// SrcUnitID holds the value of the "src_unit_id" field.
	SrcUnitID *uuid.UUID `json:"src_unit_id,omitempty"`
	// DstUnitID holds the value of the "dst_unit_id" field.
	DstUnitID *uuid.UUID `json:"dst_unit_id,omitempty"`
	// Qty holds the value of the "qty" field.
	Qty *decimal.Decimal `json:"qty,omitempty"`
	// PricePerUnit holds the value of the "price_per_unit" field.
	PricePerUnit *decimal.Decimal `json:"price_per_unit,omitempty"`
	// Status holds the value of the "status" field.
	Status *orderitem.Status `json:"status,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the OrderItemQuery when eager-loading is set.
	Edges OrderItemEdges `json:"edges"`
	// contains filtered or unexported fields
}

OrderItem is the model entity for the OrderItem schema.

func (*OrderItem) QueryDestinationWorkUnit

func (oi *OrderItem) QueryDestinationWorkUnit() *WorkUnitInfoQuery

QueryDestinationWorkUnit queries the "destination_work_unit" edge of the OrderItem entity.

func (*OrderItem) QueryOrder

func (oi *OrderItem) QueryOrder() *OrderQuery

QueryOrder queries the "order" edge of the OrderItem entity.

func (*OrderItem) QueryProduct

func (oi *OrderItem) QueryProduct() *ProductInfoQuery

QueryProduct queries the "product" edge of the OrderItem entity.

func (*OrderItem) QueryProductColor

func (oi *OrderItem) QueryProductColor() *ProductColorQuery

QueryProductColor queries the "product_color" edge of the OrderItem entity.

func (*OrderItem) QuerySourceWorkUnit

func (oi *OrderItem) QuerySourceWorkUnit() *WorkUnitInfoQuery

QuerySourceWorkUnit queries the "source_work_unit" edge of the OrderItem entity.

func (*OrderItem) String

func (oi *OrderItem) String() string

String implements the fmt.Stringer.

func (*OrderItem) Unwrap

func (oi *OrderItem) Unwrap() *OrderItem

Unwrap unwraps the OrderItem 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 (*OrderItem) Update

func (oi *OrderItem) Update() *OrderItemUpdateOne

Update returns a builder for updating this OrderItem. Note that you need to call OrderItem.Unwrap() before calling this method if this OrderItem was returned from a transaction, and the transaction was committed or rolled back.

func (*OrderItem) Value

func (oi *OrderItem) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the OrderItem. This includes values selected through modifiers, order, etc.

type OrderItemClient

type OrderItemClient struct {
	// contains filtered or unexported fields
}

OrderItemClient is a client for the OrderItem schema.

func NewOrderItemClient

func NewOrderItemClient(c config) *OrderItemClient

NewOrderItemClient returns a client for the OrderItem from the given config.

func (*OrderItemClient) Create

func (c *OrderItemClient) Create() *OrderItemCreate

Create returns a builder for creating a OrderItem entity.

func (*OrderItemClient) CreateBulk

func (c *OrderItemClient) CreateBulk(builders ...*OrderItemCreate) *OrderItemCreateBulk

CreateBulk returns a builder for creating a bulk of OrderItem entities.

func (*OrderItemClient) Delete

func (c *OrderItemClient) Delete() *OrderItemDelete

Delete returns a delete builder for OrderItem.

func (*OrderItemClient) DeleteOne

func (c *OrderItemClient) DeleteOne(oi *OrderItem) *OrderItemDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*OrderItemClient) DeleteOneID

func (c *OrderItemClient) DeleteOneID(id uuid.UUID) *OrderItemDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*OrderItemClient) Get

func (c *OrderItemClient) Get(ctx context.Context, id uuid.UUID) (*OrderItem, error)

Get returns a OrderItem entity by its id.

func (*OrderItemClient) GetX

func (c *OrderItemClient) GetX(ctx context.Context, id uuid.UUID) *OrderItem

GetX is like Get, but panics if an error occurs.

func (*OrderItemClient) Hooks

func (c *OrderItemClient) Hooks() []Hook

Hooks returns the client hooks.

func (*OrderItemClient) Intercept

func (c *OrderItemClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `orderitem.Intercept(f(g(h())))`.

func (*OrderItemClient) Interceptors

func (c *OrderItemClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*OrderItemClient) MapCreateBulk

func (c *OrderItemClient) MapCreateBulk(slice any, setFunc func(*OrderItemCreate, int)) *OrderItemCreateBulk

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 (*OrderItemClient) Query

func (c *OrderItemClient) Query() *OrderItemQuery

Query returns a query builder for OrderItem.

func (*OrderItemClient) QueryDestinationWorkUnit

func (c *OrderItemClient) QueryDestinationWorkUnit(oi *OrderItem) *WorkUnitInfoQuery

QueryDestinationWorkUnit queries the destination_work_unit edge of a OrderItem.

func (*OrderItemClient) QueryOrder

func (c *OrderItemClient) QueryOrder(oi *OrderItem) *OrderQuery

QueryOrder queries the order edge of a OrderItem.

func (*OrderItemClient) QueryProduct

func (c *OrderItemClient) QueryProduct(oi *OrderItem) *ProductInfoQuery

QueryProduct queries the product edge of a OrderItem.

func (*OrderItemClient) QueryProductColor

func (c *OrderItemClient) QueryProductColor(oi *OrderItem) *ProductColorQuery

QueryProductColor queries the product_color edge of a OrderItem.

func (*OrderItemClient) QuerySourceWorkUnit

func (c *OrderItemClient) QuerySourceWorkUnit(oi *OrderItem) *WorkUnitInfoQuery

QuerySourceWorkUnit queries the source_work_unit edge of a OrderItem.

func (*OrderItemClient) Update

func (c *OrderItemClient) Update() *OrderItemUpdate

Update returns an update builder for OrderItem.

func (*OrderItemClient) UpdateOne

func (c *OrderItemClient) UpdateOne(oi *OrderItem) *OrderItemUpdateOne

UpdateOne returns an update builder for the given entity.

func (*OrderItemClient) UpdateOneID

func (c *OrderItemClient) UpdateOneID(id uuid.UUID) *OrderItemUpdateOne

UpdateOneID returns an update builder for the given id.

func (*OrderItemClient) Use

func (c *OrderItemClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `orderitem.Hooks(f(g(h())))`.

type OrderItemCreate

type OrderItemCreate struct {
	// contains filtered or unexported fields
}

OrderItemCreate is the builder for creating a OrderItem entity.

func (*OrderItemCreate) Exec

func (oic *OrderItemCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*OrderItemCreate) ExecX

func (oic *OrderItemCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderItemCreate) Mutation

func (oic *OrderItemCreate) Mutation() *OrderItemMutation

Mutation returns the OrderItemMutation object of the builder.

func (*OrderItemCreate) Save

func (oic *OrderItemCreate) Save(ctx context.Context) (*OrderItem, error)

Save creates the OrderItem in the database.

func (*OrderItemCreate) SaveX

func (oic *OrderItemCreate) SaveX(ctx context.Context) *OrderItem

SaveX calls Save and panics if Save returns an error.

func (*OrderItemCreate) SetCreatedAt

func (oic *OrderItemCreate) SetCreatedAt(t time.Time) *OrderItemCreate

SetCreatedAt sets the "created_at" field.

func (*OrderItemCreate) SetDestinationWorkUnit

func (oic *OrderItemCreate) SetDestinationWorkUnit(w *WorkUnitInfo) *OrderItemCreate

SetDestinationWorkUnit sets the "destination_work_unit" edge to the WorkUnitInfo entity.

func (*OrderItemCreate) SetDestinationWorkUnitID

func (oic *OrderItemCreate) SetDestinationWorkUnitID(id uuid.UUID) *OrderItemCreate

SetDestinationWorkUnitID sets the "destination_work_unit" edge to the WorkUnitInfo entity by ID.

func (*OrderItemCreate) SetDstUnitID

func (oic *OrderItemCreate) SetDstUnitID(u uuid.UUID) *OrderItemCreate

SetDstUnitID sets the "dst_unit_id" field.

func (*OrderItemCreate) SetID

func (oic *OrderItemCreate) SetID(u uuid.UUID) *OrderItemCreate

SetID sets the "id" field.

func (*OrderItemCreate) SetNillableCreatedAt

func (oic *OrderItemCreate) SetNillableCreatedAt(t *time.Time) *OrderItemCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*OrderItemCreate) SetNillableDestinationWorkUnitID

func (oic *OrderItemCreate) SetNillableDestinationWorkUnitID(id *uuid.UUID) *OrderItemCreate

SetNillableDestinationWorkUnitID sets the "destination_work_unit" edge to the WorkUnitInfo entity by ID if the given value is not nil.

func (*OrderItemCreate) SetNillableDstUnitID

func (oic *OrderItemCreate) SetNillableDstUnitID(u *uuid.UUID) *OrderItemCreate

SetNillableDstUnitID sets the "dst_unit_id" field if the given value is not nil.

func (*OrderItemCreate) SetNillableID

func (oic *OrderItemCreate) SetNillableID(u *uuid.UUID) *OrderItemCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*OrderItemCreate) SetNillableSourceWorkUnitID

func (oic *OrderItemCreate) SetNillableSourceWorkUnitID(id *uuid.UUID) *OrderItemCreate

SetNillableSourceWorkUnitID sets the "source_work_unit" edge to the WorkUnitInfo entity by ID if the given value is not nil.

func (*OrderItemCreate) SetNillableSrcUnitID

func (oic *OrderItemCreate) SetNillableSrcUnitID(u *uuid.UUID) *OrderItemCreate

SetNillableSrcUnitID sets the "src_unit_id" field if the given value is not nil.

func (*OrderItemCreate) SetNillableStatus

func (oic *OrderItemCreate) SetNillableStatus(o *orderitem.Status) *OrderItemCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*OrderItemCreate) SetNillableUpdatedAt

func (oic *OrderItemCreate) SetNillableUpdatedAt(t *time.Time) *OrderItemCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*OrderItemCreate) SetOrder

func (oic *OrderItemCreate) SetOrder(o *Order) *OrderItemCreate

SetOrder sets the "order" edge to the Order entity.

func (*OrderItemCreate) SetOrderID

func (oic *OrderItemCreate) SetOrderID(u uuid.UUID) *OrderItemCreate

SetOrderID sets the "order_id" field.

func (*OrderItemCreate) SetPricePerUnit

func (oic *OrderItemCreate) SetPricePerUnit(d decimal.Decimal) *OrderItemCreate

SetPricePerUnit sets the "price_per_unit" field.

func (*OrderItemCreate) SetProduct

func (oic *OrderItemCreate) SetProduct(p *ProductInfo) *OrderItemCreate

SetProduct sets the "product" edge to the ProductInfo entity.

func (*OrderItemCreate) SetProductColor

func (oic *OrderItemCreate) SetProductColor(p *ProductColor) *OrderItemCreate

SetProductColor sets the "product_color" edge to the ProductColor entity.

func (*OrderItemCreate) SetProductColorID

func (oic *OrderItemCreate) SetProductColorID(s string) *OrderItemCreate

SetProductColorID sets the "product_color_id" field.

func (*OrderItemCreate) SetProductID

func (oic *OrderItemCreate) SetProductID(s string) *OrderItemCreate

SetProductID sets the "product_id" field.

func (*OrderItemCreate) SetQty

SetQty sets the "qty" field.

func (*OrderItemCreate) SetSourceWorkUnit

func (oic *OrderItemCreate) SetSourceWorkUnit(w *WorkUnitInfo) *OrderItemCreate

SetSourceWorkUnit sets the "source_work_unit" edge to the WorkUnitInfo entity.

func (*OrderItemCreate) SetSourceWorkUnitID

func (oic *OrderItemCreate) SetSourceWorkUnitID(id uuid.UUID) *OrderItemCreate

SetSourceWorkUnitID sets the "source_work_unit" edge to the WorkUnitInfo entity by ID.

func (*OrderItemCreate) SetSrcUnitID

func (oic *OrderItemCreate) SetSrcUnitID(u uuid.UUID) *OrderItemCreate

SetSrcUnitID sets the "src_unit_id" field.

func (*OrderItemCreate) SetStatus

func (oic *OrderItemCreate) SetStatus(o orderitem.Status) *OrderItemCreate

SetStatus sets the "status" field.

func (*OrderItemCreate) SetUpdatedAt

func (oic *OrderItemCreate) SetUpdatedAt(t time.Time) *OrderItemCreate

SetUpdatedAt sets the "updated_at" field.

type OrderItemCreateBulk

type OrderItemCreateBulk struct {
	// contains filtered or unexported fields
}

OrderItemCreateBulk is the builder for creating many OrderItem entities in bulk.

func (*OrderItemCreateBulk) Exec

func (oicb *OrderItemCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*OrderItemCreateBulk) ExecX

func (oicb *OrderItemCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderItemCreateBulk) Save

func (oicb *OrderItemCreateBulk) Save(ctx context.Context) ([]*OrderItem, error)

Save creates the OrderItem entities in the database.

func (*OrderItemCreateBulk) SaveX

func (oicb *OrderItemCreateBulk) SaveX(ctx context.Context) []*OrderItem

SaveX is like Save, but panics if an error occurs.

type OrderItemDelete

type OrderItemDelete struct {
	// contains filtered or unexported fields
}

OrderItemDelete is the builder for deleting a OrderItem entity.

func (*OrderItemDelete) Exec

func (oid *OrderItemDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*OrderItemDelete) ExecX

func (oid *OrderItemDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*OrderItemDelete) Where

Where appends a list predicates to the OrderItemDelete builder.

type OrderItemDeleteOne

type OrderItemDeleteOne struct {
	// contains filtered or unexported fields
}

OrderItemDeleteOne is the builder for deleting a single OrderItem entity.

func (*OrderItemDeleteOne) Exec

func (oido *OrderItemDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*OrderItemDeleteOne) ExecX

func (oido *OrderItemDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderItemDeleteOne) Where

Where appends a list predicates to the OrderItemDelete builder.

type OrderItemEdges

type OrderItemEdges struct {
	// Order holds the value of the order edge.
	Order *Order `json:"order,omitempty"`
	// Product holds the value of the product edge.
	Product *ProductInfo `json:"product,omitempty"`
	// ProductColor holds the value of the product_color edge.
	ProductColor *ProductColor `json:"product_color,omitempty"`
	// SourceWorkUnit holds the value of the source_work_unit edge.
	SourceWorkUnit *WorkUnitInfo `json:"source_work_unit,omitempty"`
	// DestinationWorkUnit holds the value of the destination_work_unit edge.
	DestinationWorkUnit *WorkUnitInfo `json:"destination_work_unit,omitempty"`
	// contains filtered or unexported fields
}

OrderItemEdges holds the relations/edges for other nodes in the graph.

func (OrderItemEdges) DestinationWorkUnitOrErr

func (e OrderItemEdges) DestinationWorkUnitOrErr() (*WorkUnitInfo, error)

DestinationWorkUnitOrErr returns the DestinationWorkUnit value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (OrderItemEdges) OrderOrErr

func (e OrderItemEdges) OrderOrErr() (*Order, error)

OrderOrErr returns the Order value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (OrderItemEdges) ProductColorOrErr

func (e OrderItemEdges) ProductColorOrErr() (*ProductColor, error)

ProductColorOrErr returns the ProductColor value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (OrderItemEdges) ProductOrErr

func (e OrderItemEdges) ProductOrErr() (*ProductInfo, 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 (OrderItemEdges) SourceWorkUnitOrErr

func (e OrderItemEdges) SourceWorkUnitOrErr() (*WorkUnitInfo, error)

SourceWorkUnitOrErr returns the SourceWorkUnit value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type OrderItemGroupBy

type OrderItemGroupBy struct {
	// contains filtered or unexported fields
}

OrderItemGroupBy is the group-by builder for OrderItem entities.

func (*OrderItemGroupBy) Aggregate

func (oigb *OrderItemGroupBy) Aggregate(fns ...AggregateFunc) *OrderItemGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*OrderItemGroupBy) Bool

func (s *OrderItemGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OrderItemGroupBy) BoolX

func (s *OrderItemGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OrderItemGroupBy) Bools

func (s *OrderItemGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OrderItemGroupBy) BoolsX

func (s *OrderItemGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OrderItemGroupBy) Float64

func (s *OrderItemGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OrderItemGroupBy) Float64X

func (s *OrderItemGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OrderItemGroupBy) Float64s

func (s *OrderItemGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OrderItemGroupBy) Float64sX

func (s *OrderItemGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OrderItemGroupBy) Int

func (s *OrderItemGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OrderItemGroupBy) IntX

func (s *OrderItemGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OrderItemGroupBy) Ints

func (s *OrderItemGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OrderItemGroupBy) IntsX

func (s *OrderItemGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*OrderItemGroupBy) Scan

func (oigb *OrderItemGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*OrderItemGroupBy) ScanX

func (s *OrderItemGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OrderItemGroupBy) String

func (s *OrderItemGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OrderItemGroupBy) StringX

func (s *OrderItemGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OrderItemGroupBy) Strings

func (s *OrderItemGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OrderItemGroupBy) StringsX

func (s *OrderItemGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type OrderItemMutation

type OrderItemMutation struct {
	// contains filtered or unexported fields
}

OrderItemMutation represents an operation that mutates the OrderItem nodes in the graph.

func (*OrderItemMutation) AddField

func (m *OrderItemMutation) 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 (*OrderItemMutation) AddPricePerUnit

func (m *OrderItemMutation) AddPricePerUnit(d decimal.Decimal)

AddPricePerUnit adds d to the "price_per_unit" field.

func (*OrderItemMutation) AddQty

func (m *OrderItemMutation) AddQty(d decimal.Decimal)

AddQty adds d to the "qty" field.

func (*OrderItemMutation) AddedEdges

func (m *OrderItemMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*OrderItemMutation) AddedField

func (m *OrderItemMutation) 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 (*OrderItemMutation) AddedFields

func (m *OrderItemMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*OrderItemMutation) AddedIDs

func (m *OrderItemMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*OrderItemMutation) AddedPricePerUnit

func (m *OrderItemMutation) AddedPricePerUnit() (r decimal.Decimal, exists bool)

AddedPricePerUnit returns the value that was added to the "price_per_unit" field in this mutation.

func (*OrderItemMutation) AddedQty

func (m *OrderItemMutation) AddedQty() (r decimal.Decimal, exists bool)

AddedQty returns the value that was added to the "qty" field in this mutation.

func (*OrderItemMutation) ClearDestinationWorkUnit

func (m *OrderItemMutation) ClearDestinationWorkUnit()

ClearDestinationWorkUnit clears the "destination_work_unit" edge to the WorkUnitInfo entity.

func (*OrderItemMutation) ClearDstUnitID

func (m *OrderItemMutation) ClearDstUnitID()

ClearDstUnitID clears the value of the "dst_unit_id" field.

func (*OrderItemMutation) ClearEdge

func (m *OrderItemMutation) 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 (*OrderItemMutation) ClearField

func (m *OrderItemMutation) 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 (*OrderItemMutation) ClearOrder

func (m *OrderItemMutation) ClearOrder()

ClearOrder clears the "order" edge to the Order entity.

func (*OrderItemMutation) ClearProduct

func (m *OrderItemMutation) ClearProduct()

ClearProduct clears the "product" edge to the ProductInfo entity.

func (*OrderItemMutation) ClearProductColor

func (m *OrderItemMutation) ClearProductColor()

ClearProductColor clears the "product_color" edge to the ProductColor entity.

func (*OrderItemMutation) ClearSourceWorkUnit

func (m *OrderItemMutation) ClearSourceWorkUnit()

ClearSourceWorkUnit clears the "source_work_unit" edge to the WorkUnitInfo entity.

func (*OrderItemMutation) ClearSrcUnitID

func (m *OrderItemMutation) ClearSrcUnitID()

ClearSrcUnitID clears the value of the "src_unit_id" field.

func (*OrderItemMutation) ClearedEdges

func (m *OrderItemMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*OrderItemMutation) ClearedFields

func (m *OrderItemMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (OrderItemMutation) Client

func (m OrderItemMutation) 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 (*OrderItemMutation) CreatedAt

func (m *OrderItemMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*OrderItemMutation) DestinationWorkUnitCleared

func (m *OrderItemMutation) DestinationWorkUnitCleared() bool

DestinationWorkUnitCleared reports if the "destination_work_unit" edge to the WorkUnitInfo entity was cleared.

func (*OrderItemMutation) DestinationWorkUnitID

func (m *OrderItemMutation) DestinationWorkUnitID() (id uuid.UUID, exists bool)

DestinationWorkUnitID returns the "destination_work_unit" edge ID in the mutation.

func (*OrderItemMutation) DestinationWorkUnitIDs

func (m *OrderItemMutation) DestinationWorkUnitIDs() (ids []uuid.UUID)

DestinationWorkUnitIDs returns the "destination_work_unit" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use DestinationWorkUnitID instead. It exists only for internal usage by the builders.

func (*OrderItemMutation) DstUnitID

func (m *OrderItemMutation) DstUnitID() (r uuid.UUID, exists bool)

DstUnitID returns the value of the "dst_unit_id" field in the mutation.

func (*OrderItemMutation) DstUnitIDCleared

func (m *OrderItemMutation) DstUnitIDCleared() bool

DstUnitIDCleared returns if the "dst_unit_id" field was cleared in this mutation.

func (*OrderItemMutation) EdgeCleared

func (m *OrderItemMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*OrderItemMutation) Field

func (m *OrderItemMutation) 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 (*OrderItemMutation) FieldCleared

func (m *OrderItemMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*OrderItemMutation) Fields

func (m *OrderItemMutation) 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 (*OrderItemMutation) ID

func (m *OrderItemMutation) ID() (id uuid.UUID, 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 (*OrderItemMutation) IDs

func (m *OrderItemMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*OrderItemMutation) OldCreatedAt

func (m *OrderItemMutation) OldCreatedAt(ctx context.Context) (v *time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the OrderItem entity. If the OrderItem 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 (*OrderItemMutation) OldDstUnitID

func (m *OrderItemMutation) OldDstUnitID(ctx context.Context) (v *uuid.UUID, err error)

OldDstUnitID returns the old "dst_unit_id" field's value of the OrderItem entity. If the OrderItem 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 (*OrderItemMutation) OldField

func (m *OrderItemMutation) 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 (*OrderItemMutation) OldOrderID

func (m *OrderItemMutation) OldOrderID(ctx context.Context) (v uuid.UUID, err error)

OldOrderID returns the old "order_id" field's value of the OrderItem entity. If the OrderItem 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 (*OrderItemMutation) OldPricePerUnit

func (m *OrderItemMutation) OldPricePerUnit(ctx context.Context) (v *decimal.Decimal, err error)

OldPricePerUnit returns the old "price_per_unit" field's value of the OrderItem entity. If the OrderItem 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 (*OrderItemMutation) OldProductColorID

func (m *OrderItemMutation) OldProductColorID(ctx context.Context) (v string, err error)

OldProductColorID returns the old "product_color_id" field's value of the OrderItem entity. If the OrderItem 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 (*OrderItemMutation) OldProductID

func (m *OrderItemMutation) OldProductID(ctx context.Context) (v string, err error)

OldProductID returns the old "product_id" field's value of the OrderItem entity. If the OrderItem 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 (*OrderItemMutation) OldQty

func (m *OrderItemMutation) OldQty(ctx context.Context) (v *decimal.Decimal, err error)

OldQty returns the old "qty" field's value of the OrderItem entity. If the OrderItem 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 (*OrderItemMutation) OldSrcUnitID

func (m *OrderItemMutation) OldSrcUnitID(ctx context.Context) (v *uuid.UUID, err error)

OldSrcUnitID returns the old "src_unit_id" field's value of the OrderItem entity. If the OrderItem 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 (*OrderItemMutation) OldStatus

func (m *OrderItemMutation) OldStatus(ctx context.Context) (v *orderitem.Status, err error)

OldStatus returns the old "status" field's value of the OrderItem entity. If the OrderItem 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 (*OrderItemMutation) OldUpdatedAt

func (m *OrderItemMutation) OldUpdatedAt(ctx context.Context) (v *time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the OrderItem entity. If the OrderItem 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 (*OrderItemMutation) Op

func (m *OrderItemMutation) Op() Op

Op returns the operation name.

func (*OrderItemMutation) OrderCleared

func (m *OrderItemMutation) OrderCleared() bool

OrderCleared reports if the "order" edge to the Order entity was cleared.

func (*OrderItemMutation) OrderID

func (m *OrderItemMutation) OrderID() (r uuid.UUID, exists bool)

OrderID returns the value of the "order_id" field in the mutation.

func (*OrderItemMutation) OrderIDs

func (m *OrderItemMutation) OrderIDs() (ids []uuid.UUID)

OrderIDs returns the "order" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OrderID instead. It exists only for internal usage by the builders.

func (*OrderItemMutation) PricePerUnit

func (m *OrderItemMutation) PricePerUnit() (r decimal.Decimal, exists bool)

PricePerUnit returns the value of the "price_per_unit" field in the mutation.

func (*OrderItemMutation) ProductCleared

func (m *OrderItemMutation) ProductCleared() bool

ProductCleared reports if the "product" edge to the ProductInfo entity was cleared.

func (*OrderItemMutation) ProductColorCleared

func (m *OrderItemMutation) ProductColorCleared() bool

ProductColorCleared reports if the "product_color" edge to the ProductColor entity was cleared.

func (*OrderItemMutation) ProductColorID

func (m *OrderItemMutation) ProductColorID() (r string, exists bool)

ProductColorID returns the value of the "product_color_id" field in the mutation.

func (*OrderItemMutation) ProductColorIDs

func (m *OrderItemMutation) ProductColorIDs() (ids []string)

ProductColorIDs returns the "product_color" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ProductColorID instead. It exists only for internal usage by the builders.

func (*OrderItemMutation) ProductID

func (m *OrderItemMutation) ProductID() (r string, exists bool)

ProductID returns the value of the "product_id" field in the mutation.

func (*OrderItemMutation) ProductIDs

func (m *OrderItemMutation) ProductIDs() (ids []string)

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 (*OrderItemMutation) Qty

func (m *OrderItemMutation) Qty() (r decimal.Decimal, exists bool)

Qty returns the value of the "qty" field in the mutation.

func (*OrderItemMutation) RemovedEdges

func (m *OrderItemMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*OrderItemMutation) RemovedIDs

func (m *OrderItemMutation) 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 (*OrderItemMutation) ResetCreatedAt

func (m *OrderItemMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*OrderItemMutation) ResetDestinationWorkUnit

func (m *OrderItemMutation) ResetDestinationWorkUnit()

ResetDestinationWorkUnit resets all changes to the "destination_work_unit" edge.

func (*OrderItemMutation) ResetDstUnitID

func (m *OrderItemMutation) ResetDstUnitID()

ResetDstUnitID resets all changes to the "dst_unit_id" field.

func (*OrderItemMutation) ResetEdge

func (m *OrderItemMutation) 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 (*OrderItemMutation) ResetField

func (m *OrderItemMutation) 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 (*OrderItemMutation) ResetOrder

func (m *OrderItemMutation) ResetOrder()

ResetOrder resets all changes to the "order" edge.

func (*OrderItemMutation) ResetOrderID

func (m *OrderItemMutation) ResetOrderID()

ResetOrderID resets all changes to the "order_id" field.

func (*OrderItemMutation) ResetPricePerUnit

func (m *OrderItemMutation) ResetPricePerUnit()

ResetPricePerUnit resets all changes to the "price_per_unit" field.

func (*OrderItemMutation) ResetProduct

func (m *OrderItemMutation) ResetProduct()

ResetProduct resets all changes to the "product" edge.

func (*OrderItemMutation) ResetProductColor

func (m *OrderItemMutation) ResetProductColor()

ResetProductColor resets all changes to the "product_color" edge.

func (*OrderItemMutation) ResetProductColorID

func (m *OrderItemMutation) ResetProductColorID()

ResetProductColorID resets all changes to the "product_color_id" field.

func (*OrderItemMutation) ResetProductID

func (m *OrderItemMutation) ResetProductID()

ResetProductID resets all changes to the "product_id" field.

func (*OrderItemMutation) ResetQty

func (m *OrderItemMutation) ResetQty()

ResetQty resets all changes to the "qty" field.

func (*OrderItemMutation) ResetSourceWorkUnit

func (m *OrderItemMutation) ResetSourceWorkUnit()

ResetSourceWorkUnit resets all changes to the "source_work_unit" edge.

func (*OrderItemMutation) ResetSrcUnitID

func (m *OrderItemMutation) ResetSrcUnitID()

ResetSrcUnitID resets all changes to the "src_unit_id" field.

func (*OrderItemMutation) ResetStatus

func (m *OrderItemMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*OrderItemMutation) ResetUpdatedAt

func (m *OrderItemMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*OrderItemMutation) SetCreatedAt

func (m *OrderItemMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*OrderItemMutation) SetDestinationWorkUnitID

func (m *OrderItemMutation) SetDestinationWorkUnitID(id uuid.UUID)

SetDestinationWorkUnitID sets the "destination_work_unit" edge to the WorkUnitInfo entity by id.

func (*OrderItemMutation) SetDstUnitID

func (m *OrderItemMutation) SetDstUnitID(u uuid.UUID)

SetDstUnitID sets the "dst_unit_id" field.

func (*OrderItemMutation) SetField

func (m *OrderItemMutation) 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 (*OrderItemMutation) SetID

func (m *OrderItemMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of OrderItem entities.

func (*OrderItemMutation) SetOp

func (m *OrderItemMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*OrderItemMutation) SetOrderID

func (m *OrderItemMutation) SetOrderID(u uuid.UUID)

SetOrderID sets the "order_id" field.

func (*OrderItemMutation) SetPricePerUnit

func (m *OrderItemMutation) SetPricePerUnit(d decimal.Decimal)

SetPricePerUnit sets the "price_per_unit" field.

func (*OrderItemMutation) SetProductColorID

func (m *OrderItemMutation) SetProductColorID(s string)

SetProductColorID sets the "product_color_id" field.

func (*OrderItemMutation) SetProductID

func (m *OrderItemMutation) SetProductID(s string)

SetProductID sets the "product_id" field.

func (*OrderItemMutation) SetQty

func (m *OrderItemMutation) SetQty(d decimal.Decimal)

SetQty sets the "qty" field.

func (*OrderItemMutation) SetSourceWorkUnitID

func (m *OrderItemMutation) SetSourceWorkUnitID(id uuid.UUID)

SetSourceWorkUnitID sets the "source_work_unit" edge to the WorkUnitInfo entity by id.

func (*OrderItemMutation) SetSrcUnitID

func (m *OrderItemMutation) SetSrcUnitID(u uuid.UUID)

SetSrcUnitID sets the "src_unit_id" field.

func (*OrderItemMutation) SetStatus

func (m *OrderItemMutation) SetStatus(o orderitem.Status)

SetStatus sets the "status" field.

func (*OrderItemMutation) SetUpdatedAt

func (m *OrderItemMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*OrderItemMutation) SourceWorkUnitCleared

func (m *OrderItemMutation) SourceWorkUnitCleared() bool

SourceWorkUnitCleared reports if the "source_work_unit" edge to the WorkUnitInfo entity was cleared.

func (*OrderItemMutation) SourceWorkUnitID

func (m *OrderItemMutation) SourceWorkUnitID() (id uuid.UUID, exists bool)

SourceWorkUnitID returns the "source_work_unit" edge ID in the mutation.

func (*OrderItemMutation) SourceWorkUnitIDs

func (m *OrderItemMutation) SourceWorkUnitIDs() (ids []uuid.UUID)

SourceWorkUnitIDs returns the "source_work_unit" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use SourceWorkUnitID instead. It exists only for internal usage by the builders.

func (*OrderItemMutation) SrcUnitID

func (m *OrderItemMutation) SrcUnitID() (r uuid.UUID, exists bool)

SrcUnitID returns the value of the "src_unit_id" field in the mutation.

func (*OrderItemMutation) SrcUnitIDCleared

func (m *OrderItemMutation) SrcUnitIDCleared() bool

SrcUnitIDCleared returns if the "src_unit_id" field was cleared in this mutation.

func (*OrderItemMutation) Status

func (m *OrderItemMutation) Status() (r orderitem.Status, exists bool)

Status returns the value of the "status" field in the mutation.

func (OrderItemMutation) Tx

func (m OrderItemMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*OrderItemMutation) Type

func (m *OrderItemMutation) Type() string

Type returns the node type of this mutation (OrderItem).

func (*OrderItemMutation) UpdatedAt

func (m *OrderItemMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*OrderItemMutation) Where

func (m *OrderItemMutation) Where(ps ...predicate.OrderItem)

Where appends a list predicates to the OrderItemMutation builder.

func (*OrderItemMutation) WhereP

func (m *OrderItemMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the OrderItemMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type OrderItemQuery

type OrderItemQuery struct {
	// contains filtered or unexported fields
}

OrderItemQuery is the builder for querying OrderItem entities.

func (*OrderItemQuery) Aggregate

func (oiq *OrderItemQuery) Aggregate(fns ...AggregateFunc) *OrderItemSelect

Aggregate returns a OrderItemSelect configured with the given aggregations.

func (*OrderItemQuery) All

func (oiq *OrderItemQuery) All(ctx context.Context) ([]*OrderItem, error)

All executes the query and returns a list of OrderItems.

func (*OrderItemQuery) AllX

func (oiq *OrderItemQuery) AllX(ctx context.Context) []*OrderItem

AllX is like All, but panics if an error occurs.

func (*OrderItemQuery) Clone

func (oiq *OrderItemQuery) Clone() *OrderItemQuery

Clone returns a duplicate of the OrderItemQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*OrderItemQuery) Count

func (oiq *OrderItemQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*OrderItemQuery) CountX

func (oiq *OrderItemQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*OrderItemQuery) Exist

func (oiq *OrderItemQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*OrderItemQuery) ExistX

func (oiq *OrderItemQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*OrderItemQuery) First

func (oiq *OrderItemQuery) First(ctx context.Context) (*OrderItem, error)

First returns the first OrderItem entity from the query. Returns a *NotFoundError when no OrderItem was found.

func (*OrderItemQuery) FirstID

func (oiq *OrderItemQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first OrderItem ID from the query. Returns a *NotFoundError when no OrderItem ID was found.

func (*OrderItemQuery) FirstIDX

func (oiq *OrderItemQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*OrderItemQuery) FirstX

func (oiq *OrderItemQuery) FirstX(ctx context.Context) *OrderItem

FirstX is like First, but panics if an error occurs.

func (*OrderItemQuery) GroupBy

func (oiq *OrderItemQuery) GroupBy(field string, fields ...string) *OrderItemGroupBy

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.OrderItem.Query().
	GroupBy(orderitem.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*OrderItemQuery) IDs

func (oiq *OrderItemQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of OrderItem IDs.

func (*OrderItemQuery) IDsX

func (oiq *OrderItemQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*OrderItemQuery) Limit

func (oiq *OrderItemQuery) Limit(limit int) *OrderItemQuery

Limit the number of records to be returned by this query.

func (*OrderItemQuery) Offset

func (oiq *OrderItemQuery) Offset(offset int) *OrderItemQuery

Offset to start from.

func (*OrderItemQuery) Only

func (oiq *OrderItemQuery) Only(ctx context.Context) (*OrderItem, error)

Only returns a single OrderItem entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one OrderItem entity is found. Returns a *NotFoundError when no OrderItem entities are found.

func (*OrderItemQuery) OnlyID

func (oiq *OrderItemQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only OrderItem ID in the query. Returns a *NotSingularError when more than one OrderItem ID is found. Returns a *NotFoundError when no entities are found.

func (*OrderItemQuery) OnlyIDX

func (oiq *OrderItemQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*OrderItemQuery) OnlyX

func (oiq *OrderItemQuery) OnlyX(ctx context.Context) *OrderItem

OnlyX is like Only, but panics if an error occurs.

func (*OrderItemQuery) Order

Order specifies how the records should be ordered.

func (*OrderItemQuery) QueryDestinationWorkUnit

func (oiq *OrderItemQuery) QueryDestinationWorkUnit() *WorkUnitInfoQuery

QueryDestinationWorkUnit chains the current query on the "destination_work_unit" edge.

func (*OrderItemQuery) QueryOrder

func (oiq *OrderItemQuery) QueryOrder() *OrderQuery

QueryOrder chains the current query on the "order" edge.

func (*OrderItemQuery) QueryProduct

func (oiq *OrderItemQuery) QueryProduct() *ProductInfoQuery

QueryProduct chains the current query on the "product" edge.

func (*OrderItemQuery) QueryProductColor

func (oiq *OrderItemQuery) QueryProductColor() *ProductColorQuery

QueryProductColor chains the current query on the "product_color" edge.

func (*OrderItemQuery) QuerySourceWorkUnit

func (oiq *OrderItemQuery) QuerySourceWorkUnit() *WorkUnitInfoQuery

QuerySourceWorkUnit chains the current query on the "source_work_unit" edge.

func (*OrderItemQuery) Select

func (oiq *OrderItemQuery) Select(fields ...string) *OrderItemSelect

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.OrderItem.Query().
	Select(orderitem.FieldCreatedAt).
	Scan(ctx, &v)

func (*OrderItemQuery) Unique

func (oiq *OrderItemQuery) Unique(unique bool) *OrderItemQuery

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 (*OrderItemQuery) Where

func (oiq *OrderItemQuery) Where(ps ...predicate.OrderItem) *OrderItemQuery

Where adds a new predicate for the OrderItemQuery builder.

func (*OrderItemQuery) WithDestinationWorkUnit

func (oiq *OrderItemQuery) WithDestinationWorkUnit(opts ...func(*WorkUnitInfoQuery)) *OrderItemQuery

WithDestinationWorkUnit tells the query-builder to eager-load the nodes that are connected to the "destination_work_unit" edge. The optional arguments are used to configure the query builder of the edge.

func (*OrderItemQuery) WithOrder

func (oiq *OrderItemQuery) WithOrder(opts ...func(*OrderQuery)) *OrderItemQuery

WithOrder tells the query-builder to eager-load the nodes that are connected to the "order" edge. The optional arguments are used to configure the query builder of the edge.

func (*OrderItemQuery) WithProduct

func (oiq *OrderItemQuery) WithProduct(opts ...func(*ProductInfoQuery)) *OrderItemQuery

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 (*OrderItemQuery) WithProductColor

func (oiq *OrderItemQuery) WithProductColor(opts ...func(*ProductColorQuery)) *OrderItemQuery

WithProductColor tells the query-builder to eager-load the nodes that are connected to the "product_color" edge. The optional arguments are used to configure the query builder of the edge.

func (*OrderItemQuery) WithSourceWorkUnit

func (oiq *OrderItemQuery) WithSourceWorkUnit(opts ...func(*WorkUnitInfoQuery)) *OrderItemQuery

WithSourceWorkUnit tells the query-builder to eager-load the nodes that are connected to the "source_work_unit" edge. The optional arguments are used to configure the query builder of the edge.

type OrderItemSelect

type OrderItemSelect struct {
	*OrderItemQuery
	// contains filtered or unexported fields
}

OrderItemSelect is the builder for selecting fields of OrderItem entities.

func (*OrderItemSelect) Aggregate

func (ois *OrderItemSelect) Aggregate(fns ...AggregateFunc) *OrderItemSelect

Aggregate adds the given aggregation functions to the selector query.

func (*OrderItemSelect) Bool

func (s *OrderItemSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OrderItemSelect) BoolX

func (s *OrderItemSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OrderItemSelect) Bools

func (s *OrderItemSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OrderItemSelect) BoolsX

func (s *OrderItemSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OrderItemSelect) Float64

func (s *OrderItemSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OrderItemSelect) Float64X

func (s *OrderItemSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OrderItemSelect) Float64s

func (s *OrderItemSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OrderItemSelect) Float64sX

func (s *OrderItemSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OrderItemSelect) Int

func (s *OrderItemSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OrderItemSelect) IntX

func (s *OrderItemSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OrderItemSelect) Ints

func (s *OrderItemSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OrderItemSelect) IntsX

func (s *OrderItemSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*OrderItemSelect) Scan

func (ois *OrderItemSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*OrderItemSelect) ScanX

func (s *OrderItemSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OrderItemSelect) String

func (s *OrderItemSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OrderItemSelect) StringX

func (s *OrderItemSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OrderItemSelect) Strings

func (s *OrderItemSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OrderItemSelect) StringsX

func (s *OrderItemSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type OrderItemUpdate

type OrderItemUpdate struct {
	// contains filtered or unexported fields
}

OrderItemUpdate is the builder for updating OrderItem entities.

func (*OrderItemUpdate) AddPricePerUnit

func (oiu *OrderItemUpdate) AddPricePerUnit(d decimal.Decimal) *OrderItemUpdate

AddPricePerUnit adds d to the "price_per_unit" field.

func (*OrderItemUpdate) AddQty

AddQty adds d to the "qty" field.

func (*OrderItemUpdate) ClearDestinationWorkUnit

func (oiu *OrderItemUpdate) ClearDestinationWorkUnit() *OrderItemUpdate

ClearDestinationWorkUnit clears the "destination_work_unit" edge to the WorkUnitInfo entity.

func (*OrderItemUpdate) ClearDstUnitID

func (oiu *OrderItemUpdate) ClearDstUnitID() *OrderItemUpdate

ClearDstUnitID clears the value of the "dst_unit_id" field.

func (*OrderItemUpdate) ClearSourceWorkUnit

func (oiu *OrderItemUpdate) ClearSourceWorkUnit() *OrderItemUpdate

ClearSourceWorkUnit clears the "source_work_unit" edge to the WorkUnitInfo entity.

func (*OrderItemUpdate) ClearSrcUnitID

func (oiu *OrderItemUpdate) ClearSrcUnitID() *OrderItemUpdate

ClearSrcUnitID clears the value of the "src_unit_id" field.

func (*OrderItemUpdate) Exec

func (oiu *OrderItemUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*OrderItemUpdate) ExecX

func (oiu *OrderItemUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderItemUpdate) Mutation

func (oiu *OrderItemUpdate) Mutation() *OrderItemMutation

Mutation returns the OrderItemMutation object of the builder.

func (*OrderItemUpdate) Save

func (oiu *OrderItemUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*OrderItemUpdate) SaveX

func (oiu *OrderItemUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*OrderItemUpdate) SetDestinationWorkUnit

func (oiu *OrderItemUpdate) SetDestinationWorkUnit(w *WorkUnitInfo) *OrderItemUpdate

SetDestinationWorkUnit sets the "destination_work_unit" edge to the WorkUnitInfo entity.

func (*OrderItemUpdate) SetDestinationWorkUnitID

func (oiu *OrderItemUpdate) SetDestinationWorkUnitID(id uuid.UUID) *OrderItemUpdate

SetDestinationWorkUnitID sets the "destination_work_unit" edge to the WorkUnitInfo entity by ID.

func (*OrderItemUpdate) SetDstUnitID

func (oiu *OrderItemUpdate) SetDstUnitID(u uuid.UUID) *OrderItemUpdate

SetDstUnitID sets the "dst_unit_id" field.

func (*OrderItemUpdate) SetNillableDestinationWorkUnitID

func (oiu *OrderItemUpdate) SetNillableDestinationWorkUnitID(id *uuid.UUID) *OrderItemUpdate

SetNillableDestinationWorkUnitID sets the "destination_work_unit" edge to the WorkUnitInfo entity by ID if the given value is not nil.

func (*OrderItemUpdate) SetNillableDstUnitID

func (oiu *OrderItemUpdate) SetNillableDstUnitID(u *uuid.UUID) *OrderItemUpdate

SetNillableDstUnitID sets the "dst_unit_id" field if the given value is not nil.

func (*OrderItemUpdate) SetNillablePricePerUnit

func (oiu *OrderItemUpdate) SetNillablePricePerUnit(d *decimal.Decimal) *OrderItemUpdate

SetNillablePricePerUnit sets the "price_per_unit" field if the given value is not nil.

func (*OrderItemUpdate) SetNillableQty

func (oiu *OrderItemUpdate) SetNillableQty(d *decimal.Decimal) *OrderItemUpdate

SetNillableQty sets the "qty" field if the given value is not nil.

func (*OrderItemUpdate) SetNillableSourceWorkUnitID

func (oiu *OrderItemUpdate) SetNillableSourceWorkUnitID(id *uuid.UUID) *OrderItemUpdate

SetNillableSourceWorkUnitID sets the "source_work_unit" edge to the WorkUnitInfo entity by ID if the given value is not nil.

func (*OrderItemUpdate) SetNillableSrcUnitID

func (oiu *OrderItemUpdate) SetNillableSrcUnitID(u *uuid.UUID) *OrderItemUpdate

SetNillableSrcUnitID sets the "src_unit_id" field if the given value is not nil.

func (*OrderItemUpdate) SetNillableStatus

func (oiu *OrderItemUpdate) SetNillableStatus(o *orderitem.Status) *OrderItemUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*OrderItemUpdate) SetPricePerUnit

func (oiu *OrderItemUpdate) SetPricePerUnit(d decimal.Decimal) *OrderItemUpdate

SetPricePerUnit sets the "price_per_unit" field.

func (*OrderItemUpdate) SetQty

SetQty sets the "qty" field.

func (*OrderItemUpdate) SetSourceWorkUnit

func (oiu *OrderItemUpdate) SetSourceWorkUnit(w *WorkUnitInfo) *OrderItemUpdate

SetSourceWorkUnit sets the "source_work_unit" edge to the WorkUnitInfo entity.

func (*OrderItemUpdate) SetSourceWorkUnitID

func (oiu *OrderItemUpdate) SetSourceWorkUnitID(id uuid.UUID) *OrderItemUpdate

SetSourceWorkUnitID sets the "source_work_unit" edge to the WorkUnitInfo entity by ID.

func (*OrderItemUpdate) SetSrcUnitID

func (oiu *OrderItemUpdate) SetSrcUnitID(u uuid.UUID) *OrderItemUpdate

SetSrcUnitID sets the "src_unit_id" field.

func (*OrderItemUpdate) SetStatus

func (oiu *OrderItemUpdate) SetStatus(o orderitem.Status) *OrderItemUpdate

SetStatus sets the "status" field.

func (*OrderItemUpdate) SetUpdatedAt

func (oiu *OrderItemUpdate) SetUpdatedAt(t time.Time) *OrderItemUpdate

SetUpdatedAt sets the "updated_at" field.

func (*OrderItemUpdate) Where

Where appends a list predicates to the OrderItemUpdate builder.

type OrderItemUpdateOne

type OrderItemUpdateOne struct {
	// contains filtered or unexported fields
}

OrderItemUpdateOne is the builder for updating a single OrderItem entity.

func (*OrderItemUpdateOne) AddPricePerUnit

func (oiuo *OrderItemUpdateOne) AddPricePerUnit(d decimal.Decimal) *OrderItemUpdateOne

AddPricePerUnit adds d to the "price_per_unit" field.

func (*OrderItemUpdateOne) AddQty

AddQty adds d to the "qty" field.

func (*OrderItemUpdateOne) ClearDestinationWorkUnit

func (oiuo *OrderItemUpdateOne) ClearDestinationWorkUnit() *OrderItemUpdateOne

ClearDestinationWorkUnit clears the "destination_work_unit" edge to the WorkUnitInfo entity.

func (*OrderItemUpdateOne) ClearDstUnitID

func (oiuo *OrderItemUpdateOne) ClearDstUnitID() *OrderItemUpdateOne

ClearDstUnitID clears the value of the "dst_unit_id" field.

func (*OrderItemUpdateOne) ClearSourceWorkUnit

func (oiuo *OrderItemUpdateOne) ClearSourceWorkUnit() *OrderItemUpdateOne

ClearSourceWorkUnit clears the "source_work_unit" edge to the WorkUnitInfo entity.

func (*OrderItemUpdateOne) ClearSrcUnitID

func (oiuo *OrderItemUpdateOne) ClearSrcUnitID() *OrderItemUpdateOne

ClearSrcUnitID clears the value of the "src_unit_id" field.

func (*OrderItemUpdateOne) Exec

func (oiuo *OrderItemUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*OrderItemUpdateOne) ExecX

func (oiuo *OrderItemUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderItemUpdateOne) Mutation

func (oiuo *OrderItemUpdateOne) Mutation() *OrderItemMutation

Mutation returns the OrderItemMutation object of the builder.

func (*OrderItemUpdateOne) Save

func (oiuo *OrderItemUpdateOne) Save(ctx context.Context) (*OrderItem, error)

Save executes the query and returns the updated OrderItem entity.

func (*OrderItemUpdateOne) SaveX

func (oiuo *OrderItemUpdateOne) SaveX(ctx context.Context) *OrderItem

SaveX is like Save, but panics if an error occurs.

func (*OrderItemUpdateOne) Select

func (oiuo *OrderItemUpdateOne) Select(field string, fields ...string) *OrderItemUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*OrderItemUpdateOne) SetDestinationWorkUnit

func (oiuo *OrderItemUpdateOne) SetDestinationWorkUnit(w *WorkUnitInfo) *OrderItemUpdateOne

SetDestinationWorkUnit sets the "destination_work_unit" edge to the WorkUnitInfo entity.

func (*OrderItemUpdateOne) SetDestinationWorkUnitID

func (oiuo *OrderItemUpdateOne) SetDestinationWorkUnitID(id uuid.UUID) *OrderItemUpdateOne

SetDestinationWorkUnitID sets the "destination_work_unit" edge to the WorkUnitInfo entity by ID.

func (*OrderItemUpdateOne) SetDstUnitID

func (oiuo *OrderItemUpdateOne) SetDstUnitID(u uuid.UUID) *OrderItemUpdateOne

SetDstUnitID sets the "dst_unit_id" field.

func (*OrderItemUpdateOne) SetNillableDestinationWorkUnitID

func (oiuo *OrderItemUpdateOne) SetNillableDestinationWorkUnitID(id *uuid.UUID) *OrderItemUpdateOne

SetNillableDestinationWorkUnitID sets the "destination_work_unit" edge to the WorkUnitInfo entity by ID if the given value is not nil.

func (*OrderItemUpdateOne) SetNillableDstUnitID

func (oiuo *OrderItemUpdateOne) SetNillableDstUnitID(u *uuid.UUID) *OrderItemUpdateOne

SetNillableDstUnitID sets the "dst_unit_id" field if the given value is not nil.

func (*OrderItemUpdateOne) SetNillablePricePerUnit

func (oiuo *OrderItemUpdateOne) SetNillablePricePerUnit(d *decimal.Decimal) *OrderItemUpdateOne

SetNillablePricePerUnit sets the "price_per_unit" field if the given value is not nil.

func (*OrderItemUpdateOne) SetNillableQty

func (oiuo *OrderItemUpdateOne) SetNillableQty(d *decimal.Decimal) *OrderItemUpdateOne

SetNillableQty sets the "qty" field if the given value is not nil.

func (*OrderItemUpdateOne) SetNillableSourceWorkUnitID

func (oiuo *OrderItemUpdateOne) SetNillableSourceWorkUnitID(id *uuid.UUID) *OrderItemUpdateOne

SetNillableSourceWorkUnitID sets the "source_work_unit" edge to the WorkUnitInfo entity by ID if the given value is not nil.

func (*OrderItemUpdateOne) SetNillableSrcUnitID

func (oiuo *OrderItemUpdateOne) SetNillableSrcUnitID(u *uuid.UUID) *OrderItemUpdateOne

SetNillableSrcUnitID sets the "src_unit_id" field if the given value is not nil.

func (*OrderItemUpdateOne) SetNillableStatus

func (oiuo *OrderItemUpdateOne) SetNillableStatus(o *orderitem.Status) *OrderItemUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*OrderItemUpdateOne) SetPricePerUnit

func (oiuo *OrderItemUpdateOne) SetPricePerUnit(d decimal.Decimal) *OrderItemUpdateOne

SetPricePerUnit sets the "price_per_unit" field.

func (*OrderItemUpdateOne) SetQty

SetQty sets the "qty" field.

func (*OrderItemUpdateOne) SetSourceWorkUnit

func (oiuo *OrderItemUpdateOne) SetSourceWorkUnit(w *WorkUnitInfo) *OrderItemUpdateOne

SetSourceWorkUnit sets the "source_work_unit" edge to the WorkUnitInfo entity.

func (*OrderItemUpdateOne) SetSourceWorkUnitID

func (oiuo *OrderItemUpdateOne) SetSourceWorkUnitID(id uuid.UUID) *OrderItemUpdateOne

SetSourceWorkUnitID sets the "source_work_unit" edge to the WorkUnitInfo entity by ID.

func (*OrderItemUpdateOne) SetSrcUnitID

func (oiuo *OrderItemUpdateOne) SetSrcUnitID(u uuid.UUID) *OrderItemUpdateOne

SetSrcUnitID sets the "src_unit_id" field.

func (*OrderItemUpdateOne) SetStatus

SetStatus sets the "status" field.

func (*OrderItemUpdateOne) SetUpdatedAt

func (oiuo *OrderItemUpdateOne) SetUpdatedAt(t time.Time) *OrderItemUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*OrderItemUpdateOne) Where

Where appends a list predicates to the OrderItemUpdate builder.

type OrderItems

type OrderItems []*OrderItem

OrderItems is a parsable slice of OrderItem.

type OrderMutation

type OrderMutation struct {
	// contains filtered or unexported fields
}

OrderMutation represents an operation that mutates the Order nodes in the graph.

func (*OrderMutation) AddField

func (m *OrderMutation) 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 (*OrderMutation) AddPriority

func (m *OrderMutation) AddPriority(i int)

AddPriority adds i to the "priority" field.

func (*OrderMutation) AddedEdges

func (m *OrderMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*OrderMutation) AddedField

func (m *OrderMutation) 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 (*OrderMutation) AddedFields

func (m *OrderMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*OrderMutation) AddedIDs

func (m *OrderMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*OrderMutation) AddedPriority

func (m *OrderMutation) AddedPriority() (r int, exists bool)

AddedPriority returns the value that was added to the "priority" field in this mutation.

func (*OrderMutation) AddressID

func (m *OrderMutation) AddressID() (r uuid.UUID, exists bool)

AddressID returns the value of the "address_id" field in the mutation.

func (*OrderMutation) ClearCreator

func (m *OrderMutation) ClearCreator()

ClearCreator clears the "creator" edge to the Person entity.

func (*OrderMutation) ClearCustomer

func (m *OrderMutation) ClearCustomer()

ClearCustomer clears the "customer" edge to the Person entity.

func (*OrderMutation) ClearEdge

func (m *OrderMutation) 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 (*OrderMutation) ClearField

func (m *OrderMutation) 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 (*OrderMutation) ClearInternalNote

func (m *OrderMutation) ClearInternalNote()

ClearInternalNote clears the value of the "internal_note" field.

func (*OrderMutation) ClearNote

func (m *OrderMutation) ClearNote()

ClearNote clears the value of the "note" field.

func (*OrderMutation) ClearOrderAddress

func (m *OrderMutation) ClearOrderAddress()

ClearOrderAddress clears the "order_address" edge to the Address entity.

func (*OrderMutation) ClearOrderStatus

func (m *OrderMutation) ClearOrderStatus()

ClearOrderStatus clears the "order_status" edge to the OrderStatusCode entity.

func (*OrderMutation) ClearParentOrder

func (m *OrderMutation) ClearParentOrder()

ClearParentOrder clears the "parent_order" edge to the Order entity.

func (*OrderMutation) ClearParentOrderID

func (m *OrderMutation) ClearParentOrderID()

ClearParentOrderID clears the value of the "parent_order_id" field.

func (*OrderMutation) ClearStaff

func (m *OrderMutation) ClearStaff()

ClearStaff clears the "staff" edge to the Person entity.

func (*OrderMutation) ClearStaffID

func (m *OrderMutation) ClearStaffID()

ClearStaffID clears the value of the "staff_id" field.

func (*OrderMutation) ClearedEdges

func (m *OrderMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*OrderMutation) ClearedFields

func (m *OrderMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (OrderMutation) Client

func (m OrderMutation) 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 (*OrderMutation) CreatedAt

func (m *OrderMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*OrderMutation) CreatedBy

func (m *OrderMutation) CreatedBy() (r uuid.UUID, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*OrderMutation) CreatorCleared

func (m *OrderMutation) CreatorCleared() bool

CreatorCleared reports if the "creator" edge to the Person entity was cleared.

func (*OrderMutation) CreatorID

func (m *OrderMutation) CreatorID() (id uuid.UUID, exists bool)

CreatorID returns the "creator" edge ID in the mutation.

func (*OrderMutation) CreatorIDs

func (m *OrderMutation) CreatorIDs() (ids []uuid.UUID)

CreatorIDs returns the "creator" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CreatorID instead. It exists only for internal usage by the builders.

func (*OrderMutation) CustomerCleared

func (m *OrderMutation) CustomerCleared() bool

CustomerCleared reports if the "customer" edge to the Person entity was cleared.

func (*OrderMutation) CustomerID

func (m *OrderMutation) CustomerID() (r uuid.UUID, exists bool)

CustomerID returns the value of the "customer_id" field in the mutation.

func (*OrderMutation) CustomerIDs

func (m *OrderMutation) CustomerIDs() (ids []uuid.UUID)

CustomerIDs returns the "customer" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CustomerID instead. It exists only for internal usage by the builders.

func (*OrderMutation) EdgeCleared

func (m *OrderMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*OrderMutation) Field

func (m *OrderMutation) 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 (*OrderMutation) FieldCleared

func (m *OrderMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*OrderMutation) Fields

func (m *OrderMutation) 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 (*OrderMutation) GetType

func (m *OrderMutation) GetType() (r order.Type, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*OrderMutation) ID

func (m *OrderMutation) ID() (id uuid.UUID, 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 (*OrderMutation) IDs

func (m *OrderMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*OrderMutation) InternalNote

func (m *OrderMutation) InternalNote() (r string, exists bool)

InternalNote returns the value of the "internal_note" field in the mutation.

func (*OrderMutation) InternalNoteCleared

func (m *OrderMutation) InternalNoteCleared() bool

InternalNoteCleared returns if the "internal_note" field was cleared in this mutation.

func (*OrderMutation) IsInternal

func (m *OrderMutation) IsInternal() (r bool, exists bool)

IsInternal returns the value of the "is_internal" field in the mutation.

func (*OrderMutation) Note

func (m *OrderMutation) Note() (r string, exists bool)

Note returns the value of the "note" field in the mutation.

func (*OrderMutation) NoteCleared

func (m *OrderMutation) NoteCleared() bool

NoteCleared returns if the "note" field was cleared in this mutation.

func (*OrderMutation) OldAddressID

func (m *OrderMutation) OldAddressID(ctx context.Context) (v uuid.UUID, err error)

OldAddressID returns the old "address_id" field's value of the Order entity. If the Order 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 (*OrderMutation) OldCreatedAt

func (m *OrderMutation) OldCreatedAt(ctx context.Context) (v *time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Order entity. If the Order 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 (*OrderMutation) OldCreatedBy

func (m *OrderMutation) OldCreatedBy(ctx context.Context) (v uuid.UUID, err error)

OldCreatedBy returns the old "created_by" field's value of the Order entity. If the Order 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 (*OrderMutation) OldCustomerID

func (m *OrderMutation) OldCustomerID(ctx context.Context) (v uuid.UUID, err error)

OldCustomerID returns the old "customer_id" field's value of the Order entity. If the Order 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 (*OrderMutation) OldField

func (m *OrderMutation) 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 (*OrderMutation) OldInternalNote

func (m *OrderMutation) OldInternalNote(ctx context.Context) (v *string, err error)

OldInternalNote returns the old "internal_note" field's value of the Order entity. If the Order 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 (*OrderMutation) OldIsInternal

func (m *OrderMutation) OldIsInternal(ctx context.Context) (v *bool, err error)

OldIsInternal returns the old "is_internal" field's value of the Order entity. If the Order 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 (*OrderMutation) OldNote

func (m *OrderMutation) OldNote(ctx context.Context) (v *string, err error)

OldNote returns the old "note" field's value of the Order entity. If the Order 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 (*OrderMutation) OldParentOrderID

func (m *OrderMutation) OldParentOrderID(ctx context.Context) (v *uuid.UUID, err error)

OldParentOrderID returns the old "parent_order_id" field's value of the Order entity. If the Order 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 (*OrderMutation) OldPriority

func (m *OrderMutation) OldPriority(ctx context.Context) (v *int, err error)

OldPriority returns the old "priority" field's value of the Order entity. If the Order 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 (*OrderMutation) OldStaffID

func (m *OrderMutation) OldStaffID(ctx context.Context) (v *uuid.UUID, err error)

OldStaffID returns the old "staff_id" field's value of the Order entity. If the Order 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 (*OrderMutation) OldStatusCode

func (m *OrderMutation) OldStatusCode(ctx context.Context) (v int, err error)

OldStatusCode returns the old "status_code" field's value of the Order entity. If the Order 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 (*OrderMutation) OldType

func (m *OrderMutation) OldType(ctx context.Context) (v *order.Type, err error)

OldType returns the old "type" field's value of the Order entity. If the Order 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 (*OrderMutation) OldUpdatedAt

func (m *OrderMutation) OldUpdatedAt(ctx context.Context) (v *time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Order entity. If the Order 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 (*OrderMutation) Op

func (m *OrderMutation) Op() Op

Op returns the operation name.

func (*OrderMutation) OrderAddressCleared

func (m *OrderMutation) OrderAddressCleared() bool

OrderAddressCleared reports if the "order_address" edge to the Address entity was cleared.

func (*OrderMutation) OrderAddressID

func (m *OrderMutation) OrderAddressID() (id uuid.UUID, exists bool)

OrderAddressID returns the "order_address" edge ID in the mutation.

func (*OrderMutation) OrderAddressIDs

func (m *OrderMutation) OrderAddressIDs() (ids []uuid.UUID)

OrderAddressIDs returns the "order_address" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OrderAddressID instead. It exists only for internal usage by the builders.

func (*OrderMutation) OrderStatusCleared

func (m *OrderMutation) OrderStatusCleared() bool

OrderStatusCleared reports if the "order_status" edge to the OrderStatusCode entity was cleared.

func (*OrderMutation) OrderStatusID

func (m *OrderMutation) OrderStatusID() (id int, exists bool)

OrderStatusID returns the "order_status" edge ID in the mutation.

func (*OrderMutation) OrderStatusIDs

func (m *OrderMutation) OrderStatusIDs() (ids []int)

OrderStatusIDs returns the "order_status" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OrderStatusID instead. It exists only for internal usage by the builders.

func (*OrderMutation) ParentOrderCleared

func (m *OrderMutation) ParentOrderCleared() bool

ParentOrderCleared reports if the "parent_order" edge to the Order entity was cleared.

func (*OrderMutation) ParentOrderID

func (m *OrderMutation) ParentOrderID() (r uuid.UUID, exists bool)

ParentOrderID returns the value of the "parent_order_id" field in the mutation.

func (*OrderMutation) ParentOrderIDCleared

func (m *OrderMutation) ParentOrderIDCleared() bool

ParentOrderIDCleared returns if the "parent_order_id" field was cleared in this mutation.

func (*OrderMutation) ParentOrderIDs

func (m *OrderMutation) ParentOrderIDs() (ids []uuid.UUID)

ParentOrderIDs returns the "parent_order" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ParentOrderID instead. It exists only for internal usage by the builders.

func (*OrderMutation) Priority

func (m *OrderMutation) Priority() (r int, exists bool)

Priority returns the value of the "priority" field in the mutation.

func (*OrderMutation) RemovedEdges

func (m *OrderMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*OrderMutation) RemovedIDs

func (m *OrderMutation) 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 (*OrderMutation) ResetAddressID

func (m *OrderMutation) ResetAddressID()

ResetAddressID resets all changes to the "address_id" field.

func (*OrderMutation) ResetCreatedAt

func (m *OrderMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*OrderMutation) ResetCreatedBy

func (m *OrderMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*OrderMutation) ResetCreator

func (m *OrderMutation) ResetCreator()

ResetCreator resets all changes to the "creator" edge.

func (*OrderMutation) ResetCustomer

func (m *OrderMutation) ResetCustomer()

ResetCustomer resets all changes to the "customer" edge.

func (*OrderMutation) ResetCustomerID

func (m *OrderMutation) ResetCustomerID()

ResetCustomerID resets all changes to the "customer_id" field.

func (*OrderMutation) ResetEdge

func (m *OrderMutation) 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 (*OrderMutation) ResetField

func (m *OrderMutation) 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 (*OrderMutation) ResetInternalNote

func (m *OrderMutation) ResetInternalNote()

ResetInternalNote resets all changes to the "internal_note" field.

func (*OrderMutation) ResetIsInternal

func (m *OrderMutation) ResetIsInternal()

ResetIsInternal resets all changes to the "is_internal" field.

func (*OrderMutation) ResetNote

func (m *OrderMutation) ResetNote()

ResetNote resets all changes to the "note" field.

func (*OrderMutation) ResetOrderAddress

func (m *OrderMutation) ResetOrderAddress()

ResetOrderAddress resets all changes to the "order_address" edge.

func (*OrderMutation) ResetOrderStatus

func (m *OrderMutation) ResetOrderStatus()

ResetOrderStatus resets all changes to the "order_status" edge.

func (*OrderMutation) ResetParentOrder

func (m *OrderMutation) ResetParentOrder()

ResetParentOrder resets all changes to the "parent_order" edge.

func (*OrderMutation) ResetParentOrderID

func (m *OrderMutation) ResetParentOrderID()

ResetParentOrderID resets all changes to the "parent_order_id" field.

func (*OrderMutation) ResetPriority

func (m *OrderMutation) ResetPriority()

ResetPriority resets all changes to the "priority" field.

func (*OrderMutation) ResetStaff

func (m *OrderMutation) ResetStaff()

ResetStaff resets all changes to the "staff" edge.

func (*OrderMutation) ResetStaffID

func (m *OrderMutation) ResetStaffID()

ResetStaffID resets all changes to the "staff_id" field.

func (*OrderMutation) ResetStatusCode

func (m *OrderMutation) ResetStatusCode()

ResetStatusCode resets all changes to the "status_code" field.

func (*OrderMutation) ResetType

func (m *OrderMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*OrderMutation) ResetUpdatedAt

func (m *OrderMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*OrderMutation) SetAddressID

func (m *OrderMutation) SetAddressID(u uuid.UUID)

SetAddressID sets the "address_id" field.

func (*OrderMutation) SetCreatedAt

func (m *OrderMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*OrderMutation) SetCreatedBy

func (m *OrderMutation) SetCreatedBy(u uuid.UUID)

SetCreatedBy sets the "created_by" field.

func (*OrderMutation) SetCreatorID

func (m *OrderMutation) SetCreatorID(id uuid.UUID)

SetCreatorID sets the "creator" edge to the Person entity by id.

func (*OrderMutation) SetCustomerID

func (m *OrderMutation) SetCustomerID(u uuid.UUID)

SetCustomerID sets the "customer_id" field.

func (*OrderMutation) SetField

func (m *OrderMutation) 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 (*OrderMutation) SetID

func (m *OrderMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Order entities.

func (*OrderMutation) SetInternalNote

func (m *OrderMutation) SetInternalNote(s string)

SetInternalNote sets the "internal_note" field.

func (*OrderMutation) SetIsInternal

func (m *OrderMutation) SetIsInternal(b bool)

SetIsInternal sets the "is_internal" field.

func (*OrderMutation) SetNote

func (m *OrderMutation) SetNote(s string)

SetNote sets the "note" field.

func (*OrderMutation) SetOp

func (m *OrderMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*OrderMutation) SetOrderAddressID

func (m *OrderMutation) SetOrderAddressID(id uuid.UUID)

SetOrderAddressID sets the "order_address" edge to the Address entity by id.

func (*OrderMutation) SetOrderStatusID

func (m *OrderMutation) SetOrderStatusID(id int)

SetOrderStatusID sets the "order_status" edge to the OrderStatusCode entity by id.

func (*OrderMutation) SetParentOrderID

func (m *OrderMutation) SetParentOrderID(u uuid.UUID)

SetParentOrderID sets the "parent_order_id" field.

func (*OrderMutation) SetPriority

func (m *OrderMutation) SetPriority(i int)

SetPriority sets the "priority" field.

func (*OrderMutation) SetStaffID

func (m *OrderMutation) SetStaffID(u uuid.UUID)

SetStaffID sets the "staff_id" field.

func (*OrderMutation) SetStatusCode

func (m *OrderMutation) SetStatusCode(i int)

SetStatusCode sets the "status_code" field.

func (*OrderMutation) SetType

func (m *OrderMutation) SetType(o order.Type)

SetType sets the "type" field.

func (*OrderMutation) SetUpdatedAt

func (m *OrderMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*OrderMutation) StaffCleared

func (m *OrderMutation) StaffCleared() bool

StaffCleared reports if the "staff" edge to the Person entity was cleared.

func (*OrderMutation) StaffID

func (m *OrderMutation) StaffID() (r uuid.UUID, exists bool)

StaffID returns the value of the "staff_id" field in the mutation.

func (*OrderMutation) StaffIDCleared

func (m *OrderMutation) StaffIDCleared() bool

StaffIDCleared returns if the "staff_id" field was cleared in this mutation.

func (*OrderMutation) StaffIDs

func (m *OrderMutation) StaffIDs() (ids []uuid.UUID)

StaffIDs returns the "staff" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use StaffID instead. It exists only for internal usage by the builders.

func (*OrderMutation) StatusCode

func (m *OrderMutation) StatusCode() (r int, exists bool)

StatusCode returns the value of the "status_code" field in the mutation.

func (OrderMutation) Tx

func (m OrderMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*OrderMutation) Type

func (m *OrderMutation) Type() string

Type returns the node type of this mutation (Order).

func (*OrderMutation) UpdatedAt

func (m *OrderMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*OrderMutation) Where

func (m *OrderMutation) Where(ps ...predicate.Order)

Where appends a list predicates to the OrderMutation builder.

func (*OrderMutation) WhereP

func (m *OrderMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the OrderMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type OrderQuery

type OrderQuery struct {
	// contains filtered or unexported fields
}

OrderQuery is the builder for querying Order entities.

func (*OrderQuery) Aggregate

func (oq *OrderQuery) Aggregate(fns ...AggregateFunc) *OrderSelect

Aggregate returns a OrderSelect configured with the given aggregations.

func (*OrderQuery) All

func (oq *OrderQuery) All(ctx context.Context) ([]*Order, error)

All executes the query and returns a list of Orders.

func (*OrderQuery) AllX

func (oq *OrderQuery) AllX(ctx context.Context) []*Order

AllX is like All, but panics if an error occurs.

func (*OrderQuery) Clone

func (oq *OrderQuery) Clone() *OrderQuery

Clone returns a duplicate of the OrderQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*OrderQuery) Count

func (oq *OrderQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*OrderQuery) CountX

func (oq *OrderQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*OrderQuery) Exist

func (oq *OrderQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*OrderQuery) ExistX

func (oq *OrderQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*OrderQuery) First

func (oq *OrderQuery) First(ctx context.Context) (*Order, error)

First returns the first Order entity from the query. Returns a *NotFoundError when no Order was found.

func (*OrderQuery) FirstID

func (oq *OrderQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Order ID from the query. Returns a *NotFoundError when no Order ID was found.

func (*OrderQuery) FirstIDX

func (oq *OrderQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*OrderQuery) FirstX

func (oq *OrderQuery) FirstX(ctx context.Context) *Order

FirstX is like First, but panics if an error occurs.

func (*OrderQuery) GroupBy

func (oq *OrderQuery) GroupBy(field string, fields ...string) *OrderGroupBy

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.Order.Query().
	GroupBy(order.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*OrderQuery) IDs

func (oq *OrderQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Order IDs.

func (*OrderQuery) IDsX

func (oq *OrderQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*OrderQuery) Limit

func (oq *OrderQuery) Limit(limit int) *OrderQuery

Limit the number of records to be returned by this query.

func (*OrderQuery) Offset

func (oq *OrderQuery) Offset(offset int) *OrderQuery

Offset to start from.

func (*OrderQuery) Only

func (oq *OrderQuery) Only(ctx context.Context) (*Order, error)

Only returns a single Order entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Order entity is found. Returns a *NotFoundError when no Order entities are found.

func (*OrderQuery) OnlyID

func (oq *OrderQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Order ID in the query. Returns a *NotSingularError when more than one Order ID is found. Returns a *NotFoundError when no entities are found.

func (*OrderQuery) OnlyIDX

func (oq *OrderQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*OrderQuery) OnlyX

func (oq *OrderQuery) OnlyX(ctx context.Context) *Order

OnlyX is like Only, but panics if an error occurs.

func (*OrderQuery) Order

func (oq *OrderQuery) Order(o ...order.OrderOption) *OrderQuery

Order specifies how the records should be ordered.

func (*OrderQuery) QueryCreator

func (oq *OrderQuery) QueryCreator() *PersonQuery

QueryCreator chains the current query on the "creator" edge.

func (*OrderQuery) QueryCustomer

func (oq *OrderQuery) QueryCustomer() *PersonQuery

QueryCustomer chains the current query on the "customer" edge.

func (*OrderQuery) QueryOrderAddress

func (oq *OrderQuery) QueryOrderAddress() *AddressQuery

QueryOrderAddress chains the current query on the "order_address" edge.

func (*OrderQuery) QueryOrderStatus

func (oq *OrderQuery) QueryOrderStatus() *OrderStatusCodeQuery

QueryOrderStatus chains the current query on the "order_status" edge.

func (*OrderQuery) QueryParentOrder

func (oq *OrderQuery) QueryParentOrder() *OrderQuery

QueryParentOrder chains the current query on the "parent_order" edge.

func (*OrderQuery) QueryStaff

func (oq *OrderQuery) QueryStaff() *PersonQuery

QueryStaff chains the current query on the "staff" edge.

func (*OrderQuery) Select

func (oq *OrderQuery) Select(fields ...string) *OrderSelect

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.Order.Query().
	Select(order.FieldCreatedAt).
	Scan(ctx, &v)

func (*OrderQuery) Unique

func (oq *OrderQuery) Unique(unique bool) *OrderQuery

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 (*OrderQuery) Where

func (oq *OrderQuery) Where(ps ...predicate.Order) *OrderQuery

Where adds a new predicate for the OrderQuery builder.

func (*OrderQuery) WithCreator

func (oq *OrderQuery) WithCreator(opts ...func(*PersonQuery)) *OrderQuery

WithCreator tells the query-builder to eager-load the nodes that are connected to the "creator" edge. The optional arguments are used to configure the query builder of the edge.

func (*OrderQuery) WithCustomer

func (oq *OrderQuery) WithCustomer(opts ...func(*PersonQuery)) *OrderQuery

WithCustomer tells the query-builder to eager-load the nodes that are connected to the "customer" edge. The optional arguments are used to configure the query builder of the edge.

func (*OrderQuery) WithOrderAddress

func (oq *OrderQuery) WithOrderAddress(opts ...func(*AddressQuery)) *OrderQuery

WithOrderAddress tells the query-builder to eager-load the nodes that are connected to the "order_address" edge. The optional arguments are used to configure the query builder of the edge.

func (*OrderQuery) WithOrderStatus

func (oq *OrderQuery) WithOrderStatus(opts ...func(*OrderStatusCodeQuery)) *OrderQuery

WithOrderStatus tells the query-builder to eager-load the nodes that are connected to the "order_status" edge. The optional arguments are used to configure the query builder of the edge.

func (*OrderQuery) WithParentOrder

func (oq *OrderQuery) WithParentOrder(opts ...func(*OrderQuery)) *OrderQuery

WithParentOrder tells the query-builder to eager-load the nodes that are connected to the "parent_order" edge. The optional arguments are used to configure the query builder of the edge.

func (*OrderQuery) WithStaff

func (oq *OrderQuery) WithStaff(opts ...func(*PersonQuery)) *OrderQuery

WithStaff tells the query-builder to eager-load the nodes that are connected to the "staff" edge. The optional arguments are used to configure the query builder of the edge.

type OrderSelect

type OrderSelect struct {
	*OrderQuery
	// contains filtered or unexported fields
}

OrderSelect is the builder for selecting fields of Order entities.

func (*OrderSelect) Aggregate

func (os *OrderSelect) Aggregate(fns ...AggregateFunc) *OrderSelect

Aggregate adds the given aggregation functions to the selector query.

func (*OrderSelect) Bool

func (s *OrderSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OrderSelect) BoolX

func (s *OrderSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OrderSelect) Bools

func (s *OrderSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OrderSelect) BoolsX

func (s *OrderSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OrderSelect) Float64

func (s *OrderSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OrderSelect) Float64X

func (s *OrderSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OrderSelect) Float64s

func (s *OrderSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OrderSelect) Float64sX

func (s *OrderSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OrderSelect) Int

func (s *OrderSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OrderSelect) IntX

func (s *OrderSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OrderSelect) Ints

func (s *OrderSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OrderSelect) IntsX

func (s *OrderSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*OrderSelect) Scan

func (os *OrderSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*OrderSelect) ScanX

func (s *OrderSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OrderSelect) String

func (s *OrderSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OrderSelect) StringX

func (s *OrderSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OrderSelect) Strings

func (s *OrderSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OrderSelect) StringsX

func (s *OrderSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type OrderStatusCode

type OrderStatusCode struct {

	// ID of the ent.
	ID int `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"`
	// OrderStatus holds the value of the "order_status" field.
	OrderStatus string `json:"order_status,omitempty"`
	// contains filtered or unexported fields
}

OrderStatusCode is the model entity for the OrderStatusCode schema.

func (*OrderStatusCode) String

func (osc *OrderStatusCode) String() string

String implements the fmt.Stringer.

func (*OrderStatusCode) Unwrap

func (osc *OrderStatusCode) Unwrap() *OrderStatusCode

Unwrap unwraps the OrderStatusCode 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 (*OrderStatusCode) Update

Update returns a builder for updating this OrderStatusCode. Note that you need to call OrderStatusCode.Unwrap() before calling this method if this OrderStatusCode was returned from a transaction, and the transaction was committed or rolled back.

func (*OrderStatusCode) Value

func (osc *OrderStatusCode) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the OrderStatusCode. This includes values selected through modifiers, order, etc.

type OrderStatusCodeClient

type OrderStatusCodeClient struct {
	// contains filtered or unexported fields
}

OrderStatusCodeClient is a client for the OrderStatusCode schema.

func NewOrderStatusCodeClient

func NewOrderStatusCodeClient(c config) *OrderStatusCodeClient

NewOrderStatusCodeClient returns a client for the OrderStatusCode from the given config.

func (*OrderStatusCodeClient) Create

Create returns a builder for creating a OrderStatusCode entity.

func (*OrderStatusCodeClient) CreateBulk

CreateBulk returns a builder for creating a bulk of OrderStatusCode entities.

func (*OrderStatusCodeClient) Delete

Delete returns a delete builder for OrderStatusCode.

func (*OrderStatusCodeClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*OrderStatusCodeClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*OrderStatusCodeClient) Get

Get returns a OrderStatusCode entity by its id.

func (*OrderStatusCodeClient) GetX

GetX is like Get, but panics if an error occurs.

func (*OrderStatusCodeClient) Hooks

func (c *OrderStatusCodeClient) Hooks() []Hook

Hooks returns the client hooks.

func (*OrderStatusCodeClient) Intercept

func (c *OrderStatusCodeClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `orderstatuscode.Intercept(f(g(h())))`.

func (*OrderStatusCodeClient) Interceptors

func (c *OrderStatusCodeClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*OrderStatusCodeClient) MapCreateBulk

func (c *OrderStatusCodeClient) MapCreateBulk(slice any, setFunc func(*OrderStatusCodeCreate, int)) *OrderStatusCodeCreateBulk

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 (*OrderStatusCodeClient) Query

Query returns a query builder for OrderStatusCode.

func (*OrderStatusCodeClient) Update

Update returns an update builder for OrderStatusCode.

func (*OrderStatusCodeClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*OrderStatusCodeClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*OrderStatusCodeClient) Use

func (c *OrderStatusCodeClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `orderstatuscode.Hooks(f(g(h())))`.

type OrderStatusCodeCreate

type OrderStatusCodeCreate struct {
	// contains filtered or unexported fields
}

OrderStatusCodeCreate is the builder for creating a OrderStatusCode entity.

func (*OrderStatusCodeCreate) Exec

func (oscc *OrderStatusCodeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*OrderStatusCodeCreate) ExecX

func (oscc *OrderStatusCodeCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderStatusCodeCreate) Mutation

Mutation returns the OrderStatusCodeMutation object of the builder.

func (*OrderStatusCodeCreate) Save

Save creates the OrderStatusCode in the database.

func (*OrderStatusCodeCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*OrderStatusCodeCreate) SetCreatedAt

func (oscc *OrderStatusCodeCreate) SetCreatedAt(t time.Time) *OrderStatusCodeCreate

SetCreatedAt sets the "created_at" field.

func (*OrderStatusCodeCreate) SetID

SetID sets the "id" field.

func (*OrderStatusCodeCreate) SetNillableCreatedAt

func (oscc *OrderStatusCodeCreate) SetNillableCreatedAt(t *time.Time) *OrderStatusCodeCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*OrderStatusCodeCreate) SetNillableUpdatedAt

func (oscc *OrderStatusCodeCreate) SetNillableUpdatedAt(t *time.Time) *OrderStatusCodeCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*OrderStatusCodeCreate) SetOrderStatus

func (oscc *OrderStatusCodeCreate) SetOrderStatus(s string) *OrderStatusCodeCreate

SetOrderStatus sets the "order_status" field.

func (*OrderStatusCodeCreate) SetUpdatedAt

func (oscc *OrderStatusCodeCreate) SetUpdatedAt(t time.Time) *OrderStatusCodeCreate

SetUpdatedAt sets the "updated_at" field.

type OrderStatusCodeCreateBulk

type OrderStatusCodeCreateBulk struct {
	// contains filtered or unexported fields
}

OrderStatusCodeCreateBulk is the builder for creating many OrderStatusCode entities in bulk.

func (*OrderStatusCodeCreateBulk) Exec

Exec executes the query.

func (*OrderStatusCodeCreateBulk) ExecX

func (osccb *OrderStatusCodeCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderStatusCodeCreateBulk) Save

Save creates the OrderStatusCode entities in the database.

func (*OrderStatusCodeCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type OrderStatusCodeDelete

type OrderStatusCodeDelete struct {
	// contains filtered or unexported fields
}

OrderStatusCodeDelete is the builder for deleting a OrderStatusCode entity.

func (*OrderStatusCodeDelete) Exec

func (oscd *OrderStatusCodeDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*OrderStatusCodeDelete) ExecX

func (oscd *OrderStatusCodeDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*OrderStatusCodeDelete) Where

Where appends a list predicates to the OrderStatusCodeDelete builder.

type OrderStatusCodeDeleteOne

type OrderStatusCodeDeleteOne struct {
	// contains filtered or unexported fields
}

OrderStatusCodeDeleteOne is the builder for deleting a single OrderStatusCode entity.

func (*OrderStatusCodeDeleteOne) Exec

func (oscdo *OrderStatusCodeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*OrderStatusCodeDeleteOne) ExecX

func (oscdo *OrderStatusCodeDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderStatusCodeDeleteOne) Where

Where appends a list predicates to the OrderStatusCodeDelete builder.

type OrderStatusCodeGroupBy

type OrderStatusCodeGroupBy struct {
	// contains filtered or unexported fields
}

OrderStatusCodeGroupBy is the group-by builder for OrderStatusCode entities.

func (*OrderStatusCodeGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*OrderStatusCodeGroupBy) Bool

func (s *OrderStatusCodeGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeGroupBy) BoolX

func (s *OrderStatusCodeGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OrderStatusCodeGroupBy) Bools

func (s *OrderStatusCodeGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeGroupBy) BoolsX

func (s *OrderStatusCodeGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OrderStatusCodeGroupBy) Float64

func (s *OrderStatusCodeGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeGroupBy) Float64X

func (s *OrderStatusCodeGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OrderStatusCodeGroupBy) Float64s

func (s *OrderStatusCodeGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeGroupBy) Float64sX

func (s *OrderStatusCodeGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OrderStatusCodeGroupBy) Int

func (s *OrderStatusCodeGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeGroupBy) IntX

func (s *OrderStatusCodeGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OrderStatusCodeGroupBy) Ints

func (s *OrderStatusCodeGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeGroupBy) IntsX

func (s *OrderStatusCodeGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*OrderStatusCodeGroupBy) Scan

func (oscgb *OrderStatusCodeGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*OrderStatusCodeGroupBy) ScanX

func (s *OrderStatusCodeGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OrderStatusCodeGroupBy) String

func (s *OrderStatusCodeGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeGroupBy) StringX

func (s *OrderStatusCodeGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OrderStatusCodeGroupBy) Strings

func (s *OrderStatusCodeGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeGroupBy) StringsX

func (s *OrderStatusCodeGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type OrderStatusCodeMutation

type OrderStatusCodeMutation struct {
	// contains filtered or unexported fields
}

OrderStatusCodeMutation represents an operation that mutates the OrderStatusCode nodes in the graph.

func (*OrderStatusCodeMutation) AddField

func (m *OrderStatusCodeMutation) 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 (*OrderStatusCodeMutation) AddedEdges

func (m *OrderStatusCodeMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*OrderStatusCodeMutation) AddedField

func (m *OrderStatusCodeMutation) 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 (*OrderStatusCodeMutation) AddedFields

func (m *OrderStatusCodeMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*OrderStatusCodeMutation) AddedIDs

func (m *OrderStatusCodeMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*OrderStatusCodeMutation) ClearEdge

func (m *OrderStatusCodeMutation) 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 (*OrderStatusCodeMutation) ClearField

func (m *OrderStatusCodeMutation) 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 (*OrderStatusCodeMutation) ClearedEdges

func (m *OrderStatusCodeMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*OrderStatusCodeMutation) ClearedFields

func (m *OrderStatusCodeMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (OrderStatusCodeMutation) Client

func (m OrderStatusCodeMutation) 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 (*OrderStatusCodeMutation) CreatedAt

func (m *OrderStatusCodeMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*OrderStatusCodeMutation) EdgeCleared

func (m *OrderStatusCodeMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*OrderStatusCodeMutation) Field

func (m *OrderStatusCodeMutation) 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 (*OrderStatusCodeMutation) FieldCleared

func (m *OrderStatusCodeMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*OrderStatusCodeMutation) Fields

func (m *OrderStatusCodeMutation) 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 (*OrderStatusCodeMutation) ID

func (m *OrderStatusCodeMutation) ID() (id int, 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 (*OrderStatusCodeMutation) IDs

func (m *OrderStatusCodeMutation) IDs(ctx context.Context) ([]int, 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 (*OrderStatusCodeMutation) OldCreatedAt

func (m *OrderStatusCodeMutation) OldCreatedAt(ctx context.Context) (v *time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the OrderStatusCode entity. If the OrderStatusCode 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 (*OrderStatusCodeMutation) OldField

func (m *OrderStatusCodeMutation) 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 (*OrderStatusCodeMutation) OldOrderStatus

func (m *OrderStatusCodeMutation) OldOrderStatus(ctx context.Context) (v string, err error)

OldOrderStatus returns the old "order_status" field's value of the OrderStatusCode entity. If the OrderStatusCode 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 (*OrderStatusCodeMutation) OldUpdatedAt

func (m *OrderStatusCodeMutation) OldUpdatedAt(ctx context.Context) (v *time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the OrderStatusCode entity. If the OrderStatusCode 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 (*OrderStatusCodeMutation) Op

func (m *OrderStatusCodeMutation) Op() Op

Op returns the operation name.

func (*OrderStatusCodeMutation) OrderStatus

func (m *OrderStatusCodeMutation) OrderStatus() (r string, exists bool)

OrderStatus returns the value of the "order_status" field in the mutation.

func (*OrderStatusCodeMutation) RemovedEdges

func (m *OrderStatusCodeMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*OrderStatusCodeMutation) RemovedIDs

func (m *OrderStatusCodeMutation) 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 (*OrderStatusCodeMutation) ResetCreatedAt

func (m *OrderStatusCodeMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*OrderStatusCodeMutation) ResetEdge

func (m *OrderStatusCodeMutation) 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 (*OrderStatusCodeMutation) ResetField

func (m *OrderStatusCodeMutation) 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 (*OrderStatusCodeMutation) ResetOrderStatus

func (m *OrderStatusCodeMutation) ResetOrderStatus()

ResetOrderStatus resets all changes to the "order_status" field.

func (*OrderStatusCodeMutation) ResetUpdatedAt

func (m *OrderStatusCodeMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*OrderStatusCodeMutation) SetCreatedAt

func (m *OrderStatusCodeMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*OrderStatusCodeMutation) SetField

func (m *OrderStatusCodeMutation) 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 (*OrderStatusCodeMutation) SetID

func (m *OrderStatusCodeMutation) SetID(id int)

SetID sets the value of the id field. Note that this operation is only accepted on creation of OrderStatusCode entities.

func (*OrderStatusCodeMutation) SetOp

func (m *OrderStatusCodeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*OrderStatusCodeMutation) SetOrderStatus

func (m *OrderStatusCodeMutation) SetOrderStatus(s string)

SetOrderStatus sets the "order_status" field.

func (*OrderStatusCodeMutation) SetUpdatedAt

func (m *OrderStatusCodeMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (OrderStatusCodeMutation) Tx

func (m OrderStatusCodeMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*OrderStatusCodeMutation) Type

func (m *OrderStatusCodeMutation) Type() string

Type returns the node type of this mutation (OrderStatusCode).

func (*OrderStatusCodeMutation) UpdatedAt

func (m *OrderStatusCodeMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*OrderStatusCodeMutation) Where

Where appends a list predicates to the OrderStatusCodeMutation builder.

func (*OrderStatusCodeMutation) WhereP

func (m *OrderStatusCodeMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the OrderStatusCodeMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type OrderStatusCodeQuery

type OrderStatusCodeQuery struct {
	// contains filtered or unexported fields
}

OrderStatusCodeQuery is the builder for querying OrderStatusCode entities.

func (*OrderStatusCodeQuery) Aggregate

func (oscq *OrderStatusCodeQuery) Aggregate(fns ...AggregateFunc) *OrderStatusCodeSelect

Aggregate returns a OrderStatusCodeSelect configured with the given aggregations.

func (*OrderStatusCodeQuery) All

All executes the query and returns a list of OrderStatusCodes.

func (*OrderStatusCodeQuery) AllX

AllX is like All, but panics if an error occurs.

func (*OrderStatusCodeQuery) Clone

Clone returns a duplicate of the OrderStatusCodeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*OrderStatusCodeQuery) Count

func (oscq *OrderStatusCodeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*OrderStatusCodeQuery) CountX

func (oscq *OrderStatusCodeQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*OrderStatusCodeQuery) Exist

func (oscq *OrderStatusCodeQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*OrderStatusCodeQuery) ExistX

func (oscq *OrderStatusCodeQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*OrderStatusCodeQuery) First

First returns the first OrderStatusCode entity from the query. Returns a *NotFoundError when no OrderStatusCode was found.

func (*OrderStatusCodeQuery) FirstID

func (oscq *OrderStatusCodeQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first OrderStatusCode ID from the query. Returns a *NotFoundError when no OrderStatusCode ID was found.

func (*OrderStatusCodeQuery) FirstIDX

func (oscq *OrderStatusCodeQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*OrderStatusCodeQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*OrderStatusCodeQuery) GroupBy

func (oscq *OrderStatusCodeQuery) GroupBy(field string, fields ...string) *OrderStatusCodeGroupBy

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.OrderStatusCode.Query().
	GroupBy(orderstatuscode.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*OrderStatusCodeQuery) IDs

func (oscq *OrderStatusCodeQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of OrderStatusCode IDs.

func (*OrderStatusCodeQuery) IDsX

func (oscq *OrderStatusCodeQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*OrderStatusCodeQuery) Limit

func (oscq *OrderStatusCodeQuery) Limit(limit int) *OrderStatusCodeQuery

Limit the number of records to be returned by this query.

func (*OrderStatusCodeQuery) Offset

func (oscq *OrderStatusCodeQuery) Offset(offset int) *OrderStatusCodeQuery

Offset to start from.

func (*OrderStatusCodeQuery) Only

Only returns a single OrderStatusCode entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one OrderStatusCode entity is found. Returns a *NotFoundError when no OrderStatusCode entities are found.

func (*OrderStatusCodeQuery) OnlyID

func (oscq *OrderStatusCodeQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only OrderStatusCode ID in the query. Returns a *NotSingularError when more than one OrderStatusCode ID is found. Returns a *NotFoundError when no entities are found.

func (*OrderStatusCodeQuery) OnlyIDX

func (oscq *OrderStatusCodeQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*OrderStatusCodeQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*OrderStatusCodeQuery) Order

Order specifies how the records should be ordered.

func (*OrderStatusCodeQuery) Select

func (oscq *OrderStatusCodeQuery) Select(fields ...string) *OrderStatusCodeSelect

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.OrderStatusCode.Query().
	Select(orderstatuscode.FieldCreatedAt).
	Scan(ctx, &v)

func (*OrderStatusCodeQuery) Unique

func (oscq *OrderStatusCodeQuery) Unique(unique bool) *OrderStatusCodeQuery

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 (*OrderStatusCodeQuery) Where

Where adds a new predicate for the OrderStatusCodeQuery builder.

type OrderStatusCodeSelect

type OrderStatusCodeSelect struct {
	*OrderStatusCodeQuery
	// contains filtered or unexported fields
}

OrderStatusCodeSelect is the builder for selecting fields of OrderStatusCode entities.

func (*OrderStatusCodeSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*OrderStatusCodeSelect) Bool

func (s *OrderStatusCodeSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeSelect) BoolX

func (s *OrderStatusCodeSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OrderStatusCodeSelect) Bools

func (s *OrderStatusCodeSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeSelect) BoolsX

func (s *OrderStatusCodeSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OrderStatusCodeSelect) Float64

func (s *OrderStatusCodeSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeSelect) Float64X

func (s *OrderStatusCodeSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OrderStatusCodeSelect) Float64s

func (s *OrderStatusCodeSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeSelect) Float64sX

func (s *OrderStatusCodeSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OrderStatusCodeSelect) Int

func (s *OrderStatusCodeSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeSelect) IntX

func (s *OrderStatusCodeSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OrderStatusCodeSelect) Ints

func (s *OrderStatusCodeSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeSelect) IntsX

func (s *OrderStatusCodeSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*OrderStatusCodeSelect) Scan

func (oscs *OrderStatusCodeSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*OrderStatusCodeSelect) ScanX

func (s *OrderStatusCodeSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OrderStatusCodeSelect) String

func (s *OrderStatusCodeSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeSelect) StringX

func (s *OrderStatusCodeSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OrderStatusCodeSelect) Strings

func (s *OrderStatusCodeSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeSelect) StringsX

func (s *OrderStatusCodeSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type OrderStatusCodeUpdate

type OrderStatusCodeUpdate struct {
	// contains filtered or unexported fields
}

OrderStatusCodeUpdate is the builder for updating OrderStatusCode entities.

func (*OrderStatusCodeUpdate) Exec

func (oscu *OrderStatusCodeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*OrderStatusCodeUpdate) ExecX

func (oscu *OrderStatusCodeUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderStatusCodeUpdate) Mutation

Mutation returns the OrderStatusCodeMutation object of the builder.

func (*OrderStatusCodeUpdate) Save

func (oscu *OrderStatusCodeUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*OrderStatusCodeUpdate) SaveX

func (oscu *OrderStatusCodeUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*OrderStatusCodeUpdate) SetNillableOrderStatus

func (oscu *OrderStatusCodeUpdate) SetNillableOrderStatus(s *string) *OrderStatusCodeUpdate

SetNillableOrderStatus sets the "order_status" field if the given value is not nil.

func (*OrderStatusCodeUpdate) SetOrderStatus

func (oscu *OrderStatusCodeUpdate) SetOrderStatus(s string) *OrderStatusCodeUpdate

SetOrderStatus sets the "order_status" field.

func (*OrderStatusCodeUpdate) SetUpdatedAt

func (oscu *OrderStatusCodeUpdate) SetUpdatedAt(t time.Time) *OrderStatusCodeUpdate

SetUpdatedAt sets the "updated_at" field.

func (*OrderStatusCodeUpdate) Where

Where appends a list predicates to the OrderStatusCodeUpdate builder.

type OrderStatusCodeUpdateOne

type OrderStatusCodeUpdateOne struct {
	// contains filtered or unexported fields
}

OrderStatusCodeUpdateOne is the builder for updating a single OrderStatusCode entity.

func (*OrderStatusCodeUpdateOne) Exec

func (oscuo *OrderStatusCodeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*OrderStatusCodeUpdateOne) ExecX

func (oscuo *OrderStatusCodeUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderStatusCodeUpdateOne) Mutation

Mutation returns the OrderStatusCodeMutation object of the builder.

func (*OrderStatusCodeUpdateOne) Save

Save executes the query and returns the updated OrderStatusCode entity.

func (*OrderStatusCodeUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*OrderStatusCodeUpdateOne) Select

func (oscuo *OrderStatusCodeUpdateOne) Select(field string, fields ...string) *OrderStatusCodeUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*OrderStatusCodeUpdateOne) SetNillableOrderStatus

func (oscuo *OrderStatusCodeUpdateOne) SetNillableOrderStatus(s *string) *OrderStatusCodeUpdateOne

SetNillableOrderStatus sets the "order_status" field if the given value is not nil.

func (*OrderStatusCodeUpdateOne) SetOrderStatus

func (oscuo *OrderStatusCodeUpdateOne) SetOrderStatus(s string) *OrderStatusCodeUpdateOne

SetOrderStatus sets the "order_status" field.

func (*OrderStatusCodeUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*OrderStatusCodeUpdateOne) Where

Where appends a list predicates to the OrderStatusCodeUpdate builder.

type OrderStatusCodes

type OrderStatusCodes []*OrderStatusCode

OrderStatusCodes is a parsable slice of OrderStatusCode.

type OrderUpdate

type OrderUpdate struct {
	// contains filtered or unexported fields
}

OrderUpdate is the builder for updating Order entities.

func (*OrderUpdate) AddPriority

func (ou *OrderUpdate) AddPriority(i int) *OrderUpdate

AddPriority adds i to the "priority" field.

func (*OrderUpdate) ClearInternalNote

func (ou *OrderUpdate) ClearInternalNote() *OrderUpdate

ClearInternalNote clears the value of the "internal_note" field.

func (*OrderUpdate) ClearNote

func (ou *OrderUpdate) ClearNote() *OrderUpdate

ClearNote clears the value of the "note" field.

func (*OrderUpdate) ClearOrderAddress

func (ou *OrderUpdate) ClearOrderAddress() *OrderUpdate

ClearOrderAddress clears the "order_address" edge to the Address entity.

func (*OrderUpdate) ClearOrderStatus

func (ou *OrderUpdate) ClearOrderStatus() *OrderUpdate

ClearOrderStatus clears the "order_status" edge to the OrderStatusCode entity.

func (*OrderUpdate) ClearStaff

func (ou *OrderUpdate) ClearStaff() *OrderUpdate

ClearStaff clears the "staff" edge to the Person entity.

func (*OrderUpdate) ClearStaffID

func (ou *OrderUpdate) ClearStaffID() *OrderUpdate

ClearStaffID clears the value of the "staff_id" field.

func (*OrderUpdate) Exec

func (ou *OrderUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*OrderUpdate) ExecX

func (ou *OrderUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderUpdate) Mutation

func (ou *OrderUpdate) Mutation() *OrderMutation

Mutation returns the OrderMutation object of the builder.

func (*OrderUpdate) Save

func (ou *OrderUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*OrderUpdate) SaveX

func (ou *OrderUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*OrderUpdate) SetAddressID

func (ou *OrderUpdate) SetAddressID(u uuid.UUID) *OrderUpdate

SetAddressID sets the "address_id" field.

func (*OrderUpdate) SetInternalNote

func (ou *OrderUpdate) SetInternalNote(s string) *OrderUpdate

SetInternalNote sets the "internal_note" field.

func (*OrderUpdate) SetNillableAddressID

func (ou *OrderUpdate) SetNillableAddressID(u *uuid.UUID) *OrderUpdate

SetNillableAddressID sets the "address_id" field if the given value is not nil.

func (*OrderUpdate) SetNillableInternalNote

func (ou *OrderUpdate) SetNillableInternalNote(s *string) *OrderUpdate

SetNillableInternalNote sets the "internal_note" field if the given value is not nil.

func (*OrderUpdate) SetNillableNote

func (ou *OrderUpdate) SetNillableNote(s *string) *OrderUpdate

SetNillableNote sets the "note" field if the given value is not nil.

func (*OrderUpdate) SetNillablePriority

func (ou *OrderUpdate) SetNillablePriority(i *int) *OrderUpdate

SetNillablePriority sets the "priority" field if the given value is not nil.

func (*OrderUpdate) SetNillableStaffID

func (ou *OrderUpdate) SetNillableStaffID(u *uuid.UUID) *OrderUpdate

SetNillableStaffID sets the "staff_id" field if the given value is not nil.

func (*OrderUpdate) SetNillableStatusCode

func (ou *OrderUpdate) SetNillableStatusCode(i *int) *OrderUpdate

SetNillableStatusCode sets the "status_code" field if the given value is not nil.

func (*OrderUpdate) SetNote

func (ou *OrderUpdate) SetNote(s string) *OrderUpdate

SetNote sets the "note" field.

func (*OrderUpdate) SetOrderAddress

func (ou *OrderUpdate) SetOrderAddress(a *Address) *OrderUpdate

SetOrderAddress sets the "order_address" edge to the Address entity.

func (*OrderUpdate) SetOrderAddressID

func (ou *OrderUpdate) SetOrderAddressID(id uuid.UUID) *OrderUpdate

SetOrderAddressID sets the "order_address" edge to the Address entity by ID.

func (*OrderUpdate) SetOrderStatus

func (ou *OrderUpdate) SetOrderStatus(o *OrderStatusCode) *OrderUpdate

SetOrderStatus sets the "order_status" edge to the OrderStatusCode entity.

func (*OrderUpdate) SetOrderStatusID

func (ou *OrderUpdate) SetOrderStatusID(id int) *OrderUpdate

SetOrderStatusID sets the "order_status" edge to the OrderStatusCode entity by ID.

func (*OrderUpdate) SetPriority

func (ou *OrderUpdate) SetPriority(i int) *OrderUpdate

SetPriority sets the "priority" field.

func (*OrderUpdate) SetStaff

func (ou *OrderUpdate) SetStaff(p *Person) *OrderUpdate

SetStaff sets the "staff" edge to the Person entity.

func (*OrderUpdate) SetStaffID

func (ou *OrderUpdate) SetStaffID(u uuid.UUID) *OrderUpdate

SetStaffID sets the "staff_id" field.

func (*OrderUpdate) SetStatusCode

func (ou *OrderUpdate) SetStatusCode(i int) *OrderUpdate

SetStatusCode sets the "status_code" field.

func (*OrderUpdate) SetUpdatedAt

func (ou *OrderUpdate) SetUpdatedAt(t time.Time) *OrderUpdate

SetUpdatedAt sets the "updated_at" field.

func (*OrderUpdate) Where

func (ou *OrderUpdate) Where(ps ...predicate.Order) *OrderUpdate

Where appends a list predicates to the OrderUpdate builder.

type OrderUpdateOne

type OrderUpdateOne struct {
	// contains filtered or unexported fields
}

OrderUpdateOne is the builder for updating a single Order entity.

func (*OrderUpdateOne) AddPriority

func (ouo *OrderUpdateOne) AddPriority(i int) *OrderUpdateOne

AddPriority adds i to the "priority" field.

func (*OrderUpdateOne) ClearInternalNote

func (ouo *OrderUpdateOne) ClearInternalNote() *OrderUpdateOne

ClearInternalNote clears the value of the "internal_note" field.

func (*OrderUpdateOne) ClearNote

func (ouo *OrderUpdateOne) ClearNote() *OrderUpdateOne

ClearNote clears the value of the "note" field.

func (*OrderUpdateOne) ClearOrderAddress

func (ouo *OrderUpdateOne) ClearOrderAddress() *OrderUpdateOne

ClearOrderAddress clears the "order_address" edge to the Address entity.

func (*OrderUpdateOne) ClearOrderStatus

func (ouo *OrderUpdateOne) ClearOrderStatus() *OrderUpdateOne

ClearOrderStatus clears the "order_status" edge to the OrderStatusCode entity.

func (*OrderUpdateOne) ClearStaff

func (ouo *OrderUpdateOne) ClearStaff() *OrderUpdateOne

ClearStaff clears the "staff" edge to the Person entity.

func (*OrderUpdateOne) ClearStaffID

func (ouo *OrderUpdateOne) ClearStaffID() *OrderUpdateOne

ClearStaffID clears the value of the "staff_id" field.

func (*OrderUpdateOne) Exec

func (ouo *OrderUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*OrderUpdateOne) ExecX

func (ouo *OrderUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderUpdateOne) Mutation

func (ouo *OrderUpdateOne) Mutation() *OrderMutation

Mutation returns the OrderMutation object of the builder.

func (*OrderUpdateOne) Save

func (ouo *OrderUpdateOne) Save(ctx context.Context) (*Order, error)

Save executes the query and returns the updated Order entity.

func (*OrderUpdateOne) SaveX

func (ouo *OrderUpdateOne) SaveX(ctx context.Context) *Order

SaveX is like Save, but panics if an error occurs.

func (*OrderUpdateOne) Select

func (ouo *OrderUpdateOne) Select(field string, fields ...string) *OrderUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*OrderUpdateOne) SetAddressID

func (ouo *OrderUpdateOne) SetAddressID(u uuid.UUID) *OrderUpdateOne

SetAddressID sets the "address_id" field.

func (*OrderUpdateOne) SetInternalNote

func (ouo *OrderUpdateOne) SetInternalNote(s string) *OrderUpdateOne

SetInternalNote sets the "internal_note" field.

func (*OrderUpdateOne) SetNillableAddressID

func (ouo *OrderUpdateOne) SetNillableAddressID(u *uuid.UUID) *OrderUpdateOne

SetNillableAddressID sets the "address_id" field if the given value is not nil.

func (*OrderUpdateOne) SetNillableInternalNote

func (ouo *OrderUpdateOne) SetNillableInternalNote(s *string) *OrderUpdateOne

SetNillableInternalNote sets the "internal_note" field if the given value is not nil.

func (*OrderUpdateOne) SetNillableNote

func (ouo *OrderUpdateOne) SetNillableNote(s *string) *OrderUpdateOne

SetNillableNote sets the "note" field if the given value is not nil.

func (*OrderUpdateOne) SetNillablePriority

func (ouo *OrderUpdateOne) SetNillablePriority(i *int) *OrderUpdateOne

SetNillablePriority sets the "priority" field if the given value is not nil.

func (*OrderUpdateOne) SetNillableStaffID

func (ouo *OrderUpdateOne) SetNillableStaffID(u *uuid.UUID) *OrderUpdateOne

SetNillableStaffID sets the "staff_id" field if the given value is not nil.

func (*OrderUpdateOne) SetNillableStatusCode

func (ouo *OrderUpdateOne) SetNillableStatusCode(i *int) *OrderUpdateOne

SetNillableStatusCode sets the "status_code" field if the given value is not nil.

func (*OrderUpdateOne) SetNote

func (ouo *OrderUpdateOne) SetNote(s string) *OrderUpdateOne

SetNote sets the "note" field.

func (*OrderUpdateOne) SetOrderAddress

func (ouo *OrderUpdateOne) SetOrderAddress(a *Address) *OrderUpdateOne

SetOrderAddress sets the "order_address" edge to the Address entity.

func (*OrderUpdateOne) SetOrderAddressID

func (ouo *OrderUpdateOne) SetOrderAddressID(id uuid.UUID) *OrderUpdateOne

SetOrderAddressID sets the "order_address" edge to the Address entity by ID.

func (*OrderUpdateOne) SetOrderStatus

func (ouo *OrderUpdateOne) SetOrderStatus(o *OrderStatusCode) *OrderUpdateOne

SetOrderStatus sets the "order_status" edge to the OrderStatusCode entity.

func (*OrderUpdateOne) SetOrderStatusID

func (ouo *OrderUpdateOne) SetOrderStatusID(id int) *OrderUpdateOne

SetOrderStatusID sets the "order_status" edge to the OrderStatusCode entity by ID.

func (*OrderUpdateOne) SetPriority

func (ouo *OrderUpdateOne) SetPriority(i int) *OrderUpdateOne

SetPriority sets the "priority" field.

func (*OrderUpdateOne) SetStaff

func (ouo *OrderUpdateOne) SetStaff(p *Person) *OrderUpdateOne

SetStaff sets the "staff" edge to the Person entity.

func (*OrderUpdateOne) SetStaffID

func (ouo *OrderUpdateOne) SetStaffID(u uuid.UUID) *OrderUpdateOne

SetStaffID sets the "staff_id" field.

func (*OrderUpdateOne) SetStatusCode

func (ouo *OrderUpdateOne) SetStatusCode(i int) *OrderUpdateOne

SetStatusCode sets the "status_code" field.

func (*OrderUpdateOne) SetUpdatedAt

func (ouo *OrderUpdateOne) SetUpdatedAt(t time.Time) *OrderUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*OrderUpdateOne) Where

func (ouo *OrderUpdateOne) Where(ps ...predicate.Order) *OrderUpdateOne

Where appends a list predicates to the OrderUpdate builder.

type Orders

type Orders []*Order

Orders is a parsable slice of Order.

type Person

type Person struct {

	// ID of the ent.
	ID uuid.UUID `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"`
	// AvatarURL holds the value of the "avatar_url" field.
	AvatarURL *string `json:"avatar_url,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Phone holds the value of the "phone" field.
	Phone *string `json:"phone,omitempty"`
	// Role holds the value of the "role" field.
	Role *person.Role `json:"role,omitempty"`
	// PasswordHash holds the value of the "password_hash" field.
	PasswordHash *[]byte `json:"-"`
	// IsEmailVerified holds the value of the "is_email_verified" field.
	IsEmailVerified *bool `json:"is_email_verified,omitempty"`
	// IsPhoneVerified holds the value of the "is_phone_verified" field.
	IsPhoneVerified *bool `json:"is_phone_verified,omitempty"`
	// WorkUnitID holds the value of the "work_unit_id" field.
	WorkUnitID *uuid.UUID `json:"work_unit_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PersonQuery when eager-loading is set.
	Edges PersonEdges `json:"edges"`
	// contains filtered or unexported fields
}

Person is the model entity for the Person schema.

func (*Person) QueryAddresses

func (pe *Person) QueryAddresses() *AddressQuery

QueryAddresses queries the "addresses" edge of the Person entity.

func (*Person) QueryPersonAddresses

func (pe *Person) QueryPersonAddresses() *PersonAddressQuery

QueryPersonAddresses queries the "person_addresses" edge of the Person entity.

func (*Person) QueryWorkUnit

func (pe *Person) QueryWorkUnit() *WorkUnitInfoQuery

QueryWorkUnit queries the "work_unit" edge of the Person entity.

func (*Person) String

func (pe *Person) String() string

String implements the fmt.Stringer.

func (*Person) Unwrap

func (pe *Person) Unwrap() *Person

Unwrap unwraps the Person 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 (*Person) Update

func (pe *Person) Update() *PersonUpdateOne

Update returns a builder for updating this Person. Note that you need to call Person.Unwrap() before calling this method if this Person was returned from a transaction, and the transaction was committed or rolled back.

func (*Person) Value

func (pe *Person) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Person. This includes values selected through modifiers, order, etc.

type PersonAddress

type PersonAddress struct {

	// 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"`
	// PersonID holds the value of the "person_id" field.
	PersonID uuid.UUID `json:"person_id,omitempty"`
	// AddressID holds the value of the "address_id" field.
	AddressID uuid.UUID `json:"address_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PersonAddressQuery when eager-loading is set.
	Edges PersonAddressEdges `json:"edges"`
	// contains filtered or unexported fields
}

PersonAddress is the model entity for the PersonAddress schema.

func (*PersonAddress) QueryAddresses

func (pa *PersonAddress) QueryAddresses() *AddressQuery

QueryAddresses queries the "addresses" edge of the PersonAddress entity.

func (*PersonAddress) QueryPersons

func (pa *PersonAddress) QueryPersons() *PersonQuery

QueryPersons queries the "persons" edge of the PersonAddress entity.

func (*PersonAddress) String

func (pa *PersonAddress) String() string

String implements the fmt.Stringer.

func (*PersonAddress) Unwrap

func (pa *PersonAddress) Unwrap() *PersonAddress

Unwrap unwraps the PersonAddress 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 (*PersonAddress) Update

func (pa *PersonAddress) Update() *PersonAddressUpdateOne

Update returns a builder for updating this PersonAddress. Note that you need to call PersonAddress.Unwrap() before calling this method if this PersonAddress was returned from a transaction, and the transaction was committed or rolled back.

func (*PersonAddress) Value

func (pa *PersonAddress) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the PersonAddress. This includes values selected through modifiers, order, etc.

type PersonAddressClient

type PersonAddressClient struct {
	// contains filtered or unexported fields
}

PersonAddressClient is a client for the PersonAddress schema.

func NewPersonAddressClient

func NewPersonAddressClient(c config) *PersonAddressClient

NewPersonAddressClient returns a client for the PersonAddress from the given config.

func (*PersonAddressClient) Create

Create returns a builder for creating a PersonAddress entity.

func (*PersonAddressClient) CreateBulk

CreateBulk returns a builder for creating a bulk of PersonAddress entities.

func (*PersonAddressClient) Delete

Delete returns a delete builder for PersonAddress.

func (*PersonAddressClient) Hooks

func (c *PersonAddressClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PersonAddressClient) Intercept

func (c *PersonAddressClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `personaddress.Intercept(f(g(h())))`.

func (*PersonAddressClient) Interceptors

func (c *PersonAddressClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PersonAddressClient) MapCreateBulk

func (c *PersonAddressClient) MapCreateBulk(slice any, setFunc func(*PersonAddressCreate, int)) *PersonAddressCreateBulk

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 (*PersonAddressClient) Query

Query returns a query builder for PersonAddress.

func (*PersonAddressClient) QueryAddresses

func (c *PersonAddressClient) QueryAddresses(pa *PersonAddress) *AddressQuery

QueryAddresses queries the addresses edge of a PersonAddress.

func (*PersonAddressClient) QueryPersons

func (c *PersonAddressClient) QueryPersons(pa *PersonAddress) *PersonQuery

QueryPersons queries the persons edge of a PersonAddress.

func (*PersonAddressClient) Update

Update returns an update builder for PersonAddress.

func (*PersonAddressClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*PersonAddressClient) Use

func (c *PersonAddressClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `personaddress.Hooks(f(g(h())))`.

type PersonAddressCreate

type PersonAddressCreate struct {
	// contains filtered or unexported fields
}

PersonAddressCreate is the builder for creating a PersonAddress entity.

func (*PersonAddressCreate) Exec

func (pac *PersonAddressCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PersonAddressCreate) ExecX

func (pac *PersonAddressCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PersonAddressCreate) Mutation

func (pac *PersonAddressCreate) Mutation() *PersonAddressMutation

Mutation returns the PersonAddressMutation object of the builder.

func (*PersonAddressCreate) Save

Save creates the PersonAddress in the database.

func (*PersonAddressCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*PersonAddressCreate) SetAddressID

func (pac *PersonAddressCreate) SetAddressID(u uuid.UUID) *PersonAddressCreate

SetAddressID sets the "address_id" field.

func (*PersonAddressCreate) SetAddresses

func (pac *PersonAddressCreate) SetAddresses(a *Address) *PersonAddressCreate

SetAddresses sets the "addresses" edge to the Address entity.

func (*PersonAddressCreate) SetAddressesID

func (pac *PersonAddressCreate) SetAddressesID(id uuid.UUID) *PersonAddressCreate

SetAddressesID sets the "addresses" edge to the Address entity by ID.

func (*PersonAddressCreate) SetCreatedAt

func (pac *PersonAddressCreate) SetCreatedAt(t time.Time) *PersonAddressCreate

SetCreatedAt sets the "created_at" field.

func (*PersonAddressCreate) SetNillableCreatedAt

func (pac *PersonAddressCreate) SetNillableCreatedAt(t *time.Time) *PersonAddressCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*PersonAddressCreate) SetNillableUpdatedAt

func (pac *PersonAddressCreate) SetNillableUpdatedAt(t *time.Time) *PersonAddressCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*PersonAddressCreate) SetPersonID

func (pac *PersonAddressCreate) SetPersonID(u uuid.UUID) *PersonAddressCreate

SetPersonID sets the "person_id" field.

func (*PersonAddressCreate) SetPersons

func (pac *PersonAddressCreate) SetPersons(p *Person) *PersonAddressCreate

SetPersons sets the "persons" edge to the Person entity.

func (*PersonAddressCreate) SetPersonsID

func (pac *PersonAddressCreate) SetPersonsID(id uuid.UUID) *PersonAddressCreate

SetPersonsID sets the "persons" edge to the Person entity by ID.

func (*PersonAddressCreate) SetUpdatedAt

func (pac *PersonAddressCreate) SetUpdatedAt(t time.Time) *PersonAddressCreate

SetUpdatedAt sets the "updated_at" field.

type PersonAddressCreateBulk

type PersonAddressCreateBulk struct {
	// contains filtered or unexported fields
}

PersonAddressCreateBulk is the builder for creating many PersonAddress entities in bulk.

func (*PersonAddressCreateBulk) Exec

func (pacb *PersonAddressCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PersonAddressCreateBulk) ExecX

func (pacb *PersonAddressCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PersonAddressCreateBulk) Save

Save creates the PersonAddress entities in the database.

func (*PersonAddressCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type PersonAddressDelete

type PersonAddressDelete struct {
	// contains filtered or unexported fields
}

PersonAddressDelete is the builder for deleting a PersonAddress entity.

func (*PersonAddressDelete) Exec

func (pad *PersonAddressDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PersonAddressDelete) ExecX

func (pad *PersonAddressDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PersonAddressDelete) Where

Where appends a list predicates to the PersonAddressDelete builder.

type PersonAddressDeleteOne

type PersonAddressDeleteOne struct {
	// contains filtered or unexported fields
}

PersonAddressDeleteOne is the builder for deleting a single PersonAddress entity.

func (*PersonAddressDeleteOne) Exec

func (pado *PersonAddressDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PersonAddressDeleteOne) ExecX

func (pado *PersonAddressDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PersonAddressDeleteOne) Where

Where appends a list predicates to the PersonAddressDelete builder.

type PersonAddressEdges

type PersonAddressEdges struct {
	// Persons holds the value of the persons edge.
	Persons *Person `json:"persons,omitempty"`
	// Addresses holds the value of the addresses edge.
	Addresses *Address `json:"addresses,omitempty"`
	// contains filtered or unexported fields
}

PersonAddressEdges holds the relations/edges for other nodes in the graph.

func (PersonAddressEdges) AddressesOrErr

func (e PersonAddressEdges) AddressesOrErr() (*Address, error)

AddressesOrErr returns the Addresses value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (PersonAddressEdges) PersonsOrErr

func (e PersonAddressEdges) PersonsOrErr() (*Person, error)

PersonsOrErr returns the Persons value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type PersonAddressGroupBy

type PersonAddressGroupBy struct {
	// contains filtered or unexported fields
}

PersonAddressGroupBy is the group-by builder for PersonAddress entities.

func (*PersonAddressGroupBy) Aggregate

func (pagb *PersonAddressGroupBy) Aggregate(fns ...AggregateFunc) *PersonAddressGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*PersonAddressGroupBy) Bool

func (s *PersonAddressGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PersonAddressGroupBy) BoolX

func (s *PersonAddressGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PersonAddressGroupBy) Bools

func (s *PersonAddressGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PersonAddressGroupBy) BoolsX

func (s *PersonAddressGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PersonAddressGroupBy) Float64

func (s *PersonAddressGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PersonAddressGroupBy) Float64X

func (s *PersonAddressGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PersonAddressGroupBy) Float64s

func (s *PersonAddressGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PersonAddressGroupBy) Float64sX

func (s *PersonAddressGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PersonAddressGroupBy) Int

func (s *PersonAddressGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PersonAddressGroupBy) IntX

func (s *PersonAddressGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PersonAddressGroupBy) Ints

func (s *PersonAddressGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PersonAddressGroupBy) IntsX

func (s *PersonAddressGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PersonAddressGroupBy) Scan

func (pagb *PersonAddressGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PersonAddressGroupBy) ScanX

func (s *PersonAddressGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PersonAddressGroupBy) String

func (s *PersonAddressGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PersonAddressGroupBy) StringX

func (s *PersonAddressGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PersonAddressGroupBy) Strings

func (s *PersonAddressGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PersonAddressGroupBy) StringsX

func (s *PersonAddressGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PersonAddressMutation

type PersonAddressMutation struct {
	// contains filtered or unexported fields
}

PersonAddressMutation represents an operation that mutates the PersonAddress nodes in the graph.

func (*PersonAddressMutation) AddField

func (m *PersonAddressMutation) 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 (*PersonAddressMutation) AddedEdges

func (m *PersonAddressMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PersonAddressMutation) AddedField

func (m *PersonAddressMutation) 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 (*PersonAddressMutation) AddedFields

func (m *PersonAddressMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PersonAddressMutation) AddedIDs

func (m *PersonAddressMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PersonAddressMutation) AddressID

func (m *PersonAddressMutation) AddressID() (r uuid.UUID, exists bool)

AddressID returns the value of the "address_id" field in the mutation.

func (*PersonAddressMutation) AddressesCleared

func (m *PersonAddressMutation) AddressesCleared() bool

AddressesCleared reports if the "addresses" edge to the Address entity was cleared.

func (*PersonAddressMutation) AddressesID

func (m *PersonAddressMutation) AddressesID() (id uuid.UUID, exists bool)

AddressesID returns the "addresses" edge ID in the mutation.

func (*PersonAddressMutation) AddressesIDs

func (m *PersonAddressMutation) AddressesIDs() (ids []uuid.UUID)

AddressesIDs returns the "addresses" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use AddressesID instead. It exists only for internal usage by the builders.

func (*PersonAddressMutation) ClearAddresses

func (m *PersonAddressMutation) ClearAddresses()

ClearAddresses clears the "addresses" edge to the Address entity.

func (*PersonAddressMutation) ClearEdge

func (m *PersonAddressMutation) 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 (*PersonAddressMutation) ClearField

func (m *PersonAddressMutation) 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 (*PersonAddressMutation) ClearPersons

func (m *PersonAddressMutation) ClearPersons()

ClearPersons clears the "persons" edge to the Person entity.

func (*PersonAddressMutation) ClearedEdges

func (m *PersonAddressMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PersonAddressMutation) ClearedFields

func (m *PersonAddressMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PersonAddressMutation) Client

func (m PersonAddressMutation) 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 (*PersonAddressMutation) CreatedAt

func (m *PersonAddressMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*PersonAddressMutation) EdgeCleared

func (m *PersonAddressMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PersonAddressMutation) Field

func (m *PersonAddressMutation) 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 (*PersonAddressMutation) FieldCleared

func (m *PersonAddressMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PersonAddressMutation) Fields

func (m *PersonAddressMutation) 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 (*PersonAddressMutation) OldField

func (m *PersonAddressMutation) 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 (*PersonAddressMutation) Op

func (m *PersonAddressMutation) Op() Op

Op returns the operation name.

func (*PersonAddressMutation) PersonID

func (m *PersonAddressMutation) PersonID() (r uuid.UUID, exists bool)

PersonID returns the value of the "person_id" field in the mutation.

func (*PersonAddressMutation) PersonsCleared

func (m *PersonAddressMutation) PersonsCleared() bool

PersonsCleared reports if the "persons" edge to the Person entity was cleared.

func (*PersonAddressMutation) PersonsID

func (m *PersonAddressMutation) PersonsID() (id uuid.UUID, exists bool)

PersonsID returns the "persons" edge ID in the mutation.

func (*PersonAddressMutation) PersonsIDs

func (m *PersonAddressMutation) PersonsIDs() (ids []uuid.UUID)

PersonsIDs returns the "persons" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use PersonsID instead. It exists only for internal usage by the builders.

func (*PersonAddressMutation) RemovedEdges

func (m *PersonAddressMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PersonAddressMutation) RemovedIDs

func (m *PersonAddressMutation) 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 (*PersonAddressMutation) ResetAddressID

func (m *PersonAddressMutation) ResetAddressID()

ResetAddressID resets all changes to the "address_id" field.

func (*PersonAddressMutation) ResetAddresses

func (m *PersonAddressMutation) ResetAddresses()

ResetAddresses resets all changes to the "addresses" edge.

func (*PersonAddressMutation) ResetCreatedAt

func (m *PersonAddressMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*PersonAddressMutation) ResetEdge

func (m *PersonAddressMutation) 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 (*PersonAddressMutation) ResetField

func (m *PersonAddressMutation) 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 (*PersonAddressMutation) ResetPersonID

func (m *PersonAddressMutation) ResetPersonID()

ResetPersonID resets all changes to the "person_id" field.

func (*PersonAddressMutation) ResetPersons

func (m *PersonAddressMutation) ResetPersons()

ResetPersons resets all changes to the "persons" edge.

func (*PersonAddressMutation) ResetUpdatedAt

func (m *PersonAddressMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*PersonAddressMutation) SetAddressID

func (m *PersonAddressMutation) SetAddressID(u uuid.UUID)

SetAddressID sets the "address_id" field.

func (*PersonAddressMutation) SetAddressesID

func (m *PersonAddressMutation) SetAddressesID(id uuid.UUID)

SetAddressesID sets the "addresses" edge to the Address entity by id.

func (*PersonAddressMutation) SetCreatedAt

func (m *PersonAddressMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*PersonAddressMutation) SetField

func (m *PersonAddressMutation) 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 (*PersonAddressMutation) SetOp

func (m *PersonAddressMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PersonAddressMutation) SetPersonID

func (m *PersonAddressMutation) SetPersonID(u uuid.UUID)

SetPersonID sets the "person_id" field.

func (*PersonAddressMutation) SetPersonsID

func (m *PersonAddressMutation) SetPersonsID(id uuid.UUID)

SetPersonsID sets the "persons" edge to the Person entity by id.

func (*PersonAddressMutation) SetUpdatedAt

func (m *PersonAddressMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (PersonAddressMutation) Tx

func (m PersonAddressMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PersonAddressMutation) Type

func (m *PersonAddressMutation) Type() string

Type returns the node type of this mutation (PersonAddress).

func (*PersonAddressMutation) UpdatedAt

func (m *PersonAddressMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*PersonAddressMutation) Where

Where appends a list predicates to the PersonAddressMutation builder.

func (*PersonAddressMutation) WhereP

func (m *PersonAddressMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PersonAddressMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type PersonAddressQuery

type PersonAddressQuery struct {
	// contains filtered or unexported fields
}

PersonAddressQuery is the builder for querying PersonAddress entities.

func (*PersonAddressQuery) Aggregate

func (paq *PersonAddressQuery) Aggregate(fns ...AggregateFunc) *PersonAddressSelect

Aggregate returns a PersonAddressSelect configured with the given aggregations.

func (*PersonAddressQuery) All

All executes the query and returns a list of PersonAddresses.

func (*PersonAddressQuery) AllX

func (paq *PersonAddressQuery) AllX(ctx context.Context) []*PersonAddress

AllX is like All, but panics if an error occurs.

func (*PersonAddressQuery) Clone

func (paq *PersonAddressQuery) Clone() *PersonAddressQuery

Clone returns a duplicate of the PersonAddressQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PersonAddressQuery) Count

func (paq *PersonAddressQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PersonAddressQuery) CountX

func (paq *PersonAddressQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PersonAddressQuery) Exist

func (paq *PersonAddressQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PersonAddressQuery) ExistX

func (paq *PersonAddressQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PersonAddressQuery) First

First returns the first PersonAddress entity from the query. Returns a *NotFoundError when no PersonAddress was found.

func (*PersonAddressQuery) FirstX

func (paq *PersonAddressQuery) FirstX(ctx context.Context) *PersonAddress

FirstX is like First, but panics if an error occurs.

func (*PersonAddressQuery) GroupBy

func (paq *PersonAddressQuery) GroupBy(field string, fields ...string) *PersonAddressGroupBy

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.PersonAddress.Query().
	GroupBy(personaddress.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PersonAddressQuery) Limit

func (paq *PersonAddressQuery) Limit(limit int) *PersonAddressQuery

Limit the number of records to be returned by this query.

func (*PersonAddressQuery) Offset

func (paq *PersonAddressQuery) Offset(offset int) *PersonAddressQuery

Offset to start from.

func (*PersonAddressQuery) Only

Only returns a single PersonAddress entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one PersonAddress entity is found. Returns a *NotFoundError when no PersonAddress entities are found.

func (*PersonAddressQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*PersonAddressQuery) Order

Order specifies how the records should be ordered.

func (*PersonAddressQuery) QueryAddresses

func (paq *PersonAddressQuery) QueryAddresses() *AddressQuery

QueryAddresses chains the current query on the "addresses" edge.

func (*PersonAddressQuery) QueryPersons

func (paq *PersonAddressQuery) QueryPersons() *PersonQuery

QueryPersons chains the current query on the "persons" edge.

func (*PersonAddressQuery) Select

func (paq *PersonAddressQuery) Select(fields ...string) *PersonAddressSelect

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.PersonAddress.Query().
	Select(personaddress.FieldCreatedAt).
	Scan(ctx, &v)

func (*PersonAddressQuery) Unique

func (paq *PersonAddressQuery) Unique(unique bool) *PersonAddressQuery

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 (*PersonAddressQuery) Where

Where adds a new predicate for the PersonAddressQuery builder.

func (*PersonAddressQuery) WithAddresses

func (paq *PersonAddressQuery) WithAddresses(opts ...func(*AddressQuery)) *PersonAddressQuery

WithAddresses tells the query-builder to eager-load the nodes that are connected to the "addresses" edge. The optional arguments are used to configure the query builder of the edge.

func (*PersonAddressQuery) WithPersons

func (paq *PersonAddressQuery) WithPersons(opts ...func(*PersonQuery)) *PersonAddressQuery

WithPersons tells the query-builder to eager-load the nodes that are connected to the "persons" edge. The optional arguments are used to configure the query builder of the edge.

type PersonAddressSelect

type PersonAddressSelect struct {
	*PersonAddressQuery
	// contains filtered or unexported fields
}

PersonAddressSelect is the builder for selecting fields of PersonAddress entities.

func (*PersonAddressSelect) Aggregate

func (pas *PersonAddressSelect) Aggregate(fns ...AggregateFunc) *PersonAddressSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PersonAddressSelect) Bool

func (s *PersonAddressSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PersonAddressSelect) BoolX

func (s *PersonAddressSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PersonAddressSelect) Bools

func (s *PersonAddressSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PersonAddressSelect) BoolsX

func (s *PersonAddressSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PersonAddressSelect) Float64

func (s *PersonAddressSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PersonAddressSelect) Float64X

func (s *PersonAddressSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PersonAddressSelect) Float64s

func (s *PersonAddressSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PersonAddressSelect) Float64sX

func (s *PersonAddressSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PersonAddressSelect) Int

func (s *PersonAddressSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PersonAddressSelect) IntX

func (s *PersonAddressSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PersonAddressSelect) Ints

func (s *PersonAddressSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PersonAddressSelect) IntsX

func (s *PersonAddressSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PersonAddressSelect) Scan

func (pas *PersonAddressSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PersonAddressSelect) ScanX

func (s *PersonAddressSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PersonAddressSelect) String

func (s *PersonAddressSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PersonAddressSelect) StringX

func (s *PersonAddressSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PersonAddressSelect) Strings

func (s *PersonAddressSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PersonAddressSelect) StringsX

func (s *PersonAddressSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PersonAddressUpdate

type PersonAddressUpdate struct {
	// contains filtered or unexported fields
}

PersonAddressUpdate is the builder for updating PersonAddress entities.

func (*PersonAddressUpdate) Exec

func (pau *PersonAddressUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PersonAddressUpdate) ExecX

func (pau *PersonAddressUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PersonAddressUpdate) Mutation

func (pau *PersonAddressUpdate) Mutation() *PersonAddressMutation

Mutation returns the PersonAddressMutation object of the builder.

func (*PersonAddressUpdate) Save

func (pau *PersonAddressUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PersonAddressUpdate) SaveX

func (pau *PersonAddressUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PersonAddressUpdate) SetUpdatedAt

func (pau *PersonAddressUpdate) SetUpdatedAt(t time.Time) *PersonAddressUpdate

SetUpdatedAt sets the "updated_at" field.

func (*PersonAddressUpdate) Where

Where appends a list predicates to the PersonAddressUpdate builder.

type PersonAddressUpdateOne

type PersonAddressUpdateOne struct {
	// contains filtered or unexported fields
}

PersonAddressUpdateOne is the builder for updating a single PersonAddress entity.

func (*PersonAddressUpdateOne) Exec

func (pauo *PersonAddressUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PersonAddressUpdateOne) ExecX

func (pauo *PersonAddressUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PersonAddressUpdateOne) Mutation

Mutation returns the PersonAddressMutation object of the builder.

func (*PersonAddressUpdateOne) Save

Save executes the query and returns the updated PersonAddress entity.

func (*PersonAddressUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*PersonAddressUpdateOne) Select

func (pauo *PersonAddressUpdateOne) Select(field string, fields ...string) *PersonAddressUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PersonAddressUpdateOne) SetUpdatedAt

func (pauo *PersonAddressUpdateOne) SetUpdatedAt(t time.Time) *PersonAddressUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*PersonAddressUpdateOne) Where

Where appends a list predicates to the PersonAddressUpdate builder.

type PersonAddresses

type PersonAddresses []*PersonAddress

PersonAddresses is a parsable slice of PersonAddress.

type PersonClient

type PersonClient struct {
	// contains filtered or unexported fields
}

PersonClient is a client for the Person schema.

func NewPersonClient

func NewPersonClient(c config) *PersonClient

NewPersonClient returns a client for the Person from the given config.

func (*PersonClient) Create

func (c *PersonClient) Create() *PersonCreate

Create returns a builder for creating a Person entity.

func (*PersonClient) CreateBulk

func (c *PersonClient) CreateBulk(builders ...*PersonCreate) *PersonCreateBulk

CreateBulk returns a builder for creating a bulk of Person entities.

func (*PersonClient) Delete

func (c *PersonClient) Delete() *PersonDelete

Delete returns a delete builder for Person.

func (*PersonClient) DeleteOne

func (c *PersonClient) DeleteOne(pe *Person) *PersonDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PersonClient) DeleteOneID

func (c *PersonClient) DeleteOneID(id uuid.UUID) *PersonDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*PersonClient) Get

func (c *PersonClient) Get(ctx context.Context, id uuid.UUID) (*Person, error)

Get returns a Person entity by its id.

func (*PersonClient) GetX

func (c *PersonClient) GetX(ctx context.Context, id uuid.UUID) *Person

GetX is like Get, but panics if an error occurs.

func (*PersonClient) Hooks

func (c *PersonClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PersonClient) Intercept

func (c *PersonClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `person.Intercept(f(g(h())))`.

func (*PersonClient) Interceptors

func (c *PersonClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PersonClient) MapCreateBulk

func (c *PersonClient) MapCreateBulk(slice any, setFunc func(*PersonCreate, int)) *PersonCreateBulk

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 (*PersonClient) Query

func (c *PersonClient) Query() *PersonQuery

Query returns a query builder for Person.

func (*PersonClient) QueryAddresses

func (c *PersonClient) QueryAddresses(pe *Person) *AddressQuery

QueryAddresses queries the addresses edge of a Person.

func (*PersonClient) QueryPersonAddresses

func (c *PersonClient) QueryPersonAddresses(pe *Person) *PersonAddressQuery

QueryPersonAddresses queries the person_addresses edge of a Person.

func (*PersonClient) QueryWorkUnit

func (c *PersonClient) QueryWorkUnit(pe *Person) *WorkUnitInfoQuery

QueryWorkUnit queries the work_unit edge of a Person.

func (*PersonClient) Update

func (c *PersonClient) Update() *PersonUpdate

Update returns an update builder for Person.

func (*PersonClient) UpdateOne

func (c *PersonClient) UpdateOne(pe *Person) *PersonUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PersonClient) UpdateOneID

func (c *PersonClient) UpdateOneID(id uuid.UUID) *PersonUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PersonClient) Use

func (c *PersonClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `person.Hooks(f(g(h())))`.

type PersonCreate

type PersonCreate struct {
	// contains filtered or unexported fields
}

PersonCreate is the builder for creating a Person entity.

func (*PersonCreate) AddAddressIDs

func (pc *PersonCreate) AddAddressIDs(ids ...uuid.UUID) *PersonCreate

AddAddressIDs adds the "addresses" edge to the Address entity by IDs.

func (*PersonCreate) AddAddresses

func (pc *PersonCreate) AddAddresses(a ...*Address) *PersonCreate

AddAddresses adds the "addresses" edges to the Address entity.

func (*PersonCreate) Exec

func (pc *PersonCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PersonCreate) ExecX

func (pc *PersonCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PersonCreate) Mutation

func (pc *PersonCreate) Mutation() *PersonMutation

Mutation returns the PersonMutation object of the builder.

func (*PersonCreate) Save

func (pc *PersonCreate) Save(ctx context.Context) (*Person, error)

Save creates the Person in the database.

func (*PersonCreate) SaveX

func (pc *PersonCreate) SaveX(ctx context.Context) *Person

SaveX calls Save and panics if Save returns an error.

func (*PersonCreate) SetAvatarURL

func (pc *PersonCreate) SetAvatarURL(s string) *PersonCreate

SetAvatarURL sets the "avatar_url" field.

func (*PersonCreate) SetCreatedAt

func (pc *PersonCreate) SetCreatedAt(t time.Time) *PersonCreate

SetCreatedAt sets the "created_at" field.

func (*PersonCreate) SetEmail

func (pc *PersonCreate) SetEmail(s string) *PersonCreate

SetEmail sets the "email" field.

func (*PersonCreate) SetID

func (pc *PersonCreate) SetID(u uuid.UUID) *PersonCreate

SetID sets the "id" field.

func (*PersonCreate) SetIsEmailVerified

func (pc *PersonCreate) SetIsEmailVerified(b bool) *PersonCreate

SetIsEmailVerified sets the "is_email_verified" field.

func (*PersonCreate) SetIsPhoneVerified

func (pc *PersonCreate) SetIsPhoneVerified(b bool) *PersonCreate

SetIsPhoneVerified sets the "is_phone_verified" field.

func (*PersonCreate) SetName

func (pc *PersonCreate) SetName(s string) *PersonCreate

SetName sets the "name" field.

func (*PersonCreate) SetNillableAvatarURL

func (pc *PersonCreate) SetNillableAvatarURL(s *string) *PersonCreate

SetNillableAvatarURL sets the "avatar_url" field if the given value is not nil.

func (*PersonCreate) SetNillableCreatedAt

func (pc *PersonCreate) SetNillableCreatedAt(t *time.Time) *PersonCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*PersonCreate) SetNillableID

func (pc *PersonCreate) SetNillableID(u *uuid.UUID) *PersonCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*PersonCreate) SetNillableIsEmailVerified

func (pc *PersonCreate) SetNillableIsEmailVerified(b *bool) *PersonCreate

SetNillableIsEmailVerified sets the "is_email_verified" field if the given value is not nil.

func (*PersonCreate) SetNillableIsPhoneVerified

func (pc *PersonCreate) SetNillableIsPhoneVerified(b *bool) *PersonCreate

SetNillableIsPhoneVerified sets the "is_phone_verified" field if the given value is not nil.

func (*PersonCreate) SetNillablePhone

func (pc *PersonCreate) SetNillablePhone(s *string) *PersonCreate

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*PersonCreate) SetNillableRole

func (pc *PersonCreate) SetNillableRole(pe *person.Role) *PersonCreate

SetNillableRole sets the "role" field if the given value is not nil.

func (*PersonCreate) SetNillableUpdatedAt

func (pc *PersonCreate) SetNillableUpdatedAt(t *time.Time) *PersonCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*PersonCreate) SetNillableWorkUnitID

func (pc *PersonCreate) SetNillableWorkUnitID(u *uuid.UUID) *PersonCreate

SetNillableWorkUnitID sets the "work_unit_id" field if the given value is not nil.

func (*PersonCreate) SetPasswordHash

func (pc *PersonCreate) SetPasswordHash(b []byte) *PersonCreate

SetPasswordHash sets the "password_hash" field.

func (*PersonCreate) SetPhone

func (pc *PersonCreate) SetPhone(s string) *PersonCreate

SetPhone sets the "phone" field.

func (*PersonCreate) SetRole

func (pc *PersonCreate) SetRole(pe person.Role) *PersonCreate

SetRole sets the "role" field.

func (*PersonCreate) SetUpdatedAt

func (pc *PersonCreate) SetUpdatedAt(t time.Time) *PersonCreate

SetUpdatedAt sets the "updated_at" field.

func (*PersonCreate) SetWorkUnit

func (pc *PersonCreate) SetWorkUnit(w *WorkUnitInfo) *PersonCreate

SetWorkUnit sets the "work_unit" edge to the WorkUnitInfo entity.

func (*PersonCreate) SetWorkUnitID

func (pc *PersonCreate) SetWorkUnitID(u uuid.UUID) *PersonCreate

SetWorkUnitID sets the "work_unit_id" field.

type PersonCreateBulk

type PersonCreateBulk struct {
	// contains filtered or unexported fields
}

PersonCreateBulk is the builder for creating many Person entities in bulk.

func (*PersonCreateBulk) Exec

func (pcb *PersonCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PersonCreateBulk) ExecX

func (pcb *PersonCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PersonCreateBulk) Save

func (pcb *PersonCreateBulk) Save(ctx context.Context) ([]*Person, error)

Save creates the Person entities in the database.

func (*PersonCreateBulk) SaveX

func (pcb *PersonCreateBulk) SaveX(ctx context.Context) []*Person

SaveX is like Save, but panics if an error occurs.

type PersonDelete

type PersonDelete struct {
	// contains filtered or unexported fields
}

PersonDelete is the builder for deleting a Person entity.

func (*PersonDelete) Exec

func (pd *PersonDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PersonDelete) ExecX

func (pd *PersonDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PersonDelete) Where

func (pd *PersonDelete) Where(ps ...predicate.Person) *PersonDelete

Where appends a list predicates to the PersonDelete builder.

type PersonDeleteOne

type PersonDeleteOne struct {
	// contains filtered or unexported fields
}

PersonDeleteOne is the builder for deleting a single Person entity.

func (*PersonDeleteOne) Exec

func (pdo *PersonDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PersonDeleteOne) ExecX

func (pdo *PersonDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PersonDeleteOne) Where

func (pdo *PersonDeleteOne) Where(ps ...predicate.Person) *PersonDeleteOne

Where appends a list predicates to the PersonDelete builder.

type PersonEdges

type PersonEdges struct {
	// WorkUnit holds the value of the work_unit edge.
	WorkUnit *WorkUnitInfo `json:"work_unit,omitempty"`
	// Addresses holds the value of the addresses edge.
	Addresses []*Address `json:"addresses,omitempty"`
	// PersonAddresses holds the value of the person_addresses edge.
	PersonAddresses []*PersonAddress `json:"person_addresses,omitempty"`
	// contains filtered or unexported fields
}

PersonEdges holds the relations/edges for other nodes in the graph.

func (PersonEdges) AddressesOrErr

func (e PersonEdges) AddressesOrErr() ([]*Address, error)

AddressesOrErr returns the Addresses value or an error if the edge was not loaded in eager-loading.

func (PersonEdges) PersonAddressesOrErr

func (e PersonEdges) PersonAddressesOrErr() ([]*PersonAddress, error)

PersonAddressesOrErr returns the PersonAddresses value or an error if the edge was not loaded in eager-loading.

func (PersonEdges) WorkUnitOrErr

func (e PersonEdges) WorkUnitOrErr() (*WorkUnitInfo, error)

WorkUnitOrErr returns the WorkUnit value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type PersonGroupBy

type PersonGroupBy struct {
	// contains filtered or unexported fields
}

PersonGroupBy is the group-by builder for Person entities.

func (*PersonGroupBy) Aggregate

func (pgb *PersonGroupBy) Aggregate(fns ...AggregateFunc) *PersonGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*PersonGroupBy) Bool

func (s *PersonGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PersonGroupBy) BoolX

func (s *PersonGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PersonGroupBy) Bools

func (s *PersonGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PersonGroupBy) BoolsX

func (s *PersonGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PersonGroupBy) Float64

func (s *PersonGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PersonGroupBy) Float64X

func (s *PersonGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PersonGroupBy) Float64s

func (s *PersonGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PersonGroupBy) Float64sX

func (s *PersonGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PersonGroupBy) Int

func (s *PersonGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PersonGroupBy) IntX

func (s *PersonGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PersonGroupBy) Ints

func (s *PersonGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PersonGroupBy) IntsX

func (s *PersonGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PersonGroupBy) Scan

func (pgb *PersonGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PersonGroupBy) ScanX

func (s *PersonGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PersonGroupBy) String

func (s *PersonGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PersonGroupBy) StringX

func (s *PersonGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PersonGroupBy) Strings

func (s *PersonGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PersonGroupBy) StringsX

func (s *PersonGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PersonMutation

type PersonMutation struct {
	// contains filtered or unexported fields
}

PersonMutation represents an operation that mutates the Person nodes in the graph.

func (*PersonMutation) AddAddressIDs

func (m *PersonMutation) AddAddressIDs(ids ...uuid.UUID)

AddAddressIDs adds the "addresses" edge to the Address entity by ids.

func (*PersonMutation) AddField

func (m *PersonMutation) 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 (*PersonMutation) AddedEdges

func (m *PersonMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PersonMutation) AddedField

func (m *PersonMutation) 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 (*PersonMutation) AddedFields

func (m *PersonMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PersonMutation) AddedIDs

func (m *PersonMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PersonMutation) AddressesCleared

func (m *PersonMutation) AddressesCleared() bool

AddressesCleared reports if the "addresses" edge to the Address entity was cleared.

func (*PersonMutation) AddressesIDs

func (m *PersonMutation) AddressesIDs() (ids []uuid.UUID)

AddressesIDs returns the "addresses" edge IDs in the mutation.

func (*PersonMutation) AvatarURL

func (m *PersonMutation) AvatarURL() (r string, exists bool)

AvatarURL returns the value of the "avatar_url" field in the mutation.

func (*PersonMutation) AvatarURLCleared

func (m *PersonMutation) AvatarURLCleared() bool

AvatarURLCleared returns if the "avatar_url" field was cleared in this mutation.

func (*PersonMutation) ClearAddresses

func (m *PersonMutation) ClearAddresses()

ClearAddresses clears the "addresses" edge to the Address entity.

func (*PersonMutation) ClearAvatarURL

func (m *PersonMutation) ClearAvatarURL()

ClearAvatarURL clears the value of the "avatar_url" field.

func (*PersonMutation) ClearEdge

func (m *PersonMutation) 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 (*PersonMutation) ClearField

func (m *PersonMutation) 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 (*PersonMutation) ClearPasswordHash

func (m *PersonMutation) ClearPasswordHash()

ClearPasswordHash clears the value of the "password_hash" field.

func (*PersonMutation) ClearPhone

func (m *PersonMutation) ClearPhone()

ClearPhone clears the value of the "phone" field.

func (*PersonMutation) ClearWorkUnit

func (m *PersonMutation) ClearWorkUnit()

ClearWorkUnit clears the "work_unit" edge to the WorkUnitInfo entity.

func (*PersonMutation) ClearWorkUnitID

func (m *PersonMutation) ClearWorkUnitID()

ClearWorkUnitID clears the value of the "work_unit_id" field.

func (*PersonMutation) ClearedEdges

func (m *PersonMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PersonMutation) ClearedFields

func (m *PersonMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PersonMutation) Client

func (m PersonMutation) 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 (*PersonMutation) CreatedAt

func (m *PersonMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*PersonMutation) EdgeCleared

func (m *PersonMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PersonMutation) Email

func (m *PersonMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*PersonMutation) Field

func (m *PersonMutation) 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 (*PersonMutation) FieldCleared

func (m *PersonMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PersonMutation) Fields

func (m *PersonMutation) 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 (*PersonMutation) ID

func (m *PersonMutation) ID() (id uuid.UUID, 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 (*PersonMutation) IDs

func (m *PersonMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*PersonMutation) IsEmailVerified

func (m *PersonMutation) IsEmailVerified() (r bool, exists bool)

IsEmailVerified returns the value of the "is_email_verified" field in the mutation.

func (*PersonMutation) IsPhoneVerified

func (m *PersonMutation) IsPhoneVerified() (r bool, exists bool)

IsPhoneVerified returns the value of the "is_phone_verified" field in the mutation.

func (*PersonMutation) Name

func (m *PersonMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*PersonMutation) OldAvatarURL

func (m *PersonMutation) OldAvatarURL(ctx context.Context) (v *string, err error)

OldAvatarURL returns the old "avatar_url" field's value of the Person entity. If the Person 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 (*PersonMutation) OldCreatedAt

func (m *PersonMutation) OldCreatedAt(ctx context.Context) (v *time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Person entity. If the Person 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 (*PersonMutation) OldEmail

func (m *PersonMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the Person entity. If the Person 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 (*PersonMutation) OldField

func (m *PersonMutation) 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 (*PersonMutation) OldIsEmailVerified

func (m *PersonMutation) OldIsEmailVerified(ctx context.Context) (v *bool, err error)

OldIsEmailVerified returns the old "is_email_verified" field's value of the Person entity. If the Person 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 (*PersonMutation) OldIsPhoneVerified

func (m *PersonMutation) OldIsPhoneVerified(ctx context.Context) (v *bool, err error)

OldIsPhoneVerified returns the old "is_phone_verified" field's value of the Person entity. If the Person 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 (*PersonMutation) OldName

func (m *PersonMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Person entity. If the Person 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 (*PersonMutation) OldPasswordHash

func (m *PersonMutation) OldPasswordHash(ctx context.Context) (v *[]byte, err error)

OldPasswordHash returns the old "password_hash" field's value of the Person entity. If the Person 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 (*PersonMutation) OldPhone

func (m *PersonMutation) OldPhone(ctx context.Context) (v *string, err error)

OldPhone returns the old "phone" field's value of the Person entity. If the Person 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 (*PersonMutation) OldRole

func (m *PersonMutation) OldRole(ctx context.Context) (v *person.Role, err error)

OldRole returns the old "role" field's value of the Person entity. If the Person 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 (*PersonMutation) OldUpdatedAt

func (m *PersonMutation) OldUpdatedAt(ctx context.Context) (v *time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Person entity. If the Person 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 (*PersonMutation) OldWorkUnitID

func (m *PersonMutation) OldWorkUnitID(ctx context.Context) (v *uuid.UUID, err error)

OldWorkUnitID returns the old "work_unit_id" field's value of the Person entity. If the Person 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 (*PersonMutation) Op

func (m *PersonMutation) Op() Op

Op returns the operation name.

func (*PersonMutation) PasswordHash

func (m *PersonMutation) PasswordHash() (r []byte, exists bool)

PasswordHash returns the value of the "password_hash" field in the mutation.

func (*PersonMutation) PasswordHashCleared

func (m *PersonMutation) PasswordHashCleared() bool

PasswordHashCleared returns if the "password_hash" field was cleared in this mutation.

func (*PersonMutation) Phone

func (m *PersonMutation) Phone() (r string, exists bool)

Phone returns the value of the "phone" field in the mutation.

func (*PersonMutation) PhoneCleared

func (m *PersonMutation) PhoneCleared() bool

PhoneCleared returns if the "phone" field was cleared in this mutation.

func (*PersonMutation) RemoveAddressIDs

func (m *PersonMutation) RemoveAddressIDs(ids ...uuid.UUID)

RemoveAddressIDs removes the "addresses" edge to the Address entity by IDs.

func (*PersonMutation) RemovedAddressesIDs

func (m *PersonMutation) RemovedAddressesIDs() (ids []uuid.UUID)

RemovedAddresses returns the removed IDs of the "addresses" edge to the Address entity.

func (*PersonMutation) RemovedEdges

func (m *PersonMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PersonMutation) RemovedIDs

func (m *PersonMutation) 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 (*PersonMutation) ResetAddresses

func (m *PersonMutation) ResetAddresses()

ResetAddresses resets all changes to the "addresses" edge.

func (*PersonMutation) ResetAvatarURL

func (m *PersonMutation) ResetAvatarURL()

ResetAvatarURL resets all changes to the "avatar_url" field.

func (*PersonMutation) ResetCreatedAt

func (m *PersonMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*PersonMutation) ResetEdge

func (m *PersonMutation) 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 (*PersonMutation) ResetEmail

func (m *PersonMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*PersonMutation) ResetField

func (m *PersonMutation) 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 (*PersonMutation) ResetIsEmailVerified

func (m *PersonMutation) ResetIsEmailVerified()

ResetIsEmailVerified resets all changes to the "is_email_verified" field.

func (*PersonMutation) ResetIsPhoneVerified

func (m *PersonMutation) ResetIsPhoneVerified()

ResetIsPhoneVerified resets all changes to the "is_phone_verified" field.

func (*PersonMutation) ResetName

func (m *PersonMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*PersonMutation) ResetPasswordHash

func (m *PersonMutation) ResetPasswordHash()

ResetPasswordHash resets all changes to the "password_hash" field.

func (*PersonMutation) ResetPhone

func (m *PersonMutation) ResetPhone()

ResetPhone resets all changes to the "phone" field.

func (*PersonMutation) ResetRole

func (m *PersonMutation) ResetRole()

ResetRole resets all changes to the "role" field.

func (*PersonMutation) ResetUpdatedAt

func (m *PersonMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*PersonMutation) ResetWorkUnit

func (m *PersonMutation) ResetWorkUnit()

ResetWorkUnit resets all changes to the "work_unit" edge.

func (*PersonMutation) ResetWorkUnitID

func (m *PersonMutation) ResetWorkUnitID()

ResetWorkUnitID resets all changes to the "work_unit_id" field.

func (*PersonMutation) Role

func (m *PersonMutation) Role() (r person.Role, exists bool)

Role returns the value of the "role" field in the mutation.

func (*PersonMutation) SetAvatarURL

func (m *PersonMutation) SetAvatarURL(s string)

SetAvatarURL sets the "avatar_url" field.

func (*PersonMutation) SetCreatedAt

func (m *PersonMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*PersonMutation) SetEmail

func (m *PersonMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*PersonMutation) SetField

func (m *PersonMutation) 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 (*PersonMutation) SetID

func (m *PersonMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Person entities.

func (*PersonMutation) SetIsEmailVerified

func (m *PersonMutation) SetIsEmailVerified(b bool)

SetIsEmailVerified sets the "is_email_verified" field.

func (*PersonMutation) SetIsPhoneVerified

func (m *PersonMutation) SetIsPhoneVerified(b bool)

SetIsPhoneVerified sets the "is_phone_verified" field.

func (*PersonMutation) SetName

func (m *PersonMutation) SetName(s string)

SetName sets the "name" field.

func (*PersonMutation) SetOp

func (m *PersonMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PersonMutation) SetPasswordHash

func (m *PersonMutation) SetPasswordHash(b []byte)

SetPasswordHash sets the "password_hash" field.

func (*PersonMutation) SetPhone

func (m *PersonMutation) SetPhone(s string)

SetPhone sets the "phone" field.

func (*PersonMutation) SetRole

func (m *PersonMutation) SetRole(pe person.Role)

SetRole sets the "role" field.

func (*PersonMutation) SetUpdatedAt

func (m *PersonMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*PersonMutation) SetWorkUnitID

func (m *PersonMutation) SetWorkUnitID(u uuid.UUID)

SetWorkUnitID sets the "work_unit_id" field.

func (PersonMutation) Tx

func (m PersonMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PersonMutation) Type

func (m *PersonMutation) Type() string

Type returns the node type of this mutation (Person).

func (*PersonMutation) UpdatedAt

func (m *PersonMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*PersonMutation) Where

func (m *PersonMutation) Where(ps ...predicate.Person)

Where appends a list predicates to the PersonMutation builder.

func (*PersonMutation) WhereP

func (m *PersonMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PersonMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

func (*PersonMutation) WorkUnitCleared

func (m *PersonMutation) WorkUnitCleared() bool

WorkUnitCleared reports if the "work_unit" edge to the WorkUnitInfo entity was cleared.

func (*PersonMutation) WorkUnitID

func (m *PersonMutation) WorkUnitID() (r uuid.UUID, exists bool)

WorkUnitID returns the value of the "work_unit_id" field in the mutation.

func (*PersonMutation) WorkUnitIDCleared

func (m *PersonMutation) WorkUnitIDCleared() bool

WorkUnitIDCleared returns if the "work_unit_id" field was cleared in this mutation.

func (*PersonMutation) WorkUnitIDs

func (m *PersonMutation) WorkUnitIDs() (ids []uuid.UUID)

WorkUnitIDs returns the "work_unit" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use WorkUnitID instead. It exists only for internal usage by the builders.

type PersonQuery

type PersonQuery struct {
	// contains filtered or unexported fields
}

PersonQuery is the builder for querying Person entities.

func (*PersonQuery) Aggregate

func (pq *PersonQuery) Aggregate(fns ...AggregateFunc) *PersonSelect

Aggregate returns a PersonSelect configured with the given aggregations.

func (*PersonQuery) All

func (pq *PersonQuery) All(ctx context.Context) ([]*Person, error)

All executes the query and returns a list of Persons.

func (*PersonQuery) AllX

func (pq *PersonQuery) AllX(ctx context.Context) []*Person

AllX is like All, but panics if an error occurs.

func (*PersonQuery) Clone

func (pq *PersonQuery) Clone() *PersonQuery

Clone returns a duplicate of the PersonQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PersonQuery) Count

func (pq *PersonQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PersonQuery) CountX

func (pq *PersonQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PersonQuery) Exist

func (pq *PersonQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PersonQuery) ExistX

func (pq *PersonQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PersonQuery) First

func (pq *PersonQuery) First(ctx context.Context) (*Person, error)

First returns the first Person entity from the query. Returns a *NotFoundError when no Person was found.

func (*PersonQuery) FirstID

func (pq *PersonQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Person ID from the query. Returns a *NotFoundError when no Person ID was found.

func (*PersonQuery) FirstIDX

func (pq *PersonQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*PersonQuery) FirstX

func (pq *PersonQuery) FirstX(ctx context.Context) *Person

FirstX is like First, but panics if an error occurs.

func (*PersonQuery) GroupBy

func (pq *PersonQuery) GroupBy(field string, fields ...string) *PersonGroupBy

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.Person.Query().
	GroupBy(person.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PersonQuery) IDs

func (pq *PersonQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Person IDs.

func (*PersonQuery) IDsX

func (pq *PersonQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*PersonQuery) Limit

func (pq *PersonQuery) Limit(limit int) *PersonQuery

Limit the number of records to be returned by this query.

func (*PersonQuery) Offset

func (pq *PersonQuery) Offset(offset int) *PersonQuery

Offset to start from.

func (*PersonQuery) Only

func (pq *PersonQuery) Only(ctx context.Context) (*Person, error)

Only returns a single Person entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Person entity is found. Returns a *NotFoundError when no Person entities are found.

func (*PersonQuery) OnlyID

func (pq *PersonQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Person ID in the query. Returns a *NotSingularError when more than one Person ID is found. Returns a *NotFoundError when no entities are found.

func (*PersonQuery) OnlyIDX

func (pq *PersonQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PersonQuery) OnlyX

func (pq *PersonQuery) OnlyX(ctx context.Context) *Person

OnlyX is like Only, but panics if an error occurs.

func (*PersonQuery) Order

func (pq *PersonQuery) Order(o ...person.OrderOption) *PersonQuery

Order specifies how the records should be ordered.

func (*PersonQuery) QueryAddresses

func (pq *PersonQuery) QueryAddresses() *AddressQuery

QueryAddresses chains the current query on the "addresses" edge.

func (*PersonQuery) QueryPersonAddresses

func (pq *PersonQuery) QueryPersonAddresses() *PersonAddressQuery

QueryPersonAddresses chains the current query on the "person_addresses" edge.

func (*PersonQuery) QueryWorkUnit

func (pq *PersonQuery) QueryWorkUnit() *WorkUnitInfoQuery

QueryWorkUnit chains the current query on the "work_unit" edge.

func (*PersonQuery) Select

func (pq *PersonQuery) Select(fields ...string) *PersonSelect

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.Person.Query().
	Select(person.FieldCreatedAt).
	Scan(ctx, &v)

func (*PersonQuery) Unique

func (pq *PersonQuery) Unique(unique bool) *PersonQuery

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 (*PersonQuery) Where

func (pq *PersonQuery) Where(ps ...predicate.Person) *PersonQuery

Where adds a new predicate for the PersonQuery builder.

func (*PersonQuery) WithAddresses

func (pq *PersonQuery) WithAddresses(opts ...func(*AddressQuery)) *PersonQuery

WithAddresses tells the query-builder to eager-load the nodes that are connected to the "addresses" edge. The optional arguments are used to configure the query builder of the edge.

func (*PersonQuery) WithPersonAddresses

func (pq *PersonQuery) WithPersonAddresses(opts ...func(*PersonAddressQuery)) *PersonQuery

WithPersonAddresses tells the query-builder to eager-load the nodes that are connected to the "person_addresses" edge. The optional arguments are used to configure the query builder of the edge.

func (*PersonQuery) WithWorkUnit

func (pq *PersonQuery) WithWorkUnit(opts ...func(*WorkUnitInfoQuery)) *PersonQuery

WithWorkUnit tells the query-builder to eager-load the nodes that are connected to the "work_unit" edge. The optional arguments are used to configure the query builder of the edge.

type PersonSelect

type PersonSelect struct {
	*PersonQuery
	// contains filtered or unexported fields
}

PersonSelect is the builder for selecting fields of Person entities.

func (*PersonSelect) Aggregate

func (ps *PersonSelect) Aggregate(fns ...AggregateFunc) *PersonSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PersonSelect) Bool

func (s *PersonSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PersonSelect) BoolX

func (s *PersonSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PersonSelect) Bools

func (s *PersonSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PersonSelect) BoolsX

func (s *PersonSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PersonSelect) Float64

func (s *PersonSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PersonSelect) Float64X

func (s *PersonSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PersonSelect) Float64s

func (s *PersonSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PersonSelect) Float64sX

func (s *PersonSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PersonSelect) Int

func (s *PersonSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PersonSelect) IntX

func (s *PersonSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PersonSelect) Ints

func (s *PersonSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PersonSelect) IntsX

func (s *PersonSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PersonSelect) Scan

func (ps *PersonSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PersonSelect) ScanX

func (s *PersonSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PersonSelect) String

func (s *PersonSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PersonSelect) StringX

func (s *PersonSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PersonSelect) Strings

func (s *PersonSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PersonSelect) StringsX

func (s *PersonSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PersonUpdate

type PersonUpdate struct {
	// contains filtered or unexported fields
}

PersonUpdate is the builder for updating Person entities.

func (*PersonUpdate) AddAddressIDs

func (pu *PersonUpdate) AddAddressIDs(ids ...uuid.UUID) *PersonUpdate

AddAddressIDs adds the "addresses" edge to the Address entity by IDs.

func (*PersonUpdate) AddAddresses

func (pu *PersonUpdate) AddAddresses(a ...*Address) *PersonUpdate

AddAddresses adds the "addresses" edges to the Address entity.

func (*PersonUpdate) ClearAddresses

func (pu *PersonUpdate) ClearAddresses() *PersonUpdate

ClearAddresses clears all "addresses" edges to the Address entity.

func (*PersonUpdate) ClearAvatarURL

func (pu *PersonUpdate) ClearAvatarURL() *PersonUpdate

ClearAvatarURL clears the value of the "avatar_url" field.

func (*PersonUpdate) ClearPasswordHash

func (pu *PersonUpdate) ClearPasswordHash() *PersonUpdate

ClearPasswordHash clears the value of the "password_hash" field.

func (*PersonUpdate) ClearPhone

func (pu *PersonUpdate) ClearPhone() *PersonUpdate

ClearPhone clears the value of the "phone" field.

func (*PersonUpdate) ClearWorkUnit

func (pu *PersonUpdate) ClearWorkUnit() *PersonUpdate

ClearWorkUnit clears the "work_unit" edge to the WorkUnitInfo entity.

func (*PersonUpdate) ClearWorkUnitID

func (pu *PersonUpdate) ClearWorkUnitID() *PersonUpdate

ClearWorkUnitID clears the value of the "work_unit_id" field.

func (*PersonUpdate) Exec

func (pu *PersonUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PersonUpdate) ExecX

func (pu *PersonUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PersonUpdate) Mutation

func (pu *PersonUpdate) Mutation() *PersonMutation

Mutation returns the PersonMutation object of the builder.

func (*PersonUpdate) RemoveAddressIDs

func (pu *PersonUpdate) RemoveAddressIDs(ids ...uuid.UUID) *PersonUpdate

RemoveAddressIDs removes the "addresses" edge to Address entities by IDs.

func (*PersonUpdate) RemoveAddresses

func (pu *PersonUpdate) RemoveAddresses(a ...*Address) *PersonUpdate

RemoveAddresses removes "addresses" edges to Address entities.

func (*PersonUpdate) Save

func (pu *PersonUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PersonUpdate) SaveX

func (pu *PersonUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PersonUpdate) SetAvatarURL

func (pu *PersonUpdate) SetAvatarURL(s string) *PersonUpdate

SetAvatarURL sets the "avatar_url" field.

func (*PersonUpdate) SetEmail

func (pu *PersonUpdate) SetEmail(s string) *PersonUpdate

SetEmail sets the "email" field.

func (*PersonUpdate) SetIsEmailVerified

func (pu *PersonUpdate) SetIsEmailVerified(b bool) *PersonUpdate

SetIsEmailVerified sets the "is_email_verified" field.

func (*PersonUpdate) SetIsPhoneVerified

func (pu *PersonUpdate) SetIsPhoneVerified(b bool) *PersonUpdate

SetIsPhoneVerified sets the "is_phone_verified" field.

func (*PersonUpdate) SetName

func (pu *PersonUpdate) SetName(s string) *PersonUpdate

SetName sets the "name" field.

func (*PersonUpdate) SetNillableAvatarURL

func (pu *PersonUpdate) SetNillableAvatarURL(s *string) *PersonUpdate

SetNillableAvatarURL sets the "avatar_url" field if the given value is not nil.

func (*PersonUpdate) SetNillableEmail

func (pu *PersonUpdate) SetNillableEmail(s *string) *PersonUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*PersonUpdate) SetNillableIsEmailVerified

func (pu *PersonUpdate) SetNillableIsEmailVerified(b *bool) *PersonUpdate

SetNillableIsEmailVerified sets the "is_email_verified" field if the given value is not nil.

func (*PersonUpdate) SetNillableIsPhoneVerified

func (pu *PersonUpdate) SetNillableIsPhoneVerified(b *bool) *PersonUpdate

SetNillableIsPhoneVerified sets the "is_phone_verified" field if the given value is not nil.

func (*PersonUpdate) SetNillableName

func (pu *PersonUpdate) SetNillableName(s *string) *PersonUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*PersonUpdate) SetNillablePhone

func (pu *PersonUpdate) SetNillablePhone(s *string) *PersonUpdate

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*PersonUpdate) SetNillableRole

func (pu *PersonUpdate) SetNillableRole(pe *person.Role) *PersonUpdate

SetNillableRole sets the "role" field if the given value is not nil.

func (*PersonUpdate) SetNillableWorkUnitID

func (pu *PersonUpdate) SetNillableWorkUnitID(u *uuid.UUID) *PersonUpdate

SetNillableWorkUnitID sets the "work_unit_id" field if the given value is not nil.

func (*PersonUpdate) SetPasswordHash

func (pu *PersonUpdate) SetPasswordHash(b []byte) *PersonUpdate

SetPasswordHash sets the "password_hash" field.

func (*PersonUpdate) SetPhone

func (pu *PersonUpdate) SetPhone(s string) *PersonUpdate

SetPhone sets the "phone" field.

func (*PersonUpdate) SetRole

func (pu *PersonUpdate) SetRole(pe person.Role) *PersonUpdate

SetRole sets the "role" field.

func (*PersonUpdate) SetUpdatedAt

func (pu *PersonUpdate) SetUpdatedAt(t time.Time) *PersonUpdate

SetUpdatedAt sets the "updated_at" field.

func (*PersonUpdate) SetWorkUnit

func (pu *PersonUpdate) SetWorkUnit(w *WorkUnitInfo) *PersonUpdate

SetWorkUnit sets the "work_unit" edge to the WorkUnitInfo entity.

func (*PersonUpdate) SetWorkUnitID

func (pu *PersonUpdate) SetWorkUnitID(u uuid.UUID) *PersonUpdate

SetWorkUnitID sets the "work_unit_id" field.

func (*PersonUpdate) Where

func (pu *PersonUpdate) Where(ps ...predicate.Person) *PersonUpdate

Where appends a list predicates to the PersonUpdate builder.

type PersonUpdateOne

type PersonUpdateOne struct {
	// contains filtered or unexported fields
}

PersonUpdateOne is the builder for updating a single Person entity.

func (*PersonUpdateOne) AddAddressIDs

func (puo *PersonUpdateOne) AddAddressIDs(ids ...uuid.UUID) *PersonUpdateOne

AddAddressIDs adds the "addresses" edge to the Address entity by IDs.

func (*PersonUpdateOne) AddAddresses

func (puo *PersonUpdateOne) AddAddresses(a ...*Address) *PersonUpdateOne

AddAddresses adds the "addresses" edges to the Address entity.

func (*PersonUpdateOne) ClearAddresses

func (puo *PersonUpdateOne) ClearAddresses() *PersonUpdateOne

ClearAddresses clears all "addresses" edges to the Address entity.

func (*PersonUpdateOne) ClearAvatarURL

func (puo *PersonUpdateOne) ClearAvatarURL() *PersonUpdateOne

ClearAvatarURL clears the value of the "avatar_url" field.

func (*PersonUpdateOne) ClearPasswordHash

func (puo *PersonUpdateOne) ClearPasswordHash() *PersonUpdateOne

ClearPasswordHash clears the value of the "password_hash" field.

func (*PersonUpdateOne) ClearPhone

func (puo *PersonUpdateOne) ClearPhone() *PersonUpdateOne

ClearPhone clears the value of the "phone" field.

func (*PersonUpdateOne) ClearWorkUnit

func (puo *PersonUpdateOne) ClearWorkUnit() *PersonUpdateOne

ClearWorkUnit clears the "work_unit" edge to the WorkUnitInfo entity.

func (*PersonUpdateOne) ClearWorkUnitID

func (puo *PersonUpdateOne) ClearWorkUnitID() *PersonUpdateOne

ClearWorkUnitID clears the value of the "work_unit_id" field.

func (*PersonUpdateOne) Exec

func (puo *PersonUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PersonUpdateOne) ExecX

func (puo *PersonUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PersonUpdateOne) Mutation

func (puo *PersonUpdateOne) Mutation() *PersonMutation

Mutation returns the PersonMutation object of the builder.

func (*PersonUpdateOne) RemoveAddressIDs

func (puo *PersonUpdateOne) RemoveAddressIDs(ids ...uuid.UUID) *PersonUpdateOne

RemoveAddressIDs removes the "addresses" edge to Address entities by IDs.

func (*PersonUpdateOne) RemoveAddresses

func (puo *PersonUpdateOne) RemoveAddresses(a ...*Address) *PersonUpdateOne

RemoveAddresses removes "addresses" edges to Address entities.

func (*PersonUpdateOne) Save

func (puo *PersonUpdateOne) Save(ctx context.Context) (*Person, error)

Save executes the query and returns the updated Person entity.

func (*PersonUpdateOne) SaveX

func (puo *PersonUpdateOne) SaveX(ctx context.Context) *Person

SaveX is like Save, but panics if an error occurs.

func (*PersonUpdateOne) Select

func (puo *PersonUpdateOne) Select(field string, fields ...string) *PersonUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PersonUpdateOne) SetAvatarURL

func (puo *PersonUpdateOne) SetAvatarURL(s string) *PersonUpdateOne

SetAvatarURL sets the "avatar_url" field.

func (*PersonUpdateOne) SetEmail

func (puo *PersonUpdateOne) SetEmail(s string) *PersonUpdateOne

SetEmail sets the "email" field.

func (*PersonUpdateOne) SetIsEmailVerified

func (puo *PersonUpdateOne) SetIsEmailVerified(b bool) *PersonUpdateOne

SetIsEmailVerified sets the "is_email_verified" field.

func (*PersonUpdateOne) SetIsPhoneVerified

func (puo *PersonUpdateOne) SetIsPhoneVerified(b bool) *PersonUpdateOne

SetIsPhoneVerified sets the "is_phone_verified" field.

func (*PersonUpdateOne) SetName

func (puo *PersonUpdateOne) SetName(s string) *PersonUpdateOne

SetName sets the "name" field.

func (*PersonUpdateOne) SetNillableAvatarURL

func (puo *PersonUpdateOne) SetNillableAvatarURL(s *string) *PersonUpdateOne

SetNillableAvatarURL sets the "avatar_url" field if the given value is not nil.

func (*PersonUpdateOne) SetNillableEmail

func (puo *PersonUpdateOne) SetNillableEmail(s *string) *PersonUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*PersonUpdateOne) SetNillableIsEmailVerified

func (puo *PersonUpdateOne) SetNillableIsEmailVerified(b *bool) *PersonUpdateOne

SetNillableIsEmailVerified sets the "is_email_verified" field if the given value is not nil.

func (*PersonUpdateOne) SetNillableIsPhoneVerified

func (puo *PersonUpdateOne) SetNillableIsPhoneVerified(b *bool) *PersonUpdateOne

SetNillableIsPhoneVerified sets the "is_phone_verified" field if the given value is not nil.

func (*PersonUpdateOne) SetNillableName

func (puo *PersonUpdateOne) SetNillableName(s *string) *PersonUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*PersonUpdateOne) SetNillablePhone

func (puo *PersonUpdateOne) SetNillablePhone(s *string) *PersonUpdateOne

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*PersonUpdateOne) SetNillableRole

func (puo *PersonUpdateOne) SetNillableRole(pe *person.Role) *PersonUpdateOne

SetNillableRole sets the "role" field if the given value is not nil.

func (*PersonUpdateOne) SetNillableWorkUnitID

func (puo *PersonUpdateOne) SetNillableWorkUnitID(u *uuid.UUID) *PersonUpdateOne

SetNillableWorkUnitID sets the "work_unit_id" field if the given value is not nil.

func (*PersonUpdateOne) SetPasswordHash

func (puo *PersonUpdateOne) SetPasswordHash(b []byte) *PersonUpdateOne

SetPasswordHash sets the "password_hash" field.

func (*PersonUpdateOne) SetPhone

func (puo *PersonUpdateOne) SetPhone(s string) *PersonUpdateOne

SetPhone sets the "phone" field.

func (*PersonUpdateOne) SetRole

func (puo *PersonUpdateOne) SetRole(pe person.Role) *PersonUpdateOne

SetRole sets the "role" field.

func (*PersonUpdateOne) SetUpdatedAt

func (puo *PersonUpdateOne) SetUpdatedAt(t time.Time) *PersonUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*PersonUpdateOne) SetWorkUnit

func (puo *PersonUpdateOne) SetWorkUnit(w *WorkUnitInfo) *PersonUpdateOne

SetWorkUnit sets the "work_unit" edge to the WorkUnitInfo entity.

func (*PersonUpdateOne) SetWorkUnitID

func (puo *PersonUpdateOne) SetWorkUnitID(u uuid.UUID) *PersonUpdateOne

SetWorkUnitID sets the "work_unit_id" field.

func (*PersonUpdateOne) Where

func (puo *PersonUpdateOne) Where(ps ...predicate.Person) *PersonUpdateOne

Where appends a list predicates to the PersonUpdate builder.

type Persons

type Persons []*Person

Persons is a parsable slice of Person.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type ProductColor

type ProductColor struct {

	// ID of the ent.
	ID string `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"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// ColorCode holds the value of the "color_code" field.
	ColorCode string `json:"color_code,omitempty"`
	// contains filtered or unexported fields
}

ProductColor is the model entity for the ProductColor schema.

func (*ProductColor) String

func (pc *ProductColor) String() string

String implements the fmt.Stringer.

func (*ProductColor) Unwrap

func (pc *ProductColor) Unwrap() *ProductColor

Unwrap unwraps the ProductColor 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 (*ProductColor) Update

func (pc *ProductColor) Update() *ProductColorUpdateOne

Update returns a builder for updating this ProductColor. Note that you need to call ProductColor.Unwrap() before calling this method if this ProductColor was returned from a transaction, and the transaction was committed or rolled back.

func (*ProductColor) Value

func (pc *ProductColor) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the ProductColor. This includes values selected through modifiers, order, etc.

type ProductColorClient

type ProductColorClient struct {
	// contains filtered or unexported fields
}

ProductColorClient is a client for the ProductColor schema.

func NewProductColorClient

func NewProductColorClient(c config) *ProductColorClient

NewProductColorClient returns a client for the ProductColor from the given config.

func (*ProductColorClient) Create

Create returns a builder for creating a ProductColor entity.

func (*ProductColorClient) CreateBulk

func (c *ProductColorClient) CreateBulk(builders ...*ProductColorCreate) *ProductColorCreateBulk

CreateBulk returns a builder for creating a bulk of ProductColor entities.

func (*ProductColorClient) Delete

Delete returns a delete builder for ProductColor.

func (*ProductColorClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ProductColorClient) DeleteOneID

func (c *ProductColorClient) DeleteOneID(id string) *ProductColorDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ProductColorClient) Get

Get returns a ProductColor entity by its id.

func (*ProductColorClient) GetX

GetX is like Get, but panics if an error occurs.

func (*ProductColorClient) Hooks

func (c *ProductColorClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ProductColorClient) Intercept

func (c *ProductColorClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `productcolor.Intercept(f(g(h())))`.

func (*ProductColorClient) Interceptors

func (c *ProductColorClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ProductColorClient) MapCreateBulk

func (c *ProductColorClient) MapCreateBulk(slice any, setFunc func(*ProductColorCreate, int)) *ProductColorCreateBulk

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 (*ProductColorClient) Query

Query returns a query builder for ProductColor.

func (*ProductColorClient) Update

Update returns an update builder for ProductColor.

func (*ProductColorClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ProductColorClient) UpdateOneID

func (c *ProductColorClient) UpdateOneID(id string) *ProductColorUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ProductColorClient) Use

func (c *ProductColorClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `productcolor.Hooks(f(g(h())))`.

type ProductColorCreate

type ProductColorCreate struct {
	// contains filtered or unexported fields
}

ProductColorCreate is the builder for creating a ProductColor entity.

func (*ProductColorCreate) Exec

func (pcc *ProductColorCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductColorCreate) ExecX

func (pcc *ProductColorCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductColorCreate) Mutation

func (pcc *ProductColorCreate) Mutation() *ProductColorMutation

Mutation returns the ProductColorMutation object of the builder.

func (*ProductColorCreate) Save

Save creates the ProductColor in the database.

func (*ProductColorCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*ProductColorCreate) SetColorCode

func (pcc *ProductColorCreate) SetColorCode(s string) *ProductColorCreate

SetColorCode sets the "color_code" field.

func (*ProductColorCreate) SetCreatedAt

func (pcc *ProductColorCreate) SetCreatedAt(t time.Time) *ProductColorCreate

SetCreatedAt sets the "created_at" field.

func (*ProductColorCreate) SetID

SetID sets the "id" field.

func (*ProductColorCreate) SetName

func (pcc *ProductColorCreate) SetName(s string) *ProductColorCreate

SetName sets the "name" field.

func (*ProductColorCreate) SetNillableCreatedAt

func (pcc *ProductColorCreate) SetNillableCreatedAt(t *time.Time) *ProductColorCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ProductColorCreate) SetNillableUpdatedAt

func (pcc *ProductColorCreate) SetNillableUpdatedAt(t *time.Time) *ProductColorCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*ProductColorCreate) SetUpdatedAt

func (pcc *ProductColorCreate) SetUpdatedAt(t time.Time) *ProductColorCreate

SetUpdatedAt sets the "updated_at" field.

type ProductColorCreateBulk

type ProductColorCreateBulk struct {
	// contains filtered or unexported fields
}

ProductColorCreateBulk is the builder for creating many ProductColor entities in bulk.

func (*ProductColorCreateBulk) Exec

func (pccb *ProductColorCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductColorCreateBulk) ExecX

func (pccb *ProductColorCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductColorCreateBulk) Save

Save creates the ProductColor entities in the database.

func (*ProductColorCreateBulk) SaveX

func (pccb *ProductColorCreateBulk) SaveX(ctx context.Context) []*ProductColor

SaveX is like Save, but panics if an error occurs.

type ProductColorDelete

type ProductColorDelete struct {
	// contains filtered or unexported fields
}

ProductColorDelete is the builder for deleting a ProductColor entity.

func (*ProductColorDelete) Exec

func (pcd *ProductColorDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ProductColorDelete) ExecX

func (pcd *ProductColorDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ProductColorDelete) Where

Where appends a list predicates to the ProductColorDelete builder.

type ProductColorDeleteOne

type ProductColorDeleteOne struct {
	// contains filtered or unexported fields
}

ProductColorDeleteOne is the builder for deleting a single ProductColor entity.

func (*ProductColorDeleteOne) Exec

func (pcdo *ProductColorDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ProductColorDeleteOne) ExecX

func (pcdo *ProductColorDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductColorDeleteOne) Where

Where appends a list predicates to the ProductColorDelete builder.

type ProductColorGroupBy

type ProductColorGroupBy struct {
	// contains filtered or unexported fields
}

ProductColorGroupBy is the group-by builder for ProductColor entities.

func (*ProductColorGroupBy) Aggregate

func (pcgb *ProductColorGroupBy) Aggregate(fns ...AggregateFunc) *ProductColorGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ProductColorGroupBy) Bool

func (s *ProductColorGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ProductColorGroupBy) BoolX

func (s *ProductColorGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ProductColorGroupBy) Bools

func (s *ProductColorGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ProductColorGroupBy) BoolsX

func (s *ProductColorGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ProductColorGroupBy) Float64

func (s *ProductColorGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ProductColorGroupBy) Float64X

func (s *ProductColorGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ProductColorGroupBy) Float64s

func (s *ProductColorGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ProductColorGroupBy) Float64sX

func (s *ProductColorGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ProductColorGroupBy) Int

func (s *ProductColorGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ProductColorGroupBy) IntX

func (s *ProductColorGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ProductColorGroupBy) Ints

func (s *ProductColorGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ProductColorGroupBy) IntsX

func (s *ProductColorGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ProductColorGroupBy) Scan

func (pcgb *ProductColorGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ProductColorGroupBy) ScanX

func (s *ProductColorGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ProductColorGroupBy) String

func (s *ProductColorGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ProductColorGroupBy) StringX

func (s *ProductColorGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ProductColorGroupBy) Strings

func (s *ProductColorGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ProductColorGroupBy) StringsX

func (s *ProductColorGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ProductColorMutation

type ProductColorMutation struct {
	// contains filtered or unexported fields
}

ProductColorMutation represents an operation that mutates the ProductColor nodes in the graph.

func (*ProductColorMutation) AddField

func (m *ProductColorMutation) 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 (*ProductColorMutation) AddedEdges

func (m *ProductColorMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ProductColorMutation) AddedField

func (m *ProductColorMutation) 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 (*ProductColorMutation) AddedFields

func (m *ProductColorMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ProductColorMutation) AddedIDs

func (m *ProductColorMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ProductColorMutation) ClearEdge

func (m *ProductColorMutation) 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 (*ProductColorMutation) ClearField

func (m *ProductColorMutation) 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 (*ProductColorMutation) ClearedEdges

func (m *ProductColorMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ProductColorMutation) ClearedFields

func (m *ProductColorMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ProductColorMutation) Client

func (m ProductColorMutation) 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 (*ProductColorMutation) ColorCode

func (m *ProductColorMutation) ColorCode() (r string, exists bool)

ColorCode returns the value of the "color_code" field in the mutation.

func (*ProductColorMutation) CreatedAt

func (m *ProductColorMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ProductColorMutation) EdgeCleared

func (m *ProductColorMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ProductColorMutation) Field

func (m *ProductColorMutation) 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 (*ProductColorMutation) FieldCleared

func (m *ProductColorMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ProductColorMutation) Fields

func (m *ProductColorMutation) 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 (*ProductColorMutation) ID

func (m *ProductColorMutation) ID() (id string, 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 (*ProductColorMutation) IDs

func (m *ProductColorMutation) IDs(ctx context.Context) ([]string, 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 (*ProductColorMutation) Name

func (m *ProductColorMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*ProductColorMutation) OldColorCode

func (m *ProductColorMutation) OldColorCode(ctx context.Context) (v string, err error)

OldColorCode returns the old "color_code" field's value of the ProductColor entity. If the ProductColor 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 (*ProductColorMutation) OldCreatedAt

func (m *ProductColorMutation) OldCreatedAt(ctx context.Context) (v *time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the ProductColor entity. If the ProductColor 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 (*ProductColorMutation) OldField

func (m *ProductColorMutation) 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 (*ProductColorMutation) OldName

func (m *ProductColorMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the ProductColor entity. If the ProductColor 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 (*ProductColorMutation) OldUpdatedAt

func (m *ProductColorMutation) OldUpdatedAt(ctx context.Context) (v *time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the ProductColor entity. If the ProductColor 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 (*ProductColorMutation) Op

func (m *ProductColorMutation) Op() Op

Op returns the operation name.

func (*ProductColorMutation) RemovedEdges

func (m *ProductColorMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ProductColorMutation) RemovedIDs

func (m *ProductColorMutation) 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 (*ProductColorMutation) ResetColorCode

func (m *ProductColorMutation) ResetColorCode()

ResetColorCode resets all changes to the "color_code" field.

func (*ProductColorMutation) ResetCreatedAt

func (m *ProductColorMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ProductColorMutation) ResetEdge

func (m *ProductColorMutation) 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 (*ProductColorMutation) ResetField

func (m *ProductColorMutation) 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 (*ProductColorMutation) ResetName

func (m *ProductColorMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ProductColorMutation) ResetUpdatedAt

func (m *ProductColorMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ProductColorMutation) SetColorCode

func (m *ProductColorMutation) SetColorCode(s string)

SetColorCode sets the "color_code" field.

func (*ProductColorMutation) SetCreatedAt

func (m *ProductColorMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ProductColorMutation) SetField

func (m *ProductColorMutation) 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 (*ProductColorMutation) SetID

func (m *ProductColorMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of ProductColor entities.

func (*ProductColorMutation) SetName

func (m *ProductColorMutation) SetName(s string)

SetName sets the "name" field.

func (*ProductColorMutation) SetOp

func (m *ProductColorMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ProductColorMutation) SetUpdatedAt

func (m *ProductColorMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (ProductColorMutation) Tx

func (m ProductColorMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ProductColorMutation) Type

func (m *ProductColorMutation) Type() string

Type returns the node type of this mutation (ProductColor).

func (*ProductColorMutation) UpdatedAt

func (m *ProductColorMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*ProductColorMutation) Where

Where appends a list predicates to the ProductColorMutation builder.

func (*ProductColorMutation) WhereP

func (m *ProductColorMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ProductColorMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ProductColorQuery

type ProductColorQuery struct {
	// contains filtered or unexported fields
}

ProductColorQuery is the builder for querying ProductColor entities.

func (*ProductColorQuery) Aggregate

func (pcq *ProductColorQuery) Aggregate(fns ...AggregateFunc) *ProductColorSelect

Aggregate returns a ProductColorSelect configured with the given aggregations.

func (*ProductColorQuery) All

func (pcq *ProductColorQuery) All(ctx context.Context) ([]*ProductColor, error)

All executes the query and returns a list of ProductColors.

func (*ProductColorQuery) AllX

func (pcq *ProductColorQuery) AllX(ctx context.Context) []*ProductColor

AllX is like All, but panics if an error occurs.

func (*ProductColorQuery) Clone

func (pcq *ProductColorQuery) Clone() *ProductColorQuery

Clone returns a duplicate of the ProductColorQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ProductColorQuery) Count

func (pcq *ProductColorQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ProductColorQuery) CountX

func (pcq *ProductColorQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ProductColorQuery) Exist

func (pcq *ProductColorQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ProductColorQuery) ExistX

func (pcq *ProductColorQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ProductColorQuery) First

func (pcq *ProductColorQuery) First(ctx context.Context) (*ProductColor, error)

First returns the first ProductColor entity from the query. Returns a *NotFoundError when no ProductColor was found.

func (*ProductColorQuery) FirstID

func (pcq *ProductColorQuery) FirstID(ctx context.Context) (id string, err error)

FirstID returns the first ProductColor ID from the query. Returns a *NotFoundError when no ProductColor ID was found.

func (*ProductColorQuery) FirstIDX

func (pcq *ProductColorQuery) FirstIDX(ctx context.Context) string

FirstIDX is like FirstID, but panics if an error occurs.

func (*ProductColorQuery) FirstX

func (pcq *ProductColorQuery) FirstX(ctx context.Context) *ProductColor

FirstX is like First, but panics if an error occurs.

func (*ProductColorQuery) GroupBy

func (pcq *ProductColorQuery) GroupBy(field string, fields ...string) *ProductColorGroupBy

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.ProductColor.Query().
	GroupBy(productcolor.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ProductColorQuery) IDs

func (pcq *ProductColorQuery) IDs(ctx context.Context) (ids []string, err error)

IDs executes the query and returns a list of ProductColor IDs.

func (*ProductColorQuery) IDsX

func (pcq *ProductColorQuery) IDsX(ctx context.Context) []string

IDsX is like IDs, but panics if an error occurs.

func (*ProductColorQuery) Limit

func (pcq *ProductColorQuery) Limit(limit int) *ProductColorQuery

Limit the number of records to be returned by this query.

func (*ProductColorQuery) Offset

func (pcq *ProductColorQuery) Offset(offset int) *ProductColorQuery

Offset to start from.

func (*ProductColorQuery) Only

func (pcq *ProductColorQuery) Only(ctx context.Context) (*ProductColor, error)

Only returns a single ProductColor entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ProductColor entity is found. Returns a *NotFoundError when no ProductColor entities are found.

func (*ProductColorQuery) OnlyID

func (pcq *ProductColorQuery) OnlyID(ctx context.Context) (id string, err error)

OnlyID is like Only, but returns the only ProductColor ID in the query. Returns a *NotSingularError when more than one ProductColor ID is found. Returns a *NotFoundError when no entities are found.

func (*ProductColorQuery) OnlyIDX

func (pcq *ProductColorQuery) OnlyIDX(ctx context.Context) string

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ProductColorQuery) OnlyX

func (pcq *ProductColorQuery) OnlyX(ctx context.Context) *ProductColor

OnlyX is like Only, but panics if an error occurs.

func (*ProductColorQuery) Order

Order specifies how the records should be ordered.

func (*ProductColorQuery) Select

func (pcq *ProductColorQuery) Select(fields ...string) *ProductColorSelect

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.ProductColor.Query().
	Select(productcolor.FieldCreatedAt).
	Scan(ctx, &v)

func (*ProductColorQuery) Unique

func (pcq *ProductColorQuery) Unique(unique bool) *ProductColorQuery

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 (*ProductColorQuery) Where

Where adds a new predicate for the ProductColorQuery builder.

type ProductColorSelect

type ProductColorSelect struct {
	*ProductColorQuery
	// contains filtered or unexported fields
}

ProductColorSelect is the builder for selecting fields of ProductColor entities.

func (*ProductColorSelect) Aggregate

func (pcs *ProductColorSelect) Aggregate(fns ...AggregateFunc) *ProductColorSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ProductColorSelect) Bool

func (s *ProductColorSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ProductColorSelect) BoolX

func (s *ProductColorSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ProductColorSelect) Bools

func (s *ProductColorSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ProductColorSelect) BoolsX

func (s *ProductColorSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ProductColorSelect) Float64

func (s *ProductColorSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ProductColorSelect) Float64X

func (s *ProductColorSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ProductColorSelect) Float64s

func (s *ProductColorSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ProductColorSelect) Float64sX

func (s *ProductColorSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ProductColorSelect) Int

func (s *ProductColorSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ProductColorSelect) IntX

func (s *ProductColorSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ProductColorSelect) Ints

func (s *ProductColorSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ProductColorSelect) IntsX

func (s *ProductColorSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ProductColorSelect) Scan

func (pcs *ProductColorSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ProductColorSelect) ScanX

func (s *ProductColorSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ProductColorSelect) String

func (s *ProductColorSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ProductColorSelect) StringX

func (s *ProductColorSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ProductColorSelect) Strings

func (s *ProductColorSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ProductColorSelect) StringsX

func (s *ProductColorSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ProductColorUpdate

type ProductColorUpdate struct {
	// contains filtered or unexported fields
}

ProductColorUpdate is the builder for updating ProductColor entities.

func (*ProductColorUpdate) Exec

func (pcu *ProductColorUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductColorUpdate) ExecX

func (pcu *ProductColorUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductColorUpdate) Mutation

func (pcu *ProductColorUpdate) Mutation() *ProductColorMutation

Mutation returns the ProductColorMutation object of the builder.

func (*ProductColorUpdate) Save

func (pcu *ProductColorUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ProductColorUpdate) SaveX

func (pcu *ProductColorUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ProductColorUpdate) SetColorCode

func (pcu *ProductColorUpdate) SetColorCode(s string) *ProductColorUpdate

SetColorCode sets the "color_code" field.

func (*ProductColorUpdate) SetName

func (pcu *ProductColorUpdate) SetName(s string) *ProductColorUpdate

SetName sets the "name" field.

func (*ProductColorUpdate) SetNillableColorCode

func (pcu *ProductColorUpdate) SetNillableColorCode(s *string) *ProductColorUpdate

SetNillableColorCode sets the "color_code" field if the given value is not nil.

func (*ProductColorUpdate) SetNillableName

func (pcu *ProductColorUpdate) SetNillableName(s *string) *ProductColorUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*ProductColorUpdate) SetUpdatedAt

func (pcu *ProductColorUpdate) SetUpdatedAt(t time.Time) *ProductColorUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ProductColorUpdate) Where

Where appends a list predicates to the ProductColorUpdate builder.

type ProductColorUpdateOne

type ProductColorUpdateOne struct {
	// contains filtered or unexported fields
}

ProductColorUpdateOne is the builder for updating a single ProductColor entity.

func (*ProductColorUpdateOne) Exec

func (pcuo *ProductColorUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ProductColorUpdateOne) ExecX

func (pcuo *ProductColorUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductColorUpdateOne) Mutation

func (pcuo *ProductColorUpdateOne) Mutation() *ProductColorMutation

Mutation returns the ProductColorMutation object of the builder.

func (*ProductColorUpdateOne) Save

Save executes the query and returns the updated ProductColor entity.

func (*ProductColorUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*ProductColorUpdateOne) Select

func (pcuo *ProductColorUpdateOne) Select(field string, fields ...string) *ProductColorUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ProductColorUpdateOne) SetColorCode

func (pcuo *ProductColorUpdateOne) SetColorCode(s string) *ProductColorUpdateOne

SetColorCode sets the "color_code" field.

func (*ProductColorUpdateOne) SetName

SetName sets the "name" field.

func (*ProductColorUpdateOne) SetNillableColorCode

func (pcuo *ProductColorUpdateOne) SetNillableColorCode(s *string) *ProductColorUpdateOne

SetNillableColorCode sets the "color_code" field if the given value is not nil.

func (*ProductColorUpdateOne) SetNillableName

func (pcuo *ProductColorUpdateOne) SetNillableName(s *string) *ProductColorUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*ProductColorUpdateOne) SetUpdatedAt

func (pcuo *ProductColorUpdateOne) SetUpdatedAt(t time.Time) *ProductColorUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ProductColorUpdateOne) Where

Where appends a list predicates to the ProductColorUpdate builder.

type ProductColors

type ProductColors []*ProductColor

ProductColors is a parsable slice of ProductColor.

type ProductImage

type ProductImage struct {

	// ID of the ent.
	ID uuid.UUID `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"`
	// ProductID holds the value of the "product_id" field.
	ProductID string `json:"product_id,omitempty"`
	// ImageURL holds the value of the "image_url" field.
	ImageURL string `json:"image_url,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ProductImageQuery when eager-loading is set.
	Edges ProductImageEdges `json:"edges"`
	// contains filtered or unexported fields
}

ProductImage is the model entity for the ProductImage schema.

func (*ProductImage) QueryProduct

func (pi *ProductImage) QueryProduct() *ProductInfoQuery

QueryProduct queries the "product" edge of the ProductImage entity.

func (*ProductImage) String

func (pi *ProductImage) String() string

String implements the fmt.Stringer.

func (*ProductImage) Unwrap

func (pi *ProductImage) Unwrap() *ProductImage

Unwrap unwraps the ProductImage 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 (*ProductImage) Update

func (pi *ProductImage) Update() *ProductImageUpdateOne

Update returns a builder for updating this ProductImage. Note that you need to call ProductImage.Unwrap() before calling this method if this ProductImage was returned from a transaction, and the transaction was committed or rolled back.

func (*ProductImage) Value

func (pi *ProductImage) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the ProductImage. This includes values selected through modifiers, order, etc.

type ProductImageClient

type ProductImageClient struct {
	// contains filtered or unexported fields
}

ProductImageClient is a client for the ProductImage schema.

func NewProductImageClient

func NewProductImageClient(c config) *ProductImageClient

NewProductImageClient returns a client for the ProductImage from the given config.

func (*ProductImageClient) Create

Create returns a builder for creating a ProductImage entity.

func (*ProductImageClient) CreateBulk

func (c *ProductImageClient) CreateBulk(builders ...*ProductImageCreate) *ProductImageCreateBulk

CreateBulk returns a builder for creating a bulk of ProductImage entities.

func (*ProductImageClient) Delete

Delete returns a delete builder for ProductImage.

func (*ProductImageClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ProductImageClient) DeleteOneID

func (c *ProductImageClient) DeleteOneID(id uuid.UUID) *ProductImageDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ProductImageClient) Get

Get returns a ProductImage entity by its id.

func (*ProductImageClient) GetX

GetX is like Get, but panics if an error occurs.

func (*ProductImageClient) Hooks

func (c *ProductImageClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ProductImageClient) Intercept

func (c *ProductImageClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `productimage.Intercept(f(g(h())))`.

func (*ProductImageClient) Interceptors

func (c *ProductImageClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ProductImageClient) MapCreateBulk

func (c *ProductImageClient) MapCreateBulk(slice any, setFunc func(*ProductImageCreate, int)) *ProductImageCreateBulk

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 (*ProductImageClient) Query

Query returns a query builder for ProductImage.

func (*ProductImageClient) QueryProduct

func (c *ProductImageClient) QueryProduct(pi *ProductImage) *ProductInfoQuery

QueryProduct queries the product edge of a ProductImage.

func (*ProductImageClient) Update

Update returns an update builder for ProductImage.

func (*ProductImageClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ProductImageClient) UpdateOneID

func (c *ProductImageClient) UpdateOneID(id uuid.UUID) *ProductImageUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ProductImageClient) Use

func (c *ProductImageClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `productimage.Hooks(f(g(h())))`.

type ProductImageCreate

type ProductImageCreate struct {
	// contains filtered or unexported fields
}

ProductImageCreate is the builder for creating a ProductImage entity.

func (*ProductImageCreate) Exec

func (pic *ProductImageCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductImageCreate) ExecX

func (pic *ProductImageCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductImageCreate) Mutation

func (pic *ProductImageCreate) Mutation() *ProductImageMutation

Mutation returns the ProductImageMutation object of the builder.

func (*ProductImageCreate) Save

Save creates the ProductImage in the database.

func (*ProductImageCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*ProductImageCreate) SetCreatedAt

func (pic *ProductImageCreate) SetCreatedAt(t time.Time) *ProductImageCreate

SetCreatedAt sets the "created_at" field.

func (*ProductImageCreate) SetID

SetID sets the "id" field.

func (*ProductImageCreate) SetImageURL

func (pic *ProductImageCreate) SetImageURL(s string) *ProductImageCreate

SetImageURL sets the "image_url" field.

func (*ProductImageCreate) SetNillableCreatedAt

func (pic *ProductImageCreate) SetNillableCreatedAt(t *time.Time) *ProductImageCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ProductImageCreate) SetNillableID

func (pic *ProductImageCreate) SetNillableID(u *uuid.UUID) *ProductImageCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ProductImageCreate) SetNillableUpdatedAt

func (pic *ProductImageCreate) SetNillableUpdatedAt(t *time.Time) *ProductImageCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*ProductImageCreate) SetProduct

func (pic *ProductImageCreate) SetProduct(p *ProductInfo) *ProductImageCreate

SetProduct sets the "product" edge to the ProductInfo entity.

func (*ProductImageCreate) SetProductID

func (pic *ProductImageCreate) SetProductID(s string) *ProductImageCreate

SetProductID sets the "product_id" field.

func (*ProductImageCreate) SetUpdatedAt

func (pic *ProductImageCreate) SetUpdatedAt(t time.Time) *ProductImageCreate

SetUpdatedAt sets the "updated_at" field.

type ProductImageCreateBulk

type ProductImageCreateBulk struct {
	// contains filtered or unexported fields
}

ProductImageCreateBulk is the builder for creating many ProductImage entities in bulk.

func (*ProductImageCreateBulk) Exec

func (picb *ProductImageCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductImageCreateBulk) ExecX

func (picb *ProductImageCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductImageCreateBulk) Save

Save creates the ProductImage entities in the database.

func (*ProductImageCreateBulk) SaveX

func (picb *ProductImageCreateBulk) SaveX(ctx context.Context) []*ProductImage

SaveX is like Save, but panics if an error occurs.

type ProductImageDelete

type ProductImageDelete struct {
	// contains filtered or unexported fields
}

ProductImageDelete is the builder for deleting a ProductImage entity.

func (*ProductImageDelete) Exec

func (pid *ProductImageDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ProductImageDelete) ExecX

func (pid *ProductImageDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ProductImageDelete) Where

Where appends a list predicates to the ProductImageDelete builder.

type ProductImageDeleteOne

type ProductImageDeleteOne struct {
	// contains filtered or unexported fields
}

ProductImageDeleteOne is the builder for deleting a single ProductImage entity.

func (*ProductImageDeleteOne) Exec

func (pido *ProductImageDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ProductImageDeleteOne) ExecX

func (pido *ProductImageDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductImageDeleteOne) Where

Where appends a list predicates to the ProductImageDelete builder.

type ProductImageEdges

type ProductImageEdges struct {
	// Product holds the value of the product edge.
	Product *ProductInfo `json:"product,omitempty"`
	// contains filtered or unexported fields
}

ProductImageEdges holds the relations/edges for other nodes in the graph.

func (ProductImageEdges) ProductOrErr

func (e ProductImageEdges) ProductOrErr() (*ProductInfo, 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 ProductImageGroupBy

type ProductImageGroupBy struct {
	// contains filtered or unexported fields
}

ProductImageGroupBy is the group-by builder for ProductImage entities.

func (*ProductImageGroupBy) Aggregate

func (pigb *ProductImageGroupBy) Aggregate(fns ...AggregateFunc) *ProductImageGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ProductImageGroupBy) Bool

func (s *ProductImageGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ProductImageGroupBy) BoolX

func (s *ProductImageGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ProductImageGroupBy) Bools

func (s *ProductImageGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ProductImageGroupBy) BoolsX

func (s *ProductImageGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ProductImageGroupBy) Float64

func (s *ProductImageGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ProductImageGroupBy) Float64X

func (s *ProductImageGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ProductImageGroupBy) Float64s

func (s *ProductImageGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ProductImageGroupBy) Float64sX

func (s *ProductImageGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ProductImageGroupBy) Int

func (s *ProductImageGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ProductImageGroupBy) IntX

func (s *ProductImageGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ProductImageGroupBy) Ints

func (s *ProductImageGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ProductImageGroupBy) IntsX

func (s *ProductImageGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ProductImageGroupBy) Scan

func (pigb *ProductImageGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ProductImageGroupBy) ScanX

func (s *ProductImageGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ProductImageGroupBy) String

func (s *ProductImageGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ProductImageGroupBy) StringX

func (s *ProductImageGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ProductImageGroupBy) Strings

func (s *ProductImageGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ProductImageGroupBy) StringsX

func (s *ProductImageGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ProductImageMutation

type ProductImageMutation struct {
	// contains filtered or unexported fields
}

ProductImageMutation represents an operation that mutates the ProductImage nodes in the graph.

func (*ProductImageMutation) AddField

func (m *ProductImageMutation) 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 (*ProductImageMutation) AddedEdges

func (m *ProductImageMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ProductImageMutation) AddedField

func (m *ProductImageMutation) 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 (*ProductImageMutation) AddedFields

func (m *ProductImageMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ProductImageMutation) AddedIDs

func (m *ProductImageMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ProductImageMutation) ClearEdge

func (m *ProductImageMutation) 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 (*ProductImageMutation) ClearField

func (m *ProductImageMutation) 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 (*ProductImageMutation) ClearProduct

func (m *ProductImageMutation) ClearProduct()

ClearProduct clears the "product" edge to the ProductInfo entity.

func (*ProductImageMutation) ClearedEdges

func (m *ProductImageMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ProductImageMutation) ClearedFields

func (m *ProductImageMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ProductImageMutation) Client

func (m ProductImageMutation) 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 (*ProductImageMutation) CreatedAt

func (m *ProductImageMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ProductImageMutation) EdgeCleared

func (m *ProductImageMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ProductImageMutation) Field

func (m *ProductImageMutation) 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 (*ProductImageMutation) FieldCleared

func (m *ProductImageMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ProductImageMutation) Fields

func (m *ProductImageMutation) 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 (*ProductImageMutation) ID

func (m *ProductImageMutation) ID() (id uuid.UUID, 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 (*ProductImageMutation) 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 (*ProductImageMutation) ImageURL

func (m *ProductImageMutation) ImageURL() (r string, exists bool)

ImageURL returns the value of the "image_url" field in the mutation.

func (*ProductImageMutation) OldCreatedAt

func (m *ProductImageMutation) OldCreatedAt(ctx context.Context) (v *time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the ProductImage entity. If the ProductImage 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 (*ProductImageMutation) OldField

func (m *ProductImageMutation) 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 (*ProductImageMutation) OldImageURL

func (m *ProductImageMutation) OldImageURL(ctx context.Context) (v string, err error)

OldImageURL returns the old "image_url" field's value of the ProductImage entity. If the ProductImage 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 (*ProductImageMutation) OldProductID

func (m *ProductImageMutation) OldProductID(ctx context.Context) (v string, err error)

OldProductID returns the old "product_id" field's value of the ProductImage entity. If the ProductImage 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 (*ProductImageMutation) OldUpdatedAt

func (m *ProductImageMutation) OldUpdatedAt(ctx context.Context) (v *time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the ProductImage entity. If the ProductImage 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 (*ProductImageMutation) Op

func (m *ProductImageMutation) Op() Op

Op returns the operation name.

func (*ProductImageMutation) ProductCleared

func (m *ProductImageMutation) ProductCleared() bool

ProductCleared reports if the "product" edge to the ProductInfo entity was cleared.

func (*ProductImageMutation) ProductID

func (m *ProductImageMutation) ProductID() (r string, exists bool)

ProductID returns the value of the "product_id" field in the mutation.

func (*ProductImageMutation) ProductIDs

func (m *ProductImageMutation) ProductIDs() (ids []string)

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 (*ProductImageMutation) RemovedEdges

func (m *ProductImageMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ProductImageMutation) RemovedIDs

func (m *ProductImageMutation) 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 (*ProductImageMutation) ResetCreatedAt

func (m *ProductImageMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ProductImageMutation) ResetEdge

func (m *ProductImageMutation) 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 (*ProductImageMutation) ResetField

func (m *ProductImageMutation) 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 (*ProductImageMutation) ResetImageURL

func (m *ProductImageMutation) ResetImageURL()

ResetImageURL resets all changes to the "image_url" field.

func (*ProductImageMutation) ResetProduct

func (m *ProductImageMutation) ResetProduct()

ResetProduct resets all changes to the "product" edge.

func (*ProductImageMutation) ResetProductID

func (m *ProductImageMutation) ResetProductID()

ResetProductID resets all changes to the "product_id" field.

func (*ProductImageMutation) ResetUpdatedAt

func (m *ProductImageMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ProductImageMutation) SetCreatedAt

func (m *ProductImageMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ProductImageMutation) SetField

func (m *ProductImageMutation) 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 (*ProductImageMutation) SetID

func (m *ProductImageMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of ProductImage entities.

func (*ProductImageMutation) SetImageURL

func (m *ProductImageMutation) SetImageURL(s string)

SetImageURL sets the "image_url" field.

func (*ProductImageMutation) SetOp

func (m *ProductImageMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ProductImageMutation) SetProductID

func (m *ProductImageMutation) SetProductID(s string)

SetProductID sets the "product_id" field.

func (*ProductImageMutation) SetUpdatedAt

func (m *ProductImageMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (ProductImageMutation) Tx

func (m ProductImageMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ProductImageMutation) Type

func (m *ProductImageMutation) Type() string

Type returns the node type of this mutation (ProductImage).

func (*ProductImageMutation) UpdatedAt

func (m *ProductImageMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*ProductImageMutation) Where

Where appends a list predicates to the ProductImageMutation builder.

func (*ProductImageMutation) WhereP

func (m *ProductImageMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ProductImageMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ProductImageQuery

type ProductImageQuery struct {
	// contains filtered or unexported fields
}

ProductImageQuery is the builder for querying ProductImage entities.

func (*ProductImageQuery) Aggregate

func (piq *ProductImageQuery) Aggregate(fns ...AggregateFunc) *ProductImageSelect

Aggregate returns a ProductImageSelect configured with the given aggregations.

func (*ProductImageQuery) All

func (piq *ProductImageQuery) All(ctx context.Context) ([]*ProductImage, error)

All executes the query and returns a list of ProductImages.

func (*ProductImageQuery) AllX

func (piq *ProductImageQuery) AllX(ctx context.Context) []*ProductImage

AllX is like All, but panics if an error occurs.

func (*ProductImageQuery) Clone

func (piq *ProductImageQuery) Clone() *ProductImageQuery

Clone returns a duplicate of the ProductImageQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ProductImageQuery) Count

func (piq *ProductImageQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ProductImageQuery) CountX

func (piq *ProductImageQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ProductImageQuery) Exist

func (piq *ProductImageQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ProductImageQuery) ExistX

func (piq *ProductImageQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ProductImageQuery) First

func (piq *ProductImageQuery) First(ctx context.Context) (*ProductImage, error)

First returns the first ProductImage entity from the query. Returns a *NotFoundError when no ProductImage was found.

func (*ProductImageQuery) FirstID

func (piq *ProductImageQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first ProductImage ID from the query. Returns a *NotFoundError when no ProductImage ID was found.

func (*ProductImageQuery) FirstIDX

func (piq *ProductImageQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*ProductImageQuery) FirstX

func (piq *ProductImageQuery) FirstX(ctx context.Context) *ProductImage

FirstX is like First, but panics if an error occurs.

func (*ProductImageQuery) GroupBy

func (piq *ProductImageQuery) GroupBy(field string, fields ...string) *ProductImageGroupBy

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.ProductImage.Query().
	GroupBy(productimage.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ProductImageQuery) IDs

func (piq *ProductImageQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of ProductImage IDs.

func (*ProductImageQuery) IDsX

func (piq *ProductImageQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*ProductImageQuery) Limit

func (piq *ProductImageQuery) Limit(limit int) *ProductImageQuery

Limit the number of records to be returned by this query.

func (*ProductImageQuery) Offset

func (piq *ProductImageQuery) Offset(offset int) *ProductImageQuery

Offset to start from.

func (*ProductImageQuery) Only

func (piq *ProductImageQuery) Only(ctx context.Context) (*ProductImage, error)

Only returns a single ProductImage entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ProductImage entity is found. Returns a *NotFoundError when no ProductImage entities are found.

func (*ProductImageQuery) OnlyID

func (piq *ProductImageQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only ProductImage ID in the query. Returns a *NotSingularError when more than one ProductImage ID is found. Returns a *NotFoundError when no entities are found.

func (*ProductImageQuery) OnlyIDX

func (piq *ProductImageQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ProductImageQuery) OnlyX

func (piq *ProductImageQuery) OnlyX(ctx context.Context) *ProductImage

OnlyX is like Only, but panics if an error occurs.

func (*ProductImageQuery) Order

Order specifies how the records should be ordered.

func (*ProductImageQuery) QueryProduct

func (piq *ProductImageQuery) QueryProduct() *ProductInfoQuery

QueryProduct chains the current query on the "product" edge.

func (*ProductImageQuery) Select

func (piq *ProductImageQuery) Select(fields ...string) *ProductImageSelect

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.ProductImage.Query().
	Select(productimage.FieldCreatedAt).
	Scan(ctx, &v)

func (*ProductImageQuery) Unique

func (piq *ProductImageQuery) Unique(unique bool) *ProductImageQuery

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 (*ProductImageQuery) Where

Where adds a new predicate for the ProductImageQuery builder.

func (*ProductImageQuery) WithProduct

func (piq *ProductImageQuery) WithProduct(opts ...func(*ProductInfoQuery)) *ProductImageQuery

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 ProductImageSelect

type ProductImageSelect struct {
	*ProductImageQuery
	// contains filtered or unexported fields
}

ProductImageSelect is the builder for selecting fields of ProductImage entities.

func (*ProductImageSelect) Aggregate

func (pis *ProductImageSelect) Aggregate(fns ...AggregateFunc) *ProductImageSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ProductImageSelect) Bool

func (s *ProductImageSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ProductImageSelect) BoolX

func (s *ProductImageSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ProductImageSelect) Bools

func (s *ProductImageSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ProductImageSelect) BoolsX

func (s *ProductImageSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ProductImageSelect) Float64

func (s *ProductImageSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ProductImageSelect) Float64X

func (s *ProductImageSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ProductImageSelect) Float64s

func (s *ProductImageSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ProductImageSelect) Float64sX

func (s *ProductImageSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ProductImageSelect) Int

func (s *ProductImageSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ProductImageSelect) IntX

func (s *ProductImageSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ProductImageSelect) Ints

func (s *ProductImageSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ProductImageSelect) IntsX

func (s *ProductImageSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ProductImageSelect) Scan

func (pis *ProductImageSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ProductImageSelect) ScanX

func (s *ProductImageSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ProductImageSelect) String

func (s *ProductImageSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ProductImageSelect) StringX

func (s *ProductImageSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ProductImageSelect) Strings

func (s *ProductImageSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ProductImageSelect) StringsX

func (s *ProductImageSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ProductImageUpdate

type ProductImageUpdate struct {
	// contains filtered or unexported fields
}

ProductImageUpdate is the builder for updating ProductImage entities.

func (*ProductImageUpdate) Exec

func (piu *ProductImageUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductImageUpdate) ExecX

func (piu *ProductImageUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductImageUpdate) Mutation

func (piu *ProductImageUpdate) Mutation() *ProductImageMutation

Mutation returns the ProductImageMutation object of the builder.

func (*ProductImageUpdate) Save

func (piu *ProductImageUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ProductImageUpdate) SaveX

func (piu *ProductImageUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ProductImageUpdate) SetUpdatedAt

func (piu *ProductImageUpdate) SetUpdatedAt(t time.Time) *ProductImageUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ProductImageUpdate) Where

Where appends a list predicates to the ProductImageUpdate builder.

type ProductImageUpdateOne

type ProductImageUpdateOne struct {
	// contains filtered or unexported fields
}

ProductImageUpdateOne is the builder for updating a single ProductImage entity.

func (*ProductImageUpdateOne) Exec

func (piuo *ProductImageUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ProductImageUpdateOne) ExecX

func (piuo *ProductImageUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductImageUpdateOne) Mutation

func (piuo *ProductImageUpdateOne) Mutation() *ProductImageMutation

Mutation returns the ProductImageMutation object of the builder.

func (*ProductImageUpdateOne) Save

Save executes the query and returns the updated ProductImage entity.

func (*ProductImageUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*ProductImageUpdateOne) Select

func (piuo *ProductImageUpdateOne) Select(field string, fields ...string) *ProductImageUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ProductImageUpdateOne) SetUpdatedAt

func (piuo *ProductImageUpdateOne) SetUpdatedAt(t time.Time) *ProductImageUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ProductImageUpdateOne) Where

Where appends a list predicates to the ProductImageUpdate builder.

type ProductImages

type ProductImages []*ProductImage

ProductImages is a parsable slice of ProductImage.

type ProductInfo

type ProductInfo struct {

	// ID of the ent.
	ID string `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"`
	// 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"`
	// Year holds the value of the "year" field.
	Year *int `json:"year,omitempty"`
	// Provider holds the value of the "provider" field.
	Provider *string `json:"provider,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ProductInfoQuery when eager-loading is set.
	Edges ProductInfoEdges `json:"edges"`
	// contains filtered or unexported fields
}

ProductInfo is the model entity for the ProductInfo schema.

func (*ProductInfo) QueryProductTags

func (pi *ProductInfo) QueryProductTags() *ProductTagQuery

QueryProductTags queries the "product_tags" edge of the ProductInfo entity.

func (*ProductInfo) QueryTags

func (pi *ProductInfo) QueryTags() *TagQuery

QueryTags queries the "tags" edge of the ProductInfo entity.

func (*ProductInfo) String

func (pi *ProductInfo) String() string

String implements the fmt.Stringer.

func (*ProductInfo) Unwrap

func (pi *ProductInfo) Unwrap() *ProductInfo

Unwrap unwraps the ProductInfo 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 (*ProductInfo) Update

func (pi *ProductInfo) Update() *ProductInfoUpdateOne

Update returns a builder for updating this ProductInfo. Note that you need to call ProductInfo.Unwrap() before calling this method if this ProductInfo was returned from a transaction, and the transaction was committed or rolled back.

func (*ProductInfo) Value

func (pi *ProductInfo) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the ProductInfo. This includes values selected through modifiers, order, etc.

type ProductInfoClient

type ProductInfoClient struct {
	// contains filtered or unexported fields
}

ProductInfoClient is a client for the ProductInfo schema.

func NewProductInfoClient

func NewProductInfoClient(c config) *ProductInfoClient

NewProductInfoClient returns a client for the ProductInfo from the given config.

func (*ProductInfoClient) Create

func (c *ProductInfoClient) Create() *ProductInfoCreate

Create returns a builder for creating a ProductInfo entity.

func (*ProductInfoClient) CreateBulk

func (c *ProductInfoClient) CreateBulk(builders ...*ProductInfoCreate) *ProductInfoCreateBulk

CreateBulk returns a builder for creating a bulk of ProductInfo entities.

func (*ProductInfoClient) Delete

func (c *ProductInfoClient) Delete() *ProductInfoDelete

Delete returns a delete builder for ProductInfo.

func (*ProductInfoClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ProductInfoClient) DeleteOneID

func (c *ProductInfoClient) DeleteOneID(id string) *ProductInfoDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ProductInfoClient) Get

Get returns a ProductInfo entity by its id.

func (*ProductInfoClient) GetX

GetX is like Get, but panics if an error occurs.

func (*ProductInfoClient) Hooks

func (c *ProductInfoClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ProductInfoClient) Intercept

func (c *ProductInfoClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `productinfo.Intercept(f(g(h())))`.

func (*ProductInfoClient) Interceptors

func (c *ProductInfoClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ProductInfoClient) MapCreateBulk

func (c *ProductInfoClient) MapCreateBulk(slice any, setFunc func(*ProductInfoCreate, int)) *ProductInfoCreateBulk

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 (*ProductInfoClient) Query

func (c *ProductInfoClient) Query() *ProductInfoQuery

Query returns a query builder for ProductInfo.

func (*ProductInfoClient) QueryProductTags

func (c *ProductInfoClient) QueryProductTags(pi *ProductInfo) *ProductTagQuery

QueryProductTags queries the product_tags edge of a ProductInfo.

func (*ProductInfoClient) QueryTags

func (c *ProductInfoClient) QueryTags(pi *ProductInfo) *TagQuery

QueryTags queries the tags edge of a ProductInfo.

func (*ProductInfoClient) Update

func (c *ProductInfoClient) Update() *ProductInfoUpdate

Update returns an update builder for ProductInfo.

func (*ProductInfoClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ProductInfoClient) UpdateOneID

func (c *ProductInfoClient) UpdateOneID(id string) *ProductInfoUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ProductInfoClient) Use

func (c *ProductInfoClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `productinfo.Hooks(f(g(h())))`.

type ProductInfoCreate

type ProductInfoCreate struct {
	// contains filtered or unexported fields
}

ProductInfoCreate is the builder for creating a ProductInfo entity.

func (*ProductInfoCreate) AddTagIDs

func (pic *ProductInfoCreate) AddTagIDs(ids ...string) *ProductInfoCreate

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*ProductInfoCreate) AddTags

func (pic *ProductInfoCreate) AddTags(t ...*Tag) *ProductInfoCreate

AddTags adds the "tags" edges to the Tag entity.

func (*ProductInfoCreate) Exec

func (pic *ProductInfoCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductInfoCreate) ExecX

func (pic *ProductInfoCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductInfoCreate) Mutation

func (pic *ProductInfoCreate) Mutation() *ProductInfoMutation

Mutation returns the ProductInfoMutation object of the builder.

func (*ProductInfoCreate) Save

func (pic *ProductInfoCreate) Save(ctx context.Context) (*ProductInfo, error)

Save creates the ProductInfo in the database.

func (*ProductInfoCreate) SaveX

func (pic *ProductInfoCreate) SaveX(ctx context.Context) *ProductInfo

SaveX calls Save and panics if Save returns an error.

func (*ProductInfoCreate) SetCreatedAt

func (pic *ProductInfoCreate) SetCreatedAt(t time.Time) *ProductInfoCreate

SetCreatedAt sets the "created_at" field.

func (*ProductInfoCreate) SetDescription

func (pic *ProductInfoCreate) SetDescription(s string) *ProductInfoCreate

SetDescription sets the "description" field.

func (*ProductInfoCreate) SetID

SetID sets the "id" field.

func (*ProductInfoCreate) SetName

func (pic *ProductInfoCreate) SetName(s string) *ProductInfoCreate

SetName sets the "name" field.

func (*ProductInfoCreate) SetNillableCreatedAt

func (pic *ProductInfoCreate) SetNillableCreatedAt(t *time.Time) *ProductInfoCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ProductInfoCreate) SetNillableDescription

func (pic *ProductInfoCreate) SetNillableDescription(s *string) *ProductInfoCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*ProductInfoCreate) SetNillableProvider

func (pic *ProductInfoCreate) SetNillableProvider(s *string) *ProductInfoCreate

SetNillableProvider sets the "provider" field if the given value is not nil.

func (*ProductInfoCreate) SetNillableUpdatedAt

func (pic *ProductInfoCreate) SetNillableUpdatedAt(t *time.Time) *ProductInfoCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*ProductInfoCreate) SetNillableYear

func (pic *ProductInfoCreate) SetNillableYear(i *int) *ProductInfoCreate

SetNillableYear sets the "year" field if the given value is not nil.

func (*ProductInfoCreate) SetProvider

func (pic *ProductInfoCreate) SetProvider(s string) *ProductInfoCreate

SetProvider sets the "provider" field.

func (*ProductInfoCreate) SetUpdatedAt

func (pic *ProductInfoCreate) SetUpdatedAt(t time.Time) *ProductInfoCreate

SetUpdatedAt sets the "updated_at" field.

func (*ProductInfoCreate) SetYear

func (pic *ProductInfoCreate) SetYear(i int) *ProductInfoCreate

SetYear sets the "year" field.

type ProductInfoCreateBulk

type ProductInfoCreateBulk struct {
	// contains filtered or unexported fields
}

ProductInfoCreateBulk is the builder for creating many ProductInfo entities in bulk.

func (*ProductInfoCreateBulk) Exec

func (picb *ProductInfoCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductInfoCreateBulk) ExecX

func (picb *ProductInfoCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductInfoCreateBulk) Save

func (picb *ProductInfoCreateBulk) Save(ctx context.Context) ([]*ProductInfo, error)

Save creates the ProductInfo entities in the database.

func (*ProductInfoCreateBulk) SaveX

func (picb *ProductInfoCreateBulk) SaveX(ctx context.Context) []*ProductInfo

SaveX is like Save, but panics if an error occurs.

type ProductInfoDelete

type ProductInfoDelete struct {
	// contains filtered or unexported fields
}

ProductInfoDelete is the builder for deleting a ProductInfo entity.

func (*ProductInfoDelete) Exec

func (pid *ProductInfoDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ProductInfoDelete) ExecX

func (pid *ProductInfoDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ProductInfoDelete) Where

Where appends a list predicates to the ProductInfoDelete builder.

type ProductInfoDeleteOne

type ProductInfoDeleteOne struct {
	// contains filtered or unexported fields
}

ProductInfoDeleteOne is the builder for deleting a single ProductInfo entity.

func (*ProductInfoDeleteOne) Exec

func (pido *ProductInfoDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ProductInfoDeleteOne) ExecX

func (pido *ProductInfoDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductInfoDeleteOne) Where

Where appends a list predicates to the ProductInfoDelete builder.

type ProductInfoEdges

type ProductInfoEdges struct {
	// Tags holds the value of the tags edge.
	Tags []*Tag `json:"tags,omitempty"`
	// ProductTags holds the value of the product_tags edge.
	ProductTags []*ProductTag `json:"product_tags,omitempty"`
	// contains filtered or unexported fields
}

ProductInfoEdges holds the relations/edges for other nodes in the graph.

func (ProductInfoEdges) ProductTagsOrErr

func (e ProductInfoEdges) ProductTagsOrErr() ([]*ProductTag, error)

ProductTagsOrErr returns the ProductTags value or an error if the edge was not loaded in eager-loading.

func (ProductInfoEdges) TagsOrErr

func (e ProductInfoEdges) TagsOrErr() ([]*Tag, error)

TagsOrErr returns the Tags value or an error if the edge was not loaded in eager-loading.

type ProductInfoGroupBy

type ProductInfoGroupBy struct {
	// contains filtered or unexported fields
}

ProductInfoGroupBy is the group-by builder for ProductInfo entities.

func (*ProductInfoGroupBy) Aggregate

func (pigb *ProductInfoGroupBy) Aggregate(fns ...AggregateFunc) *ProductInfoGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ProductInfoGroupBy) Bool

func (s *ProductInfoGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ProductInfoGroupBy) BoolX

func (s *ProductInfoGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ProductInfoGroupBy) Bools

func (s *ProductInfoGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ProductInfoGroupBy) BoolsX

func (s *ProductInfoGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ProductInfoGroupBy) Float64

func (s *ProductInfoGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ProductInfoGroupBy) Float64X

func (s *ProductInfoGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ProductInfoGroupBy) Float64s

func (s *ProductInfoGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ProductInfoGroupBy) Float64sX

func (s *ProductInfoGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ProductInfoGroupBy) Int

func (s *ProductInfoGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ProductInfoGroupBy) IntX

func (s *ProductInfoGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ProductInfoGroupBy) Ints

func (s *ProductInfoGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ProductInfoGroupBy) IntsX

func (s *ProductInfoGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ProductInfoGroupBy) Scan

func (pigb *ProductInfoGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ProductInfoGroupBy) ScanX

func (s *ProductInfoGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ProductInfoGroupBy) String

func (s *ProductInfoGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ProductInfoGroupBy) StringX

func (s *ProductInfoGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ProductInfoGroupBy) Strings

func (s *ProductInfoGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ProductInfoGroupBy) StringsX

func (s *ProductInfoGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ProductInfoMutation

type ProductInfoMutation struct {
	// contains filtered or unexported fields
}

ProductInfoMutation represents an operation that mutates the ProductInfo nodes in the graph.

func (*ProductInfoMutation) AddField

func (m *ProductInfoMutation) 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 (*ProductInfoMutation) AddTagIDs

func (m *ProductInfoMutation) AddTagIDs(ids ...string)

AddTagIDs adds the "tags" edge to the Tag entity by ids.

func (*ProductInfoMutation) AddYear

func (m *ProductInfoMutation) AddYear(i int)

AddYear adds i to the "year" field.

func (*ProductInfoMutation) AddedEdges

func (m *ProductInfoMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ProductInfoMutation) AddedField

func (m *ProductInfoMutation) 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 (*ProductInfoMutation) AddedFields

func (m *ProductInfoMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ProductInfoMutation) AddedIDs

func (m *ProductInfoMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ProductInfoMutation) AddedYear

func (m *ProductInfoMutation) AddedYear() (r int, exists bool)

AddedYear returns the value that was added to the "year" field in this mutation.

func (*ProductInfoMutation) ClearDescription

func (m *ProductInfoMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*ProductInfoMutation) ClearEdge

func (m *ProductInfoMutation) 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 (*ProductInfoMutation) ClearField

func (m *ProductInfoMutation) 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 (*ProductInfoMutation) ClearProvider

func (m *ProductInfoMutation) ClearProvider()

ClearProvider clears the value of the "provider" field.

func (*ProductInfoMutation) ClearTags

func (m *ProductInfoMutation) ClearTags()

ClearTags clears the "tags" edge to the Tag entity.

func (*ProductInfoMutation) ClearYear

func (m *ProductInfoMutation) ClearYear()

ClearYear clears the value of the "year" field.

func (*ProductInfoMutation) ClearedEdges

func (m *ProductInfoMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ProductInfoMutation) ClearedFields

func (m *ProductInfoMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ProductInfoMutation) Client

func (m ProductInfoMutation) 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 (*ProductInfoMutation) CreatedAt

func (m *ProductInfoMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ProductInfoMutation) Description

func (m *ProductInfoMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*ProductInfoMutation) DescriptionCleared

func (m *ProductInfoMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*ProductInfoMutation) EdgeCleared

func (m *ProductInfoMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ProductInfoMutation) Field

func (m *ProductInfoMutation) 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 (*ProductInfoMutation) FieldCleared

func (m *ProductInfoMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ProductInfoMutation) Fields

func (m *ProductInfoMutation) 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 (*ProductInfoMutation) ID

func (m *ProductInfoMutation) ID() (id string, 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 (*ProductInfoMutation) IDs

func (m *ProductInfoMutation) IDs(ctx context.Context) ([]string, 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 (*ProductInfoMutation) Name

func (m *ProductInfoMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*ProductInfoMutation) OldCreatedAt

func (m *ProductInfoMutation) OldCreatedAt(ctx context.Context) (v *time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the ProductInfo entity. If the ProductInfo 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 (*ProductInfoMutation) OldDescription

func (m *ProductInfoMutation) OldDescription(ctx context.Context) (v *string, err error)

OldDescription returns the old "description" field's value of the ProductInfo entity. If the ProductInfo 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 (*ProductInfoMutation) OldField

func (m *ProductInfoMutation) 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 (*ProductInfoMutation) OldName

func (m *ProductInfoMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the ProductInfo entity. If the ProductInfo 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 (*ProductInfoMutation) OldProvider

func (m *ProductInfoMutation) OldProvider(ctx context.Context) (v *string, err error)

OldProvider returns the old "provider" field's value of the ProductInfo entity. If the ProductInfo 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 (*ProductInfoMutation) OldUpdatedAt

func (m *ProductInfoMutation) OldUpdatedAt(ctx context.Context) (v *time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the ProductInfo entity. If the ProductInfo 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 (*ProductInfoMutation) OldYear

func (m *ProductInfoMutation) OldYear(ctx context.Context) (v *int, err error)

OldYear returns the old "year" field's value of the ProductInfo entity. If the ProductInfo 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 (*ProductInfoMutation) Op

func (m *ProductInfoMutation) Op() Op

Op returns the operation name.

func (*ProductInfoMutation) Provider

func (m *ProductInfoMutation) Provider() (r string, exists bool)

Provider returns the value of the "provider" field in the mutation.

func (*ProductInfoMutation) ProviderCleared

func (m *ProductInfoMutation) ProviderCleared() bool

ProviderCleared returns if the "provider" field was cleared in this mutation.

func (*ProductInfoMutation) RemoveTagIDs

func (m *ProductInfoMutation) RemoveTagIDs(ids ...string)

RemoveTagIDs removes the "tags" edge to the Tag entity by IDs.

func (*ProductInfoMutation) RemovedEdges

func (m *ProductInfoMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ProductInfoMutation) RemovedIDs

func (m *ProductInfoMutation) 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 (*ProductInfoMutation) RemovedTagsIDs

func (m *ProductInfoMutation) RemovedTagsIDs() (ids []string)

RemovedTags returns the removed IDs of the "tags" edge to the Tag entity.

func (*ProductInfoMutation) ResetCreatedAt

func (m *ProductInfoMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ProductInfoMutation) ResetDescription

func (m *ProductInfoMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*ProductInfoMutation) ResetEdge

func (m *ProductInfoMutation) 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 (*ProductInfoMutation) ResetField

func (m *ProductInfoMutation) 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 (*ProductInfoMutation) ResetName

func (m *ProductInfoMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ProductInfoMutation) ResetProvider

func (m *ProductInfoMutation) ResetProvider()

ResetProvider resets all changes to the "provider" field.

func (*ProductInfoMutation) ResetTags

func (m *ProductInfoMutation) ResetTags()

ResetTags resets all changes to the "tags" edge.

func (*ProductInfoMutation) ResetUpdatedAt

func (m *ProductInfoMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ProductInfoMutation) ResetYear

func (m *ProductInfoMutation) ResetYear()

ResetYear resets all changes to the "year" field.

func (*ProductInfoMutation) SetCreatedAt

func (m *ProductInfoMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ProductInfoMutation) SetDescription

func (m *ProductInfoMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*ProductInfoMutation) SetField

func (m *ProductInfoMutation) 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 (*ProductInfoMutation) SetID

func (m *ProductInfoMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of ProductInfo entities.

func (*ProductInfoMutation) SetName

func (m *ProductInfoMutation) SetName(s string)

SetName sets the "name" field.

func (*ProductInfoMutation) SetOp

func (m *ProductInfoMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ProductInfoMutation) SetProvider

func (m *ProductInfoMutation) SetProvider(s string)

SetProvider sets the "provider" field.

func (*ProductInfoMutation) SetUpdatedAt

func (m *ProductInfoMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*ProductInfoMutation) SetYear

func (m *ProductInfoMutation) SetYear(i int)

SetYear sets the "year" field.

func (*ProductInfoMutation) TagsCleared

func (m *ProductInfoMutation) TagsCleared() bool

TagsCleared reports if the "tags" edge to the Tag entity was cleared.

func (*ProductInfoMutation) TagsIDs

func (m *ProductInfoMutation) TagsIDs() (ids []string)

TagsIDs returns the "tags" edge IDs in the mutation.

func (ProductInfoMutation) Tx

func (m ProductInfoMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ProductInfoMutation) Type

func (m *ProductInfoMutation) Type() string

Type returns the node type of this mutation (ProductInfo).

func (*ProductInfoMutation) UpdatedAt

func (m *ProductInfoMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*ProductInfoMutation) Where

func (m *ProductInfoMutation) Where(ps ...predicate.ProductInfo)

Where appends a list predicates to the ProductInfoMutation builder.

func (*ProductInfoMutation) WhereP

func (m *ProductInfoMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ProductInfoMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

func (*ProductInfoMutation) Year

func (m *ProductInfoMutation) Year() (r int, exists bool)

Year returns the value of the "year" field in the mutation.

func (*ProductInfoMutation) YearCleared

func (m *ProductInfoMutation) YearCleared() bool

YearCleared returns if the "year" field was cleared in this mutation.

type ProductInfoQuery

type ProductInfoQuery struct {
	// contains filtered or unexported fields
}

ProductInfoQuery is the builder for querying ProductInfo entities.

func (*ProductInfoQuery) Aggregate

func (piq *ProductInfoQuery) Aggregate(fns ...AggregateFunc) *ProductInfoSelect

Aggregate returns a ProductInfoSelect configured with the given aggregations.

func (*ProductInfoQuery) All

func (piq *ProductInfoQuery) All(ctx context.Context) ([]*ProductInfo, error)

All executes the query and returns a list of ProductInfos.

func (*ProductInfoQuery) AllX

func (piq *ProductInfoQuery) AllX(ctx context.Context) []*ProductInfo

AllX is like All, but panics if an error occurs.

func (*ProductInfoQuery) Clone

func (piq *ProductInfoQuery) Clone() *ProductInfoQuery

Clone returns a duplicate of the ProductInfoQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ProductInfoQuery) Count

func (piq *ProductInfoQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ProductInfoQuery) CountX

func (piq *ProductInfoQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ProductInfoQuery) Exist

func (piq *ProductInfoQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ProductInfoQuery) ExistX

func (piq *ProductInfoQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ProductInfoQuery) First

func (piq *ProductInfoQuery) First(ctx context.Context) (*ProductInfo, error)

First returns the first ProductInfo entity from the query. Returns a *NotFoundError when no ProductInfo was found.

func (*ProductInfoQuery) FirstID

func (piq *ProductInfoQuery) FirstID(ctx context.Context) (id string, err error)

FirstID returns the first ProductInfo ID from the query. Returns a *NotFoundError when no ProductInfo ID was found.

func (*ProductInfoQuery) FirstIDX

func (piq *ProductInfoQuery) FirstIDX(ctx context.Context) string

FirstIDX is like FirstID, but panics if an error occurs.

func (*ProductInfoQuery) FirstX

func (piq *ProductInfoQuery) FirstX(ctx context.Context) *ProductInfo

FirstX is like First, but panics if an error occurs.

func (*ProductInfoQuery) GroupBy

func (piq *ProductInfoQuery) GroupBy(field string, fields ...string) *ProductInfoGroupBy

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.ProductInfo.Query().
	GroupBy(productinfo.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ProductInfoQuery) IDs

func (piq *ProductInfoQuery) IDs(ctx context.Context) (ids []string, err error)

IDs executes the query and returns a list of ProductInfo IDs.

func (*ProductInfoQuery) IDsX

func (piq *ProductInfoQuery) IDsX(ctx context.Context) []string

IDsX is like IDs, but panics if an error occurs.

func (*ProductInfoQuery) Limit

func (piq *ProductInfoQuery) Limit(limit int) *ProductInfoQuery

Limit the number of records to be returned by this query.

func (*ProductInfoQuery) Offset

func (piq *ProductInfoQuery) Offset(offset int) *ProductInfoQuery

Offset to start from.

func (*ProductInfoQuery) Only

func (piq *ProductInfoQuery) Only(ctx context.Context) (*ProductInfo, error)

Only returns a single ProductInfo entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ProductInfo entity is found. Returns a *NotFoundError when no ProductInfo entities are found.

func (*ProductInfoQuery) OnlyID

func (piq *ProductInfoQuery) OnlyID(ctx context.Context) (id string, err error)

OnlyID is like Only, but returns the only ProductInfo ID in the query. Returns a *NotSingularError when more than one ProductInfo ID is found. Returns a *NotFoundError when no entities are found.

func (*ProductInfoQuery) OnlyIDX

func (piq *ProductInfoQuery) OnlyIDX(ctx context.Context) string

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ProductInfoQuery) OnlyX

func (piq *ProductInfoQuery) OnlyX(ctx context.Context) *ProductInfo

OnlyX is like Only, but panics if an error occurs.

func (*ProductInfoQuery) Order

Order specifies how the records should be ordered.

func (*ProductInfoQuery) QueryProductTags

func (piq *ProductInfoQuery) QueryProductTags() *ProductTagQuery

QueryProductTags chains the current query on the "product_tags" edge.

func (*ProductInfoQuery) QueryTags

func (piq *ProductInfoQuery) QueryTags() *TagQuery

QueryTags chains the current query on the "tags" edge.

func (*ProductInfoQuery) Select

func (piq *ProductInfoQuery) Select(fields ...string) *ProductInfoSelect

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.ProductInfo.Query().
	Select(productinfo.FieldCreatedAt).
	Scan(ctx, &v)

func (*ProductInfoQuery) Unique

func (piq *ProductInfoQuery) Unique(unique bool) *ProductInfoQuery

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 (*ProductInfoQuery) Where

Where adds a new predicate for the ProductInfoQuery builder.

func (*ProductInfoQuery) WithProductTags

func (piq *ProductInfoQuery) WithProductTags(opts ...func(*ProductTagQuery)) *ProductInfoQuery

WithProductTags tells the query-builder to eager-load the nodes that are connected to the "product_tags" edge. The optional arguments are used to configure the query builder of the edge.

func (*ProductInfoQuery) WithTags

func (piq *ProductInfoQuery) WithTags(opts ...func(*TagQuery)) *ProductInfoQuery

WithTags tells the query-builder to eager-load the nodes that are connected to the "tags" edge. The optional arguments are used to configure the query builder of the edge.

type ProductInfoSelect

type ProductInfoSelect struct {
	*ProductInfoQuery
	// contains filtered or unexported fields
}

ProductInfoSelect is the builder for selecting fields of ProductInfo entities.

func (*ProductInfoSelect) Aggregate

func (pis *ProductInfoSelect) Aggregate(fns ...AggregateFunc) *ProductInfoSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ProductInfoSelect) Bool

func (s *ProductInfoSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ProductInfoSelect) BoolX

func (s *ProductInfoSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ProductInfoSelect) Bools

func (s *ProductInfoSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ProductInfoSelect) BoolsX

func (s *ProductInfoSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ProductInfoSelect) Float64

func (s *ProductInfoSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ProductInfoSelect) Float64X

func (s *ProductInfoSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ProductInfoSelect) Float64s

func (s *ProductInfoSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ProductInfoSelect) Float64sX

func (s *ProductInfoSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ProductInfoSelect) Int

func (s *ProductInfoSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ProductInfoSelect) IntX

func (s *ProductInfoSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ProductInfoSelect) Ints

func (s *ProductInfoSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ProductInfoSelect) IntsX

func (s *ProductInfoSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ProductInfoSelect) Scan

func (pis *ProductInfoSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ProductInfoSelect) ScanX

func (s *ProductInfoSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ProductInfoSelect) String

func (s *ProductInfoSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ProductInfoSelect) StringX

func (s *ProductInfoSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ProductInfoSelect) Strings

func (s *ProductInfoSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ProductInfoSelect) StringsX

func (s *ProductInfoSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ProductInfoUpdate

type ProductInfoUpdate struct {
	// contains filtered or unexported fields
}

ProductInfoUpdate is the builder for updating ProductInfo entities.

func (*ProductInfoUpdate) AddTagIDs

func (piu *ProductInfoUpdate) AddTagIDs(ids ...string) *ProductInfoUpdate

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*ProductInfoUpdate) AddTags

func (piu *ProductInfoUpdate) AddTags(t ...*Tag) *ProductInfoUpdate

AddTags adds the "tags" edges to the Tag entity.

func (*ProductInfoUpdate) AddYear

func (piu *ProductInfoUpdate) AddYear(i int) *ProductInfoUpdate

AddYear adds i to the "year" field.

func (*ProductInfoUpdate) ClearDescription

func (piu *ProductInfoUpdate) ClearDescription() *ProductInfoUpdate

ClearDescription clears the value of the "description" field.

func (*ProductInfoUpdate) ClearProvider

func (piu *ProductInfoUpdate) ClearProvider() *ProductInfoUpdate

ClearProvider clears the value of the "provider" field.

func (*ProductInfoUpdate) ClearTags

func (piu *ProductInfoUpdate) ClearTags() *ProductInfoUpdate

ClearTags clears all "tags" edges to the Tag entity.

func (*ProductInfoUpdate) ClearYear

func (piu *ProductInfoUpdate) ClearYear() *ProductInfoUpdate

ClearYear clears the value of the "year" field.

func (*ProductInfoUpdate) Exec

func (piu *ProductInfoUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductInfoUpdate) ExecX

func (piu *ProductInfoUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductInfoUpdate) Mutation

func (piu *ProductInfoUpdate) Mutation() *ProductInfoMutation

Mutation returns the ProductInfoMutation object of the builder.

func (*ProductInfoUpdate) RemoveTagIDs

func (piu *ProductInfoUpdate) RemoveTagIDs(ids ...string) *ProductInfoUpdate

RemoveTagIDs removes the "tags" edge to Tag entities by IDs.

func (*ProductInfoUpdate) RemoveTags

func (piu *ProductInfoUpdate) RemoveTags(t ...*Tag) *ProductInfoUpdate

RemoveTags removes "tags" edges to Tag entities.

func (*ProductInfoUpdate) Save

func (piu *ProductInfoUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ProductInfoUpdate) SaveX

func (piu *ProductInfoUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ProductInfoUpdate) SetDescription

func (piu *ProductInfoUpdate) SetDescription(s string) *ProductInfoUpdate

SetDescription sets the "description" field.

func (*ProductInfoUpdate) SetName

func (piu *ProductInfoUpdate) SetName(s string) *ProductInfoUpdate

SetName sets the "name" field.

func (*ProductInfoUpdate) SetNillableDescription

func (piu *ProductInfoUpdate) SetNillableDescription(s *string) *ProductInfoUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*ProductInfoUpdate) SetNillableName

func (piu *ProductInfoUpdate) SetNillableName(s *string) *ProductInfoUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*ProductInfoUpdate) SetNillableProvider

func (piu *ProductInfoUpdate) SetNillableProvider(s *string) *ProductInfoUpdate

SetNillableProvider sets the "provider" field if the given value is not nil.

func (*ProductInfoUpdate) SetNillableYear

func (piu *ProductInfoUpdate) SetNillableYear(i *int) *ProductInfoUpdate

SetNillableYear sets the "year" field if the given value is not nil.

func (*ProductInfoUpdate) SetProvider

func (piu *ProductInfoUpdate) SetProvider(s string) *ProductInfoUpdate

SetProvider sets the "provider" field.

func (*ProductInfoUpdate) SetUpdatedAt

func (piu *ProductInfoUpdate) SetUpdatedAt(t time.Time) *ProductInfoUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ProductInfoUpdate) SetYear

func (piu *ProductInfoUpdate) SetYear(i int) *ProductInfoUpdate

SetYear sets the "year" field.

func (*ProductInfoUpdate) Where

Where appends a list predicates to the ProductInfoUpdate builder.

type ProductInfoUpdateOne

type ProductInfoUpdateOne struct {
	// contains filtered or unexported fields
}

ProductInfoUpdateOne is the builder for updating a single ProductInfo entity.

func (*ProductInfoUpdateOne) AddTagIDs

func (piuo *ProductInfoUpdateOne) AddTagIDs(ids ...string) *ProductInfoUpdateOne

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*ProductInfoUpdateOne) AddTags

func (piuo *ProductInfoUpdateOne) AddTags(t ...*Tag) *ProductInfoUpdateOne

AddTags adds the "tags" edges to the Tag entity.

func (*ProductInfoUpdateOne) AddYear

func (piuo *ProductInfoUpdateOne) AddYear(i int) *ProductInfoUpdateOne

AddYear adds i to the "year" field.

func (*ProductInfoUpdateOne) ClearDescription

func (piuo *ProductInfoUpdateOne) ClearDescription() *ProductInfoUpdateOne

ClearDescription clears the value of the "description" field.

func (*ProductInfoUpdateOne) ClearProvider

func (piuo *ProductInfoUpdateOne) ClearProvider() *ProductInfoUpdateOne

ClearProvider clears the value of the "provider" field.

func (*ProductInfoUpdateOne) ClearTags

func (piuo *ProductInfoUpdateOne) ClearTags() *ProductInfoUpdateOne

ClearTags clears all "tags" edges to the Tag entity.

func (*ProductInfoUpdateOne) ClearYear

func (piuo *ProductInfoUpdateOne) ClearYear() *ProductInfoUpdateOne

ClearYear clears the value of the "year" field.

func (*ProductInfoUpdateOne) Exec

func (piuo *ProductInfoUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ProductInfoUpdateOne) ExecX

func (piuo *ProductInfoUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductInfoUpdateOne) Mutation

func (piuo *ProductInfoUpdateOne) Mutation() *ProductInfoMutation

Mutation returns the ProductInfoMutation object of the builder.

func (*ProductInfoUpdateOne) RemoveTagIDs

func (piuo *ProductInfoUpdateOne) RemoveTagIDs(ids ...string) *ProductInfoUpdateOne

RemoveTagIDs removes the "tags" edge to Tag entities by IDs.

func (*ProductInfoUpdateOne) RemoveTags

func (piuo *ProductInfoUpdateOne) RemoveTags(t ...*Tag) *ProductInfoUpdateOne

RemoveTags removes "tags" edges to Tag entities.

func (*ProductInfoUpdateOne) Save

Save executes the query and returns the updated ProductInfo entity.

func (*ProductInfoUpdateOne) SaveX

func (piuo *ProductInfoUpdateOne) SaveX(ctx context.Context) *ProductInfo

SaveX is like Save, but panics if an error occurs.

func (*ProductInfoUpdateOne) Select

func (piuo *ProductInfoUpdateOne) Select(field string, fields ...string) *ProductInfoUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ProductInfoUpdateOne) SetDescription

func (piuo *ProductInfoUpdateOne) SetDescription(s string) *ProductInfoUpdateOne

SetDescription sets the "description" field.

func (*ProductInfoUpdateOne) SetName

SetName sets the "name" field.

func (*ProductInfoUpdateOne) SetNillableDescription

func (piuo *ProductInfoUpdateOne) SetNillableDescription(s *string) *ProductInfoUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*ProductInfoUpdateOne) SetNillableName

func (piuo *ProductInfoUpdateOne) SetNillableName(s *string) *ProductInfoUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*ProductInfoUpdateOne) SetNillableProvider

func (piuo *ProductInfoUpdateOne) SetNillableProvider(s *string) *ProductInfoUpdateOne

SetNillableProvider sets the "provider" field if the given value is not nil.

func (*ProductInfoUpdateOne) SetNillableYear

func (piuo *ProductInfoUpdateOne) SetNillableYear(i *int) *ProductInfoUpdateOne

SetNillableYear sets the "year" field if the given value is not nil.

func (*ProductInfoUpdateOne) SetProvider

func (piuo *ProductInfoUpdateOne) SetProvider(s string) *ProductInfoUpdateOne

SetProvider sets the "provider" field.

func (*ProductInfoUpdateOne) SetUpdatedAt

func (piuo *ProductInfoUpdateOne) SetUpdatedAt(t time.Time) *ProductInfoUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ProductInfoUpdateOne) SetYear

func (piuo *ProductInfoUpdateOne) SetYear(i int) *ProductInfoUpdateOne

SetYear sets the "year" field.

func (*ProductInfoUpdateOne) Where

Where appends a list predicates to the ProductInfoUpdate builder.

type ProductInfos

type ProductInfos []*ProductInfo

ProductInfos is a parsable slice of ProductInfo.

type ProductQties

type ProductQties []*ProductQty

ProductQties is a parsable slice of ProductQty.

type ProductQty

type ProductQty struct {

	// ID of the ent.
	ID uuid.UUID `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"`
	// WorkUnitID holds the value of the "work_unit_id" field.
	WorkUnitID uuid.UUID `json:"work_unit_id,omitempty"`
	// ProductID holds the value of the "product_id" field.
	ProductID string `json:"product_id,omitempty"`
	// ProductColorID holds the value of the "product_color_id" field.
	ProductColorID string `json:"product_color_id,omitempty"`
	// PricePerUnit holds the value of the "price_per_unit" field.
	PricePerUnit *decimal.Decimal `json:"price_per_unit,omitempty"`
	// Qty holds the value of the "qty" field.
	Qty *decimal.Decimal `json:"qty,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ProductQtyQuery when eager-loading is set.
	Edges ProductQtyEdges `json:"edges"`
	// contains filtered or unexported fields
}

ProductQty is the model entity for the ProductQty schema.

func (*ProductQty) QueryProduct

func (pq *ProductQty) QueryProduct() *ProductInfoQuery

QueryProduct queries the "product" edge of the ProductQty entity.

func (*ProductQty) QueryProductColor

func (pq *ProductQty) QueryProductColor() *ProductColorQuery

QueryProductColor queries the "product_color" edge of the ProductQty entity.

func (*ProductQty) QueryWorkUnit

func (pq *ProductQty) QueryWorkUnit() *WorkUnitInfoQuery

QueryWorkUnit queries the "work_unit" edge of the ProductQty entity.

func (*ProductQty) String

func (pq *ProductQty) String() string

String implements the fmt.Stringer.

func (*ProductQty) Unwrap

func (pq *ProductQty) Unwrap() *ProductQty

Unwrap unwraps the ProductQty 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 (*ProductQty) Update

func (pq *ProductQty) Update() *ProductQtyUpdateOne

Update returns a builder for updating this ProductQty. Note that you need to call ProductQty.Unwrap() before calling this method if this ProductQty was returned from a transaction, and the transaction was committed or rolled back.

func (*ProductQty) Value

func (pq *ProductQty) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the ProductQty. This includes values selected through modifiers, order, etc.

type ProductQtyClient

type ProductQtyClient struct {
	// contains filtered or unexported fields
}

ProductQtyClient is a client for the ProductQty schema.

func NewProductQtyClient

func NewProductQtyClient(c config) *ProductQtyClient

NewProductQtyClient returns a client for the ProductQty from the given config.

func (*ProductQtyClient) Create

func (c *ProductQtyClient) Create() *ProductQtyCreate

Create returns a builder for creating a ProductQty entity.

func (*ProductQtyClient) CreateBulk

func (c *ProductQtyClient) CreateBulk(builders ...*ProductQtyCreate) *ProductQtyCreateBulk

CreateBulk returns a builder for creating a bulk of ProductQty entities.

func (*ProductQtyClient) Delete

func (c *ProductQtyClient) Delete() *ProductQtyDelete

Delete returns a delete builder for ProductQty.

func (*ProductQtyClient) DeleteOne

func (c *ProductQtyClient) DeleteOne(pq *ProductQty) *ProductQtyDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ProductQtyClient) DeleteOneID

func (c *ProductQtyClient) DeleteOneID(id uuid.UUID) *ProductQtyDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ProductQtyClient) Get

Get returns a ProductQty entity by its id.

func (*ProductQtyClient) GetX

func (c *ProductQtyClient) GetX(ctx context.Context, id uuid.UUID) *ProductQty

GetX is like Get, but panics if an error occurs.

func (*ProductQtyClient) Hooks

func (c *ProductQtyClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ProductQtyClient) Intercept

func (c *ProductQtyClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `productqty.Intercept(f(g(h())))`.

func (*ProductQtyClient) Interceptors

func (c *ProductQtyClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ProductQtyClient) MapCreateBulk

func (c *ProductQtyClient) MapCreateBulk(slice any, setFunc func(*ProductQtyCreate, int)) *ProductQtyCreateBulk

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 (*ProductQtyClient) Query

func (c *ProductQtyClient) Query() *ProductQtyQuery

Query returns a query builder for ProductQty.

func (*ProductQtyClient) QueryProduct

func (c *ProductQtyClient) QueryProduct(pq *ProductQty) *ProductInfoQuery

QueryProduct queries the product edge of a ProductQty.

func (*ProductQtyClient) QueryProductColor

func (c *ProductQtyClient) QueryProductColor(pq *ProductQty) *ProductColorQuery

QueryProductColor queries the product_color edge of a ProductQty.

func (*ProductQtyClient) QueryWorkUnit

func (c *ProductQtyClient) QueryWorkUnit(pq *ProductQty) *WorkUnitInfoQuery

QueryWorkUnit queries the work_unit edge of a ProductQty.

func (*ProductQtyClient) Update

func (c *ProductQtyClient) Update() *ProductQtyUpdate

Update returns an update builder for ProductQty.

func (*ProductQtyClient) UpdateOne

func (c *ProductQtyClient) UpdateOne(pq *ProductQty) *ProductQtyUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ProductQtyClient) UpdateOneID

func (c *ProductQtyClient) UpdateOneID(id uuid.UUID) *ProductQtyUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ProductQtyClient) Use

func (c *ProductQtyClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `productqty.Hooks(f(g(h())))`.

type ProductQtyCreate

type ProductQtyCreate struct {
	// contains filtered or unexported fields
}

ProductQtyCreate is the builder for creating a ProductQty entity.

func (*ProductQtyCreate) Exec

func (pqc *ProductQtyCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductQtyCreate) ExecX

func (pqc *ProductQtyCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductQtyCreate) Mutation

func (pqc *ProductQtyCreate) Mutation() *ProductQtyMutation

Mutation returns the ProductQtyMutation object of the builder.

func (*ProductQtyCreate) Save

func (pqc *ProductQtyCreate) Save(ctx context.Context) (*ProductQty, error)

Save creates the ProductQty in the database.

func (*ProductQtyCreate) SaveX

func (pqc *ProductQtyCreate) SaveX(ctx context.Context) *ProductQty

SaveX calls Save and panics if Save returns an error.

func (*ProductQtyCreate) SetCreatedAt

func (pqc *ProductQtyCreate) SetCreatedAt(t time.Time) *ProductQtyCreate

SetCreatedAt sets the "created_at" field.

func (*ProductQtyCreate) SetID

func (pqc *ProductQtyCreate) SetID(u uuid.UUID) *ProductQtyCreate

SetID sets the "id" field.

func (*ProductQtyCreate) SetNillableCreatedAt

func (pqc *ProductQtyCreate) SetNillableCreatedAt(t *time.Time) *ProductQtyCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ProductQtyCreate) SetNillableID

func (pqc *ProductQtyCreate) SetNillableID(u *uuid.UUID) *ProductQtyCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ProductQtyCreate) SetNillableUpdatedAt

func (pqc *ProductQtyCreate) SetNillableUpdatedAt(t *time.Time) *ProductQtyCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*ProductQtyCreate) SetPricePerUnit

func (pqc *ProductQtyCreate) SetPricePerUnit(d decimal.Decimal) *ProductQtyCreate

SetPricePerUnit sets the "price_per_unit" field.

func (*ProductQtyCreate) SetProduct

func (pqc *ProductQtyCreate) SetProduct(p *ProductInfo) *ProductQtyCreate

SetProduct sets the "product" edge to the ProductInfo entity.

func (*ProductQtyCreate) SetProductColor

func (pqc *ProductQtyCreate) SetProductColor(p *ProductColor) *ProductQtyCreate

SetProductColor sets the "product_color" edge to the ProductColor entity.

func (*ProductQtyCreate) SetProductColorID

func (pqc *ProductQtyCreate) SetProductColorID(s string) *ProductQtyCreate

SetProductColorID sets the "product_color_id" field.

func (*ProductQtyCreate) SetProductID

func (pqc *ProductQtyCreate) SetProductID(s string) *ProductQtyCreate

SetProductID sets the "product_id" field.

func (*ProductQtyCreate) SetQty

SetQty sets the "qty" field.

func (*ProductQtyCreate) SetUpdatedAt

func (pqc *ProductQtyCreate) SetUpdatedAt(t time.Time) *ProductQtyCreate

SetUpdatedAt sets the "updated_at" field.

func (*ProductQtyCreate) SetWorkUnit

func (pqc *ProductQtyCreate) SetWorkUnit(w *WorkUnitInfo) *ProductQtyCreate

SetWorkUnit sets the "work_unit" edge to the WorkUnitInfo entity.

func (*ProductQtyCreate) SetWorkUnitID

func (pqc *ProductQtyCreate) SetWorkUnitID(u uuid.UUID) *ProductQtyCreate

SetWorkUnitID sets the "work_unit_id" field.

type ProductQtyCreateBulk

type ProductQtyCreateBulk struct {
	// contains filtered or unexported fields
}

ProductQtyCreateBulk is the builder for creating many ProductQty entities in bulk.

func (*ProductQtyCreateBulk) Exec

func (pqcb *ProductQtyCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductQtyCreateBulk) ExecX

func (pqcb *ProductQtyCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductQtyCreateBulk) Save

func (pqcb *ProductQtyCreateBulk) Save(ctx context.Context) ([]*ProductQty, error)

Save creates the ProductQty entities in the database.

func (*ProductQtyCreateBulk) SaveX

func (pqcb *ProductQtyCreateBulk) SaveX(ctx context.Context) []*ProductQty

SaveX is like Save, but panics if an error occurs.

type ProductQtyDelete

type ProductQtyDelete struct {
	// contains filtered or unexported fields
}

ProductQtyDelete is the builder for deleting a ProductQty entity.

func (*ProductQtyDelete) Exec

func (pqd *ProductQtyDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ProductQtyDelete) ExecX

func (pqd *ProductQtyDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ProductQtyDelete) Where

Where appends a list predicates to the ProductQtyDelete builder.

type ProductQtyDeleteOne

type ProductQtyDeleteOne struct {
	// contains filtered or unexported fields
}

ProductQtyDeleteOne is the builder for deleting a single ProductQty entity.

func (*ProductQtyDeleteOne) Exec

func (pqdo *ProductQtyDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ProductQtyDeleteOne) ExecX

func (pqdo *ProductQtyDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductQtyDeleteOne) Where

Where appends a list predicates to the ProductQtyDelete builder.

type ProductQtyEdges

type ProductQtyEdges struct {
	// WorkUnit holds the value of the work_unit edge.
	WorkUnit *WorkUnitInfo `json:"work_unit,omitempty"`
	// Product holds the value of the product edge.
	Product *ProductInfo `json:"product,omitempty"`
	// ProductColor holds the value of the product_color edge.
	ProductColor *ProductColor `json:"product_color,omitempty"`
	// contains filtered or unexported fields
}

ProductQtyEdges holds the relations/edges for other nodes in the graph.

func (ProductQtyEdges) ProductColorOrErr

func (e ProductQtyEdges) ProductColorOrErr() (*ProductColor, error)

ProductColorOrErr returns the ProductColor value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ProductQtyEdges) ProductOrErr

func (e ProductQtyEdges) ProductOrErr() (*ProductInfo, 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 (ProductQtyEdges) WorkUnitOrErr

func (e ProductQtyEdges) WorkUnitOrErr() (*WorkUnitInfo, error)

WorkUnitOrErr returns the WorkUnit value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type ProductQtyGroupBy

type ProductQtyGroupBy struct {
	// contains filtered or unexported fields
}

ProductQtyGroupBy is the group-by builder for ProductQty entities.

func (*ProductQtyGroupBy) Aggregate

func (pqgb *ProductQtyGroupBy) Aggregate(fns ...AggregateFunc) *ProductQtyGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ProductQtyGroupBy) Bool

func (s *ProductQtyGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ProductQtyGroupBy) BoolX

func (s *ProductQtyGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ProductQtyGroupBy) Bools

func (s *ProductQtyGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ProductQtyGroupBy) BoolsX

func (s *ProductQtyGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ProductQtyGroupBy) Float64

func (s *ProductQtyGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ProductQtyGroupBy) Float64X

func (s *ProductQtyGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ProductQtyGroupBy) Float64s

func (s *ProductQtyGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ProductQtyGroupBy) Float64sX

func (s *ProductQtyGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ProductQtyGroupBy) Int

func (s *ProductQtyGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ProductQtyGroupBy) IntX

func (s *ProductQtyGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ProductQtyGroupBy) Ints

func (s *ProductQtyGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ProductQtyGroupBy) IntsX

func (s *ProductQtyGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ProductQtyGroupBy) Scan

func (pqgb *ProductQtyGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ProductQtyGroupBy) ScanX

func (s *ProductQtyGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ProductQtyGroupBy) String

func (s *ProductQtyGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ProductQtyGroupBy) StringX

func (s *ProductQtyGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ProductQtyGroupBy) Strings

func (s *ProductQtyGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ProductQtyGroupBy) StringsX

func (s *ProductQtyGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ProductQtyMutation

type ProductQtyMutation struct {
	// contains filtered or unexported fields
}

ProductQtyMutation represents an operation that mutates the ProductQty nodes in the graph.

func (*ProductQtyMutation) AddField

func (m *ProductQtyMutation) 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 (*ProductQtyMutation) AddPricePerUnit

func (m *ProductQtyMutation) AddPricePerUnit(d decimal.Decimal)

AddPricePerUnit adds d to the "price_per_unit" field.

func (*ProductQtyMutation) AddQty

func (m *ProductQtyMutation) AddQty(d decimal.Decimal)

AddQty adds d to the "qty" field.

func (*ProductQtyMutation) AddedEdges

func (m *ProductQtyMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ProductQtyMutation) AddedField

func (m *ProductQtyMutation) 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 (*ProductQtyMutation) AddedFields

func (m *ProductQtyMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ProductQtyMutation) AddedIDs

func (m *ProductQtyMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ProductQtyMutation) AddedPricePerUnit

func (m *ProductQtyMutation) AddedPricePerUnit() (r decimal.Decimal, exists bool)

AddedPricePerUnit returns the value that was added to the "price_per_unit" field in this mutation.

func (*ProductQtyMutation) AddedQty

func (m *ProductQtyMutation) AddedQty() (r decimal.Decimal, exists bool)

AddedQty returns the value that was added to the "qty" field in this mutation.

func (*ProductQtyMutation) ClearEdge

func (m *ProductQtyMutation) 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 (*ProductQtyMutation) ClearField

func (m *ProductQtyMutation) 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 (*ProductQtyMutation) ClearProduct

func (m *ProductQtyMutation) ClearProduct()

ClearProduct clears the "product" edge to the ProductInfo entity.

func (*ProductQtyMutation) ClearProductColor

func (m *ProductQtyMutation) ClearProductColor()

ClearProductColor clears the "product_color" edge to the ProductColor entity.

func (*ProductQtyMutation) ClearWorkUnit

func (m *ProductQtyMutation) ClearWorkUnit()

ClearWorkUnit clears the "work_unit" edge to the WorkUnitInfo entity.

func (*ProductQtyMutation) ClearedEdges

func (m *ProductQtyMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ProductQtyMutation) ClearedFields

func (m *ProductQtyMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ProductQtyMutation) Client

func (m ProductQtyMutation) 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 (*ProductQtyMutation) CreatedAt

func (m *ProductQtyMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ProductQtyMutation) EdgeCleared

func (m *ProductQtyMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ProductQtyMutation) Field

func (m *ProductQtyMutation) 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 (*ProductQtyMutation) FieldCleared

func (m *ProductQtyMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ProductQtyMutation) Fields

func (m *ProductQtyMutation) 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 (*ProductQtyMutation) ID

func (m *ProductQtyMutation) ID() (id uuid.UUID, 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 (*ProductQtyMutation) IDs

func (m *ProductQtyMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*ProductQtyMutation) OldCreatedAt

func (m *ProductQtyMutation) OldCreatedAt(ctx context.Context) (v *time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the ProductQty entity. If the ProductQty 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 (*ProductQtyMutation) OldField

func (m *ProductQtyMutation) 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 (*ProductQtyMutation) OldPricePerUnit

func (m *ProductQtyMutation) OldPricePerUnit(ctx context.Context) (v *decimal.Decimal, err error)

OldPricePerUnit returns the old "price_per_unit" field's value of the ProductQty entity. If the ProductQty 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 (*ProductQtyMutation) OldProductColorID

func (m *ProductQtyMutation) OldProductColorID(ctx context.Context) (v string, err error)

OldProductColorID returns the old "product_color_id" field's value of the ProductQty entity. If the ProductQty 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 (*ProductQtyMutation) OldProductID

func (m *ProductQtyMutation) OldProductID(ctx context.Context) (v string, err error)

OldProductID returns the old "product_id" field's value of the ProductQty entity. If the ProductQty 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 (*ProductQtyMutation) OldQty

func (m *ProductQtyMutation) OldQty(ctx context.Context) (v *decimal.Decimal, err error)

OldQty returns the old "qty" field's value of the ProductQty entity. If the ProductQty 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 (*ProductQtyMutation) OldUpdatedAt

func (m *ProductQtyMutation) OldUpdatedAt(ctx context.Context) (v *time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the ProductQty entity. If the ProductQty 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 (*ProductQtyMutation) OldWorkUnitID

func (m *ProductQtyMutation) OldWorkUnitID(ctx context.Context) (v uuid.UUID, err error)

OldWorkUnitID returns the old "work_unit_id" field's value of the ProductQty entity. If the ProductQty 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 (*ProductQtyMutation) Op

func (m *ProductQtyMutation) Op() Op

Op returns the operation name.

func (*ProductQtyMutation) PricePerUnit

func (m *ProductQtyMutation) PricePerUnit() (r decimal.Decimal, exists bool)

PricePerUnit returns the value of the "price_per_unit" field in the mutation.

func (*ProductQtyMutation) ProductCleared

func (m *ProductQtyMutation) ProductCleared() bool

ProductCleared reports if the "product" edge to the ProductInfo entity was cleared.

func (*ProductQtyMutation) ProductColorCleared

func (m *ProductQtyMutation) ProductColorCleared() bool

ProductColorCleared reports if the "product_color" edge to the ProductColor entity was cleared.

func (*ProductQtyMutation) ProductColorID

func (m *ProductQtyMutation) ProductColorID() (r string, exists bool)

ProductColorID returns the value of the "product_color_id" field in the mutation.

func (*ProductQtyMutation) ProductColorIDs

func (m *ProductQtyMutation) ProductColorIDs() (ids []string)

ProductColorIDs returns the "product_color" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ProductColorID instead. It exists only for internal usage by the builders.

func (*ProductQtyMutation) ProductID

func (m *ProductQtyMutation) ProductID() (r string, exists bool)

ProductID returns the value of the "product_id" field in the mutation.

func (*ProductQtyMutation) ProductIDs

func (m *ProductQtyMutation) ProductIDs() (ids []string)

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 (*ProductQtyMutation) Qty

func (m *ProductQtyMutation) Qty() (r decimal.Decimal, exists bool)

Qty returns the value of the "qty" field in the mutation.

func (*ProductQtyMutation) RemovedEdges

func (m *ProductQtyMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ProductQtyMutation) RemovedIDs

func (m *ProductQtyMutation) 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 (*ProductQtyMutation) ResetCreatedAt

func (m *ProductQtyMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ProductQtyMutation) ResetEdge

func (m *ProductQtyMutation) 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 (*ProductQtyMutation) ResetField

func (m *ProductQtyMutation) 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 (*ProductQtyMutation) ResetPricePerUnit

func (m *ProductQtyMutation) ResetPricePerUnit()

ResetPricePerUnit resets all changes to the "price_per_unit" field.

func (*ProductQtyMutation) ResetProduct

func (m *ProductQtyMutation) ResetProduct()

ResetProduct resets all changes to the "product" edge.

func (*ProductQtyMutation) ResetProductColor

func (m *ProductQtyMutation) ResetProductColor()

ResetProductColor resets all changes to the "product_color" edge.

func (*ProductQtyMutation) ResetProductColorID

func (m *ProductQtyMutation) ResetProductColorID()

ResetProductColorID resets all changes to the "product_color_id" field.

func (*ProductQtyMutation) ResetProductID

func (m *ProductQtyMutation) ResetProductID()

ResetProductID resets all changes to the "product_id" field.

func (*ProductQtyMutation) ResetQty

func (m *ProductQtyMutation) ResetQty()

ResetQty resets all changes to the "qty" field.

func (*ProductQtyMutation) ResetUpdatedAt

func (m *ProductQtyMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ProductQtyMutation) ResetWorkUnit

func (m *ProductQtyMutation) ResetWorkUnit()

ResetWorkUnit resets all changes to the "work_unit" edge.

func (*ProductQtyMutation) ResetWorkUnitID

func (m *ProductQtyMutation) ResetWorkUnitID()

ResetWorkUnitID resets all changes to the "work_unit_id" field.

func (*ProductQtyMutation) SetCreatedAt

func (m *ProductQtyMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ProductQtyMutation) SetField

func (m *ProductQtyMutation) 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 (*ProductQtyMutation) SetID

func (m *ProductQtyMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of ProductQty entities.

func (*ProductQtyMutation) SetOp

func (m *ProductQtyMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ProductQtyMutation) SetPricePerUnit

func (m *ProductQtyMutation) SetPricePerUnit(d decimal.Decimal)

SetPricePerUnit sets the "price_per_unit" field.

func (*ProductQtyMutation) SetProductColorID

func (m *ProductQtyMutation) SetProductColorID(s string)

SetProductColorID sets the "product_color_id" field.

func (*ProductQtyMutation) SetProductID

func (m *ProductQtyMutation) SetProductID(s string)

SetProductID sets the "product_id" field.

func (*ProductQtyMutation) SetQty

func (m *ProductQtyMutation) SetQty(d decimal.Decimal)

SetQty sets the "qty" field.

func (*ProductQtyMutation) SetUpdatedAt

func (m *ProductQtyMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*ProductQtyMutation) SetWorkUnitID

func (m *ProductQtyMutation) SetWorkUnitID(u uuid.UUID)

SetWorkUnitID sets the "work_unit_id" field.

func (ProductQtyMutation) Tx

func (m ProductQtyMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ProductQtyMutation) Type

func (m *ProductQtyMutation) Type() string

Type returns the node type of this mutation (ProductQty).

func (*ProductQtyMutation) UpdatedAt

func (m *ProductQtyMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*ProductQtyMutation) Where

func (m *ProductQtyMutation) Where(ps ...predicate.ProductQty)

Where appends a list predicates to the ProductQtyMutation builder.

func (*ProductQtyMutation) WhereP

func (m *ProductQtyMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ProductQtyMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

func (*ProductQtyMutation) WorkUnitCleared

func (m *ProductQtyMutation) WorkUnitCleared() bool

WorkUnitCleared reports if the "work_unit" edge to the WorkUnitInfo entity was cleared.

func (*ProductQtyMutation) WorkUnitID

func (m *ProductQtyMutation) WorkUnitID() (r uuid.UUID, exists bool)

WorkUnitID returns the value of the "work_unit_id" field in the mutation.

func (*ProductQtyMutation) WorkUnitIDs

func (m *ProductQtyMutation) WorkUnitIDs() (ids []uuid.UUID)

WorkUnitIDs returns the "work_unit" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use WorkUnitID instead. It exists only for internal usage by the builders.

type ProductQtyQuery

type ProductQtyQuery struct {
	// contains filtered or unexported fields
}

ProductQtyQuery is the builder for querying ProductQty entities.

func (*ProductQtyQuery) Aggregate

func (pqq *ProductQtyQuery) Aggregate(fns ...AggregateFunc) *ProductQtySelect

Aggregate returns a ProductQtySelect configured with the given aggregations.

func (*ProductQtyQuery) All

func (pqq *ProductQtyQuery) All(ctx context.Context) ([]*ProductQty, error)

All executes the query and returns a list of ProductQties.

func (*ProductQtyQuery) AllX

func (pqq *ProductQtyQuery) AllX(ctx context.Context) []*ProductQty

AllX is like All, but panics if an error occurs.

func (*ProductQtyQuery) Clone

func (pqq *ProductQtyQuery) Clone() *ProductQtyQuery

Clone returns a duplicate of the ProductQtyQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ProductQtyQuery) Count

func (pqq *ProductQtyQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ProductQtyQuery) CountX

func (pqq *ProductQtyQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ProductQtyQuery) Exist

func (pqq *ProductQtyQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ProductQtyQuery) ExistX

func (pqq *ProductQtyQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ProductQtyQuery) First

func (pqq *ProductQtyQuery) First(ctx context.Context) (*ProductQty, error)

First returns the first ProductQty entity from the query. Returns a *NotFoundError when no ProductQty was found.

func (*ProductQtyQuery) FirstID

func (pqq *ProductQtyQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first ProductQty ID from the query. Returns a *NotFoundError when no ProductQty ID was found.

func (*ProductQtyQuery) FirstIDX

func (pqq *ProductQtyQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*ProductQtyQuery) FirstX

func (pqq *ProductQtyQuery) FirstX(ctx context.Context) *ProductQty

FirstX is like First, but panics if an error occurs.

func (*ProductQtyQuery) GroupBy

func (pqq *ProductQtyQuery) GroupBy(field string, fields ...string) *ProductQtyGroupBy

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.ProductQty.Query().
	GroupBy(productqty.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ProductQtyQuery) IDs

func (pqq *ProductQtyQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of ProductQty IDs.

func (*ProductQtyQuery) IDsX

func (pqq *ProductQtyQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*ProductQtyQuery) Limit

func (pqq *ProductQtyQuery) Limit(limit int) *ProductQtyQuery

Limit the number of records to be returned by this query.

func (*ProductQtyQuery) Offset

func (pqq *ProductQtyQuery) Offset(offset int) *ProductQtyQuery

Offset to start from.

func (*ProductQtyQuery) Only

func (pqq *ProductQtyQuery) Only(ctx context.Context) (*ProductQty, error)

Only returns a single ProductQty entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ProductQty entity is found. Returns a *NotFoundError when no ProductQty entities are found.

func (*ProductQtyQuery) OnlyID

func (pqq *ProductQtyQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only ProductQty ID in the query. Returns a *NotSingularError when more than one ProductQty ID is found. Returns a *NotFoundError when no entities are found.

func (*ProductQtyQuery) OnlyIDX

func (pqq *ProductQtyQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ProductQtyQuery) OnlyX

func (pqq *ProductQtyQuery) OnlyX(ctx context.Context) *ProductQty

OnlyX is like Only, but panics if an error occurs.

func (*ProductQtyQuery) Order

Order specifies how the records should be ordered.

func (*ProductQtyQuery) QueryProduct

func (pqq *ProductQtyQuery) QueryProduct() *ProductInfoQuery

QueryProduct chains the current query on the "product" edge.

func (*ProductQtyQuery) QueryProductColor

func (pqq *ProductQtyQuery) QueryProductColor() *ProductColorQuery

QueryProductColor chains the current query on the "product_color" edge.

func (*ProductQtyQuery) QueryWorkUnit

func (pqq *ProductQtyQuery) QueryWorkUnit() *WorkUnitInfoQuery

QueryWorkUnit chains the current query on the "work_unit" edge.

func (*ProductQtyQuery) Select

func (pqq *ProductQtyQuery) Select(fields ...string) *ProductQtySelect

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.ProductQty.Query().
	Select(productqty.FieldCreatedAt).
	Scan(ctx, &v)

func (*ProductQtyQuery) Unique

func (pqq *ProductQtyQuery) Unique(unique bool) *ProductQtyQuery

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 (*ProductQtyQuery) Where

Where adds a new predicate for the ProductQtyQuery builder.

func (*ProductQtyQuery) WithProduct

func (pqq *ProductQtyQuery) WithProduct(opts ...func(*ProductInfoQuery)) *ProductQtyQuery

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 (*ProductQtyQuery) WithProductColor

func (pqq *ProductQtyQuery) WithProductColor(opts ...func(*ProductColorQuery)) *ProductQtyQuery

WithProductColor tells the query-builder to eager-load the nodes that are connected to the "product_color" edge. The optional arguments are used to configure the query builder of the edge.

func (*ProductQtyQuery) WithWorkUnit

func (pqq *ProductQtyQuery) WithWorkUnit(opts ...func(*WorkUnitInfoQuery)) *ProductQtyQuery

WithWorkUnit tells the query-builder to eager-load the nodes that are connected to the "work_unit" edge. The optional arguments are used to configure the query builder of the edge.

type ProductQtySelect

type ProductQtySelect struct {
	*ProductQtyQuery
	// contains filtered or unexported fields
}

ProductQtySelect is the builder for selecting fields of ProductQty entities.

func (*ProductQtySelect) Aggregate

func (pqs *ProductQtySelect) Aggregate(fns ...AggregateFunc) *ProductQtySelect

Aggregate adds the given aggregation functions to the selector query.

func (*ProductQtySelect) Bool

func (s *ProductQtySelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ProductQtySelect) BoolX

func (s *ProductQtySelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ProductQtySelect) Bools

func (s *ProductQtySelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ProductQtySelect) BoolsX

func (s *ProductQtySelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ProductQtySelect) Float64

func (s *ProductQtySelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ProductQtySelect) Float64X

func (s *ProductQtySelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ProductQtySelect) Float64s

func (s *ProductQtySelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ProductQtySelect) Float64sX

func (s *ProductQtySelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ProductQtySelect) Int

func (s *ProductQtySelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ProductQtySelect) IntX

func (s *ProductQtySelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ProductQtySelect) Ints

func (s *ProductQtySelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ProductQtySelect) IntsX

func (s *ProductQtySelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ProductQtySelect) Scan

func (pqs *ProductQtySelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ProductQtySelect) ScanX

func (s *ProductQtySelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ProductQtySelect) String

func (s *ProductQtySelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ProductQtySelect) StringX

func (s *ProductQtySelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ProductQtySelect) Strings

func (s *ProductQtySelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ProductQtySelect) StringsX

func (s *ProductQtySelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ProductQtyUpdate

type ProductQtyUpdate struct {
	// contains filtered or unexported fields
}

ProductQtyUpdate is the builder for updating ProductQty entities.

func (*ProductQtyUpdate) AddPricePerUnit

func (pqu *ProductQtyUpdate) AddPricePerUnit(d decimal.Decimal) *ProductQtyUpdate

AddPricePerUnit adds d to the "price_per_unit" field.

func (*ProductQtyUpdate) AddQty

AddQty adds d to the "qty" field.

func (*ProductQtyUpdate) Exec

func (pqu *ProductQtyUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductQtyUpdate) ExecX

func (pqu *ProductQtyUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductQtyUpdate) Mutation

func (pqu *ProductQtyUpdate) Mutation() *ProductQtyMutation

Mutation returns the ProductQtyMutation object of the builder.

func (*ProductQtyUpdate) Save

func (pqu *ProductQtyUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ProductQtyUpdate) SaveX

func (pqu *ProductQtyUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ProductQtyUpdate) SetNillablePricePerUnit

func (pqu *ProductQtyUpdate) SetNillablePricePerUnit(d *decimal.Decimal) *ProductQtyUpdate

SetNillablePricePerUnit sets the "price_per_unit" field if the given value is not nil.

func (*ProductQtyUpdate) SetNillableQty

func (pqu *ProductQtyUpdate) SetNillableQty(d *decimal.Decimal) *ProductQtyUpdate

SetNillableQty sets the "qty" field if the given value is not nil.

func (*ProductQtyUpdate) SetPricePerUnit

func (pqu *ProductQtyUpdate) SetPricePerUnit(d decimal.Decimal) *ProductQtyUpdate

SetPricePerUnit sets the "price_per_unit" field.

func (*ProductQtyUpdate) SetQty

SetQty sets the "qty" field.

func (*ProductQtyUpdate) SetUpdatedAt

func (pqu *ProductQtyUpdate) SetUpdatedAt(t time.Time) *ProductQtyUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ProductQtyUpdate) Where

Where appends a list predicates to the ProductQtyUpdate builder.

type ProductQtyUpdateOne

type ProductQtyUpdateOne struct {
	// contains filtered or unexported fields
}

ProductQtyUpdateOne is the builder for updating a single ProductQty entity.

func (*ProductQtyUpdateOne) AddPricePerUnit

func (pquo *ProductQtyUpdateOne) AddPricePerUnit(d decimal.Decimal) *ProductQtyUpdateOne

AddPricePerUnit adds d to the "price_per_unit" field.

func (*ProductQtyUpdateOne) AddQty

AddQty adds d to the "qty" field.

func (*ProductQtyUpdateOne) Exec

func (pquo *ProductQtyUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ProductQtyUpdateOne) ExecX

func (pquo *ProductQtyUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductQtyUpdateOne) Mutation

func (pquo *ProductQtyUpdateOne) Mutation() *ProductQtyMutation

Mutation returns the ProductQtyMutation object of the builder.

func (*ProductQtyUpdateOne) Save

func (pquo *ProductQtyUpdateOne) Save(ctx context.Context) (*ProductQty, error)

Save executes the query and returns the updated ProductQty entity.

func (*ProductQtyUpdateOne) SaveX

func (pquo *ProductQtyUpdateOne) SaveX(ctx context.Context) *ProductQty

SaveX is like Save, but panics if an error occurs.

func (*ProductQtyUpdateOne) Select

func (pquo *ProductQtyUpdateOne) Select(field string, fields ...string) *ProductQtyUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ProductQtyUpdateOne) SetNillablePricePerUnit

func (pquo *ProductQtyUpdateOne) SetNillablePricePerUnit(d *decimal.Decimal) *ProductQtyUpdateOne

SetNillablePricePerUnit sets the "price_per_unit" field if the given value is not nil.

func (*ProductQtyUpdateOne) SetNillableQty

func (pquo *ProductQtyUpdateOne) SetNillableQty(d *decimal.Decimal) *ProductQtyUpdateOne

SetNillableQty sets the "qty" field if the given value is not nil.

func (*ProductQtyUpdateOne) SetPricePerUnit

func (pquo *ProductQtyUpdateOne) SetPricePerUnit(d decimal.Decimal) *ProductQtyUpdateOne

SetPricePerUnit sets the "price_per_unit" field.

func (*ProductQtyUpdateOne) SetQty

SetQty sets the "qty" field.

func (*ProductQtyUpdateOne) SetUpdatedAt

func (pquo *ProductQtyUpdateOne) SetUpdatedAt(t time.Time) *ProductQtyUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ProductQtyUpdateOne) Where

Where appends a list predicates to the ProductQtyUpdate builder.

type ProductTag

type ProductTag struct {

	// ProductID holds the value of the "product_id" field.
	ProductID string `json:"product_id,omitempty"`
	// TagID holds the value of the "tag_id" field.
	TagID string `json:"tag_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ProductTagQuery when eager-loading is set.
	Edges ProductTagEdges `json:"edges"`
	// contains filtered or unexported fields
}

ProductTag is the model entity for the ProductTag schema.

func (*ProductTag) QueryProducts

func (pt *ProductTag) QueryProducts() *ProductInfoQuery

QueryProducts queries the "products" edge of the ProductTag entity.

func (*ProductTag) QueryTags

func (pt *ProductTag) QueryTags() *TagQuery

QueryTags queries the "tags" edge of the ProductTag entity.

func (*ProductTag) String

func (pt *ProductTag) String() string

String implements the fmt.Stringer.

func (*ProductTag) Unwrap

func (pt *ProductTag) Unwrap() *ProductTag

Unwrap unwraps the ProductTag 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 (*ProductTag) Update

func (pt *ProductTag) Update() *ProductTagUpdateOne

Update returns a builder for updating this ProductTag. Note that you need to call ProductTag.Unwrap() before calling this method if this ProductTag was returned from a transaction, and the transaction was committed or rolled back.

func (*ProductTag) Value

func (pt *ProductTag) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the ProductTag. This includes values selected through modifiers, order, etc.

type ProductTagClient

type ProductTagClient struct {
	// contains filtered or unexported fields
}

ProductTagClient is a client for the ProductTag schema.

func NewProductTagClient

func NewProductTagClient(c config) *ProductTagClient

NewProductTagClient returns a client for the ProductTag from the given config.

func (*ProductTagClient) Create

func (c *ProductTagClient) Create() *ProductTagCreate

Create returns a builder for creating a ProductTag entity.

func (*ProductTagClient) CreateBulk

func (c *ProductTagClient) CreateBulk(builders ...*ProductTagCreate) *ProductTagCreateBulk

CreateBulk returns a builder for creating a bulk of ProductTag entities.

func (*ProductTagClient) Delete

func (c *ProductTagClient) Delete() *ProductTagDelete

Delete returns a delete builder for ProductTag.

func (*ProductTagClient) Hooks

func (c *ProductTagClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ProductTagClient) Intercept

func (c *ProductTagClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `producttag.Intercept(f(g(h())))`.

func (*ProductTagClient) Interceptors

func (c *ProductTagClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ProductTagClient) MapCreateBulk

func (c *ProductTagClient) MapCreateBulk(slice any, setFunc func(*ProductTagCreate, int)) *ProductTagCreateBulk

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 (*ProductTagClient) Query

func (c *ProductTagClient) Query() *ProductTagQuery

Query returns a query builder for ProductTag.

func (*ProductTagClient) QueryProducts

func (c *ProductTagClient) QueryProducts(pt *ProductTag) *ProductInfoQuery

QueryProducts queries the products edge of a ProductTag.

func (*ProductTagClient) QueryTags

func (c *ProductTagClient) QueryTags(pt *ProductTag) *TagQuery

QueryTags queries the tags edge of a ProductTag.

func (*ProductTagClient) Update

func (c *ProductTagClient) Update() *ProductTagUpdate

Update returns an update builder for ProductTag.

func (*ProductTagClient) UpdateOne

func (c *ProductTagClient) UpdateOne(pt *ProductTag) *ProductTagUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ProductTagClient) Use

func (c *ProductTagClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `producttag.Hooks(f(g(h())))`.

type ProductTagCreate

type ProductTagCreate struct {
	// contains filtered or unexported fields
}

ProductTagCreate is the builder for creating a ProductTag entity.

func (*ProductTagCreate) Exec

func (ptc *ProductTagCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductTagCreate) ExecX

func (ptc *ProductTagCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductTagCreate) Mutation

func (ptc *ProductTagCreate) Mutation() *ProductTagMutation

Mutation returns the ProductTagMutation object of the builder.

func (*ProductTagCreate) Save

func (ptc *ProductTagCreate) Save(ctx context.Context) (*ProductTag, error)

Save creates the ProductTag in the database.

func (*ProductTagCreate) SaveX

func (ptc *ProductTagCreate) SaveX(ctx context.Context) *ProductTag

SaveX calls Save and panics if Save returns an error.

func (*ProductTagCreate) SetProductID

func (ptc *ProductTagCreate) SetProductID(s string) *ProductTagCreate

SetProductID sets the "product_id" field.

func (*ProductTagCreate) SetProducts

func (ptc *ProductTagCreate) SetProducts(p *ProductInfo) *ProductTagCreate

SetProducts sets the "products" edge to the ProductInfo entity.

func (*ProductTagCreate) SetProductsID

func (ptc *ProductTagCreate) SetProductsID(id string) *ProductTagCreate

SetProductsID sets the "products" edge to the ProductInfo entity by ID.

func (*ProductTagCreate) SetTagID

func (ptc *ProductTagCreate) SetTagID(s string) *ProductTagCreate

SetTagID sets the "tag_id" field.

func (*ProductTagCreate) SetTags

func (ptc *ProductTagCreate) SetTags(t *Tag) *ProductTagCreate

SetTags sets the "tags" edge to the Tag entity.

func (*ProductTagCreate) SetTagsID

func (ptc *ProductTagCreate) SetTagsID(id string) *ProductTagCreate

SetTagsID sets the "tags" edge to the Tag entity by ID.

type ProductTagCreateBulk

type ProductTagCreateBulk struct {
	// contains filtered or unexported fields
}

ProductTagCreateBulk is the builder for creating many ProductTag entities in bulk.

func (*ProductTagCreateBulk) Exec

func (ptcb *ProductTagCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductTagCreateBulk) ExecX

func (ptcb *ProductTagCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductTagCreateBulk) Save

func (ptcb *ProductTagCreateBulk) Save(ctx context.Context) ([]*ProductTag, error)

Save creates the ProductTag entities in the database.

func (*ProductTagCreateBulk) SaveX

func (ptcb *ProductTagCreateBulk) SaveX(ctx context.Context) []*ProductTag

SaveX is like Save, but panics if an error occurs.

type ProductTagDelete

type ProductTagDelete struct {
	// contains filtered or unexported fields
}

ProductTagDelete is the builder for deleting a ProductTag entity.

func (*ProductTagDelete) Exec

func (ptd *ProductTagDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ProductTagDelete) ExecX

func (ptd *ProductTagDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ProductTagDelete) Where

Where appends a list predicates to the ProductTagDelete builder.

type ProductTagDeleteOne

type ProductTagDeleteOne struct {
	// contains filtered or unexported fields
}

ProductTagDeleteOne is the builder for deleting a single ProductTag entity.

func (*ProductTagDeleteOne) Exec

func (ptdo *ProductTagDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ProductTagDeleteOne) ExecX

func (ptdo *ProductTagDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductTagDeleteOne) Where

Where appends a list predicates to the ProductTagDelete builder.

type ProductTagEdges

type ProductTagEdges struct {
	// Products holds the value of the products edge.
	Products *ProductInfo `json:"products,omitempty"`
	// Tags holds the value of the tags edge.
	Tags *Tag `json:"tags,omitempty"`
	// contains filtered or unexported fields
}

ProductTagEdges holds the relations/edges for other nodes in the graph.

func (ProductTagEdges) ProductsOrErr

func (e ProductTagEdges) ProductsOrErr() (*ProductInfo, error)

ProductsOrErr returns the Products value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ProductTagEdges) TagsOrErr

func (e ProductTagEdges) TagsOrErr() (*Tag, error)

TagsOrErr returns the Tags value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type ProductTagGroupBy

type ProductTagGroupBy struct {
	// contains filtered or unexported fields
}

ProductTagGroupBy is the group-by builder for ProductTag entities.

func (*ProductTagGroupBy) Aggregate

func (ptgb *ProductTagGroupBy) Aggregate(fns ...AggregateFunc) *ProductTagGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ProductTagGroupBy) Bool

func (s *ProductTagGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ProductTagGroupBy) BoolX

func (s *ProductTagGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ProductTagGroupBy) Bools

func (s *ProductTagGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ProductTagGroupBy) BoolsX

func (s *ProductTagGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ProductTagGroupBy) Float64

func (s *ProductTagGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ProductTagGroupBy) Float64X

func (s *ProductTagGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ProductTagGroupBy) Float64s

func (s *ProductTagGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ProductTagGroupBy) Float64sX

func (s *ProductTagGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ProductTagGroupBy) Int

func (s *ProductTagGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ProductTagGroupBy) IntX

func (s *ProductTagGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ProductTagGroupBy) Ints

func (s *ProductTagGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ProductTagGroupBy) IntsX

func (s *ProductTagGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ProductTagGroupBy) Scan

func (ptgb *ProductTagGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ProductTagGroupBy) ScanX

func (s *ProductTagGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ProductTagGroupBy) String

func (s *ProductTagGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ProductTagGroupBy) StringX

func (s *ProductTagGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ProductTagGroupBy) Strings

func (s *ProductTagGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ProductTagGroupBy) StringsX

func (s *ProductTagGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ProductTagMutation

type ProductTagMutation struct {
	// contains filtered or unexported fields
}

ProductTagMutation represents an operation that mutates the ProductTag nodes in the graph.

func (*ProductTagMutation) AddField

func (m *ProductTagMutation) 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 (*ProductTagMutation) AddedEdges

func (m *ProductTagMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ProductTagMutation) AddedField

func (m *ProductTagMutation) 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 (*ProductTagMutation) AddedFields

func (m *ProductTagMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ProductTagMutation) AddedIDs

func (m *ProductTagMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ProductTagMutation) ClearEdge

func (m *ProductTagMutation) 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 (*ProductTagMutation) ClearField

func (m *ProductTagMutation) 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 (*ProductTagMutation) ClearProducts

func (m *ProductTagMutation) ClearProducts()

ClearProducts clears the "products" edge to the ProductInfo entity.

func (*ProductTagMutation) ClearTags

func (m *ProductTagMutation) ClearTags()

ClearTags clears the "tags" edge to the Tag entity.

func (*ProductTagMutation) ClearedEdges

func (m *ProductTagMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ProductTagMutation) ClearedFields

func (m *ProductTagMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ProductTagMutation) Client

func (m ProductTagMutation) 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 (*ProductTagMutation) EdgeCleared

func (m *ProductTagMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ProductTagMutation) Field

func (m *ProductTagMutation) 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 (*ProductTagMutation) FieldCleared

func (m *ProductTagMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ProductTagMutation) Fields

func (m *ProductTagMutation) 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 (*ProductTagMutation) OldField

func (m *ProductTagMutation) 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 (*ProductTagMutation) Op

func (m *ProductTagMutation) Op() Op

Op returns the operation name.

func (*ProductTagMutation) ProductID

func (m *ProductTagMutation) ProductID() (r string, exists bool)

ProductID returns the value of the "product_id" field in the mutation.

func (*ProductTagMutation) ProductsCleared

func (m *ProductTagMutation) ProductsCleared() bool

ProductsCleared reports if the "products" edge to the ProductInfo entity was cleared.

func (*ProductTagMutation) ProductsID

func (m *ProductTagMutation) ProductsID() (id string, exists bool)

ProductsID returns the "products" edge ID in the mutation.

func (*ProductTagMutation) ProductsIDs

func (m *ProductTagMutation) ProductsIDs() (ids []string)

ProductsIDs returns the "products" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ProductsID instead. It exists only for internal usage by the builders.

func (*ProductTagMutation) RemovedEdges

func (m *ProductTagMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ProductTagMutation) RemovedIDs

func (m *ProductTagMutation) 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 (*ProductTagMutation) ResetEdge

func (m *ProductTagMutation) 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 (*ProductTagMutation) ResetField

func (m *ProductTagMutation) 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 (*ProductTagMutation) ResetProductID

func (m *ProductTagMutation) ResetProductID()

ResetProductID resets all changes to the "product_id" field.

func (*ProductTagMutation) ResetProducts

func (m *ProductTagMutation) ResetProducts()

ResetProducts resets all changes to the "products" edge.

func (*ProductTagMutation) ResetTagID

func (m *ProductTagMutation) ResetTagID()

ResetTagID resets all changes to the "tag_id" field.

func (*ProductTagMutation) ResetTags

func (m *ProductTagMutation) ResetTags()

ResetTags resets all changes to the "tags" edge.

func (*ProductTagMutation) SetField

func (m *ProductTagMutation) 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 (*ProductTagMutation) SetOp

func (m *ProductTagMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ProductTagMutation) SetProductID

func (m *ProductTagMutation) SetProductID(s string)

SetProductID sets the "product_id" field.

func (*ProductTagMutation) SetProductsID

func (m *ProductTagMutation) SetProductsID(id string)

SetProductsID sets the "products" edge to the ProductInfo entity by id.

func (*ProductTagMutation) SetTagID

func (m *ProductTagMutation) SetTagID(s string)

SetTagID sets the "tag_id" field.

func (*ProductTagMutation) SetTagsID

func (m *ProductTagMutation) SetTagsID(id string)

SetTagsID sets the "tags" edge to the Tag entity by id.

func (*ProductTagMutation) TagID

func (m *ProductTagMutation) TagID() (r string, exists bool)

TagID returns the value of the "tag_id" field in the mutation.

func (*ProductTagMutation) TagsCleared

func (m *ProductTagMutation) TagsCleared() bool

TagsCleared reports if the "tags" edge to the Tag entity was cleared.

func (*ProductTagMutation) TagsID

func (m *ProductTagMutation) TagsID() (id string, exists bool)

TagsID returns the "tags" edge ID in the mutation.

func (*ProductTagMutation) TagsIDs

func (m *ProductTagMutation) TagsIDs() (ids []string)

TagsIDs returns the "tags" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use TagsID instead. It exists only for internal usage by the builders.

func (ProductTagMutation) Tx

func (m ProductTagMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ProductTagMutation) Type

func (m *ProductTagMutation) Type() string

Type returns the node type of this mutation (ProductTag).

func (*ProductTagMutation) Where

func (m *ProductTagMutation) Where(ps ...predicate.ProductTag)

Where appends a list predicates to the ProductTagMutation builder.

func (*ProductTagMutation) WhereP

func (m *ProductTagMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ProductTagMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ProductTagQuery

type ProductTagQuery struct {
	// contains filtered or unexported fields
}

ProductTagQuery is the builder for querying ProductTag entities.

func (*ProductTagQuery) Aggregate

func (ptq *ProductTagQuery) Aggregate(fns ...AggregateFunc) *ProductTagSelect

Aggregate returns a ProductTagSelect configured with the given aggregations.

func (*ProductTagQuery) All

func (ptq *ProductTagQuery) All(ctx context.Context) ([]*ProductTag, error)

All executes the query and returns a list of ProductTags.

func (*ProductTagQuery) AllX

func (ptq *ProductTagQuery) AllX(ctx context.Context) []*ProductTag

AllX is like All, but panics if an error occurs.

func (*ProductTagQuery) Clone

func (ptq *ProductTagQuery) Clone() *ProductTagQuery

Clone returns a duplicate of the ProductTagQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ProductTagQuery) Count

func (ptq *ProductTagQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ProductTagQuery) CountX

func (ptq *ProductTagQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ProductTagQuery) Exist

func (ptq *ProductTagQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ProductTagQuery) ExistX

func (ptq *ProductTagQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ProductTagQuery) First

func (ptq *ProductTagQuery) First(ctx context.Context) (*ProductTag, error)

First returns the first ProductTag entity from the query. Returns a *NotFoundError when no ProductTag was found.

func (*ProductTagQuery) FirstX

func (ptq *ProductTagQuery) FirstX(ctx context.Context) *ProductTag

FirstX is like First, but panics if an error occurs.

func (*ProductTagQuery) GroupBy

func (ptq *ProductTagQuery) GroupBy(field string, fields ...string) *ProductTagGroupBy

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 {
	ProductID string `json:"product_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.ProductTag.Query().
	GroupBy(producttag.FieldProductID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ProductTagQuery) Limit

func (ptq *ProductTagQuery) Limit(limit int) *ProductTagQuery

Limit the number of records to be returned by this query.

func (*ProductTagQuery) Offset

func (ptq *ProductTagQuery) Offset(offset int) *ProductTagQuery

Offset to start from.

func (*ProductTagQuery) Only

func (ptq *ProductTagQuery) Only(ctx context.Context) (*ProductTag, error)

Only returns a single ProductTag entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ProductTag entity is found. Returns a *NotFoundError when no ProductTag entities are found.

func (*ProductTagQuery) OnlyX

func (ptq *ProductTagQuery) OnlyX(ctx context.Context) *ProductTag

OnlyX is like Only, but panics if an error occurs.

func (*ProductTagQuery) Order

Order specifies how the records should be ordered.

func (*ProductTagQuery) QueryProducts

func (ptq *ProductTagQuery) QueryProducts() *ProductInfoQuery

QueryProducts chains the current query on the "products" edge.

func (*ProductTagQuery) QueryTags

func (ptq *ProductTagQuery) QueryTags() *TagQuery

QueryTags chains the current query on the "tags" edge.

func (*ProductTagQuery) Select

func (ptq *ProductTagQuery) Select(fields ...string) *ProductTagSelect

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 {
	ProductID string `json:"product_id,omitempty"`
}

client.ProductTag.Query().
	Select(producttag.FieldProductID).
	Scan(ctx, &v)

func (*ProductTagQuery) Unique

func (ptq *ProductTagQuery) Unique(unique bool) *ProductTagQuery

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 (*ProductTagQuery) Where

Where adds a new predicate for the ProductTagQuery builder.

func (*ProductTagQuery) WithProducts

func (ptq *ProductTagQuery) WithProducts(opts ...func(*ProductInfoQuery)) *ProductTagQuery

WithProducts tells the query-builder to eager-load the nodes that are connected to the "products" edge. The optional arguments are used to configure the query builder of the edge.

func (*ProductTagQuery) WithTags

func (ptq *ProductTagQuery) WithTags(opts ...func(*TagQuery)) *ProductTagQuery

WithTags tells the query-builder to eager-load the nodes that are connected to the "tags" edge. The optional arguments are used to configure the query builder of the edge.

type ProductTagSelect

type ProductTagSelect struct {
	*ProductTagQuery
	// contains filtered or unexported fields
}

ProductTagSelect is the builder for selecting fields of ProductTag entities.

func (*ProductTagSelect) Aggregate

func (pts *ProductTagSelect) Aggregate(fns ...AggregateFunc) *ProductTagSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ProductTagSelect) Bool

func (s *ProductTagSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ProductTagSelect) BoolX

func (s *ProductTagSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ProductTagSelect) Bools

func (s *ProductTagSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ProductTagSelect) BoolsX

func (s *ProductTagSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ProductTagSelect) Float64

func (s *ProductTagSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ProductTagSelect) Float64X

func (s *ProductTagSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ProductTagSelect) Float64s

func (s *ProductTagSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ProductTagSelect) Float64sX

func (s *ProductTagSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ProductTagSelect) Int

func (s *ProductTagSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ProductTagSelect) IntX

func (s *ProductTagSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ProductTagSelect) Ints

func (s *ProductTagSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ProductTagSelect) IntsX

func (s *ProductTagSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ProductTagSelect) Scan

func (pts *ProductTagSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ProductTagSelect) ScanX

func (s *ProductTagSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ProductTagSelect) String

func (s *ProductTagSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ProductTagSelect) StringX

func (s *ProductTagSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ProductTagSelect) Strings

func (s *ProductTagSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ProductTagSelect) StringsX

func (s *ProductTagSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ProductTagUpdate

type ProductTagUpdate struct {
	// contains filtered or unexported fields
}

ProductTagUpdate is the builder for updating ProductTag entities.

func (*ProductTagUpdate) Exec

func (ptu *ProductTagUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductTagUpdate) ExecX

func (ptu *ProductTagUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductTagUpdate) Mutation

func (ptu *ProductTagUpdate) Mutation() *ProductTagMutation

Mutation returns the ProductTagMutation object of the builder.

func (*ProductTagUpdate) Save

func (ptu *ProductTagUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ProductTagUpdate) SaveX

func (ptu *ProductTagUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ProductTagUpdate) Where

Where appends a list predicates to the ProductTagUpdate builder.

type ProductTagUpdateOne

type ProductTagUpdateOne struct {
	// contains filtered or unexported fields
}

ProductTagUpdateOne is the builder for updating a single ProductTag entity.

func (*ProductTagUpdateOne) Exec

func (ptuo *ProductTagUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ProductTagUpdateOne) ExecX

func (ptuo *ProductTagUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductTagUpdateOne) Mutation

func (ptuo *ProductTagUpdateOne) Mutation() *ProductTagMutation

Mutation returns the ProductTagMutation object of the builder.

func (*ProductTagUpdateOne) Save

func (ptuo *ProductTagUpdateOne) Save(ctx context.Context) (*ProductTag, error)

Save executes the query and returns the updated ProductTag entity.

func (*ProductTagUpdateOne) SaveX

func (ptuo *ProductTagUpdateOne) SaveX(ctx context.Context) *ProductTag

SaveX is like Save, but panics if an error occurs.

func (*ProductTagUpdateOne) Select

func (ptuo *ProductTagUpdateOne) Select(field string, fields ...string) *ProductTagUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ProductTagUpdateOne) Where

Where appends a list predicates to the ProductTagUpdate builder.

type ProductTags

type ProductTags []*ProductTag

ProductTags is a parsable slice of ProductTag.

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 Shipment

type Shipment struct {

	// ID of the ent.
	ID string `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"`
	// OrderID holds the value of the "order_id" field.
	OrderID uuid.UUID `json:"order_id,omitempty"`
	// InvoiceID holds the value of the "invoice_id" field.
	InvoiceID uuid.UUID `json:"invoice_id,omitempty"`
	// StaffID holds the value of the "staff_id" field.
	StaffID uuid.UUID `json:"staff_id,omitempty"`
	// ShipmentDate holds the value of the "shipment_date" field.
	ShipmentDate *time.Time `json:"shipment_date,omitempty"`
	// Note holds the value of the "note" field.
	Note *string `json:"note,omitempty"`
	// StatusCode holds the value of the "status_code" field.
	StatusCode *int `json:"status_code,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ShipmentQuery when eager-loading is set.
	Edges ShipmentEdges `json:"edges"`
	// contains filtered or unexported fields
}

Shipment is the model entity for the Shipment schema.

func (*Shipment) QueryInvoice

func (s *Shipment) QueryInvoice() *InvoiceQuery

QueryInvoice queries the "invoice" edge of the Shipment entity.

func (*Shipment) QueryOrder

func (s *Shipment) QueryOrder() *OrderQuery

QueryOrder queries the "order" edge of the Shipment entity.

func (*Shipment) QueryShipmentStatus

func (s *Shipment) QueryShipmentStatus() *ShipmentStatusCodeQuery

QueryShipmentStatus queries the "shipment_status" edge of the Shipment entity.

func (*Shipment) QueryStaff

func (s *Shipment) QueryStaff() *PersonQuery

QueryStaff queries the "staff" edge of the Shipment entity.

func (*Shipment) String

func (s *Shipment) String() string

String implements the fmt.Stringer.

func (*Shipment) Unwrap

func (s *Shipment) Unwrap() *Shipment

Unwrap unwraps the Shipment 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 (*Shipment) Update

func (s *Shipment) Update() *ShipmentUpdateOne

Update returns a builder for updating this Shipment. Note that you need to call Shipment.Unwrap() before calling this method if this Shipment was returned from a transaction, and the transaction was committed or rolled back.

func (*Shipment) Value

func (s *Shipment) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Shipment. This includes values selected through modifiers, order, etc.

type ShipmentClient

type ShipmentClient struct {
	// contains filtered or unexported fields
}

ShipmentClient is a client for the Shipment schema.

func NewShipmentClient

func NewShipmentClient(c config) *ShipmentClient

NewShipmentClient returns a client for the Shipment from the given config.

func (*ShipmentClient) Create

func (c *ShipmentClient) Create() *ShipmentCreate

Create returns a builder for creating a Shipment entity.

func (*ShipmentClient) CreateBulk

func (c *ShipmentClient) CreateBulk(builders ...*ShipmentCreate) *ShipmentCreateBulk

CreateBulk returns a builder for creating a bulk of Shipment entities.

func (*ShipmentClient) Delete

func (c *ShipmentClient) Delete() *ShipmentDelete

Delete returns a delete builder for Shipment.

func (*ShipmentClient) DeleteOne

func (c *ShipmentClient) DeleteOne(s *Shipment) *ShipmentDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ShipmentClient) DeleteOneID

func (c *ShipmentClient) DeleteOneID(id string) *ShipmentDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ShipmentClient) Get

func (c *ShipmentClient) Get(ctx context.Context, id string) (*Shipment, error)

Get returns a Shipment entity by its id.

func (*ShipmentClient) GetX

func (c *ShipmentClient) GetX(ctx context.Context, id string) *Shipment

GetX is like Get, but panics if an error occurs.

func (*ShipmentClient) Hooks

func (c *ShipmentClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ShipmentClient) Intercept

func (c *ShipmentClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `shipment.Intercept(f(g(h())))`.

func (*ShipmentClient) Interceptors

func (c *ShipmentClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ShipmentClient) MapCreateBulk

func (c *ShipmentClient) MapCreateBulk(slice any, setFunc func(*ShipmentCreate, int)) *ShipmentCreateBulk

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 (*ShipmentClient) Query

func (c *ShipmentClient) Query() *ShipmentQuery

Query returns a query builder for Shipment.

func (*ShipmentClient) QueryInvoice

func (c *ShipmentClient) QueryInvoice(s *Shipment) *InvoiceQuery

QueryInvoice queries the invoice edge of a Shipment.

func (*ShipmentClient) QueryOrder

func (c *ShipmentClient) QueryOrder(s *Shipment) *OrderQuery

QueryOrder queries the order edge of a Shipment.

func (*ShipmentClient) QueryShipmentStatus

func (c *ShipmentClient) QueryShipmentStatus(s *Shipment) *ShipmentStatusCodeQuery

QueryShipmentStatus queries the shipment_status edge of a Shipment.

func (*ShipmentClient) QueryStaff

func (c *ShipmentClient) QueryStaff(s *Shipment) *PersonQuery

QueryStaff queries the staff edge of a Shipment.

func (*ShipmentClient) Update

func (c *ShipmentClient) Update() *ShipmentUpdate

Update returns an update builder for Shipment.

func (*ShipmentClient) UpdateOne

func (c *ShipmentClient) UpdateOne(s *Shipment) *ShipmentUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ShipmentClient) UpdateOneID

func (c *ShipmentClient) UpdateOneID(id string) *ShipmentUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ShipmentClient) Use

func (c *ShipmentClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `shipment.Hooks(f(g(h())))`.

type ShipmentCreate

type ShipmentCreate struct {
	// contains filtered or unexported fields
}

ShipmentCreate is the builder for creating a Shipment entity.

func (*ShipmentCreate) Exec

func (sc *ShipmentCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ShipmentCreate) ExecX

func (sc *ShipmentCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ShipmentCreate) Mutation

func (sc *ShipmentCreate) Mutation() *ShipmentMutation

Mutation returns the ShipmentMutation object of the builder.

func (*ShipmentCreate) Save

func (sc *ShipmentCreate) Save(ctx context.Context) (*Shipment, error)

Save creates the Shipment in the database.

func (*ShipmentCreate) SaveX

func (sc *ShipmentCreate) SaveX(ctx context.Context) *Shipment

SaveX calls Save and panics if Save returns an error.

func (*ShipmentCreate) SetCreatedAt

func (sc *ShipmentCreate) SetCreatedAt(t time.Time) *ShipmentCreate

SetCreatedAt sets the "created_at" field.

func (*ShipmentCreate) SetID

func (sc *ShipmentCreate) SetID(s string) *ShipmentCreate

SetID sets the "id" field.

func (*ShipmentCreate) SetInvoice

func (sc *ShipmentCreate) SetInvoice(i *Invoice) *ShipmentCreate

SetInvoice sets the "invoice" edge to the Invoice entity.

func (*ShipmentCreate) SetInvoiceID

func (sc *ShipmentCreate) SetInvoiceID(u uuid.UUID) *ShipmentCreate

SetInvoiceID sets the "invoice_id" field.

func (*ShipmentCreate) SetNillableCreatedAt

func (sc *ShipmentCreate) SetNillableCreatedAt(t *time.Time) *ShipmentCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ShipmentCreate) SetNillableNote

func (sc *ShipmentCreate) SetNillableNote(s *string) *ShipmentCreate

SetNillableNote sets the "note" field if the given value is not nil.

func (*ShipmentCreate) SetNillableStatusCode

func (sc *ShipmentCreate) SetNillableStatusCode(i *int) *ShipmentCreate

SetNillableStatusCode sets the "status_code" field if the given value is not nil.

func (*ShipmentCreate) SetNillableUpdatedAt

func (sc *ShipmentCreate) SetNillableUpdatedAt(t *time.Time) *ShipmentCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*ShipmentCreate) SetNote

func (sc *ShipmentCreate) SetNote(s string) *ShipmentCreate

SetNote sets the "note" field.

func (*ShipmentCreate) SetOrder

func (sc *ShipmentCreate) SetOrder(o *Order) *ShipmentCreate

SetOrder sets the "order" edge to the Order entity.

func (*ShipmentCreate) SetOrderID

func (sc *ShipmentCreate) SetOrderID(u uuid.UUID) *ShipmentCreate

SetOrderID sets the "order_id" field.

func (*ShipmentCreate) SetShipmentDate

func (sc *ShipmentCreate) SetShipmentDate(t time.Time) *ShipmentCreate

SetShipmentDate sets the "shipment_date" field.

func (*ShipmentCreate) SetShipmentStatus

func (sc *ShipmentCreate) SetShipmentStatus(s *ShipmentStatusCode) *ShipmentCreate

SetShipmentStatus sets the "shipment_status" edge to the ShipmentStatusCode entity.

func (*ShipmentCreate) SetShipmentStatusID

func (sc *ShipmentCreate) SetShipmentStatusID(id int) *ShipmentCreate

SetShipmentStatusID sets the "shipment_status" edge to the ShipmentStatusCode entity by ID.

func (*ShipmentCreate) SetStaff

func (sc *ShipmentCreate) SetStaff(p *Person) *ShipmentCreate

SetStaff sets the "staff" edge to the Person entity.

func (*ShipmentCreate) SetStaffID

func (sc *ShipmentCreate) SetStaffID(u uuid.UUID) *ShipmentCreate

SetStaffID sets the "staff_id" field.

func (*ShipmentCreate) SetStatusCode

func (sc *ShipmentCreate) SetStatusCode(i int) *ShipmentCreate

SetStatusCode sets the "status_code" field.

func (*ShipmentCreate) SetUpdatedAt

func (sc *ShipmentCreate) SetUpdatedAt(t time.Time) *ShipmentCreate

SetUpdatedAt sets the "updated_at" field.

type ShipmentCreateBulk

type ShipmentCreateBulk struct {
	// contains filtered or unexported fields
}

ShipmentCreateBulk is the builder for creating many Shipment entities in bulk.

func (*ShipmentCreateBulk) Exec

func (scb *ShipmentCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ShipmentCreateBulk) ExecX

func (scb *ShipmentCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ShipmentCreateBulk) Save

func (scb *ShipmentCreateBulk) Save(ctx context.Context) ([]*Shipment, error)

Save creates the Shipment entities in the database.

func (*ShipmentCreateBulk) SaveX

func (scb *ShipmentCreateBulk) SaveX(ctx context.Context) []*Shipment

SaveX is like Save, but panics if an error occurs.

type ShipmentDelete

type ShipmentDelete struct {
	// contains filtered or unexported fields
}

ShipmentDelete is the builder for deleting a Shipment entity.

func (*ShipmentDelete) Exec

func (sd *ShipmentDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ShipmentDelete) ExecX

func (sd *ShipmentDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ShipmentDelete) Where

func (sd *ShipmentDelete) Where(ps ...predicate.Shipment) *ShipmentDelete

Where appends a list predicates to the ShipmentDelete builder.

type ShipmentDeleteOne

type ShipmentDeleteOne struct {
	// contains filtered or unexported fields
}

ShipmentDeleteOne is the builder for deleting a single Shipment entity.

func (*ShipmentDeleteOne) Exec

func (sdo *ShipmentDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ShipmentDeleteOne) ExecX

func (sdo *ShipmentDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ShipmentDeleteOne) Where

Where appends a list predicates to the ShipmentDelete builder.

type ShipmentEdges

type ShipmentEdges struct {
	// Order holds the value of the order edge.
	Order *Order `json:"order,omitempty"`
	// Invoice holds the value of the invoice edge.
	Invoice *Invoice `json:"invoice,omitempty"`
	// Staff holds the value of the staff edge.
	Staff *Person `json:"staff,omitempty"`
	// ShipmentStatus holds the value of the shipment_status edge.
	ShipmentStatus *ShipmentStatusCode `json:"shipment_status,omitempty"`
	// contains filtered or unexported fields
}

ShipmentEdges holds the relations/edges for other nodes in the graph.

func (ShipmentEdges) InvoiceOrErr

func (e ShipmentEdges) 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 (ShipmentEdges) OrderOrErr

func (e ShipmentEdges) OrderOrErr() (*Order, error)

OrderOrErr returns the Order value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ShipmentEdges) ShipmentStatusOrErr

func (e ShipmentEdges) ShipmentStatusOrErr() (*ShipmentStatusCode, error)

ShipmentStatusOrErr returns the ShipmentStatus value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ShipmentEdges) StaffOrErr

func (e ShipmentEdges) StaffOrErr() (*Person, error)

StaffOrErr returns the Staff value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type ShipmentGroupBy

type ShipmentGroupBy struct {
	// contains filtered or unexported fields
}

ShipmentGroupBy is the group-by builder for Shipment entities.

func (*ShipmentGroupBy) Aggregate

func (sgb *ShipmentGroupBy) Aggregate(fns ...AggregateFunc) *ShipmentGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ShipmentGroupBy) Bool

func (s *ShipmentGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ShipmentGroupBy) BoolX

func (s *ShipmentGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ShipmentGroupBy) Bools

func (s *ShipmentGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ShipmentGroupBy) BoolsX

func (s *ShipmentGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ShipmentGroupBy) Float64

func (s *ShipmentGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ShipmentGroupBy) Float64X

func (s *ShipmentGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ShipmentGroupBy) Float64s

func (s *ShipmentGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ShipmentGroupBy) Float64sX

func (s *ShipmentGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ShipmentGroupBy) Int

func (s *ShipmentGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ShipmentGroupBy) IntX

func (s *ShipmentGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ShipmentGroupBy) Ints

func (s *ShipmentGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ShipmentGroupBy) IntsX

func (s *ShipmentGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ShipmentGroupBy) Scan

func (sgb *ShipmentGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ShipmentGroupBy) ScanX

func (s *ShipmentGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ShipmentGroupBy) String

func (s *ShipmentGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ShipmentGroupBy) StringX

func (s *ShipmentGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ShipmentGroupBy) Strings

func (s *ShipmentGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ShipmentGroupBy) StringsX

func (s *ShipmentGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ShipmentHistories

type ShipmentHistories []*ShipmentHistory

ShipmentHistories is a parsable slice of ShipmentHistory.

type ShipmentHistory

type ShipmentHistory struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// ShipmentID holds the value of the "shipment_id" field.
	ShipmentID string `json:"shipment_id,omitempty"`
	// PersonID holds the value of the "person_id" field.
	PersonID uuid.UUID `json:"person_id,omitempty"`
	// OldStatusCode holds the value of the "old_status_code" field.
	OldStatusCode *int `json:"old_status_code,omitempty"`
	// NewStatusCode holds the value of the "new_status_code" field.
	NewStatusCode *int `json:"new_status_code,omitempty"`
	// Description holds the value of the "description" field.
	Description *string `json:"description,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ShipmentHistoryQuery when eager-loading is set.
	Edges ShipmentHistoryEdges `json:"edges"`
	// contains filtered or unexported fields
}

ShipmentHistory is the model entity for the ShipmentHistory schema.

func (*ShipmentHistory) QueryNewStatus

func (sh *ShipmentHistory) QueryNewStatus() *ShipmentStatusCodeQuery

QueryNewStatus queries the "new_status" edge of the ShipmentHistory entity.

func (*ShipmentHistory) QueryOldStatus

func (sh *ShipmentHistory) QueryOldStatus() *ShipmentStatusCodeQuery

QueryOldStatus queries the "old_status" edge of the ShipmentHistory entity.

func (*ShipmentHistory) QueryPerson

func (sh *ShipmentHistory) QueryPerson() *PersonQuery

QueryPerson queries the "person" edge of the ShipmentHistory entity.

func (*ShipmentHistory) QueryShipment

func (sh *ShipmentHistory) QueryShipment() *ShipmentQuery

QueryShipment queries the "shipment" edge of the ShipmentHistory entity.

func (*ShipmentHistory) String

func (sh *ShipmentHistory) String() string

String implements the fmt.Stringer.

func (*ShipmentHistory) Unwrap

func (sh *ShipmentHistory) Unwrap() *ShipmentHistory

Unwrap unwraps the ShipmentHistory 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 (*ShipmentHistory) Update

Update returns a builder for updating this ShipmentHistory. Note that you need to call ShipmentHistory.Unwrap() before calling this method if this ShipmentHistory was returned from a transaction, and the transaction was committed or rolled back.

func (*ShipmentHistory) Value

func (sh *ShipmentHistory) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the ShipmentHistory. This includes values selected through modifiers, order, etc.

type ShipmentHistoryClient

type ShipmentHistoryClient struct {
	// contains filtered or unexported fields
}

ShipmentHistoryClient is a client for the ShipmentHistory schema.

func NewShipmentHistoryClient

func NewShipmentHistoryClient(c config) *ShipmentHistoryClient

NewShipmentHistoryClient returns a client for the ShipmentHistory from the given config.

func (*ShipmentHistoryClient) Create

Create returns a builder for creating a ShipmentHistory entity.

func (*ShipmentHistoryClient) CreateBulk

CreateBulk returns a builder for creating a bulk of ShipmentHistory entities.

func (*ShipmentHistoryClient) Delete

Delete returns a delete builder for ShipmentHistory.

func (*ShipmentHistoryClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ShipmentHistoryClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ShipmentHistoryClient) Get

Get returns a ShipmentHistory entity by its id.

func (*ShipmentHistoryClient) GetX

GetX is like Get, but panics if an error occurs.

func (*ShipmentHistoryClient) Hooks

func (c *ShipmentHistoryClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ShipmentHistoryClient) Intercept

func (c *ShipmentHistoryClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `shipmenthistory.Intercept(f(g(h())))`.

func (*ShipmentHistoryClient) Interceptors

func (c *ShipmentHistoryClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ShipmentHistoryClient) MapCreateBulk

func (c *ShipmentHistoryClient) MapCreateBulk(slice any, setFunc func(*ShipmentHistoryCreate, int)) *ShipmentHistoryCreateBulk

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 (*ShipmentHistoryClient) Query

Query returns a query builder for ShipmentHistory.

func (*ShipmentHistoryClient) QueryNewStatus

QueryNewStatus queries the new_status edge of a ShipmentHistory.

func (*ShipmentHistoryClient) QueryOldStatus

QueryOldStatus queries the old_status edge of a ShipmentHistory.

func (*ShipmentHistoryClient) QueryPerson

func (c *ShipmentHistoryClient) QueryPerson(sh *ShipmentHistory) *PersonQuery

QueryPerson queries the person edge of a ShipmentHistory.

func (*ShipmentHistoryClient) QueryShipment

func (c *ShipmentHistoryClient) QueryShipment(sh *ShipmentHistory) *ShipmentQuery

QueryShipment queries the shipment edge of a ShipmentHistory.

func (*ShipmentHistoryClient) Update

Update returns an update builder for ShipmentHistory.

func (*ShipmentHistoryClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ShipmentHistoryClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*ShipmentHistoryClient) Use

func (c *ShipmentHistoryClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `shipmenthistory.Hooks(f(g(h())))`.

type ShipmentHistoryCreate

type ShipmentHistoryCreate struct {
	// contains filtered or unexported fields
}

ShipmentHistoryCreate is the builder for creating a ShipmentHistory entity.

func (*ShipmentHistoryCreate) Exec

func (shc *ShipmentHistoryCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ShipmentHistoryCreate) ExecX

func (shc *ShipmentHistoryCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ShipmentHistoryCreate) Mutation

Mutation returns the ShipmentHistoryMutation object of the builder.

func (*ShipmentHistoryCreate) Save

Save creates the ShipmentHistory in the database.

func (*ShipmentHistoryCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*ShipmentHistoryCreate) SetCreatedAt

func (shc *ShipmentHistoryCreate) SetCreatedAt(t time.Time) *ShipmentHistoryCreate

SetCreatedAt sets the "created_at" field.

func (*ShipmentHistoryCreate) SetDescription

func (shc *ShipmentHistoryCreate) SetDescription(s string) *ShipmentHistoryCreate

SetDescription sets the "description" field.

func (*ShipmentHistoryCreate) SetID

SetID sets the "id" field.

func (*ShipmentHistoryCreate) SetNewStatus

SetNewStatus sets the "new_status" edge to the ShipmentStatusCode entity.

func (*ShipmentHistoryCreate) SetNewStatusCode

func (shc *ShipmentHistoryCreate) SetNewStatusCode(i int) *ShipmentHistoryCreate

SetNewStatusCode sets the "new_status_code" field.

func (*ShipmentHistoryCreate) SetNewStatusID

func (shc *ShipmentHistoryCreate) SetNewStatusID(id int) *ShipmentHistoryCreate

SetNewStatusID sets the "new_status" edge to the ShipmentStatusCode entity by ID.

func (*ShipmentHistoryCreate) SetNillableCreatedAt

func (shc *ShipmentHistoryCreate) SetNillableCreatedAt(t *time.Time) *ShipmentHistoryCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ShipmentHistoryCreate) SetNillableDescription

func (shc *ShipmentHistoryCreate) SetNillableDescription(s *string) *ShipmentHistoryCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*ShipmentHistoryCreate) SetNillableID

func (shc *ShipmentHistoryCreate) SetNillableID(u *uuid.UUID) *ShipmentHistoryCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ShipmentHistoryCreate) SetNillableNewStatusCode

func (shc *ShipmentHistoryCreate) SetNillableNewStatusCode(i *int) *ShipmentHistoryCreate

SetNillableNewStatusCode sets the "new_status_code" field if the given value is not nil.

func (*ShipmentHistoryCreate) SetNillableNewStatusID

func (shc *ShipmentHistoryCreate) SetNillableNewStatusID(id *int) *ShipmentHistoryCreate

SetNillableNewStatusID sets the "new_status" edge to the ShipmentStatusCode entity by ID if the given value is not nil.

func (*ShipmentHistoryCreate) SetNillableOldStatusCode

func (shc *ShipmentHistoryCreate) SetNillableOldStatusCode(i *int) *ShipmentHistoryCreate

SetNillableOldStatusCode sets the "old_status_code" field if the given value is not nil.

func (*ShipmentHistoryCreate) SetNillableOldStatusID

func (shc *ShipmentHistoryCreate) SetNillableOldStatusID(id *int) *ShipmentHistoryCreate

SetNillableOldStatusID sets the "old_status" edge to the ShipmentStatusCode entity by ID if the given value is not nil.

func (*ShipmentHistoryCreate) SetOldStatus

SetOldStatus sets the "old_status" edge to the ShipmentStatusCode entity.

func (*ShipmentHistoryCreate) SetOldStatusCode

func (shc *ShipmentHistoryCreate) SetOldStatusCode(i int) *ShipmentHistoryCreate

SetOldStatusCode sets the "old_status_code" field.

func (*ShipmentHistoryCreate) SetOldStatusID

func (shc *ShipmentHistoryCreate) SetOldStatusID(id int) *ShipmentHistoryCreate

SetOldStatusID sets the "old_status" edge to the ShipmentStatusCode entity by ID.

func (*ShipmentHistoryCreate) SetPerson

SetPerson sets the "person" edge to the Person entity.

func (*ShipmentHistoryCreate) SetPersonID

SetPersonID sets the "person_id" field.

func (*ShipmentHistoryCreate) SetShipment

SetShipment sets the "shipment" edge to the Shipment entity.

func (*ShipmentHistoryCreate) SetShipmentID

func (shc *ShipmentHistoryCreate) SetShipmentID(s string) *ShipmentHistoryCreate

SetShipmentID sets the "shipment_id" field.

type ShipmentHistoryCreateBulk

type ShipmentHistoryCreateBulk struct {
	// contains filtered or unexported fields
}

ShipmentHistoryCreateBulk is the builder for creating many ShipmentHistory entities in bulk.

func (*ShipmentHistoryCreateBulk) Exec

Exec executes the query.

func (*ShipmentHistoryCreateBulk) ExecX

func (shcb *ShipmentHistoryCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ShipmentHistoryCreateBulk) Save

Save creates the ShipmentHistory entities in the database.

func (*ShipmentHistoryCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type ShipmentHistoryDelete

type ShipmentHistoryDelete struct {
	// contains filtered or unexported fields
}

ShipmentHistoryDelete is the builder for deleting a ShipmentHistory entity.

func (*ShipmentHistoryDelete) Exec

func (shd *ShipmentHistoryDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ShipmentHistoryDelete) ExecX

func (shd *ShipmentHistoryDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ShipmentHistoryDelete) Where

Where appends a list predicates to the ShipmentHistoryDelete builder.

type ShipmentHistoryDeleteOne

type ShipmentHistoryDeleteOne struct {
	// contains filtered or unexported fields
}

ShipmentHistoryDeleteOne is the builder for deleting a single ShipmentHistory entity.

func (*ShipmentHistoryDeleteOne) Exec

Exec executes the deletion query.

func (*ShipmentHistoryDeleteOne) ExecX

func (shdo *ShipmentHistoryDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ShipmentHistoryDeleteOne) Where

Where appends a list predicates to the ShipmentHistoryDelete builder.

type ShipmentHistoryEdges

type ShipmentHistoryEdges struct {
	// Shipment holds the value of the shipment edge.
	Shipment *Shipment `json:"shipment,omitempty"`
	// Person holds the value of the person edge.
	Person *Person `json:"person,omitempty"`
	// OldStatus holds the value of the old_status edge.
	OldStatus *ShipmentStatusCode `json:"old_status,omitempty"`
	// NewStatus holds the value of the new_status edge.
	NewStatus *ShipmentStatusCode `json:"new_status,omitempty"`
	// contains filtered or unexported fields
}

ShipmentHistoryEdges holds the relations/edges for other nodes in the graph.

func (ShipmentHistoryEdges) NewStatusOrErr

func (e ShipmentHistoryEdges) NewStatusOrErr() (*ShipmentStatusCode, error)

NewStatusOrErr returns the NewStatus value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ShipmentHistoryEdges) OldStatusOrErr

func (e ShipmentHistoryEdges) OldStatusOrErr() (*ShipmentStatusCode, error)

OldStatusOrErr returns the OldStatus value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ShipmentHistoryEdges) PersonOrErr

func (e ShipmentHistoryEdges) PersonOrErr() (*Person, error)

PersonOrErr returns the Person value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ShipmentHistoryEdges) ShipmentOrErr

func (e ShipmentHistoryEdges) ShipmentOrErr() (*Shipment, error)

ShipmentOrErr returns the Shipment value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type ShipmentHistoryGroupBy

type ShipmentHistoryGroupBy struct {
	// contains filtered or unexported fields
}

ShipmentHistoryGroupBy is the group-by builder for ShipmentHistory entities.

func (*ShipmentHistoryGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*ShipmentHistoryGroupBy) Bool

func (s *ShipmentHistoryGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ShipmentHistoryGroupBy) BoolX

func (s *ShipmentHistoryGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ShipmentHistoryGroupBy) Bools

func (s *ShipmentHistoryGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ShipmentHistoryGroupBy) BoolsX

func (s *ShipmentHistoryGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ShipmentHistoryGroupBy) Float64

func (s *ShipmentHistoryGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ShipmentHistoryGroupBy) Float64X

func (s *ShipmentHistoryGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ShipmentHistoryGroupBy) Float64s

func (s *ShipmentHistoryGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ShipmentHistoryGroupBy) Float64sX

func (s *ShipmentHistoryGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ShipmentHistoryGroupBy) Int

func (s *ShipmentHistoryGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ShipmentHistoryGroupBy) IntX

func (s *ShipmentHistoryGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ShipmentHistoryGroupBy) Ints

func (s *ShipmentHistoryGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ShipmentHistoryGroupBy) IntsX

func (s *ShipmentHistoryGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ShipmentHistoryGroupBy) Scan

func (shgb *ShipmentHistoryGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ShipmentHistoryGroupBy) ScanX

func (s *ShipmentHistoryGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ShipmentHistoryGroupBy) String

func (s *ShipmentHistoryGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ShipmentHistoryGroupBy) StringX

func (s *ShipmentHistoryGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ShipmentHistoryGroupBy) Strings

func (s *ShipmentHistoryGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ShipmentHistoryGroupBy) StringsX

func (s *ShipmentHistoryGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ShipmentHistoryMutation

type ShipmentHistoryMutation struct {
	// contains filtered or unexported fields
}

ShipmentHistoryMutation represents an operation that mutates the ShipmentHistory nodes in the graph.

func (*ShipmentHistoryMutation) AddField

func (m *ShipmentHistoryMutation) 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 (*ShipmentHistoryMutation) AddedEdges

func (m *ShipmentHistoryMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ShipmentHistoryMutation) AddedField

func (m *ShipmentHistoryMutation) 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 (*ShipmentHistoryMutation) AddedFields

func (m *ShipmentHistoryMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ShipmentHistoryMutation) AddedIDs

func (m *ShipmentHistoryMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ShipmentHistoryMutation) ClearDescription

func (m *ShipmentHistoryMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*ShipmentHistoryMutation) ClearEdge

func (m *ShipmentHistoryMutation) 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 (*ShipmentHistoryMutation) ClearField

func (m *ShipmentHistoryMutation) 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 (*ShipmentHistoryMutation) ClearNewStatus

func (m *ShipmentHistoryMutation) ClearNewStatus()

ClearNewStatus clears the "new_status" edge to the ShipmentStatusCode entity.

func (*ShipmentHistoryMutation) ClearNewStatusCode

func (m *ShipmentHistoryMutation) ClearNewStatusCode()

ClearNewStatusCode clears the value of the "new_status_code" field.

func (*ShipmentHistoryMutation) ClearOldStatus

func (m *ShipmentHistoryMutation) ClearOldStatus()

ClearOldStatus clears the "old_status" edge to the ShipmentStatusCode entity.

func (*ShipmentHistoryMutation) ClearOldStatusCode

func (m *ShipmentHistoryMutation) ClearOldStatusCode()

ClearOldStatusCode clears the value of the "old_status_code" field.

func (*ShipmentHistoryMutation) ClearPerson

func (m *ShipmentHistoryMutation) ClearPerson()

ClearPerson clears the "person" edge to the Person entity.

func (*ShipmentHistoryMutation) ClearShipment

func (m *ShipmentHistoryMutation) ClearShipment()

ClearShipment clears the "shipment" edge to the Shipment entity.

func (*ShipmentHistoryMutation) ClearedEdges

func (m *ShipmentHistoryMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ShipmentHistoryMutation) ClearedFields

func (m *ShipmentHistoryMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ShipmentHistoryMutation) Client

func (m ShipmentHistoryMutation) 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 (*ShipmentHistoryMutation) CreatedAt

func (m *ShipmentHistoryMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ShipmentHistoryMutation) Description

func (m *ShipmentHistoryMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*ShipmentHistoryMutation) DescriptionCleared

func (m *ShipmentHistoryMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*ShipmentHistoryMutation) EdgeCleared

func (m *ShipmentHistoryMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ShipmentHistoryMutation) Field

func (m *ShipmentHistoryMutation) 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 (*ShipmentHistoryMutation) FieldCleared

func (m *ShipmentHistoryMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ShipmentHistoryMutation) Fields

func (m *ShipmentHistoryMutation) 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 (*ShipmentHistoryMutation) ID

func (m *ShipmentHistoryMutation) ID() (id uuid.UUID, 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 (*ShipmentHistoryMutation) 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 (*ShipmentHistoryMutation) NewStatusCleared

func (m *ShipmentHistoryMutation) NewStatusCleared() bool

NewStatusCleared reports if the "new_status" edge to the ShipmentStatusCode entity was cleared.

func (*ShipmentHistoryMutation) NewStatusCode

func (m *ShipmentHistoryMutation) NewStatusCode() (r int, exists bool)

NewStatusCode returns the value of the "new_status_code" field in the mutation.

func (*ShipmentHistoryMutation) NewStatusCodeCleared

func (m *ShipmentHistoryMutation) NewStatusCodeCleared() bool

NewStatusCodeCleared returns if the "new_status_code" field was cleared in this mutation.

func (*ShipmentHistoryMutation) NewStatusID

func (m *ShipmentHistoryMutation) NewStatusID() (id int, exists bool)

NewStatusID returns the "new_status" edge ID in the mutation.

func (*ShipmentHistoryMutation) NewStatusIDs

func (m *ShipmentHistoryMutation) NewStatusIDs() (ids []int)

NewStatusIDs returns the "new_status" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use NewStatusID instead. It exists only for internal usage by the builders.

func (*ShipmentHistoryMutation) OldCreatedAt

func (m *ShipmentHistoryMutation) OldCreatedAt(ctx context.Context) (v *time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the ShipmentHistory entity. If the ShipmentHistory 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 (*ShipmentHistoryMutation) OldDescription

func (m *ShipmentHistoryMutation) OldDescription(ctx context.Context) (v *string, err error)

OldDescription returns the old "description" field's value of the ShipmentHistory entity. If the ShipmentHistory 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 (*ShipmentHistoryMutation) OldField

func (m *ShipmentHistoryMutation) 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 (*ShipmentHistoryMutation) OldNewStatusCode

func (m *ShipmentHistoryMutation) OldNewStatusCode(ctx context.Context) (v *int, err error)

OldNewStatusCode returns the old "new_status_code" field's value of the ShipmentHistory entity. If the ShipmentHistory 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 (*ShipmentHistoryMutation) OldOldStatusCode

func (m *ShipmentHistoryMutation) OldOldStatusCode(ctx context.Context) (v *int, err error)

OldOldStatusCode returns the old "old_status_code" field's value of the ShipmentHistory entity. If the ShipmentHistory 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 (*ShipmentHistoryMutation) OldPersonID

func (m *ShipmentHistoryMutation) OldPersonID(ctx context.Context) (v uuid.UUID, err error)

OldPersonID returns the old "person_id" field's value of the ShipmentHistory entity. If the ShipmentHistory 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 (*ShipmentHistoryMutation) OldShipmentID

func (m *ShipmentHistoryMutation) OldShipmentID(ctx context.Context) (v string, err error)

OldShipmentID returns the old "shipment_id" field's value of the ShipmentHistory entity. If the ShipmentHistory 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 (*ShipmentHistoryMutation) OldStatusCleared

func (m *ShipmentHistoryMutation) OldStatusCleared() bool

OldStatusCleared reports if the "old_status" edge to the ShipmentStatusCode entity was cleared.

func (*ShipmentHistoryMutation) OldStatusCode

func (m *ShipmentHistoryMutation) OldStatusCode() (r int, exists bool)

OldStatusCode returns the value of the "old_status_code" field in the mutation.

func (*ShipmentHistoryMutation) OldStatusCodeCleared

func (m *ShipmentHistoryMutation) OldStatusCodeCleared() bool

OldStatusCodeCleared returns if the "old_status_code" field was cleared in this mutation.

func (*ShipmentHistoryMutation) OldStatusID

func (m *ShipmentHistoryMutation) OldStatusID() (id int, exists bool)

OldStatusID returns the "old_status" edge ID in the mutation.

func (*ShipmentHistoryMutation) OldStatusIDs

func (m *ShipmentHistoryMutation) OldStatusIDs() (ids []int)

OldStatusIDs returns the "old_status" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OldStatusID instead. It exists only for internal usage by the builders.

func (*ShipmentHistoryMutation) Op

func (m *ShipmentHistoryMutation) Op() Op

Op returns the operation name.

func (*ShipmentHistoryMutation) PersonCleared

func (m *ShipmentHistoryMutation) PersonCleared() bool

PersonCleared reports if the "person" edge to the Person entity was cleared.

func (*ShipmentHistoryMutation) PersonID

func (m *ShipmentHistoryMutation) PersonID() (r uuid.UUID, exists bool)

PersonID returns the value of the "person_id" field in the mutation.

func (*ShipmentHistoryMutation) PersonIDs

func (m *ShipmentHistoryMutation) PersonIDs() (ids []uuid.UUID)

PersonIDs returns the "person" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use PersonID instead. It exists only for internal usage by the builders.

func (*ShipmentHistoryMutation) RemovedEdges

func (m *ShipmentHistoryMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ShipmentHistoryMutation) RemovedIDs

func (m *ShipmentHistoryMutation) 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 (*ShipmentHistoryMutation) ResetCreatedAt

func (m *ShipmentHistoryMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ShipmentHistoryMutation) ResetDescription

func (m *ShipmentHistoryMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*ShipmentHistoryMutation) ResetEdge

func (m *ShipmentHistoryMutation) 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 (*ShipmentHistoryMutation) ResetField

func (m *ShipmentHistoryMutation) 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 (*ShipmentHistoryMutation) ResetNewStatus

func (m *ShipmentHistoryMutation) ResetNewStatus()

ResetNewStatus resets all changes to the "new_status" edge.

func (*ShipmentHistoryMutation) ResetNewStatusCode

func (m *ShipmentHistoryMutation) ResetNewStatusCode()

ResetNewStatusCode resets all changes to the "new_status_code" field.

func (*ShipmentHistoryMutation) ResetOldStatus

func (m *ShipmentHistoryMutation) ResetOldStatus()

ResetOldStatus resets all changes to the "old_status" edge.

func (*ShipmentHistoryMutation) ResetOldStatusCode

func (m *ShipmentHistoryMutation) ResetOldStatusCode()

ResetOldStatusCode resets all changes to the "old_status_code" field.

func (*ShipmentHistoryMutation) ResetPerson

func (m *ShipmentHistoryMutation) ResetPerson()

ResetPerson resets all changes to the "person" edge.

func (*ShipmentHistoryMutation) ResetPersonID

func (m *ShipmentHistoryMutation) ResetPersonID()

ResetPersonID resets all changes to the "person_id" field.

func (*ShipmentHistoryMutation) ResetShipment

func (m *ShipmentHistoryMutation) ResetShipment()

ResetShipment resets all changes to the "shipment" edge.

func (*ShipmentHistoryMutation) ResetShipmentID

func (m *ShipmentHistoryMutation) ResetShipmentID()

ResetShipmentID resets all changes to the "shipment_id" field.

func (*ShipmentHistoryMutation) SetCreatedAt

func (m *ShipmentHistoryMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ShipmentHistoryMutation) SetDescription

func (m *ShipmentHistoryMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*ShipmentHistoryMutation) SetField

func (m *ShipmentHistoryMutation) 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 (*ShipmentHistoryMutation) SetID

func (m *ShipmentHistoryMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of ShipmentHistory entities.

func (*ShipmentHistoryMutation) SetNewStatusCode

func (m *ShipmentHistoryMutation) SetNewStatusCode(i int)

SetNewStatusCode sets the "new_status_code" field.

func (*ShipmentHistoryMutation) SetNewStatusID

func (m *ShipmentHistoryMutation) SetNewStatusID(id int)

SetNewStatusID sets the "new_status" edge to the ShipmentStatusCode entity by id.

func (*ShipmentHistoryMutation) SetOldStatusCode

func (m *ShipmentHistoryMutation) SetOldStatusCode(i int)

SetOldStatusCode sets the "old_status_code" field.

func (*ShipmentHistoryMutation) SetOldStatusID

func (m *ShipmentHistoryMutation) SetOldStatusID(id int)

SetOldStatusID sets the "old_status" edge to the ShipmentStatusCode entity by id.

func (*ShipmentHistoryMutation) SetOp

func (m *ShipmentHistoryMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ShipmentHistoryMutation) SetPersonID

func (m *ShipmentHistoryMutation) SetPersonID(u uuid.UUID)

SetPersonID sets the "person_id" field.

func (*ShipmentHistoryMutation) SetShipmentID

func (m *ShipmentHistoryMutation) SetShipmentID(s string)

SetShipmentID sets the "shipment_id" field.

func (*ShipmentHistoryMutation) ShipmentCleared

func (m *ShipmentHistoryMutation) ShipmentCleared() bool

ShipmentCleared reports if the "shipment" edge to the Shipment entity was cleared.

func (*ShipmentHistoryMutation) ShipmentID

func (m *ShipmentHistoryMutation) ShipmentID() (r string, exists bool)

ShipmentID returns the value of the "shipment_id" field in the mutation.

func (*ShipmentHistoryMutation) ShipmentIDs

func (m *ShipmentHistoryMutation) ShipmentIDs() (ids []string)

ShipmentIDs returns the "shipment" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ShipmentID instead. It exists only for internal usage by the builders.

func (ShipmentHistoryMutation) Tx

func (m ShipmentHistoryMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ShipmentHistoryMutation) Type

func (m *ShipmentHistoryMutation) Type() string

Type returns the node type of this mutation (ShipmentHistory).

func (*ShipmentHistoryMutation) Where

Where appends a list predicates to the ShipmentHistoryMutation builder.

func (*ShipmentHistoryMutation) WhereP

func (m *ShipmentHistoryMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ShipmentHistoryMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ShipmentHistoryQuery

type ShipmentHistoryQuery struct {
	// contains filtered or unexported fields
}

ShipmentHistoryQuery is the builder for querying ShipmentHistory entities.

func (*ShipmentHistoryQuery) Aggregate

Aggregate returns a ShipmentHistorySelect configured with the given aggregations.

func (*ShipmentHistoryQuery) All

All executes the query and returns a list of ShipmentHistories.

func (*ShipmentHistoryQuery) AllX

AllX is like All, but panics if an error occurs.

func (*ShipmentHistoryQuery) Clone

Clone returns a duplicate of the ShipmentHistoryQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ShipmentHistoryQuery) Count

func (shq *ShipmentHistoryQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ShipmentHistoryQuery) CountX

func (shq *ShipmentHistoryQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ShipmentHistoryQuery) Exist

func (shq *ShipmentHistoryQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ShipmentHistoryQuery) ExistX

func (shq *ShipmentHistoryQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ShipmentHistoryQuery) First

First returns the first ShipmentHistory entity from the query. Returns a *NotFoundError when no ShipmentHistory was found.

func (*ShipmentHistoryQuery) FirstID

func (shq *ShipmentHistoryQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first ShipmentHistory ID from the query. Returns a *NotFoundError when no ShipmentHistory ID was found.

func (*ShipmentHistoryQuery) FirstIDX

func (shq *ShipmentHistoryQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*ShipmentHistoryQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*ShipmentHistoryQuery) GroupBy

func (shq *ShipmentHistoryQuery) GroupBy(field string, fields ...string) *ShipmentHistoryGroupBy

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.ShipmentHistory.Query().
	GroupBy(shipmenthistory.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ShipmentHistoryQuery) IDs

func (shq *ShipmentHistoryQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of ShipmentHistory IDs.

func (*ShipmentHistoryQuery) IDsX

func (shq *ShipmentHistoryQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*ShipmentHistoryQuery) Limit

func (shq *ShipmentHistoryQuery) Limit(limit int) *ShipmentHistoryQuery

Limit the number of records to be returned by this query.

func (*ShipmentHistoryQuery) Offset

func (shq *ShipmentHistoryQuery) Offset(offset int) *ShipmentHistoryQuery

Offset to start from.

func (*ShipmentHistoryQuery) Only

Only returns a single ShipmentHistory entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ShipmentHistory entity is found. Returns a *NotFoundError when no ShipmentHistory entities are found.

func (*ShipmentHistoryQuery) OnlyID

func (shq *ShipmentHistoryQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only ShipmentHistory ID in the query. Returns a *NotSingularError when more than one ShipmentHistory ID is found. Returns a *NotFoundError when no entities are found.

func (*ShipmentHistoryQuery) OnlyIDX

func (shq *ShipmentHistoryQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ShipmentHistoryQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*ShipmentHistoryQuery) Order

Order specifies how the records should be ordered.

func (*ShipmentHistoryQuery) QueryNewStatus

func (shq *ShipmentHistoryQuery) QueryNewStatus() *ShipmentStatusCodeQuery

QueryNewStatus chains the current query on the "new_status" edge.

func (*ShipmentHistoryQuery) QueryOldStatus

func (shq *ShipmentHistoryQuery) QueryOldStatus() *ShipmentStatusCodeQuery

QueryOldStatus chains the current query on the "old_status" edge.

func (*ShipmentHistoryQuery) QueryPerson

func (shq *ShipmentHistoryQuery) QueryPerson() *PersonQuery

QueryPerson chains the current query on the "person" edge.

func (*ShipmentHistoryQuery) QueryShipment

func (shq *ShipmentHistoryQuery) QueryShipment() *ShipmentQuery

QueryShipment chains the current query on the "shipment" edge.

func (*ShipmentHistoryQuery) Select

func (shq *ShipmentHistoryQuery) Select(fields ...string) *ShipmentHistorySelect

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.ShipmentHistory.Query().
	Select(shipmenthistory.FieldCreatedAt).
	Scan(ctx, &v)

func (*ShipmentHistoryQuery) Unique

func (shq *ShipmentHistoryQuery) Unique(unique bool) *ShipmentHistoryQuery

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 (*ShipmentHistoryQuery) Where

Where adds a new predicate for the ShipmentHistoryQuery builder.

func (*ShipmentHistoryQuery) WithNewStatus

func (shq *ShipmentHistoryQuery) WithNewStatus(opts ...func(*ShipmentStatusCodeQuery)) *ShipmentHistoryQuery

WithNewStatus tells the query-builder to eager-load the nodes that are connected to the "new_status" edge. The optional arguments are used to configure the query builder of the edge.

func (*ShipmentHistoryQuery) WithOldStatus

func (shq *ShipmentHistoryQuery) WithOldStatus(opts ...func(*ShipmentStatusCodeQuery)) *ShipmentHistoryQuery

WithOldStatus tells the query-builder to eager-load the nodes that are connected to the "old_status" edge. The optional arguments are used to configure the query builder of the edge.

func (*ShipmentHistoryQuery) WithPerson

func (shq *ShipmentHistoryQuery) WithPerson(opts ...func(*PersonQuery)) *ShipmentHistoryQuery

WithPerson tells the query-builder to eager-load the nodes that are connected to the "person" edge. The optional arguments are used to configure the query builder of the edge.

func (*ShipmentHistoryQuery) WithShipment

func (shq *ShipmentHistoryQuery) WithShipment(opts ...func(*ShipmentQuery)) *ShipmentHistoryQuery

WithShipment tells the query-builder to eager-load the nodes that are connected to the "shipment" edge. The optional arguments are used to configure the query builder of the edge.

type ShipmentHistorySelect

type ShipmentHistorySelect struct {
	*ShipmentHistoryQuery
	// contains filtered or unexported fields
}

ShipmentHistorySelect is the builder for selecting fields of ShipmentHistory entities.

func (*ShipmentHistorySelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*ShipmentHistorySelect) Bool

func (s *ShipmentHistorySelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ShipmentHistorySelect) BoolX

func (s *ShipmentHistorySelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ShipmentHistorySelect) Bools

func (s *ShipmentHistorySelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ShipmentHistorySelect) BoolsX

func (s *ShipmentHistorySelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ShipmentHistorySelect) Float64

func (s *ShipmentHistorySelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ShipmentHistorySelect) Float64X

func (s *ShipmentHistorySelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ShipmentHistorySelect) Float64s

func (s *ShipmentHistorySelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ShipmentHistorySelect) Float64sX

func (s *ShipmentHistorySelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ShipmentHistorySelect) Int

func (s *ShipmentHistorySelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ShipmentHistorySelect) IntX

func (s *ShipmentHistorySelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ShipmentHistorySelect) Ints

func (s *ShipmentHistorySelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ShipmentHistorySelect) IntsX

func (s *ShipmentHistorySelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ShipmentHistorySelect) Scan

func (shs *ShipmentHistorySelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ShipmentHistorySelect) ScanX

func (s *ShipmentHistorySelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ShipmentHistorySelect) String

func (s *ShipmentHistorySelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ShipmentHistorySelect) StringX

func (s *ShipmentHistorySelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ShipmentHistorySelect) Strings

func (s *ShipmentHistorySelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ShipmentHistorySelect) StringsX

func (s *ShipmentHistorySelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ShipmentHistoryUpdate

type ShipmentHistoryUpdate struct {
	// contains filtered or unexported fields
}

ShipmentHistoryUpdate is the builder for updating ShipmentHistory entities.

func (*ShipmentHistoryUpdate) Exec

func (shu *ShipmentHistoryUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ShipmentHistoryUpdate) ExecX

func (shu *ShipmentHistoryUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ShipmentHistoryUpdate) Mutation

Mutation returns the ShipmentHistoryMutation object of the builder.

func (*ShipmentHistoryUpdate) Save

func (shu *ShipmentHistoryUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ShipmentHistoryUpdate) SaveX

func (shu *ShipmentHistoryUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ShipmentHistoryUpdate) Where

Where appends a list predicates to the ShipmentHistoryUpdate builder.

type ShipmentHistoryUpdateOne

type ShipmentHistoryUpdateOne struct {
	// contains filtered or unexported fields
}

ShipmentHistoryUpdateOne is the builder for updating a single ShipmentHistory entity.

func (*ShipmentHistoryUpdateOne) Exec

Exec executes the query on the entity.

func (*ShipmentHistoryUpdateOne) ExecX

func (shuo *ShipmentHistoryUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ShipmentHistoryUpdateOne) Mutation

Mutation returns the ShipmentHistoryMutation object of the builder.

func (*ShipmentHistoryUpdateOne) Save

Save executes the query and returns the updated ShipmentHistory entity.

func (*ShipmentHistoryUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*ShipmentHistoryUpdateOne) Select

func (shuo *ShipmentHistoryUpdateOne) Select(field string, fields ...string) *ShipmentHistoryUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ShipmentHistoryUpdateOne) Where

Where appends a list predicates to the ShipmentHistoryUpdate builder.

type ShipmentItem

type ShipmentItem struct {

	// ID of the ent.
	ID uuid.UUID `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"`
	// ShipmentID holds the value of the "shipment_id" field.
	ShipmentID string `json:"shipment_id,omitempty"`
	// OrderItemID holds the value of the "order_item_id" field.
	OrderItemID uuid.UUID `json:"order_item_id,omitempty"`
	// Qty holds the value of the "qty" field.
	Qty *decimal.Decimal `json:"qty,omitempty"`
	// Total holds the value of the "total" field.
	Total *decimal.Decimal `json:"total,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ShipmentItemQuery when eager-loading is set.
	Edges ShipmentItemEdges `json:"edges"`
	// contains filtered or unexported fields
}

ShipmentItem is the model entity for the ShipmentItem schema.

func (*ShipmentItem) QueryOrderItem

func (si *ShipmentItem) QueryOrderItem() *OrderItemQuery

QueryOrderItem queries the "order_item" edge of the ShipmentItem entity.

func (*ShipmentItem) QueryShipment

func (si *ShipmentItem) QueryShipment() *ShipmentQuery

QueryShipment queries the "shipment" edge of the ShipmentItem entity.

func (*ShipmentItem) String

func (si *ShipmentItem) String() string

String implements the fmt.Stringer.

func (*ShipmentItem) Unwrap

func (si *ShipmentItem) Unwrap() *ShipmentItem

Unwrap unwraps the ShipmentItem 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 (*ShipmentItem) Update

func (si *ShipmentItem) Update() *ShipmentItemUpdateOne

Update returns a builder for updating this ShipmentItem. Note that you need to call ShipmentItem.Unwrap() before calling this method if this ShipmentItem was returned from a transaction, and the transaction was committed or rolled back.

func (*ShipmentItem) Value

func (si *ShipmentItem) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the ShipmentItem. This includes values selected through modifiers, order, etc.

type ShipmentItemClient

type ShipmentItemClient struct {
	// contains filtered or unexported fields
}

ShipmentItemClient is a client for the ShipmentItem schema.

func NewShipmentItemClient

func NewShipmentItemClient(c config) *ShipmentItemClient

NewShipmentItemClient returns a client for the ShipmentItem from the given config.

func (*ShipmentItemClient) Create

Create returns a builder for creating a ShipmentItem entity.

func (*ShipmentItemClient) CreateBulk

func (c *ShipmentItemClient) CreateBulk(builders ...*ShipmentItemCreate) *ShipmentItemCreateBulk

CreateBulk returns a builder for creating a bulk of ShipmentItem entities.

func (*ShipmentItemClient) Delete

Delete returns a delete builder for ShipmentItem.

func (*ShipmentItemClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ShipmentItemClient) DeleteOneID

func (c *ShipmentItemClient) DeleteOneID(id uuid.UUID) *ShipmentItemDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ShipmentItemClient) Get

Get returns a ShipmentItem entity by its id.

func (*ShipmentItemClient) GetX

GetX is like Get, but panics if an error occurs.

func (*ShipmentItemClient) Hooks

func (c *ShipmentItemClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ShipmentItemClient) Intercept

func (c *ShipmentItemClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `shipmentitem.Intercept(f(g(h())))`.

func (*ShipmentItemClient) Interceptors

func (c *ShipmentItemClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ShipmentItemClient) MapCreateBulk

func (c *ShipmentItemClient) MapCreateBulk(slice any, setFunc func(*ShipmentItemCreate, int)) *ShipmentItemCreateBulk

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 (*ShipmentItemClient) Query

Query returns a query builder for ShipmentItem.

func (*ShipmentItemClient) QueryOrderItem

func (c *ShipmentItemClient) QueryOrderItem(si *ShipmentItem) *OrderItemQuery

QueryOrderItem queries the order_item edge of a ShipmentItem.

func (*ShipmentItemClient) QueryShipment

func (c *ShipmentItemClient) QueryShipment(si *ShipmentItem) *ShipmentQuery

QueryShipment queries the shipment edge of a ShipmentItem.

func (*ShipmentItemClient) Update

Update returns an update builder for ShipmentItem.

func (*ShipmentItemClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ShipmentItemClient) UpdateOneID

func (c *ShipmentItemClient) UpdateOneID(id uuid.UUID) *ShipmentItemUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ShipmentItemClient) Use

func (c *ShipmentItemClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `shipmentitem.Hooks(f(g(h())))`.

type ShipmentItemCreate

type ShipmentItemCreate struct {
	// contains filtered or unexported fields
}

ShipmentItemCreate is the builder for creating a ShipmentItem entity.

func (*ShipmentItemCreate) Exec

func (sic *ShipmentItemCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ShipmentItemCreate) ExecX

func (sic *ShipmentItemCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ShipmentItemCreate) Mutation

func (sic *ShipmentItemCreate) Mutation() *ShipmentItemMutation

Mutation returns the ShipmentItemMutation object of the builder.

func (*ShipmentItemCreate) Save

Save creates the ShipmentItem in the database.

func (*ShipmentItemCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*ShipmentItemCreate) SetCreatedAt

func (sic *ShipmentItemCreate) SetCreatedAt(t time.Time) *ShipmentItemCreate

SetCreatedAt sets the "created_at" field.

func (*ShipmentItemCreate) SetID

SetID sets the "id" field.

func (*ShipmentItemCreate) SetNillableCreatedAt

func (sic *ShipmentItemCreate) SetNillableCreatedAt(t *time.Time) *ShipmentItemCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ShipmentItemCreate) SetNillableID

func (sic *ShipmentItemCreate) SetNillableID(u *uuid.UUID) *ShipmentItemCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ShipmentItemCreate) SetNillableUpdatedAt

func (sic *ShipmentItemCreate) SetNillableUpdatedAt(t *time.Time) *ShipmentItemCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*ShipmentItemCreate) SetOrderItem

func (sic *ShipmentItemCreate) SetOrderItem(o *OrderItem) *ShipmentItemCreate

SetOrderItem sets the "order_item" edge to the OrderItem entity.

func (*ShipmentItemCreate) SetOrderItemID

func (sic *ShipmentItemCreate) SetOrderItemID(u uuid.UUID) *ShipmentItemCreate

SetOrderItemID sets the "order_item_id" field.

func (*ShipmentItemCreate) SetQty

SetQty sets the "qty" field.

func (*ShipmentItemCreate) SetShipment

func (sic *ShipmentItemCreate) SetShipment(s *Shipment) *ShipmentItemCreate

SetShipment sets the "shipment" edge to the Shipment entity.

func (*ShipmentItemCreate) SetShipmentID

func (sic *ShipmentItemCreate) SetShipmentID(s string) *ShipmentItemCreate

SetShipmentID sets the "shipment_id" field.

func (*ShipmentItemCreate) SetTotal

SetTotal sets the "total" field.

func (*ShipmentItemCreate) SetUpdatedAt

func (sic *ShipmentItemCreate) SetUpdatedAt(t time.Time) *ShipmentItemCreate

SetUpdatedAt sets the "updated_at" field.

type ShipmentItemCreateBulk

type ShipmentItemCreateBulk struct {
	// contains filtered or unexported fields
}

ShipmentItemCreateBulk is the builder for creating many ShipmentItem entities in bulk.

func (*ShipmentItemCreateBulk) Exec

func (sicb *ShipmentItemCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ShipmentItemCreateBulk) ExecX

func (sicb *ShipmentItemCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ShipmentItemCreateBulk) Save

Save creates the ShipmentItem entities in the database.

func (*ShipmentItemCreateBulk) SaveX

func (sicb *ShipmentItemCreateBulk) SaveX(ctx context.Context) []*ShipmentItem

SaveX is like Save, but panics if an error occurs.

type ShipmentItemDelete

type ShipmentItemDelete struct {
	// contains filtered or unexported fields
}

ShipmentItemDelete is the builder for deleting a ShipmentItem entity.

func (*ShipmentItemDelete) Exec

func (sid *ShipmentItemDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ShipmentItemDelete) ExecX

func (sid *ShipmentItemDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ShipmentItemDelete) Where

Where appends a list predicates to the ShipmentItemDelete builder.

type ShipmentItemDeleteOne

type ShipmentItemDeleteOne struct {
	// contains filtered or unexported fields
}

ShipmentItemDeleteOne is the builder for deleting a single ShipmentItem entity.

func (*ShipmentItemDeleteOne) Exec

func (sido *ShipmentItemDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ShipmentItemDeleteOne) ExecX

func (sido *ShipmentItemDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ShipmentItemDeleteOne) Where

Where appends a list predicates to the ShipmentItemDelete builder.

type ShipmentItemEdges

type ShipmentItemEdges struct {
	// Shipment holds the value of the shipment edge.
	Shipment *Shipment `json:"shipment,omitempty"`
	// OrderItem holds the value of the order_item edge.
	OrderItem *OrderItem `json:"order_item,omitempty"`
	// contains filtered or unexported fields
}

ShipmentItemEdges holds the relations/edges for other nodes in the graph.

func (ShipmentItemEdges) OrderItemOrErr

func (e ShipmentItemEdges) OrderItemOrErr() (*OrderItem, error)

OrderItemOrErr returns the OrderItem value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ShipmentItemEdges) ShipmentOrErr

func (e ShipmentItemEdges) ShipmentOrErr() (*Shipment, error)

ShipmentOrErr returns the Shipment value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type ShipmentItemGroupBy

type ShipmentItemGroupBy struct {
	// contains filtered or unexported fields
}

ShipmentItemGroupBy is the group-by builder for ShipmentItem entities.

func (*ShipmentItemGroupBy) Aggregate

func (sigb *ShipmentItemGroupBy) Aggregate(fns ...AggregateFunc) *ShipmentItemGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ShipmentItemGroupBy) Bool

func (s *ShipmentItemGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ShipmentItemGroupBy) BoolX

func (s *ShipmentItemGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ShipmentItemGroupBy) Bools

func (s *ShipmentItemGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ShipmentItemGroupBy) BoolsX

func (s *ShipmentItemGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ShipmentItemGroupBy) Float64

func (s *ShipmentItemGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ShipmentItemGroupBy) Float64X

func (s *ShipmentItemGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ShipmentItemGroupBy) Float64s

func (s *ShipmentItemGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ShipmentItemGroupBy) Float64sX

func (s *ShipmentItemGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ShipmentItemGroupBy) Int

func (s *ShipmentItemGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ShipmentItemGroupBy) IntX

func (s *ShipmentItemGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ShipmentItemGroupBy) Ints

func (s *ShipmentItemGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ShipmentItemGroupBy) IntsX

func (s *ShipmentItemGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ShipmentItemGroupBy) Scan

func (sigb *ShipmentItemGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ShipmentItemGroupBy) ScanX

func (s *ShipmentItemGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ShipmentItemGroupBy) String

func (s *ShipmentItemGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ShipmentItemGroupBy) StringX

func (s *ShipmentItemGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ShipmentItemGroupBy) Strings

func (s *ShipmentItemGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ShipmentItemGroupBy) StringsX

func (s *ShipmentItemGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ShipmentItemMutation

type ShipmentItemMutation struct {
	// contains filtered or unexported fields
}

ShipmentItemMutation represents an operation that mutates the ShipmentItem nodes in the graph.

func (*ShipmentItemMutation) AddField

func (m *ShipmentItemMutation) 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 (*ShipmentItemMutation) AddQty

func (m *ShipmentItemMutation) AddQty(d decimal.Decimal)

AddQty adds d to the "qty" field.

func (*ShipmentItemMutation) AddTotal

func (m *ShipmentItemMutation) AddTotal(d decimal.Decimal)

AddTotal adds d to the "total" field.

func (*ShipmentItemMutation) AddedEdges

func (m *ShipmentItemMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ShipmentItemMutation) AddedField

func (m *ShipmentItemMutation) 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 (*ShipmentItemMutation) AddedFields

func (m *ShipmentItemMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ShipmentItemMutation) AddedIDs

func (m *ShipmentItemMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ShipmentItemMutation) AddedQty

func (m *ShipmentItemMutation) AddedQty() (r decimal.Decimal, exists bool)

AddedQty returns the value that was added to the "qty" field in this mutation.

func (*ShipmentItemMutation) AddedTotal

func (m *ShipmentItemMutation) AddedTotal() (r decimal.Decimal, exists bool)

AddedTotal returns the value that was added to the "total" field in this mutation.

func (*ShipmentItemMutation) ClearEdge

func (m *ShipmentItemMutation) 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 (*ShipmentItemMutation) ClearField

func (m *ShipmentItemMutation) 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 (*ShipmentItemMutation) ClearOrderItem

func (m *ShipmentItemMutation) ClearOrderItem()

ClearOrderItem clears the "order_item" edge to the OrderItem entity.

func (*ShipmentItemMutation) ClearShipment

func (m *ShipmentItemMutation) ClearShipment()

ClearShipment clears the "shipment" edge to the Shipment entity.

func (*ShipmentItemMutation) ClearedEdges

func (m *ShipmentItemMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ShipmentItemMutation) ClearedFields

func (m *ShipmentItemMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ShipmentItemMutation) Client

func (m ShipmentItemMutation) 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 (*ShipmentItemMutation) CreatedAt

func (m *ShipmentItemMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ShipmentItemMutation) EdgeCleared

func (m *ShipmentItemMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ShipmentItemMutation) Field

func (m *ShipmentItemMutation) 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 (*ShipmentItemMutation) FieldCleared

func (m *ShipmentItemMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ShipmentItemMutation) Fields

func (m *ShipmentItemMutation) 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 (*ShipmentItemMutation) ID

func (m *ShipmentItemMutation) ID() (id uuid.UUID, 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 (*ShipmentItemMutation) 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 (*ShipmentItemMutation) OldCreatedAt

func (m *ShipmentItemMutation) OldCreatedAt(ctx context.Context) (v *time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the ShipmentItem entity. If the ShipmentItem 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 (*ShipmentItemMutation) OldField

func (m *ShipmentItemMutation) 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 (*ShipmentItemMutation) OldOrderItemID

func (m *ShipmentItemMutation) OldOrderItemID(ctx context.Context) (v uuid.UUID, err error)

OldOrderItemID returns the old "order_item_id" field's value of the ShipmentItem entity. If the ShipmentItem 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 (*ShipmentItemMutation) OldQty

func (m *ShipmentItemMutation) OldQty(ctx context.Context) (v *decimal.Decimal, err error)

OldQty returns the old "qty" field's value of the ShipmentItem entity. If the ShipmentItem 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 (*ShipmentItemMutation) OldShipmentID

func (m *ShipmentItemMutation) OldShipmentID(ctx context.Context) (v string, err error)

OldShipmentID returns the old "shipment_id" field's value of the ShipmentItem entity. If the ShipmentItem 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 (*ShipmentItemMutation) OldTotal

func (m *ShipmentItemMutation) OldTotal(ctx context.Context) (v *decimal.Decimal, err error)

OldTotal returns the old "total" field's value of the ShipmentItem entity. If the ShipmentItem 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 (*ShipmentItemMutation) OldUpdatedAt

func (m *ShipmentItemMutation) OldUpdatedAt(ctx context.Context) (v *time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the ShipmentItem entity. If the ShipmentItem 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 (*ShipmentItemMutation) Op

func (m *ShipmentItemMutation) Op() Op

Op returns the operation name.

func (*ShipmentItemMutation) OrderItemCleared

func (m *ShipmentItemMutation) OrderItemCleared() bool

OrderItemCleared reports if the "order_item" edge to the OrderItem entity was cleared.

func (*ShipmentItemMutation) OrderItemID

func (m *ShipmentItemMutation) OrderItemID() (r uuid.UUID, exists bool)

OrderItemID returns the value of the "order_item_id" field in the mutation.

func (*ShipmentItemMutation) OrderItemIDs

func (m *ShipmentItemMutation) OrderItemIDs() (ids []uuid.UUID)

OrderItemIDs returns the "order_item" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OrderItemID instead. It exists only for internal usage by the builders.

func (*ShipmentItemMutation) Qty

func (m *ShipmentItemMutation) Qty() (r decimal.Decimal, exists bool)

Qty returns the value of the "qty" field in the mutation.

func (*ShipmentItemMutation) RemovedEdges

func (m *ShipmentItemMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ShipmentItemMutation) RemovedIDs

func (m *ShipmentItemMutation) 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 (*ShipmentItemMutation) ResetCreatedAt

func (m *ShipmentItemMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ShipmentItemMutation) ResetEdge

func (m *ShipmentItemMutation) 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 (*ShipmentItemMutation) ResetField

func (m *ShipmentItemMutation) 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 (*ShipmentItemMutation) ResetOrderItem

func (m *ShipmentItemMutation) ResetOrderItem()

ResetOrderItem resets all changes to the "order_item" edge.

func (*ShipmentItemMutation) ResetOrderItemID

func (m *ShipmentItemMutation) ResetOrderItemID()

ResetOrderItemID resets all changes to the "order_item_id" field.

func (*ShipmentItemMutation) ResetQty

func (m *ShipmentItemMutation) ResetQty()

ResetQty resets all changes to the "qty" field.

func (*ShipmentItemMutation) ResetShipment

func (m *ShipmentItemMutation) ResetShipment()

ResetShipment resets all changes to the "shipment" edge.

func (*ShipmentItemMutation) ResetShipmentID

func (m *ShipmentItemMutation) ResetShipmentID()

ResetShipmentID resets all changes to the "shipment_id" field.

func (*ShipmentItemMutation) ResetTotal

func (m *ShipmentItemMutation) ResetTotal()

ResetTotal resets all changes to the "total" field.

func (*ShipmentItemMutation) ResetUpdatedAt

func (m *ShipmentItemMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ShipmentItemMutation) SetCreatedAt

func (m *ShipmentItemMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ShipmentItemMutation) SetField

func (m *ShipmentItemMutation) 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 (*ShipmentItemMutation) SetID

func (m *ShipmentItemMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of ShipmentItem entities.

func (*ShipmentItemMutation) SetOp

func (m *ShipmentItemMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ShipmentItemMutation) SetOrderItemID

func (m *ShipmentItemMutation) SetOrderItemID(u uuid.UUID)

SetOrderItemID sets the "order_item_id" field.

func (*ShipmentItemMutation) SetQty

func (m *ShipmentItemMutation) SetQty(d decimal.Decimal)

SetQty sets the "qty" field.

func (*ShipmentItemMutation) SetShipmentID

func (m *ShipmentItemMutation) SetShipmentID(s string)

SetShipmentID sets the "shipment_id" field.

func (*ShipmentItemMutation) SetTotal

func (m *ShipmentItemMutation) SetTotal(d decimal.Decimal)

SetTotal sets the "total" field.

func (*ShipmentItemMutation) SetUpdatedAt

func (m *ShipmentItemMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*ShipmentItemMutation) ShipmentCleared

func (m *ShipmentItemMutation) ShipmentCleared() bool

ShipmentCleared reports if the "shipment" edge to the Shipment entity was cleared.

func (*ShipmentItemMutation) ShipmentID

func (m *ShipmentItemMutation) ShipmentID() (r string, exists bool)

ShipmentID returns the value of the "shipment_id" field in the mutation.

func (*ShipmentItemMutation) ShipmentIDs

func (m *ShipmentItemMutation) ShipmentIDs() (ids []string)

ShipmentIDs returns the "shipment" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ShipmentID instead. It exists only for internal usage by the builders.

func (*ShipmentItemMutation) Total

func (m *ShipmentItemMutation) Total() (r decimal.Decimal, exists bool)

Total returns the value of the "total" field in the mutation.

func (ShipmentItemMutation) Tx

func (m ShipmentItemMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ShipmentItemMutation) Type

func (m *ShipmentItemMutation) Type() string

Type returns the node type of this mutation (ShipmentItem).

func (*ShipmentItemMutation) UpdatedAt

func (m *ShipmentItemMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*ShipmentItemMutation) Where

Where appends a list predicates to the ShipmentItemMutation builder.

func (*ShipmentItemMutation) WhereP

func (m *ShipmentItemMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ShipmentItemMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ShipmentItemQuery

type ShipmentItemQuery struct {
	// contains filtered or unexported fields
}

ShipmentItemQuery is the builder for querying ShipmentItem entities.

func (*ShipmentItemQuery) Aggregate

func (siq *ShipmentItemQuery) Aggregate(fns ...AggregateFunc) *ShipmentItemSelect

Aggregate returns a ShipmentItemSelect configured with the given aggregations.

func (*ShipmentItemQuery) All

func (siq *ShipmentItemQuery) All(ctx context.Context) ([]*ShipmentItem, error)

All executes the query and returns a list of ShipmentItems.

func (*ShipmentItemQuery) AllX

func (siq *ShipmentItemQuery) AllX(ctx context.Context) []*ShipmentItem

AllX is like All, but panics if an error occurs.

func (*ShipmentItemQuery) Clone

func (siq *ShipmentItemQuery) Clone() *ShipmentItemQuery

Clone returns a duplicate of the ShipmentItemQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ShipmentItemQuery) Count

func (siq *ShipmentItemQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ShipmentItemQuery) CountX

func (siq *ShipmentItemQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ShipmentItemQuery) Exist

func (siq *ShipmentItemQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ShipmentItemQuery) ExistX

func (siq *ShipmentItemQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ShipmentItemQuery) First

func (siq *ShipmentItemQuery) First(ctx context.Context) (*ShipmentItem, error)

First returns the first ShipmentItem entity from the query. Returns a *NotFoundError when no ShipmentItem was found.

func (*ShipmentItemQuery) FirstID

func (siq *ShipmentItemQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first ShipmentItem ID from the query. Returns a *NotFoundError when no ShipmentItem ID was found.

func (*ShipmentItemQuery) FirstIDX

func (siq *ShipmentItemQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*ShipmentItemQuery) FirstX

func (siq *ShipmentItemQuery) FirstX(ctx context.Context) *ShipmentItem

FirstX is like First, but panics if an error occurs.

func (*ShipmentItemQuery) GroupBy

func (siq *ShipmentItemQuery) GroupBy(field string, fields ...string) *ShipmentItemGroupBy

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.ShipmentItem.Query().
	GroupBy(shipmentitem.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ShipmentItemQuery) IDs

func (siq *ShipmentItemQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of ShipmentItem IDs.

func (*ShipmentItemQuery) IDsX

func (siq *ShipmentItemQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*ShipmentItemQuery) Limit

func (siq *ShipmentItemQuery) Limit(limit int) *ShipmentItemQuery

Limit the number of records to be returned by this query.

func (*ShipmentItemQuery) Offset

func (siq *ShipmentItemQuery) Offset(offset int) *ShipmentItemQuery

Offset to start from.

func (*ShipmentItemQuery) Only

func (siq *ShipmentItemQuery) Only(ctx context.Context) (*ShipmentItem, error)

Only returns a single ShipmentItem entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ShipmentItem entity is found. Returns a *NotFoundError when no ShipmentItem entities are found.

func (*ShipmentItemQuery) OnlyID

func (siq *ShipmentItemQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only ShipmentItem ID in the query. Returns a *NotSingularError when more than one ShipmentItem ID is found. Returns a *NotFoundError when no entities are found.

func (*ShipmentItemQuery) OnlyIDX

func (siq *ShipmentItemQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ShipmentItemQuery) OnlyX

func (siq *ShipmentItemQuery) OnlyX(ctx context.Context) *ShipmentItem

OnlyX is like Only, but panics if an error occurs.

func (*ShipmentItemQuery) Order

Order specifies how the records should be ordered.

func (*ShipmentItemQuery) QueryOrderItem

func (siq *ShipmentItemQuery) QueryOrderItem() *OrderItemQuery

QueryOrderItem chains the current query on the "order_item" edge.

func (*ShipmentItemQuery) QueryShipment

func (siq *ShipmentItemQuery) QueryShipment() *ShipmentQuery

QueryShipment chains the current query on the "shipment" edge.

func (*ShipmentItemQuery) Select

func (siq *ShipmentItemQuery) Select(fields ...string) *ShipmentItemSelect

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.ShipmentItem.Query().
	Select(shipmentitem.FieldCreatedAt).
	Scan(ctx, &v)

func (*ShipmentItemQuery) Unique

func (siq *ShipmentItemQuery) Unique(unique bool) *ShipmentItemQuery

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 (*ShipmentItemQuery) Where

Where adds a new predicate for the ShipmentItemQuery builder.

func (*ShipmentItemQuery) WithOrderItem

func (siq *ShipmentItemQuery) WithOrderItem(opts ...func(*OrderItemQuery)) *ShipmentItemQuery

WithOrderItem tells the query-builder to eager-load the nodes that are connected to the "order_item" edge. The optional arguments are used to configure the query builder of the edge.

func (*ShipmentItemQuery) WithShipment

func (siq *ShipmentItemQuery) WithShipment(opts ...func(*ShipmentQuery)) *ShipmentItemQuery

WithShipment tells the query-builder to eager-load the nodes that are connected to the "shipment" edge. The optional arguments are used to configure the query builder of the edge.

type ShipmentItemSelect

type ShipmentItemSelect struct {
	*ShipmentItemQuery
	// contains filtered or unexported fields
}

ShipmentItemSelect is the builder for selecting fields of ShipmentItem entities.

func (*ShipmentItemSelect) Aggregate

func (sis *ShipmentItemSelect) Aggregate(fns ...AggregateFunc) *ShipmentItemSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ShipmentItemSelect) Bool

func (s *ShipmentItemSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ShipmentItemSelect) BoolX

func (s *ShipmentItemSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ShipmentItemSelect) Bools

func (s *ShipmentItemSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ShipmentItemSelect) BoolsX

func (s *ShipmentItemSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ShipmentItemSelect) Float64

func (s *ShipmentItemSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ShipmentItemSelect) Float64X

func (s *ShipmentItemSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ShipmentItemSelect) Float64s

func (s *ShipmentItemSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ShipmentItemSelect) Float64sX

func (s *ShipmentItemSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ShipmentItemSelect) Int

func (s *ShipmentItemSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ShipmentItemSelect) IntX

func (s *ShipmentItemSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ShipmentItemSelect) Ints

func (s *ShipmentItemSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ShipmentItemSelect) IntsX

func (s *ShipmentItemSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ShipmentItemSelect) Scan

func (sis *ShipmentItemSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ShipmentItemSelect) ScanX

func (s *ShipmentItemSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ShipmentItemSelect) String

func (s *ShipmentItemSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ShipmentItemSelect) StringX

func (s *ShipmentItemSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ShipmentItemSelect) Strings

func (s *ShipmentItemSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ShipmentItemSelect) StringsX

func (s *ShipmentItemSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ShipmentItemUpdate

type ShipmentItemUpdate struct {
	// contains filtered or unexported fields
}

ShipmentItemUpdate is the builder for updating ShipmentItem entities.

func (*ShipmentItemUpdate) Exec

func (siu *ShipmentItemUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ShipmentItemUpdate) ExecX

func (siu *ShipmentItemUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ShipmentItemUpdate) Mutation

func (siu *ShipmentItemUpdate) Mutation() *ShipmentItemMutation

Mutation returns the ShipmentItemMutation object of the builder.

func (*ShipmentItemUpdate) Save

func (siu *ShipmentItemUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ShipmentItemUpdate) SaveX

func (siu *ShipmentItemUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ShipmentItemUpdate) SetUpdatedAt

func (siu *ShipmentItemUpdate) SetUpdatedAt(t time.Time) *ShipmentItemUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ShipmentItemUpdate) Where

Where appends a list predicates to the ShipmentItemUpdate builder.

type ShipmentItemUpdateOne

type ShipmentItemUpdateOne struct {
	// contains filtered or unexported fields
}

ShipmentItemUpdateOne is the builder for updating a single ShipmentItem entity.

func (*ShipmentItemUpdateOne) Exec

func (siuo *ShipmentItemUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ShipmentItemUpdateOne) ExecX

func (siuo *ShipmentItemUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ShipmentItemUpdateOne) Mutation

func (siuo *ShipmentItemUpdateOne) Mutation() *ShipmentItemMutation

Mutation returns the ShipmentItemMutation object of the builder.

func (*ShipmentItemUpdateOne) Save

Save executes the query and returns the updated ShipmentItem entity.

func (*ShipmentItemUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*ShipmentItemUpdateOne) Select

func (siuo *ShipmentItemUpdateOne) Select(field string, fields ...string) *ShipmentItemUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ShipmentItemUpdateOne) SetUpdatedAt

func (siuo *ShipmentItemUpdateOne) SetUpdatedAt(t time.Time) *ShipmentItemUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ShipmentItemUpdateOne) Where

Where appends a list predicates to the ShipmentItemUpdate builder.

type ShipmentItems

type ShipmentItems []*ShipmentItem

ShipmentItems is a parsable slice of ShipmentItem.

type ShipmentMutation

type ShipmentMutation struct {
	// contains filtered or unexported fields
}

ShipmentMutation represents an operation that mutates the Shipment nodes in the graph.

func (*ShipmentMutation) AddField

func (m *ShipmentMutation) 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 (*ShipmentMutation) AddedEdges

func (m *ShipmentMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ShipmentMutation) AddedField

func (m *ShipmentMutation) 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 (*ShipmentMutation) AddedFields

func (m *ShipmentMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ShipmentMutation) AddedIDs

func (m *ShipmentMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ShipmentMutation) ClearEdge

func (m *ShipmentMutation) 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 (*ShipmentMutation) ClearField

func (m *ShipmentMutation) 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 (*ShipmentMutation) ClearInvoice

func (m *ShipmentMutation) ClearInvoice()

ClearInvoice clears the "invoice" edge to the Invoice entity.

func (*ShipmentMutation) ClearNote

func (m *ShipmentMutation) ClearNote()

ClearNote clears the value of the "note" field.

func (*ShipmentMutation) ClearOrder

func (m *ShipmentMutation) ClearOrder()

ClearOrder clears the "order" edge to the Order entity.

func (*ShipmentMutation) ClearShipmentStatus

func (m *ShipmentMutation) ClearShipmentStatus()

ClearShipmentStatus clears the "shipment_status" edge to the ShipmentStatusCode entity.

func (*ShipmentMutation) ClearStaff

func (m *ShipmentMutation) ClearStaff()

ClearStaff clears the "staff" edge to the Person entity.

func (*ShipmentMutation) ClearedEdges

func (m *ShipmentMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ShipmentMutation) ClearedFields

func (m *ShipmentMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ShipmentMutation) Client

func (m ShipmentMutation) 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 (*ShipmentMutation) CreatedAt

func (m *ShipmentMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ShipmentMutation) EdgeCleared

func (m *ShipmentMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ShipmentMutation) Field

func (m *ShipmentMutation) 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 (*ShipmentMutation) FieldCleared

func (m *ShipmentMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ShipmentMutation) Fields

func (m *ShipmentMutation) 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 (*ShipmentMutation) ID

func (m *ShipmentMutation) ID() (id string, 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 (*ShipmentMutation) IDs

func (m *ShipmentMutation) IDs(ctx context.Context) ([]string, 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 (*ShipmentMutation) InvoiceCleared

func (m *ShipmentMutation) InvoiceCleared() bool

InvoiceCleared reports if the "invoice" edge to the Invoice entity was cleared.

func (*ShipmentMutation) InvoiceID

func (m *ShipmentMutation) InvoiceID() (r uuid.UUID, exists bool)

InvoiceID returns the value of the "invoice_id" field in the mutation.

func (*ShipmentMutation) InvoiceIDs

func (m *ShipmentMutation) InvoiceIDs() (ids []uuid.UUID)

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 (*ShipmentMutation) Note

func (m *ShipmentMutation) Note() (r string, exists bool)

Note returns the value of the "note" field in the mutation.

func (*ShipmentMutation) NoteCleared

func (m *ShipmentMutation) NoteCleared() bool

NoteCleared returns if the "note" field was cleared in this mutation.

func (*ShipmentMutation) OldCreatedAt

func (m *ShipmentMutation) OldCreatedAt(ctx context.Context) (v *time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Shipment entity. If the Shipment 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 (*ShipmentMutation) OldField

func (m *ShipmentMutation) 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 (*ShipmentMutation) OldInvoiceID

func (m *ShipmentMutation) OldInvoiceID(ctx context.Context) (v uuid.UUID, err error)

OldInvoiceID returns the old "invoice_id" field's value of the Shipment entity. If the Shipment 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 (*ShipmentMutation) OldNote

func (m *ShipmentMutation) OldNote(ctx context.Context) (v *string, err error)

OldNote returns the old "note" field's value of the Shipment entity. If the Shipment 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 (*ShipmentMutation) OldOrderID

func (m *ShipmentMutation) OldOrderID(ctx context.Context) (v uuid.UUID, err error)

OldOrderID returns the old "order_id" field's value of the Shipment entity. If the Shipment 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 (*ShipmentMutation) OldShipmentDate

func (m *ShipmentMutation) OldShipmentDate(ctx context.Context) (v *time.Time, err error)

OldShipmentDate returns the old "shipment_date" field's value of the Shipment entity. If the Shipment 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 (*ShipmentMutation) OldStaffID

func (m *ShipmentMutation) OldStaffID(ctx context.Context) (v uuid.UUID, err error)

OldStaffID returns the old "staff_id" field's value of the Shipment entity. If the Shipment 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 (*ShipmentMutation) OldStatusCode

func (m *ShipmentMutation) OldStatusCode(ctx context.Context) (v *int, err error)

OldStatusCode returns the old "status_code" field's value of the Shipment entity. If the Shipment 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 (*ShipmentMutation) OldUpdatedAt

func (m *ShipmentMutation) OldUpdatedAt(ctx context.Context) (v *time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Shipment entity. If the Shipment 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 (*ShipmentMutation) Op

func (m *ShipmentMutation) Op() Op

Op returns the operation name.

func (*ShipmentMutation) OrderCleared

func (m *ShipmentMutation) OrderCleared() bool

OrderCleared reports if the "order" edge to the Order entity was cleared.

func (*ShipmentMutation) OrderID

func (m *ShipmentMutation) OrderID() (r uuid.UUID, exists bool)

OrderID returns the value of the "order_id" field in the mutation.

func (*ShipmentMutation) OrderIDs

func (m *ShipmentMutation) OrderIDs() (ids []uuid.UUID)

OrderIDs returns the "order" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OrderID instead. It exists only for internal usage by the builders.

func (*ShipmentMutation) RemovedEdges

func (m *ShipmentMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ShipmentMutation) RemovedIDs

func (m *ShipmentMutation) 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 (*ShipmentMutation) ResetCreatedAt

func (m *ShipmentMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ShipmentMutation) ResetEdge

func (m *ShipmentMutation) 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 (*ShipmentMutation) ResetField

func (m *ShipmentMutation) 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 (*ShipmentMutation) ResetInvoice

func (m *ShipmentMutation) ResetInvoice()

ResetInvoice resets all changes to the "invoice" edge.

func (*ShipmentMutation) ResetInvoiceID

func (m *ShipmentMutation) ResetInvoiceID()

ResetInvoiceID resets all changes to the "invoice_id" field.

func (*ShipmentMutation) ResetNote

func (m *ShipmentMutation) ResetNote()

ResetNote resets all changes to the "note" field.

func (*ShipmentMutation) ResetOrder

func (m *ShipmentMutation) ResetOrder()

ResetOrder resets all changes to the "order" edge.

func (*ShipmentMutation) ResetOrderID

func (m *ShipmentMutation) ResetOrderID()

ResetOrderID resets all changes to the "order_id" field.

func (*ShipmentMutation) ResetShipmentDate

func (m *ShipmentMutation) ResetShipmentDate()

ResetShipmentDate resets all changes to the "shipment_date" field.

func (*ShipmentMutation) ResetShipmentStatus

func (m *ShipmentMutation) ResetShipmentStatus()

ResetShipmentStatus resets all changes to the "shipment_status" edge.

func (*ShipmentMutation) ResetStaff

func (m *ShipmentMutation) ResetStaff()

ResetStaff resets all changes to the "staff" edge.

func (*ShipmentMutation) ResetStaffID

func (m *ShipmentMutation) ResetStaffID()

ResetStaffID resets all changes to the "staff_id" field.

func (*ShipmentMutation) ResetStatusCode

func (m *ShipmentMutation) ResetStatusCode()

ResetStatusCode resets all changes to the "status_code" field.

func (*ShipmentMutation) ResetUpdatedAt

func (m *ShipmentMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ShipmentMutation) SetCreatedAt

func (m *ShipmentMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ShipmentMutation) SetField

func (m *ShipmentMutation) 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 (*ShipmentMutation) SetID

func (m *ShipmentMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Shipment entities.

func (*ShipmentMutation) SetInvoiceID

func (m *ShipmentMutation) SetInvoiceID(u uuid.UUID)

SetInvoiceID sets the "invoice_id" field.

func (*ShipmentMutation) SetNote

func (m *ShipmentMutation) SetNote(s string)

SetNote sets the "note" field.

func (*ShipmentMutation) SetOp

func (m *ShipmentMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ShipmentMutation) SetOrderID

func (m *ShipmentMutation) SetOrderID(u uuid.UUID)

SetOrderID sets the "order_id" field.

func (*ShipmentMutation) SetShipmentDate

func (m *ShipmentMutation) SetShipmentDate(t time.Time)

SetShipmentDate sets the "shipment_date" field.

func (*ShipmentMutation) SetShipmentStatusID

func (m *ShipmentMutation) SetShipmentStatusID(id int)

SetShipmentStatusID sets the "shipment_status" edge to the ShipmentStatusCode entity by id.

func (*ShipmentMutation) SetStaffID

func (m *ShipmentMutation) SetStaffID(u uuid.UUID)

SetStaffID sets the "staff_id" field.

func (*ShipmentMutation) SetStatusCode

func (m *ShipmentMutation) SetStatusCode(i int)

SetStatusCode sets the "status_code" field.

func (*ShipmentMutation) SetUpdatedAt

func (m *ShipmentMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*ShipmentMutation) ShipmentDate

func (m *ShipmentMutation) ShipmentDate() (r time.Time, exists bool)

ShipmentDate returns the value of the "shipment_date" field in the mutation.

func (*ShipmentMutation) ShipmentStatusCleared

func (m *ShipmentMutation) ShipmentStatusCleared() bool

ShipmentStatusCleared reports if the "shipment_status" edge to the ShipmentStatusCode entity was cleared.

func (*ShipmentMutation) ShipmentStatusID

func (m *ShipmentMutation) ShipmentStatusID() (id int, exists bool)

ShipmentStatusID returns the "shipment_status" edge ID in the mutation.

func (*ShipmentMutation) ShipmentStatusIDs

func (m *ShipmentMutation) ShipmentStatusIDs() (ids []int)

ShipmentStatusIDs returns the "shipment_status" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ShipmentStatusID instead. It exists only for internal usage by the builders.

func (*ShipmentMutation) StaffCleared

func (m *ShipmentMutation) StaffCleared() bool

StaffCleared reports if the "staff" edge to the Person entity was cleared.

func (*ShipmentMutation) StaffID

func (m *ShipmentMutation) StaffID() (r uuid.UUID, exists bool)

StaffID returns the value of the "staff_id" field in the mutation.

func (*ShipmentMutation) StaffIDs

func (m *ShipmentMutation) StaffIDs() (ids []uuid.UUID)

StaffIDs returns the "staff" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use StaffID instead. It exists only for internal usage by the builders.

func (*ShipmentMutation) StatusCode

func (m *ShipmentMutation) StatusCode() (r int, exists bool)

StatusCode returns the value of the "status_code" field in the mutation.

func (ShipmentMutation) Tx

func (m ShipmentMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ShipmentMutation) Type

func (m *ShipmentMutation) Type() string

Type returns the node type of this mutation (Shipment).

func (*ShipmentMutation) UpdatedAt

func (m *ShipmentMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*ShipmentMutation) Where

func (m *ShipmentMutation) Where(ps ...predicate.Shipment)

Where appends a list predicates to the ShipmentMutation builder.

func (*ShipmentMutation) WhereP

func (m *ShipmentMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ShipmentMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ShipmentQuery

type ShipmentQuery struct {
	// contains filtered or unexported fields
}

ShipmentQuery is the builder for querying Shipment entities.

func (*ShipmentQuery) Aggregate

func (sq *ShipmentQuery) Aggregate(fns ...AggregateFunc) *ShipmentSelect

Aggregate returns a ShipmentSelect configured with the given aggregations.

func (*ShipmentQuery) All

func (sq *ShipmentQuery) All(ctx context.Context) ([]*Shipment, error)

All executes the query and returns a list of Shipments.

func (*ShipmentQuery) AllX

func (sq *ShipmentQuery) AllX(ctx context.Context) []*Shipment

AllX is like All, but panics if an error occurs.

func (*ShipmentQuery) Clone

func (sq *ShipmentQuery) Clone() *ShipmentQuery

Clone returns a duplicate of the ShipmentQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ShipmentQuery) Count

func (sq *ShipmentQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ShipmentQuery) CountX

func (sq *ShipmentQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ShipmentQuery) Exist

func (sq *ShipmentQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ShipmentQuery) ExistX

func (sq *ShipmentQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ShipmentQuery) First

func (sq *ShipmentQuery) First(ctx context.Context) (*Shipment, error)

First returns the first Shipment entity from the query. Returns a *NotFoundError when no Shipment was found.

func (*ShipmentQuery) FirstID

func (sq *ShipmentQuery) FirstID(ctx context.Context) (id string, err error)

FirstID returns the first Shipment ID from the query. Returns a *NotFoundError when no Shipment ID was found.

func (*ShipmentQuery) FirstIDX

func (sq *ShipmentQuery) FirstIDX(ctx context.Context) string

FirstIDX is like FirstID, but panics if an error occurs.

func (*ShipmentQuery) FirstX

func (sq *ShipmentQuery) FirstX(ctx context.Context) *Shipment

FirstX is like First, but panics if an error occurs.

func (*ShipmentQuery) GroupBy

func (sq *ShipmentQuery) GroupBy(field string, fields ...string) *ShipmentGroupBy

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.Shipment.Query().
	GroupBy(shipment.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ShipmentQuery) IDs

func (sq *ShipmentQuery) IDs(ctx context.Context) (ids []string, err error)

IDs executes the query and returns a list of Shipment IDs.

func (*ShipmentQuery) IDsX

func (sq *ShipmentQuery) IDsX(ctx context.Context) []string

IDsX is like IDs, but panics if an error occurs.

func (*ShipmentQuery) Limit

func (sq *ShipmentQuery) Limit(limit int) *ShipmentQuery

Limit the number of records to be returned by this query.

func (*ShipmentQuery) Offset

func (sq *ShipmentQuery) Offset(offset int) *ShipmentQuery

Offset to start from.

func (*ShipmentQuery) Only

func (sq *ShipmentQuery) Only(ctx context.Context) (*Shipment, error)

Only returns a single Shipment entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Shipment entity is found. Returns a *NotFoundError when no Shipment entities are found.

func (*ShipmentQuery) OnlyID

func (sq *ShipmentQuery) OnlyID(ctx context.Context) (id string, err error)

OnlyID is like Only, but returns the only Shipment ID in the query. Returns a *NotSingularError when more than one Shipment ID is found. Returns a *NotFoundError when no entities are found.

func (*ShipmentQuery) OnlyIDX

func (sq *ShipmentQuery) OnlyIDX(ctx context.Context) string

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ShipmentQuery) OnlyX

func (sq *ShipmentQuery) OnlyX(ctx context.Context) *Shipment

OnlyX is like Only, but panics if an error occurs.

func (*ShipmentQuery) Order

Order specifies how the records should be ordered.

func (*ShipmentQuery) QueryInvoice

func (sq *ShipmentQuery) QueryInvoice() *InvoiceQuery

QueryInvoice chains the current query on the "invoice" edge.

func (*ShipmentQuery) QueryOrder

func (sq *ShipmentQuery) QueryOrder() *OrderQuery

QueryOrder chains the current query on the "order" edge.

func (*ShipmentQuery) QueryShipmentStatus

func (sq *ShipmentQuery) QueryShipmentStatus() *ShipmentStatusCodeQuery

QueryShipmentStatus chains the current query on the "shipment_status" edge.

func (*ShipmentQuery) QueryStaff

func (sq *ShipmentQuery) QueryStaff() *PersonQuery

QueryStaff chains the current query on the "staff" edge.

func (*ShipmentQuery) Select

func (sq *ShipmentQuery) Select(fields ...string) *ShipmentSelect

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.Shipment.Query().
	Select(shipment.FieldCreatedAt).
	Scan(ctx, &v)

func (*ShipmentQuery) Unique

func (sq *ShipmentQuery) Unique(unique bool) *ShipmentQuery

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 (*ShipmentQuery) Where

func (sq *ShipmentQuery) Where(ps ...predicate.Shipment) *ShipmentQuery

Where adds a new predicate for the ShipmentQuery builder.

func (*ShipmentQuery) WithInvoice

func (sq *ShipmentQuery) WithInvoice(opts ...func(*InvoiceQuery)) *ShipmentQuery

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 (*ShipmentQuery) WithOrder

func (sq *ShipmentQuery) WithOrder(opts ...func(*OrderQuery)) *ShipmentQuery

WithOrder tells the query-builder to eager-load the nodes that are connected to the "order" edge. The optional arguments are used to configure the query builder of the edge.

func (*ShipmentQuery) WithShipmentStatus

func (sq *ShipmentQuery) WithShipmentStatus(opts ...func(*ShipmentStatusCodeQuery)) *ShipmentQuery

WithShipmentStatus tells the query-builder to eager-load the nodes that are connected to the "shipment_status" edge. The optional arguments are used to configure the query builder of the edge.

func (*ShipmentQuery) WithStaff

func (sq *ShipmentQuery) WithStaff(opts ...func(*PersonQuery)) *ShipmentQuery

WithStaff tells the query-builder to eager-load the nodes that are connected to the "staff" edge. The optional arguments are used to configure the query builder of the edge.

type ShipmentSelect

type ShipmentSelect struct {
	*ShipmentQuery
	// contains filtered or unexported fields
}

ShipmentSelect is the builder for selecting fields of Shipment entities.

func (*ShipmentSelect) Aggregate

func (ss *ShipmentSelect) Aggregate(fns ...AggregateFunc) *ShipmentSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ShipmentSelect) Bool

func (s *ShipmentSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ShipmentSelect) BoolX

func (s *ShipmentSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ShipmentSelect) Bools

func (s *ShipmentSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ShipmentSelect) BoolsX

func (s *ShipmentSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ShipmentSelect) Float64

func (s *ShipmentSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ShipmentSelect) Float64X

func (s *ShipmentSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ShipmentSelect) Float64s

func (s *ShipmentSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ShipmentSelect) Float64sX

func (s *ShipmentSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ShipmentSelect) Int

func (s *ShipmentSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ShipmentSelect) IntX

func (s *ShipmentSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ShipmentSelect) Ints

func (s *ShipmentSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ShipmentSelect) IntsX

func (s *ShipmentSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ShipmentSelect) Scan

func (ss *ShipmentSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ShipmentSelect) ScanX

func (s *ShipmentSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ShipmentSelect) String

func (s *ShipmentSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ShipmentSelect) StringX

func (s *ShipmentSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ShipmentSelect) Strings

func (s *ShipmentSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ShipmentSelect) StringsX

func (s *ShipmentSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ShipmentStatusCode

type ShipmentStatusCode struct {

	// ID of the ent.
	ID int `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"`
	// ShipmentStatus holds the value of the "shipment_status" field.
	ShipmentStatus string `json:"shipment_status,omitempty"`
	// contains filtered or unexported fields
}

ShipmentStatusCode is the model entity for the ShipmentStatusCode schema.

func (*ShipmentStatusCode) String

func (ssc *ShipmentStatusCode) String() string

String implements the fmt.Stringer.

func (*ShipmentStatusCode) Unwrap

func (ssc *ShipmentStatusCode) Unwrap() *ShipmentStatusCode

Unwrap unwraps the ShipmentStatusCode 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 (*ShipmentStatusCode) Update

Update returns a builder for updating this ShipmentStatusCode. Note that you need to call ShipmentStatusCode.Unwrap() before calling this method if this ShipmentStatusCode was returned from a transaction, and the transaction was committed or rolled back.

func (*ShipmentStatusCode) Value

func (ssc *ShipmentStatusCode) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the ShipmentStatusCode. This includes values selected through modifiers, order, etc.

type ShipmentStatusCodeClient

type ShipmentStatusCodeClient struct {
	// contains filtered or unexported fields
}

ShipmentStatusCodeClient is a client for the ShipmentStatusCode schema.

func NewShipmentStatusCodeClient

func NewShipmentStatusCodeClient(c config) *ShipmentStatusCodeClient

NewShipmentStatusCodeClient returns a client for the ShipmentStatusCode from the given config.

func (*ShipmentStatusCodeClient) Create

Create returns a builder for creating a ShipmentStatusCode entity.

func (*ShipmentStatusCodeClient) CreateBulk

CreateBulk returns a builder for creating a bulk of ShipmentStatusCode entities.

func (*ShipmentStatusCodeClient) Delete

Delete returns a delete builder for ShipmentStatusCode.

func (*ShipmentStatusCodeClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ShipmentStatusCodeClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ShipmentStatusCodeClient) Get

Get returns a ShipmentStatusCode entity by its id.

func (*ShipmentStatusCodeClient) GetX

GetX is like Get, but panics if an error occurs.

func (*ShipmentStatusCodeClient) Hooks

func (c *ShipmentStatusCodeClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ShipmentStatusCodeClient) Intercept

func (c *ShipmentStatusCodeClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `shipmentstatuscode.Intercept(f(g(h())))`.

func (*ShipmentStatusCodeClient) Interceptors

func (c *ShipmentStatusCodeClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ShipmentStatusCodeClient) MapCreateBulk

func (c *ShipmentStatusCodeClient) MapCreateBulk(slice any, setFunc func(*ShipmentStatusCodeCreate, int)) *ShipmentStatusCodeCreateBulk

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 (*ShipmentStatusCodeClient) Query

Query returns a query builder for ShipmentStatusCode.

func (*ShipmentStatusCodeClient) Update

Update returns an update builder for ShipmentStatusCode.

func (*ShipmentStatusCodeClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ShipmentStatusCodeClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*ShipmentStatusCodeClient) Use

func (c *ShipmentStatusCodeClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `shipmentstatuscode.Hooks(f(g(h())))`.

type ShipmentStatusCodeCreate

type ShipmentStatusCodeCreate struct {
	// contains filtered or unexported fields
}

ShipmentStatusCodeCreate is the builder for creating a ShipmentStatusCode entity.

func (*ShipmentStatusCodeCreate) Exec

Exec executes the query.

func (*ShipmentStatusCodeCreate) ExecX

func (sscc *ShipmentStatusCodeCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ShipmentStatusCodeCreate) Mutation

Mutation returns the ShipmentStatusCodeMutation object of the builder.

func (*ShipmentStatusCodeCreate) Save

Save creates the ShipmentStatusCode in the database.

func (*ShipmentStatusCodeCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*ShipmentStatusCodeCreate) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*ShipmentStatusCodeCreate) SetID

SetID sets the "id" field.

func (*ShipmentStatusCodeCreate) SetNillableCreatedAt

func (sscc *ShipmentStatusCodeCreate) SetNillableCreatedAt(t *time.Time) *ShipmentStatusCodeCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ShipmentStatusCodeCreate) SetNillableUpdatedAt

func (sscc *ShipmentStatusCodeCreate) SetNillableUpdatedAt(t *time.Time) *ShipmentStatusCodeCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*ShipmentStatusCodeCreate) SetShipmentStatus

func (sscc *ShipmentStatusCodeCreate) SetShipmentStatus(s string) *ShipmentStatusCodeCreate

SetShipmentStatus sets the "shipment_status" field.

func (*ShipmentStatusCodeCreate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

type ShipmentStatusCodeCreateBulk

type ShipmentStatusCodeCreateBulk struct {
	// contains filtered or unexported fields
}

ShipmentStatusCodeCreateBulk is the builder for creating many ShipmentStatusCode entities in bulk.

func (*ShipmentStatusCodeCreateBulk) Exec

Exec executes the query.

func (*ShipmentStatusCodeCreateBulk) ExecX

func (ssccb *ShipmentStatusCodeCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ShipmentStatusCodeCreateBulk) Save

Save creates the ShipmentStatusCode entities in the database.

func (*ShipmentStatusCodeCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type ShipmentStatusCodeDelete

type ShipmentStatusCodeDelete struct {
	// contains filtered or unexported fields
}

ShipmentStatusCodeDelete is the builder for deleting a ShipmentStatusCode entity.

func (*ShipmentStatusCodeDelete) Exec

func (sscd *ShipmentStatusCodeDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ShipmentStatusCodeDelete) ExecX

func (sscd *ShipmentStatusCodeDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ShipmentStatusCodeDelete) Where

Where appends a list predicates to the ShipmentStatusCodeDelete builder.

type ShipmentStatusCodeDeleteOne

type ShipmentStatusCodeDeleteOne struct {
	// contains filtered or unexported fields
}

ShipmentStatusCodeDeleteOne is the builder for deleting a single ShipmentStatusCode entity.

func (*ShipmentStatusCodeDeleteOne) Exec

Exec executes the deletion query.

func (*ShipmentStatusCodeDeleteOne) ExecX

func (sscdo *ShipmentStatusCodeDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ShipmentStatusCodeDeleteOne) Where

Where appends a list predicates to the ShipmentStatusCodeDelete builder.

type ShipmentStatusCodeGroupBy

type ShipmentStatusCodeGroupBy struct {
	// contains filtered or unexported fields
}

ShipmentStatusCodeGroupBy is the group-by builder for ShipmentStatusCode entities.

func (*ShipmentStatusCodeGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*ShipmentStatusCodeGroupBy) Bool

func (s *ShipmentStatusCodeGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ShipmentStatusCodeGroupBy) BoolX

func (s *ShipmentStatusCodeGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ShipmentStatusCodeGroupBy) Bools

func (s *ShipmentStatusCodeGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ShipmentStatusCodeGroupBy) BoolsX

func (s *ShipmentStatusCodeGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ShipmentStatusCodeGroupBy) Float64

func (s *ShipmentStatusCodeGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ShipmentStatusCodeGroupBy) Float64X

func (s *ShipmentStatusCodeGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ShipmentStatusCodeGroupBy) Float64s

func (s *ShipmentStatusCodeGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ShipmentStatusCodeGroupBy) Float64sX

func (s *ShipmentStatusCodeGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ShipmentStatusCodeGroupBy) Int

func (s *ShipmentStatusCodeGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ShipmentStatusCodeGroupBy) IntX

func (s *ShipmentStatusCodeGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ShipmentStatusCodeGroupBy) Ints

func (s *ShipmentStatusCodeGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ShipmentStatusCodeGroupBy) IntsX

func (s *ShipmentStatusCodeGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ShipmentStatusCodeGroupBy) Scan

func (sscgb *ShipmentStatusCodeGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ShipmentStatusCodeGroupBy) ScanX

func (s *ShipmentStatusCodeGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ShipmentStatusCodeGroupBy) String

func (s *ShipmentStatusCodeGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ShipmentStatusCodeGroupBy) StringX

func (s *ShipmentStatusCodeGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ShipmentStatusCodeGroupBy) Strings

func (s *ShipmentStatusCodeGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ShipmentStatusCodeGroupBy) StringsX

func (s *ShipmentStatusCodeGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ShipmentStatusCodeMutation

type ShipmentStatusCodeMutation struct {
	// contains filtered or unexported fields
}

ShipmentStatusCodeMutation represents an operation that mutates the ShipmentStatusCode nodes in the graph.

func (*ShipmentStatusCodeMutation) AddField

func (m *ShipmentStatusCodeMutation) 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 (*ShipmentStatusCodeMutation) AddedEdges

func (m *ShipmentStatusCodeMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ShipmentStatusCodeMutation) AddedField

func (m *ShipmentStatusCodeMutation) 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 (*ShipmentStatusCodeMutation) AddedFields

func (m *ShipmentStatusCodeMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ShipmentStatusCodeMutation) AddedIDs

func (m *ShipmentStatusCodeMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ShipmentStatusCodeMutation) ClearEdge

func (m *ShipmentStatusCodeMutation) 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 (*ShipmentStatusCodeMutation) ClearField

func (m *ShipmentStatusCodeMutation) 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 (*ShipmentStatusCodeMutation) ClearedEdges

func (m *ShipmentStatusCodeMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ShipmentStatusCodeMutation) ClearedFields

func (m *ShipmentStatusCodeMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ShipmentStatusCodeMutation) Client

func (m ShipmentStatusCodeMutation) 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 (*ShipmentStatusCodeMutation) CreatedAt

func (m *ShipmentStatusCodeMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ShipmentStatusCodeMutation) EdgeCleared

func (m *ShipmentStatusCodeMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ShipmentStatusCodeMutation) Field

func (m *ShipmentStatusCodeMutation) 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 (*ShipmentStatusCodeMutation) FieldCleared

func (m *ShipmentStatusCodeMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ShipmentStatusCodeMutation) Fields

func (m *ShipmentStatusCodeMutation) 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 (*ShipmentStatusCodeMutation) ID

func (m *ShipmentStatusCodeMutation) ID() (id int, 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 (*ShipmentStatusCodeMutation) 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 (*ShipmentStatusCodeMutation) OldCreatedAt

func (m *ShipmentStatusCodeMutation) OldCreatedAt(ctx context.Context) (v *time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the ShipmentStatusCode entity. If the ShipmentStatusCode 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 (*ShipmentStatusCodeMutation) OldField

func (m *ShipmentStatusCodeMutation) 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 (*ShipmentStatusCodeMutation) OldShipmentStatus

func (m *ShipmentStatusCodeMutation) OldShipmentStatus(ctx context.Context) (v string, err error)

OldShipmentStatus returns the old "shipment_status" field's value of the ShipmentStatusCode entity. If the ShipmentStatusCode 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 (*ShipmentStatusCodeMutation) OldUpdatedAt

func (m *ShipmentStatusCodeMutation) OldUpdatedAt(ctx context.Context) (v *time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the ShipmentStatusCode entity. If the ShipmentStatusCode 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 (*ShipmentStatusCodeMutation) Op

Op returns the operation name.

func (*ShipmentStatusCodeMutation) RemovedEdges

func (m *ShipmentStatusCodeMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ShipmentStatusCodeMutation) RemovedIDs

func (m *ShipmentStatusCodeMutation) 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 (*ShipmentStatusCodeMutation) ResetCreatedAt

func (m *ShipmentStatusCodeMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ShipmentStatusCodeMutation) ResetEdge

func (m *ShipmentStatusCodeMutation) 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 (*ShipmentStatusCodeMutation) ResetField

func (m *ShipmentStatusCodeMutation) 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 (*ShipmentStatusCodeMutation) ResetShipmentStatus

func (m *ShipmentStatusCodeMutation) ResetShipmentStatus()

ResetShipmentStatus resets all changes to the "shipment_status" field.

func (*ShipmentStatusCodeMutation) ResetUpdatedAt

func (m *ShipmentStatusCodeMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ShipmentStatusCodeMutation) SetCreatedAt

func (m *ShipmentStatusCodeMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ShipmentStatusCodeMutation) SetField

func (m *ShipmentStatusCodeMutation) 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 (*ShipmentStatusCodeMutation) SetID

func (m *ShipmentStatusCodeMutation) SetID(id int)

SetID sets the value of the id field. Note that this operation is only accepted on creation of ShipmentStatusCode entities.

func (*ShipmentStatusCodeMutation) SetOp

func (m *ShipmentStatusCodeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ShipmentStatusCodeMutation) SetShipmentStatus

func (m *ShipmentStatusCodeMutation) SetShipmentStatus(s string)

SetShipmentStatus sets the "shipment_status" field.

func (*ShipmentStatusCodeMutation) SetUpdatedAt

func (m *ShipmentStatusCodeMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*ShipmentStatusCodeMutation) ShipmentStatus

func (m *ShipmentStatusCodeMutation) ShipmentStatus() (r string, exists bool)

ShipmentStatus returns the value of the "shipment_status" field in the mutation.

func (ShipmentStatusCodeMutation) Tx

func (m ShipmentStatusCodeMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ShipmentStatusCodeMutation) Type

Type returns the node type of this mutation (ShipmentStatusCode).

func (*ShipmentStatusCodeMutation) UpdatedAt

func (m *ShipmentStatusCodeMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*ShipmentStatusCodeMutation) Where

Where appends a list predicates to the ShipmentStatusCodeMutation builder.

func (*ShipmentStatusCodeMutation) WhereP

func (m *ShipmentStatusCodeMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ShipmentStatusCodeMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ShipmentStatusCodeQuery

type ShipmentStatusCodeQuery struct {
	// contains filtered or unexported fields
}

ShipmentStatusCodeQuery is the builder for querying ShipmentStatusCode entities.

func (*ShipmentStatusCodeQuery) Aggregate

Aggregate returns a ShipmentStatusCodeSelect configured with the given aggregations.

func (*ShipmentStatusCodeQuery) All

All executes the query and returns a list of ShipmentStatusCodes.

func (*ShipmentStatusCodeQuery) AllX

AllX is like All, but panics if an error occurs.

func (*ShipmentStatusCodeQuery) Clone

Clone returns a duplicate of the ShipmentStatusCodeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ShipmentStatusCodeQuery) Count

func (sscq *ShipmentStatusCodeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ShipmentStatusCodeQuery) CountX

func (sscq *ShipmentStatusCodeQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ShipmentStatusCodeQuery) Exist

func (sscq *ShipmentStatusCodeQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ShipmentStatusCodeQuery) ExistX

func (sscq *ShipmentStatusCodeQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ShipmentStatusCodeQuery) First

First returns the first ShipmentStatusCode entity from the query. Returns a *NotFoundError when no ShipmentStatusCode was found.

func (*ShipmentStatusCodeQuery) FirstID

func (sscq *ShipmentStatusCodeQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first ShipmentStatusCode ID from the query. Returns a *NotFoundError when no ShipmentStatusCode ID was found.

func (*ShipmentStatusCodeQuery) FirstIDX

func (sscq *ShipmentStatusCodeQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*ShipmentStatusCodeQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*ShipmentStatusCodeQuery) GroupBy

func (sscq *ShipmentStatusCodeQuery) GroupBy(field string, fields ...string) *ShipmentStatusCodeGroupBy

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.ShipmentStatusCode.Query().
	GroupBy(shipmentstatuscode.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ShipmentStatusCodeQuery) IDs

func (sscq *ShipmentStatusCodeQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of ShipmentStatusCode IDs.

func (*ShipmentStatusCodeQuery) IDsX

func (sscq *ShipmentStatusCodeQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*ShipmentStatusCodeQuery) Limit

Limit the number of records to be returned by this query.

func (*ShipmentStatusCodeQuery) Offset

func (sscq *ShipmentStatusCodeQuery) Offset(offset int) *ShipmentStatusCodeQuery

Offset to start from.

func (*ShipmentStatusCodeQuery) Only

Only returns a single ShipmentStatusCode entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ShipmentStatusCode entity is found. Returns a *NotFoundError when no ShipmentStatusCode entities are found.

func (*ShipmentStatusCodeQuery) OnlyID

func (sscq *ShipmentStatusCodeQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only ShipmentStatusCode ID in the query. Returns a *NotSingularError when more than one ShipmentStatusCode ID is found. Returns a *NotFoundError when no entities are found.

func (*ShipmentStatusCodeQuery) OnlyIDX

func (sscq *ShipmentStatusCodeQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ShipmentStatusCodeQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*ShipmentStatusCodeQuery) Order

Order specifies how the records should be ordered.

func (*ShipmentStatusCodeQuery) Select

func (sscq *ShipmentStatusCodeQuery) Select(fields ...string) *ShipmentStatusCodeSelect

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.ShipmentStatusCode.Query().
	Select(shipmentstatuscode.FieldCreatedAt).
	Scan(ctx, &v)

func (*ShipmentStatusCodeQuery) 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 (*ShipmentStatusCodeQuery) Where

Where adds a new predicate for the ShipmentStatusCodeQuery builder.

type ShipmentStatusCodeSelect

type ShipmentStatusCodeSelect struct {
	*ShipmentStatusCodeQuery
	// contains filtered or unexported fields
}

ShipmentStatusCodeSelect is the builder for selecting fields of ShipmentStatusCode entities.

func (*ShipmentStatusCodeSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*ShipmentStatusCodeSelect) Bool

func (s *ShipmentStatusCodeSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ShipmentStatusCodeSelect) BoolX

func (s *ShipmentStatusCodeSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ShipmentStatusCodeSelect) Bools

func (s *ShipmentStatusCodeSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ShipmentStatusCodeSelect) BoolsX

func (s *ShipmentStatusCodeSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ShipmentStatusCodeSelect) Float64

func (s *ShipmentStatusCodeSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ShipmentStatusCodeSelect) Float64X

func (s *ShipmentStatusCodeSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ShipmentStatusCodeSelect) Float64s

func (s *ShipmentStatusCodeSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ShipmentStatusCodeSelect) Float64sX

func (s *ShipmentStatusCodeSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ShipmentStatusCodeSelect) Int

func (s *ShipmentStatusCodeSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ShipmentStatusCodeSelect) IntX

func (s *ShipmentStatusCodeSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ShipmentStatusCodeSelect) Ints

func (s *ShipmentStatusCodeSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ShipmentStatusCodeSelect) IntsX

func (s *ShipmentStatusCodeSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ShipmentStatusCodeSelect) Scan

func (sscs *ShipmentStatusCodeSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ShipmentStatusCodeSelect) ScanX

func (s *ShipmentStatusCodeSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ShipmentStatusCodeSelect) String

func (s *ShipmentStatusCodeSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ShipmentStatusCodeSelect) StringX

func (s *ShipmentStatusCodeSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ShipmentStatusCodeSelect) Strings

func (s *ShipmentStatusCodeSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ShipmentStatusCodeSelect) StringsX

func (s *ShipmentStatusCodeSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ShipmentStatusCodeUpdate

type ShipmentStatusCodeUpdate struct {
	// contains filtered or unexported fields
}

ShipmentStatusCodeUpdate is the builder for updating ShipmentStatusCode entities.

func (*ShipmentStatusCodeUpdate) Exec

Exec executes the query.

func (*ShipmentStatusCodeUpdate) ExecX

func (sscu *ShipmentStatusCodeUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ShipmentStatusCodeUpdate) Mutation

Mutation returns the ShipmentStatusCodeMutation object of the builder.

func (*ShipmentStatusCodeUpdate) Save

func (sscu *ShipmentStatusCodeUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ShipmentStatusCodeUpdate) SaveX

func (sscu *ShipmentStatusCodeUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ShipmentStatusCodeUpdate) SetNillableShipmentStatus

func (sscu *ShipmentStatusCodeUpdate) SetNillableShipmentStatus(s *string) *ShipmentStatusCodeUpdate

SetNillableShipmentStatus sets the "shipment_status" field if the given value is not nil.

func (*ShipmentStatusCodeUpdate) SetShipmentStatus

func (sscu *ShipmentStatusCodeUpdate) SetShipmentStatus(s string) *ShipmentStatusCodeUpdate

SetShipmentStatus sets the "shipment_status" field.

func (*ShipmentStatusCodeUpdate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*ShipmentStatusCodeUpdate) Where

Where appends a list predicates to the ShipmentStatusCodeUpdate builder.

type ShipmentStatusCodeUpdateOne

type ShipmentStatusCodeUpdateOne struct {
	// contains filtered or unexported fields
}

ShipmentStatusCodeUpdateOne is the builder for updating a single ShipmentStatusCode entity.

func (*ShipmentStatusCodeUpdateOne) Exec

Exec executes the query on the entity.

func (*ShipmentStatusCodeUpdateOne) ExecX

func (sscuo *ShipmentStatusCodeUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ShipmentStatusCodeUpdateOne) Mutation

Mutation returns the ShipmentStatusCodeMutation object of the builder.

func (*ShipmentStatusCodeUpdateOne) Save

Save executes the query and returns the updated ShipmentStatusCode entity.

func (*ShipmentStatusCodeUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*ShipmentStatusCodeUpdateOne) Select

func (sscuo *ShipmentStatusCodeUpdateOne) Select(field string, fields ...string) *ShipmentStatusCodeUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ShipmentStatusCodeUpdateOne) SetNillableShipmentStatus

func (sscuo *ShipmentStatusCodeUpdateOne) SetNillableShipmentStatus(s *string) *ShipmentStatusCodeUpdateOne

SetNillableShipmentStatus sets the "shipment_status" field if the given value is not nil.

func (*ShipmentStatusCodeUpdateOne) SetShipmentStatus

func (sscuo *ShipmentStatusCodeUpdateOne) SetShipmentStatus(s string) *ShipmentStatusCodeUpdateOne

SetShipmentStatus sets the "shipment_status" field.

func (*ShipmentStatusCodeUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*ShipmentStatusCodeUpdateOne) Where

Where appends a list predicates to the ShipmentStatusCodeUpdate builder.

type ShipmentStatusCodes

type ShipmentStatusCodes []*ShipmentStatusCode

ShipmentStatusCodes is a parsable slice of ShipmentStatusCode.

type ShipmentUpdate

type ShipmentUpdate struct {
	// contains filtered or unexported fields
}

ShipmentUpdate is the builder for updating Shipment entities.

func (*ShipmentUpdate) ClearNote

func (su *ShipmentUpdate) ClearNote() *ShipmentUpdate

ClearNote clears the value of the "note" field.

func (*ShipmentUpdate) ClearShipmentStatus

func (su *ShipmentUpdate) ClearShipmentStatus() *ShipmentUpdate

ClearShipmentStatus clears the "shipment_status" edge to the ShipmentStatusCode entity.

func (*ShipmentUpdate) Exec

func (su *ShipmentUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ShipmentUpdate) ExecX

func (su *ShipmentUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ShipmentUpdate) Mutation

func (su *ShipmentUpdate) Mutation() *ShipmentMutation

Mutation returns the ShipmentMutation object of the builder.

func (*ShipmentUpdate) Save

func (su *ShipmentUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ShipmentUpdate) SaveX

func (su *ShipmentUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ShipmentUpdate) SetNillableNote

func (su *ShipmentUpdate) SetNillableNote(s *string) *ShipmentUpdate

SetNillableNote sets the "note" field if the given value is not nil.

func (*ShipmentUpdate) SetNillableShipmentDate

func (su *ShipmentUpdate) SetNillableShipmentDate(t *time.Time) *ShipmentUpdate

SetNillableShipmentDate sets the "shipment_date" field if the given value is not nil.

func (*ShipmentUpdate) SetNillableStatusCode

func (su *ShipmentUpdate) SetNillableStatusCode(i *int) *ShipmentUpdate

SetNillableStatusCode sets the "status_code" field if the given value is not nil.

func (*ShipmentUpdate) SetNote

func (su *ShipmentUpdate) SetNote(s string) *ShipmentUpdate

SetNote sets the "note" field.

func (*ShipmentUpdate) SetShipmentDate

func (su *ShipmentUpdate) SetShipmentDate(t time.Time) *ShipmentUpdate

SetShipmentDate sets the "shipment_date" field.

func (*ShipmentUpdate) SetShipmentStatus

func (su *ShipmentUpdate) SetShipmentStatus(s *ShipmentStatusCode) *ShipmentUpdate

SetShipmentStatus sets the "shipment_status" edge to the ShipmentStatusCode entity.

func (*ShipmentUpdate) SetShipmentStatusID

func (su *ShipmentUpdate) SetShipmentStatusID(id int) *ShipmentUpdate

SetShipmentStatusID sets the "shipment_status" edge to the ShipmentStatusCode entity by ID.

func (*ShipmentUpdate) SetStatusCode

func (su *ShipmentUpdate) SetStatusCode(i int) *ShipmentUpdate

SetStatusCode sets the "status_code" field.

func (*ShipmentUpdate) SetUpdatedAt

func (su *ShipmentUpdate) SetUpdatedAt(t time.Time) *ShipmentUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ShipmentUpdate) Where

func (su *ShipmentUpdate) Where(ps ...predicate.Shipment) *ShipmentUpdate

Where appends a list predicates to the ShipmentUpdate builder.

type ShipmentUpdateOne

type ShipmentUpdateOne struct {
	// contains filtered or unexported fields
}

ShipmentUpdateOne is the builder for updating a single Shipment entity.

func (*ShipmentUpdateOne) ClearNote

func (suo *ShipmentUpdateOne) ClearNote() *ShipmentUpdateOne

ClearNote clears the value of the "note" field.

func (*ShipmentUpdateOne) ClearShipmentStatus

func (suo *ShipmentUpdateOne) ClearShipmentStatus() *ShipmentUpdateOne

ClearShipmentStatus clears the "shipment_status" edge to the ShipmentStatusCode entity.

func (*ShipmentUpdateOne) Exec

func (suo *ShipmentUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ShipmentUpdateOne) ExecX

func (suo *ShipmentUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ShipmentUpdateOne) Mutation

func (suo *ShipmentUpdateOne) Mutation() *ShipmentMutation

Mutation returns the ShipmentMutation object of the builder.

func (*ShipmentUpdateOne) Save

func (suo *ShipmentUpdateOne) Save(ctx context.Context) (*Shipment, error)

Save executes the query and returns the updated Shipment entity.

func (*ShipmentUpdateOne) SaveX

func (suo *ShipmentUpdateOne) SaveX(ctx context.Context) *Shipment

SaveX is like Save, but panics if an error occurs.

func (*ShipmentUpdateOne) Select

func (suo *ShipmentUpdateOne) Select(field string, fields ...string) *ShipmentUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ShipmentUpdateOne) SetNillableNote

func (suo *ShipmentUpdateOne) SetNillableNote(s *string) *ShipmentUpdateOne

SetNillableNote sets the "note" field if the given value is not nil.

func (*ShipmentUpdateOne) SetNillableShipmentDate

func (suo *ShipmentUpdateOne) SetNillableShipmentDate(t *time.Time) *ShipmentUpdateOne

SetNillableShipmentDate sets the "shipment_date" field if the given value is not nil.

func (*ShipmentUpdateOne) SetNillableStatusCode

func (suo *ShipmentUpdateOne) SetNillableStatusCode(i *int) *ShipmentUpdateOne

SetNillableStatusCode sets the "status_code" field if the given value is not nil.

func (*ShipmentUpdateOne) SetNote

func (suo *ShipmentUpdateOne) SetNote(s string) *ShipmentUpdateOne

SetNote sets the "note" field.

func (*ShipmentUpdateOne) SetShipmentDate

func (suo *ShipmentUpdateOne) SetShipmentDate(t time.Time) *ShipmentUpdateOne

SetShipmentDate sets the "shipment_date" field.

func (*ShipmentUpdateOne) SetShipmentStatus

func (suo *ShipmentUpdateOne) SetShipmentStatus(s *ShipmentStatusCode) *ShipmentUpdateOne

SetShipmentStatus sets the "shipment_status" edge to the ShipmentStatusCode entity.

func (*ShipmentUpdateOne) SetShipmentStatusID

func (suo *ShipmentUpdateOne) SetShipmentStatusID(id int) *ShipmentUpdateOne

SetShipmentStatusID sets the "shipment_status" edge to the ShipmentStatusCode entity by ID.

func (*ShipmentUpdateOne) SetStatusCode

func (suo *ShipmentUpdateOne) SetStatusCode(i int) *ShipmentUpdateOne

SetStatusCode sets the "status_code" field.

func (*ShipmentUpdateOne) SetUpdatedAt

func (suo *ShipmentUpdateOne) SetUpdatedAt(t time.Time) *ShipmentUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ShipmentUpdateOne) Where

Where appends a list predicates to the ShipmentUpdate builder.

type Shipments

type Shipments []*Shipment

Shipments is a parsable slice of Shipment.

type Tag

type Tag struct {

	// ID of the ent.
	ID string `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"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TagQuery when eager-loading is set.
	Edges TagEdges `json:"edges"`
	// contains filtered or unexported fields
}

Tag is the model entity for the Tag schema.

func (*Tag) QueryProductTags

func (t *Tag) QueryProductTags() *ProductTagQuery

QueryProductTags queries the "product_tags" edge of the Tag entity.

func (*Tag) QueryProducts

func (t *Tag) QueryProducts() *ProductInfoQuery

QueryProducts queries the "products" edge of the Tag entity.

func (*Tag) String

func (t *Tag) String() string

String implements the fmt.Stringer.

func (*Tag) Unwrap

func (t *Tag) Unwrap() *Tag

Unwrap unwraps the Tag 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 (*Tag) Update

func (t *Tag) Update() *TagUpdateOne

Update returns a builder for updating this Tag. Note that you need to call Tag.Unwrap() before calling this method if this Tag was returned from a transaction, and the transaction was committed or rolled back.

func (*Tag) Value

func (t *Tag) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Tag. This includes values selected through modifiers, order, etc.

type TagClient

type TagClient struct {
	// contains filtered or unexported fields
}

TagClient is a client for the Tag schema.

func NewTagClient

func NewTagClient(c config) *TagClient

NewTagClient returns a client for the Tag from the given config.

func (*TagClient) Create

func (c *TagClient) Create() *TagCreate

Create returns a builder for creating a Tag entity.

func (*TagClient) CreateBulk

func (c *TagClient) CreateBulk(builders ...*TagCreate) *TagCreateBulk

CreateBulk returns a builder for creating a bulk of Tag entities.

func (*TagClient) Delete

func (c *TagClient) Delete() *TagDelete

Delete returns a delete builder for Tag.

func (*TagClient) DeleteOne

func (c *TagClient) DeleteOne(t *Tag) *TagDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TagClient) DeleteOneID

func (c *TagClient) DeleteOneID(id string) *TagDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*TagClient) Get

func (c *TagClient) Get(ctx context.Context, id string) (*Tag, error)

Get returns a Tag entity by its id.

func (*TagClient) GetX

func (c *TagClient) GetX(ctx context.Context, id string) *Tag

GetX is like Get, but panics if an error occurs.

func (*TagClient) Hooks

func (c *TagClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TagClient) Intercept

func (c *TagClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `tag.Intercept(f(g(h())))`.

func (*TagClient) Interceptors

func (c *TagClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*TagClient) MapCreateBulk

func (c *TagClient) MapCreateBulk(slice any, setFunc func(*TagCreate, int)) *TagCreateBulk

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 (*TagClient) Query

func (c *TagClient) Query() *TagQuery

Query returns a query builder for Tag.

func (*TagClient) QueryProductTags

func (c *TagClient) QueryProductTags(t *Tag) *ProductTagQuery

QueryProductTags queries the product_tags edge of a Tag.

func (*TagClient) QueryProducts

func (c *TagClient) QueryProducts(t *Tag) *ProductInfoQuery

QueryProducts queries the products edge of a Tag.

func (*TagClient) Update

func (c *TagClient) Update() *TagUpdate

Update returns an update builder for Tag.

func (*TagClient) UpdateOne

func (c *TagClient) UpdateOne(t *Tag) *TagUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TagClient) UpdateOneID

func (c *TagClient) UpdateOneID(id string) *TagUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TagClient) Use

func (c *TagClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `tag.Hooks(f(g(h())))`.

type TagCreate

type TagCreate struct {
	// contains filtered or unexported fields
}

TagCreate is the builder for creating a Tag entity.

func (*TagCreate) AddProductIDs

func (tc *TagCreate) AddProductIDs(ids ...string) *TagCreate

AddProductIDs adds the "products" edge to the ProductInfo entity by IDs.

func (*TagCreate) AddProducts

func (tc *TagCreate) AddProducts(p ...*ProductInfo) *TagCreate

AddProducts adds the "products" edges to the ProductInfo entity.

func (*TagCreate) Exec

func (tc *TagCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TagCreate) ExecX

func (tc *TagCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagCreate) Mutation

func (tc *TagCreate) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagCreate) Save

func (tc *TagCreate) Save(ctx context.Context) (*Tag, error)

Save creates the Tag in the database.

func (*TagCreate) SaveX

func (tc *TagCreate) SaveX(ctx context.Context) *Tag

SaveX calls Save and panics if Save returns an error.

func (*TagCreate) SetCreatedAt

func (tc *TagCreate) SetCreatedAt(t time.Time) *TagCreate

SetCreatedAt sets the "created_at" field.

func (*TagCreate) SetID

func (tc *TagCreate) SetID(s string) *TagCreate

SetID sets the "id" field.

func (*TagCreate) SetNillableCreatedAt

func (tc *TagCreate) SetNillableCreatedAt(t *time.Time) *TagCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*TagCreate) SetNillableUpdatedAt

func (tc *TagCreate) SetNillableUpdatedAt(t *time.Time) *TagCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*TagCreate) SetTitle

func (tc *TagCreate) SetTitle(s string) *TagCreate

SetTitle sets the "title" field.

func (*TagCreate) SetUpdatedAt

func (tc *TagCreate) SetUpdatedAt(t time.Time) *TagCreate

SetUpdatedAt sets the "updated_at" field.

type TagCreateBulk

type TagCreateBulk struct {
	// contains filtered or unexported fields
}

TagCreateBulk is the builder for creating many Tag entities in bulk.

func (*TagCreateBulk) Exec

func (tcb *TagCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TagCreateBulk) ExecX

func (tcb *TagCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagCreateBulk) Save

func (tcb *TagCreateBulk) Save(ctx context.Context) ([]*Tag, error)

Save creates the Tag entities in the database.

func (*TagCreateBulk) SaveX

func (tcb *TagCreateBulk) SaveX(ctx context.Context) []*Tag

SaveX is like Save, but panics if an error occurs.

type TagDelete

type TagDelete struct {
	// contains filtered or unexported fields
}

TagDelete is the builder for deleting a Tag entity.

func (*TagDelete) Exec

func (td *TagDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TagDelete) ExecX

func (td *TagDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TagDelete) Where

func (td *TagDelete) Where(ps ...predicate.Tag) *TagDelete

Where appends a list predicates to the TagDelete builder.

type TagDeleteOne

type TagDeleteOne struct {
	// contains filtered or unexported fields
}

TagDeleteOne is the builder for deleting a single Tag entity.

func (*TagDeleteOne) Exec

func (tdo *TagDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TagDeleteOne) ExecX

func (tdo *TagDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagDeleteOne) Where

func (tdo *TagDeleteOne) Where(ps ...predicate.Tag) *TagDeleteOne

Where appends a list predicates to the TagDelete builder.

type TagEdges

type TagEdges struct {
	// Products holds the value of the products edge.
	Products []*ProductInfo `json:"products,omitempty"`
	// ProductTags holds the value of the product_tags edge.
	ProductTags []*ProductTag `json:"product_tags,omitempty"`
	// contains filtered or unexported fields
}

TagEdges holds the relations/edges for other nodes in the graph.

func (TagEdges) ProductTagsOrErr

func (e TagEdges) ProductTagsOrErr() ([]*ProductTag, error)

ProductTagsOrErr returns the ProductTags value or an error if the edge was not loaded in eager-loading.

func (TagEdges) ProductsOrErr

func (e TagEdges) ProductsOrErr() ([]*ProductInfo, error)

ProductsOrErr returns the Products value or an error if the edge was not loaded in eager-loading.

type TagGroupBy

type TagGroupBy struct {
	// contains filtered or unexported fields
}

TagGroupBy is the group-by builder for Tag entities.

func (*TagGroupBy) Aggregate

func (tgb *TagGroupBy) Aggregate(fns ...AggregateFunc) *TagGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*TagGroupBy) Bool

func (s *TagGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) BoolX

func (s *TagGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TagGroupBy) Bools

func (s *TagGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) BoolsX

func (s *TagGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TagGroupBy) Float64

func (s *TagGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) Float64X

func (s *TagGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TagGroupBy) Float64s

func (s *TagGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) Float64sX

func (s *TagGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TagGroupBy) Int

func (s *TagGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) IntX

func (s *TagGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TagGroupBy) Ints

func (s *TagGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) IntsX

func (s *TagGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TagGroupBy) Scan

func (tgb *TagGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TagGroupBy) ScanX

func (s *TagGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TagGroupBy) String

func (s *TagGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) StringX

func (s *TagGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TagGroupBy) Strings

func (s *TagGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) StringsX

func (s *TagGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TagMutation

type TagMutation struct {
	// contains filtered or unexported fields
}

TagMutation represents an operation that mutates the Tag nodes in the graph.

func (*TagMutation) AddField

func (m *TagMutation) 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 (*TagMutation) AddProductIDs

func (m *TagMutation) AddProductIDs(ids ...string)

AddProductIDs adds the "products" edge to the ProductInfo entity by ids.

func (*TagMutation) AddedEdges

func (m *TagMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TagMutation) AddedField

func (m *TagMutation) 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 (*TagMutation) AddedFields

func (m *TagMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TagMutation) AddedIDs

func (m *TagMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TagMutation) ClearEdge

func (m *TagMutation) 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 (*TagMutation) ClearField

func (m *TagMutation) 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 (*TagMutation) ClearProducts

func (m *TagMutation) ClearProducts()

ClearProducts clears the "products" edge to the ProductInfo entity.

func (*TagMutation) ClearedEdges

func (m *TagMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TagMutation) ClearedFields

func (m *TagMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TagMutation) Client

func (m TagMutation) 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 (*TagMutation) CreatedAt

func (m *TagMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*TagMutation) EdgeCleared

func (m *TagMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TagMutation) Field

func (m *TagMutation) 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 (*TagMutation) FieldCleared

func (m *TagMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TagMutation) Fields

func (m *TagMutation) 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 (*TagMutation) ID

func (m *TagMutation) ID() (id string, 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 (*TagMutation) IDs

func (m *TagMutation) IDs(ctx context.Context) ([]string, 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 (*TagMutation) OldCreatedAt

func (m *TagMutation) OldCreatedAt(ctx context.Context) (v *time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Tag entity. If the Tag 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 (*TagMutation) OldField

func (m *TagMutation) 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 (*TagMutation) OldTitle

func (m *TagMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old "title" field's value of the Tag entity. If the Tag 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 (*TagMutation) OldUpdatedAt

func (m *TagMutation) OldUpdatedAt(ctx context.Context) (v *time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Tag entity. If the Tag 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 (*TagMutation) Op

func (m *TagMutation) Op() Op

Op returns the operation name.

func (*TagMutation) ProductsCleared

func (m *TagMutation) ProductsCleared() bool

ProductsCleared reports if the "products" edge to the ProductInfo entity was cleared.

func (*TagMutation) ProductsIDs

func (m *TagMutation) ProductsIDs() (ids []string)

ProductsIDs returns the "products" edge IDs in the mutation.

func (*TagMutation) RemoveProductIDs

func (m *TagMutation) RemoveProductIDs(ids ...string)

RemoveProductIDs removes the "products" edge to the ProductInfo entity by IDs.

func (*TagMutation) RemovedEdges

func (m *TagMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TagMutation) RemovedIDs

func (m *TagMutation) 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 (*TagMutation) RemovedProductsIDs

func (m *TagMutation) RemovedProductsIDs() (ids []string)

RemovedProducts returns the removed IDs of the "products" edge to the ProductInfo entity.

func (*TagMutation) ResetCreatedAt

func (m *TagMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*TagMutation) ResetEdge

func (m *TagMutation) 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 (*TagMutation) ResetField

func (m *TagMutation) 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 (*TagMutation) ResetProducts

func (m *TagMutation) ResetProducts()

ResetProducts resets all changes to the "products" edge.

func (*TagMutation) ResetTitle

func (m *TagMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*TagMutation) ResetUpdatedAt

func (m *TagMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*TagMutation) SetCreatedAt

func (m *TagMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*TagMutation) SetField

func (m *TagMutation) 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 (*TagMutation) SetID

func (m *TagMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Tag entities.

func (*TagMutation) SetOp

func (m *TagMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TagMutation) SetTitle

func (m *TagMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*TagMutation) SetUpdatedAt

func (m *TagMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*TagMutation) Title

func (m *TagMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (TagMutation) Tx

func (m TagMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TagMutation) Type

func (m *TagMutation) Type() string

Type returns the node type of this mutation (Tag).

func (*TagMutation) UpdatedAt

func (m *TagMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*TagMutation) Where

func (m *TagMutation) Where(ps ...predicate.Tag)

Where appends a list predicates to the TagMutation builder.

func (*TagMutation) WhereP

func (m *TagMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the TagMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type TagQuery

type TagQuery struct {
	// contains filtered or unexported fields
}

TagQuery is the builder for querying Tag entities.

func (*TagQuery) Aggregate

func (tq *TagQuery) Aggregate(fns ...AggregateFunc) *TagSelect

Aggregate returns a TagSelect configured with the given aggregations.

func (*TagQuery) All

func (tq *TagQuery) All(ctx context.Context) ([]*Tag, error)

All executes the query and returns a list of Tags.

func (*TagQuery) AllX

func (tq *TagQuery) AllX(ctx context.Context) []*Tag

AllX is like All, but panics if an error occurs.

func (*TagQuery) Clone

func (tq *TagQuery) Clone() *TagQuery

Clone returns a duplicate of the TagQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TagQuery) Count

func (tq *TagQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TagQuery) CountX

func (tq *TagQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TagQuery) Exist

func (tq *TagQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TagQuery) ExistX

func (tq *TagQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TagQuery) First

func (tq *TagQuery) First(ctx context.Context) (*Tag, error)

First returns the first Tag entity from the query. Returns a *NotFoundError when no Tag was found.

func (*TagQuery) FirstID

func (tq *TagQuery) FirstID(ctx context.Context) (id string, err error)

FirstID returns the first Tag ID from the query. Returns a *NotFoundError when no Tag ID was found.

func (*TagQuery) FirstIDX

func (tq *TagQuery) FirstIDX(ctx context.Context) string

FirstIDX is like FirstID, but panics if an error occurs.

func (*TagQuery) FirstX

func (tq *TagQuery) FirstX(ctx context.Context) *Tag

FirstX is like First, but panics if an error occurs.

func (*TagQuery) GroupBy

func (tq *TagQuery) GroupBy(field string, fields ...string) *TagGroupBy

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.Tag.Query().
	GroupBy(tag.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TagQuery) IDs

func (tq *TagQuery) IDs(ctx context.Context) (ids []string, err error)

IDs executes the query and returns a list of Tag IDs.

func (*TagQuery) IDsX

func (tq *TagQuery) IDsX(ctx context.Context) []string

IDsX is like IDs, but panics if an error occurs.

func (*TagQuery) Limit

func (tq *TagQuery) Limit(limit int) *TagQuery

Limit the number of records to be returned by this query.

func (*TagQuery) Offset

func (tq *TagQuery) Offset(offset int) *TagQuery

Offset to start from.

func (*TagQuery) Only

func (tq *TagQuery) Only(ctx context.Context) (*Tag, error)

Only returns a single Tag entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Tag entity is found. Returns a *NotFoundError when no Tag entities are found.

func (*TagQuery) OnlyID

func (tq *TagQuery) OnlyID(ctx context.Context) (id string, err error)

OnlyID is like Only, but returns the only Tag ID in the query. Returns a *NotSingularError when more than one Tag ID is found. Returns a *NotFoundError when no entities are found.

func (*TagQuery) OnlyIDX

func (tq *TagQuery) OnlyIDX(ctx context.Context) string

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TagQuery) OnlyX

func (tq *TagQuery) OnlyX(ctx context.Context) *Tag

OnlyX is like Only, but panics if an error occurs.

func (*TagQuery) Order

func (tq *TagQuery) Order(o ...tag.OrderOption) *TagQuery

Order specifies how the records should be ordered.

func (*TagQuery) QueryProductTags

func (tq *TagQuery) QueryProductTags() *ProductTagQuery

QueryProductTags chains the current query on the "product_tags" edge.

func (*TagQuery) QueryProducts

func (tq *TagQuery) QueryProducts() *ProductInfoQuery

QueryProducts chains the current query on the "products" edge.

func (*TagQuery) Select

func (tq *TagQuery) Select(fields ...string) *TagSelect

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.Tag.Query().
	Select(tag.FieldCreatedAt).
	Scan(ctx, &v)

func (*TagQuery) Unique

func (tq *TagQuery) Unique(unique bool) *TagQuery

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 (*TagQuery) Where

func (tq *TagQuery) Where(ps ...predicate.Tag) *TagQuery

Where adds a new predicate for the TagQuery builder.

func (*TagQuery) WithProductTags

func (tq *TagQuery) WithProductTags(opts ...func(*ProductTagQuery)) *TagQuery

WithProductTags tells the query-builder to eager-load the nodes that are connected to the "product_tags" edge. The optional arguments are used to configure the query builder of the edge.

func (*TagQuery) WithProducts

func (tq *TagQuery) WithProducts(opts ...func(*ProductInfoQuery)) *TagQuery

WithProducts tells the query-builder to eager-load the nodes that are connected to the "products" edge. The optional arguments are used to configure the query builder of the edge.

type TagSelect

type TagSelect struct {
	*TagQuery
	// contains filtered or unexported fields
}

TagSelect is the builder for selecting fields of Tag entities.

func (*TagSelect) Aggregate

func (ts *TagSelect) Aggregate(fns ...AggregateFunc) *TagSelect

Aggregate adds the given aggregation functions to the selector query.

func (*TagSelect) Bool

func (s *TagSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TagSelect) BoolX

func (s *TagSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TagSelect) Bools

func (s *TagSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TagSelect) BoolsX

func (s *TagSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TagSelect) Float64

func (s *TagSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TagSelect) Float64X

func (s *TagSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TagSelect) Float64s

func (s *TagSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TagSelect) Float64sX

func (s *TagSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TagSelect) Int

func (s *TagSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TagSelect) IntX

func (s *TagSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TagSelect) Ints

func (s *TagSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TagSelect) IntsX

func (s *TagSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TagSelect) Scan

func (ts *TagSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TagSelect) ScanX

func (s *TagSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TagSelect) String

func (s *TagSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TagSelect) StringX

func (s *TagSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TagSelect) Strings

func (s *TagSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TagSelect) StringsX

func (s *TagSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TagUpdate

type TagUpdate struct {
	// contains filtered or unexported fields
}

TagUpdate is the builder for updating Tag entities.

func (*TagUpdate) AddProductIDs

func (tu *TagUpdate) AddProductIDs(ids ...string) *TagUpdate

AddProductIDs adds the "products" edge to the ProductInfo entity by IDs.

func (*TagUpdate) AddProducts

func (tu *TagUpdate) AddProducts(p ...*ProductInfo) *TagUpdate

AddProducts adds the "products" edges to the ProductInfo entity.

func (*TagUpdate) ClearProducts

func (tu *TagUpdate) ClearProducts() *TagUpdate

ClearProducts clears all "products" edges to the ProductInfo entity.

func (*TagUpdate) Exec

func (tu *TagUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TagUpdate) ExecX

func (tu *TagUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagUpdate) Mutation

func (tu *TagUpdate) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagUpdate) RemoveProductIDs

func (tu *TagUpdate) RemoveProductIDs(ids ...string) *TagUpdate

RemoveProductIDs removes the "products" edge to ProductInfo entities by IDs.

func (*TagUpdate) RemoveProducts

func (tu *TagUpdate) RemoveProducts(p ...*ProductInfo) *TagUpdate

RemoveProducts removes "products" edges to ProductInfo entities.

func (*TagUpdate) Save

func (tu *TagUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TagUpdate) SaveX

func (tu *TagUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TagUpdate) SetNillableTitle

func (tu *TagUpdate) SetNillableTitle(s *string) *TagUpdate

SetNillableTitle sets the "title" field if the given value is not nil.

func (*TagUpdate) SetTitle

func (tu *TagUpdate) SetTitle(s string) *TagUpdate

SetTitle sets the "title" field.

func (*TagUpdate) SetUpdatedAt

func (tu *TagUpdate) SetUpdatedAt(t time.Time) *TagUpdate

SetUpdatedAt sets the "updated_at" field.

func (*TagUpdate) Where

func (tu *TagUpdate) Where(ps ...predicate.Tag) *TagUpdate

Where appends a list predicates to the TagUpdate builder.

type TagUpdateOne

type TagUpdateOne struct {
	// contains filtered or unexported fields
}

TagUpdateOne is the builder for updating a single Tag entity.

func (*TagUpdateOne) AddProductIDs

func (tuo *TagUpdateOne) AddProductIDs(ids ...string) *TagUpdateOne

AddProductIDs adds the "products" edge to the ProductInfo entity by IDs.

func (*TagUpdateOne) AddProducts

func (tuo *TagUpdateOne) AddProducts(p ...*ProductInfo) *TagUpdateOne

AddProducts adds the "products" edges to the ProductInfo entity.

func (*TagUpdateOne) ClearProducts

func (tuo *TagUpdateOne) ClearProducts() *TagUpdateOne

ClearProducts clears all "products" edges to the ProductInfo entity.

func (*TagUpdateOne) Exec

func (tuo *TagUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TagUpdateOne) ExecX

func (tuo *TagUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagUpdateOne) Mutation

func (tuo *TagUpdateOne) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagUpdateOne) RemoveProductIDs

func (tuo *TagUpdateOne) RemoveProductIDs(ids ...string) *TagUpdateOne

RemoveProductIDs removes the "products" edge to ProductInfo entities by IDs.

func (*TagUpdateOne) RemoveProducts

func (tuo *TagUpdateOne) RemoveProducts(p ...*ProductInfo) *TagUpdateOne

RemoveProducts removes "products" edges to ProductInfo entities.

func (*TagUpdateOne) Save

func (tuo *TagUpdateOne) Save(ctx context.Context) (*Tag, error)

Save executes the query and returns the updated Tag entity.

func (*TagUpdateOne) SaveX

func (tuo *TagUpdateOne) SaveX(ctx context.Context) *Tag

SaveX is like Save, but panics if an error occurs.

func (*TagUpdateOne) Select

func (tuo *TagUpdateOne) Select(field string, fields ...string) *TagUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TagUpdateOne) SetNillableTitle

func (tuo *TagUpdateOne) SetNillableTitle(s *string) *TagUpdateOne

SetNillableTitle sets the "title" field if the given value is not nil.

func (*TagUpdateOne) SetTitle

func (tuo *TagUpdateOne) SetTitle(s string) *TagUpdateOne

SetTitle sets the "title" field.

func (*TagUpdateOne) SetUpdatedAt

func (tuo *TagUpdateOne) SetUpdatedAt(t time.Time) *TagUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*TagUpdateOne) Where

func (tuo *TagUpdateOne) Where(ps ...predicate.Tag) *TagUpdateOne

Where appends a list predicates to the TagUpdate builder.

type Tags

type Tags []*Tag

Tags is a parsable slice of Tag.

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 {

	// Address is the client for interacting with the Address builders.
	Address *AddressClient
	// Conversation is the client for interacting with the Conversation builders.
	Conversation *ConversationClient
	// Invoice is the client for interacting with the Invoice builders.
	Invoice *InvoiceClient
	// InvoiceHistory is the client for interacting with the InvoiceHistory builders.
	InvoiceHistory *InvoiceHistoryClient
	// InvoiceStatusCode is the client for interacting with the InvoiceStatusCode builders.
	InvoiceStatusCode *InvoiceStatusCodeClient
	// Message is the client for interacting with the Message builders.
	Message *MessageClient
	// Order is the client for interacting with the Order builders.
	Order *OrderClient
	// OrderHistory is the client for interacting with the OrderHistory builders.
	OrderHistory *OrderHistoryClient
	// OrderItem is the client for interacting with the OrderItem builders.
	OrderItem *OrderItemClient
	// OrderStatusCode is the client for interacting with the OrderStatusCode builders.
	OrderStatusCode *OrderStatusCodeClient
	// Person is the client for interacting with the Person builders.
	Person *PersonClient
	// PersonAddress is the client for interacting with the PersonAddress builders.
	PersonAddress *PersonAddressClient
	// ProductColor is the client for interacting with the ProductColor builders.
	ProductColor *ProductColorClient
	// ProductImage is the client for interacting with the ProductImage builders.
	ProductImage *ProductImageClient
	// ProductInfo is the client for interacting with the ProductInfo builders.
	ProductInfo *ProductInfoClient
	// ProductQty is the client for interacting with the ProductQty builders.
	ProductQty *ProductQtyClient
	// ProductTag is the client for interacting with the ProductTag builders.
	ProductTag *ProductTagClient
	// Shipment is the client for interacting with the Shipment builders.
	Shipment *ShipmentClient
	// ShipmentHistory is the client for interacting with the ShipmentHistory builders.
	ShipmentHistory *ShipmentHistoryClient
	// ShipmentItem is the client for interacting with the ShipmentItem builders.
	ShipmentItem *ShipmentItemClient
	// ShipmentStatusCode is the client for interacting with the ShipmentStatusCode builders.
	ShipmentStatusCode *ShipmentStatusCodeClient
	// Tag is the client for interacting with the Tag builders.
	Tag *TagClient
	// WarehouseAssignment is the client for interacting with the WarehouseAssignment builders.
	WarehouseAssignment *WarehouseAssignmentClient
	// WorkUnitInfo is the client for interacting with the WorkUnitInfo builders.
	WorkUnitInfo *WorkUnitInfoClient
	// 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.

type WarehouseAssignment

type WarehouseAssignment struct {

	// ID of the ent.
	ID uuid.UUID `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"`
	// OrderID holds the value of the "order_id" field.
	OrderID uuid.UUID `json:"order_id,omitempty"`
	// WorkUnitID holds the value of the "work_unit_id" field.
	WorkUnitID uuid.UUID `json:"work_unit_id,omitempty"`
	// StaffID holds the value of the "staff_id" field.
	StaffID *uuid.UUID `json:"staff_id,omitempty"`
	// Status holds the value of the "status" field.
	Status *warehouseassignment.Status `json:"status,omitempty"`
	// Note holds the value of the "note" field.
	Note *string `json:"note,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the WarehouseAssignmentQuery when eager-loading is set.
	Edges WarehouseAssignmentEdges `json:"edges"`
	// contains filtered or unexported fields
}

WarehouseAssignment is the model entity for the WarehouseAssignment schema.

func (*WarehouseAssignment) QueryOrder

func (wa *WarehouseAssignment) QueryOrder() *OrderQuery

QueryOrder queries the "order" edge of the WarehouseAssignment entity.

func (*WarehouseAssignment) QueryStaff

func (wa *WarehouseAssignment) QueryStaff() *PersonQuery

QueryStaff queries the "staff" edge of the WarehouseAssignment entity.

func (*WarehouseAssignment) QueryWorkUnit

func (wa *WarehouseAssignment) QueryWorkUnit() *WorkUnitInfoQuery

QueryWorkUnit queries the "work_unit" edge of the WarehouseAssignment entity.

func (*WarehouseAssignment) String

func (wa *WarehouseAssignment) String() string

String implements the fmt.Stringer.

func (*WarehouseAssignment) Unwrap

Unwrap unwraps the WarehouseAssignment 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 (*WarehouseAssignment) Update

Update returns a builder for updating this WarehouseAssignment. Note that you need to call WarehouseAssignment.Unwrap() before calling this method if this WarehouseAssignment was returned from a transaction, and the transaction was committed or rolled back.

func (*WarehouseAssignment) Value

func (wa *WarehouseAssignment) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the WarehouseAssignment. This includes values selected through modifiers, order, etc.

type WarehouseAssignmentClient

type WarehouseAssignmentClient struct {
	// contains filtered or unexported fields
}

WarehouseAssignmentClient is a client for the WarehouseAssignment schema.

func NewWarehouseAssignmentClient

func NewWarehouseAssignmentClient(c config) *WarehouseAssignmentClient

NewWarehouseAssignmentClient returns a client for the WarehouseAssignment from the given config.

func (*WarehouseAssignmentClient) Create

Create returns a builder for creating a WarehouseAssignment entity.

func (*WarehouseAssignmentClient) CreateBulk

CreateBulk returns a builder for creating a bulk of WarehouseAssignment entities.

func (*WarehouseAssignmentClient) Delete

Delete returns a delete builder for WarehouseAssignment.

func (*WarehouseAssignmentClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*WarehouseAssignmentClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*WarehouseAssignmentClient) Get

Get returns a WarehouseAssignment entity by its id.

func (*WarehouseAssignmentClient) GetX

GetX is like Get, but panics if an error occurs.

func (*WarehouseAssignmentClient) Hooks

func (c *WarehouseAssignmentClient) Hooks() []Hook

Hooks returns the client hooks.

func (*WarehouseAssignmentClient) Intercept

func (c *WarehouseAssignmentClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `warehouseassignment.Intercept(f(g(h())))`.

func (*WarehouseAssignmentClient) Interceptors

func (c *WarehouseAssignmentClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*WarehouseAssignmentClient) MapCreateBulk

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 (*WarehouseAssignmentClient) Query

Query returns a query builder for WarehouseAssignment.

func (*WarehouseAssignmentClient) QueryOrder

QueryOrder queries the order edge of a WarehouseAssignment.

func (*WarehouseAssignmentClient) QueryStaff

QueryStaff queries the staff edge of a WarehouseAssignment.

func (*WarehouseAssignmentClient) QueryWorkUnit

QueryWorkUnit queries the work_unit edge of a WarehouseAssignment.

func (*WarehouseAssignmentClient) Update

Update returns an update builder for WarehouseAssignment.

func (*WarehouseAssignmentClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*WarehouseAssignmentClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*WarehouseAssignmentClient) Use

func (c *WarehouseAssignmentClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `warehouseassignment.Hooks(f(g(h())))`.

type WarehouseAssignmentCreate

type WarehouseAssignmentCreate struct {
	// contains filtered or unexported fields
}

WarehouseAssignmentCreate is the builder for creating a WarehouseAssignment entity.

func (*WarehouseAssignmentCreate) Exec

Exec executes the query.

func (*WarehouseAssignmentCreate) ExecX

func (wac *WarehouseAssignmentCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WarehouseAssignmentCreate) Mutation

Mutation returns the WarehouseAssignmentMutation object of the builder.

func (*WarehouseAssignmentCreate) Save

Save creates the WarehouseAssignment in the database.

func (*WarehouseAssignmentCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*WarehouseAssignmentCreate) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*WarehouseAssignmentCreate) SetID

SetID sets the "id" field.

func (*WarehouseAssignmentCreate) SetNillableCreatedAt

func (wac *WarehouseAssignmentCreate) SetNillableCreatedAt(t *time.Time) *WarehouseAssignmentCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*WarehouseAssignmentCreate) SetNillableID

SetNillableID sets the "id" field if the given value is not nil.

func (*WarehouseAssignmentCreate) SetNillableNote

SetNillableNote sets the "note" field if the given value is not nil.

func (*WarehouseAssignmentCreate) SetNillableStaffID

func (wac *WarehouseAssignmentCreate) SetNillableStaffID(u *uuid.UUID) *WarehouseAssignmentCreate

SetNillableStaffID sets the "staff_id" field if the given value is not nil.

func (*WarehouseAssignmentCreate) SetNillableStatus

SetNillableStatus sets the "status" field if the given value is not nil.

func (*WarehouseAssignmentCreate) SetNillableUpdatedAt

func (wac *WarehouseAssignmentCreate) SetNillableUpdatedAt(t *time.Time) *WarehouseAssignmentCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*WarehouseAssignmentCreate) SetNote

SetNote sets the "note" field.

func (*WarehouseAssignmentCreate) SetOrder

SetOrder sets the "order" edge to the Order entity.

func (*WarehouseAssignmentCreate) SetOrderID

SetOrderID sets the "order_id" field.

func (*WarehouseAssignmentCreate) SetStaff

SetStaff sets the "staff" edge to the Person entity.

func (*WarehouseAssignmentCreate) SetStaffID

SetStaffID sets the "staff_id" field.

func (*WarehouseAssignmentCreate) SetStatus

SetStatus sets the "status" field.

func (*WarehouseAssignmentCreate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*WarehouseAssignmentCreate) SetWorkUnit

SetWorkUnit sets the "work_unit" edge to the WorkUnitInfo entity.

func (*WarehouseAssignmentCreate) SetWorkUnitID

SetWorkUnitID sets the "work_unit_id" field.

type WarehouseAssignmentCreateBulk

type WarehouseAssignmentCreateBulk struct {
	// contains filtered or unexported fields
}

WarehouseAssignmentCreateBulk is the builder for creating many WarehouseAssignment entities in bulk.

func (*WarehouseAssignmentCreateBulk) Exec

Exec executes the query.

func (*WarehouseAssignmentCreateBulk) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*WarehouseAssignmentCreateBulk) Save

Save creates the WarehouseAssignment entities in the database.

func (*WarehouseAssignmentCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type WarehouseAssignmentDelete

type WarehouseAssignmentDelete struct {
	// contains filtered or unexported fields
}

WarehouseAssignmentDelete is the builder for deleting a WarehouseAssignment entity.

func (*WarehouseAssignmentDelete) Exec

Exec executes the deletion query and returns how many vertices were deleted.

func (*WarehouseAssignmentDelete) ExecX

func (wad *WarehouseAssignmentDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*WarehouseAssignmentDelete) Where

Where appends a list predicates to the WarehouseAssignmentDelete builder.

type WarehouseAssignmentDeleteOne

type WarehouseAssignmentDeleteOne struct {
	// contains filtered or unexported fields
}

WarehouseAssignmentDeleteOne is the builder for deleting a single WarehouseAssignment entity.

func (*WarehouseAssignmentDeleteOne) Exec

Exec executes the deletion query.

func (*WarehouseAssignmentDeleteOne) ExecX

func (wado *WarehouseAssignmentDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WarehouseAssignmentDeleteOne) Where

Where appends a list predicates to the WarehouseAssignmentDelete builder.

type WarehouseAssignmentEdges

type WarehouseAssignmentEdges struct {
	// Order holds the value of the order edge.
	Order *Order `json:"order,omitempty"`
	// WorkUnit holds the value of the work_unit edge.
	WorkUnit *WorkUnitInfo `json:"work_unit,omitempty"`
	// Staff holds the value of the staff edge.
	Staff *Person `json:"staff,omitempty"`
	// contains filtered or unexported fields
}

WarehouseAssignmentEdges holds the relations/edges for other nodes in the graph.

func (WarehouseAssignmentEdges) OrderOrErr

func (e WarehouseAssignmentEdges) OrderOrErr() (*Order, error)

OrderOrErr returns the Order value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (WarehouseAssignmentEdges) StaffOrErr

func (e WarehouseAssignmentEdges) StaffOrErr() (*Person, error)

StaffOrErr returns the Staff value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (WarehouseAssignmentEdges) WorkUnitOrErr

func (e WarehouseAssignmentEdges) WorkUnitOrErr() (*WorkUnitInfo, error)

WorkUnitOrErr returns the WorkUnit value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type WarehouseAssignmentGroupBy

type WarehouseAssignmentGroupBy struct {
	// contains filtered or unexported fields
}

WarehouseAssignmentGroupBy is the group-by builder for WarehouseAssignment entities.

func (*WarehouseAssignmentGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*WarehouseAssignmentGroupBy) Bool

func (s *WarehouseAssignmentGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*WarehouseAssignmentGroupBy) BoolX

func (s *WarehouseAssignmentGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*WarehouseAssignmentGroupBy) Bools

func (s *WarehouseAssignmentGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*WarehouseAssignmentGroupBy) BoolsX

func (s *WarehouseAssignmentGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*WarehouseAssignmentGroupBy) Float64

func (s *WarehouseAssignmentGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*WarehouseAssignmentGroupBy) Float64X

func (s *WarehouseAssignmentGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*WarehouseAssignmentGroupBy) Float64s

func (s *WarehouseAssignmentGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*WarehouseAssignmentGroupBy) Float64sX

func (s *WarehouseAssignmentGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*WarehouseAssignmentGroupBy) Int

func (s *WarehouseAssignmentGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*WarehouseAssignmentGroupBy) IntX

func (s *WarehouseAssignmentGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*WarehouseAssignmentGroupBy) Ints

func (s *WarehouseAssignmentGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*WarehouseAssignmentGroupBy) IntsX

func (s *WarehouseAssignmentGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*WarehouseAssignmentGroupBy) Scan

func (wagb *WarehouseAssignmentGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*WarehouseAssignmentGroupBy) ScanX

func (s *WarehouseAssignmentGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*WarehouseAssignmentGroupBy) String

func (s *WarehouseAssignmentGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*WarehouseAssignmentGroupBy) StringX

func (s *WarehouseAssignmentGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*WarehouseAssignmentGroupBy) Strings

func (s *WarehouseAssignmentGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*WarehouseAssignmentGroupBy) StringsX

func (s *WarehouseAssignmentGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type WarehouseAssignmentMutation

type WarehouseAssignmentMutation struct {
	// contains filtered or unexported fields
}

WarehouseAssignmentMutation represents an operation that mutates the WarehouseAssignment nodes in the graph.

func (*WarehouseAssignmentMutation) AddField

func (m *WarehouseAssignmentMutation) 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 (*WarehouseAssignmentMutation) AddedEdges

func (m *WarehouseAssignmentMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*WarehouseAssignmentMutation) AddedField

func (m *WarehouseAssignmentMutation) 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 (*WarehouseAssignmentMutation) AddedFields

func (m *WarehouseAssignmentMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*WarehouseAssignmentMutation) AddedIDs

func (m *WarehouseAssignmentMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*WarehouseAssignmentMutation) ClearEdge

func (m *WarehouseAssignmentMutation) 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 (*WarehouseAssignmentMutation) ClearField

func (m *WarehouseAssignmentMutation) 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 (*WarehouseAssignmentMutation) ClearNote

func (m *WarehouseAssignmentMutation) ClearNote()

ClearNote clears the value of the "note" field.

func (*WarehouseAssignmentMutation) ClearOrder

func (m *WarehouseAssignmentMutation) ClearOrder()

ClearOrder clears the "order" edge to the Order entity.

func (*WarehouseAssignmentMutation) ClearStaff

func (m *WarehouseAssignmentMutation) ClearStaff()

ClearStaff clears the "staff" edge to the Person entity.

func (*WarehouseAssignmentMutation) ClearStaffID

func (m *WarehouseAssignmentMutation) ClearStaffID()

ClearStaffID clears the value of the "staff_id" field.

func (*WarehouseAssignmentMutation) ClearWorkUnit

func (m *WarehouseAssignmentMutation) ClearWorkUnit()

ClearWorkUnit clears the "work_unit" edge to the WorkUnitInfo entity.

func (*WarehouseAssignmentMutation) ClearedEdges

func (m *WarehouseAssignmentMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*WarehouseAssignmentMutation) ClearedFields

func (m *WarehouseAssignmentMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (WarehouseAssignmentMutation) Client

func (m WarehouseAssignmentMutation) 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 (*WarehouseAssignmentMutation) CreatedAt

func (m *WarehouseAssignmentMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*WarehouseAssignmentMutation) EdgeCleared

func (m *WarehouseAssignmentMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*WarehouseAssignmentMutation) Field

func (m *WarehouseAssignmentMutation) 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 (*WarehouseAssignmentMutation) FieldCleared

func (m *WarehouseAssignmentMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*WarehouseAssignmentMutation) Fields

func (m *WarehouseAssignmentMutation) 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 (*WarehouseAssignmentMutation) ID

func (m *WarehouseAssignmentMutation) ID() (id uuid.UUID, 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 (*WarehouseAssignmentMutation) 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 (*WarehouseAssignmentMutation) Note

func (m *WarehouseAssignmentMutation) Note() (r string, exists bool)

Note returns the value of the "note" field in the mutation.

func (*WarehouseAssignmentMutation) NoteCleared

func (m *WarehouseAssignmentMutation) NoteCleared() bool

NoteCleared returns if the "note" field was cleared in this mutation.

func (*WarehouseAssignmentMutation) OldCreatedAt

func (m *WarehouseAssignmentMutation) OldCreatedAt(ctx context.Context) (v *time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the WarehouseAssignment entity. If the WarehouseAssignment 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 (*WarehouseAssignmentMutation) OldField

func (m *WarehouseAssignmentMutation) 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 (*WarehouseAssignmentMutation) OldNote

func (m *WarehouseAssignmentMutation) OldNote(ctx context.Context) (v *string, err error)

OldNote returns the old "note" field's value of the WarehouseAssignment entity. If the WarehouseAssignment 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 (*WarehouseAssignmentMutation) OldOrderID

func (m *WarehouseAssignmentMutation) OldOrderID(ctx context.Context) (v uuid.UUID, err error)

OldOrderID returns the old "order_id" field's value of the WarehouseAssignment entity. If the WarehouseAssignment 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 (*WarehouseAssignmentMutation) OldStaffID

func (m *WarehouseAssignmentMutation) OldStaffID(ctx context.Context) (v *uuid.UUID, err error)

OldStaffID returns the old "staff_id" field's value of the WarehouseAssignment entity. If the WarehouseAssignment 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 (*WarehouseAssignmentMutation) OldStatus

OldStatus returns the old "status" field's value of the WarehouseAssignment entity. If the WarehouseAssignment 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 (*WarehouseAssignmentMutation) OldUpdatedAt

func (m *WarehouseAssignmentMutation) OldUpdatedAt(ctx context.Context) (v *time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the WarehouseAssignment entity. If the WarehouseAssignment 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 (*WarehouseAssignmentMutation) OldWorkUnitID

func (m *WarehouseAssignmentMutation) OldWorkUnitID(ctx context.Context) (v uuid.UUID, err error)

OldWorkUnitID returns the old "work_unit_id" field's value of the WarehouseAssignment entity. If the WarehouseAssignment 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 (*WarehouseAssignmentMutation) Op

Op returns the operation name.

func (*WarehouseAssignmentMutation) OrderCleared

func (m *WarehouseAssignmentMutation) OrderCleared() bool

OrderCleared reports if the "order" edge to the Order entity was cleared.

func (*WarehouseAssignmentMutation) OrderID

func (m *WarehouseAssignmentMutation) OrderID() (r uuid.UUID, exists bool)

OrderID returns the value of the "order_id" field in the mutation.

func (*WarehouseAssignmentMutation) OrderIDs

func (m *WarehouseAssignmentMutation) OrderIDs() (ids []uuid.UUID)

OrderIDs returns the "order" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OrderID instead. It exists only for internal usage by the builders.

func (*WarehouseAssignmentMutation) RemovedEdges

func (m *WarehouseAssignmentMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*WarehouseAssignmentMutation) RemovedIDs

func (m *WarehouseAssignmentMutation) 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 (*WarehouseAssignmentMutation) ResetCreatedAt

func (m *WarehouseAssignmentMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*WarehouseAssignmentMutation) ResetEdge

func (m *WarehouseAssignmentMutation) 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 (*WarehouseAssignmentMutation) ResetField

func (m *WarehouseAssignmentMutation) 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 (*WarehouseAssignmentMutation) ResetNote

func (m *WarehouseAssignmentMutation) ResetNote()

ResetNote resets all changes to the "note" field.

func (*WarehouseAssignmentMutation) ResetOrder

func (m *WarehouseAssignmentMutation) ResetOrder()

ResetOrder resets all changes to the "order" edge.

func (*WarehouseAssignmentMutation) ResetOrderID

func (m *WarehouseAssignmentMutation) ResetOrderID()

ResetOrderID resets all changes to the "order_id" field.

func (*WarehouseAssignmentMutation) ResetStaff

func (m *WarehouseAssignmentMutation) ResetStaff()

ResetStaff resets all changes to the "staff" edge.

func (*WarehouseAssignmentMutation) ResetStaffID

func (m *WarehouseAssignmentMutation) ResetStaffID()

ResetStaffID resets all changes to the "staff_id" field.

func (*WarehouseAssignmentMutation) ResetStatus

func (m *WarehouseAssignmentMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*WarehouseAssignmentMutation) ResetUpdatedAt

func (m *WarehouseAssignmentMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*WarehouseAssignmentMutation) ResetWorkUnit

func (m *WarehouseAssignmentMutation) ResetWorkUnit()

ResetWorkUnit resets all changes to the "work_unit" edge.

func (*WarehouseAssignmentMutation) ResetWorkUnitID

func (m *WarehouseAssignmentMutation) ResetWorkUnitID()

ResetWorkUnitID resets all changes to the "work_unit_id" field.

func (*WarehouseAssignmentMutation) SetCreatedAt

func (m *WarehouseAssignmentMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*WarehouseAssignmentMutation) SetField

func (m *WarehouseAssignmentMutation) 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 (*WarehouseAssignmentMutation) SetID

func (m *WarehouseAssignmentMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of WarehouseAssignment entities.

func (*WarehouseAssignmentMutation) SetNote

func (m *WarehouseAssignmentMutation) SetNote(s string)

SetNote sets the "note" field.

func (*WarehouseAssignmentMutation) SetOp

func (m *WarehouseAssignmentMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*WarehouseAssignmentMutation) SetOrderID

func (m *WarehouseAssignmentMutation) SetOrderID(u uuid.UUID)

SetOrderID sets the "order_id" field.

func (*WarehouseAssignmentMutation) SetStaffID

func (m *WarehouseAssignmentMutation) SetStaffID(u uuid.UUID)

SetStaffID sets the "staff_id" field.

func (*WarehouseAssignmentMutation) SetStatus

SetStatus sets the "status" field.

func (*WarehouseAssignmentMutation) SetUpdatedAt

func (m *WarehouseAssignmentMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*WarehouseAssignmentMutation) SetWorkUnitID

func (m *WarehouseAssignmentMutation) SetWorkUnitID(u uuid.UUID)

SetWorkUnitID sets the "work_unit_id" field.

func (*WarehouseAssignmentMutation) StaffCleared

func (m *WarehouseAssignmentMutation) StaffCleared() bool

StaffCleared reports if the "staff" edge to the Person entity was cleared.

func (*WarehouseAssignmentMutation) StaffID

func (m *WarehouseAssignmentMutation) StaffID() (r uuid.UUID, exists bool)

StaffID returns the value of the "staff_id" field in the mutation.

func (*WarehouseAssignmentMutation) StaffIDCleared

func (m *WarehouseAssignmentMutation) StaffIDCleared() bool

StaffIDCleared returns if the "staff_id" field was cleared in this mutation.

func (*WarehouseAssignmentMutation) StaffIDs

func (m *WarehouseAssignmentMutation) StaffIDs() (ids []uuid.UUID)

StaffIDs returns the "staff" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use StaffID instead. It exists only for internal usage by the builders.

func (*WarehouseAssignmentMutation) Status

Status returns the value of the "status" field in the mutation.

func (WarehouseAssignmentMutation) Tx

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*WarehouseAssignmentMutation) Type

Type returns the node type of this mutation (WarehouseAssignment).

func (*WarehouseAssignmentMutation) UpdatedAt

func (m *WarehouseAssignmentMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*WarehouseAssignmentMutation) Where

Where appends a list predicates to the WarehouseAssignmentMutation builder.

func (*WarehouseAssignmentMutation) WhereP

func (m *WarehouseAssignmentMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the WarehouseAssignmentMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

func (*WarehouseAssignmentMutation) WorkUnitCleared

func (m *WarehouseAssignmentMutation) WorkUnitCleared() bool

WorkUnitCleared reports if the "work_unit" edge to the WorkUnitInfo entity was cleared.

func (*WarehouseAssignmentMutation) WorkUnitID

func (m *WarehouseAssignmentMutation) WorkUnitID() (r uuid.UUID, exists bool)

WorkUnitID returns the value of the "work_unit_id" field in the mutation.

func (*WarehouseAssignmentMutation) WorkUnitIDs

func (m *WarehouseAssignmentMutation) WorkUnitIDs() (ids []uuid.UUID)

WorkUnitIDs returns the "work_unit" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use WorkUnitID instead. It exists only for internal usage by the builders.

type WarehouseAssignmentQuery

type WarehouseAssignmentQuery struct {
	// contains filtered or unexported fields
}

WarehouseAssignmentQuery is the builder for querying WarehouseAssignment entities.

func (*WarehouseAssignmentQuery) Aggregate

Aggregate returns a WarehouseAssignmentSelect configured with the given aggregations.

func (*WarehouseAssignmentQuery) All

All executes the query and returns a list of WarehouseAssignments.

func (*WarehouseAssignmentQuery) AllX

AllX is like All, but panics if an error occurs.

func (*WarehouseAssignmentQuery) Clone

Clone returns a duplicate of the WarehouseAssignmentQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*WarehouseAssignmentQuery) Count

func (waq *WarehouseAssignmentQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*WarehouseAssignmentQuery) CountX

func (waq *WarehouseAssignmentQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*WarehouseAssignmentQuery) Exist

func (waq *WarehouseAssignmentQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*WarehouseAssignmentQuery) ExistX

func (waq *WarehouseAssignmentQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*WarehouseAssignmentQuery) First

First returns the first WarehouseAssignment entity from the query. Returns a *NotFoundError when no WarehouseAssignment was found.

func (*WarehouseAssignmentQuery) FirstID

func (waq *WarehouseAssignmentQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first WarehouseAssignment ID from the query. Returns a *NotFoundError when no WarehouseAssignment ID was found.

func (*WarehouseAssignmentQuery) FirstIDX

func (waq *WarehouseAssignmentQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*WarehouseAssignmentQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*WarehouseAssignmentQuery) GroupBy

func (waq *WarehouseAssignmentQuery) GroupBy(field string, fields ...string) *WarehouseAssignmentGroupBy

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.WarehouseAssignment.Query().
	GroupBy(warehouseassignment.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*WarehouseAssignmentQuery) IDs

func (waq *WarehouseAssignmentQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of WarehouseAssignment IDs.

func (*WarehouseAssignmentQuery) IDsX

IDsX is like IDs, but panics if an error occurs.

func (*WarehouseAssignmentQuery) Limit

Limit the number of records to be returned by this query.

func (*WarehouseAssignmentQuery) Offset

Offset to start from.

func (*WarehouseAssignmentQuery) Only

Only returns a single WarehouseAssignment entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one WarehouseAssignment entity is found. Returns a *NotFoundError when no WarehouseAssignment entities are found.

func (*WarehouseAssignmentQuery) OnlyID

func (waq *WarehouseAssignmentQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only WarehouseAssignment ID in the query. Returns a *NotSingularError when more than one WarehouseAssignment ID is found. Returns a *NotFoundError when no entities are found.

func (*WarehouseAssignmentQuery) OnlyIDX

func (waq *WarehouseAssignmentQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*WarehouseAssignmentQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*WarehouseAssignmentQuery) Order

Order specifies how the records should be ordered.

func (*WarehouseAssignmentQuery) QueryOrder

func (waq *WarehouseAssignmentQuery) QueryOrder() *OrderQuery

QueryOrder chains the current query on the "order" edge.

func (*WarehouseAssignmentQuery) QueryStaff

func (waq *WarehouseAssignmentQuery) QueryStaff() *PersonQuery

QueryStaff chains the current query on the "staff" edge.

func (*WarehouseAssignmentQuery) QueryWorkUnit

func (waq *WarehouseAssignmentQuery) QueryWorkUnit() *WorkUnitInfoQuery

QueryWorkUnit chains the current query on the "work_unit" edge.

func (*WarehouseAssignmentQuery) 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.WarehouseAssignment.Query().
	Select(warehouseassignment.FieldCreatedAt).
	Scan(ctx, &v)

func (*WarehouseAssignmentQuery) 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 (*WarehouseAssignmentQuery) Where

Where adds a new predicate for the WarehouseAssignmentQuery builder.

func (*WarehouseAssignmentQuery) WithOrder

func (waq *WarehouseAssignmentQuery) WithOrder(opts ...func(*OrderQuery)) *WarehouseAssignmentQuery

WithOrder tells the query-builder to eager-load the nodes that are connected to the "order" edge. The optional arguments are used to configure the query builder of the edge.

func (*WarehouseAssignmentQuery) WithStaff

func (waq *WarehouseAssignmentQuery) WithStaff(opts ...func(*PersonQuery)) *WarehouseAssignmentQuery

WithStaff tells the query-builder to eager-load the nodes that are connected to the "staff" edge. The optional arguments are used to configure the query builder of the edge.

func (*WarehouseAssignmentQuery) WithWorkUnit

func (waq *WarehouseAssignmentQuery) WithWorkUnit(opts ...func(*WorkUnitInfoQuery)) *WarehouseAssignmentQuery

WithWorkUnit tells the query-builder to eager-load the nodes that are connected to the "work_unit" edge. The optional arguments are used to configure the query builder of the edge.

type WarehouseAssignmentSelect

type WarehouseAssignmentSelect struct {
	*WarehouseAssignmentQuery
	// contains filtered or unexported fields
}

WarehouseAssignmentSelect is the builder for selecting fields of WarehouseAssignment entities.

func (*WarehouseAssignmentSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*WarehouseAssignmentSelect) Bool

func (s *WarehouseAssignmentSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*WarehouseAssignmentSelect) BoolX

func (s *WarehouseAssignmentSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*WarehouseAssignmentSelect) Bools

func (s *WarehouseAssignmentSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*WarehouseAssignmentSelect) BoolsX

func (s *WarehouseAssignmentSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*WarehouseAssignmentSelect) Float64

func (s *WarehouseAssignmentSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*WarehouseAssignmentSelect) Float64X

func (s *WarehouseAssignmentSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*WarehouseAssignmentSelect) Float64s

func (s *WarehouseAssignmentSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*WarehouseAssignmentSelect) Float64sX

func (s *WarehouseAssignmentSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*WarehouseAssignmentSelect) Int

func (s *WarehouseAssignmentSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*WarehouseAssignmentSelect) IntX

func (s *WarehouseAssignmentSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*WarehouseAssignmentSelect) Ints

func (s *WarehouseAssignmentSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*WarehouseAssignmentSelect) IntsX

func (s *WarehouseAssignmentSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*WarehouseAssignmentSelect) Scan

Scan applies the selector query and scans the result into the given value.

func (*WarehouseAssignmentSelect) ScanX

func (s *WarehouseAssignmentSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*WarehouseAssignmentSelect) String

func (s *WarehouseAssignmentSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*WarehouseAssignmentSelect) StringX

func (s *WarehouseAssignmentSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*WarehouseAssignmentSelect) Strings

func (s *WarehouseAssignmentSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*WarehouseAssignmentSelect) StringsX

func (s *WarehouseAssignmentSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type WarehouseAssignmentUpdate

type WarehouseAssignmentUpdate struct {
	// contains filtered or unexported fields
}

WarehouseAssignmentUpdate is the builder for updating WarehouseAssignment entities.

func (*WarehouseAssignmentUpdate) ClearNote

ClearNote clears the value of the "note" field.

func (*WarehouseAssignmentUpdate) ClearStaff

ClearStaff clears the "staff" edge to the Person entity.

func (*WarehouseAssignmentUpdate) ClearStaffID

ClearStaffID clears the value of the "staff_id" field.

func (*WarehouseAssignmentUpdate) Exec

Exec executes the query.

func (*WarehouseAssignmentUpdate) ExecX

func (wau *WarehouseAssignmentUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WarehouseAssignmentUpdate) Mutation

Mutation returns the WarehouseAssignmentMutation object of the builder.

func (*WarehouseAssignmentUpdate) Save

Save executes the query and returns the number of nodes affected by the update operation.

func (*WarehouseAssignmentUpdate) SaveX

func (wau *WarehouseAssignmentUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*WarehouseAssignmentUpdate) SetNillableNote

SetNillableNote sets the "note" field if the given value is not nil.

func (*WarehouseAssignmentUpdate) SetNillableStaffID

func (wau *WarehouseAssignmentUpdate) SetNillableStaffID(u *uuid.UUID) *WarehouseAssignmentUpdate

SetNillableStaffID sets the "staff_id" field if the given value is not nil.

func (*WarehouseAssignmentUpdate) SetNillableStatus

SetNillableStatus sets the "status" field if the given value is not nil.

func (*WarehouseAssignmentUpdate) SetNote

SetNote sets the "note" field.

func (*WarehouseAssignmentUpdate) SetStaff

SetStaff sets the "staff" edge to the Person entity.

func (*WarehouseAssignmentUpdate) SetStaffID

SetStaffID sets the "staff_id" field.

func (*WarehouseAssignmentUpdate) SetStatus

SetStatus sets the "status" field.

func (*WarehouseAssignmentUpdate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*WarehouseAssignmentUpdate) Where

Where appends a list predicates to the WarehouseAssignmentUpdate builder.

type WarehouseAssignmentUpdateOne

type WarehouseAssignmentUpdateOne struct {
	// contains filtered or unexported fields
}

WarehouseAssignmentUpdateOne is the builder for updating a single WarehouseAssignment entity.

func (*WarehouseAssignmentUpdateOne) ClearNote

ClearNote clears the value of the "note" field.

func (*WarehouseAssignmentUpdateOne) ClearStaff

ClearStaff clears the "staff" edge to the Person entity.

func (*WarehouseAssignmentUpdateOne) ClearStaffID

ClearStaffID clears the value of the "staff_id" field.

func (*WarehouseAssignmentUpdateOne) Exec

Exec executes the query on the entity.

func (*WarehouseAssignmentUpdateOne) ExecX

func (wauo *WarehouseAssignmentUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WarehouseAssignmentUpdateOne) Mutation

Mutation returns the WarehouseAssignmentMutation object of the builder.

func (*WarehouseAssignmentUpdateOne) Save

Save executes the query and returns the updated WarehouseAssignment entity.

func (*WarehouseAssignmentUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*WarehouseAssignmentUpdateOne) Select

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*WarehouseAssignmentUpdateOne) SetNillableNote

SetNillableNote sets the "note" field if the given value is not nil.

func (*WarehouseAssignmentUpdateOne) SetNillableStaffID

SetNillableStaffID sets the "staff_id" field if the given value is not nil.

func (*WarehouseAssignmentUpdateOne) SetNillableStatus

SetNillableStatus sets the "status" field if the given value is not nil.

func (*WarehouseAssignmentUpdateOne) SetNote

SetNote sets the "note" field.

func (*WarehouseAssignmentUpdateOne) SetStaff

SetStaff sets the "staff" edge to the Person entity.

func (*WarehouseAssignmentUpdateOne) SetStaffID

SetStaffID sets the "staff_id" field.

func (*WarehouseAssignmentUpdateOne) SetStatus

SetStatus sets the "status" field.

func (*WarehouseAssignmentUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*WarehouseAssignmentUpdateOne) Where

Where appends a list predicates to the WarehouseAssignmentUpdate builder.

type WarehouseAssignments

type WarehouseAssignments []*WarehouseAssignment

WarehouseAssignments is a parsable slice of WarehouseAssignment.

type WorkUnitInfo

type WorkUnitInfo struct {

	// ID of the ent.
	ID uuid.UUID `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"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// AddressID holds the value of the "address_id" field.
	AddressID *uuid.UUID `json:"address_id,omitempty"`
	// Type holds the value of the "type" field.
	Type *workunitinfo.Type `json:"type,omitempty"`
	// ImageURL holds the value of the "image_url" field.
	ImageURL *string `json:"image_url,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the WorkUnitInfoQuery when eager-loading is set.
	Edges WorkUnitInfoEdges `json:"edges"`
	// contains filtered or unexported fields
}

WorkUnitInfo is the model entity for the WorkUnitInfo schema.

func (*WorkUnitInfo) QueryAddress

func (wui *WorkUnitInfo) QueryAddress() *AddressQuery

QueryAddress queries the "address" edge of the WorkUnitInfo entity.

func (*WorkUnitInfo) String

func (wui *WorkUnitInfo) String() string

String implements the fmt.Stringer.

func (*WorkUnitInfo) Unwrap

func (wui *WorkUnitInfo) Unwrap() *WorkUnitInfo

Unwrap unwraps the WorkUnitInfo 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 (*WorkUnitInfo) Update

func (wui *WorkUnitInfo) Update() *WorkUnitInfoUpdateOne

Update returns a builder for updating this WorkUnitInfo. Note that you need to call WorkUnitInfo.Unwrap() before calling this method if this WorkUnitInfo was returned from a transaction, and the transaction was committed or rolled back.

func (*WorkUnitInfo) Value

func (wui *WorkUnitInfo) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the WorkUnitInfo. This includes values selected through modifiers, order, etc.

type WorkUnitInfoClient

type WorkUnitInfoClient struct {
	// contains filtered or unexported fields
}

WorkUnitInfoClient is a client for the WorkUnitInfo schema.

func NewWorkUnitInfoClient

func NewWorkUnitInfoClient(c config) *WorkUnitInfoClient

NewWorkUnitInfoClient returns a client for the WorkUnitInfo from the given config.

func (*WorkUnitInfoClient) Create

Create returns a builder for creating a WorkUnitInfo entity.

func (*WorkUnitInfoClient) CreateBulk

func (c *WorkUnitInfoClient) CreateBulk(builders ...*WorkUnitInfoCreate) *WorkUnitInfoCreateBulk

CreateBulk returns a builder for creating a bulk of WorkUnitInfo entities.

func (*WorkUnitInfoClient) Delete

Delete returns a delete builder for WorkUnitInfo.

func (*WorkUnitInfoClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*WorkUnitInfoClient) DeleteOneID

func (c *WorkUnitInfoClient) DeleteOneID(id uuid.UUID) *WorkUnitInfoDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*WorkUnitInfoClient) Get

Get returns a WorkUnitInfo entity by its id.

func (*WorkUnitInfoClient) GetX

GetX is like Get, but panics if an error occurs.

func (*WorkUnitInfoClient) Hooks

func (c *WorkUnitInfoClient) Hooks() []Hook

Hooks returns the client hooks.

func (*WorkUnitInfoClient) Intercept

func (c *WorkUnitInfoClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `workunitinfo.Intercept(f(g(h())))`.

func (*WorkUnitInfoClient) Interceptors

func (c *WorkUnitInfoClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*WorkUnitInfoClient) MapCreateBulk

func (c *WorkUnitInfoClient) MapCreateBulk(slice any, setFunc func(*WorkUnitInfoCreate, int)) *WorkUnitInfoCreateBulk

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 (*WorkUnitInfoClient) Query

Query returns a query builder for WorkUnitInfo.

func (*WorkUnitInfoClient) QueryAddress

func (c *WorkUnitInfoClient) QueryAddress(wui *WorkUnitInfo) *AddressQuery

QueryAddress queries the address edge of a WorkUnitInfo.

func (*WorkUnitInfoClient) Update

Update returns an update builder for WorkUnitInfo.

func (*WorkUnitInfoClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*WorkUnitInfoClient) UpdateOneID

func (c *WorkUnitInfoClient) UpdateOneID(id uuid.UUID) *WorkUnitInfoUpdateOne

UpdateOneID returns an update builder for the given id.

func (*WorkUnitInfoClient) Use

func (c *WorkUnitInfoClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `workunitinfo.Hooks(f(g(h())))`.

type WorkUnitInfoCreate

type WorkUnitInfoCreate struct {
	// contains filtered or unexported fields
}

WorkUnitInfoCreate is the builder for creating a WorkUnitInfo entity.

func (*WorkUnitInfoCreate) Exec

func (wuic *WorkUnitInfoCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*WorkUnitInfoCreate) ExecX

func (wuic *WorkUnitInfoCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WorkUnitInfoCreate) Mutation

func (wuic *WorkUnitInfoCreate) Mutation() *WorkUnitInfoMutation

Mutation returns the WorkUnitInfoMutation object of the builder.

func (*WorkUnitInfoCreate) Save

func (wuic *WorkUnitInfoCreate) Save(ctx context.Context) (*WorkUnitInfo, error)

Save creates the WorkUnitInfo in the database.

func (*WorkUnitInfoCreate) SaveX

func (wuic *WorkUnitInfoCreate) SaveX(ctx context.Context) *WorkUnitInfo

SaveX calls Save and panics if Save returns an error.

func (*WorkUnitInfoCreate) SetAddress

func (wuic *WorkUnitInfoCreate) SetAddress(a *Address) *WorkUnitInfoCreate

SetAddress sets the "address" edge to the Address entity.

func (*WorkUnitInfoCreate) SetAddressID

func (wuic *WorkUnitInfoCreate) SetAddressID(u uuid.UUID) *WorkUnitInfoCreate

SetAddressID sets the "address_id" field.

func (*WorkUnitInfoCreate) SetCreatedAt

func (wuic *WorkUnitInfoCreate) SetCreatedAt(t time.Time) *WorkUnitInfoCreate

SetCreatedAt sets the "created_at" field.

func (*WorkUnitInfoCreate) SetID

SetID sets the "id" field.

func (*WorkUnitInfoCreate) SetImageURL

func (wuic *WorkUnitInfoCreate) SetImageURL(s string) *WorkUnitInfoCreate

SetImageURL sets the "image_url" field.

func (*WorkUnitInfoCreate) SetName

func (wuic *WorkUnitInfoCreate) SetName(s string) *WorkUnitInfoCreate

SetName sets the "name" field.

func (*WorkUnitInfoCreate) SetNillableAddressID

func (wuic *WorkUnitInfoCreate) SetNillableAddressID(u *uuid.UUID) *WorkUnitInfoCreate

SetNillableAddressID sets the "address_id" field if the given value is not nil.

func (*WorkUnitInfoCreate) SetNillableCreatedAt

func (wuic *WorkUnitInfoCreate) SetNillableCreatedAt(t *time.Time) *WorkUnitInfoCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*WorkUnitInfoCreate) SetNillableID

func (wuic *WorkUnitInfoCreate) SetNillableID(u *uuid.UUID) *WorkUnitInfoCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*WorkUnitInfoCreate) SetNillableImageURL

func (wuic *WorkUnitInfoCreate) SetNillableImageURL(s *string) *WorkUnitInfoCreate

SetNillableImageURL sets the "image_url" field if the given value is not nil.

func (*WorkUnitInfoCreate) SetNillableType

func (wuic *WorkUnitInfoCreate) SetNillableType(w *workunitinfo.Type) *WorkUnitInfoCreate

SetNillableType sets the "type" field if the given value is not nil.

func (*WorkUnitInfoCreate) SetNillableUpdatedAt

func (wuic *WorkUnitInfoCreate) SetNillableUpdatedAt(t *time.Time) *WorkUnitInfoCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*WorkUnitInfoCreate) SetType

SetType sets the "type" field.

func (*WorkUnitInfoCreate) SetUpdatedAt

func (wuic *WorkUnitInfoCreate) SetUpdatedAt(t time.Time) *WorkUnitInfoCreate

SetUpdatedAt sets the "updated_at" field.

type WorkUnitInfoCreateBulk

type WorkUnitInfoCreateBulk struct {
	// contains filtered or unexported fields
}

WorkUnitInfoCreateBulk is the builder for creating many WorkUnitInfo entities in bulk.

func (*WorkUnitInfoCreateBulk) Exec

func (wuicb *WorkUnitInfoCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*WorkUnitInfoCreateBulk) ExecX

func (wuicb *WorkUnitInfoCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WorkUnitInfoCreateBulk) Save

func (wuicb *WorkUnitInfoCreateBulk) Save(ctx context.Context) ([]*WorkUnitInfo, error)

Save creates the WorkUnitInfo entities in the database.

func (*WorkUnitInfoCreateBulk) SaveX

func (wuicb *WorkUnitInfoCreateBulk) SaveX(ctx context.Context) []*WorkUnitInfo

SaveX is like Save, but panics if an error occurs.

type WorkUnitInfoDelete

type WorkUnitInfoDelete struct {
	// contains filtered or unexported fields
}

WorkUnitInfoDelete is the builder for deleting a WorkUnitInfo entity.

func (*WorkUnitInfoDelete) Exec

func (wuid *WorkUnitInfoDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*WorkUnitInfoDelete) ExecX

func (wuid *WorkUnitInfoDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*WorkUnitInfoDelete) Where

Where appends a list predicates to the WorkUnitInfoDelete builder.

type WorkUnitInfoDeleteOne

type WorkUnitInfoDeleteOne struct {
	// contains filtered or unexported fields
}

WorkUnitInfoDeleteOne is the builder for deleting a single WorkUnitInfo entity.

func (*WorkUnitInfoDeleteOne) Exec

func (wuido *WorkUnitInfoDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*WorkUnitInfoDeleteOne) ExecX

func (wuido *WorkUnitInfoDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WorkUnitInfoDeleteOne) Where

Where appends a list predicates to the WorkUnitInfoDelete builder.

type WorkUnitInfoEdges

type WorkUnitInfoEdges struct {
	// Address holds the value of the address edge.
	Address *Address `json:"address,omitempty"`
	// contains filtered or unexported fields
}

WorkUnitInfoEdges holds the relations/edges for other nodes in the graph.

func (WorkUnitInfoEdges) AddressOrErr

func (e WorkUnitInfoEdges) AddressOrErr() (*Address, error)

AddressOrErr returns the Address value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type WorkUnitInfoGroupBy

type WorkUnitInfoGroupBy struct {
	// contains filtered or unexported fields
}

WorkUnitInfoGroupBy is the group-by builder for WorkUnitInfo entities.

func (*WorkUnitInfoGroupBy) Aggregate

func (wuigb *WorkUnitInfoGroupBy) Aggregate(fns ...AggregateFunc) *WorkUnitInfoGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*WorkUnitInfoGroupBy) Bool

func (s *WorkUnitInfoGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*WorkUnitInfoGroupBy) BoolX

func (s *WorkUnitInfoGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*WorkUnitInfoGroupBy) Bools

func (s *WorkUnitInfoGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*WorkUnitInfoGroupBy) BoolsX

func (s *WorkUnitInfoGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*WorkUnitInfoGroupBy) Float64

func (s *WorkUnitInfoGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*WorkUnitInfoGroupBy) Float64X

func (s *WorkUnitInfoGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*WorkUnitInfoGroupBy) Float64s

func (s *WorkUnitInfoGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*WorkUnitInfoGroupBy) Float64sX

func (s *WorkUnitInfoGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*WorkUnitInfoGroupBy) Int

func (s *WorkUnitInfoGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*WorkUnitInfoGroupBy) IntX

func (s *WorkUnitInfoGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*WorkUnitInfoGroupBy) Ints

func (s *WorkUnitInfoGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*WorkUnitInfoGroupBy) IntsX

func (s *WorkUnitInfoGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*WorkUnitInfoGroupBy) Scan

func (wuigb *WorkUnitInfoGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*WorkUnitInfoGroupBy) ScanX

func (s *WorkUnitInfoGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*WorkUnitInfoGroupBy) String

func (s *WorkUnitInfoGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*WorkUnitInfoGroupBy) StringX

func (s *WorkUnitInfoGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*WorkUnitInfoGroupBy) Strings

func (s *WorkUnitInfoGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*WorkUnitInfoGroupBy) StringsX

func (s *WorkUnitInfoGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type WorkUnitInfoMutation

type WorkUnitInfoMutation struct {
	// contains filtered or unexported fields
}

WorkUnitInfoMutation represents an operation that mutates the WorkUnitInfo nodes in the graph.

func (*WorkUnitInfoMutation) AddField

func (m *WorkUnitInfoMutation) 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 (*WorkUnitInfoMutation) AddedEdges

func (m *WorkUnitInfoMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*WorkUnitInfoMutation) AddedField

func (m *WorkUnitInfoMutation) 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 (*WorkUnitInfoMutation) AddedFields

func (m *WorkUnitInfoMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*WorkUnitInfoMutation) AddedIDs

func (m *WorkUnitInfoMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*WorkUnitInfoMutation) AddressCleared

func (m *WorkUnitInfoMutation) AddressCleared() bool

AddressCleared reports if the "address" edge to the Address entity was cleared.

func (*WorkUnitInfoMutation) AddressID

func (m *WorkUnitInfoMutation) AddressID() (r uuid.UUID, exists bool)

AddressID returns the value of the "address_id" field in the mutation.

func (*WorkUnitInfoMutation) AddressIDCleared

func (m *WorkUnitInfoMutation) AddressIDCleared() bool

AddressIDCleared returns if the "address_id" field was cleared in this mutation.

func (*WorkUnitInfoMutation) AddressIDs

func (m *WorkUnitInfoMutation) AddressIDs() (ids []uuid.UUID)

AddressIDs returns the "address" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use AddressID instead. It exists only for internal usage by the builders.

func (*WorkUnitInfoMutation) ClearAddress

func (m *WorkUnitInfoMutation) ClearAddress()

ClearAddress clears the "address" edge to the Address entity.

func (*WorkUnitInfoMutation) ClearAddressID

func (m *WorkUnitInfoMutation) ClearAddressID()

ClearAddressID clears the value of the "address_id" field.

func (*WorkUnitInfoMutation) ClearEdge

func (m *WorkUnitInfoMutation) 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 (*WorkUnitInfoMutation) ClearField

func (m *WorkUnitInfoMutation) 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 (*WorkUnitInfoMutation) ClearImageURL

func (m *WorkUnitInfoMutation) ClearImageURL()

ClearImageURL clears the value of the "image_url" field.

func (*WorkUnitInfoMutation) ClearedEdges

func (m *WorkUnitInfoMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*WorkUnitInfoMutation) ClearedFields

func (m *WorkUnitInfoMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (WorkUnitInfoMutation) Client

func (m WorkUnitInfoMutation) 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 (*WorkUnitInfoMutation) CreatedAt

func (m *WorkUnitInfoMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*WorkUnitInfoMutation) EdgeCleared

func (m *WorkUnitInfoMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*WorkUnitInfoMutation) Field

func (m *WorkUnitInfoMutation) 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 (*WorkUnitInfoMutation) FieldCleared

func (m *WorkUnitInfoMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*WorkUnitInfoMutation) Fields

func (m *WorkUnitInfoMutation) 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 (*WorkUnitInfoMutation) GetType

func (m *WorkUnitInfoMutation) GetType() (r workunitinfo.Type, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*WorkUnitInfoMutation) ID

func (m *WorkUnitInfoMutation) ID() (id uuid.UUID, 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 (*WorkUnitInfoMutation) 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 (*WorkUnitInfoMutation) ImageURL

func (m *WorkUnitInfoMutation) ImageURL() (r string, exists bool)

ImageURL returns the value of the "image_url" field in the mutation.

func (*WorkUnitInfoMutation) ImageURLCleared

func (m *WorkUnitInfoMutation) ImageURLCleared() bool

ImageURLCleared returns if the "image_url" field was cleared in this mutation.

func (*WorkUnitInfoMutation) Name

func (m *WorkUnitInfoMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*WorkUnitInfoMutation) OldAddressID

func (m *WorkUnitInfoMutation) OldAddressID(ctx context.Context) (v *uuid.UUID, err error)

OldAddressID returns the old "address_id" field's value of the WorkUnitInfo entity. If the WorkUnitInfo 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 (*WorkUnitInfoMutation) OldCreatedAt

func (m *WorkUnitInfoMutation) OldCreatedAt(ctx context.Context) (v *time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the WorkUnitInfo entity. If the WorkUnitInfo 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 (*WorkUnitInfoMutation) OldField

func (m *WorkUnitInfoMutation) 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 (*WorkUnitInfoMutation) OldImageURL

func (m *WorkUnitInfoMutation) OldImageURL(ctx context.Context) (v *string, err error)

OldImageURL returns the old "image_url" field's value of the WorkUnitInfo entity. If the WorkUnitInfo 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 (*WorkUnitInfoMutation) OldName

func (m *WorkUnitInfoMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the WorkUnitInfo entity. If the WorkUnitInfo 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 (*WorkUnitInfoMutation) OldType

func (m *WorkUnitInfoMutation) OldType(ctx context.Context) (v *workunitinfo.Type, err error)

OldType returns the old "type" field's value of the WorkUnitInfo entity. If the WorkUnitInfo 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 (*WorkUnitInfoMutation) OldUpdatedAt

func (m *WorkUnitInfoMutation) OldUpdatedAt(ctx context.Context) (v *time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the WorkUnitInfo entity. If the WorkUnitInfo 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 (*WorkUnitInfoMutation) Op

func (m *WorkUnitInfoMutation) Op() Op

Op returns the operation name.

func (*WorkUnitInfoMutation) RemovedEdges

func (m *WorkUnitInfoMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*WorkUnitInfoMutation) RemovedIDs

func (m *WorkUnitInfoMutation) 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 (*WorkUnitInfoMutation) ResetAddress

func (m *WorkUnitInfoMutation) ResetAddress()

ResetAddress resets all changes to the "address" edge.

func (*WorkUnitInfoMutation) ResetAddressID

func (m *WorkUnitInfoMutation) ResetAddressID()

ResetAddressID resets all changes to the "address_id" field.

func (*WorkUnitInfoMutation) ResetCreatedAt

func (m *WorkUnitInfoMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*WorkUnitInfoMutation) ResetEdge

func (m *WorkUnitInfoMutation) 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 (*WorkUnitInfoMutation) ResetField

func (m *WorkUnitInfoMutation) 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 (*WorkUnitInfoMutation) ResetImageURL

func (m *WorkUnitInfoMutation) ResetImageURL()

ResetImageURL resets all changes to the "image_url" field.

func (*WorkUnitInfoMutation) ResetName

func (m *WorkUnitInfoMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*WorkUnitInfoMutation) ResetType

func (m *WorkUnitInfoMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*WorkUnitInfoMutation) ResetUpdatedAt

func (m *WorkUnitInfoMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*WorkUnitInfoMutation) SetAddressID

func (m *WorkUnitInfoMutation) SetAddressID(u uuid.UUID)

SetAddressID sets the "address_id" field.

func (*WorkUnitInfoMutation) SetCreatedAt

func (m *WorkUnitInfoMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*WorkUnitInfoMutation) SetField

func (m *WorkUnitInfoMutation) 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 (*WorkUnitInfoMutation) SetID

func (m *WorkUnitInfoMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of WorkUnitInfo entities.

func (*WorkUnitInfoMutation) SetImageURL

func (m *WorkUnitInfoMutation) SetImageURL(s string)

SetImageURL sets the "image_url" field.

func (*WorkUnitInfoMutation) SetName

func (m *WorkUnitInfoMutation) SetName(s string)

SetName sets the "name" field.

func (*WorkUnitInfoMutation) SetOp

func (m *WorkUnitInfoMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*WorkUnitInfoMutation) SetType

func (m *WorkUnitInfoMutation) SetType(w workunitinfo.Type)

SetType sets the "type" field.

func (*WorkUnitInfoMutation) SetUpdatedAt

func (m *WorkUnitInfoMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (WorkUnitInfoMutation) Tx

func (m WorkUnitInfoMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*WorkUnitInfoMutation) Type

func (m *WorkUnitInfoMutation) Type() string

Type returns the node type of this mutation (WorkUnitInfo).

func (*WorkUnitInfoMutation) UpdatedAt

func (m *WorkUnitInfoMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*WorkUnitInfoMutation) Where

Where appends a list predicates to the WorkUnitInfoMutation builder.

func (*WorkUnitInfoMutation) WhereP

func (m *WorkUnitInfoMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the WorkUnitInfoMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type WorkUnitInfoQuery

type WorkUnitInfoQuery struct {
	// contains filtered or unexported fields
}

WorkUnitInfoQuery is the builder for querying WorkUnitInfo entities.

func (*WorkUnitInfoQuery) Aggregate

func (wuiq *WorkUnitInfoQuery) Aggregate(fns ...AggregateFunc) *WorkUnitInfoSelect

Aggregate returns a WorkUnitInfoSelect configured with the given aggregations.

func (*WorkUnitInfoQuery) All

func (wuiq *WorkUnitInfoQuery) All(ctx context.Context) ([]*WorkUnitInfo, error)

All executes the query and returns a list of WorkUnitInfos.

func (*WorkUnitInfoQuery) AllX

func (wuiq *WorkUnitInfoQuery) AllX(ctx context.Context) []*WorkUnitInfo

AllX is like All, but panics if an error occurs.

func (*WorkUnitInfoQuery) Clone

func (wuiq *WorkUnitInfoQuery) Clone() *WorkUnitInfoQuery

Clone returns a duplicate of the WorkUnitInfoQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*WorkUnitInfoQuery) Count

func (wuiq *WorkUnitInfoQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*WorkUnitInfoQuery) CountX

func (wuiq *WorkUnitInfoQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*WorkUnitInfoQuery) Exist

func (wuiq *WorkUnitInfoQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*WorkUnitInfoQuery) ExistX

func (wuiq *WorkUnitInfoQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*WorkUnitInfoQuery) First

func (wuiq *WorkUnitInfoQuery) First(ctx context.Context) (*WorkUnitInfo, error)

First returns the first WorkUnitInfo entity from the query. Returns a *NotFoundError when no WorkUnitInfo was found.

func (*WorkUnitInfoQuery) FirstID

func (wuiq *WorkUnitInfoQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first WorkUnitInfo ID from the query. Returns a *NotFoundError when no WorkUnitInfo ID was found.

func (*WorkUnitInfoQuery) FirstIDX

func (wuiq *WorkUnitInfoQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*WorkUnitInfoQuery) FirstX

func (wuiq *WorkUnitInfoQuery) FirstX(ctx context.Context) *WorkUnitInfo

FirstX is like First, but panics if an error occurs.

func (*WorkUnitInfoQuery) GroupBy

func (wuiq *WorkUnitInfoQuery) GroupBy(field string, fields ...string) *WorkUnitInfoGroupBy

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.WorkUnitInfo.Query().
	GroupBy(workunitinfo.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*WorkUnitInfoQuery) IDs

func (wuiq *WorkUnitInfoQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of WorkUnitInfo IDs.

func (*WorkUnitInfoQuery) IDsX

func (wuiq *WorkUnitInfoQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*WorkUnitInfoQuery) Limit

func (wuiq *WorkUnitInfoQuery) Limit(limit int) *WorkUnitInfoQuery

Limit the number of records to be returned by this query.

func (*WorkUnitInfoQuery) Offset

func (wuiq *WorkUnitInfoQuery) Offset(offset int) *WorkUnitInfoQuery

Offset to start from.

func (*WorkUnitInfoQuery) Only

func (wuiq *WorkUnitInfoQuery) Only(ctx context.Context) (*WorkUnitInfo, error)

Only returns a single WorkUnitInfo entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one WorkUnitInfo entity is found. Returns a *NotFoundError when no WorkUnitInfo entities are found.

func (*WorkUnitInfoQuery) OnlyID

func (wuiq *WorkUnitInfoQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only WorkUnitInfo ID in the query. Returns a *NotSingularError when more than one WorkUnitInfo ID is found. Returns a *NotFoundError when no entities are found.

func (*WorkUnitInfoQuery) OnlyIDX

func (wuiq *WorkUnitInfoQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*WorkUnitInfoQuery) OnlyX

func (wuiq *WorkUnitInfoQuery) OnlyX(ctx context.Context) *WorkUnitInfo

OnlyX is like Only, but panics if an error occurs.

func (*WorkUnitInfoQuery) Order

Order specifies how the records should be ordered.

func (*WorkUnitInfoQuery) QueryAddress

func (wuiq *WorkUnitInfoQuery) QueryAddress() *AddressQuery

QueryAddress chains the current query on the "address" edge.

func (*WorkUnitInfoQuery) Select

func (wuiq *WorkUnitInfoQuery) Select(fields ...string) *WorkUnitInfoSelect

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.WorkUnitInfo.Query().
	Select(workunitinfo.FieldCreatedAt).
	Scan(ctx, &v)

func (*WorkUnitInfoQuery) Unique

func (wuiq *WorkUnitInfoQuery) Unique(unique bool) *WorkUnitInfoQuery

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 (*WorkUnitInfoQuery) Where

Where adds a new predicate for the WorkUnitInfoQuery builder.

func (*WorkUnitInfoQuery) WithAddress

func (wuiq *WorkUnitInfoQuery) WithAddress(opts ...func(*AddressQuery)) *WorkUnitInfoQuery

WithAddress tells the query-builder to eager-load the nodes that are connected to the "address" edge. The optional arguments are used to configure the query builder of the edge.

type WorkUnitInfoSelect

type WorkUnitInfoSelect struct {
	*WorkUnitInfoQuery
	// contains filtered or unexported fields
}

WorkUnitInfoSelect is the builder for selecting fields of WorkUnitInfo entities.

func (*WorkUnitInfoSelect) Aggregate

func (wuis *WorkUnitInfoSelect) Aggregate(fns ...AggregateFunc) *WorkUnitInfoSelect

Aggregate adds the given aggregation functions to the selector query.

func (*WorkUnitInfoSelect) Bool

func (s *WorkUnitInfoSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*WorkUnitInfoSelect) BoolX

func (s *WorkUnitInfoSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*WorkUnitInfoSelect) Bools

func (s *WorkUnitInfoSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*WorkUnitInfoSelect) BoolsX

func (s *WorkUnitInfoSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*WorkUnitInfoSelect) Float64

func (s *WorkUnitInfoSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*WorkUnitInfoSelect) Float64X

func (s *WorkUnitInfoSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*WorkUnitInfoSelect) Float64s

func (s *WorkUnitInfoSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*WorkUnitInfoSelect) Float64sX

func (s *WorkUnitInfoSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*WorkUnitInfoSelect) Int

func (s *WorkUnitInfoSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*WorkUnitInfoSelect) IntX

func (s *WorkUnitInfoSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*WorkUnitInfoSelect) Ints

func (s *WorkUnitInfoSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*WorkUnitInfoSelect) IntsX

func (s *WorkUnitInfoSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*WorkUnitInfoSelect) Scan

func (wuis *WorkUnitInfoSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*WorkUnitInfoSelect) ScanX

func (s *WorkUnitInfoSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*WorkUnitInfoSelect) String

func (s *WorkUnitInfoSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*WorkUnitInfoSelect) StringX

func (s *WorkUnitInfoSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*WorkUnitInfoSelect) Strings

func (s *WorkUnitInfoSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*WorkUnitInfoSelect) StringsX

func (s *WorkUnitInfoSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type WorkUnitInfoUpdate

type WorkUnitInfoUpdate struct {
	// contains filtered or unexported fields
}

WorkUnitInfoUpdate is the builder for updating WorkUnitInfo entities.

func (*WorkUnitInfoUpdate) ClearAddress

func (wuiu *WorkUnitInfoUpdate) ClearAddress() *WorkUnitInfoUpdate

ClearAddress clears the "address" edge to the Address entity.

func (*WorkUnitInfoUpdate) ClearAddressID

func (wuiu *WorkUnitInfoUpdate) ClearAddressID() *WorkUnitInfoUpdate

ClearAddressID clears the value of the "address_id" field.

func (*WorkUnitInfoUpdate) ClearImageURL

func (wuiu *WorkUnitInfoUpdate) ClearImageURL() *WorkUnitInfoUpdate

ClearImageURL clears the value of the "image_url" field.

func (*WorkUnitInfoUpdate) Exec

func (wuiu *WorkUnitInfoUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*WorkUnitInfoUpdate) ExecX

func (wuiu *WorkUnitInfoUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WorkUnitInfoUpdate) Mutation

func (wuiu *WorkUnitInfoUpdate) Mutation() *WorkUnitInfoMutation

Mutation returns the WorkUnitInfoMutation object of the builder.

func (*WorkUnitInfoUpdate) Save

func (wuiu *WorkUnitInfoUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*WorkUnitInfoUpdate) SaveX

func (wuiu *WorkUnitInfoUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*WorkUnitInfoUpdate) SetAddress

func (wuiu *WorkUnitInfoUpdate) SetAddress(a *Address) *WorkUnitInfoUpdate

SetAddress sets the "address" edge to the Address entity.

func (*WorkUnitInfoUpdate) SetAddressID

func (wuiu *WorkUnitInfoUpdate) SetAddressID(u uuid.UUID) *WorkUnitInfoUpdate

SetAddressID sets the "address_id" field.

func (*WorkUnitInfoUpdate) SetImageURL

func (wuiu *WorkUnitInfoUpdate) SetImageURL(s string) *WorkUnitInfoUpdate

SetImageURL sets the "image_url" field.

func (*WorkUnitInfoUpdate) SetName

func (wuiu *WorkUnitInfoUpdate) SetName(s string) *WorkUnitInfoUpdate

SetName sets the "name" field.

func (*WorkUnitInfoUpdate) SetNillableAddressID

func (wuiu *WorkUnitInfoUpdate) SetNillableAddressID(u *uuid.UUID) *WorkUnitInfoUpdate

SetNillableAddressID sets the "address_id" field if the given value is not nil.

func (*WorkUnitInfoUpdate) SetNillableImageURL

func (wuiu *WorkUnitInfoUpdate) SetNillableImageURL(s *string) *WorkUnitInfoUpdate

SetNillableImageURL sets the "image_url" field if the given value is not nil.

func (*WorkUnitInfoUpdate) SetNillableName

func (wuiu *WorkUnitInfoUpdate) SetNillableName(s *string) *WorkUnitInfoUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*WorkUnitInfoUpdate) SetNillableType

func (wuiu *WorkUnitInfoUpdate) SetNillableType(w *workunitinfo.Type) *WorkUnitInfoUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*WorkUnitInfoUpdate) SetType

SetType sets the "type" field.

func (*WorkUnitInfoUpdate) SetUpdatedAt

func (wuiu *WorkUnitInfoUpdate) SetUpdatedAt(t time.Time) *WorkUnitInfoUpdate

SetUpdatedAt sets the "updated_at" field.

func (*WorkUnitInfoUpdate) Where

Where appends a list predicates to the WorkUnitInfoUpdate builder.

type WorkUnitInfoUpdateOne

type WorkUnitInfoUpdateOne struct {
	// contains filtered or unexported fields
}

WorkUnitInfoUpdateOne is the builder for updating a single WorkUnitInfo entity.

func (*WorkUnitInfoUpdateOne) ClearAddress

func (wuiuo *WorkUnitInfoUpdateOne) ClearAddress() *WorkUnitInfoUpdateOne

ClearAddress clears the "address" edge to the Address entity.

func (*WorkUnitInfoUpdateOne) ClearAddressID

func (wuiuo *WorkUnitInfoUpdateOne) ClearAddressID() *WorkUnitInfoUpdateOne

ClearAddressID clears the value of the "address_id" field.

func (*WorkUnitInfoUpdateOne) ClearImageURL

func (wuiuo *WorkUnitInfoUpdateOne) ClearImageURL() *WorkUnitInfoUpdateOne

ClearImageURL clears the value of the "image_url" field.

func (*WorkUnitInfoUpdateOne) Exec

func (wuiuo *WorkUnitInfoUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*WorkUnitInfoUpdateOne) ExecX

func (wuiuo *WorkUnitInfoUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WorkUnitInfoUpdateOne) Mutation

func (wuiuo *WorkUnitInfoUpdateOne) Mutation() *WorkUnitInfoMutation

Mutation returns the WorkUnitInfoMutation object of the builder.

func (*WorkUnitInfoUpdateOne) Save

Save executes the query and returns the updated WorkUnitInfo entity.

func (*WorkUnitInfoUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*WorkUnitInfoUpdateOne) Select

func (wuiuo *WorkUnitInfoUpdateOne) Select(field string, fields ...string) *WorkUnitInfoUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*WorkUnitInfoUpdateOne) SetAddress

func (wuiuo *WorkUnitInfoUpdateOne) SetAddress(a *Address) *WorkUnitInfoUpdateOne

SetAddress sets the "address" edge to the Address entity.

func (*WorkUnitInfoUpdateOne) SetAddressID

func (wuiuo *WorkUnitInfoUpdateOne) SetAddressID(u uuid.UUID) *WorkUnitInfoUpdateOne

SetAddressID sets the "address_id" field.

func (*WorkUnitInfoUpdateOne) SetImageURL

func (wuiuo *WorkUnitInfoUpdateOne) SetImageURL(s string) *WorkUnitInfoUpdateOne

SetImageURL sets the "image_url" field.

func (*WorkUnitInfoUpdateOne) SetName

SetName sets the "name" field.

func (*WorkUnitInfoUpdateOne) SetNillableAddressID

func (wuiuo *WorkUnitInfoUpdateOne) SetNillableAddressID(u *uuid.UUID) *WorkUnitInfoUpdateOne

SetNillableAddressID sets the "address_id" field if the given value is not nil.

func (*WorkUnitInfoUpdateOne) SetNillableImageURL

func (wuiuo *WorkUnitInfoUpdateOne) SetNillableImageURL(s *string) *WorkUnitInfoUpdateOne

SetNillableImageURL sets the "image_url" field if the given value is not nil.

func (*WorkUnitInfoUpdateOne) SetNillableName

func (wuiuo *WorkUnitInfoUpdateOne) SetNillableName(s *string) *WorkUnitInfoUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*WorkUnitInfoUpdateOne) SetNillableType

func (wuiuo *WorkUnitInfoUpdateOne) SetNillableType(w *workunitinfo.Type) *WorkUnitInfoUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*WorkUnitInfoUpdateOne) SetType

SetType sets the "type" field.

func (*WorkUnitInfoUpdateOne) SetUpdatedAt

func (wuiuo *WorkUnitInfoUpdateOne) SetUpdatedAt(t time.Time) *WorkUnitInfoUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*WorkUnitInfoUpdateOne) Where

Where appends a list predicates to the WorkUnitInfoUpdate builder.

type WorkUnitInfos

type WorkUnitInfos []*WorkUnitInfo

WorkUnitInfos is a parsable slice of WorkUnitInfo.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL