This commit is contained in:
@@ -14,7 +14,9 @@ namespace Sockeye.Biz
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Process purchases into licenses
|
/// Process purchases into licenses
|
||||||
///
|
/// ############## 2023-02-09 THIS IS ON HOLD FOR NOW - unlikely to work immediately due to all manual fuckery involved instead will find ways to speed up manual processing ################
|
||||||
|
/// too much other stuff on the go right now and time required to spend processing purchases is a good problem to have can spend more time on it later
|
||||||
|
/// I'll comment out the job so it's not called and keep the vendor notification processing for now, look at client end improvements (duplicate alone will help)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static class SockBotProcessPurchasesIntoLicenses
|
internal static class SockBotProcessPurchasesIntoLicenses
|
||||||
{
|
{
|
||||||
@@ -119,7 +121,7 @@ namespace Sockeye.Biz
|
|||||||
License newLicense = new License();
|
License newLicense = new License();
|
||||||
//Get last license if any, set up some basic stuff common to all license types
|
//Get last license if any, set up some basic stuff common to all license types
|
||||||
var firstPurchase = purchaseGroup.First();
|
var firstPurchase = purchaseGroup.First();
|
||||||
var lastLicense = await ct.License.AsNoTracking().OrderByDescending(z => z.Id).FirstOrDefaultAsync(z => z.CustomerId == firstPurchase.CustomerId && z.PGroup == firstPurchase.PGroup);
|
License lastLicense=null;
|
||||||
|
|
||||||
newLicense.CustomerId = firstPurchase.CustomerId;
|
newLicense.CustomerId = firstPurchase.CustomerId;
|
||||||
newLicense.Active = false;
|
newLicense.Active = false;
|
||||||
@@ -129,6 +131,8 @@ namespace Sockeye.Biz
|
|||||||
//if there is one and it's not entirely expired then duplicate and fixup from purchases in this group
|
//if there is one and it's not entirely expired then duplicate and fixup from purchases in this group
|
||||||
if (isV7)
|
if (isV7)
|
||||||
{
|
{
|
||||||
|
lastLicense = await ct.License.AsNoTracking().OrderByDescending(z => z.Id).FirstOrDefaultAsync(z => z.CustomerId == firstPurchase.CustomerId && z.PGroup == firstPurchase.PGroup);
|
||||||
|
|
||||||
newLicense.FetchEmail = purchaseGroupCustomer.EmailAddress;
|
newLicense.FetchEmail = purchaseGroupCustomer.EmailAddress;
|
||||||
newLicense.PGroup = ProductGroup.AyaNova7;
|
newLicense.PGroup = ProductGroup.AyaNova7;
|
||||||
|
|
||||||
@@ -294,18 +298,10 @@ namespace Sockeye.Biz
|
|||||||
{
|
{
|
||||||
//it's a RAVEN license
|
//it's a RAVEN license
|
||||||
|
|
||||||
|
|
||||||
//get last license for this dbid, if active then take all it's value and update it with this
|
//get last license for this dbid, if active then take all it's value and update it with this
|
||||||
/*
|
lastLicense = await ct.License.AsNoTracking().OrderByDescending(z => z.Id).FirstOrDefaultAsync(z => z.CustomerId == firstPurchase.CustomerId && z.PGroup == firstPurchase.PGroup);
|
||||||
Check if new or renewal:
|
|
||||||
if it's a renewal it will have several "original_XXXX" fields (they won't exist on first purcahse):
|
|
||||||
"subscription": {
|
|
||||||
"expiration_date": "2023-03-07T00:15:13.0000000Z",
|
|
||||||
"id": "833674953-1",
|
|
||||||
"interval": "Monthly without end",
|
|
||||||
"original_notification_no": "7925",
|
|
||||||
"original_purchase_id": "833674953",
|
|
||||||
"original_running_no": "1",
|
|
||||||
*/
|
|
||||||
|
|
||||||
//If renewal and there is no last license then it's a problem -> THROW EXCEPTION
|
//If renewal and there is no last license then it's a problem -> THROW EXCEPTION
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user