Initial commit: Open sourcing all of the Maple Open Technologies code.
This commit is contained in:
commit
755d54a99d
2010 changed files with 448675 additions and 0 deletions
29
cloud/maplepress-backend/internal/domain/user/repository.go
Normal file
29
cloud/maplepress-backend/internal/domain/user/repository.go
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
package user
|
||||
|
||||
import "context"
|
||||
|
||||
// Repository defines the interface for user data access
|
||||
// All methods require tenantID for multi-tenant isolation
|
||||
type Repository interface {
|
||||
// Create creates a new user
|
||||
Create(ctx context.Context, tenantID string, user *User) error
|
||||
|
||||
// GetByID retrieves a user by ID
|
||||
GetByID(ctx context.Context, tenantID string, id string) (*User, error)
|
||||
|
||||
// GetByEmail retrieves a user by email within a specific tenant
|
||||
GetByEmail(ctx context.Context, tenantID string, email string) (*User, error)
|
||||
|
||||
// GetByEmailGlobal retrieves a user by email across all tenants (for login)
|
||||
// This should only be used for authentication where tenant is not yet known
|
||||
GetByEmailGlobal(ctx context.Context, email string) (*User, error)
|
||||
|
||||
// Update updates an existing user
|
||||
Update(ctx context.Context, tenantID string, user *User) error
|
||||
|
||||
// Delete deletes a user by ID
|
||||
Delete(ctx context.Context, tenantID string, id string) error
|
||||
|
||||
// ListByDate lists users created within a date range
|
||||
ListByDate(ctx context.Context, tenantID string, startDate, endDate string, limit int) ([]*User, error)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue