Browse Source

Make email sync not remove email account if premium

master
Teknikode 7 months ago
parent
commit
2e945e7d9d
  1. 11
      BillingService/Program.cs
  2. 4
      IdentityServer/package.json
  3. 4
      Teknik/package.json

11
BillingService/Program.cs

@ -3,6 +3,7 @@ using System.Collections.Generic; @@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using CommandLine;
using Microsoft.EntityFrameworkCore;
using Teknik.Areas.Billing;
@ -72,7 +73,7 @@ namespace Teknik.BillingService @@ -72,7 +73,7 @@ namespace Teknik.BillingService
return -1;
}
public static void SyncSubscriptions(Config config, TeknikEntities db)
public static async Task SyncSubscriptions(Config config, TeknikEntities db)
{
// Get Biling Service
var billingService = BillingFactory.GetBillingService(config.BillingConfig);
@ -117,7 +118,13 @@ namespace Teknik.BillingService @@ -117,7 +118,13 @@ namespace Teknik.BillingService
}
else
{
BillingHelper.SetEmailLimits(config, user, config.EmailConfig.MaxSize, false);
// Only reset their email size limit if they are premium
var userInfo = await IdentityHelper.GetIdentityUserInfo(config, user.Username);
if (userInfo != null &&
userInfo.AccountType == AccountType.Premium)
BillingHelper.SetEmailLimits(config, user, config.EmailConfig.MaxSize, true);
else
BillingHelper.SetEmailLimits(config, user, config.EmailConfig.MaxSize, false);
}
}
}

4
IdentityServer/package.json

@ -35,8 +35,8 @@ @@ -35,8 +35,8 @@
"url": "https://git.teknik.io/Teknikode/Teknik"
},
"scripts": {
"pre-publish": "npm install && gulp clean && gulp copy-assets && gulp watch",
"build": "npm install && gulp clean && gulp copy-assets && gulp min && gulp update-version",
"pre-publish": "npm install && gulp clean && gulp copy-assets",
"build": "npm install && gulp eslint && gulp clean && gulp copy-assets && gulp load-bundle && gulp min && gulp update-version",
"gulp": "gulp"
},
"version": "2.1.0"

4
Teknik/package.json

@ -57,8 +57,8 @@ @@ -57,8 +57,8 @@
"url": "https://git.teknik.io/Teknikode/Teknik"
},
"scripts": {
"pre-publish": "npm install && gulp clean && gulp copy-assets && gulp watch",
"build": "npm install && gulp eslint && gulp clean && gulp copy-assets && gulp min && gulp update-version",
"pre-publish": "npm install && gulp clean && gulp copy-assets",
"build": "npm install && gulp eslint && gulp clean && gulp copy-assets && gulp load-bundle && gulp min && gulp update-version",
"gulp": "gulp"
},
"version": "2.1.0"

Loading…
Cancel
Save