From cfb17f48074fe382fe9c8ef4a9df5523927c22ba Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 20 Jan 2023 02:18:52 +0000 Subject: [PATCH] --- server/biz/JobsBiz.cs | 11 +++++++---- server/models/Purchase.cs | 4 +++- todo.txt | 6 ++++++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/server/biz/JobsBiz.cs b/server/biz/JobsBiz.cs index de301ac..aed19d4 100644 --- a/server/biz/JobsBiz.cs +++ b/server/biz/JobsBiz.cs @@ -204,7 +204,6 @@ namespace Sockeye.Biz //system lock (no license) is a complete deal breaker for continuation beyond here if (serverState.IsSystemLocked) return false; - return true; } @@ -239,7 +238,7 @@ namespace Sockeye.Biz //###################################################################################### //### Critical internal jobs - + //METRICS CoreJobMetricsSnapshot.DoWork(); @@ -263,7 +262,11 @@ namespace Sockeye.Biz //SOCKBOT - SUBSCRIPTION SERVER HEALTH CHECKS await SockBotSubscriptionServerHealthChecks.DoWorkAsync(); if (!KeepOnWorking()) return; - + + //SOCKBOT - PROCESS PURCHASES + await SockBotProcessPurchases.DoWorkAsync(); + if (!KeepOnWorking()) return; + //JOB SWEEPER await CoreJobSweeper.DoWorkAsync(); if (!KeepOnWorking()) return; @@ -380,7 +383,7 @@ namespace Sockeye.Biz case JobType.TestJob: o = (IJobObject)BizObjectFactory.GetBizObject(SockType.ServerJob, ct, 1, AuthorizationRoles.BizAdmin); break; - + case JobType.AttachmentMaintenance: o = (IJobObject)BizObjectFactory.GetBizObject(SockType.FileAttachment, ct, 1, AuthorizationRoles.BizAdmin); break; diff --git a/server/models/Purchase.cs b/server/models/Purchase.cs index bb96a3d..6c6a108 100644 --- a/server/models/Purchase.cs +++ b/server/models/Purchase.cs @@ -12,6 +12,8 @@ namespace Sockeye.Models public long Id { get; set; } public uint Concurrency { get; set; } public long? CustomerId { get; set; } + public long? LicenseId { get; set; }//when licensed will be set to this license id + THINKING ON THIS ONE public bool Licenseable { get; set; } = false;//indicates it is ready for the licensing job to license this purchase (if has no license id) [NotMapped] public string CustomerViz { get; set; } [Required] @@ -33,7 +35,7 @@ namespace Sockeye.Models public bool RenewNoticeSent { get; set; } = false; public int Quantity { get; set; } = 1; public string VendorData { get; set; } - public bool Processed { get; set; } = false;//indicates it was processed, false means it should be processed + public bool Processed { get; set; } = false;//indicates it was processed from raw vendor data into proper values, false means it should be processed public string Wiki { get; set; } public List Tags { get; set; } //workaround for notification diff --git a/todo.txt b/todo.txt index ff1fce7..e1a3d84 100644 --- a/todo.txt +++ b/todo.txt @@ -5,7 +5,13 @@ TODO: - create customer if necessary from purchase notification or add to existing - if v7 needs to account for there being a delay sometimes in order completeness maybe just keep adding to the order and refreshing + - JOB: make a license from purchases but not active ready to send / in waiting only for approval + - if v7 needs to account for there being a delay sometimes in order completeness + maybe just keep adding to the order and refreshing + IDEA: if v7 don't process into a license until the newest purchase for the same customer are at least XX minutes old + they almost seem to be done manually by mycommerce but I'd say there's no more than 15 minutes max for all to come in + !!! maybe look at email history of previous orders and see what the max delay is between order recepts !!!! - JOB: "SOCKBOT" virtual staff member,