36 lines
1.6 KiB
Go
36 lines
1.6 KiB
Go
package api
|
|
|
|
import (
|
|
"context"
|
|
|
|
"training-tracker/internal/models"
|
|
)
|
|
|
|
// ExerciseRepository defines the interface for exercise storage operations
|
|
type ExerciseRepository interface {
|
|
List(ctx context.Context) ([]models.Exercise, error)
|
|
GetByID(ctx context.Context, id int64) (*models.Exercise, error)
|
|
Create(ctx context.Context, req *models.CreateExerciseRequest) (*models.Exercise, error)
|
|
Update(ctx context.Context, id int64, req *models.CreateExerciseRequest) (*models.Exercise, error)
|
|
Delete(ctx context.Context, id int64) error
|
|
}
|
|
|
|
// PlanRepository defines the interface for training plan storage operations
|
|
type PlanRepository interface {
|
|
List(ctx context.Context) ([]models.TrainingPlan, error)
|
|
GetByID(ctx context.Context, id int64) (*models.TrainingPlan, error)
|
|
Create(ctx context.Context, req *models.CreatePlanRequest) (*models.TrainingPlan, error)
|
|
Update(ctx context.Context, id int64, req *models.CreatePlanRequest) (*models.TrainingPlan, error)
|
|
Delete(ctx context.Context, id int64) error
|
|
}
|
|
|
|
// SessionRepository defines the interface for session storage operations
|
|
type SessionRepository interface {
|
|
List(ctx context.Context) ([]models.Session, error)
|
|
GetByID(ctx context.Context, id int64) (*models.Session, error)
|
|
Create(ctx context.Context, req *models.CreateSessionRequest) (*models.Session, error)
|
|
Update(ctx context.Context, id int64, req *models.CreateSessionRequest) (*models.Session, error)
|
|
Delete(ctx context.Context, id int64) error
|
|
AddEntry(ctx context.Context, sessionID int64, req *models.CreateSessionEntryRequest) (*models.SessionEntry, error)
|
|
}
|