monorepo/native/desktop/maplefile/internal/usecase/collection/create.go

19 lines
533 B
Go

package collection
import (
"codeberg.org/mapleopentech/monorepo/native/desktop/maplefile/internal/domain/collection"
)
type CreateUseCase struct {
collectionRepo collection.Repository
}
// ProvideCreateUseCase creates the use case for Wire
func ProvideCreateUseCase(collectionRepo collection.Repository) *CreateUseCase {
return &CreateUseCase{collectionRepo: collectionRepo}
}
// Execute creates a new collection record
func (uc *CreateUseCase) Execute(c *collection.Collection) error {
return uc.collectionRepo.Create(c)
}