generator-codedesignplus 0.5.0 → 0.6.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/generators/microservice/core/appsettings.mjs +46 -21
- package/generators/microservice/core/grpc.mjs +0 -2
- package/generators/microservice/core/utils.mjs +2 -0
- package/generators/microservice/templates/microservice/.dockerignore +30 -0
- package/generators/microservice/templates/microservice/.github/workflows/ca.yaml +51 -0
- package/generators/microservice/templates/microservice/.github/workflows/ci.yaml +33 -0
- package/generators/microservice/templates/microservice/CodeDesignPlus.Net.Microservice.sln +0 -10
- package/generators/microservice/templates/microservice/charts/ms-archetype-grpc/Chart.yaml +1 -1
- package/generators/microservice/templates/microservice/charts/ms-archetype-grpc/Production.yaml +9 -1
- package/generators/microservice/templates/microservice/charts/ms-archetype-grpc/Staging.yaml +9 -1
- package/generators/microservice/templates/microservice/charts/ms-archetype-rest/Chart.yaml +1 -1
- package/generators/microservice/templates/microservice/charts/ms-archetype-rest/Production.yaml +7 -3
- package/generators/microservice/templates/microservice/charts/ms-archetype-rest/Staging.yaml +7 -3
- package/generators/microservice/templates/microservice/charts/ms-archetype-worker/Chart.yaml +1 -1
- package/generators/microservice/templates/microservice/charts/ms-archetype-worker/Production.yaml +5 -1
- package/generators/microservice/templates/microservice/charts/ms-archetype-worker/Staging.yaml +5 -1
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Application/CodeDesignPlus.Net.Microservice.Application.csproj +4 -4
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Application/Errors.cs +2 -4
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Application/Setup/MapsterConfig.cs +0 -1
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/CodeDesignPlus.Net.Microservice.Domain.csproj +2 -2
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/ValueObjects/AddressValueObject.cs +11 -6
- package/generators/microservice/templates/microservice/src/domain/CodeDesignPlus.Net.Microservice.Domain/ValueObjects/ClientValueObject.cs +10 -7
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.AsyncWorker/CodeDesignPlus.Net.Microservice.AsyncWorker.csproj +8 -8
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.AsyncWorker/Program.cs +6 -0
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.AsyncWorker/appsettings.json +2 -3
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.Rest/CodeDesignPlus.Net.Microservice.Rest.csproj +9 -8
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.Rest/Program.cs +11 -4
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.Rest/appsettings.Development.json +3 -0
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.Rest/appsettings.Docker.json +23 -21
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.Rest/appsettings.json +3 -3
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.gRpc/CodeDesignPlus.Net.Microservice.gRpc.csproj +10 -10
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.gRpc/Program.cs +4 -0
- package/generators/microservice/templates/microservice/src/entrypoints/CodeDesignPlus.Net.Microservice.gRpc/appsettings.json +1 -2
- package/generators/microservice/templates/microservice/tests/integration/CodeDesignPlus.Net.Microservice.AsyncWorker.Test/CodeDesignPlus.Net.Microservice.AsyncWorker.Test.csproj +1 -1
- package/generators/microservice/templates/microservice/tests/integration/CodeDesignPlus.Net.Microservice.Rest.Test/CodeDesignPlus.Net.Microservice.Rest.Test.csproj +1 -1
- package/generators/microservice/templates/microservice/tests/integration/CodeDesignPlus.Net.Microservice.gRpc.Test/CodeDesignPlus.Net.Microservice.gRpc.Test.csproj +2 -2
- package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.AsyncWorker.Test/CodeDesignPlus.Net.Microservice.AsyncWorker.Test.csproj +1 -1
- package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Default.Test/CodeDesignPlus.Net.Microservice.Default.Test.csproj +2 -2
- package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.Rest.Test/CodeDesignPlus.Net.Microservice.Rest.Test.csproj +1 -1
- package/generators/microservice/templates/microservice/tests/unit/CodeDesignPlus.Net.Microservice.gRpc.Test/CodeDesignPlus.Net.Microservice.gRpc.Test.csproj +1 -1
- package/generators/microservice/templates/value-object/ItemValueObject.cs +2 -2
- package/package.json +1 -1
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { randomUUID } from 'crypto';
|
|
2
|
+
import { glob } from 'glob';
|
|
1
3
|
import path from 'path';
|
|
2
4
|
|
|
3
5
|
export default class AppSettingsGenerator {
|
|
@@ -10,42 +12,65 @@ export default class AppSettingsGenerator {
|
|
|
10
12
|
|
|
11
13
|
async generate(options, sources = []) {
|
|
12
14
|
|
|
13
|
-
if(sources.length === 0) {
|
|
15
|
+
if (sources.length === 0) {
|
|
14
16
|
sources = [
|
|
15
|
-
options.paths.src.rest
|
|
16
|
-
options.paths.src.grpc,
|
|
17
|
-
options.paths.src.asyncWorker
|
|
17
|
+
options.paths.src.rest
|
|
18
18
|
];
|
|
19
|
+
|
|
20
|
+
if (options.enableGrpc)
|
|
21
|
+
sources.push(options.paths.src.grpc);
|
|
22
|
+
|
|
23
|
+
if (options.enableAsyncWorker)
|
|
24
|
+
sources.push(options.paths.src.asyncWorker);
|
|
19
25
|
}
|
|
20
26
|
|
|
21
27
|
const destination = this._generator.destinationPath();
|
|
22
28
|
|
|
23
29
|
sources.forEach(source => {
|
|
24
30
|
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
const files = glob.sync('appsettings.*', { dot: true, nodir: true, cwd: path.join(destination, source) });
|
|
32
|
+
|
|
33
|
+
files.forEach(file => {
|
|
34
|
+
|
|
35
|
+
const appSettingsFile = path.join(destination, source, file);
|
|
36
|
+
|
|
37
|
+
const json = this._generator.fs.readJSON(appSettingsFile, {});
|
|
38
|
+
|
|
39
|
+
if (json.Core) {
|
|
40
|
+
if (json.Core.Id)
|
|
41
|
+
json.Core.Id = randomUUID().toString();
|
|
42
|
+
if (json.Core.AppName)
|
|
43
|
+
json.Core.AppName = options.appSettings.appName;
|
|
44
|
+
if (json.Core.Description)
|
|
45
|
+
json.Core.Description = options.appSettings.description;
|
|
46
|
+
if (json.Core.Business)
|
|
47
|
+
json.Core.Business = options.appSettings.business;
|
|
48
|
+
if (json.Core.Contact?.Name)
|
|
49
|
+
json.Core.Contact.Name = options.appSettings.contact.name;
|
|
50
|
+
if (json.Core.Contact?.Email)
|
|
51
|
+
json.Core.Contact.Email = options.appSettings.contact.email;
|
|
52
|
+
}
|
|
53
|
+
if (json.Vault) {
|
|
54
|
+
json.Vault.Solution = options.appSettings.vault;
|
|
55
|
+
json.Vault.AppName = options.appSettings.appName;
|
|
56
|
+
}
|
|
57
|
+
if (json.Mongo) {
|
|
58
|
+
json.Mongo.Database = options.appSettings.database;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
this._generator.fs.writeJSON(appSettingsFile, json);
|
|
62
|
+
|
|
63
|
+
});
|
|
39
64
|
});
|
|
40
65
|
|
|
41
66
|
try {
|
|
42
|
-
this._updateConfigVault(path.join('tools', 'vault','config-vault.ps1'), options);
|
|
43
|
-
this._updateConfigVault(path.join('tools', 'vault','config-vault.sh'), options);
|
|
67
|
+
this._updateConfigVault(path.join('tools', 'vault', 'config-vault.ps1'), options);
|
|
68
|
+
this._updateConfigVault(path.join('tools', 'vault', 'config-vault.sh'), options);
|
|
44
69
|
this._updateReadme(options);
|
|
45
70
|
} catch (error) {
|
|
46
71
|
console.log('The vault configuration could not be updated.');
|
|
47
72
|
console.log(error);
|
|
48
|
-
}
|
|
73
|
+
}
|
|
49
74
|
}
|
|
50
75
|
|
|
51
76
|
_updateConfigVault(file, options) {
|
|
@@ -59,8 +59,6 @@ export default class GrpcGenerator {
|
|
|
59
59
|
|
|
60
60
|
const files = glob.sync('**', { dot: true, nodir: true, cwd: templateGrpcProject, ignore: ignores });
|
|
61
61
|
|
|
62
|
-
console.log(templateGrpcProject, files);
|
|
63
|
-
|
|
64
62
|
await this._utils.generateFiles(options, options.solution, templateGrpcProject, grpcProjectPathDestination, files);
|
|
65
63
|
|
|
66
64
|
await this._appsettings.generate(options, [options.paths.src.grpc]);
|
|
@@ -164,6 +164,7 @@ export default class Utils {
|
|
|
164
164
|
[/global using CodeDesignPlus\.Net\.Microservice\.Application\.Order\.Queries\.GetAllOrders;/g, ''],
|
|
165
165
|
[/app\.MapGrpcService<OrdersService>\(\)/g, `app.MapGrpcService<${options.proto?.name}Service>()`],
|
|
166
166
|
[/Order/g, options.aggregate.name],
|
|
167
|
+
[/ms-archetype/g, `${options.appSettings.appName}`],
|
|
167
168
|
...transformations
|
|
168
169
|
]
|
|
169
170
|
}
|
|
@@ -178,6 +179,7 @@ export default class Utils {
|
|
|
178
179
|
.replace(/CodeDesignPlus\.Net\.Microservice/g, namespace)
|
|
179
180
|
.replace(/Order/g, options.microservice)
|
|
180
181
|
.replace(/orders.proto/g, options.proto?.file)
|
|
182
|
+
.replace(/ms-archetype/g, `${options.appSettings.appName }`)
|
|
181
183
|
);
|
|
182
184
|
|
|
183
185
|
const content = await fs.readFile(src, { encoding: 'utf-8' });
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
**/.classpath
|
|
2
|
+
**/.dockerignore
|
|
3
|
+
**/.env
|
|
4
|
+
**/.git
|
|
5
|
+
**/.gitignore
|
|
6
|
+
**/.project
|
|
7
|
+
**/.settings
|
|
8
|
+
**/.toolstarget
|
|
9
|
+
**/.vs
|
|
10
|
+
**/.vscode
|
|
11
|
+
**/*.*proj.user
|
|
12
|
+
**/*.dbmdl
|
|
13
|
+
**/*.jfm
|
|
14
|
+
**/azds.yaml
|
|
15
|
+
**/bin
|
|
16
|
+
**/charts
|
|
17
|
+
**/docker-compose*
|
|
18
|
+
**/Dockerfile*
|
|
19
|
+
**/node_modules
|
|
20
|
+
**/npm-debug.log
|
|
21
|
+
**/obj
|
|
22
|
+
**/secrets.dev.yaml
|
|
23
|
+
**/values.dev.yaml
|
|
24
|
+
LICENSE
|
|
25
|
+
README.md
|
|
26
|
+
!**/.gitignore
|
|
27
|
+
!.git/HEAD
|
|
28
|
+
!.git/config
|
|
29
|
+
!.git/packed-refs
|
|
30
|
+
!.git/refs/heads/**
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
name: Continuous DeploymentAdd commentMore actions
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
environment:
|
|
7
|
+
type: choice
|
|
8
|
+
description: Select the environment to deploy to
|
|
9
|
+
default: Staging
|
|
10
|
+
options:
|
|
11
|
+
- Staging
|
|
12
|
+
- Production
|
|
13
|
+
|
|
14
|
+
permissions:
|
|
15
|
+
contents: write
|
|
16
|
+
packages: write
|
|
17
|
+
repository-projects: write
|
|
18
|
+
id-token: write
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
|
|
22
|
+
version:
|
|
23
|
+
uses: codedesignplus/workflows/.github/workflows/release.yaml@main
|
|
24
|
+
with:
|
|
25
|
+
project-name: CodeDesignPlus.Net.Microservice
|
|
26
|
+
microservice-name: ms-archetype
|
|
27
|
+
environment: ${{ github.event.inputs.environment }}
|
|
28
|
+
secrets: inherit
|
|
29
|
+
|
|
30
|
+
container:
|
|
31
|
+
needs: version
|
|
32
|
+
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/dev' }}
|
|
33
|
+
uses: codedesignplus/workflows/.github/workflows/container-image.yaml@main
|
|
34
|
+
with:
|
|
35
|
+
project-name: CodeDesignPlus.Net.Microservice
|
|
36
|
+
microservice-name: ms-archetype
|
|
37
|
+
environment: ${{ github.event.inputs.environment }}
|
|
38
|
+
secrets: inherit
|
|
39
|
+
|
|
40
|
+
deploy:
|
|
41
|
+
needs: container
|
|
42
|
+
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/dev' }}
|
|
43
|
+
uses: codedesignplus/workflows/.github/workflows/deploy-self-host.yaml@main
|
|
44
|
+
with:
|
|
45
|
+
project-name: CodeDesignPlus.Net.Microservice
|
|
46
|
+
microservice-name: ms-archetype
|
|
47
|
+
enable-rest: true
|
|
48
|
+
enable-grpc: true
|
|
49
|
+
enable-worker: true
|
|
50
|
+
environment: ${{ github.event.inputs.environment }}
|
|
51
|
+
secrets: inherit
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name: Continuous IntegrationAdd commentMore actions
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
- rc
|
|
8
|
+
- dev
|
|
9
|
+
- feature/*
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: write
|
|
13
|
+
packages: write
|
|
14
|
+
repository-projects: write
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
build:
|
|
18
|
+
uses: codedesignplus/workflows/.github/workflows/build-microservice.yaml@main
|
|
19
|
+
with:
|
|
20
|
+
project-name: CodeDesignPlus.Net.Microservice
|
|
21
|
+
microservice-name: ms-archetype
|
|
22
|
+
environment: Development
|
|
23
|
+
secrets: inherit
|
|
24
|
+
|
|
25
|
+
sonarqube:
|
|
26
|
+
needs: build
|
|
27
|
+
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/dev' }}
|
|
28
|
+
uses: codedesignplus/workflows/.github/workflows/sonarqube.yaml@main
|
|
29
|
+
with:
|
|
30
|
+
project-name: CodeDesignPlus.Net.Microservice
|
|
31
|
+
microservice-name: ms-archetype
|
|
32
|
+
environment: Development
|
|
33
|
+
secrets: inherit
|
|
@@ -52,15 +52,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CodeDesignPlus.Net.Microser
|
|
|
52
52
|
EndProject
|
|
53
53
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CodeDesignPlus.Net.Microservice.Rest.Test", "tests\unit\CodeDesignPlus.Net.Microservice.Rest.Test\CodeDesignPlus.Net.Microservice.Rest.Test.csproj", "{86BB4D11-6C2F-44CA-B7DF-527FDFE79959}"
|
|
54
54
|
EndProject
|
|
55
|
-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{9C6578E7-E4FE-79BB-1635-F363CC1E80DD}"
|
|
56
|
-
EndProject
|
|
57
|
-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{E7A3C856-6834-D657-F2F0-05592DF2DDE9}"
|
|
58
|
-
ProjectSection(SolutionItems) = preProject
|
|
59
|
-
.github\workflows\ci.yml = .github\workflows\ci.yml
|
|
60
|
-
.github\workflows\chart.yaml = .github\workflows\chart.yaml
|
|
61
|
-
.github\workflows\build.yml = .github\workflows\build.yml
|
|
62
|
-
EndProjectSection
|
|
63
|
-
EndProject
|
|
64
55
|
Global
|
|
65
56
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
66
57
|
Debug|Any CPU = Debug|Any CPU
|
|
@@ -157,7 +148,6 @@ Global
|
|
|
157
148
|
{223DF4AA-8E95-4624-B439-EA232409E903} = {5769C6DB-68E8-4A8C-B43A-243401CDB4A2}
|
|
158
149
|
{B190F800-89F0-43CD-B9BD-3EDD0C2E4B37} = {5769C6DB-68E8-4A8C-B43A-243401CDB4A2}
|
|
159
150
|
{86BB4D11-6C2F-44CA-B7DF-527FDFE79959} = {5769C6DB-68E8-4A8C-B43A-243401CDB4A2}
|
|
160
|
-
{E7A3C856-6834-D657-F2F0-05592DF2DDE9} = {9C6578E7-E4FE-79BB-1635-F363CC1E80DD}
|
|
161
151
|
EndGlobalSection
|
|
162
152
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
|
163
153
|
SolutionGuid = {91BAB16E-7151-425E-919F-2725C0813642}
|
package/generators/microservice/templates/microservice/charts/ms-archetype-rest/Production.yaml
CHANGED
|
@@ -32,7 +32,11 @@ ms-base:
|
|
|
32
32
|
|
|
33
33
|
service:
|
|
34
34
|
type: ClusterIP
|
|
35
|
-
|
|
35
|
+
ports:
|
|
36
|
+
- name: http
|
|
37
|
+
port: 5000
|
|
38
|
+
targetPort: http
|
|
39
|
+
protocol: TCP
|
|
36
40
|
|
|
37
41
|
ingress:
|
|
38
42
|
enabled: false
|
|
@@ -96,7 +100,7 @@ ms-base:
|
|
|
96
100
|
hosts:
|
|
97
101
|
- services.codedesignplus.com
|
|
98
102
|
gateways:
|
|
99
|
-
- istio-ingress/
|
|
103
|
+
- istio-ingress/istio-gateway
|
|
100
104
|
http:
|
|
101
105
|
- name: ms-archetype
|
|
102
106
|
match:
|
|
@@ -106,6 +110,6 @@ ms-base:
|
|
|
106
110
|
uri: /
|
|
107
111
|
route:
|
|
108
112
|
- destination:
|
|
109
|
-
host: ms-archetype-rest.
|
|
113
|
+
host: ms-archetype-rest.urbancore.svc.cluster.local
|
|
110
114
|
port:
|
|
111
115
|
number: 5000
|
package/generators/microservice/templates/microservice/charts/ms-archetype-rest/Staging.yaml
CHANGED
|
@@ -32,7 +32,11 @@ ms-base:
|
|
|
32
32
|
|
|
33
33
|
service:
|
|
34
34
|
type: ClusterIP
|
|
35
|
-
|
|
35
|
+
ports:
|
|
36
|
+
- name: http
|
|
37
|
+
port: 5000
|
|
38
|
+
targetPort: http
|
|
39
|
+
protocol: TCP
|
|
36
40
|
|
|
37
41
|
ingress:
|
|
38
42
|
enabled: false
|
|
@@ -96,7 +100,7 @@ ms-base:
|
|
|
96
100
|
hosts:
|
|
97
101
|
- services.codedesignplus.com
|
|
98
102
|
gateways:
|
|
99
|
-
- istio-ingress/
|
|
103
|
+
- istio-ingress/istio-gateway
|
|
100
104
|
http:
|
|
101
105
|
- name: ms-archetype
|
|
102
106
|
match:
|
|
@@ -106,6 +110,6 @@ ms-base:
|
|
|
106
110
|
uri: /
|
|
107
111
|
route:
|
|
108
112
|
- destination:
|
|
109
|
-
host: ms-archetype-rest.
|
|
113
|
+
host: ms-archetype-rest.urbancore.svc.cluster.local
|
|
110
114
|
port:
|
|
111
115
|
number: 5000
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
<Nullable>enable</Nullable>
|
|
6
6
|
</PropertyGroup>
|
|
7
7
|
<ItemGroup>
|
|
8
|
-
<PackageReference Include="CodeDesignPlus.Net.Generator" Version="0.
|
|
9
|
-
<PackageReference Include="CodeDesignPlus.Net.Redis.Abstractions" Version="0.
|
|
10
|
-
<PackageReference Include="CodeDesignPlus.Net.PubSub.Abstractions" Version="0.
|
|
11
|
-
<PackageReference Include="CodeDesignPlus.Net.Cache.Abstractions" Version="0.
|
|
8
|
+
<PackageReference Include="CodeDesignPlus.Net.Generator" Version="0.7.0-beta.33" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
|
|
9
|
+
<PackageReference Include="CodeDesignPlus.Net.Redis.Abstractions" Version="0.7.0-beta.33" />
|
|
10
|
+
<PackageReference Include="CodeDesignPlus.Net.PubSub.Abstractions" Version="0.7.0-beta.33" />
|
|
11
|
+
<PackageReference Include="CodeDesignPlus.Net.Cache.Abstractions" Version="0.7.0-beta.33" />
|
|
12
12
|
<PackageReference Include="Mapster" Version="7.4.0" />
|
|
13
13
|
<PackageReference Include="Mapster.DependencyInjection" Version="1.0.1" />
|
|
14
14
|
<PackageReference Include="MediatR" Version="12.5.0" />
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
namespace CodeDesignPlus.Net.Microservice.Application;
|
|
1
|
+
namespace CodeDesignPlus.Net.Microservice.Application;
|
|
4
2
|
|
|
5
3
|
public class Errors: IErrorCodes
|
|
6
4
|
{
|
|
7
5
|
public const string OrderNotFound = "200 : The order does not exist.";
|
|
8
6
|
public const string OrderAlreadyExists = "201 : The order already exists.";
|
|
9
|
-
public const string ClientIsNull = "300 : The client is null.";
|
|
7
|
+
public const string ClientIsNull = "300 : The client is null.";
|
|
10
8
|
}
|
|
@@ -27,7 +27,6 @@ public static class MapsterConfigOrder
|
|
|
27
27
|
.Map(dest => dest.UpdatedBy, src => src.UpdatedBy)
|
|
28
28
|
.Map(dest => dest.ReasonForCancellation, src => src.ReasonForCancellation);
|
|
29
29
|
|
|
30
|
-
|
|
31
30
|
TypeAdapterConfig<CodeDesignPlus.Microservice.Api.Dtos.AddProductToOrderDto, AddProductToOrderCommand>.NewConfig().TwoWays();
|
|
32
31
|
TypeAdapterConfig<CodeDesignPlus.Microservice.Api.Dtos.CancelOrderDto, CancelOrderCommand>.NewConfig().TwoWays();
|
|
33
32
|
TypeAdapterConfig<CodeDesignPlus.Microservice.Api.Dtos.CreateOrderDto, CreateOrderCommand>.NewConfig().TwoWays();
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<Nullable>enable</Nullable>
|
|
6
6
|
</PropertyGroup>
|
|
7
7
|
<ItemGroup>
|
|
8
|
-
<PackageReference Include="CodeDesignPlus.Net.Exceptions" Version="0.
|
|
9
|
-
<PackageReference Include="CodeDesignPlus.Net.Mongo" Version="0.
|
|
8
|
+
<PackageReference Include="CodeDesignPlus.Net.Exceptions" Version="0.7.0-beta.33" />
|
|
9
|
+
<PackageReference Include="CodeDesignPlus.Net.Mongo" Version="0.7.0-beta.33" />
|
|
10
10
|
</ItemGroup>
|
|
11
11
|
</Project>
|
|
@@ -1,8 +1,18 @@
|
|
|
1
|
+
using Newtonsoft.Json;
|
|
2
|
+
|
|
1
3
|
namespace CodeDesignPlus.Net.Microservice.Domain.ValueObjects;
|
|
2
4
|
|
|
3
5
|
public sealed partial class AddressValueObject
|
|
4
6
|
{
|
|
5
|
-
|
|
7
|
+
|
|
8
|
+
public string Country { get; private set; }
|
|
9
|
+
public string State { get; private set; }
|
|
10
|
+
public string City { get; private set; }
|
|
11
|
+
public string Address { get; private set; }
|
|
12
|
+
public int CodePostal { get; private set; }
|
|
13
|
+
|
|
14
|
+
[JsonConstructor]
|
|
15
|
+
private AddressValueObject(string country, string state, string city, string address, int codePostal)
|
|
6
16
|
{
|
|
7
17
|
this.Country = country;
|
|
8
18
|
this.State = state;
|
|
@@ -11,11 +21,6 @@ public sealed partial class AddressValueObject
|
|
|
11
21
|
this.CodePostal = codePostal;
|
|
12
22
|
}
|
|
13
23
|
|
|
14
|
-
public string Country { get; private set; }
|
|
15
|
-
public string State { get; private set; }
|
|
16
|
-
public string City { get; private set; }
|
|
17
|
-
public string Address { get; private set; }
|
|
18
|
-
public int CodePostal { get; private set; }
|
|
19
24
|
|
|
20
25
|
public static AddressValueObject Create(string country, string state, string city, string address, int codePostal)
|
|
21
26
|
{
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
+
using Newtonsoft.Json;
|
|
2
|
+
|
|
1
3
|
namespace CodeDesignPlus.Net.Microservice.Domain.ValueObjects;
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
public sealed partial class ClientValueObject
|
|
4
6
|
{
|
|
5
|
-
public
|
|
7
|
+
public Guid Id { get; private set; }
|
|
8
|
+
public string Name { get; private set; }
|
|
9
|
+
public string Document { get; private set; }
|
|
10
|
+
public string TypeDocument { get; private set; }
|
|
11
|
+
|
|
12
|
+
[JsonConstructor]
|
|
13
|
+
private ClientValueObject(Guid id, string name, string document, string typeDocument)
|
|
6
14
|
{
|
|
7
15
|
this.Id = id;
|
|
8
16
|
this.Name = name;
|
|
@@ -10,11 +18,6 @@ namespace CodeDesignPlus.Net.Microservice.Domain.ValueObjects;
|
|
|
10
18
|
this.TypeDocument = typeDocument;
|
|
11
19
|
}
|
|
12
20
|
|
|
13
|
-
public Guid Id { get; private set; }
|
|
14
|
-
public string Name { get; private set; }
|
|
15
|
-
public string Document { get; private set; }
|
|
16
|
-
public string TypeDocument { get; private set; }
|
|
17
|
-
|
|
18
21
|
public static ClientValueObject Create(Guid id, string name, string document, string typeDocument)
|
|
19
22
|
{
|
|
20
23
|
DomainGuard.GuidIsEmpty(id, Errors.IdClientIsInvalid);
|
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
<PublishAot>false</PublishAot>
|
|
8
8
|
</PropertyGroup>
|
|
9
9
|
<ItemGroup>
|
|
10
|
-
<PackageReference Include="CodeDesignPlus.Net.Microservice.Commons" Version="0.
|
|
11
|
-
<PackageReference Include="CodeDesignPlus.Net.Vault" Version="0.
|
|
12
|
-
<PackageReference Include="CodeDesignPlus.Net.Redis" Version="0.
|
|
13
|
-
<PackageReference Include="CodeDesignPlus.Net.RabbitMQ" Version="0.
|
|
14
|
-
<PackageReference Include="CodeDesignPlus.Net.Logger" Version="0.
|
|
15
|
-
<PackageReference Include="CodeDesignPlus.Net.Observability" Version="0.
|
|
16
|
-
<PackageReference Include="CodeDesignPlus.Net.Security" Version="0.
|
|
17
|
-
<PackageReference Include="CodeDesignPlus.Net.Redis.Cache" Version="0.
|
|
10
|
+
<PackageReference Include="CodeDesignPlus.Net.Microservice.Commons" Version="0.7.0-beta.33" />
|
|
11
|
+
<PackageReference Include="CodeDesignPlus.Net.Vault" Version="0.7.0-beta.33" />
|
|
12
|
+
<PackageReference Include="CodeDesignPlus.Net.Redis" Version="0.7.0-beta.33" />
|
|
13
|
+
<PackageReference Include="CodeDesignPlus.Net.RabbitMQ" Version="0.7.0-beta.33" />
|
|
14
|
+
<PackageReference Include="CodeDesignPlus.Net.Logger" Version="0.7.0-beta.33" />
|
|
15
|
+
<PackageReference Include="CodeDesignPlus.Net.Observability" Version="0.7.0-beta.33" />
|
|
16
|
+
<PackageReference Include="CodeDesignPlus.Net.Security" Version="0.7.0-beta.33" />
|
|
17
|
+
<PackageReference Include="CodeDesignPlus.Net.Redis.Cache" Version="0.7.0-beta.33" />
|
|
18
18
|
</ItemGroup>
|
|
19
19
|
<ItemGroup>
|
|
20
20
|
<SonarQubeSetting Include="sonar.coverage.exclusions">
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
using CodeDesignPlus.Net.Logger.Extensions;
|
|
2
2
|
using CodeDesignPlus.Net.Microservice.Commons.FluentValidation;
|
|
3
|
+
using CodeDesignPlus.Net.Microservice.Commons.HealthChecks;
|
|
3
4
|
using CodeDesignPlus.Net.Microservice.Commons.MediatR;
|
|
4
5
|
using CodeDesignPlus.Net.Mongo.Extensions;
|
|
6
|
+
using CodeDesignPlus.Net.Observability.Extensions;
|
|
5
7
|
using CodeDesignPlus.Net.RabbitMQ.Extensions;
|
|
6
8
|
using CodeDesignPlus.Net.Redis.Cache.Extensions;
|
|
7
9
|
using CodeDesignPlus.Net.Redis.Extensions;
|
|
@@ -26,9 +28,13 @@ builder.Services.AddCache(builder.Configuration);
|
|
|
26
28
|
builder.Services.AddMapster();
|
|
27
29
|
builder.Services.AddFluentValidation();
|
|
28
30
|
builder.Services.AddMediatR<CodeDesignPlus.Net.Microservice.Application.Startup>();
|
|
31
|
+
builder.Services.AddHealthChecksServices();
|
|
32
|
+
builder.Services.AddObservability(builder.Configuration, builder.Environment);
|
|
29
33
|
|
|
30
34
|
var app = builder.Build();
|
|
31
35
|
|
|
36
|
+
app.UseHealthChecks();
|
|
37
|
+
|
|
32
38
|
var home = app.MapGroup("/");
|
|
33
39
|
|
|
34
40
|
home.MapGet("/", () => "Ready");
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"Kestrel": {
|
|
3
3
|
"Endpoints": {
|
|
4
4
|
"Http": {
|
|
5
|
-
"Url": "http://*:
|
|
5
|
+
"Url": "http://*:5000",
|
|
6
6
|
"Protocols": "Http1"
|
|
7
7
|
}
|
|
8
8
|
}
|
|
@@ -18,14 +18,13 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"Security": {
|
|
21
|
-
"Authority": "https://codedesignplus.b2clogin.com/codedesignplus.onmicrosoft.com/B2C_1_CodeDeseignPlus/oauth2/v2.0/",
|
|
22
21
|
"ClientId": "a74cb192-598c-4757-95ae-b315793bbbca",
|
|
23
22
|
"IncludeErrorDetails": true,
|
|
24
23
|
"ValidateAudience": true,
|
|
25
24
|
"ValidateIssuer": true,
|
|
26
25
|
"ValidateLifetime": true,
|
|
27
26
|
"RequireHttpsMetadata": true,
|
|
28
|
-
"ValidIssuer": "
|
|
27
|
+
"ValidIssuer": "",
|
|
29
28
|
"ValidAudiences": [
|
|
30
29
|
"a74cb192-598c-4757-95ae-b315793bbbca"
|
|
31
30
|
],
|
|
@@ -10,18 +10,19 @@
|
|
|
10
10
|
<DockerfileContext>..\..</DockerfileContext>
|
|
11
11
|
</PropertyGroup>
|
|
12
12
|
<ItemGroup>
|
|
13
|
+
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="9.0.5" />
|
|
13
14
|
<PackageReference Include="NodaTime.Serialization.SystemTextJson" Version="1.3.0" />
|
|
14
|
-
<PackageReference Include="CodeDesignPlus.Net.Microservice.Commons" Version="0.
|
|
15
|
-
<PackageReference Include="CodeDesignPlus.Net.Vault" Version="0.
|
|
15
|
+
<PackageReference Include="CodeDesignPlus.Net.Microservice.Commons" Version="0.7.0-beta.33" />
|
|
16
|
+
<PackageReference Include="CodeDesignPlus.Net.Vault" Version="0.7.0-beta.33" />
|
|
16
17
|
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="8.1.1" />
|
|
17
18
|
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="8.1.1" />
|
|
18
19
|
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="8.1.1" />
|
|
19
|
-
<PackageReference Include="CodeDesignPlus.Net.Logger" Version="0.
|
|
20
|
-
<PackageReference Include="CodeDesignPlus.Net.Redis" Version="0.
|
|
21
|
-
<PackageReference Include="CodeDesignPlus.Net.Security" Version="0.
|
|
22
|
-
<PackageReference Include="CodeDesignPlus.Net.Observability" Version="0.
|
|
23
|
-
<PackageReference Include="CodeDesignPlus.Net.RabbitMQ" Version="0.
|
|
24
|
-
<PackageReference Include="CodeDesignPlus.Net.Redis.Cache" Version="0.
|
|
20
|
+
<PackageReference Include="CodeDesignPlus.Net.Logger" Version="0.7.0-beta.33" />
|
|
21
|
+
<PackageReference Include="CodeDesignPlus.Net.Redis" Version="0.7.0-beta.33" />
|
|
22
|
+
<PackageReference Include="CodeDesignPlus.Net.Security" Version="0.7.0-beta.33" />
|
|
23
|
+
<PackageReference Include="CodeDesignPlus.Net.Observability" Version="0.7.0-beta.33" />
|
|
24
|
+
<PackageReference Include="CodeDesignPlus.Net.RabbitMQ" Version="0.7.0-beta.33" />
|
|
25
|
+
<PackageReference Include="CodeDesignPlus.Net.Redis.Cache" Version="0.7.0-beta.33" />
|
|
25
26
|
|
|
26
27
|
<PackageReference Include="AspNetCore.HealthChecks.MongoDb" Version="9.0.0" />
|
|
27
28
|
<PackageReference Include="AspNetCore.HealthChecks.Rabbitmq" Version="9.0.0" />
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
using CodeDesignPlus.Net.Microservice.Commons.Application;
|
|
1
2
|
using CodeDesignPlus.Net.Microservice.Commons.EntryPoints.Rest.Middlewares;
|
|
2
3
|
using CodeDesignPlus.Net.Microservice.Commons.EntryPoints.Rest.Resources;
|
|
3
4
|
using CodeDesignPlus.Net.Microservice.Commons.EntryPoints.Rest.Swagger;
|
|
@@ -6,10 +7,9 @@ using CodeDesignPlus.Net.Microservice.Commons.HealthChecks;
|
|
|
6
7
|
using CodeDesignPlus.Net.Microservice.Commons.MediatR;
|
|
7
8
|
using CodeDesignPlus.Net.Redis.Cache.Extensions;
|
|
8
9
|
using CodeDesignPlus.Net.Vault.Extensions;
|
|
9
|
-
using NodaTime.Serialization.
|
|
10
|
+
using NodaTime.Serialization.JsonNet;
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
var builder = WebApplication.CreateSlimBuilder(args);
|
|
12
|
+
var builder = WebApplication.CreateSlimBuilder(args);
|
|
13
13
|
|
|
14
14
|
Serilog.Debugging.SelfLog.Enable(Console.Error);
|
|
15
15
|
|
|
@@ -19,7 +19,11 @@ builder.Configuration.AddVault();
|
|
|
19
19
|
|
|
20
20
|
builder.Services
|
|
21
21
|
.AddControllers()
|
|
22
|
-
.
|
|
22
|
+
.AddNewtonsoftJson(options =>
|
|
23
|
+
{
|
|
24
|
+
options.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Error;
|
|
25
|
+
options.SerializerSettings.ConfigureForNodaTime(DateTimeZoneProviders.Tzdb);
|
|
26
|
+
});
|
|
23
27
|
|
|
24
28
|
builder.Services.AddEndpointsApiExplorer();
|
|
25
29
|
builder.Services.AddCors();
|
|
@@ -45,6 +49,9 @@ app.UseCors(builder => builder
|
|
|
45
49
|
.AllowAnyMethod()
|
|
46
50
|
.AllowAnyHeader()
|
|
47
51
|
);
|
|
52
|
+
|
|
53
|
+
app.UsePath();
|
|
54
|
+
|
|
48
55
|
app.UseExceptionMiddleware();
|
|
49
56
|
app.UseHealthChecks();
|
|
50
57
|
app.UseCodeErrors();
|
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"RabbitMQ": {
|
|
10
|
-
"Host": "host.docker.internal"
|
|
11
|
-
},
|
|
12
|
-
"Logger": {
|
|
13
|
-
"OTelEndpoint": "http://host.docker.internal:4317"
|
|
14
|
-
},
|
|
15
|
-
"Observability": {
|
|
16
|
-
"ServerOtel": "http://host.docker.internal:4317"
|
|
17
|
-
},
|
|
18
|
-
"Vault": {
|
|
19
|
-
"Address": "http://host.docker.internal:8200",
|
|
20
|
-
"Mongo": {
|
|
21
|
-
"TemplateConnectionString": "mongodb://{0}:{1}@host.docker.internal:27017"
|
|
2
|
+
"Core": {
|
|
3
|
+
"PathBase": ""
|
|
4
|
+
},
|
|
5
|
+
"Redis": {
|
|
6
|
+
"Instances": {
|
|
7
|
+
"Core": {
|
|
8
|
+
"ConnectionString": "host.docker.internal:6379"
|
|
22
9
|
}
|
|
23
10
|
}
|
|
11
|
+
},
|
|
12
|
+
"RabbitMQ": {
|
|
13
|
+
"Host": "host.docker.internal"
|
|
14
|
+
},
|
|
15
|
+
"Logger": {
|
|
16
|
+
"OTelEndpoint": "http://host.docker.internal:4317"
|
|
17
|
+
},
|
|
18
|
+
"Observability": {
|
|
19
|
+
"ServerOtel": "http://host.docker.internal:4317"
|
|
20
|
+
},
|
|
21
|
+
"Vault": {
|
|
22
|
+
"Address": "http://host.docker.internal:8200",
|
|
23
|
+
"Mongo": {
|
|
24
|
+
"TemplateConnectionString": "mongodb://{0}:{1}@host.docker.internal:27017"
|
|
25
|
+
}
|
|
24
26
|
}
|
|
25
|
-
|
|
27
|
+
}
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
}
|
|
10
10
|
},
|
|
11
11
|
"Core": {
|
|
12
|
-
"Id": "
|
|
12
|
+
"Id": "36612844-2102-49ff-847d-d294e8240338",
|
|
13
|
+
"PathBase": "/ms-archetype",
|
|
13
14
|
"AppName": "ms-archetype-rest",
|
|
14
15
|
"Version": "v1",
|
|
15
16
|
"Description": "Microservice Archetype Template",
|
|
@@ -24,13 +25,12 @@
|
|
|
24
25
|
"Server": "http://localhost:5001"
|
|
25
26
|
},
|
|
26
27
|
"Security": {
|
|
27
|
-
"Authority": "https://codedesignplus.b2clogin.com/codedesignplus.onmicrosoft.com/B2C_1_CodeDeseignPlus/oauth2/v2.0/",
|
|
28
28
|
"IncludeErrorDetails": true,
|
|
29
29
|
"ValidateAudience": true,
|
|
30
30
|
"ValidateIssuer": true,
|
|
31
31
|
"ValidateLifetime": true,
|
|
32
32
|
"RequireHttpsMetadata": true,
|
|
33
|
-
"ValidIssuer": "
|
|
33
|
+
"ValidIssuer": "",
|
|
34
34
|
"ValidAudiences": [],
|
|
35
35
|
"Applications": [],
|
|
36
36
|
"ValidateLicense": false,
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
<Protobuf Include="Protos\orders.proto" GrpcServices="Server" />
|
|
10
10
|
</ItemGroup>
|
|
11
11
|
<ItemGroup>
|
|
12
|
-
<PackageReference Include="CodeDesignPlus.Net.Microservice.Commons" Version="0.
|
|
13
|
-
<PackageReference Include="CodeDesignPlus.Net.Vault" Version="0.
|
|
12
|
+
<PackageReference Include="CodeDesignPlus.Net.Microservice.Commons" Version="0.7.0-beta.33" />
|
|
13
|
+
<PackageReference Include="CodeDesignPlus.Net.Vault" Version="0.7.0-beta.33" />
|
|
14
14
|
<PackageReference Include="Grpc.AspNetCore" Version="2.70.0" />
|
|
15
15
|
<PackageReference Include="Grpc.AspNetCore.Server.Reflection" Version="2.70.0" />
|
|
16
|
-
<PackageReference Include="Grpc.Tools" Version="2.
|
|
16
|
+
<PackageReference Include="Grpc.Tools" Version="2.70.0">
|
|
17
17
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
|
18
18
|
<PrivateAssets>all</PrivateAssets>
|
|
19
19
|
</PackageReference>
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
<ItemGroup>
|
|
27
27
|
<ProjectReference Include="..\..\domain\CodeDesignPlus.Net.Microservice.Infrastructure\CodeDesignPlus.Net.Microservice.Infrastructure.csproj" />
|
|
28
28
|
<PackageReference Include="NodaTime.Serialization.Protobuf" Version="2.0.2" />
|
|
29
|
-
<PackageReference Include="CodeDesignPlus.Net.Redis" Version="0.
|
|
30
|
-
<PackageReference Include="CodeDesignPlus.Net.RabbitMQ" Version="0.
|
|
31
|
-
<PackageReference Include="CodeDesignPlus.Net.Logger" Version="0.
|
|
32
|
-
<PackageReference Include="CodeDesignPlus.Net.Observability" Version="0.
|
|
33
|
-
<PackageReference Include="CodeDesignPlus.Net.Security" Version="0.
|
|
34
|
-
<PackageReference Include="CodeDesignPlus.Net.Exceptions" Version="0.
|
|
35
|
-
<PackageReference Include="CodeDesignPlus.Net.Redis.Cache" Version="0.
|
|
29
|
+
<PackageReference Include="CodeDesignPlus.Net.Redis" Version="0.7.0-beta.33" />
|
|
30
|
+
<PackageReference Include="CodeDesignPlus.Net.RabbitMQ" Version="0.7.0-beta.33" />
|
|
31
|
+
<PackageReference Include="CodeDesignPlus.Net.Logger" Version="0.7.0-beta.33" />
|
|
32
|
+
<PackageReference Include="CodeDesignPlus.Net.Observability" Version="0.7.0-beta.33" />
|
|
33
|
+
<PackageReference Include="CodeDesignPlus.Net.Security" Version="0.7.0-beta.33" />
|
|
34
|
+
<PackageReference Include="CodeDesignPlus.Net.Exceptions" Version="0.7.0-beta.33" />
|
|
35
|
+
<PackageReference Include="CodeDesignPlus.Net.Redis.Cache" Version="0.7.0-beta.33" />
|
|
36
36
|
</ItemGroup>
|
|
37
37
|
</Project>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
using CodeDesignPlus.Net.Logger.Extensions;
|
|
2
2
|
using CodeDesignPlus.Net.Microservice.Commons.EntryPoints.gRpc.Interceptors;
|
|
3
3
|
using CodeDesignPlus.Net.Microservice.Commons.FluentValidation;
|
|
4
|
+
using CodeDesignPlus.Net.Microservice.Commons.HealthChecks;
|
|
4
5
|
using CodeDesignPlus.Net.Microservice.Commons.MediatR;
|
|
5
6
|
using CodeDesignPlus.Net.Microservice.gRpc.Services;
|
|
6
7
|
using CodeDesignPlus.Net.Mongo.Extensions;
|
|
@@ -37,9 +38,12 @@ builder.Services.AddSecurity(builder.Configuration);
|
|
|
37
38
|
builder.Services.AddObservability(builder.Configuration, builder.Environment);
|
|
38
39
|
builder.Services.AddLogger(builder.Configuration);
|
|
39
40
|
builder.Services.AddCache(builder.Configuration);
|
|
41
|
+
builder.Services.AddHealthChecksServices();
|
|
40
42
|
|
|
41
43
|
var app = builder.Build();
|
|
42
44
|
|
|
45
|
+
app.UseHealthChecks();
|
|
46
|
+
|
|
43
47
|
app.UseAuth();
|
|
44
48
|
|
|
45
49
|
app.MapGrpcService<OrderService>().RequireAuthorization();
|
|
@@ -22,13 +22,12 @@
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"Security": {
|
|
25
|
-
"Authority": "https://codedesignplus.b2clogin.com/codedesignplus.onmicrosoft.com/B2C_1_CodeDeseignPlus/oauth2/v2.0/",
|
|
26
25
|
"IncludeErrorDetails": true,
|
|
27
26
|
"ValidateAudience": true,
|
|
28
27
|
"ValidateIssuer": true,
|
|
29
28
|
"ValidateLifetime": true,
|
|
30
29
|
"RequireHttpsMetadata": true,
|
|
31
|
-
"ValidIssuer": "
|
|
30
|
+
"ValidIssuer": "",
|
|
32
31
|
"ValidAudiences": [],
|
|
33
32
|
"Applications": []
|
|
34
33
|
},
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
|
12
12
|
<PrivateAssets>all</PrivateAssets>
|
|
13
13
|
</PackageReference>
|
|
14
|
-
<PackageReference Include="CodeDesignPlus.Net.xUnit.Microservice" Version="0.
|
|
14
|
+
<PackageReference Include="CodeDesignPlus.Net.xUnit.Microservice" Version="0.7.0-beta.33" />
|
|
15
15
|
<PackageReference Include="Ductus.FluentDocker.XUnit" Version="2.10.59" />
|
|
16
16
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.4" />
|
|
17
17
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<PrivateAssets>all</PrivateAssets>
|
|
13
13
|
</PackageReference>
|
|
14
14
|
<PackageReference Include="Microsoft.AspNetCore.Authentication" Version="2.3.0" />
|
|
15
|
-
<PackageReference Include="CodeDesignPlus.Net.xUnit.Microservice" Version="0.
|
|
15
|
+
<PackageReference Include="CodeDesignPlus.Net.xUnit.Microservice" Version="0.7.0-beta.33" />
|
|
16
16
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.4" />
|
|
17
17
|
<PackageReference Include="Ductus.FluentDocker.XUnit" Version="2.10.59" />
|
|
18
18
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
</PackageReference>
|
|
15
15
|
<PackageReference Include="Google.Protobuf" Version="3.30.2" />
|
|
16
16
|
<PackageReference Include="Grpc.Net.Client" Version="2.70.0" />
|
|
17
|
-
<PackageReference Include="Grpc.Tools" Version="2.
|
|
17
|
+
<PackageReference Include="Grpc.Tools" Version="2.70.0">
|
|
18
18
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
|
19
19
|
<PrivateAssets>all</PrivateAssets>
|
|
20
20
|
</PackageReference>
|
|
21
21
|
<PackageReference Include="NodaTime.Serialization.Protobuf" Version="2.0.2" />
|
|
22
|
-
<PackageReference Include="CodeDesignPlus.Net.xUnit.Microservice" Version="0.
|
|
22
|
+
<PackageReference Include="CodeDesignPlus.Net.xUnit.Microservice" Version="0.7.0-beta.33" />
|
|
23
23
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.4" />
|
|
24
24
|
<PackageReference Include="Microsoft.AspNetCore.Authentication" Version="2.3.0" />
|
|
25
25
|
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="9.0.4" />
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
|
18
18
|
<PrivateAssets>all</PrivateAssets>
|
|
19
19
|
</PackageReference>
|
|
20
|
-
<PackageReference Include="CodeDesignPlus.Net.xUnit.Microservice" Version="0.
|
|
20
|
+
<PackageReference Include="CodeDesignPlus.Net.xUnit.Microservice" Version="0.7.0-beta.33" />
|
|
21
21
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
|
|
22
22
|
<PackageReference Include="Moq" Version="4.20.72" />
|
|
23
23
|
<PackageReference Include="xunit" Version="2.9.3" />
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<IsPackable>false</IsPackable>
|
|
7
7
|
</PropertyGroup>
|
|
8
8
|
<ItemGroup>
|
|
9
|
-
<PackageReference Include="CodeDesignPlus.Net.Serializers" Version="0.
|
|
9
|
+
<PackageReference Include="CodeDesignPlus.Net.Serializers" Version="0.7.0-beta.33" />
|
|
10
10
|
<PackageReference Include="coverlet.msbuild" Version="6.0.4">
|
|
11
11
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
|
12
12
|
<PrivateAssets>all</PrivateAssets>
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
</PackageReference>
|
|
25
25
|
</ItemGroup>
|
|
26
26
|
<ItemGroup>
|
|
27
|
-
<PackageReference Include="CodeDesignPlus.Net.xUnit.Microservice" Version="0.
|
|
27
|
+
<PackageReference Include="CodeDesignPlus.Net.xUnit.Microservice" Version="0.7.0-beta.33" />
|
|
28
28
|
</ItemGroup>
|
|
29
29
|
<ItemGroup>
|
|
30
30
|
<ProjectReference Include="..\..\..\src\domain\CodeDesignPlus.Net.Microservice.Infrastructure\CodeDesignPlus.Net.Microservice.Infrastructure.csproj" />
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
|
23
23
|
<PrivateAssets>all</PrivateAssets>
|
|
24
24
|
</PackageReference>
|
|
25
|
-
<PackageReference Include="CodeDesignPlus.Net.xUnit.Microservice" Version="0.
|
|
25
|
+
<PackageReference Include="CodeDesignPlus.Net.xUnit.Microservice" Version="0.7.0-beta.33" />
|
|
26
26
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
|
|
27
27
|
<PackageReference Include="Moq" Version="4.20.72" />
|
|
28
28
|
<PackageReference Include="xunit" Version="2.9.3" />
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
|
18
18
|
<PrivateAssets>all</PrivateAssets>
|
|
19
19
|
</PackageReference>
|
|
20
|
-
<PackageReference Include="CodeDesignPlus.Net.xUnit.Microservice" Version="0.
|
|
20
|
+
<PackageReference Include="CodeDesignPlus.Net.xUnit.Microservice" Version="0.7.0-beta.33" />
|
|
21
21
|
<PackageReference Include="Grpc.Core.Testing" Version="2.46.6" />
|
|
22
22
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
|
|
23
23
|
<PackageReference Include="Moq" Version="4.20.72" />
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
using
|
|
1
|
+
using Newtonsoft.Json;
|
|
2
2
|
|
|
3
3
|
namespace <%= ns %>;
|
|
4
4
|
|
|
@@ -10,7 +10,7 @@ public sealed partial class <%= name %>
|
|
|
10
10
|
public string Value { get; private set; }
|
|
11
11
|
|
|
12
12
|
[JsonConstructor]
|
|
13
|
-
|
|
13
|
+
private <%= name %>(string value)
|
|
14
14
|
{
|
|
15
15
|
DomainGuard.IsNullOrEmpty(value, Errors.UnknownError);
|
|
16
16
|
|
package/package.json
CHANGED