case 4576 addition of up to 25 level v7

This commit is contained in:
2024-03-21 14:02:06 +00:00
parent ab75b98571
commit 98c7157b0c
5 changed files with 28 additions and 18 deletions

View File

@@ -211,6 +211,9 @@ namespace Sockeye.Biz
case 20:
sb.AppendLine("Up to 20");
break;
case 25://case 4576
sb.AppendLine("Up to 25");
break;
case 50:
sb.AppendLine("Up to 50");
break;

View File

@@ -185,6 +185,7 @@ namespace Sockeye.Biz
case "300740324"://PTI
case "300740325"://OLI
case "300807973"://Up to 15
case "301091845"://Up to 25 //case 4576
case "300740326"://Outlook Schedule Export
case "300740316"://AyaNova LITE
case "999"://Up to 999

View File

@@ -121,8 +121,8 @@ namespace Sockeye.Biz
License newLicense = new License();
//Get last license if any, set up some basic stuff common to all license types
var firstPurchase = purchaseGroup.First();
License lastLicense=null;
License lastLicense = null;
newLicense.CustomerId = firstPurchase.CustomerId;
newLicense.Active = false;
newLicense.RegTo = firstPurchase.RegTo;
@@ -131,7 +131,7 @@ namespace Sockeye.Biz
//if there is one and it's not entirely expired then duplicate and fixup from purchases in this group
if (isV7)
{
lastLicense = await ct.License.AsNoTracking().OrderByDescending(z => z.Id).FirstOrDefaultAsync(z => z.CustomerId == firstPurchase.CustomerId && z.PGroup == firstPurchase.PGroup);
lastLicense = await ct.License.AsNoTracking().OrderByDescending(z => z.Id).FirstOrDefaultAsync(z => z.CustomerId == firstPurchase.CustomerId && z.PGroup == firstPurchase.PGroup);
newLicense.FetchEmail = purchaseGroupCustomer.EmailAddress;
newLicense.PGroup = ProductGroup.AyaNova7;
@@ -207,6 +207,8 @@ namespace Sockeye.Biz
21 Single AyaNova service techncian perpetual license 301028314 135 100
22 Single AyaNova service techncian 1 year maintenance plan - new 301028317 135 100
23 Single AyaNova service techncian 1 year maintenance plan - active 301028315 100 100
case 4576
25 Up to 25 AyaNova schedulable resource 1 year subscription license
*/
var dtOneYear = DateTime.UtcNow.AddYears(1);
switch (product.VendorCode)
@@ -280,6 +282,10 @@ namespace Sockeye.Biz
newLicense.Users = 15;
newLicense.MaintenanceExpire = dtOneYear;
break;
case "301091845": //case 4576
newLicense.Users = 25;
newLicense.MaintenanceExpire = dtOneYear;
break;
default:
var err = $"SockBotProcessPurchasesIntoLicenses purchase: {purchase.Id} has product not part of v7 group expected: {product.Name}-{product.VendorCode}";
//serious issue requires immediate notification
@@ -299,19 +305,19 @@ namespace Sockeye.Biz
//it's a RAVEN license
//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);
//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);
//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
//If no last license and not renewal then it's a new purchase -> GENERATE NEW
//If no last license and not renewal then it's a new purchase -> GENERATE NEW
//If last license and renewal then it's a renewal -> UPDATE LAST LICENSE DATES SAVE NEW
//If last license and renewal then it's a renewal -> UPDATE LAST LICENSE DATES SAVE NEW
//If last license and NEW then it's an additional add on count
//if dbid matches -> ADD TO COUNT PUT THAT IN NOTES OF LICENSE
//if no dbid match then -> THROW EXCEPTION
//If last license and NEW then it's an additional add on count
//if dbid matches -> ADD TO COUNT PUT THAT IN NOTES OF LICENSE
//if no dbid match then -> THROW EXCEPTION
//iterate the purchases and update / set the license
foreach (var purchase in purchaseGroup)
@@ -334,10 +340,10 @@ namespace Sockeye.Biz
301033168 AyaNova subscription additional 250 customer users yearly 250customerusersyearly Product 12 months HD1 Oct 6, 2022, 12:59 AM
*/
// - sockeye note: Need to handle multiple raven license purchases, my policy is the freshest date is honoured so for examle tri-star bought in December then in Feb 2 users each time so the feb is the freshest, the trick is when the december renews not to cut it short but still use the feb date. since eventually sockeye will be automated it needs to handle this up front now, not later
//algorithm: check if existing license for db id, if yes, is it for more users than current license?
//if yes then is it unexpired?
//if yes then honour the
// - sockeye note: Need to handle multiple raven license purchases, my policy is the freshest date is honoured so for examle tri-star bought in December then in Feb 2 users each time so the feb is the freshest, the trick is when the december renews not to cut it short but still use the feb date. since eventually sockeye will be automated it needs to handle this up front now, not later
//algorithm: check if existing license for db id, if yes, is it for more users than current license?
//if yes then is it unexpired?
//if yes then honour the
//RAVEN licenses have one week padding to be on the safe side
var dtOneYear = DateTime.UtcNow.AddYears(1).AddDays(7);
var dtOneMonth = DateTime.UtcNow.AddMonths(1).AddDays(7);

View File

@@ -4,8 +4,8 @@
</PropertyGroup>
<PropertyGroup>
<GenerateFullPaths>true</GenerateFullPaths>
<Version>8.0.13</Version>
<FileVersion>8.0.13.0</FileVersion>
<Version>8.0.14</Version>
<FileVersion>8.0.14.0</FileVersion>
<ApplicationIcon>sockeye.ico</ApplicationIcon>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
<noWarn>1591</noWarn>

View File

@@ -5,7 +5,7 @@ namespace Sockeye.Util
/// </summary>
internal static class SockeyeVersion
{
public const string VersionString = "8.0.13";
public const string VersionString = "8.0.14";
public const string FullNameAndVersion = "Sockeye server " + VersionString;
public const string CurrentApiVersion="v8";
}//eoc