package staffsvc

import (
	staffrepository "legalgo-BE-go/internal/accessor/staff"
	subscriberepository "legalgo-BE-go/internal/accessor/subscribe"
	subscribeplanrepository "legalgo-BE-go/internal/accessor/subscribe_plan"
	userrepository "legalgo-BE-go/internal/accessor/user"
	staffdomain "legalgo-BE-go/internal/domain/staff"
	userdomain "legalgo-BE-go/internal/domain/user"
)

type impl struct {
	staffRepo    staffrepository.Staff
	userRepo     userrepository.User
	subsRepo     subscriberepository.Subscribe
	subsPlanRepo subscribeplanrepository.SubscribePlan
}

type Auth interface {
	Login(staffdomain.StaffLogin) (string, error)
	Register(staffdomain.StaffRegister) (string, error)
	GetProfile(string) (*staffdomain.StaffProfile, error)
	GetStaffs() ([]staffdomain.StaffProfile, error)
	GetUsers() ([]userdomain.UserProfile, error)
	Update(string, staffdomain.StaffUpdate) error
}

func New(
	staffRepo staffrepository.Staff,
	userRepo userrepository.User,
	subsRepo subscriberepository.Subscribe,
	subsPlanRepo subscribeplanrepository.SubscribePlan,
) Auth {
	return &impl{
		staffRepo:    staffRepo,
		userRepo:     userRepo,
		subsRepo:     subsRepo,
		subsPlanRepo: subsPlanRepo,
	}
}
