Skip to content

Commit

Permalink
Merge pull request #25 from DRJTechnology/Development
Browse files Browse the repository at this point in the history
Moving NLog changes to main
  • Loading branch information
DRJTechnology authored Dec 14, 2023
2 parents 6bfac52 + c7ecf6e commit e3fbbb1
Show file tree
Hide file tree
Showing 43 changed files with 1,046 additions and 675 deletions.
20 changes: 3 additions & 17 deletions .github/workflows/azure-webapps-dotnet-core.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
# This workflow will build and push a .NET Core app to an Azure Web App when a commit is pushed to your default branch.
#
# This workflow assumes you have already created the target Azure App Service web app.
# For instructions see https://docs.microsoft.com/en-us/azure/app-service/quickstart-dotnetcore?tabs=net60&pivots=development-environment-vscode
#
# To configure this workflow:
#
# 1. Download the Publish Profile for your Azure Web App. You can download this file from the Overview page of your Web App in the Azure Portal.
# For more information: https://docs.microsoft.com/en-us/azure/app-service/deploy-github-actions?tabs=applevel#generate-deployment-credentials
#
# 2. Create a secret in your repository named AZURE_WEBAPP_PUBLISH_PROFILE, paste the publish profile contents as the value of the secret.
# For instructions on obtaining the publish profile see: https://docs.microsoft.com/azure/app-service/deploy-github-actions#configure-the-github-secret
#
# 3. Change the value for the AZURE_WEBAPP_NAME. Optionally, change the AZURE_WEBAPP_PACKAGE_PATH and DOTNET_VERSION environment variables below.
#
# For more information on GitHub Actions for Azure: https://github.com/Azure/Actions
# For more information on the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# For more samples to get started with GitHub Action workflows to deploy to Azure: https://github.com/Azure/actions-workflow-samples

name: Build and deploy ASP.Net Core app to an Azure Web App

Expand Down Expand Up @@ -73,11 +57,13 @@ jobs:
AzureAd.Scopes: ${{ secrets.AZUREAD_SCOPES }}
AzureAd.CallbackPath: ${{ secrets.AZUREAD_CALLBACKPATH }}
AzureAd.ClientSecret: ${{ secrets.AZUREAD_CLIENTSECRET }}
DRJCache.ConnectionString: ${{ secrets.DRJCACHE_CONNECTIONSTRING }}
DRJCache.ConnectionString: ${{ secrets.REDIS_CONNECTIONSTRING }}
DRJCache.KeyPrefix: ${{ secrets.DRJCACHE_KEYPREFIX }}
ConnectionStrings.PpmDatabaseConnectionString: ${{ secrets.CONNECTIONSTRINGS_PPMDATABASECONNECTIONSTRING }}
ConnectionStrings.Redis: ${{ secrets.REDIS_CONNECTIONSTRING }}
Settings.SharepointSettings.SiteId: ${{ secrets.SETTINGS_SHAREPOINTSETTINGS_SITEID }}
Settings.SharepointSettings.DriveId: ${{ secrets.SETTINGS_SHAREPOINTSETTINGS_DRIVEID }}
NLog.targets.database.connectionString: ${{ secrets.CONNECTIONSTRINGS_PPMDATABASECONNECTIONSTRING }}

- name: Upload artifact for deployment job
uses: actions/upload-artifact@v3
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dataworkspace.excludedProjects": [
"PropertyPortfolioManager.Database.sqlproj"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@
<SSDTExists Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets')">True</SSDTExists>
<VisualStudioVersion Condition="'$(SSDTExists)' == ''">11.0</VisualStudioVersion>
</PropertyGroup>
<Import Condition="'$(SQLDBExtensionsRefPath)' != ''" Project="$(SQLDBExtensionsRefPath)\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
<Import Condition="'$(SQLDBExtensionsRefPath)' == ''" Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
<Import Condition="'$(NetCoreBuild)' != 'true' AND '$(SQLDBExtensionsRefPath)' != ''" Project="$(SQLDBExtensionsRefPath)\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
<Import Condition="'$(NetCoreBuild)' != 'true' AND '$(SQLDBExtensionsRefPath)' == ''" Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
<ItemGroup>
<Folder Include="Properties" />
<Folder Include="Security\" />
<Folder Include="Stored Procedures" />
<Folder Include="Stored Procedures\dbo" />
<Folder Include="Tables" />
<Folder Include="Tables\dbo" />
<Folder Include="Tables\general" />
<Folder Include="Tables\profile" />
<Folder Include="Tables\property" />
Expand All @@ -75,6 +77,10 @@
</ItemGroup>
<ItemGroup>
<Build Include="Security\db_executor.sql" />
<Build Include="Security\ppm-user-dev.sql" />
<Build Include="Stored Procedures\dbo\InsertAppLog.sql" />
<Build Include="Tables\dbo\AppLog.sql" />
<Build Include="Tables\dbo\CombinedAccounts.sql" />
<Build Include="Tables\general\Address.sql" />
<Build Include="Tables\profile\User.sql" />
<Build Include="Tables\property\Portfolio.sql" />
Expand Down Expand Up @@ -157,4 +163,14 @@
<ItemGroup>
<RefactorLog Include="PropertyPortfolioManager.Database.refactorlog" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Condition="'$(NetCoreBuild)' == 'true'">
<Version>1.0.0</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
<Import Project="$(NETCoreTargetsPath)\Microsoft.Data.Tools.Schema.SqlTasks.targets" Condition="'$(NetCoreBuild)' == 'true'" />
<Target Name="BeforeBuild">
<Delete Files="$(BaseIntermediateOutputPath)\project.assets.json" />
</Target>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<Name>PropertyPortfolioManager.Database</Name>
<SchemaVersion>2.0</SchemaVersion>
<ProjectVersion>4.1</ProjectVersion>
<ProjectGuid>{05deb012-55a2-44c0-a464-637412f4d858}</ProjectGuid>
<DSP>Microsoft.Data.Tools.Schema.Sql.Sql130DatabaseSchemaProvider</DSP>
<OutputType>Database</OutputType>
<RootPath>
</RootPath>
<RootNamespace>PropertyPortfolioManager.Database</RootNamespace>
<AssemblyName>PropertyPortfolioManager.Database</AssemblyName>
<ModelCollation>1033,CI</ModelCollation>
<DefaultFileStructure>BySchemaAndSchemaType</DefaultFileStructure>
<DeployToDatabase>True</DeployToDatabase>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetLanguage>CS</TargetLanguage>
<AppDesignerFolder>Properties</AppDesignerFolder>
<SqlServerVerification>False</SqlServerVerification>
<IncludeCompositeObjects>True</IncludeCompositeObjects>
<TargetDatabaseSet>True</TargetDatabaseSet>
<DefaultCollation>Latin1_General_CI_AS</DefaultCollation>
<DefaultFilegroup>PRIMARY</DefaultFilegroup>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>bin\Release\</OutputPath>
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>bin\Debug\</OutputPath>
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
<!-- Default to the v11.0 targets path if the targets file for the current VS version is not found -->
<SSDTExists Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets')">True</SSDTExists>
<VisualStudioVersion Condition="'$(SSDTExists)' == ''">11.0</VisualStudioVersion>
</PropertyGroup>
<Import Condition="'$(SQLDBExtensionsRefPath)' != ''" Project="$(SQLDBExtensionsRefPath)\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
<Import Condition="'$(SQLDBExtensionsRefPath)' == ''" Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
<ItemGroup>
<Folder Include="Properties" />
<Folder Include="Security\" />
<Folder Include="Stored Procedures" />
<Folder Include="Tables" />
<Folder Include="Tables\general" />
<Folder Include="Tables\profile" />
<Folder Include="Tables\property" />
<Folder Include="Scripts" />
<Folder Include="Stored Procedures\property" />
<Folder Include="Stored Procedures\profile" />
<Folder Include="Stored Procedures\general" />
<Folder Include="Tables\finance" />
<Folder Include="Stored Procedures\finance" />
<Folder Include="Snapshots" />
<Folder Include="Schemas" />
</ItemGroup>
<ItemGroup>
<Build Include="Security\db_executor.sql" />
<Build Include="Tables\general\Address.sql" />
<Build Include="Tables\profile\User.sql" />
<Build Include="Tables\property\Portfolio.sql" />
<Build Include="Tables\property\Unit.sql" />
<Build Include="Tables\property\UnitType.sql" />
<Build Include="Stored Procedures\property\Unit_Create.sql" />
<Build Include="Stored Procedures\property\Unit_GetAll.sql" />
<Build Include="Stored Procedures\property\Unit_GetById.sql" />
<Build Include="Stored Procedures\property\Unit_Update.sql" />
<Build Include="Stored Procedures\property\UnitType_GetAll.sql" />
<Build Include="Stored Procedures\property\UnitType_Update.sql" />
<Build Include="Stored Procedures\property\UnitType_Create.sql" />
<Build Include="Stored Procedures\property\UnitType_GetById.sql" />
<Build Include="Stored Procedures\property\Portfolio_Initialise.sql" />
<Build Include="Tables\property\PortfolioUser.sql" />
<Build Include="Stored Procedures\profile\User_Create.sql" />
<Build Include="Stored Procedures\profile\User_GetByObjectIdentifier.sql" />
<Build Include="Stored Procedures\property\Portfolio_AddUser.sql" />
<Build Include="Stored Procedures\property\Portfolio_GetAll.sql" />
<Build Include="Stored Procedures\property\Portfolio_Create.sql" />
<Build Include="Stored Procedures\property\Portfolio_GetById.sql" />
<Build Include="Stored Procedures\property\Portfolio_Update.sql" />
<Build Include="Stored Procedures\property\Portfolio_GetByUserObjectIdentifier.sql" />
<Build Include="Stored Procedures\property\Portfolio_SelectForUser.sql" />
<Build Include="Tables\general\ContactType.sql" />
<Build Include="Tables\general\Contact.sql" />
<Build Include="Stored Procedures\general\ContactType_Create.sql" />
<Build Include="Stored Procedures\general\ContactType_GetAll.sql" />
<Build Include="Stored Procedures\general\ContactType_GetById.sql" />
<Build Include="Stored Procedures\general\ContactType_Update.sql" />
<Build Include="Tables\general\ContactContactType.sql" />
<Build Include="Stored Procedures\general\Contact_Create.sql" />
<Build Include="Stored Procedures\general\Contact_GetAll.sql" />
<Build Include="Stored Procedures\general\Contact_GetById.sql" />
<Build Include="Stored Procedures\general\Contact_Update.sql" />
<Build Include="Stored Procedures\property\Portfolio_Delete.sql" />
<Build Include="Stored Procedures\general\ContactType_Delete.sql" />
<Build Include="Stored Procedures\property\UnitType_Delete.sql" />
<Build Include="Stored Procedures\property\Unit_Delete.sql" />
<Build Include="Tables\general\File.sql" />
<Build Include="Stored Procedures\general\GetFileIdFromItemId.sql" />
<Build Include="Tables\property\Tenancy.sql" />
<Build Include="Tables\property\TenancyType.sql" />
<Build Include="Stored Procedures\property\TenancyType_Create.sql" />
<Build Include="Stored Procedures\property\TenancyType_Delete.sql" />
<Build Include="Stored Procedures\property\TenancyType_GetAll.sql" />
<Build Include="Stored Procedures\property\TenancyType_GetById.sql" />
<Build Include="Stored Procedures\property\TenancyType_Update.sql" />
<Build Include="Stored Procedures\property\Tenancy_Create.sql" />
<Build Include="Stored Procedures\property\Tenancy_Delete.sql" />
<Build Include="Stored Procedures\property\Tenancy_GetAll.sql" />
<Build Include="Stored Procedures\property\Tenancy_GetById.sql" />
<Build Include="Stored Procedures\property\Tenancy_Update.sql" />
<Build Include="Stored Procedures\general\Contact_GetAllWithType.sql" />
<Build Include="Tables\property\TenancyContact.sql" />
<Build Include="Stored Procedures\property\Tenancy_RemoveContact.sql" />
<Build Include="Stored Procedures\property\Tenancy_AddContact.sql" />
<Build Include="Tables\finance\AccountType.sql" />
<Build Include="Tables\finance\Account.sql" />
<Build Include="Tables\finance\Transaction.sql" />
<Build Include="Stored Procedures\finance\Account_Create.sql" />
<Build Include="Stored Procedures\finance\Account_GetAll.sql" />
<Build Include="Stored Procedures\finance\Account_GetById.sql" />
<Build Include="Stored Procedures\finance\Account_Update.sql" />
<Build Include="Security\ppm-user.sql" />
<Build Include="Schemas\finance.sql" />
<Build Include="Schemas\general.sql" />
<Build Include="Schemas\profile.sql" />
<Build Include="Schemas\property.sql" />
<Build Include="Stored Procedures\finance\AccountType_GetAll.sql" />
<Build Include="Stored Procedures\finance\Account_Delete.sql" />
<Build Include="Tables\finance\TransactionType.sql" />
<Build Include="Tables\finance\TransactionDetail.sql" />
<Build Include="Stored Procedures\finance\TransactionDetail_Get.sql" />
<Build Include="Stored Procedures\finance\TransactionType_GetAll.sql" />
</ItemGroup>
<ItemGroup>
<None Include="Scripts\InitialiseData.sql" />
</ItemGroup>
<ItemGroup>
<RefactorLog Include="PropertyPortfolioManager.Database.refactorlog" />
</ItemGroup>
</Project>
12 changes: 8 additions & 4 deletions src/PropertyPortfolioManager.Database/Security/db_executor.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
--CREATE ROLE [db_executor]
-- AUTHORIZATION [dbo];
-- CREATE ROLE [db_executor]
-- AUTHORIZATION [dbo];
-- GO

--GO
--ALTER ROLE [db_executor] ADD MEMBER [ppm-user];
-- ALTER ROLE [db_executor] ADD MEMBER [ppm-user];
-- GO

-- ALTER ROLE [db_executor] ADD MEMBER [ppm-user-dev];
-- GO

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--CREATE USER [ppm-user-dev] FOR LOGIN [ppm-user-dev];
--GO

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
CREATE procedure [dbo].[InsertAppLog]
(
@Addeddate datetime,
@Level nvarchar(50),
@Message nvarchar(max),
@StackTrace nvarchar(max),
@Logger nvarchar(255),
@Exception nvarchar(max),
@RequestUrl nvarchar(255),
@RequestType nvarchar(10)
)
as

INSERT INTO [dbo].[AppLog]
([AddedDate]
,[Level]
,[Message]
,[StackTrace]
,[Logger]
,[Exception]
,[RequestUrl]
,[RequestType])
VALUES
(
@Addeddate,
@Level,
@Message,
@StackTrace,
@Logger,
@Exception,
@RequestUrl,
@RequestType
)
GO

14 changes: 14 additions & 0 deletions src/PropertyPortfolioManager.Database/Tables/dbo/AppLog.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CREATE TABLE [dbo].[AppLog] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[AddedDate] DATETIME NOT NULL,
[Level] NVARCHAR (10) NULL,
[Message] NVARCHAR (MAX) NULL,
[StackTrace] NVARCHAR (MAX) NULL,
[Exception] NVARCHAR (MAX) NULL,
[Logger] NVARCHAR (255) NULL,
[RequestUrl] NVARCHAR (255) NULL,
[RequestType] NVARCHAR (10) NULL,
PRIMARY KEY CLUSTERED ([Id] ASC)
);
GO

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
CREATE TABLE [dbo].[CombinedAccounts] (
[Date] DATE NOT NULL,
[Transaction_ID] SMALLINT NOT NULL,
[Ledger] NVARCHAR (250) NOT NULL,
[Description] NVARCHAR (4000) NOT NULL,
[Reference] NVARCHAR (250) NULL,
[Property] NVARCHAR (250) NULL,
[Room] NVARCHAR (1) NULL,
[Debit] MONEY NULL,
[Credit] MONEY NULL,
[Balance] MONEY NOT NULL,
[Original_Order] SMALLINT NOT NULL,
[selected] NVARCHAR (1) NULL
);
GO

Loading

0 comments on commit e3fbbb1

Please sign in to comment.