Documentation ¶
Index ¶
- type AccountPostgreSQLRepository
- func (r *AccountPostgreSQLRepository) Create(ctx context.Context, acc *mmodel.Account) (*mmodel.Account, error)
- func (r *AccountPostgreSQLRepository) Delete(ctx context.Context, organizationID, ledgerID uuid.UUID, ...) error
- func (r *AccountPostgreSQLRepository) Find(ctx context.Context, organizationID, ledgerID uuid.UUID, ...) (*mmodel.Account, error)
- func (r *AccountPostgreSQLRepository) FindAll(ctx context.Context, organizationID, ledgerID uuid.UUID, ...) ([]*mmodel.Account, error)
- func (r *AccountPostgreSQLRepository) FindByAlias(ctx context.Context, organizationID, ledgerID uuid.UUID, alias string) (bool, error)
- func (r *AccountPostgreSQLRepository) FindWithDeleted(ctx context.Context, organizationID, ledgerID uuid.UUID, ...) (*mmodel.Account, error)
- func (r *AccountPostgreSQLRepository) ListAccountsByAlias(ctx context.Context, organizationID, ledgerID uuid.UUID, aliases []string) ([]*mmodel.Account, error)
- func (r *AccountPostgreSQLRepository) ListAccountsByIDs(ctx context.Context, organizationID, ledgerID uuid.UUID, ids []uuid.UUID) ([]*mmodel.Account, error)
- func (r *AccountPostgreSQLRepository) ListByAlias(ctx context.Context, organizationID, ledgerID, portfolioID uuid.UUID, ...) ([]*mmodel.Account, error)
- func (r *AccountPostgreSQLRepository) ListByIDs(ctx context.Context, organizationID, ledgerID uuid.UUID, ...) ([]*mmodel.Account, error)
- func (r *AccountPostgreSQLRepository) Update(ctx context.Context, organizationID, ledgerID uuid.UUID, ...) (*mmodel.Account, error)
- func (r *AccountPostgreSQLRepository) UpdateAccountByID(ctx context.Context, organizationID, ledgerID, id uuid.UUID, ...) (*mmodel.Account, error)
- 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) FindAll(ctx context.Context, organizationID, ledgerID uuid.UUID, limit, page int) ([]*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 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 OrganizationPostgreSQLRepository
- func (r *OrganizationPostgreSQLRepository) Create(ctx context.Context, organization *mmodel.Organization) (*mmodel.Organization, error)
- func (r *OrganizationPostgreSQLRepository) Delete(ctx context.Context, id uuid.UUID) error
- func (r *OrganizationPostgreSQLRepository) Find(ctx context.Context, id uuid.UUID) (*mmodel.Organization, error)
- func (r *OrganizationPostgreSQLRepository) FindAll(ctx context.Context, limit, page int) ([]*mmodel.Organization, error)
- func (r *OrganizationPostgreSQLRepository) ListByIDs(ctx context.Context, ids []uuid.UUID) ([]*mmodel.Organization, error)
- func (r *OrganizationPostgreSQLRepository) Update(ctx context.Context, id uuid.UUID, organization *mmodel.Organization) (*mmodel.Organization, error)
- type PortfolioPostgreSQLRepository
- func (r *PortfolioPostgreSQLRepository) Create(ctx context.Context, portfolio *mmodel.Portfolio) (*mmodel.Portfolio, error)
- func (r *PortfolioPostgreSQLRepository) Delete(ctx context.Context, organizationID, ledgerID, id uuid.UUID) error
- func (r *PortfolioPostgreSQLRepository) Find(ctx context.Context, organizationID, ledgerID, id uuid.UUID) (*mmodel.Portfolio, error)
- func (r *PortfolioPostgreSQLRepository) FindAll(ctx context.Context, organizationID, ledgerID uuid.UUID, limit, page int) ([]*mmodel.Portfolio, error)
- func (r *PortfolioPostgreSQLRepository) FindByIDEntity(ctx context.Context, organizationID, ledgerID, entityID uuid.UUID) (*mmodel.Portfolio, error)
- func (r *PortfolioPostgreSQLRepository) ListByIDs(ctx context.Context, organizationID, ledgerID uuid.UUID, ids []uuid.UUID) ([]*mmodel.Portfolio, error)
- func (r *PortfolioPostgreSQLRepository) Update(ctx context.Context, organizationID, ledgerID, id uuid.UUID, ...) (*mmodel.Portfolio, error)
- 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, limit, page int) ([]*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)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountPostgreSQLRepository ¶
type AccountPostgreSQLRepository struct {
// contains filtered or unexported fields
}
AccountPostgreSQLRepository is a Postgresql-specific implementation of the AccountRepository.
func NewAccountPostgreSQLRepository ¶
func NewAccountPostgreSQLRepository(pc *mpostgres.PostgresConnection) *AccountPostgreSQLRepository
NewAccountPostgreSQLRepository returns a new instance of AccountPostgreSQLRepository using the given Postgres connection.
func (*AccountPostgreSQLRepository) Create ¶
func (r *AccountPostgreSQLRepository) Create(ctx context.Context, acc *mmodel.Account) (*mmodel.Account, error)
Create a new account entity into Postgresql and returns it.
func (*AccountPostgreSQLRepository) Delete ¶
func (r *AccountPostgreSQLRepository) Delete(ctx context.Context, organizationID, ledgerID uuid.UUID, portfolioID *uuid.UUID, id uuid.UUID) error
Delete an Account entity from the database (soft delete) using the provided ID.
func (*AccountPostgreSQLRepository) Find ¶
func (r *AccountPostgreSQLRepository) Find(ctx context.Context, organizationID, ledgerID uuid.UUID, portfolioID *uuid.UUID, id uuid.UUID) (*mmodel.Account, error)
Find retrieves an Account entity from the database using the provided ID.
func (*AccountPostgreSQLRepository) FindAll ¶
func (r *AccountPostgreSQLRepository) FindAll(ctx context.Context, organizationID, ledgerID uuid.UUID, portfolioID *uuid.UUID, limit, page int) ([]*mmodel.Account, error)
FindAll retrieves an Account entities from the database (including soft-deleted ones) with pagination.
func (*AccountPostgreSQLRepository) FindByAlias ¶ added in v1.1.0
func (r *AccountPostgreSQLRepository) FindByAlias(ctx context.Context, organizationID, ledgerID uuid.UUID, alias string) (bool, error)
FindByAlias find account from the database using Organization and Ledger id and Alias. Returns true and ErrAliasUnavailability error if the alias is already taken.
func (*AccountPostgreSQLRepository) FindWithDeleted ¶ added in v1.26.0
func (r *AccountPostgreSQLRepository) FindWithDeleted(ctx context.Context, organizationID, ledgerID uuid.UUID, portfolioID *uuid.UUID, id uuid.UUID) (*mmodel.Account, error)
FindWithDeleted retrieves an Account entity from the database using the provided ID (including soft-deleted ones).
func (*AccountPostgreSQLRepository) ListAccountsByAlias ¶ added in v1.10.0
func (r *AccountPostgreSQLRepository) ListAccountsByAlias(ctx context.Context, organizationID, ledgerID uuid.UUID, aliases []string) ([]*mmodel.Account, error)
ListAccountsByAlias list Accounts entity from the database using the provided alias.
func (*AccountPostgreSQLRepository) ListAccountsByIDs ¶ added in v1.10.0
func (r *AccountPostgreSQLRepository) ListAccountsByIDs(ctx context.Context, organizationID, ledgerID uuid.UUID, ids []uuid.UUID) ([]*mmodel.Account, error)
ListAccountsByIDs list Accounts entity from the database using the provided IDs.
func (*AccountPostgreSQLRepository) ListByAlias ¶ added in v1.10.0
func (r *AccountPostgreSQLRepository) ListByAlias(ctx context.Context, organizationID, ledgerID, portfolioID uuid.UUID, alias []string) ([]*mmodel.Account, error)
ListByAlias retrieves Accounts entities from the database using the provided alias.
func (*AccountPostgreSQLRepository) ListByIDs ¶
func (r *AccountPostgreSQLRepository) ListByIDs(ctx context.Context, organizationID, ledgerID uuid.UUID, portfolioID *uuid.UUID, ids []uuid.UUID) ([]*mmodel.Account, error)
ListByIDs retrieves Accounts entities from the database (including soft-deleted ones) using the provided IDs.
func (*AccountPostgreSQLRepository) Update ¶
func (r *AccountPostgreSQLRepository) Update(ctx context.Context, organizationID, ledgerID uuid.UUID, portfolioID *uuid.UUID, id uuid.UUID, acc *mmodel.Account) (*mmodel.Account, error)
Update an Account entity into Postgresql and returns the Account updated.
func (*AccountPostgreSQLRepository) UpdateAccountByID ¶ added in v1.10.0
func (r *AccountPostgreSQLRepository) UpdateAccountByID(ctx context.Context, organizationID, ledgerID, id uuid.UUID, acc *mmodel.Account) (*mmodel.Account, error)
UpdateAccountByID an update Account entity by ID only into Postgresql and returns the Account updated.
type AssetPostgreSQLRepository ¶ added in v1.11.0
type AssetPostgreSQLRepository struct {
// contains filtered or unexported fields
}
AssetPostgreSQLRepository is a Postgresql-specific implementation of the AssetRepository.
func NewAssetPostgreSQLRepository ¶ added in v1.11.0
func NewAssetPostgreSQLRepository(pc *mpostgres.PostgresConnection) *AssetPostgreSQLRepository
NewAssetPostgreSQLRepository returns a new instance of AssetPostgreSQLRepository using the given Postgres connection.
func (*AssetPostgreSQLRepository) Create ¶ added in v1.11.0
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 ¶ added in v1.11.0
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 ¶ added in v1.11.0
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) FindAll ¶ added in v1.11.0
func (r *AssetPostgreSQLRepository) FindAll(ctx context.Context, organizationID, ledgerID uuid.UUID, limit, page int) ([]*mmodel.Asset, error)
FindAll retrieves Asset entities from the database.
func (*AssetPostgreSQLRepository) FindByNameOrCode ¶ added in v1.11.0
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 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 ¶ added in v1.22.0
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 OrganizationPostgreSQLRepository ¶
type OrganizationPostgreSQLRepository struct {
// contains filtered or unexported fields
}
OrganizationPostgreSQLRepository is a Postgresql-specific implementation of the OrganizationRepository.
func NewOrganizationPostgreSQLRepository ¶
func NewOrganizationPostgreSQLRepository(pc *mpostgres.PostgresConnection) *OrganizationPostgreSQLRepository
NewOrganizationPostgreSQLRepository returns a new instance of OrganizationPostgresRepository using the given Postgres connection.
func (*OrganizationPostgreSQLRepository) Create ¶
func (r *OrganizationPostgreSQLRepository) Create(ctx context.Context, organization *mmodel.Organization) (*mmodel.Organization, error)
Create inserts a new Organization entity into Postgresql and returns the created Organization.
func (*OrganizationPostgreSQLRepository) Delete ¶
Delete removes an Organization entity from the database using the provided ID.
func (*OrganizationPostgreSQLRepository) Find ¶
func (r *OrganizationPostgreSQLRepository) Find(ctx context.Context, id uuid.UUID) (*mmodel.Organization, error)
Find retrieves an Organization entity from the database using the provided ID.
func (*OrganizationPostgreSQLRepository) FindAll ¶
func (r *OrganizationPostgreSQLRepository) FindAll(ctx context.Context, limit, page int) ([]*mmodel.Organization, error)
FindAll retrieves Organizations entities from the database.
func (*OrganizationPostgreSQLRepository) ListByIDs ¶
func (r *OrganizationPostgreSQLRepository) ListByIDs(ctx context.Context, ids []uuid.UUID) ([]*mmodel.Organization, error)
ListByIDs retrieves Organizations entities from the database using the provided IDs.
func (*OrganizationPostgreSQLRepository) Update ¶
func (r *OrganizationPostgreSQLRepository) Update(ctx context.Context, id uuid.UUID, organization *mmodel.Organization) (*mmodel.Organization, error)
Update an Organization entity into Postgresql and returns the Organization updated.
type PortfolioPostgreSQLRepository ¶
type PortfolioPostgreSQLRepository struct {
// contains filtered or unexported fields
}
PortfolioPostgreSQLRepository is a Postgresql-specific implementation of the PortfolioRepository.
func NewPortfolioPostgreSQLRepository ¶
func NewPortfolioPostgreSQLRepository(pc *mpostgres.PostgresConnection) *PortfolioPostgreSQLRepository
NewPortfolioPostgreSQLRepository returns a new instance of PortfolioPostgreSQLRepository using the given Postgres connection.
func (*PortfolioPostgreSQLRepository) Create ¶
func (r *PortfolioPostgreSQLRepository) Create(ctx context.Context, portfolio *mmodel.Portfolio) (*mmodel.Portfolio, error)
Create a new portfolio entity into Postgresql and returns it.
func (*PortfolioPostgreSQLRepository) Delete ¶
func (r *PortfolioPostgreSQLRepository) Delete(ctx context.Context, organizationID, ledgerID, id uuid.UUID) error
Delete removes a Portfolio entity from the database using the provided IDs.
func (*PortfolioPostgreSQLRepository) Find ¶
func (r *PortfolioPostgreSQLRepository) Find(ctx context.Context, organizationID, ledgerID, id uuid.UUID) (*mmodel.Portfolio, error)
Find retrieves a Portfolio entity from the database using the provided ID.
func (*PortfolioPostgreSQLRepository) FindAll ¶
func (r *PortfolioPostgreSQLRepository) FindAll(ctx context.Context, organizationID, ledgerID uuid.UUID, limit, page int) ([]*mmodel.Portfolio, error)
FindAll retrieves Portfolio entities from the database.
func (*PortfolioPostgreSQLRepository) FindByIDEntity ¶
func (r *PortfolioPostgreSQLRepository) FindByIDEntity(ctx context.Context, organizationID, ledgerID, entityID uuid.UUID) (*mmodel.Portfolio, error)
FindByIDEntity find portfolio from the database using the Entity id.
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, limit, page int) ([]*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.