Documentation
¶
Overview ¶
Package balance is a generated GoMock package.
Index ¶
- type BalancePostgreSQLModel
- type BalancePostgreSQLRepository
- func (r *BalancePostgreSQLRepository) Create(ctx context.Context, balance *mmodel.Balance) error
- func (r *BalancePostgreSQLRepository) Delete(ctx context.Context, organizationID, ledgerID, id uuid.UUID) error
- func (r *BalancePostgreSQLRepository) Find(ctx context.Context, organizationID, ledgerID, id uuid.UUID) (*mmodel.Balance, error)
- func (r *BalancePostgreSQLRepository) ListAll(ctx context.Context, organizationID, ledgerID uuid.UUID, ...) ([]*mmodel.Balance, http.CursorPagination, error)
- func (r *BalancePostgreSQLRepository) ListAllByAccountID(ctx context.Context, organizationID, ledgerID, accountID uuid.UUID, ...) ([]*mmodel.Balance, http.CursorPagination, error)
- func (r *BalancePostgreSQLRepository) ListByAccountIDs(ctx context.Context, organizationID, ledgerID uuid.UUID, ...) ([]*mmodel.Balance, error)
- func (r *BalancePostgreSQLRepository) ListByAliases(ctx context.Context, organizationID, ledgerID uuid.UUID, aliases []string) ([]*mmodel.Balance, error)
- func (r *BalancePostgreSQLRepository) SelectForUpdate(ctx context.Context, organizationID, ledgerID uuid.UUID, ...) error
- func (r *BalancePostgreSQLRepository) Update(ctx context.Context, organizationID, ledgerID, id uuid.UUID, ...) error
- type MockRepository
- func (m *MockRepository) Create(ctx context.Context, balance *mmodel.Balance) error
- func (m *MockRepository) Delete(ctx context.Context, organizationID, ledgerID, id uuid.UUID) error
- func (m *MockRepository) EXPECT() *MockRepositoryMockRecorder
- func (m *MockRepository) Find(ctx context.Context, organizationID, ledgerID, id uuid.UUID) (*mmodel.Balance, error)
- func (m *MockRepository) ListAll(ctx context.Context, organizationID, ledgerID uuid.UUID, ...) ([]*mmodel.Balance, http.CursorPagination, error)
- func (m *MockRepository) ListAllByAccountID(ctx context.Context, organizationID, ledgerID, accountID uuid.UUID, ...) ([]*mmodel.Balance, http.CursorPagination, error)
- func (m *MockRepository) ListByAccountIDs(ctx context.Context, organizationID, ledgerID uuid.UUID, ids []uuid.UUID) ([]*mmodel.Balance, error)
- func (m *MockRepository) ListByAliases(ctx context.Context, organizationID, ledgerID uuid.UUID, aliases []string) ([]*mmodel.Balance, error)
- func (m *MockRepository) SelectForUpdate(ctx context.Context, organizationID, ledgerID uuid.UUID, ...) error
- func (m *MockRepository) Update(ctx context.Context, organizationID, ledgerID, id uuid.UUID, ...) error
- type MockRepositoryMockRecorder
- func (mr *MockRepositoryMockRecorder) Create(ctx, balance any) *gomock.Call
- func (mr *MockRepositoryMockRecorder) Delete(ctx, organizationID, ledgerID, id any) *gomock.Call
- func (mr *MockRepositoryMockRecorder) Find(ctx, organizationID, ledgerID, id any) *gomock.Call
- func (mr *MockRepositoryMockRecorder) ListAll(ctx, organizationID, ledgerID, filter any) *gomock.Call
- func (mr *MockRepositoryMockRecorder) ListAllByAccountID(ctx, organizationID, ledgerID, accountID, filter any) *gomock.Call
- func (mr *MockRepositoryMockRecorder) ListByAccountIDs(ctx, organizationID, ledgerID, ids any) *gomock.Call
- func (mr *MockRepositoryMockRecorder) ListByAliases(ctx, organizationID, ledgerID, aliases any) *gomock.Call
- func (mr *MockRepositoryMockRecorder) SelectForUpdate(ctx, organizationID, ledgerID, balances any) *gomock.Call
- func (mr *MockRepositoryMockRecorder) Update(ctx, organizationID, ledgerID, id, balance any) *gomock.Call
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BalancePostgreSQLModel ¶
type BalancePostgreSQLModel struct { ID string OrganizationID string LedgerID string AccountID string Alias string AssetCode string Available int64 OnHold int64 Scale int64 Version int64 AccountType string AllowSending bool AllowReceiving bool CreatedAt time.Time UpdatedAt time.Time DeletedAt sql.NullTime }
BalancePostgreSQLModel represents the entity Balance into SQL context in Database
func (*BalancePostgreSQLModel) FromEntity ¶
func (b *BalancePostgreSQLModel) FromEntity(balance *mmodel.Balance)
FromEntity converts a request entity Balance to BalancePostgreSQLModel
func (*BalancePostgreSQLModel) ToEntity ¶
func (b *BalancePostgreSQLModel) ToEntity() *mmodel.Balance
ToEntity converts an BalancePostgreSQLModel to a response entity Balance
type BalancePostgreSQLRepository ¶
type BalancePostgreSQLRepository struct {
// contains filtered or unexported fields
}
BalancePostgreSQLRepository is a Postgresql-specific implementation of the BalanceRepository.
func NewBalancePostgreSQLRepository ¶
func NewBalancePostgreSQLRepository(pc *mpostgres.PostgresConnection) *BalancePostgreSQLRepository
NewBalancePostgreSQLRepository returns a new instance of BalancePostgreSQLRepository using the given Postgres connection.
func (*BalancePostgreSQLRepository) Delete ¶
func (r *BalancePostgreSQLRepository) Delete(ctx context.Context, organizationID, ledgerID, id uuid.UUID) error
Delete marks a balance as deleted in the database using the ID provided
func (*BalancePostgreSQLRepository) Find ¶
func (r *BalancePostgreSQLRepository) Find(ctx context.Context, organizationID, ledgerID, id uuid.UUID) (*mmodel.Balance, error)
Find retrieves a balance entity from the database using the provided ID.
func (*BalancePostgreSQLRepository) ListAll ¶
func (r *BalancePostgreSQLRepository) ListAll(ctx context.Context, organizationID, ledgerID uuid.UUID, filter http.Pagination) ([]*mmodel.Balance, http.CursorPagination, error)
ListAll list Balances entity from the database.
func (*BalancePostgreSQLRepository) ListAllByAccountID ¶
func (r *BalancePostgreSQLRepository) ListAllByAccountID(ctx context.Context, organizationID, ledgerID, accountID uuid.UUID, filter http.Pagination) ([]*mmodel.Balance, http.CursorPagination, error)
ListAllByAccountID list Balances entity from the database using the provided accountID.
func (*BalancePostgreSQLRepository) ListByAccountIDs ¶
func (r *BalancePostgreSQLRepository) ListByAccountIDs(ctx context.Context, organizationID, ledgerID uuid.UUID, accountIds []uuid.UUID) ([]*mmodel.Balance, error)
ListByAccountIDs list Balances entity from the database using the provided accountIDs.
func (*BalancePostgreSQLRepository) ListByAliases ¶
func (r *BalancePostgreSQLRepository) ListByAliases(ctx context.Context, organizationID, ledgerID uuid.UUID, aliases []string) ([]*mmodel.Balance, error)
ListByAliases list Balances entity from the database using the provided aliases.
func (*BalancePostgreSQLRepository) SelectForUpdate ¶
func (r *BalancePostgreSQLRepository) SelectForUpdate(ctx context.Context, organizationID, ledgerID uuid.UUID, balances []*mmodel.Balance) error
SelectForUpdate a Balance entity into Postgresql.
func (*BalancePostgreSQLRepository) Update ¶
func (r *BalancePostgreSQLRepository) Update(ctx context.Context, organizationID, ledgerID, id uuid.UUID, balance mmodel.UpdateBalance) error
Update updates the allow_sending and allow_receiving fields of a Balance in the database.
type MockRepository ¶
type MockRepository struct {
// contains filtered or unexported fields
}
MockRepository is a mock of Repository interface.
func NewMockRepository ¶
func NewMockRepository(ctrl *gomock.Controller) *MockRepository
NewMockRepository creates a new mock instance.
func (*MockRepository) EXPECT ¶
func (m *MockRepository) EXPECT() *MockRepositoryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockRepository) Find ¶
func (m *MockRepository) Find(ctx context.Context, organizationID, ledgerID, id uuid.UUID) (*mmodel.Balance, error)
Find mocks base method.
func (*MockRepository) ListAll ¶
func (m *MockRepository) ListAll(ctx context.Context, organizationID, ledgerID uuid.UUID, filter http.Pagination) ([]*mmodel.Balance, http.CursorPagination, error)
ListAll mocks base method.
func (*MockRepository) ListAllByAccountID ¶
func (m *MockRepository) ListAllByAccountID(ctx context.Context, organizationID, ledgerID, accountID uuid.UUID, filter http.Pagination) ([]*mmodel.Balance, http.CursorPagination, error)
ListAllByAccountID mocks base method.
func (*MockRepository) ListByAccountIDs ¶
func (m *MockRepository) ListByAccountIDs(ctx context.Context, organizationID, ledgerID uuid.UUID, ids []uuid.UUID) ([]*mmodel.Balance, error)
ListByAccountIDs mocks base method.
func (*MockRepository) ListByAliases ¶
func (m *MockRepository) ListByAliases(ctx context.Context, organizationID, ledgerID uuid.UUID, aliases []string) ([]*mmodel.Balance, error)
ListByAliases mocks base method.
func (*MockRepository) SelectForUpdate ¶
func (m *MockRepository) SelectForUpdate(ctx context.Context, organizationID, ledgerID uuid.UUID, balances []*mmodel.Balance) error
SelectForUpdate mocks base method.
func (*MockRepository) Update ¶
func (m *MockRepository) Update(ctx context.Context, organizationID, ledgerID, id uuid.UUID, balance mmodel.UpdateBalance) error
Update mocks base method.
type MockRepositoryMockRecorder ¶
type MockRepositoryMockRecorder struct {
// contains filtered or unexported fields
}
MockRepositoryMockRecorder is the mock recorder for MockRepository.
func (*MockRepositoryMockRecorder) Create ¶
func (mr *MockRepositoryMockRecorder) Create(ctx, balance any) *gomock.Call
Create indicates an expected call of Create.
func (*MockRepositoryMockRecorder) Delete ¶
func (mr *MockRepositoryMockRecorder) Delete(ctx, organizationID, ledgerID, id any) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockRepositoryMockRecorder) Find ¶
func (mr *MockRepositoryMockRecorder) Find(ctx, organizationID, ledgerID, id any) *gomock.Call
Find indicates an expected call of Find.
func (*MockRepositoryMockRecorder) ListAll ¶
func (mr *MockRepositoryMockRecorder) ListAll(ctx, organizationID, ledgerID, filter any) *gomock.Call
ListAll indicates an expected call of ListAll.
func (*MockRepositoryMockRecorder) ListAllByAccountID ¶
func (mr *MockRepositoryMockRecorder) ListAllByAccountID(ctx, organizationID, ledgerID, accountID, filter any) *gomock.Call
ListAllByAccountID indicates an expected call of ListAllByAccountID.
func (*MockRepositoryMockRecorder) ListByAccountIDs ¶
func (mr *MockRepositoryMockRecorder) ListByAccountIDs(ctx, organizationID, ledgerID, ids any) *gomock.Call
ListByAccountIDs indicates an expected call of ListByAccountIDs.
func (*MockRepositoryMockRecorder) ListByAliases ¶
func (mr *MockRepositoryMockRecorder) ListByAliases(ctx, organizationID, ledgerID, aliases any) *gomock.Call
ListByAliases indicates an expected call of ListByAliases.
func (*MockRepositoryMockRecorder) SelectForUpdate ¶
func (mr *MockRepositoryMockRecorder) SelectForUpdate(ctx, organizationID, ledgerID, balances any) *gomock.Call
SelectForUpdate indicates an expected call of SelectForUpdate.
type Repository ¶
type Repository interface { Create(ctx context.Context, balance *mmodel.Balance) error Find(ctx context.Context, organizationID, ledgerID, id uuid.UUID) (*mmodel.Balance, error) ListAll(ctx context.Context, organizationID, ledgerID uuid.UUID, filter http.Pagination) ([]*mmodel.Balance, http.CursorPagination, error) ListAllByAccountID(ctx context.Context, organizationID, ledgerID, accountID uuid.UUID, filter http.Pagination) ([]*mmodel.Balance, http.CursorPagination, error) ListByAccountIDs(ctx context.Context, organizationID, ledgerID uuid.UUID, ids []uuid.UUID) ([]*mmodel.Balance, error) ListByAliases(ctx context.Context, organizationID, ledgerID uuid.UUID, aliases []string) ([]*mmodel.Balance, error) SelectForUpdate(ctx context.Context, organizationID, ledgerID uuid.UUID, balances []*mmodel.Balance) error Update(ctx context.Context, organizationID, ledgerID, id uuid.UUID, balance mmodel.UpdateBalance) error Delete(ctx context.Context, organizationID, ledgerID, id uuid.UUID) error }
Repository provides an interface for operations related to balance template entities.