Skip to content

Commit

Permalink
fixing build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
scoxen1 committed May 23, 2024
1 parent b0994bd commit b877f91
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions api/CESMII.Marketplace.JobManager/Jobs/JobOntimeEdgePurchase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
using System.Net.Mail;
using System.Net.Http;

using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;

using CESMII.Marketplace.Data.Repositories;
using CESMII.Marketplace.Data.Entities;
using CESMII.Marketplace.DAL;
using CESMII.Marketplace.DAL.Models;
Expand All @@ -26,13 +28,14 @@ namespace CESMII.Marketplace.JobManager.Jobs
public class JobOntimeEdgePurchase : JobBase
{
public JobOntimeEdgePurchase(
IServiceScopeFactory serviceScopeFactory,
ILogger<IJob> logger,
IHttpApiFactory httpFactory,
IHttpApiFactory httpFactory,
IDal<JobLog, JobLogModel> dalJobLog,
UserDAL dalUser,
IConfiguration configuration,
MailRelayService mailRelayService) :
base(logger, httpFactory, dalJobLog, dalUser, configuration, mailRelayService)
MailRelayService mailRelayService) :
base(serviceScopeFactory, logger, httpFactory, dalJobLog, dalUser, configuration, mailRelayService)
{
//wire up run async event
base.JobRun += JobInitiateLicensing;
Expand All @@ -48,7 +51,6 @@ private async Task<string> JobInitiateLicensing(object sender, JobEventArgs e)
{
//3 sources of data - job config - static data, runtime payload data - user entered data and user data - user profile data
//extract out job config params from payload and convert from JSON to an object we can use within this job
//if smip settings is null, still allow purchase to go through but inform user
var jobConfig = JsonConvert.DeserializeObject<JobOnTimeEdgeConfig>(e.Config.Data);
var payload = JsonConvert.DeserializeObject<ECommerceOnCompleteModel>(e.Payload);

Expand Down Expand Up @@ -78,6 +80,7 @@ private async Task<string> JobInitiateLicensing(object sender, JobEventArgs e)
//call the Zapier catch hook API to intialize start purchase flow
var config = new HttpApiConfig()
{
BaseAddress = "",
Url = jobConfig.ApogeanApi.Url,
Body = new StringContent(JsonConvert.SerializeObject(req)),
ContentType = "application/json",
Expand Down Expand Up @@ -150,7 +153,8 @@ private bool ValidateJobConfig(JobOnTimeEdgeConfig jobConfig, out string message
sbResult.AppendLine("The ApogeanApi config section is missing. Please contact the system administrator.");
_logger.LogError($"JobOntimeEdgePurchase|ValidateJobConfig|ApogeanApi section is missing.");
}
if (string.IsNullOrEmpty(jobConfig.ApogeanApi.Url)) {
if (string.IsNullOrEmpty(jobConfig.ApogeanApi.Url))
{
sbResult.AppendLine("The OnTime Edge url is missing. Please contact the system administrator.");
_logger.LogError($"JobOntimeEdgePurchase|ValidateJobConfig|The jobConfig.Url is missing.");
}
Expand All @@ -172,7 +176,7 @@ private bool ValidatePayload(ECommerceOnCompleteModel payload, out string messag
sbResult.AppendLine("The purchaser information is missing. Please contact the system administrator.");
_logger.LogError($"JobOntimeEdgePurchase|ValidatePayload|payload is missing.");
}

if (string.IsNullOrEmpty(payload.CheckoutUser?.FirstName))
{
sbResult.AppendLine("First Name is required.");
Expand Down Expand Up @@ -231,7 +235,7 @@ private async Task GenerateNotifyEmailHTML(MarketplaceItemSimpleModel marketplac
}
*/
var title = isSuccess ? "Purchase Fulfillment Submitted Successfully" : "Purchase Fulfillment Failed";

//generate email body
System.Text.StringBuilder sbBody = new System.Text.StringBuilder();
sbBody.AppendLine("<div class='row mb-2'>");
Expand Down

0 comments on commit b877f91

Please sign in to comment.