diff --git a/server/biz/GlobalBizSettingsBiz.cs b/server/biz/GlobalBizSettingsBiz.cs index e6fd3d4..d0abdcb 100644 --- a/server/biz/GlobalBizSettingsBiz.cs +++ b/server/biz/GlobalBizSettingsBiz.cs @@ -260,7 +260,7 @@ namespace Sockeye.Biz p.Active = true;//not entirely true but we can always deactivate there aren't many products p.VendorId = 1; p.OurCode = p.VendorCode = jPurchase["productCode"].Value(); - p.PGroup = ProductGroupFromProductCode(p.OurCode); + p.PGroup = ProductBiz.ProductGroupFromProductCode(p.OurCode); if (p.VendorCode == "301028468")//subscription yearly { @@ -793,69 +793,7 @@ namespace Sockeye.Biz } - private static ProductGroup ProductGroupFromProductCode(string productCode) - { - switch (productCode) - { - case "300740321"://wbi - case "300740317"://up to 5 - case "300740314"://RI - case "300740328"://Quick notification - case "300784766"://QBOI - case "300740315"://Single - case "300740323"://QBI - case "300740318"://Up to 10 - case "300740327"://Export to XLS - case "300740329"://ImportExport CSV duplicate - case "300740319"://Up to 20 - case "300740322"://MBI - case "300740324"://PTI - case "300740325"://OLI - case "300807973"://Up to 15 - case "300740326"://Outlook Schedule Export - case "300740316"://AyaNova LITE - case "999"://Up to 999 - return ProductGroup.AyaNova7; - case "300093112"://Key administration - case "301010670"://Custom 733918243 - case "300151145"://Custom 539230073 - return ProductGroup.Misc; - case "301028317"://AyaNova perpetual single user license includes one year maintenance plan - return ProductGroup.RavenPerpetual; - case "301028468"://AyaNova subscription one user YEARLY - case "301028467"://AyaNova subscription one user MONTHLY - return ProductGroup.RavenSubscription; - default: - throw new Exception($"Uknown product code {productCode}"); - } - } - /* - "id" "name" "active" "vendorid" "licenseinterval" "maintinterval" "vendorcode" "ourcode" "wiki" "tags" -1 "WBI" true 1 "00:00:00" "365 days" "300740321" "300740321" "{}" -2 "Up to 5" true 1 "00:00:00" "365 days" "300740317" "300740317" "{}" -3 "RI" true 1 "00:00:00" "365 days" "300740314" "300740314" "{}" -4 "Quick Notification" true 1 "00:00:00" "365 days" "300740328" "300740328" "{}" -5 "QBOI" true 1 "00:00:00" "365 days" "300784766" "300784766" "{}" -6 "Single" true 1 "00:00:00" "365 days" "300740315" "300740315" "{}" -7 "QBI" true 1 "00:00:00" "365 days" "300740323" "300740323" "{}" -8 "Up to 10" true 1 "00:00:00" "365 days" "300740318" "300740318" "{}" -9 "Export to XLS" true 1 "00:00:00" "365 days" "300740327" "300740327" "{}" -10 "Importexport.csv duplicate" true 1 "00:00:00" "365 days" "300740329" "300740329" "{}" -11 "Up to 20" true 1 "00:00:00" "365 days" "300740319" "300740319" "{}" -12 "MBI" true 1 "00:00:00" "365 days" "300740322" "300740322" "{}" -13 "Key Administration" true 1 "00:00:00" "365 days" "300093112" "300093112" "{}" -14 "PTI " true 1 "00:00:00" "365 days" "300740324" "300740324" "{}" -15 "OLI" true 1 "00:00:00" "365 days" "300740325" "300740325" "{}" -16 "Up to 15" true 1 "00:00:00" "365 days" "300807973" "300807973" "{}" -17 "Outlook Schedule Export" true 1 "00:00:00" "365 days" "300740326" "300740326" "{}" -18 "AyaNova Lite" true 1 "00:00:00" "365 days" "300740316" "300740316" "{}" -19 "Up to 999" true 1 "00:00:00" "365 days" "999" "999" "{}" -20 "AyaNova perpetual single user license includes one year maintenance plan" true 1 "00:00:00" "365 days" "301028317" "301028317" "{}" -21 "Custom 733918243" true 1 "00:00:00" "365 days" "301010670" "301010670" "{}" -22 "AyaNova subscription one user monthly" true 1 "31 days" "31 days" "301028467" "301028467" "{}" -23 "Custom 539230073" true 1 "00:00:00" "365 days" "300151145" "300151145" "{}" -24 "AyaNova subscription one user yearly" true 1 "365 days" "365 days" "301028468" "301028468" "{}" - */ + ///////////////////////////////////////////////////////////////////// }//eoc diff --git a/server/biz/ProductBiz.cs b/server/biz/ProductBiz.cs index f197fa8..10e5f40 100644 --- a/server/biz/ProductBiz.cs +++ b/server/biz/ProductBiz.cs @@ -163,7 +163,72 @@ namespace Sockeye.Biz } - + //////////////////////////////////////////////////// + // UTILITY + // + public static ProductGroup ProductGroupFromProductCode(string productCode) + { + switch (productCode) + { + case "300740321"://wbi + case "300740317"://up to 5 + case "300740314"://RI + case "300740328"://Quick notification + case "300784766"://QBOI + case "300740315"://Single + case "300740323"://QBI + case "300740318"://Up to 10 + case "300740327"://Export to XLS + case "300740329"://ImportExport CSV duplicate + case "300740319"://Up to 20 + case "300740322"://MBI + case "300740324"://PTI + case "300740325"://OLI + case "300807973"://Up to 15 + case "300740326"://Outlook Schedule Export + case "300740316"://AyaNova LITE + case "999"://Up to 999 + return ProductGroup.AyaNova7; + case "300093112"://Key administration + case "301010670"://Custom 733918243 + case "300151145"://Custom 539230073 + return ProductGroup.Misc; + case "301028317"://AyaNova perpetual single user license includes one year maintenance plan + return ProductGroup.RavenPerpetual; + case "301028468"://AyaNova subscription one user YEARLY + case "301028467"://AyaNova subscription one user MONTHLY + return ProductGroup.RavenSubscription; + default: + throw new Exception($"Uknown product code {productCode}"); + } + } + /* + "id" "name" "active" "vendorid" "licenseinterval" "maintinterval" "vendorcode" "ourcode" "wiki" "tags" +1 "WBI" true 1 "00:00:00" "365 days" "300740321" "300740321" "{}" +2 "Up to 5" true 1 "00:00:00" "365 days" "300740317" "300740317" "{}" +3 "RI" true 1 "00:00:00" "365 days" "300740314" "300740314" "{}" +4 "Quick Notification" true 1 "00:00:00" "365 days" "300740328" "300740328" "{}" +5 "QBOI" true 1 "00:00:00" "365 days" "300784766" "300784766" "{}" +6 "Single" true 1 "00:00:00" "365 days" "300740315" "300740315" "{}" +7 "QBI" true 1 "00:00:00" "365 days" "300740323" "300740323" "{}" +8 "Up to 10" true 1 "00:00:00" "365 days" "300740318" "300740318" "{}" +9 "Export to XLS" true 1 "00:00:00" "365 days" "300740327" "300740327" "{}" +10 "Importexport.csv duplicate" true 1 "00:00:00" "365 days" "300740329" "300740329" "{}" +11 "Up to 20" true 1 "00:00:00" "365 days" "300740319" "300740319" "{}" +12 "MBI" true 1 "00:00:00" "365 days" "300740322" "300740322" "{}" +13 "Key Administration" true 1 "00:00:00" "365 days" "300093112" "300093112" "{}" +14 "PTI " true 1 "00:00:00" "365 days" "300740324" "300740324" "{}" +15 "OLI" true 1 "00:00:00" "365 days" "300740325" "300740325" "{}" +16 "Up to 15" true 1 "00:00:00" "365 days" "300807973" "300807973" "{}" +17 "Outlook Schedule Export" true 1 "00:00:00" "365 days" "300740326" "300740326" "{}" +18 "AyaNova Lite" true 1 "00:00:00" "365 days" "300740316" "300740316" "{}" +19 "Up to 999" true 1 "00:00:00" "365 days" "999" "999" "{}" +20 "AyaNova perpetual single user license includes one year maintenance plan" true 1 "00:00:00" "365 days" "301028317" "301028317" "{}" +21 "Custom 733918243" true 1 "00:00:00" "365 days" "301010670" "301010670" "{}" +22 "AyaNova subscription one user monthly" true 1 "31 days" "31 days" "301028467" "301028467" "{}" +23 "Custom 539230073" true 1 "00:00:00" "365 days" "300151145" "300151145" "{}" +24 "AyaNova subscription one user yearly" true 1 "365 days" "365 days" "301028468" "301028468" "{}" + */ //////////////////////////////////////////////////////////////////////////////////////////////// //SEARCH @@ -202,7 +267,7 @@ namespace Sockeye.Biz private async Task ValidateAsync(Product proposedObj, Product currentObj) { - await Task.CompletedTask; + await Task.CompletedTask; } diff --git a/server/generator/SockBotProcessVendorNotifications.cs b/server/generator/SockBotProcessVendorNotifications.cs index 52b156f..929d3cc 100644 --- a/server/generator/SockBotProcessVendorNotifications.cs +++ b/server/generator/SockBotProcessVendorNotifications.cs @@ -173,7 +173,8 @@ namespace Sockeye.Biz //ok, turn this into a fully realized Purchase record //Product group - there is code to do this already somewhere, product number to pgroup + p.PGroup = ProductBiz.ProductGroupFromProductCode(p.OurCode); +