bank

package
v1.0.68 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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

func (s *BankService) FindAllBanks(request *http.Request) (paginate.Page, error)

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

func (s *BankService) FindBankByID(id uuid.UUID) (*models.BankModel, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL