niki/service/benefactor/address/service.go

25 lines
783 B
Go
Raw Normal View History

package benefactoraddressservice
import (
"context"
"git.gocasts.ir/ebhomengo/niki/entity"
)
type Repository interface {
CreateBenefactorAddress(ctx context.Context, address entity.Address) (entity.Address, error)
GetAddressByID(ctx context.Context, id uint) (*entity.Address, error)
2024-01-17 20:17:06 +00:00
GetAllProvinces(ctx context.Context) ([]entity.Province, error)
2024-01-18 10:16:36 +00:00
GetAllCities(ctx context.Context) ([]entity.City, error)
2024-06-01 00:29:11 +00:00
GetAddress(ctx context.Context, addressID uint, benefactorID uint) (entity.Address, error)
GetAddresses(ctx context.Context, benefactorID uint) ([]entity.Address, error)
DeleteBenefactorAddress(ctx context.Context, addressID uint, benefactorID uint) error
}
type Service struct {
repo Repository
}
func New(repo Repository) Service {
return Service{repo: repo}
}