clean up
This commit is contained in:
@@ -217,7 +217,7 @@ func main() {
|
||||
billingController := controller.NewBillingController(plans,
|
||||
appStoreController, playStoreController, stripeController,
|
||||
discordController, emailNotificationCtrl,
|
||||
billingRepo, userRepo, usageRepo, storagBonusRepo, commonBillController, notificationHistoryRepo)
|
||||
billingRepo, userRepo, usageRepo, storagBonusRepo, commonBillController)
|
||||
pushController := controller.NewPushController(pushRepo, taskLockingRepo, hostName)
|
||||
mailingListsController := controller.NewMailingListsController()
|
||||
|
||||
|
||||
@@ -118,7 +118,6 @@ func (c *AppStoreController) HandleNotification(ctx *gin.Context, notification a
|
||||
if err != nil {
|
||||
return stacktrace.Propagate(err, "")
|
||||
}
|
||||
|
||||
} else {
|
||||
if notification.NotificationType == appstore.NotificationTypeDidChangeRenewalStatus {
|
||||
err := c.BillingRepo.UpdateSubscriptionCancellationStatus(subscription.UserID, notification.AutoRenewStatus == "false")
|
||||
|
||||
@@ -54,7 +54,6 @@ func NewBillingController(
|
||||
usageRepo *repo.UsageRepository,
|
||||
storageBonusRepo *storagebonus.Repository,
|
||||
commonBillCtrl *commonbilling.Controller,
|
||||
notificationHistoryRepo *repo.NotificationHistoryRepository,
|
||||
) *BillingController {
|
||||
return &BillingController{
|
||||
BillingPlansPerAccount: plans,
|
||||
|
||||
@@ -54,7 +54,6 @@ type EmailNotificationController struct {
|
||||
LockController *lock.LockController
|
||||
NotificationHistoryRepo *repo.NotificationHistoryRepository
|
||||
isSendingStorageLimitExceededMails bool
|
||||
FamilyRepo *repo.FamilyRepository
|
||||
}
|
||||
|
||||
func (c *EmailNotificationController) OnFirstFileUpload(userID int64, userAgent string) {
|
||||
|
||||
@@ -171,8 +171,8 @@ func (c *FileController) Create(ctx *gin.Context, userID int64, file ente.File,
|
||||
}
|
||||
|
||||
// all iz well
|
||||
// var usage int64
|
||||
file, _, err = c.FileRepo.Create(file, fileSize, thumbnailSize, fileSize+thumbnailSize, userID, app)
|
||||
var usage int64
|
||||
file, usage, err = c.FileRepo.Create(file, fileSize, thumbnailSize, fileSize+thumbnailSize, userID, app)
|
||||
if err != nil {
|
||||
if err == ente.ErrDuplicateFileObjectFound || err == ente.ErrDuplicateThumbnailObjectFound {
|
||||
var existing ente.File
|
||||
@@ -192,10 +192,9 @@ func (c *FileController) Create(ctx *gin.Context, userID int64, file ente.File,
|
||||
}
|
||||
return file, stacktrace.Propagate(err, "")
|
||||
}
|
||||
// The OnFirstFileUpload Email trigger will not be used and replaced with EmailAfterSignUp
|
||||
// if usage == fileSize+thumbnailSize {
|
||||
// go c.EmailNotificationCtrl.OnFirstFileUpload(file.OwnerID, userAgent)
|
||||
// }
|
||||
if usage == fileSize+thumbnailSize {
|
||||
go c.EmailNotificationCtrl.OnFirstFileUpload(file.OwnerID, userAgent)
|
||||
}
|
||||
return file, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -260,10 +260,8 @@ func (c *StripeController) handleCheckoutSessionCompleted(event stripe.Event, co
|
||||
}()
|
||||
}
|
||||
if err != nil {
|
||||
return ente.StripeEventLog{UserID: userID, StripeSubscription: stripeSubscription, Event: event}, stacktrace.Propagate(err, "Failed to change subscription")
|
||||
return ente.StripeEventLog{}, stacktrace.Propagate(err, "Failed to change subscription")
|
||||
}
|
||||
|
||||
// Execute DeleteLastNotificationTime entry after successful execution of ReplaceSubscription
|
||||
return ente.StripeEventLog{UserID: userID, StripeSubscription: stripeSubscription, Event: event}, nil
|
||||
} else {
|
||||
priceID, err := c.getPriceIDFromSession(session.ID)
|
||||
@@ -306,7 +304,6 @@ func (c *StripeController) handleCustomerSubscriptionUpdated(event stripe.Event,
|
||||
// events to update the state
|
||||
if currentSubscription.ProductID != newSubscription.ProductID {
|
||||
c.BillingRepo.ReplaceSubscription(currentSubscription.ID, newSubscription)
|
||||
|
||||
}
|
||||
|
||||
fullStripeSub, err := c.getStripeSubscriptionWithPaymentMethod(currentSubscription)
|
||||
|
||||
@@ -2,7 +2,6 @@ package repo
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
|
||||
"github.com/ente-io/stacktrace"
|
||||
|
||||
"github.com/ente-io/museum/pkg/utils/time"
|
||||
|
||||
Reference in New Issue
Block a user