2024-01-16 16:13:06 +00:00
|
|
|
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-06 17:54:56 +00:00
|
|
|
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)
|
2024-06-01 18:01:00 +00:00
|
|
|
GetAddresses(ctx context.Context, benefactorID uint) ([]entity.Address, error)
|
2024-06-08 14:25:24 +00:00
|
|
|
DeleteBenefactorAddress(ctx context.Context, addressID uint, benefactorID uint) error
|
2024-01-16 16:13:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Service struct {
|
|
|
|
repo Repository
|
|
|
|
}
|
|
|
|
|
|
|
|
func New(repo Repository) Service {
|
|
|
|
return Service{repo: repo}
|
|
|
|
}
|