forked from ebhomengo/niki
27 lines
850 B
Go
27 lines
850 B
Go
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)
|
|
GetAllProvinces(ctx context.Context) ([]entity.Province, error)
|
|
GetAllCities(ctx context.Context) ([]entity.City, error)
|
|
UpdateAddress(ctx context.Context, address entity.Address) error
|
|
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}
|
|
}
|