package settings

import (
	"Yimaru-Backend/internal/domain"
	"Yimaru-Backend/internal/ports"
	"context"
)

type Service struct {
	settingStore ports.SettingStore
}

func NewService(settingStore ports.SettingStore) *Service {
	return &Service{
		settingStore: settingStore,
	}
}

func (s *Service) GetGlobalSettingList(ctx context.Context) (domain.SettingList, error) {
	return s.settingStore.GetGlobalSettingList(ctx)
}

func (s *Service) GetGlobalSettings(ctx context.Context) ([]domain.Setting, error) {
	return s.settingStore.GetGlobalSettings(ctx)
}

func (s *Service) GetGlobalSetting(ctx context.Context, key string) (domain.Setting, error) {
	return s.settingStore.GetGlobalSetting(ctx, key)
}
func (s *Service) UpdateGlobalSetting(ctx context.Context, key, value string) error {
	return s.settingStore.UpdateGlobalSetting(ctx, key, value)
}

func (s *Service) UpdateGlobalSettingList(ctx context.Context, settingList domain.ValidSettingList) error {
	return s.settingStore.UpdateGlobalSettingList(ctx, settingList)
}

// func (s *Service) InsertCompanySetting(ctx context.Context, key, value string, companyID int64) error {
// 	return s.settingStore.InsertCompanySetting(ctx, key, value, companyID)
// }
// func (s *Service) InsertCompanySettingList(ctx context.Context, settingList domain.ValidSettingList, companyID int64) error {
// 	return s.settingStore.InsertCompanySettingList(ctx, settingList, companyID)
// }
// func (s *Service) GetAllCompanySettings(ctx context.Context) ([]domain.CompanySetting, error) {
// 	return s.settingStore.GetAllCompanySettings(ctx)
// }
// func (s *Service) GetCompanySettingsByKey(ctx context.Context, key string) ([]domain.CompanySetting, error) {
// 	return s.settingStore.GetCompanySettingsByKey(ctx, key)
// }
// func (s *Service) GetOverrideSettings(ctx context.Context, companyID int64) ([]domain.Setting, error) {
// 	return s.settingStore.GetOverrideSettings(ctx, companyID)
// }
// func (s *Service) GetOverrideSettingsList(ctx context.Context, companyID int64) (domain.SettingList, error) {
// 	return s.settingStore.GetOverrideSettingsList(ctx, companyID)
// }

// func (s *Service) DeleteCompanySetting(ctx context.Context, companyID int64, key string) error {
// 	return s.settingStore.DeleteCompanySetting(ctx, companyID, key)
// }

// func (s *Service) DeleteAllCompanySetting(ctx context.Context, companyID int64) error {
// 	return s.settingStore.DeleteAllCompanySetting(ctx, companyID)
// }
