forked from ebhomengo/niki
1
0
Fork 0
niki/service/benefactor/address/service.go

29 lines
982 B
Go
Raw Normal View History

package benefactoraddressservice
import (
"context"
"git.gocasts.ir/ebhomengo/niki/entity"
validator "git.gocasts.ir/ebhomengo/niki/validator/benefactor/address"
)
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)
UpdateAddress(ctx context.Context, address entity.Address) 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
vld validator.Validator
}
func New(repo Repository, vld validator.Validator) Service {
return Service{repo: repo, vld: vld}
}