commit 0ecba9619f479194d310ec1ca488440da23091e9 Author: 张兆鑫 Date: Mon Sep 8 14:15:45 2025 +0800 first commit diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..c941e52 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +**/wwwroot/libs/** linguist-vendored diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e1e932f --- /dev/null +++ b/.gitignore @@ -0,0 +1,265 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# Admin +src/KonSoft.Admin.Web/Logs/* +src/KonSoft.Admin.Web.Host/Logs/* +src/KonSoft.Admin.AuthServer/Logs/* +src/KonSoft.Admin.HttpApi.Host/Logs/* +src/KonSoft.Admin.HttpApi.Host/Logs/* +src/KonSoft.Admin.DbMigrator/Logs/* +src/KonSoft.Admin.Blazor.Server/Logs/* +src/KonSoft.Admin.Blazor.Server.Tiered/Logs/* + +# Use abp install-libs to restore. +**/wwwroot/libs/* diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..56af76b --- /dev/null +++ b/.prettierrc @@ -0,0 +1,5 @@ +{ + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 +} diff --git a/KonSoft.sln b/KonSoft.sln new file mode 100644 index 0000000..7115e4f --- /dev/null +++ b/KonSoft.sln @@ -0,0 +1,139 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36414.22 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "applications", "applications", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gateways", "gateways", "{C5AC3FEE-4315-4D82-A142-5068D5A6DD73}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "microservices", "microservices", "{4CBFE8AF-968B-453D-B763-3D0437C0883D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "modules", "modules", "{327E64CE-CB3C-480A-AB52-816B8A5329B6}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "shared", "shared", "{7EFFD2C6-2041-4967-A715-0F817D70C433}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KonSoft.AuthServer", "applications\KonSoft.AuthServer\KonSoft.AuthServer.csproj", "{D02078B5-294E-DA0D-DD69-46FDEFBD76F9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KonSoft.InternalGateway", "gateways\KonSoft.InternalGateway\KonSoft.InternalGateway.csproj", "{14E3D6EA-528D-4983-9EC8-77FEE4BC2FED}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KonSoft.PublicGateway", "gateways\KonSoft.PublicGateway\KonSoft.PublicGateway.csproj", "{AEBC7053-743F-4F80-BD10-8ED6A8A7B3EE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KonSoft.Admin.HttpApi.Host", "microservices\KonSoft.Admin.HttpApi.Host\KonSoft.Admin.HttpApi.Host.csproj", "{97BC949A-9142-B129-10FE-0D9381A49C05}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KonSoft.Dispatch.HttpApi.Host", "microservices\KonSoft.Dispatch.HttpApi.Host\KonSoft.Dispatch.HttpApi.Host.csproj", "{D422C785-D6D0-8F6B-A6C3-2B0E5497B923}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KonSoft.Payment.HttpApi.Host", "microservices\KonSoft.Payment.HttpApi.Host\KonSoft.Payment.HttpApi.Host.csproj", "{9A034977-0FBC-A3C8-8432-9FDD073F215A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KonSoft.Report.HttpApi.Host", "microservices\KonSoft.Report.HttpApi.Host\KonSoft.Report.HttpApi.Host.csproj", "{1C89424B-DA16-8840-4AB0-C446CFBD634C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KonSoft.TenantManagement.HttpApi.Host", "microservices\KonSoft.TenantManagement.HttpApi.Host\KonSoft.TenantManagement.HttpApi.Host.csproj", "{3641CA05-99C5-2245-C663-6CE00730E87C}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "admin", "admin", "{A53664DF-71AE-4C8E-A2DC-A60605FDF57C}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dispatch", "dispatch", "{75A22B51-A986-48BD-A633-383DA18DE644}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "payment", "payment", "{244E1153-5BE5-4DC2-BA9D-2988BA25F208}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "report", "report", "{AAF02051-771B-4CC0-BD17-1A3643F83E09}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tenant-management", "tenant-management", "{CF59695F-7948-4743-A467-42E4B4C9EECA}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{EBCB740D-07E7-4CED-A422-90EB824B9021}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{68C52E9A-2894-4F56-B121-EBDEB8AEE5FE}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{9EDB9917-F429-447B-915D-7D51D38DB33E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{73DCA9DB-1A3D-449F-8957-924B2CF8B7B1}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B93EB51F-E75E-4735-8BC8-382015B4DBD5}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{026D8210-9B71-4296-9DD8-D4E178802E4D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{7FEC24C5-6DA6-4844-B409-0361AB1C192C}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{6C762F40-30BB-4CDA-951B-01D45F7C2B53}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{E67FA5C3-132C-4F47-B6A6-8FA4376C70BB}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{1C06151A-45F0-4D48-8303-3D4CBE9517F7}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KonSoft.Shared", "shared\KonSoft.Shared\KonSoft.Shared.csproj", "{345B5CDA-DC77-4956-BF96-80707EC1B5B2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D02078B5-294E-DA0D-DD69-46FDEFBD76F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D02078B5-294E-DA0D-DD69-46FDEFBD76F9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D02078B5-294E-DA0D-DD69-46FDEFBD76F9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D02078B5-294E-DA0D-DD69-46FDEFBD76F9}.Release|Any CPU.Build.0 = Release|Any CPU + {14E3D6EA-528D-4983-9EC8-77FEE4BC2FED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {14E3D6EA-528D-4983-9EC8-77FEE4BC2FED}.Debug|Any CPU.Build.0 = Debug|Any CPU + {14E3D6EA-528D-4983-9EC8-77FEE4BC2FED}.Release|Any CPU.ActiveCfg = Release|Any CPU + {14E3D6EA-528D-4983-9EC8-77FEE4BC2FED}.Release|Any CPU.Build.0 = Release|Any CPU + {AEBC7053-743F-4F80-BD10-8ED6A8A7B3EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AEBC7053-743F-4F80-BD10-8ED6A8A7B3EE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AEBC7053-743F-4F80-BD10-8ED6A8A7B3EE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AEBC7053-743F-4F80-BD10-8ED6A8A7B3EE}.Release|Any CPU.Build.0 = Release|Any CPU + {97BC949A-9142-B129-10FE-0D9381A49C05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {97BC949A-9142-B129-10FE-0D9381A49C05}.Debug|Any CPU.Build.0 = Debug|Any CPU + {97BC949A-9142-B129-10FE-0D9381A49C05}.Release|Any CPU.ActiveCfg = Release|Any CPU + {97BC949A-9142-B129-10FE-0D9381A49C05}.Release|Any CPU.Build.0 = Release|Any CPU + {D422C785-D6D0-8F6B-A6C3-2B0E5497B923}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D422C785-D6D0-8F6B-A6C3-2B0E5497B923}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D422C785-D6D0-8F6B-A6C3-2B0E5497B923}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D422C785-D6D0-8F6B-A6C3-2B0E5497B923}.Release|Any CPU.Build.0 = Release|Any CPU + {9A034977-0FBC-A3C8-8432-9FDD073F215A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9A034977-0FBC-A3C8-8432-9FDD073F215A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9A034977-0FBC-A3C8-8432-9FDD073F215A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9A034977-0FBC-A3C8-8432-9FDD073F215A}.Release|Any CPU.Build.0 = Release|Any CPU + {1C89424B-DA16-8840-4AB0-C446CFBD634C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1C89424B-DA16-8840-4AB0-C446CFBD634C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1C89424B-DA16-8840-4AB0-C446CFBD634C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1C89424B-DA16-8840-4AB0-C446CFBD634C}.Release|Any CPU.Build.0 = Release|Any CPU + {3641CA05-99C5-2245-C663-6CE00730E87C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3641CA05-99C5-2245-C663-6CE00730E87C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3641CA05-99C5-2245-C663-6CE00730E87C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3641CA05-99C5-2245-C663-6CE00730E87C}.Release|Any CPU.Build.0 = Release|Any CPU + {345B5CDA-DC77-4956-BF96-80707EC1B5B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {345B5CDA-DC77-4956-BF96-80707EC1B5B2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {345B5CDA-DC77-4956-BF96-80707EC1B5B2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {345B5CDA-DC77-4956-BF96-80707EC1B5B2}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {D02078B5-294E-DA0D-DD69-46FDEFBD76F9} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} + {14E3D6EA-528D-4983-9EC8-77FEE4BC2FED} = {C5AC3FEE-4315-4D82-A142-5068D5A6DD73} + {AEBC7053-743F-4F80-BD10-8ED6A8A7B3EE} = {C5AC3FEE-4315-4D82-A142-5068D5A6DD73} + {97BC949A-9142-B129-10FE-0D9381A49C05} = {4CBFE8AF-968B-453D-B763-3D0437C0883D} + {D422C785-D6D0-8F6B-A6C3-2B0E5497B923} = {4CBFE8AF-968B-453D-B763-3D0437C0883D} + {9A034977-0FBC-A3C8-8432-9FDD073F215A} = {4CBFE8AF-968B-453D-B763-3D0437C0883D} + {1C89424B-DA16-8840-4AB0-C446CFBD634C} = {4CBFE8AF-968B-453D-B763-3D0437C0883D} + {3641CA05-99C5-2245-C663-6CE00730E87C} = {4CBFE8AF-968B-453D-B763-3D0437C0883D} + {A53664DF-71AE-4C8E-A2DC-A60605FDF57C} = {327E64CE-CB3C-480A-AB52-816B8A5329B6} + {75A22B51-A986-48BD-A633-383DA18DE644} = {327E64CE-CB3C-480A-AB52-816B8A5329B6} + {244E1153-5BE5-4DC2-BA9D-2988BA25F208} = {327E64CE-CB3C-480A-AB52-816B8A5329B6} + {AAF02051-771B-4CC0-BD17-1A3643F83E09} = {327E64CE-CB3C-480A-AB52-816B8A5329B6} + {CF59695F-7948-4743-A467-42E4B4C9EECA} = {327E64CE-CB3C-480A-AB52-816B8A5329B6} + {EBCB740D-07E7-4CED-A422-90EB824B9021} = {A53664DF-71AE-4C8E-A2DC-A60605FDF57C} + {68C52E9A-2894-4F56-B121-EBDEB8AEE5FE} = {A53664DF-71AE-4C8E-A2DC-A60605FDF57C} + {9EDB9917-F429-447B-915D-7D51D38DB33E} = {75A22B51-A986-48BD-A633-383DA18DE644} + {73DCA9DB-1A3D-449F-8957-924B2CF8B7B1} = {75A22B51-A986-48BD-A633-383DA18DE644} + {B93EB51F-E75E-4735-8BC8-382015B4DBD5} = {244E1153-5BE5-4DC2-BA9D-2988BA25F208} + {026D8210-9B71-4296-9DD8-D4E178802E4D} = {244E1153-5BE5-4DC2-BA9D-2988BA25F208} + {7FEC24C5-6DA6-4844-B409-0361AB1C192C} = {AAF02051-771B-4CC0-BD17-1A3643F83E09} + {6C762F40-30BB-4CDA-951B-01D45F7C2B53} = {AAF02051-771B-4CC0-BD17-1A3643F83E09} + {E67FA5C3-132C-4F47-B6A6-8FA4376C70BB} = {CF59695F-7948-4743-A467-42E4B4C9EECA} + {1C06151A-45F0-4D48-8303-3D4CBE9517F7} = {CF59695F-7948-4743-A467-42E4B4C9EECA} + {345B5CDA-DC77-4956-BF96-80707EC1B5B2} = {7EFFD2C6-2041-4967-A715-0F817D70C433} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {28315BFD-90E7-4E14-A2EA-F3D23AF4126F} + EndGlobalSection +EndGlobal diff --git a/KonSoft.sln.DotSettings b/KonSoft.sln.DotSettings new file mode 100644 index 0000000..cb0b2c9 --- /dev/null +++ b/KonSoft.sln.DotSettings @@ -0,0 +1,23 @@ + + True + WARNING + WARNING + WARNING + WARNING + WARNING + WARNING + WARNING + WARNING + Required + Required + Required + Required + False + True + False + False + True + False + False + SQL + \ No newline at end of file diff --git a/NuGet.Config b/NuGet.Config new file mode 100644 index 0000000..bdc4519 --- /dev/null +++ b/NuGet.Config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..8643a3c --- /dev/null +++ b/README.md @@ -0,0 +1,70 @@ +# KonSoft.Admin + +## About this solution + +This is a layered startup solution based on [Domain Driven Design (DDD)](https://abp.io/docs/latest/framework/architecture/domain-driven-design) practises. All the fundamental ABP modules are already installed. + +### Pre-requirements + +* [.NET 8.0+ SDK](https://dotnet.microsoft.com/download/dotnet) +* [Node v18 or 20](https://nodejs.org/en) +* [Redis](https://redis.io/) + +### Configurations + +The solution comes with a default configuration that works out of the box. However, you may consider to change the following configuration before running your solution: + +* Check the `ConnectionStrings` in `appsettings.json` files under the `KonSoft.Admin.AuthServer`, `KonSoft.Admin.HttpApi.Host` and `KonSoft.Admin.DbMigrator` projects and change it if you need. + +### Before running the application + +#### Generating a Signing Certificate + +In the production environment, you need to use a production signing certificate. ABP Framework sets up signing and encryption certificates in your application and expects an `openiddict.pfx` file in your application. + +This certificate is already generated by ABP CLI, so most of the time you don't need to generate it yourself. However, if you need to generate a certificate, you can use the following command: + +```bash +dotnet dev-certs https -v -ep openiddict.pfx -p dbe188cc-9b2a-4799-836b-bda7987d57b2 +``` + +> `dbe188cc-9b2a-4799-836b-bda7987d57b2` is the password of the certificate, you can change it to any password you want. + +It is recommended to use **two** RSA certificates, distinct from the certificate(s) used for HTTPS: one for encryption, one for signing. + +For more information, please refer to: https://documentation.openiddict.com/configuration/encryption-and-signing-credentials.html#registering-a-certificate-recommended-for-production-ready-scenarios + +> Also, see the [Configuring OpenIddict](https://abp.io/docs/latest/deployment/configuring-openiddict#production-environment) documentation for more information. + +#### Install Client-Side Libraries + +Run the following command in the directory of your final application: + +```bash +abp install-libs +``` + +> This command installs all NPM packages for MVC/Razor Pages and Blazor Server UIs and this command is already run by the ABP CLI, so most of the time you don't need to run this command manually. + +#### Create the Database + +Run `KonSoft.Admin.DbMigrator` to create the initial database. This should be done in the first run. It is also needed if a new database migration is added to the solution later. + +### Solution structure + +This is a layered monolith application that consists of the following applications: + +* `KonSoft.Admin.DbMigrator`: A console application which applies the migrations and also seeds the initial data. It is useful on development as well as on production environment. +* `KonSoft.Admin.AuthServer`: ASP.NET Core MVC / Razor Pages application that is integrated OAuth 2.0(`OpenIddict`) and account modules. It is used to authenticate users and issue tokens. +* `KonSoft.Admin.HttpApi.Host`: ASP.NET Core API application that is used to expose the APIs to the clients. + +### Deploying the application + +Deploying an ABP application is not different than deploying any .NET or ASP.NET Core application. However, there are some topics that you should care about when you are deploying your applications. You can check ABP's [Deployment documentation](https://abp.io/docs/latest/deployment) before deploying your application. + +### Additional resources + +You can see the following resources to learn more about your solution and the ABP Framework: + +* [Web Application Development Tutorial](https://abp.io/docs/latest/tutorials/book-store/part-01?UI=Blazor&DB=EF) +* [Application Startup Template Structure](https://abp.io/docs/latest/solution-templates/layered-web-application) diff --git a/applications/KonSoft.AuthServer/KonSoft.AuthServer.csproj b/applications/KonSoft.AuthServer/KonSoft.AuthServer.csproj new file mode 100644 index 0000000..2279469 --- /dev/null +++ b/applications/KonSoft.AuthServer/KonSoft.AuthServer.csproj @@ -0,0 +1,64 @@ + + + + + + net8.0 + enable + KonSoft + $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; + true + true + true + false + true + KonSoft-4681b4fd-151f-4221-84a4-929d86723e4c + + + + + + + + + + + + Always + + + Always + + + + + + + Always + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/applications/KonSoft.AuthServer/KonSoftAuthServerModule.cs b/applications/KonSoft.AuthServer/KonSoftAuthServerModule.cs new file mode 100644 index 0000000..e22f244 --- /dev/null +++ b/applications/KonSoft.AuthServer/KonSoftAuthServerModule.cs @@ -0,0 +1,222 @@ +using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic; +using System; +using System.IO; +using System.Linq; +using Localization.Resources.AbpUi; +using Medallion.Threading; +using Medallion.Threading.Redis; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Cors; +using Microsoft.AspNetCore.DataProtection; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using KonSoft.EntityFrameworkCore; +using KonSoft.Localization; +using KonSoft.MultiTenancy; +using StackExchange.Redis; +using Volo.Abp; +using Volo.Abp.Account; +using Volo.Abp.Account.Web; +using Volo.Abp.AspNetCore.Mvc.UI; +using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; +using Volo.Abp.AspNetCore.Serilog; +using Volo.Abp.Auditing; +using Volo.Abp.Autofac; +using Volo.Abp.BackgroundJobs; +using Volo.Abp.Caching; +using Volo.Abp.Caching.StackExchangeRedis; +using Volo.Abp.DistributedLocking; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Volo.Abp.OpenIddict; +using Volo.Abp.Security.Claims; +using Volo.Abp.UI.Navigation.Urls; +using Volo.Abp.UI; +using Volo.Abp.VirtualFileSystem; +using Volo.Abp.Account.Localization; + +namespace KonSoft; + +[DependsOn( + typeof(AbpAutofacModule), + typeof(AbpCachingStackExchangeRedisModule), + typeof(AbpDistributedLockingModule), + typeof(AbpAccountWebOpenIddictModule), + typeof(AbpAccountApplicationModule), + typeof(AbpAccountHttpApiModule), + typeof(AbpAspNetCoreMvcUiBasicThemeModule), + typeof(KonSoftEntityFrameworkCoreModule), + typeof(AbpAspNetCoreSerilogModule) + )] +public class KonSoftAuthServerModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + var hostingEnvironment = context.Services.GetHostingEnvironment(); + var configuration = context.Services.GetConfiguration(); + + PreConfigure(builder => + { + builder.AddValidation(options => + { + options.AddAudiences("KonSoft"); + options.UseLocalServer(); + options.UseAspNetCore(); + }); + }); + + if (!hostingEnvironment.IsDevelopment()) + { + PreConfigure(options => + { + options.AddDevelopmentEncryptionAndSigningCertificate = false; + }); + + PreConfigure(serverBuilder => + { + serverBuilder.AddProductionEncryptionAndSigningCertificate("openiddict.pfx", "59464dba-b66e-48cd-8b81-2e4a9c08c977"); + }); + } + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + var hostingEnvironment = context.Services.GetHostingEnvironment(); + var configuration = context.Services.GetConfiguration(); + + Configure(options => + { + options.Resources + .Get() + .AddBaseTypes( + typeof(AbpUiResource), + typeof(AccountResource) + ); + }); + + Configure(options => + { + options.StyleBundles.Configure( + BasicThemeBundles.Styles.Global, + bundle => + { + bundle.AddFiles("/global-styles.css"); + } + ); + }); + + Configure(options => + { + //options.IsEnabledForGetRequests = true; + options.ApplicationName = "AuthServer"; + }); + + if (hostingEnvironment.IsDevelopment()) + { + Configure(options => + { + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}KonSoft.Domain.Shared")); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}KonSoft.Domain")); + }); + } + + Configure(options => + { + options.Applications["MVC"].RootUrl = configuration["App:SelfUrl"]; + options.RedirectAllowedUrls.AddRange(configuration["App:RedirectAllowedUrls"]?.Split(',') ?? Array.Empty()); + + options.Applications["Angular"].RootUrl = configuration["App:ClientUrl"]; + options.Applications["Angular"].Urls[AccountUrlNames.PasswordReset] = "account/reset-password"; + }); + + Configure(options => + { + options.IsJobExecutionEnabled = false; + }); + + Configure(options => + { + options.KeyPrefix = "KonSoft:"; + }); + + var dataProtectionBuilder = context.Services.AddDataProtection().SetApplicationName("KonSoft"); + if (!hostingEnvironment.IsDevelopment()) + { + var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]!); + dataProtectionBuilder.PersistKeysToStackExchangeRedis(redis, "KonSoft-Protection-Keys"); + } + + context.Services.AddSingleton(sp => + { + var connection = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]!); + return new RedisDistributedSynchronizationProvider(connection.GetDatabase()); + }); + + context.Services.AddCors(options => + { + options.AddDefaultPolicy(builder => + { + builder + .WithOrigins( + configuration["App:CorsOrigins"]? + .Split(",", StringSplitOptions.RemoveEmptyEntries) + .Select(o => o.RemovePostFix("/")) + .ToArray() ?? Array.Empty() + ) + .WithAbpExposedHeaders() + .SetIsOriginAllowedToAllowWildcardSubdomains() + .AllowAnyHeader() + .AllowAnyMethod() + .AllowCredentials(); + }); + }); + + context.Services.Configure(options => + { + options.IsDynamicClaimsEnabled = true; + }); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + var app = context.GetApplicationBuilder(); + var env = context.GetEnvironment(); + + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.UseAbpRequestLocalization(); + + if (!env.IsDevelopment()) + { + app.UseErrorPage(); + } + + app.UseCorrelationId(); + app.UseStaticFiles(); + app.UseRouting(); + app.UseCors(); + app.UseAuthentication(); + app.UseAbpOpenIddictValidation(); + + if (MultiTenancyConsts.IsEnabled) + { + app.UseMultiTenancy(); + } + + app.UseUnitOfWork(); + app.UseDynamicClaims(); + app.UseAuthorization(); + + app.UseAuditing(); + app.UseAbpSerilogEnrichers(); + app.UseConfiguredEndpoints(); + } +} diff --git a/applications/KonSoft.AuthServer/KonSoftBrandingProvider.cs b/applications/KonSoft.AuthServer/KonSoftBrandingProvider.cs new file mode 100644 index 0000000..fd0bc22 --- /dev/null +++ b/applications/KonSoft.AuthServer/KonSoftBrandingProvider.cs @@ -0,0 +1,19 @@ +using Microsoft.Extensions.Localization; +using KonSoft.Localization; +using Volo.Abp.Ui.Branding; +using Volo.Abp.DependencyInjection; + +namespace KonSoft; + +[Dependency(ReplaceServices = true)] +public class KonSoftBrandingProvider : DefaultBrandingProvider +{ + private IStringLocalizer _localizer; + + public KonSoftBrandingProvider(IStringLocalizer localizer) + { + _localizer = localizer; + } + + public override string AppName => _localizer["AppName"]; +} diff --git a/applications/KonSoft.AuthServer/Pages/Index.cshtml b/applications/KonSoft.AuthServer/Pages/Index.cshtml new file mode 100644 index 0000000..79acd9d --- /dev/null +++ b/applications/KonSoft.AuthServer/Pages/Index.cshtml @@ -0,0 +1,118 @@ +@page +@using Microsoft.AspNetCore.Http.Extensions +@using Microsoft.AspNetCore.Mvc.Localization +@using KonSoft.Pages +@using KonSoft.Localization +@using Volo.Abp.Users +@using Volo.Abp.AspNetCore.Mvc.UI.Theming +@using Volo.Abp.Ui.Branding +@model IndexModel +@inject IHtmlLocalizer L +@inject ICurrentUser CurrentUser +@inject IBrandingProvider BrandingProvider +@inject ITheme Theme + +@{ + Layout = Theme.GetEmptyLayout(); +} + +@section styles { + +} + +
+
+ + + +
+
diff --git a/applications/KonSoft.AuthServer/Pages/Index.cshtml.cs b/applications/KonSoft.AuthServer/Pages/Index.cshtml.cs new file mode 100644 index 0000000..cfa19b7 --- /dev/null +++ b/applications/KonSoft.AuthServer/Pages/Index.cshtml.cs @@ -0,0 +1,35 @@ +using System.Collections.Generic; +using System.Globalization; +using System.Threading.Tasks; +using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; +using Volo.Abp.Localization; +using Volo.Abp.OpenIddict.Applications; + +namespace KonSoft.Pages; + +public class IndexModel : AbpPageModel +{ + public List? Applications { get; protected set; } + + public IReadOnlyList? Languages { get; protected set; } + + public string? CurrentLanguage { get; protected set; } + + protected IOpenIddictApplicationRepository OpenIdApplicationRepository { get; } + + protected ILanguageProvider LanguageProvider { get; } + + public IndexModel(IOpenIddictApplicationRepository openIdApplicationRepository, ILanguageProvider languageProvider) + { + OpenIdApplicationRepository = openIdApplicationRepository; + LanguageProvider = languageProvider; + } + + public async Task OnGetAsync() + { + Applications = await OpenIdApplicationRepository.GetListAsync(); + + Languages = await LanguageProvider.GetLanguagesAsync(); + CurrentLanguage = CultureInfo.CurrentCulture.DisplayName; + } +} diff --git a/applications/KonSoft.AuthServer/Pages/_ViewImports.cshtml b/applications/KonSoft.AuthServer/Pages/_ViewImports.cshtml new file mode 100644 index 0000000..c1da1f5 --- /dev/null +++ b/applications/KonSoft.AuthServer/Pages/_ViewImports.cshtml @@ -0,0 +1,4 @@ +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling \ No newline at end of file diff --git a/applications/KonSoft.AuthServer/Program.cs b/applications/KonSoft.AuthServer/Program.cs new file mode 100644 index 0000000..3431a6e --- /dev/null +++ b/applications/KonSoft.AuthServer/Program.cs @@ -0,0 +1,56 @@ +using System; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Serilog; +using Serilog.Events; + +namespace KonSoft; + +public class Program +{ + public async static Task Main(string[] args) + { + Log.Logger = new LoggerConfiguration() +#if DEBUG + .MinimumLevel.Debug() +#else + .MinimumLevel.Information() +#endif + .MinimumLevel.Override("Microsoft", LogEventLevel.Information) + .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) + .Enrich.FromLogContext() + .WriteTo.Async(c => c.File("Logs/logs.txt")) + .WriteTo.Async(c => c.Console()) + .CreateLogger(); + + try + { + Log.Information("Starting KonSoft.AuthServer."); + var builder = WebApplication.CreateBuilder(args); + builder.Host.AddAppSettingsSecretsJson() + .UseAutofac() + .UseSerilog(); + await builder.AddApplicationAsync(); + var app = builder.Build(); + await app.InitializeApplicationAsync(); + await app.RunAsync(); + return 0; + } + catch (Exception ex) + { + if (ex is HostAbortedException) + { + throw; + } + + Log.Fatal(ex, "KonSoft.AuthServer terminated unexpectedly!"); + return 1; + } + finally + { + Log.CloseAndFlush(); + } + } +} diff --git a/applications/KonSoft.AuthServer/Properties/launchSettings.json b/applications/KonSoft.AuthServer/Properties/launchSettings.json new file mode 100644 index 0000000..67f6051 --- /dev/null +++ b/applications/KonSoft.AuthServer/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "https://localhost:44322", + "sslPort": 44322 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "KonSoft.AuthServer": { + "commandName": "Project", + "launchBrowser": true, + "applicationUrl": "https://localhost:44322", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/applications/KonSoft.AuthServer/abp.resourcemapping.js b/applications/KonSoft.AuthServer/abp.resourcemapping.js new file mode 100644 index 0000000..98822e4 --- /dev/null +++ b/applications/KonSoft.AuthServer/abp.resourcemapping.js @@ -0,0 +1,11 @@ +module.exports = { + aliases: { + + }, + clean: [ + + ], + mappings: { + + } +}; \ No newline at end of file diff --git a/applications/KonSoft.AuthServer/appsettings.Development.json b/applications/KonSoft.AuthServer/appsettings.Development.json new file mode 100644 index 0000000..2c63c08 --- /dev/null +++ b/applications/KonSoft.AuthServer/appsettings.Development.json @@ -0,0 +1,2 @@ +{ +} diff --git a/applications/KonSoft.AuthServer/appsettings.json b/applications/KonSoft.AuthServer/appsettings.json new file mode 100644 index 0000000..275efe5 --- /dev/null +++ b/applications/KonSoft.AuthServer/appsettings.json @@ -0,0 +1,17 @@ +{ + "App": { + "SelfUrl": "https://localhost:44322", + "ClientUrl": "http://localhost:4200", + "CorsOrigins": "https://*.KonSoft.com,http://localhost:4200,https://localhost:44316,https://localhost:44370", + "RedirectAllowedUrls": "http://localhost:4200,https://localhost:44319,https://localhost:44316,https://localhost:44347" + }, + "ConnectionStrings": { + "Default": "Host=localhost;Port=5432;Database=KonSoft;User ID=root;Password=myPassword;" + }, + "Redis": { + "Configuration": "127.0.0.1" + }, + "StringEncryption": { + "DefaultPassPhrase": "kxtywyrXW4i7vijT" + } +} diff --git a/applications/KonSoft.AuthServer/appsettings.secrets.json b/applications/KonSoft.AuthServer/appsettings.secrets.json new file mode 100644 index 0000000..7a73a41 --- /dev/null +++ b/applications/KonSoft.AuthServer/appsettings.secrets.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/applications/KonSoft.AuthServer/package.json b/applications/KonSoft.AuthServer/package.json new file mode 100644 index 0000000..84d9043 --- /dev/null +++ b/applications/KonSoft.AuthServer/package.json @@ -0,0 +1,8 @@ +{ + "version": "1.0.0", + "name": "my-app-authserver", + "private": true, + "dependencies": { + "@abp/aspnetcore.mvc.ui.theme.basic": "~8.3.4" + } +} diff --git a/applications/KonSoft.AuthServer/web.config b/applications/KonSoft.AuthServer/web.config new file mode 100644 index 0000000..a0bbf07 --- /dev/null +++ b/applications/KonSoft.AuthServer/web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/applications/KonSoft.AuthServer/wwwroot/global-styles.css b/applications/KonSoft.AuthServer/wwwroot/global-styles.css new file mode 100644 index 0000000..74db4bd --- /dev/null +++ b/applications/KonSoft.AuthServer/wwwroot/global-styles.css @@ -0,0 +1,6 @@ +/* Your Global Styles */ + +:root .lpx-brand-logo { + --lpx-logo: url('/images/logo/leptonx/logo-light.png'); + --lpx-logo-icon: url('/images/logo/leptonx/logo-light-thumbnail.png'); +} \ No newline at end of file diff --git a/applications/KonSoft.AuthServer/yarn.lock b/applications/KonSoft.AuthServer/yarn.lock new file mode 100644 index 0000000..dd67ef4 --- /dev/null +++ b/applications/KonSoft.AuthServer/yarn.lock @@ -0,0 +1,322 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@abp/aspnetcore.mvc.ui.theme.basic@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-8.3.4.tgz#75708276b2d9162d4f208ebf566fb0a7343636a7" + integrity sha512-m5NBySj8tPbXwMKI1hUfYDzGVxvcU4JGJsSDegetuiulZYm59tPnfdwBeM0zSqx72UPowu/2oDwJsgjODVrDlg== + dependencies: + "@abp/aspnetcore.mvc.ui.theme.shared" "~8.3.4" + +"@abp/aspnetcore.mvc.ui.theme.shared@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-8.3.4.tgz#169ae0893302ced9256f94174d9bb870e49f446c" + integrity sha512-bZy8iAIN0QfNJXCRg+RR1NxqTzNDSXRPBx+ksFtDxY6FzMJvwwSOmHF0wqsMLj1xpwXjijWaVWQ2RM/7scDWmw== + dependencies: + "@abp/aspnetcore.mvc.ui" "~8.3.4" + "@abp/bootstrap" "~8.3.4" + "@abp/bootstrap-datepicker" "~8.3.4" + "@abp/bootstrap-daterangepicker" "~8.3.4" + "@abp/datatables.net-bs5" "~8.3.4" + "@abp/font-awesome" "~8.3.4" + "@abp/jquery-form" "~8.3.4" + "@abp/jquery-validation-unobtrusive" "~8.3.4" + "@abp/lodash" "~8.3.4" + "@abp/luxon" "~8.3.4" + "@abp/malihu-custom-scrollbar-plugin" "~8.3.4" + "@abp/moment" "~8.3.4" + "@abp/select2" "~8.3.4" + "@abp/sweetalert2" "~8.3.4" + "@abp/timeago" "~8.3.4" + "@abp/toastr" "~8.3.4" + +"@abp/aspnetcore.mvc.ui@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-8.3.4.tgz#041d83f34541081d9e0f37c36c302cbe871a4897" + integrity sha512-sjGE/EoNM98mXNYPze2C7GPP+TNpv4TLIt416ojaqtxru60oddr4VWrOGuhaqUCO2jJes3OwFZi5PY3hVOBbYw== + dependencies: + ansi-colors "^4.1.3" + +"@abp/bootstrap-datepicker@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-8.3.4.tgz#072f4a3cea93e3a1bb1de13b355201648929f84c" + integrity sha512-txilFovf9zT1w+fTkyI3eZdiISjaxc/+wRRFKwrkVH+0xEgaiR41svKm6sjWBORxgTddlGas87SZJvYY3IKBjA== + dependencies: + bootstrap-datepicker "^1.10.0" + +"@abp/bootstrap-daterangepicker@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/bootstrap-daterangepicker/-/bootstrap-daterangepicker-8.3.4.tgz#b0f65611ca4fafdf2b551f9f139868eae6e22e9a" + integrity sha512-bYkYjk1zTdWcM4DGwnDoU+4pDvs1S8hkNWhrnpP0o8oRoJiesO8Aeda+82rtydtWnxHg+HkDC0iYFFqaNuHvbg== + dependencies: + bootstrap-daterangepicker "^3.1.0" + +"@abp/bootstrap@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-8.3.4.tgz#744bb4d30d4c269ce8e6a7d16c6777dd3cd9fe1e" + integrity sha512-GXCLFFmPNaR3DjQYSaqACL5sH/M9FPia2OKAAMOd796+NmcoFpT+S7l4C6ihqeQc4bjFm0voB8QklueGWx6r8A== + dependencies: + "@abp/core" "~8.3.4" + bootstrap "^5.3.3" + +"@abp/core@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/core/-/core-8.3.4.tgz#12635bc2ac325a426334150502a32fefa4ec3767" + integrity sha512-wImAdZABahaQe6mmZAZlPfYZ3PEhL7eEq+18c1WFO0xeD98oxqi8H1X7+3ABjyFscIh9LIxJVaD3RJ9OHCc5bw== + dependencies: + "@abp/utils" "~8.3.4" + +"@abp/datatables.net-bs5@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs5/-/datatables.net-bs5-8.3.4.tgz#efc28fa57144c7b495a4aeea38df962807ca20df" + integrity sha512-u85aXjqYIJJfOsMq6oNqfxNgxQqV6vOEnJ32vrH294ceW8RzUxHA+G/ZkGRLLRGWVuxuARD/UXzEotH5sd1Ssw== + dependencies: + "@abp/datatables.net" "~8.3.4" + datatables.net-bs5 "^2.0.8" + +"@abp/datatables.net@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-8.3.4.tgz#23a3155a2d84247a29a6b80ff98d1d5f6422a245" + integrity sha512-cwE9TFoRoszmI3zNVaYJtqjSPtwkL9dhCfE02zsmJo8GBdFAlbzAmQenfQiWb3BZhvUvKKN20e+og9S8qoCbXA== + dependencies: + "@abp/jquery" "~8.3.4" + datatables.net "^2.0.8" + +"@abp/font-awesome@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-8.3.4.tgz#f79f7b439f9ffadfc03be3a415a977eab21fa5a1" + integrity sha512-5+D5XKnrZROtg9PJ2zex52gbphXGK/7ZIUsszEg8rOIc/niXggaZLmuDcYJwOEzIkwpGO9OvYy7lc0tHv/Pr4g== + dependencies: + "@abp/core" "~8.3.4" + "@fortawesome/fontawesome-free" "^6.5.2" + +"@abp/jquery-form@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-8.3.4.tgz#c1705bd5213ab5c2b895dd5bd9f3e54f3d94cf54" + integrity sha512-vFjWbTbHQyIsk5SS7Cc+5YrJ15ORjJU+YWVPchI0qoug26for06a7lDGpazWMadxx3iPL7cKLqneOqaVtHkgJA== + dependencies: + "@abp/jquery" "~8.3.4" + jquery-form "^4.3.0" + +"@abp/jquery-validation-unobtrusive@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-8.3.4.tgz#e89eafed89787bcb5221c0ba89832b79a7396d19" + integrity sha512-+kJA5vfvxkrj/iW4Q84BrMTrAGOhC2Hb5czAKr6c60Prmayk5hcakZdXc3wDBHREBLVAq1Muk4AtEJZmaKIeaA== + dependencies: + "@abp/jquery-validation" "~8.3.4" + jquery-validation-unobtrusive "^4.0.0" + +"@abp/jquery-validation@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-8.3.4.tgz#a445592d80edc6b6b1334ece2007b3084c329cc6" + integrity sha512-XvL0H3IRuSHwpPKUyJmW6PH8KwPDt9NllMqPGreRANF8l5IU10hOLEeP2BnGFfGMqFwqUMh+eJRar5yZcegkmg== + dependencies: + "@abp/jquery" "~8.3.4" + jquery-validation "^1.20.1" + +"@abp/jquery@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-8.3.4.tgz#2dc3f5f124ac65b5f45d29749ebb5d6cf17db23b" + integrity sha512-Zx2rErtgc0gxjX5PURjp6sjDQfzxBChUE9YWN37Xh+Ysm3tTGcXlF0Emwl94MZ640NfmYRpG4AWdik6kbaU5Wg== + dependencies: + "@abp/core" "~8.3.4" + jquery "~3.7.1" + +"@abp/lodash@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-8.3.4.tgz#b0ef4e82a788ae7389a31793c3bad6702efdbe33" + integrity sha512-yGd/oLds0jpTgTpmkFYOEomS4K15DGcffMP3N1t0qKLgTaBYTQzeugHVgQ0baufC+OvLjumDNuu3eHjBJewwKg== + dependencies: + "@abp/core" "~8.3.4" + lodash "^4.17.21" + +"@abp/luxon@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-8.3.4.tgz#f152b2d7b62bd27f3d27aa3a1794b868bf06a1a4" + integrity sha512-l1nvfqdhHBgHBPK+bLClAEprRK3K5zx5Jar93o5++6r3zXUhYi5OUHUxl+LuGn8MXLvHJVGL41irHl6sYjFSww== + dependencies: + "@abp/core" "~8.3.4" + luxon "^3.4.4" + +"@abp/malihu-custom-scrollbar-plugin@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-8.3.4.tgz#0868214884e3e0b94dade0e8e78c01741d71106a" + integrity sha512-uKRk8+HCvXtpmvof5W09908AkivlweErTE62b0JhkrJVIlYt/0LC1MmB/qHHBfPj6OK05HYGBi3inr7fNAPXEQ== + dependencies: + "@abp/core" "~8.3.4" + malihu-custom-scrollbar-plugin "^3.1.5" + +"@abp/moment@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/moment/-/moment-8.3.4.tgz#a5809520dc50b50402ade4ac630c6ec985fd4518" + integrity sha512-61J8drO3OqkaaAn66xBg6jCws1iV6zutjYQvpEXLdGBA9Kvw2J87GSomxJ4mcIo/5+jzrVro6JYaCfKWY8b1dw== + dependencies: + moment "^2.30.1" + +"@abp/select2@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-8.3.4.tgz#1731b465760e0515d0d4280f38189c9366fecda5" + integrity sha512-sPtYstFVvMTT8fdXRIfHeODIgSN2ufWm6zCMGH7C0cST3FF59M4m/MtdKGBlA/itzHPxeDv7A6dy4Aw4l7Gk4Q== + dependencies: + "@abp/core" "~8.3.4" + select2 "^4.0.13" + +"@abp/sweetalert2@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/sweetalert2/-/sweetalert2-8.3.4.tgz#c0768ca4fe0a9926b8f33d8bf5251d3e4202cd2f" + integrity sha512-6HqxISh+FodwUsCrR3nX49RQDhzHtDlz8ul42TecUMsGa96qX2lvwnoWkXAHLG3mdLRy62Z0dhJ1JKMfrPeJeg== + dependencies: + "@abp/core" "~8.3.4" + sweetalert2 "^11.3.6" + +"@abp/timeago@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-8.3.4.tgz#26ca0bec90d861f9f4af714061b370950551c839" + integrity sha512-cDARYysPn5Rr/9rqVn7S4sBWbeEpaIXr8NKwGZqNOzMF2g283SkLKrkQJBWIC6Pn2lVeIB7AV1+GtVn81V/nnw== + dependencies: + "@abp/jquery" "~8.3.4" + timeago "^1.6.7" + +"@abp/toastr@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-8.3.4.tgz#cb433bc4ed2e302f2704ad0456c99d6f12fd0529" + integrity sha512-29C9GgwlumrHgt1iZ4lArDnlXfSvmCHDehxkbDutrkC1m257UxQaOID11us2UeCs3JobueQcLlQKD/LqnDB4xA== + dependencies: + "@abp/jquery" "~8.3.4" + toastr "^2.1.4" + +"@abp/utils@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/utils/-/utils-8.3.4.tgz#4b06575a110e85e2a360294f678b782818e1ab10" + integrity sha512-7Lq3wdk/07vKgQnR56DTmdSuYRABMe0XTGPJRS5F91DVbggeJyDUaqifVvOeurF/3CZJOS7fJpoIHQXeUveFtQ== + dependencies: + just-compare "^2.3.0" + +"@fortawesome/fontawesome-free@^6.5.2": + version "6.7.2" + resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-6.7.2.tgz#8249de9b7e22fcb3ceb5e66090c30a1d5492b81a" + integrity sha512-JUOtgFW6k9u4Y+xeIaEiLr3+cjoUPiAuLXoyKOJSia6Duzb7pq+A76P9ZdPDoAoxHdHzq6gE9/jKBGXlZT8FbA== + +ansi-colors@^4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" + integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw== + +bootstrap-datepicker@^1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/bootstrap-datepicker/-/bootstrap-datepicker-1.10.0.tgz#61612bbe8bf0a69a5bce32bbcdda93ebb6ccf24a" + integrity sha512-lWxtSYddAQOpbAO8UhYhHLcK6425eWoSjb5JDvZU3ePHEPF6A3eUr51WKaFy4PccU19JRxUG6wEU3KdhtKfvpg== + dependencies: + jquery ">=3.4.0 <4.0.0" + +bootstrap-daterangepicker@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/bootstrap-daterangepicker/-/bootstrap-daterangepicker-3.1.0.tgz#632e6fb2de4b6360c5c0a9d5f6adb9aace051fe8" + integrity sha512-oaQZx6ZBDo/dZNyXGVi2rx5GmFXThyQLAxdtIqjtLlYVaQUfQALl5JZMJJZzyDIX7blfy4ppZPAJ10g8Ma4d/g== + dependencies: + jquery ">=1.10" + moment "^2.9.0" + +bootstrap@^5.3.3: + version "5.3.8" + resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-5.3.8.tgz#6401a10057a22752d21f4e19055508980656aeed" + integrity sha512-HP1SZDqaLDPwsNiqRqi5NcP0SSXciX2s9E+RyqJIIqGo+vJeN5AJVM98CXmW/Wux0nQ5L7jeWUdplCEf0Ee+tg== + +datatables.net-bs5@^2.0.8: + version "2.3.3" + resolved "https://registry.yarnpkg.com/datatables.net-bs5/-/datatables.net-bs5-2.3.3.tgz#8bf3aec484a69e373f6007038eaac0cc0ef4ee15" + integrity sha512-IPtC57k3KyZaLzIYTHies23Cm2zqaKfD6lkxy/aOAUUAtsg35l53VqNY9y84AEySYG3YLghMHVBvl2ckUhvm0A== + dependencies: + datatables.net "2.3.3" + jquery ">=1.7" + +datatables.net@2.3.3, datatables.net@^2.0.8: + version "2.3.3" + resolved "https://registry.yarnpkg.com/datatables.net/-/datatables.net-2.3.3.tgz#fe4f96bdbc4cf47c8d11162a7af525ca6a3683d2" + integrity sha512-SWL3za6nheY6gdoiLgCc++tYmxbwrmv2bjrEiII9rXBWXXSbOZct6pjR3FueMVRM5jmt7pQcXiGovfuFDnutQg== + dependencies: + jquery ">=1.7" + +jquery-form@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/jquery-form/-/jquery-form-4.3.0.tgz#7d3961c314a1f2d15298f4af1d3943f54f4149c6" + integrity sha512-q3uaVCEWdLOYUCI6dpNdwf/7cJFOsUgdpq6r0taxtGQ5NJSkOzofyWm4jpOuJ5YxdmL1FI5QR+q+HB63HHLGnQ== + dependencies: + jquery ">=1.7.2" + +jquery-mousewheel@>=3.0.6: + version "3.2.2" + resolved "https://registry.yarnpkg.com/jquery-mousewheel/-/jquery-mousewheel-3.2.2.tgz#48c833f6260ee0c46d438a999e7d0060ec9eed0b" + integrity sha512-JP71xTAg08ZY3hcs9ZbYUZ5i+dkSsz4yRl/zpWkAmtzc+kMs5EfPkpkINSidiLYMaR0MTo3DfFGF9WIezMsFQQ== + dependencies: + jquery ">=1.2.6" + +jquery-validation-unobtrusive@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-4.0.0.tgz#dfcf25a558496a2c883db6021d10f5398d15f99d" + integrity sha512-1ervYFFv6LX/rp7ktuLnMakHNG0piNRDyROI8Ir3hL1vPIwylAehB1AY3BPrYJnzW3WmwWryZq+Bz4sazZK9iQ== + dependencies: + jquery "^3.6.0" + jquery-validation ">=1.19" + +jquery-validation@>=1.19, jquery-validation@^1.20.1: + version "1.21.0" + resolved "https://registry.yarnpkg.com/jquery-validation/-/jquery-validation-1.21.0.tgz#78fc05ab76020912a246af3661b3f54a438bca93" + integrity sha512-xNot0rlUIgu7duMcQ5qb6MGkGL/Z1PQaRJQoZAURW9+a/2PGOUxY36o/WyNeP2T9R6jvWB8Z9lUVvvQWI/Zs5w== + +jquery@>=1.10, jquery@>=1.12.0, jquery@>=1.2.6, "jquery@>=1.5.0 <4.0", jquery@>=1.7, jquery@>=1.7.2, "jquery@>=3.4.0 <4.0.0", jquery@^3.6.0, jquery@~3.7.1: + version "3.7.1" + resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.7.1.tgz#083ef98927c9a6a74d05a6af02806566d16274de" + integrity sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg== + +just-compare@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/just-compare/-/just-compare-2.3.0.tgz#a2adcc1d1940536263275f5a1ef1298bcacfeda7" + integrity sha512-6shoR7HDT+fzfL3gBahx1jZG3hWLrhPAf+l7nCwahDdT9XDtosB9kIF0ZrzUp5QY8dJWfQVr5rnsPqsbvflDzg== + +lodash@^4.17.21: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + +luxon@^3.4.4: + version "3.7.2" + resolved "https://registry.yarnpkg.com/luxon/-/luxon-3.7.2.tgz#d697e48f478553cca187a0f8436aff468e3ba0ba" + integrity sha512-vtEhXh/gNjI9Yg1u4jX/0YVPMvxzHuGgCm6tC5kZyb08yjGWGnqAjGJvcXbqQR2P3MyMEFnRbpcdFS6PBcLqew== + +malihu-custom-scrollbar-plugin@^3.1.5: + version "3.1.5" + resolved "https://registry.yarnpkg.com/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-3.1.5.tgz#310cecc5e59415a1c29e9dfb5d2b6e01d66a29ef" + integrity sha512-lwW3LgI+CNDMPnP4ED2la6oYxWMkCXlnhex+s2wuOLhFDFGnGmQuTQVdRK9bvDLpxs10sGlfErVufJy9ztfgJQ== + dependencies: + jquery-mousewheel ">=3.0.6" + +moment@^2.30.1, moment@^2.9.0: + version "2.30.1" + resolved "https://registry.yarnpkg.com/moment/-/moment-2.30.1.tgz#f8c91c07b7a786e30c59926df530b4eac96974ae" + integrity sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how== + +select2@^4.0.13: + version "4.0.13" + resolved "https://registry.yarnpkg.com/select2/-/select2-4.0.13.tgz#0dbe377df3f96167c4c1626033e924372d8ef44d" + integrity sha512-1JeB87s6oN/TDxQQYCvS5EFoQyvV6eYMZZ0AeA4tdFDYWN3BAGZ8npr17UBFddU0lgAt3H0yjX3X6/ekOj1yjw== + +sweetalert2@^11.3.6: + version "11.23.0" + resolved "https://registry.yarnpkg.com/sweetalert2/-/sweetalert2-11.23.0.tgz#ba8a051b1e94215c762af08692171b7b4611c4c1" + integrity sha512-cKzzbC3C1sIs7o9XAMw4E8F9kBtGXsBDUsd2JZ8JM/dqa+nzWwSGM+9LLYILZWzWHzX9W+HJNHyBlbHPVS/krw== + +timeago@^1.6.7: + version "1.6.7" + resolved "https://registry.yarnpkg.com/timeago/-/timeago-1.6.7.tgz#afd467c29a911e697fc22a81888c7c3022783cb5" + integrity sha512-FikcjN98+ij0siKH4VO4dZ358PR3oDDq4Vdl1+sN9gWz1/+JXGr3uZbUShYH/hL7bMhcTpPbplJU5Tej4b4jbQ== + dependencies: + jquery ">=1.5.0 <4.0" + +toastr@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/toastr/-/toastr-2.1.4.tgz#8b43be64fb9d0c414871446f2db8e8ca4e95f181" + integrity sha512-LIy77F5n+sz4tefMmFOntcJ6HL0Fv3k1TDnNmFZ0bU/GcvIIfy6eG2v7zQmMiYgaalAiUv75ttFrPn5s0gyqlA== + dependencies: + jquery ">=1.12.0" diff --git a/common.props b/common.props new file mode 100644 index 0000000..22d34c4 --- /dev/null +++ b/common.props @@ -0,0 +1,19 @@ + + + latest + 1.0.0 + $(NoWarn);CS1591 + app + + + + + $(NoWarn);0436 + + + + + + + + \ No newline at end of file diff --git a/gateways/KonSoft.InternalGateway/Controllers/WeatherForecastController.cs b/gateways/KonSoft.InternalGateway/Controllers/WeatherForecastController.cs new file mode 100644 index 0000000..2fcaf5e --- /dev/null +++ b/gateways/KonSoft.InternalGateway/Controllers/WeatherForecastController.cs @@ -0,0 +1,33 @@ +using Microsoft.AspNetCore.Mvc; + +namespace KonSoft.InternalGateway.Controllers +{ + [ApiController] + [Route("[controller]")] + public class WeatherForecastController : ControllerBase + { + private static readonly string[] Summaries = new[] + { + "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" + }; + + private readonly ILogger _logger; + + public WeatherForecastController(ILogger logger) + { + _logger = logger; + } + + [HttpGet(Name = "GetWeatherForecast")] + public IEnumerable Get() + { + return Enumerable.Range(1, 5).Select(index => new WeatherForecast + { + Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)), + TemperatureC = Random.Shared.Next(-20, 55), + Summary = Summaries[Random.Shared.Next(Summaries.Length)] + }) + .ToArray(); + } + } +} diff --git a/gateways/KonSoft.InternalGateway/KonSoft.InternalGateway.csproj b/gateways/KonSoft.InternalGateway/KonSoft.InternalGateway.csproj new file mode 100644 index 0000000..5419ef0 --- /dev/null +++ b/gateways/KonSoft.InternalGateway/KonSoft.InternalGateway.csproj @@ -0,0 +1,13 @@ + + + + net8.0 + enable + enable + + + + + + + diff --git a/gateways/KonSoft.InternalGateway/KonSoft.InternalGateway.http b/gateways/KonSoft.InternalGateway/KonSoft.InternalGateway.http new file mode 100644 index 0000000..95c5e0b --- /dev/null +++ b/gateways/KonSoft.InternalGateway/KonSoft.InternalGateway.http @@ -0,0 +1,6 @@ +@KonSoft.InternalGateway_HostAddress = http://localhost:5090 + +GET {{KonSoft.InternalGateway_HostAddress}}/weatherforecast/ +Accept: application/json + +### diff --git a/gateways/KonSoft.InternalGateway/Program.cs b/gateways/KonSoft.InternalGateway/Program.cs new file mode 100644 index 0000000..48863a6 --- /dev/null +++ b/gateways/KonSoft.InternalGateway/Program.cs @@ -0,0 +1,25 @@ +var builder = WebApplication.CreateBuilder(args); + +// Add services to the container. + +builder.Services.AddControllers(); +// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); + +var app = builder.Build(); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(); +} + +app.UseHttpsRedirection(); + +app.UseAuthorization(); + +app.MapControllers(); + +app.Run(); diff --git a/gateways/KonSoft.InternalGateway/Properties/launchSettings.json b/gateways/KonSoft.InternalGateway/Properties/launchSettings.json new file mode 100644 index 0000000..407c599 --- /dev/null +++ b/gateways/KonSoft.InternalGateway/Properties/launchSettings.json @@ -0,0 +1,41 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:15968", + "sslPort": 44395 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:5090", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7264;http://localhost:5090", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/gateways/KonSoft.InternalGateway/WeatherForecast.cs b/gateways/KonSoft.InternalGateway/WeatherForecast.cs new file mode 100644 index 0000000..3905db0 --- /dev/null +++ b/gateways/KonSoft.InternalGateway/WeatherForecast.cs @@ -0,0 +1,13 @@ +namespace KonSoft.InternalGateway +{ + public class WeatherForecast + { + public DateOnly Date { get; set; } + + public int TemperatureC { get; set; } + + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); + + public string? Summary { get; set; } + } +} diff --git a/gateways/KonSoft.InternalGateway/appsettings.Development.json b/gateways/KonSoft.InternalGateway/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/gateways/KonSoft.InternalGateway/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/gateways/KonSoft.InternalGateway/appsettings.json b/gateways/KonSoft.InternalGateway/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/gateways/KonSoft.InternalGateway/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/gateways/KonSoft.PublicGateway/Controllers/WeatherForecastController.cs b/gateways/KonSoft.PublicGateway/Controllers/WeatherForecastController.cs new file mode 100644 index 0000000..7d2536e --- /dev/null +++ b/gateways/KonSoft.PublicGateway/Controllers/WeatherForecastController.cs @@ -0,0 +1,33 @@ +using Microsoft.AspNetCore.Mvc; + +namespace KonSoft.PublicGateway.Controllers +{ + [ApiController] + [Route("[controller]")] + public class WeatherForecastController : ControllerBase + { + private static readonly string[] Summaries = new[] + { + "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" + }; + + private readonly ILogger _logger; + + public WeatherForecastController(ILogger logger) + { + _logger = logger; + } + + [HttpGet(Name = "GetWeatherForecast")] + public IEnumerable Get() + { + return Enumerable.Range(1, 5).Select(index => new WeatherForecast + { + Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)), + TemperatureC = Random.Shared.Next(-20, 55), + Summary = Summaries[Random.Shared.Next(Summaries.Length)] + }) + .ToArray(); + } + } +} diff --git a/gateways/KonSoft.PublicGateway/KonSoft.PublicGateway.csproj b/gateways/KonSoft.PublicGateway/KonSoft.PublicGateway.csproj new file mode 100644 index 0000000..5419ef0 --- /dev/null +++ b/gateways/KonSoft.PublicGateway/KonSoft.PublicGateway.csproj @@ -0,0 +1,13 @@ + + + + net8.0 + enable + enable + + + + + + + diff --git a/gateways/KonSoft.PublicGateway/KonSoft.PublicGateway.http b/gateways/KonSoft.PublicGateway/KonSoft.PublicGateway.http new file mode 100644 index 0000000..66040bf --- /dev/null +++ b/gateways/KonSoft.PublicGateway/KonSoft.PublicGateway.http @@ -0,0 +1,6 @@ +@KonSoft.PublicGateway_HostAddress = http://localhost:5214 + +GET {{KonSoft.PublicGateway_HostAddress}}/weatherforecast/ +Accept: application/json + +### diff --git a/gateways/KonSoft.PublicGateway/Program.cs b/gateways/KonSoft.PublicGateway/Program.cs new file mode 100644 index 0000000..48863a6 --- /dev/null +++ b/gateways/KonSoft.PublicGateway/Program.cs @@ -0,0 +1,25 @@ +var builder = WebApplication.CreateBuilder(args); + +// Add services to the container. + +builder.Services.AddControllers(); +// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); + +var app = builder.Build(); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(); +} + +app.UseHttpsRedirection(); + +app.UseAuthorization(); + +app.MapControllers(); + +app.Run(); diff --git a/gateways/KonSoft.PublicGateway/Properties/launchSettings.json b/gateways/KonSoft.PublicGateway/Properties/launchSettings.json new file mode 100644 index 0000000..aacf6d5 --- /dev/null +++ b/gateways/KonSoft.PublicGateway/Properties/launchSettings.json @@ -0,0 +1,41 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:30296", + "sslPort": 44320 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:5214", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7029;http://localhost:5214", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/gateways/KonSoft.PublicGateway/WeatherForecast.cs b/gateways/KonSoft.PublicGateway/WeatherForecast.cs new file mode 100644 index 0000000..2577b66 --- /dev/null +++ b/gateways/KonSoft.PublicGateway/WeatherForecast.cs @@ -0,0 +1,13 @@ +namespace KonSoft.PublicGateway +{ + public class WeatherForecast + { + public DateOnly Date { get; set; } + + public int TemperatureC { get; set; } + + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); + + public string? Summary { get; set; } + } +} diff --git a/gateways/KonSoft.PublicGateway/appsettings.Development.json b/gateways/KonSoft.PublicGateway/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/gateways/KonSoft.PublicGateway/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/gateways/KonSoft.PublicGateway/appsettings.json b/gateways/KonSoft.PublicGateway/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/gateways/KonSoft.PublicGateway/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/microservices/KonSoft.Admin.HttpApi.Host/AdminBrandingProvider.cs b/microservices/KonSoft.Admin.HttpApi.Host/AdminBrandingProvider.cs new file mode 100644 index 0000000..6c1ffde --- /dev/null +++ b/microservices/KonSoft.Admin.HttpApi.Host/AdminBrandingProvider.cs @@ -0,0 +1,19 @@ +using Microsoft.Extensions.Localization; +using KonSoft.Admin.Localization; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Ui.Branding; + +namespace KonSoft.Admin; + +[Dependency(ReplaceServices = true)] +public class AdminBrandingProvider : DefaultBrandingProvider +{ + private IStringLocalizer _localizer; + + public AdminBrandingProvider(IStringLocalizer localizer) + { + _localizer = localizer; + } + + public override string AppName => _localizer["AppName"]; +} diff --git a/microservices/KonSoft.Admin.HttpApi.Host/AdminHttpApiHostModule.cs b/microservices/KonSoft.Admin.HttpApi.Host/AdminHttpApiHostModule.cs new file mode 100644 index 0000000..85f450e --- /dev/null +++ b/microservices/KonSoft.Admin.HttpApi.Host/AdminHttpApiHostModule.cs @@ -0,0 +1,224 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Cors; +using Microsoft.AspNetCore.Extensions.DependencyInjection; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using KonSoft.Admin.EntityFrameworkCore; +using KonSoft.Admin.MultiTenancy; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite.Bundling; +using Microsoft.OpenApi.Models; +using OpenIddict.Validation.AspNetCore; +using Volo.Abp; +using Volo.Abp.Account; +using Volo.Abp.Account.Web; +using Volo.Abp.AspNetCore.MultiTenancy; +using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; +using Volo.Abp.AspNetCore.Serilog; +using Volo.Abp.Autofac; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Volo.Abp.Security.Claims; +using Volo.Abp.Swashbuckle; +using Volo.Abp.UI.Navigation.Urls; +using Volo.Abp.VirtualFileSystem; + +namespace KonSoft.Admin; + +[DependsOn( + typeof(AdminHttpApiModule), + typeof(AbpAutofacModule), + typeof(AbpAspNetCoreMultiTenancyModule), + typeof(AdminApplicationModule), + typeof(AdminEntityFrameworkCoreModule), + typeof(AbpAspNetCoreMvcUiLeptonXLiteThemeModule), + typeof(AbpAccountWebOpenIddictModule), + typeof(AbpAspNetCoreSerilogModule), + typeof(AbpSwashbuckleModule) +)] +public class AdminHttpApiHostModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PreConfigure(builder => + { + builder.AddValidation(options => + { + options.AddAudiences("Admin"); + options.UseLocalServer(); + options.UseAspNetCore(); + }); + }); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + var configuration = context.Services.GetConfiguration(); + var hostingEnvironment = context.Services.GetHostingEnvironment(); + + ConfigureAuthentication(context); + ConfigureBundles(); + ConfigureUrls(configuration); + ConfigureConventionalControllers(); + ConfigureVirtualFileSystem(context); + ConfigureCors(context, configuration); + ConfigureSwaggerServices(context, configuration); + } + + private void ConfigureAuthentication(ServiceConfigurationContext context) + { + context.Services.ForwardIdentityAuthenticationForBearer(OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme); + context.Services.Configure(options => + { + options.IsDynamicClaimsEnabled = true; + }); + } + + private void ConfigureBundles() + { + Configure(options => + { + options.StyleBundles.Configure( + LeptonXLiteThemeBundles.Styles.Global, + bundle => + { + bundle.AddFiles("/global-styles.css"); + } + ); + }); + } + + private void ConfigureUrls(IConfiguration configuration) + { + Configure(options => + { + options.Applications["MVC"].RootUrl = configuration["App:SelfUrl"]; + options.RedirectAllowedUrls.AddRange(configuration["App:RedirectAllowedUrls"]?.Split(',') ?? Array.Empty()); + + options.Applications["Angular"].RootUrl = configuration["App:ClientUrl"]; + options.Applications["Angular"].Urls[AccountUrlNames.PasswordReset] = "account/reset-password"; + }); + } + + private void ConfigureVirtualFileSystem(ServiceConfigurationContext context) + { + var hostingEnvironment = context.Services.GetHostingEnvironment(); + + if (hostingEnvironment.IsDevelopment()) + { + Configure(options => + { + options.FileSets.ReplaceEmbeddedByPhysical( + Path.Combine(hostingEnvironment.ContentRootPath, + $"..{Path.DirectorySeparatorChar}KonSoft.Admin.Domain.Shared")); + options.FileSets.ReplaceEmbeddedByPhysical( + Path.Combine(hostingEnvironment.ContentRootPath, + $"..{Path.DirectorySeparatorChar}KonSoft.Admin.Domain")); + options.FileSets.ReplaceEmbeddedByPhysical( + Path.Combine(hostingEnvironment.ContentRootPath, + $"..{Path.DirectorySeparatorChar}KonSoft.Admin.Application.Contracts")); + options.FileSets.ReplaceEmbeddedByPhysical( + Path.Combine(hostingEnvironment.ContentRootPath, + $"..{Path.DirectorySeparatorChar}KonSoft.Admin.Application")); + }); + } + } + + private void ConfigureConventionalControllers() + { + Configure(options => + { + options.ConventionalControllers.Create(typeof(AdminApplicationModule).Assembly); + }); + } + + private static void ConfigureSwaggerServices(ServiceConfigurationContext context, IConfiguration configuration) + { + context.Services.AddAbpSwaggerGenWithOAuth( + configuration["AuthServer:Authority"]!, + new Dictionary + { + {"Admin", "Admin API"} + }, + options => + { + options.SwaggerDoc("v1", new OpenApiInfo { Title = "Admin API", Version = "v1" }); + options.DocInclusionPredicate((docName, description) => true); + options.CustomSchemaIds(type => type.FullName); + }); + } + + private void ConfigureCors(ServiceConfigurationContext context, IConfiguration configuration) + { + context.Services.AddCors(options => + { + options.AddDefaultPolicy(builder => + { + builder + .WithOrigins(configuration["App:CorsOrigins"]? + .Split(",", StringSplitOptions.RemoveEmptyEntries) + .Select(o => o.RemovePostFix("/")) + .ToArray() ?? Array.Empty()) + .WithAbpExposedHeaders() + .SetIsOriginAllowedToAllowWildcardSubdomains() + .AllowAnyHeader() + .AllowAnyMethod() + .AllowCredentials(); + }); + }); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + var app = context.GetApplicationBuilder(); + var env = context.GetEnvironment(); + + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.UseAbpRequestLocalization(); + + if (!env.IsDevelopment()) + { + app.UseErrorPage(); + } + + app.UseCorrelationId(); + app.UseStaticFiles(); + app.UseRouting(); + app.UseCors(); + app.UseAuthentication(); + app.UseAbpOpenIddictValidation(); + + if (MultiTenancyConsts.IsEnabled) + { + app.UseMultiTenancy(); + } + app.UseUnitOfWork(); + app.UseDynamicClaims(); + app.UseAuthorization(); + + app.UseSwagger(); + app.UseAbpSwaggerUI(c => + { + c.SwaggerEndpoint("/swagger/v1/swagger.json", "Admin API"); + + var configuration = context.ServiceProvider.GetRequiredService(); + c.OAuthClientId(configuration["AuthServer:SwaggerClientId"]); + c.OAuthScopes("Admin"); + }); + + app.UseAuditing(); + app.UseAbpSerilogEnrichers(); + app.UseConfiguredEndpoints(); + } +} diff --git a/microservices/KonSoft.Admin.HttpApi.Host/Controllers/HomeController.cs b/microservices/KonSoft.Admin.HttpApi.Host/Controllers/HomeController.cs new file mode 100644 index 0000000..caf536b --- /dev/null +++ b/microservices/KonSoft.Admin.HttpApi.Host/Controllers/HomeController.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc; + +namespace KonSoft.Admin.Controllers; + +public class HomeController : AbpController +{ + public ActionResult Index() + { + return Redirect("~/swagger"); + } +} diff --git a/microservices/KonSoft.Admin.HttpApi.Host/KonSoft.Admin.HttpApi.Host.csproj b/microservices/KonSoft.Admin.HttpApi.Host/KonSoft.Admin.HttpApi.Host.csproj new file mode 100644 index 0000000..98cca8f --- /dev/null +++ b/microservices/KonSoft.Admin.HttpApi.Host/KonSoft.Admin.HttpApi.Host.csproj @@ -0,0 +1,40 @@ + + + + + + net8.0 + enable + KonSoft.Admin + true + KonSoft.Admin-4681b4fd-151f-4221-84a4-929d86723e4c + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/microservices/KonSoft.Admin.HttpApi.Host/Program.cs b/microservices/KonSoft.Admin.HttpApi.Host/Program.cs new file mode 100644 index 0000000..6d2ff4d --- /dev/null +++ b/microservices/KonSoft.Admin.HttpApi.Host/Program.cs @@ -0,0 +1,56 @@ +using System; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Serilog; +using Serilog.Events; + +namespace KonSoft.Admin; + +public class Program +{ + public async static Task Main(string[] args) + { + Log.Logger = new LoggerConfiguration() +#if DEBUG + .MinimumLevel.Debug() +#else + .MinimumLevel.Information() +#endif + .MinimumLevel.Override("Microsoft", LogEventLevel.Information) + .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) + .Enrich.FromLogContext() + .WriteTo.Async(c => c.File("Logs/logs.txt")) + .WriteTo.Async(c => c.Console()) + .CreateLogger(); + + try + { + Log.Information("Starting KonSoft.Admin.HttpApi.Host."); + var builder = WebApplication.CreateBuilder(args); + builder.Host.AddAppSettingsSecretsJson() + .UseAutofac() + .UseSerilog(); + await builder.AddApplicationAsync(); + var app = builder.Build(); + await app.InitializeApplicationAsync(); + await app.RunAsync(); + return 0; + } + catch (Exception ex) + { + if (ex is HostAbortedException) + { + throw; + } + + Log.Fatal(ex, "Host terminated unexpectedly!"); + return 1; + } + finally + { + Log.CloseAndFlush(); + } + } +} diff --git a/microservices/KonSoft.Admin.HttpApi.Host/Properties/launchSettings.json b/microservices/KonSoft.Admin.HttpApi.Host/Properties/launchSettings.json new file mode 100644 index 0000000..1116d11 --- /dev/null +++ b/microservices/KonSoft.Admin.HttpApi.Host/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "https://localhost:44350", + "sslPort": 44350 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "KonSoft.Admin.HttpApi.Host": { + "commandName": "Project", + "launchBrowser": true, + "applicationUrl": "https://localhost:44350", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/microservices/KonSoft.Admin.HttpApi.Host/abp.resourcemapping.js b/microservices/KonSoft.Admin.HttpApi.Host/abp.resourcemapping.js new file mode 100644 index 0000000..4a2ad45 --- /dev/null +++ b/microservices/KonSoft.Admin.HttpApi.Host/abp.resourcemapping.js @@ -0,0 +1,11 @@ +module.exports = { + aliases: { + + }, + clean: [ + + ], + mappings: { + + } +}; diff --git a/microservices/KonSoft.Admin.HttpApi.Host/appsettings.Development.json b/microservices/KonSoft.Admin.HttpApi.Host/appsettings.Development.json new file mode 100644 index 0000000..2c63c08 --- /dev/null +++ b/microservices/KonSoft.Admin.HttpApi.Host/appsettings.Development.json @@ -0,0 +1,2 @@ +{ +} diff --git a/microservices/KonSoft.Admin.HttpApi.Host/appsettings.json b/microservices/KonSoft.Admin.HttpApi.Host/appsettings.json new file mode 100644 index 0000000..8096818 --- /dev/null +++ b/microservices/KonSoft.Admin.HttpApi.Host/appsettings.json @@ -0,0 +1,18 @@ +{ + "App": { + "SelfUrl": "https://localhost:44350", + "CorsOrigins": "https://*.Admin.com", + "RedirectAllowedUrls": "" + }, + "ConnectionStrings": { + "Default": "Host=localhost;Port=5432;Database=Admin;User ID=root;Password=myPassword;" + }, + "AuthServer": { + "Authority": "https://localhost:44350", + "RequireHttpsMetadata": false, + "SwaggerClientId": "Admin_Swagger" + }, + "StringEncryption": { + "DefaultPassPhrase": "YXM86JJ7EFsh21K9" + } +} diff --git a/microservices/KonSoft.Admin.HttpApi.Host/appsettings.secrets.json b/microservices/KonSoft.Admin.HttpApi.Host/appsettings.secrets.json new file mode 100644 index 0000000..7a73a41 --- /dev/null +++ b/microservices/KonSoft.Admin.HttpApi.Host/appsettings.secrets.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/microservices/KonSoft.Admin.HttpApi.Host/package.json b/microservices/KonSoft.Admin.HttpApi.Host/package.json new file mode 100644 index 0000000..b8d616a --- /dev/null +++ b/microservices/KonSoft.Admin.HttpApi.Host/package.json @@ -0,0 +1,8 @@ +{ + "version": "1.0.0", + "name": "my-app", + "private": true, + "dependencies": { + "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~3.3.4" + } +} diff --git a/microservices/KonSoft.Admin.HttpApi.Host/web.config b/microservices/KonSoft.Admin.HttpApi.Host/web.config new file mode 100644 index 0000000..fc25838 --- /dev/null +++ b/microservices/KonSoft.Admin.HttpApi.Host/web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/microservices/KonSoft.Admin.HttpApi.Host/wwwroot/global-styles.css b/microservices/KonSoft.Admin.HttpApi.Host/wwwroot/global-styles.css new file mode 100644 index 0000000..74db4bd --- /dev/null +++ b/microservices/KonSoft.Admin.HttpApi.Host/wwwroot/global-styles.css @@ -0,0 +1,6 @@ +/* Your Global Styles */ + +:root .lpx-brand-logo { + --lpx-logo: url('/images/logo/leptonx/logo-light.png'); + --lpx-logo-icon: url('/images/logo/leptonx/logo-light-thumbnail.png'); +} \ No newline at end of file diff --git a/microservices/KonSoft.Admin.HttpApi.Host/wwwroot/images/logo/leptonx/logo-dark-thumbnail.png b/microservices/KonSoft.Admin.HttpApi.Host/wwwroot/images/logo/leptonx/logo-dark-thumbnail.png new file mode 100644 index 0000000..9734a07 Binary files /dev/null and b/microservices/KonSoft.Admin.HttpApi.Host/wwwroot/images/logo/leptonx/logo-dark-thumbnail.png differ diff --git a/microservices/KonSoft.Admin.HttpApi.Host/wwwroot/images/logo/leptonx/logo-dark.png b/microservices/KonSoft.Admin.HttpApi.Host/wwwroot/images/logo/leptonx/logo-dark.png new file mode 100644 index 0000000..a3bbe82 Binary files /dev/null and b/microservices/KonSoft.Admin.HttpApi.Host/wwwroot/images/logo/leptonx/logo-dark.png differ diff --git a/microservices/KonSoft.Admin.HttpApi.Host/wwwroot/images/logo/leptonx/logo-light-thumbnail.png b/microservices/KonSoft.Admin.HttpApi.Host/wwwroot/images/logo/leptonx/logo-light-thumbnail.png new file mode 100644 index 0000000..ca39184 Binary files /dev/null and b/microservices/KonSoft.Admin.HttpApi.Host/wwwroot/images/logo/leptonx/logo-light-thumbnail.png differ diff --git a/microservices/KonSoft.Admin.HttpApi.Host/wwwroot/images/logo/leptonx/logo-light.png b/microservices/KonSoft.Admin.HttpApi.Host/wwwroot/images/logo/leptonx/logo-light.png new file mode 100644 index 0000000..761fb44 Binary files /dev/null and b/microservices/KonSoft.Admin.HttpApi.Host/wwwroot/images/logo/leptonx/logo-light.png differ diff --git a/microservices/KonSoft.Admin.HttpApi.Host/yarn.lock b/microservices/KonSoft.Admin.HttpApi.Host/yarn.lock new file mode 100644 index 0000000..1dfe9d4 --- /dev/null +++ b/microservices/KonSoft.Admin.HttpApi.Host/yarn.lock @@ -0,0 +1,322 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@abp/aspnetcore.mvc.ui.theme.leptonxlite@~3.3.4": + version "3.3.4" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.leptonxlite/-/aspnetcore.mvc.ui.theme.leptonxlite-3.3.4.tgz#fb6879075aec2f06e0302e941dcefbe519b18e1d" + integrity sha512-5rrwwZ9n2/yePo+GnHuUsP0TelCwRwCQjYyQFdF/Nd4B3UNQVO/AXQc0Ep3+vHhUxSL386j6ObZYu14VdjPg2g== + dependencies: + "@abp/aspnetcore.mvc.ui.theme.shared" "~8.3.4" + +"@abp/aspnetcore.mvc.ui.theme.shared@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-8.3.4.tgz#169ae0893302ced9256f94174d9bb870e49f446c" + integrity sha512-bZy8iAIN0QfNJXCRg+RR1NxqTzNDSXRPBx+ksFtDxY6FzMJvwwSOmHF0wqsMLj1xpwXjijWaVWQ2RM/7scDWmw== + dependencies: + "@abp/aspnetcore.mvc.ui" "~8.3.4" + "@abp/bootstrap" "~8.3.4" + "@abp/bootstrap-datepicker" "~8.3.4" + "@abp/bootstrap-daterangepicker" "~8.3.4" + "@abp/datatables.net-bs5" "~8.3.4" + "@abp/font-awesome" "~8.3.4" + "@abp/jquery-form" "~8.3.4" + "@abp/jquery-validation-unobtrusive" "~8.3.4" + "@abp/lodash" "~8.3.4" + "@abp/luxon" "~8.3.4" + "@abp/malihu-custom-scrollbar-plugin" "~8.3.4" + "@abp/moment" "~8.3.4" + "@abp/select2" "~8.3.4" + "@abp/sweetalert2" "~8.3.4" + "@abp/timeago" "~8.3.4" + "@abp/toastr" "~8.3.4" + +"@abp/aspnetcore.mvc.ui@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-8.3.4.tgz#041d83f34541081d9e0f37c36c302cbe871a4897" + integrity sha512-sjGE/EoNM98mXNYPze2C7GPP+TNpv4TLIt416ojaqtxru60oddr4VWrOGuhaqUCO2jJes3OwFZi5PY3hVOBbYw== + dependencies: + ansi-colors "^4.1.3" + +"@abp/bootstrap-datepicker@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-8.3.4.tgz#072f4a3cea93e3a1bb1de13b355201648929f84c" + integrity sha512-txilFovf9zT1w+fTkyI3eZdiISjaxc/+wRRFKwrkVH+0xEgaiR41svKm6sjWBORxgTddlGas87SZJvYY3IKBjA== + dependencies: + bootstrap-datepicker "^1.10.0" + +"@abp/bootstrap-daterangepicker@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/bootstrap-daterangepicker/-/bootstrap-daterangepicker-8.3.4.tgz#b0f65611ca4fafdf2b551f9f139868eae6e22e9a" + integrity sha512-bYkYjk1zTdWcM4DGwnDoU+4pDvs1S8hkNWhrnpP0o8oRoJiesO8Aeda+82rtydtWnxHg+HkDC0iYFFqaNuHvbg== + dependencies: + bootstrap-daterangepicker "^3.1.0" + +"@abp/bootstrap@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-8.3.4.tgz#744bb4d30d4c269ce8e6a7d16c6777dd3cd9fe1e" + integrity sha512-GXCLFFmPNaR3DjQYSaqACL5sH/M9FPia2OKAAMOd796+NmcoFpT+S7l4C6ihqeQc4bjFm0voB8QklueGWx6r8A== + dependencies: + "@abp/core" "~8.3.4" + bootstrap "^5.3.3" + +"@abp/core@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/core/-/core-8.3.4.tgz#12635bc2ac325a426334150502a32fefa4ec3767" + integrity sha512-wImAdZABahaQe6mmZAZlPfYZ3PEhL7eEq+18c1WFO0xeD98oxqi8H1X7+3ABjyFscIh9LIxJVaD3RJ9OHCc5bw== + dependencies: + "@abp/utils" "~8.3.4" + +"@abp/datatables.net-bs5@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs5/-/datatables.net-bs5-8.3.4.tgz#efc28fa57144c7b495a4aeea38df962807ca20df" + integrity sha512-u85aXjqYIJJfOsMq6oNqfxNgxQqV6vOEnJ32vrH294ceW8RzUxHA+G/ZkGRLLRGWVuxuARD/UXzEotH5sd1Ssw== + dependencies: + "@abp/datatables.net" "~8.3.4" + datatables.net-bs5 "^2.0.8" + +"@abp/datatables.net@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-8.3.4.tgz#23a3155a2d84247a29a6b80ff98d1d5f6422a245" + integrity sha512-cwE9TFoRoszmI3zNVaYJtqjSPtwkL9dhCfE02zsmJo8GBdFAlbzAmQenfQiWb3BZhvUvKKN20e+og9S8qoCbXA== + dependencies: + "@abp/jquery" "~8.3.4" + datatables.net "^2.0.8" + +"@abp/font-awesome@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-8.3.4.tgz#f79f7b439f9ffadfc03be3a415a977eab21fa5a1" + integrity sha512-5+D5XKnrZROtg9PJ2zex52gbphXGK/7ZIUsszEg8rOIc/niXggaZLmuDcYJwOEzIkwpGO9OvYy7lc0tHv/Pr4g== + dependencies: + "@abp/core" "~8.3.4" + "@fortawesome/fontawesome-free" "^6.5.2" + +"@abp/jquery-form@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-8.3.4.tgz#c1705bd5213ab5c2b895dd5bd9f3e54f3d94cf54" + integrity sha512-vFjWbTbHQyIsk5SS7Cc+5YrJ15ORjJU+YWVPchI0qoug26for06a7lDGpazWMadxx3iPL7cKLqneOqaVtHkgJA== + dependencies: + "@abp/jquery" "~8.3.4" + jquery-form "^4.3.0" + +"@abp/jquery-validation-unobtrusive@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-8.3.4.tgz#e89eafed89787bcb5221c0ba89832b79a7396d19" + integrity sha512-+kJA5vfvxkrj/iW4Q84BrMTrAGOhC2Hb5czAKr6c60Prmayk5hcakZdXc3wDBHREBLVAq1Muk4AtEJZmaKIeaA== + dependencies: + "@abp/jquery-validation" "~8.3.4" + jquery-validation-unobtrusive "^4.0.0" + +"@abp/jquery-validation@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-8.3.4.tgz#a445592d80edc6b6b1334ece2007b3084c329cc6" + integrity sha512-XvL0H3IRuSHwpPKUyJmW6PH8KwPDt9NllMqPGreRANF8l5IU10hOLEeP2BnGFfGMqFwqUMh+eJRar5yZcegkmg== + dependencies: + "@abp/jquery" "~8.3.4" + jquery-validation "^1.20.1" + +"@abp/jquery@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-8.3.4.tgz#2dc3f5f124ac65b5f45d29749ebb5d6cf17db23b" + integrity sha512-Zx2rErtgc0gxjX5PURjp6sjDQfzxBChUE9YWN37Xh+Ysm3tTGcXlF0Emwl94MZ640NfmYRpG4AWdik6kbaU5Wg== + dependencies: + "@abp/core" "~8.3.4" + jquery "~3.7.1" + +"@abp/lodash@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-8.3.4.tgz#b0ef4e82a788ae7389a31793c3bad6702efdbe33" + integrity sha512-yGd/oLds0jpTgTpmkFYOEomS4K15DGcffMP3N1t0qKLgTaBYTQzeugHVgQ0baufC+OvLjumDNuu3eHjBJewwKg== + dependencies: + "@abp/core" "~8.3.4" + lodash "^4.17.21" + +"@abp/luxon@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-8.3.4.tgz#f152b2d7b62bd27f3d27aa3a1794b868bf06a1a4" + integrity sha512-l1nvfqdhHBgHBPK+bLClAEprRK3K5zx5Jar93o5++6r3zXUhYi5OUHUxl+LuGn8MXLvHJVGL41irHl6sYjFSww== + dependencies: + "@abp/core" "~8.3.4" + luxon "^3.4.4" + +"@abp/malihu-custom-scrollbar-plugin@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-8.3.4.tgz#0868214884e3e0b94dade0e8e78c01741d71106a" + integrity sha512-uKRk8+HCvXtpmvof5W09908AkivlweErTE62b0JhkrJVIlYt/0LC1MmB/qHHBfPj6OK05HYGBi3inr7fNAPXEQ== + dependencies: + "@abp/core" "~8.3.4" + malihu-custom-scrollbar-plugin "^3.1.5" + +"@abp/moment@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/moment/-/moment-8.3.4.tgz#a5809520dc50b50402ade4ac630c6ec985fd4518" + integrity sha512-61J8drO3OqkaaAn66xBg6jCws1iV6zutjYQvpEXLdGBA9Kvw2J87GSomxJ4mcIo/5+jzrVro6JYaCfKWY8b1dw== + dependencies: + moment "^2.30.1" + +"@abp/select2@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-8.3.4.tgz#1731b465760e0515d0d4280f38189c9366fecda5" + integrity sha512-sPtYstFVvMTT8fdXRIfHeODIgSN2ufWm6zCMGH7C0cST3FF59M4m/MtdKGBlA/itzHPxeDv7A6dy4Aw4l7Gk4Q== + dependencies: + "@abp/core" "~8.3.4" + select2 "^4.0.13" + +"@abp/sweetalert2@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/sweetalert2/-/sweetalert2-8.3.4.tgz#c0768ca4fe0a9926b8f33d8bf5251d3e4202cd2f" + integrity sha512-6HqxISh+FodwUsCrR3nX49RQDhzHtDlz8ul42TecUMsGa96qX2lvwnoWkXAHLG3mdLRy62Z0dhJ1JKMfrPeJeg== + dependencies: + "@abp/core" "~8.3.4" + sweetalert2 "^11.3.6" + +"@abp/timeago@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-8.3.4.tgz#26ca0bec90d861f9f4af714061b370950551c839" + integrity sha512-cDARYysPn5Rr/9rqVn7S4sBWbeEpaIXr8NKwGZqNOzMF2g283SkLKrkQJBWIC6Pn2lVeIB7AV1+GtVn81V/nnw== + dependencies: + "@abp/jquery" "~8.3.4" + timeago "^1.6.7" + +"@abp/toastr@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-8.3.4.tgz#cb433bc4ed2e302f2704ad0456c99d6f12fd0529" + integrity sha512-29C9GgwlumrHgt1iZ4lArDnlXfSvmCHDehxkbDutrkC1m257UxQaOID11us2UeCs3JobueQcLlQKD/LqnDB4xA== + dependencies: + "@abp/jquery" "~8.3.4" + toastr "^2.1.4" + +"@abp/utils@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/utils/-/utils-8.3.4.tgz#4b06575a110e85e2a360294f678b782818e1ab10" + integrity sha512-7Lq3wdk/07vKgQnR56DTmdSuYRABMe0XTGPJRS5F91DVbggeJyDUaqifVvOeurF/3CZJOS7fJpoIHQXeUveFtQ== + dependencies: + just-compare "^2.3.0" + +"@fortawesome/fontawesome-free@^6.5.2": + version "6.7.2" + resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-6.7.2.tgz#8249de9b7e22fcb3ceb5e66090c30a1d5492b81a" + integrity sha512-JUOtgFW6k9u4Y+xeIaEiLr3+cjoUPiAuLXoyKOJSia6Duzb7pq+A76P9ZdPDoAoxHdHzq6gE9/jKBGXlZT8FbA== + +ansi-colors@^4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" + integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw== + +bootstrap-datepicker@^1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/bootstrap-datepicker/-/bootstrap-datepicker-1.10.0.tgz#61612bbe8bf0a69a5bce32bbcdda93ebb6ccf24a" + integrity sha512-lWxtSYddAQOpbAO8UhYhHLcK6425eWoSjb5JDvZU3ePHEPF6A3eUr51WKaFy4PccU19JRxUG6wEU3KdhtKfvpg== + dependencies: + jquery ">=3.4.0 <4.0.0" + +bootstrap-daterangepicker@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/bootstrap-daterangepicker/-/bootstrap-daterangepicker-3.1.0.tgz#632e6fb2de4b6360c5c0a9d5f6adb9aace051fe8" + integrity sha512-oaQZx6ZBDo/dZNyXGVi2rx5GmFXThyQLAxdtIqjtLlYVaQUfQALl5JZMJJZzyDIX7blfy4ppZPAJ10g8Ma4d/g== + dependencies: + jquery ">=1.10" + moment "^2.9.0" + +bootstrap@^5.3.3: + version "5.3.8" + resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-5.3.8.tgz#6401a10057a22752d21f4e19055508980656aeed" + integrity sha512-HP1SZDqaLDPwsNiqRqi5NcP0SSXciX2s9E+RyqJIIqGo+vJeN5AJVM98CXmW/Wux0nQ5L7jeWUdplCEf0Ee+tg== + +datatables.net-bs5@^2.0.8: + version "2.3.3" + resolved "https://registry.yarnpkg.com/datatables.net-bs5/-/datatables.net-bs5-2.3.3.tgz#8bf3aec484a69e373f6007038eaac0cc0ef4ee15" + integrity sha512-IPtC57k3KyZaLzIYTHies23Cm2zqaKfD6lkxy/aOAUUAtsg35l53VqNY9y84AEySYG3YLghMHVBvl2ckUhvm0A== + dependencies: + datatables.net "2.3.3" + jquery ">=1.7" + +datatables.net@2.3.3, datatables.net@^2.0.8: + version "2.3.3" + resolved "https://registry.yarnpkg.com/datatables.net/-/datatables.net-2.3.3.tgz#fe4f96bdbc4cf47c8d11162a7af525ca6a3683d2" + integrity sha512-SWL3za6nheY6gdoiLgCc++tYmxbwrmv2bjrEiII9rXBWXXSbOZct6pjR3FueMVRM5jmt7pQcXiGovfuFDnutQg== + dependencies: + jquery ">=1.7" + +jquery-form@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/jquery-form/-/jquery-form-4.3.0.tgz#7d3961c314a1f2d15298f4af1d3943f54f4149c6" + integrity sha512-q3uaVCEWdLOYUCI6dpNdwf/7cJFOsUgdpq6r0taxtGQ5NJSkOzofyWm4jpOuJ5YxdmL1FI5QR+q+HB63HHLGnQ== + dependencies: + jquery ">=1.7.2" + +jquery-mousewheel@>=3.0.6: + version "3.2.2" + resolved "https://registry.yarnpkg.com/jquery-mousewheel/-/jquery-mousewheel-3.2.2.tgz#48c833f6260ee0c46d438a999e7d0060ec9eed0b" + integrity sha512-JP71xTAg08ZY3hcs9ZbYUZ5i+dkSsz4yRl/zpWkAmtzc+kMs5EfPkpkINSidiLYMaR0MTo3DfFGF9WIezMsFQQ== + dependencies: + jquery ">=1.2.6" + +jquery-validation-unobtrusive@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-4.0.0.tgz#dfcf25a558496a2c883db6021d10f5398d15f99d" + integrity sha512-1ervYFFv6LX/rp7ktuLnMakHNG0piNRDyROI8Ir3hL1vPIwylAehB1AY3BPrYJnzW3WmwWryZq+Bz4sazZK9iQ== + dependencies: + jquery "^3.6.0" + jquery-validation ">=1.19" + +jquery-validation@>=1.19, jquery-validation@^1.20.1: + version "1.21.0" + resolved "https://registry.yarnpkg.com/jquery-validation/-/jquery-validation-1.21.0.tgz#78fc05ab76020912a246af3661b3f54a438bca93" + integrity sha512-xNot0rlUIgu7duMcQ5qb6MGkGL/Z1PQaRJQoZAURW9+a/2PGOUxY36o/WyNeP2T9R6jvWB8Z9lUVvvQWI/Zs5w== + +jquery@>=1.10, jquery@>=1.12.0, jquery@>=1.2.6, "jquery@>=1.5.0 <4.0", jquery@>=1.7, jquery@>=1.7.2, "jquery@>=3.4.0 <4.0.0", jquery@^3.6.0, jquery@~3.7.1: + version "3.7.1" + resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.7.1.tgz#083ef98927c9a6a74d05a6af02806566d16274de" + integrity sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg== + +just-compare@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/just-compare/-/just-compare-2.3.0.tgz#a2adcc1d1940536263275f5a1ef1298bcacfeda7" + integrity sha512-6shoR7HDT+fzfL3gBahx1jZG3hWLrhPAf+l7nCwahDdT9XDtosB9kIF0ZrzUp5QY8dJWfQVr5rnsPqsbvflDzg== + +lodash@^4.17.21: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + +luxon@^3.4.4: + version "3.7.2" + resolved "https://registry.yarnpkg.com/luxon/-/luxon-3.7.2.tgz#d697e48f478553cca187a0f8436aff468e3ba0ba" + integrity sha512-vtEhXh/gNjI9Yg1u4jX/0YVPMvxzHuGgCm6tC5kZyb08yjGWGnqAjGJvcXbqQR2P3MyMEFnRbpcdFS6PBcLqew== + +malihu-custom-scrollbar-plugin@^3.1.5: + version "3.1.5" + resolved "https://registry.yarnpkg.com/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-3.1.5.tgz#310cecc5e59415a1c29e9dfb5d2b6e01d66a29ef" + integrity sha512-lwW3LgI+CNDMPnP4ED2la6oYxWMkCXlnhex+s2wuOLhFDFGnGmQuTQVdRK9bvDLpxs10sGlfErVufJy9ztfgJQ== + dependencies: + jquery-mousewheel ">=3.0.6" + +moment@^2.30.1, moment@^2.9.0: + version "2.30.1" + resolved "https://registry.yarnpkg.com/moment/-/moment-2.30.1.tgz#f8c91c07b7a786e30c59926df530b4eac96974ae" + integrity sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how== + +select2@^4.0.13: + version "4.0.13" + resolved "https://registry.yarnpkg.com/select2/-/select2-4.0.13.tgz#0dbe377df3f96167c4c1626033e924372d8ef44d" + integrity sha512-1JeB87s6oN/TDxQQYCvS5EFoQyvV6eYMZZ0AeA4tdFDYWN3BAGZ8npr17UBFddU0lgAt3H0yjX3X6/ekOj1yjw== + +sweetalert2@^11.3.6: + version "11.23.0" + resolved "https://registry.yarnpkg.com/sweetalert2/-/sweetalert2-11.23.0.tgz#ba8a051b1e94215c762af08692171b7b4611c4c1" + integrity sha512-cKzzbC3C1sIs7o9XAMw4E8F9kBtGXsBDUsd2JZ8JM/dqa+nzWwSGM+9LLYILZWzWHzX9W+HJNHyBlbHPVS/krw== + +timeago@^1.6.7: + version "1.6.7" + resolved "https://registry.yarnpkg.com/timeago/-/timeago-1.6.7.tgz#afd467c29a911e697fc22a81888c7c3022783cb5" + integrity sha512-FikcjN98+ij0siKH4VO4dZ358PR3oDDq4Vdl1+sN9gWz1/+JXGr3uZbUShYH/hL7bMhcTpPbplJU5Tej4b4jbQ== + dependencies: + jquery ">=1.5.0 <4.0" + +toastr@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/toastr/-/toastr-2.1.4.tgz#8b43be64fb9d0c414871446f2db8e8ca4e95f181" + integrity sha512-LIy77F5n+sz4tefMmFOntcJ6HL0Fv3k1TDnNmFZ0bU/GcvIIfy6eG2v7zQmMiYgaalAiUv75ttFrPn5s0gyqlA== + dependencies: + jquery ">=1.12.0" diff --git a/microservices/KonSoft.Dispatch.HttpApi.Host/Controllers/HomeController.cs b/microservices/KonSoft.Dispatch.HttpApi.Host/Controllers/HomeController.cs new file mode 100644 index 0000000..9c0bb17 --- /dev/null +++ b/microservices/KonSoft.Dispatch.HttpApi.Host/Controllers/HomeController.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc; + +namespace KonSoft.Dispatch.Controllers; + +public class HomeController : AbpController +{ + public ActionResult Index() + { + return Redirect("~/swagger"); + } +} diff --git a/microservices/KonSoft.Dispatch.HttpApi.Host/DispatchBrandingProvider.cs b/microservices/KonSoft.Dispatch.HttpApi.Host/DispatchBrandingProvider.cs new file mode 100644 index 0000000..8337c66 --- /dev/null +++ b/microservices/KonSoft.Dispatch.HttpApi.Host/DispatchBrandingProvider.cs @@ -0,0 +1,19 @@ +using Microsoft.Extensions.Localization; +using KonSoft.Dispatch.Localization; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Ui.Branding; + +namespace KonSoft.Dispatch; + +[Dependency(ReplaceServices = true)] +public class DispatchBrandingProvider : DefaultBrandingProvider +{ + private IStringLocalizer _localizer; + + public DispatchBrandingProvider(IStringLocalizer localizer) + { + _localizer = localizer; + } + + public override string AppName => _localizer["AppName"]; +} diff --git a/microservices/KonSoft.Dispatch.HttpApi.Host/DispatchHttpApiHostModule.cs b/microservices/KonSoft.Dispatch.HttpApi.Host/DispatchHttpApiHostModule.cs new file mode 100644 index 0000000..dbf0e2f --- /dev/null +++ b/microservices/KonSoft.Dispatch.HttpApi.Host/DispatchHttpApiHostModule.cs @@ -0,0 +1,224 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Cors; +using Microsoft.AspNetCore.Extensions.DependencyInjection; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using KonSoft.Dispatch.EntityFrameworkCore; +using KonSoft.Dispatch.MultiTenancy; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite.Bundling; +using Microsoft.OpenApi.Models; +using OpenIddict.Validation.AspNetCore; +using Volo.Abp; +using Volo.Abp.Account; +using Volo.Abp.Account.Web; +using Volo.Abp.AspNetCore.MultiTenancy; +using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; +using Volo.Abp.AspNetCore.Serilog; +using Volo.Abp.Autofac; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Volo.Abp.Security.Claims; +using Volo.Abp.Swashbuckle; +using Volo.Abp.UI.Navigation.Urls; +using Volo.Abp.VirtualFileSystem; + +namespace KonSoft.Dispatch; + +[DependsOn( + typeof(DispatchHttpApiModule), + typeof(AbpAutofacModule), + typeof(AbpAspNetCoreMultiTenancyModule), + typeof(DispatchApplicationModule), + typeof(DispatchEntityFrameworkCoreModule), + typeof(AbpAspNetCoreMvcUiLeptonXLiteThemeModule), + typeof(AbpAccountWebOpenIddictModule), + typeof(AbpAspNetCoreSerilogModule), + typeof(AbpSwashbuckleModule) +)] +public class DispatchHttpApiHostModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PreConfigure(builder => + { + builder.AddValidation(options => + { + options.AddAudiences("Dispatch"); + options.UseLocalServer(); + options.UseAspNetCore(); + }); + }); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + var configuration = context.Services.GetConfiguration(); + var hostingEnvironment = context.Services.GetHostingEnvironment(); + + ConfigureAuthentication(context); + ConfigureBundles(); + ConfigureUrls(configuration); + ConfigureConventionalControllers(); + ConfigureVirtualFileSystem(context); + ConfigureCors(context, configuration); + ConfigureSwaggerServices(context, configuration); + } + + private void ConfigureAuthentication(ServiceConfigurationContext context) + { + context.Services.ForwardIdentityAuthenticationForBearer(OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme); + context.Services.Configure(options => + { + options.IsDynamicClaimsEnabled = true; + }); + } + + private void ConfigureBundles() + { + Configure(options => + { + options.StyleBundles.Configure( + LeptonXLiteThemeBundles.Styles.Global, + bundle => + { + bundle.AddFiles("/global-styles.css"); + } + ); + }); + } + + private void ConfigureUrls(IConfiguration configuration) + { + Configure(options => + { + options.Applications["MVC"].RootUrl = configuration["App:SelfUrl"]; + options.RedirectAllowedUrls.AddRange(configuration["App:RedirectAllowedUrls"]?.Split(',') ?? Array.Empty()); + + options.Applications["Angular"].RootUrl = configuration["App:ClientUrl"]; + options.Applications["Angular"].Urls[AccountUrlNames.PasswordReset] = "account/reset-password"; + }); + } + + private void ConfigureVirtualFileSystem(ServiceConfigurationContext context) + { + var hostingEnvironment = context.Services.GetHostingEnvironment(); + + if (hostingEnvironment.IsDevelopment()) + { + Configure(options => + { + options.FileSets.ReplaceEmbeddedByPhysical( + Path.Combine(hostingEnvironment.ContentRootPath, + $"..{Path.DirectorySeparatorChar}KonSoft.Dispatch.Domain.Shared")); + options.FileSets.ReplaceEmbeddedByPhysical( + Path.Combine(hostingEnvironment.ContentRootPath, + $"..{Path.DirectorySeparatorChar}KonSoft.Dispatch.Domain")); + options.FileSets.ReplaceEmbeddedByPhysical( + Path.Combine(hostingEnvironment.ContentRootPath, + $"..{Path.DirectorySeparatorChar}KonSoft.Dispatch.Application.Contracts")); + options.FileSets.ReplaceEmbeddedByPhysical( + Path.Combine(hostingEnvironment.ContentRootPath, + $"..{Path.DirectorySeparatorChar}KonSoft.Dispatch.Application")); + }); + } + } + + private void ConfigureConventionalControllers() + { + Configure(options => + { + options.ConventionalControllers.Create(typeof(DispatchApplicationModule).Assembly); + }); + } + + private static void ConfigureSwaggerServices(ServiceConfigurationContext context, IConfiguration configuration) + { + context.Services.AddAbpSwaggerGenWithOAuth( + configuration["AuthServer:Authority"]!, + new Dictionary + { + {"Dispatch", "Dispatch API"} + }, + options => + { + options.SwaggerDoc("v1", new OpenApiInfo { Title = "Dispatch API", Version = "v1" }); + options.DocInclusionPredicate((docName, description) => true); + options.CustomSchemaIds(type => type.FullName); + }); + } + + private void ConfigureCors(ServiceConfigurationContext context, IConfiguration configuration) + { + context.Services.AddCors(options => + { + options.AddDefaultPolicy(builder => + { + builder + .WithOrigins(configuration["App:CorsOrigins"]? + .Split(",", StringSplitOptions.RemoveEmptyEntries) + .Select(o => o.RemovePostFix("/")) + .ToArray() ?? Array.Empty()) + .WithAbpExposedHeaders() + .SetIsOriginAllowedToAllowWildcardSubdomains() + .AllowAnyHeader() + .AllowAnyMethod() + .AllowCredentials(); + }); + }); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + var app = context.GetApplicationBuilder(); + var env = context.GetEnvironment(); + + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.UseAbpRequestLocalization(); + + if (!env.IsDevelopment()) + { + app.UseErrorPage(); + } + + app.UseCorrelationId(); + app.UseStaticFiles(); + app.UseRouting(); + app.UseCors(); + app.UseAuthentication(); + app.UseAbpOpenIddictValidation(); + + if (MultiTenancyConsts.IsEnabled) + { + app.UseMultiTenancy(); + } + app.UseUnitOfWork(); + app.UseDynamicClaims(); + app.UseAuthorization(); + + app.UseSwagger(); + app.UseAbpSwaggerUI(c => + { + c.SwaggerEndpoint("/swagger/v1/swagger.json", "Dispatch API"); + + var configuration = context.ServiceProvider.GetRequiredService(); + c.OAuthClientId(configuration["AuthServer:SwaggerClientId"]); + c.OAuthScopes("Dispatch"); + }); + + app.UseAuditing(); + app.UseAbpSerilogEnrichers(); + app.UseConfiguredEndpoints(); + } +} diff --git a/microservices/KonSoft.Dispatch.HttpApi.Host/KonSoft.Dispatch.HttpApi.Host.csproj b/microservices/KonSoft.Dispatch.HttpApi.Host/KonSoft.Dispatch.HttpApi.Host.csproj new file mode 100644 index 0000000..4626828 --- /dev/null +++ b/microservices/KonSoft.Dispatch.HttpApi.Host/KonSoft.Dispatch.HttpApi.Host.csproj @@ -0,0 +1,40 @@ + + + + + + net8.0 + enable + KonSoft.Dispatch + true + KonSoft.Dispatch-4681b4fd-151f-4221-84a4-929d86723e4c + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/microservices/KonSoft.Dispatch.HttpApi.Host/Program.cs b/microservices/KonSoft.Dispatch.HttpApi.Host/Program.cs new file mode 100644 index 0000000..caa2139 --- /dev/null +++ b/microservices/KonSoft.Dispatch.HttpApi.Host/Program.cs @@ -0,0 +1,56 @@ +using System; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Serilog; +using Serilog.Events; + +namespace KonSoft.Dispatch; + +public class Program +{ + public async static Task Main(string[] args) + { + Log.Logger = new LoggerConfiguration() +#if DEBUG + .MinimumLevel.Debug() +#else + .MinimumLevel.Information() +#endif + .MinimumLevel.Override("Microsoft", LogEventLevel.Information) + .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) + .Enrich.FromLogContext() + .WriteTo.Async(c => c.File("Logs/logs.txt")) + .WriteTo.Async(c => c.Console()) + .CreateLogger(); + + try + { + Log.Information("Starting KonSoft.Dispatch.HttpApi.Host."); + var builder = WebApplication.CreateBuilder(args); + builder.Host.AddAppSettingsSecretsJson() + .UseAutofac() + .UseSerilog(); + await builder.AddApplicationAsync(); + var app = builder.Build(); + await app.InitializeApplicationAsync(); + await app.RunAsync(); + return 0; + } + catch (Exception ex) + { + if (ex is HostAbortedException) + { + throw; + } + + Log.Fatal(ex, "Host terminated unexpectedly!"); + return 1; + } + finally + { + Log.CloseAndFlush(); + } + } +} diff --git a/microservices/KonSoft.Dispatch.HttpApi.Host/Properties/launchSettings.json b/microservices/KonSoft.Dispatch.HttpApi.Host/Properties/launchSettings.json new file mode 100644 index 0000000..10bade1 --- /dev/null +++ b/microservices/KonSoft.Dispatch.HttpApi.Host/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "https://localhost:44321", + "sslPort": 44321 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "KonSoft.Dispatch.HttpApi.Host": { + "commandName": "Project", + "launchBrowser": true, + "applicationUrl": "https://localhost:44321", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/microservices/KonSoft.Dispatch.HttpApi.Host/abp.resourcemapping.js b/microservices/KonSoft.Dispatch.HttpApi.Host/abp.resourcemapping.js new file mode 100644 index 0000000..4a2ad45 --- /dev/null +++ b/microservices/KonSoft.Dispatch.HttpApi.Host/abp.resourcemapping.js @@ -0,0 +1,11 @@ +module.exports = { + aliases: { + + }, + clean: [ + + ], + mappings: { + + } +}; diff --git a/microservices/KonSoft.Dispatch.HttpApi.Host/appsettings.Development.json b/microservices/KonSoft.Dispatch.HttpApi.Host/appsettings.Development.json new file mode 100644 index 0000000..2c63c08 --- /dev/null +++ b/microservices/KonSoft.Dispatch.HttpApi.Host/appsettings.Development.json @@ -0,0 +1,2 @@ +{ +} diff --git a/microservices/KonSoft.Dispatch.HttpApi.Host/appsettings.json b/microservices/KonSoft.Dispatch.HttpApi.Host/appsettings.json new file mode 100644 index 0000000..094bd17 --- /dev/null +++ b/microservices/KonSoft.Dispatch.HttpApi.Host/appsettings.json @@ -0,0 +1,18 @@ +{ + "App": { + "SelfUrl": "https://localhost:44321", + "CorsOrigins": "https://*.Dispatch.com", + "RedirectAllowedUrls": "" + }, + "ConnectionStrings": { + "Default": "Host=localhost;Port=5432;Database=Dispatch;User ID=root;Password=myPassword;" + }, + "AuthServer": { + "Authority": "https://localhost:44321", + "RequireHttpsMetadata": false, + "SwaggerClientId": "Dispatch_Swagger" + }, + "StringEncryption": { + "DefaultPassPhrase": "AcY4JMdp6hCRgMYj" + } +} diff --git a/microservices/KonSoft.Dispatch.HttpApi.Host/appsettings.secrets.json b/microservices/KonSoft.Dispatch.HttpApi.Host/appsettings.secrets.json new file mode 100644 index 0000000..7a73a41 --- /dev/null +++ b/microservices/KonSoft.Dispatch.HttpApi.Host/appsettings.secrets.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/microservices/KonSoft.Dispatch.HttpApi.Host/package.json b/microservices/KonSoft.Dispatch.HttpApi.Host/package.json new file mode 100644 index 0000000..b8d616a --- /dev/null +++ b/microservices/KonSoft.Dispatch.HttpApi.Host/package.json @@ -0,0 +1,8 @@ +{ + "version": "1.0.0", + "name": "my-app", + "private": true, + "dependencies": { + "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~3.3.4" + } +} diff --git a/microservices/KonSoft.Dispatch.HttpApi.Host/web.config b/microservices/KonSoft.Dispatch.HttpApi.Host/web.config new file mode 100644 index 0000000..729e3cd --- /dev/null +++ b/microservices/KonSoft.Dispatch.HttpApi.Host/web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/microservices/KonSoft.Dispatch.HttpApi.Host/wwwroot/global-styles.css b/microservices/KonSoft.Dispatch.HttpApi.Host/wwwroot/global-styles.css new file mode 100644 index 0000000..74db4bd --- /dev/null +++ b/microservices/KonSoft.Dispatch.HttpApi.Host/wwwroot/global-styles.css @@ -0,0 +1,6 @@ +/* Your Global Styles */ + +:root .lpx-brand-logo { + --lpx-logo: url('/images/logo/leptonx/logo-light.png'); + --lpx-logo-icon: url('/images/logo/leptonx/logo-light-thumbnail.png'); +} \ No newline at end of file diff --git a/microservices/KonSoft.Dispatch.HttpApi.Host/wwwroot/images/logo/leptonx/logo-dark-thumbnail.png b/microservices/KonSoft.Dispatch.HttpApi.Host/wwwroot/images/logo/leptonx/logo-dark-thumbnail.png new file mode 100644 index 0000000..9734a07 Binary files /dev/null and b/microservices/KonSoft.Dispatch.HttpApi.Host/wwwroot/images/logo/leptonx/logo-dark-thumbnail.png differ diff --git a/microservices/KonSoft.Dispatch.HttpApi.Host/wwwroot/images/logo/leptonx/logo-dark.png b/microservices/KonSoft.Dispatch.HttpApi.Host/wwwroot/images/logo/leptonx/logo-dark.png new file mode 100644 index 0000000..a3bbe82 Binary files /dev/null and b/microservices/KonSoft.Dispatch.HttpApi.Host/wwwroot/images/logo/leptonx/logo-dark.png differ diff --git a/microservices/KonSoft.Dispatch.HttpApi.Host/wwwroot/images/logo/leptonx/logo-light-thumbnail.png b/microservices/KonSoft.Dispatch.HttpApi.Host/wwwroot/images/logo/leptonx/logo-light-thumbnail.png new file mode 100644 index 0000000..ca39184 Binary files /dev/null and b/microservices/KonSoft.Dispatch.HttpApi.Host/wwwroot/images/logo/leptonx/logo-light-thumbnail.png differ diff --git a/microservices/KonSoft.Dispatch.HttpApi.Host/wwwroot/images/logo/leptonx/logo-light.png b/microservices/KonSoft.Dispatch.HttpApi.Host/wwwroot/images/logo/leptonx/logo-light.png new file mode 100644 index 0000000..761fb44 Binary files /dev/null and b/microservices/KonSoft.Dispatch.HttpApi.Host/wwwroot/images/logo/leptonx/logo-light.png differ diff --git a/microservices/KonSoft.Dispatch.HttpApi.Host/yarn.lock b/microservices/KonSoft.Dispatch.HttpApi.Host/yarn.lock new file mode 100644 index 0000000..1dfe9d4 --- /dev/null +++ b/microservices/KonSoft.Dispatch.HttpApi.Host/yarn.lock @@ -0,0 +1,322 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@abp/aspnetcore.mvc.ui.theme.leptonxlite@~3.3.4": + version "3.3.4" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.leptonxlite/-/aspnetcore.mvc.ui.theme.leptonxlite-3.3.4.tgz#fb6879075aec2f06e0302e941dcefbe519b18e1d" + integrity sha512-5rrwwZ9n2/yePo+GnHuUsP0TelCwRwCQjYyQFdF/Nd4B3UNQVO/AXQc0Ep3+vHhUxSL386j6ObZYu14VdjPg2g== + dependencies: + "@abp/aspnetcore.mvc.ui.theme.shared" "~8.3.4" + +"@abp/aspnetcore.mvc.ui.theme.shared@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-8.3.4.tgz#169ae0893302ced9256f94174d9bb870e49f446c" + integrity sha512-bZy8iAIN0QfNJXCRg+RR1NxqTzNDSXRPBx+ksFtDxY6FzMJvwwSOmHF0wqsMLj1xpwXjijWaVWQ2RM/7scDWmw== + dependencies: + "@abp/aspnetcore.mvc.ui" "~8.3.4" + "@abp/bootstrap" "~8.3.4" + "@abp/bootstrap-datepicker" "~8.3.4" + "@abp/bootstrap-daterangepicker" "~8.3.4" + "@abp/datatables.net-bs5" "~8.3.4" + "@abp/font-awesome" "~8.3.4" + "@abp/jquery-form" "~8.3.4" + "@abp/jquery-validation-unobtrusive" "~8.3.4" + "@abp/lodash" "~8.3.4" + "@abp/luxon" "~8.3.4" + "@abp/malihu-custom-scrollbar-plugin" "~8.3.4" + "@abp/moment" "~8.3.4" + "@abp/select2" "~8.3.4" + "@abp/sweetalert2" "~8.3.4" + "@abp/timeago" "~8.3.4" + "@abp/toastr" "~8.3.4" + +"@abp/aspnetcore.mvc.ui@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-8.3.4.tgz#041d83f34541081d9e0f37c36c302cbe871a4897" + integrity sha512-sjGE/EoNM98mXNYPze2C7GPP+TNpv4TLIt416ojaqtxru60oddr4VWrOGuhaqUCO2jJes3OwFZi5PY3hVOBbYw== + dependencies: + ansi-colors "^4.1.3" + +"@abp/bootstrap-datepicker@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-8.3.4.tgz#072f4a3cea93e3a1bb1de13b355201648929f84c" + integrity sha512-txilFovf9zT1w+fTkyI3eZdiISjaxc/+wRRFKwrkVH+0xEgaiR41svKm6sjWBORxgTddlGas87SZJvYY3IKBjA== + dependencies: + bootstrap-datepicker "^1.10.0" + +"@abp/bootstrap-daterangepicker@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/bootstrap-daterangepicker/-/bootstrap-daterangepicker-8.3.4.tgz#b0f65611ca4fafdf2b551f9f139868eae6e22e9a" + integrity sha512-bYkYjk1zTdWcM4DGwnDoU+4pDvs1S8hkNWhrnpP0o8oRoJiesO8Aeda+82rtydtWnxHg+HkDC0iYFFqaNuHvbg== + dependencies: + bootstrap-daterangepicker "^3.1.0" + +"@abp/bootstrap@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-8.3.4.tgz#744bb4d30d4c269ce8e6a7d16c6777dd3cd9fe1e" + integrity sha512-GXCLFFmPNaR3DjQYSaqACL5sH/M9FPia2OKAAMOd796+NmcoFpT+S7l4C6ihqeQc4bjFm0voB8QklueGWx6r8A== + dependencies: + "@abp/core" "~8.3.4" + bootstrap "^5.3.3" + +"@abp/core@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/core/-/core-8.3.4.tgz#12635bc2ac325a426334150502a32fefa4ec3767" + integrity sha512-wImAdZABahaQe6mmZAZlPfYZ3PEhL7eEq+18c1WFO0xeD98oxqi8H1X7+3ABjyFscIh9LIxJVaD3RJ9OHCc5bw== + dependencies: + "@abp/utils" "~8.3.4" + +"@abp/datatables.net-bs5@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs5/-/datatables.net-bs5-8.3.4.tgz#efc28fa57144c7b495a4aeea38df962807ca20df" + integrity sha512-u85aXjqYIJJfOsMq6oNqfxNgxQqV6vOEnJ32vrH294ceW8RzUxHA+G/ZkGRLLRGWVuxuARD/UXzEotH5sd1Ssw== + dependencies: + "@abp/datatables.net" "~8.3.4" + datatables.net-bs5 "^2.0.8" + +"@abp/datatables.net@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-8.3.4.tgz#23a3155a2d84247a29a6b80ff98d1d5f6422a245" + integrity sha512-cwE9TFoRoszmI3zNVaYJtqjSPtwkL9dhCfE02zsmJo8GBdFAlbzAmQenfQiWb3BZhvUvKKN20e+og9S8qoCbXA== + dependencies: + "@abp/jquery" "~8.3.4" + datatables.net "^2.0.8" + +"@abp/font-awesome@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-8.3.4.tgz#f79f7b439f9ffadfc03be3a415a977eab21fa5a1" + integrity sha512-5+D5XKnrZROtg9PJ2zex52gbphXGK/7ZIUsszEg8rOIc/niXggaZLmuDcYJwOEzIkwpGO9OvYy7lc0tHv/Pr4g== + dependencies: + "@abp/core" "~8.3.4" + "@fortawesome/fontawesome-free" "^6.5.2" + +"@abp/jquery-form@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-8.3.4.tgz#c1705bd5213ab5c2b895dd5bd9f3e54f3d94cf54" + integrity sha512-vFjWbTbHQyIsk5SS7Cc+5YrJ15ORjJU+YWVPchI0qoug26for06a7lDGpazWMadxx3iPL7cKLqneOqaVtHkgJA== + dependencies: + "@abp/jquery" "~8.3.4" + jquery-form "^4.3.0" + +"@abp/jquery-validation-unobtrusive@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-8.3.4.tgz#e89eafed89787bcb5221c0ba89832b79a7396d19" + integrity sha512-+kJA5vfvxkrj/iW4Q84BrMTrAGOhC2Hb5czAKr6c60Prmayk5hcakZdXc3wDBHREBLVAq1Muk4AtEJZmaKIeaA== + dependencies: + "@abp/jquery-validation" "~8.3.4" + jquery-validation-unobtrusive "^4.0.0" + +"@abp/jquery-validation@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-8.3.4.tgz#a445592d80edc6b6b1334ece2007b3084c329cc6" + integrity sha512-XvL0H3IRuSHwpPKUyJmW6PH8KwPDt9NllMqPGreRANF8l5IU10hOLEeP2BnGFfGMqFwqUMh+eJRar5yZcegkmg== + dependencies: + "@abp/jquery" "~8.3.4" + jquery-validation "^1.20.1" + +"@abp/jquery@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-8.3.4.tgz#2dc3f5f124ac65b5f45d29749ebb5d6cf17db23b" + integrity sha512-Zx2rErtgc0gxjX5PURjp6sjDQfzxBChUE9YWN37Xh+Ysm3tTGcXlF0Emwl94MZ640NfmYRpG4AWdik6kbaU5Wg== + dependencies: + "@abp/core" "~8.3.4" + jquery "~3.7.1" + +"@abp/lodash@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-8.3.4.tgz#b0ef4e82a788ae7389a31793c3bad6702efdbe33" + integrity sha512-yGd/oLds0jpTgTpmkFYOEomS4K15DGcffMP3N1t0qKLgTaBYTQzeugHVgQ0baufC+OvLjumDNuu3eHjBJewwKg== + dependencies: + "@abp/core" "~8.3.4" + lodash "^4.17.21" + +"@abp/luxon@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-8.3.4.tgz#f152b2d7b62bd27f3d27aa3a1794b868bf06a1a4" + integrity sha512-l1nvfqdhHBgHBPK+bLClAEprRK3K5zx5Jar93o5++6r3zXUhYi5OUHUxl+LuGn8MXLvHJVGL41irHl6sYjFSww== + dependencies: + "@abp/core" "~8.3.4" + luxon "^3.4.4" + +"@abp/malihu-custom-scrollbar-plugin@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-8.3.4.tgz#0868214884e3e0b94dade0e8e78c01741d71106a" + integrity sha512-uKRk8+HCvXtpmvof5W09908AkivlweErTE62b0JhkrJVIlYt/0LC1MmB/qHHBfPj6OK05HYGBi3inr7fNAPXEQ== + dependencies: + "@abp/core" "~8.3.4" + malihu-custom-scrollbar-plugin "^3.1.5" + +"@abp/moment@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/moment/-/moment-8.3.4.tgz#a5809520dc50b50402ade4ac630c6ec985fd4518" + integrity sha512-61J8drO3OqkaaAn66xBg6jCws1iV6zutjYQvpEXLdGBA9Kvw2J87GSomxJ4mcIo/5+jzrVro6JYaCfKWY8b1dw== + dependencies: + moment "^2.30.1" + +"@abp/select2@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-8.3.4.tgz#1731b465760e0515d0d4280f38189c9366fecda5" + integrity sha512-sPtYstFVvMTT8fdXRIfHeODIgSN2ufWm6zCMGH7C0cST3FF59M4m/MtdKGBlA/itzHPxeDv7A6dy4Aw4l7Gk4Q== + dependencies: + "@abp/core" "~8.3.4" + select2 "^4.0.13" + +"@abp/sweetalert2@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/sweetalert2/-/sweetalert2-8.3.4.tgz#c0768ca4fe0a9926b8f33d8bf5251d3e4202cd2f" + integrity sha512-6HqxISh+FodwUsCrR3nX49RQDhzHtDlz8ul42TecUMsGa96qX2lvwnoWkXAHLG3mdLRy62Z0dhJ1JKMfrPeJeg== + dependencies: + "@abp/core" "~8.3.4" + sweetalert2 "^11.3.6" + +"@abp/timeago@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-8.3.4.tgz#26ca0bec90d861f9f4af714061b370950551c839" + integrity sha512-cDARYysPn5Rr/9rqVn7S4sBWbeEpaIXr8NKwGZqNOzMF2g283SkLKrkQJBWIC6Pn2lVeIB7AV1+GtVn81V/nnw== + dependencies: + "@abp/jquery" "~8.3.4" + timeago "^1.6.7" + +"@abp/toastr@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-8.3.4.tgz#cb433bc4ed2e302f2704ad0456c99d6f12fd0529" + integrity sha512-29C9GgwlumrHgt1iZ4lArDnlXfSvmCHDehxkbDutrkC1m257UxQaOID11us2UeCs3JobueQcLlQKD/LqnDB4xA== + dependencies: + "@abp/jquery" "~8.3.4" + toastr "^2.1.4" + +"@abp/utils@~8.3.4": + version "8.3.4" + resolved "https://registry.yarnpkg.com/@abp/utils/-/utils-8.3.4.tgz#4b06575a110e85e2a360294f678b782818e1ab10" + integrity sha512-7Lq3wdk/07vKgQnR56DTmdSuYRABMe0XTGPJRS5F91DVbggeJyDUaqifVvOeurF/3CZJOS7fJpoIHQXeUveFtQ== + dependencies: + just-compare "^2.3.0" + +"@fortawesome/fontawesome-free@^6.5.2": + version "6.7.2" + resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-6.7.2.tgz#8249de9b7e22fcb3ceb5e66090c30a1d5492b81a" + integrity sha512-JUOtgFW6k9u4Y+xeIaEiLr3+cjoUPiAuLXoyKOJSia6Duzb7pq+A76P9ZdPDoAoxHdHzq6gE9/jKBGXlZT8FbA== + +ansi-colors@^4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" + integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw== + +bootstrap-datepicker@^1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/bootstrap-datepicker/-/bootstrap-datepicker-1.10.0.tgz#61612bbe8bf0a69a5bce32bbcdda93ebb6ccf24a" + integrity sha512-lWxtSYddAQOpbAO8UhYhHLcK6425eWoSjb5JDvZU3ePHEPF6A3eUr51WKaFy4PccU19JRxUG6wEU3KdhtKfvpg== + dependencies: + jquery ">=3.4.0 <4.0.0" + +bootstrap-daterangepicker@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/bootstrap-daterangepicker/-/bootstrap-daterangepicker-3.1.0.tgz#632e6fb2de4b6360c5c0a9d5f6adb9aace051fe8" + integrity sha512-oaQZx6ZBDo/dZNyXGVi2rx5GmFXThyQLAxdtIqjtLlYVaQUfQALl5JZMJJZzyDIX7blfy4ppZPAJ10g8Ma4d/g== + dependencies: + jquery ">=1.10" + moment "^2.9.0" + +bootstrap@^5.3.3: + version "5.3.8" + resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-5.3.8.tgz#6401a10057a22752d21f4e19055508980656aeed" + integrity sha512-HP1SZDqaLDPwsNiqRqi5NcP0SSXciX2s9E+RyqJIIqGo+vJeN5AJVM98CXmW/Wux0nQ5L7jeWUdplCEf0Ee+tg== + +datatables.net-bs5@^2.0.8: + version "2.3.3" + resolved "https://registry.yarnpkg.com/datatables.net-bs5/-/datatables.net-bs5-2.3.3.tgz#8bf3aec484a69e373f6007038eaac0cc0ef4ee15" + integrity sha512-IPtC57k3KyZaLzIYTHies23Cm2zqaKfD6lkxy/aOAUUAtsg35l53VqNY9y84AEySYG3YLghMHVBvl2ckUhvm0A== + dependencies: + datatables.net "2.3.3" + jquery ">=1.7" + +datatables.net@2.3.3, datatables.net@^2.0.8: + version "2.3.3" + resolved "https://registry.yarnpkg.com/datatables.net/-/datatables.net-2.3.3.tgz#fe4f96bdbc4cf47c8d11162a7af525ca6a3683d2" + integrity sha512-SWL3za6nheY6gdoiLgCc++tYmxbwrmv2bjrEiII9rXBWXXSbOZct6pjR3FueMVRM5jmt7pQcXiGovfuFDnutQg== + dependencies: + jquery ">=1.7" + +jquery-form@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/jquery-form/-/jquery-form-4.3.0.tgz#7d3961c314a1f2d15298f4af1d3943f54f4149c6" + integrity sha512-q3uaVCEWdLOYUCI6dpNdwf/7cJFOsUgdpq6r0taxtGQ5NJSkOzofyWm4jpOuJ5YxdmL1FI5QR+q+HB63HHLGnQ== + dependencies: + jquery ">=1.7.2" + +jquery-mousewheel@>=3.0.6: + version "3.2.2" + resolved "https://registry.yarnpkg.com/jquery-mousewheel/-/jquery-mousewheel-3.2.2.tgz#48c833f6260ee0c46d438a999e7d0060ec9eed0b" + integrity sha512-JP71xTAg08ZY3hcs9ZbYUZ5i+dkSsz4yRl/zpWkAmtzc+kMs5EfPkpkINSidiLYMaR0MTo3DfFGF9WIezMsFQQ== + dependencies: + jquery ">=1.2.6" + +jquery-validation-unobtrusive@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-4.0.0.tgz#dfcf25a558496a2c883db6021d10f5398d15f99d" + integrity sha512-1ervYFFv6LX/rp7ktuLnMakHNG0piNRDyROI8Ir3hL1vPIwylAehB1AY3BPrYJnzW3WmwWryZq+Bz4sazZK9iQ== + dependencies: + jquery "^3.6.0" + jquery-validation ">=1.19" + +jquery-validation@>=1.19, jquery-validation@^1.20.1: + version "1.21.0" + resolved "https://registry.yarnpkg.com/jquery-validation/-/jquery-validation-1.21.0.tgz#78fc05ab76020912a246af3661b3f54a438bca93" + integrity sha512-xNot0rlUIgu7duMcQ5qb6MGkGL/Z1PQaRJQoZAURW9+a/2PGOUxY36o/WyNeP2T9R6jvWB8Z9lUVvvQWI/Zs5w== + +jquery@>=1.10, jquery@>=1.12.0, jquery@>=1.2.6, "jquery@>=1.5.0 <4.0", jquery@>=1.7, jquery@>=1.7.2, "jquery@>=3.4.0 <4.0.0", jquery@^3.6.0, jquery@~3.7.1: + version "3.7.1" + resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.7.1.tgz#083ef98927c9a6a74d05a6af02806566d16274de" + integrity sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg== + +just-compare@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/just-compare/-/just-compare-2.3.0.tgz#a2adcc1d1940536263275f5a1ef1298bcacfeda7" + integrity sha512-6shoR7HDT+fzfL3gBahx1jZG3hWLrhPAf+l7nCwahDdT9XDtosB9kIF0ZrzUp5QY8dJWfQVr5rnsPqsbvflDzg== + +lodash@^4.17.21: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + +luxon@^3.4.4: + version "3.7.2" + resolved "https://registry.yarnpkg.com/luxon/-/luxon-3.7.2.tgz#d697e48f478553cca187a0f8436aff468e3ba0ba" + integrity sha512-vtEhXh/gNjI9Yg1u4jX/0YVPMvxzHuGgCm6tC5kZyb08yjGWGnqAjGJvcXbqQR2P3MyMEFnRbpcdFS6PBcLqew== + +malihu-custom-scrollbar-plugin@^3.1.5: + version "3.1.5" + resolved "https://registry.yarnpkg.com/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-3.1.5.tgz#310cecc5e59415a1c29e9dfb5d2b6e01d66a29ef" + integrity sha512-lwW3LgI+CNDMPnP4ED2la6oYxWMkCXlnhex+s2wuOLhFDFGnGmQuTQVdRK9bvDLpxs10sGlfErVufJy9ztfgJQ== + dependencies: + jquery-mousewheel ">=3.0.6" + +moment@^2.30.1, moment@^2.9.0: + version "2.30.1" + resolved "https://registry.yarnpkg.com/moment/-/moment-2.30.1.tgz#f8c91c07b7a786e30c59926df530b4eac96974ae" + integrity sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how== + +select2@^4.0.13: + version "4.0.13" + resolved "https://registry.yarnpkg.com/select2/-/select2-4.0.13.tgz#0dbe377df3f96167c4c1626033e924372d8ef44d" + integrity sha512-1JeB87s6oN/TDxQQYCvS5EFoQyvV6eYMZZ0AeA4tdFDYWN3BAGZ8npr17UBFddU0lgAt3H0yjX3X6/ekOj1yjw== + +sweetalert2@^11.3.6: + version "11.23.0" + resolved "https://registry.yarnpkg.com/sweetalert2/-/sweetalert2-11.23.0.tgz#ba8a051b1e94215c762af08692171b7b4611c4c1" + integrity sha512-cKzzbC3C1sIs7o9XAMw4E8F9kBtGXsBDUsd2JZ8JM/dqa+nzWwSGM+9LLYILZWzWHzX9W+HJNHyBlbHPVS/krw== + +timeago@^1.6.7: + version "1.6.7" + resolved "https://registry.yarnpkg.com/timeago/-/timeago-1.6.7.tgz#afd467c29a911e697fc22a81888c7c3022783cb5" + integrity sha512-FikcjN98+ij0siKH4VO4dZ358PR3oDDq4Vdl1+sN9gWz1/+JXGr3uZbUShYH/hL7bMhcTpPbplJU5Tej4b4jbQ== + dependencies: + jquery ">=1.5.0 <4.0" + +toastr@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/toastr/-/toastr-2.1.4.tgz#8b43be64fb9d0c414871446f2db8e8ca4e95f181" + integrity sha512-LIy77F5n+sz4tefMmFOntcJ6HL0Fv3k1TDnNmFZ0bU/GcvIIfy6eG2v7zQmMiYgaalAiUv75ttFrPn5s0gyqlA== + dependencies: + jquery ">=1.12.0" diff --git a/microservices/KonSoft.Payment.HttpApi.Host/Controllers/HomeController.cs b/microservices/KonSoft.Payment.HttpApi.Host/Controllers/HomeController.cs new file mode 100644 index 0000000..2974e46 --- /dev/null +++ b/microservices/KonSoft.Payment.HttpApi.Host/Controllers/HomeController.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc; + +namespace KonSoft.Payment.Controllers; + +public class HomeController : AbpController +{ + public ActionResult Index() + { + return Redirect("~/swagger"); + } +} diff --git a/microservices/KonSoft.Payment.HttpApi.Host/KonSoft.Payment.HttpApi.Host.csproj b/microservices/KonSoft.Payment.HttpApi.Host/KonSoft.Payment.HttpApi.Host.csproj new file mode 100644 index 0000000..c60b2bc --- /dev/null +++ b/microservices/KonSoft.Payment.HttpApi.Host/KonSoft.Payment.HttpApi.Host.csproj @@ -0,0 +1,40 @@ + + + + + + net8.0 + enable + KonSoft.Payment + true + KonSoft.Payment-4681b4fd-151f-4221-84a4-929d86723e4c + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/microservices/KonSoft.Payment.HttpApi.Host/PaymentBrandingProvider.cs b/microservices/KonSoft.Payment.HttpApi.Host/PaymentBrandingProvider.cs new file mode 100644 index 0000000..92e730d --- /dev/null +++ b/microservices/KonSoft.Payment.HttpApi.Host/PaymentBrandingProvider.cs @@ -0,0 +1,19 @@ +using Microsoft.Extensions.Localization; +using KonSoft.Payment.Localization; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Ui.Branding; + +namespace KonSoft.Payment; + +[Dependency(ReplaceServices = true)] +public class PaymentBrandingProvider : DefaultBrandingProvider +{ + private IStringLocalizer _localizer; + + public PaymentBrandingProvider(IStringLocalizer localizer) + { + _localizer = localizer; + } + + public override string AppName => _localizer["AppName"]; +} diff --git a/microservices/KonSoft.Payment.HttpApi.Host/PaymentHttpApiHostModule.cs b/microservices/KonSoft.Payment.HttpApi.Host/PaymentHttpApiHostModule.cs new file mode 100644 index 0000000..dd75b40 --- /dev/null +++ b/microservices/KonSoft.Payment.HttpApi.Host/PaymentHttpApiHostModule.cs @@ -0,0 +1,224 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Cors; +using Microsoft.AspNetCore.Extensions.DependencyInjection; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using KonSoft.Payment.EntityFrameworkCore; +using KonSoft.Payment.MultiTenancy; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite.Bundling; +using Microsoft.OpenApi.Models; +using OpenIddict.Validation.AspNetCore; +using Volo.Abp; +using Volo.Abp.Account; +using Volo.Abp.Account.Web; +using Volo.Abp.AspNetCore.MultiTenancy; +using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; +using Volo.Abp.AspNetCore.Serilog; +using Volo.Abp.Autofac; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Volo.Abp.Security.Claims; +using Volo.Abp.Swashbuckle; +using Volo.Abp.UI.Navigation.Urls; +using Volo.Abp.VirtualFileSystem; + +namespace KonSoft.Payment; + +[DependsOn( + typeof(PaymentHttpApiModule), + typeof(AbpAutofacModule), + typeof(AbpAspNetCoreMultiTenancyModule), + typeof(PaymentApplicationModule), + typeof(PaymentEntityFrameworkCoreModule), + typeof(AbpAspNetCoreMvcUiLeptonXLiteThemeModule), + typeof(AbpAccountWebOpenIddictModule), + typeof(AbpAspNetCoreSerilogModule), + typeof(AbpSwashbuckleModule) +)] +public class PaymentHttpApiHostModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PreConfigure(builder => + { + builder.AddValidation(options => + { + options.AddAudiences("Payment"); + options.UseLocalServer(); + options.UseAspNetCore(); + }); + }); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + var configuration = context.Services.GetConfiguration(); + var hostingEnvironment = context.Services.GetHostingEnvironment(); + + ConfigureAuthentication(context); + ConfigureBundles(); + ConfigureUrls(configuration); + ConfigureConventionalControllers(); + ConfigureVirtualFileSystem(context); + ConfigureCors(context, configuration); + ConfigureSwaggerServices(context, configuration); + } + + private void ConfigureAuthentication(ServiceConfigurationContext context) + { + context.Services.ForwardIdentityAuthenticationForBearer(OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme); + context.Services.Configure(options => + { + options.IsDynamicClaimsEnabled = true; + }); + } + + private void ConfigureBundles() + { + Configure(options => + { + options.StyleBundles.Configure( + LeptonXLiteThemeBundles.Styles.Global, + bundle => + { + bundle.AddFiles("/global-styles.css"); + } + ); + }); + } + + private void ConfigureUrls(IConfiguration configuration) + { + Configure(options => + { + options.Applications["MVC"].RootUrl = configuration["App:SelfUrl"]; + options.RedirectAllowedUrls.AddRange(configuration["App:RedirectAllowedUrls"]?.Split(',') ?? Array.Empty()); + + options.Applications["Angular"].RootUrl = configuration["App:ClientUrl"]; + options.Applications["Angular"].Urls[AccountUrlNames.PasswordReset] = "account/reset-password"; + }); + } + + private void ConfigureVirtualFileSystem(ServiceConfigurationContext context) + { + var hostingEnvironment = context.Services.GetHostingEnvironment(); + + if (hostingEnvironment.IsDevelopment()) + { + Configure(options => + { + options.FileSets.ReplaceEmbeddedByPhysical( + Path.Combine(hostingEnvironment.ContentRootPath, + $"..{Path.DirectorySeparatorChar}KonSoft.Payment.Domain.Shared")); + options.FileSets.ReplaceEmbeddedByPhysical( + Path.Combine(hostingEnvironment.ContentRootPath, + $"..{Path.DirectorySeparatorChar}KonSoft.Payment.Domain")); + options.FileSets.ReplaceEmbeddedByPhysical( + Path.Combine(hostingEnvironment.ContentRootPath, + $"..{Path.DirectorySeparatorChar}KonSoft.Payment.Application.Contracts")); + options.FileSets.ReplaceEmbeddedByPhysical( + Path.Combine(hostingEnvironment.ContentRootPath, + $"..{Path.DirectorySeparatorChar}KonSoft.Payment.Application")); + }); + } + } + + private void ConfigureConventionalControllers() + { + Configure(options => + { + options.ConventionalControllers.Create(typeof(PaymentApplicationModule).Assembly); + }); + } + + private static void ConfigureSwaggerServices(ServiceConfigurationContext context, IConfiguration configuration) + { + context.Services.AddAbpSwaggerGenWithOAuth( + configuration["AuthServer:Authority"]!, + new Dictionary + { + {"Payment", "Payment API"} + }, + options => + { + options.SwaggerDoc("v1", new OpenApiInfo { Title = "Payment API", Version = "v1" }); + options.DocInclusionPredicate((docName, description) => true); + options.CustomSchemaIds(type => type.FullName); + }); + } + + private void ConfigureCors(ServiceConfigurationContext context, IConfiguration configuration) + { + context.Services.AddCors(options => + { + options.AddDefaultPolicy(builder => + { + builder + .WithOrigins(configuration["App:CorsOrigins"]? + .Split(",", StringSplitOptions.RemoveEmptyEntries) + .Select(o => o.RemovePostFix("/")) + .ToArray() ?? Array.Empty()) + .WithAbpExposedHeaders() + .SetIsOriginAllowedToAllowWildcardSubdomains() + .AllowAnyHeader() + .AllowAnyMethod() + .AllowCredentials(); + }); + }); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + var app = context.GetApplicationBuilder(); + var env = context.GetEnvironment(); + + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.UseAbpRequestLocalization(); + + if (!env.IsDevelopment()) + { + app.UseErrorPage(); + } + + app.UseCorrelationId(); + app.UseStaticFiles(); + app.UseRouting(); + app.UseCors(); + app.UseAuthentication(); + app.UseAbpOpenIddictValidation(); + + if (MultiTenancyConsts.IsEnabled) + { + app.UseMultiTenancy(); + } + app.UseUnitOfWork(); + app.UseDynamicClaims(); + app.UseAuthorization(); + + app.UseSwagger(); + app.UseAbpSwaggerUI(c => + { + c.SwaggerEndpoint("/swagger/v1/swagger.json", "Payment API"); + + var configuration = context.ServiceProvider.GetRequiredService(); + c.OAuthClientId(configuration["AuthServer:SwaggerClientId"]); + c.OAuthScopes("Payment"); + }); + + app.UseAuditing(); + app.UseAbpSerilogEnrichers(); + app.UseConfiguredEndpoints(); + } +} diff --git a/microservices/KonSoft.Payment.HttpApi.Host/Program.cs b/microservices/KonSoft.Payment.HttpApi.Host/Program.cs new file mode 100644 index 0000000..dfd86a7 --- /dev/null +++ b/microservices/KonSoft.Payment.HttpApi.Host/Program.cs @@ -0,0 +1,56 @@ +using System; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Serilog; +using Serilog.Events; + +namespace KonSoft.Payment; + +public class Program +{ + public async static Task Main(string[] args) + { + Log.Logger = new LoggerConfiguration() +#if DEBUG + .MinimumLevel.Debug() +#else + .MinimumLevel.Information() +#endif + .MinimumLevel.Override("Microsoft", LogEventLevel.Information) + .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) + .Enrich.FromLogContext() + .WriteTo.Async(c => c.File("Logs/logs.txt")) + .WriteTo.Async(c => c.Console()) + .CreateLogger(); + + try + { + Log.Information("Starting KonSoft.Payment.HttpApi.Host."); + var builder = WebApplication.CreateBuilder(args); + builder.Host.AddAppSettingsSecretsJson() + .UseAutofac() + .UseSerilog(); + await builder.AddApplicationAsync(); + var app = builder.Build(); + await app.InitializeApplicationAsync(); + await app.RunAsync(); + return 0; + } + catch (Exception ex) + { + if (ex is HostAbortedException) + { + throw; + } + + Log.Fatal(ex, "Host terminated unexpectedly!"); + return 1; + } + finally + { + Log.CloseAndFlush(); + } + } +} diff --git a/microservices/KonSoft.Payment.HttpApi.Host/Properties/launchSettings.json b/microservices/KonSoft.Payment.HttpApi.Host/Properties/launchSettings.json new file mode 100644 index 0000000..6ed65af --- /dev/null +++ b/microservices/KonSoft.Payment.HttpApi.Host/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "https://localhost:44355", + "sslPort": 44355 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "KonSoft.Payment.HttpApi.Host": { + "commandName": "Project", + "launchBrowser": true, + "applicationUrl": "https://localhost:44355", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/microservices/KonSoft.Payment.HttpApi.Host/abp.resourcemapping.js b/microservices/KonSoft.Payment.HttpApi.Host/abp.resourcemapping.js new file mode 100644 index 0000000..4a2ad45 --- /dev/null +++ b/microservices/KonSoft.Payment.HttpApi.Host/abp.resourcemapping.js @@ -0,0 +1,11 @@ +module.exports = { + aliases: { + + }, + clean: [ + + ], + mappings: { + + } +}; diff --git a/microservices/KonSoft.Payment.HttpApi.Host/appsettings.Development.json b/microservices/KonSoft.Payment.HttpApi.Host/appsettings.Development.json new file mode 100644 index 0000000..2c63c08 --- /dev/null +++ b/microservices/KonSoft.Payment.HttpApi.Host/appsettings.Development.json @@ -0,0 +1,2 @@ +{ +} diff --git a/microservices/KonSoft.Payment.HttpApi.Host/appsettings.json b/microservices/KonSoft.Payment.HttpApi.Host/appsettings.json new file mode 100644 index 0000000..ab7bc0b --- /dev/null +++ b/microservices/KonSoft.Payment.HttpApi.Host/appsettings.json @@ -0,0 +1,18 @@ +{ + "App": { + "SelfUrl": "https://localhost:44355", + "CorsOrigins": "https://*.Payment.com", + "RedirectAllowedUrls": "" + }, + "ConnectionStrings": { + "Default": "Host=localhost;Port=5432;Database=Payment;User ID=root;Password=myPassword;" + }, + "AuthServer": { + "Authority": "https://localhost:44355", + "RequireHttpsMetadata": false, + "SwaggerClientId": "Payment_Swagger" + }, + "StringEncryption": { + "DefaultPassPhrase": "ex1X6Pe2UOTsR6Tv" + } +} diff --git a/microservices/KonSoft.Payment.HttpApi.Host/appsettings.secrets.json b/microservices/KonSoft.Payment.HttpApi.Host/appsettings.secrets.json new file mode 100644 index 0000000..7a73a41 --- /dev/null +++ b/microservices/KonSoft.Payment.HttpApi.Host/appsettings.secrets.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/microservices/KonSoft.Payment.HttpApi.Host/package.json b/microservices/KonSoft.Payment.HttpApi.Host/package.json new file mode 100644 index 0000000..b8d616a --- /dev/null +++ b/microservices/KonSoft.Payment.HttpApi.Host/package.json @@ -0,0 +1,8 @@ +{ + "version": "1.0.0", + "name": "my-app", + "private": true, + "dependencies": { + "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~3.3.4" + } +} diff --git a/microservices/KonSoft.Payment.HttpApi.Host/web.config b/microservices/KonSoft.Payment.HttpApi.Host/web.config new file mode 100644 index 0000000..d8a82b4 --- /dev/null +++ b/microservices/KonSoft.Payment.HttpApi.Host/web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/microservices/KonSoft.Payment.HttpApi.Host/wwwroot/global-styles.css b/microservices/KonSoft.Payment.HttpApi.Host/wwwroot/global-styles.css new file mode 100644 index 0000000..74db4bd --- /dev/null +++ b/microservices/KonSoft.Payment.HttpApi.Host/wwwroot/global-styles.css @@ -0,0 +1,6 @@ +/* Your Global Styles */ + +:root .lpx-brand-logo { + --lpx-logo: url('/images/logo/leptonx/logo-light.png'); + --lpx-logo-icon: url('/images/logo/leptonx/logo-light-thumbnail.png'); +} \ No newline at end of file diff --git a/microservices/KonSoft.Payment.HttpApi.Host/wwwroot/images/logo/leptonx/logo-dark-thumbnail.png b/microservices/KonSoft.Payment.HttpApi.Host/wwwroot/images/logo/leptonx/logo-dark-thumbnail.png new file mode 100644 index 0000000..9734a07 Binary files /dev/null and b/microservices/KonSoft.Payment.HttpApi.Host/wwwroot/images/logo/leptonx/logo-dark-thumbnail.png differ diff --git a/microservices/KonSoft.Payment.HttpApi.Host/wwwroot/images/logo/leptonx/logo-dark.png b/microservices/KonSoft.Payment.HttpApi.Host/wwwroot/images/logo/leptonx/logo-dark.png new file mode 100644 index 0000000..a3bbe82 Binary files /dev/null and b/microservices/KonSoft.Payment.HttpApi.Host/wwwroot/images/logo/leptonx/logo-dark.png differ diff --git a/microservices/KonSoft.Payment.HttpApi.Host/wwwroot/images/logo/leptonx/logo-light-thumbnail.png b/microservices/KonSoft.Payment.HttpApi.Host/wwwroot/images/logo/leptonx/logo-light-thumbnail.png new file mode 100644 index 0000000..ca39184 Binary files /dev/null and b/microservices/KonSoft.Payment.HttpApi.Host/wwwroot/images/logo/leptonx/logo-light-thumbnail.png differ diff --git a/microservices/KonSoft.Payment.HttpApi.Host/wwwroot/images/logo/leptonx/logo-light.png b/microservices/KonSoft.Payment.HttpApi.Host/wwwroot/images/logo/leptonx/logo-light.png new file mode 100644 index 0000000..761fb44 Binary files /dev/null and b/microservices/KonSoft.Payment.HttpApi.Host/wwwroot/images/logo/leptonx/logo-light.png differ diff --git a/microservices/KonSoft.Report.HttpApi.Host/Controllers/HomeController.cs b/microservices/KonSoft.Report.HttpApi.Host/Controllers/HomeController.cs new file mode 100644 index 0000000..1175391 --- /dev/null +++ b/microservices/KonSoft.Report.HttpApi.Host/Controllers/HomeController.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc; + +namespace KonSoft.Report.Controllers; + +public class HomeController : AbpController +{ + public ActionResult Index() + { + return Redirect("~/swagger"); + } +} diff --git a/microservices/KonSoft.Report.HttpApi.Host/KonSoft.Report.HttpApi.Host.csproj b/microservices/KonSoft.Report.HttpApi.Host/KonSoft.Report.HttpApi.Host.csproj new file mode 100644 index 0000000..e860229 --- /dev/null +++ b/microservices/KonSoft.Report.HttpApi.Host/KonSoft.Report.HttpApi.Host.csproj @@ -0,0 +1,40 @@ + + + + + + net8.0 + enable + KonSoft.Report + true + KonSoft.Report-4681b4fd-151f-4221-84a4-929d86723e4c + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/microservices/KonSoft.Report.HttpApi.Host/Program.cs b/microservices/KonSoft.Report.HttpApi.Host/Program.cs new file mode 100644 index 0000000..54c2ba8 --- /dev/null +++ b/microservices/KonSoft.Report.HttpApi.Host/Program.cs @@ -0,0 +1,56 @@ +using System; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Serilog; +using Serilog.Events; + +namespace KonSoft.Report; + +public class Program +{ + public async static Task Main(string[] args) + { + Log.Logger = new LoggerConfiguration() +#if DEBUG + .MinimumLevel.Debug() +#else + .MinimumLevel.Information() +#endif + .MinimumLevel.Override("Microsoft", LogEventLevel.Information) + .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) + .Enrich.FromLogContext() + .WriteTo.Async(c => c.File("Logs/logs.txt")) + .WriteTo.Async(c => c.Console()) + .CreateLogger(); + + try + { + Log.Information("Starting KonSoft.Report.HttpApi.Host."); + var builder = WebApplication.CreateBuilder(args); + builder.Host.AddAppSettingsSecretsJson() + .UseAutofac() + .UseSerilog(); + await builder.AddApplicationAsync(); + var app = builder.Build(); + await app.InitializeApplicationAsync(); + await app.RunAsync(); + return 0; + } + catch (Exception ex) + { + if (ex is HostAbortedException) + { + throw; + } + + Log.Fatal(ex, "Host terminated unexpectedly!"); + return 1; + } + finally + { + Log.CloseAndFlush(); + } + } +} diff --git a/microservices/KonSoft.Report.HttpApi.Host/Properties/launchSettings.json b/microservices/KonSoft.Report.HttpApi.Host/Properties/launchSettings.json new file mode 100644 index 0000000..e200271 --- /dev/null +++ b/microservices/KonSoft.Report.HttpApi.Host/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "https://localhost:44340", + "sslPort": 44340 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "KonSoft.Report.HttpApi.Host": { + "commandName": "Project", + "launchBrowser": true, + "applicationUrl": "https://localhost:44340", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/microservices/KonSoft.Report.HttpApi.Host/ReportBrandingProvider.cs b/microservices/KonSoft.Report.HttpApi.Host/ReportBrandingProvider.cs new file mode 100644 index 0000000..ae370f7 --- /dev/null +++ b/microservices/KonSoft.Report.HttpApi.Host/ReportBrandingProvider.cs @@ -0,0 +1,19 @@ +using Microsoft.Extensions.Localization; +using KonSoft.Report.Localization; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Ui.Branding; + +namespace KonSoft.Report; + +[Dependency(ReplaceServices = true)] +public class ReportBrandingProvider : DefaultBrandingProvider +{ + private IStringLocalizer _localizer; + + public ReportBrandingProvider(IStringLocalizer localizer) + { + _localizer = localizer; + } + + public override string AppName => _localizer["AppName"]; +} diff --git a/microservices/KonSoft.Report.HttpApi.Host/ReportHttpApiHostModule.cs b/microservices/KonSoft.Report.HttpApi.Host/ReportHttpApiHostModule.cs new file mode 100644 index 0000000..31254ad --- /dev/null +++ b/microservices/KonSoft.Report.HttpApi.Host/ReportHttpApiHostModule.cs @@ -0,0 +1,224 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Cors; +using Microsoft.AspNetCore.Extensions.DependencyInjection; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using KonSoft.Report.EntityFrameworkCore; +using KonSoft.Report.MultiTenancy; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite.Bundling; +using Microsoft.OpenApi.Models; +using OpenIddict.Validation.AspNetCore; +using Volo.Abp; +using Volo.Abp.Account; +using Volo.Abp.Account.Web; +using Volo.Abp.AspNetCore.MultiTenancy; +using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; +using Volo.Abp.AspNetCore.Serilog; +using Volo.Abp.Autofac; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Volo.Abp.Security.Claims; +using Volo.Abp.Swashbuckle; +using Volo.Abp.UI.Navigation.Urls; +using Volo.Abp.VirtualFileSystem; + +namespace KonSoft.Report; + +[DependsOn( + typeof(ReportHttpApiModule), + typeof(AbpAutofacModule), + typeof(AbpAspNetCoreMultiTenancyModule), + typeof(ReportApplicationModule), + typeof(ReportEntityFrameworkCoreModule), + typeof(AbpAspNetCoreMvcUiLeptonXLiteThemeModule), + typeof(AbpAccountWebOpenIddictModule), + typeof(AbpAspNetCoreSerilogModule), + typeof(AbpSwashbuckleModule) +)] +public class ReportHttpApiHostModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PreConfigure(builder => + { + builder.AddValidation(options => + { + options.AddAudiences("Report"); + options.UseLocalServer(); + options.UseAspNetCore(); + }); + }); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + var configuration = context.Services.GetConfiguration(); + var hostingEnvironment = context.Services.GetHostingEnvironment(); + + ConfigureAuthentication(context); + ConfigureBundles(); + ConfigureUrls(configuration); + ConfigureConventionalControllers(); + ConfigureVirtualFileSystem(context); + ConfigureCors(context, configuration); + ConfigureSwaggerServices(context, configuration); + } + + private void ConfigureAuthentication(ServiceConfigurationContext context) + { + context.Services.ForwardIdentityAuthenticationForBearer(OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme); + context.Services.Configure(options => + { + options.IsDynamicClaimsEnabled = true; + }); + } + + private void ConfigureBundles() + { + Configure(options => + { + options.StyleBundles.Configure( + LeptonXLiteThemeBundles.Styles.Global, + bundle => + { + bundle.AddFiles("/global-styles.css"); + } + ); + }); + } + + private void ConfigureUrls(IConfiguration configuration) + { + Configure(options => + { + options.Applications["MVC"].RootUrl = configuration["App:SelfUrl"]; + options.RedirectAllowedUrls.AddRange(configuration["App:RedirectAllowedUrls"]?.Split(',') ?? Array.Empty()); + + options.Applications["Angular"].RootUrl = configuration["App:ClientUrl"]; + options.Applications["Angular"].Urls[AccountUrlNames.PasswordReset] = "account/reset-password"; + }); + } + + private void ConfigureVirtualFileSystem(ServiceConfigurationContext context) + { + var hostingEnvironment = context.Services.GetHostingEnvironment(); + + if (hostingEnvironment.IsDevelopment()) + { + Configure(options => + { + options.FileSets.ReplaceEmbeddedByPhysical( + Path.Combine(hostingEnvironment.ContentRootPath, + $"..{Path.DirectorySeparatorChar}KonSoft.Report.Domain.Shared")); + options.FileSets.ReplaceEmbeddedByPhysical( + Path.Combine(hostingEnvironment.ContentRootPath, + $"..{Path.DirectorySeparatorChar}KonSoft.Report.Domain")); + options.FileSets.ReplaceEmbeddedByPhysical( + Path.Combine(hostingEnvironment.ContentRootPath, + $"..{Path.DirectorySeparatorChar}KonSoft.Report.Application.Contracts")); + options.FileSets.ReplaceEmbeddedByPhysical( + Path.Combine(hostingEnvironment.ContentRootPath, + $"..{Path.DirectorySeparatorChar}KonSoft.Report.Application")); + }); + } + } + + private void ConfigureConventionalControllers() + { + Configure(options => + { + options.ConventionalControllers.Create(typeof(ReportApplicationModule).Assembly); + }); + } + + private static void ConfigureSwaggerServices(ServiceConfigurationContext context, IConfiguration configuration) + { + context.Services.AddAbpSwaggerGenWithOAuth( + configuration["AuthServer:Authority"]!, + new Dictionary + { + {"Report", "Report API"} + }, + options => + { + options.SwaggerDoc("v1", new OpenApiInfo { Title = "Report API", Version = "v1" }); + options.DocInclusionPredicate((docName, description) => true); + options.CustomSchemaIds(type => type.FullName); + }); + } + + private void ConfigureCors(ServiceConfigurationContext context, IConfiguration configuration) + { + context.Services.AddCors(options => + { + options.AddDefaultPolicy(builder => + { + builder + .WithOrigins(configuration["App:CorsOrigins"]? + .Split(",", StringSplitOptions.RemoveEmptyEntries) + .Select(o => o.RemovePostFix("/")) + .ToArray() ?? Array.Empty()) + .WithAbpExposedHeaders() + .SetIsOriginAllowedToAllowWildcardSubdomains() + .AllowAnyHeader() + .AllowAnyMethod() + .AllowCredentials(); + }); + }); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + var app = context.GetApplicationBuilder(); + var env = context.GetEnvironment(); + + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.UseAbpRequestLocalization(); + + if (!env.IsDevelopment()) + { + app.UseErrorPage(); + } + + app.UseCorrelationId(); + app.UseStaticFiles(); + app.UseRouting(); + app.UseCors(); + app.UseAuthentication(); + app.UseAbpOpenIddictValidation(); + + if (MultiTenancyConsts.IsEnabled) + { + app.UseMultiTenancy(); + } + app.UseUnitOfWork(); + app.UseDynamicClaims(); + app.UseAuthorization(); + + app.UseSwagger(); + app.UseAbpSwaggerUI(c => + { + c.SwaggerEndpoint("/swagger/v1/swagger.json", "Report API"); + + var configuration = context.ServiceProvider.GetRequiredService(); + c.OAuthClientId(configuration["AuthServer:SwaggerClientId"]); + c.OAuthScopes("Report"); + }); + + app.UseAuditing(); + app.UseAbpSerilogEnrichers(); + app.UseConfiguredEndpoints(); + } +} diff --git a/microservices/KonSoft.Report.HttpApi.Host/abp.resourcemapping.js b/microservices/KonSoft.Report.HttpApi.Host/abp.resourcemapping.js new file mode 100644 index 0000000..4a2ad45 --- /dev/null +++ b/microservices/KonSoft.Report.HttpApi.Host/abp.resourcemapping.js @@ -0,0 +1,11 @@ +module.exports = { + aliases: { + + }, + clean: [ + + ], + mappings: { + + } +}; diff --git a/microservices/KonSoft.Report.HttpApi.Host/appsettings.Development.json b/microservices/KonSoft.Report.HttpApi.Host/appsettings.Development.json new file mode 100644 index 0000000..2c63c08 --- /dev/null +++ b/microservices/KonSoft.Report.HttpApi.Host/appsettings.Development.json @@ -0,0 +1,2 @@ +{ +} diff --git a/microservices/KonSoft.Report.HttpApi.Host/appsettings.json b/microservices/KonSoft.Report.HttpApi.Host/appsettings.json new file mode 100644 index 0000000..582f153 --- /dev/null +++ b/microservices/KonSoft.Report.HttpApi.Host/appsettings.json @@ -0,0 +1,18 @@ +{ + "App": { + "SelfUrl": "https://localhost:44340", + "CorsOrigins": "https://*.Report.com", + "RedirectAllowedUrls": "" + }, + "ConnectionStrings": { + "Default": "Host=localhost;Port=5432;Database=Report;User ID=root;Password=myPassword;" + }, + "AuthServer": { + "Authority": "https://localhost:44340", + "RequireHttpsMetadata": false, + "SwaggerClientId": "Report_Swagger" + }, + "StringEncryption": { + "DefaultPassPhrase": "aRnRGh9BVWKdfQXb" + } +} diff --git a/microservices/KonSoft.Report.HttpApi.Host/appsettings.secrets.json b/microservices/KonSoft.Report.HttpApi.Host/appsettings.secrets.json new file mode 100644 index 0000000..7a73a41 --- /dev/null +++ b/microservices/KonSoft.Report.HttpApi.Host/appsettings.secrets.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/microservices/KonSoft.Report.HttpApi.Host/package.json b/microservices/KonSoft.Report.HttpApi.Host/package.json new file mode 100644 index 0000000..b8d616a --- /dev/null +++ b/microservices/KonSoft.Report.HttpApi.Host/package.json @@ -0,0 +1,8 @@ +{ + "version": "1.0.0", + "name": "my-app", + "private": true, + "dependencies": { + "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~3.3.4" + } +} diff --git a/microservices/KonSoft.Report.HttpApi.Host/web.config b/microservices/KonSoft.Report.HttpApi.Host/web.config new file mode 100644 index 0000000..aee1cd4 --- /dev/null +++ b/microservices/KonSoft.Report.HttpApi.Host/web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/microservices/KonSoft.Report.HttpApi.Host/wwwroot/global-styles.css b/microservices/KonSoft.Report.HttpApi.Host/wwwroot/global-styles.css new file mode 100644 index 0000000..74db4bd --- /dev/null +++ b/microservices/KonSoft.Report.HttpApi.Host/wwwroot/global-styles.css @@ -0,0 +1,6 @@ +/* Your Global Styles */ + +:root .lpx-brand-logo { + --lpx-logo: url('/images/logo/leptonx/logo-light.png'); + --lpx-logo-icon: url('/images/logo/leptonx/logo-light-thumbnail.png'); +} \ No newline at end of file diff --git a/microservices/KonSoft.Report.HttpApi.Host/wwwroot/images/logo/leptonx/logo-dark-thumbnail.png b/microservices/KonSoft.Report.HttpApi.Host/wwwroot/images/logo/leptonx/logo-dark-thumbnail.png new file mode 100644 index 0000000..9734a07 Binary files /dev/null and b/microservices/KonSoft.Report.HttpApi.Host/wwwroot/images/logo/leptonx/logo-dark-thumbnail.png differ diff --git a/microservices/KonSoft.Report.HttpApi.Host/wwwroot/images/logo/leptonx/logo-dark.png b/microservices/KonSoft.Report.HttpApi.Host/wwwroot/images/logo/leptonx/logo-dark.png new file mode 100644 index 0000000..a3bbe82 Binary files /dev/null and b/microservices/KonSoft.Report.HttpApi.Host/wwwroot/images/logo/leptonx/logo-dark.png differ diff --git a/microservices/KonSoft.Report.HttpApi.Host/wwwroot/images/logo/leptonx/logo-light-thumbnail.png b/microservices/KonSoft.Report.HttpApi.Host/wwwroot/images/logo/leptonx/logo-light-thumbnail.png new file mode 100644 index 0000000..ca39184 Binary files /dev/null and b/microservices/KonSoft.Report.HttpApi.Host/wwwroot/images/logo/leptonx/logo-light-thumbnail.png differ diff --git a/microservices/KonSoft.Report.HttpApi.Host/wwwroot/images/logo/leptonx/logo-light.png b/microservices/KonSoft.Report.HttpApi.Host/wwwroot/images/logo/leptonx/logo-light.png new file mode 100644 index 0000000..761fb44 Binary files /dev/null and b/microservices/KonSoft.Report.HttpApi.Host/wwwroot/images/logo/leptonx/logo-light.png differ diff --git a/microservices/KonSoft.TenantManagement.HttpApi.Host/Controllers/HomeController.cs b/microservices/KonSoft.TenantManagement.HttpApi.Host/Controllers/HomeController.cs new file mode 100644 index 0000000..be4fe40 --- /dev/null +++ b/microservices/KonSoft.TenantManagement.HttpApi.Host/Controllers/HomeController.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc; + +namespace KonSoft.TenantManagement.Controllers; + +public class HomeController : AbpController +{ + public ActionResult Index() + { + return Redirect("~/swagger"); + } +} diff --git a/microservices/KonSoft.TenantManagement.HttpApi.Host/KonSoft.TenantManagement.HttpApi.Host.csproj b/microservices/KonSoft.TenantManagement.HttpApi.Host/KonSoft.TenantManagement.HttpApi.Host.csproj new file mode 100644 index 0000000..2126148 --- /dev/null +++ b/microservices/KonSoft.TenantManagement.HttpApi.Host/KonSoft.TenantManagement.HttpApi.Host.csproj @@ -0,0 +1,40 @@ + + + + + + net8.0 + enable + KonSoft.TenantManagement + true + KonSoft.TenantManagement-4681b4fd-151f-4221-84a4-929d86723e4c + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/microservices/KonSoft.TenantManagement.HttpApi.Host/Program.cs b/microservices/KonSoft.TenantManagement.HttpApi.Host/Program.cs new file mode 100644 index 0000000..26cedfb --- /dev/null +++ b/microservices/KonSoft.TenantManagement.HttpApi.Host/Program.cs @@ -0,0 +1,56 @@ +using System; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Serilog; +using Serilog.Events; + +namespace KonSoft.TenantManagement; + +public class Program +{ + public async static Task Main(string[] args) + { + Log.Logger = new LoggerConfiguration() +#if DEBUG + .MinimumLevel.Debug() +#else + .MinimumLevel.Information() +#endif + .MinimumLevel.Override("Microsoft", LogEventLevel.Information) + .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) + .Enrich.FromLogContext() + .WriteTo.Async(c => c.File("Logs/logs.txt")) + .WriteTo.Async(c => c.Console()) + .CreateLogger(); + + try + { + Log.Information("Starting KonSoft.TenantManagement.HttpApi.Host."); + var builder = WebApplication.CreateBuilder(args); + builder.Host.AddAppSettingsSecretsJson() + .UseAutofac() + .UseSerilog(); + await builder.AddApplicationAsync(); + var app = builder.Build(); + await app.InitializeApplicationAsync(); + await app.RunAsync(); + return 0; + } + catch (Exception ex) + { + if (ex is HostAbortedException) + { + throw; + } + + Log.Fatal(ex, "Host terminated unexpectedly!"); + return 1; + } + finally + { + Log.CloseAndFlush(); + } + } +} diff --git a/microservices/KonSoft.TenantManagement.HttpApi.Host/Properties/launchSettings.json b/microservices/KonSoft.TenantManagement.HttpApi.Host/Properties/launchSettings.json new file mode 100644 index 0000000..c10ca48 --- /dev/null +++ b/microservices/KonSoft.TenantManagement.HttpApi.Host/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "https://localhost:44316", + "sslPort": 44316 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "KonSoft.TenantManagement.HttpApi.Host": { + "commandName": "Project", + "launchBrowser": true, + "applicationUrl": "https://localhost:44316", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/microservices/KonSoft.TenantManagement.HttpApi.Host/TenantManagementBrandingProvider.cs b/microservices/KonSoft.TenantManagement.HttpApi.Host/TenantManagementBrandingProvider.cs new file mode 100644 index 0000000..ac30d7f --- /dev/null +++ b/microservices/KonSoft.TenantManagement.HttpApi.Host/TenantManagementBrandingProvider.cs @@ -0,0 +1,19 @@ +using Microsoft.Extensions.Localization; +using KonSoft.TenantManagement.Localization; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Ui.Branding; + +namespace KonSoft.TenantManagement; + +[Dependency(ReplaceServices = true)] +public class TenantManagementBrandingProvider : DefaultBrandingProvider +{ + private IStringLocalizer _localizer; + + public TenantManagementBrandingProvider(IStringLocalizer localizer) + { + _localizer = localizer; + } + + public override string AppName => _localizer["AppName"]; +} diff --git a/microservices/KonSoft.TenantManagement.HttpApi.Host/TenantManagementHttpApiHostModule.cs b/microservices/KonSoft.TenantManagement.HttpApi.Host/TenantManagementHttpApiHostModule.cs new file mode 100644 index 0000000..adf740c --- /dev/null +++ b/microservices/KonSoft.TenantManagement.HttpApi.Host/TenantManagementHttpApiHostModule.cs @@ -0,0 +1,224 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Cors; +using Microsoft.AspNetCore.Extensions.DependencyInjection; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using KonSoft.TenantManagement.EntityFrameworkCore; +using KonSoft.TenantManagement.MultiTenancy; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite.Bundling; +using Microsoft.OpenApi.Models; +using OpenIddict.Validation.AspNetCore; +using Volo.Abp; +using Volo.Abp.Account; +using Volo.Abp.Account.Web; +using Volo.Abp.AspNetCore.MultiTenancy; +using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; +using Volo.Abp.AspNetCore.Serilog; +using Volo.Abp.Autofac; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Volo.Abp.Security.Claims; +using Volo.Abp.Swashbuckle; +using Volo.Abp.UI.Navigation.Urls; +using Volo.Abp.VirtualFileSystem; + +namespace KonSoft.TenantManagement; + +[DependsOn( + typeof(TenantManagementHttpApiModule), + typeof(AbpAutofacModule), + typeof(AbpAspNetCoreMultiTenancyModule), + typeof(TenantManagementApplicationModule), + typeof(TenantManagementEntityFrameworkCoreModule), + typeof(AbpAspNetCoreMvcUiLeptonXLiteThemeModule), + typeof(AbpAccountWebOpenIddictModule), + typeof(AbpAspNetCoreSerilogModule), + typeof(AbpSwashbuckleModule) +)] +public class TenantManagementHttpApiHostModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PreConfigure(builder => + { + builder.AddValidation(options => + { + options.AddAudiences("TenantManagement"); + options.UseLocalServer(); + options.UseAspNetCore(); + }); + }); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + var configuration = context.Services.GetConfiguration(); + var hostingEnvironment = context.Services.GetHostingEnvironment(); + + ConfigureAuthentication(context); + ConfigureBundles(); + ConfigureUrls(configuration); + ConfigureConventionalControllers(); + ConfigureVirtualFileSystem(context); + ConfigureCors(context, configuration); + ConfigureSwaggerServices(context, configuration); + } + + private void ConfigureAuthentication(ServiceConfigurationContext context) + { + context.Services.ForwardIdentityAuthenticationForBearer(OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme); + context.Services.Configure(options => + { + options.IsDynamicClaimsEnabled = true; + }); + } + + private void ConfigureBundles() + { + Configure(options => + { + options.StyleBundles.Configure( + LeptonXLiteThemeBundles.Styles.Global, + bundle => + { + bundle.AddFiles("/global-styles.css"); + } + ); + }); + } + + private void ConfigureUrls(IConfiguration configuration) + { + Configure(options => + { + options.Applications["MVC"].RootUrl = configuration["App:SelfUrl"]; + options.RedirectAllowedUrls.AddRange(configuration["App:RedirectAllowedUrls"]?.Split(',') ?? Array.Empty()); + + options.Applications["Angular"].RootUrl = configuration["App:ClientUrl"]; + options.Applications["Angular"].Urls[AccountUrlNames.PasswordReset] = "account/reset-password"; + }); + } + + private void ConfigureVirtualFileSystem(ServiceConfigurationContext context) + { + var hostingEnvironment = context.Services.GetHostingEnvironment(); + + if (hostingEnvironment.IsDevelopment()) + { + Configure(options => + { + options.FileSets.ReplaceEmbeddedByPhysical( + Path.Combine(hostingEnvironment.ContentRootPath, + $"..{Path.DirectorySeparatorChar}KonSoft.TenantManagement.Domain.Shared")); + options.FileSets.ReplaceEmbeddedByPhysical( + Path.Combine(hostingEnvironment.ContentRootPath, + $"..{Path.DirectorySeparatorChar}KonSoft.TenantManagement.Domain")); + options.FileSets.ReplaceEmbeddedByPhysical( + Path.Combine(hostingEnvironment.ContentRootPath, + $"..{Path.DirectorySeparatorChar}KonSoft.TenantManagement.Application.Contracts")); + options.FileSets.ReplaceEmbeddedByPhysical( + Path.Combine(hostingEnvironment.ContentRootPath, + $"..{Path.DirectorySeparatorChar}KonSoft.TenantManagement.Application")); + }); + } + } + + private void ConfigureConventionalControllers() + { + Configure(options => + { + options.ConventionalControllers.Create(typeof(TenantManagementApplicationModule).Assembly); + }); + } + + private static void ConfigureSwaggerServices(ServiceConfigurationContext context, IConfiguration configuration) + { + context.Services.AddAbpSwaggerGenWithOAuth( + configuration["AuthServer:Authority"]!, + new Dictionary + { + {"TenantManagement", "TenantManagement API"} + }, + options => + { + options.SwaggerDoc("v1", new OpenApiInfo { Title = "TenantManagement API", Version = "v1" }); + options.DocInclusionPredicate((docName, description) => true); + options.CustomSchemaIds(type => type.FullName); + }); + } + + private void ConfigureCors(ServiceConfigurationContext context, IConfiguration configuration) + { + context.Services.AddCors(options => + { + options.AddDefaultPolicy(builder => + { + builder + .WithOrigins(configuration["App:CorsOrigins"]? + .Split(",", StringSplitOptions.RemoveEmptyEntries) + .Select(o => o.RemovePostFix("/")) + .ToArray() ?? Array.Empty()) + .WithAbpExposedHeaders() + .SetIsOriginAllowedToAllowWildcardSubdomains() + .AllowAnyHeader() + .AllowAnyMethod() + .AllowCredentials(); + }); + }); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + var app = context.GetApplicationBuilder(); + var env = context.GetEnvironment(); + + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.UseAbpRequestLocalization(); + + if (!env.IsDevelopment()) + { + app.UseErrorPage(); + } + + app.UseCorrelationId(); + app.UseStaticFiles(); + app.UseRouting(); + app.UseCors(); + app.UseAuthentication(); + app.UseAbpOpenIddictValidation(); + + if (MultiTenancyConsts.IsEnabled) + { + app.UseMultiTenancy(); + } + app.UseUnitOfWork(); + app.UseDynamicClaims(); + app.UseAuthorization(); + + app.UseSwagger(); + app.UseAbpSwaggerUI(c => + { + c.SwaggerEndpoint("/swagger/v1/swagger.json", "TenantManagement API"); + + var configuration = context.ServiceProvider.GetRequiredService(); + c.OAuthClientId(configuration["AuthServer:SwaggerClientId"]); + c.OAuthScopes("TenantManagement"); + }); + + app.UseAuditing(); + app.UseAbpSerilogEnrichers(); + app.UseConfiguredEndpoints(); + } +} diff --git a/microservices/KonSoft.TenantManagement.HttpApi.Host/abp.resourcemapping.js b/microservices/KonSoft.TenantManagement.HttpApi.Host/abp.resourcemapping.js new file mode 100644 index 0000000..4a2ad45 --- /dev/null +++ b/microservices/KonSoft.TenantManagement.HttpApi.Host/abp.resourcemapping.js @@ -0,0 +1,11 @@ +module.exports = { + aliases: { + + }, + clean: [ + + ], + mappings: { + + } +}; diff --git a/microservices/KonSoft.TenantManagement.HttpApi.Host/appsettings.Development.json b/microservices/KonSoft.TenantManagement.HttpApi.Host/appsettings.Development.json new file mode 100644 index 0000000..2c63c08 --- /dev/null +++ b/microservices/KonSoft.TenantManagement.HttpApi.Host/appsettings.Development.json @@ -0,0 +1,2 @@ +{ +} diff --git a/microservices/KonSoft.TenantManagement.HttpApi.Host/appsettings.json b/microservices/KonSoft.TenantManagement.HttpApi.Host/appsettings.json new file mode 100644 index 0000000..e08f2ba --- /dev/null +++ b/microservices/KonSoft.TenantManagement.HttpApi.Host/appsettings.json @@ -0,0 +1,18 @@ +{ + "App": { + "SelfUrl": "https://localhost:44316", + "CorsOrigins": "https://*.TenantManagement.com", + "RedirectAllowedUrls": "" + }, + "ConnectionStrings": { + "Default": "Host=localhost;Port=5432;Database=TenantManagement;User ID=root;Password=myPassword;" + }, + "AuthServer": { + "Authority": "https://localhost:44316", + "RequireHttpsMetadata": false, + "SwaggerClientId": "TenantManagement_Swagger" + }, + "StringEncryption": { + "DefaultPassPhrase": "FUFDAYrpYDaw4Tsl" + } +} diff --git a/microservices/KonSoft.TenantManagement.HttpApi.Host/appsettings.secrets.json b/microservices/KonSoft.TenantManagement.HttpApi.Host/appsettings.secrets.json new file mode 100644 index 0000000..7a73a41 --- /dev/null +++ b/microservices/KonSoft.TenantManagement.HttpApi.Host/appsettings.secrets.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/microservices/KonSoft.TenantManagement.HttpApi.Host/package.json b/microservices/KonSoft.TenantManagement.HttpApi.Host/package.json new file mode 100644 index 0000000..b8d616a --- /dev/null +++ b/microservices/KonSoft.TenantManagement.HttpApi.Host/package.json @@ -0,0 +1,8 @@ +{ + "version": "1.0.0", + "name": "my-app", + "private": true, + "dependencies": { + "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~3.3.4" + } +} diff --git a/microservices/KonSoft.TenantManagement.HttpApi.Host/web.config b/microservices/KonSoft.TenantManagement.HttpApi.Host/web.config new file mode 100644 index 0000000..407dc06 --- /dev/null +++ b/microservices/KonSoft.TenantManagement.HttpApi.Host/web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/microservices/KonSoft.TenantManagement.HttpApi.Host/wwwroot/global-styles.css b/microservices/KonSoft.TenantManagement.HttpApi.Host/wwwroot/global-styles.css new file mode 100644 index 0000000..74db4bd --- /dev/null +++ b/microservices/KonSoft.TenantManagement.HttpApi.Host/wwwroot/global-styles.css @@ -0,0 +1,6 @@ +/* Your Global Styles */ + +:root .lpx-brand-logo { + --lpx-logo: url('/images/logo/leptonx/logo-light.png'); + --lpx-logo-icon: url('/images/logo/leptonx/logo-light-thumbnail.png'); +} \ No newline at end of file diff --git a/microservices/KonSoft.TenantManagement.HttpApi.Host/wwwroot/images/logo/leptonx/logo-dark-thumbnail.png b/microservices/KonSoft.TenantManagement.HttpApi.Host/wwwroot/images/logo/leptonx/logo-dark-thumbnail.png new file mode 100644 index 0000000..9734a07 Binary files /dev/null and b/microservices/KonSoft.TenantManagement.HttpApi.Host/wwwroot/images/logo/leptonx/logo-dark-thumbnail.png differ diff --git a/microservices/KonSoft.TenantManagement.HttpApi.Host/wwwroot/images/logo/leptonx/logo-dark.png b/microservices/KonSoft.TenantManagement.HttpApi.Host/wwwroot/images/logo/leptonx/logo-dark.png new file mode 100644 index 0000000..a3bbe82 Binary files /dev/null and b/microservices/KonSoft.TenantManagement.HttpApi.Host/wwwroot/images/logo/leptonx/logo-dark.png differ diff --git a/microservices/KonSoft.TenantManagement.HttpApi.Host/wwwroot/images/logo/leptonx/logo-light-thumbnail.png b/microservices/KonSoft.TenantManagement.HttpApi.Host/wwwroot/images/logo/leptonx/logo-light-thumbnail.png new file mode 100644 index 0000000..ca39184 Binary files /dev/null and b/microservices/KonSoft.TenantManagement.HttpApi.Host/wwwroot/images/logo/leptonx/logo-light-thumbnail.png differ diff --git a/microservices/KonSoft.TenantManagement.HttpApi.Host/wwwroot/images/logo/leptonx/logo-light.png b/microservices/KonSoft.TenantManagement.HttpApi.Host/wwwroot/images/logo/leptonx/logo-light.png new file mode 100644 index 0000000..761fb44 Binary files /dev/null and b/microservices/KonSoft.TenantManagement.HttpApi.Host/wwwroot/images/logo/leptonx/logo-light.png differ diff --git a/modules/admin/src/KonSoft.Admin.Application.Contracts/AdminApplicationContractsModule.cs b/modules/admin/src/KonSoft.Admin.Application.Contracts/AdminApplicationContractsModule.cs new file mode 100644 index 0000000..a4da8ef --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Application.Contracts/AdminApplicationContractsModule.cs @@ -0,0 +1,28 @@ +using Volo.Abp.Account; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; +using Volo.Abp.ObjectExtending; +using Volo.Abp.PermissionManagement; +using Volo.Abp.SettingManagement; +using Volo.Abp.TenantManagement; + +namespace KonSoft.Admin; + +[DependsOn( + typeof(AdminDomainSharedModule), + typeof(AbpAccountApplicationContractsModule), + typeof(AbpFeatureManagementApplicationContractsModule), + typeof(AbpIdentityApplicationContractsModule), + typeof(AbpPermissionManagementApplicationContractsModule), + typeof(AbpSettingManagementApplicationContractsModule), + typeof(AbpTenantManagementApplicationContractsModule), + typeof(AbpObjectExtendingModule) +)] +public class AdminApplicationContractsModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + AdminDtoExtensions.Configure(); + } +} diff --git a/modules/admin/src/KonSoft.Admin.Application.Contracts/AdminDtoExtensions.cs b/modules/admin/src/KonSoft.Admin.Application.Contracts/AdminDtoExtensions.cs new file mode 100644 index 0000000..2b4f57c --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Application.Contracts/AdminDtoExtensions.cs @@ -0,0 +1,28 @@ +using Volo.Abp.Identity; +using Volo.Abp.ObjectExtending; +using Volo.Abp.Threading; + +namespace KonSoft.Admin; + +public static class AdminDtoExtensions +{ + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + + public static void Configure() + { + OneTimeRunner.Run(() => + { + /* You can add extension properties to DTOs + * defined in the depended modules. + * + * Example: + * + * ObjectExtensionManager.Instance + * .AddOrUpdateProperty("Title"); + * + * See the documentation for more: + * https://docs.abp.io/en/abp/latest/Object-Extensions + */ + }); + } +} diff --git a/modules/admin/src/KonSoft.Admin.Application.Contracts/KonSoft.Admin.Application.Contracts.csproj b/modules/admin/src/KonSoft.Admin.Application.Contracts/KonSoft.Admin.Application.Contracts.csproj new file mode 100644 index 0000000..21d8796 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Application.Contracts/KonSoft.Admin.Application.Contracts.csproj @@ -0,0 +1,25 @@ + + + + + + net8.0 + enable + KonSoft.Admin + + + + + + + + + + + + + + + + + diff --git a/modules/admin/src/KonSoft.Admin.Application.Contracts/Permissions/AdminPermissionDefinitionProvider.cs b/modules/admin/src/KonSoft.Admin.Application.Contracts/Permissions/AdminPermissionDefinitionProvider.cs new file mode 100644 index 0000000..c11e790 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Application.Contracts/Permissions/AdminPermissionDefinitionProvider.cs @@ -0,0 +1,20 @@ +using KonSoft.Admin.Localization; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.Localization; + +namespace KonSoft.Admin.Permissions; + +public class AdminPermissionDefinitionProvider : PermissionDefinitionProvider +{ + public override void Define(IPermissionDefinitionContext context) + { + var myGroup = context.AddGroup(AdminPermissions.GroupName); + //Define your own permissions here. Example: + //myGroup.AddPermission(AdminPermissions.MyPermission1, L("Permission:MyPermission1")); + } + + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); + } +} diff --git a/modules/admin/src/KonSoft.Admin.Application.Contracts/Permissions/AdminPermissions.cs b/modules/admin/src/KonSoft.Admin.Application.Contracts/Permissions/AdminPermissions.cs new file mode 100644 index 0000000..5fe4774 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Application.Contracts/Permissions/AdminPermissions.cs @@ -0,0 +1,9 @@ +namespace KonSoft.Admin.Permissions; + +public static class AdminPermissions +{ + public const string GroupName = "Admin"; + + //Add your own permission names. Example: + //public const string MyPermission1 = GroupName + ".MyPermission1"; +} diff --git a/modules/admin/src/KonSoft.Admin.Application/AdminAppService.cs b/modules/admin/src/KonSoft.Admin.Application/AdminAppService.cs new file mode 100644 index 0000000..58ac913 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Application/AdminAppService.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Text; +using KonSoft.Admin.Localization; +using Volo.Abp.Application.Services; + +namespace KonSoft.Admin; + +/* Inherit your application services from this class. + */ +public abstract class AdminAppService : ApplicationService +{ + protected AdminAppService() + { + LocalizationResource = typeof(AdminResource); + } +} diff --git a/modules/admin/src/KonSoft.Admin.Application/AdminApplicationAutoMapperProfile.cs b/modules/admin/src/KonSoft.Admin.Application/AdminApplicationAutoMapperProfile.cs new file mode 100644 index 0000000..4c9d249 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Application/AdminApplicationAutoMapperProfile.cs @@ -0,0 +1,13 @@ +using AutoMapper; + +namespace KonSoft.Admin; + +public class AdminApplicationAutoMapperProfile : Profile +{ + public AdminApplicationAutoMapperProfile() + { + /* You can configure your AutoMapper mapping configuration here. + * Alternatively, you can split your mapping configurations + * into multiple profile classes for a better organization. */ + } +} diff --git a/modules/admin/src/KonSoft.Admin.Application/AdminApplicationModule.cs b/modules/admin/src/KonSoft.Admin.Application/AdminApplicationModule.cs new file mode 100644 index 0000000..4b8589a --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Application/AdminApplicationModule.cs @@ -0,0 +1,31 @@ +using Volo.Abp.Account; +using Volo.Abp.AutoMapper; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; +using Volo.Abp.PermissionManagement; +using Volo.Abp.SettingManagement; +using Volo.Abp.TenantManagement; + +namespace KonSoft.Admin; + +[DependsOn( + typeof(AdminDomainModule), + typeof(AbpAccountApplicationModule), + typeof(AdminApplicationContractsModule), + typeof(AbpIdentityApplicationModule), + typeof(AbpPermissionManagementApplicationModule), + typeof(AbpTenantManagementApplicationModule), + typeof(AbpFeatureManagementApplicationModule), + typeof(AbpSettingManagementApplicationModule) + )] +public class AdminApplicationModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.AddMaps(); + }); + } +} diff --git a/modules/admin/src/KonSoft.Admin.Application/KonSoft.Admin.Application.csproj b/modules/admin/src/KonSoft.Admin.Application/KonSoft.Admin.Application.csproj new file mode 100644 index 0000000..c9569eb --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Application/KonSoft.Admin.Application.csproj @@ -0,0 +1,25 @@ + + + + + + net8.0 + enable + KonSoft.Admin + + + + + + + + + + + + + + + + + diff --git a/modules/admin/src/KonSoft.Admin.Application/Properties/AssemblyInfo.cs b/modules/admin/src/KonSoft.Admin.Application/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..12c97cf --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Application/Properties/AssemblyInfo.cs @@ -0,0 +1,2 @@ +using System.Runtime.CompilerServices; +[assembly:InternalsVisibleToAttribute("KonSoft.Admin.Application.Tests")] diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/AdminDomainErrorCodes.cs b/modules/admin/src/KonSoft.Admin.Domain.Shared/AdminDomainErrorCodes.cs new file mode 100644 index 0000000..78050c5 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/AdminDomainErrorCodes.cs @@ -0,0 +1,6 @@ +namespace KonSoft.Admin; + +public static class AdminDomainErrorCodes +{ + /* You can add your business exception error codes here, as constants */ +} diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/AdminDomainSharedModule.cs b/modules/admin/src/KonSoft.Admin.Domain.Shared/AdminDomainSharedModule.cs new file mode 100644 index 0000000..e998a5d --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/AdminDomainSharedModule.cs @@ -0,0 +1,58 @@ +using KonSoft.Admin.Localization; +using Volo.Abp.AuditLogging; +using Volo.Abp.BackgroundJobs; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Localization; +using Volo.Abp.Localization.ExceptionHandling; +using Volo.Abp.Modularity; +using Volo.Abp.OpenIddict; +using Volo.Abp.PermissionManagement; +using Volo.Abp.SettingManagement; +using Volo.Abp.TenantManagement; +using Volo.Abp.Validation.Localization; +using Volo.Abp.VirtualFileSystem; + +namespace KonSoft.Admin; + +[DependsOn( + typeof(AbpAuditLoggingDomainSharedModule), + typeof(AbpBackgroundJobsDomainSharedModule), + typeof(AbpFeatureManagementDomainSharedModule), + typeof(AbpIdentityDomainSharedModule), + typeof(AbpOpenIddictDomainSharedModule), + typeof(AbpPermissionManagementDomainSharedModule), + typeof(AbpSettingManagementDomainSharedModule), + typeof(AbpTenantManagementDomainSharedModule) + )] +public class AdminDomainSharedModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + AdminGlobalFeatureConfigurator.Configure(); + AdminModuleExtensionConfigurator.Configure(); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + Configure(options => + { + options.Resources + .Add("en") + .AddBaseTypes(typeof(AbpValidationResource)) + .AddVirtualJson("/Localization/Admin"); + + options.DefaultResourceType = typeof(AdminResource); + }); + + Configure(options => + { + options.MapCodeNamespace("Admin", typeof(AdminResource)); + }); + } +} diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/AdminGlobalFeatureConfigurator.cs b/modules/admin/src/KonSoft.Admin.Domain.Shared/AdminGlobalFeatureConfigurator.cs new file mode 100644 index 0000000..4ca98e9 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/AdminGlobalFeatureConfigurator.cs @@ -0,0 +1,22 @@ +using Volo.Abp.Threading; + +namespace KonSoft.Admin; + +public static class AdminGlobalFeatureConfigurator +{ + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + + public static void Configure() + { + OneTimeRunner.Run(() => + { + /* You can configure (enable/disable) global features of the used modules here. + * + * YOU CAN SAFELY DELETE THIS CLASS AND REMOVE ITS USAGES IF YOU DON'T NEED TO IT! + * + * Please refer to the documentation to lear more about the Global Features System: + * https://docs.abp.io/en/abp/latest/Global-Features + */ + }); + } +} diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/AdminModuleExtensionConfigurator.cs b/modules/admin/src/KonSoft.Admin.Domain.Shared/AdminModuleExtensionConfigurator.cs new file mode 100644 index 0000000..5e99900 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/AdminModuleExtensionConfigurator.cs @@ -0,0 +1,73 @@ +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Identity; +using Volo.Abp.ObjectExtending; +using Volo.Abp.Threading; + +namespace KonSoft.Admin; + +public static class AdminModuleExtensionConfigurator +{ + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + + public static void Configure() + { + OneTimeRunner.Run(() => + { + ConfigureExistingProperties(); + ConfigureExtraProperties(); + }); + } + + private static void ConfigureExistingProperties() + { + /* You can change max lengths for properties of the + * entities defined in the modules used by your application. + * + * Example: Change user and role name max lengths + + AbpUserConsts.MaxNameLength = 99; + IdentityRoleConsts.MaxNameLength = 99; + + * Notice: It is not suggested to change property lengths + * unless you really need it. Go with the standard values wherever possible. + * + * If you are using EF Core, you will need to run the add-migration command after your changes. + */ + } + + private static void ConfigureExtraProperties() + { + /* You can configure extra properties for the + * entities defined in the modules used by your application. + * + * This class can be used to define these extra properties + * with a high level, easy to use API. + * + * Example: Add a new property to the user entity of the identity module + + ObjectExtensionManager.Instance.Modules() + .ConfigureIdentity(identity => + { + identity.ConfigureUser(user => + { + user.AddOrUpdateProperty( //property type: string + "SocialSecurityNumber", //property name + property => + { + //validation rules + property.Attributes.Add(new RequiredAttribute()); + property.Attributes.Add(new StringLengthAttribute(64) {MinimumLength = 4}); + + property.Configuration[IdentityModuleExtensionConsts.ConfigurationNames.AllowUserToEdit] = true; + + //...other configurations for this property + } + ); + }); + }); + + * See the documentation for more: + * https://docs.abp.io/en/abp/latest/Module-Entity-Extensions + */ + } +} diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/KonSoft.Admin.Domain.Shared.csproj b/modules/admin/src/KonSoft.Admin.Domain.Shared/KonSoft.Admin.Domain.Shared.csproj new file mode 100644 index 0000000..10d847b --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/KonSoft.Admin.Domain.Shared.csproj @@ -0,0 +1,32 @@ + + + + + + net8.0 + enable + KonSoft.Admin + true + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/ar.json b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/ar.json new file mode 100644 index 0000000..6e22c84 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/ar.json @@ -0,0 +1,9 @@ +{ + "culture": "ar", + "texts": { + "AppName": "Admin", + "Menu:Home": "الصفحة الرئيسية", + "Welcome": "مرحباً", + "LongWelcomeMessage": "مرحبا بكم في التطبيق. هذا مشروع بدء تشغيل يعتمد على إطار عمل ABP. لمزيد من المعلومات ، يرجى زيارة abp.io." + } +} diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/cs.json b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/cs.json new file mode 100644 index 0000000..f51319b --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/cs.json @@ -0,0 +1,9 @@ +{ + "culture": "cs", + "texts": { + "AppName": "Admin", + "Menu:Home": "Úvod", + "Welcome": "Vítejte", + "LongWelcomeMessage": "Vítejte v aplikaci. Toto je startovací projekt založený na ABP frameworku. Pro více informací, navštivte abp.io." + } +} diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/de.json b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/de.json new file mode 100644 index 0000000..f61fc79 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/de.json @@ -0,0 +1,9 @@ +{ + "culture": "de", + "texts": { + "AppName": "Admin", + "Menu:Home": "Home", + "Welcome": "Willkommen", + "LongWelcomeMessage": "Willkommen bei der Anwendung. Dies ist ein Startup-Projekt, das auf dem ABP-Framework basiert. Weitere Informationen finden Sie unter abp.io." + } +} diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/en-GB.json b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/en-GB.json new file mode 100644 index 0000000..12522c5 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/en-GB.json @@ -0,0 +1,9 @@ +{ + "culture": "en-GB", + "texts": { + "AppName": "Admin", + "Menu:Home": "Home", + "Welcome": "Welcome", + "LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io." + } +} diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/en.json b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/en.json new file mode 100644 index 0000000..0beddd9 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/en.json @@ -0,0 +1,9 @@ +{ + "culture": "en", + "texts": { + "AppName": "Admin", + "Menu:Home": "Home", + "Welcome": "Welcome", + "LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io." + } +} diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/es.json b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/es.json new file mode 100644 index 0000000..6cb7865 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/es.json @@ -0,0 +1,9 @@ +{ + "culture": "es", + "texts": { + "AppName": "Admin", + "Menu:Home": "Inicio", + "Welcome": "Bienvenido", + "LongWelcomeMessage": "Bienvenido a la aplicación, este es un proyecto base basado en el framework ABP. Para más información, visita abp.io." + } +} diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/fi.json b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/fi.json new file mode 100644 index 0000000..f1fc483 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/fi.json @@ -0,0 +1,9 @@ +{ + "culture": "fi", + "texts": { + "AppName": "Admin", + "Menu:Home": "Koti", + "Welcome": "Tervetuloa", + "LongWelcomeMessage": "Tervetuloa sovellukseen. Tämä on ABP-kehykseen perustuva käynnistysprojekti. Lisätietoja on osoitteessa abp.io." + } +} diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/fr.json b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/fr.json new file mode 100644 index 0000000..7210a33 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/fr.json @@ -0,0 +1,9 @@ +{ + "culture": "fr", + "texts": { + "AppName": "Admin", + "Menu:Home": "Accueil", + "Welcome": "Bienvenue", + "LongWelcomeMessage": "Bienvenue dans l'application. Il s'agit d'un projet de démarrage basé sur le framework ABP. Pour plus d'informations, visitez abp.io." + } +} diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/hi.json b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/hi.json new file mode 100644 index 0000000..f0d0767 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/hi.json @@ -0,0 +1,9 @@ +{ + "culture": "hi", + "texts": { + "AppName": "Admin", + "Menu:Home": "घर", + "Welcome": "स्वागत हे", + "LongWelcomeMessage": "आवेदन करने के लिए आपका स्वागत है। यह एबीपी ढांचे पर आधारित एक स्टार्टअप परियोजना है। अधिक जानकारी के लिए, abp.io पर जाएं।" + } +} diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/hr.json b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/hr.json new file mode 100644 index 0000000..ad592b1 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/hr.json @@ -0,0 +1,9 @@ +{ + "culture": "hr", + "texts": { + "AppName": "Admin", + "Menu:Home": "Početna", + "Welcome": "Dobrodošli", + "LongWelcomeMessage": "Dobrodošli u aplikaciju. Ovo je startup projekt temeljen na ABP framework-u. Za više informacija posjetite abp.io." + } +} diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/hu.json b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/hu.json new file mode 100644 index 0000000..fc9e6e7 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/hu.json @@ -0,0 +1,9 @@ +{ + "culture": "hu", + "texts": { + "AppName": "Admin", + "Menu:Home": "Kezdőlap", + "Welcome": "Üdvözlöm", + "LongWelcomeMessage": "Üdvözöljük az alkalmazásban. Ez egy ABP keretrendszeren alapuló startup projekt. További információkért látogasson el az abp.io oldalra." + } +} diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/is.json b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/is.json new file mode 100644 index 0000000..1f29976 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/is.json @@ -0,0 +1,9 @@ +{ + "culture": "is", + "texts": { + "AppName": "Admin", + "Menu:Home": "Heim", + "Welcome": "Velkomin", + "LongWelcomeMessage": "Verið velkomin í forritið. Þetta er startup verkefni sem byggir á ABP. Nánari upplýsingar er að finna á abp.io." + } +} diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/it.json b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/it.json new file mode 100644 index 0000000..8a50b61 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/it.json @@ -0,0 +1,9 @@ +{ + "culture": "it", + "texts": { + "AppName": "Admin", + "Menu:Home": "Home", + "Welcome": "Benvenuto", + "LongWelcomeMessage": "Benvenuto nell'applicazione. Questo è un progetto di avvio basato sul framework ABP. Per ulteriori informazioni, visita abp.io." + } +} diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/nl.json b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/nl.json new file mode 100644 index 0000000..edfe06d --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/nl.json @@ -0,0 +1,9 @@ +{ + "culture": "nl", + "texts": { + "AppName": "Admin", + "Menu:Home": "Home", + "Welcome": "Welkom", + "LongWelcomeMessage": "Welkom bij de applicatie. Dit is een startup-project gebaseerd op het ABP-framework. Bezoek abp.io voor meer informatie." + } +} diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/pl-PL.json b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/pl-PL.json new file mode 100644 index 0000000..c286219 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/pl-PL.json @@ -0,0 +1,9 @@ +{ + "culture": "pl-PL", + "texts": { + "AppName": "Admin", + "Menu:Home": "Home", + "Welcome": "Witaj", + "LongWelcomeMessage": "Witaj w aplikacji. To jest inicjalny projekt bazujący na ABP framework. Po więcej informacji odwiedź stronę abp.io." + } +} diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/pt-BR.json b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/pt-BR.json new file mode 100644 index 0000000..017edcc --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/pt-BR.json @@ -0,0 +1,9 @@ +{ + "culture": "pt-BR", + "texts": { + "AppName": "Admin", + "Menu:Home": "Principal", + "Welcome": "Seja bem-vindo!", + "LongWelcomeMessage": "Bem-vindo a esta aplicação. Este é um projeto inicial baseado no ABP framework. Para mais informações, visite abp.io." + } +} diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/ro-RO.json b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/ro-RO.json new file mode 100644 index 0000000..c137216 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/ro-RO.json @@ -0,0 +1,9 @@ +{ + "culture": "ro-RO", + "texts": { + "AppName": "Admin", + "Menu:Home": "Acasă", + "Welcome": "Bun venit", + "LongWelcomeMessage": "Bun venit la aplicaţie. Acesta este un proiect de pornire bazat pe framework-ul ABP. Pentru mai multe informaţii, vizitaţi, visit abp.io." + } +} diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/ru.json b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/ru.json new file mode 100644 index 0000000..d359d4c --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/ru.json @@ -0,0 +1,9 @@ +{ + "culture": "ru", + "texts": { + "AppName": "Admin", + "Menu:Home": "Главная", + "Welcome": "Добро пожаловать", + "LongWelcomeMessage": "Добро пожаловать в приложение. Этот запущенный проект основан на фреймворке ABP. Для получения дополнительной информации посетите сайт abp.io." + } +} diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/sk.json b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/sk.json new file mode 100644 index 0000000..5f5bf75 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/sk.json @@ -0,0 +1,9 @@ +{ + "culture": "sk", + "texts": { + "AppName": "Admin", + "Menu:Home": "Domov", + "Welcome": "Vitajte", + "LongWelcomeMessage": "Vitajte v aplikácii. Toto je štartovací projekt založený na ABP frameworku. Viac informácií nájdete na stránke abp.io." + } +} diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/sl.json b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/sl.json new file mode 100644 index 0000000..c877729 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/sl.json @@ -0,0 +1,9 @@ +{ + "culture": "sl", + "texts": { + "AppName": "Admin", + "Menu:Home": "Domov", + "Welcome": "Dobrodošli", + "LongWelcomeMessage": "Dobrodošli v aplikaciji. To je začetni projekt na osnovi okolja ABP. Za več informacij obiščite abp.io." + } +} diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/sv.json b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/sv.json new file mode 100644 index 0000000..bd1eae4 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/sv.json @@ -0,0 +1,9 @@ +{ + "culture": "sv", + "texts": { + "AppName": "MittProjektNamn", + "Menu:Home": "Hem", + "Welcome": "Välkommen", + "LongWelcomeMessage": "Välkommen till applikationen. Detta är ett startup-projekt baserat på ABP-ramverket. För mer information, besök abp.io." + } +} \ No newline at end of file diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/tr.json b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/tr.json new file mode 100644 index 0000000..12598cc --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/tr.json @@ -0,0 +1,9 @@ +{ + "culture": "tr", + "texts": { + "AppName": "Admin", + "Menu:Home": "Ana sayfa", + "Welcome": "Hoşgeldiniz", + "LongWelcomeMessage": "Uygulamaya hoşgeldiniz. Bu, ABP framework'ü üzerine bina edilmiş bir başlangıç projesidir. Daha fazla bilgi için abp.io adresini ziyaret edebilirsiniz." + } +} diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/vi.json b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/vi.json new file mode 100644 index 0000000..0519f02 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/vi.json @@ -0,0 +1,9 @@ +{ + "culture": "vi", + "texts": { + "AppName": "Admin", + "Menu:Home": "Trang chủ", + "Welcome": "Chào mừng bạn", + "LongWelcomeMessage": "Chào mừng bạn đến ứng dụng. Đây là một dự án khởi nghiệp dựa trên khung ABP. Để biết thêm thông tin, hãy truy cập abp.io." + } +} diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/zh-Hans.json b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/zh-Hans.json new file mode 100644 index 0000000..4e50081 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/zh-Hans.json @@ -0,0 +1,9 @@ +{ + "culture": "zh-Hans", + "texts": { + "AppName": "Admin", + "Menu:Home": "首页", + "Welcome": "欢迎", + "LongWelcomeMessage": "欢迎使用本应用程序。这是一个基于 ABP 框架的启动项目。更多信息,请访问 abp.io。" + } +} diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/zh-Hant.json b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/zh-Hant.json new file mode 100644 index 0000000..a45a089 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/Admin/zh-Hant.json @@ -0,0 +1,9 @@ +{ + "culture": "zh-Hant", + "texts": { + "AppName": "Admin", + "Menu:Home": "首頁", + "Welcome": "歡迎", + "LongWelcomeMessage": "歡迎來到此應用程式. 這是一個基於ABP框架的起始專案. 有關更多訊息, 請瀏覽 abp.io." + } + } diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/AdminResource.cs b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/AdminResource.cs new file mode 100644 index 0000000..71f6d84 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/Localization/AdminResource.cs @@ -0,0 +1,9 @@ +using Volo.Abp.Localization; + +namespace KonSoft.Admin.Localization; + +[LocalizationResourceName("Admin")] +public class AdminResource +{ + +} diff --git a/modules/admin/src/KonSoft.Admin.Domain.Shared/MultiTenancy/MultiTenancyConsts.cs b/modules/admin/src/KonSoft.Admin.Domain.Shared/MultiTenancy/MultiTenancyConsts.cs new file mode 100644 index 0000000..1dbf8b3 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain.Shared/MultiTenancy/MultiTenancyConsts.cs @@ -0,0 +1,10 @@ +namespace KonSoft.Admin.MultiTenancy; + +public static class MultiTenancyConsts +{ + /* Enable/disable multi-tenancy easily in a single point. + * If you will never need to multi-tenancy, you can remove + * related modules and code parts, including this file. + */ + public const bool IsEnabled = true; +} diff --git a/modules/admin/src/KonSoft.Admin.Domain/AdminConsts.cs b/modules/admin/src/KonSoft.Admin.Domain/AdminConsts.cs new file mode 100644 index 0000000..976eacc --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain/AdminConsts.cs @@ -0,0 +1,8 @@ +namespace KonSoft.Admin; + +public static class AdminConsts +{ + public const string DbTablePrefix = "App"; + + public const string DbSchema = null; +} diff --git a/modules/admin/src/KonSoft.Admin.Domain/AdminDomainModule.cs b/modules/admin/src/KonSoft.Admin.Domain/AdminDomainModule.cs new file mode 100644 index 0000000..b6bbdb5 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain/AdminDomainModule.cs @@ -0,0 +1,68 @@ +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection.Extensions; +using KonSoft.Admin.MultiTenancy; +using Volo.Abp.AuditLogging; +using Volo.Abp.BackgroundJobs; +using Volo.Abp.Emailing; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Volo.Abp.MultiTenancy; +using Volo.Abp.OpenIddict; +using Volo.Abp.PermissionManagement.Identity; +using Volo.Abp.PermissionManagement.OpenIddict; +using Volo.Abp.SettingManagement; +using Volo.Abp.TenantManagement; + +namespace KonSoft.Admin; + +[DependsOn( + typeof(AdminDomainSharedModule), + typeof(AbpAuditLoggingDomainModule), + typeof(AbpBackgroundJobsDomainModule), + typeof(AbpFeatureManagementDomainModule), + typeof(AbpIdentityDomainModule), + typeof(AbpOpenIddictDomainModule), + typeof(AbpPermissionManagementDomainOpenIddictModule), + typeof(AbpPermissionManagementDomainIdentityModule), + typeof(AbpSettingManagementDomainModule), + typeof(AbpTenantManagementDomainModule), + typeof(AbpEmailingModule) +)] +public class AdminDomainModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.Languages.Add(new LanguageInfo("ar", "ar", "العربية")); + options.Languages.Add(new LanguageInfo("cs", "cs", "Čeština")); + options.Languages.Add(new LanguageInfo("en", "en", "English")); + options.Languages.Add(new LanguageInfo("en-GB", "en-GB", "English (UK)")); + options.Languages.Add(new LanguageInfo("hu", "hu", "Magyar")); + options.Languages.Add(new LanguageInfo("hr", "hr", "Croatian")); + options.Languages.Add(new LanguageInfo("fi", "fi", "Finnish")); + options.Languages.Add(new LanguageInfo("fr", "fr", "Français")); + options.Languages.Add(new LanguageInfo("hi", "hi", "Hindi")); + options.Languages.Add(new LanguageInfo("it", "it", "Italiano")); + options.Languages.Add(new LanguageInfo("pt-BR", "pt-BR", "Português")); + options.Languages.Add(new LanguageInfo("ru", "ru", "Русский")); + options.Languages.Add(new LanguageInfo("sk", "sk", "Slovak")); + options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe")); + options.Languages.Add(new LanguageInfo("zh-Hans", "zh-Hans", "简体中文")); + options.Languages.Add(new LanguageInfo("zh-Hant", "zh-Hant", "繁體中文")); + options.Languages.Add(new LanguageInfo("de-DE", "de-DE", "Deutsch")); + options.Languages.Add(new LanguageInfo("es", "es", "Español")); + }); + + Configure(options => + { + options.IsEnabled = MultiTenancyConsts.IsEnabled; + }); + +#if DEBUG + context.Services.Replace(ServiceDescriptor.Singleton()); +#endif + } +} diff --git a/modules/admin/src/KonSoft.Admin.Domain/Data/AdminDbMigrationService.cs b/modules/admin/src/KonSoft.Admin.Domain/Data/AdminDbMigrationService.cs new file mode 100644 index 0000000..4b5626c --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain/Data/AdminDbMigrationService.cs @@ -0,0 +1,218 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Identity; +using Volo.Abp.MultiTenancy; +using Volo.Abp.TenantManagement; + +namespace KonSoft.Admin.Data; + +public class AdminDbMigrationService : ITransientDependency +{ + public ILogger Logger { get; set; } + + private readonly IDataSeeder _dataSeeder; + private readonly IEnumerable _dbSchemaMigrators; + private readonly ITenantRepository _tenantRepository; + private readonly ICurrentTenant _currentTenant; + + public AdminDbMigrationService( + IDataSeeder dataSeeder, + IEnumerable dbSchemaMigrators, + ITenantRepository tenantRepository, + ICurrentTenant currentTenant) + { + _dataSeeder = dataSeeder; + _dbSchemaMigrators = dbSchemaMigrators; + _tenantRepository = tenantRepository; + _currentTenant = currentTenant; + + Logger = NullLogger.Instance; + } + + public async Task MigrateAsync() + { + var initialMigrationAdded = AddInitialMigrationIfNotExist(); + + if (initialMigrationAdded) + { + return; + } + + Logger.LogInformation("Started database migrations..."); + + await MigrateDatabaseSchemaAsync(); + await SeedDataAsync(); + + Logger.LogInformation($"Successfully completed host database migrations."); + + var tenants = await _tenantRepository.GetListAsync(includeDetails: true); + + var migratedDatabaseSchemas = new HashSet(); + foreach (var tenant in tenants) + { + using (_currentTenant.Change(tenant.Id)) + { + if (tenant.ConnectionStrings.Any()) + { + var tenantConnectionStrings = tenant.ConnectionStrings + .Select(x => x.Value) + .ToList(); + + if (!migratedDatabaseSchemas.IsSupersetOf(tenantConnectionStrings)) + { + await MigrateDatabaseSchemaAsync(tenant); + + migratedDatabaseSchemas.AddIfNotContains(tenantConnectionStrings); + } + } + + await SeedDataAsync(tenant); + } + + Logger.LogInformation($"Successfully completed {tenant.Name} tenant database migrations."); + } + + Logger.LogInformation("Successfully completed all database migrations."); + Logger.LogInformation("You can safely end this process..."); + } + + private async Task MigrateDatabaseSchemaAsync(Tenant? tenant = null) + { + Logger.LogInformation( + $"Migrating schema for {(tenant == null ? "host" : tenant.Name + " tenant")} database..."); + + foreach (var migrator in _dbSchemaMigrators) + { + await migrator.MigrateAsync(); + } + } + + private async Task SeedDataAsync(Tenant? tenant = null) + { + Logger.LogInformation($"Executing {(tenant == null ? "host" : tenant.Name + " tenant")} database seed..."); + + await _dataSeeder.SeedAsync(new DataSeedContext(tenant?.Id) + .WithProperty(IdentityDataSeedContributor.AdminEmailPropertyName, IdentityDataSeedContributor.AdminEmailDefaultValue) + .WithProperty(IdentityDataSeedContributor.AdminPasswordPropertyName, IdentityDataSeedContributor.AdminPasswordDefaultValue) + ); + } + + private bool AddInitialMigrationIfNotExist() + { + try + { + if (!DbMigrationsProjectExists()) + { + return false; + } + } + catch (Exception) + { + return false; + } + + try + { + if (!MigrationsFolderExists()) + { + AddInitialMigration(); + return true; + } + else + { + return false; + } + } + catch (Exception e) + { + Logger.LogWarning("Couldn't determinate if any migrations exist : " + e.Message); + return false; + } + } + + private bool DbMigrationsProjectExists() + { + var dbMigrationsProjectFolder = GetEntityFrameworkCoreProjectFolderPath(); + + return dbMigrationsProjectFolder != null; + } + + private bool MigrationsFolderExists() + { + var dbMigrationsProjectFolder = GetEntityFrameworkCoreProjectFolderPath(); + return dbMigrationsProjectFolder != null && Directory.Exists(Path.Combine(dbMigrationsProjectFolder, "Migrations")); + } + + private void AddInitialMigration() + { + Logger.LogInformation("Creating initial migration..."); + + string argumentPrefix; + string fileName; + + if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) || RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + argumentPrefix = "-c"; + fileName = "/bin/bash"; + } + else + { + argumentPrefix = "/C"; + fileName = "cmd.exe"; + } + + var procStartInfo = new ProcessStartInfo(fileName, + $"{argumentPrefix} \"abp create-migration-and-run-migrator \"{GetEntityFrameworkCoreProjectFolderPath()}\"\"" + ); + + try + { + Process.Start(procStartInfo); + } + catch (Exception) + { + throw new Exception("Couldn't run ABP CLI..."); + } + } + + private string? GetEntityFrameworkCoreProjectFolderPath() + { + var slnDirectoryPath = GetSolutionDirectoryPath(); + + if (slnDirectoryPath == null) + { + throw new Exception("Solution folder not found!"); + } + + var srcDirectoryPath = Path.Combine(slnDirectoryPath, "src"); + + return Directory.GetDirectories(srcDirectoryPath) + .FirstOrDefault(d => d.EndsWith(".EntityFrameworkCore")); + } + + private string? GetSolutionDirectoryPath() + { + var currentDirectory = new DirectoryInfo(Directory.GetCurrentDirectory()); + + while (currentDirectory != null && Directory.GetParent(currentDirectory.FullName) != null) + { + currentDirectory = Directory.GetParent(currentDirectory.FullName); + + if (currentDirectory != null && Directory.GetFiles(currentDirectory.FullName).FirstOrDefault(f => f.EndsWith(".sln")) != null) + { + return currentDirectory.FullName; + } + } + + return null; + } +} diff --git a/modules/admin/src/KonSoft.Admin.Domain/Data/IAdminDbSchemaMigrator.cs b/modules/admin/src/KonSoft.Admin.Domain/Data/IAdminDbSchemaMigrator.cs new file mode 100644 index 0000000..d182021 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain/Data/IAdminDbSchemaMigrator.cs @@ -0,0 +1,8 @@ +using System.Threading.Tasks; + +namespace KonSoft.Admin.Data; + +public interface IAdminDbSchemaMigrator +{ + Task MigrateAsync(); +} diff --git a/modules/admin/src/KonSoft.Admin.Domain/Data/NullAdminDbSchemaMigrator.cs b/modules/admin/src/KonSoft.Admin.Domain/Data/NullAdminDbSchemaMigrator.cs new file mode 100644 index 0000000..0d1c758 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain/Data/NullAdminDbSchemaMigrator.cs @@ -0,0 +1,15 @@ +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; + +namespace KonSoft.Admin.Data; + +/* This is used if database provider does't define + * IAdminDbSchemaMigrator implementation. + */ +public class NullAdminDbSchemaMigrator : IAdminDbSchemaMigrator, ITransientDependency +{ + public Task MigrateAsync() + { + return Task.CompletedTask; + } +} diff --git a/modules/admin/src/KonSoft.Admin.Domain/KonSoft.Admin.Domain.csproj b/modules/admin/src/KonSoft.Admin.Domain/KonSoft.Admin.Domain.csproj new file mode 100644 index 0000000..831a3a2 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain/KonSoft.Admin.Domain.csproj @@ -0,0 +1,28 @@ + + + + + + net8.0 + enable + KonSoft.Admin + + + + + + + + + + + + + + + + + + + + diff --git a/modules/admin/src/KonSoft.Admin.Domain/OpenIddict/OpenIddictDataSeedContributor.cs b/modules/admin/src/KonSoft.Admin.Domain/OpenIddict/OpenIddictDataSeedContributor.cs new file mode 100644 index 0000000..1e4c9a1 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain/OpenIddict/OpenIddictDataSeedContributor.cs @@ -0,0 +1,327 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; +using System.Threading.Tasks; +using JetBrains.Annotations; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Localization; +using OpenIddict.Abstractions; +using Volo.Abp; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.OpenIddict.Applications; +using Volo.Abp.OpenIddict.Scopes; +using Volo.Abp.PermissionManagement; +using Volo.Abp.Uow; + +namespace KonSoft.Admin.OpenIddict; + +/* Creates initial data that is needed to property run the application + * and make client-to-server communication possible. + */ +public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDependency +{ + private readonly IConfiguration _configuration; + private readonly IOpenIddictApplicationRepository _openIddictApplicationRepository; + private readonly IAbpApplicationManager _applicationManager; + private readonly IOpenIddictScopeRepository _openIddictScopeRepository; + private readonly IOpenIddictScopeManager _scopeManager; + private readonly IPermissionDataSeeder _permissionDataSeeder; + private readonly IStringLocalizer L; + + public OpenIddictDataSeedContributor( + IConfiguration configuration, + IOpenIddictApplicationRepository openIddictApplicationRepository, + IAbpApplicationManager applicationManager, + IOpenIddictScopeRepository openIddictScopeRepository, + IOpenIddictScopeManager scopeManager, + IPermissionDataSeeder permissionDataSeeder, + IStringLocalizer l ) + { + _configuration = configuration; + _openIddictApplicationRepository = openIddictApplicationRepository; + _applicationManager = applicationManager; + _openIddictScopeRepository = openIddictScopeRepository; + _scopeManager = scopeManager; + _permissionDataSeeder = permissionDataSeeder; + L = l; + } + + [UnitOfWork] + public virtual async Task SeedAsync(DataSeedContext context) + { + await CreateScopesAsync(); + await CreateApplicationsAsync(); + } + + private async Task CreateScopesAsync() + { + if (await _openIddictScopeRepository.FindByNameAsync("Admin") == null) + { + await _scopeManager.CreateAsync(new OpenIddictScopeDescriptor { + Name = "Admin", DisplayName = "Admin API", Resources = { "Admin" } + }); + } + } + + private async Task CreateApplicationsAsync() + { + var commonScopes = new List { + OpenIddictConstants.Permissions.Scopes.Address, + OpenIddictConstants.Permissions.Scopes.Email, + OpenIddictConstants.Permissions.Scopes.Phone, + OpenIddictConstants.Permissions.Scopes.Profile, + OpenIddictConstants.Permissions.Scopes.Roles, + "Admin" + }; + + var configurationSection = _configuration.GetSection("OpenIddict:Applications"); + + + + + + + // Swagger Client + var swaggerClientId = configurationSection["Admin_Swagger:ClientId"]; + if (!swaggerClientId.IsNullOrWhiteSpace()) + { + var swaggerRootUrl = configurationSection["Admin_Swagger:RootUrl"]?.TrimEnd('/'); + + await CreateApplicationAsync( + name: swaggerClientId!, + type: OpenIddictConstants.ClientTypes.Public, + consentType: OpenIddictConstants.ConsentTypes.Implicit, + displayName: "Swagger Application", + secret: null, + grantTypes: new List { OpenIddictConstants.GrantTypes.AuthorizationCode, }, + scopes: commonScopes, + redirectUri: $"{swaggerRootUrl}/swagger/oauth2-redirect.html", + clientUri: swaggerRootUrl + ); + } + } + + private async Task CreateApplicationAsync( + [NotNull] string name, + [NotNull] string type, + [NotNull] string consentType, + string displayName, + string? secret, + List grantTypes, + List scopes, + string? clientUri = null, + string? redirectUri = null, + string? postLogoutRedirectUri = null, + List? permissions = null) + { + if (!string.IsNullOrEmpty(secret) && string.Equals(type, OpenIddictConstants.ClientTypes.Public, + StringComparison.OrdinalIgnoreCase)) + { + throw new BusinessException(L["NoClientSecretCanBeSetForPublicApplications"]); + } + + if (string.IsNullOrEmpty(secret) && string.Equals(type, OpenIddictConstants.ClientTypes.Confidential, + StringComparison.OrdinalIgnoreCase)) + { + throw new BusinessException(L["TheClientSecretIsRequiredForConfidentialApplications"]); + } + + var client = await _openIddictApplicationRepository.FindByClientIdAsync(name); + + var application = new AbpApplicationDescriptor { + ClientId = name, + ClientType = type, + ClientSecret = secret, + ConsentType = consentType, + DisplayName = displayName, + ClientUri = clientUri, + }; + + Check.NotNullOrEmpty(grantTypes, nameof(grantTypes)); + Check.NotNullOrEmpty(scopes, nameof(scopes)); + + if (new[] { OpenIddictConstants.GrantTypes.AuthorizationCode, OpenIddictConstants.GrantTypes.Implicit }.All( + grantTypes.Contains)) + { + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.CodeIdToken); + + if (string.Equals(type, OpenIddictConstants.ClientTypes.Public, StringComparison.OrdinalIgnoreCase)) + { + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.CodeIdTokenToken); + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.CodeToken); + } + } + + if (!redirectUri.IsNullOrWhiteSpace() || !postLogoutRedirectUri.IsNullOrWhiteSpace()) + { + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Logout); + } + + var buildInGrantTypes = new[] { + OpenIddictConstants.GrantTypes.Implicit, OpenIddictConstants.GrantTypes.Password, + OpenIddictConstants.GrantTypes.AuthorizationCode, OpenIddictConstants.GrantTypes.ClientCredentials, + OpenIddictConstants.GrantTypes.DeviceCode, OpenIddictConstants.GrantTypes.RefreshToken + }; + + foreach (var grantType in grantTypes) + { + if (grantType == OpenIddictConstants.GrantTypes.AuthorizationCode) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.AuthorizationCode); + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.Code); + } + + if (grantType == OpenIddictConstants.GrantTypes.AuthorizationCode || + grantType == OpenIddictConstants.GrantTypes.Implicit) + { + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Authorization); + } + + if (grantType == OpenIddictConstants.GrantTypes.AuthorizationCode || + grantType == OpenIddictConstants.GrantTypes.ClientCredentials || + grantType == OpenIddictConstants.GrantTypes.Password || + grantType == OpenIddictConstants.GrantTypes.RefreshToken || + grantType == OpenIddictConstants.GrantTypes.DeviceCode) + { + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Token); + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Revocation); + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Introspection); + } + + if (grantType == OpenIddictConstants.GrantTypes.ClientCredentials) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.ClientCredentials); + } + + if (grantType == OpenIddictConstants.GrantTypes.Implicit) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.Implicit); + } + + if (grantType == OpenIddictConstants.GrantTypes.Password) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.Password); + } + + if (grantType == OpenIddictConstants.GrantTypes.RefreshToken) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.RefreshToken); + } + + if (grantType == OpenIddictConstants.GrantTypes.DeviceCode) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.DeviceCode); + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Device); + } + + if (grantType == OpenIddictConstants.GrantTypes.Implicit) + { + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.IdToken); + if (string.Equals(type, OpenIddictConstants.ClientTypes.Public, StringComparison.OrdinalIgnoreCase)) + { + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.IdTokenToken); + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.Token); + } + } + + if (!buildInGrantTypes.Contains(grantType)) + { + application.Permissions.Add(OpenIddictConstants.Permissions.Prefixes.GrantType + grantType); + } + } + + var buildInScopes = new[] { + OpenIddictConstants.Permissions.Scopes.Address, OpenIddictConstants.Permissions.Scopes.Email, + OpenIddictConstants.Permissions.Scopes.Phone, OpenIddictConstants.Permissions.Scopes.Profile, + OpenIddictConstants.Permissions.Scopes.Roles + }; + + foreach (var scope in scopes) + { + if (buildInScopes.Contains(scope)) + { + application.Permissions.Add(scope); + } + else + { + application.Permissions.Add(OpenIddictConstants.Permissions.Prefixes.Scope + scope); + } + } + + if (redirectUri != null) + { + if (!redirectUri.IsNullOrEmpty()) + { + if (!Uri.TryCreate(redirectUri, UriKind.Absolute, out var uri) || !uri.IsWellFormedOriginalString()) + { + throw new BusinessException(L["InvalidRedirectUri", redirectUri]); + } + + if (application.RedirectUris.All(x => x != uri)) + { + application.RedirectUris.Add(uri); + } + } + } + + if (postLogoutRedirectUri != null) + { + if (!postLogoutRedirectUri.IsNullOrEmpty()) + { + if (!Uri.TryCreate(postLogoutRedirectUri, UriKind.Absolute, out var uri) || + !uri.IsWellFormedOriginalString()) + { + throw new BusinessException(L["InvalidPostLogoutRedirectUri", postLogoutRedirectUri]); + } + + if (application.PostLogoutRedirectUris.All(x => x != uri)) + { + application.PostLogoutRedirectUris.Add(uri); + } + } + } + + if (permissions != null) + { + await _permissionDataSeeder.SeedAsync( + ClientPermissionValueProvider.ProviderName, + name, + permissions, + null + ); + } + + if (client == null) + { + await _applicationManager.CreateAsync(application); + return; + } + + if (!HasSameRedirectUris(client, application)) + { + client.RedirectUris = JsonSerializer.Serialize(application.RedirectUris.Select(q => q.ToString().TrimEnd('/'))); + client.PostLogoutRedirectUris = JsonSerializer.Serialize(application.PostLogoutRedirectUris.Select(q => q.ToString().TrimEnd('/'))); + + await _applicationManager.UpdateAsync(client.ToModel()); + } + + if (!HasSameScopes(client, application)) + { + client.Permissions = JsonSerializer.Serialize(application.Permissions.Select(q => q.ToString())); + await _applicationManager.UpdateAsync(client.ToModel()); + } + } + + private bool HasSameRedirectUris(OpenIddictApplication existingClient, AbpApplicationDescriptor application) + { + return existingClient.RedirectUris == JsonSerializer.Serialize(application.RedirectUris.Select(q => q.ToString().TrimEnd('/'))); + } + + private bool HasSameScopes(OpenIddictApplication existingClient, AbpApplicationDescriptor application) + { + return existingClient.Permissions == JsonSerializer.Serialize(application.Permissions.Select(q => q.ToString().TrimEnd('/'))); + } +} diff --git a/modules/admin/src/KonSoft.Admin.Domain/Properties/AssemblyInfo.cs b/modules/admin/src/KonSoft.Admin.Domain/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..1ed25b9 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain/Properties/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using System.Runtime.CompilerServices; +[assembly:InternalsVisibleToAttribute("KonSoft.Admin.Domain.Tests")] +[assembly:InternalsVisibleToAttribute("KonSoft.Admin.TestBase")] diff --git a/modules/admin/src/KonSoft.Admin.Domain/Settings/AdminSettingDefinitionProvider.cs b/modules/admin/src/KonSoft.Admin.Domain/Settings/AdminSettingDefinitionProvider.cs new file mode 100644 index 0000000..0920a30 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain/Settings/AdminSettingDefinitionProvider.cs @@ -0,0 +1,12 @@ +using Volo.Abp.Settings; + +namespace KonSoft.Admin.Settings; + +public class AdminSettingDefinitionProvider : SettingDefinitionProvider +{ + public override void Define(ISettingDefinitionContext context) + { + //Define your own settings here. Example: + //context.Add(new SettingDefinition(AdminSettings.MySetting1)); + } +} diff --git a/modules/admin/src/KonSoft.Admin.Domain/Settings/AdminSettings.cs b/modules/admin/src/KonSoft.Admin.Domain/Settings/AdminSettings.cs new file mode 100644 index 0000000..1d1d09e --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.Domain/Settings/AdminSettings.cs @@ -0,0 +1,9 @@ +namespace KonSoft.Admin.Settings; + +public static class AdminSettings +{ + private const string Prefix = "Admin"; + + //Add your own setting names here. Example: + //public const string MySetting1 = Prefix + ".MySetting1"; +} diff --git a/modules/admin/src/KonSoft.Admin.EntityFrameworkCore/EntityFrameworkCore/AdminDbContext.cs b/modules/admin/src/KonSoft.Admin.EntityFrameworkCore/EntityFrameworkCore/AdminDbContext.cs new file mode 100644 index 0000000..f78d79f --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.EntityFrameworkCore/EntityFrameworkCore/AdminDbContext.cs @@ -0,0 +1,86 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp.AuditLogging.EntityFrameworkCore; +using Volo.Abp.BackgroundJobs.EntityFrameworkCore; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.FeatureManagement.EntityFrameworkCore; +using Volo.Abp.Identity; +using Volo.Abp.Identity.EntityFrameworkCore; +using Volo.Abp.OpenIddict.EntityFrameworkCore; +using Volo.Abp.PermissionManagement.EntityFrameworkCore; +using Volo.Abp.SettingManagement.EntityFrameworkCore; +using Volo.Abp.TenantManagement; +using Volo.Abp.TenantManagement.EntityFrameworkCore; + +namespace KonSoft.Admin.EntityFrameworkCore; + +[ReplaceDbContext(typeof(IIdentityDbContext))] +[ReplaceDbContext(typeof(ITenantManagementDbContext))] +[ConnectionStringName("Default")] +public class AdminDbContext : + AbpDbContext, + IIdentityDbContext, + ITenantManagementDbContext +{ + /* Add DbSet properties for your Aggregate Roots / Entities here. */ + + #region Entities from the modules + + /* Notice: We only implemented IIdentityDbContext and ITenantManagementDbContext + * and replaced them for this DbContext. This allows you to perform JOIN + * queries for the entities of these modules over the repositories easily. You + * typically don't need that for other modules. But, if you need, you can + * implement the DbContext interface of the needed module and use ReplaceDbContext + * attribute just like IIdentityDbContext and ITenantManagementDbContext. + * + * More info: Replacing a DbContext of a module ensures that the related module + * uses this DbContext on runtime. Otherwise, it will use its own DbContext class. + */ + + //Identity + public DbSet Users { get; set; } + public DbSet Roles { get; set; } + public DbSet ClaimTypes { get; set; } + public DbSet OrganizationUnits { get; set; } + public DbSet SecurityLogs { get; set; } + public DbSet LinkUsers { get; set; } + public DbSet UserDelegations { get; set; } + public DbSet Sessions { get; set; } + // Tenant Management + public DbSet Tenants { get; set; } + public DbSet TenantConnectionStrings { get; set; } + + #endregion + + public AdminDbContext(DbContextOptions options) + : base(options) + { + + } + + protected override void OnModelCreating(ModelBuilder builder) + { + base.OnModelCreating(builder); + + /* Include modules to your migration db context */ + + builder.ConfigurePermissionManagement(); + builder.ConfigureSettingManagement(); + builder.ConfigureBackgroundJobs(); + builder.ConfigureAuditLogging(); + builder.ConfigureIdentity(); + builder.ConfigureOpenIddict(); + builder.ConfigureFeatureManagement(); + builder.ConfigureTenantManagement(); + + /* Configure your own tables/entities inside here */ + + //builder.Entity(b => + //{ + // b.ToTable(AdminConsts.DbTablePrefix + "YourEntities", AdminConsts.DbSchema); + // b.ConfigureByConvention(); //auto configure for the base class props + // //... + //}); + } +} diff --git a/modules/admin/src/KonSoft.Admin.EntityFrameworkCore/EntityFrameworkCore/AdminDbContextFactory.cs b/modules/admin/src/KonSoft.Admin.EntityFrameworkCore/EntityFrameworkCore/AdminDbContextFactory.cs new file mode 100644 index 0000000..9d63ad3 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.EntityFrameworkCore/EntityFrameworkCore/AdminDbContextFactory.cs @@ -0,0 +1,36 @@ +using System; +using System.IO; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Design; +using Microsoft.Extensions.Configuration; + +namespace KonSoft.Admin.EntityFrameworkCore; + +/* This class is needed for EF Core console commands + * (like Add-Migration and Update-Database commands) */ +public class AdminDbContextFactory : IDesignTimeDbContextFactory +{ + public AdminDbContext CreateDbContext(string[] args) + { + // https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic + AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); + + AdminEfCoreEntityExtensionMappings.Configure(); + + var configuration = BuildConfiguration(); + + var builder = new DbContextOptionsBuilder() + .UseNpgsql(configuration.GetConnectionString("Default")); + + return new AdminDbContext(builder.Options); + } + + private static IConfigurationRoot BuildConfiguration() + { + var builder = new ConfigurationBuilder() + .SetBasePath(Path.Combine(Directory.GetCurrentDirectory(), "../KonSoft.Admin.DbMigrator/")) + .AddJsonFile("appsettings.json", optional: false); + + return builder.Build(); + } +} diff --git a/modules/admin/src/KonSoft.Admin.EntityFrameworkCore/EntityFrameworkCore/AdminEfCoreEntityExtensionMappings.cs b/modules/admin/src/KonSoft.Admin.EntityFrameworkCore/EntityFrameworkCore/AdminEfCoreEntityExtensionMappings.cs new file mode 100644 index 0000000..a41e0ac --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.EntityFrameworkCore/EntityFrameworkCore/AdminEfCoreEntityExtensionMappings.cs @@ -0,0 +1,44 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Identity; +using Volo.Abp.ObjectExtending; +using Volo.Abp.Threading; + +namespace KonSoft.Admin.EntityFrameworkCore; + +public static class AdminEfCoreEntityExtensionMappings +{ + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + + public static void Configure() + { + AdminGlobalFeatureConfigurator.Configure(); + AdminModuleExtensionConfigurator.Configure(); + + OneTimeRunner.Run(() => + { + /* You can configure extra properties for the + * entities defined in the modules used by your application. + * + * This class can be used to map these extra properties to table fields in the database. + * + * USE THIS CLASS ONLY TO CONFIGURE EF CORE RELATED MAPPING. + * USE AdminModuleExtensionConfigurator CLASS (in the Domain.Shared project) + * FOR A HIGH LEVEL API TO DEFINE EXTRA PROPERTIES TO ENTITIES OF THE USED MODULES + * + * Example: Map a property to a table field: + + ObjectExtensionManager.Instance + .MapEfCoreProperty( + "MyProperty", + (entityBuilder, propertyBuilder) => + { + propertyBuilder.HasMaxLength(128); + } + ); + + * See the documentation for more: + * https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Extending-Entities + */ + }); + } +} diff --git a/modules/admin/src/KonSoft.Admin.EntityFrameworkCore/EntityFrameworkCore/AdminEntityFrameworkCoreModule.cs b/modules/admin/src/KonSoft.Admin.EntityFrameworkCore/EntityFrameworkCore/AdminEntityFrameworkCoreModule.cs new file mode 100644 index 0000000..ff52226 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.EntityFrameworkCore/EntityFrameworkCore/AdminEntityFrameworkCoreModule.cs @@ -0,0 +1,57 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Uow; +using Volo.Abp.AuditLogging.EntityFrameworkCore; +using Volo.Abp.BackgroundJobs.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.PostgreSql; +using Volo.Abp.FeatureManagement.EntityFrameworkCore; +using Volo.Abp.Identity.EntityFrameworkCore; +using Volo.Abp.Modularity; +using Volo.Abp.OpenIddict.EntityFrameworkCore; +using Volo.Abp.PermissionManagement.EntityFrameworkCore; +using Volo.Abp.SettingManagement.EntityFrameworkCore; +using Volo.Abp.TenantManagement.EntityFrameworkCore; + +namespace KonSoft.Admin.EntityFrameworkCore; + +[DependsOn( + typeof(AdminDomainModule), + typeof(AbpIdentityEntityFrameworkCoreModule), + typeof(AbpOpenIddictEntityFrameworkCoreModule), + typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpSettingManagementEntityFrameworkCoreModule), + typeof(AbpEntityFrameworkCorePostgreSqlModule), + typeof(AbpBackgroundJobsEntityFrameworkCoreModule), + typeof(AbpAuditLoggingEntityFrameworkCoreModule), + typeof(AbpTenantManagementEntityFrameworkCoreModule), + typeof(AbpFeatureManagementEntityFrameworkCoreModule) + )] +public class AdminEntityFrameworkCoreModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + // https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic + AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); + + AdminEfCoreEntityExtensionMappings.Configure(); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAbpDbContext(options => + { + /* Remove "includeAllEntities: true" to create + * default repositories only for aggregate roots */ + options.AddDefaultRepositories(includeAllEntities: true); + }); + + Configure(options => + { + /* The main point to change your DBMS. + * See also AdminMigrationsDbContextFactory for EF Core tooling. */ + options.UseNpgsql(); + }); + + } +} diff --git a/modules/admin/src/KonSoft.Admin.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreAdminDbSchemaMigrator.cs b/modules/admin/src/KonSoft.Admin.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreAdminDbSchemaMigrator.cs new file mode 100644 index 0000000..99dceb8 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreAdminDbSchemaMigrator.cs @@ -0,0 +1,34 @@ +using System; +using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using KonSoft.Admin.Data; +using Volo.Abp.DependencyInjection; + +namespace KonSoft.Admin.EntityFrameworkCore; + +public class EntityFrameworkCoreAdminDbSchemaMigrator + : IAdminDbSchemaMigrator, ITransientDependency +{ + private readonly IServiceProvider _serviceProvider; + + public EntityFrameworkCoreAdminDbSchemaMigrator( + IServiceProvider serviceProvider) + { + _serviceProvider = serviceProvider; + } + + public async Task MigrateAsync() + { + /* We intentionally resolve the AdminDbContext + * from IServiceProvider (instead of directly injecting it) + * to properly get the connection string of the current tenant in the + * current scope. + */ + + await _serviceProvider + .GetRequiredService() + .Database + .MigrateAsync(); + } +} diff --git a/modules/admin/src/KonSoft.Admin.EntityFrameworkCore/KonSoft.Admin.EntityFrameworkCore.csproj b/modules/admin/src/KonSoft.Admin.EntityFrameworkCore/KonSoft.Admin.EntityFrameworkCore.csproj new file mode 100644 index 0000000..ca32b8e --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.EntityFrameworkCore/KonSoft.Admin.EntityFrameworkCore.csproj @@ -0,0 +1,31 @@ + + + + + + net8.0 + enable + KonSoft.Admin + + + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers + + + + diff --git a/modules/admin/src/KonSoft.Admin.EntityFrameworkCore/Migrations/20250908050617_Initial.Designer.cs b/modules/admin/src/KonSoft.Admin.EntityFrameworkCore/Migrations/20250908050617_Initial.Designer.cs new file mode 100644 index 0000000..26bce1d --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.EntityFrameworkCore/Migrations/20250908050617_Initial.Designer.cs @@ -0,0 +1,2006 @@ +// +using System; +using KonSoft.Admin.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace KonSoft.Admin.Migrations +{ + [DbContext(typeof(AdminDbContext))] + [Migration("20250908050617_Initial")] + partial class Initial + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.PostgreSql) + .HasAnnotation("ProductVersion", "8.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("character varying(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("text"); + + b.Property("ExecutionDuration") + .HasColumnType("integer") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("timestamp without time zone"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("integer") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("uuid") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("uuid") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("uuid") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AuditLogId") + .HasColumnType("uuid") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("integer") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AuditLogId") + .HasColumnType("uuid") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("smallint") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("uuid"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("EntityChangeId") + .HasColumnType("uuid"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("character varying(1048576)"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("LastTryTime") + .HasColumnType("timestamp without time zone"); + + b.Property("NextTryTime") + .HasColumnType("timestamp without time zone"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("boolean"); + + b.Property("IsVisibleToClients") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("Required") + .HasColumnType("boolean"); + + b.Property("ValueType") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("SourceTenantId") + .HasColumnType("uuid"); + + b.Property("SourceUserId") + .HasColumnType("uuid"); + + b.Property("TargetTenantId") + .HasColumnType("uuid"); + + b.Property("TargetUserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("boolean") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("boolean") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("boolean") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("character varying(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("character varying(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("character varying(96)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySession", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Device") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("DeviceInfo") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("IpAddresses") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("LastAccessed") + .HasColumnType("timestamp without time zone"); + + b.Property("SessionId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("SignedIn") + .HasColumnType("timestamp without time zone"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("Device"); + + b.HasIndex("SessionId"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSessions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("boolean") + .HasColumnName("IsActive"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("LastPasswordChangeTime") + .HasColumnType("timestamp with time zone"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("SecurityStamp"); + + b.Property("ShouldChangePasswordOnNextLogin") + .HasColumnType("boolean"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserDelegation", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("EndTime") + .HasColumnType("timestamp without time zone"); + + b.Property("SourceUserId") + .HasColumnType("uuid"); + + b.Property("StartTime") + .HasColumnType("timestamp without time zone"); + + b.Property("TargetUserId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AbpUserDelegations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("character varying(196)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uuid"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("character varying(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("DisplayName"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uuid"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("ClientId") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("ClientSecret") + .HasColumnType("text"); + + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("ClientUri") + .HasColumnType("text"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .HasColumnType("text"); + + b.Property("DisplayNames") + .HasColumnType("text"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("JsonWebKeySet") + .HasColumnType("text"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasColumnType("text"); + + b.Property("Permissions") + .HasColumnType("text"); + + b.Property("PostLogoutRedirectUris") + .HasColumnType("text"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("RedirectUris") + .HasColumnType("text"); + + b.Property("Requirements") + .HasColumnType("text"); + + b.Property("Settings") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("OpenIddictApplications", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationId") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("timestamp without time zone"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("Scopes") + .HasColumnType("text"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("character varying(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictAuthorizations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Scopes.OpenIddictScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Descriptions") + .HasColumnType("text"); + + b.Property("DisplayName") + .HasColumnType("text"); + + b.Property("DisplayNames") + .HasColumnType("text"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("Resources") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("OpenIddictScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationId") + .HasColumnType("uuid"); + + b.Property("AuthorizationId") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("timestamp without time zone"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("ExpirationDate") + .HasColumnType("timestamp without time zone"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Payload") + .HasColumnType("text"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("RedemptionDate") + .HasColumnType("timestamp without time zone"); + + b.Property("ReferenceId") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("character varying(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.HasKey("Id"); + + b.HasIndex("AuthorizationId"); + + b.HasIndex("ReferenceId"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("IsEnabled") + .HasColumnType("boolean"); + + b.Property("MultiTenancySide") + .HasColumnType("smallint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.SettingDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DefaultValue") + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.Property("Description") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsEncrypted") + .HasColumnType("boolean"); + + b.Property("IsInherited") + .HasColumnType("boolean"); + + b.Property("IsVisibleToClients") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("Providers") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpSettingDefinitions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("uuid"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + + b.HasOne("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", null) + .WithMany() + .HasForeignKey("AuthorizationId"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/modules/admin/src/KonSoft.Admin.EntityFrameworkCore/Migrations/20250908050617_Initial.cs b/modules/admin/src/KonSoft.Admin.EntityFrameworkCore/Migrations/20250908050617_Initial.cs new file mode 100644 index 0000000..020c22d --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.EntityFrameworkCore/Migrations/20250908050617_Initial.cs @@ -0,0 +1,1156 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace KonSoft.Admin.Migrations +{ + /// + public partial class Initial : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "AbpAuditLogs", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + ApplicationName = table.Column(type: "character varying(96)", maxLength: 96, nullable: true), + UserId = table.Column(type: "uuid", nullable: true), + UserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + TenantId = table.Column(type: "uuid", nullable: true), + TenantName = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + ImpersonatorUserId = table.Column(type: "uuid", nullable: true), + ImpersonatorUserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + ImpersonatorTenantId = table.Column(type: "uuid", nullable: true), + ImpersonatorTenantName = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + ExecutionTime = table.Column(type: "timestamp without time zone", nullable: false), + ExecutionDuration = table.Column(type: "integer", nullable: false), + ClientIpAddress = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + ClientName = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + ClientId = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + CorrelationId = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + BrowserInfo = table.Column(type: "character varying(512)", maxLength: 512, nullable: true), + HttpMethod = table.Column(type: "character varying(16)", maxLength: 16, nullable: true), + Url = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + Exceptions = table.Column(type: "text", nullable: true), + Comments = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + HttpStatusCode = table.Column(type: "integer", nullable: true), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpAuditLogs", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpBackgroundJobs", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + JobName = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + JobArgs = table.Column(type: "character varying(1048576)", maxLength: 1048576, nullable: false), + TryCount = table.Column(type: "smallint", nullable: false, defaultValue: (short)0), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + NextTryTime = table.Column(type: "timestamp without time zone", nullable: false), + LastTryTime = table.Column(type: "timestamp without time zone", nullable: true), + IsAbandoned = table.Column(type: "boolean", nullable: false, defaultValue: false), + Priority = table.Column(type: "smallint", nullable: false, defaultValue: (byte)15), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpBackgroundJobs", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpClaimTypes", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + Required = table.Column(type: "boolean", nullable: false), + IsStatic = table.Column(type: "boolean", nullable: false), + Regex = table.Column(type: "character varying(512)", maxLength: 512, nullable: true), + RegexDescription = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + Description = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + ValueType = table.Column(type: "integer", nullable: false), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpClaimTypes", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpFeatureGroups", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + DisplayName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + ExtraProperties = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpFeatureGroups", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpFeatures", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + GroupName = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + ParentName = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + DisplayName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + Description = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + DefaultValue = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + IsVisibleToClients = table.Column(type: "boolean", nullable: false), + IsAvailableToHost = table.Column(type: "boolean", nullable: false), + AllowedProviders = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + ValueType = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: true), + ExtraProperties = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpFeatures", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpFeatureValues", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + Value = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + ProviderName = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + ProviderKey = table.Column(type: "character varying(64)", maxLength: 64, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpFeatureValues", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpLinkUsers", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + SourceUserId = table.Column(type: "uuid", nullable: false), + SourceTenantId = table.Column(type: "uuid", nullable: true), + TargetUserId = table.Column(type: "uuid", nullable: false), + TargetTenantId = table.Column(type: "uuid", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpLinkUsers", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpOrganizationUnits", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + ParentId = table.Column(type: "uuid", nullable: true), + Code = table.Column(type: "character varying(95)", maxLength: 95, nullable: false), + DisplayName = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + EntityVersion = table.Column(type: "integer", nullable: false), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp without time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpOrganizationUnits", x => x.Id); + table.ForeignKey( + name: "FK_AbpOrganizationUnits_AbpOrganizationUnits_ParentId", + column: x => x.ParentId, + principalTable: "AbpOrganizationUnits", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "AbpPermissionGrants", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + ProviderName = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + ProviderKey = table.Column(type: "character varying(64)", maxLength: 64, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpPermissionGroups", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + DisplayName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + ExtraProperties = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissionGroups", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpPermissions", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + GroupName = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + ParentName = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + DisplayName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + IsEnabled = table.Column(type: "boolean", nullable: false), + MultiTenancySide = table.Column(type: "smallint", nullable: false), + Providers = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + StateCheckers = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + ExtraProperties = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissions", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpRoles", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + Name = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + NormalizedName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + IsDefault = table.Column(type: "boolean", nullable: false), + IsStatic = table.Column(type: "boolean", nullable: false), + IsPublic = table.Column(type: "boolean", nullable: false), + EntityVersion = table.Column(type: "integer", nullable: false), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpRoles", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpSecurityLogs", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + ApplicationName = table.Column(type: "character varying(96)", maxLength: 96, nullable: true), + Identity = table.Column(type: "character varying(96)", maxLength: 96, nullable: true), + Action = table.Column(type: "character varying(96)", maxLength: 96, nullable: true), + UserId = table.Column(type: "uuid", nullable: true), + UserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + TenantName = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + ClientId = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + CorrelationId = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + ClientIpAddress = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + BrowserInfo = table.Column(type: "character varying(512)", maxLength: 512, nullable: true), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpSecurityLogs", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpSessions", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + SessionId = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + Device = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + DeviceInfo = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + TenantId = table.Column(type: "uuid", nullable: true), + UserId = table.Column(type: "uuid", nullable: false), + ClientId = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + IpAddresses = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + SignedIn = table.Column(type: "timestamp without time zone", nullable: false), + LastAccessed = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpSessions", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpSettingDefinitions", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + DisplayName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + Description = table.Column(type: "character varying(512)", maxLength: 512, nullable: true), + DefaultValue = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: true), + IsVisibleToClients = table.Column(type: "boolean", nullable: false), + Providers = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: true), + IsInherited = table.Column(type: "boolean", nullable: false), + IsEncrypted = table.Column(type: "boolean", nullable: false), + ExtraProperties = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpSettingDefinitions", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpSettings", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + Value = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: false), + ProviderName = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + ProviderKey = table.Column(type: "character varying(64)", maxLength: 64, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpSettings", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpTenants", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + NormalizedName = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + EntityVersion = table.Column(type: "integer", nullable: false), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp without time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpTenants", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpUserDelegations", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + SourceUserId = table.Column(type: "uuid", nullable: false), + TargetUserId = table.Column(type: "uuid", nullable: false), + StartTime = table.Column(type: "timestamp without time zone", nullable: false), + EndTime = table.Column(type: "timestamp without time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserDelegations", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpUsers", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + UserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + NormalizedUserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + Name = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + Surname = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + Email = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + NormalizedEmail = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + EmailConfirmed = table.Column(type: "boolean", nullable: false, defaultValue: false), + PasswordHash = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + SecurityStamp = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + IsExternal = table.Column(type: "boolean", nullable: false, defaultValue: false), + PhoneNumber = table.Column(type: "character varying(16)", maxLength: 16, nullable: true), + PhoneNumberConfirmed = table.Column(type: "boolean", nullable: false, defaultValue: false), + IsActive = table.Column(type: "boolean", nullable: false), + TwoFactorEnabled = table.Column(type: "boolean", nullable: false, defaultValue: false), + LockoutEnd = table.Column(type: "timestamp with time zone", nullable: true), + LockoutEnabled = table.Column(type: "boolean", nullable: false, defaultValue: false), + AccessFailedCount = table.Column(type: "integer", nullable: false, defaultValue: 0), + ShouldChangePasswordOnNextLogin = table.Column(type: "boolean", nullable: false), + EntityVersion = table.Column(type: "integer", nullable: false), + LastPasswordChangeTime = table.Column(type: "timestamp with time zone", nullable: true), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp without time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUsers", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "OpenIddictApplications", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + ApplicationType = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), + ClientId = table.Column(type: "character varying(100)", maxLength: 100, nullable: true), + ClientSecret = table.Column(type: "text", nullable: true), + ClientType = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), + ConsentType = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), + DisplayName = table.Column(type: "text", nullable: true), + DisplayNames = table.Column(type: "text", nullable: true), + JsonWebKeySet = table.Column(type: "text", nullable: true), + Permissions = table.Column(type: "text", nullable: true), + PostLogoutRedirectUris = table.Column(type: "text", nullable: true), + Properties = table.Column(type: "text", nullable: true), + RedirectUris = table.Column(type: "text", nullable: true), + Requirements = table.Column(type: "text", nullable: true), + Settings = table.Column(type: "text", nullable: true), + ClientUri = table.Column(type: "text", nullable: true), + LogoUri = table.Column(type: "text", nullable: true), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp without time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_OpenIddictApplications", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "OpenIddictScopes", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Description = table.Column(type: "text", nullable: true), + Descriptions = table.Column(type: "text", nullable: true), + DisplayName = table.Column(type: "text", nullable: true), + DisplayNames = table.Column(type: "text", nullable: true), + Name = table.Column(type: "character varying(200)", maxLength: 200, nullable: true), + Properties = table.Column(type: "text", nullable: true), + Resources = table.Column(type: "text", nullable: true), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp without time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_OpenIddictScopes", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpAuditLogActions", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + AuditLogId = table.Column(type: "uuid", nullable: false), + ServiceName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + MethodName = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + Parameters = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: true), + ExecutionTime = table.Column(type: "timestamp without time zone", nullable: false), + ExecutionDuration = table.Column(type: "integer", nullable: false), + ExtraProperties = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpAuditLogActions", x => x.Id); + table.ForeignKey( + name: "FK_AbpAuditLogActions_AbpAuditLogs_AuditLogId", + column: x => x.AuditLogId, + principalTable: "AbpAuditLogs", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpEntityChanges", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + AuditLogId = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + ChangeTime = table.Column(type: "timestamp without time zone", nullable: false), + ChangeType = table.Column(type: "smallint", nullable: false), + EntityTenantId = table.Column(type: "uuid", nullable: true), + EntityId = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + EntityTypeFullName = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + ExtraProperties = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpEntityChanges", x => x.Id); + table.ForeignKey( + name: "FK_AbpEntityChanges_AbpAuditLogs_AuditLogId", + column: x => x.AuditLogId, + principalTable: "AbpAuditLogs", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpOrganizationUnitRoles", + columns: table => new + { + RoleId = table.Column(type: "uuid", nullable: false), + OrganizationUnitId = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpOrganizationUnitRoles", x => new { x.OrganizationUnitId, x.RoleId }); + table.ForeignKey( + name: "FK_AbpOrganizationUnitRoles_AbpOrganizationUnits_OrganizationU~", + column: x => x.OrganizationUnitId, + principalTable: "AbpOrganizationUnits", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_AbpOrganizationUnitRoles_AbpRoles_RoleId", + column: x => x.RoleId, + principalTable: "AbpRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpRoleClaims", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + RoleId = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + ClaimType = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + ClaimValue = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpRoleClaims", x => x.Id); + table.ForeignKey( + name: "FK_AbpRoleClaims_AbpRoles_RoleId", + column: x => x.RoleId, + principalTable: "AbpRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpTenantConnectionStrings", + columns: table => new + { + TenantId = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + Value = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpTenantConnectionStrings", x => new { x.TenantId, x.Name }); + table.ForeignKey( + name: "FK_AbpTenantConnectionStrings_AbpTenants_TenantId", + column: x => x.TenantId, + principalTable: "AbpTenants", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserClaims", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + UserId = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + ClaimType = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + ClaimValue = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserClaims", x => x.Id); + table.ForeignKey( + name: "FK_AbpUserClaims_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserLogins", + columns: table => new + { + UserId = table.Column(type: "uuid", nullable: false), + LoginProvider = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + ProviderKey = table.Column(type: "character varying(196)", maxLength: 196, nullable: false), + ProviderDisplayName = table.Column(type: "character varying(128)", maxLength: 128, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserLogins", x => new { x.UserId, x.LoginProvider }); + table.ForeignKey( + name: "FK_AbpUserLogins_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserOrganizationUnits", + columns: table => new + { + UserId = table.Column(type: "uuid", nullable: false), + OrganizationUnitId = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserOrganizationUnits", x => new { x.OrganizationUnitId, x.UserId }); + table.ForeignKey( + name: "FK_AbpUserOrganizationUnits_AbpOrganizationUnits_OrganizationU~", + column: x => x.OrganizationUnitId, + principalTable: "AbpOrganizationUnits", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_AbpUserOrganizationUnits_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserRoles", + columns: table => new + { + UserId = table.Column(type: "uuid", nullable: false), + RoleId = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserRoles", x => new { x.UserId, x.RoleId }); + table.ForeignKey( + name: "FK_AbpUserRoles_AbpRoles_RoleId", + column: x => x.RoleId, + principalTable: "AbpRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_AbpUserRoles_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserTokens", + columns: table => new + { + UserId = table.Column(type: "uuid", nullable: false), + LoginProvider = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + Value = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); + table.ForeignKey( + name: "FK_AbpUserTokens_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "OpenIddictAuthorizations", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + ApplicationId = table.Column(type: "uuid", nullable: true), + CreationDate = table.Column(type: "timestamp without time zone", nullable: true), + Properties = table.Column(type: "text", nullable: true), + Scopes = table.Column(type: "text", nullable: true), + Status = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), + Subject = table.Column(type: "character varying(400)", maxLength: 400, nullable: true), + Type = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp without time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_OpenIddictAuthorizations", x => x.Id); + table.ForeignKey( + name: "FK_OpenIddictAuthorizations_OpenIddictApplications_Application~", + column: x => x.ApplicationId, + principalTable: "OpenIddictApplications", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "AbpEntityPropertyChanges", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + EntityChangeId = table.Column(type: "uuid", nullable: false), + NewValue = table.Column(type: "character varying(512)", maxLength: 512, nullable: true), + OriginalValue = table.Column(type: "character varying(512)", maxLength: 512, nullable: true), + PropertyName = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + PropertyTypeFullName = table.Column(type: "character varying(64)", maxLength: 64, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpEntityPropertyChanges", x => x.Id); + table.ForeignKey( + name: "FK_AbpEntityPropertyChanges_AbpEntityChanges_EntityChangeId", + column: x => x.EntityChangeId, + principalTable: "AbpEntityChanges", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "OpenIddictTokens", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + ApplicationId = table.Column(type: "uuid", nullable: true), + AuthorizationId = table.Column(type: "uuid", nullable: true), + CreationDate = table.Column(type: "timestamp without time zone", nullable: true), + ExpirationDate = table.Column(type: "timestamp without time zone", nullable: true), + Payload = table.Column(type: "text", nullable: true), + Properties = table.Column(type: "text", nullable: true), + RedemptionDate = table.Column(type: "timestamp without time zone", nullable: true), + ReferenceId = table.Column(type: "character varying(100)", maxLength: 100, nullable: true), + Status = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), + Subject = table.Column(type: "character varying(400)", maxLength: 400, nullable: true), + Type = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp without time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_OpenIddictTokens", x => x.Id); + table.ForeignKey( + name: "FK_OpenIddictTokens_OpenIddictApplications_ApplicationId", + column: x => x.ApplicationId, + principalTable: "OpenIddictApplications", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_OpenIddictTokens_OpenIddictAuthorizations_AuthorizationId", + column: x => x.AuthorizationId, + principalTable: "OpenIddictAuthorizations", + principalColumn: "Id"); + }); + + migrationBuilder.CreateIndex( + name: "IX_AbpAuditLogActions_AuditLogId", + table: "AbpAuditLogActions", + column: "AuditLogId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpAuditLogActions_TenantId_ServiceName_MethodName_Executio~", + table: "AbpAuditLogActions", + columns: new[] { "TenantId", "ServiceName", "MethodName", "ExecutionTime" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpAuditLogs_TenantId_ExecutionTime", + table: "AbpAuditLogs", + columns: new[] { "TenantId", "ExecutionTime" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpAuditLogs_TenantId_UserId_ExecutionTime", + table: "AbpAuditLogs", + columns: new[] { "TenantId", "UserId", "ExecutionTime" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpBackgroundJobs_IsAbandoned_NextTryTime", + table: "AbpBackgroundJobs", + columns: new[] { "IsAbandoned", "NextTryTime" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpEntityChanges_AuditLogId", + table: "AbpEntityChanges", + column: "AuditLogId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpEntityChanges_TenantId_EntityTypeFullName_EntityId", + table: "AbpEntityChanges", + columns: new[] { "TenantId", "EntityTypeFullName", "EntityId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpEntityPropertyChanges_EntityChangeId", + table: "AbpEntityPropertyChanges", + column: "EntityChangeId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatureGroups_Name", + table: "AbpFeatureGroups", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatures_GroupName", + table: "AbpFeatures", + column: "GroupName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatures_Name", + table: "AbpFeatures", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatureValues_Name_ProviderName_ProviderKey", + table: "AbpFeatureValues", + columns: new[] { "Name", "ProviderName", "ProviderKey" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpLinkUsers_SourceUserId_SourceTenantId_TargetUserId_Targe~", + table: "AbpLinkUsers", + columns: new[] { "SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpOrganizationUnitRoles_RoleId_OrganizationUnitId", + table: "AbpOrganizationUnitRoles", + columns: new[] { "RoleId", "OrganizationUnitId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpOrganizationUnits_Code", + table: "AbpOrganizationUnits", + column: "Code"); + + migrationBuilder.CreateIndex( + name: "IX_AbpOrganizationUnits_ParentId", + table: "AbpOrganizationUnits", + column: "ParentId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissionGrants_TenantId_Name_ProviderName_ProviderKey", + table: "AbpPermissionGrants", + columns: new[] { "TenantId", "Name", "ProviderName", "ProviderKey" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissionGroups_Name", + table: "AbpPermissionGroups", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissions_GroupName", + table: "AbpPermissions", + column: "GroupName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissions_Name", + table: "AbpPermissions", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpRoleClaims_RoleId", + table: "AbpRoleClaims", + column: "RoleId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpRoles_NormalizedName", + table: "AbpRoles", + column: "NormalizedName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpSecurityLogs_TenantId_Action", + table: "AbpSecurityLogs", + columns: new[] { "TenantId", "Action" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpSecurityLogs_TenantId_ApplicationName", + table: "AbpSecurityLogs", + columns: new[] { "TenantId", "ApplicationName" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpSecurityLogs_TenantId_Identity", + table: "AbpSecurityLogs", + columns: new[] { "TenantId", "Identity" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpSecurityLogs_TenantId_UserId", + table: "AbpSecurityLogs", + columns: new[] { "TenantId", "UserId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpSessions_Device", + table: "AbpSessions", + column: "Device"); + + migrationBuilder.CreateIndex( + name: "IX_AbpSessions_SessionId", + table: "AbpSessions", + column: "SessionId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpSessions_TenantId_UserId", + table: "AbpSessions", + columns: new[] { "TenantId", "UserId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpSettingDefinitions_Name", + table: "AbpSettingDefinitions", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpSettings_Name_ProviderName_ProviderKey", + table: "AbpSettings", + columns: new[] { "Name", "ProviderName", "ProviderKey" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpTenants_Name", + table: "AbpTenants", + column: "Name"); + + migrationBuilder.CreateIndex( + name: "IX_AbpTenants_NormalizedName", + table: "AbpTenants", + column: "NormalizedName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUserClaims_UserId", + table: "AbpUserClaims", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUserLogins_LoginProvider_ProviderKey", + table: "AbpUserLogins", + columns: new[] { "LoginProvider", "ProviderKey" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpUserOrganizationUnits_UserId_OrganizationUnitId", + table: "AbpUserOrganizationUnits", + columns: new[] { "UserId", "OrganizationUnitId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpUserRoles_RoleId_UserId", + table: "AbpUserRoles", + columns: new[] { "RoleId", "UserId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_Email", + table: "AbpUsers", + column: "Email"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_NormalizedEmail", + table: "AbpUsers", + column: "NormalizedEmail"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_NormalizedUserName", + table: "AbpUsers", + column: "NormalizedUserName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_UserName", + table: "AbpUsers", + column: "UserName"); + + migrationBuilder.CreateIndex( + name: "IX_OpenIddictApplications_ClientId", + table: "OpenIddictApplications", + column: "ClientId"); + + migrationBuilder.CreateIndex( + name: "IX_OpenIddictAuthorizations_ApplicationId_Status_Subject_Type", + table: "OpenIddictAuthorizations", + columns: new[] { "ApplicationId", "Status", "Subject", "Type" }); + + migrationBuilder.CreateIndex( + name: "IX_OpenIddictScopes_Name", + table: "OpenIddictScopes", + column: "Name"); + + migrationBuilder.CreateIndex( + name: "IX_OpenIddictTokens_ApplicationId_Status_Subject_Type", + table: "OpenIddictTokens", + columns: new[] { "ApplicationId", "Status", "Subject", "Type" }); + + migrationBuilder.CreateIndex( + name: "IX_OpenIddictTokens_AuthorizationId", + table: "OpenIddictTokens", + column: "AuthorizationId"); + + migrationBuilder.CreateIndex( + name: "IX_OpenIddictTokens_ReferenceId", + table: "OpenIddictTokens", + column: "ReferenceId"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AbpAuditLogActions"); + + migrationBuilder.DropTable( + name: "AbpBackgroundJobs"); + + migrationBuilder.DropTable( + name: "AbpClaimTypes"); + + migrationBuilder.DropTable( + name: "AbpEntityPropertyChanges"); + + migrationBuilder.DropTable( + name: "AbpFeatureGroups"); + + migrationBuilder.DropTable( + name: "AbpFeatures"); + + migrationBuilder.DropTable( + name: "AbpFeatureValues"); + + migrationBuilder.DropTable( + name: "AbpLinkUsers"); + + migrationBuilder.DropTable( + name: "AbpOrganizationUnitRoles"); + + migrationBuilder.DropTable( + name: "AbpPermissionGrants"); + + migrationBuilder.DropTable( + name: "AbpPermissionGroups"); + + migrationBuilder.DropTable( + name: "AbpPermissions"); + + migrationBuilder.DropTable( + name: "AbpRoleClaims"); + + migrationBuilder.DropTable( + name: "AbpSecurityLogs"); + + migrationBuilder.DropTable( + name: "AbpSessions"); + + migrationBuilder.DropTable( + name: "AbpSettingDefinitions"); + + migrationBuilder.DropTable( + name: "AbpSettings"); + + migrationBuilder.DropTable( + name: "AbpTenantConnectionStrings"); + + migrationBuilder.DropTable( + name: "AbpUserClaims"); + + migrationBuilder.DropTable( + name: "AbpUserDelegations"); + + migrationBuilder.DropTable( + name: "AbpUserLogins"); + + migrationBuilder.DropTable( + name: "AbpUserOrganizationUnits"); + + migrationBuilder.DropTable( + name: "AbpUserRoles"); + + migrationBuilder.DropTable( + name: "AbpUserTokens"); + + migrationBuilder.DropTable( + name: "OpenIddictScopes"); + + migrationBuilder.DropTable( + name: "OpenIddictTokens"); + + migrationBuilder.DropTable( + name: "AbpEntityChanges"); + + migrationBuilder.DropTable( + name: "AbpTenants"); + + migrationBuilder.DropTable( + name: "AbpOrganizationUnits"); + + migrationBuilder.DropTable( + name: "AbpRoles"); + + migrationBuilder.DropTable( + name: "AbpUsers"); + + migrationBuilder.DropTable( + name: "OpenIddictAuthorizations"); + + migrationBuilder.DropTable( + name: "AbpAuditLogs"); + + migrationBuilder.DropTable( + name: "OpenIddictApplications"); + } + } +} diff --git a/modules/admin/src/KonSoft.Admin.EntityFrameworkCore/Migrations/AdminDbContextModelSnapshot.cs b/modules/admin/src/KonSoft.Admin.EntityFrameworkCore/Migrations/AdminDbContextModelSnapshot.cs new file mode 100644 index 0000000..e985b81 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.EntityFrameworkCore/Migrations/AdminDbContextModelSnapshot.cs @@ -0,0 +1,2003 @@ +// +using System; +using KonSoft.Admin.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace KonSoft.Admin.Migrations +{ + [DbContext(typeof(AdminDbContext))] + partial class AdminDbContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.PostgreSql) + .HasAnnotation("ProductVersion", "8.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("character varying(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("text"); + + b.Property("ExecutionDuration") + .HasColumnType("integer") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("timestamp without time zone"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("integer") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("uuid") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("uuid") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("uuid") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AuditLogId") + .HasColumnType("uuid") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("integer") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AuditLogId") + .HasColumnType("uuid") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("smallint") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("uuid"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("EntityChangeId") + .HasColumnType("uuid"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("character varying(1048576)"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("LastTryTime") + .HasColumnType("timestamp without time zone"); + + b.Property("NextTryTime") + .HasColumnType("timestamp without time zone"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("boolean"); + + b.Property("IsVisibleToClients") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("Required") + .HasColumnType("boolean"); + + b.Property("ValueType") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("SourceTenantId") + .HasColumnType("uuid"); + + b.Property("SourceUserId") + .HasColumnType("uuid"); + + b.Property("TargetTenantId") + .HasColumnType("uuid"); + + b.Property("TargetUserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("boolean") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("boolean") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("boolean") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("character varying(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("character varying(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("character varying(96)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySession", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Device") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("DeviceInfo") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("IpAddresses") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("LastAccessed") + .HasColumnType("timestamp without time zone"); + + b.Property("SessionId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("SignedIn") + .HasColumnType("timestamp without time zone"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("Device"); + + b.HasIndex("SessionId"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSessions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("boolean") + .HasColumnName("IsActive"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("LastPasswordChangeTime") + .HasColumnType("timestamp with time zone"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("SecurityStamp"); + + b.Property("ShouldChangePasswordOnNextLogin") + .HasColumnType("boolean"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserDelegation", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("EndTime") + .HasColumnType("timestamp without time zone"); + + b.Property("SourceUserId") + .HasColumnType("uuid"); + + b.Property("StartTime") + .HasColumnType("timestamp without time zone"); + + b.Property("TargetUserId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AbpUserDelegations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("character varying(196)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uuid"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("character varying(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("DisplayName"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uuid"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("ClientId") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("ClientSecret") + .HasColumnType("text"); + + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("ClientUri") + .HasColumnType("text"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .HasColumnType("text"); + + b.Property("DisplayNames") + .HasColumnType("text"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("JsonWebKeySet") + .HasColumnType("text"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasColumnType("text"); + + b.Property("Permissions") + .HasColumnType("text"); + + b.Property("PostLogoutRedirectUris") + .HasColumnType("text"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("RedirectUris") + .HasColumnType("text"); + + b.Property("Requirements") + .HasColumnType("text"); + + b.Property("Settings") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("OpenIddictApplications", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationId") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("timestamp without time zone"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("Scopes") + .HasColumnType("text"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("character varying(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictAuthorizations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Scopes.OpenIddictScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Descriptions") + .HasColumnType("text"); + + b.Property("DisplayName") + .HasColumnType("text"); + + b.Property("DisplayNames") + .HasColumnType("text"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("Resources") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("OpenIddictScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationId") + .HasColumnType("uuid"); + + b.Property("AuthorizationId") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("timestamp without time zone"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("ExpirationDate") + .HasColumnType("timestamp without time zone"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Payload") + .HasColumnType("text"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("RedemptionDate") + .HasColumnType("timestamp without time zone"); + + b.Property("ReferenceId") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("character varying(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.HasKey("Id"); + + b.HasIndex("AuthorizationId"); + + b.HasIndex("ReferenceId"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("IsEnabled") + .HasColumnType("boolean"); + + b.Property("MultiTenancySide") + .HasColumnType("smallint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.SettingDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DefaultValue") + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.Property("Description") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsEncrypted") + .HasColumnType("boolean"); + + b.Property("IsInherited") + .HasColumnType("boolean"); + + b.Property("IsVisibleToClients") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("Providers") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpSettingDefinitions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("uuid"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + + b.HasOne("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", null) + .WithMany() + .HasForeignKey("AuthorizationId"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/modules/admin/src/KonSoft.Admin.EntityFrameworkCore/Properties/AssemblyInfo.cs b/modules/admin/src/KonSoft.Admin.EntityFrameworkCore/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..106acb2 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.EntityFrameworkCore/Properties/AssemblyInfo.cs @@ -0,0 +1,2 @@ +using System.Runtime.CompilerServices; +[assembly:InternalsVisibleToAttribute("KonSoft.Admin.EntityFrameworkCore.Tests")] diff --git a/modules/admin/src/KonSoft.Admin.HttpApi.Client/AdminHttpApiClientModule.cs b/modules/admin/src/KonSoft.Admin.HttpApi.Client/AdminHttpApiClientModule.cs new file mode 100644 index 0000000..d97145c --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.HttpApi.Client/AdminHttpApiClientModule.cs @@ -0,0 +1,38 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Account; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; +using Volo.Abp.PermissionManagement; +using Volo.Abp.TenantManagement; +using Volo.Abp.SettingManagement; +using Volo.Abp.VirtualFileSystem; + +namespace KonSoft.Admin; + +[DependsOn( + typeof(AdminApplicationContractsModule), + typeof(AbpAccountHttpApiClientModule), + typeof(AbpIdentityHttpApiClientModule), + typeof(AbpPermissionManagementHttpApiClientModule), + typeof(AbpTenantManagementHttpApiClientModule), + typeof(AbpFeatureManagementHttpApiClientModule), + typeof(AbpSettingManagementHttpApiClientModule) +)] +public class AdminHttpApiClientModule : AbpModule +{ + public const string RemoteServiceName = "Default"; + + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddHttpClientProxies( + typeof(AdminApplicationContractsModule).Assembly, + RemoteServiceName + ); + + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + } +} diff --git a/modules/admin/src/KonSoft.Admin.HttpApi.Client/KonSoft.Admin.HttpApi.Client.csproj b/modules/admin/src/KonSoft.Admin.HttpApi.Client/KonSoft.Admin.HttpApi.Client.csproj new file mode 100644 index 0000000..71bb2db --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.HttpApi.Client/KonSoft.Admin.HttpApi.Client.csproj @@ -0,0 +1,29 @@ + + + + + + net8.0 + enable + KonSoft.Admin + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/admin/src/KonSoft.Admin.HttpApi/AdminHttpApiModule.cs b/modules/admin/src/KonSoft.Admin.HttpApi/AdminHttpApiModule.cs new file mode 100644 index 0000000..c92618f --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.HttpApi/AdminHttpApiModule.cs @@ -0,0 +1,41 @@ +using Localization.Resources.AbpUi; +using KonSoft.Admin.Localization; +using Volo.Abp.Account; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Volo.Abp.PermissionManagement.HttpApi; +using Volo.Abp.SettingManagement; +using Volo.Abp.TenantManagement; + +namespace KonSoft.Admin; + +[DependsOn( + typeof(AdminApplicationContractsModule), + typeof(AbpAccountHttpApiModule), + typeof(AbpIdentityHttpApiModule), + typeof(AbpPermissionManagementHttpApiModule), + typeof(AbpTenantManagementHttpApiModule), + typeof(AbpFeatureManagementHttpApiModule), + typeof(AbpSettingManagementHttpApiModule) + )] +public class AdminHttpApiModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + ConfigureLocalization(); + } + + private void ConfigureLocalization() + { + Configure(options => + { + options.Resources + .Get() + .AddBaseTypes( + typeof(AbpUiResource) + ); + }); + } +} diff --git a/modules/admin/src/KonSoft.Admin.HttpApi/Controllers/AdminController.cs b/modules/admin/src/KonSoft.Admin.HttpApi/Controllers/AdminController.cs new file mode 100644 index 0000000..e1fd158 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.HttpApi/Controllers/AdminController.cs @@ -0,0 +1,14 @@ +using KonSoft.Admin.Localization; +using Volo.Abp.AspNetCore.Mvc; + +namespace KonSoft.Admin.Controllers; + +/* Inherit your controllers from this class. + */ +public abstract class AdminController : AbpControllerBase +{ + protected AdminController() + { + LocalizationResource = typeof(AdminResource); + } +} diff --git a/modules/admin/src/KonSoft.Admin.HttpApi/KonSoft.Admin.HttpApi.csproj b/modules/admin/src/KonSoft.Admin.HttpApi/KonSoft.Admin.HttpApi.csproj new file mode 100644 index 0000000..cb7a804 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.HttpApi/KonSoft.Admin.HttpApi.csproj @@ -0,0 +1,24 @@ + + + + + + net8.0 + enable + KonSoft.Admin + + + + + + + + + + + + + + + + diff --git a/modules/admin/src/KonSoft.Admin.HttpApi/Models/Test/TestModel.cs b/modules/admin/src/KonSoft.Admin.HttpApi/Models/Test/TestModel.cs new file mode 100644 index 0000000..15c0908 --- /dev/null +++ b/modules/admin/src/KonSoft.Admin.HttpApi/Models/Test/TestModel.cs @@ -0,0 +1,10 @@ +using System; + +namespace KonSoft.Admin.Models.Test; + +public class TestModel +{ + public string? Name { get; set; } + + public DateTime BirthDate { get; set; } +} diff --git a/modules/admin/test/KonSoft.Admin.Application.Tests/AdminApplicationTestBase.cs b/modules/admin/test/KonSoft.Admin.Application.Tests/AdminApplicationTestBase.cs new file mode 100644 index 0000000..ea110b2 --- /dev/null +++ b/modules/admin/test/KonSoft.Admin.Application.Tests/AdminApplicationTestBase.cs @@ -0,0 +1,9 @@ +using Volo.Abp.Modularity; + +namespace KonSoft.Admin; + +public abstract class AdminApplicationTestBase : AdminTestBase + where TStartupModule : IAbpModule +{ + +} diff --git a/modules/admin/test/KonSoft.Admin.Application.Tests/AdminApplicationTestModule.cs b/modules/admin/test/KonSoft.Admin.Application.Tests/AdminApplicationTestModule.cs new file mode 100644 index 0000000..2d1054f --- /dev/null +++ b/modules/admin/test/KonSoft.Admin.Application.Tests/AdminApplicationTestModule.cs @@ -0,0 +1,12 @@ +using Volo.Abp.Modularity; + +namespace KonSoft.Admin; + +[DependsOn( + typeof(AdminApplicationModule), + typeof(AdminDomainTestModule) +)] +public class AdminApplicationTestModule : AbpModule +{ + +} diff --git a/modules/admin/test/KonSoft.Admin.Application.Tests/KonSoft.Admin.Application.Tests.csproj b/modules/admin/test/KonSoft.Admin.Application.Tests/KonSoft.Admin.Application.Tests.csproj new file mode 100644 index 0000000..53d9673 --- /dev/null +++ b/modules/admin/test/KonSoft.Admin.Application.Tests/KonSoft.Admin.Application.Tests.csproj @@ -0,0 +1,20 @@ + + + + + + net8.0 + enable + KonSoft.Admin + + + + + + + + + + + + diff --git a/modules/admin/test/KonSoft.Admin.Application.Tests/Samples/SampleAppServiceTests.cs b/modules/admin/test/KonSoft.Admin.Application.Tests/Samples/SampleAppServiceTests.cs new file mode 100644 index 0000000..7f3e109 --- /dev/null +++ b/modules/admin/test/KonSoft.Admin.Application.Tests/Samples/SampleAppServiceTests.cs @@ -0,0 +1,34 @@ +using Shouldly; +using System.Threading.Tasks; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; +using Xunit; + +namespace KonSoft.Admin.Samples; + +/* This is just an example test class. + * Normally, you don't test code of the modules you are using + * (like IIdentityUserAppService here). + * Only test your own application services. + */ +public abstract class SampleAppServiceTests : AdminApplicationTestBase + where TStartupModule : IAbpModule +{ + private readonly IIdentityUserAppService _userAppService; + + protected SampleAppServiceTests() + { + _userAppService = GetRequiredService(); + } + + [Fact] + public async Task Initial_Data_Should_Contain_Admin_User() + { + //Act + var result = await _userAppService.GetListAsync(new GetIdentityUsersInput()); + + //Assert + result.TotalCount.ShouldBeGreaterThan(0); + result.Items.ShouldContain(u => u.UserName == "admin"); + } +} diff --git a/modules/admin/test/KonSoft.Admin.Domain.Tests/AdminDomainTestBase.cs b/modules/admin/test/KonSoft.Admin.Domain.Tests/AdminDomainTestBase.cs new file mode 100644 index 0000000..1a88fce --- /dev/null +++ b/modules/admin/test/KonSoft.Admin.Domain.Tests/AdminDomainTestBase.cs @@ -0,0 +1,10 @@ +using Volo.Abp.Modularity; + +namespace KonSoft.Admin; + +/* Inherit from this class for your domain layer tests. */ +public abstract class AdminDomainTestBase : AdminTestBase + where TStartupModule : IAbpModule +{ + +} diff --git a/modules/admin/test/KonSoft.Admin.Domain.Tests/AdminDomainTestModule.cs b/modules/admin/test/KonSoft.Admin.Domain.Tests/AdminDomainTestModule.cs new file mode 100644 index 0000000..35e8eb5 --- /dev/null +++ b/modules/admin/test/KonSoft.Admin.Domain.Tests/AdminDomainTestModule.cs @@ -0,0 +1,12 @@ +using Volo.Abp.Modularity; + +namespace KonSoft.Admin; + +[DependsOn( + typeof(AdminDomainModule), + typeof(AdminTestBaseModule) +)] +public class AdminDomainTestModule : AbpModule +{ + +} diff --git a/modules/admin/test/KonSoft.Admin.Domain.Tests/KonSoft.Admin.Domain.Tests.csproj b/modules/admin/test/KonSoft.Admin.Domain.Tests/KonSoft.Admin.Domain.Tests.csproj new file mode 100644 index 0000000..d191c63 --- /dev/null +++ b/modules/admin/test/KonSoft.Admin.Domain.Tests/KonSoft.Admin.Domain.Tests.csproj @@ -0,0 +1,20 @@ + + + + + + net8.0 + enable + KonSoft.Admin + + + + + + + + + + + + diff --git a/modules/admin/test/KonSoft.Admin.Domain.Tests/Samples/SampleDomainTests.cs b/modules/admin/test/KonSoft.Admin.Domain.Tests/Samples/SampleDomainTests.cs new file mode 100644 index 0000000..094ffc0 --- /dev/null +++ b/modules/admin/test/KonSoft.Admin.Domain.Tests/Samples/SampleDomainTests.cs @@ -0,0 +1,46 @@ +using System.Threading.Tasks; +using Shouldly; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; +using Xunit; + +namespace KonSoft.Admin.Samples; + +/* This is just an example test class. + * Normally, you don't test code of the modules you are using + * (like IdentityUserManager here). + * Only test your own domain services. + */ +public abstract class SampleDomainTests : AdminDomainTestBase + where TStartupModule : IAbpModule +{ + private readonly IIdentityUserRepository _identityUserRepository; + private readonly IdentityUserManager _identityUserManager; + + protected SampleDomainTests() + { + _identityUserRepository = GetRequiredService(); + _identityUserManager = GetRequiredService(); + } + + [Fact] + public async Task Should_Set_Email_Of_A_User() + { + IdentityUser adminUser; + + /* Need to manually start Unit Of Work because + * FirstOrDefaultAsync should be executed while db connection / context is available. + */ + await WithUnitOfWorkAsync(async () => + { + adminUser = await _identityUserRepository + .FindByNormalizedUserNameAsync("ADMIN"); + + await _identityUserManager.SetEmailAsync(adminUser, "newemail@abp.io"); + await _identityUserRepository.UpdateAsync(adminUser); + }); + + adminUser = await _identityUserRepository.FindByNormalizedUserNameAsync("ADMIN"); + adminUser.Email.ShouldBe("newemail@abp.io"); + } +} diff --git a/modules/admin/test/KonSoft.Admin.EntityFrameworkCore.Tests/EntityFrameworkCore/AdminEntityFrameworkCoreCollection.cs b/modules/admin/test/KonSoft.Admin.EntityFrameworkCore.Tests/EntityFrameworkCore/AdminEntityFrameworkCoreCollection.cs new file mode 100644 index 0000000..9f006da --- /dev/null +++ b/modules/admin/test/KonSoft.Admin.EntityFrameworkCore.Tests/EntityFrameworkCore/AdminEntityFrameworkCoreCollection.cs @@ -0,0 +1,9 @@ +using Xunit; + +namespace KonSoft.Admin.EntityFrameworkCore; + +[CollectionDefinition(AdminTestConsts.CollectionDefinitionName)] +public class AdminEntityFrameworkCoreCollection : ICollectionFixture +{ + +} diff --git a/modules/admin/test/KonSoft.Admin.EntityFrameworkCore.Tests/EntityFrameworkCore/AdminEntityFrameworkCoreCollectionFixtureBase.cs b/modules/admin/test/KonSoft.Admin.EntityFrameworkCore.Tests/EntityFrameworkCore/AdminEntityFrameworkCoreCollectionFixtureBase.cs new file mode 100644 index 0000000..5e02704 --- /dev/null +++ b/modules/admin/test/KonSoft.Admin.EntityFrameworkCore.Tests/EntityFrameworkCore/AdminEntityFrameworkCoreCollectionFixtureBase.cs @@ -0,0 +1,9 @@ +using KonSoft.Admin.EntityFrameworkCore; +using Xunit; + +namespace KonSoft.Admin.EntityFrameworkCore; + +public class AdminEntityFrameworkCoreCollectionFixtureBase : ICollectionFixture +{ + +} diff --git a/modules/admin/test/KonSoft.Admin.EntityFrameworkCore.Tests/EntityFrameworkCore/AdminEntityFrameworkCoreFixture.cs b/modules/admin/test/KonSoft.Admin.EntityFrameworkCore.Tests/EntityFrameworkCore/AdminEntityFrameworkCoreFixture.cs new file mode 100644 index 0000000..920d586 --- /dev/null +++ b/modules/admin/test/KonSoft.Admin.EntityFrameworkCore.Tests/EntityFrameworkCore/AdminEntityFrameworkCoreFixture.cs @@ -0,0 +1,11 @@ +using System; + +namespace KonSoft.Admin.EntityFrameworkCore; + +public class AdminEntityFrameworkCoreFixture : IDisposable +{ + public void Dispose() + { + + } +} diff --git a/modules/admin/test/KonSoft.Admin.EntityFrameworkCore.Tests/EntityFrameworkCore/AdminEntityFrameworkCoreTestBase.cs b/modules/admin/test/KonSoft.Admin.EntityFrameworkCore.Tests/EntityFrameworkCore/AdminEntityFrameworkCoreTestBase.cs new file mode 100644 index 0000000..36c1c35 --- /dev/null +++ b/modules/admin/test/KonSoft.Admin.EntityFrameworkCore.Tests/EntityFrameworkCore/AdminEntityFrameworkCoreTestBase.cs @@ -0,0 +1,8 @@ +using Volo.Abp; + +namespace KonSoft.Admin.EntityFrameworkCore; + +public abstract class AdminEntityFrameworkCoreTestBase : AdminTestBase +{ + +} diff --git a/modules/admin/test/KonSoft.Admin.EntityFrameworkCore.Tests/EntityFrameworkCore/AdminEntityFrameworkCoreTestModule.cs b/modules/admin/test/KonSoft.Admin.EntityFrameworkCore.Tests/EntityFrameworkCore/AdminEntityFrameworkCoreTestModule.cs new file mode 100644 index 0000000..a98eee4 --- /dev/null +++ b/modules/admin/test/KonSoft.Admin.EntityFrameworkCore.Tests/EntityFrameworkCore/AdminEntityFrameworkCoreTestModule.cs @@ -0,0 +1,82 @@ +using Microsoft.Data.Sqlite; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.Sqlite; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Modularity; +using Volo.Abp.PermissionManagement; +using Volo.Abp.SettingManagement; +using Volo.Abp.Uow; + +namespace KonSoft.Admin.EntityFrameworkCore; + +[DependsOn( + typeof(AdminApplicationTestModule), + typeof(AdminEntityFrameworkCoreModule), + typeof(AbpEntityFrameworkCoreSqliteModule) + )] +public class AdminEntityFrameworkCoreTestModule : AbpModule +{ + private SqliteConnection? _sqliteConnection; + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.SaveStaticFeaturesToDatabase = false; + options.IsDynamicFeatureStoreEnabled = false; + }); + Configure(options => + { + options.SaveStaticPermissionsToDatabase = false; + options.IsDynamicPermissionStoreEnabled = false; + }); + Configure(options => + { + options.SaveStaticSettingsToDatabase = false; + options.IsDynamicSettingStoreEnabled = false; + }); + context.Services.AddAlwaysDisableUnitOfWorkTransaction(); + + ConfigureInMemorySqlite(context.Services); + } + + private void ConfigureInMemorySqlite(IServiceCollection services) + { + _sqliteConnection = CreateDatabaseAndGetConnection(); + + services.Configure(options => + { + options.Configure(context => + { + context.DbContextOptions.UseSqlite(_sqliteConnection); + }); + }); + } + + public override void OnApplicationShutdown(ApplicationShutdownContext context) + { + _sqliteConnection?.Dispose(); + } + + private static SqliteConnection CreateDatabaseAndGetConnection() + { + var connection = new AbpUnitTestSqliteConnection("Data Source=:memory:"); + connection.Open(); + + var options = new DbContextOptionsBuilder() + .UseSqlite(connection) + .Options; + + using (var context = new AdminDbContext(options)) + { + context.GetService().CreateTables(); + } + + return connection; + } +} diff --git a/modules/admin/test/KonSoft.Admin.EntityFrameworkCore.Tests/EntityFrameworkCore/Applications/EfCoreSampleAppServiceTests.cs b/modules/admin/test/KonSoft.Admin.EntityFrameworkCore.Tests/EntityFrameworkCore/Applications/EfCoreSampleAppServiceTests.cs new file mode 100644 index 0000000..10298f2 --- /dev/null +++ b/modules/admin/test/KonSoft.Admin.EntityFrameworkCore.Tests/EntityFrameworkCore/Applications/EfCoreSampleAppServiceTests.cs @@ -0,0 +1,10 @@ +using KonSoft.Admin.Samples; +using Xunit; + +namespace KonSoft.Admin.EntityFrameworkCore.Applications; + +[Collection(AdminTestConsts.CollectionDefinitionName)] +public class EfCoreSampleAppServiceTests : SampleAppServiceTests +{ + +} diff --git a/modules/admin/test/KonSoft.Admin.EntityFrameworkCore.Tests/EntityFrameworkCore/Domains/EfCoreSampleDomainTests.cs b/modules/admin/test/KonSoft.Admin.EntityFrameworkCore.Tests/EntityFrameworkCore/Domains/EfCoreSampleDomainTests.cs new file mode 100644 index 0000000..a5eb518 --- /dev/null +++ b/modules/admin/test/KonSoft.Admin.EntityFrameworkCore.Tests/EntityFrameworkCore/Domains/EfCoreSampleDomainTests.cs @@ -0,0 +1,10 @@ +using KonSoft.Admin.Samples; +using Xunit; + +namespace KonSoft.Admin.EntityFrameworkCore.Domains; + +[Collection(AdminTestConsts.CollectionDefinitionName)] +public class EfCoreSampleDomainTests : SampleDomainTests +{ + +} diff --git a/modules/admin/test/KonSoft.Admin.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepositoryTests.cs b/modules/admin/test/KonSoft.Admin.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepositoryTests.cs new file mode 100644 index 0000000..1d6ee8e --- /dev/null +++ b/modules/admin/test/KonSoft.Admin.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepositoryTests.cs @@ -0,0 +1,44 @@ +using Microsoft.EntityFrameworkCore; +using Shouldly; +using System; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp.Domain.Repositories; +using Volo.Abp.Identity; +using Xunit; + +namespace KonSoft.Admin.EntityFrameworkCore.Samples; + +/* This is just an example test class. + * Normally, you don't test ABP framework code + * (like default AppUser repository IRepository here). + * Only test your custom repository methods. + */ +[Collection(AdminTestConsts.CollectionDefinitionName)] +public class SampleRepositoryTests : AdminEntityFrameworkCoreTestBase +{ + private readonly IRepository _appUserRepository; + + public SampleRepositoryTests() + { + _appUserRepository = GetRequiredService>(); + } + + [Fact] + public async Task Should_Query_AppUser() + { + /* Need to manually start Unit Of Work because + * FirstOrDefaultAsync should be executed while db connection / context is available. + */ + await WithUnitOfWorkAsync(async () => + { + //Act + var adminUser = await (await _appUserRepository.GetQueryableAsync()) + .Where(u => u.UserName == "admin") + .FirstOrDefaultAsync(); + + //Assert + adminUser.ShouldNotBeNull(); + }); + } +} diff --git a/modules/admin/test/KonSoft.Admin.EntityFrameworkCore.Tests/KonSoft.Admin.EntityFrameworkCore.Tests.csproj b/modules/admin/test/KonSoft.Admin.EntityFrameworkCore.Tests/KonSoft.Admin.EntityFrameworkCore.Tests.csproj new file mode 100644 index 0000000..719702a --- /dev/null +++ b/modules/admin/test/KonSoft.Admin.EntityFrameworkCore.Tests/KonSoft.Admin.EntityFrameworkCore.Tests.csproj @@ -0,0 +1,21 @@ + + + + + + net8.0 + enable + KonSoft.Admin + + + + + + + + + + + + + diff --git a/modules/admin/test/KonSoft.Admin.HttpApi.Client.ConsoleTestApp/AdminConsoleApiClientModule.cs b/modules/admin/test/KonSoft.Admin.HttpApi.Client.ConsoleTestApp/AdminConsoleApiClientModule.cs new file mode 100644 index 0000000..7f3049c --- /dev/null +++ b/modules/admin/test/KonSoft.Admin.HttpApi.Client.ConsoleTestApp/AdminConsoleApiClientModule.cs @@ -0,0 +1,30 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Polly; +using Volo.Abp.Autofac; +using Volo.Abp.Http.Client; +using Volo.Abp.Http.Client.IdentityModel; +using Volo.Abp.Modularity; + +namespace KonSoft.Admin.HttpApi.Client.ConsoleTestApp; + +[DependsOn( + typeof(AbpAutofacModule), + typeof(AdminHttpApiClientModule), + typeof(AbpHttpClientIdentityModelModule) + )] +public class AdminConsoleApiClientModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PreConfigure(options => + { + options.ProxyClientBuildActions.Add((remoteServiceName, clientBuilder) => + { + clientBuilder.AddTransientHttpErrorPolicy( + policyBuilder => policyBuilder.WaitAndRetryAsync(3, i => TimeSpan.FromSeconds(Math.Pow(2, i))) + ); + }); + }); + } +} diff --git a/modules/admin/test/KonSoft.Admin.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs b/modules/admin/test/KonSoft.Admin.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs new file mode 100644 index 0000000..b50730a --- /dev/null +++ b/modules/admin/test/KonSoft.Admin.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs @@ -0,0 +1,25 @@ +using System; +using System.Threading.Tasks; +using Volo.Abp.Account; +using Volo.Abp.DependencyInjection; + +namespace KonSoft.Admin.HttpApi.Client.ConsoleTestApp; + +public class ClientDemoService : ITransientDependency +{ + private readonly IProfileAppService _profileAppService; + + public ClientDemoService(IProfileAppService profileAppService) + { + _profileAppService = profileAppService; + } + + public async Task RunAsync() + { + var output = await _profileAppService.GetAsync(); + Console.WriteLine($"UserName : {output.UserName}"); + Console.WriteLine($"Email : {output.Email}"); + Console.WriteLine($"Name : {output.Name}"); + Console.WriteLine($"Surname : {output.Surname}"); + } +} diff --git a/modules/admin/test/KonSoft.Admin.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs b/modules/admin/test/KonSoft.Admin.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs new file mode 100644 index 0000000..2753a32 --- /dev/null +++ b/modules/admin/test/KonSoft.Admin.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs @@ -0,0 +1,40 @@ +using Microsoft.Extensions.Hosting; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; + +namespace KonSoft.Admin.HttpApi.Client.ConsoleTestApp; + +public class ConsoleTestAppHostedService : IHostedService +{ + private readonly IConfiguration _configuration; + + public ConsoleTestAppHostedService(IConfiguration configuration) + { + _configuration = configuration; + } + + public async Task StartAsync(CancellationToken cancellationToken) + { + using (var application = await AbpApplicationFactory.CreateAsync(options => + { + options.Services.ReplaceConfiguration(_configuration); + options.UseAutofac(); + })) + { + await application.InitializeAsync(); + + var demo = application.ServiceProvider.GetRequiredService(); + await demo.RunAsync(); + + await application.ShutdownAsync(); + } + } + + public Task StopAsync(CancellationToken cancellationToken) + { + return Task.CompletedTask; + } +} diff --git a/modules/admin/test/KonSoft.Admin.HttpApi.Client.ConsoleTestApp/KonSoft.Admin.HttpApi.Client.ConsoleTestApp.csproj b/modules/admin/test/KonSoft.Admin.HttpApi.Client.ConsoleTestApp/KonSoft.Admin.HttpApi.Client.ConsoleTestApp.csproj new file mode 100644 index 0000000..ddc21a1 --- /dev/null +++ b/modules/admin/test/KonSoft.Admin.HttpApi.Client.ConsoleTestApp/KonSoft.Admin.HttpApi.Client.ConsoleTestApp.csproj @@ -0,0 +1,33 @@ + + + + Exe + net8.0 + enable + + + + + + PreserveNewest + Always + + + + PreserveNewest + Always + + + + + + + + + + + + + + + diff --git a/modules/admin/test/KonSoft.Admin.HttpApi.Client.ConsoleTestApp/Program.cs b/modules/admin/test/KonSoft.Admin.HttpApi.Client.ConsoleTestApp/Program.cs new file mode 100644 index 0000000..a163537 --- /dev/null +++ b/modules/admin/test/KonSoft.Admin.HttpApi.Client.ConsoleTestApp/Program.cs @@ -0,0 +1,22 @@ +using System.Threading.Tasks; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +namespace KonSoft.Admin.HttpApi.Client.ConsoleTestApp; + +class Program +{ + static async Task Main(string[] args) + { + await CreateHostBuilder(args).RunConsoleAsync(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .AddAppSettingsSecretsJson() + .ConfigureServices((hostContext, services) => + { + services.AddHostedService(); + }); +} diff --git a/modules/admin/test/KonSoft.Admin.HttpApi.Client.ConsoleTestApp/appsettings.json b/modules/admin/test/KonSoft.Admin.HttpApi.Client.ConsoleTestApp/appsettings.json new file mode 100644 index 0000000..a0ac857 --- /dev/null +++ b/modules/admin/test/KonSoft.Admin.HttpApi.Client.ConsoleTestApp/appsettings.json @@ -0,0 +1,17 @@ +{ + "RemoteServices": { + "Default": { + "BaseUrl": "https://localhost:44350" + } + }, + "IdentityClients": { + "Default": { + "GrantType": "password", + "ClientId": "Admin_App", + "UserName": "admin", + "UserPassword": "1q2w3E*", + "Authority": "https://localhost:44350", + "Scope": "Admin" + } + } +} diff --git a/modules/admin/test/KonSoft.Admin.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json b/modules/admin/test/KonSoft.Admin.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json new file mode 100644 index 0000000..7a73a41 --- /dev/null +++ b/modules/admin/test/KonSoft.Admin.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/modules/admin/test/KonSoft.Admin.TestBase/AdminTestBase.cs b/modules/admin/test/KonSoft.Admin.TestBase/AdminTestBase.cs new file mode 100644 index 0000000..148d2a6 --- /dev/null +++ b/modules/admin/test/KonSoft.Admin.TestBase/AdminTestBase.cs @@ -0,0 +1,60 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.Modularity; +using Volo.Abp.Uow; +using Volo.Abp.Testing; + +namespace KonSoft.Admin; + +/* All test classes are derived from this class, directly or indirectly. + */ +public abstract class AdminTestBase : AbpIntegratedTest + where TStartupModule : IAbpModule +{ + protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options) + { + options.UseAutofac(); + } + + protected virtual Task WithUnitOfWorkAsync(Func func) + { + return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); + } + + protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func action) + { + using (var scope = ServiceProvider.CreateScope()) + { + var uowManager = scope.ServiceProvider.GetRequiredService(); + + using (var uow = uowManager.Begin(options)) + { + await action(); + + await uow.CompleteAsync(); + } + } + } + + protected virtual Task WithUnitOfWorkAsync(Func> func) + { + return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); + } + + protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func> func) + { + using (var scope = ServiceProvider.CreateScope()) + { + var uowManager = scope.ServiceProvider.GetRequiredService(); + + using (var uow = uowManager.Begin(options)) + { + var result = await func(); + await uow.CompleteAsync(); + return result; + } + } + } +} diff --git a/modules/admin/test/KonSoft.Admin.TestBase/AdminTestBaseModule.cs b/modules/admin/test/KonSoft.Admin.TestBase/AdminTestBaseModule.cs new file mode 100644 index 0000000..8f3a138 --- /dev/null +++ b/modules/admin/test/KonSoft.Admin.TestBase/AdminTestBaseModule.cs @@ -0,0 +1,47 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.Authorization; +using Volo.Abp.Autofac; +using Volo.Abp.BackgroundJobs; +using Volo.Abp.Data; +using Volo.Abp.Modularity; +using Volo.Abp.Threading; + +namespace KonSoft.Admin; + +[DependsOn( + typeof(AbpAutofacModule), + typeof(AbpTestBaseModule), + typeof(AbpAuthorizationModule), + typeof(AbpBackgroundJobsAbstractionsModule) + )] +public class AdminTestBaseModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.IsJobExecutionEnabled = false; + }); + + context.Services.AddAlwaysAllowAuthorization(); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + SeedTestData(context); + } + + private static void SeedTestData(ApplicationInitializationContext context) + { + AsyncHelper.RunSync(async () => + { + using (var scope = context.ServiceProvider.CreateScope()) + { + await scope.ServiceProvider + .GetRequiredService() + .SeedAsync(); + } + }); + } +} diff --git a/modules/admin/test/KonSoft.Admin.TestBase/AdminTestConsts.cs b/modules/admin/test/KonSoft.Admin.TestBase/AdminTestConsts.cs new file mode 100644 index 0000000..a8cd415 --- /dev/null +++ b/modules/admin/test/KonSoft.Admin.TestBase/AdminTestConsts.cs @@ -0,0 +1,6 @@ +namespace KonSoft.Admin; + +public static class AdminTestConsts +{ + public const string CollectionDefinitionName = "Admin collection"; +} diff --git a/modules/admin/test/KonSoft.Admin.TestBase/AdminTestDataSeedContributor.cs b/modules/admin/test/KonSoft.Admin.TestBase/AdminTestDataSeedContributor.cs new file mode 100644 index 0000000..5aad1ca --- /dev/null +++ b/modules/admin/test/KonSoft.Admin.TestBase/AdminTestDataSeedContributor.cs @@ -0,0 +1,15 @@ +using System.Threading.Tasks; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; + +namespace KonSoft.Admin; + +public class AdminTestDataSeedContributor : IDataSeedContributor, ITransientDependency +{ + public Task SeedAsync(DataSeedContext context) + { + /* Seed additional test data... */ + + return Task.CompletedTask; + } +} diff --git a/modules/admin/test/KonSoft.Admin.TestBase/KonSoft.Admin.TestBase.csproj b/modules/admin/test/KonSoft.Admin.TestBase/KonSoft.Admin.TestBase.csproj new file mode 100644 index 0000000..7a45449 --- /dev/null +++ b/modules/admin/test/KonSoft.Admin.TestBase/KonSoft.Admin.TestBase.csproj @@ -0,0 +1,31 @@ + + + + + + net8.0 + enable + KonSoft.Admin + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers + + + + + + + + diff --git a/modules/admin/test/KonSoft.Admin.TestBase/Security/FakeCurrentPrincipalAccessor.cs b/modules/admin/test/KonSoft.Admin.TestBase/Security/FakeCurrentPrincipalAccessor.cs new file mode 100644 index 0000000..fd9de28 --- /dev/null +++ b/modules/admin/test/KonSoft.Admin.TestBase/Security/FakeCurrentPrincipalAccessor.cs @@ -0,0 +1,25 @@ +using System.Collections.Generic; +using System.Security.Claims; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Security.Claims; + +namespace KonSoft.Admin.Security; + +[Dependency(ReplaceServices = true)] +public class FakeCurrentPrincipalAccessor : ThreadCurrentPrincipalAccessor +{ + protected override ClaimsPrincipal GetClaimsPrincipal() + { + return GetPrincipal(); + } + + private ClaimsPrincipal GetPrincipal() + { + return new ClaimsPrincipal(new ClaimsIdentity(new List + { + new Claim(AbpClaimTypes.UserId, "2e701e62-0953-4dd3-910b-dc6cc93ccb0d"), + new Claim(AbpClaimTypes.UserName, "admin"), + new Claim(AbpClaimTypes.Email, "admin@abp.io") + })); + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Application.Contracts/DispatchApplicationContractsModule.cs b/modules/dispatch/src/KonSoft.Dispatch.Application.Contracts/DispatchApplicationContractsModule.cs new file mode 100644 index 0000000..4742494 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Application.Contracts/DispatchApplicationContractsModule.cs @@ -0,0 +1,28 @@ +using Volo.Abp.Account; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; +using Volo.Abp.ObjectExtending; +using Volo.Abp.PermissionManagement; +using Volo.Abp.SettingManagement; +using Volo.Abp.TenantManagement; + +namespace KonSoft.Dispatch; + +[DependsOn( + typeof(DispatchDomainSharedModule), + typeof(AbpAccountApplicationContractsModule), + typeof(AbpFeatureManagementApplicationContractsModule), + typeof(AbpIdentityApplicationContractsModule), + typeof(AbpPermissionManagementApplicationContractsModule), + typeof(AbpSettingManagementApplicationContractsModule), + typeof(AbpTenantManagementApplicationContractsModule), + typeof(AbpObjectExtendingModule) +)] +public class DispatchApplicationContractsModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + DispatchDtoExtensions.Configure(); + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Application.Contracts/DispatchDtoExtensions.cs b/modules/dispatch/src/KonSoft.Dispatch.Application.Contracts/DispatchDtoExtensions.cs new file mode 100644 index 0000000..6af0031 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Application.Contracts/DispatchDtoExtensions.cs @@ -0,0 +1,28 @@ +using Volo.Abp.Identity; +using Volo.Abp.ObjectExtending; +using Volo.Abp.Threading; + +namespace KonSoft.Dispatch; + +public static class DispatchDtoExtensions +{ + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + + public static void Configure() + { + OneTimeRunner.Run(() => + { + /* You can add extension properties to DTOs + * defined in the depended modules. + * + * Example: + * + * ObjectExtensionManager.Instance + * .AddOrUpdateProperty("Title"); + * + * See the documentation for more: + * https://docs.abp.io/en/abp/latest/Object-Extensions + */ + }); + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Application.Contracts/KonSoft.Dispatch.Application.Contracts.csproj b/modules/dispatch/src/KonSoft.Dispatch.Application.Contracts/KonSoft.Dispatch.Application.Contracts.csproj new file mode 100644 index 0000000..2a4ca1e --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Application.Contracts/KonSoft.Dispatch.Application.Contracts.csproj @@ -0,0 +1,25 @@ + + + + + + net8.0 + enable + KonSoft.Dispatch + + + + + + + + + + + + + + + + + diff --git a/modules/dispatch/src/KonSoft.Dispatch.Application.Contracts/Permissions/DispatchPermissionDefinitionProvider.cs b/modules/dispatch/src/KonSoft.Dispatch.Application.Contracts/Permissions/DispatchPermissionDefinitionProvider.cs new file mode 100644 index 0000000..bd90841 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Application.Contracts/Permissions/DispatchPermissionDefinitionProvider.cs @@ -0,0 +1,20 @@ +using KonSoft.Dispatch.Localization; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.Localization; + +namespace KonSoft.Dispatch.Permissions; + +public class DispatchPermissionDefinitionProvider : PermissionDefinitionProvider +{ + public override void Define(IPermissionDefinitionContext context) + { + var myGroup = context.AddGroup(DispatchPermissions.GroupName); + //Define your own permissions here. Example: + //myGroup.AddPermission(DispatchPermissions.MyPermission1, L("Permission:MyPermission1")); + } + + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Application.Contracts/Permissions/DispatchPermissions.cs b/modules/dispatch/src/KonSoft.Dispatch.Application.Contracts/Permissions/DispatchPermissions.cs new file mode 100644 index 0000000..95d2818 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Application.Contracts/Permissions/DispatchPermissions.cs @@ -0,0 +1,9 @@ +namespace KonSoft.Dispatch.Permissions; + +public static class DispatchPermissions +{ + public const string GroupName = "Dispatch"; + + //Add your own permission names. Example: + //public const string MyPermission1 = GroupName + ".MyPermission1"; +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Application/DispatchAppService.cs b/modules/dispatch/src/KonSoft.Dispatch.Application/DispatchAppService.cs new file mode 100644 index 0000000..b0edd14 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Application/DispatchAppService.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Text; +using KonSoft.Dispatch.Localization; +using Volo.Abp.Application.Services; + +namespace KonSoft.Dispatch; + +/* Inherit your application services from this class. + */ +public abstract class DispatchAppService : ApplicationService +{ + protected DispatchAppService() + { + LocalizationResource = typeof(DispatchResource); + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Application/DispatchApplicationAutoMapperProfile.cs b/modules/dispatch/src/KonSoft.Dispatch.Application/DispatchApplicationAutoMapperProfile.cs new file mode 100644 index 0000000..6b7db35 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Application/DispatchApplicationAutoMapperProfile.cs @@ -0,0 +1,13 @@ +using AutoMapper; + +namespace KonSoft.Dispatch; + +public class DispatchApplicationAutoMapperProfile : Profile +{ + public DispatchApplicationAutoMapperProfile() + { + /* You can configure your AutoMapper mapping configuration here. + * Alternatively, you can split your mapping configurations + * into multiple profile classes for a better organization. */ + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Application/DispatchApplicationModule.cs b/modules/dispatch/src/KonSoft.Dispatch.Application/DispatchApplicationModule.cs new file mode 100644 index 0000000..17607d9 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Application/DispatchApplicationModule.cs @@ -0,0 +1,31 @@ +using Volo.Abp.Account; +using Volo.Abp.AutoMapper; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; +using Volo.Abp.PermissionManagement; +using Volo.Abp.SettingManagement; +using Volo.Abp.TenantManagement; + +namespace KonSoft.Dispatch; + +[DependsOn( + typeof(DispatchDomainModule), + typeof(AbpAccountApplicationModule), + typeof(DispatchApplicationContractsModule), + typeof(AbpIdentityApplicationModule), + typeof(AbpPermissionManagementApplicationModule), + typeof(AbpTenantManagementApplicationModule), + typeof(AbpFeatureManagementApplicationModule), + typeof(AbpSettingManagementApplicationModule) + )] +public class DispatchApplicationModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.AddMaps(); + }); + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Application/KonSoft.Dispatch.Application.csproj b/modules/dispatch/src/KonSoft.Dispatch.Application/KonSoft.Dispatch.Application.csproj new file mode 100644 index 0000000..e7b7c5f --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Application/KonSoft.Dispatch.Application.csproj @@ -0,0 +1,25 @@ + + + + + + net8.0 + enable + KonSoft.Dispatch + + + + + + + + + + + + + + + + + diff --git a/modules/dispatch/src/KonSoft.Dispatch.Application/Properties/AssemblyInfo.cs b/modules/dispatch/src/KonSoft.Dispatch.Application/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..3aec15b --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Application/Properties/AssemblyInfo.cs @@ -0,0 +1,2 @@ +using System.Runtime.CompilerServices; +[assembly:InternalsVisibleToAttribute("KonSoft.Dispatch.Application.Tests")] diff --git a/modules/dispatch/src/KonSoft.Dispatch.DbMigrator/DbMigratorHostedService.cs b/modules/dispatch/src/KonSoft.Dispatch.DbMigrator/DbMigratorHostedService.cs new file mode 100644 index 0000000..08885c8 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.DbMigrator/DbMigratorHostedService.cs @@ -0,0 +1,51 @@ +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using KonSoft.Dispatch.Data; +using Serilog; +using Volo.Abp; +using Volo.Abp.Data; + +namespace KonSoft.Dispatch.DbMigrator; + +public class DbMigratorHostedService : IHostedService +{ + private readonly IHostApplicationLifetime _hostApplicationLifetime; + private readonly IConfiguration _configuration; + + public DbMigratorHostedService(IHostApplicationLifetime hostApplicationLifetime, IConfiguration configuration) + { + _hostApplicationLifetime = hostApplicationLifetime; + _configuration = configuration; + } + + public async Task StartAsync(CancellationToken cancellationToken) + { + using (var application = await AbpApplicationFactory.CreateAsync(options => + { + options.Services.ReplaceConfiguration(_configuration); + options.UseAutofac(); + options.Services.AddLogging(c => c.AddSerilog()); + options.AddDataMigrationEnvironment(); + })) + { + await application.InitializeAsync(); + + await application + .ServiceProvider + .GetRequiredService() + .MigrateAsync(); + + await application.ShutdownAsync(); + + _hostApplicationLifetime.StopApplication(); + } + } + + public Task StopAsync(CancellationToken cancellationToken) + { + return Task.CompletedTask; + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.DbMigrator/DispatchDbMigratorModule.cs b/modules/dispatch/src/KonSoft.Dispatch.DbMigrator/DispatchDbMigratorModule.cs new file mode 100644 index 0000000..d2e473c --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.DbMigrator/DispatchDbMigratorModule.cs @@ -0,0 +1,21 @@ +using KonSoft.Dispatch.EntityFrameworkCore; +using Volo.Abp.Autofac; +using Volo.Abp.Caching; +using Volo.Abp.Caching.StackExchangeRedis; +using Volo.Abp.Modularity; + +namespace KonSoft.Dispatch.DbMigrator; + +[DependsOn( + typeof(AbpAutofacModule), + typeof(AbpCachingStackExchangeRedisModule), + typeof(DispatchEntityFrameworkCoreModule), + typeof(DispatchApplicationContractsModule) + )] +public class DispatchDbMigratorModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => { options.KeyPrefix = "Dispatch:"; }); + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.DbMigrator/KonSoft.Dispatch.DbMigrator.csproj b/modules/dispatch/src/KonSoft.Dispatch.DbMigrator/KonSoft.Dispatch.DbMigrator.csproj new file mode 100644 index 0000000..9a9728d --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.DbMigrator/KonSoft.Dispatch.DbMigrator.csproj @@ -0,0 +1,46 @@ + + + + + + Exe + net8.0 + enable + + + + + + PreserveNewest + Always + + + + PreserveNewest + Always + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/dispatch/src/KonSoft.Dispatch.DbMigrator/Program.cs b/modules/dispatch/src/KonSoft.Dispatch.DbMigrator/Program.cs new file mode 100644 index 0000000..3aaba5b --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.DbMigrator/Program.cs @@ -0,0 +1,41 @@ +using System.IO; +using System.Threading.Tasks; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; +using Serilog; +using Serilog.Events; + +namespace KonSoft.Dispatch.DbMigrator; + +class Program +{ + static async Task Main(string[] args) + { + Log.Logger = new LoggerConfiguration() + .MinimumLevel.Information() + .MinimumLevel.Override("Microsoft", LogEventLevel.Warning) + .MinimumLevel.Override("Volo.Abp", LogEventLevel.Warning) +#if DEBUG + .MinimumLevel.Override("KonSoft.Dispatch", LogEventLevel.Debug) +#else + .MinimumLevel.Override("KonSoft.Dispatch", LogEventLevel.Information) +#endif + .Enrich.FromLogContext() + .WriteTo.Async(c => c.File("Logs/logs.txt")) + .WriteTo.Async(c => c.Console()) + .CreateLogger(); + + await CreateHostBuilder(args).RunConsoleAsync(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .AddAppSettingsSecretsJson() + .ConfigureLogging((context, logging) => logging.ClearProviders()) + .ConfigureServices((hostContext, services) => + { + services.AddHostedService(); + }); +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.DbMigrator/appsettings.json b/modules/dispatch/src/KonSoft.Dispatch.DbMigrator/appsettings.json new file mode 100644 index 0000000..008c2fb --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.DbMigrator/appsettings.json @@ -0,0 +1,16 @@ +{ + "ConnectionStrings": { + "Default": "Host=localhost;Port=5432;Database=Dispatch;User ID=root;Password=myPassword;" + }, + "Redis": { + "Configuration": "127.0.0.1" + }, + "OpenIddict": { + "Applications": { + "Dispatch_Swagger": { + "ClientId": "Dispatch_Swagger", + "RootUrl": "https://localhost:44321" + } + } + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.DbMigrator/appsettings.secrets.json b/modules/dispatch/src/KonSoft.Dispatch.DbMigrator/appsettings.secrets.json new file mode 100644 index 0000000..7a73a41 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.DbMigrator/appsettings.secrets.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/DispatchDomainErrorCodes.cs b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/DispatchDomainErrorCodes.cs new file mode 100644 index 0000000..5674d61 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/DispatchDomainErrorCodes.cs @@ -0,0 +1,6 @@ +namespace KonSoft.Dispatch; + +public static class DispatchDomainErrorCodes +{ + /* You can add your business exception error codes here, as constants */ +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/DispatchDomainSharedModule.cs b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/DispatchDomainSharedModule.cs new file mode 100644 index 0000000..22f9225 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/DispatchDomainSharedModule.cs @@ -0,0 +1,58 @@ +using KonSoft.Dispatch.Localization; +using Volo.Abp.AuditLogging; +using Volo.Abp.BackgroundJobs; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Localization; +using Volo.Abp.Localization.ExceptionHandling; +using Volo.Abp.Modularity; +using Volo.Abp.OpenIddict; +using Volo.Abp.PermissionManagement; +using Volo.Abp.SettingManagement; +using Volo.Abp.TenantManagement; +using Volo.Abp.Validation.Localization; +using Volo.Abp.VirtualFileSystem; + +namespace KonSoft.Dispatch; + +[DependsOn( + typeof(AbpAuditLoggingDomainSharedModule), + typeof(AbpBackgroundJobsDomainSharedModule), + typeof(AbpFeatureManagementDomainSharedModule), + typeof(AbpIdentityDomainSharedModule), + typeof(AbpOpenIddictDomainSharedModule), + typeof(AbpPermissionManagementDomainSharedModule), + typeof(AbpSettingManagementDomainSharedModule), + typeof(AbpTenantManagementDomainSharedModule) + )] +public class DispatchDomainSharedModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + DispatchGlobalFeatureConfigurator.Configure(); + DispatchModuleExtensionConfigurator.Configure(); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + Configure(options => + { + options.Resources + .Add("en") + .AddBaseTypes(typeof(AbpValidationResource)) + .AddVirtualJson("/Localization/Dispatch"); + + options.DefaultResourceType = typeof(DispatchResource); + }); + + Configure(options => + { + options.MapCodeNamespace("Dispatch", typeof(DispatchResource)); + }); + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/DispatchGlobalFeatureConfigurator.cs b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/DispatchGlobalFeatureConfigurator.cs new file mode 100644 index 0000000..fed3907 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/DispatchGlobalFeatureConfigurator.cs @@ -0,0 +1,22 @@ +using Volo.Abp.Threading; + +namespace KonSoft.Dispatch; + +public static class DispatchGlobalFeatureConfigurator +{ + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + + public static void Configure() + { + OneTimeRunner.Run(() => + { + /* You can configure (enable/disable) global features of the used modules here. + * + * YOU CAN SAFELY DELETE THIS CLASS AND REMOVE ITS USAGES IF YOU DON'T NEED TO IT! + * + * Please refer to the documentation to lear more about the Global Features System: + * https://docs.abp.io/en/abp/latest/Global-Features + */ + }); + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/DispatchModuleExtensionConfigurator.cs b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/DispatchModuleExtensionConfigurator.cs new file mode 100644 index 0000000..7dc6572 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/DispatchModuleExtensionConfigurator.cs @@ -0,0 +1,73 @@ +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Identity; +using Volo.Abp.ObjectExtending; +using Volo.Abp.Threading; + +namespace KonSoft.Dispatch; + +public static class DispatchModuleExtensionConfigurator +{ + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + + public static void Configure() + { + OneTimeRunner.Run(() => + { + ConfigureExistingProperties(); + ConfigureExtraProperties(); + }); + } + + private static void ConfigureExistingProperties() + { + /* You can change max lengths for properties of the + * entities defined in the modules used by your application. + * + * Example: Change user and role name max lengths + + AbpUserConsts.MaxNameLength = 99; + IdentityRoleConsts.MaxNameLength = 99; + + * Notice: It is not suggested to change property lengths + * unless you really need it. Go with the standard values wherever possible. + * + * If you are using EF Core, you will need to run the add-migration command after your changes. + */ + } + + private static void ConfigureExtraProperties() + { + /* You can configure extra properties for the + * entities defined in the modules used by your application. + * + * This class can be used to define these extra properties + * with a high level, easy to use API. + * + * Example: Add a new property to the user entity of the identity module + + ObjectExtensionManager.Instance.Modules() + .ConfigureIdentity(identity => + { + identity.ConfigureUser(user => + { + user.AddOrUpdateProperty( //property type: string + "SocialSecurityNumber", //property name + property => + { + //validation rules + property.Attributes.Add(new RequiredAttribute()); + property.Attributes.Add(new StringLengthAttribute(64) {MinimumLength = 4}); + + property.Configuration[IdentityModuleExtensionConsts.ConfigurationNames.AllowUserToEdit] = true; + + //...other configurations for this property + } + ); + }); + }); + + * See the documentation for more: + * https://docs.abp.io/en/abp/latest/Module-Entity-Extensions + */ + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/KonSoft.Dispatch.Domain.Shared.csproj b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/KonSoft.Dispatch.Domain.Shared.csproj new file mode 100644 index 0000000..b529317 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/KonSoft.Dispatch.Domain.Shared.csproj @@ -0,0 +1,32 @@ + + + + + + net8.0 + enable + KonSoft.Dispatch + true + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/ar.json b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/ar.json new file mode 100644 index 0000000..ab9a761 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/ar.json @@ -0,0 +1,9 @@ +{ + "culture": "ar", + "texts": { + "AppName": "Dispatch", + "Menu:Home": "الصفحة الرئيسية", + "Welcome": "مرحباً", + "LongWelcomeMessage": "مرحبا بكم في التطبيق. هذا مشروع بدء تشغيل يعتمد على إطار عمل ABP. لمزيد من المعلومات ، يرجى زيارة abp.io." + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/cs.json b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/cs.json new file mode 100644 index 0000000..831b3db --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/cs.json @@ -0,0 +1,9 @@ +{ + "culture": "cs", + "texts": { + "AppName": "Dispatch", + "Menu:Home": "Úvod", + "Welcome": "Vítejte", + "LongWelcomeMessage": "Vítejte v aplikaci. Toto je startovací projekt založený na ABP frameworku. Pro více informací, navštivte abp.io." + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/de.json b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/de.json new file mode 100644 index 0000000..61e6ef6 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/de.json @@ -0,0 +1,9 @@ +{ + "culture": "de", + "texts": { + "AppName": "Dispatch", + "Menu:Home": "Home", + "Welcome": "Willkommen", + "LongWelcomeMessage": "Willkommen bei der Anwendung. Dies ist ein Startup-Projekt, das auf dem ABP-Framework basiert. Weitere Informationen finden Sie unter abp.io." + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/en-GB.json b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/en-GB.json new file mode 100644 index 0000000..70a6a63 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/en-GB.json @@ -0,0 +1,9 @@ +{ + "culture": "en-GB", + "texts": { + "AppName": "Dispatch", + "Menu:Home": "Home", + "Welcome": "Welcome", + "LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io." + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/en.json b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/en.json new file mode 100644 index 0000000..82f9dad --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/en.json @@ -0,0 +1,9 @@ +{ + "culture": "en", + "texts": { + "AppName": "Dispatch", + "Menu:Home": "Home", + "Welcome": "Welcome", + "LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io." + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/es.json b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/es.json new file mode 100644 index 0000000..f0d27e9 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/es.json @@ -0,0 +1,9 @@ +{ + "culture": "es", + "texts": { + "AppName": "Dispatch", + "Menu:Home": "Inicio", + "Welcome": "Bienvenido", + "LongWelcomeMessage": "Bienvenido a la aplicación, este es un proyecto base basado en el framework ABP. Para más información, visita abp.io." + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/fi.json b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/fi.json new file mode 100644 index 0000000..c93ee65 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/fi.json @@ -0,0 +1,9 @@ +{ + "culture": "fi", + "texts": { + "AppName": "Dispatch", + "Menu:Home": "Koti", + "Welcome": "Tervetuloa", + "LongWelcomeMessage": "Tervetuloa sovellukseen. Tämä on ABP-kehykseen perustuva käynnistysprojekti. Lisätietoja on osoitteessa abp.io." + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/fr.json b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/fr.json new file mode 100644 index 0000000..3165e49 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/fr.json @@ -0,0 +1,9 @@ +{ + "culture": "fr", + "texts": { + "AppName": "Dispatch", + "Menu:Home": "Accueil", + "Welcome": "Bienvenue", + "LongWelcomeMessage": "Bienvenue dans l'application. Il s'agit d'un projet de démarrage basé sur le framework ABP. Pour plus d'informations, visitez abp.io." + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/hi.json b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/hi.json new file mode 100644 index 0000000..cc071ac --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/hi.json @@ -0,0 +1,9 @@ +{ + "culture": "hi", + "texts": { + "AppName": "Dispatch", + "Menu:Home": "घर", + "Welcome": "स्वागत हे", + "LongWelcomeMessage": "आवेदन करने के लिए आपका स्वागत है। यह एबीपी ढांचे पर आधारित एक स्टार्टअप परियोजना है। अधिक जानकारी के लिए, abp.io पर जाएं।" + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/hr.json b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/hr.json new file mode 100644 index 0000000..f32e630 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/hr.json @@ -0,0 +1,9 @@ +{ + "culture": "hr", + "texts": { + "AppName": "Dispatch", + "Menu:Home": "Početna", + "Welcome": "Dobrodošli", + "LongWelcomeMessage": "Dobrodošli u aplikaciju. Ovo je startup projekt temeljen na ABP framework-u. Za više informacija posjetite abp.io." + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/hu.json b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/hu.json new file mode 100644 index 0000000..826efd3 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/hu.json @@ -0,0 +1,9 @@ +{ + "culture": "hu", + "texts": { + "AppName": "Dispatch", + "Menu:Home": "Kezdőlap", + "Welcome": "Üdvözlöm", + "LongWelcomeMessage": "Üdvözöljük az alkalmazásban. Ez egy ABP keretrendszeren alapuló startup projekt. További információkért látogasson el az abp.io oldalra." + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/is.json b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/is.json new file mode 100644 index 0000000..9b078c4 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/is.json @@ -0,0 +1,9 @@ +{ + "culture": "is", + "texts": { + "AppName": "Dispatch", + "Menu:Home": "Heim", + "Welcome": "Velkomin", + "LongWelcomeMessage": "Verið velkomin í forritið. Þetta er startup verkefni sem byggir á ABP. Nánari upplýsingar er að finna á abp.io." + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/it.json b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/it.json new file mode 100644 index 0000000..6c6a3c1 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/it.json @@ -0,0 +1,9 @@ +{ + "culture": "it", + "texts": { + "AppName": "Dispatch", + "Menu:Home": "Home", + "Welcome": "Benvenuto", + "LongWelcomeMessage": "Benvenuto nell'applicazione. Questo è un progetto di avvio basato sul framework ABP. Per ulteriori informazioni, visita abp.io." + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/nl.json b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/nl.json new file mode 100644 index 0000000..6b3c5f5 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/nl.json @@ -0,0 +1,9 @@ +{ + "culture": "nl", + "texts": { + "AppName": "Dispatch", + "Menu:Home": "Home", + "Welcome": "Welkom", + "LongWelcomeMessage": "Welkom bij de applicatie. Dit is een startup-project gebaseerd op het ABP-framework. Bezoek abp.io voor meer informatie." + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/pl-PL.json b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/pl-PL.json new file mode 100644 index 0000000..a984f63 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/pl-PL.json @@ -0,0 +1,9 @@ +{ + "culture": "pl-PL", + "texts": { + "AppName": "Dispatch", + "Menu:Home": "Home", + "Welcome": "Witaj", + "LongWelcomeMessage": "Witaj w aplikacji. To jest inicjalny projekt bazujący na ABP framework. Po więcej informacji odwiedź stronę abp.io." + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/pt-BR.json b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/pt-BR.json new file mode 100644 index 0000000..154abbc --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/pt-BR.json @@ -0,0 +1,9 @@ +{ + "culture": "pt-BR", + "texts": { + "AppName": "Dispatch", + "Menu:Home": "Principal", + "Welcome": "Seja bem-vindo!", + "LongWelcomeMessage": "Bem-vindo a esta aplicação. Este é um projeto inicial baseado no ABP framework. Para mais informações, visite abp.io." + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/ro-RO.json b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/ro-RO.json new file mode 100644 index 0000000..7bff132 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/ro-RO.json @@ -0,0 +1,9 @@ +{ + "culture": "ro-RO", + "texts": { + "AppName": "Dispatch", + "Menu:Home": "Acasă", + "Welcome": "Bun venit", + "LongWelcomeMessage": "Bun venit la aplicaţie. Acesta este un proiect de pornire bazat pe framework-ul ABP. Pentru mai multe informaţii, vizitaţi, visit abp.io." + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/ru.json b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/ru.json new file mode 100644 index 0000000..839d60f --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/ru.json @@ -0,0 +1,9 @@ +{ + "culture": "ru", + "texts": { + "AppName": "Dispatch", + "Menu:Home": "Главная", + "Welcome": "Добро пожаловать", + "LongWelcomeMessage": "Добро пожаловать в приложение. Этот запущенный проект основан на фреймворке ABP. Для получения дополнительной информации посетите сайт abp.io." + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/sk.json b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/sk.json new file mode 100644 index 0000000..f9a124c --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/sk.json @@ -0,0 +1,9 @@ +{ + "culture": "sk", + "texts": { + "AppName": "Dispatch", + "Menu:Home": "Domov", + "Welcome": "Vitajte", + "LongWelcomeMessage": "Vitajte v aplikácii. Toto je štartovací projekt založený na ABP frameworku. Viac informácií nájdete na stránke abp.io." + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/sl.json b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/sl.json new file mode 100644 index 0000000..20acbb4 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/sl.json @@ -0,0 +1,9 @@ +{ + "culture": "sl", + "texts": { + "AppName": "Dispatch", + "Menu:Home": "Domov", + "Welcome": "Dobrodošli", + "LongWelcomeMessage": "Dobrodošli v aplikaciji. To je začetni projekt na osnovi okolja ABP. Za več informacij obiščite abp.io." + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/sv.json b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/sv.json new file mode 100644 index 0000000..bd1eae4 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/sv.json @@ -0,0 +1,9 @@ +{ + "culture": "sv", + "texts": { + "AppName": "MittProjektNamn", + "Menu:Home": "Hem", + "Welcome": "Välkommen", + "LongWelcomeMessage": "Välkommen till applikationen. Detta är ett startup-projekt baserat på ABP-ramverket. För mer information, besök abp.io." + } +} \ No newline at end of file diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/tr.json b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/tr.json new file mode 100644 index 0000000..6adeb66 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/tr.json @@ -0,0 +1,9 @@ +{ + "culture": "tr", + "texts": { + "AppName": "Dispatch", + "Menu:Home": "Ana sayfa", + "Welcome": "Hoşgeldiniz", + "LongWelcomeMessage": "Uygulamaya hoşgeldiniz. Bu, ABP framework'ü üzerine bina edilmiş bir başlangıç projesidir. Daha fazla bilgi için abp.io adresini ziyaret edebilirsiniz." + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/vi.json b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/vi.json new file mode 100644 index 0000000..6c861c8 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/vi.json @@ -0,0 +1,9 @@ +{ + "culture": "vi", + "texts": { + "AppName": "Dispatch", + "Menu:Home": "Trang chủ", + "Welcome": "Chào mừng bạn", + "LongWelcomeMessage": "Chào mừng bạn đến ứng dụng. Đây là một dự án khởi nghiệp dựa trên khung ABP. Để biết thêm thông tin, hãy truy cập abp.io." + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/zh-Hans.json b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/zh-Hans.json new file mode 100644 index 0000000..0f10121 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/zh-Hans.json @@ -0,0 +1,9 @@ +{ + "culture": "zh-Hans", + "texts": { + "AppName": "Dispatch", + "Menu:Home": "首页", + "Welcome": "欢迎", + "LongWelcomeMessage": "欢迎使用本应用程序。这是一个基于 ABP 框架的启动项目。更多信息,请访问 abp.io。" + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/zh-Hant.json b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/zh-Hant.json new file mode 100644 index 0000000..a8bd0de --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/Dispatch/zh-Hant.json @@ -0,0 +1,9 @@ +{ + "culture": "zh-Hant", + "texts": { + "AppName": "Dispatch", + "Menu:Home": "首頁", + "Welcome": "歡迎", + "LongWelcomeMessage": "歡迎來到此應用程式. 這是一個基於ABP框架的起始專案. 有關更多訊息, 請瀏覽 abp.io." + } + } diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/DispatchResource.cs b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/DispatchResource.cs new file mode 100644 index 0000000..fc03359 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/Localization/DispatchResource.cs @@ -0,0 +1,9 @@ +using Volo.Abp.Localization; + +namespace KonSoft.Dispatch.Localization; + +[LocalizationResourceName("Dispatch")] +public class DispatchResource +{ + +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/MultiTenancy/MultiTenancyConsts.cs b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/MultiTenancy/MultiTenancyConsts.cs new file mode 100644 index 0000000..7fb6333 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain.Shared/MultiTenancy/MultiTenancyConsts.cs @@ -0,0 +1,10 @@ +namespace KonSoft.Dispatch.MultiTenancy; + +public static class MultiTenancyConsts +{ + /* Enable/disable multi-tenancy easily in a single point. + * If you will never need to multi-tenancy, you can remove + * related modules and code parts, including this file. + */ + public const bool IsEnabled = true; +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain/Data/DispatchDbMigrationService.cs b/modules/dispatch/src/KonSoft.Dispatch.Domain/Data/DispatchDbMigrationService.cs new file mode 100644 index 0000000..11680bc --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain/Data/DispatchDbMigrationService.cs @@ -0,0 +1,218 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Identity; +using Volo.Abp.MultiTenancy; +using Volo.Abp.TenantManagement; + +namespace KonSoft.Dispatch.Data; + +public class DispatchDbMigrationService : ITransientDependency +{ + public ILogger Logger { get; set; } + + private readonly IDataSeeder _dataSeeder; + private readonly IEnumerable _dbSchemaMigrators; + private readonly ITenantRepository _tenantRepository; + private readonly ICurrentTenant _currentTenant; + + public DispatchDbMigrationService( + IDataSeeder dataSeeder, + IEnumerable dbSchemaMigrators, + ITenantRepository tenantRepository, + ICurrentTenant currentTenant) + { + _dataSeeder = dataSeeder; + _dbSchemaMigrators = dbSchemaMigrators; + _tenantRepository = tenantRepository; + _currentTenant = currentTenant; + + Logger = NullLogger.Instance; + } + + public async Task MigrateAsync() + { + var initialMigrationAdded = AddInitialMigrationIfNotExist(); + + if (initialMigrationAdded) + { + return; + } + + Logger.LogInformation("Started database migrations..."); + + await MigrateDatabaseSchemaAsync(); + await SeedDataAsync(); + + Logger.LogInformation($"Successfully completed host database migrations."); + + var tenants = await _tenantRepository.GetListAsync(includeDetails: true); + + var migratedDatabaseSchemas = new HashSet(); + foreach (var tenant in tenants) + { + using (_currentTenant.Change(tenant.Id)) + { + if (tenant.ConnectionStrings.Any()) + { + var tenantConnectionStrings = tenant.ConnectionStrings + .Select(x => x.Value) + .ToList(); + + if (!migratedDatabaseSchemas.IsSupersetOf(tenantConnectionStrings)) + { + await MigrateDatabaseSchemaAsync(tenant); + + migratedDatabaseSchemas.AddIfNotContains(tenantConnectionStrings); + } + } + + await SeedDataAsync(tenant); + } + + Logger.LogInformation($"Successfully completed {tenant.Name} tenant database migrations."); + } + + Logger.LogInformation("Successfully completed all database migrations."); + Logger.LogInformation("You can safely end this process..."); + } + + private async Task MigrateDatabaseSchemaAsync(Tenant? tenant = null) + { + Logger.LogInformation( + $"Migrating schema for {(tenant == null ? "host" : tenant.Name + " tenant")} database..."); + + foreach (var migrator in _dbSchemaMigrators) + { + await migrator.MigrateAsync(); + } + } + + private async Task SeedDataAsync(Tenant? tenant = null) + { + Logger.LogInformation($"Executing {(tenant == null ? "host" : tenant.Name + " tenant")} database seed..."); + + await _dataSeeder.SeedAsync(new DataSeedContext(tenant?.Id) + .WithProperty(IdentityDataSeedContributor.AdminEmailPropertyName, IdentityDataSeedContributor.AdminEmailDefaultValue) + .WithProperty(IdentityDataSeedContributor.AdminPasswordPropertyName, IdentityDataSeedContributor.AdminPasswordDefaultValue) + ); + } + + private bool AddInitialMigrationIfNotExist() + { + try + { + if (!DbMigrationsProjectExists()) + { + return false; + } + } + catch (Exception) + { + return false; + } + + try + { + if (!MigrationsFolderExists()) + { + AddInitialMigration(); + return true; + } + else + { + return false; + } + } + catch (Exception e) + { + Logger.LogWarning("Couldn't determinate if any migrations exist : " + e.Message); + return false; + } + } + + private bool DbMigrationsProjectExists() + { + var dbMigrationsProjectFolder = GetEntityFrameworkCoreProjectFolderPath(); + + return dbMigrationsProjectFolder != null; + } + + private bool MigrationsFolderExists() + { + var dbMigrationsProjectFolder = GetEntityFrameworkCoreProjectFolderPath(); + return dbMigrationsProjectFolder != null && Directory.Exists(Path.Combine(dbMigrationsProjectFolder, "Migrations")); + } + + private void AddInitialMigration() + { + Logger.LogInformation("Creating initial migration..."); + + string argumentPrefix; + string fileName; + + if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) || RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + argumentPrefix = "-c"; + fileName = "/bin/bash"; + } + else + { + argumentPrefix = "/C"; + fileName = "cmd.exe"; + } + + var procStartInfo = new ProcessStartInfo(fileName, + $"{argumentPrefix} \"abp create-migration-and-run-migrator \"{GetEntityFrameworkCoreProjectFolderPath()}\"\"" + ); + + try + { + Process.Start(procStartInfo); + } + catch (Exception) + { + throw new Exception("Couldn't run ABP CLI..."); + } + } + + private string? GetEntityFrameworkCoreProjectFolderPath() + { + var slnDirectoryPath = GetSolutionDirectoryPath(); + + if (slnDirectoryPath == null) + { + throw new Exception("Solution folder not found!"); + } + + var srcDirectoryPath = Path.Combine(slnDirectoryPath, "src"); + + return Directory.GetDirectories(srcDirectoryPath) + .FirstOrDefault(d => d.EndsWith(".EntityFrameworkCore")); + } + + private string? GetSolutionDirectoryPath() + { + var currentDirectory = new DirectoryInfo(Directory.GetCurrentDirectory()); + + while (currentDirectory != null && Directory.GetParent(currentDirectory.FullName) != null) + { + currentDirectory = Directory.GetParent(currentDirectory.FullName); + + if (currentDirectory != null && Directory.GetFiles(currentDirectory.FullName).FirstOrDefault(f => f.EndsWith(".sln")) != null) + { + return currentDirectory.FullName; + } + } + + return null; + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain/Data/IDispatchDbSchemaMigrator.cs b/modules/dispatch/src/KonSoft.Dispatch.Domain/Data/IDispatchDbSchemaMigrator.cs new file mode 100644 index 0000000..e161870 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain/Data/IDispatchDbSchemaMigrator.cs @@ -0,0 +1,8 @@ +using System.Threading.Tasks; + +namespace KonSoft.Dispatch.Data; + +public interface IDispatchDbSchemaMigrator +{ + Task MigrateAsync(); +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain/Data/NullDispatchDbSchemaMigrator.cs b/modules/dispatch/src/KonSoft.Dispatch.Domain/Data/NullDispatchDbSchemaMigrator.cs new file mode 100644 index 0000000..cd2f4c2 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain/Data/NullDispatchDbSchemaMigrator.cs @@ -0,0 +1,15 @@ +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; + +namespace KonSoft.Dispatch.Data; + +/* This is used if database provider does't define + * IDispatchDbSchemaMigrator implementation. + */ +public class NullDispatchDbSchemaMigrator : IDispatchDbSchemaMigrator, ITransientDependency +{ + public Task MigrateAsync() + { + return Task.CompletedTask; + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain/DispatchConsts.cs b/modules/dispatch/src/KonSoft.Dispatch.Domain/DispatchConsts.cs new file mode 100644 index 0000000..e886226 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain/DispatchConsts.cs @@ -0,0 +1,8 @@ +namespace KonSoft.Dispatch; + +public static class DispatchConsts +{ + public const string DbTablePrefix = "App"; + + public const string DbSchema = null; +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain/DispatchDomainModule.cs b/modules/dispatch/src/KonSoft.Dispatch.Domain/DispatchDomainModule.cs new file mode 100644 index 0000000..edd9075 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain/DispatchDomainModule.cs @@ -0,0 +1,68 @@ +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection.Extensions; +using KonSoft.Dispatch.MultiTenancy; +using Volo.Abp.AuditLogging; +using Volo.Abp.BackgroundJobs; +using Volo.Abp.Emailing; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Volo.Abp.MultiTenancy; +using Volo.Abp.OpenIddict; +using Volo.Abp.PermissionManagement.Identity; +using Volo.Abp.PermissionManagement.OpenIddict; +using Volo.Abp.SettingManagement; +using Volo.Abp.TenantManagement; + +namespace KonSoft.Dispatch; + +[DependsOn( + typeof(DispatchDomainSharedModule), + typeof(AbpAuditLoggingDomainModule), + typeof(AbpBackgroundJobsDomainModule), + typeof(AbpFeatureManagementDomainModule), + typeof(AbpIdentityDomainModule), + typeof(AbpOpenIddictDomainModule), + typeof(AbpPermissionManagementDomainOpenIddictModule), + typeof(AbpPermissionManagementDomainIdentityModule), + typeof(AbpSettingManagementDomainModule), + typeof(AbpTenantManagementDomainModule), + typeof(AbpEmailingModule) +)] +public class DispatchDomainModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.Languages.Add(new LanguageInfo("ar", "ar", "العربية")); + options.Languages.Add(new LanguageInfo("cs", "cs", "Čeština")); + options.Languages.Add(new LanguageInfo("en", "en", "English")); + options.Languages.Add(new LanguageInfo("en-GB", "en-GB", "English (UK)")); + options.Languages.Add(new LanguageInfo("hu", "hu", "Magyar")); + options.Languages.Add(new LanguageInfo("hr", "hr", "Croatian")); + options.Languages.Add(new LanguageInfo("fi", "fi", "Finnish")); + options.Languages.Add(new LanguageInfo("fr", "fr", "Français")); + options.Languages.Add(new LanguageInfo("hi", "hi", "Hindi")); + options.Languages.Add(new LanguageInfo("it", "it", "Italiano")); + options.Languages.Add(new LanguageInfo("pt-BR", "pt-BR", "Português")); + options.Languages.Add(new LanguageInfo("ru", "ru", "Русский")); + options.Languages.Add(new LanguageInfo("sk", "sk", "Slovak")); + options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe")); + options.Languages.Add(new LanguageInfo("zh-Hans", "zh-Hans", "简体中文")); + options.Languages.Add(new LanguageInfo("zh-Hant", "zh-Hant", "繁體中文")); + options.Languages.Add(new LanguageInfo("de-DE", "de-DE", "Deutsch")); + options.Languages.Add(new LanguageInfo("es", "es", "Español")); + }); + + Configure(options => + { + options.IsEnabled = MultiTenancyConsts.IsEnabled; + }); + +#if DEBUG + context.Services.Replace(ServiceDescriptor.Singleton()); +#endif + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain/KonSoft.Dispatch.Domain.csproj b/modules/dispatch/src/KonSoft.Dispatch.Domain/KonSoft.Dispatch.Domain.csproj new file mode 100644 index 0000000..a2e6370 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain/KonSoft.Dispatch.Domain.csproj @@ -0,0 +1,28 @@ + + + + + + net8.0 + enable + KonSoft.Dispatch + + + + + + + + + + + + + + + + + + + + diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain/OpenIddict/OpenIddictDataSeedContributor.cs b/modules/dispatch/src/KonSoft.Dispatch.Domain/OpenIddict/OpenIddictDataSeedContributor.cs new file mode 100644 index 0000000..6e766f2 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain/OpenIddict/OpenIddictDataSeedContributor.cs @@ -0,0 +1,327 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; +using System.Threading.Tasks; +using JetBrains.Annotations; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Localization; +using OpenIddict.Abstractions; +using Volo.Abp; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.OpenIddict.Applications; +using Volo.Abp.OpenIddict.Scopes; +using Volo.Abp.PermissionManagement; +using Volo.Abp.Uow; + +namespace KonSoft.Dispatch.OpenIddict; + +/* Creates initial data that is needed to property run the application + * and make client-to-server communication possible. + */ +public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDependency +{ + private readonly IConfiguration _configuration; + private readonly IOpenIddictApplicationRepository _openIddictApplicationRepository; + private readonly IAbpApplicationManager _applicationManager; + private readonly IOpenIddictScopeRepository _openIddictScopeRepository; + private readonly IOpenIddictScopeManager _scopeManager; + private readonly IPermissionDataSeeder _permissionDataSeeder; + private readonly IStringLocalizer L; + + public OpenIddictDataSeedContributor( + IConfiguration configuration, + IOpenIddictApplicationRepository openIddictApplicationRepository, + IAbpApplicationManager applicationManager, + IOpenIddictScopeRepository openIddictScopeRepository, + IOpenIddictScopeManager scopeManager, + IPermissionDataSeeder permissionDataSeeder, + IStringLocalizer l ) + { + _configuration = configuration; + _openIddictApplicationRepository = openIddictApplicationRepository; + _applicationManager = applicationManager; + _openIddictScopeRepository = openIddictScopeRepository; + _scopeManager = scopeManager; + _permissionDataSeeder = permissionDataSeeder; + L = l; + } + + [UnitOfWork] + public virtual async Task SeedAsync(DataSeedContext context) + { + await CreateScopesAsync(); + await CreateApplicationsAsync(); + } + + private async Task CreateScopesAsync() + { + if (await _openIddictScopeRepository.FindByNameAsync("Dispatch") == null) + { + await _scopeManager.CreateAsync(new OpenIddictScopeDescriptor { + Name = "Dispatch", DisplayName = "Dispatch API", Resources = { "Dispatch" } + }); + } + } + + private async Task CreateApplicationsAsync() + { + var commonScopes = new List { + OpenIddictConstants.Permissions.Scopes.Address, + OpenIddictConstants.Permissions.Scopes.Email, + OpenIddictConstants.Permissions.Scopes.Phone, + OpenIddictConstants.Permissions.Scopes.Profile, + OpenIddictConstants.Permissions.Scopes.Roles, + "Dispatch" + }; + + var configurationSection = _configuration.GetSection("OpenIddict:Applications"); + + + + + + + // Swagger Client + var swaggerClientId = configurationSection["Dispatch_Swagger:ClientId"]; + if (!swaggerClientId.IsNullOrWhiteSpace()) + { + var swaggerRootUrl = configurationSection["Dispatch_Swagger:RootUrl"]?.TrimEnd('/'); + + await CreateApplicationAsync( + name: swaggerClientId!, + type: OpenIddictConstants.ClientTypes.Public, + consentType: OpenIddictConstants.ConsentTypes.Implicit, + displayName: "Swagger Application", + secret: null, + grantTypes: new List { OpenIddictConstants.GrantTypes.AuthorizationCode, }, + scopes: commonScopes, + redirectUri: $"{swaggerRootUrl}/swagger/oauth2-redirect.html", + clientUri: swaggerRootUrl + ); + } + } + + private async Task CreateApplicationAsync( + [NotNull] string name, + [NotNull] string type, + [NotNull] string consentType, + string displayName, + string? secret, + List grantTypes, + List scopes, + string? clientUri = null, + string? redirectUri = null, + string? postLogoutRedirectUri = null, + List? permissions = null) + { + if (!string.IsNullOrEmpty(secret) && string.Equals(type, OpenIddictConstants.ClientTypes.Public, + StringComparison.OrdinalIgnoreCase)) + { + throw new BusinessException(L["NoClientSecretCanBeSetForPublicApplications"]); + } + + if (string.IsNullOrEmpty(secret) && string.Equals(type, OpenIddictConstants.ClientTypes.Confidential, + StringComparison.OrdinalIgnoreCase)) + { + throw new BusinessException(L["TheClientSecretIsRequiredForConfidentialApplications"]); + } + + var client = await _openIddictApplicationRepository.FindByClientIdAsync(name); + + var application = new AbpApplicationDescriptor { + ClientId = name, + ClientType = type, + ClientSecret = secret, + ConsentType = consentType, + DisplayName = displayName, + ClientUri = clientUri, + }; + + Check.NotNullOrEmpty(grantTypes, nameof(grantTypes)); + Check.NotNullOrEmpty(scopes, nameof(scopes)); + + if (new[] { OpenIddictConstants.GrantTypes.AuthorizationCode, OpenIddictConstants.GrantTypes.Implicit }.All( + grantTypes.Contains)) + { + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.CodeIdToken); + + if (string.Equals(type, OpenIddictConstants.ClientTypes.Public, StringComparison.OrdinalIgnoreCase)) + { + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.CodeIdTokenToken); + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.CodeToken); + } + } + + if (!redirectUri.IsNullOrWhiteSpace() || !postLogoutRedirectUri.IsNullOrWhiteSpace()) + { + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Logout); + } + + var buildInGrantTypes = new[] { + OpenIddictConstants.GrantTypes.Implicit, OpenIddictConstants.GrantTypes.Password, + OpenIddictConstants.GrantTypes.AuthorizationCode, OpenIddictConstants.GrantTypes.ClientCredentials, + OpenIddictConstants.GrantTypes.DeviceCode, OpenIddictConstants.GrantTypes.RefreshToken + }; + + foreach (var grantType in grantTypes) + { + if (grantType == OpenIddictConstants.GrantTypes.AuthorizationCode) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.AuthorizationCode); + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.Code); + } + + if (grantType == OpenIddictConstants.GrantTypes.AuthorizationCode || + grantType == OpenIddictConstants.GrantTypes.Implicit) + { + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Authorization); + } + + if (grantType == OpenIddictConstants.GrantTypes.AuthorizationCode || + grantType == OpenIddictConstants.GrantTypes.ClientCredentials || + grantType == OpenIddictConstants.GrantTypes.Password || + grantType == OpenIddictConstants.GrantTypes.RefreshToken || + grantType == OpenIddictConstants.GrantTypes.DeviceCode) + { + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Token); + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Revocation); + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Introspection); + } + + if (grantType == OpenIddictConstants.GrantTypes.ClientCredentials) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.ClientCredentials); + } + + if (grantType == OpenIddictConstants.GrantTypes.Implicit) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.Implicit); + } + + if (grantType == OpenIddictConstants.GrantTypes.Password) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.Password); + } + + if (grantType == OpenIddictConstants.GrantTypes.RefreshToken) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.RefreshToken); + } + + if (grantType == OpenIddictConstants.GrantTypes.DeviceCode) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.DeviceCode); + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Device); + } + + if (grantType == OpenIddictConstants.GrantTypes.Implicit) + { + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.IdToken); + if (string.Equals(type, OpenIddictConstants.ClientTypes.Public, StringComparison.OrdinalIgnoreCase)) + { + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.IdTokenToken); + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.Token); + } + } + + if (!buildInGrantTypes.Contains(grantType)) + { + application.Permissions.Add(OpenIddictConstants.Permissions.Prefixes.GrantType + grantType); + } + } + + var buildInScopes = new[] { + OpenIddictConstants.Permissions.Scopes.Address, OpenIddictConstants.Permissions.Scopes.Email, + OpenIddictConstants.Permissions.Scopes.Phone, OpenIddictConstants.Permissions.Scopes.Profile, + OpenIddictConstants.Permissions.Scopes.Roles + }; + + foreach (var scope in scopes) + { + if (buildInScopes.Contains(scope)) + { + application.Permissions.Add(scope); + } + else + { + application.Permissions.Add(OpenIddictConstants.Permissions.Prefixes.Scope + scope); + } + } + + if (redirectUri != null) + { + if (!redirectUri.IsNullOrEmpty()) + { + if (!Uri.TryCreate(redirectUri, UriKind.Absolute, out var uri) || !uri.IsWellFormedOriginalString()) + { + throw new BusinessException(L["InvalidRedirectUri", redirectUri]); + } + + if (application.RedirectUris.All(x => x != uri)) + { + application.RedirectUris.Add(uri); + } + } + } + + if (postLogoutRedirectUri != null) + { + if (!postLogoutRedirectUri.IsNullOrEmpty()) + { + if (!Uri.TryCreate(postLogoutRedirectUri, UriKind.Absolute, out var uri) || + !uri.IsWellFormedOriginalString()) + { + throw new BusinessException(L["InvalidPostLogoutRedirectUri", postLogoutRedirectUri]); + } + + if (application.PostLogoutRedirectUris.All(x => x != uri)) + { + application.PostLogoutRedirectUris.Add(uri); + } + } + } + + if (permissions != null) + { + await _permissionDataSeeder.SeedAsync( + ClientPermissionValueProvider.ProviderName, + name, + permissions, + null + ); + } + + if (client == null) + { + await _applicationManager.CreateAsync(application); + return; + } + + if (!HasSameRedirectUris(client, application)) + { + client.RedirectUris = JsonSerializer.Serialize(application.RedirectUris.Select(q => q.ToString().TrimEnd('/'))); + client.PostLogoutRedirectUris = JsonSerializer.Serialize(application.PostLogoutRedirectUris.Select(q => q.ToString().TrimEnd('/'))); + + await _applicationManager.UpdateAsync(client.ToModel()); + } + + if (!HasSameScopes(client, application)) + { + client.Permissions = JsonSerializer.Serialize(application.Permissions.Select(q => q.ToString())); + await _applicationManager.UpdateAsync(client.ToModel()); + } + } + + private bool HasSameRedirectUris(OpenIddictApplication existingClient, AbpApplicationDescriptor application) + { + return existingClient.RedirectUris == JsonSerializer.Serialize(application.RedirectUris.Select(q => q.ToString().TrimEnd('/'))); + } + + private bool HasSameScopes(OpenIddictApplication existingClient, AbpApplicationDescriptor application) + { + return existingClient.Permissions == JsonSerializer.Serialize(application.Permissions.Select(q => q.ToString().TrimEnd('/'))); + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain/Properties/AssemblyInfo.cs b/modules/dispatch/src/KonSoft.Dispatch.Domain/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..62d174d --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain/Properties/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using System.Runtime.CompilerServices; +[assembly:InternalsVisibleToAttribute("KonSoft.Dispatch.Domain.Tests")] +[assembly:InternalsVisibleToAttribute("KonSoft.Dispatch.TestBase")] diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain/Settings/DispatchSettingDefinitionProvider.cs b/modules/dispatch/src/KonSoft.Dispatch.Domain/Settings/DispatchSettingDefinitionProvider.cs new file mode 100644 index 0000000..a90d428 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain/Settings/DispatchSettingDefinitionProvider.cs @@ -0,0 +1,12 @@ +using Volo.Abp.Settings; + +namespace KonSoft.Dispatch.Settings; + +public class DispatchSettingDefinitionProvider : SettingDefinitionProvider +{ + public override void Define(ISettingDefinitionContext context) + { + //Define your own settings here. Example: + //context.Add(new SettingDefinition(DispatchSettings.MySetting1)); + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain/Settings/DispatchSettings.cs b/modules/dispatch/src/KonSoft.Dispatch.Domain/Settings/DispatchSettings.cs new file mode 100644 index 0000000..606a2b9 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain/Settings/DispatchSettings.cs @@ -0,0 +1,9 @@ +namespace KonSoft.Dispatch.Settings; + +public static class DispatchSettings +{ + private const string Prefix = "Dispatch"; + + //Add your own setting names here. Example: + //public const string MySetting1 = Prefix + ".MySetting1"; +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.EntityFrameworkCore/EntityFrameworkCore/DispatchDbContext.cs b/modules/dispatch/src/KonSoft.Dispatch.EntityFrameworkCore/EntityFrameworkCore/DispatchDbContext.cs new file mode 100644 index 0000000..857a29c --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.EntityFrameworkCore/EntityFrameworkCore/DispatchDbContext.cs @@ -0,0 +1,86 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp.AuditLogging.EntityFrameworkCore; +using Volo.Abp.BackgroundJobs.EntityFrameworkCore; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.FeatureManagement.EntityFrameworkCore; +using Volo.Abp.Identity; +using Volo.Abp.Identity.EntityFrameworkCore; +using Volo.Abp.OpenIddict.EntityFrameworkCore; +using Volo.Abp.PermissionManagement.EntityFrameworkCore; +using Volo.Abp.SettingManagement.EntityFrameworkCore; +using Volo.Abp.TenantManagement; +using Volo.Abp.TenantManagement.EntityFrameworkCore; + +namespace KonSoft.Dispatch.EntityFrameworkCore; + +[ReplaceDbContext(typeof(IIdentityDbContext))] +[ReplaceDbContext(typeof(ITenantManagementDbContext))] +[ConnectionStringName("Default")] +public class DispatchDbContext : + AbpDbContext, + IIdentityDbContext, + ITenantManagementDbContext +{ + /* Add DbSet properties for your Aggregate Roots / Entities here. */ + + #region Entities from the modules + + /* Notice: We only implemented IIdentityDbContext and ITenantManagementDbContext + * and replaced them for this DbContext. This allows you to perform JOIN + * queries for the entities of these modules over the repositories easily. You + * typically don't need that for other modules. But, if you need, you can + * implement the DbContext interface of the needed module and use ReplaceDbContext + * attribute just like IIdentityDbContext and ITenantManagementDbContext. + * + * More info: Replacing a DbContext of a module ensures that the related module + * uses this DbContext on runtime. Otherwise, it will use its own DbContext class. + */ + + //Identity + public DbSet Users { get; set; } + public DbSet Roles { get; set; } + public DbSet ClaimTypes { get; set; } + public DbSet OrganizationUnits { get; set; } + public DbSet SecurityLogs { get; set; } + public DbSet LinkUsers { get; set; } + public DbSet UserDelegations { get; set; } + public DbSet Sessions { get; set; } + // Tenant Management + public DbSet Tenants { get; set; } + public DbSet TenantConnectionStrings { get; set; } + + #endregion + + public DispatchDbContext(DbContextOptions options) + : base(options) + { + + } + + protected override void OnModelCreating(ModelBuilder builder) + { + base.OnModelCreating(builder); + + /* Include modules to your migration db context */ + + builder.ConfigurePermissionManagement(); + builder.ConfigureSettingManagement(); + builder.ConfigureBackgroundJobs(); + builder.ConfigureAuditLogging(); + builder.ConfigureIdentity(); + builder.ConfigureOpenIddict(); + builder.ConfigureFeatureManagement(); + builder.ConfigureTenantManagement(); + + /* Configure your own tables/entities inside here */ + + //builder.Entity(b => + //{ + // b.ToTable(DispatchConsts.DbTablePrefix + "YourEntities", DispatchConsts.DbSchema); + // b.ConfigureByConvention(); //auto configure for the base class props + // //... + //}); + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.EntityFrameworkCore/EntityFrameworkCore/DispatchDbContextFactory.cs b/modules/dispatch/src/KonSoft.Dispatch.EntityFrameworkCore/EntityFrameworkCore/DispatchDbContextFactory.cs new file mode 100644 index 0000000..83440e2 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.EntityFrameworkCore/EntityFrameworkCore/DispatchDbContextFactory.cs @@ -0,0 +1,36 @@ +using System; +using System.IO; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Design; +using Microsoft.Extensions.Configuration; + +namespace KonSoft.Dispatch.EntityFrameworkCore; + +/* This class is needed for EF Core console commands + * (like Add-Migration and Update-Database commands) */ +public class DispatchDbContextFactory : IDesignTimeDbContextFactory +{ + public DispatchDbContext CreateDbContext(string[] args) + { + // https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic + AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); + + DispatchEfCoreEntityExtensionMappings.Configure(); + + var configuration = BuildConfiguration(); + + var builder = new DbContextOptionsBuilder() + .UseNpgsql(configuration.GetConnectionString("Default")); + + return new DispatchDbContext(builder.Options); + } + + private static IConfigurationRoot BuildConfiguration() + { + var builder = new ConfigurationBuilder() + .SetBasePath(Path.Combine(Directory.GetCurrentDirectory(), "../KonSoft.Dispatch.DbMigrator/")) + .AddJsonFile("appsettings.json", optional: false); + + return builder.Build(); + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.EntityFrameworkCore/EntityFrameworkCore/DispatchEfCoreEntityExtensionMappings.cs b/modules/dispatch/src/KonSoft.Dispatch.EntityFrameworkCore/EntityFrameworkCore/DispatchEfCoreEntityExtensionMappings.cs new file mode 100644 index 0000000..61f016e --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.EntityFrameworkCore/EntityFrameworkCore/DispatchEfCoreEntityExtensionMappings.cs @@ -0,0 +1,44 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Identity; +using Volo.Abp.ObjectExtending; +using Volo.Abp.Threading; + +namespace KonSoft.Dispatch.EntityFrameworkCore; + +public static class DispatchEfCoreEntityExtensionMappings +{ + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + + public static void Configure() + { + DispatchGlobalFeatureConfigurator.Configure(); + DispatchModuleExtensionConfigurator.Configure(); + + OneTimeRunner.Run(() => + { + /* You can configure extra properties for the + * entities defined in the modules used by your application. + * + * This class can be used to map these extra properties to table fields in the database. + * + * USE THIS CLASS ONLY TO CONFIGURE EF CORE RELATED MAPPING. + * USE DispatchModuleExtensionConfigurator CLASS (in the Domain.Shared project) + * FOR A HIGH LEVEL API TO DEFINE EXTRA PROPERTIES TO ENTITIES OF THE USED MODULES + * + * Example: Map a property to a table field: + + ObjectExtensionManager.Instance + .MapEfCoreProperty( + "MyProperty", + (entityBuilder, propertyBuilder) => + { + propertyBuilder.HasMaxLength(128); + } + ); + + * See the documentation for more: + * https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Extending-Entities + */ + }); + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.EntityFrameworkCore/EntityFrameworkCore/DispatchEntityFrameworkCoreModule.cs b/modules/dispatch/src/KonSoft.Dispatch.EntityFrameworkCore/EntityFrameworkCore/DispatchEntityFrameworkCoreModule.cs new file mode 100644 index 0000000..788dca1 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.EntityFrameworkCore/EntityFrameworkCore/DispatchEntityFrameworkCoreModule.cs @@ -0,0 +1,57 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Uow; +using Volo.Abp.AuditLogging.EntityFrameworkCore; +using Volo.Abp.BackgroundJobs.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.PostgreSql; +using Volo.Abp.FeatureManagement.EntityFrameworkCore; +using Volo.Abp.Identity.EntityFrameworkCore; +using Volo.Abp.Modularity; +using Volo.Abp.OpenIddict.EntityFrameworkCore; +using Volo.Abp.PermissionManagement.EntityFrameworkCore; +using Volo.Abp.SettingManagement.EntityFrameworkCore; +using Volo.Abp.TenantManagement.EntityFrameworkCore; + +namespace KonSoft.Dispatch.EntityFrameworkCore; + +[DependsOn( + typeof(DispatchDomainModule), + typeof(AbpIdentityEntityFrameworkCoreModule), + typeof(AbpOpenIddictEntityFrameworkCoreModule), + typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpSettingManagementEntityFrameworkCoreModule), + typeof(AbpEntityFrameworkCorePostgreSqlModule), + typeof(AbpBackgroundJobsEntityFrameworkCoreModule), + typeof(AbpAuditLoggingEntityFrameworkCoreModule), + typeof(AbpTenantManagementEntityFrameworkCoreModule), + typeof(AbpFeatureManagementEntityFrameworkCoreModule) + )] +public class DispatchEntityFrameworkCoreModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + // https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic + AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); + + DispatchEfCoreEntityExtensionMappings.Configure(); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAbpDbContext(options => + { + /* Remove "includeAllEntities: true" to create + * default repositories only for aggregate roots */ + options.AddDefaultRepositories(includeAllEntities: true); + }); + + Configure(options => + { + /* The main point to change your DBMS. + * See also DispatchMigrationsDbContextFactory for EF Core tooling. */ + options.UseNpgsql(); + }); + + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreDispatchDbSchemaMigrator.cs b/modules/dispatch/src/KonSoft.Dispatch.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreDispatchDbSchemaMigrator.cs new file mode 100644 index 0000000..6475cdb --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreDispatchDbSchemaMigrator.cs @@ -0,0 +1,34 @@ +using System; +using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using KonSoft.Dispatch.Data; +using Volo.Abp.DependencyInjection; + +namespace KonSoft.Dispatch.EntityFrameworkCore; + +public class EntityFrameworkCoreDispatchDbSchemaMigrator + : IDispatchDbSchemaMigrator, ITransientDependency +{ + private readonly IServiceProvider _serviceProvider; + + public EntityFrameworkCoreDispatchDbSchemaMigrator( + IServiceProvider serviceProvider) + { + _serviceProvider = serviceProvider; + } + + public async Task MigrateAsync() + { + /* We intentionally resolve the DispatchDbContext + * from IServiceProvider (instead of directly injecting it) + * to properly get the connection string of the current tenant in the + * current scope. + */ + + await _serviceProvider + .GetRequiredService() + .Database + .MigrateAsync(); + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.EntityFrameworkCore/KonSoft.Dispatch.EntityFrameworkCore.csproj b/modules/dispatch/src/KonSoft.Dispatch.EntityFrameworkCore/KonSoft.Dispatch.EntityFrameworkCore.csproj new file mode 100644 index 0000000..4c1c6f1 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.EntityFrameworkCore/KonSoft.Dispatch.EntityFrameworkCore.csproj @@ -0,0 +1,31 @@ + + + + + + net8.0 + enable + KonSoft.Dispatch + + + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers + + + + diff --git a/modules/dispatch/src/KonSoft.Dispatch.EntityFrameworkCore/Migrations/20250908052345_Initial.Designer.cs b/modules/dispatch/src/KonSoft.Dispatch.EntityFrameworkCore/Migrations/20250908052345_Initial.Designer.cs new file mode 100644 index 0000000..6135d0a --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.EntityFrameworkCore/Migrations/20250908052345_Initial.Designer.cs @@ -0,0 +1,2006 @@ +// +using System; +using KonSoft.Dispatch.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace KonSoft.Dispatch.Migrations +{ + [DbContext(typeof(DispatchDbContext))] + [Migration("20250908052345_Initial")] + partial class Initial + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.PostgreSql) + .HasAnnotation("ProductVersion", "8.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("character varying(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("text"); + + b.Property("ExecutionDuration") + .HasColumnType("integer") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("timestamp without time zone"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("integer") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("uuid") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("uuid") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("uuid") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AuditLogId") + .HasColumnType("uuid") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("integer") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AuditLogId") + .HasColumnType("uuid") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("smallint") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("uuid"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("EntityChangeId") + .HasColumnType("uuid"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("character varying(1048576)"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("LastTryTime") + .HasColumnType("timestamp without time zone"); + + b.Property("NextTryTime") + .HasColumnType("timestamp without time zone"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("boolean"); + + b.Property("IsVisibleToClients") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("Required") + .HasColumnType("boolean"); + + b.Property("ValueType") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("SourceTenantId") + .HasColumnType("uuid"); + + b.Property("SourceUserId") + .HasColumnType("uuid"); + + b.Property("TargetTenantId") + .HasColumnType("uuid"); + + b.Property("TargetUserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("boolean") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("boolean") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("boolean") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("character varying(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("character varying(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("character varying(96)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySession", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Device") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("DeviceInfo") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("IpAddresses") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("LastAccessed") + .HasColumnType("timestamp without time zone"); + + b.Property("SessionId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("SignedIn") + .HasColumnType("timestamp without time zone"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("Device"); + + b.HasIndex("SessionId"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSessions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("boolean") + .HasColumnName("IsActive"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("LastPasswordChangeTime") + .HasColumnType("timestamp with time zone"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("SecurityStamp"); + + b.Property("ShouldChangePasswordOnNextLogin") + .HasColumnType("boolean"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserDelegation", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("EndTime") + .HasColumnType("timestamp without time zone"); + + b.Property("SourceUserId") + .HasColumnType("uuid"); + + b.Property("StartTime") + .HasColumnType("timestamp without time zone"); + + b.Property("TargetUserId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AbpUserDelegations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("character varying(196)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uuid"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("character varying(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("DisplayName"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uuid"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("ClientId") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("ClientSecret") + .HasColumnType("text"); + + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("ClientUri") + .HasColumnType("text"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .HasColumnType("text"); + + b.Property("DisplayNames") + .HasColumnType("text"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("JsonWebKeySet") + .HasColumnType("text"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasColumnType("text"); + + b.Property("Permissions") + .HasColumnType("text"); + + b.Property("PostLogoutRedirectUris") + .HasColumnType("text"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("RedirectUris") + .HasColumnType("text"); + + b.Property("Requirements") + .HasColumnType("text"); + + b.Property("Settings") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("OpenIddictApplications", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationId") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("timestamp without time zone"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("Scopes") + .HasColumnType("text"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("character varying(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictAuthorizations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Scopes.OpenIddictScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Descriptions") + .HasColumnType("text"); + + b.Property("DisplayName") + .HasColumnType("text"); + + b.Property("DisplayNames") + .HasColumnType("text"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("Resources") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("OpenIddictScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationId") + .HasColumnType("uuid"); + + b.Property("AuthorizationId") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("timestamp without time zone"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("ExpirationDate") + .HasColumnType("timestamp without time zone"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Payload") + .HasColumnType("text"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("RedemptionDate") + .HasColumnType("timestamp without time zone"); + + b.Property("ReferenceId") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("character varying(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.HasKey("Id"); + + b.HasIndex("AuthorizationId"); + + b.HasIndex("ReferenceId"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("IsEnabled") + .HasColumnType("boolean"); + + b.Property("MultiTenancySide") + .HasColumnType("smallint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.SettingDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DefaultValue") + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.Property("Description") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsEncrypted") + .HasColumnType("boolean"); + + b.Property("IsInherited") + .HasColumnType("boolean"); + + b.Property("IsVisibleToClients") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("Providers") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpSettingDefinitions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("uuid"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + + b.HasOne("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", null) + .WithMany() + .HasForeignKey("AuthorizationId"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.EntityFrameworkCore/Migrations/20250908052345_Initial.cs b/modules/dispatch/src/KonSoft.Dispatch.EntityFrameworkCore/Migrations/20250908052345_Initial.cs new file mode 100644 index 0000000..8d71e00 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.EntityFrameworkCore/Migrations/20250908052345_Initial.cs @@ -0,0 +1,1156 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace KonSoft.Dispatch.Migrations +{ + /// + public partial class Initial : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "AbpAuditLogs", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + ApplicationName = table.Column(type: "character varying(96)", maxLength: 96, nullable: true), + UserId = table.Column(type: "uuid", nullable: true), + UserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + TenantId = table.Column(type: "uuid", nullable: true), + TenantName = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + ImpersonatorUserId = table.Column(type: "uuid", nullable: true), + ImpersonatorUserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + ImpersonatorTenantId = table.Column(type: "uuid", nullable: true), + ImpersonatorTenantName = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + ExecutionTime = table.Column(type: "timestamp without time zone", nullable: false), + ExecutionDuration = table.Column(type: "integer", nullable: false), + ClientIpAddress = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + ClientName = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + ClientId = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + CorrelationId = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + BrowserInfo = table.Column(type: "character varying(512)", maxLength: 512, nullable: true), + HttpMethod = table.Column(type: "character varying(16)", maxLength: 16, nullable: true), + Url = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + Exceptions = table.Column(type: "text", nullable: true), + Comments = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + HttpStatusCode = table.Column(type: "integer", nullable: true), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpAuditLogs", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpBackgroundJobs", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + JobName = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + JobArgs = table.Column(type: "character varying(1048576)", maxLength: 1048576, nullable: false), + TryCount = table.Column(type: "smallint", nullable: false, defaultValue: (short)0), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + NextTryTime = table.Column(type: "timestamp without time zone", nullable: false), + LastTryTime = table.Column(type: "timestamp without time zone", nullable: true), + IsAbandoned = table.Column(type: "boolean", nullable: false, defaultValue: false), + Priority = table.Column(type: "smallint", nullable: false, defaultValue: (byte)15), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpBackgroundJobs", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpClaimTypes", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + Required = table.Column(type: "boolean", nullable: false), + IsStatic = table.Column(type: "boolean", nullable: false), + Regex = table.Column(type: "character varying(512)", maxLength: 512, nullable: true), + RegexDescription = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + Description = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + ValueType = table.Column(type: "integer", nullable: false), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpClaimTypes", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpFeatureGroups", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + DisplayName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + ExtraProperties = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpFeatureGroups", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpFeatures", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + GroupName = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + ParentName = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + DisplayName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + Description = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + DefaultValue = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + IsVisibleToClients = table.Column(type: "boolean", nullable: false), + IsAvailableToHost = table.Column(type: "boolean", nullable: false), + AllowedProviders = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + ValueType = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: true), + ExtraProperties = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpFeatures", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpFeatureValues", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + Value = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + ProviderName = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + ProviderKey = table.Column(type: "character varying(64)", maxLength: 64, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpFeatureValues", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpLinkUsers", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + SourceUserId = table.Column(type: "uuid", nullable: false), + SourceTenantId = table.Column(type: "uuid", nullable: true), + TargetUserId = table.Column(type: "uuid", nullable: false), + TargetTenantId = table.Column(type: "uuid", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpLinkUsers", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpOrganizationUnits", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + ParentId = table.Column(type: "uuid", nullable: true), + Code = table.Column(type: "character varying(95)", maxLength: 95, nullable: false), + DisplayName = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + EntityVersion = table.Column(type: "integer", nullable: false), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp without time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpOrganizationUnits", x => x.Id); + table.ForeignKey( + name: "FK_AbpOrganizationUnits_AbpOrganizationUnits_ParentId", + column: x => x.ParentId, + principalTable: "AbpOrganizationUnits", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "AbpPermissionGrants", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + ProviderName = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + ProviderKey = table.Column(type: "character varying(64)", maxLength: 64, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpPermissionGroups", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + DisplayName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + ExtraProperties = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissionGroups", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpPermissions", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + GroupName = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + ParentName = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + DisplayName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + IsEnabled = table.Column(type: "boolean", nullable: false), + MultiTenancySide = table.Column(type: "smallint", nullable: false), + Providers = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + StateCheckers = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + ExtraProperties = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissions", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpRoles", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + Name = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + NormalizedName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + IsDefault = table.Column(type: "boolean", nullable: false), + IsStatic = table.Column(type: "boolean", nullable: false), + IsPublic = table.Column(type: "boolean", nullable: false), + EntityVersion = table.Column(type: "integer", nullable: false), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpRoles", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpSecurityLogs", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + ApplicationName = table.Column(type: "character varying(96)", maxLength: 96, nullable: true), + Identity = table.Column(type: "character varying(96)", maxLength: 96, nullable: true), + Action = table.Column(type: "character varying(96)", maxLength: 96, nullable: true), + UserId = table.Column(type: "uuid", nullable: true), + UserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + TenantName = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + ClientId = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + CorrelationId = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + ClientIpAddress = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + BrowserInfo = table.Column(type: "character varying(512)", maxLength: 512, nullable: true), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpSecurityLogs", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpSessions", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + SessionId = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + Device = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + DeviceInfo = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + TenantId = table.Column(type: "uuid", nullable: true), + UserId = table.Column(type: "uuid", nullable: false), + ClientId = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + IpAddresses = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + SignedIn = table.Column(type: "timestamp without time zone", nullable: false), + LastAccessed = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpSessions", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpSettingDefinitions", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + DisplayName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + Description = table.Column(type: "character varying(512)", maxLength: 512, nullable: true), + DefaultValue = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: true), + IsVisibleToClients = table.Column(type: "boolean", nullable: false), + Providers = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: true), + IsInherited = table.Column(type: "boolean", nullable: false), + IsEncrypted = table.Column(type: "boolean", nullable: false), + ExtraProperties = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpSettingDefinitions", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpSettings", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + Value = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: false), + ProviderName = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + ProviderKey = table.Column(type: "character varying(64)", maxLength: 64, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpSettings", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpTenants", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + NormalizedName = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + EntityVersion = table.Column(type: "integer", nullable: false), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp without time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpTenants", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpUserDelegations", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + SourceUserId = table.Column(type: "uuid", nullable: false), + TargetUserId = table.Column(type: "uuid", nullable: false), + StartTime = table.Column(type: "timestamp without time zone", nullable: false), + EndTime = table.Column(type: "timestamp without time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserDelegations", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpUsers", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + UserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + NormalizedUserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + Name = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + Surname = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + Email = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + NormalizedEmail = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + EmailConfirmed = table.Column(type: "boolean", nullable: false, defaultValue: false), + PasswordHash = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + SecurityStamp = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + IsExternal = table.Column(type: "boolean", nullable: false, defaultValue: false), + PhoneNumber = table.Column(type: "character varying(16)", maxLength: 16, nullable: true), + PhoneNumberConfirmed = table.Column(type: "boolean", nullable: false, defaultValue: false), + IsActive = table.Column(type: "boolean", nullable: false), + TwoFactorEnabled = table.Column(type: "boolean", nullable: false, defaultValue: false), + LockoutEnd = table.Column(type: "timestamp with time zone", nullable: true), + LockoutEnabled = table.Column(type: "boolean", nullable: false, defaultValue: false), + AccessFailedCount = table.Column(type: "integer", nullable: false, defaultValue: 0), + ShouldChangePasswordOnNextLogin = table.Column(type: "boolean", nullable: false), + EntityVersion = table.Column(type: "integer", nullable: false), + LastPasswordChangeTime = table.Column(type: "timestamp with time zone", nullable: true), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp without time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUsers", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "OpenIddictApplications", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + ApplicationType = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), + ClientId = table.Column(type: "character varying(100)", maxLength: 100, nullable: true), + ClientSecret = table.Column(type: "text", nullable: true), + ClientType = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), + ConsentType = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), + DisplayName = table.Column(type: "text", nullable: true), + DisplayNames = table.Column(type: "text", nullable: true), + JsonWebKeySet = table.Column(type: "text", nullable: true), + Permissions = table.Column(type: "text", nullable: true), + PostLogoutRedirectUris = table.Column(type: "text", nullable: true), + Properties = table.Column(type: "text", nullable: true), + RedirectUris = table.Column(type: "text", nullable: true), + Requirements = table.Column(type: "text", nullable: true), + Settings = table.Column(type: "text", nullable: true), + ClientUri = table.Column(type: "text", nullable: true), + LogoUri = table.Column(type: "text", nullable: true), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp without time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_OpenIddictApplications", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "OpenIddictScopes", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Description = table.Column(type: "text", nullable: true), + Descriptions = table.Column(type: "text", nullable: true), + DisplayName = table.Column(type: "text", nullable: true), + DisplayNames = table.Column(type: "text", nullable: true), + Name = table.Column(type: "character varying(200)", maxLength: 200, nullable: true), + Properties = table.Column(type: "text", nullable: true), + Resources = table.Column(type: "text", nullable: true), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp without time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_OpenIddictScopes", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpAuditLogActions", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + AuditLogId = table.Column(type: "uuid", nullable: false), + ServiceName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + MethodName = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + Parameters = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: true), + ExecutionTime = table.Column(type: "timestamp without time zone", nullable: false), + ExecutionDuration = table.Column(type: "integer", nullable: false), + ExtraProperties = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpAuditLogActions", x => x.Id); + table.ForeignKey( + name: "FK_AbpAuditLogActions_AbpAuditLogs_AuditLogId", + column: x => x.AuditLogId, + principalTable: "AbpAuditLogs", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpEntityChanges", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + AuditLogId = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + ChangeTime = table.Column(type: "timestamp without time zone", nullable: false), + ChangeType = table.Column(type: "smallint", nullable: false), + EntityTenantId = table.Column(type: "uuid", nullable: true), + EntityId = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + EntityTypeFullName = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + ExtraProperties = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpEntityChanges", x => x.Id); + table.ForeignKey( + name: "FK_AbpEntityChanges_AbpAuditLogs_AuditLogId", + column: x => x.AuditLogId, + principalTable: "AbpAuditLogs", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpOrganizationUnitRoles", + columns: table => new + { + RoleId = table.Column(type: "uuid", nullable: false), + OrganizationUnitId = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpOrganizationUnitRoles", x => new { x.OrganizationUnitId, x.RoleId }); + table.ForeignKey( + name: "FK_AbpOrganizationUnitRoles_AbpOrganizationUnits_OrganizationU~", + column: x => x.OrganizationUnitId, + principalTable: "AbpOrganizationUnits", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_AbpOrganizationUnitRoles_AbpRoles_RoleId", + column: x => x.RoleId, + principalTable: "AbpRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpRoleClaims", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + RoleId = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + ClaimType = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + ClaimValue = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpRoleClaims", x => x.Id); + table.ForeignKey( + name: "FK_AbpRoleClaims_AbpRoles_RoleId", + column: x => x.RoleId, + principalTable: "AbpRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpTenantConnectionStrings", + columns: table => new + { + TenantId = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + Value = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpTenantConnectionStrings", x => new { x.TenantId, x.Name }); + table.ForeignKey( + name: "FK_AbpTenantConnectionStrings_AbpTenants_TenantId", + column: x => x.TenantId, + principalTable: "AbpTenants", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserClaims", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + UserId = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + ClaimType = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + ClaimValue = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserClaims", x => x.Id); + table.ForeignKey( + name: "FK_AbpUserClaims_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserLogins", + columns: table => new + { + UserId = table.Column(type: "uuid", nullable: false), + LoginProvider = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + ProviderKey = table.Column(type: "character varying(196)", maxLength: 196, nullable: false), + ProviderDisplayName = table.Column(type: "character varying(128)", maxLength: 128, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserLogins", x => new { x.UserId, x.LoginProvider }); + table.ForeignKey( + name: "FK_AbpUserLogins_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserOrganizationUnits", + columns: table => new + { + UserId = table.Column(type: "uuid", nullable: false), + OrganizationUnitId = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserOrganizationUnits", x => new { x.OrganizationUnitId, x.UserId }); + table.ForeignKey( + name: "FK_AbpUserOrganizationUnits_AbpOrganizationUnits_OrganizationU~", + column: x => x.OrganizationUnitId, + principalTable: "AbpOrganizationUnits", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_AbpUserOrganizationUnits_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserRoles", + columns: table => new + { + UserId = table.Column(type: "uuid", nullable: false), + RoleId = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserRoles", x => new { x.UserId, x.RoleId }); + table.ForeignKey( + name: "FK_AbpUserRoles_AbpRoles_RoleId", + column: x => x.RoleId, + principalTable: "AbpRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_AbpUserRoles_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserTokens", + columns: table => new + { + UserId = table.Column(type: "uuid", nullable: false), + LoginProvider = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + Value = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); + table.ForeignKey( + name: "FK_AbpUserTokens_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "OpenIddictAuthorizations", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + ApplicationId = table.Column(type: "uuid", nullable: true), + CreationDate = table.Column(type: "timestamp without time zone", nullable: true), + Properties = table.Column(type: "text", nullable: true), + Scopes = table.Column(type: "text", nullable: true), + Status = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), + Subject = table.Column(type: "character varying(400)", maxLength: 400, nullable: true), + Type = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp without time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_OpenIddictAuthorizations", x => x.Id); + table.ForeignKey( + name: "FK_OpenIddictAuthorizations_OpenIddictApplications_Application~", + column: x => x.ApplicationId, + principalTable: "OpenIddictApplications", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "AbpEntityPropertyChanges", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + EntityChangeId = table.Column(type: "uuid", nullable: false), + NewValue = table.Column(type: "character varying(512)", maxLength: 512, nullable: true), + OriginalValue = table.Column(type: "character varying(512)", maxLength: 512, nullable: true), + PropertyName = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + PropertyTypeFullName = table.Column(type: "character varying(64)", maxLength: 64, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpEntityPropertyChanges", x => x.Id); + table.ForeignKey( + name: "FK_AbpEntityPropertyChanges_AbpEntityChanges_EntityChangeId", + column: x => x.EntityChangeId, + principalTable: "AbpEntityChanges", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "OpenIddictTokens", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + ApplicationId = table.Column(type: "uuid", nullable: true), + AuthorizationId = table.Column(type: "uuid", nullable: true), + CreationDate = table.Column(type: "timestamp without time zone", nullable: true), + ExpirationDate = table.Column(type: "timestamp without time zone", nullable: true), + Payload = table.Column(type: "text", nullable: true), + Properties = table.Column(type: "text", nullable: true), + RedemptionDate = table.Column(type: "timestamp without time zone", nullable: true), + ReferenceId = table.Column(type: "character varying(100)", maxLength: 100, nullable: true), + Status = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), + Subject = table.Column(type: "character varying(400)", maxLength: 400, nullable: true), + Type = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp without time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_OpenIddictTokens", x => x.Id); + table.ForeignKey( + name: "FK_OpenIddictTokens_OpenIddictApplications_ApplicationId", + column: x => x.ApplicationId, + principalTable: "OpenIddictApplications", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_OpenIddictTokens_OpenIddictAuthorizations_AuthorizationId", + column: x => x.AuthorizationId, + principalTable: "OpenIddictAuthorizations", + principalColumn: "Id"); + }); + + migrationBuilder.CreateIndex( + name: "IX_AbpAuditLogActions_AuditLogId", + table: "AbpAuditLogActions", + column: "AuditLogId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpAuditLogActions_TenantId_ServiceName_MethodName_Executio~", + table: "AbpAuditLogActions", + columns: new[] { "TenantId", "ServiceName", "MethodName", "ExecutionTime" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpAuditLogs_TenantId_ExecutionTime", + table: "AbpAuditLogs", + columns: new[] { "TenantId", "ExecutionTime" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpAuditLogs_TenantId_UserId_ExecutionTime", + table: "AbpAuditLogs", + columns: new[] { "TenantId", "UserId", "ExecutionTime" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpBackgroundJobs_IsAbandoned_NextTryTime", + table: "AbpBackgroundJobs", + columns: new[] { "IsAbandoned", "NextTryTime" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpEntityChanges_AuditLogId", + table: "AbpEntityChanges", + column: "AuditLogId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpEntityChanges_TenantId_EntityTypeFullName_EntityId", + table: "AbpEntityChanges", + columns: new[] { "TenantId", "EntityTypeFullName", "EntityId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpEntityPropertyChanges_EntityChangeId", + table: "AbpEntityPropertyChanges", + column: "EntityChangeId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatureGroups_Name", + table: "AbpFeatureGroups", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatures_GroupName", + table: "AbpFeatures", + column: "GroupName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatures_Name", + table: "AbpFeatures", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatureValues_Name_ProviderName_ProviderKey", + table: "AbpFeatureValues", + columns: new[] { "Name", "ProviderName", "ProviderKey" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpLinkUsers_SourceUserId_SourceTenantId_TargetUserId_Targe~", + table: "AbpLinkUsers", + columns: new[] { "SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpOrganizationUnitRoles_RoleId_OrganizationUnitId", + table: "AbpOrganizationUnitRoles", + columns: new[] { "RoleId", "OrganizationUnitId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpOrganizationUnits_Code", + table: "AbpOrganizationUnits", + column: "Code"); + + migrationBuilder.CreateIndex( + name: "IX_AbpOrganizationUnits_ParentId", + table: "AbpOrganizationUnits", + column: "ParentId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissionGrants_TenantId_Name_ProviderName_ProviderKey", + table: "AbpPermissionGrants", + columns: new[] { "TenantId", "Name", "ProviderName", "ProviderKey" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissionGroups_Name", + table: "AbpPermissionGroups", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissions_GroupName", + table: "AbpPermissions", + column: "GroupName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissions_Name", + table: "AbpPermissions", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpRoleClaims_RoleId", + table: "AbpRoleClaims", + column: "RoleId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpRoles_NormalizedName", + table: "AbpRoles", + column: "NormalizedName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpSecurityLogs_TenantId_Action", + table: "AbpSecurityLogs", + columns: new[] { "TenantId", "Action" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpSecurityLogs_TenantId_ApplicationName", + table: "AbpSecurityLogs", + columns: new[] { "TenantId", "ApplicationName" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpSecurityLogs_TenantId_Identity", + table: "AbpSecurityLogs", + columns: new[] { "TenantId", "Identity" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpSecurityLogs_TenantId_UserId", + table: "AbpSecurityLogs", + columns: new[] { "TenantId", "UserId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpSessions_Device", + table: "AbpSessions", + column: "Device"); + + migrationBuilder.CreateIndex( + name: "IX_AbpSessions_SessionId", + table: "AbpSessions", + column: "SessionId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpSessions_TenantId_UserId", + table: "AbpSessions", + columns: new[] { "TenantId", "UserId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpSettingDefinitions_Name", + table: "AbpSettingDefinitions", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpSettings_Name_ProviderName_ProviderKey", + table: "AbpSettings", + columns: new[] { "Name", "ProviderName", "ProviderKey" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpTenants_Name", + table: "AbpTenants", + column: "Name"); + + migrationBuilder.CreateIndex( + name: "IX_AbpTenants_NormalizedName", + table: "AbpTenants", + column: "NormalizedName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUserClaims_UserId", + table: "AbpUserClaims", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUserLogins_LoginProvider_ProviderKey", + table: "AbpUserLogins", + columns: new[] { "LoginProvider", "ProviderKey" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpUserOrganizationUnits_UserId_OrganizationUnitId", + table: "AbpUserOrganizationUnits", + columns: new[] { "UserId", "OrganizationUnitId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpUserRoles_RoleId_UserId", + table: "AbpUserRoles", + columns: new[] { "RoleId", "UserId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_Email", + table: "AbpUsers", + column: "Email"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_NormalizedEmail", + table: "AbpUsers", + column: "NormalizedEmail"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_NormalizedUserName", + table: "AbpUsers", + column: "NormalizedUserName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_UserName", + table: "AbpUsers", + column: "UserName"); + + migrationBuilder.CreateIndex( + name: "IX_OpenIddictApplications_ClientId", + table: "OpenIddictApplications", + column: "ClientId"); + + migrationBuilder.CreateIndex( + name: "IX_OpenIddictAuthorizations_ApplicationId_Status_Subject_Type", + table: "OpenIddictAuthorizations", + columns: new[] { "ApplicationId", "Status", "Subject", "Type" }); + + migrationBuilder.CreateIndex( + name: "IX_OpenIddictScopes_Name", + table: "OpenIddictScopes", + column: "Name"); + + migrationBuilder.CreateIndex( + name: "IX_OpenIddictTokens_ApplicationId_Status_Subject_Type", + table: "OpenIddictTokens", + columns: new[] { "ApplicationId", "Status", "Subject", "Type" }); + + migrationBuilder.CreateIndex( + name: "IX_OpenIddictTokens_AuthorizationId", + table: "OpenIddictTokens", + column: "AuthorizationId"); + + migrationBuilder.CreateIndex( + name: "IX_OpenIddictTokens_ReferenceId", + table: "OpenIddictTokens", + column: "ReferenceId"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AbpAuditLogActions"); + + migrationBuilder.DropTable( + name: "AbpBackgroundJobs"); + + migrationBuilder.DropTable( + name: "AbpClaimTypes"); + + migrationBuilder.DropTable( + name: "AbpEntityPropertyChanges"); + + migrationBuilder.DropTable( + name: "AbpFeatureGroups"); + + migrationBuilder.DropTable( + name: "AbpFeatures"); + + migrationBuilder.DropTable( + name: "AbpFeatureValues"); + + migrationBuilder.DropTable( + name: "AbpLinkUsers"); + + migrationBuilder.DropTable( + name: "AbpOrganizationUnitRoles"); + + migrationBuilder.DropTable( + name: "AbpPermissionGrants"); + + migrationBuilder.DropTable( + name: "AbpPermissionGroups"); + + migrationBuilder.DropTable( + name: "AbpPermissions"); + + migrationBuilder.DropTable( + name: "AbpRoleClaims"); + + migrationBuilder.DropTable( + name: "AbpSecurityLogs"); + + migrationBuilder.DropTable( + name: "AbpSessions"); + + migrationBuilder.DropTable( + name: "AbpSettingDefinitions"); + + migrationBuilder.DropTable( + name: "AbpSettings"); + + migrationBuilder.DropTable( + name: "AbpTenantConnectionStrings"); + + migrationBuilder.DropTable( + name: "AbpUserClaims"); + + migrationBuilder.DropTable( + name: "AbpUserDelegations"); + + migrationBuilder.DropTable( + name: "AbpUserLogins"); + + migrationBuilder.DropTable( + name: "AbpUserOrganizationUnits"); + + migrationBuilder.DropTable( + name: "AbpUserRoles"); + + migrationBuilder.DropTable( + name: "AbpUserTokens"); + + migrationBuilder.DropTable( + name: "OpenIddictScopes"); + + migrationBuilder.DropTable( + name: "OpenIddictTokens"); + + migrationBuilder.DropTable( + name: "AbpEntityChanges"); + + migrationBuilder.DropTable( + name: "AbpTenants"); + + migrationBuilder.DropTable( + name: "AbpOrganizationUnits"); + + migrationBuilder.DropTable( + name: "AbpRoles"); + + migrationBuilder.DropTable( + name: "AbpUsers"); + + migrationBuilder.DropTable( + name: "OpenIddictAuthorizations"); + + migrationBuilder.DropTable( + name: "AbpAuditLogs"); + + migrationBuilder.DropTable( + name: "OpenIddictApplications"); + } + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.EntityFrameworkCore/Migrations/DispatchDbContextModelSnapshot.cs b/modules/dispatch/src/KonSoft.Dispatch.EntityFrameworkCore/Migrations/DispatchDbContextModelSnapshot.cs new file mode 100644 index 0000000..c679511 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.EntityFrameworkCore/Migrations/DispatchDbContextModelSnapshot.cs @@ -0,0 +1,2003 @@ +// +using System; +using KonSoft.Dispatch.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace KonSoft.Dispatch.Migrations +{ + [DbContext(typeof(DispatchDbContext))] + partial class DispatchDbContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.PostgreSql) + .HasAnnotation("ProductVersion", "8.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("character varying(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("text"); + + b.Property("ExecutionDuration") + .HasColumnType("integer") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("timestamp without time zone"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("integer") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("uuid") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("uuid") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("uuid") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AuditLogId") + .HasColumnType("uuid") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("integer") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AuditLogId") + .HasColumnType("uuid") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("smallint") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("uuid"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("EntityChangeId") + .HasColumnType("uuid"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("character varying(1048576)"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("LastTryTime") + .HasColumnType("timestamp without time zone"); + + b.Property("NextTryTime") + .HasColumnType("timestamp without time zone"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("boolean"); + + b.Property("IsVisibleToClients") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("Required") + .HasColumnType("boolean"); + + b.Property("ValueType") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("SourceTenantId") + .HasColumnType("uuid"); + + b.Property("SourceUserId") + .HasColumnType("uuid"); + + b.Property("TargetTenantId") + .HasColumnType("uuid"); + + b.Property("TargetUserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("boolean") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("boolean") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("boolean") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("character varying(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("character varying(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("character varying(96)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySession", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Device") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("DeviceInfo") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("IpAddresses") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("LastAccessed") + .HasColumnType("timestamp without time zone"); + + b.Property("SessionId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("SignedIn") + .HasColumnType("timestamp without time zone"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("Device"); + + b.HasIndex("SessionId"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSessions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("boolean") + .HasColumnName("IsActive"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("LastPasswordChangeTime") + .HasColumnType("timestamp with time zone"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("SecurityStamp"); + + b.Property("ShouldChangePasswordOnNextLogin") + .HasColumnType("boolean"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserDelegation", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("EndTime") + .HasColumnType("timestamp without time zone"); + + b.Property("SourceUserId") + .HasColumnType("uuid"); + + b.Property("StartTime") + .HasColumnType("timestamp without time zone"); + + b.Property("TargetUserId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AbpUserDelegations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("character varying(196)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uuid"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("character varying(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("DisplayName"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uuid"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("ClientId") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("ClientSecret") + .HasColumnType("text"); + + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("ClientUri") + .HasColumnType("text"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .HasColumnType("text"); + + b.Property("DisplayNames") + .HasColumnType("text"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("JsonWebKeySet") + .HasColumnType("text"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasColumnType("text"); + + b.Property("Permissions") + .HasColumnType("text"); + + b.Property("PostLogoutRedirectUris") + .HasColumnType("text"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("RedirectUris") + .HasColumnType("text"); + + b.Property("Requirements") + .HasColumnType("text"); + + b.Property("Settings") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("OpenIddictApplications", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationId") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("timestamp without time zone"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("Scopes") + .HasColumnType("text"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("character varying(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictAuthorizations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Scopes.OpenIddictScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Descriptions") + .HasColumnType("text"); + + b.Property("DisplayName") + .HasColumnType("text"); + + b.Property("DisplayNames") + .HasColumnType("text"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("Resources") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("OpenIddictScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationId") + .HasColumnType("uuid"); + + b.Property("AuthorizationId") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("timestamp without time zone"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("ExpirationDate") + .HasColumnType("timestamp without time zone"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Payload") + .HasColumnType("text"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("RedemptionDate") + .HasColumnType("timestamp without time zone"); + + b.Property("ReferenceId") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("character varying(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.HasKey("Id"); + + b.HasIndex("AuthorizationId"); + + b.HasIndex("ReferenceId"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("IsEnabled") + .HasColumnType("boolean"); + + b.Property("MultiTenancySide") + .HasColumnType("smallint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.SettingDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DefaultValue") + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.Property("Description") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsEncrypted") + .HasColumnType("boolean"); + + b.Property("IsInherited") + .HasColumnType("boolean"); + + b.Property("IsVisibleToClients") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("Providers") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpSettingDefinitions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("uuid"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + + b.HasOne("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", null) + .WithMany() + .HasForeignKey("AuthorizationId"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.EntityFrameworkCore/Properties/AssemblyInfo.cs b/modules/dispatch/src/KonSoft.Dispatch.EntityFrameworkCore/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..b9f7b48 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.EntityFrameworkCore/Properties/AssemblyInfo.cs @@ -0,0 +1,2 @@ +using System.Runtime.CompilerServices; +[assembly:InternalsVisibleToAttribute("KonSoft.Dispatch.EntityFrameworkCore.Tests")] diff --git a/modules/dispatch/src/KonSoft.Dispatch.HttpApi.Client/DispatchHttpApiClientModule.cs b/modules/dispatch/src/KonSoft.Dispatch.HttpApi.Client/DispatchHttpApiClientModule.cs new file mode 100644 index 0000000..f91692b --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.HttpApi.Client/DispatchHttpApiClientModule.cs @@ -0,0 +1,38 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Account; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; +using Volo.Abp.PermissionManagement; +using Volo.Abp.TenantManagement; +using Volo.Abp.SettingManagement; +using Volo.Abp.VirtualFileSystem; + +namespace KonSoft.Dispatch; + +[DependsOn( + typeof(DispatchApplicationContractsModule), + typeof(AbpAccountHttpApiClientModule), + typeof(AbpIdentityHttpApiClientModule), + typeof(AbpPermissionManagementHttpApiClientModule), + typeof(AbpTenantManagementHttpApiClientModule), + typeof(AbpFeatureManagementHttpApiClientModule), + typeof(AbpSettingManagementHttpApiClientModule) +)] +public class DispatchHttpApiClientModule : AbpModule +{ + public const string RemoteServiceName = "Default"; + + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddHttpClientProxies( + typeof(DispatchApplicationContractsModule).Assembly, + RemoteServiceName + ); + + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.HttpApi.Client/KonSoft.Dispatch.HttpApi.Client.csproj b/modules/dispatch/src/KonSoft.Dispatch.HttpApi.Client/KonSoft.Dispatch.HttpApi.Client.csproj new file mode 100644 index 0000000..08a8461 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.HttpApi.Client/KonSoft.Dispatch.HttpApi.Client.csproj @@ -0,0 +1,29 @@ + + + + + + net8.0 + enable + KonSoft.Dispatch + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/dispatch/src/KonSoft.Dispatch.HttpApi/Controllers/DispatchController.cs b/modules/dispatch/src/KonSoft.Dispatch.HttpApi/Controllers/DispatchController.cs new file mode 100644 index 0000000..a1cea3d --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.HttpApi/Controllers/DispatchController.cs @@ -0,0 +1,14 @@ +using KonSoft.Dispatch.Localization; +using Volo.Abp.AspNetCore.Mvc; + +namespace KonSoft.Dispatch.Controllers; + +/* Inherit your controllers from this class. + */ +public abstract class DispatchController : AbpControllerBase +{ + protected DispatchController() + { + LocalizationResource = typeof(DispatchResource); + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.HttpApi/DispatchHttpApiModule.cs b/modules/dispatch/src/KonSoft.Dispatch.HttpApi/DispatchHttpApiModule.cs new file mode 100644 index 0000000..c5bf83b --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.HttpApi/DispatchHttpApiModule.cs @@ -0,0 +1,41 @@ +using Localization.Resources.AbpUi; +using KonSoft.Dispatch.Localization; +using Volo.Abp.Account; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Volo.Abp.PermissionManagement.HttpApi; +using Volo.Abp.SettingManagement; +using Volo.Abp.TenantManagement; + +namespace KonSoft.Dispatch; + +[DependsOn( + typeof(DispatchApplicationContractsModule), + typeof(AbpAccountHttpApiModule), + typeof(AbpIdentityHttpApiModule), + typeof(AbpPermissionManagementHttpApiModule), + typeof(AbpTenantManagementHttpApiModule), + typeof(AbpFeatureManagementHttpApiModule), + typeof(AbpSettingManagementHttpApiModule) + )] +public class DispatchHttpApiModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + ConfigureLocalization(); + } + + private void ConfigureLocalization() + { + Configure(options => + { + options.Resources + .Get() + .AddBaseTypes( + typeof(AbpUiResource) + ); + }); + } +} diff --git a/modules/dispatch/src/KonSoft.Dispatch.HttpApi/KonSoft.Dispatch.HttpApi.csproj b/modules/dispatch/src/KonSoft.Dispatch.HttpApi/KonSoft.Dispatch.HttpApi.csproj new file mode 100644 index 0000000..0d821e0 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.HttpApi/KonSoft.Dispatch.HttpApi.csproj @@ -0,0 +1,24 @@ + + + + + + net8.0 + enable + KonSoft.Dispatch + + + + + + + + + + + + + + + + diff --git a/modules/dispatch/src/KonSoft.Dispatch.HttpApi/Models/Test/TestModel.cs b/modules/dispatch/src/KonSoft.Dispatch.HttpApi/Models/Test/TestModel.cs new file mode 100644 index 0000000..7da0622 --- /dev/null +++ b/modules/dispatch/src/KonSoft.Dispatch.HttpApi/Models/Test/TestModel.cs @@ -0,0 +1,10 @@ +using System; + +namespace KonSoft.Dispatch.Models.Test; + +public class TestModel +{ + public string? Name { get; set; } + + public DateTime BirthDate { get; set; } +} diff --git a/modules/dispatch/test/KonSoft.Dispatch.Application.Tests/DispatchApplicationTestBase.cs b/modules/dispatch/test/KonSoft.Dispatch.Application.Tests/DispatchApplicationTestBase.cs new file mode 100644 index 0000000..3638395 --- /dev/null +++ b/modules/dispatch/test/KonSoft.Dispatch.Application.Tests/DispatchApplicationTestBase.cs @@ -0,0 +1,9 @@ +using Volo.Abp.Modularity; + +namespace KonSoft.Dispatch; + +public abstract class DispatchApplicationTestBase : DispatchTestBase + where TStartupModule : IAbpModule +{ + +} diff --git a/modules/dispatch/test/KonSoft.Dispatch.Application.Tests/DispatchApplicationTestModule.cs b/modules/dispatch/test/KonSoft.Dispatch.Application.Tests/DispatchApplicationTestModule.cs new file mode 100644 index 0000000..a2e8f91 --- /dev/null +++ b/modules/dispatch/test/KonSoft.Dispatch.Application.Tests/DispatchApplicationTestModule.cs @@ -0,0 +1,12 @@ +using Volo.Abp.Modularity; + +namespace KonSoft.Dispatch; + +[DependsOn( + typeof(DispatchApplicationModule), + typeof(DispatchDomainTestModule) +)] +public class DispatchApplicationTestModule : AbpModule +{ + +} diff --git a/modules/dispatch/test/KonSoft.Dispatch.Application.Tests/KonSoft.Dispatch.Application.Tests.csproj b/modules/dispatch/test/KonSoft.Dispatch.Application.Tests/KonSoft.Dispatch.Application.Tests.csproj new file mode 100644 index 0000000..6218618 --- /dev/null +++ b/modules/dispatch/test/KonSoft.Dispatch.Application.Tests/KonSoft.Dispatch.Application.Tests.csproj @@ -0,0 +1,20 @@ + + + + + + net8.0 + enable + KonSoft.Dispatch + + + + + + + + + + + + diff --git a/modules/dispatch/test/KonSoft.Dispatch.Application.Tests/Samples/SampleAppServiceTests.cs b/modules/dispatch/test/KonSoft.Dispatch.Application.Tests/Samples/SampleAppServiceTests.cs new file mode 100644 index 0000000..51703b8 --- /dev/null +++ b/modules/dispatch/test/KonSoft.Dispatch.Application.Tests/Samples/SampleAppServiceTests.cs @@ -0,0 +1,34 @@ +using Shouldly; +using System.Threading.Tasks; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; +using Xunit; + +namespace KonSoft.Dispatch.Samples; + +/* This is just an example test class. + * Normally, you don't test code of the modules you are using + * (like IIdentityUserAppService here). + * Only test your own application services. + */ +public abstract class SampleAppServiceTests : DispatchApplicationTestBase + where TStartupModule : IAbpModule +{ + private readonly IIdentityUserAppService _userAppService; + + protected SampleAppServiceTests() + { + _userAppService = GetRequiredService(); + } + + [Fact] + public async Task Initial_Data_Should_Contain_Admin_User() + { + //Act + var result = await _userAppService.GetListAsync(new GetIdentityUsersInput()); + + //Assert + result.TotalCount.ShouldBeGreaterThan(0); + result.Items.ShouldContain(u => u.UserName == "admin"); + } +} diff --git a/modules/dispatch/test/KonSoft.Dispatch.Domain.Tests/DispatchDomainTestBase.cs b/modules/dispatch/test/KonSoft.Dispatch.Domain.Tests/DispatchDomainTestBase.cs new file mode 100644 index 0000000..c0e94f5 --- /dev/null +++ b/modules/dispatch/test/KonSoft.Dispatch.Domain.Tests/DispatchDomainTestBase.cs @@ -0,0 +1,10 @@ +using Volo.Abp.Modularity; + +namespace KonSoft.Dispatch; + +/* Inherit from this class for your domain layer tests. */ +public abstract class DispatchDomainTestBase : DispatchTestBase + where TStartupModule : IAbpModule +{ + +} diff --git a/modules/dispatch/test/KonSoft.Dispatch.Domain.Tests/DispatchDomainTestModule.cs b/modules/dispatch/test/KonSoft.Dispatch.Domain.Tests/DispatchDomainTestModule.cs new file mode 100644 index 0000000..c28f7b8 --- /dev/null +++ b/modules/dispatch/test/KonSoft.Dispatch.Domain.Tests/DispatchDomainTestModule.cs @@ -0,0 +1,12 @@ +using Volo.Abp.Modularity; + +namespace KonSoft.Dispatch; + +[DependsOn( + typeof(DispatchDomainModule), + typeof(DispatchTestBaseModule) +)] +public class DispatchDomainTestModule : AbpModule +{ + +} diff --git a/modules/dispatch/test/KonSoft.Dispatch.Domain.Tests/KonSoft.Dispatch.Domain.Tests.csproj b/modules/dispatch/test/KonSoft.Dispatch.Domain.Tests/KonSoft.Dispatch.Domain.Tests.csproj new file mode 100644 index 0000000..2df7195 --- /dev/null +++ b/modules/dispatch/test/KonSoft.Dispatch.Domain.Tests/KonSoft.Dispatch.Domain.Tests.csproj @@ -0,0 +1,20 @@ + + + + + + net8.0 + enable + KonSoft.Dispatch + + + + + + + + + + + + diff --git a/modules/dispatch/test/KonSoft.Dispatch.Domain.Tests/Samples/SampleDomainTests.cs b/modules/dispatch/test/KonSoft.Dispatch.Domain.Tests/Samples/SampleDomainTests.cs new file mode 100644 index 0000000..a56788e --- /dev/null +++ b/modules/dispatch/test/KonSoft.Dispatch.Domain.Tests/Samples/SampleDomainTests.cs @@ -0,0 +1,46 @@ +using System.Threading.Tasks; +using Shouldly; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; +using Xunit; + +namespace KonSoft.Dispatch.Samples; + +/* This is just an example test class. + * Normally, you don't test code of the modules you are using + * (like IdentityUserManager here). + * Only test your own domain services. + */ +public abstract class SampleDomainTests : DispatchDomainTestBase + where TStartupModule : IAbpModule +{ + private readonly IIdentityUserRepository _identityUserRepository; + private readonly IdentityUserManager _identityUserManager; + + protected SampleDomainTests() + { + _identityUserRepository = GetRequiredService(); + _identityUserManager = GetRequiredService(); + } + + [Fact] + public async Task Should_Set_Email_Of_A_User() + { + IdentityUser adminUser; + + /* Need to manually start Unit Of Work because + * FirstOrDefaultAsync should be executed while db connection / context is available. + */ + await WithUnitOfWorkAsync(async () => + { + adminUser = await _identityUserRepository + .FindByNormalizedUserNameAsync("ADMIN"); + + await _identityUserManager.SetEmailAsync(adminUser, "newemail@abp.io"); + await _identityUserRepository.UpdateAsync(adminUser); + }); + + adminUser = await _identityUserRepository.FindByNormalizedUserNameAsync("ADMIN"); + adminUser.Email.ShouldBe("newemail@abp.io"); + } +} diff --git a/modules/dispatch/test/KonSoft.Dispatch.EntityFrameworkCore.Tests/EntityFrameworkCore/Applications/EfCoreSampleAppServiceTests.cs b/modules/dispatch/test/KonSoft.Dispatch.EntityFrameworkCore.Tests/EntityFrameworkCore/Applications/EfCoreSampleAppServiceTests.cs new file mode 100644 index 0000000..1b831fc --- /dev/null +++ b/modules/dispatch/test/KonSoft.Dispatch.EntityFrameworkCore.Tests/EntityFrameworkCore/Applications/EfCoreSampleAppServiceTests.cs @@ -0,0 +1,10 @@ +using KonSoft.Dispatch.Samples; +using Xunit; + +namespace KonSoft.Dispatch.EntityFrameworkCore.Applications; + +[Collection(DispatchTestConsts.CollectionDefinitionName)] +public class EfCoreSampleAppServiceTests : SampleAppServiceTests +{ + +} diff --git a/modules/dispatch/test/KonSoft.Dispatch.EntityFrameworkCore.Tests/EntityFrameworkCore/DispatchEntityFrameworkCoreCollection.cs b/modules/dispatch/test/KonSoft.Dispatch.EntityFrameworkCore.Tests/EntityFrameworkCore/DispatchEntityFrameworkCoreCollection.cs new file mode 100644 index 0000000..a2578dd --- /dev/null +++ b/modules/dispatch/test/KonSoft.Dispatch.EntityFrameworkCore.Tests/EntityFrameworkCore/DispatchEntityFrameworkCoreCollection.cs @@ -0,0 +1,9 @@ +using Xunit; + +namespace KonSoft.Dispatch.EntityFrameworkCore; + +[CollectionDefinition(DispatchTestConsts.CollectionDefinitionName)] +public class DispatchEntityFrameworkCoreCollection : ICollectionFixture +{ + +} diff --git a/modules/dispatch/test/KonSoft.Dispatch.EntityFrameworkCore.Tests/EntityFrameworkCore/DispatchEntityFrameworkCoreCollectionFixtureBase.cs b/modules/dispatch/test/KonSoft.Dispatch.EntityFrameworkCore.Tests/EntityFrameworkCore/DispatchEntityFrameworkCoreCollectionFixtureBase.cs new file mode 100644 index 0000000..0d37668 --- /dev/null +++ b/modules/dispatch/test/KonSoft.Dispatch.EntityFrameworkCore.Tests/EntityFrameworkCore/DispatchEntityFrameworkCoreCollectionFixtureBase.cs @@ -0,0 +1,9 @@ +using KonSoft.Dispatch.EntityFrameworkCore; +using Xunit; + +namespace KonSoft.Dispatch.EntityFrameworkCore; + +public class DispatchEntityFrameworkCoreCollectionFixtureBase : ICollectionFixture +{ + +} diff --git a/modules/dispatch/test/KonSoft.Dispatch.EntityFrameworkCore.Tests/EntityFrameworkCore/DispatchEntityFrameworkCoreFixture.cs b/modules/dispatch/test/KonSoft.Dispatch.EntityFrameworkCore.Tests/EntityFrameworkCore/DispatchEntityFrameworkCoreFixture.cs new file mode 100644 index 0000000..086b344 --- /dev/null +++ b/modules/dispatch/test/KonSoft.Dispatch.EntityFrameworkCore.Tests/EntityFrameworkCore/DispatchEntityFrameworkCoreFixture.cs @@ -0,0 +1,11 @@ +using System; + +namespace KonSoft.Dispatch.EntityFrameworkCore; + +public class DispatchEntityFrameworkCoreFixture : IDisposable +{ + public void Dispose() + { + + } +} diff --git a/modules/dispatch/test/KonSoft.Dispatch.EntityFrameworkCore.Tests/EntityFrameworkCore/DispatchEntityFrameworkCoreTestBase.cs b/modules/dispatch/test/KonSoft.Dispatch.EntityFrameworkCore.Tests/EntityFrameworkCore/DispatchEntityFrameworkCoreTestBase.cs new file mode 100644 index 0000000..989b941 --- /dev/null +++ b/modules/dispatch/test/KonSoft.Dispatch.EntityFrameworkCore.Tests/EntityFrameworkCore/DispatchEntityFrameworkCoreTestBase.cs @@ -0,0 +1,8 @@ +using Volo.Abp; + +namespace KonSoft.Dispatch.EntityFrameworkCore; + +public abstract class DispatchEntityFrameworkCoreTestBase : DispatchTestBase +{ + +} diff --git a/modules/dispatch/test/KonSoft.Dispatch.EntityFrameworkCore.Tests/EntityFrameworkCore/DispatchEntityFrameworkCoreTestModule.cs b/modules/dispatch/test/KonSoft.Dispatch.EntityFrameworkCore.Tests/EntityFrameworkCore/DispatchEntityFrameworkCoreTestModule.cs new file mode 100644 index 0000000..f6517d9 --- /dev/null +++ b/modules/dispatch/test/KonSoft.Dispatch.EntityFrameworkCore.Tests/EntityFrameworkCore/DispatchEntityFrameworkCoreTestModule.cs @@ -0,0 +1,82 @@ +using Microsoft.Data.Sqlite; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.Sqlite; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Modularity; +using Volo.Abp.PermissionManagement; +using Volo.Abp.SettingManagement; +using Volo.Abp.Uow; + +namespace KonSoft.Dispatch.EntityFrameworkCore; + +[DependsOn( + typeof(DispatchApplicationTestModule), + typeof(DispatchEntityFrameworkCoreModule), + typeof(AbpEntityFrameworkCoreSqliteModule) + )] +public class DispatchEntityFrameworkCoreTestModule : AbpModule +{ + private SqliteConnection? _sqliteConnection; + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.SaveStaticFeaturesToDatabase = false; + options.IsDynamicFeatureStoreEnabled = false; + }); + Configure(options => + { + options.SaveStaticPermissionsToDatabase = false; + options.IsDynamicPermissionStoreEnabled = false; + }); + Configure(options => + { + options.SaveStaticSettingsToDatabase = false; + options.IsDynamicSettingStoreEnabled = false; + }); + context.Services.AddAlwaysDisableUnitOfWorkTransaction(); + + ConfigureInMemorySqlite(context.Services); + } + + private void ConfigureInMemorySqlite(IServiceCollection services) + { + _sqliteConnection = CreateDatabaseAndGetConnection(); + + services.Configure(options => + { + options.Configure(context => + { + context.DbContextOptions.UseSqlite(_sqliteConnection); + }); + }); + } + + public override void OnApplicationShutdown(ApplicationShutdownContext context) + { + _sqliteConnection?.Dispose(); + } + + private static SqliteConnection CreateDatabaseAndGetConnection() + { + var connection = new AbpUnitTestSqliteConnection("Data Source=:memory:"); + connection.Open(); + + var options = new DbContextOptionsBuilder() + .UseSqlite(connection) + .Options; + + using (var context = new DispatchDbContext(options)) + { + context.GetService().CreateTables(); + } + + return connection; + } +} diff --git a/modules/dispatch/test/KonSoft.Dispatch.EntityFrameworkCore.Tests/EntityFrameworkCore/Domains/EfCoreSampleDomainTests.cs b/modules/dispatch/test/KonSoft.Dispatch.EntityFrameworkCore.Tests/EntityFrameworkCore/Domains/EfCoreSampleDomainTests.cs new file mode 100644 index 0000000..3bad6ef --- /dev/null +++ b/modules/dispatch/test/KonSoft.Dispatch.EntityFrameworkCore.Tests/EntityFrameworkCore/Domains/EfCoreSampleDomainTests.cs @@ -0,0 +1,10 @@ +using KonSoft.Dispatch.Samples; +using Xunit; + +namespace KonSoft.Dispatch.EntityFrameworkCore.Domains; + +[Collection(DispatchTestConsts.CollectionDefinitionName)] +public class EfCoreSampleDomainTests : SampleDomainTests +{ + +} diff --git a/modules/dispatch/test/KonSoft.Dispatch.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepositoryTests.cs b/modules/dispatch/test/KonSoft.Dispatch.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepositoryTests.cs new file mode 100644 index 0000000..234cc69 --- /dev/null +++ b/modules/dispatch/test/KonSoft.Dispatch.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepositoryTests.cs @@ -0,0 +1,44 @@ +using Microsoft.EntityFrameworkCore; +using Shouldly; +using System; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp.Domain.Repositories; +using Volo.Abp.Identity; +using Xunit; + +namespace KonSoft.Dispatch.EntityFrameworkCore.Samples; + +/* This is just an example test class. + * Normally, you don't test ABP framework code + * (like default AppUser repository IRepository here). + * Only test your custom repository methods. + */ +[Collection(DispatchTestConsts.CollectionDefinitionName)] +public class SampleRepositoryTests : DispatchEntityFrameworkCoreTestBase +{ + private readonly IRepository _appUserRepository; + + public SampleRepositoryTests() + { + _appUserRepository = GetRequiredService>(); + } + + [Fact] + public async Task Should_Query_AppUser() + { + /* Need to manually start Unit Of Work because + * FirstOrDefaultAsync should be executed while db connection / context is available. + */ + await WithUnitOfWorkAsync(async () => + { + //Act + var adminUser = await (await _appUserRepository.GetQueryableAsync()) + .Where(u => u.UserName == "admin") + .FirstOrDefaultAsync(); + + //Assert + adminUser.ShouldNotBeNull(); + }); + } +} diff --git a/modules/dispatch/test/KonSoft.Dispatch.EntityFrameworkCore.Tests/KonSoft.Dispatch.EntityFrameworkCore.Tests.csproj b/modules/dispatch/test/KonSoft.Dispatch.EntityFrameworkCore.Tests/KonSoft.Dispatch.EntityFrameworkCore.Tests.csproj new file mode 100644 index 0000000..7fac87a --- /dev/null +++ b/modules/dispatch/test/KonSoft.Dispatch.EntityFrameworkCore.Tests/KonSoft.Dispatch.EntityFrameworkCore.Tests.csproj @@ -0,0 +1,21 @@ + + + + + + net8.0 + enable + KonSoft.Dispatch + + + + + + + + + + + + + diff --git a/modules/dispatch/test/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs b/modules/dispatch/test/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs new file mode 100644 index 0000000..636311e --- /dev/null +++ b/modules/dispatch/test/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs @@ -0,0 +1,25 @@ +using System; +using System.Threading.Tasks; +using Volo.Abp.Account; +using Volo.Abp.DependencyInjection; + +namespace KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp; + +public class ClientDemoService : ITransientDependency +{ + private readonly IProfileAppService _profileAppService; + + public ClientDemoService(IProfileAppService profileAppService) + { + _profileAppService = profileAppService; + } + + public async Task RunAsync() + { + var output = await _profileAppService.GetAsync(); + Console.WriteLine($"UserName : {output.UserName}"); + Console.WriteLine($"Email : {output.Email}"); + Console.WriteLine($"Name : {output.Name}"); + Console.WriteLine($"Surname : {output.Surname}"); + } +} diff --git a/modules/dispatch/test/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs b/modules/dispatch/test/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs new file mode 100644 index 0000000..6e81f80 --- /dev/null +++ b/modules/dispatch/test/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs @@ -0,0 +1,40 @@ +using Microsoft.Extensions.Hosting; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; + +namespace KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp; + +public class ConsoleTestAppHostedService : IHostedService +{ + private readonly IConfiguration _configuration; + + public ConsoleTestAppHostedService(IConfiguration configuration) + { + _configuration = configuration; + } + + public async Task StartAsync(CancellationToken cancellationToken) + { + using (var application = await AbpApplicationFactory.CreateAsync(options => + { + options.Services.ReplaceConfiguration(_configuration); + options.UseAutofac(); + })) + { + await application.InitializeAsync(); + + var demo = application.ServiceProvider.GetRequiredService(); + await demo.RunAsync(); + + await application.ShutdownAsync(); + } + } + + public Task StopAsync(CancellationToken cancellationToken) + { + return Task.CompletedTask; + } +} diff --git a/modules/dispatch/test/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp/DispatchConsoleApiClientModule.cs b/modules/dispatch/test/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp/DispatchConsoleApiClientModule.cs new file mode 100644 index 0000000..be6deb9 --- /dev/null +++ b/modules/dispatch/test/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp/DispatchConsoleApiClientModule.cs @@ -0,0 +1,30 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Polly; +using Volo.Abp.Autofac; +using Volo.Abp.Http.Client; +using Volo.Abp.Http.Client.IdentityModel; +using Volo.Abp.Modularity; + +namespace KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp; + +[DependsOn( + typeof(AbpAutofacModule), + typeof(DispatchHttpApiClientModule), + typeof(AbpHttpClientIdentityModelModule) + )] +public class DispatchConsoleApiClientModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PreConfigure(options => + { + options.ProxyClientBuildActions.Add((remoteServiceName, clientBuilder) => + { + clientBuilder.AddTransientHttpErrorPolicy( + policyBuilder => policyBuilder.WaitAndRetryAsync(3, i => TimeSpan.FromSeconds(Math.Pow(2, i))) + ); + }); + }); + } +} diff --git a/modules/dispatch/test/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp.csproj b/modules/dispatch/test/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp.csproj new file mode 100644 index 0000000..2182f74 --- /dev/null +++ b/modules/dispatch/test/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp.csproj @@ -0,0 +1,33 @@ + + + + Exe + net8.0 + enable + + + + + + PreserveNewest + Always + + + + PreserveNewest + Always + + + + + + + + + + + + + + + diff --git a/modules/dispatch/test/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp/Program.cs b/modules/dispatch/test/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp/Program.cs new file mode 100644 index 0000000..2c0b50a --- /dev/null +++ b/modules/dispatch/test/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp/Program.cs @@ -0,0 +1,22 @@ +using System.Threading.Tasks; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +namespace KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp; + +class Program +{ + static async Task Main(string[] args) + { + await CreateHostBuilder(args).RunConsoleAsync(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .AddAppSettingsSecretsJson() + .ConfigureServices((hostContext, services) => + { + services.AddHostedService(); + }); +} diff --git a/modules/dispatch/test/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp/appsettings.json b/modules/dispatch/test/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp/appsettings.json new file mode 100644 index 0000000..e85919d --- /dev/null +++ b/modules/dispatch/test/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp/appsettings.json @@ -0,0 +1,17 @@ +{ + "RemoteServices": { + "Default": { + "BaseUrl": "https://localhost:44321" + } + }, + "IdentityClients": { + "Default": { + "GrantType": "password", + "ClientId": "Dispatch_App", + "UserName": "admin", + "UserPassword": "1q2w3E*", + "Authority": "https://localhost:44321", + "Scope": "Dispatch" + } + } +} diff --git a/modules/dispatch/test/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json b/modules/dispatch/test/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json new file mode 100644 index 0000000..7a73a41 --- /dev/null +++ b/modules/dispatch/test/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/modules/dispatch/test/KonSoft.Dispatch.TestBase/DispatchTestBase.cs b/modules/dispatch/test/KonSoft.Dispatch.TestBase/DispatchTestBase.cs new file mode 100644 index 0000000..db3f3f2 --- /dev/null +++ b/modules/dispatch/test/KonSoft.Dispatch.TestBase/DispatchTestBase.cs @@ -0,0 +1,60 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.Modularity; +using Volo.Abp.Uow; +using Volo.Abp.Testing; + +namespace KonSoft.Dispatch; + +/* All test classes are derived from this class, directly or indirectly. + */ +public abstract class DispatchTestBase : AbpIntegratedTest + where TStartupModule : IAbpModule +{ + protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options) + { + options.UseAutofac(); + } + + protected virtual Task WithUnitOfWorkAsync(Func func) + { + return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); + } + + protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func action) + { + using (var scope = ServiceProvider.CreateScope()) + { + var uowManager = scope.ServiceProvider.GetRequiredService(); + + using (var uow = uowManager.Begin(options)) + { + await action(); + + await uow.CompleteAsync(); + } + } + } + + protected virtual Task WithUnitOfWorkAsync(Func> func) + { + return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); + } + + protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func> func) + { + using (var scope = ServiceProvider.CreateScope()) + { + var uowManager = scope.ServiceProvider.GetRequiredService(); + + using (var uow = uowManager.Begin(options)) + { + var result = await func(); + await uow.CompleteAsync(); + return result; + } + } + } +} diff --git a/modules/dispatch/test/KonSoft.Dispatch.TestBase/DispatchTestBaseModule.cs b/modules/dispatch/test/KonSoft.Dispatch.TestBase/DispatchTestBaseModule.cs new file mode 100644 index 0000000..87e2202 --- /dev/null +++ b/modules/dispatch/test/KonSoft.Dispatch.TestBase/DispatchTestBaseModule.cs @@ -0,0 +1,47 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.Authorization; +using Volo.Abp.Autofac; +using Volo.Abp.BackgroundJobs; +using Volo.Abp.Data; +using Volo.Abp.Modularity; +using Volo.Abp.Threading; + +namespace KonSoft.Dispatch; + +[DependsOn( + typeof(AbpAutofacModule), + typeof(AbpTestBaseModule), + typeof(AbpAuthorizationModule), + typeof(AbpBackgroundJobsAbstractionsModule) + )] +public class DispatchTestBaseModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.IsJobExecutionEnabled = false; + }); + + context.Services.AddAlwaysAllowAuthorization(); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + SeedTestData(context); + } + + private static void SeedTestData(ApplicationInitializationContext context) + { + AsyncHelper.RunSync(async () => + { + using (var scope = context.ServiceProvider.CreateScope()) + { + await scope.ServiceProvider + .GetRequiredService() + .SeedAsync(); + } + }); + } +} diff --git a/modules/dispatch/test/KonSoft.Dispatch.TestBase/DispatchTestConsts.cs b/modules/dispatch/test/KonSoft.Dispatch.TestBase/DispatchTestConsts.cs new file mode 100644 index 0000000..394b858 --- /dev/null +++ b/modules/dispatch/test/KonSoft.Dispatch.TestBase/DispatchTestConsts.cs @@ -0,0 +1,6 @@ +namespace KonSoft.Dispatch; + +public static class DispatchTestConsts +{ + public const string CollectionDefinitionName = "Dispatch collection"; +} diff --git a/modules/dispatch/test/KonSoft.Dispatch.TestBase/DispatchTestDataSeedContributor.cs b/modules/dispatch/test/KonSoft.Dispatch.TestBase/DispatchTestDataSeedContributor.cs new file mode 100644 index 0000000..cdf13ef --- /dev/null +++ b/modules/dispatch/test/KonSoft.Dispatch.TestBase/DispatchTestDataSeedContributor.cs @@ -0,0 +1,15 @@ +using System.Threading.Tasks; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; + +namespace KonSoft.Dispatch; + +public class DispatchTestDataSeedContributor : IDataSeedContributor, ITransientDependency +{ + public Task SeedAsync(DataSeedContext context) + { + /* Seed additional test data... */ + + return Task.CompletedTask; + } +} diff --git a/modules/dispatch/test/KonSoft.Dispatch.TestBase/KonSoft.Dispatch.TestBase.csproj b/modules/dispatch/test/KonSoft.Dispatch.TestBase/KonSoft.Dispatch.TestBase.csproj new file mode 100644 index 0000000..7e34e0a --- /dev/null +++ b/modules/dispatch/test/KonSoft.Dispatch.TestBase/KonSoft.Dispatch.TestBase.csproj @@ -0,0 +1,31 @@ + + + + + + net8.0 + enable + KonSoft.Dispatch + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers + + + + + + + + diff --git a/modules/dispatch/test/KonSoft.Dispatch.TestBase/Security/FakeCurrentPrincipalAccessor.cs b/modules/dispatch/test/KonSoft.Dispatch.TestBase/Security/FakeCurrentPrincipalAccessor.cs new file mode 100644 index 0000000..1f8fe62 --- /dev/null +++ b/modules/dispatch/test/KonSoft.Dispatch.TestBase/Security/FakeCurrentPrincipalAccessor.cs @@ -0,0 +1,25 @@ +using System.Collections.Generic; +using System.Security.Claims; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Security.Claims; + +namespace KonSoft.Dispatch.Security; + +[Dependency(ReplaceServices = true)] +public class FakeCurrentPrincipalAccessor : ThreadCurrentPrincipalAccessor +{ + protected override ClaimsPrincipal GetClaimsPrincipal() + { + return GetPrincipal(); + } + + private ClaimsPrincipal GetPrincipal() + { + return new ClaimsPrincipal(new ClaimsIdentity(new List + { + new Claim(AbpClaimTypes.UserId, "2e701e62-0953-4dd3-910b-dc6cc93ccb0d"), + new Claim(AbpClaimTypes.UserName, "admin"), + new Claim(AbpClaimTypes.Email, "admin@abp.io") + })); + } +} diff --git a/modules/payment/src/KonSoft.Payment.Application.Contracts/KonSoft.Payment.Application.Contracts.csproj b/modules/payment/src/KonSoft.Payment.Application.Contracts/KonSoft.Payment.Application.Contracts.csproj new file mode 100644 index 0000000..dcc8a92 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Application.Contracts/KonSoft.Payment.Application.Contracts.csproj @@ -0,0 +1,25 @@ + + + + + + net8.0 + enable + KonSoft.Payment + + + + + + + + + + + + + + + + + diff --git a/modules/payment/src/KonSoft.Payment.Application.Contracts/PaymentApplicationContractsModule.cs b/modules/payment/src/KonSoft.Payment.Application.Contracts/PaymentApplicationContractsModule.cs new file mode 100644 index 0000000..779660b --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Application.Contracts/PaymentApplicationContractsModule.cs @@ -0,0 +1,28 @@ +using Volo.Abp.Account; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; +using Volo.Abp.ObjectExtending; +using Volo.Abp.PermissionManagement; +using Volo.Abp.SettingManagement; +using Volo.Abp.TenantManagement; + +namespace KonSoft.Payment; + +[DependsOn( + typeof(PaymentDomainSharedModule), + typeof(AbpAccountApplicationContractsModule), + typeof(AbpFeatureManagementApplicationContractsModule), + typeof(AbpIdentityApplicationContractsModule), + typeof(AbpPermissionManagementApplicationContractsModule), + typeof(AbpSettingManagementApplicationContractsModule), + typeof(AbpTenantManagementApplicationContractsModule), + typeof(AbpObjectExtendingModule) +)] +public class PaymentApplicationContractsModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PaymentDtoExtensions.Configure(); + } +} diff --git a/modules/payment/src/KonSoft.Payment.Application.Contracts/PaymentDtoExtensions.cs b/modules/payment/src/KonSoft.Payment.Application.Contracts/PaymentDtoExtensions.cs new file mode 100644 index 0000000..d9e8eed --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Application.Contracts/PaymentDtoExtensions.cs @@ -0,0 +1,28 @@ +using Volo.Abp.Identity; +using Volo.Abp.ObjectExtending; +using Volo.Abp.Threading; + +namespace KonSoft.Payment; + +public static class PaymentDtoExtensions +{ + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + + public static void Configure() + { + OneTimeRunner.Run(() => + { + /* You can add extension properties to DTOs + * defined in the depended modules. + * + * Example: + * + * ObjectExtensionManager.Instance + * .AddOrUpdateProperty("Title"); + * + * See the documentation for more: + * https://docs.abp.io/en/abp/latest/Object-Extensions + */ + }); + } +} diff --git a/modules/payment/src/KonSoft.Payment.Application.Contracts/Permissions/PaymentPermissionDefinitionProvider.cs b/modules/payment/src/KonSoft.Payment.Application.Contracts/Permissions/PaymentPermissionDefinitionProvider.cs new file mode 100644 index 0000000..e0a83de --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Application.Contracts/Permissions/PaymentPermissionDefinitionProvider.cs @@ -0,0 +1,20 @@ +using KonSoft.Payment.Localization; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.Localization; + +namespace KonSoft.Payment.Permissions; + +public class PaymentPermissionDefinitionProvider : PermissionDefinitionProvider +{ + public override void Define(IPermissionDefinitionContext context) + { + var myGroup = context.AddGroup(PaymentPermissions.GroupName); + //Define your own permissions here. Example: + //myGroup.AddPermission(PaymentPermissions.MyPermission1, L("Permission:MyPermission1")); + } + + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); + } +} diff --git a/modules/payment/src/KonSoft.Payment.Application.Contracts/Permissions/PaymentPermissions.cs b/modules/payment/src/KonSoft.Payment.Application.Contracts/Permissions/PaymentPermissions.cs new file mode 100644 index 0000000..2c9a28b --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Application.Contracts/Permissions/PaymentPermissions.cs @@ -0,0 +1,9 @@ +namespace KonSoft.Payment.Permissions; + +public static class PaymentPermissions +{ + public const string GroupName = "Payment"; + + //Add your own permission names. Example: + //public const string MyPermission1 = GroupName + ".MyPermission1"; +} diff --git a/modules/payment/src/KonSoft.Payment.Application/KonSoft.Payment.Application.csproj b/modules/payment/src/KonSoft.Payment.Application/KonSoft.Payment.Application.csproj new file mode 100644 index 0000000..4f2eb85 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Application/KonSoft.Payment.Application.csproj @@ -0,0 +1,25 @@ + + + + + + net8.0 + enable + KonSoft.Payment + + + + + + + + + + + + + + + + + diff --git a/modules/payment/src/KonSoft.Payment.Application/PaymentAppService.cs b/modules/payment/src/KonSoft.Payment.Application/PaymentAppService.cs new file mode 100644 index 0000000..3e3e04a --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Application/PaymentAppService.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Text; +using KonSoft.Payment.Localization; +using Volo.Abp.Application.Services; + +namespace KonSoft.Payment; + +/* Inherit your application services from this class. + */ +public abstract class PaymentAppService : ApplicationService +{ + protected PaymentAppService() + { + LocalizationResource = typeof(PaymentResource); + } +} diff --git a/modules/payment/src/KonSoft.Payment.Application/PaymentApplicationAutoMapperProfile.cs b/modules/payment/src/KonSoft.Payment.Application/PaymentApplicationAutoMapperProfile.cs new file mode 100644 index 0000000..cd57e6f --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Application/PaymentApplicationAutoMapperProfile.cs @@ -0,0 +1,13 @@ +using AutoMapper; + +namespace KonSoft.Payment; + +public class PaymentApplicationAutoMapperProfile : Profile +{ + public PaymentApplicationAutoMapperProfile() + { + /* You can configure your AutoMapper mapping configuration here. + * Alternatively, you can split your mapping configurations + * into multiple profile classes for a better organization. */ + } +} diff --git a/modules/payment/src/KonSoft.Payment.Application/PaymentApplicationModule.cs b/modules/payment/src/KonSoft.Payment.Application/PaymentApplicationModule.cs new file mode 100644 index 0000000..827aee4 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Application/PaymentApplicationModule.cs @@ -0,0 +1,31 @@ +using Volo.Abp.Account; +using Volo.Abp.AutoMapper; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; +using Volo.Abp.PermissionManagement; +using Volo.Abp.SettingManagement; +using Volo.Abp.TenantManagement; + +namespace KonSoft.Payment; + +[DependsOn( + typeof(PaymentDomainModule), + typeof(AbpAccountApplicationModule), + typeof(PaymentApplicationContractsModule), + typeof(AbpIdentityApplicationModule), + typeof(AbpPermissionManagementApplicationModule), + typeof(AbpTenantManagementApplicationModule), + typeof(AbpFeatureManagementApplicationModule), + typeof(AbpSettingManagementApplicationModule) + )] +public class PaymentApplicationModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.AddMaps(); + }); + } +} diff --git a/modules/payment/src/KonSoft.Payment.Application/Properties/AssemblyInfo.cs b/modules/payment/src/KonSoft.Payment.Application/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..2626411 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Application/Properties/AssemblyInfo.cs @@ -0,0 +1,2 @@ +using System.Runtime.CompilerServices; +[assembly:InternalsVisibleToAttribute("KonSoft.Payment.Application.Tests")] diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/KonSoft.Payment.Domain.Shared.csproj b/modules/payment/src/KonSoft.Payment.Domain.Shared/KonSoft.Payment.Domain.Shared.csproj new file mode 100644 index 0000000..ef9d680 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/KonSoft.Payment.Domain.Shared.csproj @@ -0,0 +1,32 @@ + + + + + + net8.0 + enable + KonSoft.Payment + true + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/ar.json b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/ar.json new file mode 100644 index 0000000..6c6546a --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/ar.json @@ -0,0 +1,9 @@ +{ + "culture": "ar", + "texts": { + "AppName": "Payment", + "Menu:Home": "الصفحة الرئيسية", + "Welcome": "مرحباً", + "LongWelcomeMessage": "مرحبا بكم في التطبيق. هذا مشروع بدء تشغيل يعتمد على إطار عمل ABP. لمزيد من المعلومات ، يرجى زيارة abp.io." + } +} diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/cs.json b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/cs.json new file mode 100644 index 0000000..06f07d8 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/cs.json @@ -0,0 +1,9 @@ +{ + "culture": "cs", + "texts": { + "AppName": "Payment", + "Menu:Home": "Úvod", + "Welcome": "Vítejte", + "LongWelcomeMessage": "Vítejte v aplikaci. Toto je startovací projekt založený na ABP frameworku. Pro více informací, navštivte abp.io." + } +} diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/de.json b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/de.json new file mode 100644 index 0000000..937a03d --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/de.json @@ -0,0 +1,9 @@ +{ + "culture": "de", + "texts": { + "AppName": "Payment", + "Menu:Home": "Home", + "Welcome": "Willkommen", + "LongWelcomeMessage": "Willkommen bei der Anwendung. Dies ist ein Startup-Projekt, das auf dem ABP-Framework basiert. Weitere Informationen finden Sie unter abp.io." + } +} diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/en-GB.json b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/en-GB.json new file mode 100644 index 0000000..954746e --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/en-GB.json @@ -0,0 +1,9 @@ +{ + "culture": "en-GB", + "texts": { + "AppName": "Payment", + "Menu:Home": "Home", + "Welcome": "Welcome", + "LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io." + } +} diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/en.json b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/en.json new file mode 100644 index 0000000..3aaad49 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/en.json @@ -0,0 +1,9 @@ +{ + "culture": "en", + "texts": { + "AppName": "Payment", + "Menu:Home": "Home", + "Welcome": "Welcome", + "LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io." + } +} diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/es.json b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/es.json new file mode 100644 index 0000000..e133058 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/es.json @@ -0,0 +1,9 @@ +{ + "culture": "es", + "texts": { + "AppName": "Payment", + "Menu:Home": "Inicio", + "Welcome": "Bienvenido", + "LongWelcomeMessage": "Bienvenido a la aplicación, este es un proyecto base basado en el framework ABP. Para más información, visita abp.io." + } +} diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/fi.json b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/fi.json new file mode 100644 index 0000000..74ee99d --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/fi.json @@ -0,0 +1,9 @@ +{ + "culture": "fi", + "texts": { + "AppName": "Payment", + "Menu:Home": "Koti", + "Welcome": "Tervetuloa", + "LongWelcomeMessage": "Tervetuloa sovellukseen. Tämä on ABP-kehykseen perustuva käynnistysprojekti. Lisätietoja on osoitteessa abp.io." + } +} diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/fr.json b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/fr.json new file mode 100644 index 0000000..20fcbee --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/fr.json @@ -0,0 +1,9 @@ +{ + "culture": "fr", + "texts": { + "AppName": "Payment", + "Menu:Home": "Accueil", + "Welcome": "Bienvenue", + "LongWelcomeMessage": "Bienvenue dans l'application. Il s'agit d'un projet de démarrage basé sur le framework ABP. Pour plus d'informations, visitez abp.io." + } +} diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/hi.json b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/hi.json new file mode 100644 index 0000000..c39bdee --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/hi.json @@ -0,0 +1,9 @@ +{ + "culture": "hi", + "texts": { + "AppName": "Payment", + "Menu:Home": "घर", + "Welcome": "स्वागत हे", + "LongWelcomeMessage": "आवेदन करने के लिए आपका स्वागत है। यह एबीपी ढांचे पर आधारित एक स्टार्टअप परियोजना है। अधिक जानकारी के लिए, abp.io पर जाएं।" + } +} diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/hr.json b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/hr.json new file mode 100644 index 0000000..230051f --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/hr.json @@ -0,0 +1,9 @@ +{ + "culture": "hr", + "texts": { + "AppName": "Payment", + "Menu:Home": "Početna", + "Welcome": "Dobrodošli", + "LongWelcomeMessage": "Dobrodošli u aplikaciju. Ovo je startup projekt temeljen na ABP framework-u. Za više informacija posjetite abp.io." + } +} diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/hu.json b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/hu.json new file mode 100644 index 0000000..d9c1f20 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/hu.json @@ -0,0 +1,9 @@ +{ + "culture": "hu", + "texts": { + "AppName": "Payment", + "Menu:Home": "Kezdőlap", + "Welcome": "Üdvözlöm", + "LongWelcomeMessage": "Üdvözöljük az alkalmazásban. Ez egy ABP keretrendszeren alapuló startup projekt. További információkért látogasson el az abp.io oldalra." + } +} diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/is.json b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/is.json new file mode 100644 index 0000000..a72f98a --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/is.json @@ -0,0 +1,9 @@ +{ + "culture": "is", + "texts": { + "AppName": "Payment", + "Menu:Home": "Heim", + "Welcome": "Velkomin", + "LongWelcomeMessage": "Verið velkomin í forritið. Þetta er startup verkefni sem byggir á ABP. Nánari upplýsingar er að finna á abp.io." + } +} diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/it.json b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/it.json new file mode 100644 index 0000000..cebc29d --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/it.json @@ -0,0 +1,9 @@ +{ + "culture": "it", + "texts": { + "AppName": "Payment", + "Menu:Home": "Home", + "Welcome": "Benvenuto", + "LongWelcomeMessage": "Benvenuto nell'applicazione. Questo è un progetto di avvio basato sul framework ABP. Per ulteriori informazioni, visita abp.io." + } +} diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/nl.json b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/nl.json new file mode 100644 index 0000000..d333745 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/nl.json @@ -0,0 +1,9 @@ +{ + "culture": "nl", + "texts": { + "AppName": "Payment", + "Menu:Home": "Home", + "Welcome": "Welkom", + "LongWelcomeMessage": "Welkom bij de applicatie. Dit is een startup-project gebaseerd op het ABP-framework. Bezoek abp.io voor meer informatie." + } +} diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/pl-PL.json b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/pl-PL.json new file mode 100644 index 0000000..16f09f7 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/pl-PL.json @@ -0,0 +1,9 @@ +{ + "culture": "pl-PL", + "texts": { + "AppName": "Payment", + "Menu:Home": "Home", + "Welcome": "Witaj", + "LongWelcomeMessage": "Witaj w aplikacji. To jest inicjalny projekt bazujący na ABP framework. Po więcej informacji odwiedź stronę abp.io." + } +} diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/pt-BR.json b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/pt-BR.json new file mode 100644 index 0000000..32b4fc7 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/pt-BR.json @@ -0,0 +1,9 @@ +{ + "culture": "pt-BR", + "texts": { + "AppName": "Payment", + "Menu:Home": "Principal", + "Welcome": "Seja bem-vindo!", + "LongWelcomeMessage": "Bem-vindo a esta aplicação. Este é um projeto inicial baseado no ABP framework. Para mais informações, visite abp.io." + } +} diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/ro-RO.json b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/ro-RO.json new file mode 100644 index 0000000..2c89655 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/ro-RO.json @@ -0,0 +1,9 @@ +{ + "culture": "ro-RO", + "texts": { + "AppName": "Payment", + "Menu:Home": "Acasă", + "Welcome": "Bun venit", + "LongWelcomeMessage": "Bun venit la aplicaţie. Acesta este un proiect de pornire bazat pe framework-ul ABP. Pentru mai multe informaţii, vizitaţi, visit abp.io." + } +} diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/ru.json b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/ru.json new file mode 100644 index 0000000..6c1469b --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/ru.json @@ -0,0 +1,9 @@ +{ + "culture": "ru", + "texts": { + "AppName": "Payment", + "Menu:Home": "Главная", + "Welcome": "Добро пожаловать", + "LongWelcomeMessage": "Добро пожаловать в приложение. Этот запущенный проект основан на фреймворке ABP. Для получения дополнительной информации посетите сайт abp.io." + } +} diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/sk.json b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/sk.json new file mode 100644 index 0000000..2a6b160 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/sk.json @@ -0,0 +1,9 @@ +{ + "culture": "sk", + "texts": { + "AppName": "Payment", + "Menu:Home": "Domov", + "Welcome": "Vitajte", + "LongWelcomeMessage": "Vitajte v aplikácii. Toto je štartovací projekt založený na ABP frameworku. Viac informácií nájdete na stránke abp.io." + } +} diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/sl.json b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/sl.json new file mode 100644 index 0000000..a7b06d8 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/sl.json @@ -0,0 +1,9 @@ +{ + "culture": "sl", + "texts": { + "AppName": "Payment", + "Menu:Home": "Domov", + "Welcome": "Dobrodošli", + "LongWelcomeMessage": "Dobrodošli v aplikaciji. To je začetni projekt na osnovi okolja ABP. Za več informacij obiščite abp.io." + } +} diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/sv.json b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/sv.json new file mode 100644 index 0000000..bd1eae4 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/sv.json @@ -0,0 +1,9 @@ +{ + "culture": "sv", + "texts": { + "AppName": "MittProjektNamn", + "Menu:Home": "Hem", + "Welcome": "Välkommen", + "LongWelcomeMessage": "Välkommen till applikationen. Detta är ett startup-projekt baserat på ABP-ramverket. För mer information, besök abp.io." + } +} \ No newline at end of file diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/tr.json b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/tr.json new file mode 100644 index 0000000..c59e7a8 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/tr.json @@ -0,0 +1,9 @@ +{ + "culture": "tr", + "texts": { + "AppName": "Payment", + "Menu:Home": "Ana sayfa", + "Welcome": "Hoşgeldiniz", + "LongWelcomeMessage": "Uygulamaya hoşgeldiniz. Bu, ABP framework'ü üzerine bina edilmiş bir başlangıç projesidir. Daha fazla bilgi için abp.io adresini ziyaret edebilirsiniz." + } +} diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/vi.json b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/vi.json new file mode 100644 index 0000000..333e831 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/vi.json @@ -0,0 +1,9 @@ +{ + "culture": "vi", + "texts": { + "AppName": "Payment", + "Menu:Home": "Trang chủ", + "Welcome": "Chào mừng bạn", + "LongWelcomeMessage": "Chào mừng bạn đến ứng dụng. Đây là một dự án khởi nghiệp dựa trên khung ABP. Để biết thêm thông tin, hãy truy cập abp.io." + } +} diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/zh-Hans.json b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/zh-Hans.json new file mode 100644 index 0000000..01dbeac --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/zh-Hans.json @@ -0,0 +1,9 @@ +{ + "culture": "zh-Hans", + "texts": { + "AppName": "Payment", + "Menu:Home": "首页", + "Welcome": "欢迎", + "LongWelcomeMessage": "欢迎使用本应用程序。这是一个基于 ABP 框架的启动项目。更多信息,请访问 abp.io。" + } +} diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/zh-Hant.json b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/zh-Hant.json new file mode 100644 index 0000000..2ceb93b --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/Payment/zh-Hant.json @@ -0,0 +1,9 @@ +{ + "culture": "zh-Hant", + "texts": { + "AppName": "Payment", + "Menu:Home": "首頁", + "Welcome": "歡迎", + "LongWelcomeMessage": "歡迎來到此應用程式. 這是一個基於ABP框架的起始專案. 有關更多訊息, 請瀏覽 abp.io." + } + } diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/PaymentResource.cs b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/PaymentResource.cs new file mode 100644 index 0000000..fcf7fb7 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/Localization/PaymentResource.cs @@ -0,0 +1,9 @@ +using Volo.Abp.Localization; + +namespace KonSoft.Payment.Localization; + +[LocalizationResourceName("Payment")] +public class PaymentResource +{ + +} diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/MultiTenancy/MultiTenancyConsts.cs b/modules/payment/src/KonSoft.Payment.Domain.Shared/MultiTenancy/MultiTenancyConsts.cs new file mode 100644 index 0000000..c3155c1 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/MultiTenancy/MultiTenancyConsts.cs @@ -0,0 +1,10 @@ +namespace KonSoft.Payment.MultiTenancy; + +public static class MultiTenancyConsts +{ + /* Enable/disable multi-tenancy easily in a single point. + * If you will never need to multi-tenancy, you can remove + * related modules and code parts, including this file. + */ + public const bool IsEnabled = true; +} diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/PaymentDomainErrorCodes.cs b/modules/payment/src/KonSoft.Payment.Domain.Shared/PaymentDomainErrorCodes.cs new file mode 100644 index 0000000..85cf719 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/PaymentDomainErrorCodes.cs @@ -0,0 +1,6 @@ +namespace KonSoft.Payment; + +public static class PaymentDomainErrorCodes +{ + /* You can add your business exception error codes here, as constants */ +} diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/PaymentDomainSharedModule.cs b/modules/payment/src/KonSoft.Payment.Domain.Shared/PaymentDomainSharedModule.cs new file mode 100644 index 0000000..8da6490 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/PaymentDomainSharedModule.cs @@ -0,0 +1,58 @@ +using KonSoft.Payment.Localization; +using Volo.Abp.AuditLogging; +using Volo.Abp.BackgroundJobs; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Localization; +using Volo.Abp.Localization.ExceptionHandling; +using Volo.Abp.Modularity; +using Volo.Abp.OpenIddict; +using Volo.Abp.PermissionManagement; +using Volo.Abp.SettingManagement; +using Volo.Abp.TenantManagement; +using Volo.Abp.Validation.Localization; +using Volo.Abp.VirtualFileSystem; + +namespace KonSoft.Payment; + +[DependsOn( + typeof(AbpAuditLoggingDomainSharedModule), + typeof(AbpBackgroundJobsDomainSharedModule), + typeof(AbpFeatureManagementDomainSharedModule), + typeof(AbpIdentityDomainSharedModule), + typeof(AbpOpenIddictDomainSharedModule), + typeof(AbpPermissionManagementDomainSharedModule), + typeof(AbpSettingManagementDomainSharedModule), + typeof(AbpTenantManagementDomainSharedModule) + )] +public class PaymentDomainSharedModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PaymentGlobalFeatureConfigurator.Configure(); + PaymentModuleExtensionConfigurator.Configure(); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + Configure(options => + { + options.Resources + .Add("en") + .AddBaseTypes(typeof(AbpValidationResource)) + .AddVirtualJson("/Localization/Payment"); + + options.DefaultResourceType = typeof(PaymentResource); + }); + + Configure(options => + { + options.MapCodeNamespace("Payment", typeof(PaymentResource)); + }); + } +} diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/PaymentGlobalFeatureConfigurator.cs b/modules/payment/src/KonSoft.Payment.Domain.Shared/PaymentGlobalFeatureConfigurator.cs new file mode 100644 index 0000000..c1b4b07 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/PaymentGlobalFeatureConfigurator.cs @@ -0,0 +1,22 @@ +using Volo.Abp.Threading; + +namespace KonSoft.Payment; + +public static class PaymentGlobalFeatureConfigurator +{ + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + + public static void Configure() + { + OneTimeRunner.Run(() => + { + /* You can configure (enable/disable) global features of the used modules here. + * + * YOU CAN SAFELY DELETE THIS CLASS AND REMOVE ITS USAGES IF YOU DON'T NEED TO IT! + * + * Please refer to the documentation to lear more about the Global Features System: + * https://docs.abp.io/en/abp/latest/Global-Features + */ + }); + } +} diff --git a/modules/payment/src/KonSoft.Payment.Domain.Shared/PaymentModuleExtensionConfigurator.cs b/modules/payment/src/KonSoft.Payment.Domain.Shared/PaymentModuleExtensionConfigurator.cs new file mode 100644 index 0000000..a26ebbc --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain.Shared/PaymentModuleExtensionConfigurator.cs @@ -0,0 +1,73 @@ +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Identity; +using Volo.Abp.ObjectExtending; +using Volo.Abp.Threading; + +namespace KonSoft.Payment; + +public static class PaymentModuleExtensionConfigurator +{ + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + + public static void Configure() + { + OneTimeRunner.Run(() => + { + ConfigureExistingProperties(); + ConfigureExtraProperties(); + }); + } + + private static void ConfigureExistingProperties() + { + /* You can change max lengths for properties of the + * entities defined in the modules used by your application. + * + * Example: Change user and role name max lengths + + AbpUserConsts.MaxNameLength = 99; + IdentityRoleConsts.MaxNameLength = 99; + + * Notice: It is not suggested to change property lengths + * unless you really need it. Go with the standard values wherever possible. + * + * If you are using EF Core, you will need to run the add-migration command after your changes. + */ + } + + private static void ConfigureExtraProperties() + { + /* You can configure extra properties for the + * entities defined in the modules used by your application. + * + * This class can be used to define these extra properties + * with a high level, easy to use API. + * + * Example: Add a new property to the user entity of the identity module + + ObjectExtensionManager.Instance.Modules() + .ConfigureIdentity(identity => + { + identity.ConfigureUser(user => + { + user.AddOrUpdateProperty( //property type: string + "SocialSecurityNumber", //property name + property => + { + //validation rules + property.Attributes.Add(new RequiredAttribute()); + property.Attributes.Add(new StringLengthAttribute(64) {MinimumLength = 4}); + + property.Configuration[IdentityModuleExtensionConsts.ConfigurationNames.AllowUserToEdit] = true; + + //...other configurations for this property + } + ); + }); + }); + + * See the documentation for more: + * https://docs.abp.io/en/abp/latest/Module-Entity-Extensions + */ + } +} diff --git a/modules/payment/src/KonSoft.Payment.Domain/Data/IPaymentDbSchemaMigrator.cs b/modules/payment/src/KonSoft.Payment.Domain/Data/IPaymentDbSchemaMigrator.cs new file mode 100644 index 0000000..78d1e4f --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain/Data/IPaymentDbSchemaMigrator.cs @@ -0,0 +1,8 @@ +using System.Threading.Tasks; + +namespace KonSoft.Payment.Data; + +public interface IPaymentDbSchemaMigrator +{ + Task MigrateAsync(); +} diff --git a/modules/payment/src/KonSoft.Payment.Domain/Data/NullPaymentDbSchemaMigrator.cs b/modules/payment/src/KonSoft.Payment.Domain/Data/NullPaymentDbSchemaMigrator.cs new file mode 100644 index 0000000..15b687d --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain/Data/NullPaymentDbSchemaMigrator.cs @@ -0,0 +1,15 @@ +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; + +namespace KonSoft.Payment.Data; + +/* This is used if database provider does't define + * IPaymentDbSchemaMigrator implementation. + */ +public class NullPaymentDbSchemaMigrator : IPaymentDbSchemaMigrator, ITransientDependency +{ + public Task MigrateAsync() + { + return Task.CompletedTask; + } +} diff --git a/modules/payment/src/KonSoft.Payment.Domain/Data/PaymentDbMigrationService.cs b/modules/payment/src/KonSoft.Payment.Domain/Data/PaymentDbMigrationService.cs new file mode 100644 index 0000000..32e6382 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain/Data/PaymentDbMigrationService.cs @@ -0,0 +1,218 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Identity; +using Volo.Abp.MultiTenancy; +using Volo.Abp.TenantManagement; + +namespace KonSoft.Payment.Data; + +public class PaymentDbMigrationService : ITransientDependency +{ + public ILogger Logger { get; set; } + + private readonly IDataSeeder _dataSeeder; + private readonly IEnumerable _dbSchemaMigrators; + private readonly ITenantRepository _tenantRepository; + private readonly ICurrentTenant _currentTenant; + + public PaymentDbMigrationService( + IDataSeeder dataSeeder, + IEnumerable dbSchemaMigrators, + ITenantRepository tenantRepository, + ICurrentTenant currentTenant) + { + _dataSeeder = dataSeeder; + _dbSchemaMigrators = dbSchemaMigrators; + _tenantRepository = tenantRepository; + _currentTenant = currentTenant; + + Logger = NullLogger.Instance; + } + + public async Task MigrateAsync() + { + var initialMigrationAdded = AddInitialMigrationIfNotExist(); + + if (initialMigrationAdded) + { + return; + } + + Logger.LogInformation("Started database migrations..."); + + await MigrateDatabaseSchemaAsync(); + await SeedDataAsync(); + + Logger.LogInformation($"Successfully completed host database migrations."); + + var tenants = await _tenantRepository.GetListAsync(includeDetails: true); + + var migratedDatabaseSchemas = new HashSet(); + foreach (var tenant in tenants) + { + using (_currentTenant.Change(tenant.Id)) + { + if (tenant.ConnectionStrings.Any()) + { + var tenantConnectionStrings = tenant.ConnectionStrings + .Select(x => x.Value) + .ToList(); + + if (!migratedDatabaseSchemas.IsSupersetOf(tenantConnectionStrings)) + { + await MigrateDatabaseSchemaAsync(tenant); + + migratedDatabaseSchemas.AddIfNotContains(tenantConnectionStrings); + } + } + + await SeedDataAsync(tenant); + } + + Logger.LogInformation($"Successfully completed {tenant.Name} tenant database migrations."); + } + + Logger.LogInformation("Successfully completed all database migrations."); + Logger.LogInformation("You can safely end this process..."); + } + + private async Task MigrateDatabaseSchemaAsync(Tenant? tenant = null) + { + Logger.LogInformation( + $"Migrating schema for {(tenant == null ? "host" : tenant.Name + " tenant")} database..."); + + foreach (var migrator in _dbSchemaMigrators) + { + await migrator.MigrateAsync(); + } + } + + private async Task SeedDataAsync(Tenant? tenant = null) + { + Logger.LogInformation($"Executing {(tenant == null ? "host" : tenant.Name + " tenant")} database seed..."); + + await _dataSeeder.SeedAsync(new DataSeedContext(tenant?.Id) + .WithProperty(IdentityDataSeedContributor.AdminEmailPropertyName, IdentityDataSeedContributor.AdminEmailDefaultValue) + .WithProperty(IdentityDataSeedContributor.AdminPasswordPropertyName, IdentityDataSeedContributor.AdminPasswordDefaultValue) + ); + } + + private bool AddInitialMigrationIfNotExist() + { + try + { + if (!DbMigrationsProjectExists()) + { + return false; + } + } + catch (Exception) + { + return false; + } + + try + { + if (!MigrationsFolderExists()) + { + AddInitialMigration(); + return true; + } + else + { + return false; + } + } + catch (Exception e) + { + Logger.LogWarning("Couldn't determinate if any migrations exist : " + e.Message); + return false; + } + } + + private bool DbMigrationsProjectExists() + { + var dbMigrationsProjectFolder = GetEntityFrameworkCoreProjectFolderPath(); + + return dbMigrationsProjectFolder != null; + } + + private bool MigrationsFolderExists() + { + var dbMigrationsProjectFolder = GetEntityFrameworkCoreProjectFolderPath(); + return dbMigrationsProjectFolder != null && Directory.Exists(Path.Combine(dbMigrationsProjectFolder, "Migrations")); + } + + private void AddInitialMigration() + { + Logger.LogInformation("Creating initial migration..."); + + string argumentPrefix; + string fileName; + + if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) || RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + argumentPrefix = "-c"; + fileName = "/bin/bash"; + } + else + { + argumentPrefix = "/C"; + fileName = "cmd.exe"; + } + + var procStartInfo = new ProcessStartInfo(fileName, + $"{argumentPrefix} \"abp create-migration-and-run-migrator \"{GetEntityFrameworkCoreProjectFolderPath()}\"\"" + ); + + try + { + Process.Start(procStartInfo); + } + catch (Exception) + { + throw new Exception("Couldn't run ABP CLI..."); + } + } + + private string? GetEntityFrameworkCoreProjectFolderPath() + { + var slnDirectoryPath = GetSolutionDirectoryPath(); + + if (slnDirectoryPath == null) + { + throw new Exception("Solution folder not found!"); + } + + var srcDirectoryPath = Path.Combine(slnDirectoryPath, "src"); + + return Directory.GetDirectories(srcDirectoryPath) + .FirstOrDefault(d => d.EndsWith(".EntityFrameworkCore")); + } + + private string? GetSolutionDirectoryPath() + { + var currentDirectory = new DirectoryInfo(Directory.GetCurrentDirectory()); + + while (currentDirectory != null && Directory.GetParent(currentDirectory.FullName) != null) + { + currentDirectory = Directory.GetParent(currentDirectory.FullName); + + if (currentDirectory != null && Directory.GetFiles(currentDirectory.FullName).FirstOrDefault(f => f.EndsWith(".sln")) != null) + { + return currentDirectory.FullName; + } + } + + return null; + } +} diff --git a/modules/payment/src/KonSoft.Payment.Domain/KonSoft.Payment.Domain.csproj b/modules/payment/src/KonSoft.Payment.Domain/KonSoft.Payment.Domain.csproj new file mode 100644 index 0000000..fdccac0 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain/KonSoft.Payment.Domain.csproj @@ -0,0 +1,28 @@ + + + + + + net8.0 + enable + KonSoft.Payment + + + + + + + + + + + + + + + + + + + + diff --git a/modules/payment/src/KonSoft.Payment.Domain/OpenIddict/OpenIddictDataSeedContributor.cs b/modules/payment/src/KonSoft.Payment.Domain/OpenIddict/OpenIddictDataSeedContributor.cs new file mode 100644 index 0000000..2487dd9 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain/OpenIddict/OpenIddictDataSeedContributor.cs @@ -0,0 +1,327 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; +using System.Threading.Tasks; +using JetBrains.Annotations; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Localization; +using OpenIddict.Abstractions; +using Volo.Abp; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.OpenIddict.Applications; +using Volo.Abp.OpenIddict.Scopes; +using Volo.Abp.PermissionManagement; +using Volo.Abp.Uow; + +namespace KonSoft.Payment.OpenIddict; + +/* Creates initial data that is needed to property run the application + * and make client-to-server communication possible. + */ +public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDependency +{ + private readonly IConfiguration _configuration; + private readonly IOpenIddictApplicationRepository _openIddictApplicationRepository; + private readonly IAbpApplicationManager _applicationManager; + private readonly IOpenIddictScopeRepository _openIddictScopeRepository; + private readonly IOpenIddictScopeManager _scopeManager; + private readonly IPermissionDataSeeder _permissionDataSeeder; + private readonly IStringLocalizer L; + + public OpenIddictDataSeedContributor( + IConfiguration configuration, + IOpenIddictApplicationRepository openIddictApplicationRepository, + IAbpApplicationManager applicationManager, + IOpenIddictScopeRepository openIddictScopeRepository, + IOpenIddictScopeManager scopeManager, + IPermissionDataSeeder permissionDataSeeder, + IStringLocalizer l ) + { + _configuration = configuration; + _openIddictApplicationRepository = openIddictApplicationRepository; + _applicationManager = applicationManager; + _openIddictScopeRepository = openIddictScopeRepository; + _scopeManager = scopeManager; + _permissionDataSeeder = permissionDataSeeder; + L = l; + } + + [UnitOfWork] + public virtual async Task SeedAsync(DataSeedContext context) + { + await CreateScopesAsync(); + await CreateApplicationsAsync(); + } + + private async Task CreateScopesAsync() + { + if (await _openIddictScopeRepository.FindByNameAsync("Payment") == null) + { + await _scopeManager.CreateAsync(new OpenIddictScopeDescriptor { + Name = "Payment", DisplayName = "Payment API", Resources = { "Payment" } + }); + } + } + + private async Task CreateApplicationsAsync() + { + var commonScopes = new List { + OpenIddictConstants.Permissions.Scopes.Address, + OpenIddictConstants.Permissions.Scopes.Email, + OpenIddictConstants.Permissions.Scopes.Phone, + OpenIddictConstants.Permissions.Scopes.Profile, + OpenIddictConstants.Permissions.Scopes.Roles, + "Payment" + }; + + var configurationSection = _configuration.GetSection("OpenIddict:Applications"); + + + + + + + // Swagger Client + var swaggerClientId = configurationSection["Payment_Swagger:ClientId"]; + if (!swaggerClientId.IsNullOrWhiteSpace()) + { + var swaggerRootUrl = configurationSection["Payment_Swagger:RootUrl"]?.TrimEnd('/'); + + await CreateApplicationAsync( + name: swaggerClientId!, + type: OpenIddictConstants.ClientTypes.Public, + consentType: OpenIddictConstants.ConsentTypes.Implicit, + displayName: "Swagger Application", + secret: null, + grantTypes: new List { OpenIddictConstants.GrantTypes.AuthorizationCode, }, + scopes: commonScopes, + redirectUri: $"{swaggerRootUrl}/swagger/oauth2-redirect.html", + clientUri: swaggerRootUrl + ); + } + } + + private async Task CreateApplicationAsync( + [NotNull] string name, + [NotNull] string type, + [NotNull] string consentType, + string displayName, + string? secret, + List grantTypes, + List scopes, + string? clientUri = null, + string? redirectUri = null, + string? postLogoutRedirectUri = null, + List? permissions = null) + { + if (!string.IsNullOrEmpty(secret) && string.Equals(type, OpenIddictConstants.ClientTypes.Public, + StringComparison.OrdinalIgnoreCase)) + { + throw new BusinessException(L["NoClientSecretCanBeSetForPublicApplications"]); + } + + if (string.IsNullOrEmpty(secret) && string.Equals(type, OpenIddictConstants.ClientTypes.Confidential, + StringComparison.OrdinalIgnoreCase)) + { + throw new BusinessException(L["TheClientSecretIsRequiredForConfidentialApplications"]); + } + + var client = await _openIddictApplicationRepository.FindByClientIdAsync(name); + + var application = new AbpApplicationDescriptor { + ClientId = name, + ClientType = type, + ClientSecret = secret, + ConsentType = consentType, + DisplayName = displayName, + ClientUri = clientUri, + }; + + Check.NotNullOrEmpty(grantTypes, nameof(grantTypes)); + Check.NotNullOrEmpty(scopes, nameof(scopes)); + + if (new[] { OpenIddictConstants.GrantTypes.AuthorizationCode, OpenIddictConstants.GrantTypes.Implicit }.All( + grantTypes.Contains)) + { + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.CodeIdToken); + + if (string.Equals(type, OpenIddictConstants.ClientTypes.Public, StringComparison.OrdinalIgnoreCase)) + { + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.CodeIdTokenToken); + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.CodeToken); + } + } + + if (!redirectUri.IsNullOrWhiteSpace() || !postLogoutRedirectUri.IsNullOrWhiteSpace()) + { + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Logout); + } + + var buildInGrantTypes = new[] { + OpenIddictConstants.GrantTypes.Implicit, OpenIddictConstants.GrantTypes.Password, + OpenIddictConstants.GrantTypes.AuthorizationCode, OpenIddictConstants.GrantTypes.ClientCredentials, + OpenIddictConstants.GrantTypes.DeviceCode, OpenIddictConstants.GrantTypes.RefreshToken + }; + + foreach (var grantType in grantTypes) + { + if (grantType == OpenIddictConstants.GrantTypes.AuthorizationCode) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.AuthorizationCode); + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.Code); + } + + if (grantType == OpenIddictConstants.GrantTypes.AuthorizationCode || + grantType == OpenIddictConstants.GrantTypes.Implicit) + { + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Authorization); + } + + if (grantType == OpenIddictConstants.GrantTypes.AuthorizationCode || + grantType == OpenIddictConstants.GrantTypes.ClientCredentials || + grantType == OpenIddictConstants.GrantTypes.Password || + grantType == OpenIddictConstants.GrantTypes.RefreshToken || + grantType == OpenIddictConstants.GrantTypes.DeviceCode) + { + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Token); + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Revocation); + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Introspection); + } + + if (grantType == OpenIddictConstants.GrantTypes.ClientCredentials) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.ClientCredentials); + } + + if (grantType == OpenIddictConstants.GrantTypes.Implicit) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.Implicit); + } + + if (grantType == OpenIddictConstants.GrantTypes.Password) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.Password); + } + + if (grantType == OpenIddictConstants.GrantTypes.RefreshToken) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.RefreshToken); + } + + if (grantType == OpenIddictConstants.GrantTypes.DeviceCode) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.DeviceCode); + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Device); + } + + if (grantType == OpenIddictConstants.GrantTypes.Implicit) + { + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.IdToken); + if (string.Equals(type, OpenIddictConstants.ClientTypes.Public, StringComparison.OrdinalIgnoreCase)) + { + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.IdTokenToken); + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.Token); + } + } + + if (!buildInGrantTypes.Contains(grantType)) + { + application.Permissions.Add(OpenIddictConstants.Permissions.Prefixes.GrantType + grantType); + } + } + + var buildInScopes = new[] { + OpenIddictConstants.Permissions.Scopes.Address, OpenIddictConstants.Permissions.Scopes.Email, + OpenIddictConstants.Permissions.Scopes.Phone, OpenIddictConstants.Permissions.Scopes.Profile, + OpenIddictConstants.Permissions.Scopes.Roles + }; + + foreach (var scope in scopes) + { + if (buildInScopes.Contains(scope)) + { + application.Permissions.Add(scope); + } + else + { + application.Permissions.Add(OpenIddictConstants.Permissions.Prefixes.Scope + scope); + } + } + + if (redirectUri != null) + { + if (!redirectUri.IsNullOrEmpty()) + { + if (!Uri.TryCreate(redirectUri, UriKind.Absolute, out var uri) || !uri.IsWellFormedOriginalString()) + { + throw new BusinessException(L["InvalidRedirectUri", redirectUri]); + } + + if (application.RedirectUris.All(x => x != uri)) + { + application.RedirectUris.Add(uri); + } + } + } + + if (postLogoutRedirectUri != null) + { + if (!postLogoutRedirectUri.IsNullOrEmpty()) + { + if (!Uri.TryCreate(postLogoutRedirectUri, UriKind.Absolute, out var uri) || + !uri.IsWellFormedOriginalString()) + { + throw new BusinessException(L["InvalidPostLogoutRedirectUri", postLogoutRedirectUri]); + } + + if (application.PostLogoutRedirectUris.All(x => x != uri)) + { + application.PostLogoutRedirectUris.Add(uri); + } + } + } + + if (permissions != null) + { + await _permissionDataSeeder.SeedAsync( + ClientPermissionValueProvider.ProviderName, + name, + permissions, + null + ); + } + + if (client == null) + { + await _applicationManager.CreateAsync(application); + return; + } + + if (!HasSameRedirectUris(client, application)) + { + client.RedirectUris = JsonSerializer.Serialize(application.RedirectUris.Select(q => q.ToString().TrimEnd('/'))); + client.PostLogoutRedirectUris = JsonSerializer.Serialize(application.PostLogoutRedirectUris.Select(q => q.ToString().TrimEnd('/'))); + + await _applicationManager.UpdateAsync(client.ToModel()); + } + + if (!HasSameScopes(client, application)) + { + client.Permissions = JsonSerializer.Serialize(application.Permissions.Select(q => q.ToString())); + await _applicationManager.UpdateAsync(client.ToModel()); + } + } + + private bool HasSameRedirectUris(OpenIddictApplication existingClient, AbpApplicationDescriptor application) + { + return existingClient.RedirectUris == JsonSerializer.Serialize(application.RedirectUris.Select(q => q.ToString().TrimEnd('/'))); + } + + private bool HasSameScopes(OpenIddictApplication existingClient, AbpApplicationDescriptor application) + { + return existingClient.Permissions == JsonSerializer.Serialize(application.Permissions.Select(q => q.ToString().TrimEnd('/'))); + } +} diff --git a/modules/payment/src/KonSoft.Payment.Domain/PaymentConsts.cs b/modules/payment/src/KonSoft.Payment.Domain/PaymentConsts.cs new file mode 100644 index 0000000..9938471 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain/PaymentConsts.cs @@ -0,0 +1,8 @@ +namespace KonSoft.Payment; + +public static class PaymentConsts +{ + public const string DbTablePrefix = "App"; + + public const string DbSchema = null; +} diff --git a/modules/payment/src/KonSoft.Payment.Domain/PaymentDomainModule.cs b/modules/payment/src/KonSoft.Payment.Domain/PaymentDomainModule.cs new file mode 100644 index 0000000..c8b9650 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain/PaymentDomainModule.cs @@ -0,0 +1,68 @@ +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection.Extensions; +using KonSoft.Payment.MultiTenancy; +using Volo.Abp.AuditLogging; +using Volo.Abp.BackgroundJobs; +using Volo.Abp.Emailing; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Volo.Abp.MultiTenancy; +using Volo.Abp.OpenIddict; +using Volo.Abp.PermissionManagement.Identity; +using Volo.Abp.PermissionManagement.OpenIddict; +using Volo.Abp.SettingManagement; +using Volo.Abp.TenantManagement; + +namespace KonSoft.Payment; + +[DependsOn( + typeof(PaymentDomainSharedModule), + typeof(AbpAuditLoggingDomainModule), + typeof(AbpBackgroundJobsDomainModule), + typeof(AbpFeatureManagementDomainModule), + typeof(AbpIdentityDomainModule), + typeof(AbpOpenIddictDomainModule), + typeof(AbpPermissionManagementDomainOpenIddictModule), + typeof(AbpPermissionManagementDomainIdentityModule), + typeof(AbpSettingManagementDomainModule), + typeof(AbpTenantManagementDomainModule), + typeof(AbpEmailingModule) +)] +public class PaymentDomainModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.Languages.Add(new LanguageInfo("ar", "ar", "العربية")); + options.Languages.Add(new LanguageInfo("cs", "cs", "Čeština")); + options.Languages.Add(new LanguageInfo("en", "en", "English")); + options.Languages.Add(new LanguageInfo("en-GB", "en-GB", "English (UK)")); + options.Languages.Add(new LanguageInfo("hu", "hu", "Magyar")); + options.Languages.Add(new LanguageInfo("hr", "hr", "Croatian")); + options.Languages.Add(new LanguageInfo("fi", "fi", "Finnish")); + options.Languages.Add(new LanguageInfo("fr", "fr", "Français")); + options.Languages.Add(new LanguageInfo("hi", "hi", "Hindi")); + options.Languages.Add(new LanguageInfo("it", "it", "Italiano")); + options.Languages.Add(new LanguageInfo("pt-BR", "pt-BR", "Português")); + options.Languages.Add(new LanguageInfo("ru", "ru", "Русский")); + options.Languages.Add(new LanguageInfo("sk", "sk", "Slovak")); + options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe")); + options.Languages.Add(new LanguageInfo("zh-Hans", "zh-Hans", "简体中文")); + options.Languages.Add(new LanguageInfo("zh-Hant", "zh-Hant", "繁體中文")); + options.Languages.Add(new LanguageInfo("de-DE", "de-DE", "Deutsch")); + options.Languages.Add(new LanguageInfo("es", "es", "Español")); + }); + + Configure(options => + { + options.IsEnabled = MultiTenancyConsts.IsEnabled; + }); + +#if DEBUG + context.Services.Replace(ServiceDescriptor.Singleton()); +#endif + } +} diff --git a/modules/payment/src/KonSoft.Payment.Domain/Properties/AssemblyInfo.cs b/modules/payment/src/KonSoft.Payment.Domain/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..2c6594d --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain/Properties/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using System.Runtime.CompilerServices; +[assembly:InternalsVisibleToAttribute("KonSoft.Payment.Domain.Tests")] +[assembly:InternalsVisibleToAttribute("KonSoft.Payment.TestBase")] diff --git a/modules/payment/src/KonSoft.Payment.Domain/Settings/PaymentSettingDefinitionProvider.cs b/modules/payment/src/KonSoft.Payment.Domain/Settings/PaymentSettingDefinitionProvider.cs new file mode 100644 index 0000000..59b8e51 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain/Settings/PaymentSettingDefinitionProvider.cs @@ -0,0 +1,12 @@ +using Volo.Abp.Settings; + +namespace KonSoft.Payment.Settings; + +public class PaymentSettingDefinitionProvider : SettingDefinitionProvider +{ + public override void Define(ISettingDefinitionContext context) + { + //Define your own settings here. Example: + //context.Add(new SettingDefinition(PaymentSettings.MySetting1)); + } +} diff --git a/modules/payment/src/KonSoft.Payment.Domain/Settings/PaymentSettings.cs b/modules/payment/src/KonSoft.Payment.Domain/Settings/PaymentSettings.cs new file mode 100644 index 0000000..07b3d18 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.Domain/Settings/PaymentSettings.cs @@ -0,0 +1,9 @@ +namespace KonSoft.Payment.Settings; + +public static class PaymentSettings +{ + private const string Prefix = "Payment"; + + //Add your own setting names here. Example: + //public const string MySetting1 = Prefix + ".MySetting1"; +} diff --git a/modules/payment/src/KonSoft.Payment.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCorePaymentDbSchemaMigrator.cs b/modules/payment/src/KonSoft.Payment.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCorePaymentDbSchemaMigrator.cs new file mode 100644 index 0000000..d96b923 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCorePaymentDbSchemaMigrator.cs @@ -0,0 +1,34 @@ +using System; +using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using KonSoft.Payment.Data; +using Volo.Abp.DependencyInjection; + +namespace KonSoft.Payment.EntityFrameworkCore; + +public class EntityFrameworkCorePaymentDbSchemaMigrator + : IPaymentDbSchemaMigrator, ITransientDependency +{ + private readonly IServiceProvider _serviceProvider; + + public EntityFrameworkCorePaymentDbSchemaMigrator( + IServiceProvider serviceProvider) + { + _serviceProvider = serviceProvider; + } + + public async Task MigrateAsync() + { + /* We intentionally resolve the PaymentDbContext + * from IServiceProvider (instead of directly injecting it) + * to properly get the connection string of the current tenant in the + * current scope. + */ + + await _serviceProvider + .GetRequiredService() + .Database + .MigrateAsync(); + } +} diff --git a/modules/payment/src/KonSoft.Payment.EntityFrameworkCore/EntityFrameworkCore/PaymentDbContext.cs b/modules/payment/src/KonSoft.Payment.EntityFrameworkCore/EntityFrameworkCore/PaymentDbContext.cs new file mode 100644 index 0000000..9aecc99 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.EntityFrameworkCore/EntityFrameworkCore/PaymentDbContext.cs @@ -0,0 +1,86 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp.AuditLogging.EntityFrameworkCore; +using Volo.Abp.BackgroundJobs.EntityFrameworkCore; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.FeatureManagement.EntityFrameworkCore; +using Volo.Abp.Identity; +using Volo.Abp.Identity.EntityFrameworkCore; +using Volo.Abp.OpenIddict.EntityFrameworkCore; +using Volo.Abp.PermissionManagement.EntityFrameworkCore; +using Volo.Abp.SettingManagement.EntityFrameworkCore; +using Volo.Abp.TenantManagement; +using Volo.Abp.TenantManagement.EntityFrameworkCore; + +namespace KonSoft.Payment.EntityFrameworkCore; + +[ReplaceDbContext(typeof(IIdentityDbContext))] +[ReplaceDbContext(typeof(ITenantManagementDbContext))] +[ConnectionStringName("Default")] +public class PaymentDbContext : + AbpDbContext, + IIdentityDbContext, + ITenantManagementDbContext +{ + /* Add DbSet properties for your Aggregate Roots / Entities here. */ + + #region Entities from the modules + + /* Notice: We only implemented IIdentityDbContext and ITenantManagementDbContext + * and replaced them for this DbContext. This allows you to perform JOIN + * queries for the entities of these modules over the repositories easily. You + * typically don't need that for other modules. But, if you need, you can + * implement the DbContext interface of the needed module and use ReplaceDbContext + * attribute just like IIdentityDbContext and ITenantManagementDbContext. + * + * More info: Replacing a DbContext of a module ensures that the related module + * uses this DbContext on runtime. Otherwise, it will use its own DbContext class. + */ + + //Identity + public DbSet Users { get; set; } + public DbSet Roles { get; set; } + public DbSet ClaimTypes { get; set; } + public DbSet OrganizationUnits { get; set; } + public DbSet SecurityLogs { get; set; } + public DbSet LinkUsers { get; set; } + public DbSet UserDelegations { get; set; } + public DbSet Sessions { get; set; } + // Tenant Management + public DbSet Tenants { get; set; } + public DbSet TenantConnectionStrings { get; set; } + + #endregion + + public PaymentDbContext(DbContextOptions options) + : base(options) + { + + } + + protected override void OnModelCreating(ModelBuilder builder) + { + base.OnModelCreating(builder); + + /* Include modules to your migration db context */ + + builder.ConfigurePermissionManagement(); + builder.ConfigureSettingManagement(); + builder.ConfigureBackgroundJobs(); + builder.ConfigureAuditLogging(); + builder.ConfigureIdentity(); + builder.ConfigureOpenIddict(); + builder.ConfigureFeatureManagement(); + builder.ConfigureTenantManagement(); + + /* Configure your own tables/entities inside here */ + + //builder.Entity(b => + //{ + // b.ToTable(PaymentConsts.DbTablePrefix + "YourEntities", PaymentConsts.DbSchema); + // b.ConfigureByConvention(); //auto configure for the base class props + // //... + //}); + } +} diff --git a/modules/payment/src/KonSoft.Payment.EntityFrameworkCore/EntityFrameworkCore/PaymentDbContextFactory.cs b/modules/payment/src/KonSoft.Payment.EntityFrameworkCore/EntityFrameworkCore/PaymentDbContextFactory.cs new file mode 100644 index 0000000..fc21917 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.EntityFrameworkCore/EntityFrameworkCore/PaymentDbContextFactory.cs @@ -0,0 +1,36 @@ +using System; +using System.IO; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Design; +using Microsoft.Extensions.Configuration; + +namespace KonSoft.Payment.EntityFrameworkCore; + +/* This class is needed for EF Core console commands + * (like Add-Migration and Update-Database commands) */ +public class PaymentDbContextFactory : IDesignTimeDbContextFactory +{ + public PaymentDbContext CreateDbContext(string[] args) + { + // https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic + AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); + + PaymentEfCoreEntityExtensionMappings.Configure(); + + var configuration = BuildConfiguration(); + + var builder = new DbContextOptionsBuilder() + .UseNpgsql(configuration.GetConnectionString("Default")); + + return new PaymentDbContext(builder.Options); + } + + private static IConfigurationRoot BuildConfiguration() + { + var builder = new ConfigurationBuilder() + .SetBasePath(Path.Combine(Directory.GetCurrentDirectory(), "../KonSoft.Payment.DbMigrator/")) + .AddJsonFile("appsettings.json", optional: false); + + return builder.Build(); + } +} diff --git a/modules/payment/src/KonSoft.Payment.EntityFrameworkCore/EntityFrameworkCore/PaymentEfCoreEntityExtensionMappings.cs b/modules/payment/src/KonSoft.Payment.EntityFrameworkCore/EntityFrameworkCore/PaymentEfCoreEntityExtensionMappings.cs new file mode 100644 index 0000000..9c70801 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.EntityFrameworkCore/EntityFrameworkCore/PaymentEfCoreEntityExtensionMappings.cs @@ -0,0 +1,44 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Identity; +using Volo.Abp.ObjectExtending; +using Volo.Abp.Threading; + +namespace KonSoft.Payment.EntityFrameworkCore; + +public static class PaymentEfCoreEntityExtensionMappings +{ + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + + public static void Configure() + { + PaymentGlobalFeatureConfigurator.Configure(); + PaymentModuleExtensionConfigurator.Configure(); + + OneTimeRunner.Run(() => + { + /* You can configure extra properties for the + * entities defined in the modules used by your application. + * + * This class can be used to map these extra properties to table fields in the database. + * + * USE THIS CLASS ONLY TO CONFIGURE EF CORE RELATED MAPPING. + * USE PaymentModuleExtensionConfigurator CLASS (in the Domain.Shared project) + * FOR A HIGH LEVEL API TO DEFINE EXTRA PROPERTIES TO ENTITIES OF THE USED MODULES + * + * Example: Map a property to a table field: + + ObjectExtensionManager.Instance + .MapEfCoreProperty( + "MyProperty", + (entityBuilder, propertyBuilder) => + { + propertyBuilder.HasMaxLength(128); + } + ); + + * See the documentation for more: + * https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Extending-Entities + */ + }); + } +} diff --git a/modules/payment/src/KonSoft.Payment.EntityFrameworkCore/EntityFrameworkCore/PaymentEntityFrameworkCoreModule.cs b/modules/payment/src/KonSoft.Payment.EntityFrameworkCore/EntityFrameworkCore/PaymentEntityFrameworkCoreModule.cs new file mode 100644 index 0000000..6b196a8 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.EntityFrameworkCore/EntityFrameworkCore/PaymentEntityFrameworkCoreModule.cs @@ -0,0 +1,57 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Uow; +using Volo.Abp.AuditLogging.EntityFrameworkCore; +using Volo.Abp.BackgroundJobs.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.PostgreSql; +using Volo.Abp.FeatureManagement.EntityFrameworkCore; +using Volo.Abp.Identity.EntityFrameworkCore; +using Volo.Abp.Modularity; +using Volo.Abp.OpenIddict.EntityFrameworkCore; +using Volo.Abp.PermissionManagement.EntityFrameworkCore; +using Volo.Abp.SettingManagement.EntityFrameworkCore; +using Volo.Abp.TenantManagement.EntityFrameworkCore; + +namespace KonSoft.Payment.EntityFrameworkCore; + +[DependsOn( + typeof(PaymentDomainModule), + typeof(AbpIdentityEntityFrameworkCoreModule), + typeof(AbpOpenIddictEntityFrameworkCoreModule), + typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpSettingManagementEntityFrameworkCoreModule), + typeof(AbpEntityFrameworkCorePostgreSqlModule), + typeof(AbpBackgroundJobsEntityFrameworkCoreModule), + typeof(AbpAuditLoggingEntityFrameworkCoreModule), + typeof(AbpTenantManagementEntityFrameworkCoreModule), + typeof(AbpFeatureManagementEntityFrameworkCoreModule) + )] +public class PaymentEntityFrameworkCoreModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + // https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic + AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); + + PaymentEfCoreEntityExtensionMappings.Configure(); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAbpDbContext(options => + { + /* Remove "includeAllEntities: true" to create + * default repositories only for aggregate roots */ + options.AddDefaultRepositories(includeAllEntities: true); + }); + + Configure(options => + { + /* The main point to change your DBMS. + * See also PaymentMigrationsDbContextFactory for EF Core tooling. */ + options.UseNpgsql(); + }); + + } +} diff --git a/modules/payment/src/KonSoft.Payment.EntityFrameworkCore/KonSoft.Payment.EntityFrameworkCore.csproj b/modules/payment/src/KonSoft.Payment.EntityFrameworkCore/KonSoft.Payment.EntityFrameworkCore.csproj new file mode 100644 index 0000000..b1ec0b7 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.EntityFrameworkCore/KonSoft.Payment.EntityFrameworkCore.csproj @@ -0,0 +1,31 @@ + + + + + + net8.0 + enable + KonSoft.Payment + + + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers + + + + diff --git a/modules/payment/src/KonSoft.Payment.EntityFrameworkCore/Migrations/20250908052440_Initial.Designer.cs b/modules/payment/src/KonSoft.Payment.EntityFrameworkCore/Migrations/20250908052440_Initial.Designer.cs new file mode 100644 index 0000000..0eefc2a --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.EntityFrameworkCore/Migrations/20250908052440_Initial.Designer.cs @@ -0,0 +1,2006 @@ +// +using System; +using KonSoft.Payment.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace KonSoft.Payment.Migrations +{ + [DbContext(typeof(PaymentDbContext))] + [Migration("20250908052440_Initial")] + partial class Initial + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.PostgreSql) + .HasAnnotation("ProductVersion", "8.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("character varying(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("text"); + + b.Property("ExecutionDuration") + .HasColumnType("integer") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("timestamp without time zone"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("integer") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("uuid") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("uuid") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("uuid") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AuditLogId") + .HasColumnType("uuid") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("integer") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AuditLogId") + .HasColumnType("uuid") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("smallint") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("uuid"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("EntityChangeId") + .HasColumnType("uuid"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("character varying(1048576)"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("LastTryTime") + .HasColumnType("timestamp without time zone"); + + b.Property("NextTryTime") + .HasColumnType("timestamp without time zone"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("boolean"); + + b.Property("IsVisibleToClients") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("Required") + .HasColumnType("boolean"); + + b.Property("ValueType") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("SourceTenantId") + .HasColumnType("uuid"); + + b.Property("SourceUserId") + .HasColumnType("uuid"); + + b.Property("TargetTenantId") + .HasColumnType("uuid"); + + b.Property("TargetUserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("boolean") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("boolean") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("boolean") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("character varying(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("character varying(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("character varying(96)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySession", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Device") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("DeviceInfo") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("IpAddresses") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("LastAccessed") + .HasColumnType("timestamp without time zone"); + + b.Property("SessionId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("SignedIn") + .HasColumnType("timestamp without time zone"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("Device"); + + b.HasIndex("SessionId"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSessions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("boolean") + .HasColumnName("IsActive"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("LastPasswordChangeTime") + .HasColumnType("timestamp with time zone"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("SecurityStamp"); + + b.Property("ShouldChangePasswordOnNextLogin") + .HasColumnType("boolean"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserDelegation", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("EndTime") + .HasColumnType("timestamp without time zone"); + + b.Property("SourceUserId") + .HasColumnType("uuid"); + + b.Property("StartTime") + .HasColumnType("timestamp without time zone"); + + b.Property("TargetUserId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AbpUserDelegations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("character varying(196)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uuid"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("character varying(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("DisplayName"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uuid"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("ClientId") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("ClientSecret") + .HasColumnType("text"); + + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("ClientUri") + .HasColumnType("text"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .HasColumnType("text"); + + b.Property("DisplayNames") + .HasColumnType("text"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("JsonWebKeySet") + .HasColumnType("text"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasColumnType("text"); + + b.Property("Permissions") + .HasColumnType("text"); + + b.Property("PostLogoutRedirectUris") + .HasColumnType("text"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("RedirectUris") + .HasColumnType("text"); + + b.Property("Requirements") + .HasColumnType("text"); + + b.Property("Settings") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("OpenIddictApplications", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationId") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("timestamp without time zone"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("Scopes") + .HasColumnType("text"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("character varying(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictAuthorizations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Scopes.OpenIddictScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Descriptions") + .HasColumnType("text"); + + b.Property("DisplayName") + .HasColumnType("text"); + + b.Property("DisplayNames") + .HasColumnType("text"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("Resources") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("OpenIddictScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationId") + .HasColumnType("uuid"); + + b.Property("AuthorizationId") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("timestamp without time zone"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("ExpirationDate") + .HasColumnType("timestamp without time zone"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Payload") + .HasColumnType("text"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("RedemptionDate") + .HasColumnType("timestamp without time zone"); + + b.Property("ReferenceId") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("character varying(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.HasKey("Id"); + + b.HasIndex("AuthorizationId"); + + b.HasIndex("ReferenceId"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("IsEnabled") + .HasColumnType("boolean"); + + b.Property("MultiTenancySide") + .HasColumnType("smallint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.SettingDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DefaultValue") + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.Property("Description") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsEncrypted") + .HasColumnType("boolean"); + + b.Property("IsInherited") + .HasColumnType("boolean"); + + b.Property("IsVisibleToClients") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("Providers") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpSettingDefinitions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("uuid"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + + b.HasOne("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", null) + .WithMany() + .HasForeignKey("AuthorizationId"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/modules/payment/src/KonSoft.Payment.EntityFrameworkCore/Migrations/20250908052440_Initial.cs b/modules/payment/src/KonSoft.Payment.EntityFrameworkCore/Migrations/20250908052440_Initial.cs new file mode 100644 index 0000000..00846bf --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.EntityFrameworkCore/Migrations/20250908052440_Initial.cs @@ -0,0 +1,1156 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace KonSoft.Payment.Migrations +{ + /// + public partial class Initial : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "AbpAuditLogs", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + ApplicationName = table.Column(type: "character varying(96)", maxLength: 96, nullable: true), + UserId = table.Column(type: "uuid", nullable: true), + UserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + TenantId = table.Column(type: "uuid", nullable: true), + TenantName = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + ImpersonatorUserId = table.Column(type: "uuid", nullable: true), + ImpersonatorUserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + ImpersonatorTenantId = table.Column(type: "uuid", nullable: true), + ImpersonatorTenantName = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + ExecutionTime = table.Column(type: "timestamp without time zone", nullable: false), + ExecutionDuration = table.Column(type: "integer", nullable: false), + ClientIpAddress = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + ClientName = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + ClientId = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + CorrelationId = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + BrowserInfo = table.Column(type: "character varying(512)", maxLength: 512, nullable: true), + HttpMethod = table.Column(type: "character varying(16)", maxLength: 16, nullable: true), + Url = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + Exceptions = table.Column(type: "text", nullable: true), + Comments = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + HttpStatusCode = table.Column(type: "integer", nullable: true), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpAuditLogs", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpBackgroundJobs", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + JobName = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + JobArgs = table.Column(type: "character varying(1048576)", maxLength: 1048576, nullable: false), + TryCount = table.Column(type: "smallint", nullable: false, defaultValue: (short)0), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + NextTryTime = table.Column(type: "timestamp without time zone", nullable: false), + LastTryTime = table.Column(type: "timestamp without time zone", nullable: true), + IsAbandoned = table.Column(type: "boolean", nullable: false, defaultValue: false), + Priority = table.Column(type: "smallint", nullable: false, defaultValue: (byte)15), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpBackgroundJobs", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpClaimTypes", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + Required = table.Column(type: "boolean", nullable: false), + IsStatic = table.Column(type: "boolean", nullable: false), + Regex = table.Column(type: "character varying(512)", maxLength: 512, nullable: true), + RegexDescription = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + Description = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + ValueType = table.Column(type: "integer", nullable: false), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpClaimTypes", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpFeatureGroups", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + DisplayName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + ExtraProperties = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpFeatureGroups", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpFeatures", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + GroupName = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + ParentName = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + DisplayName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + Description = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + DefaultValue = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + IsVisibleToClients = table.Column(type: "boolean", nullable: false), + IsAvailableToHost = table.Column(type: "boolean", nullable: false), + AllowedProviders = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + ValueType = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: true), + ExtraProperties = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpFeatures", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpFeatureValues", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + Value = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + ProviderName = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + ProviderKey = table.Column(type: "character varying(64)", maxLength: 64, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpFeatureValues", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpLinkUsers", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + SourceUserId = table.Column(type: "uuid", nullable: false), + SourceTenantId = table.Column(type: "uuid", nullable: true), + TargetUserId = table.Column(type: "uuid", nullable: false), + TargetTenantId = table.Column(type: "uuid", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpLinkUsers", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpOrganizationUnits", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + ParentId = table.Column(type: "uuid", nullable: true), + Code = table.Column(type: "character varying(95)", maxLength: 95, nullable: false), + DisplayName = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + EntityVersion = table.Column(type: "integer", nullable: false), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp without time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpOrganizationUnits", x => x.Id); + table.ForeignKey( + name: "FK_AbpOrganizationUnits_AbpOrganizationUnits_ParentId", + column: x => x.ParentId, + principalTable: "AbpOrganizationUnits", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "AbpPermissionGrants", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + ProviderName = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + ProviderKey = table.Column(type: "character varying(64)", maxLength: 64, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpPermissionGroups", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + DisplayName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + ExtraProperties = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissionGroups", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpPermissions", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + GroupName = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + ParentName = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + DisplayName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + IsEnabled = table.Column(type: "boolean", nullable: false), + MultiTenancySide = table.Column(type: "smallint", nullable: false), + Providers = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + StateCheckers = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + ExtraProperties = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissions", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpRoles", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + Name = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + NormalizedName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + IsDefault = table.Column(type: "boolean", nullable: false), + IsStatic = table.Column(type: "boolean", nullable: false), + IsPublic = table.Column(type: "boolean", nullable: false), + EntityVersion = table.Column(type: "integer", nullable: false), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpRoles", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpSecurityLogs", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + ApplicationName = table.Column(type: "character varying(96)", maxLength: 96, nullable: true), + Identity = table.Column(type: "character varying(96)", maxLength: 96, nullable: true), + Action = table.Column(type: "character varying(96)", maxLength: 96, nullable: true), + UserId = table.Column(type: "uuid", nullable: true), + UserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + TenantName = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + ClientId = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + CorrelationId = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + ClientIpAddress = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + BrowserInfo = table.Column(type: "character varying(512)", maxLength: 512, nullable: true), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpSecurityLogs", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpSessions", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + SessionId = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + Device = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + DeviceInfo = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + TenantId = table.Column(type: "uuid", nullable: true), + UserId = table.Column(type: "uuid", nullable: false), + ClientId = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + IpAddresses = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + SignedIn = table.Column(type: "timestamp without time zone", nullable: false), + LastAccessed = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpSessions", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpSettingDefinitions", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + DisplayName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + Description = table.Column(type: "character varying(512)", maxLength: 512, nullable: true), + DefaultValue = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: true), + IsVisibleToClients = table.Column(type: "boolean", nullable: false), + Providers = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: true), + IsInherited = table.Column(type: "boolean", nullable: false), + IsEncrypted = table.Column(type: "boolean", nullable: false), + ExtraProperties = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpSettingDefinitions", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpSettings", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + Value = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: false), + ProviderName = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + ProviderKey = table.Column(type: "character varying(64)", maxLength: 64, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpSettings", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpTenants", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + NormalizedName = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + EntityVersion = table.Column(type: "integer", nullable: false), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp without time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpTenants", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpUserDelegations", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + SourceUserId = table.Column(type: "uuid", nullable: false), + TargetUserId = table.Column(type: "uuid", nullable: false), + StartTime = table.Column(type: "timestamp without time zone", nullable: false), + EndTime = table.Column(type: "timestamp without time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserDelegations", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpUsers", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + UserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + NormalizedUserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + Name = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + Surname = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + Email = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + NormalizedEmail = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + EmailConfirmed = table.Column(type: "boolean", nullable: false, defaultValue: false), + PasswordHash = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + SecurityStamp = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + IsExternal = table.Column(type: "boolean", nullable: false, defaultValue: false), + PhoneNumber = table.Column(type: "character varying(16)", maxLength: 16, nullable: true), + PhoneNumberConfirmed = table.Column(type: "boolean", nullable: false, defaultValue: false), + IsActive = table.Column(type: "boolean", nullable: false), + TwoFactorEnabled = table.Column(type: "boolean", nullable: false, defaultValue: false), + LockoutEnd = table.Column(type: "timestamp with time zone", nullable: true), + LockoutEnabled = table.Column(type: "boolean", nullable: false, defaultValue: false), + AccessFailedCount = table.Column(type: "integer", nullable: false, defaultValue: 0), + ShouldChangePasswordOnNextLogin = table.Column(type: "boolean", nullable: false), + EntityVersion = table.Column(type: "integer", nullable: false), + LastPasswordChangeTime = table.Column(type: "timestamp with time zone", nullable: true), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp without time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUsers", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "OpenIddictApplications", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + ApplicationType = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), + ClientId = table.Column(type: "character varying(100)", maxLength: 100, nullable: true), + ClientSecret = table.Column(type: "text", nullable: true), + ClientType = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), + ConsentType = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), + DisplayName = table.Column(type: "text", nullable: true), + DisplayNames = table.Column(type: "text", nullable: true), + JsonWebKeySet = table.Column(type: "text", nullable: true), + Permissions = table.Column(type: "text", nullable: true), + PostLogoutRedirectUris = table.Column(type: "text", nullable: true), + Properties = table.Column(type: "text", nullable: true), + RedirectUris = table.Column(type: "text", nullable: true), + Requirements = table.Column(type: "text", nullable: true), + Settings = table.Column(type: "text", nullable: true), + ClientUri = table.Column(type: "text", nullable: true), + LogoUri = table.Column(type: "text", nullable: true), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp without time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_OpenIddictApplications", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "OpenIddictScopes", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Description = table.Column(type: "text", nullable: true), + Descriptions = table.Column(type: "text", nullable: true), + DisplayName = table.Column(type: "text", nullable: true), + DisplayNames = table.Column(type: "text", nullable: true), + Name = table.Column(type: "character varying(200)", maxLength: 200, nullable: true), + Properties = table.Column(type: "text", nullable: true), + Resources = table.Column(type: "text", nullable: true), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp without time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_OpenIddictScopes", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpAuditLogActions", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + AuditLogId = table.Column(type: "uuid", nullable: false), + ServiceName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + MethodName = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + Parameters = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: true), + ExecutionTime = table.Column(type: "timestamp without time zone", nullable: false), + ExecutionDuration = table.Column(type: "integer", nullable: false), + ExtraProperties = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpAuditLogActions", x => x.Id); + table.ForeignKey( + name: "FK_AbpAuditLogActions_AbpAuditLogs_AuditLogId", + column: x => x.AuditLogId, + principalTable: "AbpAuditLogs", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpEntityChanges", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + AuditLogId = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + ChangeTime = table.Column(type: "timestamp without time zone", nullable: false), + ChangeType = table.Column(type: "smallint", nullable: false), + EntityTenantId = table.Column(type: "uuid", nullable: true), + EntityId = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + EntityTypeFullName = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + ExtraProperties = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpEntityChanges", x => x.Id); + table.ForeignKey( + name: "FK_AbpEntityChanges_AbpAuditLogs_AuditLogId", + column: x => x.AuditLogId, + principalTable: "AbpAuditLogs", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpOrganizationUnitRoles", + columns: table => new + { + RoleId = table.Column(type: "uuid", nullable: false), + OrganizationUnitId = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpOrganizationUnitRoles", x => new { x.OrganizationUnitId, x.RoleId }); + table.ForeignKey( + name: "FK_AbpOrganizationUnitRoles_AbpOrganizationUnits_OrganizationU~", + column: x => x.OrganizationUnitId, + principalTable: "AbpOrganizationUnits", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_AbpOrganizationUnitRoles_AbpRoles_RoleId", + column: x => x.RoleId, + principalTable: "AbpRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpRoleClaims", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + RoleId = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + ClaimType = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + ClaimValue = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpRoleClaims", x => x.Id); + table.ForeignKey( + name: "FK_AbpRoleClaims_AbpRoles_RoleId", + column: x => x.RoleId, + principalTable: "AbpRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpTenantConnectionStrings", + columns: table => new + { + TenantId = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + Value = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpTenantConnectionStrings", x => new { x.TenantId, x.Name }); + table.ForeignKey( + name: "FK_AbpTenantConnectionStrings_AbpTenants_TenantId", + column: x => x.TenantId, + principalTable: "AbpTenants", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserClaims", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + UserId = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + ClaimType = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + ClaimValue = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserClaims", x => x.Id); + table.ForeignKey( + name: "FK_AbpUserClaims_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserLogins", + columns: table => new + { + UserId = table.Column(type: "uuid", nullable: false), + LoginProvider = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + ProviderKey = table.Column(type: "character varying(196)", maxLength: 196, nullable: false), + ProviderDisplayName = table.Column(type: "character varying(128)", maxLength: 128, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserLogins", x => new { x.UserId, x.LoginProvider }); + table.ForeignKey( + name: "FK_AbpUserLogins_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserOrganizationUnits", + columns: table => new + { + UserId = table.Column(type: "uuid", nullable: false), + OrganizationUnitId = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserOrganizationUnits", x => new { x.OrganizationUnitId, x.UserId }); + table.ForeignKey( + name: "FK_AbpUserOrganizationUnits_AbpOrganizationUnits_OrganizationU~", + column: x => x.OrganizationUnitId, + principalTable: "AbpOrganizationUnits", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_AbpUserOrganizationUnits_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserRoles", + columns: table => new + { + UserId = table.Column(type: "uuid", nullable: false), + RoleId = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserRoles", x => new { x.UserId, x.RoleId }); + table.ForeignKey( + name: "FK_AbpUserRoles_AbpRoles_RoleId", + column: x => x.RoleId, + principalTable: "AbpRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_AbpUserRoles_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserTokens", + columns: table => new + { + UserId = table.Column(type: "uuid", nullable: false), + LoginProvider = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + Value = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); + table.ForeignKey( + name: "FK_AbpUserTokens_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "OpenIddictAuthorizations", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + ApplicationId = table.Column(type: "uuid", nullable: true), + CreationDate = table.Column(type: "timestamp without time zone", nullable: true), + Properties = table.Column(type: "text", nullable: true), + Scopes = table.Column(type: "text", nullable: true), + Status = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), + Subject = table.Column(type: "character varying(400)", maxLength: 400, nullable: true), + Type = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp without time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_OpenIddictAuthorizations", x => x.Id); + table.ForeignKey( + name: "FK_OpenIddictAuthorizations_OpenIddictApplications_Application~", + column: x => x.ApplicationId, + principalTable: "OpenIddictApplications", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "AbpEntityPropertyChanges", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + EntityChangeId = table.Column(type: "uuid", nullable: false), + NewValue = table.Column(type: "character varying(512)", maxLength: 512, nullable: true), + OriginalValue = table.Column(type: "character varying(512)", maxLength: 512, nullable: true), + PropertyName = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + PropertyTypeFullName = table.Column(type: "character varying(64)", maxLength: 64, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpEntityPropertyChanges", x => x.Id); + table.ForeignKey( + name: "FK_AbpEntityPropertyChanges_AbpEntityChanges_EntityChangeId", + column: x => x.EntityChangeId, + principalTable: "AbpEntityChanges", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "OpenIddictTokens", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + ApplicationId = table.Column(type: "uuid", nullable: true), + AuthorizationId = table.Column(type: "uuid", nullable: true), + CreationDate = table.Column(type: "timestamp without time zone", nullable: true), + ExpirationDate = table.Column(type: "timestamp without time zone", nullable: true), + Payload = table.Column(type: "text", nullable: true), + Properties = table.Column(type: "text", nullable: true), + RedemptionDate = table.Column(type: "timestamp without time zone", nullable: true), + ReferenceId = table.Column(type: "character varying(100)", maxLength: 100, nullable: true), + Status = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), + Subject = table.Column(type: "character varying(400)", maxLength: 400, nullable: true), + Type = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp without time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_OpenIddictTokens", x => x.Id); + table.ForeignKey( + name: "FK_OpenIddictTokens_OpenIddictApplications_ApplicationId", + column: x => x.ApplicationId, + principalTable: "OpenIddictApplications", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_OpenIddictTokens_OpenIddictAuthorizations_AuthorizationId", + column: x => x.AuthorizationId, + principalTable: "OpenIddictAuthorizations", + principalColumn: "Id"); + }); + + migrationBuilder.CreateIndex( + name: "IX_AbpAuditLogActions_AuditLogId", + table: "AbpAuditLogActions", + column: "AuditLogId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpAuditLogActions_TenantId_ServiceName_MethodName_Executio~", + table: "AbpAuditLogActions", + columns: new[] { "TenantId", "ServiceName", "MethodName", "ExecutionTime" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpAuditLogs_TenantId_ExecutionTime", + table: "AbpAuditLogs", + columns: new[] { "TenantId", "ExecutionTime" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpAuditLogs_TenantId_UserId_ExecutionTime", + table: "AbpAuditLogs", + columns: new[] { "TenantId", "UserId", "ExecutionTime" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpBackgroundJobs_IsAbandoned_NextTryTime", + table: "AbpBackgroundJobs", + columns: new[] { "IsAbandoned", "NextTryTime" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpEntityChanges_AuditLogId", + table: "AbpEntityChanges", + column: "AuditLogId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpEntityChanges_TenantId_EntityTypeFullName_EntityId", + table: "AbpEntityChanges", + columns: new[] { "TenantId", "EntityTypeFullName", "EntityId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpEntityPropertyChanges_EntityChangeId", + table: "AbpEntityPropertyChanges", + column: "EntityChangeId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatureGroups_Name", + table: "AbpFeatureGroups", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatures_GroupName", + table: "AbpFeatures", + column: "GroupName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatures_Name", + table: "AbpFeatures", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatureValues_Name_ProviderName_ProviderKey", + table: "AbpFeatureValues", + columns: new[] { "Name", "ProviderName", "ProviderKey" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpLinkUsers_SourceUserId_SourceTenantId_TargetUserId_Targe~", + table: "AbpLinkUsers", + columns: new[] { "SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpOrganizationUnitRoles_RoleId_OrganizationUnitId", + table: "AbpOrganizationUnitRoles", + columns: new[] { "RoleId", "OrganizationUnitId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpOrganizationUnits_Code", + table: "AbpOrganizationUnits", + column: "Code"); + + migrationBuilder.CreateIndex( + name: "IX_AbpOrganizationUnits_ParentId", + table: "AbpOrganizationUnits", + column: "ParentId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissionGrants_TenantId_Name_ProviderName_ProviderKey", + table: "AbpPermissionGrants", + columns: new[] { "TenantId", "Name", "ProviderName", "ProviderKey" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissionGroups_Name", + table: "AbpPermissionGroups", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissions_GroupName", + table: "AbpPermissions", + column: "GroupName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissions_Name", + table: "AbpPermissions", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpRoleClaims_RoleId", + table: "AbpRoleClaims", + column: "RoleId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpRoles_NormalizedName", + table: "AbpRoles", + column: "NormalizedName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpSecurityLogs_TenantId_Action", + table: "AbpSecurityLogs", + columns: new[] { "TenantId", "Action" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpSecurityLogs_TenantId_ApplicationName", + table: "AbpSecurityLogs", + columns: new[] { "TenantId", "ApplicationName" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpSecurityLogs_TenantId_Identity", + table: "AbpSecurityLogs", + columns: new[] { "TenantId", "Identity" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpSecurityLogs_TenantId_UserId", + table: "AbpSecurityLogs", + columns: new[] { "TenantId", "UserId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpSessions_Device", + table: "AbpSessions", + column: "Device"); + + migrationBuilder.CreateIndex( + name: "IX_AbpSessions_SessionId", + table: "AbpSessions", + column: "SessionId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpSessions_TenantId_UserId", + table: "AbpSessions", + columns: new[] { "TenantId", "UserId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpSettingDefinitions_Name", + table: "AbpSettingDefinitions", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpSettings_Name_ProviderName_ProviderKey", + table: "AbpSettings", + columns: new[] { "Name", "ProviderName", "ProviderKey" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpTenants_Name", + table: "AbpTenants", + column: "Name"); + + migrationBuilder.CreateIndex( + name: "IX_AbpTenants_NormalizedName", + table: "AbpTenants", + column: "NormalizedName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUserClaims_UserId", + table: "AbpUserClaims", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUserLogins_LoginProvider_ProviderKey", + table: "AbpUserLogins", + columns: new[] { "LoginProvider", "ProviderKey" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpUserOrganizationUnits_UserId_OrganizationUnitId", + table: "AbpUserOrganizationUnits", + columns: new[] { "UserId", "OrganizationUnitId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpUserRoles_RoleId_UserId", + table: "AbpUserRoles", + columns: new[] { "RoleId", "UserId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_Email", + table: "AbpUsers", + column: "Email"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_NormalizedEmail", + table: "AbpUsers", + column: "NormalizedEmail"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_NormalizedUserName", + table: "AbpUsers", + column: "NormalizedUserName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_UserName", + table: "AbpUsers", + column: "UserName"); + + migrationBuilder.CreateIndex( + name: "IX_OpenIddictApplications_ClientId", + table: "OpenIddictApplications", + column: "ClientId"); + + migrationBuilder.CreateIndex( + name: "IX_OpenIddictAuthorizations_ApplicationId_Status_Subject_Type", + table: "OpenIddictAuthorizations", + columns: new[] { "ApplicationId", "Status", "Subject", "Type" }); + + migrationBuilder.CreateIndex( + name: "IX_OpenIddictScopes_Name", + table: "OpenIddictScopes", + column: "Name"); + + migrationBuilder.CreateIndex( + name: "IX_OpenIddictTokens_ApplicationId_Status_Subject_Type", + table: "OpenIddictTokens", + columns: new[] { "ApplicationId", "Status", "Subject", "Type" }); + + migrationBuilder.CreateIndex( + name: "IX_OpenIddictTokens_AuthorizationId", + table: "OpenIddictTokens", + column: "AuthorizationId"); + + migrationBuilder.CreateIndex( + name: "IX_OpenIddictTokens_ReferenceId", + table: "OpenIddictTokens", + column: "ReferenceId"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AbpAuditLogActions"); + + migrationBuilder.DropTable( + name: "AbpBackgroundJobs"); + + migrationBuilder.DropTable( + name: "AbpClaimTypes"); + + migrationBuilder.DropTable( + name: "AbpEntityPropertyChanges"); + + migrationBuilder.DropTable( + name: "AbpFeatureGroups"); + + migrationBuilder.DropTable( + name: "AbpFeatures"); + + migrationBuilder.DropTable( + name: "AbpFeatureValues"); + + migrationBuilder.DropTable( + name: "AbpLinkUsers"); + + migrationBuilder.DropTable( + name: "AbpOrganizationUnitRoles"); + + migrationBuilder.DropTable( + name: "AbpPermissionGrants"); + + migrationBuilder.DropTable( + name: "AbpPermissionGroups"); + + migrationBuilder.DropTable( + name: "AbpPermissions"); + + migrationBuilder.DropTable( + name: "AbpRoleClaims"); + + migrationBuilder.DropTable( + name: "AbpSecurityLogs"); + + migrationBuilder.DropTable( + name: "AbpSessions"); + + migrationBuilder.DropTable( + name: "AbpSettingDefinitions"); + + migrationBuilder.DropTable( + name: "AbpSettings"); + + migrationBuilder.DropTable( + name: "AbpTenantConnectionStrings"); + + migrationBuilder.DropTable( + name: "AbpUserClaims"); + + migrationBuilder.DropTable( + name: "AbpUserDelegations"); + + migrationBuilder.DropTable( + name: "AbpUserLogins"); + + migrationBuilder.DropTable( + name: "AbpUserOrganizationUnits"); + + migrationBuilder.DropTable( + name: "AbpUserRoles"); + + migrationBuilder.DropTable( + name: "AbpUserTokens"); + + migrationBuilder.DropTable( + name: "OpenIddictScopes"); + + migrationBuilder.DropTable( + name: "OpenIddictTokens"); + + migrationBuilder.DropTable( + name: "AbpEntityChanges"); + + migrationBuilder.DropTable( + name: "AbpTenants"); + + migrationBuilder.DropTable( + name: "AbpOrganizationUnits"); + + migrationBuilder.DropTable( + name: "AbpRoles"); + + migrationBuilder.DropTable( + name: "AbpUsers"); + + migrationBuilder.DropTable( + name: "OpenIddictAuthorizations"); + + migrationBuilder.DropTable( + name: "AbpAuditLogs"); + + migrationBuilder.DropTable( + name: "OpenIddictApplications"); + } + } +} diff --git a/modules/payment/src/KonSoft.Payment.EntityFrameworkCore/Migrations/PaymentDbContextModelSnapshot.cs b/modules/payment/src/KonSoft.Payment.EntityFrameworkCore/Migrations/PaymentDbContextModelSnapshot.cs new file mode 100644 index 0000000..e65c7ae --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.EntityFrameworkCore/Migrations/PaymentDbContextModelSnapshot.cs @@ -0,0 +1,2003 @@ +// +using System; +using KonSoft.Payment.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace KonSoft.Payment.Migrations +{ + [DbContext(typeof(PaymentDbContext))] + partial class PaymentDbContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.PostgreSql) + .HasAnnotation("ProductVersion", "8.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("character varying(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("text"); + + b.Property("ExecutionDuration") + .HasColumnType("integer") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("timestamp without time zone"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("integer") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("uuid") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("uuid") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("uuid") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AuditLogId") + .HasColumnType("uuid") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("integer") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AuditLogId") + .HasColumnType("uuid") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("smallint") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("uuid"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("EntityChangeId") + .HasColumnType("uuid"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("character varying(1048576)"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("LastTryTime") + .HasColumnType("timestamp without time zone"); + + b.Property("NextTryTime") + .HasColumnType("timestamp without time zone"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("boolean"); + + b.Property("IsVisibleToClients") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("Required") + .HasColumnType("boolean"); + + b.Property("ValueType") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("SourceTenantId") + .HasColumnType("uuid"); + + b.Property("SourceUserId") + .HasColumnType("uuid"); + + b.Property("TargetTenantId") + .HasColumnType("uuid"); + + b.Property("TargetUserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("boolean") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("boolean") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("boolean") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("character varying(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("character varying(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("character varying(96)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySession", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Device") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("DeviceInfo") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("IpAddresses") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("LastAccessed") + .HasColumnType("timestamp without time zone"); + + b.Property("SessionId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("SignedIn") + .HasColumnType("timestamp without time zone"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("Device"); + + b.HasIndex("SessionId"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSessions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("boolean") + .HasColumnName("IsActive"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("LastPasswordChangeTime") + .HasColumnType("timestamp with time zone"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("SecurityStamp"); + + b.Property("ShouldChangePasswordOnNextLogin") + .HasColumnType("boolean"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserDelegation", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("EndTime") + .HasColumnType("timestamp without time zone"); + + b.Property("SourceUserId") + .HasColumnType("uuid"); + + b.Property("StartTime") + .HasColumnType("timestamp without time zone"); + + b.Property("TargetUserId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AbpUserDelegations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("character varying(196)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uuid"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("character varying(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("DisplayName"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uuid"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("ClientId") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("ClientSecret") + .HasColumnType("text"); + + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("ClientUri") + .HasColumnType("text"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .HasColumnType("text"); + + b.Property("DisplayNames") + .HasColumnType("text"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("JsonWebKeySet") + .HasColumnType("text"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasColumnType("text"); + + b.Property("Permissions") + .HasColumnType("text"); + + b.Property("PostLogoutRedirectUris") + .HasColumnType("text"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("RedirectUris") + .HasColumnType("text"); + + b.Property("Requirements") + .HasColumnType("text"); + + b.Property("Settings") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("OpenIddictApplications", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationId") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("timestamp without time zone"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("Scopes") + .HasColumnType("text"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("character varying(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictAuthorizations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Scopes.OpenIddictScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Descriptions") + .HasColumnType("text"); + + b.Property("DisplayName") + .HasColumnType("text"); + + b.Property("DisplayNames") + .HasColumnType("text"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("Resources") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("OpenIddictScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationId") + .HasColumnType("uuid"); + + b.Property("AuthorizationId") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("timestamp without time zone"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("ExpirationDate") + .HasColumnType("timestamp without time zone"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Payload") + .HasColumnType("text"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("RedemptionDate") + .HasColumnType("timestamp without time zone"); + + b.Property("ReferenceId") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("character varying(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.HasKey("Id"); + + b.HasIndex("AuthorizationId"); + + b.HasIndex("ReferenceId"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("IsEnabled") + .HasColumnType("boolean"); + + b.Property("MultiTenancySide") + .HasColumnType("smallint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.SettingDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DefaultValue") + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.Property("Description") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsEncrypted") + .HasColumnType("boolean"); + + b.Property("IsInherited") + .HasColumnType("boolean"); + + b.Property("IsVisibleToClients") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("Providers") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpSettingDefinitions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("uuid"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + + b.HasOne("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", null) + .WithMany() + .HasForeignKey("AuthorizationId"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/modules/payment/src/KonSoft.Payment.EntityFrameworkCore/Properties/AssemblyInfo.cs b/modules/payment/src/KonSoft.Payment.EntityFrameworkCore/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..cf32d3b --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.EntityFrameworkCore/Properties/AssemblyInfo.cs @@ -0,0 +1,2 @@ +using System.Runtime.CompilerServices; +[assembly:InternalsVisibleToAttribute("KonSoft.Payment.EntityFrameworkCore.Tests")] diff --git a/modules/payment/src/KonSoft.Payment.HttpApi.Client/KonSoft.Payment.HttpApi.Client.csproj b/modules/payment/src/KonSoft.Payment.HttpApi.Client/KonSoft.Payment.HttpApi.Client.csproj new file mode 100644 index 0000000..59ef0ab --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.HttpApi.Client/KonSoft.Payment.HttpApi.Client.csproj @@ -0,0 +1,29 @@ + + + + + + net8.0 + enable + KonSoft.Payment + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/payment/src/KonSoft.Payment.HttpApi.Client/PaymentHttpApiClientModule.cs b/modules/payment/src/KonSoft.Payment.HttpApi.Client/PaymentHttpApiClientModule.cs new file mode 100644 index 0000000..bbdeb31 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.HttpApi.Client/PaymentHttpApiClientModule.cs @@ -0,0 +1,38 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Account; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; +using Volo.Abp.PermissionManagement; +using Volo.Abp.TenantManagement; +using Volo.Abp.SettingManagement; +using Volo.Abp.VirtualFileSystem; + +namespace KonSoft.Payment; + +[DependsOn( + typeof(PaymentApplicationContractsModule), + typeof(AbpAccountHttpApiClientModule), + typeof(AbpIdentityHttpApiClientModule), + typeof(AbpPermissionManagementHttpApiClientModule), + typeof(AbpTenantManagementHttpApiClientModule), + typeof(AbpFeatureManagementHttpApiClientModule), + typeof(AbpSettingManagementHttpApiClientModule) +)] +public class PaymentHttpApiClientModule : AbpModule +{ + public const string RemoteServiceName = "Default"; + + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddHttpClientProxies( + typeof(PaymentApplicationContractsModule).Assembly, + RemoteServiceName + ); + + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + } +} diff --git a/modules/payment/src/KonSoft.Payment.HttpApi/Controllers/PaymentController.cs b/modules/payment/src/KonSoft.Payment.HttpApi/Controllers/PaymentController.cs new file mode 100644 index 0000000..4120fb4 --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.HttpApi/Controllers/PaymentController.cs @@ -0,0 +1,14 @@ +using KonSoft.Payment.Localization; +using Volo.Abp.AspNetCore.Mvc; + +namespace KonSoft.Payment.Controllers; + +/* Inherit your controllers from this class. + */ +public abstract class PaymentController : AbpControllerBase +{ + protected PaymentController() + { + LocalizationResource = typeof(PaymentResource); + } +} diff --git a/modules/payment/src/KonSoft.Payment.HttpApi/KonSoft.Payment.HttpApi.csproj b/modules/payment/src/KonSoft.Payment.HttpApi/KonSoft.Payment.HttpApi.csproj new file mode 100644 index 0000000..ba7550c --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.HttpApi/KonSoft.Payment.HttpApi.csproj @@ -0,0 +1,24 @@ + + + + + + net8.0 + enable + KonSoft.Payment + + + + + + + + + + + + + + + + diff --git a/modules/payment/src/KonSoft.Payment.HttpApi/Models/Test/TestModel.cs b/modules/payment/src/KonSoft.Payment.HttpApi/Models/Test/TestModel.cs new file mode 100644 index 0000000..0f9671c --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.HttpApi/Models/Test/TestModel.cs @@ -0,0 +1,10 @@ +using System; + +namespace KonSoft.Payment.Models.Test; + +public class TestModel +{ + public string? Name { get; set; } + + public DateTime BirthDate { get; set; } +} diff --git a/modules/payment/src/KonSoft.Payment.HttpApi/PaymentHttpApiModule.cs b/modules/payment/src/KonSoft.Payment.HttpApi/PaymentHttpApiModule.cs new file mode 100644 index 0000000..ae7ce3a --- /dev/null +++ b/modules/payment/src/KonSoft.Payment.HttpApi/PaymentHttpApiModule.cs @@ -0,0 +1,41 @@ +using Localization.Resources.AbpUi; +using KonSoft.Payment.Localization; +using Volo.Abp.Account; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Volo.Abp.PermissionManagement.HttpApi; +using Volo.Abp.SettingManagement; +using Volo.Abp.TenantManagement; + +namespace KonSoft.Payment; + +[DependsOn( + typeof(PaymentApplicationContractsModule), + typeof(AbpAccountHttpApiModule), + typeof(AbpIdentityHttpApiModule), + typeof(AbpPermissionManagementHttpApiModule), + typeof(AbpTenantManagementHttpApiModule), + typeof(AbpFeatureManagementHttpApiModule), + typeof(AbpSettingManagementHttpApiModule) + )] +public class PaymentHttpApiModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + ConfigureLocalization(); + } + + private void ConfigureLocalization() + { + Configure(options => + { + options.Resources + .Get() + .AddBaseTypes( + typeof(AbpUiResource) + ); + }); + } +} diff --git a/modules/payment/test/KonSoft.Payment.Application.Tests/KonSoft.Payment.Application.Tests.csproj b/modules/payment/test/KonSoft.Payment.Application.Tests/KonSoft.Payment.Application.Tests.csproj new file mode 100644 index 0000000..8745827 --- /dev/null +++ b/modules/payment/test/KonSoft.Payment.Application.Tests/KonSoft.Payment.Application.Tests.csproj @@ -0,0 +1,20 @@ + + + + + + net8.0 + enable + KonSoft.Payment + + + + + + + + + + + + diff --git a/modules/payment/test/KonSoft.Payment.Application.Tests/PaymentApplicationTestBase.cs b/modules/payment/test/KonSoft.Payment.Application.Tests/PaymentApplicationTestBase.cs new file mode 100644 index 0000000..9478300 --- /dev/null +++ b/modules/payment/test/KonSoft.Payment.Application.Tests/PaymentApplicationTestBase.cs @@ -0,0 +1,9 @@ +using Volo.Abp.Modularity; + +namespace KonSoft.Payment; + +public abstract class PaymentApplicationTestBase : PaymentTestBase + where TStartupModule : IAbpModule +{ + +} diff --git a/modules/payment/test/KonSoft.Payment.Application.Tests/PaymentApplicationTestModule.cs b/modules/payment/test/KonSoft.Payment.Application.Tests/PaymentApplicationTestModule.cs new file mode 100644 index 0000000..19d15d8 --- /dev/null +++ b/modules/payment/test/KonSoft.Payment.Application.Tests/PaymentApplicationTestModule.cs @@ -0,0 +1,12 @@ +using Volo.Abp.Modularity; + +namespace KonSoft.Payment; + +[DependsOn( + typeof(PaymentApplicationModule), + typeof(PaymentDomainTestModule) +)] +public class PaymentApplicationTestModule : AbpModule +{ + +} diff --git a/modules/payment/test/KonSoft.Payment.Application.Tests/Samples/SampleAppServiceTests.cs b/modules/payment/test/KonSoft.Payment.Application.Tests/Samples/SampleAppServiceTests.cs new file mode 100644 index 0000000..058c005 --- /dev/null +++ b/modules/payment/test/KonSoft.Payment.Application.Tests/Samples/SampleAppServiceTests.cs @@ -0,0 +1,34 @@ +using Shouldly; +using System.Threading.Tasks; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; +using Xunit; + +namespace KonSoft.Payment.Samples; + +/* This is just an example test class. + * Normally, you don't test code of the modules you are using + * (like IIdentityUserAppService here). + * Only test your own application services. + */ +public abstract class SampleAppServiceTests : PaymentApplicationTestBase + where TStartupModule : IAbpModule +{ + private readonly IIdentityUserAppService _userAppService; + + protected SampleAppServiceTests() + { + _userAppService = GetRequiredService(); + } + + [Fact] + public async Task Initial_Data_Should_Contain_Admin_User() + { + //Act + var result = await _userAppService.GetListAsync(new GetIdentityUsersInput()); + + //Assert + result.TotalCount.ShouldBeGreaterThan(0); + result.Items.ShouldContain(u => u.UserName == "admin"); + } +} diff --git a/modules/payment/test/KonSoft.Payment.Domain.Tests/KonSoft.Payment.Domain.Tests.csproj b/modules/payment/test/KonSoft.Payment.Domain.Tests/KonSoft.Payment.Domain.Tests.csproj new file mode 100644 index 0000000..34891a2 --- /dev/null +++ b/modules/payment/test/KonSoft.Payment.Domain.Tests/KonSoft.Payment.Domain.Tests.csproj @@ -0,0 +1,20 @@ + + + + + + net8.0 + enable + KonSoft.Payment + + + + + + + + + + + + diff --git a/modules/payment/test/KonSoft.Payment.Domain.Tests/PaymentDomainTestBase.cs b/modules/payment/test/KonSoft.Payment.Domain.Tests/PaymentDomainTestBase.cs new file mode 100644 index 0000000..919c54d --- /dev/null +++ b/modules/payment/test/KonSoft.Payment.Domain.Tests/PaymentDomainTestBase.cs @@ -0,0 +1,10 @@ +using Volo.Abp.Modularity; + +namespace KonSoft.Payment; + +/* Inherit from this class for your domain layer tests. */ +public abstract class PaymentDomainTestBase : PaymentTestBase + where TStartupModule : IAbpModule +{ + +} diff --git a/modules/payment/test/KonSoft.Payment.Domain.Tests/PaymentDomainTestModule.cs b/modules/payment/test/KonSoft.Payment.Domain.Tests/PaymentDomainTestModule.cs new file mode 100644 index 0000000..9a6dca8 --- /dev/null +++ b/modules/payment/test/KonSoft.Payment.Domain.Tests/PaymentDomainTestModule.cs @@ -0,0 +1,12 @@ +using Volo.Abp.Modularity; + +namespace KonSoft.Payment; + +[DependsOn( + typeof(PaymentDomainModule), + typeof(PaymentTestBaseModule) +)] +public class PaymentDomainTestModule : AbpModule +{ + +} diff --git a/modules/payment/test/KonSoft.Payment.Domain.Tests/Samples/SampleDomainTests.cs b/modules/payment/test/KonSoft.Payment.Domain.Tests/Samples/SampleDomainTests.cs new file mode 100644 index 0000000..8994eaf --- /dev/null +++ b/modules/payment/test/KonSoft.Payment.Domain.Tests/Samples/SampleDomainTests.cs @@ -0,0 +1,46 @@ +using System.Threading.Tasks; +using Shouldly; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; +using Xunit; + +namespace KonSoft.Payment.Samples; + +/* This is just an example test class. + * Normally, you don't test code of the modules you are using + * (like IdentityUserManager here). + * Only test your own domain services. + */ +public abstract class SampleDomainTests : PaymentDomainTestBase + where TStartupModule : IAbpModule +{ + private readonly IIdentityUserRepository _identityUserRepository; + private readonly IdentityUserManager _identityUserManager; + + protected SampleDomainTests() + { + _identityUserRepository = GetRequiredService(); + _identityUserManager = GetRequiredService(); + } + + [Fact] + public async Task Should_Set_Email_Of_A_User() + { + IdentityUser adminUser; + + /* Need to manually start Unit Of Work because + * FirstOrDefaultAsync should be executed while db connection / context is available. + */ + await WithUnitOfWorkAsync(async () => + { + adminUser = await _identityUserRepository + .FindByNormalizedUserNameAsync("ADMIN"); + + await _identityUserManager.SetEmailAsync(adminUser, "newemail@abp.io"); + await _identityUserRepository.UpdateAsync(adminUser); + }); + + adminUser = await _identityUserRepository.FindByNormalizedUserNameAsync("ADMIN"); + adminUser.Email.ShouldBe("newemail@abp.io"); + } +} diff --git a/modules/payment/test/KonSoft.Payment.EntityFrameworkCore.Tests/EntityFrameworkCore/Applications/EfCoreSampleAppServiceTests.cs b/modules/payment/test/KonSoft.Payment.EntityFrameworkCore.Tests/EntityFrameworkCore/Applications/EfCoreSampleAppServiceTests.cs new file mode 100644 index 0000000..cc8ecc3 --- /dev/null +++ b/modules/payment/test/KonSoft.Payment.EntityFrameworkCore.Tests/EntityFrameworkCore/Applications/EfCoreSampleAppServiceTests.cs @@ -0,0 +1,10 @@ +using KonSoft.Payment.Samples; +using Xunit; + +namespace KonSoft.Payment.EntityFrameworkCore.Applications; + +[Collection(PaymentTestConsts.CollectionDefinitionName)] +public class EfCoreSampleAppServiceTests : SampleAppServiceTests +{ + +} diff --git a/modules/payment/test/KonSoft.Payment.EntityFrameworkCore.Tests/EntityFrameworkCore/Domains/EfCoreSampleDomainTests.cs b/modules/payment/test/KonSoft.Payment.EntityFrameworkCore.Tests/EntityFrameworkCore/Domains/EfCoreSampleDomainTests.cs new file mode 100644 index 0000000..e90b9fa --- /dev/null +++ b/modules/payment/test/KonSoft.Payment.EntityFrameworkCore.Tests/EntityFrameworkCore/Domains/EfCoreSampleDomainTests.cs @@ -0,0 +1,10 @@ +using KonSoft.Payment.Samples; +using Xunit; + +namespace KonSoft.Payment.EntityFrameworkCore.Domains; + +[Collection(PaymentTestConsts.CollectionDefinitionName)] +public class EfCoreSampleDomainTests : SampleDomainTests +{ + +} diff --git a/modules/payment/test/KonSoft.Payment.EntityFrameworkCore.Tests/EntityFrameworkCore/PaymentEntityFrameworkCoreCollection.cs b/modules/payment/test/KonSoft.Payment.EntityFrameworkCore.Tests/EntityFrameworkCore/PaymentEntityFrameworkCoreCollection.cs new file mode 100644 index 0000000..f2ddf4d --- /dev/null +++ b/modules/payment/test/KonSoft.Payment.EntityFrameworkCore.Tests/EntityFrameworkCore/PaymentEntityFrameworkCoreCollection.cs @@ -0,0 +1,9 @@ +using Xunit; + +namespace KonSoft.Payment.EntityFrameworkCore; + +[CollectionDefinition(PaymentTestConsts.CollectionDefinitionName)] +public class PaymentEntityFrameworkCoreCollection : ICollectionFixture +{ + +} diff --git a/modules/payment/test/KonSoft.Payment.EntityFrameworkCore.Tests/EntityFrameworkCore/PaymentEntityFrameworkCoreCollectionFixtureBase.cs b/modules/payment/test/KonSoft.Payment.EntityFrameworkCore.Tests/EntityFrameworkCore/PaymentEntityFrameworkCoreCollectionFixtureBase.cs new file mode 100644 index 0000000..d29e066 --- /dev/null +++ b/modules/payment/test/KonSoft.Payment.EntityFrameworkCore.Tests/EntityFrameworkCore/PaymentEntityFrameworkCoreCollectionFixtureBase.cs @@ -0,0 +1,9 @@ +using KonSoft.Payment.EntityFrameworkCore; +using Xunit; + +namespace KonSoft.Payment.EntityFrameworkCore; + +public class PaymentEntityFrameworkCoreCollectionFixtureBase : ICollectionFixture +{ + +} diff --git a/modules/payment/test/KonSoft.Payment.EntityFrameworkCore.Tests/EntityFrameworkCore/PaymentEntityFrameworkCoreFixture.cs b/modules/payment/test/KonSoft.Payment.EntityFrameworkCore.Tests/EntityFrameworkCore/PaymentEntityFrameworkCoreFixture.cs new file mode 100644 index 0000000..54424f9 --- /dev/null +++ b/modules/payment/test/KonSoft.Payment.EntityFrameworkCore.Tests/EntityFrameworkCore/PaymentEntityFrameworkCoreFixture.cs @@ -0,0 +1,11 @@ +using System; + +namespace KonSoft.Payment.EntityFrameworkCore; + +public class PaymentEntityFrameworkCoreFixture : IDisposable +{ + public void Dispose() + { + + } +} diff --git a/modules/payment/test/KonSoft.Payment.EntityFrameworkCore.Tests/EntityFrameworkCore/PaymentEntityFrameworkCoreTestBase.cs b/modules/payment/test/KonSoft.Payment.EntityFrameworkCore.Tests/EntityFrameworkCore/PaymentEntityFrameworkCoreTestBase.cs new file mode 100644 index 0000000..ac885da --- /dev/null +++ b/modules/payment/test/KonSoft.Payment.EntityFrameworkCore.Tests/EntityFrameworkCore/PaymentEntityFrameworkCoreTestBase.cs @@ -0,0 +1,8 @@ +using Volo.Abp; + +namespace KonSoft.Payment.EntityFrameworkCore; + +public abstract class PaymentEntityFrameworkCoreTestBase : PaymentTestBase +{ + +} diff --git a/modules/payment/test/KonSoft.Payment.EntityFrameworkCore.Tests/EntityFrameworkCore/PaymentEntityFrameworkCoreTestModule.cs b/modules/payment/test/KonSoft.Payment.EntityFrameworkCore.Tests/EntityFrameworkCore/PaymentEntityFrameworkCoreTestModule.cs new file mode 100644 index 0000000..d431bc1 --- /dev/null +++ b/modules/payment/test/KonSoft.Payment.EntityFrameworkCore.Tests/EntityFrameworkCore/PaymentEntityFrameworkCoreTestModule.cs @@ -0,0 +1,82 @@ +using Microsoft.Data.Sqlite; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.Sqlite; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Modularity; +using Volo.Abp.PermissionManagement; +using Volo.Abp.SettingManagement; +using Volo.Abp.Uow; + +namespace KonSoft.Payment.EntityFrameworkCore; + +[DependsOn( + typeof(PaymentApplicationTestModule), + typeof(PaymentEntityFrameworkCoreModule), + typeof(AbpEntityFrameworkCoreSqliteModule) + )] +public class PaymentEntityFrameworkCoreTestModule : AbpModule +{ + private SqliteConnection? _sqliteConnection; + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.SaveStaticFeaturesToDatabase = false; + options.IsDynamicFeatureStoreEnabled = false; + }); + Configure(options => + { + options.SaveStaticPermissionsToDatabase = false; + options.IsDynamicPermissionStoreEnabled = false; + }); + Configure(options => + { + options.SaveStaticSettingsToDatabase = false; + options.IsDynamicSettingStoreEnabled = false; + }); + context.Services.AddAlwaysDisableUnitOfWorkTransaction(); + + ConfigureInMemorySqlite(context.Services); + } + + private void ConfigureInMemorySqlite(IServiceCollection services) + { + _sqliteConnection = CreateDatabaseAndGetConnection(); + + services.Configure(options => + { + options.Configure(context => + { + context.DbContextOptions.UseSqlite(_sqliteConnection); + }); + }); + } + + public override void OnApplicationShutdown(ApplicationShutdownContext context) + { + _sqliteConnection?.Dispose(); + } + + private static SqliteConnection CreateDatabaseAndGetConnection() + { + var connection = new AbpUnitTestSqliteConnection("Data Source=:memory:"); + connection.Open(); + + var options = new DbContextOptionsBuilder() + .UseSqlite(connection) + .Options; + + using (var context = new PaymentDbContext(options)) + { + context.GetService().CreateTables(); + } + + return connection; + } +} diff --git a/modules/payment/test/KonSoft.Payment.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepositoryTests.cs b/modules/payment/test/KonSoft.Payment.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepositoryTests.cs new file mode 100644 index 0000000..0dcfeff --- /dev/null +++ b/modules/payment/test/KonSoft.Payment.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepositoryTests.cs @@ -0,0 +1,44 @@ +using Microsoft.EntityFrameworkCore; +using Shouldly; +using System; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp.Domain.Repositories; +using Volo.Abp.Identity; +using Xunit; + +namespace KonSoft.Payment.EntityFrameworkCore.Samples; + +/* This is just an example test class. + * Normally, you don't test ABP framework code + * (like default AppUser repository IRepository here). + * Only test your custom repository methods. + */ +[Collection(PaymentTestConsts.CollectionDefinitionName)] +public class SampleRepositoryTests : PaymentEntityFrameworkCoreTestBase +{ + private readonly IRepository _appUserRepository; + + public SampleRepositoryTests() + { + _appUserRepository = GetRequiredService>(); + } + + [Fact] + public async Task Should_Query_AppUser() + { + /* Need to manually start Unit Of Work because + * FirstOrDefaultAsync should be executed while db connection / context is available. + */ + await WithUnitOfWorkAsync(async () => + { + //Act + var adminUser = await (await _appUserRepository.GetQueryableAsync()) + .Where(u => u.UserName == "admin") + .FirstOrDefaultAsync(); + + //Assert + adminUser.ShouldNotBeNull(); + }); + } +} diff --git a/modules/payment/test/KonSoft.Payment.EntityFrameworkCore.Tests/KonSoft.Payment.EntityFrameworkCore.Tests.csproj b/modules/payment/test/KonSoft.Payment.EntityFrameworkCore.Tests/KonSoft.Payment.EntityFrameworkCore.Tests.csproj new file mode 100644 index 0000000..5fbb4a3 --- /dev/null +++ b/modules/payment/test/KonSoft.Payment.EntityFrameworkCore.Tests/KonSoft.Payment.EntityFrameworkCore.Tests.csproj @@ -0,0 +1,21 @@ + + + + + + net8.0 + enable + KonSoft.Payment + + + + + + + + + + + + + diff --git a/modules/payment/test/KonSoft.Payment.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs b/modules/payment/test/KonSoft.Payment.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs new file mode 100644 index 0000000..3b69ac0 --- /dev/null +++ b/modules/payment/test/KonSoft.Payment.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs @@ -0,0 +1,25 @@ +using System; +using System.Threading.Tasks; +using Volo.Abp.Account; +using Volo.Abp.DependencyInjection; + +namespace KonSoft.Payment.HttpApi.Client.ConsoleTestApp; + +public class ClientDemoService : ITransientDependency +{ + private readonly IProfileAppService _profileAppService; + + public ClientDemoService(IProfileAppService profileAppService) + { + _profileAppService = profileAppService; + } + + public async Task RunAsync() + { + var output = await _profileAppService.GetAsync(); + Console.WriteLine($"UserName : {output.UserName}"); + Console.WriteLine($"Email : {output.Email}"); + Console.WriteLine($"Name : {output.Name}"); + Console.WriteLine($"Surname : {output.Surname}"); + } +} diff --git a/modules/payment/test/KonSoft.Payment.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs b/modules/payment/test/KonSoft.Payment.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs new file mode 100644 index 0000000..ee68c9a --- /dev/null +++ b/modules/payment/test/KonSoft.Payment.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs @@ -0,0 +1,40 @@ +using Microsoft.Extensions.Hosting; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; + +namespace KonSoft.Payment.HttpApi.Client.ConsoleTestApp; + +public class ConsoleTestAppHostedService : IHostedService +{ + private readonly IConfiguration _configuration; + + public ConsoleTestAppHostedService(IConfiguration configuration) + { + _configuration = configuration; + } + + public async Task StartAsync(CancellationToken cancellationToken) + { + using (var application = await AbpApplicationFactory.CreateAsync(options => + { + options.Services.ReplaceConfiguration(_configuration); + options.UseAutofac(); + })) + { + await application.InitializeAsync(); + + var demo = application.ServiceProvider.GetRequiredService(); + await demo.RunAsync(); + + await application.ShutdownAsync(); + } + } + + public Task StopAsync(CancellationToken cancellationToken) + { + return Task.CompletedTask; + } +} diff --git a/modules/payment/test/KonSoft.Payment.HttpApi.Client.ConsoleTestApp/KonSoft.Payment.HttpApi.Client.ConsoleTestApp.csproj b/modules/payment/test/KonSoft.Payment.HttpApi.Client.ConsoleTestApp/KonSoft.Payment.HttpApi.Client.ConsoleTestApp.csproj new file mode 100644 index 0000000..0ec131f --- /dev/null +++ b/modules/payment/test/KonSoft.Payment.HttpApi.Client.ConsoleTestApp/KonSoft.Payment.HttpApi.Client.ConsoleTestApp.csproj @@ -0,0 +1,33 @@ + + + + Exe + net8.0 + enable + + + + + + PreserveNewest + Always + + + + PreserveNewest + Always + + + + + + + + + + + + + + + diff --git a/modules/payment/test/KonSoft.Payment.HttpApi.Client.ConsoleTestApp/PaymentConsoleApiClientModule.cs b/modules/payment/test/KonSoft.Payment.HttpApi.Client.ConsoleTestApp/PaymentConsoleApiClientModule.cs new file mode 100644 index 0000000..1ff17ab --- /dev/null +++ b/modules/payment/test/KonSoft.Payment.HttpApi.Client.ConsoleTestApp/PaymentConsoleApiClientModule.cs @@ -0,0 +1,30 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Polly; +using Volo.Abp.Autofac; +using Volo.Abp.Http.Client; +using Volo.Abp.Http.Client.IdentityModel; +using Volo.Abp.Modularity; + +namespace KonSoft.Payment.HttpApi.Client.ConsoleTestApp; + +[DependsOn( + typeof(AbpAutofacModule), + typeof(PaymentHttpApiClientModule), + typeof(AbpHttpClientIdentityModelModule) + )] +public class PaymentConsoleApiClientModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PreConfigure(options => + { + options.ProxyClientBuildActions.Add((remoteServiceName, clientBuilder) => + { + clientBuilder.AddTransientHttpErrorPolicy( + policyBuilder => policyBuilder.WaitAndRetryAsync(3, i => TimeSpan.FromSeconds(Math.Pow(2, i))) + ); + }); + }); + } +} diff --git a/modules/payment/test/KonSoft.Payment.HttpApi.Client.ConsoleTestApp/Program.cs b/modules/payment/test/KonSoft.Payment.HttpApi.Client.ConsoleTestApp/Program.cs new file mode 100644 index 0000000..8654dd1 --- /dev/null +++ b/modules/payment/test/KonSoft.Payment.HttpApi.Client.ConsoleTestApp/Program.cs @@ -0,0 +1,22 @@ +using System.Threading.Tasks; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +namespace KonSoft.Payment.HttpApi.Client.ConsoleTestApp; + +class Program +{ + static async Task Main(string[] args) + { + await CreateHostBuilder(args).RunConsoleAsync(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .AddAppSettingsSecretsJson() + .ConfigureServices((hostContext, services) => + { + services.AddHostedService(); + }); +} diff --git a/modules/payment/test/KonSoft.Payment.HttpApi.Client.ConsoleTestApp/appsettings.json b/modules/payment/test/KonSoft.Payment.HttpApi.Client.ConsoleTestApp/appsettings.json new file mode 100644 index 0000000..fcddc86 --- /dev/null +++ b/modules/payment/test/KonSoft.Payment.HttpApi.Client.ConsoleTestApp/appsettings.json @@ -0,0 +1,17 @@ +{ + "RemoteServices": { + "Default": { + "BaseUrl": "https://localhost:44355" + } + }, + "IdentityClients": { + "Default": { + "GrantType": "password", + "ClientId": "Payment_App", + "UserName": "admin", + "UserPassword": "1q2w3E*", + "Authority": "https://localhost:44355", + "Scope": "Payment" + } + } +} diff --git a/modules/payment/test/KonSoft.Payment.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json b/modules/payment/test/KonSoft.Payment.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json new file mode 100644 index 0000000..7a73a41 --- /dev/null +++ b/modules/payment/test/KonSoft.Payment.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/modules/payment/test/KonSoft.Payment.TestBase/KonSoft.Payment.TestBase.csproj b/modules/payment/test/KonSoft.Payment.TestBase/KonSoft.Payment.TestBase.csproj new file mode 100644 index 0000000..9272bcd --- /dev/null +++ b/modules/payment/test/KonSoft.Payment.TestBase/KonSoft.Payment.TestBase.csproj @@ -0,0 +1,31 @@ + + + + + + net8.0 + enable + KonSoft.Payment + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers + + + + + + + + diff --git a/modules/payment/test/KonSoft.Payment.TestBase/PaymentTestBase.cs b/modules/payment/test/KonSoft.Payment.TestBase/PaymentTestBase.cs new file mode 100644 index 0000000..3331157 --- /dev/null +++ b/modules/payment/test/KonSoft.Payment.TestBase/PaymentTestBase.cs @@ -0,0 +1,60 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.Modularity; +using Volo.Abp.Uow; +using Volo.Abp.Testing; + +namespace KonSoft.Payment; + +/* All test classes are derived from this class, directly or indirectly. + */ +public abstract class PaymentTestBase : AbpIntegratedTest + where TStartupModule : IAbpModule +{ + protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options) + { + options.UseAutofac(); + } + + protected virtual Task WithUnitOfWorkAsync(Func func) + { + return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); + } + + protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func action) + { + using (var scope = ServiceProvider.CreateScope()) + { + var uowManager = scope.ServiceProvider.GetRequiredService(); + + using (var uow = uowManager.Begin(options)) + { + await action(); + + await uow.CompleteAsync(); + } + } + } + + protected virtual Task WithUnitOfWorkAsync(Func> func) + { + return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); + } + + protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func> func) + { + using (var scope = ServiceProvider.CreateScope()) + { + var uowManager = scope.ServiceProvider.GetRequiredService(); + + using (var uow = uowManager.Begin(options)) + { + var result = await func(); + await uow.CompleteAsync(); + return result; + } + } + } +} diff --git a/modules/payment/test/KonSoft.Payment.TestBase/PaymentTestBaseModule.cs b/modules/payment/test/KonSoft.Payment.TestBase/PaymentTestBaseModule.cs new file mode 100644 index 0000000..d9c1ff6 --- /dev/null +++ b/modules/payment/test/KonSoft.Payment.TestBase/PaymentTestBaseModule.cs @@ -0,0 +1,47 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.Authorization; +using Volo.Abp.Autofac; +using Volo.Abp.BackgroundJobs; +using Volo.Abp.Data; +using Volo.Abp.Modularity; +using Volo.Abp.Threading; + +namespace KonSoft.Payment; + +[DependsOn( + typeof(AbpAutofacModule), + typeof(AbpTestBaseModule), + typeof(AbpAuthorizationModule), + typeof(AbpBackgroundJobsAbstractionsModule) + )] +public class PaymentTestBaseModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.IsJobExecutionEnabled = false; + }); + + context.Services.AddAlwaysAllowAuthorization(); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + SeedTestData(context); + } + + private static void SeedTestData(ApplicationInitializationContext context) + { + AsyncHelper.RunSync(async () => + { + using (var scope = context.ServiceProvider.CreateScope()) + { + await scope.ServiceProvider + .GetRequiredService() + .SeedAsync(); + } + }); + } +} diff --git a/modules/payment/test/KonSoft.Payment.TestBase/PaymentTestConsts.cs b/modules/payment/test/KonSoft.Payment.TestBase/PaymentTestConsts.cs new file mode 100644 index 0000000..64b3623 --- /dev/null +++ b/modules/payment/test/KonSoft.Payment.TestBase/PaymentTestConsts.cs @@ -0,0 +1,6 @@ +namespace KonSoft.Payment; + +public static class PaymentTestConsts +{ + public const string CollectionDefinitionName = "Payment collection"; +} diff --git a/modules/payment/test/KonSoft.Payment.TestBase/PaymentTestDataSeedContributor.cs b/modules/payment/test/KonSoft.Payment.TestBase/PaymentTestDataSeedContributor.cs new file mode 100644 index 0000000..eb4eaff --- /dev/null +++ b/modules/payment/test/KonSoft.Payment.TestBase/PaymentTestDataSeedContributor.cs @@ -0,0 +1,15 @@ +using System.Threading.Tasks; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; + +namespace KonSoft.Payment; + +public class PaymentTestDataSeedContributor : IDataSeedContributor, ITransientDependency +{ + public Task SeedAsync(DataSeedContext context) + { + /* Seed additional test data... */ + + return Task.CompletedTask; + } +} diff --git a/modules/payment/test/KonSoft.Payment.TestBase/Security/FakeCurrentPrincipalAccessor.cs b/modules/payment/test/KonSoft.Payment.TestBase/Security/FakeCurrentPrincipalAccessor.cs new file mode 100644 index 0000000..10983b2 --- /dev/null +++ b/modules/payment/test/KonSoft.Payment.TestBase/Security/FakeCurrentPrincipalAccessor.cs @@ -0,0 +1,25 @@ +using System.Collections.Generic; +using System.Security.Claims; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Security.Claims; + +namespace KonSoft.Payment.Security; + +[Dependency(ReplaceServices = true)] +public class FakeCurrentPrincipalAccessor : ThreadCurrentPrincipalAccessor +{ + protected override ClaimsPrincipal GetClaimsPrincipal() + { + return GetPrincipal(); + } + + private ClaimsPrincipal GetPrincipal() + { + return new ClaimsPrincipal(new ClaimsIdentity(new List + { + new Claim(AbpClaimTypes.UserId, "2e701e62-0953-4dd3-910b-dc6cc93ccb0d"), + new Claim(AbpClaimTypes.UserName, "admin"), + new Claim(AbpClaimTypes.Email, "admin@abp.io") + })); + } +} diff --git a/modules/report/src/KonSoft.Report.Application.Contracts/KonSoft.Report.Application.Contracts.csproj b/modules/report/src/KonSoft.Report.Application.Contracts/KonSoft.Report.Application.Contracts.csproj new file mode 100644 index 0000000..cc23daa --- /dev/null +++ b/modules/report/src/KonSoft.Report.Application.Contracts/KonSoft.Report.Application.Contracts.csproj @@ -0,0 +1,25 @@ + + + + + + net8.0 + enable + KonSoft.Report + + + + + + + + + + + + + + + + + diff --git a/modules/report/src/KonSoft.Report.Application.Contracts/Permissions/ReportPermissionDefinitionProvider.cs b/modules/report/src/KonSoft.Report.Application.Contracts/Permissions/ReportPermissionDefinitionProvider.cs new file mode 100644 index 0000000..b99e6bd --- /dev/null +++ b/modules/report/src/KonSoft.Report.Application.Contracts/Permissions/ReportPermissionDefinitionProvider.cs @@ -0,0 +1,20 @@ +using KonSoft.Report.Localization; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.Localization; + +namespace KonSoft.Report.Permissions; + +public class ReportPermissionDefinitionProvider : PermissionDefinitionProvider +{ + public override void Define(IPermissionDefinitionContext context) + { + var myGroup = context.AddGroup(ReportPermissions.GroupName); + //Define your own permissions here. Example: + //myGroup.AddPermission(ReportPermissions.MyPermission1, L("Permission:MyPermission1")); + } + + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); + } +} diff --git a/modules/report/src/KonSoft.Report.Application.Contracts/Permissions/ReportPermissions.cs b/modules/report/src/KonSoft.Report.Application.Contracts/Permissions/ReportPermissions.cs new file mode 100644 index 0000000..4b65916 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Application.Contracts/Permissions/ReportPermissions.cs @@ -0,0 +1,9 @@ +namespace KonSoft.Report.Permissions; + +public static class ReportPermissions +{ + public const string GroupName = "Report"; + + //Add your own permission names. Example: + //public const string MyPermission1 = GroupName + ".MyPermission1"; +} diff --git a/modules/report/src/KonSoft.Report.Application.Contracts/ReportApplicationContractsModule.cs b/modules/report/src/KonSoft.Report.Application.Contracts/ReportApplicationContractsModule.cs new file mode 100644 index 0000000..e8b9e7d --- /dev/null +++ b/modules/report/src/KonSoft.Report.Application.Contracts/ReportApplicationContractsModule.cs @@ -0,0 +1,28 @@ +using Volo.Abp.Account; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; +using Volo.Abp.ObjectExtending; +using Volo.Abp.PermissionManagement; +using Volo.Abp.SettingManagement; +using Volo.Abp.TenantManagement; + +namespace KonSoft.Report; + +[DependsOn( + typeof(ReportDomainSharedModule), + typeof(AbpAccountApplicationContractsModule), + typeof(AbpFeatureManagementApplicationContractsModule), + typeof(AbpIdentityApplicationContractsModule), + typeof(AbpPermissionManagementApplicationContractsModule), + typeof(AbpSettingManagementApplicationContractsModule), + typeof(AbpTenantManagementApplicationContractsModule), + typeof(AbpObjectExtendingModule) +)] +public class ReportApplicationContractsModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + ReportDtoExtensions.Configure(); + } +} diff --git a/modules/report/src/KonSoft.Report.Application.Contracts/ReportDtoExtensions.cs b/modules/report/src/KonSoft.Report.Application.Contracts/ReportDtoExtensions.cs new file mode 100644 index 0000000..4541f59 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Application.Contracts/ReportDtoExtensions.cs @@ -0,0 +1,28 @@ +using Volo.Abp.Identity; +using Volo.Abp.ObjectExtending; +using Volo.Abp.Threading; + +namespace KonSoft.Report; + +public static class ReportDtoExtensions +{ + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + + public static void Configure() + { + OneTimeRunner.Run(() => + { + /* You can add extension properties to DTOs + * defined in the depended modules. + * + * Example: + * + * ObjectExtensionManager.Instance + * .AddOrUpdateProperty("Title"); + * + * See the documentation for more: + * https://docs.abp.io/en/abp/latest/Object-Extensions + */ + }); + } +} diff --git a/modules/report/src/KonSoft.Report.Application/KonSoft.Report.Application.csproj b/modules/report/src/KonSoft.Report.Application/KonSoft.Report.Application.csproj new file mode 100644 index 0000000..e39e71e --- /dev/null +++ b/modules/report/src/KonSoft.Report.Application/KonSoft.Report.Application.csproj @@ -0,0 +1,25 @@ + + + + + + net8.0 + enable + KonSoft.Report + + + + + + + + + + + + + + + + + diff --git a/modules/report/src/KonSoft.Report.Application/Properties/AssemblyInfo.cs b/modules/report/src/KonSoft.Report.Application/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..62f1528 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Application/Properties/AssemblyInfo.cs @@ -0,0 +1,2 @@ +using System.Runtime.CompilerServices; +[assembly:InternalsVisibleToAttribute("KonSoft.Report.Application.Tests")] diff --git a/modules/report/src/KonSoft.Report.Application/ReportAppService.cs b/modules/report/src/KonSoft.Report.Application/ReportAppService.cs new file mode 100644 index 0000000..4d50cce --- /dev/null +++ b/modules/report/src/KonSoft.Report.Application/ReportAppService.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Text; +using KonSoft.Report.Localization; +using Volo.Abp.Application.Services; + +namespace KonSoft.Report; + +/* Inherit your application services from this class. + */ +public abstract class ReportAppService : ApplicationService +{ + protected ReportAppService() + { + LocalizationResource = typeof(ReportResource); + } +} diff --git a/modules/report/src/KonSoft.Report.Application/ReportApplicationAutoMapperProfile.cs b/modules/report/src/KonSoft.Report.Application/ReportApplicationAutoMapperProfile.cs new file mode 100644 index 0000000..a7d2748 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Application/ReportApplicationAutoMapperProfile.cs @@ -0,0 +1,13 @@ +using AutoMapper; + +namespace KonSoft.Report; + +public class ReportApplicationAutoMapperProfile : Profile +{ + public ReportApplicationAutoMapperProfile() + { + /* You can configure your AutoMapper mapping configuration here. + * Alternatively, you can split your mapping configurations + * into multiple profile classes for a better organization. */ + } +} diff --git a/modules/report/src/KonSoft.Report.Application/ReportApplicationModule.cs b/modules/report/src/KonSoft.Report.Application/ReportApplicationModule.cs new file mode 100644 index 0000000..a010131 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Application/ReportApplicationModule.cs @@ -0,0 +1,31 @@ +using Volo.Abp.Account; +using Volo.Abp.AutoMapper; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; +using Volo.Abp.PermissionManagement; +using Volo.Abp.SettingManagement; +using Volo.Abp.TenantManagement; + +namespace KonSoft.Report; + +[DependsOn( + typeof(ReportDomainModule), + typeof(AbpAccountApplicationModule), + typeof(ReportApplicationContractsModule), + typeof(AbpIdentityApplicationModule), + typeof(AbpPermissionManagementApplicationModule), + typeof(AbpTenantManagementApplicationModule), + typeof(AbpFeatureManagementApplicationModule), + typeof(AbpSettingManagementApplicationModule) + )] +public class ReportApplicationModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.AddMaps(); + }); + } +} diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/KonSoft.Report.Domain.Shared.csproj b/modules/report/src/KonSoft.Report.Domain.Shared/KonSoft.Report.Domain.Shared.csproj new file mode 100644 index 0000000..80b1023 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/KonSoft.Report.Domain.Shared.csproj @@ -0,0 +1,32 @@ + + + + + + net8.0 + enable + KonSoft.Report + true + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/ar.json b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/ar.json new file mode 100644 index 0000000..c27a209 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/ar.json @@ -0,0 +1,9 @@ +{ + "culture": "ar", + "texts": { + "AppName": "Report", + "Menu:Home": "الصفحة الرئيسية", + "Welcome": "مرحباً", + "LongWelcomeMessage": "مرحبا بكم في التطبيق. هذا مشروع بدء تشغيل يعتمد على إطار عمل ABP. لمزيد من المعلومات ، يرجى زيارة abp.io." + } +} diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/cs.json b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/cs.json new file mode 100644 index 0000000..e1914eb --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/cs.json @@ -0,0 +1,9 @@ +{ + "culture": "cs", + "texts": { + "AppName": "Report", + "Menu:Home": "Úvod", + "Welcome": "Vítejte", + "LongWelcomeMessage": "Vítejte v aplikaci. Toto je startovací projekt založený na ABP frameworku. Pro více informací, navštivte abp.io." + } +} diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/de.json b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/de.json new file mode 100644 index 0000000..e0d1ee6 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/de.json @@ -0,0 +1,9 @@ +{ + "culture": "de", + "texts": { + "AppName": "Report", + "Menu:Home": "Home", + "Welcome": "Willkommen", + "LongWelcomeMessage": "Willkommen bei der Anwendung. Dies ist ein Startup-Projekt, das auf dem ABP-Framework basiert. Weitere Informationen finden Sie unter abp.io." + } +} diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/en-GB.json b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/en-GB.json new file mode 100644 index 0000000..d808639 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/en-GB.json @@ -0,0 +1,9 @@ +{ + "culture": "en-GB", + "texts": { + "AppName": "Report", + "Menu:Home": "Home", + "Welcome": "Welcome", + "LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io." + } +} diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/en.json b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/en.json new file mode 100644 index 0000000..6be22e3 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/en.json @@ -0,0 +1,9 @@ +{ + "culture": "en", + "texts": { + "AppName": "Report", + "Menu:Home": "Home", + "Welcome": "Welcome", + "LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io." + } +} diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/es.json b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/es.json new file mode 100644 index 0000000..05f168d --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/es.json @@ -0,0 +1,9 @@ +{ + "culture": "es", + "texts": { + "AppName": "Report", + "Menu:Home": "Inicio", + "Welcome": "Bienvenido", + "LongWelcomeMessage": "Bienvenido a la aplicación, este es un proyecto base basado en el framework ABP. Para más información, visita abp.io." + } +} diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/fi.json b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/fi.json new file mode 100644 index 0000000..dc45858 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/fi.json @@ -0,0 +1,9 @@ +{ + "culture": "fi", + "texts": { + "AppName": "Report", + "Menu:Home": "Koti", + "Welcome": "Tervetuloa", + "LongWelcomeMessage": "Tervetuloa sovellukseen. Tämä on ABP-kehykseen perustuva käynnistysprojekti. Lisätietoja on osoitteessa abp.io." + } +} diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/fr.json b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/fr.json new file mode 100644 index 0000000..99e4e97 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/fr.json @@ -0,0 +1,9 @@ +{ + "culture": "fr", + "texts": { + "AppName": "Report", + "Menu:Home": "Accueil", + "Welcome": "Bienvenue", + "LongWelcomeMessage": "Bienvenue dans l'application. Il s'agit d'un projet de démarrage basé sur le framework ABP. Pour plus d'informations, visitez abp.io." + } +} diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/hi.json b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/hi.json new file mode 100644 index 0000000..2659892 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/hi.json @@ -0,0 +1,9 @@ +{ + "culture": "hi", + "texts": { + "AppName": "Report", + "Menu:Home": "घर", + "Welcome": "स्वागत हे", + "LongWelcomeMessage": "आवेदन करने के लिए आपका स्वागत है। यह एबीपी ढांचे पर आधारित एक स्टार्टअप परियोजना है। अधिक जानकारी के लिए, abp.io पर जाएं।" + } +} diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/hr.json b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/hr.json new file mode 100644 index 0000000..c6af8b3 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/hr.json @@ -0,0 +1,9 @@ +{ + "culture": "hr", + "texts": { + "AppName": "Report", + "Menu:Home": "Početna", + "Welcome": "Dobrodošli", + "LongWelcomeMessage": "Dobrodošli u aplikaciju. Ovo je startup projekt temeljen na ABP framework-u. Za više informacija posjetite abp.io." + } +} diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/hu.json b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/hu.json new file mode 100644 index 0000000..4a687e5 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/hu.json @@ -0,0 +1,9 @@ +{ + "culture": "hu", + "texts": { + "AppName": "Report", + "Menu:Home": "Kezdőlap", + "Welcome": "Üdvözlöm", + "LongWelcomeMessage": "Üdvözöljük az alkalmazásban. Ez egy ABP keretrendszeren alapuló startup projekt. További információkért látogasson el az abp.io oldalra." + } +} diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/is.json b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/is.json new file mode 100644 index 0000000..3e89ddb --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/is.json @@ -0,0 +1,9 @@ +{ + "culture": "is", + "texts": { + "AppName": "Report", + "Menu:Home": "Heim", + "Welcome": "Velkomin", + "LongWelcomeMessage": "Verið velkomin í forritið. Þetta er startup verkefni sem byggir á ABP. Nánari upplýsingar er að finna á abp.io." + } +} diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/it.json b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/it.json new file mode 100644 index 0000000..4666506 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/it.json @@ -0,0 +1,9 @@ +{ + "culture": "it", + "texts": { + "AppName": "Report", + "Menu:Home": "Home", + "Welcome": "Benvenuto", + "LongWelcomeMessage": "Benvenuto nell'applicazione. Questo è un progetto di avvio basato sul framework ABP. Per ulteriori informazioni, visita abp.io." + } +} diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/nl.json b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/nl.json new file mode 100644 index 0000000..779c1d5 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/nl.json @@ -0,0 +1,9 @@ +{ + "culture": "nl", + "texts": { + "AppName": "Report", + "Menu:Home": "Home", + "Welcome": "Welkom", + "LongWelcomeMessage": "Welkom bij de applicatie. Dit is een startup-project gebaseerd op het ABP-framework. Bezoek abp.io voor meer informatie." + } +} diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/pl-PL.json b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/pl-PL.json new file mode 100644 index 0000000..2f134f0 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/pl-PL.json @@ -0,0 +1,9 @@ +{ + "culture": "pl-PL", + "texts": { + "AppName": "Report", + "Menu:Home": "Home", + "Welcome": "Witaj", + "LongWelcomeMessage": "Witaj w aplikacji. To jest inicjalny projekt bazujący na ABP framework. Po więcej informacji odwiedź stronę abp.io." + } +} diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/pt-BR.json b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/pt-BR.json new file mode 100644 index 0000000..804c2da --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/pt-BR.json @@ -0,0 +1,9 @@ +{ + "culture": "pt-BR", + "texts": { + "AppName": "Report", + "Menu:Home": "Principal", + "Welcome": "Seja bem-vindo!", + "LongWelcomeMessage": "Bem-vindo a esta aplicação. Este é um projeto inicial baseado no ABP framework. Para mais informações, visite abp.io." + } +} diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/ro-RO.json b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/ro-RO.json new file mode 100644 index 0000000..7b9e67d --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/ro-RO.json @@ -0,0 +1,9 @@ +{ + "culture": "ro-RO", + "texts": { + "AppName": "Report", + "Menu:Home": "Acasă", + "Welcome": "Bun venit", + "LongWelcomeMessage": "Bun venit la aplicaţie. Acesta este un proiect de pornire bazat pe framework-ul ABP. Pentru mai multe informaţii, vizitaţi, visit abp.io." + } +} diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/ru.json b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/ru.json new file mode 100644 index 0000000..854bc96 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/ru.json @@ -0,0 +1,9 @@ +{ + "culture": "ru", + "texts": { + "AppName": "Report", + "Menu:Home": "Главная", + "Welcome": "Добро пожаловать", + "LongWelcomeMessage": "Добро пожаловать в приложение. Этот запущенный проект основан на фреймворке ABP. Для получения дополнительной информации посетите сайт abp.io." + } +} diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/sk.json b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/sk.json new file mode 100644 index 0000000..e520fe2 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/sk.json @@ -0,0 +1,9 @@ +{ + "culture": "sk", + "texts": { + "AppName": "Report", + "Menu:Home": "Domov", + "Welcome": "Vitajte", + "LongWelcomeMessage": "Vitajte v aplikácii. Toto je štartovací projekt založený na ABP frameworku. Viac informácií nájdete na stránke abp.io." + } +} diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/sl.json b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/sl.json new file mode 100644 index 0000000..08dbb08 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/sl.json @@ -0,0 +1,9 @@ +{ + "culture": "sl", + "texts": { + "AppName": "Report", + "Menu:Home": "Domov", + "Welcome": "Dobrodošli", + "LongWelcomeMessage": "Dobrodošli v aplikaciji. To je začetni projekt na osnovi okolja ABP. Za več informacij obiščite abp.io." + } +} diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/sv.json b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/sv.json new file mode 100644 index 0000000..bd1eae4 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/sv.json @@ -0,0 +1,9 @@ +{ + "culture": "sv", + "texts": { + "AppName": "MittProjektNamn", + "Menu:Home": "Hem", + "Welcome": "Välkommen", + "LongWelcomeMessage": "Välkommen till applikationen. Detta är ett startup-projekt baserat på ABP-ramverket. För mer information, besök abp.io." + } +} \ No newline at end of file diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/tr.json b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/tr.json new file mode 100644 index 0000000..fb949e4 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/tr.json @@ -0,0 +1,9 @@ +{ + "culture": "tr", + "texts": { + "AppName": "Report", + "Menu:Home": "Ana sayfa", + "Welcome": "Hoşgeldiniz", + "LongWelcomeMessage": "Uygulamaya hoşgeldiniz. Bu, ABP framework'ü üzerine bina edilmiş bir başlangıç projesidir. Daha fazla bilgi için abp.io adresini ziyaret edebilirsiniz." + } +} diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/vi.json b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/vi.json new file mode 100644 index 0000000..cbf9a01 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/vi.json @@ -0,0 +1,9 @@ +{ + "culture": "vi", + "texts": { + "AppName": "Report", + "Menu:Home": "Trang chủ", + "Welcome": "Chào mừng bạn", + "LongWelcomeMessage": "Chào mừng bạn đến ứng dụng. Đây là một dự án khởi nghiệp dựa trên khung ABP. Để biết thêm thông tin, hãy truy cập abp.io." + } +} diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/zh-Hans.json b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/zh-Hans.json new file mode 100644 index 0000000..9ebba61 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/zh-Hans.json @@ -0,0 +1,9 @@ +{ + "culture": "zh-Hans", + "texts": { + "AppName": "Report", + "Menu:Home": "首页", + "Welcome": "欢迎", + "LongWelcomeMessage": "欢迎使用本应用程序。这是一个基于 ABP 框架的启动项目。更多信息,请访问 abp.io。" + } +} diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/zh-Hant.json b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/zh-Hant.json new file mode 100644 index 0000000..a292114 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/Report/zh-Hant.json @@ -0,0 +1,9 @@ +{ + "culture": "zh-Hant", + "texts": { + "AppName": "Report", + "Menu:Home": "首頁", + "Welcome": "歡迎", + "LongWelcomeMessage": "歡迎來到此應用程式. 這是一個基於ABP框架的起始專案. 有關更多訊息, 請瀏覽 abp.io." + } + } diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/Localization/ReportResource.cs b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/ReportResource.cs new file mode 100644 index 0000000..bdab1be --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/Localization/ReportResource.cs @@ -0,0 +1,9 @@ +using Volo.Abp.Localization; + +namespace KonSoft.Report.Localization; + +[LocalizationResourceName("Report")] +public class ReportResource +{ + +} diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/MultiTenancy/MultiTenancyConsts.cs b/modules/report/src/KonSoft.Report.Domain.Shared/MultiTenancy/MultiTenancyConsts.cs new file mode 100644 index 0000000..40a27a4 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/MultiTenancy/MultiTenancyConsts.cs @@ -0,0 +1,10 @@ +namespace KonSoft.Report.MultiTenancy; + +public static class MultiTenancyConsts +{ + /* Enable/disable multi-tenancy easily in a single point. + * If you will never need to multi-tenancy, you can remove + * related modules and code parts, including this file. + */ + public const bool IsEnabled = true; +} diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/ReportDomainErrorCodes.cs b/modules/report/src/KonSoft.Report.Domain.Shared/ReportDomainErrorCodes.cs new file mode 100644 index 0000000..3f91211 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/ReportDomainErrorCodes.cs @@ -0,0 +1,6 @@ +namespace KonSoft.Report; + +public static class ReportDomainErrorCodes +{ + /* You can add your business exception error codes here, as constants */ +} diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/ReportDomainSharedModule.cs b/modules/report/src/KonSoft.Report.Domain.Shared/ReportDomainSharedModule.cs new file mode 100644 index 0000000..e49c6eb --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/ReportDomainSharedModule.cs @@ -0,0 +1,58 @@ +using KonSoft.Report.Localization; +using Volo.Abp.AuditLogging; +using Volo.Abp.BackgroundJobs; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Localization; +using Volo.Abp.Localization.ExceptionHandling; +using Volo.Abp.Modularity; +using Volo.Abp.OpenIddict; +using Volo.Abp.PermissionManagement; +using Volo.Abp.SettingManagement; +using Volo.Abp.TenantManagement; +using Volo.Abp.Validation.Localization; +using Volo.Abp.VirtualFileSystem; + +namespace KonSoft.Report; + +[DependsOn( + typeof(AbpAuditLoggingDomainSharedModule), + typeof(AbpBackgroundJobsDomainSharedModule), + typeof(AbpFeatureManagementDomainSharedModule), + typeof(AbpIdentityDomainSharedModule), + typeof(AbpOpenIddictDomainSharedModule), + typeof(AbpPermissionManagementDomainSharedModule), + typeof(AbpSettingManagementDomainSharedModule), + typeof(AbpTenantManagementDomainSharedModule) + )] +public class ReportDomainSharedModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + ReportGlobalFeatureConfigurator.Configure(); + ReportModuleExtensionConfigurator.Configure(); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + Configure(options => + { + options.Resources + .Add("en") + .AddBaseTypes(typeof(AbpValidationResource)) + .AddVirtualJson("/Localization/Report"); + + options.DefaultResourceType = typeof(ReportResource); + }); + + Configure(options => + { + options.MapCodeNamespace("Report", typeof(ReportResource)); + }); + } +} diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/ReportGlobalFeatureConfigurator.cs b/modules/report/src/KonSoft.Report.Domain.Shared/ReportGlobalFeatureConfigurator.cs new file mode 100644 index 0000000..5ce692d --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/ReportGlobalFeatureConfigurator.cs @@ -0,0 +1,22 @@ +using Volo.Abp.Threading; + +namespace KonSoft.Report; + +public static class ReportGlobalFeatureConfigurator +{ + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + + public static void Configure() + { + OneTimeRunner.Run(() => + { + /* You can configure (enable/disable) global features of the used modules here. + * + * YOU CAN SAFELY DELETE THIS CLASS AND REMOVE ITS USAGES IF YOU DON'T NEED TO IT! + * + * Please refer to the documentation to lear more about the Global Features System: + * https://docs.abp.io/en/abp/latest/Global-Features + */ + }); + } +} diff --git a/modules/report/src/KonSoft.Report.Domain.Shared/ReportModuleExtensionConfigurator.cs b/modules/report/src/KonSoft.Report.Domain.Shared/ReportModuleExtensionConfigurator.cs new file mode 100644 index 0000000..3a1ae57 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain.Shared/ReportModuleExtensionConfigurator.cs @@ -0,0 +1,73 @@ +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Identity; +using Volo.Abp.ObjectExtending; +using Volo.Abp.Threading; + +namespace KonSoft.Report; + +public static class ReportModuleExtensionConfigurator +{ + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + + public static void Configure() + { + OneTimeRunner.Run(() => + { + ConfigureExistingProperties(); + ConfigureExtraProperties(); + }); + } + + private static void ConfigureExistingProperties() + { + /* You can change max lengths for properties of the + * entities defined in the modules used by your application. + * + * Example: Change user and role name max lengths + + AbpUserConsts.MaxNameLength = 99; + IdentityRoleConsts.MaxNameLength = 99; + + * Notice: It is not suggested to change property lengths + * unless you really need it. Go with the standard values wherever possible. + * + * If you are using EF Core, you will need to run the add-migration command after your changes. + */ + } + + private static void ConfigureExtraProperties() + { + /* You can configure extra properties for the + * entities defined in the modules used by your application. + * + * This class can be used to define these extra properties + * with a high level, easy to use API. + * + * Example: Add a new property to the user entity of the identity module + + ObjectExtensionManager.Instance.Modules() + .ConfigureIdentity(identity => + { + identity.ConfigureUser(user => + { + user.AddOrUpdateProperty( //property type: string + "SocialSecurityNumber", //property name + property => + { + //validation rules + property.Attributes.Add(new RequiredAttribute()); + property.Attributes.Add(new StringLengthAttribute(64) {MinimumLength = 4}); + + property.Configuration[IdentityModuleExtensionConsts.ConfigurationNames.AllowUserToEdit] = true; + + //...other configurations for this property + } + ); + }); + }); + + * See the documentation for more: + * https://docs.abp.io/en/abp/latest/Module-Entity-Extensions + */ + } +} diff --git a/modules/report/src/KonSoft.Report.Domain/Data/IReportDbSchemaMigrator.cs b/modules/report/src/KonSoft.Report.Domain/Data/IReportDbSchemaMigrator.cs new file mode 100644 index 0000000..eda5adb --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain/Data/IReportDbSchemaMigrator.cs @@ -0,0 +1,8 @@ +using System.Threading.Tasks; + +namespace KonSoft.Report.Data; + +public interface IReportDbSchemaMigrator +{ + Task MigrateAsync(); +} diff --git a/modules/report/src/KonSoft.Report.Domain/Data/NullReportDbSchemaMigrator.cs b/modules/report/src/KonSoft.Report.Domain/Data/NullReportDbSchemaMigrator.cs new file mode 100644 index 0000000..4133e60 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain/Data/NullReportDbSchemaMigrator.cs @@ -0,0 +1,15 @@ +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; + +namespace KonSoft.Report.Data; + +/* This is used if database provider does't define + * IReportDbSchemaMigrator implementation. + */ +public class NullReportDbSchemaMigrator : IReportDbSchemaMigrator, ITransientDependency +{ + public Task MigrateAsync() + { + return Task.CompletedTask; + } +} diff --git a/modules/report/src/KonSoft.Report.Domain/Data/ReportDbMigrationService.cs b/modules/report/src/KonSoft.Report.Domain/Data/ReportDbMigrationService.cs new file mode 100644 index 0000000..f53ae54 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain/Data/ReportDbMigrationService.cs @@ -0,0 +1,218 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Identity; +using Volo.Abp.MultiTenancy; +using Volo.Abp.TenantManagement; + +namespace KonSoft.Report.Data; + +public class ReportDbMigrationService : ITransientDependency +{ + public ILogger Logger { get; set; } + + private readonly IDataSeeder _dataSeeder; + private readonly IEnumerable _dbSchemaMigrators; + private readonly ITenantRepository _tenantRepository; + private readonly ICurrentTenant _currentTenant; + + public ReportDbMigrationService( + IDataSeeder dataSeeder, + IEnumerable dbSchemaMigrators, + ITenantRepository tenantRepository, + ICurrentTenant currentTenant) + { + _dataSeeder = dataSeeder; + _dbSchemaMigrators = dbSchemaMigrators; + _tenantRepository = tenantRepository; + _currentTenant = currentTenant; + + Logger = NullLogger.Instance; + } + + public async Task MigrateAsync() + { + var initialMigrationAdded = AddInitialMigrationIfNotExist(); + + if (initialMigrationAdded) + { + return; + } + + Logger.LogInformation("Started database migrations..."); + + await MigrateDatabaseSchemaAsync(); + await SeedDataAsync(); + + Logger.LogInformation($"Successfully completed host database migrations."); + + var tenants = await _tenantRepository.GetListAsync(includeDetails: true); + + var migratedDatabaseSchemas = new HashSet(); + foreach (var tenant in tenants) + { + using (_currentTenant.Change(tenant.Id)) + { + if (tenant.ConnectionStrings.Any()) + { + var tenantConnectionStrings = tenant.ConnectionStrings + .Select(x => x.Value) + .ToList(); + + if (!migratedDatabaseSchemas.IsSupersetOf(tenantConnectionStrings)) + { + await MigrateDatabaseSchemaAsync(tenant); + + migratedDatabaseSchemas.AddIfNotContains(tenantConnectionStrings); + } + } + + await SeedDataAsync(tenant); + } + + Logger.LogInformation($"Successfully completed {tenant.Name} tenant database migrations."); + } + + Logger.LogInformation("Successfully completed all database migrations."); + Logger.LogInformation("You can safely end this process..."); + } + + private async Task MigrateDatabaseSchemaAsync(Tenant? tenant = null) + { + Logger.LogInformation( + $"Migrating schema for {(tenant == null ? "host" : tenant.Name + " tenant")} database..."); + + foreach (var migrator in _dbSchemaMigrators) + { + await migrator.MigrateAsync(); + } + } + + private async Task SeedDataAsync(Tenant? tenant = null) + { + Logger.LogInformation($"Executing {(tenant == null ? "host" : tenant.Name + " tenant")} database seed..."); + + await _dataSeeder.SeedAsync(new DataSeedContext(tenant?.Id) + .WithProperty(IdentityDataSeedContributor.AdminEmailPropertyName, IdentityDataSeedContributor.AdminEmailDefaultValue) + .WithProperty(IdentityDataSeedContributor.AdminPasswordPropertyName, IdentityDataSeedContributor.AdminPasswordDefaultValue) + ); + } + + private bool AddInitialMigrationIfNotExist() + { + try + { + if (!DbMigrationsProjectExists()) + { + return false; + } + } + catch (Exception) + { + return false; + } + + try + { + if (!MigrationsFolderExists()) + { + AddInitialMigration(); + return true; + } + else + { + return false; + } + } + catch (Exception e) + { + Logger.LogWarning("Couldn't determinate if any migrations exist : " + e.Message); + return false; + } + } + + private bool DbMigrationsProjectExists() + { + var dbMigrationsProjectFolder = GetEntityFrameworkCoreProjectFolderPath(); + + return dbMigrationsProjectFolder != null; + } + + private bool MigrationsFolderExists() + { + var dbMigrationsProjectFolder = GetEntityFrameworkCoreProjectFolderPath(); + return dbMigrationsProjectFolder != null && Directory.Exists(Path.Combine(dbMigrationsProjectFolder, "Migrations")); + } + + private void AddInitialMigration() + { + Logger.LogInformation("Creating initial migration..."); + + string argumentPrefix; + string fileName; + + if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) || RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + argumentPrefix = "-c"; + fileName = "/bin/bash"; + } + else + { + argumentPrefix = "/C"; + fileName = "cmd.exe"; + } + + var procStartInfo = new ProcessStartInfo(fileName, + $"{argumentPrefix} \"abp create-migration-and-run-migrator \"{GetEntityFrameworkCoreProjectFolderPath()}\"\"" + ); + + try + { + Process.Start(procStartInfo); + } + catch (Exception) + { + throw new Exception("Couldn't run ABP CLI..."); + } + } + + private string? GetEntityFrameworkCoreProjectFolderPath() + { + var slnDirectoryPath = GetSolutionDirectoryPath(); + + if (slnDirectoryPath == null) + { + throw new Exception("Solution folder not found!"); + } + + var srcDirectoryPath = Path.Combine(slnDirectoryPath, "src"); + + return Directory.GetDirectories(srcDirectoryPath) + .FirstOrDefault(d => d.EndsWith(".EntityFrameworkCore")); + } + + private string? GetSolutionDirectoryPath() + { + var currentDirectory = new DirectoryInfo(Directory.GetCurrentDirectory()); + + while (currentDirectory != null && Directory.GetParent(currentDirectory.FullName) != null) + { + currentDirectory = Directory.GetParent(currentDirectory.FullName); + + if (currentDirectory != null && Directory.GetFiles(currentDirectory.FullName).FirstOrDefault(f => f.EndsWith(".sln")) != null) + { + return currentDirectory.FullName; + } + } + + return null; + } +} diff --git a/modules/report/src/KonSoft.Report.Domain/KonSoft.Report.Domain.csproj b/modules/report/src/KonSoft.Report.Domain/KonSoft.Report.Domain.csproj new file mode 100644 index 0000000..3ca0779 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain/KonSoft.Report.Domain.csproj @@ -0,0 +1,28 @@ + + + + + + net8.0 + enable + KonSoft.Report + + + + + + + + + + + + + + + + + + + + diff --git a/modules/report/src/KonSoft.Report.Domain/OpenIddict/OpenIddictDataSeedContributor.cs b/modules/report/src/KonSoft.Report.Domain/OpenIddict/OpenIddictDataSeedContributor.cs new file mode 100644 index 0000000..e2b734f --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain/OpenIddict/OpenIddictDataSeedContributor.cs @@ -0,0 +1,327 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; +using System.Threading.Tasks; +using JetBrains.Annotations; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Localization; +using OpenIddict.Abstractions; +using Volo.Abp; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.OpenIddict.Applications; +using Volo.Abp.OpenIddict.Scopes; +using Volo.Abp.PermissionManagement; +using Volo.Abp.Uow; + +namespace KonSoft.Report.OpenIddict; + +/* Creates initial data that is needed to property run the application + * and make client-to-server communication possible. + */ +public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDependency +{ + private readonly IConfiguration _configuration; + private readonly IOpenIddictApplicationRepository _openIddictApplicationRepository; + private readonly IAbpApplicationManager _applicationManager; + private readonly IOpenIddictScopeRepository _openIddictScopeRepository; + private readonly IOpenIddictScopeManager _scopeManager; + private readonly IPermissionDataSeeder _permissionDataSeeder; + private readonly IStringLocalizer L; + + public OpenIddictDataSeedContributor( + IConfiguration configuration, + IOpenIddictApplicationRepository openIddictApplicationRepository, + IAbpApplicationManager applicationManager, + IOpenIddictScopeRepository openIddictScopeRepository, + IOpenIddictScopeManager scopeManager, + IPermissionDataSeeder permissionDataSeeder, + IStringLocalizer l ) + { + _configuration = configuration; + _openIddictApplicationRepository = openIddictApplicationRepository; + _applicationManager = applicationManager; + _openIddictScopeRepository = openIddictScopeRepository; + _scopeManager = scopeManager; + _permissionDataSeeder = permissionDataSeeder; + L = l; + } + + [UnitOfWork] + public virtual async Task SeedAsync(DataSeedContext context) + { + await CreateScopesAsync(); + await CreateApplicationsAsync(); + } + + private async Task CreateScopesAsync() + { + if (await _openIddictScopeRepository.FindByNameAsync("Report") == null) + { + await _scopeManager.CreateAsync(new OpenIddictScopeDescriptor { + Name = "Report", DisplayName = "Report API", Resources = { "Report" } + }); + } + } + + private async Task CreateApplicationsAsync() + { + var commonScopes = new List { + OpenIddictConstants.Permissions.Scopes.Address, + OpenIddictConstants.Permissions.Scopes.Email, + OpenIddictConstants.Permissions.Scopes.Phone, + OpenIddictConstants.Permissions.Scopes.Profile, + OpenIddictConstants.Permissions.Scopes.Roles, + "Report" + }; + + var configurationSection = _configuration.GetSection("OpenIddict:Applications"); + + + + + + + // Swagger Client + var swaggerClientId = configurationSection["Report_Swagger:ClientId"]; + if (!swaggerClientId.IsNullOrWhiteSpace()) + { + var swaggerRootUrl = configurationSection["Report_Swagger:RootUrl"]?.TrimEnd('/'); + + await CreateApplicationAsync( + name: swaggerClientId!, + type: OpenIddictConstants.ClientTypes.Public, + consentType: OpenIddictConstants.ConsentTypes.Implicit, + displayName: "Swagger Application", + secret: null, + grantTypes: new List { OpenIddictConstants.GrantTypes.AuthorizationCode, }, + scopes: commonScopes, + redirectUri: $"{swaggerRootUrl}/swagger/oauth2-redirect.html", + clientUri: swaggerRootUrl + ); + } + } + + private async Task CreateApplicationAsync( + [NotNull] string name, + [NotNull] string type, + [NotNull] string consentType, + string displayName, + string? secret, + List grantTypes, + List scopes, + string? clientUri = null, + string? redirectUri = null, + string? postLogoutRedirectUri = null, + List? permissions = null) + { + if (!string.IsNullOrEmpty(secret) && string.Equals(type, OpenIddictConstants.ClientTypes.Public, + StringComparison.OrdinalIgnoreCase)) + { + throw new BusinessException(L["NoClientSecretCanBeSetForPublicApplications"]); + } + + if (string.IsNullOrEmpty(secret) && string.Equals(type, OpenIddictConstants.ClientTypes.Confidential, + StringComparison.OrdinalIgnoreCase)) + { + throw new BusinessException(L["TheClientSecretIsRequiredForConfidentialApplications"]); + } + + var client = await _openIddictApplicationRepository.FindByClientIdAsync(name); + + var application = new AbpApplicationDescriptor { + ClientId = name, + ClientType = type, + ClientSecret = secret, + ConsentType = consentType, + DisplayName = displayName, + ClientUri = clientUri, + }; + + Check.NotNullOrEmpty(grantTypes, nameof(grantTypes)); + Check.NotNullOrEmpty(scopes, nameof(scopes)); + + if (new[] { OpenIddictConstants.GrantTypes.AuthorizationCode, OpenIddictConstants.GrantTypes.Implicit }.All( + grantTypes.Contains)) + { + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.CodeIdToken); + + if (string.Equals(type, OpenIddictConstants.ClientTypes.Public, StringComparison.OrdinalIgnoreCase)) + { + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.CodeIdTokenToken); + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.CodeToken); + } + } + + if (!redirectUri.IsNullOrWhiteSpace() || !postLogoutRedirectUri.IsNullOrWhiteSpace()) + { + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Logout); + } + + var buildInGrantTypes = new[] { + OpenIddictConstants.GrantTypes.Implicit, OpenIddictConstants.GrantTypes.Password, + OpenIddictConstants.GrantTypes.AuthorizationCode, OpenIddictConstants.GrantTypes.ClientCredentials, + OpenIddictConstants.GrantTypes.DeviceCode, OpenIddictConstants.GrantTypes.RefreshToken + }; + + foreach (var grantType in grantTypes) + { + if (grantType == OpenIddictConstants.GrantTypes.AuthorizationCode) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.AuthorizationCode); + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.Code); + } + + if (grantType == OpenIddictConstants.GrantTypes.AuthorizationCode || + grantType == OpenIddictConstants.GrantTypes.Implicit) + { + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Authorization); + } + + if (grantType == OpenIddictConstants.GrantTypes.AuthorizationCode || + grantType == OpenIddictConstants.GrantTypes.ClientCredentials || + grantType == OpenIddictConstants.GrantTypes.Password || + grantType == OpenIddictConstants.GrantTypes.RefreshToken || + grantType == OpenIddictConstants.GrantTypes.DeviceCode) + { + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Token); + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Revocation); + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Introspection); + } + + if (grantType == OpenIddictConstants.GrantTypes.ClientCredentials) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.ClientCredentials); + } + + if (grantType == OpenIddictConstants.GrantTypes.Implicit) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.Implicit); + } + + if (grantType == OpenIddictConstants.GrantTypes.Password) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.Password); + } + + if (grantType == OpenIddictConstants.GrantTypes.RefreshToken) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.RefreshToken); + } + + if (grantType == OpenIddictConstants.GrantTypes.DeviceCode) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.DeviceCode); + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Device); + } + + if (grantType == OpenIddictConstants.GrantTypes.Implicit) + { + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.IdToken); + if (string.Equals(type, OpenIddictConstants.ClientTypes.Public, StringComparison.OrdinalIgnoreCase)) + { + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.IdTokenToken); + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.Token); + } + } + + if (!buildInGrantTypes.Contains(grantType)) + { + application.Permissions.Add(OpenIddictConstants.Permissions.Prefixes.GrantType + grantType); + } + } + + var buildInScopes = new[] { + OpenIddictConstants.Permissions.Scopes.Address, OpenIddictConstants.Permissions.Scopes.Email, + OpenIddictConstants.Permissions.Scopes.Phone, OpenIddictConstants.Permissions.Scopes.Profile, + OpenIddictConstants.Permissions.Scopes.Roles + }; + + foreach (var scope in scopes) + { + if (buildInScopes.Contains(scope)) + { + application.Permissions.Add(scope); + } + else + { + application.Permissions.Add(OpenIddictConstants.Permissions.Prefixes.Scope + scope); + } + } + + if (redirectUri != null) + { + if (!redirectUri.IsNullOrEmpty()) + { + if (!Uri.TryCreate(redirectUri, UriKind.Absolute, out var uri) || !uri.IsWellFormedOriginalString()) + { + throw new BusinessException(L["InvalidRedirectUri", redirectUri]); + } + + if (application.RedirectUris.All(x => x != uri)) + { + application.RedirectUris.Add(uri); + } + } + } + + if (postLogoutRedirectUri != null) + { + if (!postLogoutRedirectUri.IsNullOrEmpty()) + { + if (!Uri.TryCreate(postLogoutRedirectUri, UriKind.Absolute, out var uri) || + !uri.IsWellFormedOriginalString()) + { + throw new BusinessException(L["InvalidPostLogoutRedirectUri", postLogoutRedirectUri]); + } + + if (application.PostLogoutRedirectUris.All(x => x != uri)) + { + application.PostLogoutRedirectUris.Add(uri); + } + } + } + + if (permissions != null) + { + await _permissionDataSeeder.SeedAsync( + ClientPermissionValueProvider.ProviderName, + name, + permissions, + null + ); + } + + if (client == null) + { + await _applicationManager.CreateAsync(application); + return; + } + + if (!HasSameRedirectUris(client, application)) + { + client.RedirectUris = JsonSerializer.Serialize(application.RedirectUris.Select(q => q.ToString().TrimEnd('/'))); + client.PostLogoutRedirectUris = JsonSerializer.Serialize(application.PostLogoutRedirectUris.Select(q => q.ToString().TrimEnd('/'))); + + await _applicationManager.UpdateAsync(client.ToModel()); + } + + if (!HasSameScopes(client, application)) + { + client.Permissions = JsonSerializer.Serialize(application.Permissions.Select(q => q.ToString())); + await _applicationManager.UpdateAsync(client.ToModel()); + } + } + + private bool HasSameRedirectUris(OpenIddictApplication existingClient, AbpApplicationDescriptor application) + { + return existingClient.RedirectUris == JsonSerializer.Serialize(application.RedirectUris.Select(q => q.ToString().TrimEnd('/'))); + } + + private bool HasSameScopes(OpenIddictApplication existingClient, AbpApplicationDescriptor application) + { + return existingClient.Permissions == JsonSerializer.Serialize(application.Permissions.Select(q => q.ToString().TrimEnd('/'))); + } +} diff --git a/modules/report/src/KonSoft.Report.Domain/Properties/AssemblyInfo.cs b/modules/report/src/KonSoft.Report.Domain/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..d9b7131 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain/Properties/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using System.Runtime.CompilerServices; +[assembly:InternalsVisibleToAttribute("KonSoft.Report.Domain.Tests")] +[assembly:InternalsVisibleToAttribute("KonSoft.Report.TestBase")] diff --git a/modules/report/src/KonSoft.Report.Domain/ReportConsts.cs b/modules/report/src/KonSoft.Report.Domain/ReportConsts.cs new file mode 100644 index 0000000..705ae6a --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain/ReportConsts.cs @@ -0,0 +1,8 @@ +namespace KonSoft.Report; + +public static class ReportConsts +{ + public const string DbTablePrefix = "App"; + + public const string DbSchema = null; +} diff --git a/modules/report/src/KonSoft.Report.Domain/ReportDomainModule.cs b/modules/report/src/KonSoft.Report.Domain/ReportDomainModule.cs new file mode 100644 index 0000000..ad4c0de --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain/ReportDomainModule.cs @@ -0,0 +1,68 @@ +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection.Extensions; +using KonSoft.Report.MultiTenancy; +using Volo.Abp.AuditLogging; +using Volo.Abp.BackgroundJobs; +using Volo.Abp.Emailing; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Volo.Abp.MultiTenancy; +using Volo.Abp.OpenIddict; +using Volo.Abp.PermissionManagement.Identity; +using Volo.Abp.PermissionManagement.OpenIddict; +using Volo.Abp.SettingManagement; +using Volo.Abp.TenantManagement; + +namespace KonSoft.Report; + +[DependsOn( + typeof(ReportDomainSharedModule), + typeof(AbpAuditLoggingDomainModule), + typeof(AbpBackgroundJobsDomainModule), + typeof(AbpFeatureManagementDomainModule), + typeof(AbpIdentityDomainModule), + typeof(AbpOpenIddictDomainModule), + typeof(AbpPermissionManagementDomainOpenIddictModule), + typeof(AbpPermissionManagementDomainIdentityModule), + typeof(AbpSettingManagementDomainModule), + typeof(AbpTenantManagementDomainModule), + typeof(AbpEmailingModule) +)] +public class ReportDomainModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.Languages.Add(new LanguageInfo("ar", "ar", "العربية")); + options.Languages.Add(new LanguageInfo("cs", "cs", "Čeština")); + options.Languages.Add(new LanguageInfo("en", "en", "English")); + options.Languages.Add(new LanguageInfo("en-GB", "en-GB", "English (UK)")); + options.Languages.Add(new LanguageInfo("hu", "hu", "Magyar")); + options.Languages.Add(new LanguageInfo("hr", "hr", "Croatian")); + options.Languages.Add(new LanguageInfo("fi", "fi", "Finnish")); + options.Languages.Add(new LanguageInfo("fr", "fr", "Français")); + options.Languages.Add(new LanguageInfo("hi", "hi", "Hindi")); + options.Languages.Add(new LanguageInfo("it", "it", "Italiano")); + options.Languages.Add(new LanguageInfo("pt-BR", "pt-BR", "Português")); + options.Languages.Add(new LanguageInfo("ru", "ru", "Русский")); + options.Languages.Add(new LanguageInfo("sk", "sk", "Slovak")); + options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe")); + options.Languages.Add(new LanguageInfo("zh-Hans", "zh-Hans", "简体中文")); + options.Languages.Add(new LanguageInfo("zh-Hant", "zh-Hant", "繁體中文")); + options.Languages.Add(new LanguageInfo("de-DE", "de-DE", "Deutsch")); + options.Languages.Add(new LanguageInfo("es", "es", "Español")); + }); + + Configure(options => + { + options.IsEnabled = MultiTenancyConsts.IsEnabled; + }); + +#if DEBUG + context.Services.Replace(ServiceDescriptor.Singleton()); +#endif + } +} diff --git a/modules/report/src/KonSoft.Report.Domain/Settings/ReportSettingDefinitionProvider.cs b/modules/report/src/KonSoft.Report.Domain/Settings/ReportSettingDefinitionProvider.cs new file mode 100644 index 0000000..844e270 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain/Settings/ReportSettingDefinitionProvider.cs @@ -0,0 +1,12 @@ +using Volo.Abp.Settings; + +namespace KonSoft.Report.Settings; + +public class ReportSettingDefinitionProvider : SettingDefinitionProvider +{ + public override void Define(ISettingDefinitionContext context) + { + //Define your own settings here. Example: + //context.Add(new SettingDefinition(ReportSettings.MySetting1)); + } +} diff --git a/modules/report/src/KonSoft.Report.Domain/Settings/ReportSettings.cs b/modules/report/src/KonSoft.Report.Domain/Settings/ReportSettings.cs new file mode 100644 index 0000000..48d4c45 --- /dev/null +++ b/modules/report/src/KonSoft.Report.Domain/Settings/ReportSettings.cs @@ -0,0 +1,9 @@ +namespace KonSoft.Report.Settings; + +public static class ReportSettings +{ + private const string Prefix = "Report"; + + //Add your own setting names here. Example: + //public const string MySetting1 = Prefix + ".MySetting1"; +} diff --git a/modules/report/src/KonSoft.Report.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreReportDbSchemaMigrator.cs b/modules/report/src/KonSoft.Report.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreReportDbSchemaMigrator.cs new file mode 100644 index 0000000..40bff4e --- /dev/null +++ b/modules/report/src/KonSoft.Report.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreReportDbSchemaMigrator.cs @@ -0,0 +1,34 @@ +using System; +using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using KonSoft.Report.Data; +using Volo.Abp.DependencyInjection; + +namespace KonSoft.Report.EntityFrameworkCore; + +public class EntityFrameworkCoreReportDbSchemaMigrator + : IReportDbSchemaMigrator, ITransientDependency +{ + private readonly IServiceProvider _serviceProvider; + + public EntityFrameworkCoreReportDbSchemaMigrator( + IServiceProvider serviceProvider) + { + _serviceProvider = serviceProvider; + } + + public async Task MigrateAsync() + { + /* We intentionally resolve the ReportDbContext + * from IServiceProvider (instead of directly injecting it) + * to properly get the connection string of the current tenant in the + * current scope. + */ + + await _serviceProvider + .GetRequiredService() + .Database + .MigrateAsync(); + } +} diff --git a/modules/report/src/KonSoft.Report.EntityFrameworkCore/EntityFrameworkCore/ReportDbContext.cs b/modules/report/src/KonSoft.Report.EntityFrameworkCore/EntityFrameworkCore/ReportDbContext.cs new file mode 100644 index 0000000..10edbfb --- /dev/null +++ b/modules/report/src/KonSoft.Report.EntityFrameworkCore/EntityFrameworkCore/ReportDbContext.cs @@ -0,0 +1,86 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp.AuditLogging.EntityFrameworkCore; +using Volo.Abp.BackgroundJobs.EntityFrameworkCore; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.FeatureManagement.EntityFrameworkCore; +using Volo.Abp.Identity; +using Volo.Abp.Identity.EntityFrameworkCore; +using Volo.Abp.OpenIddict.EntityFrameworkCore; +using Volo.Abp.PermissionManagement.EntityFrameworkCore; +using Volo.Abp.SettingManagement.EntityFrameworkCore; +using Volo.Abp.TenantManagement; +using Volo.Abp.TenantManagement.EntityFrameworkCore; + +namespace KonSoft.Report.EntityFrameworkCore; + +[ReplaceDbContext(typeof(IIdentityDbContext))] +[ReplaceDbContext(typeof(ITenantManagementDbContext))] +[ConnectionStringName("Default")] +public class ReportDbContext : + AbpDbContext, + IIdentityDbContext, + ITenantManagementDbContext +{ + /* Add DbSet properties for your Aggregate Roots / Entities here. */ + + #region Entities from the modules + + /* Notice: We only implemented IIdentityDbContext and ITenantManagementDbContext + * and replaced them for this DbContext. This allows you to perform JOIN + * queries for the entities of these modules over the repositories easily. You + * typically don't need that for other modules. But, if you need, you can + * implement the DbContext interface of the needed module and use ReplaceDbContext + * attribute just like IIdentityDbContext and ITenantManagementDbContext. + * + * More info: Replacing a DbContext of a module ensures that the related module + * uses this DbContext on runtime. Otherwise, it will use its own DbContext class. + */ + + //Identity + public DbSet Users { get; set; } + public DbSet Roles { get; set; } + public DbSet ClaimTypes { get; set; } + public DbSet OrganizationUnits { get; set; } + public DbSet SecurityLogs { get; set; } + public DbSet LinkUsers { get; set; } + public DbSet UserDelegations { get; set; } + public DbSet Sessions { get; set; } + // Tenant Management + public DbSet Tenants { get; set; } + public DbSet TenantConnectionStrings { get; set; } + + #endregion + + public ReportDbContext(DbContextOptions options) + : base(options) + { + + } + + protected override void OnModelCreating(ModelBuilder builder) + { + base.OnModelCreating(builder); + + /* Include modules to your migration db context */ + + builder.ConfigurePermissionManagement(); + builder.ConfigureSettingManagement(); + builder.ConfigureBackgroundJobs(); + builder.ConfigureAuditLogging(); + builder.ConfigureIdentity(); + builder.ConfigureOpenIddict(); + builder.ConfigureFeatureManagement(); + builder.ConfigureTenantManagement(); + + /* Configure your own tables/entities inside here */ + + //builder.Entity(b => + //{ + // b.ToTable(ReportConsts.DbTablePrefix + "YourEntities", ReportConsts.DbSchema); + // b.ConfigureByConvention(); //auto configure for the base class props + // //... + //}); + } +} diff --git a/modules/report/src/KonSoft.Report.EntityFrameworkCore/EntityFrameworkCore/ReportDbContextFactory.cs b/modules/report/src/KonSoft.Report.EntityFrameworkCore/EntityFrameworkCore/ReportDbContextFactory.cs new file mode 100644 index 0000000..d394ab6 --- /dev/null +++ b/modules/report/src/KonSoft.Report.EntityFrameworkCore/EntityFrameworkCore/ReportDbContextFactory.cs @@ -0,0 +1,36 @@ +using System; +using System.IO; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Design; +using Microsoft.Extensions.Configuration; + +namespace KonSoft.Report.EntityFrameworkCore; + +/* This class is needed for EF Core console commands + * (like Add-Migration and Update-Database commands) */ +public class ReportDbContextFactory : IDesignTimeDbContextFactory +{ + public ReportDbContext CreateDbContext(string[] args) + { + // https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic + AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); + + ReportEfCoreEntityExtensionMappings.Configure(); + + var configuration = BuildConfiguration(); + + var builder = new DbContextOptionsBuilder() + .UseNpgsql(configuration.GetConnectionString("Default")); + + return new ReportDbContext(builder.Options); + } + + private static IConfigurationRoot BuildConfiguration() + { + var builder = new ConfigurationBuilder() + .SetBasePath(Path.Combine(Directory.GetCurrentDirectory(), "../KonSoft.Report.DbMigrator/")) + .AddJsonFile("appsettings.json", optional: false); + + return builder.Build(); + } +} diff --git a/modules/report/src/KonSoft.Report.EntityFrameworkCore/EntityFrameworkCore/ReportEfCoreEntityExtensionMappings.cs b/modules/report/src/KonSoft.Report.EntityFrameworkCore/EntityFrameworkCore/ReportEfCoreEntityExtensionMappings.cs new file mode 100644 index 0000000..ca2ce19 --- /dev/null +++ b/modules/report/src/KonSoft.Report.EntityFrameworkCore/EntityFrameworkCore/ReportEfCoreEntityExtensionMappings.cs @@ -0,0 +1,44 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Identity; +using Volo.Abp.ObjectExtending; +using Volo.Abp.Threading; + +namespace KonSoft.Report.EntityFrameworkCore; + +public static class ReportEfCoreEntityExtensionMappings +{ + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + + public static void Configure() + { + ReportGlobalFeatureConfigurator.Configure(); + ReportModuleExtensionConfigurator.Configure(); + + OneTimeRunner.Run(() => + { + /* You can configure extra properties for the + * entities defined in the modules used by your application. + * + * This class can be used to map these extra properties to table fields in the database. + * + * USE THIS CLASS ONLY TO CONFIGURE EF CORE RELATED MAPPING. + * USE ReportModuleExtensionConfigurator CLASS (in the Domain.Shared project) + * FOR A HIGH LEVEL API TO DEFINE EXTRA PROPERTIES TO ENTITIES OF THE USED MODULES + * + * Example: Map a property to a table field: + + ObjectExtensionManager.Instance + .MapEfCoreProperty( + "MyProperty", + (entityBuilder, propertyBuilder) => + { + propertyBuilder.HasMaxLength(128); + } + ); + + * See the documentation for more: + * https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Extending-Entities + */ + }); + } +} diff --git a/modules/report/src/KonSoft.Report.EntityFrameworkCore/EntityFrameworkCore/ReportEntityFrameworkCoreModule.cs b/modules/report/src/KonSoft.Report.EntityFrameworkCore/EntityFrameworkCore/ReportEntityFrameworkCoreModule.cs new file mode 100644 index 0000000..cabe4ec --- /dev/null +++ b/modules/report/src/KonSoft.Report.EntityFrameworkCore/EntityFrameworkCore/ReportEntityFrameworkCoreModule.cs @@ -0,0 +1,57 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Uow; +using Volo.Abp.AuditLogging.EntityFrameworkCore; +using Volo.Abp.BackgroundJobs.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.PostgreSql; +using Volo.Abp.FeatureManagement.EntityFrameworkCore; +using Volo.Abp.Identity.EntityFrameworkCore; +using Volo.Abp.Modularity; +using Volo.Abp.OpenIddict.EntityFrameworkCore; +using Volo.Abp.PermissionManagement.EntityFrameworkCore; +using Volo.Abp.SettingManagement.EntityFrameworkCore; +using Volo.Abp.TenantManagement.EntityFrameworkCore; + +namespace KonSoft.Report.EntityFrameworkCore; + +[DependsOn( + typeof(ReportDomainModule), + typeof(AbpIdentityEntityFrameworkCoreModule), + typeof(AbpOpenIddictEntityFrameworkCoreModule), + typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpSettingManagementEntityFrameworkCoreModule), + typeof(AbpEntityFrameworkCorePostgreSqlModule), + typeof(AbpBackgroundJobsEntityFrameworkCoreModule), + typeof(AbpAuditLoggingEntityFrameworkCoreModule), + typeof(AbpTenantManagementEntityFrameworkCoreModule), + typeof(AbpFeatureManagementEntityFrameworkCoreModule) + )] +public class ReportEntityFrameworkCoreModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + // https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic + AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); + + ReportEfCoreEntityExtensionMappings.Configure(); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAbpDbContext(options => + { + /* Remove "includeAllEntities: true" to create + * default repositories only for aggregate roots */ + options.AddDefaultRepositories(includeAllEntities: true); + }); + + Configure(options => + { + /* The main point to change your DBMS. + * See also ReportMigrationsDbContextFactory for EF Core tooling. */ + options.UseNpgsql(); + }); + + } +} diff --git a/modules/report/src/KonSoft.Report.EntityFrameworkCore/KonSoft.Report.EntityFrameworkCore.csproj b/modules/report/src/KonSoft.Report.EntityFrameworkCore/KonSoft.Report.EntityFrameworkCore.csproj new file mode 100644 index 0000000..d31cb9c --- /dev/null +++ b/modules/report/src/KonSoft.Report.EntityFrameworkCore/KonSoft.Report.EntityFrameworkCore.csproj @@ -0,0 +1,31 @@ + + + + + + net8.0 + enable + KonSoft.Report + + + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers + + + + diff --git a/modules/report/src/KonSoft.Report.EntityFrameworkCore/Properties/AssemblyInfo.cs b/modules/report/src/KonSoft.Report.EntityFrameworkCore/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..b45c97b --- /dev/null +++ b/modules/report/src/KonSoft.Report.EntityFrameworkCore/Properties/AssemblyInfo.cs @@ -0,0 +1,2 @@ +using System.Runtime.CompilerServices; +[assembly:InternalsVisibleToAttribute("KonSoft.Report.EntityFrameworkCore.Tests")] diff --git a/modules/report/src/KonSoft.Report.HttpApi.Client/KonSoft.Report.HttpApi.Client.csproj b/modules/report/src/KonSoft.Report.HttpApi.Client/KonSoft.Report.HttpApi.Client.csproj new file mode 100644 index 0000000..85a166a --- /dev/null +++ b/modules/report/src/KonSoft.Report.HttpApi.Client/KonSoft.Report.HttpApi.Client.csproj @@ -0,0 +1,29 @@ + + + + + + net8.0 + enable + KonSoft.Report + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/report/src/KonSoft.Report.HttpApi.Client/ReportHttpApiClientModule.cs b/modules/report/src/KonSoft.Report.HttpApi.Client/ReportHttpApiClientModule.cs new file mode 100644 index 0000000..0ec52d7 --- /dev/null +++ b/modules/report/src/KonSoft.Report.HttpApi.Client/ReportHttpApiClientModule.cs @@ -0,0 +1,38 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Account; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; +using Volo.Abp.PermissionManagement; +using Volo.Abp.TenantManagement; +using Volo.Abp.SettingManagement; +using Volo.Abp.VirtualFileSystem; + +namespace KonSoft.Report; + +[DependsOn( + typeof(ReportApplicationContractsModule), + typeof(AbpAccountHttpApiClientModule), + typeof(AbpIdentityHttpApiClientModule), + typeof(AbpPermissionManagementHttpApiClientModule), + typeof(AbpTenantManagementHttpApiClientModule), + typeof(AbpFeatureManagementHttpApiClientModule), + typeof(AbpSettingManagementHttpApiClientModule) +)] +public class ReportHttpApiClientModule : AbpModule +{ + public const string RemoteServiceName = "Default"; + + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddHttpClientProxies( + typeof(ReportApplicationContractsModule).Assembly, + RemoteServiceName + ); + + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + } +} diff --git a/modules/report/src/KonSoft.Report.HttpApi/Controllers/ReportController.cs b/modules/report/src/KonSoft.Report.HttpApi/Controllers/ReportController.cs new file mode 100644 index 0000000..e2843e2 --- /dev/null +++ b/modules/report/src/KonSoft.Report.HttpApi/Controllers/ReportController.cs @@ -0,0 +1,14 @@ +using KonSoft.Report.Localization; +using Volo.Abp.AspNetCore.Mvc; + +namespace KonSoft.Report.Controllers; + +/* Inherit your controllers from this class. + */ +public abstract class ReportController : AbpControllerBase +{ + protected ReportController() + { + LocalizationResource = typeof(ReportResource); + } +} diff --git a/modules/report/src/KonSoft.Report.HttpApi/KonSoft.Report.HttpApi.csproj b/modules/report/src/KonSoft.Report.HttpApi/KonSoft.Report.HttpApi.csproj new file mode 100644 index 0000000..acf82b7 --- /dev/null +++ b/modules/report/src/KonSoft.Report.HttpApi/KonSoft.Report.HttpApi.csproj @@ -0,0 +1,24 @@ + + + + + + net8.0 + enable + KonSoft.Report + + + + + + + + + + + + + + + + diff --git a/modules/report/src/KonSoft.Report.HttpApi/Models/Test/TestModel.cs b/modules/report/src/KonSoft.Report.HttpApi/Models/Test/TestModel.cs new file mode 100644 index 0000000..0673740 --- /dev/null +++ b/modules/report/src/KonSoft.Report.HttpApi/Models/Test/TestModel.cs @@ -0,0 +1,10 @@ +using System; + +namespace KonSoft.Report.Models.Test; + +public class TestModel +{ + public string? Name { get; set; } + + public DateTime BirthDate { get; set; } +} diff --git a/modules/report/src/KonSoft.Report.HttpApi/ReportHttpApiModule.cs b/modules/report/src/KonSoft.Report.HttpApi/ReportHttpApiModule.cs new file mode 100644 index 0000000..ee189b5 --- /dev/null +++ b/modules/report/src/KonSoft.Report.HttpApi/ReportHttpApiModule.cs @@ -0,0 +1,41 @@ +using Localization.Resources.AbpUi; +using KonSoft.Report.Localization; +using Volo.Abp.Account; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Volo.Abp.PermissionManagement.HttpApi; +using Volo.Abp.SettingManagement; +using Volo.Abp.TenantManagement; + +namespace KonSoft.Report; + +[DependsOn( + typeof(ReportApplicationContractsModule), + typeof(AbpAccountHttpApiModule), + typeof(AbpIdentityHttpApiModule), + typeof(AbpPermissionManagementHttpApiModule), + typeof(AbpTenantManagementHttpApiModule), + typeof(AbpFeatureManagementHttpApiModule), + typeof(AbpSettingManagementHttpApiModule) + )] +public class ReportHttpApiModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + ConfigureLocalization(); + } + + private void ConfigureLocalization() + { + Configure(options => + { + options.Resources + .Get() + .AddBaseTypes( + typeof(AbpUiResource) + ); + }); + } +} diff --git a/modules/report/test/KonSoft.Report.Application.Tests/KonSoft.Report.Application.Tests.csproj b/modules/report/test/KonSoft.Report.Application.Tests/KonSoft.Report.Application.Tests.csproj new file mode 100644 index 0000000..c5374fb --- /dev/null +++ b/modules/report/test/KonSoft.Report.Application.Tests/KonSoft.Report.Application.Tests.csproj @@ -0,0 +1,20 @@ + + + + + + net8.0 + enable + KonSoft.Report + + + + + + + + + + + + diff --git a/modules/report/test/KonSoft.Report.Application.Tests/ReportApplicationTestBase.cs b/modules/report/test/KonSoft.Report.Application.Tests/ReportApplicationTestBase.cs new file mode 100644 index 0000000..634c92a --- /dev/null +++ b/modules/report/test/KonSoft.Report.Application.Tests/ReportApplicationTestBase.cs @@ -0,0 +1,9 @@ +using Volo.Abp.Modularity; + +namespace KonSoft.Report; + +public abstract class ReportApplicationTestBase : ReportTestBase + where TStartupModule : IAbpModule +{ + +} diff --git a/modules/report/test/KonSoft.Report.Application.Tests/ReportApplicationTestModule.cs b/modules/report/test/KonSoft.Report.Application.Tests/ReportApplicationTestModule.cs new file mode 100644 index 0000000..b612b5f --- /dev/null +++ b/modules/report/test/KonSoft.Report.Application.Tests/ReportApplicationTestModule.cs @@ -0,0 +1,12 @@ +using Volo.Abp.Modularity; + +namespace KonSoft.Report; + +[DependsOn( + typeof(ReportApplicationModule), + typeof(ReportDomainTestModule) +)] +public class ReportApplicationTestModule : AbpModule +{ + +} diff --git a/modules/report/test/KonSoft.Report.Application.Tests/Samples/SampleAppServiceTests.cs b/modules/report/test/KonSoft.Report.Application.Tests/Samples/SampleAppServiceTests.cs new file mode 100644 index 0000000..b597da9 --- /dev/null +++ b/modules/report/test/KonSoft.Report.Application.Tests/Samples/SampleAppServiceTests.cs @@ -0,0 +1,34 @@ +using Shouldly; +using System.Threading.Tasks; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; +using Xunit; + +namespace KonSoft.Report.Samples; + +/* This is just an example test class. + * Normally, you don't test code of the modules you are using + * (like IIdentityUserAppService here). + * Only test your own application services. + */ +public abstract class SampleAppServiceTests : ReportApplicationTestBase + where TStartupModule : IAbpModule +{ + private readonly IIdentityUserAppService _userAppService; + + protected SampleAppServiceTests() + { + _userAppService = GetRequiredService(); + } + + [Fact] + public async Task Initial_Data_Should_Contain_Admin_User() + { + //Act + var result = await _userAppService.GetListAsync(new GetIdentityUsersInput()); + + //Assert + result.TotalCount.ShouldBeGreaterThan(0); + result.Items.ShouldContain(u => u.UserName == "admin"); + } +} diff --git a/modules/report/test/KonSoft.Report.Domain.Tests/KonSoft.Report.Domain.Tests.csproj b/modules/report/test/KonSoft.Report.Domain.Tests/KonSoft.Report.Domain.Tests.csproj new file mode 100644 index 0000000..f294473 --- /dev/null +++ b/modules/report/test/KonSoft.Report.Domain.Tests/KonSoft.Report.Domain.Tests.csproj @@ -0,0 +1,20 @@ + + + + + + net8.0 + enable + KonSoft.Report + + + + + + + + + + + + diff --git a/modules/report/test/KonSoft.Report.Domain.Tests/ReportDomainTestBase.cs b/modules/report/test/KonSoft.Report.Domain.Tests/ReportDomainTestBase.cs new file mode 100644 index 0000000..1840a70 --- /dev/null +++ b/modules/report/test/KonSoft.Report.Domain.Tests/ReportDomainTestBase.cs @@ -0,0 +1,10 @@ +using Volo.Abp.Modularity; + +namespace KonSoft.Report; + +/* Inherit from this class for your domain layer tests. */ +public abstract class ReportDomainTestBase : ReportTestBase + where TStartupModule : IAbpModule +{ + +} diff --git a/modules/report/test/KonSoft.Report.Domain.Tests/ReportDomainTestModule.cs b/modules/report/test/KonSoft.Report.Domain.Tests/ReportDomainTestModule.cs new file mode 100644 index 0000000..59edb92 --- /dev/null +++ b/modules/report/test/KonSoft.Report.Domain.Tests/ReportDomainTestModule.cs @@ -0,0 +1,12 @@ +using Volo.Abp.Modularity; + +namespace KonSoft.Report; + +[DependsOn( + typeof(ReportDomainModule), + typeof(ReportTestBaseModule) +)] +public class ReportDomainTestModule : AbpModule +{ + +} diff --git a/modules/report/test/KonSoft.Report.Domain.Tests/Samples/SampleDomainTests.cs b/modules/report/test/KonSoft.Report.Domain.Tests/Samples/SampleDomainTests.cs new file mode 100644 index 0000000..4b4729f --- /dev/null +++ b/modules/report/test/KonSoft.Report.Domain.Tests/Samples/SampleDomainTests.cs @@ -0,0 +1,46 @@ +using System.Threading.Tasks; +using Shouldly; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; +using Xunit; + +namespace KonSoft.Report.Samples; + +/* This is just an example test class. + * Normally, you don't test code of the modules you are using + * (like IdentityUserManager here). + * Only test your own domain services. + */ +public abstract class SampleDomainTests : ReportDomainTestBase + where TStartupModule : IAbpModule +{ + private readonly IIdentityUserRepository _identityUserRepository; + private readonly IdentityUserManager _identityUserManager; + + protected SampleDomainTests() + { + _identityUserRepository = GetRequiredService(); + _identityUserManager = GetRequiredService(); + } + + [Fact] + public async Task Should_Set_Email_Of_A_User() + { + IdentityUser adminUser; + + /* Need to manually start Unit Of Work because + * FirstOrDefaultAsync should be executed while db connection / context is available. + */ + await WithUnitOfWorkAsync(async () => + { + adminUser = await _identityUserRepository + .FindByNormalizedUserNameAsync("ADMIN"); + + await _identityUserManager.SetEmailAsync(adminUser, "newemail@abp.io"); + await _identityUserRepository.UpdateAsync(adminUser); + }); + + adminUser = await _identityUserRepository.FindByNormalizedUserNameAsync("ADMIN"); + adminUser.Email.ShouldBe("newemail@abp.io"); + } +} diff --git a/modules/report/test/KonSoft.Report.EntityFrameworkCore.Tests/EntityFrameworkCore/Applications/EfCoreSampleAppServiceTests.cs b/modules/report/test/KonSoft.Report.EntityFrameworkCore.Tests/EntityFrameworkCore/Applications/EfCoreSampleAppServiceTests.cs new file mode 100644 index 0000000..4ef5eed --- /dev/null +++ b/modules/report/test/KonSoft.Report.EntityFrameworkCore.Tests/EntityFrameworkCore/Applications/EfCoreSampleAppServiceTests.cs @@ -0,0 +1,10 @@ +using KonSoft.Report.Samples; +using Xunit; + +namespace KonSoft.Report.EntityFrameworkCore.Applications; + +[Collection(ReportTestConsts.CollectionDefinitionName)] +public class EfCoreSampleAppServiceTests : SampleAppServiceTests +{ + +} diff --git a/modules/report/test/KonSoft.Report.EntityFrameworkCore.Tests/EntityFrameworkCore/Domains/EfCoreSampleDomainTests.cs b/modules/report/test/KonSoft.Report.EntityFrameworkCore.Tests/EntityFrameworkCore/Domains/EfCoreSampleDomainTests.cs new file mode 100644 index 0000000..4019f10 --- /dev/null +++ b/modules/report/test/KonSoft.Report.EntityFrameworkCore.Tests/EntityFrameworkCore/Domains/EfCoreSampleDomainTests.cs @@ -0,0 +1,10 @@ +using KonSoft.Report.Samples; +using Xunit; + +namespace KonSoft.Report.EntityFrameworkCore.Domains; + +[Collection(ReportTestConsts.CollectionDefinitionName)] +public class EfCoreSampleDomainTests : SampleDomainTests +{ + +} diff --git a/modules/report/test/KonSoft.Report.EntityFrameworkCore.Tests/EntityFrameworkCore/ReportEntityFrameworkCoreCollection.cs b/modules/report/test/KonSoft.Report.EntityFrameworkCore.Tests/EntityFrameworkCore/ReportEntityFrameworkCoreCollection.cs new file mode 100644 index 0000000..beeedd5 --- /dev/null +++ b/modules/report/test/KonSoft.Report.EntityFrameworkCore.Tests/EntityFrameworkCore/ReportEntityFrameworkCoreCollection.cs @@ -0,0 +1,9 @@ +using Xunit; + +namespace KonSoft.Report.EntityFrameworkCore; + +[CollectionDefinition(ReportTestConsts.CollectionDefinitionName)] +public class ReportEntityFrameworkCoreCollection : ICollectionFixture +{ + +} diff --git a/modules/report/test/KonSoft.Report.EntityFrameworkCore.Tests/EntityFrameworkCore/ReportEntityFrameworkCoreCollectionFixtureBase.cs b/modules/report/test/KonSoft.Report.EntityFrameworkCore.Tests/EntityFrameworkCore/ReportEntityFrameworkCoreCollectionFixtureBase.cs new file mode 100644 index 0000000..1fd8ecb --- /dev/null +++ b/modules/report/test/KonSoft.Report.EntityFrameworkCore.Tests/EntityFrameworkCore/ReportEntityFrameworkCoreCollectionFixtureBase.cs @@ -0,0 +1,9 @@ +using KonSoft.Report.EntityFrameworkCore; +using Xunit; + +namespace KonSoft.Report.EntityFrameworkCore; + +public class ReportEntityFrameworkCoreCollectionFixtureBase : ICollectionFixture +{ + +} diff --git a/modules/report/test/KonSoft.Report.EntityFrameworkCore.Tests/EntityFrameworkCore/ReportEntityFrameworkCoreFixture.cs b/modules/report/test/KonSoft.Report.EntityFrameworkCore.Tests/EntityFrameworkCore/ReportEntityFrameworkCoreFixture.cs new file mode 100644 index 0000000..62ce6b1 --- /dev/null +++ b/modules/report/test/KonSoft.Report.EntityFrameworkCore.Tests/EntityFrameworkCore/ReportEntityFrameworkCoreFixture.cs @@ -0,0 +1,11 @@ +using System; + +namespace KonSoft.Report.EntityFrameworkCore; + +public class ReportEntityFrameworkCoreFixture : IDisposable +{ + public void Dispose() + { + + } +} diff --git a/modules/report/test/KonSoft.Report.EntityFrameworkCore.Tests/EntityFrameworkCore/ReportEntityFrameworkCoreTestBase.cs b/modules/report/test/KonSoft.Report.EntityFrameworkCore.Tests/EntityFrameworkCore/ReportEntityFrameworkCoreTestBase.cs new file mode 100644 index 0000000..13022d1 --- /dev/null +++ b/modules/report/test/KonSoft.Report.EntityFrameworkCore.Tests/EntityFrameworkCore/ReportEntityFrameworkCoreTestBase.cs @@ -0,0 +1,8 @@ +using Volo.Abp; + +namespace KonSoft.Report.EntityFrameworkCore; + +public abstract class ReportEntityFrameworkCoreTestBase : ReportTestBase +{ + +} diff --git a/modules/report/test/KonSoft.Report.EntityFrameworkCore.Tests/EntityFrameworkCore/ReportEntityFrameworkCoreTestModule.cs b/modules/report/test/KonSoft.Report.EntityFrameworkCore.Tests/EntityFrameworkCore/ReportEntityFrameworkCoreTestModule.cs new file mode 100644 index 0000000..ef01433 --- /dev/null +++ b/modules/report/test/KonSoft.Report.EntityFrameworkCore.Tests/EntityFrameworkCore/ReportEntityFrameworkCoreTestModule.cs @@ -0,0 +1,82 @@ +using Microsoft.Data.Sqlite; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.Sqlite; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Modularity; +using Volo.Abp.PermissionManagement; +using Volo.Abp.SettingManagement; +using Volo.Abp.Uow; + +namespace KonSoft.Report.EntityFrameworkCore; + +[DependsOn( + typeof(ReportApplicationTestModule), + typeof(ReportEntityFrameworkCoreModule), + typeof(AbpEntityFrameworkCoreSqliteModule) + )] +public class ReportEntityFrameworkCoreTestModule : AbpModule +{ + private SqliteConnection? _sqliteConnection; + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.SaveStaticFeaturesToDatabase = false; + options.IsDynamicFeatureStoreEnabled = false; + }); + Configure(options => + { + options.SaveStaticPermissionsToDatabase = false; + options.IsDynamicPermissionStoreEnabled = false; + }); + Configure(options => + { + options.SaveStaticSettingsToDatabase = false; + options.IsDynamicSettingStoreEnabled = false; + }); + context.Services.AddAlwaysDisableUnitOfWorkTransaction(); + + ConfigureInMemorySqlite(context.Services); + } + + private void ConfigureInMemorySqlite(IServiceCollection services) + { + _sqliteConnection = CreateDatabaseAndGetConnection(); + + services.Configure(options => + { + options.Configure(context => + { + context.DbContextOptions.UseSqlite(_sqliteConnection); + }); + }); + } + + public override void OnApplicationShutdown(ApplicationShutdownContext context) + { + _sqliteConnection?.Dispose(); + } + + private static SqliteConnection CreateDatabaseAndGetConnection() + { + var connection = new AbpUnitTestSqliteConnection("Data Source=:memory:"); + connection.Open(); + + var options = new DbContextOptionsBuilder() + .UseSqlite(connection) + .Options; + + using (var context = new ReportDbContext(options)) + { + context.GetService().CreateTables(); + } + + return connection; + } +} diff --git a/modules/report/test/KonSoft.Report.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepositoryTests.cs b/modules/report/test/KonSoft.Report.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepositoryTests.cs new file mode 100644 index 0000000..c1dd450 --- /dev/null +++ b/modules/report/test/KonSoft.Report.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepositoryTests.cs @@ -0,0 +1,44 @@ +using Microsoft.EntityFrameworkCore; +using Shouldly; +using System; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp.Domain.Repositories; +using Volo.Abp.Identity; +using Xunit; + +namespace KonSoft.Report.EntityFrameworkCore.Samples; + +/* This is just an example test class. + * Normally, you don't test ABP framework code + * (like default AppUser repository IRepository here). + * Only test your custom repository methods. + */ +[Collection(ReportTestConsts.CollectionDefinitionName)] +public class SampleRepositoryTests : ReportEntityFrameworkCoreTestBase +{ + private readonly IRepository _appUserRepository; + + public SampleRepositoryTests() + { + _appUserRepository = GetRequiredService>(); + } + + [Fact] + public async Task Should_Query_AppUser() + { + /* Need to manually start Unit Of Work because + * FirstOrDefaultAsync should be executed while db connection / context is available. + */ + await WithUnitOfWorkAsync(async () => + { + //Act + var adminUser = await (await _appUserRepository.GetQueryableAsync()) + .Where(u => u.UserName == "admin") + .FirstOrDefaultAsync(); + + //Assert + adminUser.ShouldNotBeNull(); + }); + } +} diff --git a/modules/report/test/KonSoft.Report.EntityFrameworkCore.Tests/KonSoft.Report.EntityFrameworkCore.Tests.csproj b/modules/report/test/KonSoft.Report.EntityFrameworkCore.Tests/KonSoft.Report.EntityFrameworkCore.Tests.csproj new file mode 100644 index 0000000..fbb99dc --- /dev/null +++ b/modules/report/test/KonSoft.Report.EntityFrameworkCore.Tests/KonSoft.Report.EntityFrameworkCore.Tests.csproj @@ -0,0 +1,21 @@ + + + + + + net8.0 + enable + KonSoft.Report + + + + + + + + + + + + + diff --git a/modules/report/test/KonSoft.Report.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs b/modules/report/test/KonSoft.Report.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs new file mode 100644 index 0000000..8b4d7a3 --- /dev/null +++ b/modules/report/test/KonSoft.Report.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs @@ -0,0 +1,25 @@ +using System; +using System.Threading.Tasks; +using Volo.Abp.Account; +using Volo.Abp.DependencyInjection; + +namespace KonSoft.Report.HttpApi.Client.ConsoleTestApp; + +public class ClientDemoService : ITransientDependency +{ + private readonly IProfileAppService _profileAppService; + + public ClientDemoService(IProfileAppService profileAppService) + { + _profileAppService = profileAppService; + } + + public async Task RunAsync() + { + var output = await _profileAppService.GetAsync(); + Console.WriteLine($"UserName : {output.UserName}"); + Console.WriteLine($"Email : {output.Email}"); + Console.WriteLine($"Name : {output.Name}"); + Console.WriteLine($"Surname : {output.Surname}"); + } +} diff --git a/modules/report/test/KonSoft.Report.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs b/modules/report/test/KonSoft.Report.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs new file mode 100644 index 0000000..125fa85 --- /dev/null +++ b/modules/report/test/KonSoft.Report.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs @@ -0,0 +1,40 @@ +using Microsoft.Extensions.Hosting; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; + +namespace KonSoft.Report.HttpApi.Client.ConsoleTestApp; + +public class ConsoleTestAppHostedService : IHostedService +{ + private readonly IConfiguration _configuration; + + public ConsoleTestAppHostedService(IConfiguration configuration) + { + _configuration = configuration; + } + + public async Task StartAsync(CancellationToken cancellationToken) + { + using (var application = await AbpApplicationFactory.CreateAsync(options => + { + options.Services.ReplaceConfiguration(_configuration); + options.UseAutofac(); + })) + { + await application.InitializeAsync(); + + var demo = application.ServiceProvider.GetRequiredService(); + await demo.RunAsync(); + + await application.ShutdownAsync(); + } + } + + public Task StopAsync(CancellationToken cancellationToken) + { + return Task.CompletedTask; + } +} diff --git a/modules/report/test/KonSoft.Report.HttpApi.Client.ConsoleTestApp/KonSoft.Report.HttpApi.Client.ConsoleTestApp.csproj b/modules/report/test/KonSoft.Report.HttpApi.Client.ConsoleTestApp/KonSoft.Report.HttpApi.Client.ConsoleTestApp.csproj new file mode 100644 index 0000000..357a6d6 --- /dev/null +++ b/modules/report/test/KonSoft.Report.HttpApi.Client.ConsoleTestApp/KonSoft.Report.HttpApi.Client.ConsoleTestApp.csproj @@ -0,0 +1,33 @@ + + + + Exe + net8.0 + enable + + + + + + PreserveNewest + Always + + + + PreserveNewest + Always + + + + + + + + + + + + + + + diff --git a/modules/report/test/KonSoft.Report.HttpApi.Client.ConsoleTestApp/Program.cs b/modules/report/test/KonSoft.Report.HttpApi.Client.ConsoleTestApp/Program.cs new file mode 100644 index 0000000..288c22a --- /dev/null +++ b/modules/report/test/KonSoft.Report.HttpApi.Client.ConsoleTestApp/Program.cs @@ -0,0 +1,22 @@ +using System.Threading.Tasks; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +namespace KonSoft.Report.HttpApi.Client.ConsoleTestApp; + +class Program +{ + static async Task Main(string[] args) + { + await CreateHostBuilder(args).RunConsoleAsync(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .AddAppSettingsSecretsJson() + .ConfigureServices((hostContext, services) => + { + services.AddHostedService(); + }); +} diff --git a/modules/report/test/KonSoft.Report.HttpApi.Client.ConsoleTestApp/ReportConsoleApiClientModule.cs b/modules/report/test/KonSoft.Report.HttpApi.Client.ConsoleTestApp/ReportConsoleApiClientModule.cs new file mode 100644 index 0000000..08ba7f7 --- /dev/null +++ b/modules/report/test/KonSoft.Report.HttpApi.Client.ConsoleTestApp/ReportConsoleApiClientModule.cs @@ -0,0 +1,30 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Polly; +using Volo.Abp.Autofac; +using Volo.Abp.Http.Client; +using Volo.Abp.Http.Client.IdentityModel; +using Volo.Abp.Modularity; + +namespace KonSoft.Report.HttpApi.Client.ConsoleTestApp; + +[DependsOn( + typeof(AbpAutofacModule), + typeof(ReportHttpApiClientModule), + typeof(AbpHttpClientIdentityModelModule) + )] +public class ReportConsoleApiClientModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PreConfigure(options => + { + options.ProxyClientBuildActions.Add((remoteServiceName, clientBuilder) => + { + clientBuilder.AddTransientHttpErrorPolicy( + policyBuilder => policyBuilder.WaitAndRetryAsync(3, i => TimeSpan.FromSeconds(Math.Pow(2, i))) + ); + }); + }); + } +} diff --git a/modules/report/test/KonSoft.Report.HttpApi.Client.ConsoleTestApp/appsettings.json b/modules/report/test/KonSoft.Report.HttpApi.Client.ConsoleTestApp/appsettings.json new file mode 100644 index 0000000..a47a418 --- /dev/null +++ b/modules/report/test/KonSoft.Report.HttpApi.Client.ConsoleTestApp/appsettings.json @@ -0,0 +1,17 @@ +{ + "RemoteServices": { + "Default": { + "BaseUrl": "https://localhost:44340" + } + }, + "IdentityClients": { + "Default": { + "GrantType": "password", + "ClientId": "Report_App", + "UserName": "admin", + "UserPassword": "1q2w3E*", + "Authority": "https://localhost:44340", + "Scope": "Report" + } + } +} diff --git a/modules/report/test/KonSoft.Report.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json b/modules/report/test/KonSoft.Report.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json new file mode 100644 index 0000000..7a73a41 --- /dev/null +++ b/modules/report/test/KonSoft.Report.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/modules/report/test/KonSoft.Report.TestBase/KonSoft.Report.TestBase.csproj b/modules/report/test/KonSoft.Report.TestBase/KonSoft.Report.TestBase.csproj new file mode 100644 index 0000000..e162884 --- /dev/null +++ b/modules/report/test/KonSoft.Report.TestBase/KonSoft.Report.TestBase.csproj @@ -0,0 +1,31 @@ + + + + + + net8.0 + enable + KonSoft.Report + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers + + + + + + + + diff --git a/modules/report/test/KonSoft.Report.TestBase/ReportTestBase.cs b/modules/report/test/KonSoft.Report.TestBase/ReportTestBase.cs new file mode 100644 index 0000000..70f614d --- /dev/null +++ b/modules/report/test/KonSoft.Report.TestBase/ReportTestBase.cs @@ -0,0 +1,60 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.Modularity; +using Volo.Abp.Uow; +using Volo.Abp.Testing; + +namespace KonSoft.Report; + +/* All test classes are derived from this class, directly or indirectly. + */ +public abstract class ReportTestBase : AbpIntegratedTest + where TStartupModule : IAbpModule +{ + protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options) + { + options.UseAutofac(); + } + + protected virtual Task WithUnitOfWorkAsync(Func func) + { + return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); + } + + protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func action) + { + using (var scope = ServiceProvider.CreateScope()) + { + var uowManager = scope.ServiceProvider.GetRequiredService(); + + using (var uow = uowManager.Begin(options)) + { + await action(); + + await uow.CompleteAsync(); + } + } + } + + protected virtual Task WithUnitOfWorkAsync(Func> func) + { + return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); + } + + protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func> func) + { + using (var scope = ServiceProvider.CreateScope()) + { + var uowManager = scope.ServiceProvider.GetRequiredService(); + + using (var uow = uowManager.Begin(options)) + { + var result = await func(); + await uow.CompleteAsync(); + return result; + } + } + } +} diff --git a/modules/report/test/KonSoft.Report.TestBase/ReportTestBaseModule.cs b/modules/report/test/KonSoft.Report.TestBase/ReportTestBaseModule.cs new file mode 100644 index 0000000..a3c53db --- /dev/null +++ b/modules/report/test/KonSoft.Report.TestBase/ReportTestBaseModule.cs @@ -0,0 +1,47 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.Authorization; +using Volo.Abp.Autofac; +using Volo.Abp.BackgroundJobs; +using Volo.Abp.Data; +using Volo.Abp.Modularity; +using Volo.Abp.Threading; + +namespace KonSoft.Report; + +[DependsOn( + typeof(AbpAutofacModule), + typeof(AbpTestBaseModule), + typeof(AbpAuthorizationModule), + typeof(AbpBackgroundJobsAbstractionsModule) + )] +public class ReportTestBaseModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.IsJobExecutionEnabled = false; + }); + + context.Services.AddAlwaysAllowAuthorization(); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + SeedTestData(context); + } + + private static void SeedTestData(ApplicationInitializationContext context) + { + AsyncHelper.RunSync(async () => + { + using (var scope = context.ServiceProvider.CreateScope()) + { + await scope.ServiceProvider + .GetRequiredService() + .SeedAsync(); + } + }); + } +} diff --git a/modules/report/test/KonSoft.Report.TestBase/ReportTestConsts.cs b/modules/report/test/KonSoft.Report.TestBase/ReportTestConsts.cs new file mode 100644 index 0000000..552b154 --- /dev/null +++ b/modules/report/test/KonSoft.Report.TestBase/ReportTestConsts.cs @@ -0,0 +1,6 @@ +namespace KonSoft.Report; + +public static class ReportTestConsts +{ + public const string CollectionDefinitionName = "Report collection"; +} diff --git a/modules/report/test/KonSoft.Report.TestBase/ReportTestDataSeedContributor.cs b/modules/report/test/KonSoft.Report.TestBase/ReportTestDataSeedContributor.cs new file mode 100644 index 0000000..2931d7e --- /dev/null +++ b/modules/report/test/KonSoft.Report.TestBase/ReportTestDataSeedContributor.cs @@ -0,0 +1,15 @@ +using System.Threading.Tasks; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; + +namespace KonSoft.Report; + +public class ReportTestDataSeedContributor : IDataSeedContributor, ITransientDependency +{ + public Task SeedAsync(DataSeedContext context) + { + /* Seed additional test data... */ + + return Task.CompletedTask; + } +} diff --git a/modules/report/test/KonSoft.Report.TestBase/Security/FakeCurrentPrincipalAccessor.cs b/modules/report/test/KonSoft.Report.TestBase/Security/FakeCurrentPrincipalAccessor.cs new file mode 100644 index 0000000..184f07f --- /dev/null +++ b/modules/report/test/KonSoft.Report.TestBase/Security/FakeCurrentPrincipalAccessor.cs @@ -0,0 +1,25 @@ +using System.Collections.Generic; +using System.Security.Claims; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Security.Claims; + +namespace KonSoft.Report.Security; + +[Dependency(ReplaceServices = true)] +public class FakeCurrentPrincipalAccessor : ThreadCurrentPrincipalAccessor +{ + protected override ClaimsPrincipal GetClaimsPrincipal() + { + return GetPrincipal(); + } + + private ClaimsPrincipal GetPrincipal() + { + return new ClaimsPrincipal(new ClaimsIdentity(new List + { + new Claim(AbpClaimTypes.UserId, "2e701e62-0953-4dd3-910b-dc6cc93ccb0d"), + new Claim(AbpClaimTypes.UserName, "admin"), + new Claim(AbpClaimTypes.Email, "admin@abp.io") + })); + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Application.Contracts/KonSoft.TenantManagement.Application.Contracts.csproj b/modules/tenant-management/src/KonSoft.TenantManagement.Application.Contracts/KonSoft.TenantManagement.Application.Contracts.csproj new file mode 100644 index 0000000..254eea6 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Application.Contracts/KonSoft.TenantManagement.Application.Contracts.csproj @@ -0,0 +1,25 @@ + + + + + + net8.0 + enable + KonSoft.TenantManagement + + + + + + + + + + + + + + + + + diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Application.Contracts/Permissions/TenantManagementPermissionDefinitionProvider.cs b/modules/tenant-management/src/KonSoft.TenantManagement.Application.Contracts/Permissions/TenantManagementPermissionDefinitionProvider.cs new file mode 100644 index 0000000..1bf7394 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Application.Contracts/Permissions/TenantManagementPermissionDefinitionProvider.cs @@ -0,0 +1,20 @@ +using KonSoft.TenantManagement.Localization; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.Localization; + +namespace KonSoft.TenantManagement.Permissions; + +public class TenantManagementPermissionDefinitionProvider : PermissionDefinitionProvider +{ + public override void Define(IPermissionDefinitionContext context) + { + var myGroup = context.AddGroup(TenantManagementPermissions.GroupName); + //Define your own permissions here. Example: + //myGroup.AddPermission(TenantManagementPermissions.MyPermission1, L("Permission:MyPermission1")); + } + + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Application.Contracts/Permissions/TenantManagementPermissions.cs b/modules/tenant-management/src/KonSoft.TenantManagement.Application.Contracts/Permissions/TenantManagementPermissions.cs new file mode 100644 index 0000000..b18cbdd --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Application.Contracts/Permissions/TenantManagementPermissions.cs @@ -0,0 +1,9 @@ +namespace KonSoft.TenantManagement.Permissions; + +public static class TenantManagementPermissions +{ + public const string GroupName = "TenantManagement"; + + //Add your own permission names. Example: + //public const string MyPermission1 = GroupName + ".MyPermission1"; +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Application.Contracts/TenantManagementApplicationContractsModule.cs b/modules/tenant-management/src/KonSoft.TenantManagement.Application.Contracts/TenantManagementApplicationContractsModule.cs new file mode 100644 index 0000000..cb1dc8c --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Application.Contracts/TenantManagementApplicationContractsModule.cs @@ -0,0 +1,28 @@ +using Volo.Abp.Account; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; +using Volo.Abp.ObjectExtending; +using Volo.Abp.PermissionManagement; +using Volo.Abp.SettingManagement; +using Volo.Abp.TenantManagement; + +namespace KonSoft.TenantManagement; + +[DependsOn( + typeof(TenantManagementDomainSharedModule), + typeof(AbpAccountApplicationContractsModule), + typeof(AbpFeatureManagementApplicationContractsModule), + typeof(AbpIdentityApplicationContractsModule), + typeof(AbpPermissionManagementApplicationContractsModule), + typeof(AbpSettingManagementApplicationContractsModule), + typeof(AbpTenantManagementApplicationContractsModule), + typeof(AbpObjectExtendingModule) +)] +public class TenantManagementApplicationContractsModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + TenantManagementDtoExtensions.Configure(); + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Application.Contracts/TenantManagementDtoExtensions.cs b/modules/tenant-management/src/KonSoft.TenantManagement.Application.Contracts/TenantManagementDtoExtensions.cs new file mode 100644 index 0000000..8f59d3e --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Application.Contracts/TenantManagementDtoExtensions.cs @@ -0,0 +1,28 @@ +using Volo.Abp.Identity; +using Volo.Abp.ObjectExtending; +using Volo.Abp.Threading; + +namespace KonSoft.TenantManagement; + +public static class TenantManagementDtoExtensions +{ + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + + public static void Configure() + { + OneTimeRunner.Run(() => + { + /* You can add extension properties to DTOs + * defined in the depended modules. + * + * Example: + * + * ObjectExtensionManager.Instance + * .AddOrUpdateProperty("Title"); + * + * See the documentation for more: + * https://docs.abp.io/en/abp/latest/Object-Extensions + */ + }); + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Application/KonSoft.TenantManagement.Application.csproj b/modules/tenant-management/src/KonSoft.TenantManagement.Application/KonSoft.TenantManagement.Application.csproj new file mode 100644 index 0000000..6c2e177 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Application/KonSoft.TenantManagement.Application.csproj @@ -0,0 +1,25 @@ + + + + + + net8.0 + enable + KonSoft.TenantManagement + + + + + + + + + + + + + + + + + diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Application/Properties/AssemblyInfo.cs b/modules/tenant-management/src/KonSoft.TenantManagement.Application/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..532c436 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Application/Properties/AssemblyInfo.cs @@ -0,0 +1,2 @@ +using System.Runtime.CompilerServices; +[assembly:InternalsVisibleToAttribute("KonSoft.TenantManagement.Application.Tests")] diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Application/TenantManagementAppService.cs b/modules/tenant-management/src/KonSoft.TenantManagement.Application/TenantManagementAppService.cs new file mode 100644 index 0000000..73aab41 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Application/TenantManagementAppService.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Text; +using KonSoft.TenantManagement.Localization; +using Volo.Abp.Application.Services; + +namespace KonSoft.TenantManagement; + +/* Inherit your application services from this class. + */ +public abstract class TenantManagementAppService : ApplicationService +{ + protected TenantManagementAppService() + { + LocalizationResource = typeof(TenantManagementResource); + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Application/TenantManagementApplicationAutoMapperProfile.cs b/modules/tenant-management/src/KonSoft.TenantManagement.Application/TenantManagementApplicationAutoMapperProfile.cs new file mode 100644 index 0000000..cd54bf0 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Application/TenantManagementApplicationAutoMapperProfile.cs @@ -0,0 +1,13 @@ +using AutoMapper; + +namespace KonSoft.TenantManagement; + +public class TenantManagementApplicationAutoMapperProfile : Profile +{ + public TenantManagementApplicationAutoMapperProfile() + { + /* You can configure your AutoMapper mapping configuration here. + * Alternatively, you can split your mapping configurations + * into multiple profile classes for a better organization. */ + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Application/TenantManagementApplicationModule.cs b/modules/tenant-management/src/KonSoft.TenantManagement.Application/TenantManagementApplicationModule.cs new file mode 100644 index 0000000..abcec47 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Application/TenantManagementApplicationModule.cs @@ -0,0 +1,31 @@ +using Volo.Abp.Account; +using Volo.Abp.AutoMapper; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; +using Volo.Abp.PermissionManagement; +using Volo.Abp.SettingManagement; +using Volo.Abp.TenantManagement; + +namespace KonSoft.TenantManagement; + +[DependsOn( + typeof(TenantManagementDomainModule), + typeof(AbpAccountApplicationModule), + typeof(TenantManagementApplicationContractsModule), + typeof(AbpIdentityApplicationModule), + typeof(AbpPermissionManagementApplicationModule), + typeof(AbpTenantManagementApplicationModule), + typeof(AbpFeatureManagementApplicationModule), + typeof(AbpSettingManagementApplicationModule) + )] +public class TenantManagementApplicationModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.AddMaps(); + }); + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/KonSoft.TenantManagement.Domain.Shared.csproj b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/KonSoft.TenantManagement.Domain.Shared.csproj new file mode 100644 index 0000000..bdf9f4d --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/KonSoft.TenantManagement.Domain.Shared.csproj @@ -0,0 +1,32 @@ + + + + + + net8.0 + enable + KonSoft.TenantManagement + true + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/ar.json b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/ar.json new file mode 100644 index 0000000..1549fba --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/ar.json @@ -0,0 +1,9 @@ +{ + "culture": "ar", + "texts": { + "AppName": "TenantManagement", + "Menu:Home": "الصفحة الرئيسية", + "Welcome": "مرحباً", + "LongWelcomeMessage": "مرحبا بكم في التطبيق. هذا مشروع بدء تشغيل يعتمد على إطار عمل ABP. لمزيد من المعلومات ، يرجى زيارة abp.io." + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/cs.json b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/cs.json new file mode 100644 index 0000000..fb1838f --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/cs.json @@ -0,0 +1,9 @@ +{ + "culture": "cs", + "texts": { + "AppName": "TenantManagement", + "Menu:Home": "Úvod", + "Welcome": "Vítejte", + "LongWelcomeMessage": "Vítejte v aplikaci. Toto je startovací projekt založený na ABP frameworku. Pro více informací, navštivte abp.io." + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/de.json b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/de.json new file mode 100644 index 0000000..10aa9f0 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/de.json @@ -0,0 +1,9 @@ +{ + "culture": "de", + "texts": { + "AppName": "TenantManagement", + "Menu:Home": "Home", + "Welcome": "Willkommen", + "LongWelcomeMessage": "Willkommen bei der Anwendung. Dies ist ein Startup-Projekt, das auf dem ABP-Framework basiert. Weitere Informationen finden Sie unter abp.io." + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/en-GB.json b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/en-GB.json new file mode 100644 index 0000000..2d474a0 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/en-GB.json @@ -0,0 +1,9 @@ +{ + "culture": "en-GB", + "texts": { + "AppName": "TenantManagement", + "Menu:Home": "Home", + "Welcome": "Welcome", + "LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io." + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/en.json b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/en.json new file mode 100644 index 0000000..e5372ca --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/en.json @@ -0,0 +1,9 @@ +{ + "culture": "en", + "texts": { + "AppName": "TenantManagement", + "Menu:Home": "Home", + "Welcome": "Welcome", + "LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io." + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/es.json b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/es.json new file mode 100644 index 0000000..ca7d341 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/es.json @@ -0,0 +1,9 @@ +{ + "culture": "es", + "texts": { + "AppName": "TenantManagement", + "Menu:Home": "Inicio", + "Welcome": "Bienvenido", + "LongWelcomeMessage": "Bienvenido a la aplicación, este es un proyecto base basado en el framework ABP. Para más información, visita abp.io." + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/fi.json b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/fi.json new file mode 100644 index 0000000..c70a458 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/fi.json @@ -0,0 +1,9 @@ +{ + "culture": "fi", + "texts": { + "AppName": "TenantManagement", + "Menu:Home": "Koti", + "Welcome": "Tervetuloa", + "LongWelcomeMessage": "Tervetuloa sovellukseen. Tämä on ABP-kehykseen perustuva käynnistysprojekti. Lisätietoja on osoitteessa abp.io." + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/fr.json b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/fr.json new file mode 100644 index 0000000..04f34e0 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/fr.json @@ -0,0 +1,9 @@ +{ + "culture": "fr", + "texts": { + "AppName": "TenantManagement", + "Menu:Home": "Accueil", + "Welcome": "Bienvenue", + "LongWelcomeMessage": "Bienvenue dans l'application. Il s'agit d'un projet de démarrage basé sur le framework ABP. Pour plus d'informations, visitez abp.io." + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/hi.json b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/hi.json new file mode 100644 index 0000000..25b0b0f --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/hi.json @@ -0,0 +1,9 @@ +{ + "culture": "hi", + "texts": { + "AppName": "TenantManagement", + "Menu:Home": "घर", + "Welcome": "स्वागत हे", + "LongWelcomeMessage": "आवेदन करने के लिए आपका स्वागत है। यह एबीपी ढांचे पर आधारित एक स्टार्टअप परियोजना है। अधिक जानकारी के लिए, abp.io पर जाएं।" + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/hr.json b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/hr.json new file mode 100644 index 0000000..ff8836c --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/hr.json @@ -0,0 +1,9 @@ +{ + "culture": "hr", + "texts": { + "AppName": "TenantManagement", + "Menu:Home": "Početna", + "Welcome": "Dobrodošli", + "LongWelcomeMessage": "Dobrodošli u aplikaciju. Ovo je startup projekt temeljen na ABP framework-u. Za više informacija posjetite abp.io." + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/hu.json b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/hu.json new file mode 100644 index 0000000..de7c728 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/hu.json @@ -0,0 +1,9 @@ +{ + "culture": "hu", + "texts": { + "AppName": "TenantManagement", + "Menu:Home": "Kezdőlap", + "Welcome": "Üdvözlöm", + "LongWelcomeMessage": "Üdvözöljük az alkalmazásban. Ez egy ABP keretrendszeren alapuló startup projekt. További információkért látogasson el az abp.io oldalra." + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/is.json b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/is.json new file mode 100644 index 0000000..a08c37d --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/is.json @@ -0,0 +1,9 @@ +{ + "culture": "is", + "texts": { + "AppName": "TenantManagement", + "Menu:Home": "Heim", + "Welcome": "Velkomin", + "LongWelcomeMessage": "Verið velkomin í forritið. Þetta er startup verkefni sem byggir á ABP. Nánari upplýsingar er að finna á abp.io." + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/it.json b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/it.json new file mode 100644 index 0000000..58682d2 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/it.json @@ -0,0 +1,9 @@ +{ + "culture": "it", + "texts": { + "AppName": "TenantManagement", + "Menu:Home": "Home", + "Welcome": "Benvenuto", + "LongWelcomeMessage": "Benvenuto nell'applicazione. Questo è un progetto di avvio basato sul framework ABP. Per ulteriori informazioni, visita abp.io." + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/nl.json b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/nl.json new file mode 100644 index 0000000..0298ab9 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/nl.json @@ -0,0 +1,9 @@ +{ + "culture": "nl", + "texts": { + "AppName": "TenantManagement", + "Menu:Home": "Home", + "Welcome": "Welkom", + "LongWelcomeMessage": "Welkom bij de applicatie. Dit is een startup-project gebaseerd op het ABP-framework. Bezoek abp.io voor meer informatie." + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/pl-PL.json b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/pl-PL.json new file mode 100644 index 0000000..f57b395 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/pl-PL.json @@ -0,0 +1,9 @@ +{ + "culture": "pl-PL", + "texts": { + "AppName": "TenantManagement", + "Menu:Home": "Home", + "Welcome": "Witaj", + "LongWelcomeMessage": "Witaj w aplikacji. To jest inicjalny projekt bazujący na ABP framework. Po więcej informacji odwiedź stronę abp.io." + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/pt-BR.json b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/pt-BR.json new file mode 100644 index 0000000..392fd64 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/pt-BR.json @@ -0,0 +1,9 @@ +{ + "culture": "pt-BR", + "texts": { + "AppName": "TenantManagement", + "Menu:Home": "Principal", + "Welcome": "Seja bem-vindo!", + "LongWelcomeMessage": "Bem-vindo a esta aplicação. Este é um projeto inicial baseado no ABP framework. Para mais informações, visite abp.io." + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/ro-RO.json b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/ro-RO.json new file mode 100644 index 0000000..ce67c79 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/ro-RO.json @@ -0,0 +1,9 @@ +{ + "culture": "ro-RO", + "texts": { + "AppName": "TenantManagement", + "Menu:Home": "Acasă", + "Welcome": "Bun venit", + "LongWelcomeMessage": "Bun venit la aplicaţie. Acesta este un proiect de pornire bazat pe framework-ul ABP. Pentru mai multe informaţii, vizitaţi, visit abp.io." + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/ru.json b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/ru.json new file mode 100644 index 0000000..e1442c6 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/ru.json @@ -0,0 +1,9 @@ +{ + "culture": "ru", + "texts": { + "AppName": "TenantManagement", + "Menu:Home": "Главная", + "Welcome": "Добро пожаловать", + "LongWelcomeMessage": "Добро пожаловать в приложение. Этот запущенный проект основан на фреймворке ABP. Для получения дополнительной информации посетите сайт abp.io." + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/sk.json b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/sk.json new file mode 100644 index 0000000..d866a32 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/sk.json @@ -0,0 +1,9 @@ +{ + "culture": "sk", + "texts": { + "AppName": "TenantManagement", + "Menu:Home": "Domov", + "Welcome": "Vitajte", + "LongWelcomeMessage": "Vitajte v aplikácii. Toto je štartovací projekt založený na ABP frameworku. Viac informácií nájdete na stránke abp.io." + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/sl.json b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/sl.json new file mode 100644 index 0000000..dec2120 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/sl.json @@ -0,0 +1,9 @@ +{ + "culture": "sl", + "texts": { + "AppName": "TenantManagement", + "Menu:Home": "Domov", + "Welcome": "Dobrodošli", + "LongWelcomeMessage": "Dobrodošli v aplikaciji. To je začetni projekt na osnovi okolja ABP. Za več informacij obiščite abp.io." + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/sv.json b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/sv.json new file mode 100644 index 0000000..bd1eae4 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/sv.json @@ -0,0 +1,9 @@ +{ + "culture": "sv", + "texts": { + "AppName": "MittProjektNamn", + "Menu:Home": "Hem", + "Welcome": "Välkommen", + "LongWelcomeMessage": "Välkommen till applikationen. Detta är ett startup-projekt baserat på ABP-ramverket. För mer information, besök abp.io." + } +} \ No newline at end of file diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/tr.json b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/tr.json new file mode 100644 index 0000000..d134626 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/tr.json @@ -0,0 +1,9 @@ +{ + "culture": "tr", + "texts": { + "AppName": "TenantManagement", + "Menu:Home": "Ana sayfa", + "Welcome": "Hoşgeldiniz", + "LongWelcomeMessage": "Uygulamaya hoşgeldiniz. Bu, ABP framework'ü üzerine bina edilmiş bir başlangıç projesidir. Daha fazla bilgi için abp.io adresini ziyaret edebilirsiniz." + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/vi.json b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/vi.json new file mode 100644 index 0000000..cea053f --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/vi.json @@ -0,0 +1,9 @@ +{ + "culture": "vi", + "texts": { + "AppName": "TenantManagement", + "Menu:Home": "Trang chủ", + "Welcome": "Chào mừng bạn", + "LongWelcomeMessage": "Chào mừng bạn đến ứng dụng. Đây là một dự án khởi nghiệp dựa trên khung ABP. Để biết thêm thông tin, hãy truy cập abp.io." + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/zh-Hans.json b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/zh-Hans.json new file mode 100644 index 0000000..70f3be7 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/zh-Hans.json @@ -0,0 +1,9 @@ +{ + "culture": "zh-Hans", + "texts": { + "AppName": "TenantManagement", + "Menu:Home": "首页", + "Welcome": "欢迎", + "LongWelcomeMessage": "欢迎使用本应用程序。这是一个基于 ABP 框架的启动项目。更多信息,请访问 abp.io。" + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/zh-Hant.json b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/zh-Hant.json new file mode 100644 index 0000000..01a16d1 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagement/zh-Hant.json @@ -0,0 +1,9 @@ +{ + "culture": "zh-Hant", + "texts": { + "AppName": "TenantManagement", + "Menu:Home": "首頁", + "Welcome": "歡迎", + "LongWelcomeMessage": "歡迎來到此應用程式. 這是一個基於ABP框架的起始專案. 有關更多訊息, 請瀏覽 abp.io." + } + } diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagementResource.cs b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagementResource.cs new file mode 100644 index 0000000..63c87f1 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/Localization/TenantManagementResource.cs @@ -0,0 +1,9 @@ +using Volo.Abp.Localization; + +namespace KonSoft.TenantManagement.Localization; + +[LocalizationResourceName("TenantManagement")] +public class TenantManagementResource +{ + +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/MultiTenancy/MultiTenancyConsts.cs b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/MultiTenancy/MultiTenancyConsts.cs new file mode 100644 index 0000000..16fc670 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/MultiTenancy/MultiTenancyConsts.cs @@ -0,0 +1,10 @@ +namespace KonSoft.TenantManagement.MultiTenancy; + +public static class MultiTenancyConsts +{ + /* Enable/disable multi-tenancy easily in a single point. + * If you will never need to multi-tenancy, you can remove + * related modules and code parts, including this file. + */ + public const bool IsEnabled = true; +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/TenantManagementDomainErrorCodes.cs b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/TenantManagementDomainErrorCodes.cs new file mode 100644 index 0000000..5c8ea27 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/TenantManagementDomainErrorCodes.cs @@ -0,0 +1,6 @@ +namespace KonSoft.TenantManagement; + +public static class TenantManagementDomainErrorCodes +{ + /* You can add your business exception error codes here, as constants */ +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/TenantManagementDomainSharedModule.cs b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/TenantManagementDomainSharedModule.cs new file mode 100644 index 0000000..70a3f90 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/TenantManagementDomainSharedModule.cs @@ -0,0 +1,58 @@ +using KonSoft.TenantManagement.Localization; +using Volo.Abp.AuditLogging; +using Volo.Abp.BackgroundJobs; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Localization; +using Volo.Abp.Localization.ExceptionHandling; +using Volo.Abp.Modularity; +using Volo.Abp.OpenIddict; +using Volo.Abp.PermissionManagement; +using Volo.Abp.SettingManagement; +using Volo.Abp.TenantManagement; +using Volo.Abp.Validation.Localization; +using Volo.Abp.VirtualFileSystem; + +namespace KonSoft.TenantManagement; + +[DependsOn( + typeof(AbpAuditLoggingDomainSharedModule), + typeof(AbpBackgroundJobsDomainSharedModule), + typeof(AbpFeatureManagementDomainSharedModule), + typeof(AbpIdentityDomainSharedModule), + typeof(AbpOpenIddictDomainSharedModule), + typeof(AbpPermissionManagementDomainSharedModule), + typeof(AbpSettingManagementDomainSharedModule), + typeof(AbpTenantManagementDomainSharedModule) + )] +public class TenantManagementDomainSharedModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + TenantManagementGlobalFeatureConfigurator.Configure(); + TenantManagementModuleExtensionConfigurator.Configure(); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + Configure(options => + { + options.Resources + .Add("en") + .AddBaseTypes(typeof(AbpValidationResource)) + .AddVirtualJson("/Localization/TenantManagement"); + + options.DefaultResourceType = typeof(TenantManagementResource); + }); + + Configure(options => + { + options.MapCodeNamespace("TenantManagement", typeof(TenantManagementResource)); + }); + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/TenantManagementGlobalFeatureConfigurator.cs b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/TenantManagementGlobalFeatureConfigurator.cs new file mode 100644 index 0000000..a26c94b --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/TenantManagementGlobalFeatureConfigurator.cs @@ -0,0 +1,22 @@ +using Volo.Abp.Threading; + +namespace KonSoft.TenantManagement; + +public static class TenantManagementGlobalFeatureConfigurator +{ + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + + public static void Configure() + { + OneTimeRunner.Run(() => + { + /* You can configure (enable/disable) global features of the used modules here. + * + * YOU CAN SAFELY DELETE THIS CLASS AND REMOVE ITS USAGES IF YOU DON'T NEED TO IT! + * + * Please refer to the documentation to lear more about the Global Features System: + * https://docs.abp.io/en/abp/latest/Global-Features + */ + }); + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/TenantManagementModuleExtensionConfigurator.cs b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/TenantManagementModuleExtensionConfigurator.cs new file mode 100644 index 0000000..c42519f --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain.Shared/TenantManagementModuleExtensionConfigurator.cs @@ -0,0 +1,73 @@ +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Identity; +using Volo.Abp.ObjectExtending; +using Volo.Abp.Threading; + +namespace KonSoft.TenantManagement; + +public static class TenantManagementModuleExtensionConfigurator +{ + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + + public static void Configure() + { + OneTimeRunner.Run(() => + { + ConfigureExistingProperties(); + ConfigureExtraProperties(); + }); + } + + private static void ConfigureExistingProperties() + { + /* You can change max lengths for properties of the + * entities defined in the modules used by your application. + * + * Example: Change user and role name max lengths + + AbpUserConsts.MaxNameLength = 99; + IdentityRoleConsts.MaxNameLength = 99; + + * Notice: It is not suggested to change property lengths + * unless you really need it. Go with the standard values wherever possible. + * + * If you are using EF Core, you will need to run the add-migration command after your changes. + */ + } + + private static void ConfigureExtraProperties() + { + /* You can configure extra properties for the + * entities defined in the modules used by your application. + * + * This class can be used to define these extra properties + * with a high level, easy to use API. + * + * Example: Add a new property to the user entity of the identity module + + ObjectExtensionManager.Instance.Modules() + .ConfigureIdentity(identity => + { + identity.ConfigureUser(user => + { + user.AddOrUpdateProperty( //property type: string + "SocialSecurityNumber", //property name + property => + { + //validation rules + property.Attributes.Add(new RequiredAttribute()); + property.Attributes.Add(new StringLengthAttribute(64) {MinimumLength = 4}); + + property.Configuration[IdentityModuleExtensionConsts.ConfigurationNames.AllowUserToEdit] = true; + + //...other configurations for this property + } + ); + }); + }); + + * See the documentation for more: + * https://docs.abp.io/en/abp/latest/Module-Entity-Extensions + */ + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain/Data/ITenantManagementDbSchemaMigrator.cs b/modules/tenant-management/src/KonSoft.TenantManagement.Domain/Data/ITenantManagementDbSchemaMigrator.cs new file mode 100644 index 0000000..134f8ef --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain/Data/ITenantManagementDbSchemaMigrator.cs @@ -0,0 +1,8 @@ +using System.Threading.Tasks; + +namespace KonSoft.TenantManagement.Data; + +public interface ITenantManagementDbSchemaMigrator +{ + Task MigrateAsync(); +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain/Data/NullTenantManagementDbSchemaMigrator.cs b/modules/tenant-management/src/KonSoft.TenantManagement.Domain/Data/NullTenantManagementDbSchemaMigrator.cs new file mode 100644 index 0000000..4d10344 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain/Data/NullTenantManagementDbSchemaMigrator.cs @@ -0,0 +1,15 @@ +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; + +namespace KonSoft.TenantManagement.Data; + +/* This is used if database provider does't define + * ITenantManagementDbSchemaMigrator implementation. + */ +public class NullTenantManagementDbSchemaMigrator : ITenantManagementDbSchemaMigrator, ITransientDependency +{ + public Task MigrateAsync() + { + return Task.CompletedTask; + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain/Data/TenantManagementDbMigrationService.cs b/modules/tenant-management/src/KonSoft.TenantManagement.Domain/Data/TenantManagementDbMigrationService.cs new file mode 100644 index 0000000..38df252 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain/Data/TenantManagementDbMigrationService.cs @@ -0,0 +1,218 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Identity; +using Volo.Abp.MultiTenancy; +using Volo.Abp.TenantManagement; + +namespace KonSoft.TenantManagement.Data; + +public class TenantManagementDbMigrationService : ITransientDependency +{ + public ILogger Logger { get; set; } + + private readonly IDataSeeder _dataSeeder; + private readonly IEnumerable _dbSchemaMigrators; + private readonly ITenantRepository _tenantRepository; + private readonly ICurrentTenant _currentTenant; + + public TenantManagementDbMigrationService( + IDataSeeder dataSeeder, + IEnumerable dbSchemaMigrators, + ITenantRepository tenantRepository, + ICurrentTenant currentTenant) + { + _dataSeeder = dataSeeder; + _dbSchemaMigrators = dbSchemaMigrators; + _tenantRepository = tenantRepository; + _currentTenant = currentTenant; + + Logger = NullLogger.Instance; + } + + public async Task MigrateAsync() + { + var initialMigrationAdded = AddInitialMigrationIfNotExist(); + + if (initialMigrationAdded) + { + return; + } + + Logger.LogInformation("Started database migrations..."); + + await MigrateDatabaseSchemaAsync(); + await SeedDataAsync(); + + Logger.LogInformation($"Successfully completed host database migrations."); + + var tenants = await _tenantRepository.GetListAsync(includeDetails: true); + + var migratedDatabaseSchemas = new HashSet(); + foreach (var tenant in tenants) + { + using (_currentTenant.Change(tenant.Id)) + { + if (tenant.ConnectionStrings.Any()) + { + var tenantConnectionStrings = tenant.ConnectionStrings + .Select(x => x.Value) + .ToList(); + + if (!migratedDatabaseSchemas.IsSupersetOf(tenantConnectionStrings)) + { + await MigrateDatabaseSchemaAsync(tenant); + + migratedDatabaseSchemas.AddIfNotContains(tenantConnectionStrings); + } + } + + await SeedDataAsync(tenant); + } + + Logger.LogInformation($"Successfully completed {tenant.Name} tenant database migrations."); + } + + Logger.LogInformation("Successfully completed all database migrations."); + Logger.LogInformation("You can safely end this process..."); + } + + private async Task MigrateDatabaseSchemaAsync(Tenant? tenant = null) + { + Logger.LogInformation( + $"Migrating schema for {(tenant == null ? "host" : tenant.Name + " tenant")} database..."); + + foreach (var migrator in _dbSchemaMigrators) + { + await migrator.MigrateAsync(); + } + } + + private async Task SeedDataAsync(Tenant? tenant = null) + { + Logger.LogInformation($"Executing {(tenant == null ? "host" : tenant.Name + " tenant")} database seed..."); + + await _dataSeeder.SeedAsync(new DataSeedContext(tenant?.Id) + .WithProperty(IdentityDataSeedContributor.AdminEmailPropertyName, IdentityDataSeedContributor.AdminEmailDefaultValue) + .WithProperty(IdentityDataSeedContributor.AdminPasswordPropertyName, IdentityDataSeedContributor.AdminPasswordDefaultValue) + ); + } + + private bool AddInitialMigrationIfNotExist() + { + try + { + if (!DbMigrationsProjectExists()) + { + return false; + } + } + catch (Exception) + { + return false; + } + + try + { + if (!MigrationsFolderExists()) + { + AddInitialMigration(); + return true; + } + else + { + return false; + } + } + catch (Exception e) + { + Logger.LogWarning("Couldn't determinate if any migrations exist : " + e.Message); + return false; + } + } + + private bool DbMigrationsProjectExists() + { + var dbMigrationsProjectFolder = GetEntityFrameworkCoreProjectFolderPath(); + + return dbMigrationsProjectFolder != null; + } + + private bool MigrationsFolderExists() + { + var dbMigrationsProjectFolder = GetEntityFrameworkCoreProjectFolderPath(); + return dbMigrationsProjectFolder != null && Directory.Exists(Path.Combine(dbMigrationsProjectFolder, "Migrations")); + } + + private void AddInitialMigration() + { + Logger.LogInformation("Creating initial migration..."); + + string argumentPrefix; + string fileName; + + if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) || RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + argumentPrefix = "-c"; + fileName = "/bin/bash"; + } + else + { + argumentPrefix = "/C"; + fileName = "cmd.exe"; + } + + var procStartInfo = new ProcessStartInfo(fileName, + $"{argumentPrefix} \"abp create-migration-and-run-migrator \"{GetEntityFrameworkCoreProjectFolderPath()}\"\"" + ); + + try + { + Process.Start(procStartInfo); + } + catch (Exception) + { + throw new Exception("Couldn't run ABP CLI..."); + } + } + + private string? GetEntityFrameworkCoreProjectFolderPath() + { + var slnDirectoryPath = GetSolutionDirectoryPath(); + + if (slnDirectoryPath == null) + { + throw new Exception("Solution folder not found!"); + } + + var srcDirectoryPath = Path.Combine(slnDirectoryPath, "src"); + + return Directory.GetDirectories(srcDirectoryPath) + .FirstOrDefault(d => d.EndsWith(".EntityFrameworkCore")); + } + + private string? GetSolutionDirectoryPath() + { + var currentDirectory = new DirectoryInfo(Directory.GetCurrentDirectory()); + + while (currentDirectory != null && Directory.GetParent(currentDirectory.FullName) != null) + { + currentDirectory = Directory.GetParent(currentDirectory.FullName); + + if (currentDirectory != null && Directory.GetFiles(currentDirectory.FullName).FirstOrDefault(f => f.EndsWith(".sln")) != null) + { + return currentDirectory.FullName; + } + } + + return null; + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain/KonSoft.TenantManagement.Domain.csproj b/modules/tenant-management/src/KonSoft.TenantManagement.Domain/KonSoft.TenantManagement.Domain.csproj new file mode 100644 index 0000000..80340f9 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain/KonSoft.TenantManagement.Domain.csproj @@ -0,0 +1,28 @@ + + + + + + net8.0 + enable + KonSoft.TenantManagement + + + + + + + + + + + + + + + + + + + + diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain/OpenIddict/OpenIddictDataSeedContributor.cs b/modules/tenant-management/src/KonSoft.TenantManagement.Domain/OpenIddict/OpenIddictDataSeedContributor.cs new file mode 100644 index 0000000..595dc86 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain/OpenIddict/OpenIddictDataSeedContributor.cs @@ -0,0 +1,327 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; +using System.Threading.Tasks; +using JetBrains.Annotations; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Localization; +using OpenIddict.Abstractions; +using Volo.Abp; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.OpenIddict.Applications; +using Volo.Abp.OpenIddict.Scopes; +using Volo.Abp.PermissionManagement; +using Volo.Abp.Uow; + +namespace KonSoft.TenantManagement.OpenIddict; + +/* Creates initial data that is needed to property run the application + * and make client-to-server communication possible. + */ +public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDependency +{ + private readonly IConfiguration _configuration; + private readonly IOpenIddictApplicationRepository _openIddictApplicationRepository; + private readonly IAbpApplicationManager _applicationManager; + private readonly IOpenIddictScopeRepository _openIddictScopeRepository; + private readonly IOpenIddictScopeManager _scopeManager; + private readonly IPermissionDataSeeder _permissionDataSeeder; + private readonly IStringLocalizer L; + + public OpenIddictDataSeedContributor( + IConfiguration configuration, + IOpenIddictApplicationRepository openIddictApplicationRepository, + IAbpApplicationManager applicationManager, + IOpenIddictScopeRepository openIddictScopeRepository, + IOpenIddictScopeManager scopeManager, + IPermissionDataSeeder permissionDataSeeder, + IStringLocalizer l ) + { + _configuration = configuration; + _openIddictApplicationRepository = openIddictApplicationRepository; + _applicationManager = applicationManager; + _openIddictScopeRepository = openIddictScopeRepository; + _scopeManager = scopeManager; + _permissionDataSeeder = permissionDataSeeder; + L = l; + } + + [UnitOfWork] + public virtual async Task SeedAsync(DataSeedContext context) + { + await CreateScopesAsync(); + await CreateApplicationsAsync(); + } + + private async Task CreateScopesAsync() + { + if (await _openIddictScopeRepository.FindByNameAsync("TenantManagement") == null) + { + await _scopeManager.CreateAsync(new OpenIddictScopeDescriptor { + Name = "TenantManagement", DisplayName = "TenantManagement API", Resources = { "TenantManagement" } + }); + } + } + + private async Task CreateApplicationsAsync() + { + var commonScopes = new List { + OpenIddictConstants.Permissions.Scopes.Address, + OpenIddictConstants.Permissions.Scopes.Email, + OpenIddictConstants.Permissions.Scopes.Phone, + OpenIddictConstants.Permissions.Scopes.Profile, + OpenIddictConstants.Permissions.Scopes.Roles, + "TenantManagement" + }; + + var configurationSection = _configuration.GetSection("OpenIddict:Applications"); + + + + + + + // Swagger Client + var swaggerClientId = configurationSection["TenantManagement_Swagger:ClientId"]; + if (!swaggerClientId.IsNullOrWhiteSpace()) + { + var swaggerRootUrl = configurationSection["TenantManagement_Swagger:RootUrl"]?.TrimEnd('/'); + + await CreateApplicationAsync( + name: swaggerClientId!, + type: OpenIddictConstants.ClientTypes.Public, + consentType: OpenIddictConstants.ConsentTypes.Implicit, + displayName: "Swagger Application", + secret: null, + grantTypes: new List { OpenIddictConstants.GrantTypes.AuthorizationCode, }, + scopes: commonScopes, + redirectUri: $"{swaggerRootUrl}/swagger/oauth2-redirect.html", + clientUri: swaggerRootUrl + ); + } + } + + private async Task CreateApplicationAsync( + [NotNull] string name, + [NotNull] string type, + [NotNull] string consentType, + string displayName, + string? secret, + List grantTypes, + List scopes, + string? clientUri = null, + string? redirectUri = null, + string? postLogoutRedirectUri = null, + List? permissions = null) + { + if (!string.IsNullOrEmpty(secret) && string.Equals(type, OpenIddictConstants.ClientTypes.Public, + StringComparison.OrdinalIgnoreCase)) + { + throw new BusinessException(L["NoClientSecretCanBeSetForPublicApplications"]); + } + + if (string.IsNullOrEmpty(secret) && string.Equals(type, OpenIddictConstants.ClientTypes.Confidential, + StringComparison.OrdinalIgnoreCase)) + { + throw new BusinessException(L["TheClientSecretIsRequiredForConfidentialApplications"]); + } + + var client = await _openIddictApplicationRepository.FindByClientIdAsync(name); + + var application = new AbpApplicationDescriptor { + ClientId = name, + ClientType = type, + ClientSecret = secret, + ConsentType = consentType, + DisplayName = displayName, + ClientUri = clientUri, + }; + + Check.NotNullOrEmpty(grantTypes, nameof(grantTypes)); + Check.NotNullOrEmpty(scopes, nameof(scopes)); + + if (new[] { OpenIddictConstants.GrantTypes.AuthorizationCode, OpenIddictConstants.GrantTypes.Implicit }.All( + grantTypes.Contains)) + { + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.CodeIdToken); + + if (string.Equals(type, OpenIddictConstants.ClientTypes.Public, StringComparison.OrdinalIgnoreCase)) + { + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.CodeIdTokenToken); + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.CodeToken); + } + } + + if (!redirectUri.IsNullOrWhiteSpace() || !postLogoutRedirectUri.IsNullOrWhiteSpace()) + { + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Logout); + } + + var buildInGrantTypes = new[] { + OpenIddictConstants.GrantTypes.Implicit, OpenIddictConstants.GrantTypes.Password, + OpenIddictConstants.GrantTypes.AuthorizationCode, OpenIddictConstants.GrantTypes.ClientCredentials, + OpenIddictConstants.GrantTypes.DeviceCode, OpenIddictConstants.GrantTypes.RefreshToken + }; + + foreach (var grantType in grantTypes) + { + if (grantType == OpenIddictConstants.GrantTypes.AuthorizationCode) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.AuthorizationCode); + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.Code); + } + + if (grantType == OpenIddictConstants.GrantTypes.AuthorizationCode || + grantType == OpenIddictConstants.GrantTypes.Implicit) + { + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Authorization); + } + + if (grantType == OpenIddictConstants.GrantTypes.AuthorizationCode || + grantType == OpenIddictConstants.GrantTypes.ClientCredentials || + grantType == OpenIddictConstants.GrantTypes.Password || + grantType == OpenIddictConstants.GrantTypes.RefreshToken || + grantType == OpenIddictConstants.GrantTypes.DeviceCode) + { + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Token); + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Revocation); + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Introspection); + } + + if (grantType == OpenIddictConstants.GrantTypes.ClientCredentials) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.ClientCredentials); + } + + if (grantType == OpenIddictConstants.GrantTypes.Implicit) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.Implicit); + } + + if (grantType == OpenIddictConstants.GrantTypes.Password) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.Password); + } + + if (grantType == OpenIddictConstants.GrantTypes.RefreshToken) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.RefreshToken); + } + + if (grantType == OpenIddictConstants.GrantTypes.DeviceCode) + { + application.Permissions.Add(OpenIddictConstants.Permissions.GrantTypes.DeviceCode); + application.Permissions.Add(OpenIddictConstants.Permissions.Endpoints.Device); + } + + if (grantType == OpenIddictConstants.GrantTypes.Implicit) + { + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.IdToken); + if (string.Equals(type, OpenIddictConstants.ClientTypes.Public, StringComparison.OrdinalIgnoreCase)) + { + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.IdTokenToken); + application.Permissions.Add(OpenIddictConstants.Permissions.ResponseTypes.Token); + } + } + + if (!buildInGrantTypes.Contains(grantType)) + { + application.Permissions.Add(OpenIddictConstants.Permissions.Prefixes.GrantType + grantType); + } + } + + var buildInScopes = new[] { + OpenIddictConstants.Permissions.Scopes.Address, OpenIddictConstants.Permissions.Scopes.Email, + OpenIddictConstants.Permissions.Scopes.Phone, OpenIddictConstants.Permissions.Scopes.Profile, + OpenIddictConstants.Permissions.Scopes.Roles + }; + + foreach (var scope in scopes) + { + if (buildInScopes.Contains(scope)) + { + application.Permissions.Add(scope); + } + else + { + application.Permissions.Add(OpenIddictConstants.Permissions.Prefixes.Scope + scope); + } + } + + if (redirectUri != null) + { + if (!redirectUri.IsNullOrEmpty()) + { + if (!Uri.TryCreate(redirectUri, UriKind.Absolute, out var uri) || !uri.IsWellFormedOriginalString()) + { + throw new BusinessException(L["InvalidRedirectUri", redirectUri]); + } + + if (application.RedirectUris.All(x => x != uri)) + { + application.RedirectUris.Add(uri); + } + } + } + + if (postLogoutRedirectUri != null) + { + if (!postLogoutRedirectUri.IsNullOrEmpty()) + { + if (!Uri.TryCreate(postLogoutRedirectUri, UriKind.Absolute, out var uri) || + !uri.IsWellFormedOriginalString()) + { + throw new BusinessException(L["InvalidPostLogoutRedirectUri", postLogoutRedirectUri]); + } + + if (application.PostLogoutRedirectUris.All(x => x != uri)) + { + application.PostLogoutRedirectUris.Add(uri); + } + } + } + + if (permissions != null) + { + await _permissionDataSeeder.SeedAsync( + ClientPermissionValueProvider.ProviderName, + name, + permissions, + null + ); + } + + if (client == null) + { + await _applicationManager.CreateAsync(application); + return; + } + + if (!HasSameRedirectUris(client, application)) + { + client.RedirectUris = JsonSerializer.Serialize(application.RedirectUris.Select(q => q.ToString().TrimEnd('/'))); + client.PostLogoutRedirectUris = JsonSerializer.Serialize(application.PostLogoutRedirectUris.Select(q => q.ToString().TrimEnd('/'))); + + await _applicationManager.UpdateAsync(client.ToModel()); + } + + if (!HasSameScopes(client, application)) + { + client.Permissions = JsonSerializer.Serialize(application.Permissions.Select(q => q.ToString())); + await _applicationManager.UpdateAsync(client.ToModel()); + } + } + + private bool HasSameRedirectUris(OpenIddictApplication existingClient, AbpApplicationDescriptor application) + { + return existingClient.RedirectUris == JsonSerializer.Serialize(application.RedirectUris.Select(q => q.ToString().TrimEnd('/'))); + } + + private bool HasSameScopes(OpenIddictApplication existingClient, AbpApplicationDescriptor application) + { + return existingClient.Permissions == JsonSerializer.Serialize(application.Permissions.Select(q => q.ToString().TrimEnd('/'))); + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain/Properties/AssemblyInfo.cs b/modules/tenant-management/src/KonSoft.TenantManagement.Domain/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..41dfbc0 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain/Properties/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using System.Runtime.CompilerServices; +[assembly:InternalsVisibleToAttribute("KonSoft.TenantManagement.Domain.Tests")] +[assembly:InternalsVisibleToAttribute("KonSoft.TenantManagement.TestBase")] diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain/Settings/TenantManagementSettingDefinitionProvider.cs b/modules/tenant-management/src/KonSoft.TenantManagement.Domain/Settings/TenantManagementSettingDefinitionProvider.cs new file mode 100644 index 0000000..b986266 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain/Settings/TenantManagementSettingDefinitionProvider.cs @@ -0,0 +1,12 @@ +using Volo.Abp.Settings; + +namespace KonSoft.TenantManagement.Settings; + +public class TenantManagementSettingDefinitionProvider : SettingDefinitionProvider +{ + public override void Define(ISettingDefinitionContext context) + { + //Define your own settings here. Example: + //context.Add(new SettingDefinition(TenantManagementSettings.MySetting1)); + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain/Settings/TenantManagementSettings.cs b/modules/tenant-management/src/KonSoft.TenantManagement.Domain/Settings/TenantManagementSettings.cs new file mode 100644 index 0000000..054278d --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain/Settings/TenantManagementSettings.cs @@ -0,0 +1,9 @@ +namespace KonSoft.TenantManagement.Settings; + +public static class TenantManagementSettings +{ + private const string Prefix = "TenantManagement"; + + //Add your own setting names here. Example: + //public const string MySetting1 = Prefix + ".MySetting1"; +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain/TenantManagementConsts.cs b/modules/tenant-management/src/KonSoft.TenantManagement.Domain/TenantManagementConsts.cs new file mode 100644 index 0000000..8a46643 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain/TenantManagementConsts.cs @@ -0,0 +1,8 @@ +namespace KonSoft.TenantManagement; + +public static class TenantManagementConsts +{ + public const string DbTablePrefix = "App"; + + public const string DbSchema = null; +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain/TenantManagementDomainModule.cs b/modules/tenant-management/src/KonSoft.TenantManagement.Domain/TenantManagementDomainModule.cs new file mode 100644 index 0000000..0e3b699 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain/TenantManagementDomainModule.cs @@ -0,0 +1,68 @@ +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection.Extensions; +using KonSoft.TenantManagement.MultiTenancy; +using Volo.Abp.AuditLogging; +using Volo.Abp.BackgroundJobs; +using Volo.Abp.Emailing; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Volo.Abp.MultiTenancy; +using Volo.Abp.OpenIddict; +using Volo.Abp.PermissionManagement.Identity; +using Volo.Abp.PermissionManagement.OpenIddict; +using Volo.Abp.SettingManagement; +using Volo.Abp.TenantManagement; + +namespace KonSoft.TenantManagement; + +[DependsOn( + typeof(TenantManagementDomainSharedModule), + typeof(AbpAuditLoggingDomainModule), + typeof(AbpBackgroundJobsDomainModule), + typeof(AbpFeatureManagementDomainModule), + typeof(AbpIdentityDomainModule), + typeof(AbpOpenIddictDomainModule), + typeof(AbpPermissionManagementDomainOpenIddictModule), + typeof(AbpPermissionManagementDomainIdentityModule), + typeof(AbpSettingManagementDomainModule), + typeof(AbpTenantManagementDomainModule), + typeof(AbpEmailingModule) +)] +public class TenantManagementDomainModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.Languages.Add(new LanguageInfo("ar", "ar", "العربية")); + options.Languages.Add(new LanguageInfo("cs", "cs", "Čeština")); + options.Languages.Add(new LanguageInfo("en", "en", "English")); + options.Languages.Add(new LanguageInfo("en-GB", "en-GB", "English (UK)")); + options.Languages.Add(new LanguageInfo("hu", "hu", "Magyar")); + options.Languages.Add(new LanguageInfo("hr", "hr", "Croatian")); + options.Languages.Add(new LanguageInfo("fi", "fi", "Finnish")); + options.Languages.Add(new LanguageInfo("fr", "fr", "Français")); + options.Languages.Add(new LanguageInfo("hi", "hi", "Hindi")); + options.Languages.Add(new LanguageInfo("it", "it", "Italiano")); + options.Languages.Add(new LanguageInfo("pt-BR", "pt-BR", "Português")); + options.Languages.Add(new LanguageInfo("ru", "ru", "Русский")); + options.Languages.Add(new LanguageInfo("sk", "sk", "Slovak")); + options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe")); + options.Languages.Add(new LanguageInfo("zh-Hans", "zh-Hans", "简体中文")); + options.Languages.Add(new LanguageInfo("zh-Hant", "zh-Hant", "繁體中文")); + options.Languages.Add(new LanguageInfo("de-DE", "de-DE", "Deutsch")); + options.Languages.Add(new LanguageInfo("es", "es", "Español")); + }); + + Configure(options => + { + options.IsEnabled = MultiTenancyConsts.IsEnabled; + }); + +#if DEBUG + context.Services.Replace(ServiceDescriptor.Singleton()); +#endif + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreTenantManagementDbSchemaMigrator.cs b/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreTenantManagementDbSchemaMigrator.cs new file mode 100644 index 0000000..ce41516 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreTenantManagementDbSchemaMigrator.cs @@ -0,0 +1,34 @@ +using System; +using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using KonSoft.TenantManagement.Data; +using Volo.Abp.DependencyInjection; + +namespace KonSoft.TenantManagement.EntityFrameworkCore; + +public class EntityFrameworkCoreTenantManagementDbSchemaMigrator + : ITenantManagementDbSchemaMigrator, ITransientDependency +{ + private readonly IServiceProvider _serviceProvider; + + public EntityFrameworkCoreTenantManagementDbSchemaMigrator( + IServiceProvider serviceProvider) + { + _serviceProvider = serviceProvider; + } + + public async Task MigrateAsync() + { + /* We intentionally resolve the TenantManagementDbContext + * from IServiceProvider (instead of directly injecting it) + * to properly get the connection string of the current tenant in the + * current scope. + */ + + await _serviceProvider + .GetRequiredService() + .Database + .MigrateAsync(); + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/EntityFrameworkCore/TenantManagementDbContext.cs b/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/EntityFrameworkCore/TenantManagementDbContext.cs new file mode 100644 index 0000000..42fb62f --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/EntityFrameworkCore/TenantManagementDbContext.cs @@ -0,0 +1,86 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp.AuditLogging.EntityFrameworkCore; +using Volo.Abp.BackgroundJobs.EntityFrameworkCore; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.FeatureManagement.EntityFrameworkCore; +using Volo.Abp.Identity; +using Volo.Abp.Identity.EntityFrameworkCore; +using Volo.Abp.OpenIddict.EntityFrameworkCore; +using Volo.Abp.PermissionManagement.EntityFrameworkCore; +using Volo.Abp.SettingManagement.EntityFrameworkCore; +using Volo.Abp.TenantManagement; +using Volo.Abp.TenantManagement.EntityFrameworkCore; + +namespace KonSoft.TenantManagement.EntityFrameworkCore; + +[ReplaceDbContext(typeof(IIdentityDbContext))] +[ReplaceDbContext(typeof(ITenantManagementDbContext))] +[ConnectionStringName("Default")] +public class TenantManagementDbContext : + AbpDbContext, + IIdentityDbContext, + ITenantManagementDbContext +{ + /* Add DbSet properties for your Aggregate Roots / Entities here. */ + + #region Entities from the modules + + /* Notice: We only implemented IIdentityDbContext and ITenantManagementDbContext + * and replaced them for this DbContext. This allows you to perform JOIN + * queries for the entities of these modules over the repositories easily. You + * typically don't need that for other modules. But, if you need, you can + * implement the DbContext interface of the needed module and use ReplaceDbContext + * attribute just like IIdentityDbContext and ITenantManagementDbContext. + * + * More info: Replacing a DbContext of a module ensures that the related module + * uses this DbContext on runtime. Otherwise, it will use its own DbContext class. + */ + + //Identity + public DbSet Users { get; set; } + public DbSet Roles { get; set; } + public DbSet ClaimTypes { get; set; } + public DbSet OrganizationUnits { get; set; } + public DbSet SecurityLogs { get; set; } + public DbSet LinkUsers { get; set; } + public DbSet UserDelegations { get; set; } + public DbSet Sessions { get; set; } + // Tenant Management + public DbSet Tenants { get; set; } + public DbSet TenantConnectionStrings { get; set; } + + #endregion + + public TenantManagementDbContext(DbContextOptions options) + : base(options) + { + + } + + protected override void OnModelCreating(ModelBuilder builder) + { + base.OnModelCreating(builder); + + /* Include modules to your migration db context */ + + builder.ConfigurePermissionManagement(); + builder.ConfigureSettingManagement(); + builder.ConfigureBackgroundJobs(); + builder.ConfigureAuditLogging(); + builder.ConfigureIdentity(); + builder.ConfigureOpenIddict(); + builder.ConfigureFeatureManagement(); + builder.ConfigureTenantManagement(); + + /* Configure your own tables/entities inside here */ + + //builder.Entity(b => + //{ + // b.ToTable(TenantManagementConsts.DbTablePrefix + "YourEntities", TenantManagementConsts.DbSchema); + // b.ConfigureByConvention(); //auto configure for the base class props + // //... + //}); + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/EntityFrameworkCore/TenantManagementDbContextFactory.cs b/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/EntityFrameworkCore/TenantManagementDbContextFactory.cs new file mode 100644 index 0000000..491c202 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/EntityFrameworkCore/TenantManagementDbContextFactory.cs @@ -0,0 +1,36 @@ +using System; +using System.IO; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Design; +using Microsoft.Extensions.Configuration; + +namespace KonSoft.TenantManagement.EntityFrameworkCore; + +/* This class is needed for EF Core console commands + * (like Add-Migration and Update-Database commands) */ +public class TenantManagementDbContextFactory : IDesignTimeDbContextFactory +{ + public TenantManagementDbContext CreateDbContext(string[] args) + { + // https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic + AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); + + TenantManagementEfCoreEntityExtensionMappings.Configure(); + + var configuration = BuildConfiguration(); + + var builder = new DbContextOptionsBuilder() + .UseNpgsql(configuration.GetConnectionString("Default")); + + return new TenantManagementDbContext(builder.Options); + } + + private static IConfigurationRoot BuildConfiguration() + { + var builder = new ConfigurationBuilder() + .SetBasePath(Path.Combine(Directory.GetCurrentDirectory(), "../KonSoft.TenantManagement.DbMigrator/")) + .AddJsonFile("appsettings.json", optional: false); + + return builder.Build(); + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/EntityFrameworkCore/TenantManagementEfCoreEntityExtensionMappings.cs b/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/EntityFrameworkCore/TenantManagementEfCoreEntityExtensionMappings.cs new file mode 100644 index 0000000..0e41151 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/EntityFrameworkCore/TenantManagementEfCoreEntityExtensionMappings.cs @@ -0,0 +1,44 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Identity; +using Volo.Abp.ObjectExtending; +using Volo.Abp.Threading; + +namespace KonSoft.TenantManagement.EntityFrameworkCore; + +public static class TenantManagementEfCoreEntityExtensionMappings +{ + private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + + public static void Configure() + { + TenantManagementGlobalFeatureConfigurator.Configure(); + TenantManagementModuleExtensionConfigurator.Configure(); + + OneTimeRunner.Run(() => + { + /* You can configure extra properties for the + * entities defined in the modules used by your application. + * + * This class can be used to map these extra properties to table fields in the database. + * + * USE THIS CLASS ONLY TO CONFIGURE EF CORE RELATED MAPPING. + * USE TenantManagementModuleExtensionConfigurator CLASS (in the Domain.Shared project) + * FOR A HIGH LEVEL API TO DEFINE EXTRA PROPERTIES TO ENTITIES OF THE USED MODULES + * + * Example: Map a property to a table field: + + ObjectExtensionManager.Instance + .MapEfCoreProperty( + "MyProperty", + (entityBuilder, propertyBuilder) => + { + propertyBuilder.HasMaxLength(128); + } + ); + + * See the documentation for more: + * https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Extending-Entities + */ + }); + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/EntityFrameworkCore/TenantManagementEntityFrameworkCoreModule.cs b/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/EntityFrameworkCore/TenantManagementEntityFrameworkCoreModule.cs new file mode 100644 index 0000000..19ad7ae --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/EntityFrameworkCore/TenantManagementEntityFrameworkCoreModule.cs @@ -0,0 +1,57 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Uow; +using Volo.Abp.AuditLogging.EntityFrameworkCore; +using Volo.Abp.BackgroundJobs.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.PostgreSql; +using Volo.Abp.FeatureManagement.EntityFrameworkCore; +using Volo.Abp.Identity.EntityFrameworkCore; +using Volo.Abp.Modularity; +using Volo.Abp.OpenIddict.EntityFrameworkCore; +using Volo.Abp.PermissionManagement.EntityFrameworkCore; +using Volo.Abp.SettingManagement.EntityFrameworkCore; +using Volo.Abp.TenantManagement.EntityFrameworkCore; + +namespace KonSoft.TenantManagement.EntityFrameworkCore; + +[DependsOn( + typeof(TenantManagementDomainModule), + typeof(AbpIdentityEntityFrameworkCoreModule), + typeof(AbpOpenIddictEntityFrameworkCoreModule), + typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpSettingManagementEntityFrameworkCoreModule), + typeof(AbpEntityFrameworkCorePostgreSqlModule), + typeof(AbpBackgroundJobsEntityFrameworkCoreModule), + typeof(AbpAuditLoggingEntityFrameworkCoreModule), + typeof(AbpTenantManagementEntityFrameworkCoreModule), + typeof(AbpFeatureManagementEntityFrameworkCoreModule) + )] +public class TenantManagementEntityFrameworkCoreModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + // https://www.npgsql.org/efcore/release-notes/6.0.html#opting-out-of-the-new-timestamp-mapping-logic + AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); + + TenantManagementEfCoreEntityExtensionMappings.Configure(); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAbpDbContext(options => + { + /* Remove "includeAllEntities: true" to create + * default repositories only for aggregate roots */ + options.AddDefaultRepositories(includeAllEntities: true); + }); + + Configure(options => + { + /* The main point to change your DBMS. + * See also TenantManagementMigrationsDbContextFactory for EF Core tooling. */ + options.UseNpgsql(); + }); + + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/KonSoft.TenantManagement.EntityFrameworkCore.csproj b/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/KonSoft.TenantManagement.EntityFrameworkCore.csproj new file mode 100644 index 0000000..619558b --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/KonSoft.TenantManagement.EntityFrameworkCore.csproj @@ -0,0 +1,31 @@ + + + + + + net8.0 + enable + KonSoft.TenantManagement + + + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers + + + + diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/Migrations/20250908052623_Initial.Designer.cs b/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/Migrations/20250908052623_Initial.Designer.cs new file mode 100644 index 0000000..fbd5b65 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/Migrations/20250908052623_Initial.Designer.cs @@ -0,0 +1,2006 @@ +// +using System; +using KonSoft.TenantManagement.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace KonSoft.TenantManagement.Migrations +{ + [DbContext(typeof(TenantManagementDbContext))] + [Migration("20250908052623_Initial")] + partial class Initial + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.PostgreSql) + .HasAnnotation("ProductVersion", "8.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("character varying(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("text"); + + b.Property("ExecutionDuration") + .HasColumnType("integer") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("timestamp without time zone"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("integer") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("uuid") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("uuid") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("uuid") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AuditLogId") + .HasColumnType("uuid") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("integer") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AuditLogId") + .HasColumnType("uuid") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("smallint") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("uuid"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("EntityChangeId") + .HasColumnType("uuid"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("character varying(1048576)"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("LastTryTime") + .HasColumnType("timestamp without time zone"); + + b.Property("NextTryTime") + .HasColumnType("timestamp without time zone"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("boolean"); + + b.Property("IsVisibleToClients") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("Required") + .HasColumnType("boolean"); + + b.Property("ValueType") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("SourceTenantId") + .HasColumnType("uuid"); + + b.Property("SourceUserId") + .HasColumnType("uuid"); + + b.Property("TargetTenantId") + .HasColumnType("uuid"); + + b.Property("TargetUserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("boolean") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("boolean") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("boolean") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("character varying(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("character varying(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("character varying(96)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySession", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Device") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("DeviceInfo") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("IpAddresses") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("LastAccessed") + .HasColumnType("timestamp without time zone"); + + b.Property("SessionId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("SignedIn") + .HasColumnType("timestamp without time zone"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("Device"); + + b.HasIndex("SessionId"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSessions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("boolean") + .HasColumnName("IsActive"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("LastPasswordChangeTime") + .HasColumnType("timestamp with time zone"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("SecurityStamp"); + + b.Property("ShouldChangePasswordOnNextLogin") + .HasColumnType("boolean"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserDelegation", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("EndTime") + .HasColumnType("timestamp without time zone"); + + b.Property("SourceUserId") + .HasColumnType("uuid"); + + b.Property("StartTime") + .HasColumnType("timestamp without time zone"); + + b.Property("TargetUserId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AbpUserDelegations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("character varying(196)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uuid"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("character varying(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("DisplayName"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uuid"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("ClientId") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("ClientSecret") + .HasColumnType("text"); + + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("ClientUri") + .HasColumnType("text"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .HasColumnType("text"); + + b.Property("DisplayNames") + .HasColumnType("text"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("JsonWebKeySet") + .HasColumnType("text"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasColumnType("text"); + + b.Property("Permissions") + .HasColumnType("text"); + + b.Property("PostLogoutRedirectUris") + .HasColumnType("text"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("RedirectUris") + .HasColumnType("text"); + + b.Property("Requirements") + .HasColumnType("text"); + + b.Property("Settings") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("OpenIddictApplications", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationId") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("timestamp without time zone"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("Scopes") + .HasColumnType("text"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("character varying(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictAuthorizations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Scopes.OpenIddictScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Descriptions") + .HasColumnType("text"); + + b.Property("DisplayName") + .HasColumnType("text"); + + b.Property("DisplayNames") + .HasColumnType("text"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("Resources") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("OpenIddictScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationId") + .HasColumnType("uuid"); + + b.Property("AuthorizationId") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("timestamp without time zone"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("ExpirationDate") + .HasColumnType("timestamp without time zone"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Payload") + .HasColumnType("text"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("RedemptionDate") + .HasColumnType("timestamp without time zone"); + + b.Property("ReferenceId") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("character varying(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.HasKey("Id"); + + b.HasIndex("AuthorizationId"); + + b.HasIndex("ReferenceId"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("IsEnabled") + .HasColumnType("boolean"); + + b.Property("MultiTenancySide") + .HasColumnType("smallint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.SettingDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DefaultValue") + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.Property("Description") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsEncrypted") + .HasColumnType("boolean"); + + b.Property("IsInherited") + .HasColumnType("boolean"); + + b.Property("IsVisibleToClients") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("Providers") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpSettingDefinitions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("uuid"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + + b.HasOne("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", null) + .WithMany() + .HasForeignKey("AuthorizationId"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/Migrations/20250908052623_Initial.cs b/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/Migrations/20250908052623_Initial.cs new file mode 100644 index 0000000..949d916 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/Migrations/20250908052623_Initial.cs @@ -0,0 +1,1156 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace KonSoft.TenantManagement.Migrations +{ + /// + public partial class Initial : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "AbpAuditLogs", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + ApplicationName = table.Column(type: "character varying(96)", maxLength: 96, nullable: true), + UserId = table.Column(type: "uuid", nullable: true), + UserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + TenantId = table.Column(type: "uuid", nullable: true), + TenantName = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + ImpersonatorUserId = table.Column(type: "uuid", nullable: true), + ImpersonatorUserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + ImpersonatorTenantId = table.Column(type: "uuid", nullable: true), + ImpersonatorTenantName = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + ExecutionTime = table.Column(type: "timestamp without time zone", nullable: false), + ExecutionDuration = table.Column(type: "integer", nullable: false), + ClientIpAddress = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + ClientName = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + ClientId = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + CorrelationId = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + BrowserInfo = table.Column(type: "character varying(512)", maxLength: 512, nullable: true), + HttpMethod = table.Column(type: "character varying(16)", maxLength: 16, nullable: true), + Url = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + Exceptions = table.Column(type: "text", nullable: true), + Comments = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + HttpStatusCode = table.Column(type: "integer", nullable: true), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpAuditLogs", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpBackgroundJobs", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + JobName = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + JobArgs = table.Column(type: "character varying(1048576)", maxLength: 1048576, nullable: false), + TryCount = table.Column(type: "smallint", nullable: false, defaultValue: (short)0), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + NextTryTime = table.Column(type: "timestamp without time zone", nullable: false), + LastTryTime = table.Column(type: "timestamp without time zone", nullable: true), + IsAbandoned = table.Column(type: "boolean", nullable: false, defaultValue: false), + Priority = table.Column(type: "smallint", nullable: false, defaultValue: (byte)15), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpBackgroundJobs", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpClaimTypes", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + Required = table.Column(type: "boolean", nullable: false), + IsStatic = table.Column(type: "boolean", nullable: false), + Regex = table.Column(type: "character varying(512)", maxLength: 512, nullable: true), + RegexDescription = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + Description = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + ValueType = table.Column(type: "integer", nullable: false), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpClaimTypes", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpFeatureGroups", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + DisplayName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + ExtraProperties = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpFeatureGroups", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpFeatures", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + GroupName = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + ParentName = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + DisplayName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + Description = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + DefaultValue = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + IsVisibleToClients = table.Column(type: "boolean", nullable: false), + IsAvailableToHost = table.Column(type: "boolean", nullable: false), + AllowedProviders = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + ValueType = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: true), + ExtraProperties = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpFeatures", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpFeatureValues", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + Value = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + ProviderName = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + ProviderKey = table.Column(type: "character varying(64)", maxLength: 64, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpFeatureValues", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpLinkUsers", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + SourceUserId = table.Column(type: "uuid", nullable: false), + SourceTenantId = table.Column(type: "uuid", nullable: true), + TargetUserId = table.Column(type: "uuid", nullable: false), + TargetTenantId = table.Column(type: "uuid", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpLinkUsers", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpOrganizationUnits", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + ParentId = table.Column(type: "uuid", nullable: true), + Code = table.Column(type: "character varying(95)", maxLength: 95, nullable: false), + DisplayName = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + EntityVersion = table.Column(type: "integer", nullable: false), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp without time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpOrganizationUnits", x => x.Id); + table.ForeignKey( + name: "FK_AbpOrganizationUnits_AbpOrganizationUnits_ParentId", + column: x => x.ParentId, + principalTable: "AbpOrganizationUnits", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "AbpPermissionGrants", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + ProviderName = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + ProviderKey = table.Column(type: "character varying(64)", maxLength: 64, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpPermissionGroups", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + DisplayName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + ExtraProperties = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissionGroups", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpPermissions", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + GroupName = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + ParentName = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + DisplayName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + IsEnabled = table.Column(type: "boolean", nullable: false), + MultiTenancySide = table.Column(type: "smallint", nullable: false), + Providers = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + StateCheckers = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + ExtraProperties = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissions", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpRoles", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + Name = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + NormalizedName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + IsDefault = table.Column(type: "boolean", nullable: false), + IsStatic = table.Column(type: "boolean", nullable: false), + IsPublic = table.Column(type: "boolean", nullable: false), + EntityVersion = table.Column(type: "integer", nullable: false), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpRoles", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpSecurityLogs", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + ApplicationName = table.Column(type: "character varying(96)", maxLength: 96, nullable: true), + Identity = table.Column(type: "character varying(96)", maxLength: 96, nullable: true), + Action = table.Column(type: "character varying(96)", maxLength: 96, nullable: true), + UserId = table.Column(type: "uuid", nullable: true), + UserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + TenantName = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + ClientId = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + CorrelationId = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + ClientIpAddress = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + BrowserInfo = table.Column(type: "character varying(512)", maxLength: 512, nullable: true), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpSecurityLogs", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpSessions", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + SessionId = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + Device = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + DeviceInfo = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + TenantId = table.Column(type: "uuid", nullable: true), + UserId = table.Column(type: "uuid", nullable: false), + ClientId = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + IpAddresses = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + SignedIn = table.Column(type: "timestamp without time zone", nullable: false), + LastAccessed = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpSessions", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpSettingDefinitions", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + DisplayName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + Description = table.Column(type: "character varying(512)", maxLength: 512, nullable: true), + DefaultValue = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: true), + IsVisibleToClients = table.Column(type: "boolean", nullable: false), + Providers = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: true), + IsInherited = table.Column(type: "boolean", nullable: false), + IsEncrypted = table.Column(type: "boolean", nullable: false), + ExtraProperties = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpSettingDefinitions", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpSettings", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + Value = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: false), + ProviderName = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + ProviderKey = table.Column(type: "character varying(64)", maxLength: 64, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpSettings", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpTenants", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + NormalizedName = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + EntityVersion = table.Column(type: "integer", nullable: false), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp without time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpTenants", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpUserDelegations", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + SourceUserId = table.Column(type: "uuid", nullable: false), + TargetUserId = table.Column(type: "uuid", nullable: false), + StartTime = table.Column(type: "timestamp without time zone", nullable: false), + EndTime = table.Column(type: "timestamp without time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserDelegations", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpUsers", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + UserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + NormalizedUserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + Name = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + Surname = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + Email = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + NormalizedEmail = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + EmailConfirmed = table.Column(type: "boolean", nullable: false, defaultValue: false), + PasswordHash = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + SecurityStamp = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + IsExternal = table.Column(type: "boolean", nullable: false, defaultValue: false), + PhoneNumber = table.Column(type: "character varying(16)", maxLength: 16, nullable: true), + PhoneNumberConfirmed = table.Column(type: "boolean", nullable: false, defaultValue: false), + IsActive = table.Column(type: "boolean", nullable: false), + TwoFactorEnabled = table.Column(type: "boolean", nullable: false, defaultValue: false), + LockoutEnd = table.Column(type: "timestamp with time zone", nullable: true), + LockoutEnabled = table.Column(type: "boolean", nullable: false, defaultValue: false), + AccessFailedCount = table.Column(type: "integer", nullable: false, defaultValue: 0), + ShouldChangePasswordOnNextLogin = table.Column(type: "boolean", nullable: false), + EntityVersion = table.Column(type: "integer", nullable: false), + LastPasswordChangeTime = table.Column(type: "timestamp with time zone", nullable: true), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp without time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUsers", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "OpenIddictApplications", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + ApplicationType = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), + ClientId = table.Column(type: "character varying(100)", maxLength: 100, nullable: true), + ClientSecret = table.Column(type: "text", nullable: true), + ClientType = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), + ConsentType = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), + DisplayName = table.Column(type: "text", nullable: true), + DisplayNames = table.Column(type: "text", nullable: true), + JsonWebKeySet = table.Column(type: "text", nullable: true), + Permissions = table.Column(type: "text", nullable: true), + PostLogoutRedirectUris = table.Column(type: "text", nullable: true), + Properties = table.Column(type: "text", nullable: true), + RedirectUris = table.Column(type: "text", nullable: true), + Requirements = table.Column(type: "text", nullable: true), + Settings = table.Column(type: "text", nullable: true), + ClientUri = table.Column(type: "text", nullable: true), + LogoUri = table.Column(type: "text", nullable: true), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp without time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_OpenIddictApplications", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "OpenIddictScopes", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Description = table.Column(type: "text", nullable: true), + Descriptions = table.Column(type: "text", nullable: true), + DisplayName = table.Column(type: "text", nullable: true), + DisplayNames = table.Column(type: "text", nullable: true), + Name = table.Column(type: "character varying(200)", maxLength: 200, nullable: true), + Properties = table.Column(type: "text", nullable: true), + Resources = table.Column(type: "text", nullable: true), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp without time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_OpenIddictScopes", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpAuditLogActions", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + AuditLogId = table.Column(type: "uuid", nullable: false), + ServiceName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + MethodName = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + Parameters = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: true), + ExecutionTime = table.Column(type: "timestamp without time zone", nullable: false), + ExecutionDuration = table.Column(type: "integer", nullable: false), + ExtraProperties = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpAuditLogActions", x => x.Id); + table.ForeignKey( + name: "FK_AbpAuditLogActions_AbpAuditLogs_AuditLogId", + column: x => x.AuditLogId, + principalTable: "AbpAuditLogs", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpEntityChanges", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + AuditLogId = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + ChangeTime = table.Column(type: "timestamp without time zone", nullable: false), + ChangeType = table.Column(type: "smallint", nullable: false), + EntityTenantId = table.Column(type: "uuid", nullable: true), + EntityId = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), + EntityTypeFullName = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + ExtraProperties = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpEntityChanges", x => x.Id); + table.ForeignKey( + name: "FK_AbpEntityChanges_AbpAuditLogs_AuditLogId", + column: x => x.AuditLogId, + principalTable: "AbpAuditLogs", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpOrganizationUnitRoles", + columns: table => new + { + RoleId = table.Column(type: "uuid", nullable: false), + OrganizationUnitId = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpOrganizationUnitRoles", x => new { x.OrganizationUnitId, x.RoleId }); + table.ForeignKey( + name: "FK_AbpOrganizationUnitRoles_AbpOrganizationUnits_OrganizationU~", + column: x => x.OrganizationUnitId, + principalTable: "AbpOrganizationUnits", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_AbpOrganizationUnitRoles_AbpRoles_RoleId", + column: x => x.RoleId, + principalTable: "AbpRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpRoleClaims", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + RoleId = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + ClaimType = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + ClaimValue = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpRoleClaims", x => x.Id); + table.ForeignKey( + name: "FK_AbpRoleClaims_AbpRoles_RoleId", + column: x => x.RoleId, + principalTable: "AbpRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpTenantConnectionStrings", + columns: table => new + { + TenantId = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + Value = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpTenantConnectionStrings", x => new { x.TenantId, x.Name }); + table.ForeignKey( + name: "FK_AbpTenantConnectionStrings_AbpTenants_TenantId", + column: x => x.TenantId, + principalTable: "AbpTenants", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserClaims", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + UserId = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + ClaimType = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + ClaimValue = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserClaims", x => x.Id); + table.ForeignKey( + name: "FK_AbpUserClaims_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserLogins", + columns: table => new + { + UserId = table.Column(type: "uuid", nullable: false), + LoginProvider = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + ProviderKey = table.Column(type: "character varying(196)", maxLength: 196, nullable: false), + ProviderDisplayName = table.Column(type: "character varying(128)", maxLength: 128, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserLogins", x => new { x.UserId, x.LoginProvider }); + table.ForeignKey( + name: "FK_AbpUserLogins_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserOrganizationUnits", + columns: table => new + { + UserId = table.Column(type: "uuid", nullable: false), + OrganizationUnitId = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserOrganizationUnits", x => new { x.OrganizationUnitId, x.UserId }); + table.ForeignKey( + name: "FK_AbpUserOrganizationUnits_AbpOrganizationUnits_OrganizationU~", + column: x => x.OrganizationUnitId, + principalTable: "AbpOrganizationUnits", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_AbpUserOrganizationUnits_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserRoles", + columns: table => new + { + UserId = table.Column(type: "uuid", nullable: false), + RoleId = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserRoles", x => new { x.UserId, x.RoleId }); + table.ForeignKey( + name: "FK_AbpUserRoles_AbpRoles_RoleId", + column: x => x.RoleId, + principalTable: "AbpRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_AbpUserRoles_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpUserTokens", + columns: table => new + { + UserId = table.Column(type: "uuid", nullable: false), + LoginProvider = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + Value = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); + table.ForeignKey( + name: "FK_AbpUserTokens_AbpUsers_UserId", + column: x => x.UserId, + principalTable: "AbpUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "OpenIddictAuthorizations", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + ApplicationId = table.Column(type: "uuid", nullable: true), + CreationDate = table.Column(type: "timestamp without time zone", nullable: true), + Properties = table.Column(type: "text", nullable: true), + Scopes = table.Column(type: "text", nullable: true), + Status = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), + Subject = table.Column(type: "character varying(400)", maxLength: 400, nullable: true), + Type = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp without time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_OpenIddictAuthorizations", x => x.Id); + table.ForeignKey( + name: "FK_OpenIddictAuthorizations_OpenIddictApplications_Application~", + column: x => x.ApplicationId, + principalTable: "OpenIddictApplications", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "AbpEntityPropertyChanges", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true), + EntityChangeId = table.Column(type: "uuid", nullable: false), + NewValue = table.Column(type: "character varying(512)", maxLength: 512, nullable: true), + OriginalValue = table.Column(type: "character varying(512)", maxLength: 512, nullable: true), + PropertyName = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + PropertyTypeFullName = table.Column(type: "character varying(64)", maxLength: 64, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpEntityPropertyChanges", x => x.Id); + table.ForeignKey( + name: "FK_AbpEntityPropertyChanges_AbpEntityChanges_EntityChangeId", + column: x => x.EntityChangeId, + principalTable: "AbpEntityChanges", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "OpenIddictTokens", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + ApplicationId = table.Column(type: "uuid", nullable: true), + AuthorizationId = table.Column(type: "uuid", nullable: true), + CreationDate = table.Column(type: "timestamp without time zone", nullable: true), + ExpirationDate = table.Column(type: "timestamp without time zone", nullable: true), + Payload = table.Column(type: "text", nullable: true), + Properties = table.Column(type: "text", nullable: true), + RedemptionDate = table.Column(type: "timestamp without time zone", nullable: true), + ReferenceId = table.Column(type: "character varying(100)", maxLength: 100, nullable: true), + Status = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), + Subject = table.Column(type: "character varying(400)", maxLength: 400, nullable: true), + Type = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), + ExtraProperties = table.Column(type: "text", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: true), + LastModificationTime = table.Column(type: "timestamp without time zone", nullable: true), + LastModifierId = table.Column(type: "uuid", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uuid", nullable: true), + DeletionTime = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_OpenIddictTokens", x => x.Id); + table.ForeignKey( + name: "FK_OpenIddictTokens_OpenIddictApplications_ApplicationId", + column: x => x.ApplicationId, + principalTable: "OpenIddictApplications", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_OpenIddictTokens_OpenIddictAuthorizations_AuthorizationId", + column: x => x.AuthorizationId, + principalTable: "OpenIddictAuthorizations", + principalColumn: "Id"); + }); + + migrationBuilder.CreateIndex( + name: "IX_AbpAuditLogActions_AuditLogId", + table: "AbpAuditLogActions", + column: "AuditLogId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpAuditLogActions_TenantId_ServiceName_MethodName_Executio~", + table: "AbpAuditLogActions", + columns: new[] { "TenantId", "ServiceName", "MethodName", "ExecutionTime" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpAuditLogs_TenantId_ExecutionTime", + table: "AbpAuditLogs", + columns: new[] { "TenantId", "ExecutionTime" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpAuditLogs_TenantId_UserId_ExecutionTime", + table: "AbpAuditLogs", + columns: new[] { "TenantId", "UserId", "ExecutionTime" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpBackgroundJobs_IsAbandoned_NextTryTime", + table: "AbpBackgroundJobs", + columns: new[] { "IsAbandoned", "NextTryTime" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpEntityChanges_AuditLogId", + table: "AbpEntityChanges", + column: "AuditLogId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpEntityChanges_TenantId_EntityTypeFullName_EntityId", + table: "AbpEntityChanges", + columns: new[] { "TenantId", "EntityTypeFullName", "EntityId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpEntityPropertyChanges_EntityChangeId", + table: "AbpEntityPropertyChanges", + column: "EntityChangeId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatureGroups_Name", + table: "AbpFeatureGroups", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatures_GroupName", + table: "AbpFeatures", + column: "GroupName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatures_Name", + table: "AbpFeatures", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpFeatureValues_Name_ProviderName_ProviderKey", + table: "AbpFeatureValues", + columns: new[] { "Name", "ProviderName", "ProviderKey" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpLinkUsers_SourceUserId_SourceTenantId_TargetUserId_Targe~", + table: "AbpLinkUsers", + columns: new[] { "SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpOrganizationUnitRoles_RoleId_OrganizationUnitId", + table: "AbpOrganizationUnitRoles", + columns: new[] { "RoleId", "OrganizationUnitId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpOrganizationUnits_Code", + table: "AbpOrganizationUnits", + column: "Code"); + + migrationBuilder.CreateIndex( + name: "IX_AbpOrganizationUnits_ParentId", + table: "AbpOrganizationUnits", + column: "ParentId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissionGrants_TenantId_Name_ProviderName_ProviderKey", + table: "AbpPermissionGrants", + columns: new[] { "TenantId", "Name", "ProviderName", "ProviderKey" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissionGroups_Name", + table: "AbpPermissionGroups", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissions_GroupName", + table: "AbpPermissions", + column: "GroupName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpPermissions_Name", + table: "AbpPermissions", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpRoleClaims_RoleId", + table: "AbpRoleClaims", + column: "RoleId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpRoles_NormalizedName", + table: "AbpRoles", + column: "NormalizedName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpSecurityLogs_TenantId_Action", + table: "AbpSecurityLogs", + columns: new[] { "TenantId", "Action" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpSecurityLogs_TenantId_ApplicationName", + table: "AbpSecurityLogs", + columns: new[] { "TenantId", "ApplicationName" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpSecurityLogs_TenantId_Identity", + table: "AbpSecurityLogs", + columns: new[] { "TenantId", "Identity" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpSecurityLogs_TenantId_UserId", + table: "AbpSecurityLogs", + columns: new[] { "TenantId", "UserId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpSessions_Device", + table: "AbpSessions", + column: "Device"); + + migrationBuilder.CreateIndex( + name: "IX_AbpSessions_SessionId", + table: "AbpSessions", + column: "SessionId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpSessions_TenantId_UserId", + table: "AbpSessions", + columns: new[] { "TenantId", "UserId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpSettingDefinitions_Name", + table: "AbpSettingDefinitions", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpSettings_Name_ProviderName_ProviderKey", + table: "AbpSettings", + columns: new[] { "Name", "ProviderName", "ProviderKey" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AbpTenants_Name", + table: "AbpTenants", + column: "Name"); + + migrationBuilder.CreateIndex( + name: "IX_AbpTenants_NormalizedName", + table: "AbpTenants", + column: "NormalizedName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUserClaims_UserId", + table: "AbpUserClaims", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUserLogins_LoginProvider_ProviderKey", + table: "AbpUserLogins", + columns: new[] { "LoginProvider", "ProviderKey" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpUserOrganizationUnits_UserId_OrganizationUnitId", + table: "AbpUserOrganizationUnits", + columns: new[] { "UserId", "OrganizationUnitId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpUserRoles_RoleId_UserId", + table: "AbpUserRoles", + columns: new[] { "RoleId", "UserId" }); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_Email", + table: "AbpUsers", + column: "Email"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_NormalizedEmail", + table: "AbpUsers", + column: "NormalizedEmail"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_NormalizedUserName", + table: "AbpUsers", + column: "NormalizedUserName"); + + migrationBuilder.CreateIndex( + name: "IX_AbpUsers_UserName", + table: "AbpUsers", + column: "UserName"); + + migrationBuilder.CreateIndex( + name: "IX_OpenIddictApplications_ClientId", + table: "OpenIddictApplications", + column: "ClientId"); + + migrationBuilder.CreateIndex( + name: "IX_OpenIddictAuthorizations_ApplicationId_Status_Subject_Type", + table: "OpenIddictAuthorizations", + columns: new[] { "ApplicationId", "Status", "Subject", "Type" }); + + migrationBuilder.CreateIndex( + name: "IX_OpenIddictScopes_Name", + table: "OpenIddictScopes", + column: "Name"); + + migrationBuilder.CreateIndex( + name: "IX_OpenIddictTokens_ApplicationId_Status_Subject_Type", + table: "OpenIddictTokens", + columns: new[] { "ApplicationId", "Status", "Subject", "Type" }); + + migrationBuilder.CreateIndex( + name: "IX_OpenIddictTokens_AuthorizationId", + table: "OpenIddictTokens", + column: "AuthorizationId"); + + migrationBuilder.CreateIndex( + name: "IX_OpenIddictTokens_ReferenceId", + table: "OpenIddictTokens", + column: "ReferenceId"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AbpAuditLogActions"); + + migrationBuilder.DropTable( + name: "AbpBackgroundJobs"); + + migrationBuilder.DropTable( + name: "AbpClaimTypes"); + + migrationBuilder.DropTable( + name: "AbpEntityPropertyChanges"); + + migrationBuilder.DropTable( + name: "AbpFeatureGroups"); + + migrationBuilder.DropTable( + name: "AbpFeatures"); + + migrationBuilder.DropTable( + name: "AbpFeatureValues"); + + migrationBuilder.DropTable( + name: "AbpLinkUsers"); + + migrationBuilder.DropTable( + name: "AbpOrganizationUnitRoles"); + + migrationBuilder.DropTable( + name: "AbpPermissionGrants"); + + migrationBuilder.DropTable( + name: "AbpPermissionGroups"); + + migrationBuilder.DropTable( + name: "AbpPermissions"); + + migrationBuilder.DropTable( + name: "AbpRoleClaims"); + + migrationBuilder.DropTable( + name: "AbpSecurityLogs"); + + migrationBuilder.DropTable( + name: "AbpSessions"); + + migrationBuilder.DropTable( + name: "AbpSettingDefinitions"); + + migrationBuilder.DropTable( + name: "AbpSettings"); + + migrationBuilder.DropTable( + name: "AbpTenantConnectionStrings"); + + migrationBuilder.DropTable( + name: "AbpUserClaims"); + + migrationBuilder.DropTable( + name: "AbpUserDelegations"); + + migrationBuilder.DropTable( + name: "AbpUserLogins"); + + migrationBuilder.DropTable( + name: "AbpUserOrganizationUnits"); + + migrationBuilder.DropTable( + name: "AbpUserRoles"); + + migrationBuilder.DropTable( + name: "AbpUserTokens"); + + migrationBuilder.DropTable( + name: "OpenIddictScopes"); + + migrationBuilder.DropTable( + name: "OpenIddictTokens"); + + migrationBuilder.DropTable( + name: "AbpEntityChanges"); + + migrationBuilder.DropTable( + name: "AbpTenants"); + + migrationBuilder.DropTable( + name: "AbpOrganizationUnits"); + + migrationBuilder.DropTable( + name: "AbpRoles"); + + migrationBuilder.DropTable( + name: "AbpUsers"); + + migrationBuilder.DropTable( + name: "OpenIddictAuthorizations"); + + migrationBuilder.DropTable( + name: "AbpAuditLogs"); + + migrationBuilder.DropTable( + name: "OpenIddictApplications"); + } + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/Migrations/TenantManagementDbContextModelSnapshot.cs b/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/Migrations/TenantManagementDbContextModelSnapshot.cs new file mode 100644 index 0000000..767b42f --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/Migrations/TenantManagementDbContextModelSnapshot.cs @@ -0,0 +1,2003 @@ +// +using System; +using KonSoft.TenantManagement.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace KonSoft.TenantManagement.Migrations +{ + [DbContext(typeof(TenantManagementDbContext))] + partial class TenantManagementDbContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.PostgreSql) + .HasAnnotation("ProductVersion", "8.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("character varying(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("text"); + + b.Property("ExecutionDuration") + .HasColumnType("integer") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("timestamp without time zone"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("integer") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("uuid") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("uuid") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("uuid") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AuditLogId") + .HasColumnType("uuid") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("integer") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("character varying(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AuditLogId") + .HasColumnType("uuid") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("smallint") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("uuid"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("EntityChangeId") + .HasColumnType("uuid"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("character varying(1048576)"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("LastTryTime") + .HasColumnType("timestamp without time zone"); + + b.Property("NextTryTime") + .HasColumnType("timestamp without time zone"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("boolean"); + + b.Property("IsVisibleToClients") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("Required") + .HasColumnType("boolean"); + + b.Property("ValueType") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("SourceTenantId") + .HasColumnType("uuid"); + + b.Property("SourceUserId") + .HasColumnType("uuid"); + + b.Property("TargetTenantId") + .HasColumnType("uuid"); + + b.Property("TargetUserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("boolean") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("boolean") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("boolean") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("character varying(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("character varying(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("character varying(96)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySession", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Device") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("DeviceInfo") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("IpAddresses") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("LastAccessed") + .HasColumnType("timestamp without time zone"); + + b.Property("SessionId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("SignedIn") + .HasColumnType("timestamp without time zone"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("Device"); + + b.HasIndex("SessionId"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSessions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("boolean") + .HasColumnName("IsActive"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("LastPasswordChangeTime") + .HasColumnType("timestamp with time zone"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("character varying(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("SecurityStamp"); + + b.Property("ShouldChangePasswordOnNextLogin") + .HasColumnType("boolean"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("character varying(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserDelegation", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("EndTime") + .HasColumnType("timestamp without time zone"); + + b.Property("SourceUserId") + .HasColumnType("uuid"); + + b.Property("StartTime") + .HasColumnType("timestamp without time zone"); + + b.Property("TargetUserId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AbpUserDelegations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("character varying(196)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uuid"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("character varying(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)") + .HasColumnName("DisplayName"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("uuid"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uuid"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("ClientId") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("ClientSecret") + .HasColumnType("text"); + + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("ClientUri") + .HasColumnType("text"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .HasColumnType("text"); + + b.Property("DisplayNames") + .HasColumnType("text"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("JsonWebKeySet") + .HasColumnType("text"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasColumnType("text"); + + b.Property("Permissions") + .HasColumnType("text"); + + b.Property("PostLogoutRedirectUris") + .HasColumnType("text"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("RedirectUris") + .HasColumnType("text"); + + b.Property("Requirements") + .HasColumnType("text"); + + b.Property("Settings") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("OpenIddictApplications", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationId") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("timestamp without time zone"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("Scopes") + .HasColumnType("text"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("character varying(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictAuthorizations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Scopes.OpenIddictScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Descriptions") + .HasColumnType("text"); + + b.Property("DisplayName") + .HasColumnType("text"); + + b.Property("DisplayNames") + .HasColumnType("text"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("Resources") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("OpenIddictScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationId") + .HasColumnType("uuid"); + + b.Property("AuthorizationId") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("timestamp without time zone"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("ExpirationDate") + .HasColumnType("timestamp without time zone"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Payload") + .HasColumnType("text"); + + b.Property("Properties") + .HasColumnType("text"); + + b.Property("RedemptionDate") + .HasColumnType("timestamp without time zone"); + + b.Property("ReferenceId") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("character varying(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.HasKey("Id"); + + b.HasIndex("AuthorizationId"); + + b.HasIndex("ReferenceId"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("IsEnabled") + .HasColumnType("boolean"); + + b.Property("MultiTenancySide") + .HasColumnType("smallint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("TenantId") + .HasColumnType("uuid") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.SettingDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DefaultValue") + .HasMaxLength(2048) + .HasColumnType("character varying(2048)"); + + b.Property("Description") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExtraProperties") + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsEncrypted") + .HasColumnType("boolean"); + + b.Property("IsInherited") + .HasColumnType("boolean"); + + b.Property("IsVisibleToClients") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("Providers") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpSettingDefinitions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("character varying(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uuid") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uuid") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("DeletionTime"); + + b.Property("EntityVersion") + .HasColumnType("integer"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("text") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("timestamp without time zone") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uuid") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("uuid"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + + b.HasOne("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", null) + .WithMany() + .HasForeignKey("AuthorizationId"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/Properties/AssemblyInfo.cs b/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..135e6af --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/Properties/AssemblyInfo.cs @@ -0,0 +1,2 @@ +using System.Runtime.CompilerServices; +[assembly:InternalsVisibleToAttribute("KonSoft.TenantManagement.EntityFrameworkCore.Tests")] diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.HttpApi.Client/KonSoft.TenantManagement.HttpApi.Client.csproj b/modules/tenant-management/src/KonSoft.TenantManagement.HttpApi.Client/KonSoft.TenantManagement.HttpApi.Client.csproj new file mode 100644 index 0000000..f7ec709 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.HttpApi.Client/KonSoft.TenantManagement.HttpApi.Client.csproj @@ -0,0 +1,29 @@ + + + + + + net8.0 + enable + KonSoft.TenantManagement + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.HttpApi.Client/TenantManagementHttpApiClientModule.cs b/modules/tenant-management/src/KonSoft.TenantManagement.HttpApi.Client/TenantManagementHttpApiClientModule.cs new file mode 100644 index 0000000..ed63970 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.HttpApi.Client/TenantManagementHttpApiClientModule.cs @@ -0,0 +1,38 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Account; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; +using Volo.Abp.PermissionManagement; +using Volo.Abp.TenantManagement; +using Volo.Abp.SettingManagement; +using Volo.Abp.VirtualFileSystem; + +namespace KonSoft.TenantManagement; + +[DependsOn( + typeof(TenantManagementApplicationContractsModule), + typeof(AbpAccountHttpApiClientModule), + typeof(AbpIdentityHttpApiClientModule), + typeof(AbpPermissionManagementHttpApiClientModule), + typeof(AbpTenantManagementHttpApiClientModule), + typeof(AbpFeatureManagementHttpApiClientModule), + typeof(AbpSettingManagementHttpApiClientModule) +)] +public class TenantManagementHttpApiClientModule : AbpModule +{ + public const string RemoteServiceName = "Default"; + + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddHttpClientProxies( + typeof(TenantManagementApplicationContractsModule).Assembly, + RemoteServiceName + ); + + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.HttpApi/Controllers/TenantManagementController.cs b/modules/tenant-management/src/KonSoft.TenantManagement.HttpApi/Controllers/TenantManagementController.cs new file mode 100644 index 0000000..e4b323b --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.HttpApi/Controllers/TenantManagementController.cs @@ -0,0 +1,14 @@ +using KonSoft.TenantManagement.Localization; +using Volo.Abp.AspNetCore.Mvc; + +namespace KonSoft.TenantManagement.Controllers; + +/* Inherit your controllers from this class. + */ +public abstract class TenantManagementController : AbpControllerBase +{ + protected TenantManagementController() + { + LocalizationResource = typeof(TenantManagementResource); + } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.HttpApi/KonSoft.TenantManagement.HttpApi.csproj b/modules/tenant-management/src/KonSoft.TenantManagement.HttpApi/KonSoft.TenantManagement.HttpApi.csproj new file mode 100644 index 0000000..f81b1e6 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.HttpApi/KonSoft.TenantManagement.HttpApi.csproj @@ -0,0 +1,24 @@ + + + + + + net8.0 + enable + KonSoft.TenantManagement + + + + + + + + + + + + + + + + diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.HttpApi/Models/Test/TestModel.cs b/modules/tenant-management/src/KonSoft.TenantManagement.HttpApi/Models/Test/TestModel.cs new file mode 100644 index 0000000..e790d7b --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.HttpApi/Models/Test/TestModel.cs @@ -0,0 +1,10 @@ +using System; + +namespace KonSoft.TenantManagement.Models.Test; + +public class TestModel +{ + public string? Name { get; set; } + + public DateTime BirthDate { get; set; } +} diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.HttpApi/TenantManagementHttpApiModule.cs b/modules/tenant-management/src/KonSoft.TenantManagement.HttpApi/TenantManagementHttpApiModule.cs new file mode 100644 index 0000000..3e5bea8 --- /dev/null +++ b/modules/tenant-management/src/KonSoft.TenantManagement.HttpApi/TenantManagementHttpApiModule.cs @@ -0,0 +1,41 @@ +using Localization.Resources.AbpUi; +using KonSoft.TenantManagement.Localization; +using Volo.Abp.Account; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Identity; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Volo.Abp.PermissionManagement.HttpApi; +using Volo.Abp.SettingManagement; +using Volo.Abp.TenantManagement; + +namespace KonSoft.TenantManagement; + +[DependsOn( + typeof(TenantManagementApplicationContractsModule), + typeof(AbpAccountHttpApiModule), + typeof(AbpIdentityHttpApiModule), + typeof(AbpPermissionManagementHttpApiModule), + typeof(AbpTenantManagementHttpApiModule), + typeof(AbpFeatureManagementHttpApiModule), + typeof(AbpSettingManagementHttpApiModule) + )] +public class TenantManagementHttpApiModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + ConfigureLocalization(); + } + + private void ConfigureLocalization() + { + Configure(options => + { + options.Resources + .Get() + .AddBaseTypes( + typeof(AbpUiResource) + ); + }); + } +} diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.Application.Tests/KonSoft.TenantManagement.Application.Tests.csproj b/modules/tenant-management/test/KonSoft.TenantManagement.Application.Tests/KonSoft.TenantManagement.Application.Tests.csproj new file mode 100644 index 0000000..9e3bdd2 --- /dev/null +++ b/modules/tenant-management/test/KonSoft.TenantManagement.Application.Tests/KonSoft.TenantManagement.Application.Tests.csproj @@ -0,0 +1,20 @@ + + + + + + net8.0 + enable + KonSoft.TenantManagement + + + + + + + + + + + + diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.Application.Tests/Samples/SampleAppServiceTests.cs b/modules/tenant-management/test/KonSoft.TenantManagement.Application.Tests/Samples/SampleAppServiceTests.cs new file mode 100644 index 0000000..a0ce7da --- /dev/null +++ b/modules/tenant-management/test/KonSoft.TenantManagement.Application.Tests/Samples/SampleAppServiceTests.cs @@ -0,0 +1,34 @@ +using Shouldly; +using System.Threading.Tasks; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; +using Xunit; + +namespace KonSoft.TenantManagement.Samples; + +/* This is just an example test class. + * Normally, you don't test code of the modules you are using + * (like IIdentityUserAppService here). + * Only test your own application services. + */ +public abstract class SampleAppServiceTests : TenantManagementApplicationTestBase + where TStartupModule : IAbpModule +{ + private readonly IIdentityUserAppService _userAppService; + + protected SampleAppServiceTests() + { + _userAppService = GetRequiredService(); + } + + [Fact] + public async Task Initial_Data_Should_Contain_Admin_User() + { + //Act + var result = await _userAppService.GetListAsync(new GetIdentityUsersInput()); + + //Assert + result.TotalCount.ShouldBeGreaterThan(0); + result.Items.ShouldContain(u => u.UserName == "admin"); + } +} diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.Application.Tests/TenantManagementApplicationTestBase.cs b/modules/tenant-management/test/KonSoft.TenantManagement.Application.Tests/TenantManagementApplicationTestBase.cs new file mode 100644 index 0000000..e6b0448 --- /dev/null +++ b/modules/tenant-management/test/KonSoft.TenantManagement.Application.Tests/TenantManagementApplicationTestBase.cs @@ -0,0 +1,9 @@ +using Volo.Abp.Modularity; + +namespace KonSoft.TenantManagement; + +public abstract class TenantManagementApplicationTestBase : TenantManagementTestBase + where TStartupModule : IAbpModule +{ + +} diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.Application.Tests/TenantManagementApplicationTestModule.cs b/modules/tenant-management/test/KonSoft.TenantManagement.Application.Tests/TenantManagementApplicationTestModule.cs new file mode 100644 index 0000000..b57a624 --- /dev/null +++ b/modules/tenant-management/test/KonSoft.TenantManagement.Application.Tests/TenantManagementApplicationTestModule.cs @@ -0,0 +1,12 @@ +using Volo.Abp.Modularity; + +namespace KonSoft.TenantManagement; + +[DependsOn( + typeof(TenantManagementApplicationModule), + typeof(TenantManagementDomainTestModule) +)] +public class TenantManagementApplicationTestModule : AbpModule +{ + +} diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.Domain.Tests/KonSoft.TenantManagement.Domain.Tests.csproj b/modules/tenant-management/test/KonSoft.TenantManagement.Domain.Tests/KonSoft.TenantManagement.Domain.Tests.csproj new file mode 100644 index 0000000..16c92b5 --- /dev/null +++ b/modules/tenant-management/test/KonSoft.TenantManagement.Domain.Tests/KonSoft.TenantManagement.Domain.Tests.csproj @@ -0,0 +1,20 @@ + + + + + + net8.0 + enable + KonSoft.TenantManagement + + + + + + + + + + + + diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.Domain.Tests/Samples/SampleDomainTests.cs b/modules/tenant-management/test/KonSoft.TenantManagement.Domain.Tests/Samples/SampleDomainTests.cs new file mode 100644 index 0000000..c7a2b7b --- /dev/null +++ b/modules/tenant-management/test/KonSoft.TenantManagement.Domain.Tests/Samples/SampleDomainTests.cs @@ -0,0 +1,46 @@ +using System.Threading.Tasks; +using Shouldly; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; +using Xunit; + +namespace KonSoft.TenantManagement.Samples; + +/* This is just an example test class. + * Normally, you don't test code of the modules you are using + * (like IdentityUserManager here). + * Only test your own domain services. + */ +public abstract class SampleDomainTests : TenantManagementDomainTestBase + where TStartupModule : IAbpModule +{ + private readonly IIdentityUserRepository _identityUserRepository; + private readonly IdentityUserManager _identityUserManager; + + protected SampleDomainTests() + { + _identityUserRepository = GetRequiredService(); + _identityUserManager = GetRequiredService(); + } + + [Fact] + public async Task Should_Set_Email_Of_A_User() + { + IdentityUser adminUser; + + /* Need to manually start Unit Of Work because + * FirstOrDefaultAsync should be executed while db connection / context is available. + */ + await WithUnitOfWorkAsync(async () => + { + adminUser = await _identityUserRepository + .FindByNormalizedUserNameAsync("ADMIN"); + + await _identityUserManager.SetEmailAsync(adminUser, "newemail@abp.io"); + await _identityUserRepository.UpdateAsync(adminUser); + }); + + adminUser = await _identityUserRepository.FindByNormalizedUserNameAsync("ADMIN"); + adminUser.Email.ShouldBe("newemail@abp.io"); + } +} diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.Domain.Tests/TenantManagementDomainTestBase.cs b/modules/tenant-management/test/KonSoft.TenantManagement.Domain.Tests/TenantManagementDomainTestBase.cs new file mode 100644 index 0000000..c73497f --- /dev/null +++ b/modules/tenant-management/test/KonSoft.TenantManagement.Domain.Tests/TenantManagementDomainTestBase.cs @@ -0,0 +1,10 @@ +using Volo.Abp.Modularity; + +namespace KonSoft.TenantManagement; + +/* Inherit from this class for your domain layer tests. */ +public abstract class TenantManagementDomainTestBase : TenantManagementTestBase + where TStartupModule : IAbpModule +{ + +} diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.Domain.Tests/TenantManagementDomainTestModule.cs b/modules/tenant-management/test/KonSoft.TenantManagement.Domain.Tests/TenantManagementDomainTestModule.cs new file mode 100644 index 0000000..6847984 --- /dev/null +++ b/modules/tenant-management/test/KonSoft.TenantManagement.Domain.Tests/TenantManagementDomainTestModule.cs @@ -0,0 +1,12 @@ +using Volo.Abp.Modularity; + +namespace KonSoft.TenantManagement; + +[DependsOn( + typeof(TenantManagementDomainModule), + typeof(TenantManagementTestBaseModule) +)] +public class TenantManagementDomainTestModule : AbpModule +{ + +} diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/Applications/EfCoreSampleAppServiceTests.cs b/modules/tenant-management/test/KonSoft.TenantManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/Applications/EfCoreSampleAppServiceTests.cs new file mode 100644 index 0000000..a6e4e59 --- /dev/null +++ b/modules/tenant-management/test/KonSoft.TenantManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/Applications/EfCoreSampleAppServiceTests.cs @@ -0,0 +1,10 @@ +using KonSoft.TenantManagement.Samples; +using Xunit; + +namespace KonSoft.TenantManagement.EntityFrameworkCore.Applications; + +[Collection(TenantManagementTestConsts.CollectionDefinitionName)] +public class EfCoreSampleAppServiceTests : SampleAppServiceTests +{ + +} diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/Domains/EfCoreSampleDomainTests.cs b/modules/tenant-management/test/KonSoft.TenantManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/Domains/EfCoreSampleDomainTests.cs new file mode 100644 index 0000000..9fddfdc --- /dev/null +++ b/modules/tenant-management/test/KonSoft.TenantManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/Domains/EfCoreSampleDomainTests.cs @@ -0,0 +1,10 @@ +using KonSoft.TenantManagement.Samples; +using Xunit; + +namespace KonSoft.TenantManagement.EntityFrameworkCore.Domains; + +[Collection(TenantManagementTestConsts.CollectionDefinitionName)] +public class EfCoreSampleDomainTests : SampleDomainTests +{ + +} diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepositoryTests.cs b/modules/tenant-management/test/KonSoft.TenantManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepositoryTests.cs new file mode 100644 index 0000000..239ff03 --- /dev/null +++ b/modules/tenant-management/test/KonSoft.TenantManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepositoryTests.cs @@ -0,0 +1,44 @@ +using Microsoft.EntityFrameworkCore; +using Shouldly; +using System; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp.Domain.Repositories; +using Volo.Abp.Identity; +using Xunit; + +namespace KonSoft.TenantManagement.EntityFrameworkCore.Samples; + +/* This is just an example test class. + * Normally, you don't test ABP framework code + * (like default AppUser repository IRepository here). + * Only test your custom repository methods. + */ +[Collection(TenantManagementTestConsts.CollectionDefinitionName)] +public class SampleRepositoryTests : TenantManagementEntityFrameworkCoreTestBase +{ + private readonly IRepository _appUserRepository; + + public SampleRepositoryTests() + { + _appUserRepository = GetRequiredService>(); + } + + [Fact] + public async Task Should_Query_AppUser() + { + /* Need to manually start Unit Of Work because + * FirstOrDefaultAsync should be executed while db connection / context is available. + */ + await WithUnitOfWorkAsync(async () => + { + //Act + var adminUser = await (await _appUserRepository.GetQueryableAsync()) + .Where(u => u.UserName == "admin") + .FirstOrDefaultAsync(); + + //Assert + adminUser.ShouldNotBeNull(); + }); + } +} diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/TenantManagementEntityFrameworkCoreCollection.cs b/modules/tenant-management/test/KonSoft.TenantManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/TenantManagementEntityFrameworkCoreCollection.cs new file mode 100644 index 0000000..060cb03 --- /dev/null +++ b/modules/tenant-management/test/KonSoft.TenantManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/TenantManagementEntityFrameworkCoreCollection.cs @@ -0,0 +1,9 @@ +using Xunit; + +namespace KonSoft.TenantManagement.EntityFrameworkCore; + +[CollectionDefinition(TenantManagementTestConsts.CollectionDefinitionName)] +public class TenantManagementEntityFrameworkCoreCollection : ICollectionFixture +{ + +} diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/TenantManagementEntityFrameworkCoreCollectionFixtureBase.cs b/modules/tenant-management/test/KonSoft.TenantManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/TenantManagementEntityFrameworkCoreCollectionFixtureBase.cs new file mode 100644 index 0000000..850ce94 --- /dev/null +++ b/modules/tenant-management/test/KonSoft.TenantManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/TenantManagementEntityFrameworkCoreCollectionFixtureBase.cs @@ -0,0 +1,9 @@ +using KonSoft.TenantManagement.EntityFrameworkCore; +using Xunit; + +namespace KonSoft.TenantManagement.EntityFrameworkCore; + +public class TenantManagementEntityFrameworkCoreCollectionFixtureBase : ICollectionFixture +{ + +} diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/TenantManagementEntityFrameworkCoreFixture.cs b/modules/tenant-management/test/KonSoft.TenantManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/TenantManagementEntityFrameworkCoreFixture.cs new file mode 100644 index 0000000..f4b25a7 --- /dev/null +++ b/modules/tenant-management/test/KonSoft.TenantManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/TenantManagementEntityFrameworkCoreFixture.cs @@ -0,0 +1,11 @@ +using System; + +namespace KonSoft.TenantManagement.EntityFrameworkCore; + +public class TenantManagementEntityFrameworkCoreFixture : IDisposable +{ + public void Dispose() + { + + } +} diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/TenantManagementEntityFrameworkCoreTestBase.cs b/modules/tenant-management/test/KonSoft.TenantManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/TenantManagementEntityFrameworkCoreTestBase.cs new file mode 100644 index 0000000..89a75dd --- /dev/null +++ b/modules/tenant-management/test/KonSoft.TenantManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/TenantManagementEntityFrameworkCoreTestBase.cs @@ -0,0 +1,8 @@ +using Volo.Abp; + +namespace KonSoft.TenantManagement.EntityFrameworkCore; + +public abstract class TenantManagementEntityFrameworkCoreTestBase : TenantManagementTestBase +{ + +} diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/TenantManagementEntityFrameworkCoreTestModule.cs b/modules/tenant-management/test/KonSoft.TenantManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/TenantManagementEntityFrameworkCoreTestModule.cs new file mode 100644 index 0000000..9a4e308 --- /dev/null +++ b/modules/tenant-management/test/KonSoft.TenantManagement.EntityFrameworkCore.Tests/EntityFrameworkCore/TenantManagementEntityFrameworkCoreTestModule.cs @@ -0,0 +1,82 @@ +using Microsoft.Data.Sqlite; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.Sqlite; +using Volo.Abp.FeatureManagement; +using Volo.Abp.Modularity; +using Volo.Abp.PermissionManagement; +using Volo.Abp.SettingManagement; +using Volo.Abp.Uow; + +namespace KonSoft.TenantManagement.EntityFrameworkCore; + +[DependsOn( + typeof(TenantManagementApplicationTestModule), + typeof(TenantManagementEntityFrameworkCoreModule), + typeof(AbpEntityFrameworkCoreSqliteModule) + )] +public class TenantManagementEntityFrameworkCoreTestModule : AbpModule +{ + private SqliteConnection? _sqliteConnection; + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.SaveStaticFeaturesToDatabase = false; + options.IsDynamicFeatureStoreEnabled = false; + }); + Configure(options => + { + options.SaveStaticPermissionsToDatabase = false; + options.IsDynamicPermissionStoreEnabled = false; + }); + Configure(options => + { + options.SaveStaticSettingsToDatabase = false; + options.IsDynamicSettingStoreEnabled = false; + }); + context.Services.AddAlwaysDisableUnitOfWorkTransaction(); + + ConfigureInMemorySqlite(context.Services); + } + + private void ConfigureInMemorySqlite(IServiceCollection services) + { + _sqliteConnection = CreateDatabaseAndGetConnection(); + + services.Configure(options => + { + options.Configure(context => + { + context.DbContextOptions.UseSqlite(_sqliteConnection); + }); + }); + } + + public override void OnApplicationShutdown(ApplicationShutdownContext context) + { + _sqliteConnection?.Dispose(); + } + + private static SqliteConnection CreateDatabaseAndGetConnection() + { + var connection = new AbpUnitTestSqliteConnection("Data Source=:memory:"); + connection.Open(); + + var options = new DbContextOptionsBuilder() + .UseSqlite(connection) + .Options; + + using (var context = new TenantManagementDbContext(options)) + { + context.GetService().CreateTables(); + } + + return connection; + } +} diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.EntityFrameworkCore.Tests/KonSoft.TenantManagement.EntityFrameworkCore.Tests.csproj b/modules/tenant-management/test/KonSoft.TenantManagement.EntityFrameworkCore.Tests/KonSoft.TenantManagement.EntityFrameworkCore.Tests.csproj new file mode 100644 index 0000000..f77824c --- /dev/null +++ b/modules/tenant-management/test/KonSoft.TenantManagement.EntityFrameworkCore.Tests/KonSoft.TenantManagement.EntityFrameworkCore.Tests.csproj @@ -0,0 +1,21 @@ + + + + + + net8.0 + enable + KonSoft.TenantManagement + + + + + + + + + + + + + diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs b/modules/tenant-management/test/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs new file mode 100644 index 0000000..a388b25 --- /dev/null +++ b/modules/tenant-management/test/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs @@ -0,0 +1,25 @@ +using System; +using System.Threading.Tasks; +using Volo.Abp.Account; +using Volo.Abp.DependencyInjection; + +namespace KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp; + +public class ClientDemoService : ITransientDependency +{ + private readonly IProfileAppService _profileAppService; + + public ClientDemoService(IProfileAppService profileAppService) + { + _profileAppService = profileAppService; + } + + public async Task RunAsync() + { + var output = await _profileAppService.GetAsync(); + Console.WriteLine($"UserName : {output.UserName}"); + Console.WriteLine($"Email : {output.Email}"); + Console.WriteLine($"Name : {output.Name}"); + Console.WriteLine($"Surname : {output.Surname}"); + } +} diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs b/modules/tenant-management/test/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs new file mode 100644 index 0000000..9c4f85a --- /dev/null +++ b/modules/tenant-management/test/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs @@ -0,0 +1,40 @@ +using Microsoft.Extensions.Hosting; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; + +namespace KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp; + +public class ConsoleTestAppHostedService : IHostedService +{ + private readonly IConfiguration _configuration; + + public ConsoleTestAppHostedService(IConfiguration configuration) + { + _configuration = configuration; + } + + public async Task StartAsync(CancellationToken cancellationToken) + { + using (var application = await AbpApplicationFactory.CreateAsync(options => + { + options.Services.ReplaceConfiguration(_configuration); + options.UseAutofac(); + })) + { + await application.InitializeAsync(); + + var demo = application.ServiceProvider.GetRequiredService(); + await demo.RunAsync(); + + await application.ShutdownAsync(); + } + } + + public Task StopAsync(CancellationToken cancellationToken) + { + return Task.CompletedTask; + } +} diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp.csproj b/modules/tenant-management/test/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp.csproj new file mode 100644 index 0000000..b2b2c45 --- /dev/null +++ b/modules/tenant-management/test/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp.csproj @@ -0,0 +1,33 @@ + + + + Exe + net8.0 + enable + + + + + + PreserveNewest + Always + + + + PreserveNewest + Always + + + + + + + + + + + + + + + diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp/Program.cs b/modules/tenant-management/test/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp/Program.cs new file mode 100644 index 0000000..d836b73 --- /dev/null +++ b/modules/tenant-management/test/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp/Program.cs @@ -0,0 +1,22 @@ +using System.Threading.Tasks; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +namespace KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp; + +class Program +{ + static async Task Main(string[] args) + { + await CreateHostBuilder(args).RunConsoleAsync(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .AddAppSettingsSecretsJson() + .ConfigureServices((hostContext, services) => + { + services.AddHostedService(); + }); +} diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp/TenantManagementConsoleApiClientModule.cs b/modules/tenant-management/test/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp/TenantManagementConsoleApiClientModule.cs new file mode 100644 index 0000000..a265cfd --- /dev/null +++ b/modules/tenant-management/test/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp/TenantManagementConsoleApiClientModule.cs @@ -0,0 +1,30 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Polly; +using Volo.Abp.Autofac; +using Volo.Abp.Http.Client; +using Volo.Abp.Http.Client.IdentityModel; +using Volo.Abp.Modularity; + +namespace KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp; + +[DependsOn( + typeof(AbpAutofacModule), + typeof(TenantManagementHttpApiClientModule), + typeof(AbpHttpClientIdentityModelModule) + )] +public class TenantManagementConsoleApiClientModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PreConfigure(options => + { + options.ProxyClientBuildActions.Add((remoteServiceName, clientBuilder) => + { + clientBuilder.AddTransientHttpErrorPolicy( + policyBuilder => policyBuilder.WaitAndRetryAsync(3, i => TimeSpan.FromSeconds(Math.Pow(2, i))) + ); + }); + }); + } +} diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp/appsettings.json b/modules/tenant-management/test/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp/appsettings.json new file mode 100644 index 0000000..7073b87 --- /dev/null +++ b/modules/tenant-management/test/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp/appsettings.json @@ -0,0 +1,17 @@ +{ + "RemoteServices": { + "Default": { + "BaseUrl": "https://localhost:44316" + } + }, + "IdentityClients": { + "Default": { + "GrantType": "password", + "ClientId": "TenantManagement_App", + "UserName": "admin", + "UserPassword": "1q2w3E*", + "Authority": "https://localhost:44316", + "Scope": "TenantManagement" + } + } +} diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json b/modules/tenant-management/test/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json new file mode 100644 index 0000000..7a73a41 --- /dev/null +++ b/modules/tenant-management/test/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.TestBase/KonSoft.TenantManagement.TestBase.csproj b/modules/tenant-management/test/KonSoft.TenantManagement.TestBase/KonSoft.TenantManagement.TestBase.csproj new file mode 100644 index 0000000..d7742e1 --- /dev/null +++ b/modules/tenant-management/test/KonSoft.TenantManagement.TestBase/KonSoft.TenantManagement.TestBase.csproj @@ -0,0 +1,31 @@ + + + + + + net8.0 + enable + KonSoft.TenantManagement + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers + + + + + + + + diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.TestBase/Security/FakeCurrentPrincipalAccessor.cs b/modules/tenant-management/test/KonSoft.TenantManagement.TestBase/Security/FakeCurrentPrincipalAccessor.cs new file mode 100644 index 0000000..e08ed88 --- /dev/null +++ b/modules/tenant-management/test/KonSoft.TenantManagement.TestBase/Security/FakeCurrentPrincipalAccessor.cs @@ -0,0 +1,25 @@ +using System.Collections.Generic; +using System.Security.Claims; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Security.Claims; + +namespace KonSoft.TenantManagement.Security; + +[Dependency(ReplaceServices = true)] +public class FakeCurrentPrincipalAccessor : ThreadCurrentPrincipalAccessor +{ + protected override ClaimsPrincipal GetClaimsPrincipal() + { + return GetPrincipal(); + } + + private ClaimsPrincipal GetPrincipal() + { + return new ClaimsPrincipal(new ClaimsIdentity(new List + { + new Claim(AbpClaimTypes.UserId, "2e701e62-0953-4dd3-910b-dc6cc93ccb0d"), + new Claim(AbpClaimTypes.UserName, "admin"), + new Claim(AbpClaimTypes.Email, "admin@abp.io") + })); + } +} diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.TestBase/TenantManagementTestBase.cs b/modules/tenant-management/test/KonSoft.TenantManagement.TestBase/TenantManagementTestBase.cs new file mode 100644 index 0000000..b5e1fbe --- /dev/null +++ b/modules/tenant-management/test/KonSoft.TenantManagement.TestBase/TenantManagementTestBase.cs @@ -0,0 +1,60 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.Modularity; +using Volo.Abp.Uow; +using Volo.Abp.Testing; + +namespace KonSoft.TenantManagement; + +/* All test classes are derived from this class, directly or indirectly. + */ +public abstract class TenantManagementTestBase : AbpIntegratedTest + where TStartupModule : IAbpModule +{ + protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options) + { + options.UseAutofac(); + } + + protected virtual Task WithUnitOfWorkAsync(Func func) + { + return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); + } + + protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func action) + { + using (var scope = ServiceProvider.CreateScope()) + { + var uowManager = scope.ServiceProvider.GetRequiredService(); + + using (var uow = uowManager.Begin(options)) + { + await action(); + + await uow.CompleteAsync(); + } + } + } + + protected virtual Task WithUnitOfWorkAsync(Func> func) + { + return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); + } + + protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func> func) + { + using (var scope = ServiceProvider.CreateScope()) + { + var uowManager = scope.ServiceProvider.GetRequiredService(); + + using (var uow = uowManager.Begin(options)) + { + var result = await func(); + await uow.CompleteAsync(); + return result; + } + } + } +} diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.TestBase/TenantManagementTestBaseModule.cs b/modules/tenant-management/test/KonSoft.TenantManagement.TestBase/TenantManagementTestBaseModule.cs new file mode 100644 index 0000000..2ed6282 --- /dev/null +++ b/modules/tenant-management/test/KonSoft.TenantManagement.TestBase/TenantManagementTestBaseModule.cs @@ -0,0 +1,47 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.Authorization; +using Volo.Abp.Autofac; +using Volo.Abp.BackgroundJobs; +using Volo.Abp.Data; +using Volo.Abp.Modularity; +using Volo.Abp.Threading; + +namespace KonSoft.TenantManagement; + +[DependsOn( + typeof(AbpAutofacModule), + typeof(AbpTestBaseModule), + typeof(AbpAuthorizationModule), + typeof(AbpBackgroundJobsAbstractionsModule) + )] +public class TenantManagementTestBaseModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.IsJobExecutionEnabled = false; + }); + + context.Services.AddAlwaysAllowAuthorization(); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + SeedTestData(context); + } + + private static void SeedTestData(ApplicationInitializationContext context) + { + AsyncHelper.RunSync(async () => + { + using (var scope = context.ServiceProvider.CreateScope()) + { + await scope.ServiceProvider + .GetRequiredService() + .SeedAsync(); + } + }); + } +} diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.TestBase/TenantManagementTestConsts.cs b/modules/tenant-management/test/KonSoft.TenantManagement.TestBase/TenantManagementTestConsts.cs new file mode 100644 index 0000000..fbb37d2 --- /dev/null +++ b/modules/tenant-management/test/KonSoft.TenantManagement.TestBase/TenantManagementTestConsts.cs @@ -0,0 +1,6 @@ +namespace KonSoft.TenantManagement; + +public static class TenantManagementTestConsts +{ + public const string CollectionDefinitionName = "TenantManagement collection"; +} diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.TestBase/TenantManagementTestDataSeedContributor.cs b/modules/tenant-management/test/KonSoft.TenantManagement.TestBase/TenantManagementTestDataSeedContributor.cs new file mode 100644 index 0000000..ffc9d62 --- /dev/null +++ b/modules/tenant-management/test/KonSoft.TenantManagement.TestBase/TenantManagementTestDataSeedContributor.cs @@ -0,0 +1,15 @@ +using System.Threading.Tasks; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; + +namespace KonSoft.TenantManagement; + +public class TenantManagementTestDataSeedContributor : IDataSeedContributor, ITransientDependency +{ + public Task SeedAsync(DataSeedContext context) + { + /* Seed additional test data... */ + + return Task.CompletedTask; + } +} diff --git a/shared/KonSoft.Shared/Class1.cs b/shared/KonSoft.Shared/Class1.cs new file mode 100644 index 0000000..3a4e8b4 --- /dev/null +++ b/shared/KonSoft.Shared/Class1.cs @@ -0,0 +1,7 @@ +namespace KonSoft.Shared +{ + public class Class1 + { + + } +} diff --git a/shared/KonSoft.Shared/KonSoft.Shared.csproj b/shared/KonSoft.Shared/KonSoft.Shared.csproj new file mode 100644 index 0000000..fa71b7a --- /dev/null +++ b/shared/KonSoft.Shared/KonSoft.Shared.csproj @@ -0,0 +1,9 @@ + + + + net8.0 + enable + enable + + +