package repository

import (
	"netidhub-saas-be/app/database/entity"

	"github.com/google/uuid"
)

type ClientApprovalSettingsRepository interface {
	// Basic CRUD
	Create(clientId *uuid.UUID, settings *entity.ClientApprovalSettings) (*entity.ClientApprovalSettings, error)
	FindOne(clientId *uuid.UUID) (*entity.ClientApprovalSettings, error)
	Update(clientId *uuid.UUID, settings *entity.ClientApprovalSettings) (*entity.ClientApprovalSettings, error)
	Delete(clientId *uuid.UUID) error

	// Specific queries
	FindByClientId(clientId uuid.UUID) (*entity.ClientApprovalSettings, error)
	FindActiveSettings(clientId *uuid.UUID) (*entity.ClientApprovalSettings, error)
	FindByWorkflowId(workflowId uint) ([]*entity.ClientApprovalSettings, error)

	// Exemption management
	AddExemptUser(clientId *uuid.UUID, userId uint) error
	RemoveExemptUser(clientId *uuid.UUID, userId uint) error
	AddExemptRole(clientId *uuid.UUID, roleId uint) error
	RemoveExemptRole(clientId *uuid.UUID, roleId uint) error
	AddExemptCategory(clientId *uuid.UUID, categoryId uint) error
	RemoveExemptCategory(clientId *uuid.UUID, categoryId uint) error

	// Bulk operations
	BulkUpdateExemptUsers(clientId *uuid.UUID, userIds []uint) error
	BulkUpdateExemptRoles(clientId *uuid.UUID, roleIds []uint) error
	BulkUpdateExemptCategories(clientId *uuid.UUID, categoryIds []uint) error
}
