Documentation ¶
Overview ¶
Package product is a generated GoMock package.
Index ¶
- type MockRepository
- func (m *MockRepository) Create(ctx context.Context, product *mmodel.Product) (*mmodel.Product, 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.Product, error)
- func (m *MockRepository) FindAll(ctx context.Context, organizationID, ledgerID uuid.UUID, ...) ([]*mmodel.Product, error)
- func (m *MockRepository) FindByIDs(ctx context.Context, organizationID, ledgerID uuid.UUID, ids []uuid.UUID) ([]*mmodel.Product, error)
- func (m *MockRepository) FindByName(ctx context.Context, organizationID, ledgerID uuid.UUID, name string) (bool, error)
- func (m *MockRepository) Update(ctx context.Context, organizationID, ledgerID, id uuid.UUID, ...) (*mmodel.Product, error)
- type MockRepositoryMockRecorder
- func (mr *MockRepositoryMockRecorder) Create(ctx, product 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) FindAll(ctx, organizationID, ledgerID, filter any) *gomock.Call
- func (mr *MockRepositoryMockRecorder) FindByIDs(ctx, organizationID, ledgerID, ids any) *gomock.Call
- func (mr *MockRepositoryMockRecorder) FindByName(ctx, organizationID, ledgerID, name any) *gomock.Call
- func (mr *MockRepositoryMockRecorder) Update(ctx, organizationID, ledgerID, id, product any) *gomock.Call
- type ProductPostgreSQLModel
- type ProductPostgreSQLRepository
- func (p *ProductPostgreSQLRepository) Create(ctx context.Context, product *mmodel.Product) (*mmodel.Product, error)
- func (p *ProductPostgreSQLRepository) Delete(ctx context.Context, organizationID, ledgerID, id uuid.UUID) error
- func (p *ProductPostgreSQLRepository) Find(ctx context.Context, organizationID, ledgerID, id uuid.UUID) (*mmodel.Product, error)
- func (p *ProductPostgreSQLRepository) FindAll(ctx context.Context, organizationID, ledgerID uuid.UUID, ...) ([]*mmodel.Product, error)
- func (p *ProductPostgreSQLRepository) FindByIDs(ctx context.Context, organizationID, ledgerID uuid.UUID, ids []uuid.UUID) ([]*mmodel.Product, error)
- func (p *ProductPostgreSQLRepository) FindByName(ctx context.Context, organizationID, ledgerID uuid.UUID, name string) (bool, error)
- func (p *ProductPostgreSQLRepository) Update(ctx context.Context, organizationID, ledgerID, id uuid.UUID, ...) (*mmodel.Product, error)
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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) Create ¶
func (m *MockRepository) Create(ctx context.Context, product *mmodel.Product) (*mmodel.Product, error)
Create mocks base method.
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.Product, error)
Find mocks base method.
func (*MockRepository) FindAll ¶
func (m *MockRepository) FindAll(ctx context.Context, organizationID, ledgerID uuid.UUID, filter http.Pagination) ([]*mmodel.Product, error)
FindAll mocks base method.
func (*MockRepository) FindByIDs ¶
func (m *MockRepository) FindByIDs(ctx context.Context, organizationID, ledgerID uuid.UUID, ids []uuid.UUID) ([]*mmodel.Product, error)
FindByIDs mocks base method.
func (*MockRepository) FindByName ¶
func (m *MockRepository) FindByName(ctx context.Context, organizationID, ledgerID uuid.UUID, name 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(ctx, product 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) FindAll ¶
func (mr *MockRepositoryMockRecorder) FindAll(ctx, organizationID, ledgerID, filter any) *gomock.Call
FindAll indicates an expected call of FindAll.
func (*MockRepositoryMockRecorder) FindByIDs ¶
func (mr *MockRepositoryMockRecorder) FindByIDs(ctx, organizationID, ledgerID, ids any) *gomock.Call
FindByIDs indicates an expected call of FindByIDs.
func (*MockRepositoryMockRecorder) FindByName ¶
func (mr *MockRepositoryMockRecorder) FindByName(ctx, organizationID, ledgerID, name any) *gomock.Call
FindByName indicates an expected call of FindByName.
type ProductPostgreSQLModel ¶
type ProductPostgreSQLModel struct { ID string Name string LedgerID string OrganizationID string Status string StatusDescription *string CreatedAt time.Time UpdatedAt time.Time DeletedAt sql.NullTime Metadata map[string]any }
ProductPostgreSQLModel represents the entity Product into SQL context in Database
func (*ProductPostgreSQLModel) FromEntity ¶
func (t *ProductPostgreSQLModel) FromEntity(product *mmodel.Product)
FromEntity converts an entity.Product to ProductPostgreSQLModel
func (*ProductPostgreSQLModel) ToEntity ¶
func (t *ProductPostgreSQLModel) ToEntity() *mmodel.Product
ToEntity converts an ProductPostgreSQLModel to entity.Product
type ProductPostgreSQLRepository ¶
type ProductPostgreSQLRepository struct {
// contains filtered or unexported fields
}
ProductPostgreSQLRepository is a Postgresql-specific implementation of the Repository.
func NewProductPostgreSQLRepository ¶
func NewProductPostgreSQLRepository(pc *mpostgres.PostgresConnection) *ProductPostgreSQLRepository
NewProductPostgreSQLRepository returns a new instance of ProductPostgreSQLRepository using the given Postgres connection.
func (*ProductPostgreSQLRepository) Create ¶
func (p *ProductPostgreSQLRepository) Create(ctx context.Context, product *mmodel.Product) (*mmodel.Product, error)
Create a new product entity into Postgresql and returns it.
func (*ProductPostgreSQLRepository) Delete ¶
func (p *ProductPostgreSQLRepository) Delete(ctx context.Context, organizationID, ledgerID, id uuid.UUID) error
Delete removes a Product entity from the database using the provided IDs.
func (*ProductPostgreSQLRepository) Find ¶
func (p *ProductPostgreSQLRepository) Find(ctx context.Context, organizationID, ledgerID, id uuid.UUID) (*mmodel.Product, error)
Find retrieves a Product entity from the database using the provided ID.
func (*ProductPostgreSQLRepository) FindAll ¶
func (p *ProductPostgreSQLRepository) FindAll(ctx context.Context, organizationID, ledgerID uuid.UUID, filter http.Pagination) ([]*mmodel.Product, error)
FindAll retrieves Product entities from the database.
func (*ProductPostgreSQLRepository) FindByIDs ¶
func (p *ProductPostgreSQLRepository) FindByIDs(ctx context.Context, organizationID, ledgerID uuid.UUID, ids []uuid.UUID) ([]*mmodel.Product, error)
FindByIDs retrieves Products entities from the database using the provided IDs.
func (*ProductPostgreSQLRepository) FindByName ¶
func (p *ProductPostgreSQLRepository) FindByName(ctx context.Context, organizationID, ledgerID uuid.UUID, name string) (bool, error)
FindByName find product from the database using Organization and Ledger id and Name.
type Repository ¶
type Repository interface { Create(ctx context.Context, product *mmodel.Product) (*mmodel.Product, error) FindByName(ctx context.Context, organizationID, ledgerID uuid.UUID, name string) (bool, error) FindAll(ctx context.Context, organizationID, ledgerID uuid.UUID, filter http.Pagination) ([]*mmodel.Product, error) FindByIDs(ctx context.Context, organizationID, ledgerID uuid.UUID, ids []uuid.UUID) ([]*mmodel.Product, error) Find(ctx context.Context, organizationID, ledgerID, id uuid.UUID) (*mmodel.Product, error) Update(ctx context.Context, organizationID, ledgerID, id uuid.UUID, product *mmodel.Product) (*mmodel.Product, error) Delete(ctx context.Context, organizationID, ledgerID, id uuid.UUID) error }
Repository provides an interface for operations related to product entities.