Initial commit: Open sourcing all of the Maple Open Technologies code.

This commit is contained in:
Bartlomiej Mika 2025-12-02 14:33:08 -05:00
commit 755d54a99d
2010 changed files with 448675 additions and 0 deletions

View file

@ -0,0 +1,34 @@
package user
import (
"time"
"codeberg.org/mapleopentech/monorepo/native/desktop/maplefile/internal/domain/user"
)
type CreateUseCase struct {
userRepo user.Repository
}
func ProvideCreateUseCase(userRepo user.Repository) *CreateUseCase {
return &CreateUseCase{
userRepo: userRepo,
}
}
func (uc *CreateUseCase) Execute(
id, email, firstName, lastName string,
storageQuotaBytes int64,
) error {
u := &user.User{
ID: id,
Email: email,
FirstName: firstName,
LastName: lastName,
StorageQuotaBytes: storageQuotaBytes,
CreatedAt: time.Now(),
UpdatedAt: time.Now(),
}
return uc.userRepo.Save(u)
}

View file

@ -0,0 +1,19 @@
package user
import (
"codeberg.org/mapleopentech/monorepo/native/desktop/maplefile/internal/domain/user"
)
type GetByEmailUseCase struct {
userRepo user.Repository
}
func ProvideGetByEmailUseCase(userRepo user.Repository) *GetByEmailUseCase {
return &GetByEmailUseCase{
userRepo: userRepo,
}
}
func (uc *GetByEmailUseCase) Execute(email string) (*user.User, error) {
return uc.userRepo.GetByEmail(email)
}

View file

@ -0,0 +1,19 @@
package user
import (
"codeberg.org/mapleopentech/monorepo/native/desktop/maplefile/internal/domain/user"
)
type GetByIdUseCase struct {
userRepo user.Repository
}
func ProvideGetByIdUseCase(userRepo user.Repository) *GetByIdUseCase {
return &GetByIdUseCase{
userRepo: userRepo,
}
}
func (uc *GetByIdUseCase) Execute(id string) (*user.User, error) {
return uc.userRepo.GetByID(id)
}