handlers

package
v0.0.0-...-33c0e0c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePlan

func CreatePlan(c *fiber.Ctx) error

func CreateSubscription

func CreateSubscription(c *fiber.Ctx) error

func GetPlanByID

func GetPlanByID(c *fiber.Ctx) error

func GetPlans

func GetPlans(c *fiber.Ctx) error

func GetUserSubscriptions

func GetUserSubscriptions(c *fiber.Ctx) error

GetUserSubscriptions retrieves all subscriptions for a user

func SubscribeUser

func SubscribeUser(c *fiber.Ctx) error

SubscribeUser handles user subscription requests

Types

type PlanRequest

type PlanRequest struct {
	Name     string  `json:"name" validate:"required"`
	Price    float64 `json:"price" validate:"required"`
	Duration int     `json:"duration" validate:"required"`
}

PlanRequest represents the plan request payload

type PlanResponse

type PlanResponse struct {
	Success bool         `json:"success"`
	Data    *models.Plan `json:"data,omitempty"`
	Error   string       `json:"error,omitempty"`
}

PlanResponse represents the standardized response for plans

type SubscriptionRequest

type SubscriptionRequest struct {
	UserID uint `json:"user_id" validate:"required"`
	PlanID uint `json:"plan_id" validate:"required"`
}

SubscriptionRequest represents the subscription request payload

type SubscriptionResponse

type SubscriptionResponse struct {
	Success bool                 `json:"success"`
	Data    *models.Subscription `json:"data,omitempty"`
	Error   string               `json:"error,omitempty"`
}

SubscriptionResponse represents the standardized response

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL