Documentation ¶
Overview ¶
Package asset is a generated GoMock package.
Index ¶
- type AssetPostgreSQLModel
- type AssetPostgreSQLRepository
- func (r *AssetPostgreSQLRepository) Create(ctx context.Context, asset *mmodel.Asset) (*mmodel.Asset, error)
- func (r *AssetPostgreSQLRepository) Delete(ctx context.Context, organizationID, ledgerID, id uuid.UUID) error
- func (r *AssetPostgreSQLRepository) Find(ctx context.Context, organizationID, ledgerID, id uuid.UUID) (*mmodel.Asset, error)
- func (r *AssetPostgreSQLRepository) FindAllWithDeleted(ctx context.Context, organizationID, ledgerID uuid.UUID, ...) ([]*mmodel.Asset, error)
- func (r *AssetPostgreSQLRepository) FindByNameOrCode(ctx context.Context, organizationID, ledgerID uuid.UUID, name, code string) (bool, error)
- func (r *AssetPostgreSQLRepository) ListByIDs(ctx context.Context, organizationID, ledgerID uuid.UUID, ids []uuid.UUID) ([]*mmodel.Asset, error)
- func (r *AssetPostgreSQLRepository) Update(ctx context.Context, organizationID, ledgerID, id uuid.UUID, ...) (*mmodel.Asset, error)
- type MockRepository
- func (m *MockRepository) Create(ctx context.Context, asset *mmodel.Asset) (*mmodel.Asset, 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.Asset, error)
- func (m *MockRepository) FindAllWithDeleted(ctx context.Context, organizationID, ledgerID uuid.UUID, ...) ([]*mmodel.Asset, error)
- func (m *MockRepository) FindByNameOrCode(ctx context.Context, organizationID, ledgerID uuid.UUID, name, code string) (bool, error)
- func (m *MockRepository) ListByIDs(ctx context.Context, organizationID, ledgerID uuid.UUID, ids []uuid.UUID) ([]*mmodel.Asset, error)
- func (m *MockRepository) Update(ctx context.Context, organizationID, ledgerID, id uuid.UUID, ...) (*mmodel.Asset, error)
- type MockRepositoryMockRecorder
- func (mr *MockRepositoryMockRecorder) Create(ctx, asset 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) FindAllWithDeleted(ctx, organizationID, ledgerID, filter any) *gomock.Call
- func (mr *MockRepositoryMockRecorder) FindByNameOrCode(ctx, organizationID, ledgerID, name, code any) *gomock.Call
- func (mr *MockRepositoryMockRecorder) ListByIDs(ctx, organizationID, ledgerID, ids any) *gomock.Call
- func (mr *MockRepositoryMockRecorder) Update(ctx, organizationID, ledgerID, id, asset any) *gomock.Call
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssetPostgreSQLModel ¶
type AssetPostgreSQLModel struct { ID string Name string Type string Code string Status string StatusDescription *string LedgerID string OrganizationID string CreatedAt time.Time UpdatedAt time.Time DeletedAt sql.NullTime Metadata map[string]any }
AssetPostgreSQLModel represents the entity Asset into SQL context in Database
func (*AssetPostgreSQLModel) FromEntity ¶
func (t *AssetPostgreSQLModel) FromEntity(asset *mmodel.Asset)
FromEntity converts a request entity Asset to AssetPostgreSQLModel
func (*AssetPostgreSQLModel) ToEntity ¶
func (t *AssetPostgreSQLModel) ToEntity() *mmodel.Asset
ToEntity converts an AssetPostgreSQLModel to entity response Asset
type AssetPostgreSQLRepository ¶
type AssetPostgreSQLRepository struct {
// contains filtered or unexported fields
}
AssetPostgreSQLRepository is a Postgresql-specific implementation of the AssetRepository.
func NewAssetPostgreSQLRepository ¶
func NewAssetPostgreSQLRepository(pc *mpostgres.PostgresConnection) *AssetPostgreSQLRepository
NewAssetPostgreSQLRepository returns a new instance of AssetPostgreSQLRepository using the given Postgres connection.
func (*AssetPostgreSQLRepository) Create ¶
func (r *AssetPostgreSQLRepository) Create(ctx context.Context, asset *mmodel.Asset) (*mmodel.Asset, error)
Create a new asset entity into Postgresql and returns it.
func (*AssetPostgreSQLRepository) Delete ¶
func (r *AssetPostgreSQLRepository) Delete(ctx context.Context, organizationID, ledgerID, id uuid.UUID) error
Delete removes an Asset entity from the database using the provided IDs.
func (*AssetPostgreSQLRepository) Find ¶
func (r *AssetPostgreSQLRepository) Find(ctx context.Context, organizationID, ledgerID, id uuid.UUID) (*mmodel.Asset, error)
Find retrieves an Asset entity from the database using the provided ID.
func (*AssetPostgreSQLRepository) FindAllWithDeleted ¶ added in v1.31.0
func (r *AssetPostgreSQLRepository) FindAllWithDeleted(ctx context.Context, organizationID, ledgerID uuid.UUID, filter http.Pagination) ([]*mmodel.Asset, error)
FindAllWithDeleted retrieves Asset entities from the database with soft-deleted records.
func (*AssetPostgreSQLRepository) FindByNameOrCode ¶
func (r *AssetPostgreSQLRepository) FindByNameOrCode(ctx context.Context, organizationID, ledgerID uuid.UUID, name, code string) (bool, error)
FindByNameOrCode retrieves Asset entities by name or code from 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.Asset, error)
Find mocks base method.
func (*MockRepository) FindAllWithDeleted ¶ added in v1.31.0
func (m *MockRepository) FindAllWithDeleted(ctx context.Context, organizationID, ledgerID uuid.UUID, filter http.Pagination) ([]*mmodel.Asset, error)
FindAllWithDeleted mocks base method.
func (*MockRepository) FindByNameOrCode ¶
func (m *MockRepository) FindByNameOrCode(ctx context.Context, organizationID, ledgerID uuid.UUID, name, code string) (bool, error)
FindByNameOrCode 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, asset 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) FindAllWithDeleted ¶ added in v1.31.0
func (mr *MockRepositoryMockRecorder) FindAllWithDeleted(ctx, organizationID, ledgerID, filter any) *gomock.Call
FindAllWithDeleted indicates an expected call of FindAllWithDeleted.
func (*MockRepositoryMockRecorder) FindByNameOrCode ¶
func (mr *MockRepositoryMockRecorder) FindByNameOrCode(ctx, organizationID, ledgerID, name, code any) *gomock.Call
FindByNameOrCode indicates an expected call of FindByNameOrCode.
type Repository ¶
type Repository interface { Create(ctx context.Context, asset *mmodel.Asset) (*mmodel.Asset, error) FindAllWithDeleted(ctx context.Context, organizationID, ledgerID uuid.UUID, filter http.Pagination) ([]*mmodel.Asset, error) ListByIDs(ctx context.Context, organizationID, ledgerID uuid.UUID, ids []uuid.UUID) ([]*mmodel.Asset, error) Find(ctx context.Context, organizationID, ledgerID, id uuid.UUID) (*mmodel.Asset, error) FindByNameOrCode(ctx context.Context, organizationID, ledgerID uuid.UUID, name, code string) (bool, error) Update(ctx context.Context, organizationID, ledgerID, id uuid.UUID, asset *mmodel.Asset) (*mmodel.Asset, error) Delete(ctx context.Context, organizationID, ledgerID, id uuid.UUID) error }
Repository provides an interface for operations related to asset entities.