Skip to content

Commit

Permalink
Merge pull request #159 from loresoft/develop
Browse files Browse the repository at this point in the history
deploy to production
  • Loading branch information
pwelter34 authored Apr 11, 2023
2 parents 950c427 + 2fe485f commit 7509a4b
Show file tree
Hide file tree
Showing 547 changed files with 25,347 additions and 24,884 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,11 @@ end_of_line = crlf
[*.sh]
end_of_line = lf

[*.{cs,vb}]
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = true
dotnet_style_namespace_match_folder = true

[*.cs]
csharp_using_directive_placement = outside_namespace
csharp_style_namespace_declarations = file_scoped:warning
4 changes: 2 additions & 2 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,15 @@ jobs:

- name: Deploy SQL Server Database to Azure Staging
if: github.ref == 'refs/heads/develop'
uses: azure/sql-action@v2
uses: azure/sql-action@v2.1
with:
connection-string: ${{secrets.AZURE_SQL_CONNECTION_STAGING}}
path: './InstructorIQ.dacpac'
action: 'publish'

- name: Deploy SQL Server Database to Azure Production
if: github.ref == 'refs/heads/master'
uses: azure/sql-action@v2
uses: azure/sql-action@v2.1
with:
connection-string: ${{secrets.AZURE_SQL_CONNECTION_PRODUCTION}}
path: './InstructorIQ.dacpac'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -257,3 +257,4 @@ build/
client/dist/
temp/
coverage.opencover.xml
*.clef
27 changes: 27 additions & 0 deletions service/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<Project>
<PropertyGroup Label="Package">
<Product>InstructorIQ</Product>
<Description>Training calendar manangement</Description>
<Copyright>Copyright © $([System.DateTime]::Now.ToString(yyyy)) LoreSoft</Copyright>
<Authors>LoreSoft</Authors>
<NeutralLanguage>en-US</NeutralLanguage>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageProjectUrl>https://github.com/loresoft/InstructorIQ</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIcon>logo.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/loresoft/InstructorIQ</RepositoryUrl>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<NoWarn>1591</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="Injectio" Version="2.5.87" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<Using Include="Injectio.Attributes" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions service/InstructorIQ.sln
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InstructorIQ.WebApplication
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{64DEECE6-F644-428A-9094-3729E6A74698}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
..\.github\workflows\dotnet.yml = ..\.github\workflows\dotnet.yml
EndProjectSection
EndProject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@

using Microsoft.Extensions.Logging;

namespace InstructorIQ.Core.Behaviors
namespace InstructorIQ.Core.Behaviors;

public class AuthenticateEntityIdentifierCommandBehavior<TKey, TReadModel>
: PipelineBehaviorBase<EntityIdentifierCommand<TKey, TReadModel>, TReadModel>
{
public class AuthenticateEntityIdentifierCommandBehavior<TKey, TReadModel>
: PipelineBehaviorBase<EntityIdentifierCommand<TKey, TReadModel>, TReadModel>
public AuthenticateEntityIdentifierCommandBehavior(ILoggerFactory loggerFactory) : base(loggerFactory)
{
public AuthenticateEntityIdentifierCommandBehavior(ILoggerFactory loggerFactory) : base(loggerFactory)
{
}
}

protected override async Task<TReadModel> Process(EntityIdentifierCommand<TKey, TReadModel> request, RequestHandlerDelegate<TReadModel> next, CancellationToken cancellationToken)
{
// continue pipeline
return await next().ConfigureAwait(false);
}
protected override async Task<TReadModel> Process(EntityIdentifierCommand<TKey, TReadModel> request, RequestHandlerDelegate<TReadModel> next, CancellationToken cancellationToken)
{
// continue pipeline
return await next().ConfigureAwait(false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,19 @@

using Microsoft.Extensions.Logging;

namespace InstructorIQ.Core.Behaviors
namespace InstructorIQ.Core.Behaviors;

public class TrackChangeEntityPatchCommandBehavior<TKey, TReadModel>
: PipelineBehaviorBase<EntityPatchCommand<TKey, TReadModel>, TReadModel>
{
public class TrackChangeEntityPatchCommandBehavior<TKey, TReadModel>
: PipelineBehaviorBase<EntityPatchCommand<TKey, TReadModel>, TReadModel>
public TrackChangeEntityPatchCommandBehavior(ILoggerFactory loggerFactory) : base(loggerFactory)
{
public TrackChangeEntityPatchCommandBehavior(ILoggerFactory loggerFactory) : base(loggerFactory)
{
}

protected override async Task<TReadModel> Process(EntityPatchCommand<TKey, TReadModel> request, RequestHandlerDelegate<TReadModel> next, CancellationToken cancellationToken)
{
// continue pipeline
return await next().ConfigureAwait(false);
}
}

protected override async Task<TReadModel> Process(EntityPatchCommand<TKey, TReadModel> request, RequestHandlerDelegate<TReadModel> next, CancellationToken cancellationToken)
{
// continue pipeline
return await next().ConfigureAwait(false);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@

using Microsoft.Extensions.Logging;

namespace InstructorIQ.Core.Behaviors
namespace InstructorIQ.Core.Behaviors;

public class TrackChangeEntityUpdateCommandBehavior<TKey, TUpdateModel, TReadModel>
: PipelineBehaviorBase<EntityUpdateCommand<TKey, TUpdateModel, TReadModel>, TReadModel>
{
public class TrackChangeEntityUpdateCommandBehavior<TKey, TUpdateModel, TReadModel>
: PipelineBehaviorBase<EntityUpdateCommand<TKey, TUpdateModel, TReadModel>, TReadModel>
public TrackChangeEntityUpdateCommandBehavior(ILoggerFactory loggerFactory) : base(loggerFactory)
{
public TrackChangeEntityUpdateCommandBehavior(ILoggerFactory loggerFactory) : base(loggerFactory)
{
}
}

protected override async Task<TReadModel> Process(EntityUpdateCommand<TKey, TUpdateModel, TReadModel> request, RequestHandlerDelegate<TReadModel> next, CancellationToken cancellationToken)
{
// continue pipeline
return await next().ConfigureAwait(false);
}
protected override async Task<TReadModel> Process(EntityUpdateCommand<TKey, TUpdateModel, TReadModel> request, RequestHandlerDelegate<TReadModel> next, CancellationToken cancellationToken)
{
// continue pipeline
return await next().ConfigureAwait(false);
}
}
25 changes: 12 additions & 13 deletions service/src/InstructorIQ.Core/Converters/TimeSpanConverter.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
using System;
using System;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace InstructorIQ.Core.Converters
namespace InstructorIQ.Core.Converters;

public class TimeSpanConverter : JsonConverter<TimeSpan>
{
public class TimeSpanConverter : JsonConverter<TimeSpan>
public override TimeSpan Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
public override TimeSpan Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var stringValue = reader.GetString();
return TimeSpan.Parse(stringValue);
}
var stringValue = reader.GetString();
return TimeSpan.Parse(stringValue);
}

public override void Write(Utf8JsonWriter writer, TimeSpan value, JsonSerializerOptions options)
{
var stringValue = value.ToString();
writer.WriteStringValue(stringValue);
}
public override void Write(Utf8JsonWriter writer, TimeSpan value, JsonSerializerOptions options)
{
var stringValue = value.ToString();
writer.WriteStringValue(stringValue);
}
}
35 changes: 17 additions & 18 deletions service/src/InstructorIQ.Core/Data/Constants/Role.cs
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
using System;
using System;

namespace InstructorIQ.Core.Data.Constants
namespace InstructorIQ.Core.Data.Constants;

public static class Role
{
public static class Role
{
///<summary>Member for organization</summary>
public static readonly Guid Member = new Guid("d373fbb2-39eb-e711-87c1-708bcd56aa6d");
///<summary>User that can attend sessions</summary>
public static readonly Guid Attendee = new Guid("d9fb92e7-a5e8-4fe3-86ba-16924e44fb86");
///<summary>Instructor for organization</summary>
public static readonly Guid Instructor = new Guid("808c0ec0-39eb-e711-87c1-708bcd56aa6d");
///<summary>Administrator for organization</summary>
public static readonly Guid Administrator = new Guid("8fa6aec8-39eb-e711-87c1-708bcd56aa6d");
///<summary>Member for organization</summary>
public static readonly Guid Member = new Guid("d373fbb2-39eb-e711-87c1-708bcd56aa6d");
///<summary>User that can attend sessions</summary>
public static readonly Guid Attendee = new Guid("d9fb92e7-a5e8-4fe3-86ba-16924e44fb86");
///<summary>Instructor for organization</summary>
public static readonly Guid Instructor = new Guid("808c0ec0-39eb-e711-87c1-708bcd56aa6d");
///<summary>Administrator for organization</summary>
public static readonly Guid Administrator = new Guid("8fa6aec8-39eb-e711-87c1-708bcd56aa6d");

public const string MemberName = "Member";
public const string AttendeeName = "Attendee";
public const string InstructorName = "Instructor";
public const string AdministratorName = "Administrator";
public const string GlobalAdministrator = "GlobalAdministrator";
public const string MemberName = "Member";
public const string AttendeeName = "Attendee";
public const string InstructorName = "Instructor";
public const string AdministratorName = "Administrator";
public const string GlobalAdministrator = "GlobalAdministrator";

}
}
11 changes: 5 additions & 6 deletions service/src/InstructorIQ.Core/Data/Constants/TemplateType.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
using System;
using System;
using System.Collections.Generic;
using System.Text;

namespace InstructorIQ.Core.Data.Constants
namespace InstructorIQ.Core.Data.Constants;

public static class TemplateType
{
public static class TemplateType
{
public const string Editor = "Editor";
}
public const string Editor = "Editor";
}
19 changes: 9 additions & 10 deletions service/src/InstructorIQ.Core/Data/Constants/Tenant.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
using System;
using System;

namespace InstructorIQ.Core.Data.Constants
namespace InstructorIQ.Core.Data.Constants;

public static class Tenant
{
public static class Tenant
{
///<summary>Test Organization</summary>
public static readonly Guid Test = new Guid("2a3080d2-a9ec-e711-87c2-708bcd56aa6d");
///<summary>Demo Organization</summary>
public static readonly Guid Demo = new Guid("e8a8db6e-2feb-e711-87c1-708bcd56aa6d");
}
}
///<summary>Test Organization</summary>
public static readonly Guid Test = new Guid("2a3080d2-a9ec-e711-87c2-708bcd56aa6d");
///<summary>Demo Organization</summary>
public static readonly Guid Demo = new Guid("e8a8db6e-2feb-e711-87c1-708bcd56aa6d");
}
19 changes: 9 additions & 10 deletions service/src/InstructorIQ.Core/Data/Constants/User.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
using System;
using System;

namespace InstructorIQ.Core.Data.Constants
namespace InstructorIQ.Core.Data.Constants;

public static class User
{
public static class User
{
///<summary>Test User</summary>
public static readonly System.Guid Test = new Guid("52ae0c20-c4de-e711-87bf-708bcd56aa6d");
///<summary>InstructorIQ Support</summary>
public static readonly System.Guid Support = new Guid("2a31eec5-30eb-e711-87c1-708bcd56aa6d");
}
}
///<summary>Test User</summary>
public static readonly System.Guid Test = new Guid("52ae0c20-c4de-e711-87bf-708bcd56aa6d");
///<summary>InstructorIQ Support</summary>
public static readonly System.Guid Support = new Guid("2a31eec5-30eb-e711-87c1-708bcd56aa6d");
}
37 changes: 18 additions & 19 deletions service/src/InstructorIQ.Core/Data/DataServiceModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,28 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;

namespace InstructorIQ.Core.Data
namespace InstructorIQ.Core.Data;

public class DataServiceModule
{
public class DataServiceModule
{

[RegisterServices]
public void Register(IServiceCollection services)
[RegisterServices]
public void Register(IServiceCollection services)
{
services.AddDbContextPool<InstructorIQContext>((provider, options) =>
{
services.AddDbContextPool<InstructorIQContext>((provider, options) =>
{
var configuration = provider.GetRequiredService<IConfiguration>();
var connectionString = configuration.GetConnectionString("InstructorIQ");
options.UseSqlServer(connectionString, providerOptions => providerOptions.EnableRetryOnFailure());
});
var configuration = provider.GetRequiredService<IConfiguration>();
var connectionString = configuration.GetConnectionString("InstructorIQ");
options.UseSqlServer(connectionString, providerOptions => providerOptions.EnableRetryOnFailure());
});

services.TryAddSingleton<IDataConfiguration>(provider =>
{
var configuration = provider.GetRequiredService<IConfiguration>();
var connectionString = configuration.GetConnectionString("InstructorIQ");
return new DataConfiguration(SqlClientFactory.Instance, connectionString);
});
services.TryAddSingleton<IDataConfiguration>(provider =>
{
var configuration = provider.GetRequiredService<IConfiguration>();
var connectionString = configuration.GetConnectionString("InstructorIQ");
return new DataConfiguration(SqlClientFactory.Instance, connectionString);
});

services.TryAddTransient<IDataSession, DataSession>();
}
services.TryAddTransient<IDataSession, DataSession>();
}
}
Loading

0 comments on commit 7509a4b

Please sign in to comment.