package ports

import (
	"Yimaru-Backend/internal/domain"
	"context"
	"time"
)

type SubscriptionStore interface {
	// Subscription Plans
	CreateSubscriptionPlan(ctx context.Context, input domain.CreateSubscriptionPlanInput) (*domain.SubscriptionPlan, error)
	GetSubscriptionPlanByID(ctx context.Context, id int64) (*domain.SubscriptionPlan, error)
	ListSubscriptionPlans(ctx context.Context, activeOnly bool) ([]domain.SubscriptionPlan, error)
	UpdateSubscriptionPlan(ctx context.Context, id int64, input domain.UpdateSubscriptionPlanInput) error
	DeleteSubscriptionPlan(ctx context.Context, id int64) error

	// User Subscriptions
	CreateUserSubscription(ctx context.Context, input domain.CreateUserSubscriptionInput) (*domain.UserSubscription, error)
	GetUserSubscriptionByID(ctx context.Context, id int64) (*domain.UserSubscription, error)
	GetActiveSubscriptionByUserID(ctx context.Context, userID int64) (*domain.UserSubscription, error)
	GetUserSubscriptionHistory(ctx context.Context, userID int64, limit, offset int32) ([]domain.UserSubscription, error)
	HasActiveSubscription(ctx context.Context, userID int64) (bool, error)
	CancelUserSubscription(ctx context.Context, id int64) error
	UpdateSubscriptionStatus(ctx context.Context, id int64, status string) error
	UpdateAutoRenew(ctx context.Context, id int64, autoRenew bool) error
	ExtendSubscription(ctx context.Context, id int64, newExpiresAt time.Time) error
}
