package syncstate

import (
	"codeberg.org/mapleopentech/monorepo/native/desktop/maplefile/internal/domain/syncstate"
)

type SaveUseCase struct {
	syncStateRepo syncstate.Repository
}

// ProvideSaveUseCase creates the use case for Wire
func ProvideSaveUseCase(syncStateRepo syncstate.Repository) *SaveUseCase {
	return &SaveUseCase{syncStateRepo: syncStateRepo}
}

// Execute saves the sync state
func (uc *SaveUseCase) Execute(state *syncstate.SyncState) error {
	return uc.syncStateRepo.Save(state)
}
