ent

package
v0.0.0-...-fa32389 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: MIT Imports: 26 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.
	TypeBalance     = "Balance"
	TypeBid         = "Bid"
	TypeInvestor    = "Investor"
	TypeInvoice     = "Invoice"
	TypeInvoiceItem = "InvoiceItem"
	TypeIssuer      = "Issuer"
	TypeLedger      = "Ledger"
)

Variables

This section is empty.

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Balance

type Balance struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// TotalAmount holds the value of the "total_amount" field.
	TotalAmount float64 `json:"total_amount,omitempty"`
	// AvailableAmount holds the value of the "available_amount" field.
	AvailableAmount float64 `json:"available_amount,omitempty"`
	// EntityID holds the value of the "entity_id" field.
	EntityID uuid.UUID `json:"entity_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"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the BalanceQuery when eager-loading is set.
	Edges BalanceEdges `json:"edges"`
	// contains filtered or unexported fields
}

Balance is the model entity for the Balance schema.

func (*Balance) QueryInvestor

func (b *Balance) QueryInvestor() *InvestorQuery

QueryInvestor queries the "investor" edge of the Balance entity.

func (*Balance) QueryIssuer

func (b *Balance) QueryIssuer() *IssuerQuery

QueryIssuer queries the "issuer" edge of the Balance entity.

func (*Balance) String

func (b *Balance) String() string

String implements the fmt.Stringer.

func (*Balance) Unwrap

func (b *Balance) Unwrap() *Balance

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

func (b *Balance) Update() *BalanceUpdateOne

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

func (*Balance) Value

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

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

type BalanceClient

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

BalanceClient is a client for the Balance schema.

func NewBalanceClient

func NewBalanceClient(c config) *BalanceClient

NewBalanceClient returns a client for the Balance from the given config.

func (*BalanceClient) Create

func (c *BalanceClient) Create() *BalanceCreate

Create returns a builder for creating a Balance entity.

func (*BalanceClient) CreateBulk

func (c *BalanceClient) CreateBulk(builders ...*BalanceCreate) *BalanceCreateBulk

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

func (*BalanceClient) Delete

func (c *BalanceClient) Delete() *BalanceDelete

Delete returns a delete builder for Balance.

func (*BalanceClient) DeleteOne

func (c *BalanceClient) DeleteOne(b *Balance) *BalanceDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*BalanceClient) DeleteOneID

func (c *BalanceClient) DeleteOneID(id uuid.UUID) *BalanceDeleteOne

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

func (*BalanceClient) Get

func (c *BalanceClient) Get(ctx context.Context, id uuid.UUID) (*Balance, error)

Get returns a Balance entity by its id.

func (*BalanceClient) GetX

func (c *BalanceClient) GetX(ctx context.Context, id uuid.UUID) *Balance

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

func (*BalanceClient) Hooks

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

Hooks returns the client hooks.

func (*BalanceClient) Intercept

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

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

func (*BalanceClient) Interceptors

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

Interceptors returns the client interceptors.

func (*BalanceClient) Query

func (c *BalanceClient) Query() *BalanceQuery

Query returns a query builder for Balance.

func (*BalanceClient) QueryInvestor

func (c *BalanceClient) QueryInvestor(b *Balance) *InvestorQuery

QueryInvestor queries the investor edge of a Balance.

func (*BalanceClient) QueryIssuer

func (c *BalanceClient) QueryIssuer(b *Balance) *IssuerQuery

QueryIssuer queries the issuer edge of a Balance.

func (*BalanceClient) Update

func (c *BalanceClient) Update() *BalanceUpdate

Update returns an update builder for Balance.

func (*BalanceClient) UpdateOne

func (c *BalanceClient) UpdateOne(b *Balance) *BalanceUpdateOne

UpdateOne returns an update builder for the given entity.

func (*BalanceClient) UpdateOneID

func (c *BalanceClient) UpdateOneID(id uuid.UUID) *BalanceUpdateOne

UpdateOneID returns an update builder for the given id.

func (*BalanceClient) Use

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

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

type BalanceCreate

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

BalanceCreate is the builder for creating a Balance entity.

func (*BalanceCreate) AddInvestor

func (bc *BalanceCreate) AddInvestor(i ...*Investor) *BalanceCreate

AddInvestor adds the "investor" edges to the Investor entity.

func (*BalanceCreate) AddInvestorIDs

func (bc *BalanceCreate) AddInvestorIDs(ids ...uuid.UUID) *BalanceCreate

AddInvestorIDs adds the "investor" edge to the Investor entity by IDs.

func (*BalanceCreate) AddIssuer

func (bc *BalanceCreate) AddIssuer(i ...*Issuer) *BalanceCreate

AddIssuer adds the "issuer" edges to the Issuer entity.

func (*BalanceCreate) AddIssuerIDs

func (bc *BalanceCreate) AddIssuerIDs(ids ...uuid.UUID) *BalanceCreate

AddIssuerIDs adds the "issuer" edge to the Issuer entity by IDs.

func (*BalanceCreate) Exec

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

Exec executes the query.

func (*BalanceCreate) ExecX

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

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

func (*BalanceCreate) Mutation

func (bc *BalanceCreate) Mutation() *BalanceMutation

Mutation returns the BalanceMutation object of the builder.

func (*BalanceCreate) Save

func (bc *BalanceCreate) Save(ctx context.Context) (*Balance, error)

Save creates the Balance in the database.

func (*BalanceCreate) SaveX

func (bc *BalanceCreate) SaveX(ctx context.Context) *Balance

SaveX calls Save and panics if Save returns an error.

func (*BalanceCreate) SetAvailableAmount

func (bc *BalanceCreate) SetAvailableAmount(f float64) *BalanceCreate

SetAvailableAmount sets the "available_amount" field.

func (*BalanceCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*BalanceCreate) SetEntityID

func (bc *BalanceCreate) SetEntityID(u uuid.UUID) *BalanceCreate

SetEntityID sets the "entity_id" field.

func (*BalanceCreate) SetID

func (bc *BalanceCreate) SetID(u uuid.UUID) *BalanceCreate

SetID sets the "id" field.

func (*BalanceCreate) SetNillableCreatedAt

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

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

func (*BalanceCreate) SetNillableID

func (bc *BalanceCreate) SetNillableID(u *uuid.UUID) *BalanceCreate

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

func (*BalanceCreate) SetNillableUpdatedAt

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

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

func (*BalanceCreate) SetTotalAmount

func (bc *BalanceCreate) SetTotalAmount(f float64) *BalanceCreate

SetTotalAmount sets the "total_amount" field.

func (*BalanceCreate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

type BalanceCreateBulk

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

BalanceCreateBulk is the builder for creating many Balance entities in bulk.

func (*BalanceCreateBulk) Exec

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

Exec executes the query.

func (*BalanceCreateBulk) ExecX

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

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

func (*BalanceCreateBulk) Save

func (bcb *BalanceCreateBulk) Save(ctx context.Context) ([]*Balance, error)

Save creates the Balance entities in the database.

func (*BalanceCreateBulk) SaveX

func (bcb *BalanceCreateBulk) SaveX(ctx context.Context) []*Balance

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

type BalanceDelete

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

BalanceDelete is the builder for deleting a Balance entity.

func (*BalanceDelete) Exec

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

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

func (*BalanceDelete) ExecX

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

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

func (*BalanceDelete) Where

func (bd *BalanceDelete) Where(ps ...predicate.Balance) *BalanceDelete

Where appends a list predicates to the BalanceDelete builder.

type BalanceDeleteOne

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

BalanceDeleteOne is the builder for deleting a single Balance entity.

func (*BalanceDeleteOne) Exec

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

Exec executes the deletion query.

func (*BalanceDeleteOne) ExecX

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

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

func (*BalanceDeleteOne) Where

Where appends a list predicates to the BalanceDelete builder.

type BalanceEdges

type BalanceEdges struct {
	// Investor holds the value of the investor edge.
	Investor []*Investor `json:"investor,omitempty"`
	// Issuer holds the value of the issuer edge.
	Issuer []*Issuer `json:"issuer,omitempty"`
	// contains filtered or unexported fields
}

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

func (BalanceEdges) InvestorOrErr

func (e BalanceEdges) InvestorOrErr() ([]*Investor, error)

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

func (BalanceEdges) IssuerOrErr

func (e BalanceEdges) IssuerOrErr() ([]*Issuer, error)

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

type BalanceGroupBy

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

BalanceGroupBy is the group-by builder for Balance entities.

func (*BalanceGroupBy) Aggregate

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

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

func (*BalanceGroupBy) Bool

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

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

func (*BalanceGroupBy) BoolX

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

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

func (*BalanceGroupBy) Bools

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

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

func (*BalanceGroupBy) BoolsX

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

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

func (*BalanceGroupBy) Float64

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

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

func (*BalanceGroupBy) Float64X

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

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

func (*BalanceGroupBy) Float64s

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

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

func (*BalanceGroupBy) Float64sX

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

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

func (*BalanceGroupBy) Int

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

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

func (*BalanceGroupBy) IntX

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

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

func (*BalanceGroupBy) Ints

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

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

func (*BalanceGroupBy) IntsX

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

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

func (*BalanceGroupBy) Scan

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

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

func (*BalanceGroupBy) ScanX

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

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

func (*BalanceGroupBy) String

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

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

func (*BalanceGroupBy) StringX

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

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

func (*BalanceGroupBy) Strings

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

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

func (*BalanceGroupBy) StringsX

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

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

type BalanceMutation

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

BalanceMutation represents an operation that mutates the Balance nodes in the graph.

func (*BalanceMutation) AddAvailableAmount

func (m *BalanceMutation) AddAvailableAmount(f float64)

AddAvailableAmount adds f to the "available_amount" field.

func (*BalanceMutation) AddField

func (m *BalanceMutation) 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 (*BalanceMutation) AddInvestorIDs

func (m *BalanceMutation) AddInvestorIDs(ids ...uuid.UUID)

AddInvestorIDs adds the "investor" edge to the Investor entity by ids.

func (*BalanceMutation) AddIssuerIDs

func (m *BalanceMutation) AddIssuerIDs(ids ...uuid.UUID)

AddIssuerIDs adds the "issuer" edge to the Issuer entity by ids.

func (*BalanceMutation) AddTotalAmount

func (m *BalanceMutation) AddTotalAmount(f float64)

AddTotalAmount adds f to the "total_amount" field.

func (*BalanceMutation) AddedAvailableAmount

func (m *BalanceMutation) AddedAvailableAmount() (r float64, exists bool)

AddedAvailableAmount returns the value that was added to the "available_amount" field in this mutation.

func (*BalanceMutation) AddedEdges

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

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

func (*BalanceMutation) AddedField

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

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

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

func (*BalanceMutation) AddedIDs

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

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

func (*BalanceMutation) AddedTotalAmount

func (m *BalanceMutation) AddedTotalAmount() (r float64, exists bool)

AddedTotalAmount returns the value that was added to the "total_amount" field in this mutation.

func (*BalanceMutation) AvailableAmount

func (m *BalanceMutation) AvailableAmount() (r float64, exists bool)

AvailableAmount returns the value of the "available_amount" field in the mutation.

func (*BalanceMutation) ClearEdge

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

func (m *BalanceMutation) 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 (*BalanceMutation) ClearInvestor

func (m *BalanceMutation) ClearInvestor()

ClearInvestor clears the "investor" edge to the Investor entity.

func (*BalanceMutation) ClearIssuer

func (m *BalanceMutation) ClearIssuer()

ClearIssuer clears the "issuer" edge to the Issuer entity.

func (*BalanceMutation) ClearedEdges

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

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

func (*BalanceMutation) ClearedFields

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

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

func (BalanceMutation) Client

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

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

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

func (*BalanceMutation) EdgeCleared

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

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

func (*BalanceMutation) EntityID

func (m *BalanceMutation) EntityID() (r uuid.UUID, exists bool)

EntityID returns the value of the "entity_id" field in the mutation.

func (*BalanceMutation) Field

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

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

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

func (*BalanceMutation) Fields

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

func (m *BalanceMutation) 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 (*BalanceMutation) IDs

func (m *BalanceMutation) 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 (*BalanceMutation) InvestorCleared

func (m *BalanceMutation) InvestorCleared() bool

InvestorCleared reports if the "investor" edge to the Investor entity was cleared.

func (*BalanceMutation) InvestorIDs

func (m *BalanceMutation) InvestorIDs() (ids []uuid.UUID)

InvestorIDs returns the "investor" edge IDs in the mutation.

func (*BalanceMutation) IssuerCleared

func (m *BalanceMutation) IssuerCleared() bool

IssuerCleared reports if the "issuer" edge to the Issuer entity was cleared.

func (*BalanceMutation) IssuerIDs

func (m *BalanceMutation) IssuerIDs() (ids []uuid.UUID)

IssuerIDs returns the "issuer" edge IDs in the mutation.

func (*BalanceMutation) OldAvailableAmount

func (m *BalanceMutation) OldAvailableAmount(ctx context.Context) (v float64, err error)

OldAvailableAmount returns the old "available_amount" field's value of the Balance entity. If the Balance 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 (*BalanceMutation) OldCreatedAt

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

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

func (m *BalanceMutation) OldEntityID(ctx context.Context) (v uuid.UUID, err error)

OldEntityID returns the old "entity_id" field's value of the Balance entity. If the Balance 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 (*BalanceMutation) OldField

func (m *BalanceMutation) 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 (*BalanceMutation) OldTotalAmount

func (m *BalanceMutation) OldTotalAmount(ctx context.Context) (v float64, err error)

OldTotalAmount returns the old "total_amount" field's value of the Balance entity. If the Balance 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 (*BalanceMutation) OldUpdatedAt

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

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

func (m *BalanceMutation) Op() Op

Op returns the operation name.

func (*BalanceMutation) RemoveInvestorIDs

func (m *BalanceMutation) RemoveInvestorIDs(ids ...uuid.UUID)

RemoveInvestorIDs removes the "investor" edge to the Investor entity by IDs.

func (*BalanceMutation) RemoveIssuerIDs

func (m *BalanceMutation) RemoveIssuerIDs(ids ...uuid.UUID)

RemoveIssuerIDs removes the "issuer" edge to the Issuer entity by IDs.

func (*BalanceMutation) RemovedEdges

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

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

func (*BalanceMutation) RemovedIDs

func (m *BalanceMutation) 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 (*BalanceMutation) RemovedInvestorIDs

func (m *BalanceMutation) RemovedInvestorIDs() (ids []uuid.UUID)

RemovedInvestor returns the removed IDs of the "investor" edge to the Investor entity.

func (*BalanceMutation) RemovedIssuerIDs

func (m *BalanceMutation) RemovedIssuerIDs() (ids []uuid.UUID)

RemovedIssuer returns the removed IDs of the "issuer" edge to the Issuer entity.

func (*BalanceMutation) ResetAvailableAmount

func (m *BalanceMutation) ResetAvailableAmount()

ResetAvailableAmount resets all changes to the "available_amount" field.

func (*BalanceMutation) ResetCreatedAt

func (m *BalanceMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*BalanceMutation) ResetEdge

func (m *BalanceMutation) 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 (*BalanceMutation) ResetEntityID

func (m *BalanceMutation) ResetEntityID()

ResetEntityID resets all changes to the "entity_id" field.

func (*BalanceMutation) ResetField

func (m *BalanceMutation) 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 (*BalanceMutation) ResetInvestor

func (m *BalanceMutation) ResetInvestor()

ResetInvestor resets all changes to the "investor" edge.

func (*BalanceMutation) ResetIssuer

func (m *BalanceMutation) ResetIssuer()

ResetIssuer resets all changes to the "issuer" edge.

func (*BalanceMutation) ResetTotalAmount

func (m *BalanceMutation) ResetTotalAmount()

ResetTotalAmount resets all changes to the "total_amount" field.

func (*BalanceMutation) ResetUpdatedAt

func (m *BalanceMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*BalanceMutation) SetAvailableAmount

func (m *BalanceMutation) SetAvailableAmount(f float64)

SetAvailableAmount sets the "available_amount" field.

func (*BalanceMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*BalanceMutation) SetEntityID

func (m *BalanceMutation) SetEntityID(u uuid.UUID)

SetEntityID sets the "entity_id" field.

func (*BalanceMutation) SetField

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

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

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

func (*BalanceMutation) SetOp

func (m *BalanceMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*BalanceMutation) SetTotalAmount

func (m *BalanceMutation) SetTotalAmount(f float64)

SetTotalAmount sets the "total_amount" field.

func (*BalanceMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*BalanceMutation) TotalAmount

func (m *BalanceMutation) TotalAmount() (r float64, exists bool)

TotalAmount returns the value of the "total_amount" field in the mutation.

func (BalanceMutation) Tx

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

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

func (*BalanceMutation) Type

func (m *BalanceMutation) Type() string

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

func (*BalanceMutation) UpdatedAt

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

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

func (*BalanceMutation) Where

func (m *BalanceMutation) Where(ps ...predicate.Balance)

Where appends a list predicates to the BalanceMutation builder.

func (*BalanceMutation) WhereP

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

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

type BalanceQuery

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

BalanceQuery is the builder for querying Balance entities.

func (*BalanceQuery) Aggregate

func (bq *BalanceQuery) Aggregate(fns ...AggregateFunc) *BalanceSelect

Aggregate returns a BalanceSelect configured with the given aggregations.

func (*BalanceQuery) All

func (bq *BalanceQuery) All(ctx context.Context) ([]*Balance, error)

All executes the query and returns a list of Balances.

func (*BalanceQuery) AllX

func (bq *BalanceQuery) AllX(ctx context.Context) []*Balance

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

func (*BalanceQuery) Clone

func (bq *BalanceQuery) Clone() *BalanceQuery

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

func (*BalanceQuery) Count

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

Count returns the count of the given query.

func (*BalanceQuery) CountX

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

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

func (*BalanceQuery) Exist

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

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

func (*BalanceQuery) ExistX

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

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

func (*BalanceQuery) First

func (bq *BalanceQuery) First(ctx context.Context) (*Balance, error)

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

func (*BalanceQuery) FirstID

func (bq *BalanceQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*BalanceQuery) FirstIDX

func (bq *BalanceQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*BalanceQuery) FirstX

func (bq *BalanceQuery) FirstX(ctx context.Context) *Balance

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

func (*BalanceQuery) GroupBy

func (bq *BalanceQuery) GroupBy(field string, fields ...string) *BalanceGroupBy

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 {
	TotalAmount float64 `json:"total_amount,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Balance.Query().
	GroupBy(balance.FieldTotalAmount).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*BalanceQuery) IDs

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

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

func (*BalanceQuery) IDsX

func (bq *BalanceQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*BalanceQuery) Limit

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

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

func (*BalanceQuery) Offset

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

Offset to start from.

func (*BalanceQuery) Only

func (bq *BalanceQuery) Only(ctx context.Context) (*Balance, error)

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

func (*BalanceQuery) OnlyID

func (bq *BalanceQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*BalanceQuery) OnlyIDX

func (bq *BalanceQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*BalanceQuery) OnlyX

func (bq *BalanceQuery) OnlyX(ctx context.Context) *Balance

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

func (*BalanceQuery) Order

func (bq *BalanceQuery) Order(o ...balance.OrderOption) *BalanceQuery

Order specifies how the records should be ordered.

func (*BalanceQuery) QueryInvestor

func (bq *BalanceQuery) QueryInvestor() *InvestorQuery

QueryInvestor chains the current query on the "investor" edge.

func (*BalanceQuery) QueryIssuer

func (bq *BalanceQuery) QueryIssuer() *IssuerQuery

QueryIssuer chains the current query on the "issuer" edge.

func (*BalanceQuery) Select

func (bq *BalanceQuery) Select(fields ...string) *BalanceSelect

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 {
	TotalAmount float64 `json:"total_amount,omitempty"`
}

client.Balance.Query().
	Select(balance.FieldTotalAmount).
	Scan(ctx, &v)

func (*BalanceQuery) Unique

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

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

func (bq *BalanceQuery) Where(ps ...predicate.Balance) *BalanceQuery

Where adds a new predicate for the BalanceQuery builder.

func (*BalanceQuery) WithInvestor

func (bq *BalanceQuery) WithInvestor(opts ...func(*InvestorQuery)) *BalanceQuery

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

func (*BalanceQuery) WithIssuer

func (bq *BalanceQuery) WithIssuer(opts ...func(*IssuerQuery)) *BalanceQuery

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

type BalanceSelect

type BalanceSelect struct {
	*BalanceQuery
	// contains filtered or unexported fields
}

BalanceSelect is the builder for selecting fields of Balance entities.

func (*BalanceSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*BalanceSelect) Bool

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

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

func (*BalanceSelect) BoolX

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

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

func (*BalanceSelect) Bools

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

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

func (*BalanceSelect) BoolsX

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

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

func (*BalanceSelect) Float64

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

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

func (*BalanceSelect) Float64X

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

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

func (*BalanceSelect) Float64s

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

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

func (*BalanceSelect) Float64sX

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

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

func (*BalanceSelect) Int

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

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

func (*BalanceSelect) IntX

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

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

func (*BalanceSelect) Ints

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

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

func (*BalanceSelect) IntsX

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

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

func (*BalanceSelect) Scan

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

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

func (*BalanceSelect) ScanX

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

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

func (*BalanceSelect) String

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

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

func (*BalanceSelect) StringX

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

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

func (*BalanceSelect) Strings

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

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

func (*BalanceSelect) StringsX

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

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

type BalanceUpdate

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

BalanceUpdate is the builder for updating Balance entities.

func (*BalanceUpdate) AddAvailableAmount

func (bu *BalanceUpdate) AddAvailableAmount(f float64) *BalanceUpdate

AddAvailableAmount adds f to the "available_amount" field.

func (*BalanceUpdate) AddInvestor

func (bu *BalanceUpdate) AddInvestor(i ...*Investor) *BalanceUpdate

AddInvestor adds the "investor" edges to the Investor entity.

func (*BalanceUpdate) AddInvestorIDs

func (bu *BalanceUpdate) AddInvestorIDs(ids ...uuid.UUID) *BalanceUpdate

AddInvestorIDs adds the "investor" edge to the Investor entity by IDs.

func (*BalanceUpdate) AddIssuer

func (bu *BalanceUpdate) AddIssuer(i ...*Issuer) *BalanceUpdate

AddIssuer adds the "issuer" edges to the Issuer entity.

func (*BalanceUpdate) AddIssuerIDs

func (bu *BalanceUpdate) AddIssuerIDs(ids ...uuid.UUID) *BalanceUpdate

AddIssuerIDs adds the "issuer" edge to the Issuer entity by IDs.

func (*BalanceUpdate) AddTotalAmount

func (bu *BalanceUpdate) AddTotalAmount(f float64) *BalanceUpdate

AddTotalAmount adds f to the "total_amount" field.

func (*BalanceUpdate) ClearInvestor

func (bu *BalanceUpdate) ClearInvestor() *BalanceUpdate

ClearInvestor clears all "investor" edges to the Investor entity.

func (*BalanceUpdate) ClearIssuer

func (bu *BalanceUpdate) ClearIssuer() *BalanceUpdate

ClearIssuer clears all "issuer" edges to the Issuer entity.

func (*BalanceUpdate) Exec

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

Exec executes the query.

func (*BalanceUpdate) ExecX

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

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

func (*BalanceUpdate) Mutation

func (bu *BalanceUpdate) Mutation() *BalanceMutation

Mutation returns the BalanceMutation object of the builder.

func (*BalanceUpdate) RemoveInvestor

func (bu *BalanceUpdate) RemoveInvestor(i ...*Investor) *BalanceUpdate

RemoveInvestor removes "investor" edges to Investor entities.

func (*BalanceUpdate) RemoveInvestorIDs

func (bu *BalanceUpdate) RemoveInvestorIDs(ids ...uuid.UUID) *BalanceUpdate

RemoveInvestorIDs removes the "investor" edge to Investor entities by IDs.

func (*BalanceUpdate) RemoveIssuer

func (bu *BalanceUpdate) RemoveIssuer(i ...*Issuer) *BalanceUpdate

RemoveIssuer removes "issuer" edges to Issuer entities.

func (*BalanceUpdate) RemoveIssuerIDs

func (bu *BalanceUpdate) RemoveIssuerIDs(ids ...uuid.UUID) *BalanceUpdate

RemoveIssuerIDs removes the "issuer" edge to Issuer entities by IDs.

func (*BalanceUpdate) Save

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

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

func (*BalanceUpdate) SaveX

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

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

func (*BalanceUpdate) SetAvailableAmount

func (bu *BalanceUpdate) SetAvailableAmount(f float64) *BalanceUpdate

SetAvailableAmount sets the "available_amount" field.

func (*BalanceUpdate) SetTotalAmount

func (bu *BalanceUpdate) SetTotalAmount(f float64) *BalanceUpdate

SetTotalAmount sets the "total_amount" field.

func (*BalanceUpdate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*BalanceUpdate) Where

func (bu *BalanceUpdate) Where(ps ...predicate.Balance) *BalanceUpdate

Where appends a list predicates to the BalanceUpdate builder.

type BalanceUpdateOne

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

BalanceUpdateOne is the builder for updating a single Balance entity.

func (*BalanceUpdateOne) AddAvailableAmount

func (buo *BalanceUpdateOne) AddAvailableAmount(f float64) *BalanceUpdateOne

AddAvailableAmount adds f to the "available_amount" field.

func (*BalanceUpdateOne) AddInvestor

func (buo *BalanceUpdateOne) AddInvestor(i ...*Investor) *BalanceUpdateOne

AddInvestor adds the "investor" edges to the Investor entity.

func (*BalanceUpdateOne) AddInvestorIDs

func (buo *BalanceUpdateOne) AddInvestorIDs(ids ...uuid.UUID) *BalanceUpdateOne

AddInvestorIDs adds the "investor" edge to the Investor entity by IDs.

func (*BalanceUpdateOne) AddIssuer

func (buo *BalanceUpdateOne) AddIssuer(i ...*Issuer) *BalanceUpdateOne

AddIssuer adds the "issuer" edges to the Issuer entity.

func (*BalanceUpdateOne) AddIssuerIDs

func (buo *BalanceUpdateOne) AddIssuerIDs(ids ...uuid.UUID) *BalanceUpdateOne

AddIssuerIDs adds the "issuer" edge to the Issuer entity by IDs.

func (*BalanceUpdateOne) AddTotalAmount

func (buo *BalanceUpdateOne) AddTotalAmount(f float64) *BalanceUpdateOne

AddTotalAmount adds f to the "total_amount" field.

func (*BalanceUpdateOne) ClearInvestor

func (buo *BalanceUpdateOne) ClearInvestor() *BalanceUpdateOne

ClearInvestor clears all "investor" edges to the Investor entity.

func (*BalanceUpdateOne) ClearIssuer

func (buo *BalanceUpdateOne) ClearIssuer() *BalanceUpdateOne

ClearIssuer clears all "issuer" edges to the Issuer entity.

func (*BalanceUpdateOne) Exec

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

Exec executes the query on the entity.

func (*BalanceUpdateOne) ExecX

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

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

func (*BalanceUpdateOne) Mutation

func (buo *BalanceUpdateOne) Mutation() *BalanceMutation

Mutation returns the BalanceMutation object of the builder.

func (*BalanceUpdateOne) RemoveInvestor

func (buo *BalanceUpdateOne) RemoveInvestor(i ...*Investor) *BalanceUpdateOne

RemoveInvestor removes "investor" edges to Investor entities.

func (*BalanceUpdateOne) RemoveInvestorIDs

func (buo *BalanceUpdateOne) RemoveInvestorIDs(ids ...uuid.UUID) *BalanceUpdateOne

RemoveInvestorIDs removes the "investor" edge to Investor entities by IDs.

func (*BalanceUpdateOne) RemoveIssuer

func (buo *BalanceUpdateOne) RemoveIssuer(i ...*Issuer) *BalanceUpdateOne

RemoveIssuer removes "issuer" edges to Issuer entities.

func (*BalanceUpdateOne) RemoveIssuerIDs

func (buo *BalanceUpdateOne) RemoveIssuerIDs(ids ...uuid.UUID) *BalanceUpdateOne

RemoveIssuerIDs removes the "issuer" edge to Issuer entities by IDs.

func (*BalanceUpdateOne) Save

func (buo *BalanceUpdateOne) Save(ctx context.Context) (*Balance, error)

Save executes the query and returns the updated Balance entity.

func (*BalanceUpdateOne) SaveX

func (buo *BalanceUpdateOne) SaveX(ctx context.Context) *Balance

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

func (*BalanceUpdateOne) Select

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

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

func (*BalanceUpdateOne) SetAvailableAmount

func (buo *BalanceUpdateOne) SetAvailableAmount(f float64) *BalanceUpdateOne

SetAvailableAmount sets the "available_amount" field.

func (*BalanceUpdateOne) SetTotalAmount

func (buo *BalanceUpdateOne) SetTotalAmount(f float64) *BalanceUpdateOne

SetTotalAmount sets the "total_amount" field.

func (*BalanceUpdateOne) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*BalanceUpdateOne) Where

Where appends a list predicates to the BalanceUpdate builder.

type Balances

type Balances []*Balance

Balances is a parsable slice of Balance.

type Bid

type Bid struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Status holds the value of the "status" field.
	Status bid.Status `json:"status,omitempty"`
	// Amount holds the value of the "amount" field.
	Amount float64 `json:"amount,omitempty"`
	// AcceptedAmount holds the value of the "accepted_amount" field.
	AcceptedAmount float64 `json:"accepted_amount,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"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the BidQuery when eager-loading is set.
	Edges BidEdges `json:"edges"`
	// contains filtered or unexported fields
}

Bid is the model entity for the Bid schema.

func (*Bid) QueryInvestor

func (b *Bid) QueryInvestor() *InvestorQuery

QueryInvestor queries the "investor" edge of the Bid entity.

func (*Bid) QueryInvoice

func (b *Bid) QueryInvoice() *InvoiceQuery

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

func (*Bid) String

func (b *Bid) String() string

String implements the fmt.Stringer.

func (*Bid) Unwrap

func (b *Bid) Unwrap() *Bid

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

func (b *Bid) Update() *BidUpdateOne

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

func (*Bid) Value

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

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

type BidClient

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

BidClient is a client for the Bid schema.

func NewBidClient

func NewBidClient(c config) *BidClient

NewBidClient returns a client for the Bid from the given config.

func (*BidClient) Create

func (c *BidClient) Create() *BidCreate

Create returns a builder for creating a Bid entity.

func (*BidClient) CreateBulk

func (c *BidClient) CreateBulk(builders ...*BidCreate) *BidCreateBulk

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

func (*BidClient) Delete

func (c *BidClient) Delete() *BidDelete

Delete returns a delete builder for Bid.

func (*BidClient) DeleteOne

func (c *BidClient) DeleteOne(b *Bid) *BidDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*BidClient) DeleteOneID

func (c *BidClient) DeleteOneID(id uuid.UUID) *BidDeleteOne

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

func (*BidClient) Get

func (c *BidClient) Get(ctx context.Context, id uuid.UUID) (*Bid, error)

Get returns a Bid entity by its id.

func (*BidClient) GetX

func (c *BidClient) GetX(ctx context.Context, id uuid.UUID) *Bid

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

func (*BidClient) Hooks

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

Hooks returns the client hooks.

func (*BidClient) Intercept

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

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

func (*BidClient) Interceptors

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

Interceptors returns the client interceptors.

func (*BidClient) Query

func (c *BidClient) Query() *BidQuery

Query returns a query builder for Bid.

func (*BidClient) QueryInvestor

func (c *BidClient) QueryInvestor(b *Bid) *InvestorQuery

QueryInvestor queries the investor edge of a Bid.

func (*BidClient) QueryInvoice

func (c *BidClient) QueryInvoice(b *Bid) *InvoiceQuery

QueryInvoice queries the invoice edge of a Bid.

func (*BidClient) Update

func (c *BidClient) Update() *BidUpdate

Update returns an update builder for Bid.

func (*BidClient) UpdateOne

func (c *BidClient) UpdateOne(b *Bid) *BidUpdateOne

UpdateOne returns an update builder for the given entity.

func (*BidClient) UpdateOneID

func (c *BidClient) UpdateOneID(id uuid.UUID) *BidUpdateOne

UpdateOneID returns an update builder for the given id.

func (*BidClient) Use

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

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

type BidCreate

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

BidCreate is the builder for creating a Bid entity.

func (*BidCreate) Exec

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

Exec executes the query.

func (*BidCreate) ExecX

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

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

func (*BidCreate) Mutation

func (bc *BidCreate) Mutation() *BidMutation

Mutation returns the BidMutation object of the builder.

func (*BidCreate) Save

func (bc *BidCreate) Save(ctx context.Context) (*Bid, error)

Save creates the Bid in the database.

func (*BidCreate) SaveX

func (bc *BidCreate) SaveX(ctx context.Context) *Bid

SaveX calls Save and panics if Save returns an error.

func (*BidCreate) SetAcceptedAmount

func (bc *BidCreate) SetAcceptedAmount(f float64) *BidCreate

SetAcceptedAmount sets the "accepted_amount" field.

func (*BidCreate) SetAmount

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

SetAmount sets the "amount" field.

func (*BidCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*BidCreate) SetID

func (bc *BidCreate) SetID(u uuid.UUID) *BidCreate

SetID sets the "id" field.

func (*BidCreate) SetInvestor

func (bc *BidCreate) SetInvestor(i *Investor) *BidCreate

SetInvestor sets the "investor" edge to the Investor entity.

func (*BidCreate) SetInvestorID

func (bc *BidCreate) SetInvestorID(id uuid.UUID) *BidCreate

SetInvestorID sets the "investor" edge to the Investor entity by ID.

func (*BidCreate) SetInvoice

func (bc *BidCreate) SetInvoice(i *Invoice) *BidCreate

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

func (*BidCreate) SetInvoiceID

func (bc *BidCreate) SetInvoiceID(id uuid.UUID) *BidCreate

SetInvoiceID sets the "invoice" edge to the Invoice entity by ID.

func (*BidCreate) SetNillableAcceptedAmount

func (bc *BidCreate) SetNillableAcceptedAmount(f *float64) *BidCreate

SetNillableAcceptedAmount sets the "accepted_amount" field if the given value is not nil.

func (*BidCreate) SetNillableCreatedAt

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

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

func (*BidCreate) SetNillableID

func (bc *BidCreate) SetNillableID(u *uuid.UUID) *BidCreate

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

func (*BidCreate) SetNillableStatus

func (bc *BidCreate) SetNillableStatus(b *bid.Status) *BidCreate

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

func (*BidCreate) SetNillableUpdatedAt

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

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

func (*BidCreate) SetStatus

func (bc *BidCreate) SetStatus(b bid.Status) *BidCreate

SetStatus sets the "status" field.

func (*BidCreate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

type BidCreateBulk

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

BidCreateBulk is the builder for creating many Bid entities in bulk.

func (*BidCreateBulk) Exec

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

Exec executes the query.

func (*BidCreateBulk) ExecX

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

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

func (*BidCreateBulk) Save

func (bcb *BidCreateBulk) Save(ctx context.Context) ([]*Bid, error)

Save creates the Bid entities in the database.

func (*BidCreateBulk) SaveX

func (bcb *BidCreateBulk) SaveX(ctx context.Context) []*Bid

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

type BidDelete

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

BidDelete is the builder for deleting a Bid entity.

func (*BidDelete) Exec

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

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

func (*BidDelete) ExecX

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

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

func (*BidDelete) Where

func (bd *BidDelete) Where(ps ...predicate.Bid) *BidDelete

Where appends a list predicates to the BidDelete builder.

type BidDeleteOne

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

BidDeleteOne is the builder for deleting a single Bid entity.

func (*BidDeleteOne) Exec

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

Exec executes the deletion query.

func (*BidDeleteOne) ExecX

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

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

func (*BidDeleteOne) Where

func (bdo *BidDeleteOne) Where(ps ...predicate.Bid) *BidDeleteOne

Where appends a list predicates to the BidDelete builder.

type BidEdges

type BidEdges struct {
	// Invoice holds the value of the invoice edge.
	Invoice *Invoice `json:"invoice,omitempty"`
	// Investor holds the value of the investor edge.
	Investor *Investor `json:"investor,omitempty"`
	// contains filtered or unexported fields
}

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

func (BidEdges) InvestorOrErr

func (e BidEdges) InvestorOrErr() (*Investor, error)

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

func (BidEdges) InvoiceOrErr

func (e BidEdges) 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.

type BidGroupBy

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

BidGroupBy is the group-by builder for Bid entities.

func (*BidGroupBy) Aggregate

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

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

func (*BidGroupBy) Bool

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

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

func (*BidGroupBy) BoolX

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

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

func (*BidGroupBy) Bools

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

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

func (*BidGroupBy) BoolsX

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

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

func (*BidGroupBy) Float64

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

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

func (*BidGroupBy) Float64X

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

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

func (*BidGroupBy) Float64s

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

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

func (*BidGroupBy) Float64sX

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

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

func (*BidGroupBy) Int

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

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

func (*BidGroupBy) IntX

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

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

func (*BidGroupBy) Ints

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

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

func (*BidGroupBy) IntsX

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

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

func (*BidGroupBy) Scan

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

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

func (*BidGroupBy) ScanX

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

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

func (*BidGroupBy) String

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

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

func (*BidGroupBy) StringX

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

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

func (*BidGroupBy) Strings

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

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

func (*BidGroupBy) StringsX

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

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

type BidMutation

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

BidMutation represents an operation that mutates the Bid nodes in the graph.

func (*BidMutation) AcceptedAmount

func (m *BidMutation) AcceptedAmount() (r float64, exists bool)

AcceptedAmount returns the value of the "accepted_amount" field in the mutation.

func (*BidMutation) AddAcceptedAmount

func (m *BidMutation) AddAcceptedAmount(f float64)

AddAcceptedAmount adds f to the "accepted_amount" field.

func (*BidMutation) AddAmount

func (m *BidMutation) AddAmount(f float64)

AddAmount adds f to the "amount" field.

func (*BidMutation) AddField

func (m *BidMutation) 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 (*BidMutation) AddedAcceptedAmount

func (m *BidMutation) AddedAcceptedAmount() (r float64, exists bool)

AddedAcceptedAmount returns the value that was added to the "accepted_amount" field in this mutation.

func (*BidMutation) AddedAmount

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

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

func (*BidMutation) AddedEdges

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

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

func (*BidMutation) AddedField

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

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

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

func (*BidMutation) AddedIDs

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

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

func (*BidMutation) Amount

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

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

func (*BidMutation) ClearEdge

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

func (m *BidMutation) 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 (*BidMutation) ClearInvestor

func (m *BidMutation) ClearInvestor()

ClearInvestor clears the "investor" edge to the Investor entity.

func (*BidMutation) ClearInvoice

func (m *BidMutation) ClearInvoice()

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

func (*BidMutation) ClearedEdges

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

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

func (*BidMutation) ClearedFields

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

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

func (BidMutation) Client

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

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

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

func (*BidMutation) EdgeCleared

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

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

func (*BidMutation) Field

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

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

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

func (*BidMutation) Fields

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

func (m *BidMutation) 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 (*BidMutation) IDs

func (m *BidMutation) 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 (*BidMutation) InvestorCleared

func (m *BidMutation) InvestorCleared() bool

InvestorCleared reports if the "investor" edge to the Investor entity was cleared.

func (*BidMutation) InvestorID

func (m *BidMutation) InvestorID() (id uuid.UUID, exists bool)

InvestorID returns the "investor" edge ID in the mutation.

func (*BidMutation) InvestorIDs

func (m *BidMutation) InvestorIDs() (ids []uuid.UUID)

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

func (*BidMutation) InvoiceCleared

func (m *BidMutation) InvoiceCleared() bool

InvoiceCleared reports if the "invoice" edge to the Invoice entity was cleared.

func (*BidMutation) InvoiceID

func (m *BidMutation) InvoiceID() (id uuid.UUID, exists bool)

InvoiceID returns the "invoice" edge ID in the mutation.

func (*BidMutation) InvoiceIDs

func (m *BidMutation) 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 (*BidMutation) OldAcceptedAmount

func (m *BidMutation) OldAcceptedAmount(ctx context.Context) (v float64, err error)

OldAcceptedAmount returns the old "accepted_amount" field's value of the Bid entity. If the Bid 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 (*BidMutation) OldAmount

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

OldAmount returns the old "amount" field's value of the Bid entity. If the Bid 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 (*BidMutation) OldCreatedAt

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

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

func (m *BidMutation) 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 (*BidMutation) OldStatus

func (m *BidMutation) OldStatus(ctx context.Context) (v bid.Status, err error)

OldStatus returns the old "status" field's value of the Bid entity. If the Bid 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 (*BidMutation) OldUpdatedAt

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

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

func (m *BidMutation) Op() Op

Op returns the operation name.

func (*BidMutation) RemovedEdges

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

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

func (*BidMutation) RemovedIDs

func (m *BidMutation) 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 (*BidMutation) ResetAcceptedAmount

func (m *BidMutation) ResetAcceptedAmount()

ResetAcceptedAmount resets all changes to the "accepted_amount" field.

func (*BidMutation) ResetAmount

func (m *BidMutation) ResetAmount()

ResetAmount resets all changes to the "amount" field.

func (*BidMutation) ResetCreatedAt

func (m *BidMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*BidMutation) ResetEdge

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

func (m *BidMutation) 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 (*BidMutation) ResetInvestor

func (m *BidMutation) ResetInvestor()

ResetInvestor resets all changes to the "investor" edge.

func (*BidMutation) ResetInvoice

func (m *BidMutation) ResetInvoice()

ResetInvoice resets all changes to the "invoice" edge.

func (*BidMutation) ResetStatus

func (m *BidMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*BidMutation) ResetUpdatedAt

func (m *BidMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*BidMutation) SetAcceptedAmount

func (m *BidMutation) SetAcceptedAmount(f float64)

SetAcceptedAmount sets the "accepted_amount" field.

func (*BidMutation) SetAmount

func (m *BidMutation) SetAmount(f float64)

SetAmount sets the "amount" field.

func (*BidMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*BidMutation) SetField

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

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

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

func (*BidMutation) SetInvestorID

func (m *BidMutation) SetInvestorID(id uuid.UUID)

SetInvestorID sets the "investor" edge to the Investor entity by id.

func (*BidMutation) SetInvoiceID

func (m *BidMutation) SetInvoiceID(id uuid.UUID)

SetInvoiceID sets the "invoice" edge to the Invoice entity by id.

func (*BidMutation) SetOp

func (m *BidMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*BidMutation) SetStatus

func (m *BidMutation) SetStatus(b bid.Status)

SetStatus sets the "status" field.

func (*BidMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*BidMutation) Status

func (m *BidMutation) Status() (r bid.Status, exists bool)

Status returns the value of the "status" field in the mutation.

func (BidMutation) Tx

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

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

func (*BidMutation) Type

func (m *BidMutation) Type() string

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

func (*BidMutation) UpdatedAt

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

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

func (*BidMutation) Where

func (m *BidMutation) Where(ps ...predicate.Bid)

Where appends a list predicates to the BidMutation builder.

func (*BidMutation) WhereP

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

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

type BidQuery

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

BidQuery is the builder for querying Bid entities.

func (*BidQuery) Aggregate

func (bq *BidQuery) Aggregate(fns ...AggregateFunc) *BidSelect

Aggregate returns a BidSelect configured with the given aggregations.

func (*BidQuery) All

func (bq *BidQuery) All(ctx context.Context) ([]*Bid, error)

All executes the query and returns a list of Bids.

func (*BidQuery) AllX

func (bq *BidQuery) AllX(ctx context.Context) []*Bid

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

func (*BidQuery) Clone

func (bq *BidQuery) Clone() *BidQuery

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

func (*BidQuery) Count

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

Count returns the count of the given query.

func (*BidQuery) CountX

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

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

func (*BidQuery) Exist

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

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

func (*BidQuery) ExistX

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

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

func (*BidQuery) First

func (bq *BidQuery) First(ctx context.Context) (*Bid, error)

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

func (*BidQuery) FirstID

func (bq *BidQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*BidQuery) FirstIDX

func (bq *BidQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*BidQuery) FirstX

func (bq *BidQuery) FirstX(ctx context.Context) *Bid

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

func (*BidQuery) GroupBy

func (bq *BidQuery) GroupBy(field string, fields ...string) *BidGroupBy

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 {
	Status bid.Status `json:"status,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Bid.Query().
	GroupBy(bid.FieldStatus).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*BidQuery) IDs

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

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

func (*BidQuery) IDsX

func (bq *BidQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*BidQuery) Limit

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

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

func (*BidQuery) Offset

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

Offset to start from.

func (*BidQuery) Only

func (bq *BidQuery) Only(ctx context.Context) (*Bid, error)

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

func (*BidQuery) OnlyID

func (bq *BidQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*BidQuery) OnlyIDX

func (bq *BidQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*BidQuery) OnlyX

func (bq *BidQuery) OnlyX(ctx context.Context) *Bid

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

func (*BidQuery) Order

func (bq *BidQuery) Order(o ...bid.OrderOption) *BidQuery

Order specifies how the records should be ordered.

func (*BidQuery) QueryInvestor

func (bq *BidQuery) QueryInvestor() *InvestorQuery

QueryInvestor chains the current query on the "investor" edge.

func (*BidQuery) QueryInvoice

func (bq *BidQuery) QueryInvoice() *InvoiceQuery

QueryInvoice chains the current query on the "invoice" edge.

func (*BidQuery) Select

func (bq *BidQuery) Select(fields ...string) *BidSelect

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 {
	Status bid.Status `json:"status,omitempty"`
}

client.Bid.Query().
	Select(bid.FieldStatus).
	Scan(ctx, &v)

func (*BidQuery) Unique

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

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

func (bq *BidQuery) Where(ps ...predicate.Bid) *BidQuery

Where adds a new predicate for the BidQuery builder.

func (*BidQuery) WithInvestor

func (bq *BidQuery) WithInvestor(opts ...func(*InvestorQuery)) *BidQuery

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

func (*BidQuery) WithInvoice

func (bq *BidQuery) WithInvoice(opts ...func(*InvoiceQuery)) *BidQuery

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.

type BidSelect

type BidSelect struct {
	*BidQuery
	// contains filtered or unexported fields
}

BidSelect is the builder for selecting fields of Bid entities.

func (*BidSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*BidSelect) Bool

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

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

func (*BidSelect) BoolX

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

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

func (*BidSelect) Bools

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

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

func (*BidSelect) BoolsX

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

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

func (*BidSelect) Float64

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

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

func (*BidSelect) Float64X

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

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

func (*BidSelect) Float64s

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

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

func (*BidSelect) Float64sX

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

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

func (*BidSelect) Int

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

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

func (*BidSelect) IntX

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

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

func (*BidSelect) Ints

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

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

func (*BidSelect) IntsX

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

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

func (*BidSelect) Scan

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

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

func (*BidSelect) ScanX

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

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

func (*BidSelect) String

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

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

func (*BidSelect) StringX

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

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

func (*BidSelect) Strings

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

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

func (*BidSelect) StringsX

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

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

type BidUpdate

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

BidUpdate is the builder for updating Bid entities.

func (*BidUpdate) AddAcceptedAmount

func (bu *BidUpdate) AddAcceptedAmount(f float64) *BidUpdate

AddAcceptedAmount adds f to the "accepted_amount" field.

func (*BidUpdate) AddAmount

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

AddAmount adds f to the "amount" field.

func (*BidUpdate) Exec

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

Exec executes the query.

func (*BidUpdate) ExecX

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

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

func (*BidUpdate) Mutation

func (bu *BidUpdate) Mutation() *BidMutation

Mutation returns the BidMutation object of the builder.

func (*BidUpdate) Save

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

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

func (*BidUpdate) SaveX

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

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

func (*BidUpdate) SetAcceptedAmount

func (bu *BidUpdate) SetAcceptedAmount(f float64) *BidUpdate

SetAcceptedAmount sets the "accepted_amount" field.

func (*BidUpdate) SetAmount

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

SetAmount sets the "amount" field.

func (*BidUpdate) SetNillableAcceptedAmount

func (bu *BidUpdate) SetNillableAcceptedAmount(f *float64) *BidUpdate

SetNillableAcceptedAmount sets the "accepted_amount" field if the given value is not nil.

func (*BidUpdate) SetNillableStatus

func (bu *BidUpdate) SetNillableStatus(b *bid.Status) *BidUpdate

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

func (*BidUpdate) SetStatus

func (bu *BidUpdate) SetStatus(b bid.Status) *BidUpdate

SetStatus sets the "status" field.

func (*BidUpdate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*BidUpdate) Where

func (bu *BidUpdate) Where(ps ...predicate.Bid) *BidUpdate

Where appends a list predicates to the BidUpdate builder.

type BidUpdateOne

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

BidUpdateOne is the builder for updating a single Bid entity.

func (*BidUpdateOne) AddAcceptedAmount

func (buo *BidUpdateOne) AddAcceptedAmount(f float64) *BidUpdateOne

AddAcceptedAmount adds f to the "accepted_amount" field.

func (*BidUpdateOne) AddAmount

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

AddAmount adds f to the "amount" field.

func (*BidUpdateOne) Exec

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

Exec executes the query on the entity.

func (*BidUpdateOne) ExecX

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

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

func (*BidUpdateOne) Mutation

func (buo *BidUpdateOne) Mutation() *BidMutation

Mutation returns the BidMutation object of the builder.

func (*BidUpdateOne) Save

func (buo *BidUpdateOne) Save(ctx context.Context) (*Bid, error)

Save executes the query and returns the updated Bid entity.

func (*BidUpdateOne) SaveX

func (buo *BidUpdateOne) SaveX(ctx context.Context) *Bid

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

func (*BidUpdateOne) Select

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

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

func (*BidUpdateOne) SetAcceptedAmount

func (buo *BidUpdateOne) SetAcceptedAmount(f float64) *BidUpdateOne

SetAcceptedAmount sets the "accepted_amount" field.

func (*BidUpdateOne) SetAmount

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

SetAmount sets the "amount" field.

func (*BidUpdateOne) SetNillableAcceptedAmount

func (buo *BidUpdateOne) SetNillableAcceptedAmount(f *float64) *BidUpdateOne

SetNillableAcceptedAmount sets the "accepted_amount" field if the given value is not nil.

func (*BidUpdateOne) SetNillableStatus

func (buo *BidUpdateOne) SetNillableStatus(b *bid.Status) *BidUpdateOne

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

func (*BidUpdateOne) SetStatus

func (buo *BidUpdateOne) SetStatus(b bid.Status) *BidUpdateOne

SetStatus sets the "status" field.

func (*BidUpdateOne) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*BidUpdateOne) Where

func (buo *BidUpdateOne) Where(ps ...predicate.Bid) *BidUpdateOne

Where appends a list predicates to the BidUpdate builder.

type Bids

type Bids []*Bid

Bids is a parsable slice of Bid.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Balance is the client for interacting with the Balance builders.
	Balance *BalanceClient
	// Bid is the client for interacting with the Bid builders.
	Bid *BidClient
	// Investor is the client for interacting with the Investor builders.
	Investor *InvestorClient
	// Invoice is the client for interacting with the Invoice builders.
	Invoice *InvoiceClient
	// InvoiceItem is the client for interacting with the InvoiceItem builders.
	InvoiceItem *InvoiceItemClient
	// Issuer is the client for interacting with the Issuer builders.
	Issuer *IssuerClient
	// Ledger is the client for interacting with the Ledger builders.
	Ledger *LedgerClient
	// 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().
	Balance.
	Query().
	Count(ctx)

func (*Client) Intercept

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

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

func (*Client) Mutate

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

Mutate implements the ent.Mutator interface.

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Hook

type Hook = ent.Hook

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

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type Investor

type Investor struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// JoinedAt holds the value of the "joined_at" field.
	JoinedAt time.Time `json:"joined_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the InvestorQuery when eager-loading is set.
	Edges InvestorEdges `json:"edges"`
	// contains filtered or unexported fields
}

Investor is the model entity for the Investor schema.

func (*Investor) QueryBalance

func (i *Investor) QueryBalance() *BalanceQuery

QueryBalance queries the "balance" edge of the Investor entity.

func (*Investor) QueryBids

func (i *Investor) QueryBids() *BidQuery

QueryBids queries the "bids" edge of the Investor entity.

func (*Investor) QueryInvoices

func (i *Investor) QueryInvoices() *InvoiceQuery

QueryInvoices queries the "invoices" edge of the Investor entity.

func (*Investor) String

func (i *Investor) String() string

String implements the fmt.Stringer.

func (*Investor) Unwrap

func (i *Investor) Unwrap() *Investor

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

func (i *Investor) Update() *InvestorUpdateOne

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

func (*Investor) Value

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

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

type InvestorClient

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

InvestorClient is a client for the Investor schema.

func NewInvestorClient

func NewInvestorClient(c config) *InvestorClient

NewInvestorClient returns a client for the Investor from the given config.

func (*InvestorClient) Create

func (c *InvestorClient) Create() *InvestorCreate

Create returns a builder for creating a Investor entity.

func (*InvestorClient) CreateBulk

func (c *InvestorClient) CreateBulk(builders ...*InvestorCreate) *InvestorCreateBulk

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

func (*InvestorClient) Delete

func (c *InvestorClient) Delete() *InvestorDelete

Delete returns a delete builder for Investor.

func (*InvestorClient) DeleteOne

func (c *InvestorClient) DeleteOne(i *Investor) *InvestorDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*InvestorClient) DeleteOneID

func (c *InvestorClient) DeleteOneID(id uuid.UUID) *InvestorDeleteOne

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

func (*InvestorClient) Get

func (c *InvestorClient) Get(ctx context.Context, id uuid.UUID) (*Investor, error)

Get returns a Investor entity by its id.

func (*InvestorClient) GetX

func (c *InvestorClient) GetX(ctx context.Context, id uuid.UUID) *Investor

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

func (*InvestorClient) Hooks

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

Hooks returns the client hooks.

func (*InvestorClient) Intercept

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

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

func (*InvestorClient) Interceptors

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

Interceptors returns the client interceptors.

func (*InvestorClient) Query

func (c *InvestorClient) Query() *InvestorQuery

Query returns a query builder for Investor.

func (*InvestorClient) QueryBalance

func (c *InvestorClient) QueryBalance(i *Investor) *BalanceQuery

QueryBalance queries the balance edge of a Investor.

func (*InvestorClient) QueryBids

func (c *InvestorClient) QueryBids(i *Investor) *BidQuery

QueryBids queries the bids edge of a Investor.

func (*InvestorClient) QueryInvoices

func (c *InvestorClient) QueryInvoices(i *Investor) *InvoiceQuery

QueryInvoices queries the invoices edge of a Investor.

func (*InvestorClient) Update

func (c *InvestorClient) Update() *InvestorUpdate

Update returns an update builder for Investor.

func (*InvestorClient) UpdateOne

func (c *InvestorClient) UpdateOne(i *Investor) *InvestorUpdateOne

UpdateOne returns an update builder for the given entity.

func (*InvestorClient) UpdateOneID

func (c *InvestorClient) UpdateOneID(id uuid.UUID) *InvestorUpdateOne

UpdateOneID returns an update builder for the given id.

func (*InvestorClient) Use

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

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

type InvestorCreate

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

InvestorCreate is the builder for creating a Investor entity.

func (*InvestorCreate) AddBidIDs

func (ic *InvestorCreate) AddBidIDs(ids ...uuid.UUID) *InvestorCreate

AddBidIDs adds the "bids" edge to the Bid entity by IDs.

func (*InvestorCreate) AddBids

func (ic *InvestorCreate) AddBids(b ...*Bid) *InvestorCreate

AddBids adds the "bids" edges to the Bid entity.

func (*InvestorCreate) AddInvoiceIDs

func (ic *InvestorCreate) AddInvoiceIDs(ids ...uuid.UUID) *InvestorCreate

AddInvoiceIDs adds the "invoices" edge to the Invoice entity by IDs.

func (*InvestorCreate) AddInvoices

func (ic *InvestorCreate) AddInvoices(i ...*Invoice) *InvestorCreate

AddInvoices adds the "invoices" edges to the Invoice entity.

func (*InvestorCreate) Exec

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

Exec executes the query.

func (*InvestorCreate) ExecX

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

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

func (*InvestorCreate) Mutation

func (ic *InvestorCreate) Mutation() *InvestorMutation

Mutation returns the InvestorMutation object of the builder.

func (*InvestorCreate) Save

func (ic *InvestorCreate) Save(ctx context.Context) (*Investor, error)

Save creates the Investor in the database.

func (*InvestorCreate) SaveX

func (ic *InvestorCreate) SaveX(ctx context.Context) *Investor

SaveX calls Save and panics if Save returns an error.

func (*InvestorCreate) SetBalance

func (ic *InvestorCreate) SetBalance(b *Balance) *InvestorCreate

SetBalance sets the "balance" edge to the Balance entity.

func (*InvestorCreate) SetBalanceID

func (ic *InvestorCreate) SetBalanceID(id uuid.UUID) *InvestorCreate

SetBalanceID sets the "balance" edge to the Balance entity by ID.

func (*InvestorCreate) SetID

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

SetID sets the "id" field.

func (*InvestorCreate) SetJoinedAt

func (ic *InvestorCreate) SetJoinedAt(t time.Time) *InvestorCreate

SetJoinedAt sets the "joined_at" field.

func (*InvestorCreate) SetName

func (ic *InvestorCreate) SetName(s string) *InvestorCreate

SetName sets the "name" field.

func (*InvestorCreate) SetNillableID

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

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

func (*InvestorCreate) SetNillableJoinedAt

func (ic *InvestorCreate) SetNillableJoinedAt(t *time.Time) *InvestorCreate

SetNillableJoinedAt sets the "joined_at" field if the given value is not nil.

type InvestorCreateBulk

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

InvestorCreateBulk is the builder for creating many Investor entities in bulk.

func (*InvestorCreateBulk) Exec

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

Exec executes the query.

func (*InvestorCreateBulk) ExecX

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

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

func (*InvestorCreateBulk) Save

func (icb *InvestorCreateBulk) Save(ctx context.Context) ([]*Investor, error)

Save creates the Investor entities in the database.

func (*InvestorCreateBulk) SaveX

func (icb *InvestorCreateBulk) SaveX(ctx context.Context) []*Investor

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

type InvestorDelete

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

InvestorDelete is the builder for deleting a Investor entity.

func (*InvestorDelete) Exec

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

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

func (*InvestorDelete) ExecX

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

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

func (*InvestorDelete) Where

func (id *InvestorDelete) Where(ps ...predicate.Investor) *InvestorDelete

Where appends a list predicates to the InvestorDelete builder.

type InvestorDeleteOne

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

InvestorDeleteOne is the builder for deleting a single Investor entity.

func (*InvestorDeleteOne) Exec

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

Exec executes the deletion query.

func (*InvestorDeleteOne) ExecX

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

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

func (*InvestorDeleteOne) Where

Where appends a list predicates to the InvestorDelete builder.

type InvestorEdges

type InvestorEdges struct {
	// Bids holds the value of the bids edge.
	Bids []*Bid `json:"bids,omitempty"`
	// Invoices holds the value of the invoices edge.
	Invoices []*Invoice `json:"invoices,omitempty"`
	// Balance holds the value of the balance edge.
	Balance *Balance `json:"balance,omitempty"`
	// contains filtered or unexported fields
}

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

func (InvestorEdges) BalanceOrErr

func (e InvestorEdges) BalanceOrErr() (*Balance, error)

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

func (InvestorEdges) BidsOrErr

func (e InvestorEdges) BidsOrErr() ([]*Bid, error)

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

func (InvestorEdges) InvoicesOrErr

func (e InvestorEdges) InvoicesOrErr() ([]*Invoice, error)

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

type InvestorGroupBy

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

InvestorGroupBy is the group-by builder for Investor entities.

func (*InvestorGroupBy) Aggregate

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

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

func (*InvestorGroupBy) Bool

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

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

func (*InvestorGroupBy) BoolX

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

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

func (*InvestorGroupBy) Bools

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

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

func (*InvestorGroupBy) BoolsX

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

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

func (*InvestorGroupBy) Float64

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

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

func (*InvestorGroupBy) Float64X

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

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

func (*InvestorGroupBy) Float64s

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

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

func (*InvestorGroupBy) Float64sX

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

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

func (*InvestorGroupBy) Int

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

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

func (*InvestorGroupBy) IntX

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

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

func (*InvestorGroupBy) Ints

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

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

func (*InvestorGroupBy) IntsX

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

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

func (*InvestorGroupBy) Scan

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

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

func (*InvestorGroupBy) ScanX

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

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

func (*InvestorGroupBy) String

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

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

func (*InvestorGroupBy) StringX

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

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

func (*InvestorGroupBy) Strings

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

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

func (*InvestorGroupBy) StringsX

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

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

type InvestorMutation

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

InvestorMutation represents an operation that mutates the Investor nodes in the graph.

func (*InvestorMutation) AddBidIDs

func (m *InvestorMutation) AddBidIDs(ids ...uuid.UUID)

AddBidIDs adds the "bids" edge to the Bid entity by ids.

func (*InvestorMutation) AddField

func (m *InvestorMutation) 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 (*InvestorMutation) AddInvoiceIDs

func (m *InvestorMutation) AddInvoiceIDs(ids ...uuid.UUID)

AddInvoiceIDs adds the "invoices" edge to the Invoice entity by ids.

func (*InvestorMutation) AddedEdges

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

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

func (*InvestorMutation) AddedField

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

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

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

func (*InvestorMutation) AddedIDs

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

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

func (*InvestorMutation) BalanceCleared

func (m *InvestorMutation) BalanceCleared() bool

BalanceCleared reports if the "balance" edge to the Balance entity was cleared.

func (*InvestorMutation) BalanceID

func (m *InvestorMutation) BalanceID() (id uuid.UUID, exists bool)

BalanceID returns the "balance" edge ID in the mutation.

func (*InvestorMutation) BalanceIDs

func (m *InvestorMutation) BalanceIDs() (ids []uuid.UUID)

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

func (*InvestorMutation) BidsCleared

func (m *InvestorMutation) BidsCleared() bool

BidsCleared reports if the "bids" edge to the Bid entity was cleared.

func (*InvestorMutation) BidsIDs

func (m *InvestorMutation) BidsIDs() (ids []uuid.UUID)

BidsIDs returns the "bids" edge IDs in the mutation.

func (*InvestorMutation) ClearBalance

func (m *InvestorMutation) ClearBalance()

ClearBalance clears the "balance" edge to the Balance entity.

func (*InvestorMutation) ClearBids

func (m *InvestorMutation) ClearBids()

ClearBids clears the "bids" edge to the Bid entity.

func (*InvestorMutation) ClearEdge

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

func (m *InvestorMutation) 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 (*InvestorMutation) ClearInvoices

func (m *InvestorMutation) ClearInvoices()

ClearInvoices clears the "invoices" edge to the Invoice entity.

func (*InvestorMutation) ClearedEdges

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

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

func (*InvestorMutation) ClearedFields

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

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

func (InvestorMutation) Client

func (m InvestorMutation) 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 (*InvestorMutation) EdgeCleared

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

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

func (*InvestorMutation) Field

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

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

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

func (*InvestorMutation) Fields

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

func (m *InvestorMutation) 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 (*InvestorMutation) IDs

func (m *InvestorMutation) 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 (*InvestorMutation) InvoicesCleared

func (m *InvestorMutation) InvoicesCleared() bool

InvoicesCleared reports if the "invoices" edge to the Invoice entity was cleared.

func (*InvestorMutation) InvoicesIDs

func (m *InvestorMutation) InvoicesIDs() (ids []uuid.UUID)

InvoicesIDs returns the "invoices" edge IDs in the mutation.

func (*InvestorMutation) JoinedAt

func (m *InvestorMutation) JoinedAt() (r time.Time, exists bool)

JoinedAt returns the value of the "joined_at" field in the mutation.

func (*InvestorMutation) Name

func (m *InvestorMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*InvestorMutation) OldField

func (m *InvestorMutation) 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 (*InvestorMutation) OldJoinedAt

func (m *InvestorMutation) OldJoinedAt(ctx context.Context) (v time.Time, err error)

OldJoinedAt returns the old "joined_at" field's value of the Investor entity. If the Investor 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 (*InvestorMutation) OldName

func (m *InvestorMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Investor entity. If the Investor 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 (*InvestorMutation) Op

func (m *InvestorMutation) Op() Op

Op returns the operation name.

func (*InvestorMutation) RemoveBidIDs

func (m *InvestorMutation) RemoveBidIDs(ids ...uuid.UUID)

RemoveBidIDs removes the "bids" edge to the Bid entity by IDs.

func (*InvestorMutation) RemoveInvoiceIDs

func (m *InvestorMutation) RemoveInvoiceIDs(ids ...uuid.UUID)

RemoveInvoiceIDs removes the "invoices" edge to the Invoice entity by IDs.

func (*InvestorMutation) RemovedBidsIDs

func (m *InvestorMutation) RemovedBidsIDs() (ids []uuid.UUID)

RemovedBids returns the removed IDs of the "bids" edge to the Bid entity.

func (*InvestorMutation) RemovedEdges

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

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

func (*InvestorMutation) RemovedIDs

func (m *InvestorMutation) 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 (*InvestorMutation) RemovedInvoicesIDs

func (m *InvestorMutation) RemovedInvoicesIDs() (ids []uuid.UUID)

RemovedInvoices returns the removed IDs of the "invoices" edge to the Invoice entity.

func (*InvestorMutation) ResetBalance

func (m *InvestorMutation) ResetBalance()

ResetBalance resets all changes to the "balance" edge.

func (*InvestorMutation) ResetBids

func (m *InvestorMutation) ResetBids()

ResetBids resets all changes to the "bids" edge.

func (*InvestorMutation) ResetEdge

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

func (m *InvestorMutation) 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 (*InvestorMutation) ResetInvoices

func (m *InvestorMutation) ResetInvoices()

ResetInvoices resets all changes to the "invoices" edge.

func (*InvestorMutation) ResetJoinedAt

func (m *InvestorMutation) ResetJoinedAt()

ResetJoinedAt resets all changes to the "joined_at" field.

func (*InvestorMutation) ResetName

func (m *InvestorMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*InvestorMutation) SetBalanceID

func (m *InvestorMutation) SetBalanceID(id uuid.UUID)

SetBalanceID sets the "balance" edge to the Balance entity by id.

func (*InvestorMutation) SetField

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

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

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

func (*InvestorMutation) SetJoinedAt

func (m *InvestorMutation) SetJoinedAt(t time.Time)

SetJoinedAt sets the "joined_at" field.

func (*InvestorMutation) SetName

func (m *InvestorMutation) SetName(s string)

SetName sets the "name" field.

func (*InvestorMutation) SetOp

func (m *InvestorMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (InvestorMutation) Tx

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

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

func (*InvestorMutation) Type

func (m *InvestorMutation) Type() string

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

func (*InvestorMutation) Where

func (m *InvestorMutation) Where(ps ...predicate.Investor)

Where appends a list predicates to the InvestorMutation builder.

func (*InvestorMutation) WhereP

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

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

type InvestorQuery

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

InvestorQuery is the builder for querying Investor entities.

func (*InvestorQuery) Aggregate

func (iq *InvestorQuery) Aggregate(fns ...AggregateFunc) *InvestorSelect

Aggregate returns a InvestorSelect configured with the given aggregations.

func (*InvestorQuery) All

func (iq *InvestorQuery) All(ctx context.Context) ([]*Investor, error)

All executes the query and returns a list of Investors.

func (*InvestorQuery) AllX

func (iq *InvestorQuery) AllX(ctx context.Context) []*Investor

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

func (*InvestorQuery) Clone

func (iq *InvestorQuery) Clone() *InvestorQuery

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

func (*InvestorQuery) Count

func (iq *InvestorQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*InvestorQuery) CountX

func (iq *InvestorQuery) CountX(ctx context.Context) int

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

func (*InvestorQuery) Exist

func (iq *InvestorQuery) Exist(ctx context.Context) (bool, error)

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

func (*InvestorQuery) ExistX

func (iq *InvestorQuery) ExistX(ctx context.Context) bool

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

func (*InvestorQuery) First

func (iq *InvestorQuery) First(ctx context.Context) (*Investor, error)

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

func (*InvestorQuery) FirstID

func (iq *InvestorQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*InvestorQuery) FirstIDX

func (iq *InvestorQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*InvestorQuery) FirstX

func (iq *InvestorQuery) FirstX(ctx context.Context) *Investor

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

func (*InvestorQuery) GroupBy

func (iq *InvestorQuery) GroupBy(field string, fields ...string) *InvestorGroupBy

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 {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Investor.Query().
	GroupBy(investor.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*InvestorQuery) IDs

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

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

func (*InvestorQuery) IDsX

func (iq *InvestorQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*InvestorQuery) Limit

func (iq *InvestorQuery) Limit(limit int) *InvestorQuery

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

func (*InvestorQuery) Offset

func (iq *InvestorQuery) Offset(offset int) *InvestorQuery

Offset to start from.

func (*InvestorQuery) Only

func (iq *InvestorQuery) Only(ctx context.Context) (*Investor, error)

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

func (*InvestorQuery) OnlyID

func (iq *InvestorQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*InvestorQuery) OnlyIDX

func (iq *InvestorQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*InvestorQuery) OnlyX

func (iq *InvestorQuery) OnlyX(ctx context.Context) *Investor

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

func (*InvestorQuery) Order

Order specifies how the records should be ordered.

func (*InvestorQuery) QueryBalance

func (iq *InvestorQuery) QueryBalance() *BalanceQuery

QueryBalance chains the current query on the "balance" edge.

func (*InvestorQuery) QueryBids

func (iq *InvestorQuery) QueryBids() *BidQuery

QueryBids chains the current query on the "bids" edge.

func (*InvestorQuery) QueryInvoices

func (iq *InvestorQuery) QueryInvoices() *InvoiceQuery

QueryInvoices chains the current query on the "invoices" edge.

func (*InvestorQuery) Select

func (iq *InvestorQuery) Select(fields ...string) *InvestorSelect

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 {
	Name string `json:"name,omitempty"`
}

client.Investor.Query().
	Select(investor.FieldName).
	Scan(ctx, &v)

func (*InvestorQuery) Unique

func (iq *InvestorQuery) Unique(unique bool) *InvestorQuery

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

func (iq *InvestorQuery) Where(ps ...predicate.Investor) *InvestorQuery

Where adds a new predicate for the InvestorQuery builder.

func (*InvestorQuery) WithBalance

func (iq *InvestorQuery) WithBalance(opts ...func(*BalanceQuery)) *InvestorQuery

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

func (*InvestorQuery) WithBids

func (iq *InvestorQuery) WithBids(opts ...func(*BidQuery)) *InvestorQuery

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

func (*InvestorQuery) WithInvoices

func (iq *InvestorQuery) WithInvoices(opts ...func(*InvoiceQuery)) *InvestorQuery

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

type InvestorSelect

type InvestorSelect struct {
	*InvestorQuery
	// contains filtered or unexported fields
}

InvestorSelect is the builder for selecting fields of Investor entities.

func (*InvestorSelect) Aggregate

func (is *InvestorSelect) Aggregate(fns ...AggregateFunc) *InvestorSelect

Aggregate adds the given aggregation functions to the selector query.

func (*InvestorSelect) Bool

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

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

func (*InvestorSelect) BoolX

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

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

func (*InvestorSelect) Bools

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

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

func (*InvestorSelect) BoolsX

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

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

func (*InvestorSelect) Float64

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

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

func (*InvestorSelect) Float64X

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

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

func (*InvestorSelect) Float64s

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

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

func (*InvestorSelect) Float64sX

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

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

func (*InvestorSelect) Int

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

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

func (*InvestorSelect) IntX

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

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

func (*InvestorSelect) Ints

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

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

func (*InvestorSelect) IntsX

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

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

func (*InvestorSelect) Scan

func (is *InvestorSelect) Scan(ctx context.Context, v any) error

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

func (*InvestorSelect) ScanX

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

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

func (*InvestorSelect) String

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

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

func (*InvestorSelect) StringX

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

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

func (*InvestorSelect) Strings

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

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

func (*InvestorSelect) StringsX

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

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

type InvestorUpdate

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

InvestorUpdate is the builder for updating Investor entities.

func (*InvestorUpdate) AddBidIDs

func (iu *InvestorUpdate) AddBidIDs(ids ...uuid.UUID) *InvestorUpdate

AddBidIDs adds the "bids" edge to the Bid entity by IDs.

func (*InvestorUpdate) AddBids

func (iu *InvestorUpdate) AddBids(b ...*Bid) *InvestorUpdate

AddBids adds the "bids" edges to the Bid entity.

func (*InvestorUpdate) AddInvoiceIDs

func (iu *InvestorUpdate) AddInvoiceIDs(ids ...uuid.UUID) *InvestorUpdate

AddInvoiceIDs adds the "invoices" edge to the Invoice entity by IDs.

func (*InvestorUpdate) AddInvoices

func (iu *InvestorUpdate) AddInvoices(i ...*Invoice) *InvestorUpdate

AddInvoices adds the "invoices" edges to the Invoice entity.

func (*InvestorUpdate) ClearBalance

func (iu *InvestorUpdate) ClearBalance() *InvestorUpdate

ClearBalance clears the "balance" edge to the Balance entity.

func (*InvestorUpdate) ClearBids

func (iu *InvestorUpdate) ClearBids() *InvestorUpdate

ClearBids clears all "bids" edges to the Bid entity.

func (*InvestorUpdate) ClearInvoices

func (iu *InvestorUpdate) ClearInvoices() *InvestorUpdate

ClearInvoices clears all "invoices" edges to the Invoice entity.

func (*InvestorUpdate) Exec

func (iu *InvestorUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*InvestorUpdate) ExecX

func (iu *InvestorUpdate) ExecX(ctx context.Context)

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

func (*InvestorUpdate) Mutation

func (iu *InvestorUpdate) Mutation() *InvestorMutation

Mutation returns the InvestorMutation object of the builder.

func (*InvestorUpdate) RemoveBidIDs

func (iu *InvestorUpdate) RemoveBidIDs(ids ...uuid.UUID) *InvestorUpdate

RemoveBidIDs removes the "bids" edge to Bid entities by IDs.

func (*InvestorUpdate) RemoveBids

func (iu *InvestorUpdate) RemoveBids(b ...*Bid) *InvestorUpdate

RemoveBids removes "bids" edges to Bid entities.

func (*InvestorUpdate) RemoveInvoiceIDs

func (iu *InvestorUpdate) RemoveInvoiceIDs(ids ...uuid.UUID) *InvestorUpdate

RemoveInvoiceIDs removes the "invoices" edge to Invoice entities by IDs.

func (*InvestorUpdate) RemoveInvoices

func (iu *InvestorUpdate) RemoveInvoices(i ...*Invoice) *InvestorUpdate

RemoveInvoices removes "invoices" edges to Invoice entities.

func (*InvestorUpdate) Save

func (iu *InvestorUpdate) Save(ctx context.Context) (int, error)

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

func (*InvestorUpdate) SaveX

func (iu *InvestorUpdate) SaveX(ctx context.Context) int

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

func (*InvestorUpdate) SetBalance

func (iu *InvestorUpdate) SetBalance(b *Balance) *InvestorUpdate

SetBalance sets the "balance" edge to the Balance entity.

func (*InvestorUpdate) SetBalanceID

func (iu *InvestorUpdate) SetBalanceID(id uuid.UUID) *InvestorUpdate

SetBalanceID sets the "balance" edge to the Balance entity by ID.

func (*InvestorUpdate) SetName

func (iu *InvestorUpdate) SetName(s string) *InvestorUpdate

SetName sets the "name" field.

func (*InvestorUpdate) Where

func (iu *InvestorUpdate) Where(ps ...predicate.Investor) *InvestorUpdate

Where appends a list predicates to the InvestorUpdate builder.

type InvestorUpdateOne

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

InvestorUpdateOne is the builder for updating a single Investor entity.

func (*InvestorUpdateOne) AddBidIDs

func (iuo *InvestorUpdateOne) AddBidIDs(ids ...uuid.UUID) *InvestorUpdateOne

AddBidIDs adds the "bids" edge to the Bid entity by IDs.

func (*InvestorUpdateOne) AddBids

func (iuo *InvestorUpdateOne) AddBids(b ...*Bid) *InvestorUpdateOne

AddBids adds the "bids" edges to the Bid entity.

func (*InvestorUpdateOne) AddInvoiceIDs

func (iuo *InvestorUpdateOne) AddInvoiceIDs(ids ...uuid.UUID) *InvestorUpdateOne

AddInvoiceIDs adds the "invoices" edge to the Invoice entity by IDs.

func (*InvestorUpdateOne) AddInvoices

func (iuo *InvestorUpdateOne) AddInvoices(i ...*Invoice) *InvestorUpdateOne

AddInvoices adds the "invoices" edges to the Invoice entity.

func (*InvestorUpdateOne) ClearBalance

func (iuo *InvestorUpdateOne) ClearBalance() *InvestorUpdateOne

ClearBalance clears the "balance" edge to the Balance entity.

func (*InvestorUpdateOne) ClearBids

func (iuo *InvestorUpdateOne) ClearBids() *InvestorUpdateOne

ClearBids clears all "bids" edges to the Bid entity.

func (*InvestorUpdateOne) ClearInvoices

func (iuo *InvestorUpdateOne) ClearInvoices() *InvestorUpdateOne

ClearInvoices clears all "invoices" edges to the Invoice entity.

func (*InvestorUpdateOne) Exec

func (iuo *InvestorUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*InvestorUpdateOne) ExecX

func (iuo *InvestorUpdateOne) ExecX(ctx context.Context)

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

func (*InvestorUpdateOne) Mutation

func (iuo *InvestorUpdateOne) Mutation() *InvestorMutation

Mutation returns the InvestorMutation object of the builder.

func (*InvestorUpdateOne) RemoveBidIDs

func (iuo *InvestorUpdateOne) RemoveBidIDs(ids ...uuid.UUID) *InvestorUpdateOne

RemoveBidIDs removes the "bids" edge to Bid entities by IDs.

func (*InvestorUpdateOne) RemoveBids

func (iuo *InvestorUpdateOne) RemoveBids(b ...*Bid) *InvestorUpdateOne

RemoveBids removes "bids" edges to Bid entities.

func (*InvestorUpdateOne) RemoveInvoiceIDs

func (iuo *InvestorUpdateOne) RemoveInvoiceIDs(ids ...uuid.UUID) *InvestorUpdateOne

RemoveInvoiceIDs removes the "invoices" edge to Invoice entities by IDs.

func (*InvestorUpdateOne) RemoveInvoices

func (iuo *InvestorUpdateOne) RemoveInvoices(i ...*Invoice) *InvestorUpdateOne

RemoveInvoices removes "invoices" edges to Invoice entities.

func (*InvestorUpdateOne) Save

func (iuo *InvestorUpdateOne) Save(ctx context.Context) (*Investor, error)

Save executes the query and returns the updated Investor entity.

func (*InvestorUpdateOne) SaveX

func (iuo *InvestorUpdateOne) SaveX(ctx context.Context) *Investor

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

func (*InvestorUpdateOne) Select

func (iuo *InvestorUpdateOne) Select(field string, fields ...string) *InvestorUpdateOne

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

func (*InvestorUpdateOne) SetBalance

func (iuo *InvestorUpdateOne) SetBalance(b *Balance) *InvestorUpdateOne

SetBalance sets the "balance" edge to the Balance entity.

func (*InvestorUpdateOne) SetBalanceID

func (iuo *InvestorUpdateOne) SetBalanceID(id uuid.UUID) *InvestorUpdateOne

SetBalanceID sets the "balance" edge to the Balance entity by ID.

func (*InvestorUpdateOne) SetName

func (iuo *InvestorUpdateOne) SetName(s string) *InvestorUpdateOne

SetName sets the "name" field.

func (*InvestorUpdateOne) Where

Where appends a list predicates to the InvestorUpdate builder.

type Investors

type Investors []*Investor

Investors is a parsable slice of Investor.

type Invoice

type Invoice struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Status holds the value of the "status" field.
	Status invoice.Status `json:"status,omitempty"`
	// AskingPrice holds the value of the "asking_price" field.
	AskingPrice float64 `json:"asking_price,omitempty"`
	// IsLocked holds the value of the "is_locked" field.
	IsLocked bool `json:"is_locked,omitempty"`
	// IsApproved holds the value of the "is_approved" field.
	IsApproved bool `json:"is_approved,omitempty"`
	// InvoiceNumber holds the value of the "invoice_number" field.
	InvoiceNumber string `json:"invoice_number,omitempty"`
	// InvoiceDate holds the value of the "invoice_date" field.
	InvoiceDate time.Time `json:"invoice_date,omitempty"`
	// DueDate holds the value of the "due_date" field.
	DueDate time.Time `json:"due_date,omitempty"`
	// AmountDue holds the value of the "amount_due" field.
	AmountDue float64 `json:"amount_due,omitempty"`
	// CustomerName holds the value of the "customer_name" field.
	CustomerName string `json:"customer_name,omitempty"`
	// Reference holds the value of the "reference" field.
	Reference string `json:"reference,omitempty"`
	// CompanyName holds the value of the "company_name" field.
	CompanyName string `json:"company_name,omitempty"`
	// Currency holds the value of the "currency" field.
	Currency string `json:"currency,omitempty"`
	// TotalAmount holds the value of the "total_amount" field.
	TotalAmount float64 `json:"total_amount,omitempty"`
	// TotalVat holds the value of the "total_vat" field.
	TotalVat float64 `json:"total_vat,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,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) QueryBids

func (i *Invoice) QueryBids() *BidQuery

QueryBids queries the "bids" edge of the Invoice entity.

func (*Invoice) QueryInvestor

func (i *Invoice) QueryInvestor() *InvestorQuery

QueryInvestor queries the "investor" edge of the Invoice entity.

func (*Invoice) QueryIssuer

func (i *Invoice) QueryIssuer() *IssuerQuery

QueryIssuer queries the "issuer" edge of the Invoice entity.

func (*Invoice) QueryItems

func (i *Invoice) QueryItems() *InvoiceItemQuery

QueryItems queries the "items" 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) Query

func (c *InvoiceClient) Query() *InvoiceQuery

Query returns a query builder for Invoice.

func (*InvoiceClient) QueryBids

func (c *InvoiceClient) QueryBids(i *Invoice) *BidQuery

QueryBids queries the bids edge of a Invoice.

func (*InvoiceClient) QueryInvestor

func (c *InvoiceClient) QueryInvestor(i *Invoice) *InvestorQuery

QueryInvestor queries the investor edge of a Invoice.

func (*InvoiceClient) QueryIssuer

func (c *InvoiceClient) QueryIssuer(i *Invoice) *IssuerQuery

QueryIssuer queries the issuer edge of a Invoice.

func (*InvoiceClient) QueryItems

func (c *InvoiceClient) QueryItems(i *Invoice) *InvoiceItemQuery

QueryItems queries the items 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) AddBidIDs

func (ic *InvoiceCreate) AddBidIDs(ids ...uuid.UUID) *InvoiceCreate

AddBidIDs adds the "bids" edge to the Bid entity by IDs.

func (*InvoiceCreate) AddBids

func (ic *InvoiceCreate) AddBids(b ...*Bid) *InvoiceCreate

AddBids adds the "bids" edges to the Bid entity.

func (*InvoiceCreate) AddInvestor

func (ic *InvoiceCreate) AddInvestor(i ...*Investor) *InvoiceCreate

AddInvestor adds the "investor" edges to the Investor entity.

func (*InvoiceCreate) AddInvestorIDs

func (ic *InvoiceCreate) AddInvestorIDs(ids ...uuid.UUID) *InvoiceCreate

AddInvestorIDs adds the "investor" edge to the Investor entity by IDs.

func (*InvoiceCreate) AddItemIDs

func (ic *InvoiceCreate) AddItemIDs(ids ...uuid.UUID) *InvoiceCreate

AddItemIDs adds the "items" edge to the InvoiceItem entity by IDs.

func (*InvoiceCreate) AddItems

func (ic *InvoiceCreate) AddItems(i ...*InvoiceItem) *InvoiceCreate

AddItems adds the "items" edges to the InvoiceItem 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) SetAmountDue

func (ic *InvoiceCreate) SetAmountDue(f float64) *InvoiceCreate

SetAmountDue sets the "amount_due" field.

func (*InvoiceCreate) SetAskingPrice

func (ic *InvoiceCreate) SetAskingPrice(f float64) *InvoiceCreate

SetAskingPrice sets the "asking_price" field.

func (*InvoiceCreate) SetCompanyName

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

SetCompanyName sets the "company_name" field.

func (*InvoiceCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*InvoiceCreate) SetCurrency

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

SetCurrency sets the "currency" field.

func (*InvoiceCreate) SetCustomerName

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

SetCustomerName sets the "customer_name" field.

func (*InvoiceCreate) SetDueDate

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

SetDueDate sets the "due_date" field.

func (*InvoiceCreate) SetID

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

SetID sets the "id" field.

func (*InvoiceCreate) SetInvoiceDate

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

SetInvoiceDate sets the "invoice_date" field.

func (*InvoiceCreate) SetInvoiceNumber

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

SetInvoiceNumber sets the "invoice_number" field.

func (*InvoiceCreate) SetIsApproved

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

SetIsApproved sets the "is_approved" field.

func (*InvoiceCreate) SetIsLocked

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

SetIsLocked sets the "is_locked" field.

func (*InvoiceCreate) SetIssuer

func (ic *InvoiceCreate) SetIssuer(i *Issuer) *InvoiceCreate

SetIssuer sets the "issuer" edge to the Issuer entity.

func (*InvoiceCreate) SetIssuerID

func (ic *InvoiceCreate) SetIssuerID(id uuid.UUID) *InvoiceCreate

SetIssuerID sets the "issuer" edge to the Issuer entity by ID.

func (*InvoiceCreate) SetNillableAskingPrice

func (ic *InvoiceCreate) SetNillableAskingPrice(f *float64) *InvoiceCreate

SetNillableAskingPrice sets the "asking_price" field if the given value is not nil.

func (*InvoiceCreate) SetNillableCompanyName

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

SetNillableCompanyName sets the "company_name" field if the given value is not nil.

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) SetNillableCurrency

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

SetNillableCurrency sets the "currency" 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) SetNillableIsApproved

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

SetNillableIsApproved sets the "is_approved" field if the given value is not nil.

func (*InvoiceCreate) SetNillableIsLocked

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

SetNillableIsLocked sets the "is_locked" field if the given value is not nil.

func (*InvoiceCreate) SetNillableReference

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

SetNillableReference sets the "reference" field if the given value is not nil.

func (*InvoiceCreate) SetNillableStatus

func (ic *InvoiceCreate) SetNillableStatus(i *invoice.Status) *InvoiceCreate

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

func (*InvoiceCreate) SetNillableTotalAmount

func (ic *InvoiceCreate) SetNillableTotalAmount(f *float64) *InvoiceCreate

SetNillableTotalAmount sets the "total_amount" field if the given value is not nil.

func (*InvoiceCreate) SetNillableTotalVat

func (ic *InvoiceCreate) SetNillableTotalVat(f *float64) *InvoiceCreate

SetNillableTotalVat sets the "total_vat" field if the given value is not nil.

func (*InvoiceCreate) SetReference

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

SetReference sets the "reference" field.

func (*InvoiceCreate) SetStatus

func (ic *InvoiceCreate) SetStatus(i invoice.Status) *InvoiceCreate

SetStatus sets the "status" field.

func (*InvoiceCreate) SetTotalAmount

func (ic *InvoiceCreate) SetTotalAmount(f float64) *InvoiceCreate

SetTotalAmount sets the "total_amount" field.

func (*InvoiceCreate) SetTotalVat

func (ic *InvoiceCreate) SetTotalVat(f float64) *InvoiceCreate

SetTotalVat sets the "total_vat" 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 {
	// Items holds the value of the items edge.
	Items []*InvoiceItem `json:"items,omitempty"`
	// Bids holds the value of the bids edge.
	Bids []*Bid `json:"bids,omitempty"`
	// Issuer holds the value of the issuer edge.
	Issuer *Issuer `json:"issuer,omitempty"`
	// Investor holds the value of the investor edge.
	Investor []*Investor `json:"investor,omitempty"`
	// contains filtered or unexported fields
}

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

func (InvoiceEdges) BidsOrErr

func (e InvoiceEdges) BidsOrErr() ([]*Bid, error)

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

func (InvoiceEdges) InvestorOrErr

func (e InvoiceEdges) InvestorOrErr() ([]*Investor, error)

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

func (InvoiceEdges) IssuerOrErr

func (e InvoiceEdges) IssuerOrErr() (*Issuer, error)

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

func (InvoiceEdges) ItemsOrErr

func (e InvoiceEdges) ItemsOrErr() ([]*InvoiceItem, error)

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

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 InvoiceItem

type InvoiceItem struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Quantity holds the value of the "quantity" field.
	Quantity int `json:"quantity,omitempty"`
	// UnitPrice holds the value of the "unit_price" field.
	UnitPrice float64 `json:"unit_price,omitempty"`
	// Amount holds the value of the "amount" field.
	Amount float64 `json:"amount,omitempty"`
	// VatRate holds the value of the "vat_rate" field.
	VatRate float64 `json:"vat_rate,omitempty"`
	// VatAmount holds the value of the "vat_amount" field.
	VatAmount float64 `json:"vat_amount,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the InvoiceItemQuery when eager-loading is set.
	Edges InvoiceItemEdges `json:"edges"`
	// contains filtered or unexported fields
}

InvoiceItem is the model entity for the InvoiceItem schema.

func (*InvoiceItem) QueryInvoice

func (ii *InvoiceItem) QueryInvoice() *InvoiceQuery

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

func (*InvoiceItem) String

func (ii *InvoiceItem) String() string

String implements the fmt.Stringer.

func (*InvoiceItem) Unwrap

func (ii *InvoiceItem) Unwrap() *InvoiceItem

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

func (ii *InvoiceItem) Update() *InvoiceItemUpdateOne

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

func (*InvoiceItem) Value

func (ii *InvoiceItem) Value(name string) (ent.Value, error)

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

type InvoiceItemClient

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

InvoiceItemClient is a client for the InvoiceItem schema.

func NewInvoiceItemClient

func NewInvoiceItemClient(c config) *InvoiceItemClient

NewInvoiceItemClient returns a client for the InvoiceItem from the given config.

func (*InvoiceItemClient) Create

func (c *InvoiceItemClient) Create() *InvoiceItemCreate

Create returns a builder for creating a InvoiceItem entity.

func (*InvoiceItemClient) CreateBulk

func (c *InvoiceItemClient) CreateBulk(builders ...*InvoiceItemCreate) *InvoiceItemCreateBulk

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

func (*InvoiceItemClient) Delete

func (c *InvoiceItemClient) Delete() *InvoiceItemDelete

Delete returns a delete builder for InvoiceItem.

func (*InvoiceItemClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*InvoiceItemClient) DeleteOneID

func (c *InvoiceItemClient) DeleteOneID(id uuid.UUID) *InvoiceItemDeleteOne

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

func (*InvoiceItemClient) Get

Get returns a InvoiceItem entity by its id.

func (*InvoiceItemClient) GetX

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

func (*InvoiceItemClient) Hooks

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

Hooks returns the client hooks.

func (*InvoiceItemClient) Intercept

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

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

func (*InvoiceItemClient) Interceptors

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

Interceptors returns the client interceptors.

func (*InvoiceItemClient) Query

func (c *InvoiceItemClient) Query() *InvoiceItemQuery

Query returns a query builder for InvoiceItem.

func (*InvoiceItemClient) QueryInvoice

func (c *InvoiceItemClient) QueryInvoice(ii *InvoiceItem) *InvoiceQuery

QueryInvoice queries the invoice edge of a InvoiceItem.

func (*InvoiceItemClient) Update

func (c *InvoiceItemClient) Update() *InvoiceItemUpdate

Update returns an update builder for InvoiceItem.

func (*InvoiceItemClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*InvoiceItemClient) UpdateOneID

func (c *InvoiceItemClient) UpdateOneID(id uuid.UUID) *InvoiceItemUpdateOne

UpdateOneID returns an update builder for the given id.

func (*InvoiceItemClient) Use

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

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

type InvoiceItemCreate

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

InvoiceItemCreate is the builder for creating a InvoiceItem entity.

func (*InvoiceItemCreate) Exec

func (iic *InvoiceItemCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*InvoiceItemCreate) ExecX

func (iic *InvoiceItemCreate) ExecX(ctx context.Context)

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

func (*InvoiceItemCreate) Mutation

func (iic *InvoiceItemCreate) Mutation() *InvoiceItemMutation

Mutation returns the InvoiceItemMutation object of the builder.

func (*InvoiceItemCreate) Save

func (iic *InvoiceItemCreate) Save(ctx context.Context) (*InvoiceItem, error)

Save creates the InvoiceItem in the database.

func (*InvoiceItemCreate) SaveX

func (iic *InvoiceItemCreate) SaveX(ctx context.Context) *InvoiceItem

SaveX calls Save and panics if Save returns an error.

func (*InvoiceItemCreate) SetAmount

func (iic *InvoiceItemCreate) SetAmount(f float64) *InvoiceItemCreate

SetAmount sets the "amount" field.

func (*InvoiceItemCreate) SetDescription

func (iic *InvoiceItemCreate) SetDescription(s string) *InvoiceItemCreate

SetDescription sets the "description" field.

func (*InvoiceItemCreate) SetID

SetID sets the "id" field.

func (*InvoiceItemCreate) SetInvoice

func (iic *InvoiceItemCreate) SetInvoice(i *Invoice) *InvoiceItemCreate

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

func (*InvoiceItemCreate) SetInvoiceID

func (iic *InvoiceItemCreate) SetInvoiceID(id uuid.UUID) *InvoiceItemCreate

SetInvoiceID sets the "invoice" edge to the Invoice entity by ID.

func (*InvoiceItemCreate) SetNillableID

func (iic *InvoiceItemCreate) SetNillableID(u *uuid.UUID) *InvoiceItemCreate

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

func (*InvoiceItemCreate) SetNillableInvoiceID

func (iic *InvoiceItemCreate) SetNillableInvoiceID(id *uuid.UUID) *InvoiceItemCreate

SetNillableInvoiceID sets the "invoice" edge to the Invoice entity by ID if the given value is not nil.

func (*InvoiceItemCreate) SetNillableVatAmount

func (iic *InvoiceItemCreate) SetNillableVatAmount(f *float64) *InvoiceItemCreate

SetNillableVatAmount sets the "vat_amount" field if the given value is not nil.

func (*InvoiceItemCreate) SetNillableVatRate

func (iic *InvoiceItemCreate) SetNillableVatRate(f *float64) *InvoiceItemCreate

SetNillableVatRate sets the "vat_rate" field if the given value is not nil.

func (*InvoiceItemCreate) SetQuantity

func (iic *InvoiceItemCreate) SetQuantity(i int) *InvoiceItemCreate

SetQuantity sets the "quantity" field.

func (*InvoiceItemCreate) SetUnitPrice

func (iic *InvoiceItemCreate) SetUnitPrice(f float64) *InvoiceItemCreate

SetUnitPrice sets the "unit_price" field.

func (*InvoiceItemCreate) SetVatAmount

func (iic *InvoiceItemCreate) SetVatAmount(f float64) *InvoiceItemCreate

SetVatAmount sets the "vat_amount" field.

func (*InvoiceItemCreate) SetVatRate

func (iic *InvoiceItemCreate) SetVatRate(f float64) *InvoiceItemCreate

SetVatRate sets the "vat_rate" field.

type InvoiceItemCreateBulk

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

InvoiceItemCreateBulk is the builder for creating many InvoiceItem entities in bulk.

func (*InvoiceItemCreateBulk) Exec

func (iicb *InvoiceItemCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*InvoiceItemCreateBulk) ExecX

func (iicb *InvoiceItemCreateBulk) ExecX(ctx context.Context)

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

func (*InvoiceItemCreateBulk) Save

func (iicb *InvoiceItemCreateBulk) Save(ctx context.Context) ([]*InvoiceItem, error)

Save creates the InvoiceItem entities in the database.

func (*InvoiceItemCreateBulk) SaveX

func (iicb *InvoiceItemCreateBulk) SaveX(ctx context.Context) []*InvoiceItem

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

type InvoiceItemDelete

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

InvoiceItemDelete is the builder for deleting a InvoiceItem entity.

func (*InvoiceItemDelete) Exec

func (iid *InvoiceItemDelete) Exec(ctx context.Context) (int, error)

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

func (*InvoiceItemDelete) ExecX

func (iid *InvoiceItemDelete) ExecX(ctx context.Context) int

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

func (*InvoiceItemDelete) Where

Where appends a list predicates to the InvoiceItemDelete builder.

type InvoiceItemDeleteOne

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

InvoiceItemDeleteOne is the builder for deleting a single InvoiceItem entity.

func (*InvoiceItemDeleteOne) Exec

func (iido *InvoiceItemDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*InvoiceItemDeleteOne) ExecX

func (iido *InvoiceItemDeleteOne) ExecX(ctx context.Context)

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

func (*InvoiceItemDeleteOne) Where

Where appends a list predicates to the InvoiceItemDelete builder.

type InvoiceItemEdges

type InvoiceItemEdges struct {
	// Invoice holds the value of the invoice edge.
	Invoice *Invoice `json:"invoice,omitempty"`
	// contains filtered or unexported fields
}

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

func (InvoiceItemEdges) InvoiceOrErr

func (e InvoiceItemEdges) 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.

type InvoiceItemGroupBy

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

InvoiceItemGroupBy is the group-by builder for InvoiceItem entities.

func (*InvoiceItemGroupBy) Aggregate

func (iigb *InvoiceItemGroupBy) Aggregate(fns ...AggregateFunc) *InvoiceItemGroupBy

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

func (*InvoiceItemGroupBy) Bool

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

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

func (*InvoiceItemGroupBy) BoolX

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

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

func (*InvoiceItemGroupBy) Bools

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

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

func (*InvoiceItemGroupBy) BoolsX

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

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

func (*InvoiceItemGroupBy) Float64

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

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

func (*InvoiceItemGroupBy) Float64X

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

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

func (*InvoiceItemGroupBy) Float64s

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

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

func (*InvoiceItemGroupBy) Float64sX

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

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

func (*InvoiceItemGroupBy) Int

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

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

func (*InvoiceItemGroupBy) IntX

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

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

func (*InvoiceItemGroupBy) Ints

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

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

func (*InvoiceItemGroupBy) IntsX

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

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

func (*InvoiceItemGroupBy) Scan

func (iigb *InvoiceItemGroupBy) Scan(ctx context.Context, v any) error

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

func (*InvoiceItemGroupBy) ScanX

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

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

func (*InvoiceItemGroupBy) String

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

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

func (*InvoiceItemGroupBy) StringX

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

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

func (*InvoiceItemGroupBy) Strings

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

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

func (*InvoiceItemGroupBy) StringsX

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

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

type InvoiceItemMutation

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

InvoiceItemMutation represents an operation that mutates the InvoiceItem nodes in the graph.

func (*InvoiceItemMutation) AddAmount

func (m *InvoiceItemMutation) AddAmount(f float64)

AddAmount adds f to the "amount" field.

func (*InvoiceItemMutation) AddField

func (m *InvoiceItemMutation) 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 (*InvoiceItemMutation) AddQuantity

func (m *InvoiceItemMutation) AddQuantity(i int)

AddQuantity adds i to the "quantity" field.

func (*InvoiceItemMutation) AddUnitPrice

func (m *InvoiceItemMutation) AddUnitPrice(f float64)

AddUnitPrice adds f to the "unit_price" field.

func (*InvoiceItemMutation) AddVatAmount

func (m *InvoiceItemMutation) AddVatAmount(f float64)

AddVatAmount adds f to the "vat_amount" field.

func (*InvoiceItemMutation) AddVatRate

func (m *InvoiceItemMutation) AddVatRate(f float64)

AddVatRate adds f to the "vat_rate" field.

func (*InvoiceItemMutation) AddedAmount

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

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

func (*InvoiceItemMutation) AddedEdges

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

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

func (*InvoiceItemMutation) AddedField

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

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

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

func (*InvoiceItemMutation) AddedIDs

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

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

func (*InvoiceItemMutation) AddedQuantity

func (m *InvoiceItemMutation) AddedQuantity() (r int, exists bool)

AddedQuantity returns the value that was added to the "quantity" field in this mutation.

func (*InvoiceItemMutation) AddedUnitPrice

func (m *InvoiceItemMutation) AddedUnitPrice() (r float64, exists bool)

AddedUnitPrice returns the value that was added to the "unit_price" field in this mutation.

func (*InvoiceItemMutation) AddedVatAmount

func (m *InvoiceItemMutation) AddedVatAmount() (r float64, exists bool)

AddedVatAmount returns the value that was added to the "vat_amount" field in this mutation.

func (*InvoiceItemMutation) AddedVatRate

func (m *InvoiceItemMutation) AddedVatRate() (r float64, exists bool)

AddedVatRate returns the value that was added to the "vat_rate" field in this mutation.

func (*InvoiceItemMutation) Amount

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

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

func (*InvoiceItemMutation) ClearEdge

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

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

func (m *InvoiceItemMutation) ClearInvoice()

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

func (*InvoiceItemMutation) ClearedEdges

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

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

func (*InvoiceItemMutation) ClearedFields

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

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

func (InvoiceItemMutation) Client

func (m InvoiceItemMutation) 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 (*InvoiceItemMutation) Description

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

Description returns the value of the "description" field in the mutation.

func (*InvoiceItemMutation) EdgeCleared

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

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

func (*InvoiceItemMutation) Field

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

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

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

func (*InvoiceItemMutation) Fields

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

func (m *InvoiceItemMutation) 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 (*InvoiceItemMutation) IDs

func (m *InvoiceItemMutation) 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 (*InvoiceItemMutation) InvoiceCleared

func (m *InvoiceItemMutation) InvoiceCleared() bool

InvoiceCleared reports if the "invoice" edge to the Invoice entity was cleared.

func (*InvoiceItemMutation) InvoiceID

func (m *InvoiceItemMutation) InvoiceID() (id uuid.UUID, exists bool)

InvoiceID returns the "invoice" edge ID in the mutation.

func (*InvoiceItemMutation) InvoiceIDs

func (m *InvoiceItemMutation) 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 (*InvoiceItemMutation) OldAmount

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

OldAmount returns the old "amount" field's value of the InvoiceItem entity. If the InvoiceItem 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 (*InvoiceItemMutation) OldDescription

func (m *InvoiceItemMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the InvoiceItem entity. If the InvoiceItem 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 (*InvoiceItemMutation) OldField

func (m *InvoiceItemMutation) 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 (*InvoiceItemMutation) OldQuantity

func (m *InvoiceItemMutation) OldQuantity(ctx context.Context) (v int, err error)

OldQuantity returns the old "quantity" field's value of the InvoiceItem entity. If the InvoiceItem 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 (*InvoiceItemMutation) OldUnitPrice

func (m *InvoiceItemMutation) OldUnitPrice(ctx context.Context) (v float64, err error)

OldUnitPrice returns the old "unit_price" field's value of the InvoiceItem entity. If the InvoiceItem 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 (*InvoiceItemMutation) OldVatAmount

func (m *InvoiceItemMutation) OldVatAmount(ctx context.Context) (v float64, err error)

OldVatAmount returns the old "vat_amount" field's value of the InvoiceItem entity. If the InvoiceItem 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 (*InvoiceItemMutation) OldVatRate

func (m *InvoiceItemMutation) OldVatRate(ctx context.Context) (v float64, err error)

OldVatRate returns the old "vat_rate" field's value of the InvoiceItem entity. If the InvoiceItem 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 (*InvoiceItemMutation) Op

func (m *InvoiceItemMutation) Op() Op

Op returns the operation name.

func (*InvoiceItemMutation) Quantity

func (m *InvoiceItemMutation) Quantity() (r int, exists bool)

Quantity returns the value of the "quantity" field in the mutation.

func (*InvoiceItemMutation) RemovedEdges

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

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

func (*InvoiceItemMutation) RemovedIDs

func (m *InvoiceItemMutation) 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 (*InvoiceItemMutation) ResetAmount

func (m *InvoiceItemMutation) ResetAmount()

ResetAmount resets all changes to the "amount" field.

func (*InvoiceItemMutation) ResetDescription

func (m *InvoiceItemMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*InvoiceItemMutation) ResetEdge

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

func (m *InvoiceItemMutation) 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 (*InvoiceItemMutation) ResetInvoice

func (m *InvoiceItemMutation) ResetInvoice()

ResetInvoice resets all changes to the "invoice" edge.

func (*InvoiceItemMutation) ResetQuantity

func (m *InvoiceItemMutation) ResetQuantity()

ResetQuantity resets all changes to the "quantity" field.

func (*InvoiceItemMutation) ResetUnitPrice

func (m *InvoiceItemMutation) ResetUnitPrice()

ResetUnitPrice resets all changes to the "unit_price" field.

func (*InvoiceItemMutation) ResetVatAmount

func (m *InvoiceItemMutation) ResetVatAmount()

ResetVatAmount resets all changes to the "vat_amount" field.

func (*InvoiceItemMutation) ResetVatRate

func (m *InvoiceItemMutation) ResetVatRate()

ResetVatRate resets all changes to the "vat_rate" field.

func (*InvoiceItemMutation) SetAmount

func (m *InvoiceItemMutation) SetAmount(f float64)

SetAmount sets the "amount" field.

func (*InvoiceItemMutation) SetDescription

func (m *InvoiceItemMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*InvoiceItemMutation) SetField

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

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

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

func (*InvoiceItemMutation) SetInvoiceID

func (m *InvoiceItemMutation) SetInvoiceID(id uuid.UUID)

SetInvoiceID sets the "invoice" edge to the Invoice entity by id.

func (*InvoiceItemMutation) SetOp

func (m *InvoiceItemMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*InvoiceItemMutation) SetQuantity

func (m *InvoiceItemMutation) SetQuantity(i int)

SetQuantity sets the "quantity" field.

func (*InvoiceItemMutation) SetUnitPrice

func (m *InvoiceItemMutation) SetUnitPrice(f float64)

SetUnitPrice sets the "unit_price" field.

func (*InvoiceItemMutation) SetVatAmount

func (m *InvoiceItemMutation) SetVatAmount(f float64)

SetVatAmount sets the "vat_amount" field.

func (*InvoiceItemMutation) SetVatRate

func (m *InvoiceItemMutation) SetVatRate(f float64)

SetVatRate sets the "vat_rate" field.

func (InvoiceItemMutation) Tx

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

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

func (*InvoiceItemMutation) Type

func (m *InvoiceItemMutation) Type() string

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

func (*InvoiceItemMutation) UnitPrice

func (m *InvoiceItemMutation) UnitPrice() (r float64, exists bool)

UnitPrice returns the value of the "unit_price" field in the mutation.

func (*InvoiceItemMutation) VatAmount

func (m *InvoiceItemMutation) VatAmount() (r float64, exists bool)

VatAmount returns the value of the "vat_amount" field in the mutation.

func (*InvoiceItemMutation) VatRate

func (m *InvoiceItemMutation) VatRate() (r float64, exists bool)

VatRate returns the value of the "vat_rate" field in the mutation.

func (*InvoiceItemMutation) Where

func (m *InvoiceItemMutation) Where(ps ...predicate.InvoiceItem)

Where appends a list predicates to the InvoiceItemMutation builder.

func (*InvoiceItemMutation) WhereP

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

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

type InvoiceItemQuery

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

InvoiceItemQuery is the builder for querying InvoiceItem entities.

func (*InvoiceItemQuery) Aggregate

func (iiq *InvoiceItemQuery) Aggregate(fns ...AggregateFunc) *InvoiceItemSelect

Aggregate returns a InvoiceItemSelect configured with the given aggregations.

func (*InvoiceItemQuery) All

func (iiq *InvoiceItemQuery) All(ctx context.Context) ([]*InvoiceItem, error)

All executes the query and returns a list of InvoiceItems.

func (*InvoiceItemQuery) AllX

func (iiq *InvoiceItemQuery) AllX(ctx context.Context) []*InvoiceItem

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

func (*InvoiceItemQuery) Clone

func (iiq *InvoiceItemQuery) Clone() *InvoiceItemQuery

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

func (*InvoiceItemQuery) Count

func (iiq *InvoiceItemQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*InvoiceItemQuery) CountX

func (iiq *InvoiceItemQuery) CountX(ctx context.Context) int

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

func (*InvoiceItemQuery) Exist

func (iiq *InvoiceItemQuery) Exist(ctx context.Context) (bool, error)

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

func (*InvoiceItemQuery) ExistX

func (iiq *InvoiceItemQuery) ExistX(ctx context.Context) bool

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

func (*InvoiceItemQuery) First

func (iiq *InvoiceItemQuery) First(ctx context.Context) (*InvoiceItem, error)

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

func (*InvoiceItemQuery) FirstID

func (iiq *InvoiceItemQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*InvoiceItemQuery) FirstIDX

func (iiq *InvoiceItemQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*InvoiceItemQuery) FirstX

func (iiq *InvoiceItemQuery) FirstX(ctx context.Context) *InvoiceItem

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

func (*InvoiceItemQuery) GroupBy

func (iiq *InvoiceItemQuery) GroupBy(field string, fields ...string) *InvoiceItemGroupBy

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 {
	Description string `json:"description,omitempty"`
	Count int `json:"count,omitempty"`
}

client.InvoiceItem.Query().
	GroupBy(invoiceitem.FieldDescription).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*InvoiceItemQuery) IDs

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

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

func (*InvoiceItemQuery) IDsX

func (iiq *InvoiceItemQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*InvoiceItemQuery) Limit

func (iiq *InvoiceItemQuery) Limit(limit int) *InvoiceItemQuery

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

func (*InvoiceItemQuery) Offset

func (iiq *InvoiceItemQuery) Offset(offset int) *InvoiceItemQuery

Offset to start from.

func (*InvoiceItemQuery) Only

func (iiq *InvoiceItemQuery) Only(ctx context.Context) (*InvoiceItem, error)

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

func (*InvoiceItemQuery) OnlyID

func (iiq *InvoiceItemQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*InvoiceItemQuery) OnlyIDX

func (iiq *InvoiceItemQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*InvoiceItemQuery) OnlyX

func (iiq *InvoiceItemQuery) OnlyX(ctx context.Context) *InvoiceItem

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

func (*InvoiceItemQuery) Order

Order specifies how the records should be ordered.

func (*InvoiceItemQuery) QueryInvoice

func (iiq *InvoiceItemQuery) QueryInvoice() *InvoiceQuery

QueryInvoice chains the current query on the "invoice" edge.

func (*InvoiceItemQuery) Select

func (iiq *InvoiceItemQuery) Select(fields ...string) *InvoiceItemSelect

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 {
	Description string `json:"description,omitempty"`
}

client.InvoiceItem.Query().
	Select(invoiceitem.FieldDescription).
	Scan(ctx, &v)

func (*InvoiceItemQuery) Unique

func (iiq *InvoiceItemQuery) Unique(unique bool) *InvoiceItemQuery

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

Where adds a new predicate for the InvoiceItemQuery builder.

func (*InvoiceItemQuery) WithInvoice

func (iiq *InvoiceItemQuery) WithInvoice(opts ...func(*InvoiceQuery)) *InvoiceItemQuery

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.

type InvoiceItemSelect

type InvoiceItemSelect struct {
	*InvoiceItemQuery
	// contains filtered or unexported fields
}

InvoiceItemSelect is the builder for selecting fields of InvoiceItem entities.

func (*InvoiceItemSelect) Aggregate

func (iis *InvoiceItemSelect) Aggregate(fns ...AggregateFunc) *InvoiceItemSelect

Aggregate adds the given aggregation functions to the selector query.

func (*InvoiceItemSelect) Bool

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

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

func (*InvoiceItemSelect) BoolX

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

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

func (*InvoiceItemSelect) Bools

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

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

func (*InvoiceItemSelect) BoolsX

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

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

func (*InvoiceItemSelect) Float64

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

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

func (*InvoiceItemSelect) Float64X

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

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

func (*InvoiceItemSelect) Float64s

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

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

func (*InvoiceItemSelect) Float64sX

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

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

func (*InvoiceItemSelect) Int

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

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

func (*InvoiceItemSelect) IntX

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

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

func (*InvoiceItemSelect) Ints

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

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

func (*InvoiceItemSelect) IntsX

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

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

func (*InvoiceItemSelect) Scan

func (iis *InvoiceItemSelect) Scan(ctx context.Context, v any) error

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

func (*InvoiceItemSelect) ScanX

func (s *InvoiceItemSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*InvoiceItemSelect) String

func (s *InvoiceItemSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*InvoiceItemSelect) StringX

func (s *InvoiceItemSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*InvoiceItemSelect) Strings

func (s *InvoiceItemSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*InvoiceItemSelect) StringsX

func (s *InvoiceItemSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type InvoiceItemUpdate

type InvoiceItemUpdate struct {
	// contains filtered or unexported fields
}

InvoiceItemUpdate is the builder for updating InvoiceItem entities.

func (*InvoiceItemUpdate) AddAmount

func (iiu *InvoiceItemUpdate) AddAmount(f float64) *InvoiceItemUpdate

AddAmount adds f to the "amount" field.

func (*InvoiceItemUpdate) AddQuantity

func (iiu *InvoiceItemUpdate) AddQuantity(i int) *InvoiceItemUpdate

AddQuantity adds i to the "quantity" field.

func (*InvoiceItemUpdate) AddUnitPrice

func (iiu *InvoiceItemUpdate) AddUnitPrice(f float64) *InvoiceItemUpdate

AddUnitPrice adds f to the "unit_price" field.

func (*InvoiceItemUpdate) AddVatAmount

func (iiu *InvoiceItemUpdate) AddVatAmount(f float64) *InvoiceItemUpdate

AddVatAmount adds f to the "vat_amount" field.

func (*InvoiceItemUpdate) AddVatRate

func (iiu *InvoiceItemUpdate) AddVatRate(f float64) *InvoiceItemUpdate

AddVatRate adds f to the "vat_rate" field.

func (*InvoiceItemUpdate) ClearInvoice

func (iiu *InvoiceItemUpdate) ClearInvoice() *InvoiceItemUpdate

ClearInvoice clears the "invoice" edge to the Invoice entity.

func (*InvoiceItemUpdate) Exec

func (iiu *InvoiceItemUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*InvoiceItemUpdate) ExecX

func (iiu *InvoiceItemUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*InvoiceItemUpdate) Mutation

func (iiu *InvoiceItemUpdate) Mutation() *InvoiceItemMutation

Mutation returns the InvoiceItemMutation object of the builder.

func (*InvoiceItemUpdate) Save

func (iiu *InvoiceItemUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*InvoiceItemUpdate) SaveX

func (iiu *InvoiceItemUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*InvoiceItemUpdate) SetAmount

func (iiu *InvoiceItemUpdate) SetAmount(f float64) *InvoiceItemUpdate

SetAmount sets the "amount" field.

func (*InvoiceItemUpdate) SetDescription

func (iiu *InvoiceItemUpdate) SetDescription(s string) *InvoiceItemUpdate

SetDescription sets the "description" field.

func (*InvoiceItemUpdate) SetInvoice

func (iiu *InvoiceItemUpdate) SetInvoice(i *Invoice) *InvoiceItemUpdate

SetInvoice sets the "invoice" edge to the Invoice entity.

func (*InvoiceItemUpdate) SetInvoiceID

func (iiu *InvoiceItemUpdate) SetInvoiceID(id uuid.UUID) *InvoiceItemUpdate

SetInvoiceID sets the "invoice" edge to the Invoice entity by ID.

func (*InvoiceItemUpdate) SetNillableInvoiceID

func (iiu *InvoiceItemUpdate) SetNillableInvoiceID(id *uuid.UUID) *InvoiceItemUpdate

SetNillableInvoiceID sets the "invoice" edge to the Invoice entity by ID if the given value is not nil.

func (*InvoiceItemUpdate) SetNillableVatAmount

func (iiu *InvoiceItemUpdate) SetNillableVatAmount(f *float64) *InvoiceItemUpdate

SetNillableVatAmount sets the "vat_amount" field if the given value is not nil.

func (*InvoiceItemUpdate) SetNillableVatRate

func (iiu *InvoiceItemUpdate) SetNillableVatRate(f *float64) *InvoiceItemUpdate

SetNillableVatRate sets the "vat_rate" field if the given value is not nil.

func (*InvoiceItemUpdate) SetQuantity

func (iiu *InvoiceItemUpdate) SetQuantity(i int) *InvoiceItemUpdate

SetQuantity sets the "quantity" field.

func (*InvoiceItemUpdate) SetUnitPrice

func (iiu *InvoiceItemUpdate) SetUnitPrice(f float64) *InvoiceItemUpdate

SetUnitPrice sets the "unit_price" field.

func (*InvoiceItemUpdate) SetVatAmount

func (iiu *InvoiceItemUpdate) SetVatAmount(f float64) *InvoiceItemUpdate

SetVatAmount sets the "vat_amount" field.

func (*InvoiceItemUpdate) SetVatRate

func (iiu *InvoiceItemUpdate) SetVatRate(f float64) *InvoiceItemUpdate

SetVatRate sets the "vat_rate" field.

func (*InvoiceItemUpdate) Where

Where appends a list predicates to the InvoiceItemUpdate builder.

type InvoiceItemUpdateOne

type InvoiceItemUpdateOne struct {
	// contains filtered or unexported fields
}

InvoiceItemUpdateOne is the builder for updating a single InvoiceItem entity.

func (*InvoiceItemUpdateOne) AddAmount

AddAmount adds f to the "amount" field.

func (*InvoiceItemUpdateOne) AddQuantity

func (iiuo *InvoiceItemUpdateOne) AddQuantity(i int) *InvoiceItemUpdateOne

AddQuantity adds i to the "quantity" field.

func (*InvoiceItemUpdateOne) AddUnitPrice

func (iiuo *InvoiceItemUpdateOne) AddUnitPrice(f float64) *InvoiceItemUpdateOne

AddUnitPrice adds f to the "unit_price" field.

func (*InvoiceItemUpdateOne) AddVatAmount

func (iiuo *InvoiceItemUpdateOne) AddVatAmount(f float64) *InvoiceItemUpdateOne

AddVatAmount adds f to the "vat_amount" field.

func (*InvoiceItemUpdateOne) AddVatRate

func (iiuo *InvoiceItemUpdateOne) AddVatRate(f float64) *InvoiceItemUpdateOne

AddVatRate adds f to the "vat_rate" field.

func (*InvoiceItemUpdateOne) ClearInvoice

func (iiuo *InvoiceItemUpdateOne) ClearInvoice() *InvoiceItemUpdateOne

ClearInvoice clears the "invoice" edge to the Invoice entity.

func (*InvoiceItemUpdateOne) Exec

func (iiuo *InvoiceItemUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*InvoiceItemUpdateOne) ExecX

func (iiuo *InvoiceItemUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*InvoiceItemUpdateOne) Mutation

func (iiuo *InvoiceItemUpdateOne) Mutation() *InvoiceItemMutation

Mutation returns the InvoiceItemMutation object of the builder.

func (*InvoiceItemUpdateOne) Save

Save executes the query and returns the updated InvoiceItem entity.

func (*InvoiceItemUpdateOne) SaveX

func (iiuo *InvoiceItemUpdateOne) SaveX(ctx context.Context) *InvoiceItem

SaveX is like Save, but panics if an error occurs.

func (*InvoiceItemUpdateOne) Select

func (iiuo *InvoiceItemUpdateOne) Select(field string, fields ...string) *InvoiceItemUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*InvoiceItemUpdateOne) SetAmount

SetAmount sets the "amount" field.

func (*InvoiceItemUpdateOne) SetDescription

func (iiuo *InvoiceItemUpdateOne) SetDescription(s string) *InvoiceItemUpdateOne

SetDescription sets the "description" field.

func (*InvoiceItemUpdateOne) SetInvoice

func (iiuo *InvoiceItemUpdateOne) SetInvoice(i *Invoice) *InvoiceItemUpdateOne

SetInvoice sets the "invoice" edge to the Invoice entity.

func (*InvoiceItemUpdateOne) SetInvoiceID

func (iiuo *InvoiceItemUpdateOne) SetInvoiceID(id uuid.UUID) *InvoiceItemUpdateOne

SetInvoiceID sets the "invoice" edge to the Invoice entity by ID.

func (*InvoiceItemUpdateOne) SetNillableInvoiceID

func (iiuo *InvoiceItemUpdateOne) SetNillableInvoiceID(id *uuid.UUID) *InvoiceItemUpdateOne

SetNillableInvoiceID sets the "invoice" edge to the Invoice entity by ID if the given value is not nil.

func (*InvoiceItemUpdateOne) SetNillableVatAmount

func (iiuo *InvoiceItemUpdateOne) SetNillableVatAmount(f *float64) *InvoiceItemUpdateOne

SetNillableVatAmount sets the "vat_amount" field if the given value is not nil.

func (*InvoiceItemUpdateOne) SetNillableVatRate

func (iiuo *InvoiceItemUpdateOne) SetNillableVatRate(f *float64) *InvoiceItemUpdateOne

SetNillableVatRate sets the "vat_rate" field if the given value is not nil.

func (*InvoiceItemUpdateOne) SetQuantity

func (iiuo *InvoiceItemUpdateOne) SetQuantity(i int) *InvoiceItemUpdateOne

SetQuantity sets the "quantity" field.

func (*InvoiceItemUpdateOne) SetUnitPrice

func (iiuo *InvoiceItemUpdateOne) SetUnitPrice(f float64) *InvoiceItemUpdateOne

SetUnitPrice sets the "unit_price" field.

func (*InvoiceItemUpdateOne) SetVatAmount

func (iiuo *InvoiceItemUpdateOne) SetVatAmount(f float64) *InvoiceItemUpdateOne

SetVatAmount sets the "vat_amount" field.

func (*InvoiceItemUpdateOne) SetVatRate

func (iiuo *InvoiceItemUpdateOne) SetVatRate(f float64) *InvoiceItemUpdateOne

SetVatRate sets the "vat_rate" field.

func (*InvoiceItemUpdateOne) Where

Where appends a list predicates to the InvoiceItemUpdate builder.

type InvoiceItems

type InvoiceItems []*InvoiceItem

InvoiceItems is a parsable slice of InvoiceItem.

type InvoiceMutation

type InvoiceMutation struct {
	// contains filtered or unexported fields
}

InvoiceMutation represents an operation that mutates the Invoice nodes in the graph.

func (*InvoiceMutation) AddAmountDue

func (m *InvoiceMutation) AddAmountDue(f float64)

AddAmountDue adds f to the "amount_due" field.

func (*InvoiceMutation) AddAskingPrice

func (m *InvoiceMutation) AddAskingPrice(f float64)

AddAskingPrice adds f to the "asking_price" field.

func (*InvoiceMutation) AddBidIDs

func (m *InvoiceMutation) AddBidIDs(ids ...uuid.UUID)

AddBidIDs adds the "bids" edge to the Bid entity by ids.

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) AddInvestorIDs

func (m *InvoiceMutation) AddInvestorIDs(ids ...uuid.UUID)

AddInvestorIDs adds the "investor" edge to the Investor entity by ids.

func (*InvoiceMutation) AddItemIDs

func (m *InvoiceMutation) AddItemIDs(ids ...uuid.UUID)

AddItemIDs adds the "items" edge to the InvoiceItem entity by ids.

func (*InvoiceMutation) AddTotalAmount

func (m *InvoiceMutation) AddTotalAmount(f float64)

AddTotalAmount adds f to the "total_amount" field.

func (*InvoiceMutation) AddTotalVat

func (m *InvoiceMutation) AddTotalVat(f float64)

AddTotalVat adds f to the "total_vat" field.

func (*InvoiceMutation) AddedAmountDue

func (m *InvoiceMutation) AddedAmountDue() (r float64, exists bool)

AddedAmountDue returns the value that was added to the "amount_due" field in this mutation.

func (*InvoiceMutation) AddedAskingPrice

func (m *InvoiceMutation) AddedAskingPrice() (r float64, exists bool)

AddedAskingPrice returns the value that was added to the "asking_price" field in this mutation.

func (*InvoiceMutation) AddedEdges

func (m *InvoiceMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*InvoiceMutation) AddedField

func (m *InvoiceMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*InvoiceMutation) AddedFields

func (m *InvoiceMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*InvoiceMutation) AddedIDs

func (m *InvoiceMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*InvoiceMutation) AddedTotalAmount

func (m *InvoiceMutation) AddedTotalAmount() (r float64, exists bool)

AddedTotalAmount returns the value that was added to the "total_amount" field in this mutation.

func (*InvoiceMutation) AddedTotalVat

func (m *InvoiceMutation) AddedTotalVat() (r float64, exists bool)

AddedTotalVat returns the value that was added to the "total_vat" field in this mutation.

func (*InvoiceMutation) AmountDue

func (m *InvoiceMutation) AmountDue() (r float64, exists bool)

AmountDue returns the value of the "amount_due" field in the mutation.

func (*InvoiceMutation) AskingPrice

func (m *InvoiceMutation) AskingPrice() (r float64, exists bool)

AskingPrice returns the value of the "asking_price" field in the mutation.

func (*InvoiceMutation) BidsCleared

func (m *InvoiceMutation) BidsCleared() bool

BidsCleared reports if the "bids" edge to the Bid entity was cleared.

func (*InvoiceMutation) BidsIDs

func (m *InvoiceMutation) BidsIDs() (ids []uuid.UUID)

BidsIDs returns the "bids" edge IDs in the mutation.

func (*InvoiceMutation) ClearBids

func (m *InvoiceMutation) ClearBids()

ClearBids clears the "bids" edge to the Bid entity.

func (*InvoiceMutation) ClearCompanyName

func (m *InvoiceMutation) ClearCompanyName()

ClearCompanyName clears the value of the "company_name" field.

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) ClearInvestor

func (m *InvoiceMutation) ClearInvestor()

ClearInvestor clears the "investor" edge to the Investor entity.

func (*InvoiceMutation) ClearIssuer

func (m *InvoiceMutation) ClearIssuer()

ClearIssuer clears the "issuer" edge to the Issuer entity.

func (*InvoiceMutation) ClearItems

func (m *InvoiceMutation) ClearItems()

ClearItems clears the "items" edge to the InvoiceItem entity.

func (*InvoiceMutation) ClearReference

func (m *InvoiceMutation) ClearReference()

ClearReference clears the value of the "reference" field.

func (*InvoiceMutation) ClearTotalAmount

func (m *InvoiceMutation) ClearTotalAmount()

ClearTotalAmount clears the value of the "total_amount" field.

func (*InvoiceMutation) ClearTotalVat

func (m *InvoiceMutation) ClearTotalVat()

ClearTotalVat clears the value of the "total_vat" field.

func (*InvoiceMutation) ClearedEdges

func (m *InvoiceMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*InvoiceMutation) ClearedFields

func (m *InvoiceMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (InvoiceMutation) Client

func (m InvoiceMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*InvoiceMutation) CompanyName

func (m *InvoiceMutation) CompanyName() (r string, exists bool)

CompanyName returns the value of the "company_name" field in the mutation.

func (*InvoiceMutation) CompanyNameCleared

func (m *InvoiceMutation) CompanyNameCleared() bool

CompanyNameCleared returns if the "company_name" field was cleared in this mutation.

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) Currency

func (m *InvoiceMutation) Currency() (r string, exists bool)

Currency returns the value of the "currency" field in the mutation.

func (*InvoiceMutation) CustomerName

func (m *InvoiceMutation) CustomerName() (r string, exists bool)

CustomerName returns the value of the "customer_name" field in the mutation.

func (*InvoiceMutation) DueDate

func (m *InvoiceMutation) DueDate() (r time.Time, exists bool)

DueDate returns the value of the "due_date" 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) 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) InvestorCleared

func (m *InvoiceMutation) InvestorCleared() bool

InvestorCleared reports if the "investor" edge to the Investor entity was cleared.

func (*InvoiceMutation) InvestorIDs

func (m *InvoiceMutation) InvestorIDs() (ids []uuid.UUID)

InvestorIDs returns the "investor" edge IDs in the mutation.

func (*InvoiceMutation) InvoiceDate

func (m *InvoiceMutation) InvoiceDate() (r time.Time, exists bool)

InvoiceDate returns the value of the "invoice_date" field in the mutation.

func (*InvoiceMutation) InvoiceNumber

func (m *InvoiceMutation) InvoiceNumber() (r string, exists bool)

InvoiceNumber returns the value of the "invoice_number" field in the mutation.

func (*InvoiceMutation) IsApproved

func (m *InvoiceMutation) IsApproved() (r bool, exists bool)

IsApproved returns the value of the "is_approved" field in the mutation.

func (*InvoiceMutation) IsLocked

func (m *InvoiceMutation) IsLocked() (r bool, exists bool)

IsLocked returns the value of the "is_locked" field in the mutation.

func (*InvoiceMutation) IssuerCleared

func (m *InvoiceMutation) IssuerCleared() bool

IssuerCleared reports if the "issuer" edge to the Issuer entity was cleared.

func (*InvoiceMutation) IssuerID

func (m *InvoiceMutation) IssuerID() (id uuid.UUID, exists bool)

IssuerID returns the "issuer" edge ID in the mutation.

func (*InvoiceMutation) IssuerIDs

func (m *InvoiceMutation) IssuerIDs() (ids []uuid.UUID)

IssuerIDs returns the "issuer" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use IssuerID instead. It exists only for internal usage by the builders.

func (*InvoiceMutation) ItemsCleared

func (m *InvoiceMutation) ItemsCleared() bool

ItemsCleared reports if the "items" edge to the InvoiceItem entity was cleared.

func (*InvoiceMutation) ItemsIDs

func (m *InvoiceMutation) ItemsIDs() (ids []uuid.UUID)

ItemsIDs returns the "items" edge IDs in the mutation.

func (*InvoiceMutation) OldAmountDue

func (m *InvoiceMutation) OldAmountDue(ctx context.Context) (v float64, err error)

OldAmountDue returns the old "amount_due" 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) OldAskingPrice

func (m *InvoiceMutation) OldAskingPrice(ctx context.Context) (v float64, err error)

OldAskingPrice returns the old "asking_price" field's value of the Invoice entity. If the Invoice object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*InvoiceMutation) OldCompanyName

func (m *InvoiceMutation) OldCompanyName(ctx context.Context) (v string, err error)

OldCompanyName returns the old "company_name" 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) 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) OldCurrency

func (m *InvoiceMutation) OldCurrency(ctx context.Context) (v string, err error)

OldCurrency returns the old "currency" field's value of the Invoice entity. If the Invoice object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*InvoiceMutation) OldCustomerName

func (m *InvoiceMutation) OldCustomerName(ctx context.Context) (v string, err error)

OldCustomerName returns the old "customer_name" 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) OldDueDate

func (m *InvoiceMutation) OldDueDate(ctx context.Context) (v time.Time, err error)

OldDueDate returns the old "due_date" 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) OldInvoiceDate

func (m *InvoiceMutation) OldInvoiceDate(ctx context.Context) (v time.Time, err error)

OldInvoiceDate returns the old "invoice_date" 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) OldInvoiceNumber

func (m *InvoiceMutation) OldInvoiceNumber(ctx context.Context) (v string, err error)

OldInvoiceNumber returns the old "invoice_number" 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) OldIsApproved

func (m *InvoiceMutation) OldIsApproved(ctx context.Context) (v bool, err error)

OldIsApproved returns the old "is_approved" 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) OldIsLocked

func (m *InvoiceMutation) OldIsLocked(ctx context.Context) (v bool, err error)

OldIsLocked returns the old "is_locked" 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) OldReference

func (m *InvoiceMutation) OldReference(ctx context.Context) (v string, err error)

OldReference returns the old "reference" field's value of the Invoice entity. If the Invoice object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*InvoiceMutation) OldStatus

func (m *InvoiceMutation) OldStatus(ctx context.Context) (v invoice.Status, err error)

OldStatus returns the old "status" field's value of the Invoice entity. If the Invoice object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*InvoiceMutation) OldTotalAmount

func (m *InvoiceMutation) OldTotalAmount(ctx context.Context) (v float64, err error)

OldTotalAmount returns the old "total_amount" field's value of the Invoice entity. If the Invoice object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*InvoiceMutation) OldTotalVat

func (m *InvoiceMutation) OldTotalVat(ctx context.Context) (v float64, err error)

OldTotalVat returns the old "total_vat" 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) Reference

func (m *InvoiceMutation) Reference() (r string, exists bool)

Reference returns the value of the "reference" field in the mutation.

func (*InvoiceMutation) ReferenceCleared

func (m *InvoiceMutation) ReferenceCleared() bool

ReferenceCleared returns if the "reference" field was cleared in this mutation.

func (*InvoiceMutation) RemoveBidIDs

func (m *InvoiceMutation) RemoveBidIDs(ids ...uuid.UUID)

RemoveBidIDs removes the "bids" edge to the Bid entity by IDs.

func (*InvoiceMutation) RemoveInvestorIDs

func (m *InvoiceMutation) RemoveInvestorIDs(ids ...uuid.UUID)

RemoveInvestorIDs removes the "investor" edge to the Investor entity by IDs.

func (*InvoiceMutation) RemoveItemIDs

func (m *InvoiceMutation) RemoveItemIDs(ids ...uuid.UUID)

RemoveItemIDs removes the "items" edge to the InvoiceItem entity by IDs.

func (*InvoiceMutation) RemovedBidsIDs

func (m *InvoiceMutation) RemovedBidsIDs() (ids []uuid.UUID)

RemovedBids returns the removed IDs of the "bids" edge to the Bid entity.

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) RemovedInvestorIDs

func (m *InvoiceMutation) RemovedInvestorIDs() (ids []uuid.UUID)

RemovedInvestor returns the removed IDs of the "investor" edge to the Investor entity.

func (*InvoiceMutation) RemovedItemsIDs

func (m *InvoiceMutation) RemovedItemsIDs() (ids []uuid.UUID)

RemovedItems returns the removed IDs of the "items" edge to the InvoiceItem entity.

func (*InvoiceMutation) ResetAmountDue

func (m *InvoiceMutation) ResetAmountDue()

ResetAmountDue resets all changes to the "amount_due" field.

func (*InvoiceMutation) ResetAskingPrice

func (m *InvoiceMutation) ResetAskingPrice()

ResetAskingPrice resets all changes to the "asking_price" field.

func (*InvoiceMutation) ResetBids

func (m *InvoiceMutation) ResetBids()

ResetBids resets all changes to the "bids" edge.

func (*InvoiceMutation) ResetCompanyName

func (m *InvoiceMutation) ResetCompanyName()

ResetCompanyName resets all changes to the "company_name" field.

func (*InvoiceMutation) ResetCreatedAt

func (m *InvoiceMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*InvoiceMutation) ResetCurrency

func (m *InvoiceMutation) ResetCurrency()

ResetCurrency resets all changes to the "currency" field.

func (*InvoiceMutation) ResetCustomerName

func (m *InvoiceMutation) ResetCustomerName()

ResetCustomerName resets all changes to the "customer_name" field.

func (*InvoiceMutation) ResetDueDate

func (m *InvoiceMutation) ResetDueDate()

ResetDueDate resets all changes to the "due_date" 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) ResetInvestor

func (m *InvoiceMutation) ResetInvestor()

ResetInvestor resets all changes to the "investor" edge.

func (*InvoiceMutation) ResetInvoiceDate

func (m *InvoiceMutation) ResetInvoiceDate()

ResetInvoiceDate resets all changes to the "invoice_date" field.

func (*InvoiceMutation) ResetInvoiceNumber

func (m *InvoiceMutation) ResetInvoiceNumber()

ResetInvoiceNumber resets all changes to the "invoice_number" field.

func (*InvoiceMutation) ResetIsApproved

func (m *InvoiceMutation) ResetIsApproved()

ResetIsApproved resets all changes to the "is_approved" field.

func (*InvoiceMutation) ResetIsLocked

func (m *InvoiceMutation) ResetIsLocked()

ResetIsLocked resets all changes to the "is_locked" field.

func (*InvoiceMutation) ResetIssuer

func (m *InvoiceMutation) ResetIssuer()

ResetIssuer resets all changes to the "issuer" edge.

func (*InvoiceMutation) ResetItems

func (m *InvoiceMutation) ResetItems()

ResetItems resets all changes to the "items" edge.

func (*InvoiceMutation) ResetReference

func (m *InvoiceMutation) ResetReference()

ResetReference resets all changes to the "reference" field.

func (*InvoiceMutation) ResetStatus

func (m *InvoiceMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*InvoiceMutation) ResetTotalAmount

func (m *InvoiceMutation) ResetTotalAmount()

ResetTotalAmount resets all changes to the "total_amount" field.

func (*InvoiceMutation) ResetTotalVat

func (m *InvoiceMutation) ResetTotalVat()

ResetTotalVat resets all changes to the "total_vat" field.

func (*InvoiceMutation) SetAmountDue

func (m *InvoiceMutation) SetAmountDue(f float64)

SetAmountDue sets the "amount_due" field.

func (*InvoiceMutation) SetAskingPrice

func (m *InvoiceMutation) SetAskingPrice(f float64)

SetAskingPrice sets the "asking_price" field.

func (*InvoiceMutation) SetCompanyName

func (m *InvoiceMutation) SetCompanyName(s string)

SetCompanyName sets the "company_name" field.

func (*InvoiceMutation) SetCreatedAt

func (m *InvoiceMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*InvoiceMutation) SetCurrency

func (m *InvoiceMutation) SetCurrency(s string)

SetCurrency sets the "currency" field.

func (*InvoiceMutation) SetCustomerName

func (m *InvoiceMutation) SetCustomerName(s string)

SetCustomerName sets the "customer_name" field.

func (*InvoiceMutation) SetDueDate

func (m *InvoiceMutation) SetDueDate(t time.Time)

SetDueDate sets the "due_date" 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) SetInvoiceDate

func (m *InvoiceMutation) SetInvoiceDate(t time.Time)

SetInvoiceDate sets the "invoice_date" field.

func (*InvoiceMutation) SetInvoiceNumber

func (m *InvoiceMutation) SetInvoiceNumber(s string)

SetInvoiceNumber sets the "invoice_number" field.

func (*InvoiceMutation) SetIsApproved

func (m *InvoiceMutation) SetIsApproved(b bool)

SetIsApproved sets the "is_approved" field.

func (*InvoiceMutation) SetIsLocked

func (m *InvoiceMutation) SetIsLocked(b bool)

SetIsLocked sets the "is_locked" field.

func (*InvoiceMutation) SetIssuerID

func (m *InvoiceMutation) SetIssuerID(id uuid.UUID)

SetIssuerID sets the "issuer" edge to the Issuer entity by id.

func (*InvoiceMutation) SetOp

func (m *InvoiceMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*InvoiceMutation) SetReference

func (m *InvoiceMutation) SetReference(s string)

SetReference sets the "reference" field.

func (*InvoiceMutation) SetStatus

func (m *InvoiceMutation) SetStatus(i invoice.Status)

SetStatus sets the "status" field.

func (*InvoiceMutation) SetTotalAmount

func (m *InvoiceMutation) SetTotalAmount(f float64)

SetTotalAmount sets the "total_amount" field.

func (*InvoiceMutation) SetTotalVat

func (m *InvoiceMutation) SetTotalVat(f float64)

SetTotalVat sets the "total_vat" field.

func (*InvoiceMutation) Status

func (m *InvoiceMutation) Status() (r invoice.Status, exists bool)

Status returns the value of the "status" field in the mutation.

func (*InvoiceMutation) TotalAmount

func (m *InvoiceMutation) TotalAmount() (r float64, exists bool)

TotalAmount returns the value of the "total_amount" field in the mutation.

func (*InvoiceMutation) TotalAmountCleared

func (m *InvoiceMutation) TotalAmountCleared() bool

TotalAmountCleared returns if the "total_amount" field was cleared in this mutation.

func (*InvoiceMutation) TotalVat

func (m *InvoiceMutation) TotalVat() (r float64, exists bool)

TotalVat returns the value of the "total_vat" field in the mutation.

func (*InvoiceMutation) TotalVatCleared

func (m *InvoiceMutation) TotalVatCleared() bool

TotalVatCleared returns if the "total_vat" field was cleared in this mutation.

func (InvoiceMutation) Tx

func (m InvoiceMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*InvoiceMutation) Type

func (m *InvoiceMutation) Type() string

Type returns the node type of this mutation (Invoice).

func (*InvoiceMutation) 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 {
	Status invoice.Status `json:"status,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Invoice.Query().
	GroupBy(invoice.FieldStatus).
	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) QueryBids

func (iq *InvoiceQuery) QueryBids() *BidQuery

QueryBids chains the current query on the "bids" edge.

func (*InvoiceQuery) QueryInvestor

func (iq *InvoiceQuery) QueryInvestor() *InvestorQuery

QueryInvestor chains the current query on the "investor" edge.

func (*InvoiceQuery) QueryIssuer

func (iq *InvoiceQuery) QueryIssuer() *IssuerQuery

QueryIssuer chains the current query on the "issuer" edge.

func (*InvoiceQuery) QueryItems

func (iq *InvoiceQuery) QueryItems() *InvoiceItemQuery

QueryItems chains the current query on the "items" 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 {
	Status invoice.Status `json:"status,omitempty"`
}

client.Invoice.Query().
	Select(invoice.FieldStatus).
	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) WithBids

func (iq *InvoiceQuery) WithBids(opts ...func(*BidQuery)) *InvoiceQuery

WithBids tells the query-builder to eager-load the nodes that are connected to the "bids" edge. The optional arguments are used to configure the query builder of the edge.

func (*InvoiceQuery) WithInvestor

func (iq *InvoiceQuery) WithInvestor(opts ...func(*InvestorQuery)) *InvoiceQuery

WithInvestor tells the query-builder to eager-load the nodes that are connected to the "investor" edge. The optional arguments are used to configure the query builder of the edge.

func (*InvoiceQuery) WithIssuer

func (iq *InvoiceQuery) WithIssuer(opts ...func(*IssuerQuery)) *InvoiceQuery

WithIssuer tells the query-builder to eager-load the nodes that are connected to the "issuer" edge. The optional arguments are used to configure the query builder of the edge.

func (*InvoiceQuery) WithItems

func (iq *InvoiceQuery) WithItems(opts ...func(*InvoiceItemQuery)) *InvoiceQuery

WithItems tells the query-builder to eager-load the nodes that are connected to the "items" 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 InvoiceUpdate

type InvoiceUpdate struct {
	// contains filtered or unexported fields
}

InvoiceUpdate is the builder for updating Invoice entities.

func (*InvoiceUpdate) AddAmountDue

func (iu *InvoiceUpdate) AddAmountDue(f float64) *InvoiceUpdate

AddAmountDue adds f to the "amount_due" field.

func (*InvoiceUpdate) AddAskingPrice

func (iu *InvoiceUpdate) AddAskingPrice(f float64) *InvoiceUpdate

AddAskingPrice adds f to the "asking_price" field.

func (*InvoiceUpdate) AddBidIDs

func (iu *InvoiceUpdate) AddBidIDs(ids ...uuid.UUID) *InvoiceUpdate

AddBidIDs adds the "bids" edge to the Bid entity by IDs.

func (*InvoiceUpdate) AddBids

func (iu *InvoiceUpdate) AddBids(b ...*Bid) *InvoiceUpdate

AddBids adds the "bids" edges to the Bid entity.

func (*InvoiceUpdate) AddInvestor

func (iu *InvoiceUpdate) AddInvestor(i ...*Investor) *InvoiceUpdate

AddInvestor adds the "investor" edges to the Investor entity.

func (*InvoiceUpdate) AddInvestorIDs

func (iu *InvoiceUpdate) AddInvestorIDs(ids ...uuid.UUID) *InvoiceUpdate

AddInvestorIDs adds the "investor" edge to the Investor entity by IDs.

func (*InvoiceUpdate) AddItemIDs

func (iu *InvoiceUpdate) AddItemIDs(ids ...uuid.UUID) *InvoiceUpdate

AddItemIDs adds the "items" edge to the InvoiceItem entity by IDs.

func (*InvoiceUpdate) AddItems

func (iu *InvoiceUpdate) AddItems(i ...*InvoiceItem) *InvoiceUpdate

AddItems adds the "items" edges to the InvoiceItem entity.

func (*InvoiceUpdate) AddTotalAmount

func (iu *InvoiceUpdate) AddTotalAmount(f float64) *InvoiceUpdate

AddTotalAmount adds f to the "total_amount" field.

func (*InvoiceUpdate) AddTotalVat

func (iu *InvoiceUpdate) AddTotalVat(f float64) *InvoiceUpdate

AddTotalVat adds f to the "total_vat" field.

func (*InvoiceUpdate) ClearBids

func (iu *InvoiceUpdate) ClearBids() *InvoiceUpdate

ClearBids clears all "bids" edges to the Bid entity.

func (*InvoiceUpdate) ClearCompanyName

func (iu *InvoiceUpdate) ClearCompanyName() *InvoiceUpdate

ClearCompanyName clears the value of the "company_name" field.

func (*InvoiceUpdate) ClearInvestor

func (iu *InvoiceUpdate) ClearInvestor() *InvoiceUpdate

ClearInvestor clears all "investor" edges to the Investor entity.

func (*InvoiceUpdate) ClearIssuer

func (iu *InvoiceUpdate) ClearIssuer() *InvoiceUpdate

ClearIssuer clears the "issuer" edge to the Issuer entity.

func (*InvoiceUpdate) ClearItems

func (iu *InvoiceUpdate) ClearItems() *InvoiceUpdate

ClearItems clears all "items" edges to the InvoiceItem entity.

func (*InvoiceUpdate) ClearReference

func (iu *InvoiceUpdate) ClearReference() *InvoiceUpdate

ClearReference clears the value of the "reference" field.

func (*InvoiceUpdate) ClearTotalAmount

func (iu *InvoiceUpdate) ClearTotalAmount() *InvoiceUpdate

ClearTotalAmount clears the value of the "total_amount" field.

func (*InvoiceUpdate) ClearTotalVat

func (iu *InvoiceUpdate) ClearTotalVat() *InvoiceUpdate

ClearTotalVat clears the value of the "total_vat" 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) RemoveBidIDs

func (iu *InvoiceUpdate) RemoveBidIDs(ids ...uuid.UUID) *InvoiceUpdate

RemoveBidIDs removes the "bids" edge to Bid entities by IDs.

func (*InvoiceUpdate) RemoveBids

func (iu *InvoiceUpdate) RemoveBids(b ...*Bid) *InvoiceUpdate

RemoveBids removes "bids" edges to Bid entities.

func (*InvoiceUpdate) RemoveInvestor

func (iu *InvoiceUpdate) RemoveInvestor(i ...*Investor) *InvoiceUpdate

RemoveInvestor removes "investor" edges to Investor entities.

func (*InvoiceUpdate) RemoveInvestorIDs

func (iu *InvoiceUpdate) RemoveInvestorIDs(ids ...uuid.UUID) *InvoiceUpdate

RemoveInvestorIDs removes the "investor" edge to Investor entities by IDs.

func (*InvoiceUpdate) RemoveItemIDs

func (iu *InvoiceUpdate) RemoveItemIDs(ids ...uuid.UUID) *InvoiceUpdate

RemoveItemIDs removes the "items" edge to InvoiceItem entities by IDs.

func (*InvoiceUpdate) RemoveItems

func (iu *InvoiceUpdate) RemoveItems(i ...*InvoiceItem) *InvoiceUpdate

RemoveItems removes "items" edges to InvoiceItem entities.

func (*InvoiceUpdate) Save

func (iu *InvoiceUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*InvoiceUpdate) SaveX

func (iu *InvoiceUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*InvoiceUpdate) SetAmountDue

func (iu *InvoiceUpdate) SetAmountDue(f float64) *InvoiceUpdate

SetAmountDue sets the "amount_due" field.

func (*InvoiceUpdate) SetAskingPrice

func (iu *InvoiceUpdate) SetAskingPrice(f float64) *InvoiceUpdate

SetAskingPrice sets the "asking_price" field.

func (*InvoiceUpdate) SetCompanyName

func (iu *InvoiceUpdate) SetCompanyName(s string) *InvoiceUpdate

SetCompanyName sets the "company_name" field.

func (*InvoiceUpdate) SetCurrency

func (iu *InvoiceUpdate) SetCurrency(s string) *InvoiceUpdate

SetCurrency sets the "currency" field.

func (*InvoiceUpdate) SetCustomerName

func (iu *InvoiceUpdate) SetCustomerName(s string) *InvoiceUpdate

SetCustomerName sets the "customer_name" field.

func (*InvoiceUpdate) SetDueDate

func (iu *InvoiceUpdate) SetDueDate(t time.Time) *InvoiceUpdate

SetDueDate sets the "due_date" field.

func (*InvoiceUpdate) SetInvoiceDate

func (iu *InvoiceUpdate) SetInvoiceDate(t time.Time) *InvoiceUpdate

SetInvoiceDate sets the "invoice_date" field.

func (*InvoiceUpdate) SetInvoiceNumber

func (iu *InvoiceUpdate) SetInvoiceNumber(s string) *InvoiceUpdate

SetInvoiceNumber sets the "invoice_number" field.

func (*InvoiceUpdate) SetIsApproved

func (iu *InvoiceUpdate) SetIsApproved(b bool) *InvoiceUpdate

SetIsApproved sets the "is_approved" field.

func (*InvoiceUpdate) SetIsLocked

func (iu *InvoiceUpdate) SetIsLocked(b bool) *InvoiceUpdate

SetIsLocked sets the "is_locked" field.

func (*InvoiceUpdate) SetIssuer

func (iu *InvoiceUpdate) SetIssuer(i *Issuer) *InvoiceUpdate

SetIssuer sets the "issuer" edge to the Issuer entity.

func (*InvoiceUpdate) SetIssuerID

func (iu *InvoiceUpdate) SetIssuerID(id uuid.UUID) *InvoiceUpdate

SetIssuerID sets the "issuer" edge to the Issuer entity by ID.

func (*InvoiceUpdate) SetNillableAskingPrice

func (iu *InvoiceUpdate) SetNillableAskingPrice(f *float64) *InvoiceUpdate

SetNillableAskingPrice sets the "asking_price" field if the given value is not nil.

func (*InvoiceUpdate) SetNillableCompanyName

func (iu *InvoiceUpdate) SetNillableCompanyName(s *string) *InvoiceUpdate

SetNillableCompanyName sets the "company_name" field if the given value is not nil.

func (*InvoiceUpdate) SetNillableCurrency

func (iu *InvoiceUpdate) SetNillableCurrency(s *string) *InvoiceUpdate

SetNillableCurrency sets the "currency" field if the given value is not nil.

func (*InvoiceUpdate) SetNillableIsApproved

func (iu *InvoiceUpdate) SetNillableIsApproved(b *bool) *InvoiceUpdate

SetNillableIsApproved sets the "is_approved" field if the given value is not nil.

func (*InvoiceUpdate) SetNillableIsLocked

func (iu *InvoiceUpdate) SetNillableIsLocked(b *bool) *InvoiceUpdate

SetNillableIsLocked sets the "is_locked" field if the given value is not nil.

func (*InvoiceUpdate) SetNillableReference

func (iu *InvoiceUpdate) SetNillableReference(s *string) *InvoiceUpdate

SetNillableReference sets the "reference" field if the given value is not nil.

func (*InvoiceUpdate) SetNillableStatus

func (iu *InvoiceUpdate) SetNillableStatus(i *invoice.Status) *InvoiceUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*InvoiceUpdate) SetNillableTotalAmount

func (iu *InvoiceUpdate) SetNillableTotalAmount(f *float64) *InvoiceUpdate

SetNillableTotalAmount sets the "total_amount" field if the given value is not nil.

func (*InvoiceUpdate) SetNillableTotalVat

func (iu *InvoiceUpdate) SetNillableTotalVat(f *float64) *InvoiceUpdate

SetNillableTotalVat sets the "total_vat" field if the given value is not nil.

func (*InvoiceUpdate) SetReference

func (iu *InvoiceUpdate) SetReference(s string) *InvoiceUpdate

SetReference sets the "reference" field.

func (*InvoiceUpdate) SetStatus

func (iu *InvoiceUpdate) SetStatus(i invoice.Status) *InvoiceUpdate

SetStatus sets the "status" field.

func (*InvoiceUpdate) SetTotalAmount

func (iu *InvoiceUpdate) SetTotalAmount(f float64) *InvoiceUpdate

SetTotalAmount sets the "total_amount" field.

func (*InvoiceUpdate) SetTotalVat

func (iu *InvoiceUpdate) SetTotalVat(f float64) *InvoiceUpdate

SetTotalVat sets the "total_vat" 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) AddAmountDue

func (iuo *InvoiceUpdateOne) AddAmountDue(f float64) *InvoiceUpdateOne

AddAmountDue adds f to the "amount_due" field.

func (*InvoiceUpdateOne) AddAskingPrice

func (iuo *InvoiceUpdateOne) AddAskingPrice(f float64) *InvoiceUpdateOne

AddAskingPrice adds f to the "asking_price" field.

func (*InvoiceUpdateOne) AddBidIDs

func (iuo *InvoiceUpdateOne) AddBidIDs(ids ...uuid.UUID) *InvoiceUpdateOne

AddBidIDs adds the "bids" edge to the Bid entity by IDs.

func (*InvoiceUpdateOne) AddBids

func (iuo *InvoiceUpdateOne) AddBids(b ...*Bid) *InvoiceUpdateOne

AddBids adds the "bids" edges to the Bid entity.

func (*InvoiceUpdateOne) AddInvestor

func (iuo *InvoiceUpdateOne) AddInvestor(i ...*Investor) *InvoiceUpdateOne

AddInvestor adds the "investor" edges to the Investor entity.

func (*InvoiceUpdateOne) AddInvestorIDs

func (iuo *InvoiceUpdateOne) AddInvestorIDs(ids ...uuid.UUID) *InvoiceUpdateOne

AddInvestorIDs adds the "investor" edge to the Investor entity by IDs.

func (*InvoiceUpdateOne) AddItemIDs

func (iuo *InvoiceUpdateOne) AddItemIDs(ids ...uuid.UUID) *InvoiceUpdateOne

AddItemIDs adds the "items" edge to the InvoiceItem entity by IDs.

func (*InvoiceUpdateOne) AddItems

func (iuo *InvoiceUpdateOne) AddItems(i ...*InvoiceItem) *InvoiceUpdateOne

AddItems adds the "items" edges to the InvoiceItem entity.

func (*InvoiceUpdateOne) AddTotalAmount

func (iuo *InvoiceUpdateOne) AddTotalAmount(f float64) *InvoiceUpdateOne

AddTotalAmount adds f to the "total_amount" field.

func (*InvoiceUpdateOne) AddTotalVat

func (iuo *InvoiceUpdateOne) AddTotalVat(f float64) *InvoiceUpdateOne

AddTotalVat adds f to the "total_vat" field.

func (*InvoiceUpdateOne) ClearBids

func (iuo *InvoiceUpdateOne) ClearBids() *InvoiceUpdateOne

ClearBids clears all "bids" edges to the Bid entity.

func (*InvoiceUpdateOne) ClearCompanyName

func (iuo *InvoiceUpdateOne) ClearCompanyName() *InvoiceUpdateOne

ClearCompanyName clears the value of the "company_name" field.

func (*InvoiceUpdateOne) ClearInvestor

func (iuo *InvoiceUpdateOne) ClearInvestor() *InvoiceUpdateOne

ClearInvestor clears all "investor" edges to the Investor entity.

func (*InvoiceUpdateOne) ClearIssuer

func (iuo *InvoiceUpdateOne) ClearIssuer() *InvoiceUpdateOne

ClearIssuer clears the "issuer" edge to the Issuer entity.

func (*InvoiceUpdateOne) ClearItems

func (iuo *InvoiceUpdateOne) ClearItems() *InvoiceUpdateOne

ClearItems clears all "items" edges to the InvoiceItem entity.

func (*InvoiceUpdateOne) ClearReference

func (iuo *InvoiceUpdateOne) ClearReference() *InvoiceUpdateOne

ClearReference clears the value of the "reference" field.

func (*InvoiceUpdateOne) ClearTotalAmount

func (iuo *InvoiceUpdateOne) ClearTotalAmount() *InvoiceUpdateOne

ClearTotalAmount clears the value of the "total_amount" field.

func (*InvoiceUpdateOne) ClearTotalVat

func (iuo *InvoiceUpdateOne) ClearTotalVat() *InvoiceUpdateOne

ClearTotalVat clears the value of the "total_vat" 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) RemoveBidIDs

func (iuo *InvoiceUpdateOne) RemoveBidIDs(ids ...uuid.UUID) *InvoiceUpdateOne

RemoveBidIDs removes the "bids" edge to Bid entities by IDs.

func (*InvoiceUpdateOne) RemoveBids

func (iuo *InvoiceUpdateOne) RemoveBids(b ...*Bid) *InvoiceUpdateOne

RemoveBids removes "bids" edges to Bid entities.

func (*InvoiceUpdateOne) RemoveInvestor

func (iuo *InvoiceUpdateOne) RemoveInvestor(i ...*Investor) *InvoiceUpdateOne

RemoveInvestor removes "investor" edges to Investor entities.

func (*InvoiceUpdateOne) RemoveInvestorIDs

func (iuo *InvoiceUpdateOne) RemoveInvestorIDs(ids ...uuid.UUID) *InvoiceUpdateOne

RemoveInvestorIDs removes the "investor" edge to Investor entities by IDs.

func (*InvoiceUpdateOne) RemoveItemIDs

func (iuo *InvoiceUpdateOne) RemoveItemIDs(ids ...uuid.UUID) *InvoiceUpdateOne

RemoveItemIDs removes the "items" edge to InvoiceItem entities by IDs.

func (*InvoiceUpdateOne) RemoveItems

func (iuo *InvoiceUpdateOne) RemoveItems(i ...*InvoiceItem) *InvoiceUpdateOne

RemoveItems removes "items" edges to InvoiceItem entities.

func (*InvoiceUpdateOne) Save

func (iuo *InvoiceUpdateOne) Save(ctx context.Context) (*Invoice, error)

Save executes the query and returns the updated Invoice entity.

func (*InvoiceUpdateOne) SaveX

func (iuo *InvoiceUpdateOne) SaveX(ctx context.Context) *Invoice

SaveX is like Save, but panics if an error occurs.

func (*InvoiceUpdateOne) Select

func (iuo *InvoiceUpdateOne) Select(field string, fields ...string) *InvoiceUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*InvoiceUpdateOne) SetAmountDue

func (iuo *InvoiceUpdateOne) SetAmountDue(f float64) *InvoiceUpdateOne

SetAmountDue sets the "amount_due" field.

func (*InvoiceUpdateOne) SetAskingPrice

func (iuo *InvoiceUpdateOne) SetAskingPrice(f float64) *InvoiceUpdateOne

SetAskingPrice sets the "asking_price" field.

func (*InvoiceUpdateOne) SetCompanyName

func (iuo *InvoiceUpdateOne) SetCompanyName(s string) *InvoiceUpdateOne

SetCompanyName sets the "company_name" field.

func (*InvoiceUpdateOne) SetCurrency

func (iuo *InvoiceUpdateOne) SetCurrency(s string) *InvoiceUpdateOne

SetCurrency sets the "currency" field.

func (*InvoiceUpdateOne) SetCustomerName

func (iuo *InvoiceUpdateOne) SetCustomerName(s string) *InvoiceUpdateOne

SetCustomerName sets the "customer_name" field.

func (*InvoiceUpdateOne) SetDueDate

func (iuo *InvoiceUpdateOne) SetDueDate(t time.Time) *InvoiceUpdateOne

SetDueDate sets the "due_date" field.

func (*InvoiceUpdateOne) SetInvoiceDate

func (iuo *InvoiceUpdateOne) SetInvoiceDate(t time.Time) *InvoiceUpdateOne

SetInvoiceDate sets the "invoice_date" field.

func (*InvoiceUpdateOne) SetInvoiceNumber

func (iuo *InvoiceUpdateOne) SetInvoiceNumber(s string) *InvoiceUpdateOne

SetInvoiceNumber sets the "invoice_number" field.

func (*InvoiceUpdateOne) SetIsApproved

func (iuo *InvoiceUpdateOne) SetIsApproved(b bool) *InvoiceUpdateOne

SetIsApproved sets the "is_approved" field.

func (*InvoiceUpdateOne) SetIsLocked

func (iuo *InvoiceUpdateOne) SetIsLocked(b bool) *InvoiceUpdateOne

SetIsLocked sets the "is_locked" field.

func (*InvoiceUpdateOne) SetIssuer

func (iuo *InvoiceUpdateOne) SetIssuer(i *Issuer) *InvoiceUpdateOne

SetIssuer sets the "issuer" edge to the Issuer entity.

func (*InvoiceUpdateOne) SetIssuerID

func (iuo *InvoiceUpdateOne) SetIssuerID(id uuid.UUID) *InvoiceUpdateOne

SetIssuerID sets the "issuer" edge to the Issuer entity by ID.

func (*InvoiceUpdateOne) SetNillableAskingPrice

func (iuo *InvoiceUpdateOne) SetNillableAskingPrice(f *float64) *InvoiceUpdateOne

SetNillableAskingPrice sets the "asking_price" field if the given value is not nil.

func (*InvoiceUpdateOne) SetNillableCompanyName

func (iuo *InvoiceUpdateOne) SetNillableCompanyName(s *string) *InvoiceUpdateOne

SetNillableCompanyName sets the "company_name" field if the given value is not nil.

func (*InvoiceUpdateOne) SetNillableCurrency

func (iuo *InvoiceUpdateOne) SetNillableCurrency(s *string) *InvoiceUpdateOne

SetNillableCurrency sets the "currency" field if the given value is not nil.

func (*InvoiceUpdateOne) SetNillableIsApproved

func (iuo *InvoiceUpdateOne) SetNillableIsApproved(b *bool) *InvoiceUpdateOne

SetNillableIsApproved sets the "is_approved" field if the given value is not nil.

func (*InvoiceUpdateOne) SetNillableIsLocked

func (iuo *InvoiceUpdateOne) SetNillableIsLocked(b *bool) *InvoiceUpdateOne

SetNillableIsLocked sets the "is_locked" field if the given value is not nil.

func (*InvoiceUpdateOne) SetNillableReference

func (iuo *InvoiceUpdateOne) SetNillableReference(s *string) *InvoiceUpdateOne

SetNillableReference sets the "reference" field if the given value is not nil.

func (*InvoiceUpdateOne) SetNillableStatus

func (iuo *InvoiceUpdateOne) SetNillableStatus(i *invoice.Status) *InvoiceUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*InvoiceUpdateOne) SetNillableTotalAmount

func (iuo *InvoiceUpdateOne) SetNillableTotalAmount(f *float64) *InvoiceUpdateOne

SetNillableTotalAmount sets the "total_amount" field if the given value is not nil.

func (*InvoiceUpdateOne) SetNillableTotalVat

func (iuo *InvoiceUpdateOne) SetNillableTotalVat(f *float64) *InvoiceUpdateOne

SetNillableTotalVat sets the "total_vat" field if the given value is not nil.

func (*InvoiceUpdateOne) SetReference

func (iuo *InvoiceUpdateOne) SetReference(s string) *InvoiceUpdateOne

SetReference sets the "reference" field.

func (*InvoiceUpdateOne) SetStatus

func (iuo *InvoiceUpdateOne) SetStatus(i invoice.Status) *InvoiceUpdateOne

SetStatus sets the "status" field.

func (*InvoiceUpdateOne) SetTotalAmount

func (iuo *InvoiceUpdateOne) SetTotalAmount(f float64) *InvoiceUpdateOne

SetTotalAmount sets the "total_amount" field.

func (*InvoiceUpdateOne) SetTotalVat

func (iuo *InvoiceUpdateOne) SetTotalVat(f float64) *InvoiceUpdateOne

SetTotalVat sets the "total_vat" 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 Issuer

type Issuer struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// JoinedAt holds the value of the "joined_at" field.
	JoinedAt time.Time `json:"joined_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the IssuerQuery when eager-loading is set.
	Edges IssuerEdges `json:"edges"`
	// contains filtered or unexported fields
}

Issuer is the model entity for the Issuer schema.

func (*Issuer) QueryBalance

func (i *Issuer) QueryBalance() *BalanceQuery

QueryBalance queries the "balance" edge of the Issuer entity.

func (*Issuer) QueryInvoices

func (i *Issuer) QueryInvoices() *InvoiceQuery

QueryInvoices queries the "invoices" edge of the Issuer entity.

func (*Issuer) String

func (i *Issuer) String() string

String implements the fmt.Stringer.

func (*Issuer) Unwrap

func (i *Issuer) Unwrap() *Issuer

Unwrap unwraps the Issuer 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 (*Issuer) Update

func (i *Issuer) Update() *IssuerUpdateOne

Update returns a builder for updating this Issuer. Note that you need to call Issuer.Unwrap() before calling this method if this Issuer was returned from a transaction, and the transaction was committed or rolled back.

func (*Issuer) Value

func (i *Issuer) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Issuer. This includes values selected through modifiers, order, etc.

type IssuerClient

type IssuerClient struct {
	// contains filtered or unexported fields
}

IssuerClient is a client for the Issuer schema.

func NewIssuerClient

func NewIssuerClient(c config) *IssuerClient

NewIssuerClient returns a client for the Issuer from the given config.

func (*IssuerClient) Create

func (c *IssuerClient) Create() *IssuerCreate

Create returns a builder for creating a Issuer entity.

func (*IssuerClient) CreateBulk

func (c *IssuerClient) CreateBulk(builders ...*IssuerCreate) *IssuerCreateBulk

CreateBulk returns a builder for creating a bulk of Issuer entities.

func (*IssuerClient) Delete

func (c *IssuerClient) Delete() *IssuerDelete

Delete returns a delete builder for Issuer.

func (*IssuerClient) DeleteOne

func (c *IssuerClient) DeleteOne(i *Issuer) *IssuerDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*IssuerClient) DeleteOneID

func (c *IssuerClient) DeleteOneID(id uuid.UUID) *IssuerDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*IssuerClient) Get

func (c *IssuerClient) Get(ctx context.Context, id uuid.UUID) (*Issuer, error)

Get returns a Issuer entity by its id.

func (*IssuerClient) GetX

func (c *IssuerClient) GetX(ctx context.Context, id uuid.UUID) *Issuer

GetX is like Get, but panics if an error occurs.

func (*IssuerClient) Hooks

func (c *IssuerClient) Hooks() []Hook

Hooks returns the client hooks.

func (*IssuerClient) Intercept

func (c *IssuerClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `issuer.Intercept(f(g(h())))`.

func (*IssuerClient) Interceptors

func (c *IssuerClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*IssuerClient) Query

func (c *IssuerClient) Query() *IssuerQuery

Query returns a query builder for Issuer.

func (*IssuerClient) QueryBalance

func (c *IssuerClient) QueryBalance(i *Issuer) *BalanceQuery

QueryBalance queries the balance edge of a Issuer.

func (*IssuerClient) QueryInvoices

func (c *IssuerClient) QueryInvoices(i *Issuer) *InvoiceQuery

QueryInvoices queries the invoices edge of a Issuer.

func (*IssuerClient) Update

func (c *IssuerClient) Update() *IssuerUpdate

Update returns an update builder for Issuer.

func (*IssuerClient) UpdateOne

func (c *IssuerClient) UpdateOne(i *Issuer) *IssuerUpdateOne

UpdateOne returns an update builder for the given entity.

func (*IssuerClient) UpdateOneID

func (c *IssuerClient) UpdateOneID(id uuid.UUID) *IssuerUpdateOne

UpdateOneID returns an update builder for the given id.

func (*IssuerClient) Use

func (c *IssuerClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `issuer.Hooks(f(g(h())))`.

type IssuerCreate

type IssuerCreate struct {
	// contains filtered or unexported fields
}

IssuerCreate is the builder for creating a Issuer entity.

func (*IssuerCreate) AddInvoiceIDs

func (ic *IssuerCreate) AddInvoiceIDs(ids ...uuid.UUID) *IssuerCreate

AddInvoiceIDs adds the "invoices" edge to the Invoice entity by IDs.

func (*IssuerCreate) AddInvoices

func (ic *IssuerCreate) AddInvoices(i ...*Invoice) *IssuerCreate

AddInvoices adds the "invoices" edges to the Invoice entity.

func (*IssuerCreate) Exec

func (ic *IssuerCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*IssuerCreate) ExecX

func (ic *IssuerCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*IssuerCreate) Mutation

func (ic *IssuerCreate) Mutation() *IssuerMutation

Mutation returns the IssuerMutation object of the builder.

func (*IssuerCreate) Save

func (ic *IssuerCreate) Save(ctx context.Context) (*Issuer, error)

Save creates the Issuer in the database.

func (*IssuerCreate) SaveX

func (ic *IssuerCreate) SaveX(ctx context.Context) *Issuer

SaveX calls Save and panics if Save returns an error.

func (*IssuerCreate) SetBalance

func (ic *IssuerCreate) SetBalance(b *Balance) *IssuerCreate

SetBalance sets the "balance" edge to the Balance entity.

func (*IssuerCreate) SetBalanceID

func (ic *IssuerCreate) SetBalanceID(id uuid.UUID) *IssuerCreate

SetBalanceID sets the "balance" edge to the Balance entity by ID.

func (*IssuerCreate) SetID

func (ic *IssuerCreate) SetID(u uuid.UUID) *IssuerCreate

SetID sets the "id" field.

func (*IssuerCreate) SetJoinedAt

func (ic *IssuerCreate) SetJoinedAt(t time.Time) *IssuerCreate

SetJoinedAt sets the "joined_at" field.

func (*IssuerCreate) SetName

func (ic *IssuerCreate) SetName(s string) *IssuerCreate

SetName sets the "name" field.

func (*IssuerCreate) SetNillableID

func (ic *IssuerCreate) SetNillableID(u *uuid.UUID) *IssuerCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*IssuerCreate) SetNillableJoinedAt

func (ic *IssuerCreate) SetNillableJoinedAt(t *time.Time) *IssuerCreate

SetNillableJoinedAt sets the "joined_at" field if the given value is not nil.

type IssuerCreateBulk

type IssuerCreateBulk struct {
	// contains filtered or unexported fields
}

IssuerCreateBulk is the builder for creating many Issuer entities in bulk.

func (*IssuerCreateBulk) Exec

func (icb *IssuerCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*IssuerCreateBulk) ExecX

func (icb *IssuerCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*IssuerCreateBulk) Save

func (icb *IssuerCreateBulk) Save(ctx context.Context) ([]*Issuer, error)

Save creates the Issuer entities in the database.

func (*IssuerCreateBulk) SaveX

func (icb *IssuerCreateBulk) SaveX(ctx context.Context) []*Issuer

SaveX is like Save, but panics if an error occurs.

type IssuerDelete

type IssuerDelete struct {
	// contains filtered or unexported fields
}

IssuerDelete is the builder for deleting a Issuer entity.

func (*IssuerDelete) Exec

func (id *IssuerDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*IssuerDelete) ExecX

func (id *IssuerDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*IssuerDelete) Where

func (id *IssuerDelete) Where(ps ...predicate.Issuer) *IssuerDelete

Where appends a list predicates to the IssuerDelete builder.

type IssuerDeleteOne

type IssuerDeleteOne struct {
	// contains filtered or unexported fields
}

IssuerDeleteOne is the builder for deleting a single Issuer entity.

func (*IssuerDeleteOne) Exec

func (ido *IssuerDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*IssuerDeleteOne) ExecX

func (ido *IssuerDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*IssuerDeleteOne) Where

func (ido *IssuerDeleteOne) Where(ps ...predicate.Issuer) *IssuerDeleteOne

Where appends a list predicates to the IssuerDelete builder.

type IssuerEdges

type IssuerEdges struct {
	// Invoices holds the value of the invoices edge.
	Invoices []*Invoice `json:"invoices,omitempty"`
	// Balance holds the value of the balance edge.
	Balance *Balance `json:"balance,omitempty"`
	// contains filtered or unexported fields
}

IssuerEdges holds the relations/edges for other nodes in the graph.

func (IssuerEdges) BalanceOrErr

func (e IssuerEdges) BalanceOrErr() (*Balance, error)

BalanceOrErr returns the Balance value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (IssuerEdges) InvoicesOrErr

func (e IssuerEdges) InvoicesOrErr() ([]*Invoice, error)

InvoicesOrErr returns the Invoices value or an error if the edge was not loaded in eager-loading.

type IssuerGroupBy

type IssuerGroupBy struct {
	// contains filtered or unexported fields
}

IssuerGroupBy is the group-by builder for Issuer entities.

func (*IssuerGroupBy) Aggregate

func (igb *IssuerGroupBy) Aggregate(fns ...AggregateFunc) *IssuerGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*IssuerGroupBy) Bool

func (s *IssuerGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*IssuerGroupBy) BoolX

func (s *IssuerGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*IssuerGroupBy) Bools

func (s *IssuerGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*IssuerGroupBy) BoolsX

func (s *IssuerGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*IssuerGroupBy) Float64

func (s *IssuerGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*IssuerGroupBy) Float64X

func (s *IssuerGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*IssuerGroupBy) Float64s

func (s *IssuerGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*IssuerGroupBy) Float64sX

func (s *IssuerGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*IssuerGroupBy) Int

func (s *IssuerGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*IssuerGroupBy) IntX

func (s *IssuerGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*IssuerGroupBy) Ints

func (s *IssuerGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*IssuerGroupBy) IntsX

func (s *IssuerGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*IssuerGroupBy) Scan

func (igb *IssuerGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*IssuerGroupBy) ScanX

func (s *IssuerGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*IssuerGroupBy) String

func (s *IssuerGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*IssuerGroupBy) StringX

func (s *IssuerGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*IssuerGroupBy) Strings

func (s *IssuerGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*IssuerGroupBy) StringsX

func (s *IssuerGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type IssuerMutation

type IssuerMutation struct {
	// contains filtered or unexported fields
}

IssuerMutation represents an operation that mutates the Issuer nodes in the graph.

func (*IssuerMutation) AddField

func (m *IssuerMutation) 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 (*IssuerMutation) AddInvoiceIDs

func (m *IssuerMutation) AddInvoiceIDs(ids ...uuid.UUID)

AddInvoiceIDs adds the "invoices" edge to the Invoice entity by ids.

func (*IssuerMutation) AddedEdges

func (m *IssuerMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*IssuerMutation) AddedField

func (m *IssuerMutation) 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 (*IssuerMutation) AddedFields

func (m *IssuerMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*IssuerMutation) AddedIDs

func (m *IssuerMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*IssuerMutation) BalanceCleared

func (m *IssuerMutation) BalanceCleared() bool

BalanceCleared reports if the "balance" edge to the Balance entity was cleared.

func (*IssuerMutation) BalanceID

func (m *IssuerMutation) BalanceID() (id uuid.UUID, exists bool)

BalanceID returns the "balance" edge ID in the mutation.

func (*IssuerMutation) BalanceIDs

func (m *IssuerMutation) BalanceIDs() (ids []uuid.UUID)

BalanceIDs returns the "balance" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use BalanceID instead. It exists only for internal usage by the builders.

func (*IssuerMutation) ClearBalance

func (m *IssuerMutation) ClearBalance()

ClearBalance clears the "balance" edge to the Balance entity.

func (*IssuerMutation) ClearEdge

func (m *IssuerMutation) 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 (*IssuerMutation) ClearField

func (m *IssuerMutation) 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 (*IssuerMutation) ClearInvoices

func (m *IssuerMutation) ClearInvoices()

ClearInvoices clears the "invoices" edge to the Invoice entity.

func (*IssuerMutation) ClearedEdges

func (m *IssuerMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*IssuerMutation) ClearedFields

func (m *IssuerMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (IssuerMutation) Client

func (m IssuerMutation) 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 (*IssuerMutation) EdgeCleared

func (m *IssuerMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*IssuerMutation) Field

func (m *IssuerMutation) 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 (*IssuerMutation) FieldCleared

func (m *IssuerMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*IssuerMutation) Fields

func (m *IssuerMutation) 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 (*IssuerMutation) ID

func (m *IssuerMutation) 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 (*IssuerMutation) IDs

func (m *IssuerMutation) 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 (*IssuerMutation) InvoicesCleared

func (m *IssuerMutation) InvoicesCleared() bool

InvoicesCleared reports if the "invoices" edge to the Invoice entity was cleared.

func (*IssuerMutation) InvoicesIDs

func (m *IssuerMutation) InvoicesIDs() (ids []uuid.UUID)

InvoicesIDs returns the "invoices" edge IDs in the mutation.

func (*IssuerMutation) JoinedAt

func (m *IssuerMutation) JoinedAt() (r time.Time, exists bool)

JoinedAt returns the value of the "joined_at" field in the mutation.

func (*IssuerMutation) Name

func (m *IssuerMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*IssuerMutation) OldField

func (m *IssuerMutation) 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 (*IssuerMutation) OldJoinedAt

func (m *IssuerMutation) OldJoinedAt(ctx context.Context) (v time.Time, err error)

OldJoinedAt returns the old "joined_at" field's value of the Issuer entity. If the Issuer 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 (*IssuerMutation) OldName

func (m *IssuerMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Issuer entity. If the Issuer 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 (*IssuerMutation) Op

func (m *IssuerMutation) Op() Op

Op returns the operation name.

func (*IssuerMutation) RemoveInvoiceIDs

func (m *IssuerMutation) RemoveInvoiceIDs(ids ...uuid.UUID)

RemoveInvoiceIDs removes the "invoices" edge to the Invoice entity by IDs.

func (*IssuerMutation) RemovedEdges

func (m *IssuerMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*IssuerMutation) RemovedIDs

func (m *IssuerMutation) 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 (*IssuerMutation) RemovedInvoicesIDs

func (m *IssuerMutation) RemovedInvoicesIDs() (ids []uuid.UUID)

RemovedInvoices returns the removed IDs of the "invoices" edge to the Invoice entity.

func (*IssuerMutation) ResetBalance

func (m *IssuerMutation) ResetBalance()

ResetBalance resets all changes to the "balance" edge.

func (*IssuerMutation) ResetEdge

func (m *IssuerMutation) 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 (*IssuerMutation) ResetField

func (m *IssuerMutation) 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 (*IssuerMutation) ResetInvoices

func (m *IssuerMutation) ResetInvoices()

ResetInvoices resets all changes to the "invoices" edge.

func (*IssuerMutation) ResetJoinedAt

func (m *IssuerMutation) ResetJoinedAt()

ResetJoinedAt resets all changes to the "joined_at" field.

func (*IssuerMutation) ResetName

func (m *IssuerMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*IssuerMutation) SetBalanceID

func (m *IssuerMutation) SetBalanceID(id uuid.UUID)

SetBalanceID sets the "balance" edge to the Balance entity by id.

func (*IssuerMutation) SetField

func (m *IssuerMutation) 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 (*IssuerMutation) SetID

func (m *IssuerMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Issuer entities.

func (*IssuerMutation) SetJoinedAt

func (m *IssuerMutation) SetJoinedAt(t time.Time)

SetJoinedAt sets the "joined_at" field.

func (*IssuerMutation) SetName

func (m *IssuerMutation) SetName(s string)

SetName sets the "name" field.

func (*IssuerMutation) SetOp

func (m *IssuerMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (IssuerMutation) Tx

func (m IssuerMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*IssuerMutation) Type

func (m *IssuerMutation) Type() string

Type returns the node type of this mutation (Issuer).

func (*IssuerMutation) Where

func (m *IssuerMutation) Where(ps ...predicate.Issuer)

Where appends a list predicates to the IssuerMutation builder.

func (*IssuerMutation) WhereP

func (m *IssuerMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the IssuerMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type IssuerQuery

type IssuerQuery struct {
	// contains filtered or unexported fields
}

IssuerQuery is the builder for querying Issuer entities.

func (*IssuerQuery) Aggregate

func (iq *IssuerQuery) Aggregate(fns ...AggregateFunc) *IssuerSelect

Aggregate returns a IssuerSelect configured with the given aggregations.

func (*IssuerQuery) All

func (iq *IssuerQuery) All(ctx context.Context) ([]*Issuer, error)

All executes the query and returns a list of Issuers.

func (*IssuerQuery) AllX

func (iq *IssuerQuery) AllX(ctx context.Context) []*Issuer

AllX is like All, but panics if an error occurs.

func (*IssuerQuery) Clone

func (iq *IssuerQuery) Clone() *IssuerQuery

Clone returns a duplicate of the IssuerQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*IssuerQuery) Count

func (iq *IssuerQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*IssuerQuery) CountX

func (iq *IssuerQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*IssuerQuery) Exist

func (iq *IssuerQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*IssuerQuery) ExistX

func (iq *IssuerQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*IssuerQuery) First

func (iq *IssuerQuery) First(ctx context.Context) (*Issuer, error)

First returns the first Issuer entity from the query. Returns a *NotFoundError when no Issuer was found.

func (*IssuerQuery) FirstID

func (iq *IssuerQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Issuer ID from the query. Returns a *NotFoundError when no Issuer ID was found.

func (*IssuerQuery) FirstIDX

func (iq *IssuerQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*IssuerQuery) FirstX

func (iq *IssuerQuery) FirstX(ctx context.Context) *Issuer

FirstX is like First, but panics if an error occurs.

func (*IssuerQuery) GroupBy

func (iq *IssuerQuery) GroupBy(field string, fields ...string) *IssuerGroupBy

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 {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Issuer.Query().
	GroupBy(issuer.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*IssuerQuery) IDs

func (iq *IssuerQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Issuer IDs.

func (*IssuerQuery) IDsX

func (iq *IssuerQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*IssuerQuery) Limit

func (iq *IssuerQuery) Limit(limit int) *IssuerQuery

Limit the number of records to be returned by this query.

func (*IssuerQuery) Offset

func (iq *IssuerQuery) Offset(offset int) *IssuerQuery

Offset to start from.

func (*IssuerQuery) Only

func (iq *IssuerQuery) Only(ctx context.Context) (*Issuer, error)

Only returns a single Issuer entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Issuer entity is found. Returns a *NotFoundError when no Issuer entities are found.

func (*IssuerQuery) OnlyID

func (iq *IssuerQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Issuer ID in the query. Returns a *NotSingularError when more than one Issuer ID is found. Returns a *NotFoundError when no entities are found.

func (*IssuerQuery) OnlyIDX

func (iq *IssuerQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*IssuerQuery) OnlyX

func (iq *IssuerQuery) OnlyX(ctx context.Context) *Issuer

OnlyX is like Only, but panics if an error occurs.

func (*IssuerQuery) Order

func (iq *IssuerQuery) Order(o ...issuer.OrderOption) *IssuerQuery

Order specifies how the records should be ordered.

func (*IssuerQuery) QueryBalance

func (iq *IssuerQuery) QueryBalance() *BalanceQuery

QueryBalance chains the current query on the "balance" edge.

func (*IssuerQuery) QueryInvoices

func (iq *IssuerQuery) QueryInvoices() *InvoiceQuery

QueryInvoices chains the current query on the "invoices" edge.

func (*IssuerQuery) Select

func (iq *IssuerQuery) Select(fields ...string) *IssuerSelect

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 {
	Name string `json:"name,omitempty"`
}

client.Issuer.Query().
	Select(issuer.FieldName).
	Scan(ctx, &v)

func (*IssuerQuery) Unique

func (iq *IssuerQuery) Unique(unique bool) *IssuerQuery

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 (*IssuerQuery) Where

func (iq *IssuerQuery) Where(ps ...predicate.Issuer) *IssuerQuery

Where adds a new predicate for the IssuerQuery builder.

func (*IssuerQuery) WithBalance

func (iq *IssuerQuery) WithBalance(opts ...func(*BalanceQuery)) *IssuerQuery

WithBalance tells the query-builder to eager-load the nodes that are connected to the "balance" edge. The optional arguments are used to configure the query builder of the edge.

func (*IssuerQuery) WithInvoices

func (iq *IssuerQuery) WithInvoices(opts ...func(*InvoiceQuery)) *IssuerQuery

WithInvoices tells the query-builder to eager-load the nodes that are connected to the "invoices" edge. The optional arguments are used to configure the query builder of the edge.

type IssuerSelect

type IssuerSelect struct {
	*IssuerQuery
	// contains filtered or unexported fields
}

IssuerSelect is the builder for selecting fields of Issuer entities.

func (*IssuerSelect) Aggregate

func (is *IssuerSelect) Aggregate(fns ...AggregateFunc) *IssuerSelect

Aggregate adds the given aggregation functions to the selector query.

func (*IssuerSelect) Bool

func (s *IssuerSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*IssuerSelect) BoolX

func (s *IssuerSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*IssuerSelect) Bools

func (s *IssuerSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*IssuerSelect) BoolsX

func (s *IssuerSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*IssuerSelect) Float64

func (s *IssuerSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*IssuerSelect) Float64X

func (s *IssuerSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*IssuerSelect) Float64s

func (s *IssuerSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*IssuerSelect) Float64sX

func (s *IssuerSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*IssuerSelect) Int

func (s *IssuerSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*IssuerSelect) IntX

func (s *IssuerSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*IssuerSelect) Ints

func (s *IssuerSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*IssuerSelect) IntsX

func (s *IssuerSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*IssuerSelect) Scan

func (is *IssuerSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*IssuerSelect) ScanX

func (s *IssuerSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*IssuerSelect) String

func (s *IssuerSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*IssuerSelect) StringX

func (s *IssuerSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*IssuerSelect) Strings

func (s *IssuerSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*IssuerSelect) StringsX

func (s *IssuerSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type IssuerUpdate

type IssuerUpdate struct {
	// contains filtered or unexported fields
}

IssuerUpdate is the builder for updating Issuer entities.

func (*IssuerUpdate) AddInvoiceIDs

func (iu *IssuerUpdate) AddInvoiceIDs(ids ...uuid.UUID) *IssuerUpdate

AddInvoiceIDs adds the "invoices" edge to the Invoice entity by IDs.

func (*IssuerUpdate) AddInvoices

func (iu *IssuerUpdate) AddInvoices(i ...*Invoice) *IssuerUpdate

AddInvoices adds the "invoices" edges to the Invoice entity.

func (*IssuerUpdate) ClearBalance

func (iu *IssuerUpdate) ClearBalance() *IssuerUpdate

ClearBalance clears the "balance" edge to the Balance entity.

func (*IssuerUpdate) ClearInvoices

func (iu *IssuerUpdate) ClearInvoices() *IssuerUpdate

ClearInvoices clears all "invoices" edges to the Invoice entity.

func (*IssuerUpdate) Exec

func (iu *IssuerUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*IssuerUpdate) ExecX

func (iu *IssuerUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*IssuerUpdate) Mutation

func (iu *IssuerUpdate) Mutation() *IssuerMutation

Mutation returns the IssuerMutation object of the builder.

func (*IssuerUpdate) RemoveInvoiceIDs

func (iu *IssuerUpdate) RemoveInvoiceIDs(ids ...uuid.UUID) *IssuerUpdate

RemoveInvoiceIDs removes the "invoices" edge to Invoice entities by IDs.

func (*IssuerUpdate) RemoveInvoices

func (iu *IssuerUpdate) RemoveInvoices(i ...*Invoice) *IssuerUpdate

RemoveInvoices removes "invoices" edges to Invoice entities.

func (*IssuerUpdate) Save

func (iu *IssuerUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*IssuerUpdate) SaveX

func (iu *IssuerUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*IssuerUpdate) SetBalance

func (iu *IssuerUpdate) SetBalance(b *Balance) *IssuerUpdate

SetBalance sets the "balance" edge to the Balance entity.

func (*IssuerUpdate) SetBalanceID

func (iu *IssuerUpdate) SetBalanceID(id uuid.UUID) *IssuerUpdate

SetBalanceID sets the "balance" edge to the Balance entity by ID.

func (*IssuerUpdate) SetName

func (iu *IssuerUpdate) SetName(s string) *IssuerUpdate

SetName sets the "name" field.

func (*IssuerUpdate) Where

func (iu *IssuerUpdate) Where(ps ...predicate.Issuer) *IssuerUpdate

Where appends a list predicates to the IssuerUpdate builder.

type IssuerUpdateOne

type IssuerUpdateOne struct {
	// contains filtered or unexported fields
}

IssuerUpdateOne is the builder for updating a single Issuer entity.

func (*IssuerUpdateOne) AddInvoiceIDs

func (iuo *IssuerUpdateOne) AddInvoiceIDs(ids ...uuid.UUID) *IssuerUpdateOne

AddInvoiceIDs adds the "invoices" edge to the Invoice entity by IDs.

func (*IssuerUpdateOne) AddInvoices

func (iuo *IssuerUpdateOne) AddInvoices(i ...*Invoice) *IssuerUpdateOne

AddInvoices adds the "invoices" edges to the Invoice entity.

func (*IssuerUpdateOne) ClearBalance

func (iuo *IssuerUpdateOne) ClearBalance() *IssuerUpdateOne

ClearBalance clears the "balance" edge to the Balance entity.

func (*IssuerUpdateOne) ClearInvoices

func (iuo *IssuerUpdateOne) ClearInvoices() *IssuerUpdateOne

ClearInvoices clears all "invoices" edges to the Invoice entity.

func (*IssuerUpdateOne) Exec

func (iuo *IssuerUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*IssuerUpdateOne) ExecX

func (iuo *IssuerUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*IssuerUpdateOne) Mutation

func (iuo *IssuerUpdateOne) Mutation() *IssuerMutation

Mutation returns the IssuerMutation object of the builder.

func (*IssuerUpdateOne) RemoveInvoiceIDs

func (iuo *IssuerUpdateOne) RemoveInvoiceIDs(ids ...uuid.UUID) *IssuerUpdateOne

RemoveInvoiceIDs removes the "invoices" edge to Invoice entities by IDs.

func (*IssuerUpdateOne) RemoveInvoices

func (iuo *IssuerUpdateOne) RemoveInvoices(i ...*Invoice) *IssuerUpdateOne

RemoveInvoices removes "invoices" edges to Invoice entities.

func (*IssuerUpdateOne) Save

func (iuo *IssuerUpdateOne) Save(ctx context.Context) (*Issuer, error)

Save executes the query and returns the updated Issuer entity.

func (*IssuerUpdateOne) SaveX

func (iuo *IssuerUpdateOne) SaveX(ctx context.Context) *Issuer

SaveX is like Save, but panics if an error occurs.

func (*IssuerUpdateOne) Select

func (iuo *IssuerUpdateOne) Select(field string, fields ...string) *IssuerUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*IssuerUpdateOne) SetBalance

func (iuo *IssuerUpdateOne) SetBalance(b *Balance) *IssuerUpdateOne

SetBalance sets the "balance" edge to the Balance entity.

func (*IssuerUpdateOne) SetBalanceID

func (iuo *IssuerUpdateOne) SetBalanceID(id uuid.UUID) *IssuerUpdateOne

SetBalanceID sets the "balance" edge to the Balance entity by ID.

func (*IssuerUpdateOne) SetName

func (iuo *IssuerUpdateOne) SetName(s string) *IssuerUpdateOne

SetName sets the "name" field.

func (*IssuerUpdateOne) Where

func (iuo *IssuerUpdateOne) Where(ps ...predicate.Issuer) *IssuerUpdateOne

Where appends a list predicates to the IssuerUpdate builder.

type Issuers

type Issuers []*Issuer

Issuers is a parsable slice of Issuer.

type Ledger

type Ledger struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Status holds the value of the "status" field.
	Status ledger.Status `json:"status,omitempty"`
	// InvoiceID holds the value of the "invoice_id" field.
	InvoiceID uuid.UUID `json:"invoice_id,omitempty"`
	// Entity holds the value of the "entity" field.
	Entity ledger.Entity `json:"entity,omitempty"`
	// EntityID holds the value of the "entity_id" field.
	EntityID uuid.UUID `json:"entity_id,omitempty"`
	// Amount holds the value of the "amount" field.
	Amount float64 `json:"amount,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"`
	// contains filtered or unexported fields
}

Ledger is the model entity for the Ledger schema.

func (*Ledger) String

func (l *Ledger) String() string

String implements the fmt.Stringer.

func (*Ledger) Unwrap

func (l *Ledger) Unwrap() *Ledger

Unwrap unwraps the Ledger 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 (*Ledger) Update

func (l *Ledger) Update() *LedgerUpdateOne

Update returns a builder for updating this Ledger. Note that you need to call Ledger.Unwrap() before calling this method if this Ledger was returned from a transaction, and the transaction was committed or rolled back.

func (*Ledger) Value

func (l *Ledger) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Ledger. This includes values selected through modifiers, order, etc.

type LedgerClient

type LedgerClient struct {
	// contains filtered or unexported fields
}

LedgerClient is a client for the Ledger schema.

func NewLedgerClient

func NewLedgerClient(c config) *LedgerClient

NewLedgerClient returns a client for the Ledger from the given config.

func (*LedgerClient) Create

func (c *LedgerClient) Create() *LedgerCreate

Create returns a builder for creating a Ledger entity.

func (*LedgerClient) CreateBulk

func (c *LedgerClient) CreateBulk(builders ...*LedgerCreate) *LedgerCreateBulk

CreateBulk returns a builder for creating a bulk of Ledger entities.

func (*LedgerClient) Delete

func (c *LedgerClient) Delete() *LedgerDelete

Delete returns a delete builder for Ledger.

func (*LedgerClient) DeleteOne

func (c *LedgerClient) DeleteOne(l *Ledger) *LedgerDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*LedgerClient) DeleteOneID

func (c *LedgerClient) DeleteOneID(id uuid.UUID) *LedgerDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*LedgerClient) Get

func (c *LedgerClient) Get(ctx context.Context, id uuid.UUID) (*Ledger, error)

Get returns a Ledger entity by its id.

func (*LedgerClient) GetX

func (c *LedgerClient) GetX(ctx context.Context, id uuid.UUID) *Ledger

GetX is like Get, but panics if an error occurs.

func (*LedgerClient) Hooks

func (c *LedgerClient) Hooks() []Hook

Hooks returns the client hooks.

func (*LedgerClient) Intercept

func (c *LedgerClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `ledger.Intercept(f(g(h())))`.

func (*LedgerClient) Interceptors

func (c *LedgerClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*LedgerClient) Query

func (c *LedgerClient) Query() *LedgerQuery

Query returns a query builder for Ledger.

func (*LedgerClient) Update

func (c *LedgerClient) Update() *LedgerUpdate

Update returns an update builder for Ledger.

func (*LedgerClient) UpdateOne

func (c *LedgerClient) UpdateOne(l *Ledger) *LedgerUpdateOne

UpdateOne returns an update builder for the given entity.

func (*LedgerClient) UpdateOneID

func (c *LedgerClient) UpdateOneID(id uuid.UUID) *LedgerUpdateOne

UpdateOneID returns an update builder for the given id.

func (*LedgerClient) Use

func (c *LedgerClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `ledger.Hooks(f(g(h())))`.

type LedgerCreate

type LedgerCreate struct {
	// contains filtered or unexported fields
}

LedgerCreate is the builder for creating a Ledger entity.

func (*LedgerCreate) Exec

func (lc *LedgerCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*LedgerCreate) ExecX

func (lc *LedgerCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LedgerCreate) Mutation

func (lc *LedgerCreate) Mutation() *LedgerMutation

Mutation returns the LedgerMutation object of the builder.

func (*LedgerCreate) Save

func (lc *LedgerCreate) Save(ctx context.Context) (*Ledger, error)

Save creates the Ledger in the database.

func (*LedgerCreate) SaveX

func (lc *LedgerCreate) SaveX(ctx context.Context) *Ledger

SaveX calls Save and panics if Save returns an error.

func (*LedgerCreate) SetAmount

func (lc *LedgerCreate) SetAmount(f float64) *LedgerCreate

SetAmount sets the "amount" field.

func (*LedgerCreate) SetCreatedAt

func (lc *LedgerCreate) SetCreatedAt(t time.Time) *LedgerCreate

SetCreatedAt sets the "created_at" field.

func (*LedgerCreate) SetEntity

func (lc *LedgerCreate) SetEntity(l ledger.Entity) *LedgerCreate

SetEntity sets the "entity" field.

func (*LedgerCreate) SetEntityID

func (lc *LedgerCreate) SetEntityID(u uuid.UUID) *LedgerCreate

SetEntityID sets the "entity_id" field.

func (*LedgerCreate) SetID

func (lc *LedgerCreate) SetID(u uuid.UUID) *LedgerCreate

SetID sets the "id" field.

func (*LedgerCreate) SetInvoiceID

func (lc *LedgerCreate) SetInvoiceID(u uuid.UUID) *LedgerCreate

SetInvoiceID sets the "invoice_id" field.

func (*LedgerCreate) SetNillableCreatedAt

func (lc *LedgerCreate) SetNillableCreatedAt(t *time.Time) *LedgerCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*LedgerCreate) SetNillableID

func (lc *LedgerCreate) SetNillableID(u *uuid.UUID) *LedgerCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*LedgerCreate) SetNillableStatus

func (lc *LedgerCreate) SetNillableStatus(l *ledger.Status) *LedgerCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*LedgerCreate) SetNillableUpdatedAt

func (lc *LedgerCreate) SetNillableUpdatedAt(t *time.Time) *LedgerCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*LedgerCreate) SetStatus

func (lc *LedgerCreate) SetStatus(l ledger.Status) *LedgerCreate

SetStatus sets the "status" field.

func (*LedgerCreate) SetUpdatedAt

func (lc *LedgerCreate) SetUpdatedAt(t time.Time) *LedgerCreate

SetUpdatedAt sets the "updated_at" field.

type LedgerCreateBulk

type LedgerCreateBulk struct {
	// contains filtered or unexported fields
}

LedgerCreateBulk is the builder for creating many Ledger entities in bulk.

func (*LedgerCreateBulk) Exec

func (lcb *LedgerCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*LedgerCreateBulk) ExecX

func (lcb *LedgerCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LedgerCreateBulk) Save

func (lcb *LedgerCreateBulk) Save(ctx context.Context) ([]*Ledger, error)

Save creates the Ledger entities in the database.

func (*LedgerCreateBulk) SaveX

func (lcb *LedgerCreateBulk) SaveX(ctx context.Context) []*Ledger

SaveX is like Save, but panics if an error occurs.

type LedgerDelete

type LedgerDelete struct {
	// contains filtered or unexported fields
}

LedgerDelete is the builder for deleting a Ledger entity.

func (*LedgerDelete) Exec

func (ld *LedgerDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*LedgerDelete) ExecX

func (ld *LedgerDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*LedgerDelete) Where

func (ld *LedgerDelete) Where(ps ...predicate.Ledger) *LedgerDelete

Where appends a list predicates to the LedgerDelete builder.

type LedgerDeleteOne

type LedgerDeleteOne struct {
	// contains filtered or unexported fields
}

LedgerDeleteOne is the builder for deleting a single Ledger entity.

func (*LedgerDeleteOne) Exec

func (ldo *LedgerDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*LedgerDeleteOne) ExecX

func (ldo *LedgerDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LedgerDeleteOne) Where

func (ldo *LedgerDeleteOne) Where(ps ...predicate.Ledger) *LedgerDeleteOne

Where appends a list predicates to the LedgerDelete builder.

type LedgerGroupBy

type LedgerGroupBy struct {
	// contains filtered or unexported fields
}

LedgerGroupBy is the group-by builder for Ledger entities.

func (*LedgerGroupBy) Aggregate

func (lgb *LedgerGroupBy) Aggregate(fns ...AggregateFunc) *LedgerGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*LedgerGroupBy) Bool

func (s *LedgerGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*LedgerGroupBy) BoolX

func (s *LedgerGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*LedgerGroupBy) Bools

func (s *LedgerGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*LedgerGroupBy) BoolsX

func (s *LedgerGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*LedgerGroupBy) Float64

func (s *LedgerGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*LedgerGroupBy) Float64X

func (s *LedgerGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*LedgerGroupBy) Float64s

func (s *LedgerGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*LedgerGroupBy) Float64sX

func (s *LedgerGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*LedgerGroupBy) Int

func (s *LedgerGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*LedgerGroupBy) IntX

func (s *LedgerGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*LedgerGroupBy) Ints

func (s *LedgerGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*LedgerGroupBy) IntsX

func (s *LedgerGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*LedgerGroupBy) Scan

func (lgb *LedgerGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*LedgerGroupBy) ScanX

func (s *LedgerGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*LedgerGroupBy) String

func (s *LedgerGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*LedgerGroupBy) StringX

func (s *LedgerGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*LedgerGroupBy) Strings

func (s *LedgerGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*LedgerGroupBy) StringsX

func (s *LedgerGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type LedgerMutation

type LedgerMutation struct {
	// contains filtered or unexported fields
}

LedgerMutation represents an operation that mutates the Ledger nodes in the graph.

func (*LedgerMutation) AddAmount

func (m *LedgerMutation) AddAmount(f float64)

AddAmount adds f to the "amount" field.

func (*LedgerMutation) AddField

func (m *LedgerMutation) 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 (*LedgerMutation) AddedAmount

func (m *LedgerMutation) AddedAmount() (r float64, exists bool)

AddedAmount returns the value that was added to the "amount" field in this mutation.

func (*LedgerMutation) AddedEdges

func (m *LedgerMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*LedgerMutation) AddedField

func (m *LedgerMutation) 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 (*LedgerMutation) AddedFields

func (m *LedgerMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*LedgerMutation) AddedIDs

func (m *LedgerMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*LedgerMutation) Amount

func (m *LedgerMutation) Amount() (r float64, exists bool)

Amount returns the value of the "amount" field in the mutation.

func (*LedgerMutation) ClearEdge

func (m *LedgerMutation) 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 (*LedgerMutation) ClearField

func (m *LedgerMutation) 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 (*LedgerMutation) ClearedEdges

func (m *LedgerMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*LedgerMutation) ClearedFields

func (m *LedgerMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (LedgerMutation) Client

func (m LedgerMutation) 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 (*LedgerMutation) CreatedAt

func (m *LedgerMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*LedgerMutation) EdgeCleared

func (m *LedgerMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*LedgerMutation) Entity

func (m *LedgerMutation) Entity() (r ledger.Entity, exists bool)

Entity returns the value of the "entity" field in the mutation.

func (*LedgerMutation) EntityID

func (m *LedgerMutation) EntityID() (r uuid.UUID, exists bool)

EntityID returns the value of the "entity_id" field in the mutation.

func (*LedgerMutation) Field

func (m *LedgerMutation) 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 (*LedgerMutation) FieldCleared

func (m *LedgerMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*LedgerMutation) Fields

func (m *LedgerMutation) 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 (*LedgerMutation) ID

func (m *LedgerMutation) 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 (*LedgerMutation) IDs

func (m *LedgerMutation) 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 (*LedgerMutation) InvoiceID

func (m *LedgerMutation) InvoiceID() (r uuid.UUID, exists bool)

InvoiceID returns the value of the "invoice_id" field in the mutation.

func (*LedgerMutation) OldAmount

func (m *LedgerMutation) OldAmount(ctx context.Context) (v float64, err error)

OldAmount returns the old "amount" field's value of the Ledger entity. If the Ledger 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 (*LedgerMutation) OldCreatedAt

func (m *LedgerMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Ledger entity. If the Ledger 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 (*LedgerMutation) OldEntity

func (m *LedgerMutation) OldEntity(ctx context.Context) (v ledger.Entity, err error)

OldEntity returns the old "entity" field's value of the Ledger entity. If the Ledger 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 (*LedgerMutation) OldEntityID

func (m *LedgerMutation) OldEntityID(ctx context.Context) (v uuid.UUID, err error)

OldEntityID returns the old "entity_id" field's value of the Ledger entity. If the Ledger 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 (*LedgerMutation) OldField

func (m *LedgerMutation) 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 (*LedgerMutation) OldInvoiceID

func (m *LedgerMutation) OldInvoiceID(ctx context.Context) (v uuid.UUID, err error)

OldInvoiceID returns the old "invoice_id" field's value of the Ledger entity. If the Ledger 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 (*LedgerMutation) OldStatus

func (m *LedgerMutation) OldStatus(ctx context.Context) (v ledger.Status, err error)

OldStatus returns the old "status" field's value of the Ledger entity. If the Ledger 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 (*LedgerMutation) OldUpdatedAt

func (m *LedgerMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Ledger entity. If the Ledger 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 (*LedgerMutation) Op

func (m *LedgerMutation) Op() Op

Op returns the operation name.

func (*LedgerMutation) RemovedEdges

func (m *LedgerMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*LedgerMutation) RemovedIDs

func (m *LedgerMutation) 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 (*LedgerMutation) ResetAmount

func (m *LedgerMutation) ResetAmount()

ResetAmount resets all changes to the "amount" field.

func (*LedgerMutation) ResetCreatedAt

func (m *LedgerMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*LedgerMutation) ResetEdge

func (m *LedgerMutation) 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 (*LedgerMutation) ResetEntity

func (m *LedgerMutation) ResetEntity()

ResetEntity resets all changes to the "entity" field.

func (*LedgerMutation) ResetEntityID

func (m *LedgerMutation) ResetEntityID()

ResetEntityID resets all changes to the "entity_id" field.

func (*LedgerMutation) ResetField

func (m *LedgerMutation) 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 (*LedgerMutation) ResetInvoiceID

func (m *LedgerMutation) ResetInvoiceID()

ResetInvoiceID resets all changes to the "invoice_id" field.

func (*LedgerMutation) ResetStatus

func (m *LedgerMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*LedgerMutation) ResetUpdatedAt

func (m *LedgerMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*LedgerMutation) SetAmount

func (m *LedgerMutation) SetAmount(f float64)

SetAmount sets the "amount" field.

func (*LedgerMutation) SetCreatedAt

func (m *LedgerMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*LedgerMutation) SetEntity

func (m *LedgerMutation) SetEntity(l ledger.Entity)

SetEntity sets the "entity" field.

func (*LedgerMutation) SetEntityID

func (m *LedgerMutation) SetEntityID(u uuid.UUID)

SetEntityID sets the "entity_id" field.

func (*LedgerMutation) SetField

func (m *LedgerMutation) 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 (*LedgerMutation) SetID

func (m *LedgerMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Ledger entities.

func (*LedgerMutation) SetInvoiceID

func (m *LedgerMutation) SetInvoiceID(u uuid.UUID)

SetInvoiceID sets the "invoice_id" field.

func (*LedgerMutation) SetOp

func (m *LedgerMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*LedgerMutation) SetStatus

func (m *LedgerMutation) SetStatus(l ledger.Status)

SetStatus sets the "status" field.

func (*LedgerMutation) SetUpdatedAt

func (m *LedgerMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*LedgerMutation) Status

func (m *LedgerMutation) Status() (r ledger.Status, exists bool)

Status returns the value of the "status" field in the mutation.

func (LedgerMutation) Tx

func (m LedgerMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*LedgerMutation) Type

func (m *LedgerMutation) Type() string

Type returns the node type of this mutation (Ledger).

func (*LedgerMutation) UpdatedAt

func (m *LedgerMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*LedgerMutation) Where

func (m *LedgerMutation) Where(ps ...predicate.Ledger)

Where appends a list predicates to the LedgerMutation builder.

func (*LedgerMutation) WhereP

func (m *LedgerMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the LedgerMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type LedgerQuery

type LedgerQuery struct {
	// contains filtered or unexported fields
}

LedgerQuery is the builder for querying Ledger entities.

func (*LedgerQuery) Aggregate

func (lq *LedgerQuery) Aggregate(fns ...AggregateFunc) *LedgerSelect

Aggregate returns a LedgerSelect configured with the given aggregations.

func (*LedgerQuery) All

func (lq *LedgerQuery) All(ctx context.Context) ([]*Ledger, error)

All executes the query and returns a list of Ledgers.

func (*LedgerQuery) AllX

func (lq *LedgerQuery) AllX(ctx context.Context) []*Ledger

AllX is like All, but panics if an error occurs.

func (*LedgerQuery) Clone

func (lq *LedgerQuery) Clone() *LedgerQuery

Clone returns a duplicate of the LedgerQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*LedgerQuery) Count

func (lq *LedgerQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*LedgerQuery) CountX

func (lq *LedgerQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*LedgerQuery) Exist

func (lq *LedgerQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*LedgerQuery) ExistX

func (lq *LedgerQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*LedgerQuery) First

func (lq *LedgerQuery) First(ctx context.Context) (*Ledger, error)

First returns the first Ledger entity from the query. Returns a *NotFoundError when no Ledger was found.

func (*LedgerQuery) FirstID

func (lq *LedgerQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Ledger ID from the query. Returns a *NotFoundError when no Ledger ID was found.

func (*LedgerQuery) FirstIDX

func (lq *LedgerQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*LedgerQuery) FirstX

func (lq *LedgerQuery) FirstX(ctx context.Context) *Ledger

FirstX is like First, but panics if an error occurs.

func (*LedgerQuery) GroupBy

func (lq *LedgerQuery) GroupBy(field string, fields ...string) *LedgerGroupBy

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 {
	Status ledger.Status `json:"status,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Ledger.Query().
	GroupBy(ledger.FieldStatus).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*LedgerQuery) IDs

func (lq *LedgerQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Ledger IDs.

func (*LedgerQuery) IDsX

func (lq *LedgerQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*LedgerQuery) Limit

func (lq *LedgerQuery) Limit(limit int) *LedgerQuery

Limit the number of records to be returned by this query.

func (*LedgerQuery) Offset

func (lq *LedgerQuery) Offset(offset int) *LedgerQuery

Offset to start from.

func (*LedgerQuery) Only

func (lq *LedgerQuery) Only(ctx context.Context) (*Ledger, error)

Only returns a single Ledger entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Ledger entity is found. Returns a *NotFoundError when no Ledger entities are found.

func (*LedgerQuery) OnlyID

func (lq *LedgerQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Ledger ID in the query. Returns a *NotSingularError when more than one Ledger ID is found. Returns a *NotFoundError when no entities are found.

func (*LedgerQuery) OnlyIDX

func (lq *LedgerQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*LedgerQuery) OnlyX

func (lq *LedgerQuery) OnlyX(ctx context.Context) *Ledger

OnlyX is like Only, but panics if an error occurs.

func (*LedgerQuery) Order

func (lq *LedgerQuery) Order(o ...ledger.OrderOption) *LedgerQuery

Order specifies how the records should be ordered.

func (*LedgerQuery) Select

func (lq *LedgerQuery) Select(fields ...string) *LedgerSelect

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 {
	Status ledger.Status `json:"status,omitempty"`
}

client.Ledger.Query().
	Select(ledger.FieldStatus).
	Scan(ctx, &v)

func (*LedgerQuery) Unique

func (lq *LedgerQuery) Unique(unique bool) *LedgerQuery

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 (*LedgerQuery) Where

func (lq *LedgerQuery) Where(ps ...predicate.Ledger) *LedgerQuery

Where adds a new predicate for the LedgerQuery builder.

type LedgerSelect

type LedgerSelect struct {
	*LedgerQuery
	// contains filtered or unexported fields
}

LedgerSelect is the builder for selecting fields of Ledger entities.

func (*LedgerSelect) Aggregate

func (ls *LedgerSelect) Aggregate(fns ...AggregateFunc) *LedgerSelect

Aggregate adds the given aggregation functions to the selector query.

func (*LedgerSelect) Bool

func (s *LedgerSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*LedgerSelect) BoolX

func (s *LedgerSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*LedgerSelect) Bools

func (s *LedgerSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*LedgerSelect) BoolsX

func (s *LedgerSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*LedgerSelect) Float64

func (s *LedgerSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*LedgerSelect) Float64X

func (s *LedgerSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*LedgerSelect) Float64s

func (s *LedgerSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*LedgerSelect) Float64sX

func (s *LedgerSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*LedgerSelect) Int

func (s *LedgerSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*LedgerSelect) IntX

func (s *LedgerSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*LedgerSelect) Ints

func (s *LedgerSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*LedgerSelect) IntsX

func (s *LedgerSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*LedgerSelect) Scan

func (ls *LedgerSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*LedgerSelect) ScanX

func (s *LedgerSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*LedgerSelect) String

func (s *LedgerSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*LedgerSelect) StringX

func (s *LedgerSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*LedgerSelect) Strings

func (s *LedgerSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*LedgerSelect) StringsX

func (s *LedgerSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type LedgerUpdate

type LedgerUpdate struct {
	// contains filtered or unexported fields
}

LedgerUpdate is the builder for updating Ledger entities.

func (*LedgerUpdate) AddAmount

func (lu *LedgerUpdate) AddAmount(f float64) *LedgerUpdate

AddAmount adds f to the "amount" field.

func (*LedgerUpdate) Exec

func (lu *LedgerUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*LedgerUpdate) ExecX

func (lu *LedgerUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LedgerUpdate) Mutation

func (lu *LedgerUpdate) Mutation() *LedgerMutation

Mutation returns the LedgerMutation object of the builder.

func (*LedgerUpdate) Save

func (lu *LedgerUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*LedgerUpdate) SaveX

func (lu *LedgerUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*LedgerUpdate) SetAmount

func (lu *LedgerUpdate) SetAmount(f float64) *LedgerUpdate

SetAmount sets the "amount" field.

func (*LedgerUpdate) SetNillableStatus

func (lu *LedgerUpdate) SetNillableStatus(l *ledger.Status) *LedgerUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*LedgerUpdate) SetStatus

func (lu *LedgerUpdate) SetStatus(l ledger.Status) *LedgerUpdate

SetStatus sets the "status" field.

func (*LedgerUpdate) SetUpdatedAt

func (lu *LedgerUpdate) SetUpdatedAt(t time.Time) *LedgerUpdate

SetUpdatedAt sets the "updated_at" field.

func (*LedgerUpdate) Where

func (lu *LedgerUpdate) Where(ps ...predicate.Ledger) *LedgerUpdate

Where appends a list predicates to the LedgerUpdate builder.

type LedgerUpdateOne

type LedgerUpdateOne struct {
	// contains filtered or unexported fields
}

LedgerUpdateOne is the builder for updating a single Ledger entity.

func (*LedgerUpdateOne) AddAmount

func (luo *LedgerUpdateOne) AddAmount(f float64) *LedgerUpdateOne

AddAmount adds f to the "amount" field.

func (*LedgerUpdateOne) Exec

func (luo *LedgerUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*LedgerUpdateOne) ExecX

func (luo *LedgerUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LedgerUpdateOne) Mutation

func (luo *LedgerUpdateOne) Mutation() *LedgerMutation

Mutation returns the LedgerMutation object of the builder.

func (*LedgerUpdateOne) Save

func (luo *LedgerUpdateOne) Save(ctx context.Context) (*Ledger, error)

Save executes the query and returns the updated Ledger entity.

func (*LedgerUpdateOne) SaveX

func (luo *LedgerUpdateOne) SaveX(ctx context.Context) *Ledger

SaveX is like Save, but panics if an error occurs.

func (*LedgerUpdateOne) Select

func (luo *LedgerUpdateOne) Select(field string, fields ...string) *LedgerUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*LedgerUpdateOne) SetAmount

func (luo *LedgerUpdateOne) SetAmount(f float64) *LedgerUpdateOne

SetAmount sets the "amount" field.

func (*LedgerUpdateOne) SetNillableStatus

func (luo *LedgerUpdateOne) SetNillableStatus(l *ledger.Status) *LedgerUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*LedgerUpdateOne) SetStatus

func (luo *LedgerUpdateOne) SetStatus(l ledger.Status) *LedgerUpdateOne

SetStatus sets the "status" field.

func (*LedgerUpdateOne) SetUpdatedAt

func (luo *LedgerUpdateOne) SetUpdatedAt(t time.Time) *LedgerUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*LedgerUpdateOne) Where

func (luo *LedgerUpdateOne) Where(ps ...predicate.Ledger) *LedgerUpdateOne

Where appends a list predicates to the LedgerUpdate builder.

type Ledgers

type Ledgers []*Ledger

Ledgers is a parsable slice of Ledger.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflicts in user's code.

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

type NotLoadedError struct {
	// contains filtered or unexported fields
}

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

type NotSingularError struct {
	// contains filtered or unexported fields
}

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

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 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 {

	// Balance is the client for interacting with the Balance builders.
	Balance *BalanceClient
	// Bid is the client for interacting with the Bid builders.
	Bid *BidClient
	// Investor is the client for interacting with the Investor builders.
	Investor *InvestorClient
	// Invoice is the client for interacting with the Invoice builders.
	Invoice *InvoiceClient
	// InvoiceItem is the client for interacting with the InvoiceItem builders.
	InvoiceItem *InvoiceItemClient
	// Issuer is the client for interacting with the Issuer builders.
	Issuer *IssuerClient
	// Ledger is the client for interacting with the Ledger builders.
	Ledger *LedgerClient
	// 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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL