Documentation ¶
Overview ¶
Package ledger is a generated GoMock package.
Index ¶
- type LedgerPostgreSQLModel
- type LedgerPostgreSQLRepository
- func (r *LedgerPostgreSQLRepository) Create(ctx context.Context, ledger *mmodel.Ledger) (*mmodel.Ledger, error)
- func (r *LedgerPostgreSQLRepository) Delete(ctx context.Context, organizationID, id uuid.UUID) error
- func (r *LedgerPostgreSQLRepository) Find(ctx context.Context, organizationID, id uuid.UUID) (*mmodel.Ledger, error)
- func (r *LedgerPostgreSQLRepository) FindAll(ctx context.Context, organizationID uuid.UUID, limit, page int) ([]*mmodel.Ledger, error)
- func (r *LedgerPostgreSQLRepository) FindByName(ctx context.Context, organizationID uuid.UUID, name string) (bool, error)
- func (r *LedgerPostgreSQLRepository) ListByIDs(ctx context.Context, organizationID uuid.UUID, ids []uuid.UUID) ([]*mmodel.Ledger, error)
- func (r *LedgerPostgreSQLRepository) Update(ctx context.Context, organizationID, id uuid.UUID, ledger *mmodel.Ledger) (*mmodel.Ledger, error)
- type MockRepository
- func (m *MockRepository) Create(arg0 context.Context, arg1 *mmodel.Ledger) (*mmodel.Ledger, error)
- func (m *MockRepository) Delete(arg0 context.Context, arg1, arg2 uuid.UUID) error
- func (m *MockRepository) EXPECT() *MockRepositoryMockRecorder
- func (m *MockRepository) Find(arg0 context.Context, arg1, arg2 uuid.UUID) (*mmodel.Ledger, error)
- func (m *MockRepository) FindAll(arg0 context.Context, arg1 uuid.UUID, arg2, arg3 int) ([]*mmodel.Ledger, error)
- func (m *MockRepository) FindByName(arg0 context.Context, arg1 uuid.UUID, arg2 string) (bool, error)
- func (m *MockRepository) ListByIDs(arg0 context.Context, arg1 uuid.UUID, arg2 []uuid.UUID) ([]*mmodel.Ledger, error)
- func (m *MockRepository) Update(arg0 context.Context, arg1, arg2 uuid.UUID, arg3 *mmodel.Ledger) (*mmodel.Ledger, error)
- type MockRepositoryMockRecorder
- func (mr *MockRepositoryMockRecorder) Create(arg0, arg1 any) *gomock.Call
- func (mr *MockRepositoryMockRecorder) Delete(arg0, arg1, arg2 any) *gomock.Call
- func (mr *MockRepositoryMockRecorder) Find(arg0, arg1, arg2 any) *gomock.Call
- func (mr *MockRepositoryMockRecorder) FindAll(arg0, arg1, arg2, arg3 any) *gomock.Call
- func (mr *MockRepositoryMockRecorder) FindByName(arg0, arg1, arg2 any) *gomock.Call
- func (mr *MockRepositoryMockRecorder) ListByIDs(arg0, arg1, arg2 any) *gomock.Call
- func (mr *MockRepositoryMockRecorder) Update(arg0, arg1, arg2, arg3 any) *gomock.Call
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LedgerPostgreSQLModel ¶
type LedgerPostgreSQLModel struct { ID string Name string OrganizationID string Status string StatusDescription *string CreatedAt time.Time UpdatedAt time.Time DeletedAt sql.NullTime Metadata map[string]any }
LedgerPostgreSQLModel represents the entity.Ledger into SQL context in Database
func (*LedgerPostgreSQLModel) FromEntity ¶
func (t *LedgerPostgreSQLModel) FromEntity(ledger *mmodel.Ledger)
FromEntity converts an entity.Ledger to LedgerPostgreSQLModel
func (*LedgerPostgreSQLModel) ToEntity ¶
func (t *LedgerPostgreSQLModel) ToEntity() *mmodel.Ledger
ToEntity converts an LedgerPostgreSQLModel to entity.Ledger
type LedgerPostgreSQLRepository ¶
type LedgerPostgreSQLRepository struct {
// contains filtered or unexported fields
}
LedgerPostgreSQLRepository is a Postgresql-specific implementation of the LedgerRepository.
func NewLedgerPostgreSQLRepository ¶
func NewLedgerPostgreSQLRepository(pc *mpostgres.PostgresConnection) *LedgerPostgreSQLRepository
NewLedgerPostgreSQLRepository returns a new instance of LedgerPostgresRepository using the given Postgres connection.
func (*LedgerPostgreSQLRepository) Create ¶
func (r *LedgerPostgreSQLRepository) Create(ctx context.Context, ledger *mmodel.Ledger) (*mmodel.Ledger, error)
Create a new Ledger entity into Postgresql and returns it.
func (*LedgerPostgreSQLRepository) Delete ¶
func (r *LedgerPostgreSQLRepository) Delete(ctx context.Context, organizationID, id uuid.UUID) error
Delete removes a Ledger entity from the database using the provided ID.
func (*LedgerPostgreSQLRepository) Find ¶
func (r *LedgerPostgreSQLRepository) Find(ctx context.Context, organizationID, id uuid.UUID) (*mmodel.Ledger, error)
Find retrieves a Ledger entity from the database using the provided ID.
func (*LedgerPostgreSQLRepository) FindAll ¶
func (r *LedgerPostgreSQLRepository) FindAll(ctx context.Context, organizationID uuid.UUID, limit, page int) ([]*mmodel.Ledger, error)
FindAll retrieves Ledgers entities from the database.
func (*LedgerPostgreSQLRepository) FindByName ¶
func (r *LedgerPostgreSQLRepository) FindByName(ctx context.Context, organizationID uuid.UUID, name string) (bool, error)
FindByName returns error and a boolean indicating if Ledger entities exists by name
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) FindAll ¶
func (m *MockRepository) FindAll(arg0 context.Context, arg1 uuid.UUID, arg2, arg3 int) ([]*mmodel.Ledger, error)
FindAll mocks base method.
func (*MockRepository) FindByName ¶
func (m *MockRepository) FindByName(arg0 context.Context, arg1 uuid.UUID, arg2 string) (bool, error)
FindByName 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(arg0, arg1 any) *gomock.Call
Create indicates an expected call of Create.
func (*MockRepositoryMockRecorder) Delete ¶
func (mr *MockRepositoryMockRecorder) Delete(arg0, arg1, arg2 any) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockRepositoryMockRecorder) Find ¶
func (mr *MockRepositoryMockRecorder) Find(arg0, arg1, arg2 any) *gomock.Call
Find indicates an expected call of Find.
func (*MockRepositoryMockRecorder) FindAll ¶
func (mr *MockRepositoryMockRecorder) FindAll(arg0, arg1, arg2, arg3 any) *gomock.Call
FindAll indicates an expected call of FindAll.
func (*MockRepositoryMockRecorder) FindByName ¶
func (mr *MockRepositoryMockRecorder) FindByName(arg0, arg1, arg2 any) *gomock.Call
FindByName indicates an expected call of FindByName.
type Repository ¶
type Repository interface { Create(ctx context.Context, ledger *mmodel.Ledger) (*mmodel.Ledger, error) Find(ctx context.Context, organizationID, id uuid.UUID) (*mmodel.Ledger, error) FindAll(ctx context.Context, organizationID uuid.UUID, limit, page int) ([]*mmodel.Ledger, error) FindByName(ctx context.Context, organizationID uuid.UUID, name string) (bool, error) ListByIDs(ctx context.Context, organizationID uuid.UUID, ids []uuid.UUID) ([]*mmodel.Ledger, error) Update(ctx context.Context, organizationID, id uuid.UUID, ledger *mmodel.Ledger) (*mmodel.Ledger, error) Delete(ctx context.Context, organizationID, id uuid.UUID) error }
Repository provides an interface for operations related to ledger entities.