package piggybankservice import "git.gocasts.ir/ebhomengo/niki/entity" type Repository interface { AddPiggyBank(piggy entity.PiggyBank) (entity.PiggyBank, error) EditPiggyBank(piggyID uint, piggyBankInput entity.PiggyBank) (entity.PiggyBank, error) DeletePiggyBank(piggyID uint) error GetAllPiggyBank() ([]entity.PiggyBank, error) GetPiggyBankByID(piggyBank uint) (entity.PiggyBank, error) } type Service struct { repo Repository } func New(repository Repository) Service { return Service{ repo: repository, } }