Documentation
¶
Index ¶
- type BankService
- func (s *BankService) CreateBank(bank *models.BankModel) error
- func (s *BankService) DeleteBank(id uuid.UUID) error
- func (s *BankService) FindAllBanks(request *http.Request) (paginate.Page, error)
- func (s *BankService) FindBankByID(id uuid.UUID) (*models.BankModel, error)
- func (s *BankService) UpdateBank(bank *models.BankModel) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BankService ¶
type BankService struct {
// contains filtered or unexported fields
}
func NewBankService ¶
func NewBankService(db *gorm.DB, ctx *context.ERPContext) *BankService
func (*BankService) CreateBank ¶
func (s *BankService) CreateBank(bank *models.BankModel) error
CreateBank creates a new bank in the database.
The method takes a pointer to a BankModel and returns an error.
func (*BankService) DeleteBank ¶
func (s *BankService) DeleteBank(id uuid.UUID) error
func (*BankService) FindAllBanks ¶
FindAllBanks returns a paginated list of all banks in the database.
The method takes an HTTP request and returns a paginated page of BankModel objects and an error. The request is used for pagination purposes, such as specifying the page number and the number of items per page.
If the method successfully retrieves the list of banks from the database, the error is nil. Otherwise, the error is not nil and the paginated page is empty.
func (*BankService) FindBankByID ¶
FindBankByID returns a bank by its ID.
The method takes a UUID bank ID, queries the database and returns a pointer to a BankModel and an error. If the bank is found, the error is nil. Otherwise, the error is not nil and the BankModel pointer is nil.
func (*BankService) UpdateBank ¶
func (s *BankService) UpdateBank(bank *models.BankModel) error
UpdateBank updates an existing bank in the database.
The function takes a pointer to a BankModel as its argument. The BankModel instance contains the new values to be updated in the database.
The function returns an error if the update fails.