package authsvc

import (
	staffrepository "legalgo-BE-go/internal/accessor/staff"
	subscriberepository "legalgo-BE-go/internal/accessor/subscribe"
	subscribeplanrepository "legalgo-BE-go/internal/accessor/subscribeplan"
	userrepository "legalgo-BE-go/internal/accessor/user_repository"
	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.SubsIntf
	subsPlanRepo subscribeplanrepository.SubsPlanIntf
}

type Auth interface {
	LoginAsStaff(staffdomain.StaffLogin) (string, error)
	RegisterStaff(staffdomain.StaffRegister) (string, error)
	GetStaffProfile(string) (*staffdomain.StaffProfile, error)
	UpdateStaff(staffdomain.Staff) error

	LoginAsUser(userdomain.UserLogin) (string, error)
	RegisterUser(userdomain.UserRegister) (string, error)
	GetUserProfile(string) (*userdomain.UserProfile, error)
}

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