refactor: Update data models to use pointer fields for optional values and add atomic database operations for video views and user storage.

This commit is contained in:
2026-01-22 18:02:45 +07:00
parent acd0be8fa1
commit ea2edbb9e0
4 changed files with 54 additions and 22 deletions

View File

@@ -52,13 +52,16 @@ func (h *Handler) CreatePayment(c *gin.Context) {
// In a real scenario, we would contact Stripe/PayPal here to create a session
// For now, we just create a "PENDING" payment record.
status := "PENDING"
provider := "STRIPE"
payment := &model.Payment{
ID: uuid.New().String(),
UserID: userID,
PlanID: req.PlanID,
PlanID: &req.PlanID,
Amount: req.Amount,
Status: "PENDING",
Provider: "STRIPE", // Defaulting to Stripe for this example
Status: &status,
Provider: &provider, // Defaulting to Stripe for this example
}
p := query.Payment