diff --git a/server/biz/GlobalBizSettingsBiz.cs b/server/biz/GlobalBizSettingsBiz.cs index 41d1d3d..044bbb5 100644 --- a/server/biz/GlobalBizSettingsBiz.cs +++ b/server/biz/GlobalBizSettingsBiz.cs @@ -350,106 +350,106 @@ namespace Sockeye.Biz #region CASES - // log.LogInformation("RFImport Cases"); - // //case projects to be tags - // List CaseProjectList = new List(); - // { - // res = await client.GetAsync($"{URL_ROCKFISH}api/rfcaseproject"); - // responseText = await res.Content.ReadAsStringAsync(); + log.LogInformation("RFImport Cases"); + //case projects to be tags + List CaseProjectList = new List(); + { + res = await client.GetAsync($"{URL_ROCKFISH}api/rfcaseproject"); + responseText = await res.Content.ReadAsStringAsync(); - // var jaRFCaseProjectList = JArray.Parse(responseText); - // foreach (JObject jRFCaseProject in jaRFCaseProjectList) - // { - // CaseProjectList.Add(new NameIdItem() { Name = jRFCaseProject["name"].Value(), Id = jRFCaseProject["id"].Value() }); + var jaRFCaseProjectList = JArray.Parse(responseText); + foreach (JObject jRFCaseProject in jaRFCaseProjectList) + { + CaseProjectList.Add(new NameIdItem() { Name = jRFCaseProject["name"].Value(), Id = jRFCaseProject["id"].Value() }); - // } + } - // } - // { - // res = await client.GetAsync($"{URL_ROCKFISH}api/rfcase/list"); - // responseText = await res.Content.ReadAsStringAsync(); - // var jaRFCaseList = JArray.Parse(responseText); - // //some cases are missing the start date so substitute a close other case date (not critical but sb at least in the ballpark for list viewing purposes) - // DateTime dtTempCreated = new DateTime(2000, 1, 1, 0, 0, 0, DateTimeKind.Utc); - // foreach (JObject jRFCase in jaRFCaseList.Reverse()) - // { + } + { + res = await client.GetAsync($"{URL_ROCKFISH}api/rfcase/list"); + responseText = await res.Content.ReadAsStringAsync(); + var jaRFCaseList = JArray.Parse(responseText); + //some cases are missing the start date so substitute a close other case date (not critical but sb at least in the ballpark for list viewing purposes) + DateTime dtTempCreated = new DateTime(2000, 1, 1, 0, 0, 0, DateTimeKind.Utc); + foreach (JObject jRFCase in jaRFCaseList.Reverse()) + { - // var g = new GZCase(); - // g.CaseId = jRFCase["id"].Value(); - // g.Closed = DateUtil.EpochToDateNullIsNull(jRFCase["dtClosed"].Value()); - // //NOTE: closed in rockfish was the date at midnight in GMT - // //so to be in the same day as here need to add a few hours, let's say 8 am for each so add 8 hours - // if (g.Closed != null) - // { - // g.Closed = ((DateTime)g.Closed).AddHours(16); - // } + var g = new GZCase(); + g.CaseId = jRFCase["id"].Value(); + g.Closed = DateUtil.EpochToDateNullIsNull(jRFCase["dtClosed"].Value()); + //NOTE: closed in rockfish was the date at midnight in GMT + //so to be in the same day as here need to add a few hours, let's say 8 am for each so add 8 hours + if (g.Closed != null) + { + g.Closed = ((DateTime)g.Closed).AddHours(16); + } - // //fuckery to try to insert a at least semi close date when created date is missing - // DateTime? dtTemp = DateUtil.EpochToDateNullIsNull(jRFCase["dtCreated"].Value()); - // if (dtTemp == null) - // { - // dtTemp = dtTempCreated; - // } - // else - // { - // dtTempCreated = (DateTime)dtTemp; - // } - // g.Created = (DateTime)dtTemp; - // g.Name = jRFCase["title"].Value(); - // g.Notes = jRFCase["notes"].Value(); + //fuckery to try to insert a at least semi close date when created date is missing + DateTime? dtTemp = DateUtil.EpochToDateNullIsNull(jRFCase["dtCreated"].Value()); + if (dtTemp == null) + { + dtTemp = dtTempCreated; + } + else + { + dtTempCreated = (DateTime)dtTemp; + } + g.Created = (DateTime)dtTemp; + g.Name = jRFCase["title"].Value(); + g.Notes = jRFCase["notes"].Value(); - // var ver = jRFCase["releaseVersion"].Value(); - // if (!string.IsNullOrWhiteSpace(ver)) - // g.Notes += $"\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\nReleased on version:{ver}"; + var ver = jRFCase["releaseVersion"].Value(); + if (!string.IsNullOrWhiteSpace(ver)) + g.Notes += $"\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\nReleased on version:{ver}"; - // var releaseNotes = jRFCase["releaseNotes"].Value(); - // if (!string.IsNullOrWhiteSpace(releaseNotes)) - // g.Notes += $"\nRelease notes:{releaseNotes}"; + var releaseNotes = jRFCase["releaseNotes"].Value(); + if (!string.IsNullOrWhiteSpace(releaseNotes)) + g.Notes += $"\nRelease notes:{releaseNotes}"; - // //Project name to tags - // g.Tags.Add(CaseProjectList.FirstOrDefault(z => z.Id == jRFCase["rfCaseProjectId"].Value()).Name.Replace("z_", "legacy-")); + //Project name to tags + g.Tags.Add(CaseProjectList.FirstOrDefault(z => z.Id == jRFCase["rfCaseProjectId"].Value()).Name.Replace("z_", "legacy-")); - // //priority to tags - // g.Tags.Add($"{jRFCase["priority"].Value()}-priority"); + //priority to tags + g.Tags.Add($"{jRFCase["priority"].Value()}-priority"); - // //check for attachments and just add as a note, don't bother with actual transfer of attachment, there aren't a lot and most are way in the past and not required for anything - // //if needed in future can manually xfer it over from the rockfish.sqlite db directly using DB BRowser for sqlite which allows opening the blob from the rfcaseblob table and saving it - // res = await client.GetAsync($"{URL_ROCKFISH}api/rfcase/{g.CaseId}/attachments"); - // responseText = await res.Content.ReadAsStringAsync(); - // var jAttachments = JObject.Parse(responseText); - // if (jAttachments["attach"].Count() > 0) - // { - // g.Notes += "\n********\nRockfish attachments\n"; - // foreach (JObject jAttachmentRecord in jAttachments["attach"]) - // { - // g.Notes += $"File: \"{jAttachmentRecord["name"].Value()}\", rfcaseblob table id: {jAttachmentRecord["id"].Value()}\n"; + //check for attachments and just add as a note, don't bother with actual transfer of attachment, there aren't a lot and most are way in the past and not required for anything + //if needed in future can manually xfer it over from the rockfish.sqlite db directly using DB BRowser for sqlite which allows opening the blob from the rfcaseblob table and saving it + res = await client.GetAsync($"{URL_ROCKFISH}api/rfcase/{g.CaseId}/attachments"); + responseText = await res.Content.ReadAsStringAsync(); + var jAttachments = JObject.Parse(responseText); + if (jAttachments["attach"].Count() > 0) + { + g.Notes += "\n********\nRockfish attachments\n"; + foreach (JObject jAttachmentRecord in jAttachments["attach"]) + { + g.Notes += $"File: \"{jAttachmentRecord["name"].Value()}\", rfcaseblob table id: {jAttachmentRecord["id"].Value()}\n"; - // } - // g.Notes += "\n********\n"; - // } + } + g.Notes += "\n********\n"; + } - // GZCaseBiz biz = GZCaseBiz.GetBiz(ct); - // await biz.CreateAsync(g); + GZCaseBiz biz = GZCaseBiz.GetBiz(ct); + await biz.CreateAsync(g); - // //attachments example 86400000 - // // /api/rfcase/4360/attachments - // //{"dlkey":"ZFkAUpo1L0Gi3Q9aO5szkA","attach":[{"id":259,"name":"desired weight calcs.txt"}]} - // //{"dlkey":"iR6ncD70CkzkozyT0otA","attach":[]} + //attachments example 86400000 + // /api/rfcase/4360/attachments + //{"dlkey":"ZFkAUpo1L0Gi3Q9aO5szkA","attach":[{"id":259,"name":"desired weight calcs.txt"}]} + //{"dlkey":"iR6ncD70CkzkozyT0otA","attach":[]} - // }// all cases loop + }// all cases loop - // //Start next case with a new sequence caseid of 4444 - // using (var command = ct.Database.GetDbConnection().CreateCommand()) - // { - // command.CommandText = $"ALTER SEQUENCE agzcase_caseid_seq RESTART WITH 4443;"; - // await ct.Database.OpenConnectionAsync(); - // await command.ExecuteNonQueryAsync(); - // await ct.Database.CloseConnectionAsync(); - // } - // } + //Start next case with a new sequence caseid of 4444 + using (var command = ct.Database.GetDbConnection().CreateCommand()) + { + command.CommandText = $"ALTER SEQUENCE agzcase_caseid_seq RESTART WITH 4444;"; + await ct.Database.OpenConnectionAsync(); + await command.ExecuteNonQueryAsync(); + await ct.Database.CloseConnectionAsync(); + } + } #endregion cases diff --git a/todo.txt b/todo.txt index 25998d7..4be91a8 100644 --- a/todo.txt +++ b/todo.txt @@ -1,6 +1,26 @@ -client - open / edit all the things +LICENSE NOTES +Sockeye should generate a license on a sale receipt, maybe after a slight delay. Generated license should be in the list of licenses but have a unfulfilled status of some kind so it's ready for me to visually see purchases applicable and confirm approve and send it with one click but it's not doing it itself. + +If more purchases come on that supply to take customer for v7 then it should regenerate a new license or I guess edit the one it made before and just add to it. +Idea bring that all I have to do is open they list off licenses and just release any that are good to go. +UI should show the purchases that go into a license so can confirm visually without having to click anywhere else. + +This way is all but automatic in pero for full automation later. +Maybe even a semi automatic dead man switch that will just send it after 24 guess if I don't once it's confirmed to work properly. + +So need properties added to license object for fulfilled status and a property indicating sent to customer and a menu options to send manually maybe too. + +I guess will need a template for email messages as well. +Tier into notification system. +Don't forget some licenses are not done through SHAREitb do must support manual generation from Paypal etc + +ALSO + +Needs manual license generation for v7 still + +========= PURCHASE drives new licensing ui To automate as much as possible need following: @@ -71,4 +91,42 @@ Also, sidebar, check if can pay d.o. in advance, or do I want that?? new roles and bizroles set appropo Developer - rw cases Support - read cases, read sales and customer data? - Sales - licenses \ No newline at end of file + Sales - licenses + + + + ============================== + certbot expand + + root@devops:/etc/nginx/sites-available# certbot --nginx --cert-name test.onayanova.com -d test.onayanova.com,subtest.onayanova.com +Saving debug log to /var/log/letsencrypt/letsencrypt.log + +- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +You are updating certificate test.onayanova.com to include new domain(s): ++ subtest.onayanova.com + +You are also removing previously included domain(s): +(None) + +Did you intend to make this change? +- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +(U)pdate certificate/(C)ancel: u +Renewing an existing certificate for test.onayanova.com and subtest.onayanova.com + +Successfully received certificate. +Certificate is saved at: /etc/letsencrypt/live/test.onayanova.com/fullchain.pem +Key is saved at: /etc/letsencrypt/live/test.onayanova.com/privkey.pem +This certificate expires on 2023-04-04. +These files will be updated when the certificate renews. +Certbot has set up a scheduled task to automatically renew this certificate in the background. + +Deploying certificate +Successfully deployed certificate for test.onayanova.com to /etc/nginx/sites-enabled/default +Could not install certificate + +NEXT STEPS: +- The certificate was saved, but could not be installed (installer: nginx). After fixing the error shown below, try installing it again by running: + certbot install --cert-name test.onayanova.com + +Could not automatically find a matching server block for subtest.onayanova.com. Set the `server_name` directive to use the Nginx installer. +Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.