From 55159b772578e58d3406dd8028e9c14d9b3254e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Dybvik=20Langfors?= Date: Wed, 30 Oct 2024 10:02:34 +0100 Subject: [PATCH 1/7] fix: Simplify subject attribute matching (#1348) ## Description This simplifies the subject attribute mapping to only use a single attribute, as multiple subject attributes are explicitly disallowed by the PDP (eg. for system users). In fact, for external use, only a single subject attribute is ever required (eg. sending the authlvl attribute is not supported, as it is the PEPs responsibility to enforce any obligations returned from the PDP). In addition, support for allowing pure Maskinporten tokens (using only consumer-claims) has been removed, as this is not officially supported in the Altinn Authorization model; only userid/pid/systemuserid will cause the PDP to resolve roles/access packages in order to match policy rules, so the only way sending organization numbers as subject claims is if the policy itself contains hard coded organization numbers, which is discouraged (should access lists for that). Note that urn:altinn:org (ie serviceowner acronym claim types) are left out, as authenticated service owners should not use the end user APIs (this would potentially leak information that we only want to make available to the end users). ## Related Issue(s) See previous PR (#1340) and [slack thread](https://digdir.slack.com/archives/C079ZFUSFMW/p1729772275391209). ## Verification - [x] **Your** code builds clean without any errors or warnings - [x] Manual testing done (required) - [x] Relevant automated test added (if you find this hard, leave it and we'll help out) ## Summary by CodeRabbit - **New Features** - Enhanced error handling with the introduction of an `UnreachableException` for invalid user types. - Streamlined attribute selection logic for improved performance. - **Bug Fixes** - Updated claims structure in tests to reflect recent changes, ensuring accurate validation. - **Tests** - Added a new test for exception handling. - Renamed and consolidated existing tests for clarity and maintainability. --- .../Authorization/DecisionRequestHelper.cs | 90 +++++++++++-------- .../DecisionRequestHelperTests.cs | 73 ++++++--------- 2 files changed, 81 insertions(+), 82 deletions(-) diff --git a/src/Digdir.Domain.Dialogporten.Infrastructure/Altinn/Authorization/DecisionRequestHelper.cs b/src/Digdir.Domain.Dialogporten.Infrastructure/Altinn/Authorization/DecisionRequestHelper.cs index f2297fc3cb..a5f8f36b6f 100644 --- a/src/Digdir.Domain.Dialogporten.Infrastructure/Altinn/Authorization/DecisionRequestHelper.cs +++ b/src/Digdir.Domain.Dialogporten.Infrastructure/Altinn/Authorization/DecisionRequestHelper.cs @@ -1,5 +1,7 @@ -using Altinn.Authorization.ABAC.Xacml.JsonProfile; +using System.Diagnostics; +using Altinn.Authorization.ABAC.Xacml.JsonProfile; using System.Security.Claims; + using Digdir.Domain.Dialogporten.Application.Common.Extensions; using Digdir.Domain.Dialogporten.Application.Externals.AltinnAuthorization; using Digdir.Domain.Dialogporten.Domain.Parties; @@ -10,20 +12,29 @@ namespace Digdir.Domain.Dialogporten.Infrastructure.Altinn.Authorization; internal static class DecisionRequestHelper { private const string SubjectId = "s1"; - private const string AltinnUrnNsPrefix = "urn:altinn:"; + private const string PidClaimType = "pid"; - private const string ConsumerClaimType = "consumer"; + private const string UserIdClaimType = "urn:altinn:userid"; + private const string RarAuthorizationDetailsClaimType = "authorization_details"; + private const string AttributeIdAction = "urn:oasis:names:tc:xacml:1.0:action:action-id"; private const string AttributeIdResource = "urn:altinn:resource"; private const string AttributeIdResourceInstance = "urn:altinn:resourceinstance"; - private const string AltinnAutorizationDetailsClaim = "authorization_details"; + private const string AttributeIdSubResource = "urn:altinn:subresource"; + private const string AttributeIdOrg = "urn:altinn:org"; private const string AttributeIdApp = "urn:altinn:app"; - private const string AttributeIdSystemUser = "urn:altinn:systemuser:uuid"; + private const string AttributeIdAppInstance = "urn:altinn:instance-id"; + private const string AttributeIdUserId = "urn:altinn:userid"; + private const string AttributeIdPerson = "urn:altinn:person:identifier-no"; + private const string AttributeIdSystemUser = "urn:altinn:systemuser:uuid"; + + // The order of these attribute types is important as we want to prioritize the most specific claim types. + private static readonly List PrioritizedClaimTypes = [AttributeIdUserId, AttributeIdPerson, AttributeIdSystemUser]; + private const string ReservedResourcePrefixForApps = "app_"; - private const string AttributeIdAppInstance = "urn:altinn:instance-id"; - private const string AttributeIdSubResource = "urn:altinn:subresource"; + private const string PermitResponse = "Permit"; public static XacmlJsonRequestRoot CreateDialogDetailsRequest(DialogDetailsAuthorizationRequest request) @@ -71,39 +82,42 @@ public static DialogDetailsAuthorizationResult CreateDialogDetailsResponse(List< }; } - private static List CreateAccessSubjectCategory(IEnumerable claims) - { - var attributes = claims - .Select(x => x switch + private static List CreateAccessSubjectCategory(IEnumerable claims) => + // The PDP expects for the most part only a single subject attribute, and will even fail the request + // for some types (e.g. the urn:altinn:systemuser:uuid) if there are multiple subject attributes (for + // security reasons). We therefore need to filter out the relevant attributes and only include those, + // which in essence is the pid and the system user uuid. In addition, we also utilize urn:altinn:userid + // if present instead of the pid as a simple optimization as this offloads the PDP from having to look up + // the user id from the pid. See PrioritizedClaimTypes for the order of prioritization. + claims.Select(claim => claim.Type switch + { + UserIdClaimType => new XacmlJsonCategory { - { Type: PidClaimType } => new XacmlJsonAttribute { AttributeId = NorwegianPersonIdentifier.Prefix, Value = x.Value }, - { Type: var type } when type.StartsWith(AltinnUrnNsPrefix, StringComparison.Ordinal) => new() { AttributeId = type, Value = x.Value }, - { Type: ConsumerClaimType } when x.TryGetOrganizationNumber(out var organizationNumber) => new() { AttributeId = NorwegianOrganizationIdentifier.Prefix, Value = organizationNumber }, - { Type: AltinnAutorizationDetailsClaim } => new() { AttributeId = AttributeIdSystemUser, Value = GetSystemUserId(x) }, - _ => null - }) - .Where(x => x is not null) - .Cast() - .ToList(); - - // If we're authorizing a person (i.e. ID-porten token), we are not interested in the consumer-claim (organization number) - // as that is not relevant for the authorization decision (it's just the organization owning the OAuth client). - // The same goes if urn:altinn:userid is present, which might be present if using a legacy enterprise user token - if (attributes.Any(x => x.AttributeId == NorwegianPersonIdentifier.Prefix) || - attributes.Any(x => x.AttributeId == AttributeIdUserId)) + Id = SubjectId, + Attribute = [new() { AttributeId = AttributeIdUserId, Value = claim.Value }] + }, + PidClaimType => new XacmlJsonCategory + { + Id = SubjectId, + Attribute = [new() { AttributeId = AttributeIdPerson, Value = claim.Value }] + }, + RarAuthorizationDetailsClaimType when new ClaimsPrincipal(new ClaimsIdentity(new[] { claim })).TryGetSystemUserId(out var systemUserId) => new XacmlJsonCategory + { + Id = SubjectId, + Attribute = + [ + new XacmlJsonAttribute { AttributeId = AttributeIdSystemUser, Value = systemUserId } + ] + }, + _ => null + }) + .Where(x => x != null) + .MinBy(x => PrioritizedClaimTypes.IndexOf(x!.Attribute[0].AttributeId)) switch { - attributes.RemoveAll(x => x.AttributeId == NorwegianOrganizationIdentifier.Prefix); - } - - return [new() { Id = SubjectId, Attribute = attributes }]; - } - - private static string GetSystemUserId(Claim claim) - { - var claimsPrincipal = new ClaimsPrincipal(new ClaimsIdentity([claim])); - claimsPrincipal.TryGetSystemUserId(out var systemUserId); - return systemUserId!; - } + { } validCategory => new List { validCategory }, + _ => throw new UnreachableException( + "Unable to find a suitable subject attribute for the authorization request. Having a known user type should be enforced during authentication (see UserTypeValidationMiddleware)."), + }; private static List CreateActionCategories( List altinnActions, out Dictionary actionIdByName) diff --git a/tests/Digdir.Domain.Dialogporten.Infrastructure.Unit.Tests/DecisionRequestHelperTests.cs b/tests/Digdir.Domain.Dialogporten.Infrastructure.Unit.Tests/DecisionRequestHelperTests.cs index e23c180e5d..04682aa18b 100644 --- a/tests/Digdir.Domain.Dialogporten.Infrastructure.Unit.Tests/DecisionRequestHelperTests.cs +++ b/tests/Digdir.Domain.Dialogporten.Infrastructure.Unit.Tests/DecisionRequestHelperTests.cs @@ -1,4 +1,5 @@ -using System.Security.Claims; +using System.Diagnostics; +using System.Security.Claims; using Altinn.Authorization.ABAC.Xacml.JsonProfile; using Digdir.Domain.Dialogporten.Application.Common.Authorization; using Digdir.Domain.Dialogporten.Application.Externals.AltinnAuthorization; @@ -10,8 +11,6 @@ namespace Digdir.Domain.Dialogporten.Infrastructure.Unit.Tests; public class DecisionRequestHelperTests { - private const string ConsumerClaimValue = /*lang=json,strict*/ "{\"authority\":\"iso6523-actorid-upis\",\"ID\":\"0192:991825827\"}"; - private const string AuthorizationDetailsClaimValue = /*lang=json,strict*/"[{\"type\":\"urn:altinn:systemuser\",\"systemuser_id\":[\"unique_systemuser_id\"]}]"; [Fact] @@ -20,10 +19,9 @@ public void CreateDialogDetailsRequestShouldReturnCorrectRequest() // Arrange var request = CreateDialogDetailsAuthorizationRequest( GetAsClaims( - ("pid", "12345678901"), - // This should not be copied as subject claim since there's a "pid"-claim - ("consumer", ConsumerClaimValue) + ("authorization_details", AuthorizationDetailsClaimValue), + ("pid", "12345678901") ), $"{NorwegianOrganizationIdentifier.PrefixWithSeparator}713330310"); var dialogId = request.DialogId; @@ -42,9 +40,8 @@ public void CreateDialogDetailsRequestShouldReturnCorrectRequest() // Check AccessSubject attributes var accessSubject = result.Request.AccessSubject.First(); Assert.Equal("s1", accessSubject.Id); - Assert.Contains(accessSubject.Attribute, a => a.AttributeId == "urn:altinn:foo" && a.Value == "bar"); Assert.Contains(accessSubject.Attribute, a => a.AttributeId == "urn:altinn:person:identifier-no" && a.Value == "12345678901"); - Assert.DoesNotContain(accessSubject.Attribute, a => a.AttributeId == "urn:altinn:organization:identifier-no"); + Assert.Single(accessSubject.Attribute); // Check Action attributes. var actionIdsByName = new Dictionary(); @@ -79,15 +76,14 @@ public void CreateDialogDetailsRequestShouldReturnCorrectRequest() } [Fact] - public void CreateDialogDetailsRequestShouldReturnCorrectRequestForLegacyEnterpriseUsers() + public void CreateDialogDetailsRequestShouldReturnCorrectRequestForExchangedTokens() { // Arrange var request = CreateDialogDetailsAuthorizationRequest( GetAsClaims( - ("urn:altinn:userid", "5678901"), - // This should not be copied as subject claim since there's a "urn:altinn:user-id"-claim - ("consumer", ConsumerClaimValue) + ("pid", "12345678901"), + ("urn:altinn:userid", "5678901") ), $"{NorwegianOrganizationIdentifier.PrefixWithSeparator}713330310"); @@ -98,7 +94,7 @@ public void CreateDialogDetailsRequestShouldReturnCorrectRequestForLegacyEnterpr var accessSubject = result.Request.AccessSubject.First(); Assert.Equal("s1", accessSubject.Id); Assert.Contains(accessSubject.Attribute, a => a.AttributeId == "urn:altinn:userid" && a.Value == "5678901"); - Assert.DoesNotContain(accessSubject.Attribute, a => a.AttributeId == "urn:altinn:organization:identifier-no"); + Assert.Single(accessSubject.Attribute); } [Fact] @@ -151,33 +147,8 @@ public void CreateDialogDetailsRequestShouldReturnCorrectRequestForSystemUser() var accessSubject = result.Request.AccessSubject.First(); Assert.Equal("s1", accessSubject.Id); - Assert.Contains(accessSubject.Attribute, a => a.AttributeId == "urn:altinn:foo" && a.Value == "bar"); Assert.Contains(accessSubject.Attribute, a => a.AttributeId == "urn:altinn:systemuser:uuid" && a.Value == "unique_systemuser_id"); - } - - [Fact] - public void CreateDialogDetailsRequestShouldReturnCorrectRequestForConsumerOrgAndPersonParty() - { - // Arrange - var request = CreateDialogDetailsAuthorizationRequest( - GetAsClaims( - // Should be copied as subject claim since there's not a "pid"-claim - ("consumer", ConsumerClaimValue) - ), - $"{NorwegianPersonIdentifier.PrefixWithSeparator}16073422888"); - - // Act - var result = DecisionRequestHelper.CreateDialogDetailsRequest(request); - - // Assert - // Check that we have the organizationnumber - var accessSubject = result.Request.AccessSubject.First(); - Assert.Contains(accessSubject.Attribute, a => a.AttributeId == "urn:altinn:organization:identifier-no" && a.Value == "991825827"); - - // Check that we have the ssn attribute as resource owner - var resource1 = result.Request.Resource.FirstOrDefault(r => r.Id == "r1"); - Assert.NotNull(resource1); - Assert.Contains(resource1.Attribute, a => a.AttributeId == "urn:altinn:person:identifier-no" && a.Value == "16073422888"); + Assert.Single(accessSubject.Attribute); } [Fact] @@ -186,7 +157,7 @@ public void CreateDialogDetailsRequestShouldReturnCorrectRequestForOverriddenRes // Arrange var request = CreateDialogDetailsAuthorizationRequest( GetAsClaims( - ("consumer", ConsumerClaimValue) + ("pid", "12345678901") ), $"{NorwegianPersonIdentifier.PrefixWithSeparator}16073422888"); @@ -211,7 +182,7 @@ public void CreateDialogDetailsRequestShouldReturnCorrectRequestForOverriddenRes // Arrange var request = CreateDialogDetailsAuthorizationRequest( GetAsClaims( - ("consumer", ConsumerClaimValue) + ("pid", "12345678901") ), $"{NorwegianPersonIdentifier.PrefixWithSeparator}16073422888"); @@ -238,7 +209,7 @@ public void CreateDialogDetailsRequestShouldReturnCorrectRequestForFullyQualifie // Arrange var request = CreateDialogDetailsAuthorizationRequest( GetAsClaims( - ("consumer", ConsumerClaimValue) + ("pid", "12345678901") ), $"{NorwegianPersonIdentifier.PrefixWithSeparator}16073422888"); @@ -262,8 +233,7 @@ public void CreateDialogDetailsResponseShouldReturnCorrectResponse() // Arrange var request = CreateDialogDetailsAuthorizationRequest( GetAsClaims( - // Should be copied as subject claim since there's not a "pid"-claim - ("consumer", ConsumerClaimValue) + ("pid", "12345678901") ), $"{NorwegianPersonIdentifier.PrefixWithSeparator}12345678901"); @@ -287,6 +257,21 @@ public void CreateDialogDetailsResponseShouldReturnCorrectResponse() Assert.DoesNotContain(new AltinnAction("failaction", Constants.MainResource), response.AuthorizedAltinnActions); } + [Fact] + public void CreateDetailsRequestShouldThrowUnreachableExceptionIfNoValidUserType() + { + // Arrange + var request = CreateDialogDetailsAuthorizationRequest( + GetAsClaims( + ("consumer", "somevalue") + ), + $"{NorwegianOrganizationIdentifier.PrefixWithSeparator}713330310"); + + // Act / assert + Assert.Throws(() => DecisionRequestHelper.CreateDialogDetailsRequest(request)); + } + + private static DialogDetailsAuthorizationRequest CreateDialogDetailsAuthorizationRequest(List principalClaims, string party, bool isApp = false) { var allClaims = new List From 92967b6c1048a73832d3c4b9fda87876a137b282 Mon Sep 17 00:00:00 2001 From: Are Almaas Date: Wed, 30 Oct 2024 10:22:11 +0100 Subject: [PATCH 2/7] chore(main): release 1.27.1 (#1360) :robot: I have created a release *beep* *boop* --- ## [1.27.1](https://github.com/digdir/dialogporten/compare/v1.27.0...v1.27.1) (2024-10-30) ### Bug Fixes * Simplify subject attribute matching ([#1348](https://github.com/digdir/dialogporten/issues/1348)) ([55159b7](https://github.com/digdir/dialogporten/commit/55159b772578e58d3406dd8028e9c14d9b3254e1)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ version.txt | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1af7974edd..5519c11221 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.27.1](https://github.com/digdir/dialogporten/compare/v1.27.0...v1.27.1) (2024-10-30) + + +### Bug Fixes + +* Simplify subject attribute matching ([#1348](https://github.com/digdir/dialogporten/issues/1348)) ([55159b7](https://github.com/digdir/dialogporten/commit/55159b772578e58d3406dd8028e9c14d9b3254e1)) + ## [1.27.0](https://github.com/digdir/dialogporten/compare/v1.26.3...v1.27.0) (2024-10-29) diff --git a/version.txt b/version.txt index 5db08bf2dc..08002f86cc 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.27.0 +1.27.1 From b3a01e8798867bb10dc8d7705ac88c9535507f24 Mon Sep 17 00:00:00 2001 From: Dagfinn Olsen Date: Thu, 31 Oct 2024 11:14:56 +0100 Subject: [PATCH 3/7] test(load-test): Performance tests for create dialog and search (#1331) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description See commits for details ## Related Issue(s) - #1326 ## Verification - [ ] **Your** code builds clean without any errors or warnings - [x] Manual testing done (required) - [ ] Relevant automated test added (if you find this hard, leave it and we'll help out) ## Documentation - [ ] Documentation is updated (either in `docs`-directory, Altinnpedia or a separate linked PR in [altinn-studio-docs.](https://github.com/Altinn/altinn-studio-docs), if applicable) ## Summary by CodeRabbit - **New Features** - Introduced new GitHub Actions workflows for K6 performance testing, allowing manual execution with customizable parameters. - Added performance testing scripts for end-user interactions and dialog creation using the K6 framework. - **Bug Fixes** - Improved handling of authorization headers in request parameter functions. - **Chores** - Updated `.gitignore` to exclude sensitive files and generated token files. - Added a script for generating tokens for service owners and end users. --------- Co-authored-by: Ole Jørgen Skogstad Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .github/workflows/dispatch-k6-performance.yml | 60 ++++++++++++ .../workflow-run-k6-performance.yml | 55 +++++++++++ .gitignore | 7 ++ tests/k6/common/request.js | 7 +- .../enduser/performance/simple-search.js | 57 +++++++++++ .../performancetest_data/endusers-staging.csv | 2 + .../serviceowners-staging.csv | 2 + tests/k6/tests/scripts/generate_tokens.sh | 94 +++++++++++++++++++ .../serviceowner/performance/create-dialog.js | 49 ++++++++++ .../performance/createremove-no-delay.js | 2 +- .../serviceowner/testdata/01-create-dialog.js | 4 +- 11 files changed, 334 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/dispatch-k6-performance.yml create mode 100644 .github/workflows/performance-workflows/workflow-run-k6-performance.yml create mode 100644 tests/k6/tests/enduser/performance/simple-search.js create mode 100644 tests/k6/tests/performancetest_data/endusers-staging.csv create mode 100644 tests/k6/tests/performancetest_data/serviceowners-staging.csv create mode 100755 tests/k6/tests/scripts/generate_tokens.sh create mode 100644 tests/k6/tests/serviceowner/performance/create-dialog.js diff --git a/.github/workflows/dispatch-k6-performance.yml b/.github/workflows/dispatch-k6-performance.yml new file mode 100644 index 0000000000..03f02c4714 --- /dev/null +++ b/.github/workflows/dispatch-k6-performance.yml @@ -0,0 +1,60 @@ +name: Run K6 performance test + +on: + workflow_dispatch: + inputs: + apiVersion: + description: 'API Version' + required: true + default: 'v1' + environment: + description: 'Environment' + required: true + default: 'staging' + type: choice + options: + - test + - staging + - performance + tokens: + description: 'Tokens to generate; for create dialog, search, none, or both' + required: true + default: 'both' + type: choice + options: + - both + - enterprise + - personal + - none + vus: + description: 'Number of VUS' + required: true + type: number + default: 10 + duration: + description: 'Duration of test, ie 30s, 1m, 10m' + required: true + default: 1m + type: string + testSuitePath: + description: 'Path to test suite to run' + required: true + default: 'tests/k6/tests/serviceowner/performance/create-dialog.js' + +jobs: + k6-performance: + name: "Run K6 performance test" + uses: ./.github/workflows/performance-workflows/workflow-run-k6-performance.yml + secrets: + TOKEN_GENERATOR_USERNAME: ${{ secrets.TOKEN_GENERATOR_USERNAME }} + TOKEN_GENERATOR_PASSWORD: ${{ secrets.TOKEN_GENERATOR_PASSWORD }} + K6_CLOUD_TOKEN: ${{ secrets.K6_CLOUD_TOKEN }} + K6_CLOUD_PROJECT_ID: ${{ secrets.K6_CLOUD_PROJECT_ID }} + with: + environment: ${{ inputs.environment }} + apiVersion: ${{ inputs.apiVersion }} + testSuitePath: ${{ inputs.testSuitePath }} + vus: ${{ inputs.vus }} + duration: ${{ inputs.duration }} + tokens: ${{ inputs.tokens }} + diff --git a/.github/workflows/performance-workflows/workflow-run-k6-performance.yml b/.github/workflows/performance-workflows/workflow-run-k6-performance.yml new file mode 100644 index 0000000000..bd55f70cdd --- /dev/null +++ b/.github/workflows/performance-workflows/workflow-run-k6-performance.yml @@ -0,0 +1,55 @@ +name: Run K6 performance tests + +on: + workflow_call: + inputs: + apiVersion: + required: true + type: string + environment: + required: true + type: string + testSuitePath: + required: true + type: string + vus: + required: true + type: number + duration: + required: true + type: string + tokens: + required: true + type: string + secrets: + TOKEN_GENERATOR_USERNAME: + required: true + TOKEN_GENERATOR_PASSWORD: + required: true + K6_CLOUD_TOKEN: + required: true + K6_CLOUD_PROJECT_ID: + required: true + +jobs: + k6-test: + runs-on: ubuntu-latest + permissions: + checks: write + pull-requests: write + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Setup k6 + uses: grafana/setup-k6-action@v1 + - name: Run K6 tests (${{ inputs.testSuitePath }}) + run: | + ./tests/k6/tests/scripts/generate_tokens.sh ./tests/k6/tests/performancetest_data ${{ inputs.tokens }} + k6 run ${{ inputs.testSuitePath }} --quiet --log-output=stdout --include-system-env-vars --vus=${{ inputs.vus }} --duration=${{ inputs.duration }} + env: + API_ENVIRONMENT: ${{ inputs.environment }} + API_VERSION: ${{ inputs.apiVersion }} + TOKEN_GENERATOR_USERNAME: ${{ secrets.TOKEN_GENERATOR_USERNAME }} + TOKEN_GENERATOR_PASSWORD: ${{ secrets.TOKEN_GENERATOR_PASSWORD }} + K6_CLOUD_TOKEN: ${{ secrets.K6_CLOUD_TOKEN }} + K6_CLOUD_PROJECT_ID: ${{ secrets.K6_CLOUD_PROJECT_ID }} diff --git a/.gitignore b/.gitignore index 8b4c08a26a..bedd35f4e5 100644 --- a/.gitignore +++ b/.gitignore @@ -374,3 +374,10 @@ FodyWeavers.xsd # MacOS .DS_Store + +# Secrets file used by act +.secrets + +# Generated files with tokens +**/.endusers-with-tokens.csv +**/.serviceowners-with-tokens.csv diff --git a/tests/k6/common/request.js b/tests/k6/common/request.js index 80bb431252..cc2be8457c 100644 --- a/tests/k6/common/request.js +++ b/tests/k6/common/request.js @@ -18,7 +18,7 @@ function resolveParams(defaultParams, params) { function getServiceOwnerRequestParams(params = null, tokenOptions = null) { params = params || {}; - const headers = params.Headers || {}; + const headers = params.headers || {}; const hasOverridenAuthorizationHeader = headers.Authorization !== undefined; const defaultParams = { @@ -33,11 +33,14 @@ function getServiceOwnerRequestParams(params = null, tokenOptions = null) { } function getEnduserRequestParams(params = null, tokenOptions = null) { + params = params || {}; + const headers = params.headers || {}; + const hasOverridenAuthorizationHeader = headers.Authorization !== undefined; let defaultParams = { headers: { 'Accept': 'application/json', 'User-Agent': 'dialogporten-k6', - 'Authorization': 'Bearer ' + getEnduserTokenFromGenerator(tokenOptions) + 'Authorization': hasOverridenAuthorizationHeader ? headers.Authorization : 'Bearer ' + getEnduserTokenFromGenerator(tokenOptions) } } diff --git a/tests/k6/tests/enduser/performance/simple-search.js b/tests/k6/tests/enduser/performance/simple-search.js new file mode 100644 index 0000000000..be99517b2b --- /dev/null +++ b/tests/k6/tests/enduser/performance/simple-search.js @@ -0,0 +1,57 @@ +import { getEU, expect, expectStatusFor, describe } from "../../../common/testimports.js"; +import { SharedArray } from 'k6/data'; +import papaparse from 'https://jslib.k6.io/papaparse/5.1.1/index.js'; +import { randomItem } from 'https://jslib.k6.io/k6-utils/1.2.0/index.js'; + +const filenameEndusers = '../../performancetest_data/.endusers-with-tokens.csv'; + +const endUsers = new SharedArray('endUsers', function () { + try { + const csvData = papaparse.parse(open(filenameEndusers), { header: true, skipEmptyLines: true }).data; + if (!csvData.length) { + throw new Error('No data found in CSV file'); + } + csvData.forEach((user, index) => { + if (!user.token || !user.ssn) { + throw new Error(`Missing required fields at row ${index + 1}`); + } + }); + return csvData; + } catch (error) { + throw new Error(`Failed to load end users: ${error.message}`); + } +}); + +export let options = { + summaryTrendStats: ['avg', 'min', 'med', 'max', 'p(95)', 'p(99)', 'p(99.5)', 'p(99.9)', 'count'], + thresholds: { + 'http_req_duration{name:simple search}': [], + 'http_reqs{name:simple search}': [], + }, +}; + +export default function() { + if ((options.vus === undefined || options.vus === 1) && (options.iterations === undefined || options.iterations === 1)) { + simpleSearch(endUsers[0]); + } + else { + simpleSearch(randomItem(endUsers)); + } +} + +export function simpleSearch(enduser) { + let paramsWithToken = { + headers: { + Authorization: "Bearer " + enduser.token + }, + tags: { name: 'simple search' } + } + let defaultParty = "urn:altinn:person:identifier-no:" + enduser.ssn; + let defaultFilter = "?Party=" + defaultParty; + describe('Perform simple dialog list', () => { + let r = getEU('dialogs' + defaultFilter, paramsWithToken); + expectStatusFor(r).to.equal(200); + expect(r, 'response').to.have.validJsonBody(); + }); +} + diff --git a/tests/k6/tests/performancetest_data/endusers-staging.csv b/tests/k6/tests/performancetest_data/endusers-staging.csv new file mode 100644 index 0000000000..28cf9dcdbb --- /dev/null +++ b/tests/k6/tests/performancetest_data/endusers-staging.csv @@ -0,0 +1,2 @@ +ssn,resource,scopes +08895699684,super-simple-service,digdir:dialogporten diff --git a/tests/k6/tests/performancetest_data/serviceowners-staging.csv b/tests/k6/tests/performancetest_data/serviceowners-staging.csv new file mode 100644 index 0000000000..449a5e7c60 --- /dev/null +++ b/tests/k6/tests/performancetest_data/serviceowners-staging.csv @@ -0,0 +1,2 @@ +org,orgno,scopes,resource +digdir,991825827,digdir:dialogporten.serviceprovider,super-simple-service diff --git a/tests/k6/tests/scripts/generate_tokens.sh b/tests/k6/tests/scripts/generate_tokens.sh new file mode 100755 index 0000000000..06df1ab241 --- /dev/null +++ b/tests/k6/tests/scripts/generate_tokens.sh @@ -0,0 +1,94 @@ +#!/bin/bash + +# Check if required environment variables are set +if [ -z "$TOKEN_GENERATOR_USERNAME" ] || [ -z "$TOKEN_GENERATOR_PASSWORD" ] || [ -z "$API_ENVIRONMENT" ]; then + echo "Error: TOKEN_GENERATOR_USERNAME, TOKEN_GENERATOR_PASSWORD, and API_ENVIRONMENT must be set" + exit 1 +fi + +# Function to display usage information +usage() { + echo "Usage: $0 " + echo " : Path to the test data files" + echo " : Type of tokens to generate (both, enterprise, or personal)" + exit 1 +} + +# Validate arguments +if [ $# -ne 2 ]; then + usage +fi + +tokengenuser=${TOKEN_GENERATOR_USERNAME} +tokengenpasswd=${TOKEN_GENERATOR_PASSWORD} + +env="" +case $API_ENVIRONMENT in + "test") + env="at21" ;; + "staging") + env="tt02" ;; + "performance") + env="yt01" ;; + *) + echo "Error: Unknown api environment $API_ENVIRONMENT" + exit 1 ;; +esac + +testdatafilepath=$1 +tokens=$2 + +# Validate tokens argument +if [[ ! "$tokens" =~ ^(both|enterprise|personal)$ ]]; then + echo "Error: Invalid token type. Must be 'both', 'enterprise', or 'personal'." + usage +fi + +serviceowner_datafile="$testdatafilepath/serviceowners-$API_ENVIRONMENT.csv" +serviceowner_tokenfile="$testdatafilepath/.serviceowners-with-tokens.csv" +enduser_datafile="$testdatafilepath/endusers-$API_ENVIRONMENT.csv" +enduser_tokenfile="$testdatafilepath/.endusers-with-tokens.csv" + +if [ "$tokens" = "both" ] || [ "$tokens" = "enterprise" ]; then + if [ ! -f "$serviceowner_datafile" ]; then + echo "Error: Input file not found: $serviceowner_datafile" + exit 1 + fi + echo "org,orgno,scopes,resource,token" > $serviceowner_tokenfile + while IFS=, read -r org orgno scopes resource + do + url="https://altinn-testtools-token-generator.azurewebsites.net/api/GetEnterpriseToken?org=$org&env=$env&scopes=$scopes&orgno=$orgno&ttl=3600" + token=$(curl -s -f $url -u "$tokengenuser:$tokengenpasswd" ) + if [ $? -ne 0 ]; then + echo "Error: Failed to generate enterprise token for: $env, $org, $orgno, $scopes " + continue + fi + echo "$org,$orgno,$scopes,$resource,$token" >> $serviceowner_tokenfile + status=$? + if [ $status -ne 0 ]; then + echo "Error: Failed to write enterprise token to file for: $env, $org, $orgno, $scopes" + fi + done < <(tail -n +2 $serviceowner_datafile) +fi + +if [ "$tokens" = "both" ] || [ "$tokens" = "personal" ]; then + if [ ! -f "$enduser_datafile" ]; then + echo "Error: Input file not found: $enduser_datafile" + exit 1 + fi + echo "ssn,resource,scopes,token" > $enduser_tokenfile + while IFS=, read -r ssn resource scopes + do + url="https://altinn-testtools-token-generator.azurewebsites.net/api/GetPersonalToken?env=$env&scopes=$scopes&pid=$ssn&ttl=3600" + token=$(curl -s -f $url -u "$tokengenuser:$tokengenpasswd" ) + if [ $? -ne 0 ]; then + echo "Error: Failed to generate personal token for: $ssn, $scopes " + continue + fi + echo "$ssn,$resource,$scopes,$token" >> $enduser_tokenfile + status=$? + if [ $status -ne 0 ]; then + echo "Error: Failed to write personal token to file for: $ssn, $scopes" + fi + done < <(tail -n +2 $enduser_datafile) +fi diff --git a/tests/k6/tests/serviceowner/performance/create-dialog.js b/tests/k6/tests/serviceowner/performance/create-dialog.js new file mode 100644 index 0000000000..60aef04e92 --- /dev/null +++ b/tests/k6/tests/serviceowner/performance/create-dialog.js @@ -0,0 +1,49 @@ +import { postSO, expect, describe } from "../../../common/testimports.js"; +import { SharedArray } from 'k6/data'; +import papaparse from 'https://jslib.k6.io/papaparse/5.1.1/index.js'; +import { default as dialogToInsert } from '../testdata/01-create-dialog.js'; +import { randomItem } from 'https://jslib.k6.io/k6-utils/1.2.0/index.js'; + +const filenameServiceowners = '../../performancetest_data/.serviceowners-with-tokens.csv'; +const filenameEndusers = `../../performancetest_data/endusers-${__ENV.API_ENVIRONMENT}.csv`; + +const serviceOwners = new SharedArray('serviceOwners', function () { + return papaparse.parse(open(filenameServiceowners), { header: true, skipEmptyLines: true }).data; +}); + +const endUsers = new SharedArray('endUsers', function () { + return papaparse.parse(open(filenameEndusers), { header: true, skipEmptyLines: true }).data; + }); + +export let options = { + summaryTrendStats: ['avg', 'min', 'med', 'max', 'p(95)', 'p(99)', 'p(99.5)', 'p(99.9)', 'count'], + thresholds: { + 'http_req_duration{scenario:default}': [`max>=0`], + 'http_req_duration{name:create dialog}': [], + 'http_reqs{name:create dialog}': [], + }, +}; + +export default function() { + if ((options.vus === undefined || options.vus === 1) && (options.iterations === undefined || options.iterations === 1)) { + createDialog(serviceOwners[0], endUsers[0]); + } + else { + createDialog(randomItem(serviceOwners), randomItem(endUsers)); + } + } + +export function createDialog(serviceOwner, endUser) { + var paramsWithToken = { + headers: { + Authorization: "Bearer " + serviceOwner.token + }, + tags: { name: 'create dialog' } + } + + describe('create dialog', () => { + let r = postSO('dialogs', dialogToInsert(endUser.ssn), paramsWithToken); + expect(r.status, 'response status').to.equal(201); + }); + +} \ No newline at end of file diff --git a/tests/k6/tests/serviceowner/performance/createremove-no-delay.js b/tests/k6/tests/serviceowner/performance/createremove-no-delay.js index 4dbb6b095f..27a3a380f3 100644 --- a/tests/k6/tests/serviceowner/performance/createremove-no-delay.js +++ b/tests/k6/tests/serviceowner/performance/createremove-no-delay.js @@ -4,7 +4,7 @@ import { default as dialogToInsert } from '../testdata/01-create-dialog.js'; export function setup() { // Get the token during setup stage so that it doesn't interfere with timings return { - Headers: { + headers: { Authorization: "Bearer " + getServiceOwnerTokenFromGenerator() } } diff --git a/tests/k6/tests/serviceowner/testdata/01-create-dialog.js b/tests/k6/tests/serviceowner/testdata/01-create-dialog.js index 0bbc7b1cd6..940ecfba6f 100644 --- a/tests/k6/tests/serviceowner/testdata/01-create-dialog.js +++ b/tests/k6/tests/serviceowner/testdata/01-create-dialog.js @@ -2,10 +2,10 @@ import { uuidv4 } from '../../../common/testimports.js' import { getDefaultEnduserSsn } from "../../../common/token.js"; import { sentinelValue } from "../../../common/config.js"; -export default function () { +export default function (endUser = getDefaultEnduserSsn()) { return { "serviceResource": "urn:altinn:resource:ttd-dialogporten-automated-tests", // urn starting with urn:altinn:resource: - "party": "urn:altinn:person:identifier-no:" + getDefaultEnduserSsn(), // or urn:altinn:organization:identifier-no:<9 digits> + "party": "urn:altinn:person:identifier-no:" + endUser, // or urn:altinn:organization:identifier-no:<9 digits> "status": "new", // valid values: new, inprogress, waiting, signing, cancelled, completed "extendedStatus": "urn:any/valid/uri", "dueAt": "2033-11-25T06:37:54.2920190Z", // must be UTC From 49c1d8042040fe5e9eef1646a76b7c7ecaac062f Mon Sep 17 00:00:00 2001 From: Dagfinn Olsen Date: Thu, 31 Oct 2024 12:02:06 +0100 Subject: [PATCH 4/7] fix: fixed placement of referenced workflow-file (#1365) ## Description Placed a referenced workflow-file in .github/workflows/. Not allowed according to github. Fixed ## Related Issue(s) - #1326 ## Verification - [ ] **Your** code builds clean without any errors or warnings - [ ] Manual testing done (required) - [ ] Relevant automated test added (if you find this hard, leave it and we'll help out) ## Documentation - [ ] Documentation is updated (either in `docs`-directory, Altinnpedia or a separate linked PR in [altinn-studio-docs.](https://github.com/Altinn/altinn-studio-docs), if applicable) --- .github/workflows/dispatch-k6-performance.yml | 2 +- .../{performance-workflows => }/workflow-run-k6-performance.yml | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{performance-workflows => }/workflow-run-k6-performance.yml (100%) diff --git a/.github/workflows/dispatch-k6-performance.yml b/.github/workflows/dispatch-k6-performance.yml index 03f02c4714..d06c594fa8 100644 --- a/.github/workflows/dispatch-k6-performance.yml +++ b/.github/workflows/dispatch-k6-performance.yml @@ -44,7 +44,7 @@ on: jobs: k6-performance: name: "Run K6 performance test" - uses: ./.github/workflows/performance-workflows/workflow-run-k6-performance.yml + uses: ./.github/workflows/workflow-run-k6-performance.yml secrets: TOKEN_GENERATOR_USERNAME: ${{ secrets.TOKEN_GENERATOR_USERNAME }} TOKEN_GENERATOR_PASSWORD: ${{ secrets.TOKEN_GENERATOR_PASSWORD }} diff --git a/.github/workflows/performance-workflows/workflow-run-k6-performance.yml b/.github/workflows/workflow-run-k6-performance.yml similarity index 100% rename from .github/workflows/performance-workflows/workflow-run-k6-performance.yml rename to .github/workflows/workflow-run-k6-performance.yml From 4974676733079b62cadb7ac0892fbcb4d0659d5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20J=C3=B8rgen=20Skogstad?= Date: Thu, 31 Oct 2024 13:15:39 +0100 Subject: [PATCH 5/7] chore: Temp. disable caching for AuthorizedParties requests (#1368) --- .../Altinn/Authorization/AltinnAuthorizationClient.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Digdir.Domain.Dialogporten.Infrastructure/Altinn/Authorization/AltinnAuthorizationClient.cs b/src/Digdir.Domain.Dialogporten.Infrastructure/Altinn/Authorization/AltinnAuthorizationClient.cs index b676e36c99..96adb19e9d 100644 --- a/src/Digdir.Domain.Dialogporten.Infrastructure/Altinn/Authorization/AltinnAuthorizationClient.cs +++ b/src/Digdir.Domain.Dialogporten.Infrastructure/Altinn/Authorization/AltinnAuthorizationClient.cs @@ -81,9 +81,9 @@ public async Task GetAuthorizedParties(IPartyIdentifier CancellationToken cancellationToken = default) { var authorizedPartiesRequest = new AuthorizedPartiesRequest(authenticatedParty); - var authorizedParties = await _partiesCache.GetOrSetAsync(authorizedPartiesRequest.GenerateCacheKey(), async token - => await PerformAuthorizedPartiesRequest(authorizedPartiesRequest, token), token: cancellationToken); - + // var authorizedParties = await _partiesCache.GetOrSetAsync(authorizedPartiesRequest.GenerateCacheKey(), async token + // => await PerformAuthorizedPartiesRequest(authorizedPartiesRequest, token), token: cancellationToken); + var authorizedParties = await PerformAuthorizedPartiesRequest(authorizedPartiesRequest, cancellationToken); return flatten ? GetFlattenedAuthorizedParties(authorizedParties) : authorizedParties; } From 16f160d5f5a2293444ac63c0ae13a713b3afe318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Dybvik=20Langfors?= Date: Thu, 31 Oct 2024 14:59:33 +0100 Subject: [PATCH 6/7] fix: Add system user id to identifying claims (#1362) ## Description This adds a check to include the system user id in the list of identifiable claims, which is in turn used to generate a cache key for authorization requests on dialog details accesses. ## Related Issue(s) - #1363 ## Verification - [x] **Your** code builds clean without any errors or warnings - [x] Manual testing done (required) - [x] Relevant automated test added (if you find this hard, leave it and we'll help out) ## Summary by CodeRabbit - **New Features** - Introduced methods to simplify the retrieval of system user IDs from claims. - Enhanced claims processing to include system user identifiers from authorization details. - **Bug Fixes** - Streamlined logic in handling user ID extraction, improving efficiency. - **Tests** - Added a test to verify the correct extraction of system user identifiers from claims. --- .../Extensions/ClaimsPrincipalExtensions.cs | 28 +++++++++++++++++-- .../Authorization/DecisionRequestHelper.cs | 2 +- .../ClaimsPrincipalExtensionsTests.cs | 15 ++++++++++ 3 files changed, 41 insertions(+), 4 deletions(-) diff --git a/src/Digdir.Domain.Dialogporten.Application/Common/Extensions/ClaimsPrincipalExtensions.cs b/src/Digdir.Domain.Dialogporten.Application/Common/Extensions/ClaimsPrincipalExtensions.cs index b25af8c282..0ebda5a25f 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Common/Extensions/ClaimsPrincipalExtensions.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Common/Extensions/ClaimsPrincipalExtensions.cs @@ -110,6 +110,14 @@ private static bool TryGetAuthorizationDetailsClaimValue(this ClaimsPrincipal cl return authorizationDetails is not null; } + public static bool TryGetSystemUserId(this Claim claim, + [NotNullWhen(true)] out string? systemUserId) => + new List { claim }.TryGetSystemUserId(out systemUserId); + + public static bool TryGetSystemUserId(this List claimsList, + [NotNullWhen(true)] out string? systemUserId) => + new ClaimsPrincipal(new ClaimsIdentity(claimsList.ToArray())).TryGetSystemUserId(out systemUserId); + public static bool TryGetSystemUserId(this ClaimsPrincipal claimsPrincipal, [NotNullWhen(true)] out string? systemUserId) { @@ -198,14 +206,28 @@ public static bool TryGetAuthenticationLevel(this ClaimsPrincipal claimsPrincipa return false; } - public static IEnumerable GetIdentifyingClaims(this List claims) => - claims.Where(c => + public static IEnumerable GetIdentifyingClaims(this IEnumerable claims) + { + var claimsList = claims.ToList(); + + var identifyingClaims = claimsList.Where(c => c.Type == PidClaim || c.Type == ConsumerClaim || c.Type == SupplierClaim || c.Type == IdportenAuthLevelClaim || c.Type.StartsWith(AltinnClaimPrefix, StringComparison.Ordinal) - ).OrderBy(c => c.Type); + ).OrderBy(c => c.Type).ToList(); + + // If we have a RAR-claim, this is most likely a system user. Attempt to extract the + // systemuser-uuid from the authorization_details claim and add to the list. + var rarClaim = claimsList.FirstOrDefault(c => c.Type == AuthorizationDetailsClaim); + if (rarClaim != null && rarClaim.TryGetSystemUserId(out var systemUserId)) + { + identifyingClaims.Add(new Claim(AuthorizationDetailsType, systemUserId)); + } + + return identifyingClaims; + } public static (UserIdType, string externalId) GetUserType(this ClaimsPrincipal claimsPrincipal) { diff --git a/src/Digdir.Domain.Dialogporten.Infrastructure/Altinn/Authorization/DecisionRequestHelper.cs b/src/Digdir.Domain.Dialogporten.Infrastructure/Altinn/Authorization/DecisionRequestHelper.cs index a5f8f36b6f..92648cc797 100644 --- a/src/Digdir.Domain.Dialogporten.Infrastructure/Altinn/Authorization/DecisionRequestHelper.cs +++ b/src/Digdir.Domain.Dialogporten.Infrastructure/Altinn/Authorization/DecisionRequestHelper.cs @@ -101,7 +101,7 @@ private static List CreateAccessSubjectCategory(IEnumerable new XacmlJsonCategory + RarAuthorizationDetailsClaimType when claim.TryGetSystemUserId(out var systemUserId) => new XacmlJsonCategory { Id = SubjectId, Attribute = diff --git a/tests/Digdir.Domain.Dialogporten.Application.Unit.Tests/Features/V1/Common/Extensions/ClaimsPrincipalExtensionsTests.cs b/tests/Digdir.Domain.Dialogporten.Application.Unit.Tests/Features/V1/Common/Extensions/ClaimsPrincipalExtensionsTests.cs index 42ff004311..938d1c6d6e 100644 --- a/tests/Digdir.Domain.Dialogporten.Application.Unit.Tests/Features/V1/Common/Extensions/ClaimsPrincipalExtensionsTests.cs +++ b/tests/Digdir.Domain.Dialogporten.Application.Unit.Tests/Features/V1/Common/Extensions/ClaimsPrincipalExtensionsTests.cs @@ -53,4 +53,19 @@ public void TryGetAuthenticationLevel_Should_Parse_Altinn_Authlevel_First() Assert.True(result); Assert.Equal(5, authenticationLevel); } + + [Fact] + public void GetIdentifyingClaims_Should_Include_SystemUserIdentifier_From_AuthorizationDetails() + { + // Arrange + var claimsPrincipal = new ClaimsPrincipal(new ClaimsIdentity([ + new Claim("authorization_details", "[{\"type\":\"urn:altinn:systemuser\",\"systemuser_id\":[\"e3b87b08-dce6-4edd-8308-db887950a83b\"],\"systemuser_org\":{\"authority\":\"iso6523-actorid-upis\",\"ID\":\"0192:991825827\"},\"system_id\":\"1d81b874-f139-4842-bd0a-e5cc64319272\"}]") + ])); + + // Act + var identifyingClaims = claimsPrincipal.Claims.GetIdentifyingClaims(); + + // Assert + Assert.Contains(identifyingClaims, c => c.Type == "urn:altinn:systemuser" && c.Value == "e3b87b08-dce6-4edd-8308-db887950a83b"); + } } From 94c55446dbc52ec69def8a74bab6bf7a928d2f3c Mon Sep 17 00:00:00 2001 From: Amund Date: Thu, 31 Oct 2024 15:40:33 +0100 Subject: [PATCH 7/7] feat: update swagger name generation (#1350) --- docs/schema/V1/swagger.verified.json | 6021 +++++++++-------- ...GetDialogActivityDto.cs => ActivityDto.cs} | 6 +- ...ogActivityQuery.cs => GetActivityQuery.cs} | 12 +- .../Queries/Get/MappingProfile.cs | 4 +- ...rchDialogActivityDto.cs => ActivityDto.cs} | 2 +- .../Queries/Search/MappingProfile.cs | 2 +- ...ctivityQuery.cs => SearchActivityQuery.cs} | 12 +- ...mentLogDto.cs => LabelAssignmentLogDto.cs} | 2 +- .../Queries/Search/MappingProfile.cs | 2 +- ...ry.cs => SearchLabelAssignmentLogQuery.cs} | 12 +- ...alogSeenLogQuery.cs => GetSeenLogQuery.cs} | 12 +- .../Queries/Get/MappingProfile.cs | 4 +- .../{GetDialogSeenLogDto.cs => SeenLogDto.cs} | 6 +- .../Queries/Search/MappingProfile.cs | 4 +- ...gSeenLogQuery.cs => SearchSeenLogQuery.cs} | 12 +- ...earchDialogSeenLogDto.cs => SeenLogDto.cs} | 6 +- .../SetDialogSystemLabelCommandValidator.cs | 2 +- ...mLabelCommand.cs => SystemLabelCommand.cs} | 14 +- ...logSystemLabelDto.cs => SystemLabelDto.cs} | 2 +- ...issionQuery.cs => GetTransmissionQuery.cs} | 12 +- .../Queries/Get/MappingProfile.cs | 12 +- ...gTransmissionDto.cs => TransmissionDto.cs} | 18 +- .../Queries/Search/MappingProfile.cs | 12 +- ...ionQuery.cs => SearchTransmissionQuery.cs} | 12 +- ...gTransmissionDto.cs => TransmissionDto.cs} | 18 +- .../Get/{GetDialogDto.cs => DialogDto.cs} | 62 +- .../Dialogs/Queries/Get/GetDialogQuery.cs | 10 +- .../Dialogs/Queries/Get/MappingProfile.cs | 36 +- .../{SearchDialogDto.cs => DialogDto.cs} | 8 +- ...earchDialogDtoBase.cs => DialogDtoBase.cs} | 18 +- .../Dialogs/Queries/Search/MappingProfile.cs | 16 +- .../Queries/Search/SearchDialogQuery.cs | 14 +- .../Search/SearchDialogQueryValidator.cs | 2 +- .../Parties/Queries/Get/GetPartiesQuery.cs | 8 +- .../Parties/Queries/Get/MappingProfile.cs | 2 +- .../Get/{GetPartiesDto.cs => PartiesDto.cs} | 2 +- ...GetDialogActivityDto.cs => ActivityDto.cs} | 6 +- ...ogActivityQuery.cs => GetActivityQuery.cs} | 12 +- .../Queries/Get/MappingProfile.cs | 4 +- ...rchDialogActivityDto.cs => ActivityDto.cs} | 2 +- .../Queries/Search/MappingProfile.cs | 2 +- ...ctivityQuery.cs => SearchActivityQuery.cs} | 12 +- ...alogSeenLogQuery.cs => GetSeenLogQuery.cs} | 12 +- .../Queries/Get/MappingProfile.cs | 4 +- .../{GetDialogSeenLogDto.cs => SeenLogDto.cs} | 6 +- .../Queries/Search/MappingProfile.cs | 4 +- ...gSeenLogQuery.cs => SearchSeenLogQuery.cs} | 12 +- .../{SearchSeenLogDto.cs => SeenLogDto.cs} | 6 +- ...issionQuery.cs => GetTransmissionQuery.cs} | 14 +- .../Queries/Get/MappingProfile.cs | 12 +- ...gTransmissionDto.cs => TransmissionDto.cs} | 18 +- .../Queries/Search/MappingProfile.cs | 12 +- ...ionQuery.cs => SearchTransmissionQuery.cs} | 14 +- ...gTransmissionDto.cs => TransmissionDto.cs} | 18 +- .../Create/CreateDialogCommandValidator.cs | 62 +- .../Commands/Create/CreateDialogDto.cs | 56 +- .../Dialogs/Commands/Create/MappingProfile.cs | 32 +- .../Dialogs/Commands/Update/MappingProfile.cs | 52 +- .../Commands/Update/UpdateDialogCommand.cs | 8 +- .../Update/UpdateDialogCommandValidator.cs | 62 +- .../Commands/Update/UpdateDialogDto.cs | 56 +- .../Get/{GetDialogDto.cs => DialogDto.cs} | 66 +- .../Dialogs/Queries/Get/GetDialogQuery.cs | 8 +- .../Dialogs/Queries/Get/MappingProfile.cs | 38 +- .../{SearchDialogDto.cs => DialogDto.cs} | 8 +- ...earchDialogDtoBase.cs => DialogDtoBase.cs} | 18 +- .../Dialogs/Queries/Search/MappingProfile.cs | 16 +- .../Queries/Search/SearchDialogQuery.cs | 12 +- .../Search/SearchDialogQueryValidator.cs | 2 +- .../EndUser/Common/MappingProfile.cs | 22 +- .../EndUser/DialogById/MappingProfile.cs | 26 +- .../EndUser/MutationTypes/MappingProfile.cs | 2 +- .../EndUser/MutationTypes/Mutations.cs | 2 +- .../EndUser/SearchDialogs/MappingProfile.cs | 6 +- .../Persistence/DialogDbContext.cs | 2 - .../Json/SuffixedSchemaNameGenerator.cs | 63 +- .../Common/Swagger/ISwaggerConfig.cs | 9 - .../Common/Swagger/TypeNameConverter.cs | 153 + .../Get/GetDialogActivityEndpoint.cs | 9 +- ...cs => GetDialogActivityEndpointSummary.cs} | 16 - .../Search/SearchDialogActivityEndpoint.cs | 6 +- ...=> SearchDialogActivityEndpointSummary.cs} | 14 +- .../SearchDialogLabelAssignmentLogEndpoint.cs | 10 +- ...earchDialogLabelAssignmentSwaggerConfig.cs | 17 - .../Get/GetDialogSeenLogEndpoint.cs | 10 +- ....cs => GetDialogSeenLogEndpointSummary.cs} | 15 - .../Search/SearchDialogSeenLogEndpoint.cs | 9 +- ... => SearchDialogSeenLogEndpointSummary.cs} | 16 - .../Set/SetDialogSystemLabelEndpoint.cs | 14 +- .../Set/SetDialogSystemLabelSwaggerConfig.cs | 16 - .../Get/GetDialogTransmissionEndpoint.cs | 9 +- ...> GetDialogTransmissionEndpointSummary.cs} | 16 - .../SearchDialogTransmissionEndpoint.cs | 6 +- ...earchDialogTransmissionEndpointSummary.cs} | 13 +- .../EndUser/Dialogs/Get/GetDialogEndpoint.cs | 7 +- ...rConfig.cs => GetDialogEndpointSummary.cs} | 16 - .../Dialogs/Search/SearchDialogEndpoint.cs | 5 +- ...nfig.cs => SearchDialogEndpointSummary.cs} | 13 - .../EndUser/Parties/Get/GetPartiesEndpoint.cs | 4 +- ...Config.cs => GetPartiesEndpointSummary.cs} | 14 - .../Create/CreateDialogActivityEndpoint.cs | 17 +- ...=> CreateDialogActivityEndpointSummary.cs} | 18 - .../Get/GetDialogActivityEndpoint.cs | 10 +- .../Get/GetDialogActivitySwaggerConfig.cs | 16 - .../NotificationConditionEndpoint.cs | 2 - ...=> SearchDialogActivityEndpointSummary.cs} | 12 - .../Search/SearchDialogActivityEndpoint.cs | 6 +- ...=> SearchDialogActivityEndpointSummary.cs} | 13 +- .../Get/GetDialogSeenLogEndpoint.cs | 9 +- ....cs => GetDialogSeenLogEndpointSummary.cs} | 15 - .../Search/SearchDialogSeenLogEndpoint.cs | 9 +- ... => SearchDialogSeenLogEndpointSummary.cs} | 16 - .../CreateDialogTransmissionEndpoint.cs | 17 +- ...reateDialogTransmissionEndpointSummary.cs} | 18 - .../Get/GetDialogTransmissionEndpoint.cs | 9 +- ...> GetDialogTransmissionEndpointSummary.cs} | 16 - .../SearchDialogTransmissionEndpoint.cs | 9 +- ...earchDialogTransmissionEndpointSummary.cs} | 13 +- .../Dialogs/Create/CreateDialogEndpoint.cs | 6 +- ...nfig.cs => CreateDialogEndpointSummary.cs} | 16 - .../Dialogs/Delete/DeleteDialogEndpoint.cs | 6 +- ...nfig.cs => DeleteDialogEndpointSummary.cs} | 16 - .../Dialogs/Get/GetDialogEndpoint.cs | 7 +- ...rConfig.cs => GetDialogEndpointSummary.cs} | 16 - .../Dialogs/Purge/PurgeDialogEndpoint.cs | 6 +- ...onfig.cs => PurgeDialogEndpointSummary.cs} | 17 - ...Config.cs => ListDialogEndpointSummary.cs} | 13 - .../Dialogs/Search/SearchDialogEndpoint.cs | 4 +- .../Dialogs/Update/UpdateDialogEndpoint.cs | 8 +- .../Update/UpdateDialogSwaggerConfig.cs | 34 +- .../V1/WellKnown/Jwks/Get/GetJwksEndpoint.cs | 3 +- ...gerConfig.cs => GetJwksEndpointSummary.cs} | 15 - .../GetOauthAuthorizationServerEndpoint.cs | 3 +- ...authAuthorizationServerEndpointSummary.cs} | 15 - .../OpenApiDocumentExtensions.cs | 2 +- .../Program.cs | 8 + .../DialogGenerator.cs | 70 +- .../V1/Common/Events/DomainEventsTests.cs | 2 +- .../Dialogs/Queries/ActivityLogTests.cs | 2 +- .../EndUser/Dialogs/Queries/SeenLogTests.cs | 4 +- .../Dialogs/Commands/UpdateDialogTests.cs | 9 +- .../Dialogs/Queries/ActivityLogTests.cs | 2 +- .../Dialogs/Queries/SeenLogTests.cs | 4 +- .../Commands/UpdateTransmissionTests.cs | 2 +- .../Features/V1/Common/ContentTypeTests.cs | 32 +- .../ObjectTypes/ContentTypeTests.cs | 2 +- 146 files changed, 3950 insertions(+), 4204 deletions(-) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Get/{GetDialogActivityDto.cs => ActivityDto.cs} (81%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Get/{GetDialogActivityQuery.cs => GetActivityQuery.cs} (83%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Search/{SearchDialogActivityDto.cs => ActivityDto.cs} (91%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Search/{SearchDialogActivityQuery.cs => SearchActivityQuery.cs} (76%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogLabelAssignmentLog/Queries/Search/{SearchDialogLabelAssignmentLogDto.cs => LabelAssignmentLogDto.cs} (90%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogLabelAssignmentLog/Queries/Search/{SearchDialogLabelAssignmentLogQuery.cs => SearchLabelAssignmentLogQuery.cs} (69%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Get/{GetDialogSeenLogQuery.cs => GetSeenLogQuery.cs} (84%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Get/{GetDialogSeenLogDto.cs => SeenLogDto.cs} (71%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Search/{SearchDialogSeenLogQuery.cs => SearchSeenLogQuery.cs} (81%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Search/{SearchDialogSeenLogDto.cs => SeenLogDto.cs} (70%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSystemLabels/Commands/Set/{SetDialogSystemLabelCommand.cs => SystemLabelCommand.cs} (77%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSystemLabels/Commands/Set/{SetDialogSystemLabelDto.cs => SystemLabelDto.cs} (87%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Get/{GetDialogTransmissionQuery.cs => GetTransmissionQuery.cs} (84%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Get/{GetDialogTransmissionDto.cs => TransmissionDto.cs} (88%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Search/{SearchDialogTransmissionQuery.cs => SearchTransmissionQuery.cs} (78%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Search/{SearchDialogTransmissionDto.cs => TransmissionDto.cs} (87%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Get/{GetDialogDto.cs => DialogDto.cs} (91%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/{SearchDialogDto.cs => DialogDto.cs} (86%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/{SearchDialogDtoBase.cs => DialogDtoBase.cs} (92%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Parties/Queries/Get/{GetPartiesDto.cs => PartiesDto.cs} (95%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Get/{GetDialogActivityDto.cs => ActivityDto.cs} (82%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Get/{GetDialogActivityQuery.cs => GetActivityQuery.cs} (78%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Search/{SearchDialogActivityDto.cs => ActivityDto.cs} (91%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Search/{SearchDialogActivityQuery.cs => SearchActivityQuery.cs} (68%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Get/{GetDialogSeenLogQuery.cs => GetSeenLogQuery.cs} (80%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Get/{GetDialogSeenLogDto.cs => SeenLogDto.cs} (69%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Search/{SearchDialogSeenLogQuery.cs => SearchSeenLogQuery.cs} (75%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Search/{SearchSeenLogDto.cs => SeenLogDto.cs} (71%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Get/{GetDialogTransmissionQuery.cs => GetTransmissionQuery.cs} (77%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Get/{GetDialogTransmissionDto.cs => TransmissionDto.cs} (87%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Search/{SearchDialogTransmissionQuery.cs => SearchTransmissionQuery.cs} (72%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Search/{SearchDialogTransmissionDto.cs => TransmissionDto.cs} (87%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Get/{GetDialogDto.cs => DialogDto.cs} (91%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/{SearchDialogDto.cs => DialogDto.cs} (86%) rename src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/{SearchDialogDtoBase.cs => DialogDtoBase.cs} (92%) delete mode 100644 src/Digdir.Domain.Dialogporten.WebApi/Common/Swagger/ISwaggerConfig.cs create mode 100644 src/Digdir.Domain.Dialogporten.WebApi/Common/Swagger/TypeNameConverter.cs rename src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogActivities/Get/{GetDialogActivitySwaggerConfig.cs => GetDialogActivityEndpointSummary.cs} (60%) rename src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogActivities/Search/{SearchDialogActivitySwaggerConfig.cs => SearchDialogActivityEndpointSummary.cs} (66%) delete mode 100644 src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogLabelAssignmentLogs/Search/SearchDialogLabelAssignmentSwaggerConfig.cs rename src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogSeenLogs/Get/{GetDialogSeenLogSwaggerConfig.cs => GetDialogSeenLogEndpointSummary.cs} (54%) rename src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogSeenLogs/Search/{SearchDialogSeenLogSwaggerConfig.cs => SearchDialogSeenLogEndpointSummary.cs} (54%) delete mode 100644 src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogSystemLabels/Set/SetDialogSystemLabelSwaggerConfig.cs rename src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogTransmissions/Get/{GetDialogTransmissionSwaggerConfig.cs => GetDialogTransmissionEndpointSummary.cs} (62%) rename src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogTransmissions/Search/{SearchDialogTransmissionSwaggerConfig.cs => SearchDialogTransmissionEndpointSummary.cs} (68%) rename src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Dialogs/Get/{GetDialogSwaggerConfig.cs => GetDialogEndpointSummary.cs} (59%) rename src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Dialogs/Search/{SearchDialogSwaggerConfig.cs => SearchDialogEndpointSummary.cs} (75%) rename src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Parties/Get/{GetPartiesSwaggerConfig.cs => GetPartiesEndpointSummary.cs} (50%) rename src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Create/{CreateDialogActivitySwaggerConfig.cs => CreateDialogActivityEndpointSummary.cs} (68%) rename src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/NotificationCondition/{NotificationConditionSwaggerConfig.cs => SearchDialogActivityEndpointSummary.cs} (72%) rename src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Search/{SearchDialogActivitySwaggerConfig.cs => SearchDialogActivityEndpointSummary.cs} (69%) rename src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogSeenLogs/Get/{GetDialogSeenLogSwaggerConfig.cs => GetDialogSeenLogEndpointSummary.cs} (50%) rename src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogSeenLogs/Search/{SearchDialogSeenLogSwaggerConfig.cs => SearchDialogSeenLogEndpointSummary.cs} (51%) rename src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Create/{CreateDialogTransmissionSwaggerConfig.cs => CreateDialogTransmissionEndpointSummary.cs} (68%) rename src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Get/{GetDialogTransmissionSwaggerConfig.cs => GetDialogTransmissionEndpointSummary.cs} (62%) rename src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Search/{SearchDialogTransmissionSwaggerConfig.cs => SearchDialogTransmissionEndpointSummary.cs} (68%) rename src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Create/{CreateDialogSwaggerConfig.cs => CreateDialogEndpointSummary.cs} (71%) rename src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Delete/{DeleteDialogSwaggerConfig.cs => DeleteDialogEndpointSummary.cs} (73%) rename src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Get/{GetDialogSwaggerConfig.cs => GetDialogEndpointSummary.cs} (64%) rename src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Purge/{PurgeDialogSwaggerConfig.cs => PurgeDialogEndpointSummary.cs} (68%) rename src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Search/{SwaggerConfig.cs => ListDialogEndpointSummary.cs} (78%) rename src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/WellKnown/Jwks/Get/{GetJwksSwaggerConfig.cs => GetJwksEndpointSummary.cs} (53%) rename src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/WellKnown/OauthAuthorizationServer/Get/{GetOauthAuthorizationServerSwaggerConfig.cs => GetOauthAuthorizationServerEndpointSummary.cs} (52%) diff --git a/docs/schema/V1/swagger.verified.json b/docs/schema/V1/swagger.verified.json index c13d2b9e3d..2529f84a7a 100644 --- a/docs/schema/V1/swagger.verified.json +++ b/docs/schema/V1/swagger.verified.json @@ -1,7 +1,7 @@ { "components": { "schemas": { - "ActorType_Values": { + "Actors_ActorType": { "description": "", "enum": [ "PartyRepresentative", @@ -13,7 +13,7 @@ "ServiceOwner" ] }, - "AttachmentUrlConsumerType_Values": { + "Attachments_AttachmentUrlConsumerType": { "description": "", "enum": [ "Gui", @@ -25,918 +25,322 @@ "Api" ] }, - "AuthorizedPartyDto": { - "additionalProperties": false, - "properties": { - "hasKeyRole": { - "type": "boolean" - }, - "hasOnlyAccessToSubParties": { - "type": "boolean" - }, - "isAccessManager": { - "type": "boolean" - }, - "isCurrentEndUser": { - "type": "boolean" - }, - "isDeleted": { - "type": "boolean" - }, - "isMainAdministrator": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "party": { - "type": "string" - }, - "partyType": { - "type": "string" - }, - "subParties": { - "items": { - "$ref": "#/components/schemas/AuthorizedPartyDto" - }, - "nullable": true, - "type": "array" - } - }, - "type": "object" - }, - "ContentValueDto": { - "additionalProperties": false, - "properties": { - "mediaType": { - "description": "Media type of the content (plaintext, Markdown). Can also indicate that the content is embeddable.", - "type": "string" - }, - "value": { - "description": "A list of localizations for the content.", - "items": { - "$ref": "#/components/schemas/LocalizationDto" - }, - "type": "array" - } - }, - "type": "object" - }, "ContinuationTokenSetOfTOrderDefinitionAndTTarget": {}, - "CreateDialogActivityRequest": { - "additionalProperties": false, - "properties": { - "createdAt": { - "description": "If supplied, overrides the creating date and time for the transmission.\nIf not supplied, the current date /time will be used.", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "description": { - "description": "Unstructured text describing the activity. Only set if the activity type is \u0022Information\u0022.", - "items": { - "$ref": "#/components/schemas/LocalizationDto" - }, - "type": "array" - }, - "extendedType": { - "description": "Arbitrary URI/URN describing a service-specific transmission type.", - "format": "uri", - "nullable": true, - "type": "string" - }, - "id": { - "description": "The UUDIv7 of the action may be provided to support idempotent additions to the list of activities.\nIf not supplied, a new UUIDv7 will be generated.", - "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", - "format": "guid", - "nullable": true, - "type": "string" - }, - "performedBy": { - "description": "The actor that performed the activity.", - "oneOf": [ - { - "$ref": "#/components/schemas/UpdateDialogDialogActivityPerformedByActorDto" - } - ] - }, - "transmissionId": { - "description": "If the activity is related to a particular transmission, this field will contain the transmission identifier.\nMust be present in the request body.", - "format": "guid", - "nullable": true, - "type": "string" - }, - "type": { - "description": "The type of transmission.", - "oneOf": [ - { - "$ref": "#/components/schemas/DialogActivityType_Values" - } - ] - } - }, - "type": "object" - }, - "CreateDialogCommand": { - "additionalProperties": false, - "properties": { - "activities": { - "description": "An immutable list of activities associated with the dialog.", - "items": { - "$ref": "#/components/schemas/CreateDialogDialogActivityDto" - }, - "type": "array" - }, - "apiActions": { - "description": "The API actions associated with the dialog. Should be used in specialized, non-browser-based integrations.", - "items": { - "$ref": "#/components/schemas/CreateDialogDialogApiActionDto" - }, - "type": "array" - }, - "attachments": { - "description": "The attachments associated with the dialog (on an aggregate level).", - "items": { - "$ref": "#/components/schemas/CreateDialogDialogAttachmentDto" - }, - "type": "array" - }, - "content": { - "description": "The dialog unstructured text content.", - "oneOf": [ - { - "$ref": "#/components/schemas/CreateDialogContentDto" - } - ] - }, - "createdAt": { - "description": "If set, will override the date and time when the dialog is set as created.\nIf not supplied, the current date /time will be used.", - "example": "2022-12-31T23:59:59Z", - "format": "date-time", - "type": "string" - }, - "dueAt": { - "description": "The due date for the dialog. Dialogs past due date might be marked as such in frontends but will still be available.", - "example": "2022-12-31T23:59:59Z", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "expiresAt": { - "description": "The expiration date for the dialog. This is the last date when the dialog is available for the end user.\n \nAfter this date is passed, the dialog will be considered expired and no longer available for the end user in any\nAPI. If not supplied, the dialog will be considered to never expire. This field can be changed after creation.", - "example": "2022-12-31T23:59:59Z", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "extendedStatus": { - "description": "Arbitrary string with a service-specific indicator of status, typically used to indicate a fine-grained state of\nthe dialog to further specify the \u0022status\u0022 enum.", - "nullable": true, - "type": "string" - }, - "externalReference": { - "description": "Arbitrary string with a service-specific reference to an external system or service.", - "nullable": true, - "type": "string" - }, - "guiActions": { - "description": "The GUI actions associated with the dialog. Should be used in browser-based interactive frontends.", - "items": { - "$ref": "#/components/schemas/CreateDialogDialogGuiActionDto" - }, - "type": "array" - }, - "id": { - "description": "A self-defined UUIDv7 may be provided to support idempotent creation of dialogs. If not provided, a new UUIDv7 will be generated.", - "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", - "format": "guid", - "nullable": true, - "type": "string" - }, - "party": { - "description": "The party code representing the organization or person that the dialog belongs to in URN format.", - "example": "urn:altinn:person:identifier-no:01125512345\nurn:altinn:organization:identifier-no:912345678", - "type": "string" - }, - "precedingProcess": { - "description": "Optional preceding process identifier to indicate the business process that preceded the process indicated in the \u0022Process\u0022 field. Cannot be set without also \u0022Process\u0022 being set.", - "nullable": true, - "type": "string" - }, - "process": { - "description": "Optional process identifier used to indicate a business process this dialog belongs to.", - "nullable": true, - "type": "string" - }, - "progress": { - "description": "Advisory indicator of progress, represented as 1-100 percentage value. 100% representing a dialog that has come\nto a natural completion (successful or not).", - "format": "int32", - "nullable": true, - "type": "integer" - }, - "searchTags": { - "description": "A list of words (tags) that will be used in dialog search queries. Not visible in end-user DTO.", - "items": { - "$ref": "#/components/schemas/CreateDialogSearchTagDto" - }, - "type": "array" - }, - "serviceResource": { - "description": "The service identifier for the service that the dialog is related to in URN-format.\nThis corresponds to a resource in the Altinn Resource Registry, which the authenticated organization\nmust own, i.e., be listed as the \u0022competent authority\u0022 in the Resource Registry entry.", - "example": "urn:altinn:resource:some-service-identifier", - "type": "string" - }, - "status": { - "description": "The aggregated status of the dialog.", - "oneOf": [ - { - "$ref": "#/components/schemas/DialogStatus_Values" - } - ] - }, - "systemLabel": { - "description": "Set the system label of the dialog Migration purposes.", - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/SystemLabel_Values" - } - ] - }, - "transmissions": { - "description": "The immutable list of transmissions associated with the dialog.", - "items": { - "$ref": "#/components/schemas/CreateDialogDialogTransmissionDto" - }, - "type": "array" - }, - "updatedAt": { - "description": "If set, will override the date and time when the dialog is set as last updated.\nIf not supplied, the current date /time will be used.", - "example": "2022-12-31T23:59:59Z", - "format": "date-time", - "type": "string" - }, - "visibleFrom": { - "description": "The timestamp when the dialog should be made visible for authorized end users. If not provided, the dialog will be\nimmediately available.", - "example": "2022-12-31T23:59:59Z", - "format": "date-time", - "nullable": true, - "type": "string" - } - }, - "type": "object" - }, - "CreateDialogContentDto": { - "additionalProperties": false, - "properties": { - "additionalInfo": { - "description": "Additional information about the dialog.\nSupported media types: text/plain, text/markdown", - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/ContentValueDto" - } - ] - }, - "extendedStatus": { - "description": "Used as the human-readable label used to describe the \u0022ExtendedStatus\u0022 field.\nSupported media types: text/plain", - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/ContentValueDto" - } - ] - }, - "mainContentReference": { - "description": "Front-channel embedded content. Used to dynamically embed content in the frontend from an external URL. Must be HTTPS.\nSupported media types: application/vnd.dialogporten.frontchannelembed\u002Bjson;type=markdown", - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/ContentValueDto" - } - ] - }, - "senderName": { - "description": "Overridden sender name. If not supplied, assume \u0022org\u0022 as the sender name. Must be text/plain if supplied.\nSupported media types: text/plain", - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/ContentValueDto" - } - ] - }, - "summary": { - "description": "A short summary of the dialog and its current state.\nSupported media types: text/plain", - "oneOf": [ - { - "$ref": "#/components/schemas/ContentValueDto" - } - ] - }, - "title": { - "description": "The title of the dialog.\nSupported media types: text/plain", - "oneOf": [ - { - "$ref": "#/components/schemas/ContentValueDto" - } - ] - } - }, - "type": "object" - }, - "CreateDialogDialogActivityDto": { - "additionalProperties": false, - "properties": { - "createdAt": { - "description": "If supplied, overrides the creating date and time for the transmission.\nIf not supplied, the current date /time will be used.", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "description": { - "description": "Unstructured text describing the activity. Only set if the activity type is \u0022Information\u0022.", - "items": { - "$ref": "#/components/schemas/LocalizationDto" - }, - "type": "array" - }, - "extendedType": { - "description": "Arbitrary URI/URN describing a service-specific transmission type.", - "format": "uri", - "nullable": true, - "type": "string" - }, - "id": { - "description": "A self-defined UUIDv7 may be provided to support idempotent creation of activities. If not provided, a new UUIDv7 will be generated.", - "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", - "format": "guid", - "nullable": true, - "type": "string" - }, - "performedBy": { - "description": "The actor that performed the activity.", - "oneOf": [ - { - "$ref": "#/components/schemas/CreateDialogDialogActivityPerformedByActorDto" - } - ] - }, - "transmissionId": { - "description": "If the activity is related to a particular transmission, this field will contain the transmission identifier.\nMust be present in the request body.", - "format": "guid", - "nullable": true, - "type": "string" - }, - "type": { - "description": "The type of transmission.", - "oneOf": [ - { - "$ref": "#/components/schemas/DialogActivityType_Values" - } - ] - } - }, - "type": "object" - }, - "CreateDialogDialogActivityPerformedByActorDto": { - "additionalProperties": false, - "properties": { - "actorId": { - "description": "The identifier of the person or organization that performed the activity. Mutually exclusive with ActorName.\nMight be omitted if ActorType is \u0022ServiceOwner\u0022.", - "example": "urn:altinn:person:identifier-no:12018212345", - "nullable": true, - "type": "string" - }, - "actorName": { - "description": "Specifies the name of the entity that performed the activity. Mutually exclusive with ActorId. If ActorId\nis supplied, the name will be automatically populated from the name registries.", - "example": "Ola Nordmann", - "nullable": true, - "type": "string" - }, - "actorType": { - "description": "What type of actor performed the activity.", - "oneOf": [ - { - "$ref": "#/components/schemas/ActorType_Values" - } - ] - } - }, - "type": "object" - }, - "CreateDialogDialogApiActionDto": { - "additionalProperties": false, - "properties": { - "action": { - "description": "String identifier for the action, corresponding to the \u0022action\u0022 attributeId used in the XACML service policy,\nwhich by default is the policy belonging to the service referred to by \u0022serviceResource\u0022 in the dialog.", - "example": "write", - "type": "string" - }, - "authorizationAttribute": { - "description": "Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service\npolicy, which by default is the policy belonging to the service referred to by \u0022serviceResource\u0022 in the dialog.\n \nCan also be used to refer to other service policies.", - "example": "mycustomresource\n/* equivalent to the above */\nurn:altinn:subresource:mycustomresource\nurn:altinn:task:Task_1\n/* refer to another service */\nurn:altinn:resource:some-other-service-identifier", - "nullable": true, - "type": "string" - }, - "endpoints": { - "description": "The endpoints associated with the action.", - "items": { - "$ref": "#/components/schemas/CreateDialogDialogApiActionEndpointDto" - }, - "type": "array" - } - }, - "type": "object" - }, - "CreateDialogDialogApiActionEndpointDto": { - "additionalProperties": false, - "properties": { - "deprecated": { - "description": "Boolean indicating if the endpoint is deprecated.", - "type": "boolean" - }, - "documentationUrl": { - "description": "Link to documentation for the endpoint, providing documentation for integrators. Should be a URL to a\nhuman-readable page.", - "format": "uri", - "nullable": true, - "type": "string" - }, - "httpMethod": { - "description": "The HTTP method that the endpoint expects for this action.", - "oneOf": [ - { - "$ref": "#/components/schemas/HttpVerb_Values" - } - ] - }, - "requestSchema": { - "description": "Link to the request schema for the endpoint. Used to provide documentation for integrators.\nDialogporten will not validate information on this endpoint.", - "format": "uri", - "nullable": true, - "type": "string" - }, - "responseSchema": { - "description": "Link to the response schema for the endpoint. Used to provide documentation for integrators.\nDialogporten will not validate information on this endpoint.", - "format": "uri", - "nullable": true, - "type": "string" - }, - "sunsetAt": { - "description": "Date and time when the endpoint will no longer function. Only set if the endpoint is deprecated. Dialogporten\nwill not enforce this date.", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "url": { - "description": "The fully qualified URL of the API endpoint.", - "format": "uri", - "type": "string" - }, - "version": { - "description": "Arbitrary string indicating the version of the endpoint.", - "nullable": true, - "type": "string" - } - }, - "type": "object" - }, - "CreateDialogDialogAttachmentDto": { - "additionalProperties": false, - "properties": { - "displayName": { - "description": "The display name of the attachment that should be used in GUIs.", - "items": { - "$ref": "#/components/schemas/LocalizationDto" - }, - "type": "array" - }, - "urls": { - "description": "The URLs associated with the attachment, each referring to a different representation of the attachment.", - "items": { - "$ref": "#/components/schemas/CreateDialogDialogAttachmentUrlDto" - }, - "type": "array" - } - }, - "type": "object" + "DialogEndUserContextsEntities_SystemLabel": { + "description": "", + "enum": [ + "Default", + "Bin", + "Archive" + ], + "type": "string", + "x-enumNames": [ + "Default", + "Bin", + "Archive" + ] }, - "CreateDialogDialogAttachmentUrlDto": { - "additionalProperties": false, - "properties": { - "consumerType": { - "description": "The type of consumer the URL is intended for.", - "oneOf": [ - { - "$ref": "#/components/schemas/AttachmentUrlConsumerType_Values" - } - ] - }, - "mediaType": { - "description": "The media type of the attachment.", - "example": "application/pdf\napplication/zip", - "nullable": true, - "type": "string" - }, - "url": { - "description": "The fully qualified URL of the attachment.", - "format": "uri", - "type": "string" - } - }, - "type": "object" + "DialogsEntities_DialogStatus": { + "description": "", + "enum": [ + "New", + "InProgress", + "Draft", + "Sent", + "RequiresAttention", + "Completed" + ], + "type": "string", + "x-enumNames": [ + "New", + "InProgress", + "Draft", + "Sent", + "RequiresAttention", + "Completed" + ] }, - "CreateDialogDialogGuiActionDto": { - "additionalProperties": false, - "properties": { - "action": { - "description": "The action identifier for the action, corresponding to the \u0022action\u0022 attributeId used in the XACML service policy.", - "type": "string" - }, - "authorizationAttribute": { - "description": "Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service\npolicy, which by default is the policy belonging to the service referred to by \u0022serviceResource\u0022 in the dialog.\n \nCan also be used to refer to other service policies.", - "example": "mycustomresource\n/* equivalent to the above */\nurn:altinn:subresource:mycustomresource\nurn:altinn:task:Task_1\n/* refer to another service */\nurn:altinn:resource:some-other-service-identifier", - "nullable": true, - "type": "string" - }, - "httpMethod": { - "description": "The HTTP method that the frontend should use when redirecting the user.", - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/HttpVerb_Values" - } - ] - }, - "isDeleteDialogAction": { - "description": "Indicates whether the action results in the dialog being deleted. Used by frontends to implement custom UX\nfor delete actions.", - "type": "boolean" - }, - "priority": { - "description": "Indicates a priority for the action, making it possible for frontends to adapt GUI elements based on action\npriority.", - "oneOf": [ - { - "$ref": "#/components/schemas/DialogGuiActionPriority_Values" - } - ] - }, - "prompt": { - "description": "If there should be a prompt asking the user for confirmation before the action is executed,\nthis field should contain the prompt text.", - "items": { - "$ref": "#/components/schemas/LocalizationDto" - }, - "nullable": true, - "type": "array" - }, - "title": { - "description": "The title of the action, this should be short and in verb form. Must be text/plain.", - "items": { - "$ref": "#/components/schemas/LocalizationDto" - }, - "type": "array" - }, - "url": { - "description": "The fully qualified URL of the action, to which the user will be redirected when the action is triggered. Will be set to\n\u0022urn:dialogporten:unauthorized\u0022 if the user is not authorized to perform the action.", - "example": "urn:dialogporten:unauthorized\nhttps://someendpoint.com/gui/some-service-instance-id", - "format": "uri", - "type": "string" - } - }, - "type": "object" + "DialogsEntitiesActions_DialogGuiActionPriority": { + "description": "", + "enum": [ + "Primary", + "Secondary", + "Tertiary" + ], + "type": "string", + "x-enumNames": [ + "Primary", + "Secondary", + "Tertiary" + ] }, - "CreateDialogDialogTransmissionContentDto": { - "additionalProperties": false, - "properties": { - "contentReference": { - "description": "Front-channel embedded content. Used to dynamically embed content in the frontend from an external URL. Must be HTTPS.\nAllowed media types: application/vnd.dialogporten.frontchannelembed\u002Bjson;type=markdown", - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/ContentValueDto" - } - ] - }, - "summary": { - "description": "The transmission summary.", - "oneOf": [ - { - "$ref": "#/components/schemas/ContentValueDto" - } - ] - }, - "title": { - "description": "The transmission title. Must be text/plain.", - "oneOf": [ - { - "$ref": "#/components/schemas/ContentValueDto" - } - ] - } - }, - "type": "object" + "DialogsEntitiesActivities_DialogActivityType": { + "description": "", + "enum": [ + "DialogCreated", + "DialogClosed", + "Information", + "TransmissionOpened", + "PaymentMade", + "SignatureProvided", + "DialogOpened" + ], + "type": "string", + "x-enumNames": [ + "DialogCreated", + "DialogClosed", + "Information", + "TransmissionOpened", + "PaymentMade", + "SignatureProvided", + "DialogOpened" + ] }, - "CreateDialogDialogTransmissionDto": { - "additionalProperties": false, - "properties": { - "attachments": { - "description": "The transmission-level attachments.", - "items": { - "$ref": "#/components/schemas/CreateDialogTransmissionAttachmentDto" - }, - "type": "array" - }, - "authorizationAttribute": { - "description": "Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service\npolicy, which by default is the policy belonging to the service referred to by \u0022serviceResource\u0022 in the dialog.\n \nCan also be used to refer to other service policies.", - "example": "mycustomresource\n/* equivalent to the above */\nurn:altinn:subresource:mycustomresource\nurn:altinn:task:Task_1\n/* refer to another service */\nurn:altinn:resource:some-other-service-identifier", - "nullable": true, - "type": "string" - }, - "content": { - "description": "The transmission unstructured text content.", - "oneOf": [ - { - "$ref": "#/components/schemas/CreateDialogDialogTransmissionContentDto" - } - ] - }, - "createdAt": { - "description": "If supplied, overrides the creating date and time for the transmission.\nIf not supplied, the current date /time will be used.", - "format": "date-time", - "type": "string" - }, - "extendedType": { - "description": "Arbitrary URI/URN describing a service-specific transmission type.\n \nRefer to the service-specific documentation provided by the service owner for details (if in use).", - "format": "uri", - "nullable": true, - "type": "string" - }, - "id": { - "description": "A self-defined UUIDv7 may be provided to support idempotent creation of transmissions. If not provided, a new UUIDv7 will be generated.", - "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", - "format": "guid", - "nullable": true, - "type": "string" - }, - "relatedTransmissionId": { - "description": "Reference to any other transmission that this transmission is related to.", - "format": "guid", - "nullable": true, - "type": "string" - }, - "sender": { - "description": "The actor that sent the transmission.", - "oneOf": [ - { - "$ref": "#/components/schemas/CreateDialogDialogTransmissionSenderActorDto" - } - ] - }, - "type": { - "description": "The type of transmission.", - "oneOf": [ - { - "$ref": "#/components/schemas/DialogTransmissionType_Values" - } - ] - } - }, - "type": "object" + "DialogsEntitiesTransmissions_DialogTransmissionType": { + "description": "", + "enum": [ + "Information", + "Acceptance", + "Rejection", + "Request", + "Alert", + "Decision", + "Submission", + "Correction" + ], + "type": "string", + "x-enumNames": [ + "Information", + "Acceptance", + "Rejection", + "Request", + "Alert", + "Decision", + "Submission", + "Correction" + ] }, - "CreateDialogDialogTransmissionSenderActorDto": { - "additionalProperties": false, - "properties": { - "actorId": { - "description": "The identifier of the person or organization that sent the transmission. Mutually exclusive with ActorName.\nMight be omitted if ActorType is \u0022ServiceOwner\u0022.", - "example": "urn:altinn:person:identifier-no:12018212345", - "nullable": true, - "type": "string" - }, - "actorName": { - "description": "Specifies the name of the entity that sent the transmission. Mutually exclusive with ActorId. If ActorId\nis supplied, the name will be automatically populated from the name registries.", - "example": "Ola Nordmann", - "nullable": true, - "type": "string" - }, - "actorType": { - "description": "The type of actor that sent the transmission.", - "oneOf": [ - { - "$ref": "#/components/schemas/ActorType_Values" - } - ] - } - }, - "type": "object" + "Http_HttpVerb": { + "description": "", + "enum": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE", + "HEAD", + "OPTIONS", + "TRACE", + "CONNECT" + ], + "type": "string", + "x-enumNames": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE", + "HEAD", + "OPTIONS", + "TRACE", + "CONNECT" + ] }, - "CreateDialogSearchTagDto": { + "MicrosoftAspNetCoreJsonPatchOperations_Operation": { "additionalProperties": false, "properties": { - "value": { - "description": "A search tag value.", + "from": { + "nullable": true, + "type": "string" + }, + "op": { + "nullable": true, "type": "string" + }, + "operationType": { + "$ref": "#/components/schemas/MicrosoftAspNetCoreJsonPatchOperations_OperationType" + }, + "path": { + "nullable": true, + "type": "string" + }, + "value": { + "nullable": true } }, "type": "object" }, - "CreateDialogTransmissionAttachmentDto": { + "MicrosoftAspNetCoreJsonPatchOperations_OperationType": { + "description": "", + "enum": [ + "Add", + "Remove", + "Replace", + "Move", + "Copy", + "Test", + "Invalid" + ], + "type": "string", + "x-enumNames": [ + "Add", + "Remove", + "Replace", + "Move", + "Copy", + "Test", + "Invalid" + ] + }, + "OrderSetOfTOrderDefinitionAndTTarget": {}, + "PaginatedListOfV1EndUserDialogsQueriesSearch_Dialog": { "additionalProperties": false, "properties": { - "displayName": { - "description": "The display name of the attachment that should be used in GUIs.", - "items": { - "$ref": "#/components/schemas/LocalizationDto" - }, - "type": "array" - }, - "id": { - "description": "A self-defined UUIDv7 may be provided to support idempotent creation of transmission attachments. If not provided, a new UUIDv7 will be generated.", - "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", - "format": "guid", + "continuationToken": { + "description": "The continuation token to be used to fetch the next page of items", + "example": "createdat_2024-07-31T09:09:03.0257090Z,id_0c089101-b7cf-a476-955c-f00a78d74a4e", "nullable": true, "type": "string" }, - "urls": { - "description": "The URLs associated with the attachment, each referring to a different representation of the attachment.", + "hasNextPage": { + "description": "Whether there are more items available that can be fetched by supplying the continuation token", + "type": "boolean" + }, + "items": { + "description": "The paginated list of items", "items": { - "$ref": "#/components/schemas/CreateDialogTransmissionAttachmentUrlDto" + "$ref": "#/components/schemas/V1EndUserDialogsQueriesSearch_Dialog" }, "type": "array" + }, + "orderBy": { + "description": "The current sorting order of the items", + "example": "createdat_desc,id_desc", + "type": "string" } }, "type": "object" }, - "CreateDialogTransmissionAttachmentUrlDto": { + "PaginatedListOfV1ServiceOwnerDialogsQueriesSearch_Dialog": { "additionalProperties": false, "properties": { - "consumerType": { - "description": "The type of consumer the URL is intended for.", - "oneOf": [ - { - "$ref": "#/components/schemas/AttachmentUrlConsumerType_Values" - } - ] - }, - "mediaType": { - "description": "The media type of the attachment.", - "example": "application/pdf\napplication/zip", + "continuationToken": { + "description": "The continuation token to be used to fetch the next page of items", + "example": "createdat_2024-07-31T09:09:03.0257090Z,id_0c089101-b7cf-a476-955c-f00a78d74a4e", "nullable": true, "type": "string" }, - "url": { - "description": "The fully qualified URL of the attachment.", - "format": "uri", + "hasNextPage": { + "description": "Whether there are more items available that can be fetched by supplying the continuation token", + "type": "boolean" + }, + "items": { + "description": "The paginated list of items", + "items": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsQueriesSearch_Dialog" + }, + "type": "array" + }, + "orderBy": { + "description": "The current sorting order of the items", + "example": "createdat_desc,id_desc", "type": "string" } }, "type": "object" }, - "CreateDialogTransmissionRequest": { + "ProblemDetails": { "additionalProperties": false, "properties": { - "attachments": { - "description": "The transmission-level attachments.", + "detail": { + "nullable": true, + "type": "string" + }, + "errors": { "items": { - "$ref": "#/components/schemas/UpdateDialogTransmissionAttachmentDto" + "$ref": "#/components/schemas/ProblemDetails_Error" }, "type": "array" }, - "authorizationAttribute": { - "description": "Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service\npolicy, which by default is the policy belonging to the service referred to by \u0022serviceResource\u0022 in the dialog.\n \nCan also be used to refer to other service policies.", - "example": "mycustomresource\n/* equivalent to the above */\nurn:altinn:subresource:mycustomresource\nurn:altinn:task:Task_1\n/* refer to another service */\nurn:altinn:resource:some-other-service-identifier", - "nullable": true, + "instance": { + "default": "/api/route", "type": "string" }, - "content": { - "description": "The transmission unstructured text content.", - "oneOf": [ - { - "$ref": "#/components/schemas/UpdateDialogDialogTransmissionContentDto" - } - ] + "status": { + "default": 400, + "format": "int32", + "type": "integer" }, - "createdAt": { - "description": "If supplied, overrides the creating date and time for the transmission.\nIf not supplied, the current date /time will be used.", - "format": "date-time", + "title": { + "default": "One or more validation errors occurred.", "type": "string" }, - "extendedType": { - "description": "Arbitrary URI/URN describing a service-specific transmission type.\n \nRefer to the service-specific documentation provided by the service owner for details (if in use).", - "format": "uri", - "nullable": true, + "traceId": { + "default": "0HMPNHL0JHL76:00000001", "type": "string" }, - "id": { - "description": "The UUDIv7 of the action may be provided to support idempotent additions to the list of transmissions.\nIf not supplied, a new UUIDv7 will be generated.", - "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", - "format": "guid", + "type": { + "default": "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1", + "type": "string" + } + }, + "type": "object" + }, + "ProblemDetails_Error": { + "additionalProperties": false, + "properties": { + "code": { "nullable": true, "type": "string" }, - "relatedTransmissionId": { - "description": "Reference to any other transmission that this transmission is related to.", - "format": "guid", - "nullable": true, + "name": { + "default": "Error or field name", "type": "string" }, - "sender": { - "description": "The actor that sent the transmission.", - "oneOf": [ - { - "$ref": "#/components/schemas/UpdateDialogDialogTransmissionSenderActorDto" - } - ] + "reason": { + "default": "Error reason", + "type": "string" }, - "type": { - "description": "The type of transmission.", - "oneOf": [ - { - "$ref": "#/components/schemas/DialogTransmissionType_Values" - } - ] + "severity": { + "nullable": true, + "type": "string" } }, "type": "object" }, - "DialogActivityType_Values": { - "description": "", - "enum": [ - "DialogCreated", - "DialogClosed", - "Information", - "TransmissionOpened", - "PaymentMade", - "SignatureProvided", - "DialogOpened" - ], - "type": "string", - "x-enumNames": [ - "DialogCreated", - "DialogClosed", - "Information", - "TransmissionOpened", - "PaymentMade", - "SignatureProvided", - "DialogOpened" - ] - }, - "DialogGuiActionPriority_Values": { - "description": "", - "enum": [ - "Primary", - "Secondary", - "Tertiary" - ], - "type": "string", - "x-enumNames": [ - "Primary", - "Secondary", - "Tertiary" - ] - }, - "DialogStatus_Values": { - "description": "", - "enum": [ - "New", - "InProgress", - "Draft", - "Sent", - "RequiresAttention", - "Completed" - ], - "type": "string", - "x-enumNames": [ - "New", - "InProgress", - "Draft", - "Sent", - "RequiresAttention", - "Completed" - ] - }, - "DialogTransmissionType_Values": { - "description": "", - "enum": [ - "Information", - "Acceptance", - "Rejection", - "Request", - "Alert", - "Decision", - "Submission", - "Correction" - ], - "type": "string", - "x-enumNames": [ - "Information", - "Acceptance", - "Rejection", - "Request", - "Alert", - "Decision", - "Submission", - "Correction" - ] + "V1CommonContent_ContentValue": { + "additionalProperties": false, + "properties": { + "mediaType": { + "description": "Media type of the content (plaintext, Markdown). Can also indicate that the content is embeddable.", + "type": "string" + }, + "value": { + "description": "A list of localizations for the content.", + "items": { + "$ref": "#/components/schemas/V1CommonLocalizations_Localization" + }, + "type": "array" + } + }, + "type": "object" + }, + "V1CommonLocalizations_Localization": { + "additionalProperties": false, + "properties": { + "languageCode": { + "description": "The language code of the localization in ISO 639-1 format.", + "example": "nb", + "type": "string" + }, + "value": { + "description": "The localized text or URI reference.", + "type": "string" + } + }, + "type": "object" }, - "GetDialogActivityDto": { + "V1EndUserDialogActivitiesQueriesGet_Activity": { "additionalProperties": false, "properties": { "createdAt": { @@ -946,7 +350,7 @@ }, "description": { "items": { - "$ref": "#/components/schemas/LocalizationDto" + "$ref": "#/components/schemas/V1CommonLocalizations_Localization" }, "type": "array" }, @@ -960,7 +364,7 @@ "type": "string" }, "performedBy": { - "$ref": "#/components/schemas/GetDialogActivityPerformedByActorDto" + "$ref": "#/components/schemas/V1EndUserDialogActivitiesQueriesGet_PerformedByActor" }, "transmissionId": { "format": "guid", @@ -968,29 +372,38 @@ "type": "string" }, "type": { - "$ref": "#/components/schemas/DialogActivityType_Values" + "$ref": "#/components/schemas/DialogsEntitiesActivities_DialogActivityType" } }, "type": "object" }, - "GetDialogActivityDtoSO": { + "V1EndUserDialogActivitiesQueriesGet_PerformedByActor": { "additionalProperties": false, "properties": { - "createdAt": { - "format": "date-time", + "actorId": { "nullable": true, "type": "string" }, - "deletedAt": { - "format": "date-time", + "actorName": { "nullable": true, "type": "string" }, - "description": { - "items": { - "$ref": "#/components/schemas/LocalizationDto" - }, - "type": "array" + "actorType": { + "$ref": "#/components/schemas/Actors_ActorType" + }, + "id": { + "format": "guid", + "type": "string" + } + }, + "type": "object" + }, + "V1EndUserDialogActivitiesQueriesSearch_Activity": { + "additionalProperties": false, + "properties": { + "createdAt": { + "format": "date-time", + "type": "string" }, "extendedType": { "format": "uri", @@ -1001,8 +414,9 @@ "format": "guid", "type": "string" }, - "performedBy": { - "$ref": "#/components/schemas/GetDialogActivityPerformedByActorDtoSO" + "seenByEndUserIdHash": { + "nullable": true, + "type": "string" }, "transmissionId": { "format": "guid", @@ -1010,46 +424,113 @@ "type": "string" }, "type": { - "$ref": "#/components/schemas/DialogActivityType_Values" + "$ref": "#/components/schemas/DialogsEntitiesActivities_DialogActivityType" + } + }, + "type": "object" + }, + "V1EndUserDialogLabelAssignmentLogQueriesSearch_LabelAssignmentLog": { + "additionalProperties": false, + "properties": { + "action": { + "type": "string" + }, + "createdAt": { + "format": "date-time", + "type": "string" + }, + "name": { + "type": "string" + }, + "performedBy": { + "$ref": "#/components/schemas/V1EndUserDialogLabelAssignmentLogQueriesSearch_LabelAssignmentLogActor" } }, "type": "object" }, - "GetDialogActivityPerformedByActorDto": { + "V1EndUserDialogLabelAssignmentLogQueriesSearch_LabelAssignmentLogActor": { "additionalProperties": false, "properties": { "actorId": { - "nullable": true, "type": "string" }, "actorName": { - "nullable": true, + "type": "string" + } + }, + "type": "object" + }, + "V1EndUserDialogSeenLogsQueriesGet_SeenLog": { + "additionalProperties": false, + "properties": { + "id": { + "format": "guid", "type": "string" }, - "actorType": { - "$ref": "#/components/schemas/ActorType_Values" + "isCurrentEndUser": { + "type": "boolean" + }, + "isViaServiceOwner": { + "type": "boolean" + }, + "seenAt": { + "format": "date-time", + "type": "string" + }, + "seenBy": { + "$ref": "#/components/schemas/V1EndUserDialogSeenLogsQueriesGet_SeenLogSeenByActor" + } + }, + "type": "object" + }, + "V1EndUserDialogSeenLogsQueriesGet_SeenLogSeenByActor": { + "additionalProperties": false, + "properties": { + "actorId": { + "type": "string" }, + "actorName": { + "type": "string" + }, + "id": { + "format": "guid", + "type": "string" + } + }, + "type": "object" + }, + "V1EndUserDialogSeenLogsQueriesSearch_SeenLog": { + "additionalProperties": false, + "properties": { "id": { "format": "guid", "type": "string" + }, + "isCurrentEndUser": { + "type": "boolean" + }, + "isViaServiceOwner": { + "type": "boolean" + }, + "seenAt": { + "format": "date-time", + "type": "string" + }, + "seenBy": { + "$ref": "#/components/schemas/V1EndUserDialogSeenLogsQueriesSearch_SeenLogSeenByActor" } }, "type": "object" }, - "GetDialogActivityPerformedByActorDtoSO": { + "V1EndUserDialogSeenLogsQueriesSearch_SeenLogSeenByActor": { "additionalProperties": false, "properties": { "actorId": { - "nullable": true, "type": "string" }, "actorName": { - "nullable": true, "type": "string" }, - "actorType": { - "$ref": "#/components/schemas/ActorType_Values" - }, "id": { "format": "guid", "type": "string" @@ -1057,7 +538,7 @@ }, "type": "object" }, - "GetDialogContentDto": { + "V1EndUserDialogsQueriesGet_Content": { "additionalProperties": false, "properties": { "additionalInfo": { @@ -1065,7 +546,7 @@ "nullable": true, "oneOf": [ { - "$ref": "#/components/schemas/ContentValueDto" + "$ref": "#/components/schemas/V1CommonContent_ContentValue" } ] }, @@ -1074,7 +555,7 @@ "nullable": true, "oneOf": [ { - "$ref": "#/components/schemas/ContentValueDto" + "$ref": "#/components/schemas/V1CommonContent_ContentValue" } ] }, @@ -1083,7 +564,7 @@ "nullable": true, "oneOf": [ { - "$ref": "#/components/schemas/ContentValueDto" + "$ref": "#/components/schemas/V1CommonContent_ContentValue" } ] }, @@ -1092,7 +573,7 @@ "nullable": true, "oneOf": [ { - "$ref": "#/components/schemas/ContentValueDto" + "$ref": "#/components/schemas/V1CommonContent_ContentValue" } ] }, @@ -1100,7 +581,7 @@ "description": "A short summary of the dialog and its current state.", "oneOf": [ { - "$ref": "#/components/schemas/ContentValueDto" + "$ref": "#/components/schemas/V1CommonContent_ContentValue" } ] }, @@ -1108,124 +589,174 @@ "description": "The title of the dialog.", "oneOf": [ { - "$ref": "#/components/schemas/ContentValueDto" + "$ref": "#/components/schemas/V1CommonContent_ContentValue" } ] } }, "type": "object" }, - "GetDialogContentDtoSO": { + "V1EndUserDialogsQueriesGet_Dialog": { "additionalProperties": false, "properties": { - "additionalInfo": { - "description": "Additional information about the dialog, this may contain Markdown.", - "nullable": true, + "activities": { + "description": "An immutable list of activities associated with the dialog.", + "items": { + "$ref": "#/components/schemas/V1EndUserDialogsQueriesGet_DialogActivity" + }, + "type": "array" + }, + "apiActions": { + "description": "The API actions associated with the dialog. Should be used in specialized, non-browser-based integrations.", + "items": { + "$ref": "#/components/schemas/V1EndUserDialogsQueriesGet_DialogApiAction" + }, + "type": "array" + }, + "attachments": { + "description": "The attachments associated with the dialog (on an aggregate level).", + "items": { + "$ref": "#/components/schemas/V1EndUserDialogsQueriesGet_DialogAttachment" + }, + "type": "array" + }, + "content": { + "description": "The dialog unstructured text content.", "oneOf": [ { - "$ref": "#/components/schemas/ContentValueDto" + "$ref": "#/components/schemas/V1EndUserDialogsQueriesGet_Content" } ] }, - "extendedStatus": { - "description": "Used as the human-readable label used to describe the \u0022ExtendedStatus\u0022 field.", + "createdAt": { + "description": "The date and time when the dialog was created.", + "example": "2022-12-31T23:59:59Z", + "format": "date-time", + "type": "string" + }, + "dialogToken": { + "description": "The dialog token. May be used (if supported) against external URLs referred to in this dialog\u0027s apiActions,\ntransmissions or attachments. It should also be used for front-channel embeds.", "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/ContentValueDto" - } - ] + "type": "string" }, - "mainContentReference": { - "description": "Front-channel embedded content. Used to dynamically embed content in the frontend from an external URL. Must be HTTPS.\nAllowed media types: application/vnd.dialogporten.frontchannelembed\u002Bjson;type=markdown", + "dueAt": { + "description": "The due date for the dialog. Dialogs past due date might be marked as such in frontends but will still be available.", + "example": "2022-12-31T23:59:59Z", + "format": "date-time", "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/ContentValueDto" - } - ] + "type": "string" }, - "senderName": { - "description": "Overridden sender name. If not supplied, assume \u0022org\u0022 as the sender name.", + "expiresAt": { + "description": "The expiration date for the dialog. This is the last date when the dialog is available for the end user.\n \nAfter this date is passed, the dialog will be considered expired and no longer available for the end user in any\nAPI. If not supplied, the dialog will be considered to never expire. This field can be changed by the service\nowner after the dialog has been created.", + "example": "2022-12-31T23:59:59Z", + "format": "date-time", "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/ContentValueDto" - } - ] + "type": "string" }, - "summary": { - "description": "A short summary of the dialog and its current state.", - "oneOf": [ - { - "$ref": "#/components/schemas/ContentValueDto" - } - ] + "extendedStatus": { + "description": "Arbitrary string with a service-specific indicator of status, typically used to indicate a fine-grained state of\nthe dialog to further specify the \u0022status\u0022 enum.\n \nRefer to the service-specific documentation provided by the service owner for details on the possible values (if\nin use).", + "nullable": true, + "type": "string" }, - "title": { - "description": "The title of the dialog.", - "oneOf": [ - { - "$ref": "#/components/schemas/ContentValueDto" - } - ] - } - }, - "type": "object" - }, - "GetDialogDialogActivityDto": { - "additionalProperties": false, - "properties": { - "createdAt": { - "description": "The date and time when the activity was created.", - "format": "date-time", + "externalReference": { + "description": "Arbitrary string with a service-specific reference to an external system or service.\n \nRefer to the service-specific documentation provided by the service owner for details (if in use).", "nullable": true, "type": "string" }, - "description": { - "description": "Unstructured text describing the activity. Only set if the activity type is \u0022Information\u0022.", + "guiActions": { + "description": "The GUI actions associated with the dialog. Should be used in browser-based interactive frontends.", "items": { - "$ref": "#/components/schemas/LocalizationDto" + "$ref": "#/components/schemas/V1EndUserDialogsQueriesGet_DialogGuiAction" }, "type": "array" }, - "extendedType": { - "description": "An arbitrary URI/URN with a service-specific activity type.\n \nConsult the service-specific documentation provided by the service owner for details (if in use).", - "format": "uri", + "id": { + "description": "The unique identifier for the dialog in UUIDv7 format.", + "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", + "format": "guid", + "type": "string" + }, + "org": { + "description": "The service owner code representing the organization (service owner) related to this dialog.", + "example": "ske", + "type": "string" + }, + "party": { + "description": "The party code representing the organization or person that the dialog belongs to in URN format.", + "example": "urn:altinn:person:identifier-no:01125512345\nurn:altinn:organization:identifier-no:912345678", + "type": "string" + }, + "precedingProcess": { + "description": "Optional preceding process identifier to indicate the business process that preceded the process indicated in the \u0022Process\u0022 field. Cannot be set without also \u0022Process\u0022 being set.", + "nullable": true, + "type": "string" + }, + "process": { + "description": "Optional process identifier used to indicate a business process this dialog belongs to.", + "nullable": true, + "type": "string" + }, + "progress": { + "description": "Advisory indicator of progress, represented as 1-100 percentage value. 100% representing a dialog that has come\nto a natural completion (successful or not).", + "format": "int32", "nullable": true, + "type": "integer" + }, + "revision": { + "description": "The unique identifier for the revision in UUIDv4 format.", + "example": "a312cb9c-7632-43c2-aa38-69b06aed56ca", + "format": "guid", + "type": "string" + }, + "seenSinceLastUpdate": { + "description": "The list of seen log entries for the dialog newer than the dialog ChangedAt date.", + "items": { + "$ref": "#/components/schemas/V1EndUserDialogsQueriesGet_DialogSeenLog" + }, + "type": "array" + }, + "serviceResource": { + "description": "The service identifier for the service that the dialog is related to in URN-format.\nThis corresponds to a service resource in the Altinn Resource Registry.", + "example": "urn:altinn:resource:some-service-identifier", "type": "string" }, - "id": { - "description": "The unique identifier for the activity in UUIDv7 format.", - "format": "guid", + "serviceResourceType": { + "description": "The ServiceResource type, as defined in Altinn Resource Registry (see ResourceType).", "type": "string" }, - "performedBy": { - "description": "The actor that performed the activity.", + "status": { + "description": "The aggregated status of the dialog.", "oneOf": [ { - "$ref": "#/components/schemas/GetDialogDialogActivityPerformedByActorDto" + "$ref": "#/components/schemas/DialogsEntities_DialogStatus" } ] }, - "transmissionId": { - "description": "If the activity is related to a particular transmission, this field will contain the transmission identifier.", - "format": "guid", - "nullable": true, - "type": "string" - }, - "type": { - "description": "The type of activity.", + "systemLabel": { + "description": "Current display state.", "oneOf": [ { - "$ref": "#/components/schemas/DialogActivityType_Values" + "$ref": "#/components/schemas/DialogEndUserContextsEntities_SystemLabel" } ] + }, + "transmissions": { + "description": "The immutable list of transmissions associated with the dialog.", + "items": { + "$ref": "#/components/schemas/V1EndUserDialogsQueriesGet_DialogTransmission" + }, + "type": "array" + }, + "updatedAt": { + "description": "The date and time when the dialog was last updated.", + "example": "2022-12-31T23:59:59Z", + "format": "date-time", + "type": "string" } }, "type": "object" }, - "GetDialogDialogActivityDtoSO": { + "V1EndUserDialogsQueriesGet_DialogActivity": { "additionalProperties": false, "properties": { "createdAt": { @@ -1237,7 +768,7 @@ "description": { "description": "Unstructured text describing the activity. Only set if the activity type is \u0022Information\u0022.", "items": { - "$ref": "#/components/schemas/LocalizationDto" + "$ref": "#/components/schemas/V1CommonLocalizations_Localization" }, "type": "array" }, @@ -1256,7 +787,7 @@ "description": "The actor that performed the activity.", "oneOf": [ { - "$ref": "#/components/schemas/GetDialogDialogActivityPerformedByActorDtoSO" + "$ref": "#/components/schemas/V1EndUserDialogsQueriesGet_DialogActivityPerformedByActor" } ] }, @@ -1270,14 +801,14 @@ "description": "The type of activity.", "oneOf": [ { - "$ref": "#/components/schemas/DialogActivityType_Values" + "$ref": "#/components/schemas/DialogsEntitiesActivities_DialogActivityType" } ] } }, "type": "object" }, - "GetDialogDialogActivityPerformedByActorDto": { + "V1EndUserDialogsQueriesGet_DialogActivityPerformedByActor": { "additionalProperties": false, "properties": { "actorId": { @@ -1294,38 +825,14 @@ "description": "The type of actor that performed the activity.", "oneOf": [ { - "$ref": "#/components/schemas/ActorType_Values" - } - ] - } - }, - "type": "object" - }, - "GetDialogDialogActivityPerformedByActorDtoSO": { - "additionalProperties": false, - "properties": { - "actorId": { - "description": "The identifier of the person or organization that performed the activity.\nMay be omitted if ActorType is \u0022ServiceOwner\u0022.", - "nullable": true, - "type": "string" - }, - "actorName": { - "description": "The name of the person or organization that performed the activity.\nOnly set if the actor type is \u0022PartyRepresentative\u0022.", - "nullable": true, - "type": "string" - }, - "actorType": { - "description": "What type of actor performed the activity.", - "oneOf": [ - { - "$ref": "#/components/schemas/ActorType_Values" + "$ref": "#/components/schemas/Actors_ActorType" } ] } }, "type": "object" }, - "GetDialogDialogApiActionDto": { + "V1EndUserDialogsQueriesGet_DialogApiAction": { "additionalProperties": false, "properties": { "action": { @@ -1342,7 +849,7 @@ "endpoints": { "description": "The endpoints associated with the action.", "items": { - "$ref": "#/components/schemas/GetDialogDialogApiActionEndpointDto" + "$ref": "#/components/schemas/V1EndUserDialogsQueriesGet_DialogApiActionEndpoint" }, "type": "array" }, @@ -1358,41 +865,7 @@ }, "type": "object" }, - "GetDialogDialogApiActionDtoSO": { - "additionalProperties": false, - "properties": { - "action": { - "description": "String identifier for the action, corresponding to the \u0022action\u0022 attributeId used in the XACML service policy,\nwhich by default is the policy belonging to the service referred to by \u0022serviceResource\u0022 in the dialog.", - "example": "write", - "type": "string" - }, - "authorizationAttribute": { - "description": "Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service\npolicy, which by default is the policy belonging to the service referred to by \u0022serviceResource\u0022 in the dialog.\n \nCan also be used to refer to other service policies.", - "example": "mycustomresource\n/* equivalent to the above */\nurn:altinn:subresource:mycustomresource\nurn:altinn:task:Task_1\n/* refer to another service */\nurn:altinn:resource:some-other-service-identifier", - "nullable": true, - "type": "string" - }, - "endpoints": { - "description": "The endpoints associated with the action.", - "items": { - "$ref": "#/components/schemas/GetDialogDialogApiActionEndpointDtoSO" - }, - "type": "array" - }, - "id": { - "description": "The unique identifier for the action in UUIDv7 format.", - "format": "guid", - "type": "string" - }, - "isAuthorized": { - "description": "True if the authenticated user (set in the query) is authorized for this action.", - "nullable": true, - "type": "boolean" - } - }, - "type": "object" - }, - "GetDialogDialogApiActionEndpointDto": { + "V1EndUserDialogsQueriesGet_DialogApiActionEndpoint": { "additionalProperties": false, "properties": { "deprecated": { @@ -1409,7 +882,7 @@ "description": "The HTTP method that the endpoint expects for this action.", "oneOf": [ { - "$ref": "#/components/schemas/HttpVerb_Values" + "$ref": "#/components/schemas/Http_HttpVerb" } ] }, @@ -1450,95 +923,252 @@ }, "type": "object" }, - "GetDialogDialogApiActionEndpointDtoSO": { + "V1EndUserDialogsQueriesGet_DialogAttachment": { "additionalProperties": false, "properties": { - "deprecated": { - "description": "Boolean indicating if the endpoint is deprecated. Integrators should migrate to endpoints with a higher version.", + "displayName": { + "description": "The display name of the attachment that should be used in GUIs.", + "items": { + "$ref": "#/components/schemas/V1CommonLocalizations_Localization" + }, + "type": "array" + }, + "id": { + "description": "The unique identifier for the attachment in UUIDv7 format.", + "format": "guid", + "type": "string" + }, + "urls": { + "description": "The URLs associated with the attachment, each referring to a different representation of the attachment.", + "items": { + "$ref": "#/components/schemas/V1EndUserDialogsQueriesGet_DialogAttachmentUrl" + }, + "type": "array" + } + }, + "type": "object" + }, + "V1EndUserDialogsQueriesGet_DialogAttachmentUrl": { + "additionalProperties": false, + "properties": { + "consumerType": { + "description": "What type of consumer the URL is intended for.", + "oneOf": [ + { + "$ref": "#/components/schemas/Attachments_AttachmentUrlConsumerType" + } + ] + }, + "id": { + "description": "The unique identifier for the attachment URL in UUIDv7 format.", + "format": "guid", + "type": "string" + }, + "mediaType": { + "description": "The media type of the attachment.", + "example": "application/pdf\napplication/zip", + "nullable": true, + "type": "string" + }, + "url": { + "description": "The fully qualified URL of the attachment.", + "example": "https://someendpoint.com/someattachment.pdf", + "format": "uri", + "type": "string" + } + }, + "type": "object" + }, + "V1EndUserDialogsQueriesGet_DialogGuiAction": { + "additionalProperties": false, + "properties": { + "action": { + "description": "The action identifier for the action, corresponding to the \u0022action\u0022 attributeId used in the XACML service policy.", + "type": "string" + }, + "authorizationAttribute": { + "description": "Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service\npolicy, which by default is the policy belonging to the service referred to by \u0022serviceResource\u0022 in the dialog.\n \nCan also be used to refer to other service policies.", + "example": "mycustomresource\n/* equivalent to the above */\nurn:altinn:subresource:mycustomresource\nurn:altinn:task:Task_1\n/* refer to another service */\nurn:altinn:resource:some-other-service-identifier", + "nullable": true, + "type": "string" + }, + "httpMethod": { + "description": "The HTTP method that the frontend should use when redirecting the user.", + "oneOf": [ + { + "$ref": "#/components/schemas/Http_HttpVerb" + } + ] + }, + "id": { + "description": "The unique identifier for the action in UUIDv7 format.", + "format": "guid", + "type": "string" + }, + "isAuthorized": { + "description": "Whether the user is authorized to perform the action.", "type": "boolean" }, - "documentationUrl": { - "description": "Link to service provider documentation for the endpoint. Used for service owners to provide documentation for\nintegrators. Should be a URL to a human-readable page.", + "isDeleteDialogAction": { + "description": "Indicates whether the action results in the dialog being deleted. Used by frontends to implement custom UX\nfor delete actions.", + "type": "boolean" + }, + "priority": { + "description": "Indicates a priority for the action, making it possible for frontends to adapt GUI elements based on action\npriority.", + "oneOf": [ + { + "$ref": "#/components/schemas/DialogsEntitiesActions_DialogGuiActionPriority" + } + ] + }, + "prompt": { + "description": "If there should be a prompt asking the user for confirmation before the action is executed,\nthis field should contain the prompt text.", + "items": { + "$ref": "#/components/schemas/V1CommonLocalizations_Localization" + }, + "nullable": true, + "type": "array" + }, + "title": { + "description": "The title of the action, this should be short and in verb form.", + "items": { + "$ref": "#/components/schemas/V1CommonLocalizations_Localization" + }, + "type": "array" + }, + "url": { + "description": "The fully qualified URL of the action, to which the user will be redirected when the action is triggered. Will be set to\n\u0022urn:dialogporten:unauthorized\u0022 if the user is not authorized to perform the action.", + "example": "urn:dialogporten:unauthorized\nhttps://someendpoint.com/gui/some-service-instance-id", "format": "uri", + "type": "string" + } + }, + "type": "object" + }, + "V1EndUserDialogsQueriesGet_DialogSeenLog": { + "additionalProperties": false, + "properties": { + "id": { + "description": "The unique identifier for the seen log entry in UUIDv7 format.", + "format": "guid", + "type": "string" + }, + "isCurrentEndUser": { + "description": "Flag indicating whether the seen log entry was created by the current end user.", + "type": "boolean" + }, + "isViaServiceOwner": { + "description": "Flag indicating whether the seen log entry was created via the service owner.\n \nThis is used when the service owner uses the service owner API to implement its own frontend.", + "nullable": true, + "type": "boolean" + }, + "seenAt": { + "description": "The timestamp when the dialog revision was seen.", + "format": "date-time", + "type": "string" + }, + "seenBy": { + "description": "The actor that saw the dialog revision.", + "oneOf": [ + { + "$ref": "#/components/schemas/V1EndUserDialogsQueriesGet_DialogSeenLogSeenByActor" + } + ] + } + }, + "type": "object" + }, + "V1EndUserDialogsQueriesGet_DialogSeenLogSeenByActor": { + "additionalProperties": false, + "properties": { + "actorId": { + "description": "The identifier of the person/business that saw the dialog revision.", + "example": "urn:altinn:person:identifier-no:01125512345\nurn:altinn:organization:identifier-no:912345678", + "type": "string" + }, + "actorName": { + "description": "The natural name of the person/business that saw the dialog revision.", + "type": "string" + } + }, + "type": "object" + }, + "V1EndUserDialogsQueriesGet_DialogTransmission": { + "additionalProperties": false, + "properties": { + "attachments": { + "description": "The transmission-level attachments.", + "items": { + "$ref": "#/components/schemas/V1EndUserDialogsQueriesGet_DialogTransmissionAttachment" + }, + "type": "array" + }, + "authorizationAttribute": { + "description": "Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service\npolicy, which by default is the policy belonging to the service referred to by \u0022serviceResource\u0022 in the dialog.\n \nCan also be used to refer to other service policies.", + "example": "mycustomresource\n/* equivalent to the above */\nurn:altinn:subresource:mycustomresource\nurn:altinn:task:Task_1\n/* refer to another service */\nurn:altinn:resource:some-other-service-identifier", "nullable": true, "type": "string" }, - "httpMethod": { - "description": "The HTTP method that the endpoint expects for this action.", + "content": { + "description": "The transmission unstructured text content.", "oneOf": [ { - "$ref": "#/components/schemas/HttpVerb_Values" + "$ref": "#/components/schemas/V1EndUserDialogsQueriesGet_DialogTransmissionContent" } ] }, - "id": { - "description": "The unique identifier for the endpoint in UUIDv7 format.", - "format": "guid", - "type": "string" - }, - "requestSchema": { - "description": "Link to the request schema for the endpoint. Used by service owners to provide documentation for integrators.\nDialogporten will not validate information on this endpoint.", - "format": "uri", - "nullable": true, + "createdAt": { + "description": "The date and time when the transmission was created.", + "format": "date-time", "type": "string" }, - "responseSchema": { - "description": "Link to the response schema for the endpoint. Used for service owners to provide documentation for integrators.\nDialogporten will not validate information on this endpoint.", + "extendedType": { + "description": "Arbitrary URI/URN describing a service-specific transmission type.\n \nRefer to the service-specific documentation provided by the service owner for details (if in use).", "format": "uri", "nullable": true, "type": "string" }, - "sunsetAt": { - "description": "Date and time when the service owner has indicated that endpoint will no longer function. Only set if the endpoint\nis deprecated. Dialogporten will not enforce this date.", - "format": "date-time", - "nullable": true, + "id": { + "description": "The unique identifier for the transmission in UUIDv7 format.", + "format": "guid", "type": "string" }, - "url": { - "description": "The fully qualified URL of the API endpoint.", - "format": "uri", - "type": "string" + "isAuthorized": { + "description": "Flag indicating if the authenticated user is authorized for this transmission. If not, embedded content and\nthe attachments will not be available.", + "type": "boolean" }, - "version": { - "description": "Arbitrary string indicating the version of the endpoint.\n \nConsult the service-specific documentation provided by the service owner for details (if in use).", + "relatedTransmissionId": { + "description": "Reference to any other transmission that this transmission is related to.", + "format": "guid", "nullable": true, "type": "string" - } - }, - "type": "object" - }, - "GetDialogDialogAttachmentDto": { - "additionalProperties": false, - "properties": { - "displayName": { - "description": "The display name of the attachment that should be used in GUIs.", - "items": { - "$ref": "#/components/schemas/LocalizationDto" - }, - "type": "array" }, - "id": { - "description": "The unique identifier for the attachment in UUIDv7 format.", - "format": "guid", - "type": "string" + "sender": { + "description": "The actor that sent the transmission.", + "oneOf": [ + { + "$ref": "#/components/schemas/V1EndUserDialogsQueriesGet_DialogTransmissionSenderActor" + } + ] }, - "urls": { - "description": "The URLs associated with the attachment, each referring to a different representation of the attachment.", - "items": { - "$ref": "#/components/schemas/GetDialogDialogAttachmentUrlDto" - }, - "type": "array" + "type": { + "description": "The type of transmission.", + "oneOf": [ + { + "$ref": "#/components/schemas/DialogsEntitiesTransmissions_DialogTransmissionType" + } + ] } }, "type": "object" }, - "GetDialogDialogAttachmentDtoSO": { + "V1EndUserDialogsQueriesGet_DialogTransmissionAttachment": { "additionalProperties": false, "properties": { "displayName": { "description": "The display name of the attachment that should be used in GUIs.", "items": { - "$ref": "#/components/schemas/LocalizationDto" + "$ref": "#/components/schemas/V1CommonLocalizations_Localization" }, "type": "array" }, @@ -1550,29 +1180,24 @@ "urls": { "description": "The URLs associated with the attachment, each referring to a different representation of the attachment.", "items": { - "$ref": "#/components/schemas/GetDialogDialogAttachmentUrlDtoSO" + "$ref": "#/components/schemas/V1EndUserDialogsQueriesGet_DialogTransmissionAttachmentUrl" }, "type": "array" } }, "type": "object" }, - "GetDialogDialogAttachmentUrlDto": { + "V1EndUserDialogsQueriesGet_DialogTransmissionAttachmentUrl": { "additionalProperties": false, "properties": { "consumerType": { - "description": "What type of consumer the URL is intended for.", + "description": "The type of consumer the URL is intended for.", "oneOf": [ { - "$ref": "#/components/schemas/AttachmentUrlConsumerType_Values" + "$ref": "#/components/schemas/Attachments_AttachmentUrlConsumerType" } ] }, - "id": { - "description": "The unique identifier for the attachment URL in UUIDv7 format.", - "format": "guid", - "type": "string" - }, "mediaType": { "description": "The media type of the attachment.", "example": "application/pdf\napplication/zip", @@ -1580,211 +1205,303 @@ "type": "string" }, "url": { - "description": "The fully qualified URL of the attachment.", - "example": "https://someendpoint.com/someattachment.pdf", + "description": "The fully qualified URL of the attachment. Will be set to \u0022urn:dialogporten:unauthorized\u0022 if the user is\nnot authorized to access the transmission.", + "example": "https://someendpoint.com/someattachment.pdf\nurn:dialogporten:unauthorized", "format": "uri", "type": "string" } }, "type": "object" }, - "GetDialogDialogAttachmentUrlDtoSO": { + "V1EndUserDialogsQueriesGet_DialogTransmissionContent": { "additionalProperties": false, "properties": { - "consumerType": { - "description": "What type of consumer the URL is intended for.", + "contentReference": { + "description": "Front-channel embedded content. Used to dynamically embed content in the frontend from an external URL.\nAllowed media types: application/vnd.dialogporten.frontchannelembed\u002Bjson;type=markdown", + "nullable": true, "oneOf": [ { - "$ref": "#/components/schemas/AttachmentUrlConsumerType_Values" + "$ref": "#/components/schemas/V1CommonContent_ContentValue" } ] }, - "id": { - "description": "The unique identifier for the attachment URL in UUIDv7 format.", - "format": "guid", - "type": "string" + "summary": { + "description": "The transmission summary.", + "oneOf": [ + { + "$ref": "#/components/schemas/V1CommonContent_ContentValue" + } + ] }, - "mediaType": { - "description": "The media type of the attachment.", - "example": "application/pdf\napplication/zip", - "nullable": true, + "title": { + "description": "The transmission title.", + "oneOf": [ + { + "$ref": "#/components/schemas/V1CommonContent_ContentValue" + } + ] + } + }, + "type": "object" + }, + "V1EndUserDialogsQueriesGet_DialogTransmissionSenderActor": { + "additionalProperties": false, + "properties": { + "actorId": { + "description": "The identifier of the person or organization that sent the transmission.", + "example": "urn:altinn:person:identifier-no:12018212345", "type": "string" }, - "url": { - "description": "The fully qualified URL of the attachment.", - "example": "https://someendpoint.com/someattachment.pdf", - "format": "uri", + "actorName": { + "description": "The name of the person or organization that sent the transmission.", + "example": "Ola Nordmann", "type": "string" + }, + "actorType": { + "description": "The type of actor that sent the transmission.", + "oneOf": [ + { + "$ref": "#/components/schemas/Actors_ActorType" + } + ] } }, "type": "object" }, - "GetDialogDialogGuiActionDto": { + "V1EndUserDialogsQueriesSearch_Content": { "additionalProperties": false, "properties": { - "action": { - "description": "The action identifier for the action, corresponding to the \u0022action\u0022 attributeId used in the XACML service policy.", - "type": "string" + "extendedStatus": { + "description": "Used as the human-readable label used to describe the \u0022ExtendedStatus\u0022 field.", + "nullable": true, + "oneOf": [ + { + "$ref": "#/components/schemas/V1CommonContent_ContentValue" + } + ] }, - "authorizationAttribute": { - "description": "Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service\npolicy, which by default is the policy belonging to the service referred to by \u0022serviceResource\u0022 in the dialog.\n \nCan also be used to refer to other service policies.", - "example": "mycustomresource\n/* equivalent to the above */\nurn:altinn:subresource:mycustomresource\nurn:altinn:task:Task_1\n/* refer to another service */\nurn:altinn:resource:some-other-service-identifier", + "senderName": { + "description": "Overridden sender name. If not supplied, assume \u0022org\u0022 as the sender name.", "nullable": true, - "type": "string" + "oneOf": [ + { + "$ref": "#/components/schemas/V1CommonContent_ContentValue" + } + ] }, - "httpMethod": { - "description": "The HTTP method that the frontend should use when redirecting the user.", + "summary": { + "description": "A short summary of the dialog and its current state.", + "oneOf": [ + { + "$ref": "#/components/schemas/V1CommonContent_ContentValue" + } + ] + }, + "title": { + "description": "The title of the dialog.", + "oneOf": [ + { + "$ref": "#/components/schemas/V1CommonContent_ContentValue" + } + ] + } + }, + "type": "object" + }, + "V1EndUserDialogsQueriesSearch_Dialog": { + "additionalProperties": false, + "properties": { + "content": { + "description": "The content of the dialog in search results.", "oneOf": [ { - "$ref": "#/components/schemas/HttpVerb_Values" + "$ref": "#/components/schemas/V1EndUserDialogsQueriesSearch_Content" } ] }, + "createdAt": { + "description": "The date and time when the dialog was created.", + "example": "2022-12-31T23:59:59Z", + "format": "date-time", + "type": "string" + }, + "dueAt": { + "description": "The due date for the dialog. This is the last date when the dialog is expected to be completed.", + "example": "2022-12-31T23:59:59Z", + "format": "date-time", + "nullable": true, + "type": "string" + }, + "extendedStatus": { + "description": "Arbitrary string with a service-specific indicator of status, typically used to indicate a fine-grained state of\nthe dialog to further specify the \u0022status\u0022 enum.\n \nRefer to the service-specific documentation provided by the service owner for details on the possible values (if\nin use).", + "nullable": true, + "type": "string" + }, + "guiAttachmentCount": { + "description": "The number of attachments in the dialog made available for browser-based frontends.", + "format": "int32", + "nullable": true, + "type": "integer" + }, "id": { - "description": "The unique identifier for the action in UUIDv7 format.", + "description": "The unique identifier for the dialog in UUIDv7 format.", + "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", "format": "guid", "type": "string" }, - "isAuthorized": { - "description": "Whether the user is authorized to perform the action.", - "type": "boolean" + "latestActivity": { + "description": "The latest entry in the dialog\u0027s activity log.", + "nullable": true, + "oneOf": [ + { + "$ref": "#/components/schemas/V1EndUserDialogsQueriesSearch_DialogActivity" + } + ] }, - "isDeleteDialogAction": { - "description": "Indicates whether the action results in the dialog being deleted. Used by frontends to implement custom UX\nfor delete actions.", - "type": "boolean" + "org": { + "description": "The service owner code representing the organization (service owner) related to this dialog.", + "example": "ske", + "type": "string" }, - "priority": { - "description": "Indicates a priority for the action, making it possible for frontends to adapt GUI elements based on action\npriority.", + "party": { + "description": "The party code representing the organization or person that the dialog belongs to in URN format.", + "example": "urn:altinn:person:identifier-no:01125512345\nurn:altinn:organization:identifier-no:912345678", + "type": "string" + }, + "precedingProcess": { + "description": "Optional preceding process identifier to indicate the business process that preceded the process indicated in the \u0022Process\u0022 field. Cannot be set without also \u0022Process\u0022 being set.", + "nullable": true, + "type": "string" + }, + "process": { + "description": "Optional process identifier used to indicate a business process this dialog belongs to.", + "nullable": true, + "type": "string" + }, + "progress": { + "description": "Advisory indicator of progress, represented as 1-100 percentage value. 100% representing a dialog that has come\nto a natural completion (successful or not).", + "format": "int32", + "nullable": true, + "type": "integer" + }, + "seenSinceLastUpdate": { + "description": "The list of seen log entries for the dialog newer than the dialog ChangedAt date.", + "items": { + "$ref": "#/components/schemas/V1EndUserDialogsQueriesSearch_DialogSeenLog" + }, + "type": "array" + }, + "serviceResource": { + "description": "The service identifier for the service that the dialog is related to in URN-format.\nThis corresponds to a service resource in the Altinn Resource Registry.", + "example": "urn:altinn:resource:some-service-identifier", + "type": "string" + }, + "serviceResourceType": { + "description": "The ServiceResource type, as defined in Altinn Resource Registry (see ResourceType).", + "type": "string" + }, + "status": { + "description": "The aggregated status of the dialog.", "oneOf": [ { - "$ref": "#/components/schemas/DialogGuiActionPriority_Values" + "$ref": "#/components/schemas/DialogsEntities_DialogStatus" } ] }, - "prompt": { - "description": "If there should be a prompt asking the user for confirmation before the action is executed,\nthis field should contain the prompt text.", - "items": { - "$ref": "#/components/schemas/LocalizationDto" - }, - "nullable": true, - "type": "array" - }, - "title": { - "description": "The title of the action, this should be short and in verb form.", - "items": { - "$ref": "#/components/schemas/LocalizationDto" - }, - "type": "array" + "systemLabel": { + "description": "Current display state.", + "oneOf": [ + { + "$ref": "#/components/schemas/DialogEndUserContextsEntities_SystemLabel" + } + ] }, - "url": { - "description": "The fully qualified URL of the action, to which the user will be redirected when the action is triggered. Will be set to\n\u0022urn:dialogporten:unauthorized\u0022 if the user is not authorized to perform the action.", - "example": "urn:dialogporten:unauthorized\nhttps://someendpoint.com/gui/some-service-instance-id", - "format": "uri", + "updatedAt": { + "description": "The date and time when the dialog was last updated.", + "example": "2022-12-31T23:59:59Z", + "format": "date-time", "type": "string" } }, "type": "object" }, - "GetDialogDialogGuiActionDtoSO": { + "V1EndUserDialogsQueriesSearch_DialogActivity": { "additionalProperties": false, "properties": { - "action": { - "description": "The action identifier for the action, corresponding to the \u0022action\u0022 attributeId used in the XACML service policy.", + "createdAt": { + "description": "The date and time when the activity was created.", + "format": "date-time", + "nullable": true, "type": "string" }, - "authorizationAttribute": { - "description": "Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service\npolicy, which by default is the policy belonging to the service referred to by \u0022serviceResource\u0022 in the dialog.\n \nCan also be used to refer to other service policies.", - "example": "mycustomresource\n/* equivalent to the above */\nurn:altinn:subresource:mycustomresource\nurn:altinn:task:Task_1\n/* refer to another service */\nurn:altinn:resource:some-other-service-identifier", + "description": { + "description": "Unstructured text describing the activity. Only set if the activity type is \u0022Information\u0022.", + "items": { + "$ref": "#/components/schemas/V1CommonLocalizations_Localization" + }, + "type": "array" + }, + "extendedType": { + "description": "An arbitrary string with a service-specific activity type.\n \nConsult the service-specific documentation provided by the service owner for details (if in use).", + "format": "uri", "nullable": true, "type": "string" }, - "httpMethod": { - "description": "The HTTP method that the frontend should use when redirecting the user.", + "id": { + "description": "The unique identifier for the activity in UUIDv7 format.", + "format": "guid", + "type": "string" + }, + "performedBy": { + "description": "The actor that performed the activity.", "oneOf": [ { - "$ref": "#/components/schemas/HttpVerb_Values" + "$ref": "#/components/schemas/V1EndUserDialogsQueriesSearch_DialogActivityPerformedByActor" } ] }, - "id": { - "description": "The unique identifier for the action in UUIDv7 format.", + "transmissionId": { + "description": "If the activity is related to a particular transmission, this field will contain the transmission identifier.", "format": "guid", - "type": "string" - }, - "isAuthorized": { - "description": "Whether the user, if supplied in the query, is authorized to perform the action.", "nullable": true, - "type": "boolean" - }, - "isDeleteDialogAction": { - "description": "Indicates whether the action results in the dialog being deleted. Used by frontends to implement custom UX\nfor delete actions.", - "type": "boolean" + "type": "string" }, - "priority": { - "description": "Indicates a priority for the action, making it possible for frontends to adapt GUI elements based on action\npriority.", + "type": { + "description": "The type of activity.", "oneOf": [ { - "$ref": "#/components/schemas/DialogGuiActionPriority_Values" + "$ref": "#/components/schemas/DialogsEntitiesActivities_DialogActivityType" } ] - }, - "prompt": { - "description": "If there should be a prompt asking the user for confirmation before the action is executed,\nthis field should contain the prompt text.", - "items": { - "$ref": "#/components/schemas/LocalizationDto" - }, - "nullable": true, - "type": "array" - }, - "title": { - "description": "The title of the action, this should be short and in verb form.", - "items": { - "$ref": "#/components/schemas/LocalizationDto" - }, - "type": "array" - }, - "url": { - "description": "The fully qualified URL of the action, to which the user will be redirected when the action is triggered.", - "format": "uri", - "type": "string" } }, "type": "object" }, - "GetDialogDialogSeenLogDto": { + "V1EndUserDialogsQueriesSearch_DialogActivityPerformedByActor": { "additionalProperties": false, "properties": { - "id": { - "description": "The unique identifier for the seen log entry in UUIDv7 format.", - "format": "guid", + "actorId": { + "description": "The identifier of the person or organization that performed the activity.\nMay be omitted if ActorType is \u0022ServiceOwner\u0022.", + "nullable": true, "type": "string" }, - "isCurrentEndUser": { - "description": "Flag indicating whether the seen log entry was created by the current end user.", - "type": "boolean" - }, - "isViaServiceOwner": { - "description": "Flag indicating whether the seen log entry was created via the service owner.\n \nThis is used when the service owner uses the service owner API to implement its own frontend.", + "actorName": { + "description": "The name of the person or organization that performed the activity.\nOnly set if the actor type is \u0022PartyRepresentative\u0022.", "nullable": true, - "type": "boolean" - }, - "seenAt": { - "description": "The timestamp when the dialog revision was seen.", - "format": "date-time", "type": "string" }, - "seenBy": { - "description": "The actor that saw the dialog revision.", + "actorType": { + "description": "What type of actor performed the activity.", "oneOf": [ { - "$ref": "#/components/schemas/GetDialogDialogSeenLogSeenByActorDto" + "$ref": "#/components/schemas/Actors_ActorType" } ] } }, "type": "object" }, - "GetDialogDialogSeenLogDtoSO": { + "V1EndUserDialogsQueriesSearch_DialogSeenLog": { "additionalProperties": false, "properties": { "id": { @@ -1793,7 +1510,7 @@ "type": "string" }, "isCurrentEndUser": { - "description": "Flag indicating whether the seen log entry was created by the current end user, if provided in the query.", + "description": "Flag indicating whether the seen log entry was created by the current end user.", "type": "boolean" }, "isViaServiceOwner": { @@ -1810,29 +1527,14 @@ "description": "The actor that saw the dialog revision.", "oneOf": [ { - "$ref": "#/components/schemas/GetDialogDialogSeenLogSeenByActorDtoSO" + "$ref": "#/components/schemas/V1EndUserDialogsQueriesSearch_DialogSeenLogSeenByActor" } ] } }, "type": "object" }, - "GetDialogDialogSeenLogSeenByActorDto": { - "additionalProperties": false, - "properties": { - "actorId": { - "description": "The identifier of the person/business that saw the dialog revision.", - "example": "urn:altinn:person:identifier-no:01125512345\nurn:altinn:organization:identifier-no:912345678", - "type": "string" - }, - "actorName": { - "description": "The natural name of the person/business that saw the dialog revision.", - "type": "string" - } - }, - "type": "object" - }, - "GetDialogDialogSeenLogSeenByActorDtoSO": { + "V1EndUserDialogsQueriesSearch_DialogSeenLogSeenByActor": { "additionalProperties": false, "properties": { "actorId": { @@ -1847,38 +1549,27 @@ }, "type": "object" }, - "GetDialogDialogTransmissionAttachmentDto": { + "V1EndUserDialogSystemLabelsCommandsSet_SystemLabelCommand": { "additionalProperties": false, "properties": { - "displayName": { - "description": "The display name of the attachment that should be used in GUIs.", - "items": { - "$ref": "#/components/schemas/LocalizationDto" - }, - "type": "array" - }, - "id": { - "description": "The unique identifier for the attachment in UUIDv7 format.", + "ifMatchDialogRevision": { "format": "guid", + "nullable": true, "type": "string" }, - "urls": { - "description": "The URLs associated with the attachment, each referring to a different representation of the attachment.", - "items": { - "$ref": "#/components/schemas/GetDialogDialogTransmissionAttachmentUrlDto" - }, - "type": "array" + "label": { + "$ref": "#/components/schemas/DialogEndUserContextsEntities_SystemLabel" } }, "type": "object" }, - "GetDialogDialogTransmissionAttachmentDtoSO": { + "V1EndUserDialogTransmissionsQueriesGet_Attachment": { "additionalProperties": false, "properties": { "displayName": { "description": "The display name of the attachment that should be used in GUIs.", "items": { - "$ref": "#/components/schemas/LocalizationDto" + "$ref": "#/components/schemas/V1CommonLocalizations_Localization" }, "type": "array" }, @@ -1890,49 +1581,28 @@ "urls": { "description": "The URLs associated with the attachment, each referring to a different representation of the attachment.", "items": { - "$ref": "#/components/schemas/GetDialogDialogTransmissionAttachmentUrlDtoSO" + "$ref": "#/components/schemas/V1EndUserDialogTransmissionsQueriesGet_AttachmentUrl" }, "type": "array" } }, "type": "object" }, - "GetDialogDialogTransmissionAttachmentUrlDto": { + "V1EndUserDialogTransmissionsQueriesGet_AttachmentUrl": { "additionalProperties": false, "properties": { "consumerType": { "description": "The type of consumer the URL is intended for.", "oneOf": [ { - "$ref": "#/components/schemas/AttachmentUrlConsumerType_Values" + "$ref": "#/components/schemas/Attachments_AttachmentUrlConsumerType" } ] }, - "mediaType": { - "description": "The media type of the attachment.", - "example": "application/pdf\napplication/zip", - "nullable": true, - "type": "string" - }, - "url": { - "description": "The fully qualified URL of the attachment. Will be set to \u0022urn:dialogporten:unauthorized\u0022 if the user is\nnot authorized to access the transmission.", - "example": "https://someendpoint.com/someattachment.pdf\nurn:dialogporten:unauthorized", - "format": "uri", + "id": { + "description": "The unique identifier for the attachment URL in UUIDv7 format.", + "format": "guid", "type": "string" - } - }, - "type": "object" - }, - "GetDialogDialogTransmissionAttachmentUrlDtoSO": { - "additionalProperties": false, - "properties": { - "consumerType": { - "description": "The type of consumer the URL is intended for.", - "oneOf": [ - { - "$ref": "#/components/schemas/AttachmentUrlConsumerType_Values" - } - ] }, "mediaType": { "description": "The media type of the attachment.", @@ -1949,7 +1619,7 @@ }, "type": "object" }, - "GetDialogDialogTransmissionContentDto": { + "V1EndUserDialogTransmissionsQueriesGet_Content": { "additionalProperties": false, "properties": { "contentReference": { @@ -1957,150 +1627,76 @@ "nullable": true, "oneOf": [ { - "$ref": "#/components/schemas/ContentValueDto" - } - ] - }, - "summary": { - "description": "The transmission summary.", - "oneOf": [ - { - "$ref": "#/components/schemas/ContentValueDto" - } - ] - }, - "title": { - "description": "The transmission title.", - "oneOf": [ - { - "$ref": "#/components/schemas/ContentValueDto" - } - ] - } - }, - "type": "object" - }, - "GetDialogDialogTransmissionContentDtoSO": { - "additionalProperties": false, - "properties": { - "contentReference": { - "description": "Front-channel embedded content. Used to dynamically embed content in the frontend from an external URL. Must be HTTPS.\nAllowed media types: application/vnd.dialogporten.frontchannelembed\u002Bjson;type=markdown", - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/ContentValueDto" + "$ref": "#/components/schemas/V1CommonContent_ContentValue" } ] }, "summary": { - "description": "The transmission summary.", + "description": "The summary of the content.", "oneOf": [ { - "$ref": "#/components/schemas/ContentValueDto" + "$ref": "#/components/schemas/V1CommonContent_ContentValue" } ] }, "title": { - "description": "The transmission title.", + "description": "The title of the content.", "oneOf": [ { - "$ref": "#/components/schemas/ContentValueDto" + "$ref": "#/components/schemas/V1CommonContent_ContentValue" } ] } }, "type": "object" }, - "GetDialogDialogTransmissionDto": { + "V1EndUserDialogTransmissionsQueriesGet_SenderActor": { "additionalProperties": false, "properties": { - "attachments": { - "description": "The transmission-level attachments.", - "items": { - "$ref": "#/components/schemas/GetDialogDialogTransmissionAttachmentDto" - }, - "type": "array" - }, - "authorizationAttribute": { - "description": "Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service\npolicy, which by default is the policy belonging to the service referred to by \u0022serviceResource\u0022 in the dialog.\n \nCan also be used to refer to other service policies.", - "example": "mycustomresource\n/* equivalent to the above */\nurn:altinn:subresource:mycustomresource\nurn:altinn:task:Task_1\n/* refer to another service */\nurn:altinn:resource:some-other-service-identifier", - "nullable": true, - "type": "string" - }, - "content": { - "description": "The transmission unstructured text content.", - "oneOf": [ - { - "$ref": "#/components/schemas/GetDialogDialogTransmissionContentDto" - } - ] - }, - "createdAt": { - "description": "The date and time when the transmission was created.", - "format": "date-time", - "type": "string" - }, - "extendedType": { - "description": "Arbitrary URI/URN describing a service-specific transmission type.\n \nRefer to the service-specific documentation provided by the service owner for details (if in use).", - "format": "uri", - "nullable": true, - "type": "string" - }, - "id": { - "description": "The unique identifier for the transmission in UUIDv7 format.", - "format": "guid", + "actorId": { + "description": "The identifier of the actor.", "type": "string" }, - "isAuthorized": { - "description": "Flag indicating if the authenticated user is authorized for this transmission. If not, embedded content and\nthe attachments will not be available.", - "type": "boolean" - }, - "relatedTransmissionId": { - "description": "Reference to any other transmission that this transmission is related to.", - "format": "guid", - "nullable": true, + "actorName": { + "description": "The name of the actor.", "type": "string" }, - "sender": { - "description": "The actor that sent the transmission.", - "oneOf": [ - { - "$ref": "#/components/schemas/GetDialogDialogTransmissionSenderActorDto" - } - ] - }, - "type": { - "description": "The type of transmission.", + "actorType": { + "description": "The type of the actor.", "oneOf": [ { - "$ref": "#/components/schemas/DialogTransmissionType_Values" + "$ref": "#/components/schemas/Actors_ActorType" } ] + }, + "id": { + "description": "The unique identifier for the sender actor in UUIDv7 format.", + "format": "guid", + "type": "string" } }, "type": "object" }, - "GetDialogDialogTransmissionDtoSO": { + "V1EndUserDialogTransmissionsQueriesGet_Transmission": { "additionalProperties": false, "properties": { "attachments": { - "description": "The transmission-level attachments.", + "description": "The attachments associated with the transmission.", "items": { - "$ref": "#/components/schemas/GetDialogDialogTransmissionAttachmentDtoSO" + "$ref": "#/components/schemas/V1EndUserDialogTransmissionsQueriesGet_Attachment" }, "type": "array" }, "authorizationAttribute": { - "description": "Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service\npolicy, which by default is the policy belonging to the service referred to by \u0022serviceResource\u0022 in the dialog.\n \nCan also be used to refer to other service policies.", - "example": "mycustomresource\n/* equivalent to the above */\nurn:altinn:subresource:mycustomresource\nurn:altinn:task:Task_1\n/* refer to another service */\nurn:altinn:resource:some-other-service-identifier", + "description": "The authorization attribute associated with the transmission.", "nullable": true, "type": "string" }, "content": { - "description": "The transmission unstructured text content.", + "description": "The content of the transmission.", "oneOf": [ { - "$ref": "#/components/schemas/GetDialogDialogTransmissionContentDtoSO" + "$ref": "#/components/schemas/V1EndUserDialogTransmissionsQueriesGet_Content" } ] }, @@ -2109,8 +1705,14 @@ "format": "date-time", "type": "string" }, + "deletedAt": { + "description": "The date and time when the transmission was deleted, if applicable.", + "format": "date-time", + "nullable": true, + "type": "string" + }, "extendedType": { - "description": "Arbitrary URI/URN describing a service-specific transmission type.\n \nRefer to the service-specific documentation provided by the service owner for details (if in use).", + "description": "The extended type URI for the transmission.", "format": "uri", "nullable": true, "type": "string" @@ -2121,1689 +1723,1896 @@ "type": "string" }, "isAuthorized": { - "description": "Flag indicating if the authenticated user supplied in the query is authorized for this transmission.", - "nullable": true, + "description": "Flag indicating if the authenticated user is authorized for this transmission. If not, embedded content and\nthe attachments will not be available.", "type": "boolean" }, "relatedTransmissionId": { - "description": "Reference to any other transmission that this transmission is related to.", + "description": "The unique identifier for the related transmission, if any.", "format": "guid", "nullable": true, "type": "string" }, "sender": { - "description": "The actor that sent the transmission.", + "description": "The sender actor information for the transmission.", "oneOf": [ { - "$ref": "#/components/schemas/GetDialogDialogTransmissionSenderActorDtoSO" + "$ref": "#/components/schemas/V1EndUserDialogTransmissionsQueriesGet_SenderActor" } ] }, "type": { - "description": "The type of transmission.", - "oneOf": [ - { - "$ref": "#/components/schemas/DialogTransmissionType_Values" - } - ] - } - }, - "type": "object" - }, - "GetDialogDialogTransmissionSenderActorDto": { - "additionalProperties": false, - "properties": { - "actorId": { - "description": "The identifier of the person or organization that sent the transmission.", - "example": "urn:altinn:person:identifier-no:12018212345", - "type": "string" - }, - "actorName": { - "description": "The name of the person or organization that sent the transmission.", - "example": "Ola Nordmann", - "type": "string" - }, - "actorType": { - "description": "The type of actor that sent the transmission.", + "description": "The type of the transmission.", "oneOf": [ { - "$ref": "#/components/schemas/ActorType_Values" + "$ref": "#/components/schemas/DialogsEntitiesTransmissions_DialogTransmissionType" } ] } }, "type": "object" }, - "GetDialogDialogTransmissionSenderActorDtoSO": { + "V1EndUserDialogTransmissionsQueriesSearch_Attachment": { "additionalProperties": false, "properties": { - "actorId": { - "description": "The identifier of the person or organization that sent the transmission.", - "example": "urn:altinn:person:identifier-no:12018212345", - "type": "string" + "displayName": { + "description": "The display name of the attachment that should be used in GUIs.", + "items": { + "$ref": "#/components/schemas/V1CommonLocalizations_Localization" + }, + "type": "array" }, - "actorName": { - "description": "The name of the person or organization that sent the transmission.", - "example": "Ola Nordmann", + "id": { + "description": "The unique identifier for the attachment in UUIDv7 format.", + "format": "guid", "type": "string" }, - "actorType": { - "description": "The type of actor that sent the transmission.", - "oneOf": [ - { - "$ref": "#/components/schemas/ActorType_Values" - } - ] + "urls": { + "description": "The URLs associated with the attachment, each referring to a different representation of the attachment.", + "items": { + "$ref": "#/components/schemas/V1EndUserDialogTransmissionsQueriesSearch_AttachmentUrl" + }, + "type": "array" } }, "type": "object" }, - "GetDialogDto": { + "V1EndUserDialogTransmissionsQueriesSearch_AttachmentUrl": { "additionalProperties": false, "properties": { - "activities": { - "description": "An immutable list of activities associated with the dialog.", - "items": { - "$ref": "#/components/schemas/GetDialogDialogActivityDto" - }, - "type": "array" - }, - "apiActions": { - "description": "The API actions associated with the dialog. Should be used in specialized, non-browser-based integrations.", - "items": { - "$ref": "#/components/schemas/GetDialogDialogApiActionDto" - }, - "type": "array" - }, - "attachments": { - "description": "The attachments associated with the dialog (on an aggregate level).", - "items": { - "$ref": "#/components/schemas/GetDialogDialogAttachmentDto" - }, - "type": "array" - }, - "content": { - "description": "The dialog unstructured text content.", + "consumerType": { + "description": "The type of consumer the URL is intended for.", "oneOf": [ { - "$ref": "#/components/schemas/GetDialogContentDto" + "$ref": "#/components/schemas/Attachments_AttachmentUrlConsumerType" } ] }, - "createdAt": { - "description": "The date and time when the dialog was created.", - "example": "2022-12-31T23:59:59Z", - "format": "date-time", - "type": "string" - }, - "dialogToken": { - "description": "The dialog token. May be used (if supported) against external URLs referred to in this dialog\u0027s apiActions,\ntransmissions or attachments. It should also be used for front-channel embeds.", - "nullable": true, - "type": "string" - }, - "dueAt": { - "description": "The due date for the dialog. Dialogs past due date might be marked as such in frontends but will still be available.", - "example": "2022-12-31T23:59:59Z", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "expiresAt": { - "description": "The expiration date for the dialog. This is the last date when the dialog is available for the end user.\n \nAfter this date is passed, the dialog will be considered expired and no longer available for the end user in any\nAPI. If not supplied, the dialog will be considered to never expire. This field can be changed by the service\nowner after the dialog has been created.", - "example": "2022-12-31T23:59:59Z", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "extendedStatus": { - "description": "Arbitrary string with a service-specific indicator of status, typically used to indicate a fine-grained state of\nthe dialog to further specify the \u0022status\u0022 enum.\n \nRefer to the service-specific documentation provided by the service owner for details on the possible values (if\nin use).", - "nullable": true, - "type": "string" - }, - "externalReference": { - "description": "Arbitrary string with a service-specific reference to an external system or service.\n \nRefer to the service-specific documentation provided by the service owner for details (if in use).", - "nullable": true, - "type": "string" - }, - "guiActions": { - "description": "The GUI actions associated with the dialog. Should be used in browser-based interactive frontends.", - "items": { - "$ref": "#/components/schemas/GetDialogDialogGuiActionDto" - }, - "type": "array" - }, "id": { - "description": "The unique identifier for the dialog in UUIDv7 format.", - "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", + "description": "The unique identifier for the attachment URL in UUIDv7 format.", "format": "guid", "type": "string" }, - "org": { - "description": "The service owner code representing the organization (service owner) related to this dialog.", - "example": "ske", - "type": "string" - }, - "party": { - "description": "The party code representing the organization or person that the dialog belongs to in URN format.", - "example": "urn:altinn:person:identifier-no:01125512345\nurn:altinn:organization:identifier-no:912345678", - "type": "string" - }, - "precedingProcess": { - "description": "Optional preceding process identifier to indicate the business process that preceded the process indicated in the \u0022Process\u0022 field. Cannot be set without also \u0022Process\u0022 being set.", + "mediaType": { + "description": "The media type of the attachment.", + "example": "application/pdf\napplication/zip", "nullable": true, "type": "string" }, - "process": { - "description": "Optional process identifier used to indicate a business process this dialog belongs to.", - "nullable": true, + "url": { + "description": "The fully qualified URL of the attachment. Will be set to \u0022urn:dialogporten:unauthorized\u0022 if the user is\nnot authorized to access the transmission.", + "example": "https://someendpoint.com/someattachment.pdf\nurn:dialogporten:unauthorized", + "format": "uri", "type": "string" - }, - "progress": { - "description": "Advisory indicator of progress, represented as 1-100 percentage value. 100% representing a dialog that has come\nto a natural completion (successful or not).", - "format": "int32", + } + }, + "type": "object" + }, + "V1EndUserDialogTransmissionsQueriesSearch_Content": { + "additionalProperties": false, + "properties": { + "contentReference": { + "description": "Front-channel embedded content. Used to dynamically embed content in the frontend from an external URL.\nAllowed media types: application/vnd.dialogporten.frontchannelembed\u002Bjson;type=markdown", "nullable": true, - "type": "integer" - }, - "revision": { - "description": "The unique identifier for the revision in UUIDv4 format.", - "example": "a312cb9c-7632-43c2-aa38-69b06aed56ca", - "format": "guid", - "type": "string" - }, - "seenSinceLastUpdate": { - "description": "The list of seen log entries for the dialog newer than the dialog ChangedAt date.", - "items": { - "$ref": "#/components/schemas/GetDialogDialogSeenLogDto" - }, - "type": "array" - }, - "serviceResource": { - "description": "The service identifier for the service that the dialog is related to in URN-format.\nThis corresponds to a service resource in the Altinn Resource Registry.", - "example": "urn:altinn:resource:some-service-identifier", - "type": "string" - }, - "serviceResourceType": { - "description": "The ServiceResource type, as defined in Altinn Resource Registry (see ResourceType).", - "type": "string" + "oneOf": [ + { + "$ref": "#/components/schemas/V1CommonContent_ContentValue" + } + ] }, - "status": { - "description": "The aggregated status of the dialog.", + "summary": { + "description": "The summary of the content.", "oneOf": [ { - "$ref": "#/components/schemas/DialogStatus_Values" + "$ref": "#/components/schemas/V1CommonContent_ContentValue" } ] }, - "systemLabel": { - "description": "Current display state.", + "title": { + "description": "The title of the content.", "oneOf": [ { - "$ref": "#/components/schemas/SystemLabel_Values" + "$ref": "#/components/schemas/V1CommonContent_ContentValue" } ] + } + }, + "type": "object" + }, + "V1EndUserDialogTransmissionsQueriesSearch_SenderActor": { + "additionalProperties": false, + "properties": { + "actorId": { + "description": "The identifier of the actor.", + "type": "string" }, - "transmissions": { - "description": "The immutable list of transmissions associated with the dialog.", - "items": { - "$ref": "#/components/schemas/GetDialogDialogTransmissionDto" - }, - "type": "array" + "actorName": { + "description": "The name of the actor.", + "type": "string" }, - "updatedAt": { - "description": "The date and time when the dialog was last updated.", - "example": "2022-12-31T23:59:59Z", - "format": "date-time", + "actorType": { + "description": "The type of the actor.", + "oneOf": [ + { + "$ref": "#/components/schemas/Actors_ActorType" + } + ] + }, + "id": { + "description": "The unique identifier for the sender actor in UUIDv7 format.", + "format": "guid", "type": "string" } }, "type": "object" }, - "GetDialogDtoSO": { + "V1EndUserDialogTransmissionsQueriesSearch_Transmission": { "additionalProperties": false, "properties": { - "activities": { - "description": "An immutable list of activities associated with the dialog.", - "items": { - "$ref": "#/components/schemas/GetDialogDialogActivityDtoSO" - }, - "type": "array" - }, - "apiActions": { - "description": "The API actions associated with the dialog. Should be used in specialized, non-browser-based integrations.", - "items": { - "$ref": "#/components/schemas/GetDialogDialogApiActionDtoSO" - }, - "type": "array" - }, "attachments": { - "description": "The attachments associated with the dialog (on an aggregate level).", + "description": "The attachments associated with the transmission.", "items": { - "$ref": "#/components/schemas/GetDialogDialogAttachmentDtoSO" + "$ref": "#/components/schemas/V1EndUserDialogTransmissionsQueriesSearch_Attachment" }, "type": "array" }, + "authorizationAttribute": { + "description": "The authorization attribute associated with the transmission.", + "nullable": true, + "type": "string" + }, "content": { - "description": "The dialog unstructured text content.", + "description": "The content of the transmission.", "oneOf": [ { - "$ref": "#/components/schemas/GetDialogContentDtoSO" + "$ref": "#/components/schemas/V1EndUserDialogTransmissionsQueriesSearch_Content" } ] }, "createdAt": { - "description": "The date and time when the dialog was created.", - "example": "2022-12-31T23:59:59Z", + "description": "The date and time when the transmission was created.", "format": "date-time", "type": "string" }, "deletedAt": { - "description": "If deleted, the date and time when the deletion was performed.", + "description": "The date and time when the transmission was deleted, if applicable.", "format": "date-time", "nullable": true, "type": "string" }, - "dueAt": { - "description": "The due date for the dialog. Dialogs past due date might be marked as such in frontends but will still be available.", - "example": "2022-12-31T23:59:59Z", - "format": "date-time", + "extendedType": { + "description": "The extended type URI for the transmission.", + "format": "uri", "nullable": true, "type": "string" }, - "expiresAt": { - "description": "The expiration date for the dialog. This is the last date when the dialog is available for the end user.\n \nAfter this date is passed, the dialog will be considered expired and no longer available for the end user in any\nAPI. If not supplied, the dialog will be considered to never expire. This field can be changed by the service\nowner after the dialog has been created.", - "example": "2022-12-31T23:59:59Z", - "format": "date-time", - "nullable": true, + "id": { + "description": "The unique identifier for the transmission in UUIDv7 format.", + "format": "guid", "type": "string" }, - "extendedStatus": { - "description": "Arbitrary string with a service-specific indicator of status, typically used to indicate a fine-grained state of\nthe dialog to further specify the \u0022status\u0022 enum.\n \nRefer to the service-specific documentation provided by the service owner for details on the possible values (if\nin use).", - "nullable": true, - "type": "string" + "isAuthorized": { + "description": "Flag indicating if the authenticated user is authorized for this transmission. If not, embedded content and\nthe attachments will not be available.", + "type": "boolean" }, - "externalReference": { - "description": "Arbitrary string with a service-specific reference to an external system or service.\n \nRefer to the service-specific documentation provided by the service owner for details (if in use).", + "relatedTransmissionId": { + "description": "The unique identifier for the related transmission, if any.", + "format": "guid", "nullable": true, "type": "string" }, - "guiActions": { - "description": "The GUI actions associated with the dialog. Should be used in browser-based interactive frontends.", - "items": { - "$ref": "#/components/schemas/GetDialogDialogGuiActionDtoSO" - }, - "type": "array" + "sender": { + "description": "The sender actor information for the transmission.", + "oneOf": [ + { + "$ref": "#/components/schemas/V1EndUserDialogTransmissionsQueriesSearch_SenderActor" + } + ] }, - "id": { - "description": "The unique identifier for the dialog in UUIDv7 format.", - "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", - "format": "guid", - "type": "string" + "type": { + "description": "The type of the transmission.", + "oneOf": [ + { + "$ref": "#/components/schemas/DialogsEntitiesTransmissions_DialogTransmissionType" + } + ] + } + }, + "type": "object" + }, + "V1EndUserPartiesQueriesGet_AuthorizedParty": { + "additionalProperties": false, + "properties": { + "hasKeyRole": { + "type": "boolean" }, - "org": { - "description": "The service owner code representing the organization (service owner) related to this dialog.", - "example": "ske", - "type": "string" + "hasOnlyAccessToSubParties": { + "type": "boolean" }, - "party": { - "description": "The party code representing the organization or person that the dialog belongs to in URN format.", - "example": "urn:altinn:person:identifier-no:01125512345\nurn:altinn:organization:identifier-no:912345678", - "type": "string" + "isAccessManager": { + "type": "boolean" }, - "precedingProcess": { - "description": "Optional preceding process identifier to indicate the business process that preceded the process indicated in the \u0022Process\u0022 field. Cannot be set without also \u0022Process\u0022 being set.", - "nullable": true, - "type": "string" + "isCurrentEndUser": { + "type": "boolean" }, - "process": { - "description": "Optional process identifier used to indicate a business process this dialog belongs to.", - "nullable": true, + "isDeleted": { + "type": "boolean" + }, + "isMainAdministrator": { + "type": "boolean" + }, + "name": { "type": "string" }, - "progress": { - "description": "Advisory indicator of progress, represented as 1-100 percentage value. 100% representing a dialog that has come\nto a natural completion (successful or not).", - "format": "int32", - "nullable": true, - "type": "integer" + "party": { + "type": "string" }, - "revision": { - "description": "The unique identifier for the revision in UUIDv4 format.", - "example": "a312cb9c-7632-43c2-aa38-69b06aed56ca", - "format": "guid", + "partyType": { "type": "string" }, - "searchTags": { - "description": "The list of words (tags) that will be used in dialog search queries. Not visible in end-user DTO.", + "subParties": { "items": { - "$ref": "#/components/schemas/GetDialogSearchTagDtoSO" + "$ref": "#/components/schemas/V1EndUserPartiesQueriesGet_AuthorizedParty" }, "nullable": true, "type": "array" + } + }, + "type": "object" + }, + "V1EndUserPartiesQueriesGet_Parties": { + "additionalProperties": false, + "properties": { + "authorizedParties": { + "items": { + "$ref": "#/components/schemas/V1EndUserPartiesQueriesGet_AuthorizedParty" + }, + "type": "array" + } + }, + "type": "object" + }, + "V1ServiceOwnerDialogActivitiesCreate_ActivityRequest": { + "additionalProperties": false, + "properties": { + "createdAt": { + "description": "If supplied, overrides the creating date and time for the transmission.\nIf not supplied, the current date /time will be used.", + "format": "date-time", + "nullable": true, + "type": "string" }, - "seenSinceLastUpdate": { - "description": "The list of seen log entries for the dialog newer than the dialog ChangedAt date.", + "description": { + "description": "Unstructured text describing the activity. Only set if the activity type is \u0022Information\u0022.", "items": { - "$ref": "#/components/schemas/GetDialogDialogSeenLogDtoSO" + "$ref": "#/components/schemas/V1CommonLocalizations_Localization" }, "type": "array" }, - "serviceResource": { - "description": "The service identifier for the service that the dialog is related to in URN-format.\nThis corresponds to a service resource in the Altinn Resource Registry.", - "example": "urn:altinn:resource:some-service-identifier", + "extendedType": { + "description": "Arbitrary URI/URN describing a service-specific transmission type.", + "format": "uri", + "nullable": true, "type": "string" }, - "serviceResourceType": { - "description": "The ServiceResource type, as defined in Altinn Resource Registry (see ResourceType).", + "id": { + "description": "The UUDIv7 of the action may be provided to support idempotent additions to the list of activities.\nIf not supplied, a new UUIDv7 will be generated.", + "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", + "format": "guid", + "nullable": true, "type": "string" }, - "status": { - "description": "The aggregated status of the dialog.", + "performedBy": { + "description": "The actor that performed the activity.", "oneOf": [ { - "$ref": "#/components/schemas/DialogStatus_Values" + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsUpdate_ActivityPerformedByActor" } ] }, - "systemLabel": { - "description": "Current display state.", + "transmissionId": { + "description": "If the activity is related to a particular transmission, this field will contain the transmission identifier.\nMust be present in the request body.", + "format": "guid", + "nullable": true, + "type": "string" + }, + "type": { + "description": "The type of transmission.", "oneOf": [ { - "$ref": "#/components/schemas/SystemLabel_Values" + "$ref": "#/components/schemas/DialogsEntitiesActivities_DialogActivityType" } ] + } + }, + "type": "object" + }, + "V1ServiceOwnerDialogActivitiesQueriesGet_Activity": { + "additionalProperties": false, + "properties": { + "createdAt": { + "format": "date-time", + "nullable": true, + "type": "string" }, - "transmissions": { - "description": "The immutable list of transmissions associated with the dialog.", + "deletedAt": { + "format": "date-time", + "nullable": true, + "type": "string" + }, + "description": { "items": { - "$ref": "#/components/schemas/GetDialogDialogTransmissionDtoSO" + "$ref": "#/components/schemas/V1CommonLocalizations_Localization" }, "type": "array" }, - "updatedAt": { - "description": "The date and time when the dialog was last updated.", - "example": "2022-12-31T23:59:59Z", - "format": "date-time", + "extendedType": { + "format": "uri", + "nullable": true, "type": "string" }, - "visibleFrom": { - "description": "The timestamp when the dialog will be made visible for authorized end users.", - "example": "2022-12-31T23:59:59Z", - "format": "date-time", + "id": { + "format": "guid", + "type": "string" + }, + "performedBy": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogActivitiesQueriesGet_ActivityPerformedByActor" + }, + "transmissionId": { + "format": "guid", "nullable": true, "type": "string" + }, + "type": { + "$ref": "#/components/schemas/DialogsEntitiesActivities_DialogActivityType" } }, "type": "object" }, - "GetDialogSearchTagDtoSO": { + "V1ServiceOwnerDialogActivitiesQueriesGet_ActivityPerformedByActor": { "additionalProperties": false, "properties": { - "value": { - "description": "A search tag value.", + "actorId": { + "nullable": true, + "type": "string" + }, + "actorName": { + "nullable": true, + "type": "string" + }, + "actorType": { + "$ref": "#/components/schemas/Actors_ActorType" + }, + "id": { + "format": "guid", "type": "string" } }, "type": "object" }, - "GetDialogSeenLogDto": { + "V1ServiceOwnerDialogActivitiesQueriesNotificationCondition_NotificationCondition": { "additionalProperties": false, "properties": { - "id": { - "format": "guid", - "type": "string" - }, - "isCurrentEndUser": { - "type": "boolean" - }, - "isViaServiceOwner": { + "sendNotification": { "type": "boolean" - }, - "seenAt": { - "format": "date-time", - "type": "string" - }, - "seenBy": { - "$ref": "#/components/schemas/GetDialogSeenLogSeenByActorDto" } }, "type": "object" }, - "GetDialogSeenLogDtoSO": { + "V1ServiceOwnerDialogActivitiesQueriesNotificationCondition_NotificationConditionType": { + "description": "", + "enum": [ + "NotExists", + "Exists" + ], + "type": "string", + "x-enumNames": [ + "NotExists", + "Exists" + ] + }, + "V1ServiceOwnerDialogActivitiesQueriesSearch_Activity": { "additionalProperties": false, "properties": { + "createdAt": { + "format": "date-time", + "type": "string" + }, + "deletedAt": { + "format": "date-time", + "nullable": true, + "type": "string" + }, + "extendedType": { + "format": "uri", + "nullable": true, + "type": "string" + }, "id": { "format": "guid", "type": "string" }, - "isViaServiceOwner": { + "transmissionId": { + "format": "guid", "nullable": true, - "type": "boolean" - }, - "seenAt": { - "format": "date-time", "type": "string" }, - "seenBy": { - "$ref": "#/components/schemas/GetDialogSeenLogSeenByActorDtoSO" + "type": { + "$ref": "#/components/schemas/DialogsEntitiesActivities_DialogActivityType" } }, "type": "object" }, - "GetDialogSeenLogSeenByActorDto": { + "V1ServiceOwnerDialogsCommandsCreate_Activity": { "additionalProperties": false, "properties": { - "actorId": { + "createdAt": { + "description": "If supplied, overrides the creating date and time for the transmission.\nIf not supplied, the current date /time will be used.", + "format": "date-time", + "nullable": true, "type": "string" }, - "actorName": { + "description": { + "description": "Unstructured text describing the activity. Only set if the activity type is \u0022Information\u0022.", + "items": { + "$ref": "#/components/schemas/V1CommonLocalizations_Localization" + }, + "type": "array" + }, + "extendedType": { + "description": "Arbitrary URI/URN describing a service-specific transmission type.", + "format": "uri", + "nullable": true, "type": "string" }, "id": { + "description": "A self-defined UUIDv7 may be provided to support idempotent creation of activities. If not provided, a new UUIDv7 will be generated.", + "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", + "format": "guid", + "nullable": true, + "type": "string" + }, + "performedBy": { + "description": "The actor that performed the activity.", + "oneOf": [ + { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsCreate_ActivityPerformedByActor" + } + ] + }, + "transmissionId": { + "description": "If the activity is related to a particular transmission, this field will contain the transmission identifier.\nMust be present in the request body.", "format": "guid", + "nullable": true, "type": "string" + }, + "type": { + "description": "The type of transmission.", + "oneOf": [ + { + "$ref": "#/components/schemas/DialogsEntitiesActivities_DialogActivityType" + } + ] } }, "type": "object" }, - "GetDialogSeenLogSeenByActorDtoSO": { + "V1ServiceOwnerDialogsCommandsCreate_ActivityPerformedByActor": { "additionalProperties": false, "properties": { "actorId": { + "description": "The identifier of the person or organization that performed the activity. Mutually exclusive with ActorName.\nMight be omitted if ActorType is \u0022ServiceOwner\u0022.", + "example": "urn:altinn:person:identifier-no:12018212345", + "nullable": true, "type": "string" }, "actorName": { + "description": "Specifies the name of the entity that performed the activity. Mutually exclusive with ActorId. If ActorId\nis supplied, the name will be automatically populated from the name registries.", + "example": "Ola Nordmann", + "nullable": true, "type": "string" }, - "id": { - "format": "guid", - "type": "string" + "actorType": { + "description": "What type of actor performed the activity.", + "oneOf": [ + { + "$ref": "#/components/schemas/Actors_ActorType" + } + ] } }, "type": "object" }, - "GetDialogTransmissionAttachmentDto": { + "V1ServiceOwnerDialogsCommandsCreate_ApiAction": { "additionalProperties": false, "properties": { - "displayName": { - "description": "The display name of the attachment that should be used in GUIs.", - "items": { - "$ref": "#/components/schemas/LocalizationDto" - }, - "type": "array" + "action": { + "description": "String identifier for the action, corresponding to the \u0022action\u0022 attributeId used in the XACML service policy,\nwhich by default is the policy belonging to the service referred to by \u0022serviceResource\u0022 in the dialog.", + "example": "write", + "type": "string" }, - "id": { - "description": "The unique identifier for the attachment in UUIDv7 format.", - "format": "guid", + "authorizationAttribute": { + "description": "Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service\npolicy, which by default is the policy belonging to the service referred to by \u0022serviceResource\u0022 in the dialog.\n \nCan also be used to refer to other service policies.", + "example": "mycustomresource\n/* equivalent to the above */\nurn:altinn:subresource:mycustomresource\nurn:altinn:task:Task_1\n/* refer to another service */\nurn:altinn:resource:some-other-service-identifier", + "nullable": true, "type": "string" }, - "urls": { - "description": "The URLs associated with the attachment, each referring to a different representation of the attachment.", + "endpoints": { + "description": "The endpoints associated with the action.", "items": { - "$ref": "#/components/schemas/GetDialogTransmissionAttachmentUrlDto" + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsCreate_ApiActionEndpoint" }, "type": "array" } }, "type": "object" }, - "GetDialogTransmissionAttachmentDtoSO": { + "V1ServiceOwnerDialogsCommandsCreate_ApiActionEndpoint": { "additionalProperties": false, "properties": { - "displayName": { - "description": "The display name of the attachment that should be used in GUIs.", - "items": { - "$ref": "#/components/schemas/LocalizationDto" - }, - "type": "array" + "deprecated": { + "description": "Boolean indicating if the endpoint is deprecated.", + "type": "boolean" }, - "id": { - "description": "The unique identifier for the attachment in UUIDv7 format.", - "format": "guid", + "documentationUrl": { + "description": "Link to documentation for the endpoint, providing documentation for integrators. Should be a URL to a\nhuman-readable page.", + "format": "uri", + "nullable": true, "type": "string" }, - "urls": { - "description": "The URLs associated with the attachment, each referring to a different representation of the attachment.", - "items": { - "$ref": "#/components/schemas/GetDialogTransmissionAttachmentUrlDtoSO" - }, - "type": "array" - } - }, - "type": "object" - }, - "GetDialogTransmissionAttachmentUrlDto": { - "additionalProperties": false, - "properties": { - "consumerType": { - "description": "The type of consumer the URL is intended for.", + "httpMethod": { + "description": "The HTTP method that the endpoint expects for this action.", "oneOf": [ { - "$ref": "#/components/schemas/AttachmentUrlConsumerType_Values" + "$ref": "#/components/schemas/Http_HttpVerb" } ] }, - "id": { - "description": "The unique identifier for the attachment URL in UUIDv7 format.", - "format": "guid", - "type": "string" - }, - "mediaType": { - "description": "The media type of the attachment.", - "example": "application/pdf\napplication/zip", + "requestSchema": { + "description": "Link to the request schema for the endpoint. Used to provide documentation for integrators.\nDialogporten will not validate information on this endpoint.", + "format": "uri", "nullable": true, "type": "string" }, - "url": { - "description": "The fully qualified URL of the attachment. Will be set to \u0022urn:dialogporten:unauthorized\u0022 if the user is\nnot authorized to access the transmission.", - "example": "https://someendpoint.com/someattachment.pdf\nurn:dialogporten:unauthorized", + "responseSchema": { + "description": "Link to the response schema for the endpoint. Used to provide documentation for integrators.\nDialogporten will not validate information on this endpoint.", "format": "uri", - "type": "string" - } - }, - "type": "object" - }, - "GetDialogTransmissionAttachmentUrlDtoSO": { - "additionalProperties": false, - "properties": { - "consumerType": { - "description": "The type of consumer the URL is intended for.", - "oneOf": [ - { - "$ref": "#/components/schemas/AttachmentUrlConsumerType_Values" - } - ] - }, - "id": { - "description": "The unique identifier for the attachment URL in UUIDv7 format.", - "format": "guid", + "nullable": true, "type": "string" }, - "mediaType": { - "description": "The media type of the attachment.", - "example": "application/pdf\napplication/zip", + "sunsetAt": { + "description": "Date and time when the endpoint will no longer function. Only set if the endpoint is deprecated. Dialogporten\nwill not enforce this date.", + "format": "date-time", "nullable": true, "type": "string" }, "url": { - "description": "The fully qualified URL of the attachment. Will be set to \u0022urn:dialogporten:unauthorized\u0022 if the user is\nnot authorized to access the transmission.", - "example": "https://someendpoint.com/someattachment.pdf\nurn:dialogporten:unauthorized", + "description": "The fully qualified URL of the API endpoint.", "format": "uri", "type": "string" + }, + "version": { + "description": "Arbitrary string indicating the version of the endpoint.", + "nullable": true, + "type": "string" } }, "type": "object" }, - "GetDialogTransmissionContentDto": { + "V1ServiceOwnerDialogsCommandsCreate_Attachment": { "additionalProperties": false, "properties": { - "contentReference": { - "description": "Front-channel embedded content. Used to dynamically embed content in the frontend from an external URL.\nAllowed media types: application/vnd.dialogporten.frontchannelembed\u002Bjson;type=markdown", - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/ContentValueDto" - } - ] - }, - "summary": { - "description": "The summary of the content.", - "oneOf": [ - { - "$ref": "#/components/schemas/ContentValueDto" - } - ] + "displayName": { + "description": "The display name of the attachment that should be used in GUIs.", + "items": { + "$ref": "#/components/schemas/V1CommonLocalizations_Localization" + }, + "type": "array" }, - "title": { - "description": "The title of the content.", - "oneOf": [ - { - "$ref": "#/components/schemas/ContentValueDto" - } - ] + "urls": { + "description": "The URLs associated with the attachment, each referring to a different representation of the attachment.", + "items": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsCreate_AttachmentUrl" + }, + "type": "array" } }, "type": "object" }, - "GetDialogTransmissionContentDtoSO": { + "V1ServiceOwnerDialogsCommandsCreate_AttachmentUrl": { "additionalProperties": false, "properties": { - "contentReference": { - "description": "Front-channel embedded content. Used to dynamically embed content in the frontend from an external URL.\nAllowed media types: application/vnd.dialogporten.frontchannelembed\u002Bjson;type=markdown", - "nullable": true, + "consumerType": { + "description": "The type of consumer the URL is intended for.", "oneOf": [ { - "$ref": "#/components/schemas/ContentValueDto" + "$ref": "#/components/schemas/Attachments_AttachmentUrlConsumerType" } ] }, - "summary": { - "description": "The summary of the content.", - "oneOf": [ - { - "$ref": "#/components/schemas/ContentValueDto" - } - ] + "mediaType": { + "description": "The media type of the attachment.", + "example": "application/pdf\napplication/zip", + "nullable": true, + "type": "string" }, - "title": { - "description": "The title of the content.", - "oneOf": [ - { - "$ref": "#/components/schemas/ContentValueDto" - } - ] + "url": { + "description": "The fully qualified URL of the attachment.", + "format": "uri", + "type": "string" } }, "type": "object" }, - "GetDialogTransmissionDto": { + "V1ServiceOwnerDialogsCommandsCreate_Content": { "additionalProperties": false, "properties": { - "attachments": { - "description": "The attachments associated with the transmission.", - "items": { - "$ref": "#/components/schemas/GetDialogTransmissionAttachmentDto" - }, - "type": "array" - }, - "authorizationAttribute": { - "description": "The authorization attribute associated with the transmission.", + "additionalInfo": { + "description": "Additional information about the dialog.\nSupported media types: text/plain, text/markdown", "nullable": true, - "type": "string" - }, - "content": { - "description": "The content of the transmission.", "oneOf": [ { - "$ref": "#/components/schemas/GetDialogTransmissionContentDto" + "$ref": "#/components/schemas/V1CommonContent_ContentValue" } ] }, - "createdAt": { - "description": "The date and time when the transmission was created.", - "format": "date-time", - "type": "string" - }, - "deletedAt": { - "description": "The date and time when the transmission was deleted, if applicable.", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "extendedType": { - "description": "The extended type URI for the transmission.", - "format": "uri", - "nullable": true, - "type": "string" - }, - "id": { - "description": "The unique identifier for the transmission in UUIDv7 format.", - "format": "guid", - "type": "string" - }, - "isAuthorized": { - "description": "Flag indicating if the authenticated user is authorized for this transmission. If not, embedded content and\nthe attachments will not be available.", - "type": "boolean" + "extendedStatus": { + "description": "Used as the human-readable label used to describe the \u0022ExtendedStatus\u0022 field.\nSupported media types: text/plain", + "nullable": true, + "oneOf": [ + { + "$ref": "#/components/schemas/V1CommonContent_ContentValue" + } + ] }, - "relatedTransmissionId": { - "description": "The unique identifier for the related transmission, if any.", - "format": "guid", + "mainContentReference": { + "description": "Front-channel embedded content. Used to dynamically embed content in the frontend from an external URL. Must be HTTPS.\nSupported media types: application/vnd.dialogporten.frontchannelembed\u002Bjson;type=markdown", "nullable": true, - "type": "string" + "oneOf": [ + { + "$ref": "#/components/schemas/V1CommonContent_ContentValue" + } + ] }, - "sender": { - "description": "The sender actor information for the transmission.", + "senderName": { + "description": "Overridden sender name. If not supplied, assume \u0022org\u0022 as the sender name. Must be text/plain if supplied.\nSupported media types: text/plain", + "nullable": true, "oneOf": [ { - "$ref": "#/components/schemas/GetDialogTransmissionSenderActorDto" + "$ref": "#/components/schemas/V1CommonContent_ContentValue" } ] }, - "type": { - "description": "The type of the transmission.", + "summary": { + "description": "A short summary of the dialog and its current state.\nSupported media types: text/plain", + "oneOf": [ + { + "$ref": "#/components/schemas/V1CommonContent_ContentValue" + } + ] + }, + "title": { + "description": "The title of the dialog.\nSupported media types: text/plain", "oneOf": [ { - "$ref": "#/components/schemas/DialogTransmissionType_Values" + "$ref": "#/components/schemas/V1CommonContent_ContentValue" } ] } }, "type": "object" }, - "GetDialogTransmissionDtoSO": { + "V1ServiceOwnerDialogsCommandsCreate_DialogCommand": { "additionalProperties": false, "properties": { - "attachments": { - "description": "The attachments associated with the transmission.", + "activities": { + "description": "An immutable list of activities associated with the dialog.", "items": { - "$ref": "#/components/schemas/GetDialogTransmissionAttachmentDtoSO" + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsCreate_Activity" }, "type": "array" }, - "authorizationAttribute": { - "description": "The authorization attribute associated with the transmission.", - "nullable": true, - "type": "string" + "apiActions": { + "description": "The API actions associated with the dialog. Should be used in specialized, non-browser-based integrations.", + "items": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsCreate_ApiAction" + }, + "type": "array" + }, + "attachments": { + "description": "The attachments associated with the dialog (on an aggregate level).", + "items": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsCreate_Attachment" + }, + "type": "array" }, "content": { - "description": "The content of the transmission.", + "description": "The dialog unstructured text content.", "oneOf": [ { - "$ref": "#/components/schemas/GetDialogTransmissionContentDtoSO" + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsCreate_Content" } ] }, "createdAt": { - "description": "The date and time when the transmission was created.", + "description": "If set, will override the date and time when the dialog is set as created.\nIf not supplied, the current date /time will be used.", + "example": "2022-12-31T23:59:59Z", "format": "date-time", "type": "string" }, - "deletedAt": { - "description": "The date and time when the transmission was deleted, if applicable.", + "dueAt": { + "description": "The due date for the dialog. Dialogs past due date might be marked as such in frontends but will still be available.", + "example": "2022-12-31T23:59:59Z", "format": "date-time", "nullable": true, "type": "string" }, - "extendedType": { - "description": "The extended type URI for the transmission.", - "format": "uri", + "expiresAt": { + "description": "The expiration date for the dialog. This is the last date when the dialog is available for the end user.\n \nAfter this date is passed, the dialog will be considered expired and no longer available for the end user in any\nAPI. If not supplied, the dialog will be considered to never expire. This field can be changed after creation.", + "example": "2022-12-31T23:59:59Z", + "format": "date-time", + "nullable": true, + "type": "string" + }, + "extendedStatus": { + "description": "Arbitrary string with a service-specific indicator of status, typically used to indicate a fine-grained state of\nthe dialog to further specify the \u0022status\u0022 enum.", + "nullable": true, + "type": "string" + }, + "externalReference": { + "description": "Arbitrary string with a service-specific reference to an external system or service.", "nullable": true, "type": "string" }, + "guiActions": { + "description": "The GUI actions associated with the dialog. Should be used in browser-based interactive frontends.", + "items": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsCreate_GuiAction" + }, + "type": "array" + }, "id": { - "description": "The unique identifier for the transmission in UUIDv7 format.", + "description": "A self-defined UUIDv7 may be provided to support idempotent creation of dialogs. If not provided, a new UUIDv7 will be generated.", + "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", "format": "guid", + "nullable": true, "type": "string" }, - "relatedTransmissionId": { - "description": "The unique identifier for the related transmission, if any.", - "format": "guid", + "party": { + "description": "The party code representing the organization or person that the dialog belongs to in URN format.", + "example": "urn:altinn:person:identifier-no:01125512345\nurn:altinn:organization:identifier-no:912345678", + "type": "string" + }, + "precedingProcess": { + "description": "Optional preceding process identifier to indicate the business process that preceded the process indicated in the \u0022Process\u0022 field. Cannot be set without also \u0022Process\u0022 being set.", "nullable": true, "type": "string" }, - "sender": { - "description": "The sender actor information for the transmission.", + "process": { + "description": "Optional process identifier used to indicate a business process this dialog belongs to.", + "nullable": true, + "type": "string" + }, + "progress": { + "description": "Advisory indicator of progress, represented as 1-100 percentage value. 100% representing a dialog that has come\nto a natural completion (successful or not).", + "format": "int32", + "nullable": true, + "type": "integer" + }, + "searchTags": { + "description": "A list of words (tags) that will be used in dialog search queries. Not visible in end-user DTO.", + "items": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsCreate_SearchTag" + }, + "type": "array" + }, + "serviceResource": { + "description": "The service identifier for the service that the dialog is related to in URN-format.\nThis corresponds to a resource in the Altinn Resource Registry, which the authenticated organization\nmust own, i.e., be listed as the \u0022competent authority\u0022 in the Resource Registry entry.", + "example": "urn:altinn:resource:some-service-identifier", + "type": "string" + }, + "status": { + "description": "The aggregated status of the dialog.", "oneOf": [ { - "$ref": "#/components/schemas/GetDialogTransmissionSenderActorDtoSO" + "$ref": "#/components/schemas/DialogsEntities_DialogStatus" } ] }, - "type": { - "description": "The type of the transmission.", + "systemLabel": { + "description": "Set the system label of the dialog Migration purposes.", + "nullable": true, "oneOf": [ { - "$ref": "#/components/schemas/DialogTransmissionType_Values" + "$ref": "#/components/schemas/DialogEndUserContextsEntities_SystemLabel" } ] + }, + "transmissions": { + "description": "The immutable list of transmissions associated with the dialog.", + "items": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsCreate_Transmission" + }, + "type": "array" + }, + "updatedAt": { + "description": "If set, will override the date and time when the dialog is set as last updated.\nIf not supplied, the current date /time will be used.", + "example": "2022-12-31T23:59:59Z", + "format": "date-time", + "type": "string" + }, + "visibleFrom": { + "description": "The timestamp when the dialog should be made visible for authorized end users. If not provided, the dialog will be\nimmediately available.", + "example": "2022-12-31T23:59:59Z", + "format": "date-time", + "nullable": true, + "type": "string" } }, "type": "object" }, - "GetDialogTransmissionSenderActorDto": { + "V1ServiceOwnerDialogsCommandsCreate_GuiAction": { "additionalProperties": false, "properties": { - "actorId": { - "description": "The identifier of the actor.", + "action": { + "description": "The action identifier for the action, corresponding to the \u0022action\u0022 attributeId used in the XACML service policy.", "type": "string" }, - "actorName": { - "description": "The name of the actor.", + "authorizationAttribute": { + "description": "Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service\npolicy, which by default is the policy belonging to the service referred to by \u0022serviceResource\u0022 in the dialog.\n \nCan also be used to refer to other service policies.", + "example": "mycustomresource\n/* equivalent to the above */\nurn:altinn:subresource:mycustomresource\nurn:altinn:task:Task_1\n/* refer to another service */\nurn:altinn:resource:some-other-service-identifier", + "nullable": true, "type": "string" }, - "actorType": { - "description": "The type of the actor.", + "httpMethod": { + "description": "The HTTP method that the frontend should use when redirecting the user.", + "nullable": true, "oneOf": [ { - "$ref": "#/components/schemas/ActorType_Values" + "$ref": "#/components/schemas/Http_HttpVerb" } ] }, - "id": { - "description": "The unique identifier for the sender actor in UUIDv7 format.", - "format": "guid", - "type": "string" - } - }, - "type": "object" - }, - "GetDialogTransmissionSenderActorDtoSO": { - "additionalProperties": false, - "properties": { - "actorId": { - "description": "The identifier of the actor.", - "type": "string" - }, - "actorName": { - "description": "The name of the actor.", - "type": "string" + "isDeleteDialogAction": { + "description": "Indicates whether the action results in the dialog being deleted. Used by frontends to implement custom UX\nfor delete actions.", + "type": "boolean" }, - "actorType": { - "description": "The type of the actor.", + "priority": { + "description": "Indicates a priority for the action, making it possible for frontends to adapt GUI elements based on action\npriority.", "oneOf": [ { - "$ref": "#/components/schemas/ActorType_Values" + "$ref": "#/components/schemas/DialogsEntitiesActions_DialogGuiActionPriority" } ] }, - "id": { - "description": "The unique identifier for the sender actor in UUIDv7 format.", - "format": "guid", - "type": "string" - } - }, - "type": "object" - }, - "GetJwksDto": { - "additionalProperties": false, - "properties": { - "keys": { + "prompt": { + "description": "If there should be a prompt asking the user for confirmation before the action is executed,\nthis field should contain the prompt text.", "items": { - "$ref": "#/components/schemas/Jwk" + "$ref": "#/components/schemas/V1CommonLocalizations_Localization" }, + "nullable": true, "type": "array" - } - }, - "type": "object" - }, - "GetOauthAuthorizationServerDto": { - "additionalProperties": false, - "properties": { - "issuer": { - "type": "string" }, - "jwks_uri": { + "title": { + "description": "The title of the action, this should be short and in verb form. Must be text/plain.", + "items": { + "$ref": "#/components/schemas/V1CommonLocalizations_Localization" + }, + "type": "array" + }, + "url": { + "description": "The fully qualified URL of the action, to which the user will be redirected when the action is triggered. Will be set to\n\u0022urn:dialogporten:unauthorized\u0022 if the user is not authorized to perform the action.", + "example": "urn:dialogporten:unauthorized\nhttps://someendpoint.com/gui/some-service-instance-id", + "format": "uri", "type": "string" } }, "type": "object" }, - "GetPartiesDto": { + "V1ServiceOwnerDialogsCommandsCreate_SearchTag": { "additionalProperties": false, "properties": { - "authorizedParties": { - "items": { - "$ref": "#/components/schemas/AuthorizedPartyDto" - }, - "type": "array" + "value": { + "description": "A search tag value.", + "type": "string" } }, "type": "object" }, - "HttpVerb_Values": { - "description": "", - "enum": [ - "GET", - "POST", - "PUT", - "PATCH", - "DELETE", - "HEAD", - "OPTIONS", - "TRACE", - "CONNECT" - ], - "type": "string", - "x-enumNames": [ - "GET", - "POST", - "PUT", - "PATCH", - "DELETE", - "HEAD", - "OPTIONS", - "TRACE", - "CONNECT" - ] - }, - "Jwk": { + "V1ServiceOwnerDialogsCommandsCreate_Transmission": { "additionalProperties": false, "properties": { - "alg": { - "type": "string" + "attachments": { + "description": "The transmission-level attachments.", + "items": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsCreate_TransmissionAttachment" + }, + "type": "array" }, - "crv": { + "authorizationAttribute": { + "description": "Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service\npolicy, which by default is the policy belonging to the service referred to by \u0022serviceResource\u0022 in the dialog.\n \nCan also be used to refer to other service policies.", + "example": "mycustomresource\n/* equivalent to the above */\nurn:altinn:subresource:mycustomresource\nurn:altinn:task:Task_1\n/* refer to another service */\nurn:altinn:resource:some-other-service-identifier", + "nullable": true, "type": "string" }, - "kid": { + "content": { + "description": "The transmission unstructured text content.", + "oneOf": [ + { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsCreate_TransmissionContent" + } + ] + }, + "createdAt": { + "description": "If supplied, overrides the creating date and time for the transmission.\nIf not supplied, the current date /time will be used.", + "format": "date-time", "type": "string" }, - "kty": { + "extendedType": { + "description": "Arbitrary URI/URN describing a service-specific transmission type.\n \nRefer to the service-specific documentation provided by the service owner for details (if in use).", + "format": "uri", + "nullable": true, "type": "string" }, - "use": { + "id": { + "description": "A self-defined UUIDv7 may be provided to support idempotent creation of transmissions. If not provided, a new UUIDv7 will be generated.", + "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", + "format": "guid", + "nullable": true, "type": "string" }, - "x": { + "relatedTransmissionId": { + "description": "Reference to any other transmission that this transmission is related to.", + "format": "guid", + "nullable": true, "type": "string" + }, + "sender": { + "description": "The actor that sent the transmission.", + "oneOf": [ + { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsCreate_TransmissionSenderActor" + } + ] + }, + "type": { + "description": "The type of transmission.", + "oneOf": [ + { + "$ref": "#/components/schemas/DialogsEntitiesTransmissions_DialogTransmissionType" + } + ] } }, "type": "object" }, - "LabelAssignmentLogActorDto": { + "V1ServiceOwnerDialogsCommandsCreate_TransmissionAttachment": { "additionalProperties": false, "properties": { - "actorId": { - "type": "string" + "displayName": { + "description": "The display name of the attachment that should be used in GUIs.", + "items": { + "$ref": "#/components/schemas/V1CommonLocalizations_Localization" + }, + "type": "array" }, - "actorName": { + "id": { + "description": "A self-defined UUIDv7 may be provided to support idempotent creation of transmission attachments. If not provided, a new UUIDv7 will be generated.", + "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", + "format": "guid", + "nullable": true, "type": "string" + }, + "urls": { + "description": "The URLs associated with the attachment, each referring to a different representation of the attachment.", + "items": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsCreate_TransmissionAttachmentUrl" + }, + "type": "array" } }, "type": "object" }, - "LocalizationDto": { + "V1ServiceOwnerDialogsCommandsCreate_TransmissionAttachmentUrl": { "additionalProperties": false, "properties": { - "languageCode": { - "description": "The language code of the localization in ISO 639-1 format.", - "example": "nb", + "consumerType": { + "description": "The type of consumer the URL is intended for.", + "oneOf": [ + { + "$ref": "#/components/schemas/Attachments_AttachmentUrlConsumerType" + } + ] + }, + "mediaType": { + "description": "The media type of the attachment.", + "example": "application/pdf\napplication/zip", + "nullable": true, "type": "string" }, - "value": { - "description": "The localized text or URI reference.", + "url": { + "description": "The fully qualified URL of the attachment.", + "format": "uri", "type": "string" } }, "type": "object" }, - "NotificationConditionDto": { + "V1ServiceOwnerDialogsCommandsCreate_TransmissionContent": { "additionalProperties": false, "properties": { - "sendNotification": { - "type": "boolean" + "contentReference": { + "description": "Front-channel embedded content. Used to dynamically embed content in the frontend from an external URL. Must be HTTPS.\nAllowed media types: application/vnd.dialogporten.frontchannelembed\u002Bjson;type=markdown", + "nullable": true, + "oneOf": [ + { + "$ref": "#/components/schemas/V1CommonContent_ContentValue" + } + ] + }, + "summary": { + "description": "The transmission summary.", + "oneOf": [ + { + "$ref": "#/components/schemas/V1CommonContent_ContentValue" + } + ] + }, + "title": { + "description": "The transmission title. Must be text/plain.", + "oneOf": [ + { + "$ref": "#/components/schemas/V1CommonContent_ContentValue" + } + ] } }, "type": "object" }, - "NotificationConditionType": { - "description": "", - "enum": [ - "NotExists", - "Exists" - ], - "type": "string", - "x-enumNames": [ - "NotExists", - "Exists" - ] - }, - "Operation": { + "V1ServiceOwnerDialogsCommandsCreate_TransmissionSenderActor": { "additionalProperties": false, "properties": { - "from": { - "nullable": true, - "type": "string" - }, - "op": { + "actorId": { + "description": "The identifier of the person or organization that sent the transmission. Mutually exclusive with ActorName.\nMight be omitted if ActorType is \u0022ServiceOwner\u0022.", + "example": "urn:altinn:person:identifier-no:12018212345", "nullable": true, "type": "string" }, - "operationType": { - "$ref": "#/components/schemas/OperationType" - }, - "path": { + "actorName": { + "description": "Specifies the name of the entity that sent the transmission. Mutually exclusive with ActorId. If ActorId\nis supplied, the name will be automatically populated from the name registries.", + "example": "Ola Nordmann", "nullable": true, "type": "string" }, - "value": { - "nullable": true + "actorType": { + "description": "The type of actor that sent the transmission.", + "oneOf": [ + { + "$ref": "#/components/schemas/Actors_ActorType" + } + ] } }, "type": "object" }, - "OperationType": { - "description": "", - "enum": [ - "Add", - "Remove", - "Replace", - "Move", - "Copy", - "Test", - "Invalid" - ], - "type": "string", - "x-enumNames": [ - "Add", - "Remove", - "Replace", - "Move", - "Copy", - "Test", - "Invalid" - ] - }, - "OrderSetOfTOrderDefinitionAndTTarget": {}, - "PaginatedListOfSearchDialogDto": { + "V1ServiceOwnerDialogsCommandsUpdate_Activity": { "additionalProperties": false, "properties": { - "continuationToken": { - "description": "The continuation token to be used to fetch the next page of items", - "example": "createdat_2024-07-31T09:09:03.0257090Z,id_0c089101-b7cf-a476-955c-f00a78d74a4e", + "createdAt": { + "description": "If supplied, overrides the creating date and time for the transmission.\nIf not supplied, the current date /time will be used.", + "format": "date-time", "nullable": true, "type": "string" }, - "hasNextPage": { - "description": "Whether there are more items available that can be fetched by supplying the continuation token", - "type": "boolean" - }, - "items": { - "description": "The paginated list of items", + "description": { + "description": "Unstructured text describing the activity. Only set if the activity type is \u0022Information\u0022.", "items": { - "$ref": "#/components/schemas/SearchDialogDto" + "$ref": "#/components/schemas/V1CommonLocalizations_Localization" }, "type": "array" }, - "orderBy": { - "description": "The current sorting order of the items", - "example": "createdat_desc,id_desc", - "type": "string" - } - }, - "type": "object" - }, - "PaginatedListOfSearchDialogDtoSO": { - "additionalProperties": false, - "properties": { - "continuationToken": { - "description": "The continuation token to be used to fetch the next page of items", - "example": "createdat_2024-07-31T09:09:03.0257090Z,id_0c089101-b7cf-a476-955c-f00a78d74a4e", + "extendedType": { + "description": "Arbitrary URI/URN describing a service-specific transmission type.", + "format": "uri", "nullable": true, "type": "string" }, - "hasNextPage": { - "description": "Whether there are more items available that can be fetched by supplying the continuation token", - "type": "boolean" - }, - "items": { - "description": "The paginated list of items", - "items": { - "$ref": "#/components/schemas/SearchDialogDtoSO" - }, - "type": "array" - }, - "orderBy": { - "description": "The current sorting order of the items", - "example": "createdat_desc,id_desc", - "type": "string" - } - }, - "type": "object" - }, - "ProblemDetails": { - "additionalProperties": false, - "properties": { - "detail": { + "id": { + "description": "The UUDIv7 of the action may be provided to support idempotent additions to the list of activities.\nIf not supplied, a new UUIDv7 will be generated.", + "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", + "format": "guid", "nullable": true, "type": "string" }, - "errors": { - "items": { - "$ref": "#/components/schemas/ProblemDetails_Error" - }, - "type": "array" + "performedBy": { + "description": "The actor that performed the activity.", + "oneOf": [ + { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsUpdate_ActivityPerformedByActor" + } + ] }, - "instance": { - "default": "/api/route", + "transmissionId": { + "description": "If the activity is related to a particular transmission, this field will contain the transmission identifier.\nMust be present in the request body.", + "format": "guid", + "nullable": true, "type": "string" }, - "status": { - "default": 400, - "format": "int32", - "type": "integer" - }, - "title": { - "default": "One or more validation errors occurred.", + "type": { + "description": "The type of transmission.", + "oneOf": [ + { + "$ref": "#/components/schemas/DialogsEntitiesActivities_DialogActivityType" + } + ] + } + }, + "type": "object" + }, + "V1ServiceOwnerDialogsCommandsUpdate_ActivityPerformedByActor": { + "additionalProperties": false, + "properties": { + "actorId": { + "description": "The identifier of the person or organization that performed the activity. Mutually exclusive with ActorName.\nMight be omitted if ActorType is \u0022ServiceOwner\u0022.", + "example": "urn:altinn:person:identifier-no:12018212345", + "nullable": true, "type": "string" }, - "traceId": { - "default": "0HMPNHL0JHL76:00000001", + "actorName": { + "description": "Specifies the name of the entity that performed the activity. Mutually exclusive with ActorId. If ActorId\nis supplied, the name will be automatically populated from the name registries.", + "example": "Ola Nordmann", + "nullable": true, "type": "string" }, - "type": { - "default": "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1", - "type": "string" + "actorType": { + "description": "What type of actor performed the activity.", + "oneOf": [ + { + "$ref": "#/components/schemas/Actors_ActorType" + } + ] } }, "type": "object" }, - "ProblemDetails_Error": { + "V1ServiceOwnerDialogsCommandsUpdate_ApiAction": { "additionalProperties": false, "properties": { - "code": { - "nullable": true, + "action": { + "description": "String identifier for the action, corresponding to the \u0022action\u0022 attributeId used in the XACML service policy,\nwhich by default is the policy belonging to the service referred to by \u0022serviceResource\u0022 in the dialog.", + "example": "write", "type": "string" }, - "name": { - "default": "Error or field name", + "authorizationAttribute": { + "description": "Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service\npolicy, which by default is the policy belonging to the service referred to by \u0022serviceResource\u0022 in the dialog.\n \nCan also be used to refer to other service policies.", + "example": "mycustomresource\n/* equivalent to the above */\nurn:altinn:subresource:mycustomresource\nurn:altinn:task:Task_1\n/* refer to another service */\nurn:altinn:resource:some-other-service-identifier", + "nullable": true, "type": "string" }, - "reason": { - "default": "Error reason", - "type": "string" + "endpoints": { + "description": "The endpoints associated with the action.", + "items": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsUpdate_ApiActionEndpoint" + }, + "type": "array" }, - "severity": { + "id": { + "description": "A UUIDv7 used for merging existing data, unknown IDs will be ignored as this entity does not support user-defined IDs.", + "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", + "format": "guid", "nullable": true, "type": "string" } }, "type": "object" }, - "SearchDialogActivityDto": { + "V1ServiceOwnerDialogsCommandsUpdate_ApiActionEndpoint": { "additionalProperties": false, "properties": { - "createdAt": { - "format": "date-time", - "type": "string" + "deprecated": { + "description": "Boolean indicating if the endpoint is deprecated.", + "type": "boolean" }, - "extendedType": { + "documentationUrl": { + "description": "Link to documentation for the endpoint, providing documentation for integrators. Should be a URL to a\nhuman-readable page.", "format": "uri", "nullable": true, "type": "string" }, + "httpMethod": { + "description": "The HTTP method that the endpoint expects for this action.", + "oneOf": [ + { + "$ref": "#/components/schemas/Http_HttpVerb" + } + ] + }, "id": { + "description": "A UUIDv7 used for merging existing data, unknown IDs will be ignored as this entity does not support user-defined IDs.", + "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", "format": "guid", + "nullable": true, "type": "string" }, - "seenByEndUserIdHash": { + "requestSchema": { + "description": "Link to the request schema for the endpoint. Used to provide documentation for integrators.\nDialogporten will not validate information on this endpoint.", + "format": "uri", "nullable": true, "type": "string" }, - "transmissionId": { - "format": "guid", + "responseSchema": { + "description": "Link to the response schema for the endpoint. Used to provide documentation for integrators.\nDialogporten will not validate information on this endpoint.", + "format": "uri", "nullable": true, "type": "string" }, - "type": { - "$ref": "#/components/schemas/DialogActivityType_Values" + "sunsetAt": { + "description": "Date and time when the endpoint will no longer function. Only set if the endpoint is deprecated. Dialogporten\nwill not enforce this date.", + "format": "date-time", + "nullable": true, + "type": "string" + }, + "url": { + "description": "The fully qualified URL of the API endpoint.", + "format": "uri", + "type": "string" + }, + "version": { + "description": "Arbitrary string indicating the version of the endpoint.", + "nullable": true, + "type": "string" } }, "type": "object" }, - "SearchDialogActivityDtoSO": { + "V1ServiceOwnerDialogsCommandsUpdate_Attachment": { "additionalProperties": false, "properties": { - "createdAt": { - "format": "date-time", - "type": "string" + "displayName": { + "description": "The display name of the attachment that should be used in GUIs.", + "items": { + "$ref": "#/components/schemas/V1CommonLocalizations_Localization" + }, + "type": "array" }, - "deletedAt": { - "format": "date-time", + "id": { + "description": "A UUIDv7 used for merging existing data, unknown IDs will be ignored as this entity does not support user-defined IDs.", + "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", + "format": "guid", "nullable": true, "type": "string" }, - "extendedType": { - "format": "uri", - "nullable": true, - "type": "string" + "urls": { + "description": "The URLs associated with the attachment, each referring to a different representation of the attachment.", + "items": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsUpdate_AttachmentUrl" + }, + "type": "array" + } + }, + "type": "object" + }, + "V1ServiceOwnerDialogsCommandsUpdate_AttachmentUrl": { + "additionalProperties": false, + "properties": { + "consumerType": { + "description": "The type of consumer the URL is intended for.", + "oneOf": [ + { + "$ref": "#/components/schemas/Attachments_AttachmentUrlConsumerType" + } + ] }, "id": { + "description": "A UUIDv7 used for merging existing data, unknown IDs will be ignored as this entity does not support user-defined IDs.", + "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", "format": "guid", + "nullable": true, "type": "string" }, - "transmissionId": { - "format": "guid", + "mediaType": { + "description": "The media type of the attachment.", + "example": "application/pdf\napplication/zip", "nullable": true, "type": "string" }, - "type": { - "$ref": "#/components/schemas/DialogActivityType_Values" + "url": { + "description": "The fully qualified URL of the attachment.", + "format": "uri", + "type": "string" } }, "type": "object" }, - "SearchDialogContentDto": { + "V1ServiceOwnerDialogsCommandsUpdate_Content": { "additionalProperties": false, "properties": { + "additionalInfo": { + "description": "Additional information about the dialog, this may contain Markdown.", + "nullable": true, + "oneOf": [ + { + "$ref": "#/components/schemas/V1CommonContent_ContentValue" + } + ] + }, "extendedStatus": { - "description": "Used as the human-readable label used to describe the \u0022ExtendedStatus\u0022 field.", + "description": "Used as the human-readable label used to describe the \u0022ExtendedStatus\u0022 field. Must be text/plain.", + "nullable": true, + "oneOf": [ + { + "$ref": "#/components/schemas/V1CommonContent_ContentValue" + } + ] + }, + "mainContentReference": { + "description": "Front-channel embedded content. Used to dynamically embed content in the frontend from an external URL. Must be HTTPS.", "nullable": true, "oneOf": [ { - "$ref": "#/components/schemas/ContentValueDto" + "$ref": "#/components/schemas/V1CommonContent_ContentValue" } ] }, "senderName": { - "description": "Overridden sender name. If not supplied, assume \u0022org\u0022 as the sender name.", + "description": "Overridden sender name. If not supplied, assume \u0022org\u0022 as the sender name. Must be text/plain if supplied.", "nullable": true, "oneOf": [ { - "$ref": "#/components/schemas/ContentValueDto" + "$ref": "#/components/schemas/V1CommonContent_ContentValue" } ] }, "summary": { - "description": "A short summary of the dialog and its current state.", + "description": "A short summary of the dialog and its current state. Must be text/plain.", "oneOf": [ { - "$ref": "#/components/schemas/ContentValueDto" + "$ref": "#/components/schemas/V1CommonContent_ContentValue" } ] }, "title": { - "description": "The title of the dialog.", + "description": "The title of the dialog. Must be text/plain.", + "oneOf": [ + { + "$ref": "#/components/schemas/V1CommonContent_ContentValue" + } + ] + } + }, + "type": "object" + }, + "V1ServiceOwnerDialogsCommandsUpdate_Dialog": { + "additionalProperties": false, + "properties": { + "activities": { + "description": "An immutable list of activities associated with the dialog. When updating via PUT, any activities added here\nwill be appended to the existing list of activities.", + "items": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsUpdate_Activity" + }, + "type": "array" + }, + "apiActions": { + "description": "The API actions associated with the dialog. Should be used in specialized, non-browser-based integrations.", + "items": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsUpdate_ApiAction" + }, + "type": "array" + }, + "attachments": { + "description": "The attachments associated with the dialog (on an aggregate level).", + "items": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsUpdate_Attachment" + }, + "type": "array" + }, + "content": { + "description": "The dialog unstructured text content.", + "oneOf": [ + { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsUpdate_Content" + } + ] + }, + "dueAt": { + "description": "The due date for the dialog. Dialogs past due date might be marked as such in frontends but will still be available.", + "example": "2022-12-31T23:59:59Z", + "format": "date-time", + "nullable": true, + "type": "string" + }, + "expiresAt": { + "description": "The expiration date for the dialog. This is the last date when the dialog is available for the end user.\n \nAfter this date is passed, the dialog will be considered expired and no longer available for the end user in any\nAPI. If not supplied, the dialog will be considered to never expire. This field can be changed after creation.", + "example": "2022-12-31T23:59:59Z", + "format": "date-time", + "nullable": true, + "type": "string" + }, + "extendedStatus": { + "description": "Arbitrary string with a service-specific indicator of status, typically used to indicate a fine-grained state of\nthe dialog to further specify the \u0022status\u0022 enum.", + "nullable": true, + "type": "string" + }, + "externalReference": { + "description": "Arbitrary string with a service-specific reference to an external system or service.", + "nullable": true, + "type": "string" + }, + "guiActions": { + "description": "The GUI actions associated with the dialog. Should be used in browser-based interactive frontends.", + "items": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsUpdate_GuiAction" + }, + "type": "array" + }, + "progress": { + "description": "Advisory indicator of progress, represented as 1-100 percentage value. 100% representing a dialog that has come\nto a natural completion (successful or not).", + "format": "int32", + "nullable": true, + "type": "integer" + }, + "searchTags": { + "description": "A list of words (tags) that will be used in dialog search queries. Not visible in end-user DTO.", + "items": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsUpdate_SearchTag" + }, + "type": "array" + }, + "status": { + "description": "The aggregated status of the dialog.", "oneOf": [ { - "$ref": "#/components/schemas/ContentValueDto" + "$ref": "#/components/schemas/DialogsEntities_DialogStatus" } ] + }, + "transmissions": { + "description": "The immutable list of transmissions associated with the dialog. When updating via PUT, any transmissions\nadded here will be appended to the existing list of transmissions.", + "items": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsUpdate_Transmission" + }, + "type": "array" + }, + "visibleFrom": { + "description": "The timestamp when the dialog should be made visible for authorized end users. If not provided, the dialog will be\nimmediately available.", + "example": "2022-12-31T23:59:59Z", + "format": "date-time", + "nullable": true, + "type": "string" } }, "type": "object" }, - "SearchDialogContentDtoSO": { + "V1ServiceOwnerDialogsCommandsUpdate_GuiAction": { "additionalProperties": false, "properties": { - "extendedStatus": { - "description": "Used as the human-readable label used to describe the \u0022ExtendedStatus\u0022 field.", + "action": { + "description": "The action identifier for the action, corresponding to the \u0022action\u0022 attributeId used in the XACML service policy.", + "type": "string" + }, + "authorizationAttribute": { + "description": "Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service\npolicy, which by default is the policy belonging to the service referred to by \u0022serviceResource\u0022 in the dialog.\n \nCan also be used to refer to other service policies.", + "example": "mycustomresource\n/* equivalent to the above */\nurn:altinn:subresource:mycustomresource\nurn:altinn:task:Task_1\n/* refer to another service */\nurn:altinn:resource:some-other-service-identifier", "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/ContentValueDto" - } - ] + "type": "string" }, - "senderName": { - "description": "Overridden sender name. If not supplied, assume \u0022org\u0022 as the sender name.", + "httpMethod": { + "description": "The HTTP method that the frontend should use when redirecting the user.", "nullable": true, "oneOf": [ { - "$ref": "#/components/schemas/ContentValueDto" + "$ref": "#/components/schemas/Http_HttpVerb" } ] }, - "summary": { - "description": "A short summary of the dialog and its current state.", + "id": { + "description": "A UUIDv7 used for merging existing data, unknown IDs will be ignored as this entity does not support user-defined IDs.", + "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", + "format": "guid", + "nullable": true, + "type": "string" + }, + "isDeleteDialogAction": { + "description": "Indicates whether the action results in the dialog being deleted. Used by frontends to implement custom UX\nfor delete actions.", + "type": "boolean" + }, + "priority": { + "description": "Indicates a priority for the action, making it possible for frontends to adapt GUI elements based on action\npriority.", "oneOf": [ { - "$ref": "#/components/schemas/ContentValueDto" + "$ref": "#/components/schemas/DialogsEntitiesActions_DialogGuiActionPriority" } ] }, + "prompt": { + "description": "If there should be a prompt asking the user for confirmation before the action is executed,\nthis field should contain the prompt text.", + "items": { + "$ref": "#/components/schemas/V1CommonLocalizations_Localization" + }, + "nullable": true, + "type": "array" + }, "title": { - "description": "The title of the dialog.", - "oneOf": [ - { - "$ref": "#/components/schemas/ContentValueDto" - } - ] + "description": "The title of the action, this should be short and in verb form. Must be text/plain.", + "items": { + "$ref": "#/components/schemas/V1CommonLocalizations_Localization" + }, + "type": "array" + }, + "url": { + "description": "The fully qualified URL of the action, to which the user will be redirected when the action is triggered. Will be set to\n\u0022urn:dialogporten:unauthorized\u0022 if the user is not authorized to perform the action.", + "example": "urn:dialogporten:unauthorized\nhttps://someendpoint.com/gui/some-service-instance-id", + "format": "uri", + "type": "string" } }, "type": "object" }, - "SearchDialogDialogActivityDto": { + "V1ServiceOwnerDialogsCommandsUpdate_SearchTag": { "additionalProperties": false, "properties": { - "createdAt": { - "description": "The date and time when the activity was created.", - "format": "date-time", - "nullable": true, + "value": { + "description": "A search tag value.", "type": "string" - }, - "description": { - "description": "Unstructured text describing the activity. Only set if the activity type is \u0022Information\u0022.", + } + }, + "type": "object" + }, + "V1ServiceOwnerDialogsCommandsUpdate_Transmission": { + "additionalProperties": false, + "properties": { + "attachments": { + "description": "The transmission-level attachments.", "items": { - "$ref": "#/components/schemas/LocalizationDto" + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsUpdate_TransmissionAttachment" }, "type": "array" }, + "authorizationAttribute": { + "description": "Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service\npolicy, which by default is the policy belonging to the service referred to by \u0022serviceResource\u0022 in the dialog.\n \nCan also be used to refer to other service policies.", + "example": "mycustomresource\n/* equivalent to the above */\nurn:altinn:subresource:mycustomresource\nurn:altinn:task:Task_1\n/* refer to another service */\nurn:altinn:resource:some-other-service-identifier", + "nullable": true, + "type": "string" + }, + "content": { + "description": "The transmission unstructured text content.", + "oneOf": [ + { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsUpdate_TransmissionContent" + } + ] + }, + "createdAt": { + "description": "If supplied, overrides the creating date and time for the transmission.\nIf not supplied, the current date /time will be used.", + "format": "date-time", + "type": "string" + }, "extendedType": { - "description": "An arbitrary string with a service-specific activity type.\n \nConsult the service-specific documentation provided by the service owner for details (if in use).", + "description": "Arbitrary URI/URN describing a service-specific transmission type.\n \nRefer to the service-specific documentation provided by the service owner for details (if in use).", "format": "uri", "nullable": true, "type": "string" }, "id": { - "description": "The unique identifier for the activity in UUIDv7 format.", + "description": "The UUDIv7 of the action may be provided to support idempotent additions to the list of transmissions.\nIf not supplied, a new UUIDv7 will be generated.", + "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", "format": "guid", + "nullable": true, "type": "string" }, - "performedBy": { - "description": "The actor that performed the activity.", + "relatedTransmissionId": { + "description": "Reference to any other transmission that this transmission is related to.", + "format": "guid", + "nullable": true, + "type": "string" + }, + "sender": { + "description": "The actor that sent the transmission.", "oneOf": [ { - "$ref": "#/components/schemas/SearchDialogDialogActivityPerformedByActorDto" + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsUpdate_TransmissionSenderActor" } ] }, - "transmissionId": { - "description": "If the activity is related to a particular transmission, this field will contain the transmission identifier.", - "format": "guid", - "nullable": true, - "type": "string" - }, "type": { - "description": "The type of activity.", + "description": "The type of transmission.", "oneOf": [ { - "$ref": "#/components/schemas/DialogActivityType_Values" + "$ref": "#/components/schemas/DialogsEntitiesTransmissions_DialogTransmissionType" } ] } }, "type": "object" }, - "SearchDialogDialogActivityDtoSO": { + "V1ServiceOwnerDialogsCommandsUpdate_TransmissionAttachment": { "additionalProperties": false, "properties": { - "createdAt": { - "description": "The date and time when the activity was created.", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "description": { - "description": "Unstructured text describing the activity. Only set if the activity type is \u0022Information\u0022.", + "displayName": { + "description": "The display name of the attachment that should be used in GUIs.", "items": { - "$ref": "#/components/schemas/LocalizationDto" + "$ref": "#/components/schemas/V1CommonLocalizations_Localization" }, "type": "array" }, - "extendedType": { - "description": "An arbitrary string with a service-specific activity type.\n \nConsult the service-specific documentation provided by the service owner for details (if in use).", - "format": "uri", - "nullable": true, - "type": "string" - }, "id": { - "description": "The unique identifier for the activity in UUIDv7 format.", + "description": "A self-defined UUIDv7 may be provided to support idempotent creation of transmission attachments. If not provided, a new UUIDv7 will be generated.", + "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", "format": "guid", + "nullable": true, "type": "string" }, - "performedBy": { - "description": "The actor that performed the activity.", + "urls": { + "description": "The URLs associated with the attachment, each referring to a different representation of the attachment.", + "items": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsUpdate_TransmissionAttachmentUrl" + }, + "type": "array" + } + }, + "type": "object" + }, + "V1ServiceOwnerDialogsCommandsUpdate_TransmissionAttachmentUrl": { + "additionalProperties": false, + "properties": { + "consumerType": { + "description": "The type of consumer the URL is intended for.", "oneOf": [ { - "$ref": "#/components/schemas/SearchDialogDialogActivityPerformedByActorDtoSO" + "$ref": "#/components/schemas/Attachments_AttachmentUrlConsumerType" } ] }, - "transmissionId": { - "description": "If the activity is related to a particular transmission, this field will contain the transmission identifier.", - "format": "guid", + "mediaType": { + "description": "The media type of the attachment.", + "example": "application/pdf\napplication/zip", "nullable": true, "type": "string" }, - "type": { - "description": "The type of activity.", - "oneOf": [ - { - "$ref": "#/components/schemas/DialogActivityType_Values" - } - ] + "url": { + "description": "The fully qualified URL of the attachment.", + "format": "uri", + "type": "string" } }, "type": "object" }, - "SearchDialogDialogActivityPerformedByActorDto": { + "V1ServiceOwnerDialogsCommandsUpdate_TransmissionContent": { "additionalProperties": false, "properties": { - "actorId": { - "description": "The identifier of the person or organization that performed the activity.\nMay be omitted if ActorType is \u0022ServiceOwner\u0022.", + "contentReference": { + "description": "Front-channel embedded content. Used to dynamically embed content in the frontend from an external URL. Must be HTTPS.\nAllowed media types: application/vnd.dialogporten.frontchannelembed\u002Bjson;type=markdown", "nullable": true, - "type": "string" + "oneOf": [ + { + "$ref": "#/components/schemas/V1CommonContent_ContentValue" + } + ] }, - "actorName": { - "description": "The name of the person or organization that performed the activity.\nOnly set if the actor type is \u0022PartyRepresentative\u0022.", - "nullable": true, - "type": "string" + "summary": { + "description": "The transmission summary.", + "oneOf": [ + { + "$ref": "#/components/schemas/V1CommonContent_ContentValue" + } + ] }, - "actorType": { - "description": "What type of actor performed the activity.", + "title": { + "description": "The transmission title. Must be text/plain.", "oneOf": [ { - "$ref": "#/components/schemas/ActorType_Values" + "$ref": "#/components/schemas/V1CommonContent_ContentValue" } ] } }, "type": "object" }, - "SearchDialogDialogActivityPerformedByActorDtoSO": { + "V1ServiceOwnerDialogsCommandsUpdate_TransmissionSenderActor": { "additionalProperties": false, "properties": { "actorId": { - "description": "The identifier of the person or organization that performed the activity.\nMay be omitted if ActorType is \u0022ServiceOwner\u0022.", + "description": "The identifier of the person or organization that sent the transmission. Mutually exclusive with ActorName.\nMight be omitted if ActorType is \u0022ServiceOwner\u0022.", + "example": "urn:altinn:person:identifier-no:12018212345", "nullable": true, "type": "string" }, "actorName": { - "description": "The name of the person or organization that performed the activity.\nOnly set if the actor type is \u0022PartyRepresentative\u0022.", + "description": "Specifies the name of the entity that sent the transmission. Mutually exclusive with ActorId. If ActorId\nis supplied, the name will be automatically populated from the name registries.", + "example": "Ola Nordmann", "nullable": true, "type": "string" }, "actorType": { - "description": "What type of actor performed the activity.", + "description": "The type of actor that sent the transmission.", "oneOf": [ { - "$ref": "#/components/schemas/ActorType_Values" + "$ref": "#/components/schemas/Actors_ActorType" } ] } }, "type": "object" }, - "SearchDialogDialogSeenLogDto": { + "V1ServiceOwnerDialogSeenLogsQueriesGet_SeenLog": { "additionalProperties": false, "properties": { "id": { - "description": "The unique identifier for the seen log entry in UUIDv7 format.", "format": "guid", "type": "string" }, - "isCurrentEndUser": { - "description": "Flag indicating whether the seen log entry was created by the current end user.", - "type": "boolean" - }, "isViaServiceOwner": { - "description": "Flag indicating whether the seen log entry was created via the service owner.\n \nThis is used when the service owner uses the service owner API to implement its own frontend.", "nullable": true, "type": "boolean" }, "seenAt": { - "description": "The timestamp when the dialog revision was seen.", "format": "date-time", "type": "string" }, "seenBy": { - "description": "The actor that saw the dialog revision.", - "oneOf": [ - { - "$ref": "#/components/schemas/SearchDialogDialogSeenLogSeenByActorDto" - } - ] + "$ref": "#/components/schemas/V1ServiceOwnerDialogSeenLogsQueriesGet_SeenLogSeenByActor" } }, "type": "object" }, - "SearchDialogDialogSeenLogDtoSO": { + "V1ServiceOwnerDialogSeenLogsQueriesGet_SeenLogSeenByActor": { "additionalProperties": false, "properties": { - "id": { - "description": "The unique identifier for the seen log entry in UUIDv7 format.", - "format": "guid", + "actorId": { "type": "string" }, - "isCurrentEndUser": { - "description": "Flag indicating whether the seen log entry was created by the end user supplied in the query.", - "type": "boolean" - }, - "isViaServiceOwner": { - "description": "Flag indicating whether the seen log entry was created via the service owner.\n \nThis is used when the service owner uses the service owner API to implement its own frontend.", - "nullable": true, - "type": "boolean" - }, - "seenAt": { - "description": "The timestamp when the dialog revision was seen.", - "format": "date-time", + "actorName": { "type": "string" }, - "seenBy": { - "description": "The actor that saw the dialog revision.", - "oneOf": [ - { - "$ref": "#/components/schemas/SearchDialogDialogSeenLogSeenByActorDtoSO" - } - ] + "id": { + "format": "guid", + "type": "string" } }, "type": "object" }, - "SearchDialogDialogSeenLogSeenByActorDto": { + "V1ServiceOwnerDialogSeenLogsQueriesSearch_SeenByActor": { "additionalProperties": false, "properties": { "actorId": { - "description": "The identifier of the person/business that saw the dialog revision.", - "example": "urn:altinn:person:identifier-no:01125512345\nurn:altinn:organization:identifier-no:912345678", "type": "string" }, "actorName": { - "description": "The natural name of the person/business that saw the dialog revision.", + "type": "string" + }, + "id": { + "format": "guid", "type": "string" } }, "type": "object" }, - "SearchDialogDialogSeenLogSeenByActorDtoSO": { + "V1ServiceOwnerDialogSeenLogsQueriesSearch_SeenLog": { "additionalProperties": false, "properties": { - "actorId": { - "description": "The identifier of the person/business that saw the dialog revision.", - "example": "urn:altinn:person:identifier-no:01125512345\nurn:altinn:organization:identifier-no:912345678", + "id": { + "format": "guid", "type": "string" }, - "actorName": { - "description": "The natural name of the person/business that saw the dialog revision.", + "isViaServiceOwner": { + "nullable": true, + "type": "boolean" + }, + "seenAt": { + "format": "date-time", "type": "string" + }, + "seenBy": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogSeenLogsQueriesSearch_SeenByActor" } }, "type": "object" }, - "SearchDialogDto": { + "V1ServiceOwnerDialogsQueriesGet_Content": { "additionalProperties": false, "properties": { - "content": { - "description": "The content of the dialog in search results.", + "additionalInfo": { + "description": "Additional information about the dialog, this may contain Markdown.", + "nullable": true, "oneOf": [ { - "$ref": "#/components/schemas/SearchDialogContentDto" + "$ref": "#/components/schemas/V1CommonContent_ContentValue" } ] }, - "createdAt": { - "description": "The date and time when the dialog was created.", - "example": "2022-12-31T23:59:59Z", - "format": "date-time", - "type": "string" - }, - "dueAt": { - "description": "The due date for the dialog. This is the last date when the dialog is expected to be completed.", - "example": "2022-12-31T23:59:59Z", - "format": "date-time", - "nullable": true, - "type": "string" - }, "extendedStatus": { - "description": "Arbitrary string with a service-specific indicator of status, typically used to indicate a fine-grained state of\nthe dialog to further specify the \u0022status\u0022 enum.\n \nRefer to the service-specific documentation provided by the service owner for details on the possible values (if\nin use).", - "nullable": true, - "type": "string" - }, - "guiAttachmentCount": { - "description": "The number of attachments in the dialog made available for browser-based frontends.", - "format": "int32", - "nullable": true, - "type": "integer" - }, - "id": { - "description": "The unique identifier for the dialog in UUIDv7 format.", - "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", - "format": "guid", - "type": "string" - }, - "latestActivity": { - "description": "The latest entry in the dialog\u0027s activity log.", + "description": "Used as the human-readable label used to describe the \u0022ExtendedStatus\u0022 field.", "nullable": true, "oneOf": [ { - "$ref": "#/components/schemas/SearchDialogDialogActivityDto" + "$ref": "#/components/schemas/V1CommonContent_ContentValue" } ] }, - "org": { - "description": "The service owner code representing the organization (service owner) related to this dialog.", - "example": "ske", - "type": "string" - }, - "party": { - "description": "The party code representing the organization or person that the dialog belongs to in URN format.", - "example": "urn:altinn:person:identifier-no:01125512345\nurn:altinn:organization:identifier-no:912345678", - "type": "string" - }, - "precedingProcess": { - "description": "Optional preceding process identifier to indicate the business process that preceded the process indicated in the \u0022Process\u0022 field. Cannot be set without also \u0022Process\u0022 being set.", - "nullable": true, - "type": "string" - }, - "process": { - "description": "Optional process identifier used to indicate a business process this dialog belongs to.", + "mainContentReference": { + "description": "Front-channel embedded content. Used to dynamically embed content in the frontend from an external URL. Must be HTTPS.\nAllowed media types: application/vnd.dialogporten.frontchannelembed\u002Bjson;type=markdown", "nullable": true, - "type": "string" + "oneOf": [ + { + "$ref": "#/components/schemas/V1CommonContent_ContentValue" + } + ] }, - "progress": { - "description": "Advisory indicator of progress, represented as 1-100 percentage value. 100% representing a dialog that has come\nto a natural completion (successful or not).", - "format": "int32", + "senderName": { + "description": "Overridden sender name. If not supplied, assume \u0022org\u0022 as the sender name.", "nullable": true, - "type": "integer" - }, - "seenSinceLastUpdate": { - "description": "The list of seen log entries for the dialog newer than the dialog ChangedAt date.", - "items": { - "$ref": "#/components/schemas/SearchDialogDialogSeenLogDto" - }, - "type": "array" - }, - "serviceResource": { - "description": "The service identifier for the service that the dialog is related to in URN-format.\nThis corresponds to a service resource in the Altinn Resource Registry.", - "example": "urn:altinn:resource:some-service-identifier", - "type": "string" - }, - "serviceResourceType": { - "description": "The ServiceResource type, as defined in Altinn Resource Registry (see ResourceType).", - "type": "string" - }, - "status": { - "description": "The aggregated status of the dialog.", "oneOf": [ { - "$ref": "#/components/schemas/DialogStatus_Values" + "$ref": "#/components/schemas/V1CommonContent_ContentValue" } ] }, - "systemLabel": { - "description": "Current display state.", + "summary": { + "description": "A short summary of the dialog and its current state.", "oneOf": [ { - "$ref": "#/components/schemas/SystemLabel_Values" + "$ref": "#/components/schemas/V1CommonContent_ContentValue" } ] }, - "updatedAt": { - "description": "The date and time when the dialog was last updated.", - "example": "2022-12-31T23:59:59Z", - "format": "date-time", - "type": "string" + "title": { + "description": "The title of the dialog.", + "oneOf": [ + { + "$ref": "#/components/schemas/V1CommonContent_ContentValue" + } + ] } }, "type": "object" }, - "SearchDialogDtoSO": { + "V1ServiceOwnerDialogsQueriesGet_Dialog": { "additionalProperties": false, "properties": { + "activities": { + "description": "An immutable list of activities associated with the dialog.", + "items": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsQueriesGet_DialogActivity" + }, + "type": "array" + }, + "apiActions": { + "description": "The API actions associated with the dialog. Should be used in specialized, non-browser-based integrations.", + "items": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsQueriesGet_DialogApiAction" + }, + "type": "array" + }, + "attachments": { + "description": "The attachments associated with the dialog (on an aggregate level).", + "items": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsQueriesGet_DialogAttachment" + }, + "type": "array" + }, "content": { - "description": "The content of the dialog in search results.", + "description": "The dialog unstructured text content.", "oneOf": [ { - "$ref": "#/components/schemas/SearchDialogContentDtoSO" + "$ref": "#/components/schemas/V1ServiceOwnerDialogsQueriesGet_Content" } ] }, @@ -3813,8 +3622,21 @@ "format": "date-time", "type": "string" }, + "deletedAt": { + "description": "If deleted, the date and time when the deletion was performed.", + "format": "date-time", + "nullable": true, + "type": "string" + }, "dueAt": { - "description": "The due date for the dialog. This is the last date when the dialog is expected to be completed.", + "description": "The due date for the dialog. Dialogs past due date might be marked as such in frontends but will still be available.", + "example": "2022-12-31T23:59:59Z", + "format": "date-time", + "nullable": true, + "type": "string" + }, + "expiresAt": { + "description": "The expiration date for the dialog. This is the last date when the dialog is available for the end user.\n \nAfter this date is passed, the dialog will be considered expired and no longer available for the end user in any\nAPI. If not supplied, the dialog will be considered to never expire. This field can be changed by the service\nowner after the dialog has been created.", "example": "2022-12-31T23:59:59Z", "format": "date-time", "nullable": true, @@ -3825,11 +3647,17 @@ "nullable": true, "type": "string" }, - "guiAttachmentCount": { - "description": "The number of attachments in the dialog made available for browser-based frontends.", - "format": "int32", + "externalReference": { + "description": "Arbitrary string with a service-specific reference to an external system or service.\n \nRefer to the service-specific documentation provided by the service owner for details (if in use).", "nullable": true, - "type": "integer" + "type": "string" + }, + "guiActions": { + "description": "The GUI actions associated with the dialog. Should be used in browser-based interactive frontends.", + "items": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsQueriesGet_DialogGuiAction" + }, + "type": "array" }, "id": { "description": "The unique identifier for the dialog in UUIDv7 format.", @@ -3837,15 +3665,6 @@ "format": "guid", "type": "string" }, - "latestActivity": { - "description": "The latest entry in the dialog\u0027s activity log.", - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/SearchDialogDialogActivityDtoSO" - } - ] - }, "org": { "description": "The service owner code representing the organization (service owner) related to this dialog.", "example": "ske", @@ -3878,10 +3697,18 @@ "format": "guid", "type": "string" }, + "searchTags": { + "description": "The list of words (tags) that will be used in dialog search queries. Not visible in end-user DTO.", + "items": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsQueriesGet_SearchTag" + }, + "nullable": true, + "type": "array" + }, "seenSinceLastUpdate": { "description": "The list of seen log entries for the dialog newer than the dialog ChangedAt date.", "items": { - "$ref": "#/components/schemas/SearchDialogDialogSeenLogDtoSO" + "$ref": "#/components/schemas/V1ServiceOwnerDialogsQueriesGet_DialogSeenLog" }, "type": "array" }, @@ -3898,7 +3725,7 @@ "description": "The aggregated status of the dialog.", "oneOf": [ { - "$ref": "#/components/schemas/DialogStatus_Values" + "$ref": "#/components/schemas/DialogsEntities_DialogStatus" } ] }, @@ -3906,10 +3733,17 @@ "description": "Current display state.", "oneOf": [ { - "$ref": "#/components/schemas/SystemLabel_Values" + "$ref": "#/components/schemas/DialogEndUserContextsEntities_SystemLabel" } ] }, + "transmissions": { + "description": "The immutable list of transmissions associated with the dialog.", + "items": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsQueriesGet_DialogTransmission" + }, + "type": "array" + }, "updatedAt": { "description": "The date and time when the dialog was last updated.", "example": "2022-12-31T23:59:59Z", @@ -3918,6 +3752,7 @@ }, "visibleFrom": { "description": "The timestamp when the dialog will be made visible for authorized end users.", + "example": "2022-12-31T23:59:59Z", "format": "date-time", "nullable": true, "type": "string" @@ -3925,96 +3760,180 @@ }, "type": "object" }, - "SearchDialogLabelAssignmentLogDto": { + "V1ServiceOwnerDialogsQueriesGet_DialogActivity": { "additionalProperties": false, "properties": { - "action": { - "type": "string" - }, "createdAt": { + "description": "The date and time when the activity was created.", "format": "date-time", + "nullable": true, "type": "string" }, - "name": { + "description": { + "description": "Unstructured text describing the activity. Only set if the activity type is \u0022Information\u0022.", + "items": { + "$ref": "#/components/schemas/V1CommonLocalizations_Localization" + }, + "type": "array" + }, + "extendedType": { + "description": "An arbitrary URI/URN with a service-specific activity type.\n \nConsult the service-specific documentation provided by the service owner for details (if in use).", + "format": "uri", + "nullable": true, + "type": "string" + }, + "id": { + "description": "The unique identifier for the activity in UUIDv7 format.", + "format": "guid", "type": "string" }, "performedBy": { - "$ref": "#/components/schemas/LabelAssignmentLogActorDto" + "description": "The actor that performed the activity.", + "oneOf": [ + { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsQueriesGet_DialogActivityPerformedByActor" + } + ] + }, + "transmissionId": { + "description": "If the activity is related to a particular transmission, this field will contain the transmission identifier.", + "format": "guid", + "nullable": true, + "type": "string" + }, + "type": { + "description": "The type of activity.", + "oneOf": [ + { + "$ref": "#/components/schemas/DialogsEntitiesActivities_DialogActivityType" + } + ] } }, "type": "object" }, - "SearchDialogSeenLogDto": { + "V1ServiceOwnerDialogsQueriesGet_DialogActivityPerformedByActor": { "additionalProperties": false, "properties": { - "id": { - "format": "guid", + "actorId": { + "description": "The identifier of the person or organization that performed the activity.\nMay be omitted if ActorType is \u0022ServiceOwner\u0022.", + "nullable": true, "type": "string" }, - "isCurrentEndUser": { - "type": "boolean" + "actorName": { + "description": "The name of the person or organization that performed the activity.\nOnly set if the actor type is \u0022PartyRepresentative\u0022.", + "nullable": true, + "type": "string" }, - "isViaServiceOwner": { - "type": "boolean" + "actorType": { + "description": "What type of actor performed the activity.", + "oneOf": [ + { + "$ref": "#/components/schemas/Actors_ActorType" + } + ] + } + }, + "type": "object" + }, + "V1ServiceOwnerDialogsQueriesGet_DialogApiAction": { + "additionalProperties": false, + "properties": { + "action": { + "description": "String identifier for the action, corresponding to the \u0022action\u0022 attributeId used in the XACML service policy,\nwhich by default is the policy belonging to the service referred to by \u0022serviceResource\u0022 in the dialog.", + "example": "write", + "type": "string" }, - "seenAt": { - "format": "date-time", + "authorizationAttribute": { + "description": "Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service\npolicy, which by default is the policy belonging to the service referred to by \u0022serviceResource\u0022 in the dialog.\n \nCan also be used to refer to other service policies.", + "example": "mycustomresource\n/* equivalent to the above */\nurn:altinn:subresource:mycustomresource\nurn:altinn:task:Task_1\n/* refer to another service */\nurn:altinn:resource:some-other-service-identifier", + "nullable": true, + "type": "string" + }, + "endpoints": { + "description": "The endpoints associated with the action.", + "items": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsQueriesGet_DialogApiActionEndpoint" + }, + "type": "array" + }, + "id": { + "description": "The unique identifier for the action in UUIDv7 format.", + "format": "guid", "type": "string" }, - "seenBy": { - "$ref": "#/components/schemas/SearchDialogSeenLogSeenByActorDto" + "isAuthorized": { + "description": "True if the authenticated user (set in the query) is authorized for this action.", + "nullable": true, + "type": "boolean" } }, "type": "object" }, - "SearchDialogSeenLogSeenByActorDto": { + "V1ServiceOwnerDialogsQueriesGet_DialogApiActionEndpoint": { "additionalProperties": false, "properties": { - "actorId": { - "type": "string" + "deprecated": { + "description": "Boolean indicating if the endpoint is deprecated. Integrators should migrate to endpoints with a higher version.", + "type": "boolean" }, - "actorName": { + "documentationUrl": { + "description": "Link to service provider documentation for the endpoint. Used for service owners to provide documentation for\nintegrators. Should be a URL to a human-readable page.", + "format": "uri", + "nullable": true, "type": "string" }, + "httpMethod": { + "description": "The HTTP method that the endpoint expects for this action.", + "oneOf": [ + { + "$ref": "#/components/schemas/Http_HttpVerb" + } + ] + }, "id": { + "description": "The unique identifier for the endpoint in UUIDv7 format.", "format": "guid", "type": "string" - } - }, - "type": "object" - }, - "SearchDialogTransmissionAttachmentDto": { - "additionalProperties": false, - "properties": { - "displayName": { - "description": "The display name of the attachment that should be used in GUIs.", - "items": { - "$ref": "#/components/schemas/LocalizationDto" - }, - "type": "array" }, - "id": { - "description": "The unique identifier for the attachment in UUIDv7 format.", - "format": "guid", + "requestSchema": { + "description": "Link to the request schema for the endpoint. Used by service owners to provide documentation for integrators.\nDialogporten will not validate information on this endpoint.", + "format": "uri", + "nullable": true, "type": "string" }, - "urls": { - "description": "The URLs associated with the attachment, each referring to a different representation of the attachment.", - "items": { - "$ref": "#/components/schemas/SearchDialogTransmissionAttachmentUrlDto" - }, - "type": "array" + "responseSchema": { + "description": "Link to the response schema for the endpoint. Used for service owners to provide documentation for integrators.\nDialogporten will not validate information on this endpoint.", + "format": "uri", + "nullable": true, + "type": "string" + }, + "sunsetAt": { + "description": "Date and time when the service owner has indicated that endpoint will no longer function. Only set if the endpoint\nis deprecated. Dialogporten will not enforce this date.", + "format": "date-time", + "nullable": true, + "type": "string" + }, + "url": { + "description": "The fully qualified URL of the API endpoint.", + "format": "uri", + "type": "string" + }, + "version": { + "description": "Arbitrary string indicating the version of the endpoint.\n \nConsult the service-specific documentation provided by the service owner for details (if in use).", + "nullable": true, + "type": "string" } }, "type": "object" }, - "SearchDialogTransmissionAttachmentDtoSO": { + "V1ServiceOwnerDialogsQueriesGet_DialogAttachment": { "additionalProperties": false, "properties": { "displayName": { "description": "The display name of the attachment that should be used in GUIs.", "items": { - "$ref": "#/components/schemas/LocalizationDto" + "$ref": "#/components/schemas/V1CommonLocalizations_Localization" }, "type": "array" }, @@ -4026,21 +3945,21 @@ "urls": { "description": "The URLs associated with the attachment, each referring to a different representation of the attachment.", "items": { - "$ref": "#/components/schemas/SearchDialogTransmissionAttachmentUrlDtoSO" + "$ref": "#/components/schemas/V1ServiceOwnerDialogsQueriesGet_DialogAttachmentUrl" }, "type": "array" } }, "type": "object" }, - "SearchDialogTransmissionAttachmentUrlDto": { + "V1ServiceOwnerDialogsQueriesGet_DialogAttachmentUrl": { "additionalProperties": false, "properties": { "consumerType": { - "description": "The type of consumer the URL is intended for.", + "description": "What type of consumer the URL is intended for.", "oneOf": [ { - "$ref": "#/components/schemas/AttachmentUrlConsumerType_Values" + "$ref": "#/components/schemas/Attachments_AttachmentUrlConsumerType" } ] }, @@ -4056,201 +3975,149 @@ "type": "string" }, "url": { - "description": "The fully qualified URL of the attachment. Will be set to \u0022urn:dialogporten:unauthorized\u0022 if the user is\nnot authorized to access the transmission.", - "example": "https://someendpoint.com/someattachment.pdf\nurn:dialogporten:unauthorized", + "description": "The fully qualified URL of the attachment.", + "example": "https://someendpoint.com/someattachment.pdf", "format": "uri", "type": "string" } }, "type": "object" }, - "SearchDialogTransmissionAttachmentUrlDtoSO": { + "V1ServiceOwnerDialogsQueriesGet_DialogGuiAction": { "additionalProperties": false, "properties": { - "consumerType": { - "description": "The type of consumer the URL is intended for.", + "action": { + "description": "The action identifier for the action, corresponding to the \u0022action\u0022 attributeId used in the XACML service policy.", + "type": "string" + }, + "authorizationAttribute": { + "description": "Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service\npolicy, which by default is the policy belonging to the service referred to by \u0022serviceResource\u0022 in the dialog.\n \nCan also be used to refer to other service policies.", + "example": "mycustomresource\n/* equivalent to the above */\nurn:altinn:subresource:mycustomresource\nurn:altinn:task:Task_1\n/* refer to another service */\nurn:altinn:resource:some-other-service-identifier", + "nullable": true, + "type": "string" + }, + "httpMethod": { + "description": "The HTTP method that the frontend should use when redirecting the user.", "oneOf": [ { - "$ref": "#/components/schemas/AttachmentUrlConsumerType_Values" + "$ref": "#/components/schemas/Http_HttpVerb" } ] }, "id": { - "description": "The unique identifier for the attachment URL in UUIDv7 format.", + "description": "The unique identifier for the action in UUIDv7 format.", "format": "guid", "type": "string" }, - "mediaType": { - "description": "The media type of the attachment.", - "example": "application/pdf\napplication/zip", + "isAuthorized": { + "description": "Whether the user, if supplied in the query, is authorized to perform the action.", "nullable": true, - "type": "string" + "type": "boolean" }, - "url": { - "description": "The fully qualified URL of the attachment. Will be set to \u0022urn:dialogporten:unauthorized\u0022 if the user is\nnot authorized to access the transmission.", - "example": "https://someendpoint.com/someattachment.pdf\nurn:dialogporten:unauthorized", - "format": "uri", - "type": "string" - } - }, - "type": "object" - }, - "SearchDialogTransmissionContentDto": { - "additionalProperties": false, - "properties": { - "contentReference": { - "description": "Front-channel embedded content. Used to dynamically embed content in the frontend from an external URL.\nAllowed media types: application/vnd.dialogporten.frontchannelembed\u002Bjson;type=markdown", - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/ContentValueDto" - } - ] + "isDeleteDialogAction": { + "description": "Indicates whether the action results in the dialog being deleted. Used by frontends to implement custom UX\nfor delete actions.", + "type": "boolean" }, - "summary": { - "description": "The summary of the content.", + "priority": { + "description": "Indicates a priority for the action, making it possible for frontends to adapt GUI elements based on action\npriority.", "oneOf": [ { - "$ref": "#/components/schemas/ContentValueDto" + "$ref": "#/components/schemas/DialogsEntitiesActions_DialogGuiActionPriority" } ] }, - "title": { - "description": "The title of the content.", - "oneOf": [ - { - "$ref": "#/components/schemas/ContentValueDto" - } - ] - } - }, - "type": "object" - }, - "SearchDialogTransmissionContentDtoSO": { - "additionalProperties": false, - "properties": { - "contentReference": { - "description": "Front-channel embedded content. Used to dynamically embed content in the frontend from an external URL.", + "prompt": { + "description": "If there should be a prompt asking the user for confirmation before the action is executed,\nthis field should contain the prompt text.", + "items": { + "$ref": "#/components/schemas/V1CommonLocalizations_Localization" + }, "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/ContentValueDto" - } - ] - }, - "summary": { - "description": "The summary of the content.", - "oneOf": [ - { - "$ref": "#/components/schemas/ContentValueDto" - } - ] + "type": "array" }, "title": { - "description": "The title of the content.", - "oneOf": [ - { - "$ref": "#/components/schemas/ContentValueDto" - } - ] - } - }, - "type": "object" - }, - "SearchDialogTransmissionDto": { - "additionalProperties": false, - "properties": { - "attachments": { - "description": "The attachments associated with the transmission.", + "description": "The title of the action, this should be short and in verb form.", "items": { - "$ref": "#/components/schemas/SearchDialogTransmissionAttachmentDto" + "$ref": "#/components/schemas/V1CommonLocalizations_Localization" }, "type": "array" }, - "authorizationAttribute": { - "description": "The authorization attribute associated with the transmission.", - "nullable": true, - "type": "string" - }, - "content": { - "description": "The content of the transmission.", - "oneOf": [ - { - "$ref": "#/components/schemas/SearchDialogTransmissionContentDto" - } - ] - }, - "createdAt": { - "description": "The date and time when the transmission was created.", - "format": "date-time", - "type": "string" - }, - "deletedAt": { - "description": "The date and time when the transmission was deleted, if applicable.", - "format": "date-time", - "nullable": true, - "type": "string" - }, - "extendedType": { - "description": "The extended type URI for the transmission.", + "url": { + "description": "The fully qualified URL of the action, to which the user will be redirected when the action is triggered.", "format": "uri", - "nullable": true, "type": "string" - }, + } + }, + "type": "object" + }, + "V1ServiceOwnerDialogsQueriesGet_DialogSeenLog": { + "additionalProperties": false, + "properties": { "id": { - "description": "The unique identifier for the transmission in UUIDv7 format.", + "description": "The unique identifier for the seen log entry in UUIDv7 format.", "format": "guid", "type": "string" }, - "isAuthorized": { - "description": "Flag indicating if the authenticated user is authorized for this transmission. If not, embedded content and\nthe attachments will not be available.", + "isCurrentEndUser": { + "description": "Flag indicating whether the seen log entry was created by the current end user, if provided in the query.", "type": "boolean" }, - "relatedTransmissionId": { - "description": "The unique identifier for the related transmission, if any.", - "format": "guid", + "isViaServiceOwner": { + "description": "Flag indicating whether the seen log entry was created via the service owner.\n \nThis is used when the service owner uses the service owner API to implement its own frontend.", "nullable": true, + "type": "boolean" + }, + "seenAt": { + "description": "The timestamp when the dialog revision was seen.", + "format": "date-time", "type": "string" }, - "sender": { - "description": "The sender actor information for the transmission.", + "seenBy": { + "description": "The actor that saw the dialog revision.", "oneOf": [ { - "$ref": "#/components/schemas/SearchDialogTransmissionSenderActorDto" + "$ref": "#/components/schemas/V1ServiceOwnerDialogsQueriesGet_DialogSeenLogSeenByActor" } ] + } + }, + "type": "object" + }, + "V1ServiceOwnerDialogsQueriesGet_DialogSeenLogSeenByActor": { + "additionalProperties": false, + "properties": { + "actorId": { + "description": "The identifier of the person/business that saw the dialog revision.", + "example": "urn:altinn:person:identifier-no:01125512345\nurn:altinn:organization:identifier-no:912345678", + "type": "string" }, - "type": { - "description": "The type of the transmission.", - "oneOf": [ - { - "$ref": "#/components/schemas/DialogTransmissionType_Values" - } - ] + "actorName": { + "description": "The natural name of the person/business that saw the dialog revision.", + "type": "string" } }, "type": "object" }, - "SearchDialogTransmissionDtoSO": { + "V1ServiceOwnerDialogsQueriesGet_DialogTransmission": { "additionalProperties": false, "properties": { "attachments": { - "description": "The attachments associated with the transmission.", + "description": "The transmission-level attachments.", "items": { - "$ref": "#/components/schemas/SearchDialogTransmissionAttachmentDtoSO" + "$ref": "#/components/schemas/V1ServiceOwnerDialogsQueriesGet_DialogTransmissionAttachment" }, "type": "array" }, "authorizationAttribute": { - "description": "The authorization attribute associated with the transmission.", + "description": "Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service\npolicy, which by default is the policy belonging to the service referred to by \u0022serviceResource\u0022 in the dialog.\n \nCan also be used to refer to other service policies.", + "example": "mycustomresource\n/* equivalent to the above */\nurn:altinn:subresource:mycustomresource\nurn:altinn:task:Task_1\n/* refer to another service */\nurn:altinn:resource:some-other-service-identifier", "nullable": true, "type": "string" }, "content": { - "description": "The content of the transmission.", + "description": "The transmission unstructured text content.", "oneOf": [ { - "$ref": "#/components/schemas/SearchDialogTransmissionContentDtoSO" + "$ref": "#/components/schemas/V1ServiceOwnerDialogsQueriesGet_DialogTransmissionContent" } ] }, @@ -4259,14 +4126,8 @@ "format": "date-time", "type": "string" }, - "deletedAt": { - "description": "The date and time when the transmission was deleted, if applicable.", - "format": "date-time", - "nullable": true, - "type": "string" - }, "extendedType": { - "description": "The extended type URI for the transmission.", + "description": "Arbitrary URI/URN describing a service-specific transmission type.\n \nRefer to the service-specific documentation provided by the service owner for details (if in use).", "format": "uri", "nullable": true, "type": "string" @@ -4276,213 +4137,326 @@ "format": "guid", "type": "string" }, + "isAuthorized": { + "description": "Flag indicating if the authenticated user supplied in the query is authorized for this transmission.", + "nullable": true, + "type": "boolean" + }, "relatedTransmissionId": { - "description": "The unique identifier for the related transmission, if any.", + "description": "Reference to any other transmission that this transmission is related to.", "format": "guid", "nullable": true, "type": "string" }, "sender": { - "description": "The sender actor information for the transmission.", + "description": "The actor that sent the transmission.", "oneOf": [ { - "$ref": "#/components/schemas/SearchDialogTransmissionSenderActorDtoSO" + "$ref": "#/components/schemas/V1ServiceOwnerDialogsQueriesGet_DialogTransmissionSenderActor" } ] }, "type": { - "description": "The type of the transmission.", + "description": "The type of transmission.", "oneOf": [ { - "$ref": "#/components/schemas/DialogTransmissionType_Values" + "$ref": "#/components/schemas/DialogsEntitiesTransmissions_DialogTransmissionType" } ] } }, "type": "object" }, - "SearchDialogTransmissionSenderActorDto": { + "V1ServiceOwnerDialogsQueriesGet_DialogTransmissionAttachment": { "additionalProperties": false, "properties": { - "actorId": { - "description": "The identifier of the actor.", - "type": "string" - }, - "actorName": { - "description": "The name of the actor.", - "type": "string" - }, - "actorType": { - "description": "The type of the actor.", - "oneOf": [ - { - "$ref": "#/components/schemas/ActorType_Values" - } - ] + "displayName": { + "description": "The display name of the attachment that should be used in GUIs.", + "items": { + "$ref": "#/components/schemas/V1CommonLocalizations_Localization" + }, + "type": "array" }, "id": { - "description": "The unique identifier for the sender actor in UUIDv7 format.", + "description": "The unique identifier for the attachment in UUIDv7 format.", "format": "guid", "type": "string" + }, + "urls": { + "description": "The URLs associated with the attachment, each referring to a different representation of the attachment.", + "items": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsQueriesGet_DialogTransmissionAttachmentUrl" + }, + "type": "array" } }, "type": "object" }, - "SearchDialogTransmissionSenderActorDtoSO": { + "V1ServiceOwnerDialogsQueriesGet_DialogTransmissionAttachmentUrl": { "additionalProperties": false, "properties": { - "actorId": { - "description": "The identifier of the actor.", - "type": "string" - }, - "actorName": { - "description": "The name of the actor.", - "type": "string" - }, - "actorType": { - "description": "The type of the actor.", + "consumerType": { + "description": "The type of consumer the URL is intended for.", "oneOf": [ { - "$ref": "#/components/schemas/ActorType_Values" + "$ref": "#/components/schemas/Attachments_AttachmentUrlConsumerType" } ] }, - "id": { - "description": "The unique identifier for the sender actor in UUIDv7 format.", - "format": "guid", + "mediaType": { + "description": "The media type of the attachment.", + "example": "application/pdf\napplication/zip", + "nullable": true, + "type": "string" + }, + "url": { + "description": "The fully qualified URL of the attachment. Will be set to \u0022urn:dialogporten:unauthorized\u0022 if the user is\nnot authorized to access the transmission.", + "example": "https://someendpoint.com/someattachment.pdf\nurn:dialogporten:unauthorized", + "format": "uri", "type": "string" } }, "type": "object" }, - "SearchSeenLogDto": { + "V1ServiceOwnerDialogsQueriesGet_DialogTransmissionContent": { "additionalProperties": false, "properties": { - "id": { - "format": "guid", - "type": "string" - }, - "isViaServiceOwner": { + "contentReference": { + "description": "Front-channel embedded content. Used to dynamically embed content in the frontend from an external URL. Must be HTTPS.\nAllowed media types: application/vnd.dialogporten.frontchannelembed\u002Bjson;type=markdown", "nullable": true, - "type": "boolean" + "oneOf": [ + { + "$ref": "#/components/schemas/V1CommonContent_ContentValue" + } + ] }, - "seenAt": { - "format": "date-time", - "type": "string" + "summary": { + "description": "The transmission summary.", + "oneOf": [ + { + "$ref": "#/components/schemas/V1CommonContent_ContentValue" + } + ] }, - "seenBy": { - "$ref": "#/components/schemas/SearchSeenLogSeenByActorDto" + "title": { + "description": "The transmission title.", + "oneOf": [ + { + "$ref": "#/components/schemas/V1CommonContent_ContentValue" + } + ] } }, "type": "object" }, - "SearchSeenLogSeenByActorDto": { + "V1ServiceOwnerDialogsQueriesGet_DialogTransmissionSenderActor": { "additionalProperties": false, "properties": { "actorId": { + "description": "The identifier of the person or organization that sent the transmission.", + "example": "urn:altinn:person:identifier-no:12018212345", "type": "string" }, "actorName": { + "description": "The name of the person or organization that sent the transmission.", + "example": "Ola Nordmann", "type": "string" }, - "id": { - "format": "guid", - "type": "string" + "actorType": { + "description": "The type of actor that sent the transmission.", + "oneOf": [ + { + "$ref": "#/components/schemas/Actors_ActorType" + } + ] } }, "type": "object" }, - "SetDialogSystemLabelCommand": { + "V1ServiceOwnerDialogsQueriesGet_SearchTag": { "additionalProperties": false, "properties": { - "ifMatchDialogRevision": { - "format": "guid", - "nullable": true, + "value": { + "description": "A search tag value.", "type": "string" - }, - "label": { - "$ref": "#/components/schemas/SystemLabel_Values" } }, "type": "object" }, - "SystemLabel_Values": { - "description": "", - "enum": [ - "Default", - "Bin", - "Archive" - ], - "type": "string", - "x-enumNames": [ - "Default", - "Bin", - "Archive" - ] - }, - "UpdateDialogContentDto": { + "V1ServiceOwnerDialogsQueriesSearch_Content": { "additionalProperties": false, "properties": { - "additionalInfo": { - "description": "Additional information about the dialog, this may contain Markdown.", + "extendedStatus": { + "description": "Used as the human-readable label used to describe the \u0022ExtendedStatus\u0022 field.", "nullable": true, "oneOf": [ { - "$ref": "#/components/schemas/ContentValueDto" + "$ref": "#/components/schemas/V1CommonContent_ContentValue" } ] }, - "extendedStatus": { - "description": "Used as the human-readable label used to describe the \u0022ExtendedStatus\u0022 field. Must be text/plain.", + "senderName": { + "description": "Overridden sender name. If not supplied, assume \u0022org\u0022 as the sender name.", "nullable": true, "oneOf": [ { - "$ref": "#/components/schemas/ContentValueDto" + "$ref": "#/components/schemas/V1CommonContent_ContentValue" } ] }, - "mainContentReference": { - "description": "Front-channel embedded content. Used to dynamically embed content in the frontend from an external URL. Must be HTTPS.", - "nullable": true, + "summary": { + "description": "A short summary of the dialog and its current state.", "oneOf": [ { - "$ref": "#/components/schemas/ContentValueDto" + "$ref": "#/components/schemas/V1CommonContent_ContentValue" } ] }, - "senderName": { - "description": "Overridden sender name. If not supplied, assume \u0022org\u0022 as the sender name. Must be text/plain if supplied.", + "title": { + "description": "The title of the dialog.", + "oneOf": [ + { + "$ref": "#/components/schemas/V1CommonContent_ContentValue" + } + ] + } + }, + "type": "object" + }, + "V1ServiceOwnerDialogsQueriesSearch_Dialog": { + "additionalProperties": false, + "properties": { + "content": { + "description": "The content of the dialog in search results.", + "oneOf": [ + { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsQueriesSearch_Content" + } + ] + }, + "createdAt": { + "description": "The date and time when the dialog was created.", + "example": "2022-12-31T23:59:59Z", + "format": "date-time", + "type": "string" + }, + "dueAt": { + "description": "The due date for the dialog. This is the last date when the dialog is expected to be completed.", + "example": "2022-12-31T23:59:59Z", + "format": "date-time", + "nullable": true, + "type": "string" + }, + "extendedStatus": { + "description": "Arbitrary string with a service-specific indicator of status, typically used to indicate a fine-grained state of\nthe dialog to further specify the \u0022status\u0022 enum.\n \nRefer to the service-specific documentation provided by the service owner for details on the possible values (if\nin use).", + "nullable": true, + "type": "string" + }, + "guiAttachmentCount": { + "description": "The number of attachments in the dialog made available for browser-based frontends.", + "format": "int32", + "nullable": true, + "type": "integer" + }, + "id": { + "description": "The unique identifier for the dialog in UUIDv7 format.", + "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", + "format": "guid", + "type": "string" + }, + "latestActivity": { + "description": "The latest entry in the dialog\u0027s activity log.", "nullable": true, "oneOf": [ { - "$ref": "#/components/schemas/ContentValueDto" + "$ref": "#/components/schemas/V1ServiceOwnerDialogsQueriesSearch_DialogActivity" } ] }, - "summary": { - "description": "A short summary of the dialog and its current state. Must be text/plain.", + "org": { + "description": "The service owner code representing the organization (service owner) related to this dialog.", + "example": "ske", + "type": "string" + }, + "party": { + "description": "The party code representing the organization or person that the dialog belongs to in URN format.", + "example": "urn:altinn:person:identifier-no:01125512345\nurn:altinn:organization:identifier-no:912345678", + "type": "string" + }, + "precedingProcess": { + "description": "Optional preceding process identifier to indicate the business process that preceded the process indicated in the \u0022Process\u0022 field. Cannot be set without also \u0022Process\u0022 being set.", + "nullable": true, + "type": "string" + }, + "process": { + "description": "Optional process identifier used to indicate a business process this dialog belongs to.", + "nullable": true, + "type": "string" + }, + "progress": { + "description": "Advisory indicator of progress, represented as 1-100 percentage value. 100% representing a dialog that has come\nto a natural completion (successful or not).", + "format": "int32", + "nullable": true, + "type": "integer" + }, + "revision": { + "description": "The unique identifier for the revision in UUIDv4 format.", + "example": "a312cb9c-7632-43c2-aa38-69b06aed56ca", + "format": "guid", + "type": "string" + }, + "seenSinceLastUpdate": { + "description": "The list of seen log entries for the dialog newer than the dialog ChangedAt date.", + "items": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsQueriesSearch_DialogSeenLog" + }, + "type": "array" + }, + "serviceResource": { + "description": "The service identifier for the service that the dialog is related to in URN-format.\nThis corresponds to a service resource in the Altinn Resource Registry.", + "example": "urn:altinn:resource:some-service-identifier", + "type": "string" + }, + "serviceResourceType": { + "description": "The ServiceResource type, as defined in Altinn Resource Registry (see ResourceType).", + "type": "string" + }, + "status": { + "description": "The aggregated status of the dialog.", "oneOf": [ { - "$ref": "#/components/schemas/ContentValueDto" + "$ref": "#/components/schemas/DialogsEntities_DialogStatus" } ] }, - "title": { - "description": "The title of the dialog. Must be text/plain.", + "systemLabel": { + "description": "Current display state.", "oneOf": [ { - "$ref": "#/components/schemas/ContentValueDto" + "$ref": "#/components/schemas/DialogEndUserContextsEntities_SystemLabel" } ] + }, + "updatedAt": { + "description": "The date and time when the dialog was last updated.", + "example": "2022-12-31T23:59:59Z", + "format": "date-time", + "type": "string" + }, + "visibleFrom": { + "description": "The timestamp when the dialog will be made visible for authorized end users.", + "format": "date-time", + "nullable": true, + "type": "string" } }, "type": "object" }, - "UpdateDialogDialogActivityDto": { + "V1ServiceOwnerDialogsQueriesSearch_DialogActivity": { "additionalProperties": false, "properties": { "createdAt": { - "description": "If supplied, overrides the creating date and time for the transmission.\nIf not supplied, the current date /time will be used.", + "description": "The date and time when the activity was created.", "format": "date-time", "nullable": true, "type": "string" @@ -4490,60 +4464,56 @@ "description": { "description": "Unstructured text describing the activity. Only set if the activity type is \u0022Information\u0022.", "items": { - "$ref": "#/components/schemas/LocalizationDto" + "$ref": "#/components/schemas/V1CommonLocalizations_Localization" }, "type": "array" }, "extendedType": { - "description": "Arbitrary URI/URN describing a service-specific transmission type.", + "description": "An arbitrary string with a service-specific activity type.\n \nConsult the service-specific documentation provided by the service owner for details (if in use).", "format": "uri", "nullable": true, "type": "string" }, "id": { - "description": "The UUDIv7 of the action may be provided to support idempotent additions to the list of activities.\nIf not supplied, a new UUIDv7 will be generated.", - "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", + "description": "The unique identifier for the activity in UUIDv7 format.", "format": "guid", - "nullable": true, "type": "string" }, "performedBy": { "description": "The actor that performed the activity.", "oneOf": [ { - "$ref": "#/components/schemas/UpdateDialogDialogActivityPerformedByActorDto" + "$ref": "#/components/schemas/V1ServiceOwnerDialogsQueriesSearch_DialogActivityPerformedByActor" } ] }, "transmissionId": { - "description": "If the activity is related to a particular transmission, this field will contain the transmission identifier.\nMust be present in the request body.", + "description": "If the activity is related to a particular transmission, this field will contain the transmission identifier.", "format": "guid", "nullable": true, "type": "string" }, "type": { - "description": "The type of transmission.", + "description": "The type of activity.", "oneOf": [ { - "$ref": "#/components/schemas/DialogActivityType_Values" + "$ref": "#/components/schemas/DialogsEntitiesActivities_DialogActivityType" } ] } }, "type": "object" }, - "UpdateDialogDialogActivityPerformedByActorDto": { + "V1ServiceOwnerDialogsQueriesSearch_DialogActivityPerformedByActor": { "additionalProperties": false, "properties": { "actorId": { - "description": "The identifier of the person or organization that performed the activity. Mutually exclusive with ActorName.\nMight be omitted if ActorType is \u0022ServiceOwner\u0022.", - "example": "urn:altinn:person:identifier-no:12018212345", + "description": "The identifier of the person or organization that performed the activity.\nMay be omitted if ActorType is \u0022ServiceOwner\u0022.", "nullable": true, "type": "string" }, "actorName": { - "description": "Specifies the name of the entity that performed the activity. Mutually exclusive with ActorId. If ActorId\nis supplied, the name will be automatically populated from the name registries.", - "example": "Ola Nordmann", + "description": "The name of the person or organization that performed the activity.\nOnly set if the actor type is \u0022PartyRepresentative\u0022.", "nullable": true, "type": "string" }, @@ -4551,146 +4521,176 @@ "description": "What type of actor performed the activity.", "oneOf": [ { - "$ref": "#/components/schemas/ActorType_Values" + "$ref": "#/components/schemas/Actors_ActorType" } ] } }, "type": "object" }, - "UpdateDialogDialogApiActionDto": { + "V1ServiceOwnerDialogsQueriesSearch_DialogSeenLog": { "additionalProperties": false, "properties": { - "action": { - "description": "String identifier for the action, corresponding to the \u0022action\u0022 attributeId used in the XACML service policy,\nwhich by default is the policy belonging to the service referred to by \u0022serviceResource\u0022 in the dialog.", - "example": "write", + "id": { + "description": "The unique identifier for the seen log entry in UUIDv7 format.", + "format": "guid", "type": "string" }, - "authorizationAttribute": { - "description": "Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service\npolicy, which by default is the policy belonging to the service referred to by \u0022serviceResource\u0022 in the dialog.\n \nCan also be used to refer to other service policies.", - "example": "mycustomresource\n/* equivalent to the above */\nurn:altinn:subresource:mycustomresource\nurn:altinn:task:Task_1\n/* refer to another service */\nurn:altinn:resource:some-other-service-identifier", + "isCurrentEndUser": { + "description": "Flag indicating whether the seen log entry was created by the end user supplied in the query.", + "type": "boolean" + }, + "isViaServiceOwner": { + "description": "Flag indicating whether the seen log entry was created via the service owner.\n \nThis is used when the service owner uses the service owner API to implement its own frontend.", "nullable": true, + "type": "boolean" + }, + "seenAt": { + "description": "The timestamp when the dialog revision was seen.", + "format": "date-time", "type": "string" }, - "endpoints": { - "description": "The endpoints associated with the action.", - "items": { - "$ref": "#/components/schemas/UpdateDialogDialogApiActionEndpointDto" - }, - "type": "array" + "seenBy": { + "description": "The actor that saw the dialog revision.", + "oneOf": [ + { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsQueriesSearch_DialogSeenLogSeenByActor" + } + ] + } + }, + "type": "object" + }, + "V1ServiceOwnerDialogsQueriesSearch_DialogSeenLogSeenByActor": { + "additionalProperties": false, + "properties": { + "actorId": { + "description": "The identifier of the person/business that saw the dialog revision.", + "example": "urn:altinn:person:identifier-no:01125512345\nurn:altinn:organization:identifier-no:912345678", + "type": "string" }, - "id": { - "description": "A UUIDv7 used for merging existing data, unknown IDs will be ignored as this entity does not support user-defined IDs.", - "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", - "format": "guid", - "nullable": true, + "actorName": { + "description": "The natural name of the person/business that saw the dialog revision.", "type": "string" } }, "type": "object" }, - "UpdateDialogDialogApiActionEndpointDto": { + "V1ServiceOwnerDialogsUpdate_DialogRequest": { "additionalProperties": false, "properties": { - "deprecated": { - "description": "Boolean indicating if the endpoint is deprecated.", - "type": "boolean" + "dto": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsUpdate_Dialog" + } + }, + "type": "object" + }, + "V1ServiceOwnerDialogTransmissionsCreate_TransmissionRequest": { + "additionalProperties": false, + "properties": { + "attachments": { + "description": "The transmission-level attachments.", + "items": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsUpdate_TransmissionAttachment" + }, + "type": "array" }, - "documentationUrl": { - "description": "Link to documentation for the endpoint, providing documentation for integrators. Should be a URL to a\nhuman-readable page.", - "format": "uri", + "authorizationAttribute": { + "description": "Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service\npolicy, which by default is the policy belonging to the service referred to by \u0022serviceResource\u0022 in the dialog.\n \nCan also be used to refer to other service policies.", + "example": "mycustomresource\n/* equivalent to the above */\nurn:altinn:subresource:mycustomresource\nurn:altinn:task:Task_1\n/* refer to another service */\nurn:altinn:resource:some-other-service-identifier", "nullable": true, "type": "string" }, - "httpMethod": { - "description": "The HTTP method that the endpoint expects for this action.", + "content": { + "description": "The transmission unstructured text content.", "oneOf": [ { - "$ref": "#/components/schemas/HttpVerb_Values" + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsUpdate_TransmissionContent" } ] }, - "id": { - "description": "A UUIDv7 used for merging existing data, unknown IDs will be ignored as this entity does not support user-defined IDs.", - "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", - "format": "guid", - "nullable": true, + "createdAt": { + "description": "If supplied, overrides the creating date and time for the transmission.\nIf not supplied, the current date /time will be used.", + "format": "date-time", "type": "string" }, - "requestSchema": { - "description": "Link to the request schema for the endpoint. Used to provide documentation for integrators.\nDialogporten will not validate information on this endpoint.", + "extendedType": { + "description": "Arbitrary URI/URN describing a service-specific transmission type.\n \nRefer to the service-specific documentation provided by the service owner for details (if in use).", "format": "uri", "nullable": true, "type": "string" }, - "responseSchema": { - "description": "Link to the response schema for the endpoint. Used to provide documentation for integrators.\nDialogporten will not validate information on this endpoint.", - "format": "uri", + "id": { + "description": "The UUDIv7 of the action may be provided to support idempotent additions to the list of transmissions.\nIf not supplied, a new UUIDv7 will be generated.", + "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", + "format": "guid", "nullable": true, "type": "string" }, - "sunsetAt": { - "description": "Date and time when the endpoint will no longer function. Only set if the endpoint is deprecated. Dialogporten\nwill not enforce this date.", - "format": "date-time", + "relatedTransmissionId": { + "description": "Reference to any other transmission that this transmission is related to.", + "format": "guid", "nullable": true, "type": "string" }, - "url": { - "description": "The fully qualified URL of the API endpoint.", - "format": "uri", - "type": "string" + "sender": { + "description": "The actor that sent the transmission.", + "oneOf": [ + { + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsUpdate_TransmissionSenderActor" + } + ] }, - "version": { - "description": "Arbitrary string indicating the version of the endpoint.", - "nullable": true, - "type": "string" + "type": { + "description": "The type of transmission.", + "oneOf": [ + { + "$ref": "#/components/schemas/DialogsEntitiesTransmissions_DialogTransmissionType" + } + ] } }, "type": "object" }, - "UpdateDialogDialogAttachmentDto": { + "V1ServiceOwnerDialogTransmissionsQueriesGet_Attachment": { "additionalProperties": false, "properties": { "displayName": { "description": "The display name of the attachment that should be used in GUIs.", "items": { - "$ref": "#/components/schemas/LocalizationDto" + "$ref": "#/components/schemas/V1CommonLocalizations_Localization" }, "type": "array" }, "id": { - "description": "A UUIDv7 used for merging existing data, unknown IDs will be ignored as this entity does not support user-defined IDs.", - "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", + "description": "The unique identifier for the attachment in UUIDv7 format.", "format": "guid", - "nullable": true, "type": "string" }, "urls": { "description": "The URLs associated with the attachment, each referring to a different representation of the attachment.", "items": { - "$ref": "#/components/schemas/UpdateDialogDialogAttachmentUrlDto" + "$ref": "#/components/schemas/V1ServiceOwnerDialogTransmissionsQueriesGet_AttachmentUrl" }, "type": "array" } }, "type": "object" }, - "UpdateDialogDialogAttachmentUrlDto": { + "V1ServiceOwnerDialogTransmissionsQueriesGet_AttachmentUrl": { "additionalProperties": false, "properties": { "consumerType": { "description": "The type of consumer the URL is intended for.", "oneOf": [ { - "$ref": "#/components/schemas/AttachmentUrlConsumerType_Values" + "$ref": "#/components/schemas/Attachments_AttachmentUrlConsumerType" } ] }, "id": { - "description": "A UUIDv7 used for merging existing data, unknown IDs will be ignored as this entity does not support user-defined IDs.", - "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", + "description": "The unique identifier for the attachment URL in UUIDv7 format.", "format": "guid", - "nullable": true, "type": "string" }, "mediaType": { @@ -4700,369 +4700,369 @@ "type": "string" }, "url": { - "description": "The fully qualified URL of the attachment.", + "description": "The fully qualified URL of the attachment. Will be set to \u0022urn:dialogporten:unauthorized\u0022 if the user is\nnot authorized to access the transmission.", + "example": "https://someendpoint.com/someattachment.pdf\nurn:dialogporten:unauthorized", "format": "uri", "type": "string" } }, "type": "object" }, - "UpdateDialogDialogGuiActionDto": { + "V1ServiceOwnerDialogTransmissionsQueriesGet_Content": { "additionalProperties": false, "properties": { - "action": { - "description": "The action identifier for the action, corresponding to the \u0022action\u0022 attributeId used in the XACML service policy.", + "contentReference": { + "description": "Front-channel embedded content. Used to dynamically embed content in the frontend from an external URL.\nAllowed media types: application/vnd.dialogporten.frontchannelembed\u002Bjson;type=markdown", + "nullable": true, + "oneOf": [ + { + "$ref": "#/components/schemas/V1CommonContent_ContentValue" + } + ] + }, + "summary": { + "description": "The summary of the content.", + "oneOf": [ + { + "$ref": "#/components/schemas/V1CommonContent_ContentValue" + } + ] + }, + "title": { + "description": "The title of the content.", + "oneOf": [ + { + "$ref": "#/components/schemas/V1CommonContent_ContentValue" + } + ] + } + }, + "type": "object" + }, + "V1ServiceOwnerDialogTransmissionsQueriesGet_SenderActor": { + "additionalProperties": false, + "properties": { + "actorId": { + "description": "The identifier of the actor.", "type": "string" }, - "authorizationAttribute": { - "description": "Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service\npolicy, which by default is the policy belonging to the service referred to by \u0022serviceResource\u0022 in the dialog.\n \nCan also be used to refer to other service policies.", - "example": "mycustomresource\n/* equivalent to the above */\nurn:altinn:subresource:mycustomresource\nurn:altinn:task:Task_1\n/* refer to another service */\nurn:altinn:resource:some-other-service-identifier", - "nullable": true, + "actorName": { + "description": "The name of the actor.", "type": "string" }, - "httpMethod": { - "description": "The HTTP method that the frontend should use when redirecting the user.", - "nullable": true, + "actorType": { + "description": "The type of the actor.", "oneOf": [ { - "$ref": "#/components/schemas/HttpVerb_Values" + "$ref": "#/components/schemas/Actors_ActorType" } ] }, "id": { - "description": "A UUIDv7 used for merging existing data, unknown IDs will be ignored as this entity does not support user-defined IDs.", - "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", + "description": "The unique identifier for the sender actor in UUIDv7 format.", "format": "guid", - "nullable": true, "type": "string" + } + }, + "type": "object" + }, + "V1ServiceOwnerDialogTransmissionsQueriesGet_Transmission": { + "additionalProperties": false, + "properties": { + "attachments": { + "description": "The attachments associated with the transmission.", + "items": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogTransmissionsQueriesGet_Attachment" + }, + "type": "array" }, - "isDeleteDialogAction": { - "description": "Indicates whether the action results in the dialog being deleted. Used by frontends to implement custom UX\nfor delete actions.", - "type": "boolean" + "authorizationAttribute": { + "description": "The authorization attribute associated with the transmission.", + "nullable": true, + "type": "string" }, - "priority": { - "description": "Indicates a priority for the action, making it possible for frontends to adapt GUI elements based on action\npriority.", + "content": { + "description": "The content of the transmission.", "oneOf": [ { - "$ref": "#/components/schemas/DialogGuiActionPriority_Values" + "$ref": "#/components/schemas/V1ServiceOwnerDialogTransmissionsQueriesGet_Content" } ] }, - "prompt": { - "description": "If there should be a prompt asking the user for confirmation before the action is executed,\nthis field should contain the prompt text.", - "items": { - "$ref": "#/components/schemas/LocalizationDto" - }, - "nullable": true, - "type": "array" + "createdAt": { + "description": "The date and time when the transmission was created.", + "format": "date-time", + "type": "string" }, - "title": { - "description": "The title of the action, this should be short and in verb form. Must be text/plain.", - "items": { - "$ref": "#/components/schemas/LocalizationDto" - }, - "type": "array" + "deletedAt": { + "description": "The date and time when the transmission was deleted, if applicable.", + "format": "date-time", + "nullable": true, + "type": "string" }, - "url": { - "description": "The fully qualified URL of the action, to which the user will be redirected when the action is triggered. Will be set to\n\u0022urn:dialogporten:unauthorized\u0022 if the user is not authorized to perform the action.", - "example": "urn:dialogporten:unauthorized\nhttps://someendpoint.com/gui/some-service-instance-id", + "extendedType": { + "description": "The extended type URI for the transmission.", "format": "uri", + "nullable": true, "type": "string" - } - }, - "type": "object" - }, - "UpdateDialogDialogTransmissionContentDto": { - "additionalProperties": false, - "properties": { - "contentReference": { - "description": "Front-channel embedded content. Used to dynamically embed content in the frontend from an external URL. Must be HTTPS.\nAllowed media types: application/vnd.dialogporten.frontchannelembed\u002Bjson;type=markdown", + }, + "id": { + "description": "The unique identifier for the transmission in UUIDv7 format.", + "format": "guid", + "type": "string" + }, + "relatedTransmissionId": { + "description": "The unique identifier for the related transmission, if any.", + "format": "guid", "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/ContentValueDto" - } - ] + "type": "string" }, - "summary": { - "description": "The transmission summary.", + "sender": { + "description": "The sender actor information for the transmission.", "oneOf": [ { - "$ref": "#/components/schemas/ContentValueDto" + "$ref": "#/components/schemas/V1ServiceOwnerDialogTransmissionsQueriesGet_SenderActor" } ] }, - "title": { - "description": "The transmission title. Must be text/plain.", + "type": { + "description": "The type of the transmission.", "oneOf": [ { - "$ref": "#/components/schemas/ContentValueDto" + "$ref": "#/components/schemas/DialogsEntitiesTransmissions_DialogTransmissionType" } ] } }, "type": "object" }, - "UpdateDialogDialogTransmissionDto": { + "V1ServiceOwnerDialogTransmissionsQueriesSearch_Attachment": { "additionalProperties": false, "properties": { - "attachments": { - "description": "The transmission-level attachments.", + "displayName": { + "description": "The display name of the attachment that should be used in GUIs.", "items": { - "$ref": "#/components/schemas/UpdateDialogTransmissionAttachmentDto" + "$ref": "#/components/schemas/V1CommonLocalizations_Localization" }, "type": "array" }, - "authorizationAttribute": { - "description": "Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service\npolicy, which by default is the policy belonging to the service referred to by \u0022serviceResource\u0022 in the dialog.\n \nCan also be used to refer to other service policies.", - "example": "mycustomresource\n/* equivalent to the above */\nurn:altinn:subresource:mycustomresource\nurn:altinn:task:Task_1\n/* refer to another service */\nurn:altinn:resource:some-other-service-identifier", - "nullable": true, + "id": { + "description": "The unique identifier for the attachment in UUIDv7 format.", + "format": "guid", "type": "string" }, - "content": { - "description": "The transmission unstructured text content.", + "urls": { + "description": "The URLs associated with the attachment, each referring to a different representation of the attachment.", + "items": { + "$ref": "#/components/schemas/V1ServiceOwnerDialogTransmissionsQueriesSearch_AttachmentUrl" + }, + "type": "array" + } + }, + "type": "object" + }, + "V1ServiceOwnerDialogTransmissionsQueriesSearch_AttachmentUrl": { + "additionalProperties": false, + "properties": { + "consumerType": { + "description": "The type of consumer the URL is intended for.", "oneOf": [ { - "$ref": "#/components/schemas/UpdateDialogDialogTransmissionContentDto" + "$ref": "#/components/schemas/Attachments_AttachmentUrlConsumerType" } ] }, - "createdAt": { - "description": "If supplied, overrides the creating date and time for the transmission.\nIf not supplied, the current date /time will be used.", - "format": "date-time", + "id": { + "description": "The unique identifier for the attachment URL in UUIDv7 format.", + "format": "guid", "type": "string" }, - "extendedType": { - "description": "Arbitrary URI/URN describing a service-specific transmission type.\n \nRefer to the service-specific documentation provided by the service owner for details (if in use).", - "format": "uri", + "mediaType": { + "description": "The media type of the attachment.", + "example": "application/pdf\napplication/zip", "nullable": true, "type": "string" }, - "id": { - "description": "The UUDIv7 of the action may be provided to support idempotent additions to the list of transmissions.\nIf not supplied, a new UUIDv7 will be generated.", - "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", - "format": "guid", - "nullable": true, + "url": { + "description": "The fully qualified URL of the attachment. Will be set to \u0022urn:dialogporten:unauthorized\u0022 if the user is\nnot authorized to access the transmission.", + "example": "https://someendpoint.com/someattachment.pdf\nurn:dialogporten:unauthorized", + "format": "uri", "type": "string" - }, - "relatedTransmissionId": { - "description": "Reference to any other transmission that this transmission is related to.", - "format": "guid", + } + }, + "type": "object" + }, + "V1ServiceOwnerDialogTransmissionsQueriesSearch_Content": { + "additionalProperties": false, + "properties": { + "contentReference": { + "description": "Front-channel embedded content. Used to dynamically embed content in the frontend from an external URL.", "nullable": true, - "type": "string" + "oneOf": [ + { + "$ref": "#/components/schemas/V1CommonContent_ContentValue" + } + ] }, - "sender": { - "description": "The actor that sent the transmission.", + "summary": { + "description": "The summary of the content.", "oneOf": [ { - "$ref": "#/components/schemas/UpdateDialogDialogTransmissionSenderActorDto" + "$ref": "#/components/schemas/V1CommonContent_ContentValue" } ] }, - "type": { - "description": "The type of transmission.", + "title": { + "description": "The title of the content.", "oneOf": [ { - "$ref": "#/components/schemas/DialogTransmissionType_Values" + "$ref": "#/components/schemas/V1CommonContent_ContentValue" } ] } }, "type": "object" }, - "UpdateDialogDialogTransmissionSenderActorDto": { + "V1ServiceOwnerDialogTransmissionsQueriesSearch_SenderActor": { "additionalProperties": false, "properties": { "actorId": { - "description": "The identifier of the person or organization that sent the transmission. Mutually exclusive with ActorName.\nMight be omitted if ActorType is \u0022ServiceOwner\u0022.", - "example": "urn:altinn:person:identifier-no:12018212345", - "nullable": true, + "description": "The identifier of the actor.", "type": "string" }, "actorName": { - "description": "Specifies the name of the entity that sent the transmission. Mutually exclusive with ActorId. If ActorId\nis supplied, the name will be automatically populated from the name registries.", - "example": "Ola Nordmann", - "nullable": true, + "description": "The name of the actor.", "type": "string" }, "actorType": { - "description": "The type of actor that sent the transmission.", + "description": "The type of the actor.", "oneOf": [ { - "$ref": "#/components/schemas/ActorType_Values" + "$ref": "#/components/schemas/Actors_ActorType" } ] + }, + "id": { + "description": "The unique identifier for the sender actor in UUIDv7 format.", + "format": "guid", + "type": "string" } }, "type": "object" }, - "UpdateDialogDto": { + "V1ServiceOwnerDialogTransmissionsQueriesSearch_Transmission": { "additionalProperties": false, "properties": { - "activities": { - "description": "An immutable list of activities associated with the dialog. When updating via PUT, any activities added here\nwill be appended to the existing list of activities.", - "items": { - "$ref": "#/components/schemas/UpdateDialogDialogActivityDto" - }, - "type": "array" - }, - "apiActions": { - "description": "The API actions associated with the dialog. Should be used in specialized, non-browser-based integrations.", - "items": { - "$ref": "#/components/schemas/UpdateDialogDialogApiActionDto" - }, - "type": "array" - }, "attachments": { - "description": "The attachments associated with the dialog (on an aggregate level).", + "description": "The attachments associated with the transmission.", "items": { - "$ref": "#/components/schemas/UpdateDialogDialogAttachmentDto" + "$ref": "#/components/schemas/V1ServiceOwnerDialogTransmissionsQueriesSearch_Attachment" }, "type": "array" }, + "authorizationAttribute": { + "description": "The authorization attribute associated with the transmission.", + "nullable": true, + "type": "string" + }, "content": { - "description": "The dialog unstructured text content.", + "description": "The content of the transmission.", "oneOf": [ { - "$ref": "#/components/schemas/UpdateDialogContentDto" + "$ref": "#/components/schemas/V1ServiceOwnerDialogTransmissionsQueriesSearch_Content" } ] }, - "dueAt": { - "description": "The due date for the dialog. Dialogs past due date might be marked as such in frontends but will still be available.", - "example": "2022-12-31T23:59:59Z", + "createdAt": { + "description": "The date and time when the transmission was created.", "format": "date-time", - "nullable": true, "type": "string" }, - "expiresAt": { - "description": "The expiration date for the dialog. This is the last date when the dialog is available for the end user.\n \nAfter this date is passed, the dialog will be considered expired and no longer available for the end user in any\nAPI. If not supplied, the dialog will be considered to never expire. This field can be changed after creation.", - "example": "2022-12-31T23:59:59Z", + "deletedAt": { + "description": "The date and time when the transmission was deleted, if applicable.", "format": "date-time", "nullable": true, "type": "string" }, - "extendedStatus": { - "description": "Arbitrary string with a service-specific indicator of status, typically used to indicate a fine-grained state of\nthe dialog to further specify the \u0022status\u0022 enum.", + "extendedType": { + "description": "The extended type URI for the transmission.", + "format": "uri", "nullable": true, "type": "string" }, - "externalReference": { - "description": "Arbitrary string with a service-specific reference to an external system or service.", - "nullable": true, + "id": { + "description": "The unique identifier for the transmission in UUIDv7 format.", + "format": "guid", "type": "string" }, - "guiActions": { - "description": "The GUI actions associated with the dialog. Should be used in browser-based interactive frontends.", - "items": { - "$ref": "#/components/schemas/UpdateDialogDialogGuiActionDto" - }, - "type": "array" - }, - "progress": { - "description": "Advisory indicator of progress, represented as 1-100 percentage value. 100% representing a dialog that has come\nto a natural completion (successful or not).", - "format": "int32", + "relatedTransmissionId": { + "description": "The unique identifier for the related transmission, if any.", + "format": "guid", "nullable": true, - "type": "integer" - }, - "searchTags": { - "description": "A list of words (tags) that will be used in dialog search queries. Not visible in end-user DTO.", - "items": { - "$ref": "#/components/schemas/UpdateDialogSearchTagDto" - }, - "type": "array" + "type": "string" }, - "status": { - "description": "The aggregated status of the dialog.", + "sender": { + "description": "The sender actor information for the transmission.", "oneOf": [ { - "$ref": "#/components/schemas/DialogStatus_Values" + "$ref": "#/components/schemas/V1ServiceOwnerDialogTransmissionsQueriesSearch_SenderActor" } ] }, - "transmissions": { - "description": "The immutable list of transmissions associated with the dialog. When updating via PUT, any transmissions\nadded here will be appended to the existing list of transmissions.", - "items": { - "$ref": "#/components/schemas/UpdateDialogDialogTransmissionDto" - }, - "type": "array" - }, - "visibleFrom": { - "description": "The timestamp when the dialog should be made visible for authorized end users. If not provided, the dialog will be\nimmediately available.", - "example": "2022-12-31T23:59:59Z", - "format": "date-time", - "nullable": true, - "type": "string" + "type": { + "description": "The type of the transmission.", + "oneOf": [ + { + "$ref": "#/components/schemas/DialogsEntitiesTransmissions_DialogTransmissionType" + } + ] } }, "type": "object" }, - "UpdateDialogRequest": { + "V1WellKnownJwksQueriesGet_GetJwks": { "additionalProperties": false, "properties": { - "dto": { - "$ref": "#/components/schemas/UpdateDialogDto" + "keys": { + "items": { + "$ref": "#/components/schemas/V1WellKnownJwksQueriesGet_Jwk" + }, + "type": "array" } }, "type": "object" }, - "UpdateDialogSearchTagDto": { + "V1WellKnownJwksQueriesGet_Jwk": { "additionalProperties": false, "properties": { - "value": { - "description": "A search tag value.", + "alg": { "type": "string" - } - }, - "type": "object" - }, - "UpdateDialogTransmissionAttachmentDto": { - "additionalProperties": false, - "properties": { - "displayName": { - "description": "The display name of the attachment that should be used in GUIs.", - "items": { - "$ref": "#/components/schemas/LocalizationDto" - }, - "type": "array" }, - "id": { - "description": "A self-defined UUIDv7 may be provided to support idempotent creation of transmission attachments. If not provided, a new UUIDv7 will be generated.", - "example": "01913cd5-784f-7d3b-abef-4c77b1f0972d", - "format": "guid", - "nullable": true, + "crv": { "type": "string" }, - "urls": { - "description": "The URLs associated with the attachment, each referring to a different representation of the attachment.", - "items": { - "$ref": "#/components/schemas/UpdateDialogTransmissionAttachmentUrlDto" - }, - "type": "array" + "kid": { + "type": "string" + }, + "kty": { + "type": "string" + }, + "use": { + "type": "string" + }, + "x": { + "type": "string" } }, "type": "object" }, - "UpdateDialogTransmissionAttachmentUrlDto": { + "V1WellKnownOauthAuthorizationServerQueriesGet_GetOauthAuthorizationServer": { "additionalProperties": false, "properties": { - "consumerType": { - "description": "The type of consumer the URL is intended for.", - "oneOf": [ - { - "$ref": "#/components/schemas/AttachmentUrlConsumerType_Values" - } - ] - }, - "mediaType": { - "description": "The media type of the attachment.", - "example": "application/pdf\napplication/zip", - "nullable": true, + "issuer": { "type": "string" }, - "url": { - "description": "The fully qualified URL of the attachment.", - "format": "uri", + "jwks_uri": { "type": "string" } }, @@ -5087,13 +5087,13 @@ "/api/v1/.well-known/jwks.json": { "get": { "description": "This endpoint can be used by client integrations supporting automatic discovery of \u0022OAuth 2.0 Authorization Server\u0022 metadata, enabling verification of dialog tokens issues by Dialogporten.", - "operationId": "GetJwks", + "operationId": "V1WellKnownJwksGet_GetJwks", "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetJwksDto" + "$ref": "#/components/schemas/V1WellKnownJwksQueriesGet_GetJwks" } } }, @@ -5109,13 +5109,13 @@ "/api/v1/.well-known/oauth-authorization-server": { "get": { "description": "This endpoint can be used by client integrations supporting automatic discovery of \u0022OAuth 2.0 Authorization Server\u0022 metadata, enabling verification of dialog tokens issues by Dialogporten.", - "operationId": "GetOauthAuthorizationServer", + "operationId": "V1WellKnownOauthAuthorizationServerGet_GetOauthAuthorizationServer", "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetOauthAuthorizationServerDto" + "$ref": "#/components/schemas/V1WellKnownOauthAuthorizationServerQueriesGet_GetOauthAuthorizationServer" } } }, @@ -5131,7 +5131,7 @@ "/api/v1/enduser/dialogs": { "get": { "description": "Performs a search for dialogs, returning a paginated list of dialogs. For more information see the documentation (link TBD).\n\n* All date parameters must contain explicit time zone. Example: 2023-10-27T10:00:00Z or 2023-10-27T10:00:00\u002B01:00\n* See \u0022continuationToken\u0022 in the response for how to get the next page of results.\n* hasNextPage will be set to true if there are more items to get.", - "operationId": "GetDialogList", + "operationId": "V1EndUserDialogsSearch_SearchDialog", "parameters": [ { "description": "Filter by one or more service owner codes", @@ -5205,7 +5205,7 @@ "name": "status", "schema": { "items": { - "$ref": "#/components/schemas/DialogStatus_Values" + "$ref": "#/components/schemas/DialogsEntities_DialogStatus" }, "nullable": true, "type": "array" @@ -5288,7 +5288,7 @@ "name": "systemLabel", "schema": { "items": { - "$ref": "#/components/schemas/SystemLabel_Values" + "$ref": "#/components/schemas/DialogEndUserContextsEntities_SystemLabel" }, "nullable": true, "type": "array" @@ -5354,7 +5354,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PaginatedListOfSearchDialogDto" + "$ref": "#/components/schemas/PaginatedListOfV1EndUserDialogsQueriesSearch_Dialog" } } }, @@ -5378,7 +5378,7 @@ "/api/v1/enduser/dialogs/{dialogId}": { "get": { "description": "Gets a single dialog aggregate. For more information see the documentation (link TBD).", - "operationId": "GetDialog", + "operationId": "V1EndUserDialogsGet_GetDialog", "parameters": [ { "in": "path", @@ -5395,7 +5395,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetDialogDto" + "$ref": "#/components/schemas/V1EndUserDialogsQueriesGet_Dialog" } } }, @@ -5432,7 +5432,7 @@ "/api/v1/enduser/dialogs/{dialogId}/activities": { "get": { "description": "Gets the list of activities belonging to a dialog", - "operationId": "GetDialogActivityList", + "operationId": "V1EndUserDialogActivitiesSearch_SearchDialogActivity", "parameters": [ { "in": "path", @@ -5450,7 +5450,7 @@ "application/json": { "schema": { "items": { - "$ref": "#/components/schemas/SearchDialogActivityDto" + "$ref": "#/components/schemas/V1EndUserDialogActivitiesQueriesSearch_Activity" }, "type": "array" } @@ -5479,7 +5479,7 @@ "/api/v1/enduser/dialogs/{dialogId}/activities/{activityId}": { "get": { "description": "Gets a single activity belonging to a dialog. For more information see the documentation (link TBD).", - "operationId": "GetDialogActivity", + "operationId": "V1EndUserDialogActivitiesGet_GetDialogActivity", "parameters": [ { "in": "path", @@ -5505,7 +5505,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetDialogActivityDto" + "$ref": "#/components/schemas/V1EndUserDialogActivitiesQueriesGet_Activity" } } }, @@ -5541,7 +5541,7 @@ }, "/api/v1/enduser/dialogs/{dialogId}/labellog": { "get": { - "operationId": "SearchDialogLabelAssignmentLog", + "operationId": "V1EndUserDialogLabelAssignmentLogsSearch_SearchDialogLabelAssignmentLog", "parameters": [ { "in": "path", @@ -5559,7 +5559,7 @@ "application/json": { "schema": { "items": { - "$ref": "#/components/schemas/SearchDialogLabelAssignmentLogDto" + "$ref": "#/components/schemas/V1EndUserDialogLabelAssignmentLogQueriesSearch_LabelAssignmentLog" }, "type": "array" } @@ -5600,7 +5600,7 @@ "/api/v1/enduser/dialogs/{dialogId}/seenlog": { "get": { "description": "Gets all seen log records for a dialog. For more information see the documentation (link TBD).", - "operationId": "SearchDialogSeenLog", + "operationId": "V1EndUserDialogSeenLogsSearch_SearchDialogSeenLog", "parameters": [ { "in": "path", @@ -5618,7 +5618,7 @@ "application/json": { "schema": { "items": { - "$ref": "#/components/schemas/SearchDialogSeenLogDto" + "$ref": "#/components/schemas/V1EndUserDialogSeenLogsQueriesSearch_SeenLog" }, "type": "array" } @@ -5657,7 +5657,7 @@ "/api/v1/enduser/dialogs/{dialogId}/seenlog/{seenLogId}": { "get": { "description": "Gets a single dialog seen log record. For more information see the documentation (link TBD).", - "operationId": "GetDialogSeenLog", + "operationId": "V1EndUserDialogSeenLogsGet_GetDialogSeenLog", "parameters": [ { "in": "path", @@ -5683,7 +5683,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetDialogSeenLogDto" + "$ref": "#/components/schemas/V1EndUserDialogSeenLogsQueriesGet_SeenLog" } } }, @@ -5719,7 +5719,7 @@ }, "/api/v1/enduser/dialogs/{dialogId}/systemlabels": { "put": { - "operationId": "SetDialogLabel", + "operationId": "V1EndUserDialogSystemLabelsSet_SetDialogSystemLabel", "parameters": [ { "in": "path", @@ -5735,13 +5735,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SetDialogSystemLabelCommand" + "$ref": "#/components/schemas/V1EndUserDialogSystemLabelsCommandsSet_SystemLabelCommand" } } }, "description": "", "required": true, - "x-name": "SetDialogSystemLabelCommand", + "x-name": "SystemLabelCommand", "x-position": 1 }, "responses": { @@ -5811,7 +5811,7 @@ "/api/v1/enduser/dialogs/{dialogId}/transmissions": { "get": { "description": "Gets the list of transmissions belonging to a dialog", - "operationId": "GetDialogTransmissionList", + "operationId": "V1EndUserDialogTransmissionsSearch_SearchDialogTransmission", "parameters": [ { "in": "path", @@ -5829,7 +5829,7 @@ "application/json": { "schema": { "items": { - "$ref": "#/components/schemas/SearchDialogTransmissionDto" + "$ref": "#/components/schemas/V1EndUserDialogTransmissionsQueriesSearch_Transmission" }, "type": "array" } @@ -5858,7 +5858,7 @@ "/api/v1/enduser/dialogs/{dialogId}/transmissions/{transmissionId}": { "get": { "description": "Gets a single transmission belonging to a dialog. For more information see the documentation (link TBD).", - "operationId": "GetDialogTransmission", + "operationId": "V1EndUserDialogTransmissionsGet_GetDialogTransmission", "parameters": [ { "in": "path", @@ -5884,7 +5884,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetDialogTransmissionDto" + "$ref": "#/components/schemas/V1EndUserDialogTransmissionsQueriesGet_Transmission" } } }, @@ -5921,14 +5921,14 @@ "/api/v1/enduser/parties": { "get": { "description": "Gets the list of authorized parties for the end user. For more information see the documentation (link TBD).", - "operationId": "GetParties", + "operationId": "V1EndUserPartiesGet_GetParties", "responses": { "200": { "content": { "application/json": { "schema": { "items": { - "$ref": "#/components/schemas/GetPartiesDto" + "$ref": "#/components/schemas/V1EndUserPartiesQueriesGet_Parties" }, "type": "array" } @@ -5957,7 +5957,7 @@ "/api/v1/serviceowner/dialogs": { "get": { "description": "Performs a search for dialogs, returning a paginated list of dialogs. For more information see the documentation (link TBD).\n\n* All date parameters must contain explicit time zone. Example: 2023-10-27T10:00:00Z or 2023-10-27T10:00:00\u002B01:00\n* See \u0022continuationToken\u0022 in the response for how to get the next page of results.\n* hasNextPage will be set to true if there are more items to get.", - "operationId": "GetDialogListSO", + "operationId": "V1ServiceOwnerDialogsSearch_SearchDialog", "parameters": [ { "description": "Filter by one or more service resources", @@ -6026,7 +6026,7 @@ "name": "status", "schema": { "items": { - "$ref": "#/components/schemas/DialogStatus_Values" + "$ref": "#/components/schemas/DialogsEntities_DialogStatus" }, "nullable": true, "type": "array" @@ -6129,7 +6129,7 @@ "name": "systemLabel", "schema": { "items": { - "$ref": "#/components/schemas/SystemLabel_Values" + "$ref": "#/components/schemas/DialogEndUserContextsEntities_SystemLabel" }, "nullable": true, "type": "array" @@ -6195,7 +6195,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PaginatedListOfSearchDialogDtoSO" + "$ref": "#/components/schemas/PaginatedListOfV1ServiceOwnerDialogsQueriesSearch_Dialog" } } }, @@ -6217,12 +6217,12 @@ }, "post": { "description": "The dialog is created with the given configuration. For more information see the documentation (link TBD).\n\nFor detailed information on validation rules, see [the source for CreateDialogCommandValidator](https://github.com/digdir/dialogporten/blob/main/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Create/CreateDialogCommandValidator.cs)", - "operationId": "CreateDialog", + "operationId": "V1ServiceOwnerDialogsCreate_Dialog", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateDialogCommand" + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsCreate_DialogCommand" } } }, @@ -6284,7 +6284,7 @@ "/api/v1/serviceowner/dialogs/{dialogId}": { "delete": { "description": "Deletes a given dialog (soft delete). For more information see the documentation (link TBD).\n\nNote that the dialog will still be available on the single details endpoint, but will have a deleted status. It will not appear on the list endpoint for either service owners nor end users.\nIf end users attempt to access the dialog via the details endpoint, they will get a 410 Gone response.\n\nOptimistic concurrency control is implemented using the If-Match header. Supply the Revision value from the GetDialog endpoint to ensure that the dialog is not deleted by another request in the meantime.", - "operationId": "DeleteDialog", + "operationId": "V1ServiceOwnerDialogsDelete_Dialog", "parameters": [ { "in": "path", @@ -6348,7 +6348,7 @@ }, "get": { "description": "Gets a single dialog aggregate. For more information see the documentation (link TBD).\n\nNote that this operation may return deleted dialogs (see the field \u0060DeletedAt\u0060).", - "operationId": "GetDialogSO", + "operationId": "V1ServiceOwnerDialogsGet_GetDialog", "parameters": [ { "in": "path", @@ -6374,7 +6374,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetDialogDtoSO" + "$ref": "#/components/schemas/V1ServiceOwnerDialogsQueriesGet_Dialog" } } }, @@ -6438,7 +6438,7 @@ "application/json": { "schema": { "items": { - "$ref": "#/components/schemas/Operation" + "$ref": "#/components/schemas/MicrosoftAspNetCoreJsonPatchOperations_Operation" }, "type": "array" } @@ -6511,7 +6511,7 @@ }, "put": { "description": "Replaces a given dialog with the supplied model. For more information see the documentation (link TBD).\n\nOptimistic concurrency control is implemented using the If-Match header. Supply the Revision value from the GetDialog endpoint to ensure that the dialog is not modified/deleted by another request in the meantime.", - "operationId": "ReplaceDialog", + "operationId": "V1ServiceOwnerDialogsUpdate_Dialog", "parameters": [ { "in": "path", @@ -6670,7 +6670,7 @@ "VisibleFrom": "2054-03-04T12:13:10.01344\u002B00:00" }, "schema": { - "$ref": "#/components/schemas/UpdateDialogDto" + "$ref": "#/components/schemas/V1ServiceOwnerDialogsCommandsUpdate_Dialog" } } }, @@ -6742,7 +6742,7 @@ "/api/v1/serviceowner/dialogs/{dialogId}/actions/purge": { "post": { "description": "Deletes a given dialog (hard delete). For more information see the documentation (link TBD).\n\nOptimistic concurrency control is implemented using the If-Match header. Supply the Revision value from the GetDialog endpoint to ensure that the dialog is not deleted by another request in the meantime.", - "operationId": "PurgeDialog", + "operationId": "V1ServiceOwnerDialogsPurge_PurgeDialog", "parameters": [ { "in": "path", @@ -6808,7 +6808,7 @@ "/api/v1/serviceowner/dialogs/{dialogId}/actions/should-send-notification": { "get": { "description": "Used by Altinn Notification only. Takes a dialogId and returns a boolean value based on conditions used to determine if a notification is to be sent.", - "operationId": "GetDialogActivityNotificationConditionSO", + "operationId": "V1ServiceOwnerDialogActivitiesNotificationCondition_NotificationCondition", "parameters": [ { "in": "path", @@ -6826,7 +6826,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/NotificationConditionType" + "$ref": "#/components/schemas/V1ServiceOwnerDialogActivitiesQueriesNotificationCondition_NotificationConditionType" } ] } @@ -6838,7 +6838,7 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/DialogActivityType_Values" + "$ref": "#/components/schemas/DialogsEntitiesActivities_DialogActivityType" } ] } @@ -6858,7 +6858,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotificationConditionDto" + "$ref": "#/components/schemas/V1ServiceOwnerDialogActivitiesQueriesNotificationCondition_NotificationCondition" } } }, @@ -6885,7 +6885,7 @@ "/api/v1/serviceowner/dialogs/{dialogId}/activities": { "get": { "description": "Gets the list of activities belonging to a dialog", - "operationId": "GetDialogActivityListSO", + "operationId": "V1ServiceOwnerDialogActivitiesSearch_SearchDialogActivity", "parameters": [ { "in": "path", @@ -6903,7 +6903,7 @@ "application/json": { "schema": { "items": { - "$ref": "#/components/schemas/SearchDialogActivityDtoSO" + "$ref": "#/components/schemas/V1ServiceOwnerDialogActivitiesQueriesSearch_Activity" }, "type": "array" } @@ -6930,7 +6930,7 @@ }, "post": { "description": "The activity is created with the given configuration. For more information see the documentation (link TBD).\n\nOptimistic concurrency control is implemented using the If-Match header. Supply the Revision value from the GetDialog endpoint to ensure that the dialog is not modified/deleted by another request in the meantime.", - "operationId": "CreateDialogActivity", + "operationId": "V1ServiceOwnerDialogActivitiesCreate_DialogActivity", "parameters": [ { "in": "path", @@ -6955,13 +6955,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateDialogActivityRequest" + "$ref": "#/components/schemas/V1ServiceOwnerDialogActivitiesCreate_ActivityRequest" } } }, "description": "", "required": true, - "x-name": "CreateDialogActivityRequest", + "x-name": "CreateActivityRequest", "x-position": 1 }, "responses": { @@ -7037,7 +7037,7 @@ "/api/v1/serviceowner/dialogs/{dialogId}/activities/{activityId}": { "get": { "description": "Gets a single activity belonging to a dialog. For more information see the documentation (link TBD).", - "operationId": "GetDialogActivitySO", + "operationId": "V1ServiceOwnerDialogActivitiesGet_GetDialogActivity", "parameters": [ { "in": "path", @@ -7063,7 +7063,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetDialogActivityDtoSO" + "$ref": "#/components/schemas/V1ServiceOwnerDialogActivitiesQueriesGet_Activity" } } }, @@ -7100,7 +7100,7 @@ "/api/v1/serviceowner/dialogs/{dialogId}/seenlog": { "get": { "description": "Gets all seen log records for a dialog. For more information see the documentation (link TBD).", - "operationId": "SearchDialogSeenLogSO", + "operationId": "V1ServiceOwnerDialogSeenLogsSearch_SearchDialogSeenLog", "parameters": [ { "in": "path", @@ -7118,7 +7118,7 @@ "application/json": { "schema": { "items": { - "$ref": "#/components/schemas/SearchSeenLogDto" + "$ref": "#/components/schemas/V1ServiceOwnerDialogSeenLogsQueriesSearch_SeenLog" }, "type": "array" } @@ -7157,7 +7157,7 @@ "/api/v1/serviceowner/dialogs/{dialogId}/seenlog/{seenLogId}": { "get": { "description": "Gets a single dialog seen log record. For more information see the documentation (link TBD).", - "operationId": "GetDialogSeenLogSO", + "operationId": "V1ServiceOwnerDialogSeenLogsGet_GetDialogSeenLog", "parameters": [ { "in": "path", @@ -7183,7 +7183,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetDialogSeenLogDtoSO" + "$ref": "#/components/schemas/V1ServiceOwnerDialogSeenLogsQueriesGet_SeenLog" } } }, @@ -7220,7 +7220,7 @@ "/api/v1/serviceowner/dialogs/{dialogId}/transmissions": { "get": { "description": "Gets the list of transmissions belonging to a dialog", - "operationId": "GetDialogTransmissionListSO", + "operationId": "V1ServiceOwnerDialogTransmissionsSearch_SearchDialogTransmission", "parameters": [ { "in": "path", @@ -7237,10 +7237,7 @@ "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/SearchDialogTransmissionDtoSO" - }, - "type": "array" + "$ref": "#/components/schemas/V1ServiceOwnerDialogTransmissionsQueriesSearch_Transmission" } } }, @@ -7251,6 +7248,16 @@ }, "403": { "description": "Unauthorized to get the supplied dialog (not owned by authenticated organization or has additional scope requirements defined in policy)." + }, + "404": { + "content": { + "application/problem\u002Bjson": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + }, + "description": "The given dialog ID was not found or is already deleted." } }, "security": [ @@ -7265,7 +7272,7 @@ }, "post": { "description": "The transmission is created with the given configuration. For more information see the documentation (link TBD).\n\nOptimistic concurrency control is implemented using the If-Match header. Supply the Revision value from the GetDialog endpoint to ensure that the dialog is not modified/deleted by another request in the meantime.", - "operationId": "CreateDialogTransmission", + "operationId": "V1ServiceOwnerDialogTransmissionsCreate_DialogTransmission", "parameters": [ { "in": "path", @@ -7290,13 +7297,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateDialogTransmissionRequest" + "$ref": "#/components/schemas/V1ServiceOwnerDialogTransmissionsCreate_TransmissionRequest" } } }, "description": "", "required": true, - "x-name": "CreateDialogTransmissionRequest", + "x-name": "CreateTransmissionRequest", "x-position": 1 }, "responses": { @@ -7372,7 +7379,7 @@ "/api/v1/serviceowner/dialogs/{dialogId}/transmissions/{transmissionId}": { "get": { "description": "Gets a single transmission belonging to a dialog. For more information see the documentation (link TBD).", - "operationId": "GetDialogTransmissionSO", + "operationId": "V1ServiceOwnerDialogTransmissionsGet_GetDialogTransmission", "parameters": [ { "in": "path", @@ -7398,7 +7405,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetDialogTransmissionDtoSO" + "$ref": "#/components/schemas/V1ServiceOwnerDialogTransmissionsQueriesGet_Transmission" } } }, diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Get/GetDialogActivityDto.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Get/ActivityDto.cs similarity index 81% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Get/GetDialogActivityDto.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Get/ActivityDto.cs index 1a01ca075d..75aefae051 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Get/GetDialogActivityDto.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Get/ActivityDto.cs @@ -4,7 +4,7 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogActivities.Queries.Get; -public sealed class GetDialogActivityDto +public sealed class ActivityDto { public Guid Id { get; set; } public DateTimeOffset? CreatedAt { get; set; } @@ -14,11 +14,11 @@ public sealed class GetDialogActivityDto public Guid? TransmissionId { get; set; } - public GetDialogActivityPerformedByActorDto PerformedBy { get; set; } = null!; + public PerformedByActorDto PerformedBy { get; set; } = null!; public List Description { get; set; } = []; } -public sealed class GetDialogActivityPerformedByActorDto +public sealed class PerformedByActorDto { public Guid Id { get; set; } public ActorType.Values ActorType { get; set; } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Get/GetDialogActivityQuery.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Get/GetActivityQuery.cs similarity index 83% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Get/GetDialogActivityQuery.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Get/GetActivityQuery.cs index a67d88d3b5..245445b55e 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Get/GetDialogActivityQuery.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Get/GetActivityQuery.cs @@ -10,22 +10,22 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogActivities.Queries.Get; -public sealed class GetDialogActivityQuery : IRequest +public sealed class GetActivityQuery : IRequest { public Guid DialogId { get; set; } public Guid ActivityId { get; set; } } [GenerateOneOf] -public sealed partial class GetDialogActivityResult : OneOfBase; +public sealed partial class GetActivityResult : OneOfBase; -internal sealed class GetDialogActivityQueryHandler : IRequestHandler +internal sealed class GetActivityQueryHandler : IRequestHandler { private readonly IMapper _mapper; private readonly IAltinnAuthorization _altinnAuthorization; private readonly IDialogDbContext _dbContext; - public GetDialogActivityQueryHandler( + public GetActivityQueryHandler( IDialogDbContext dbContext, IMapper mapper, IAltinnAuthorization altinnAuthorization) @@ -35,7 +35,7 @@ public GetDialogActivityQueryHandler( _altinnAuthorization = altinnAuthorization ?? throw new ArgumentNullException(nameof(altinnAuthorization)); } - public async Task Handle(GetDialogActivityQuery request, + public async Task Handle(GetActivityQuery request, CancellationToken cancellationToken) { var dialog = await _dbContext.Dialogs @@ -74,6 +74,6 @@ public async Task Handle(GetDialogActivityQuery request return new EntityNotFound(request.ActivityId); } - return _mapper.Map(activity); + return _mapper.Map(activity); } } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Get/MappingProfile.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Get/MappingProfile.cs index 27d0d4bd48..dad292bc6c 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Get/MappingProfile.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Get/MappingProfile.cs @@ -8,10 +8,10 @@ internal sealed class MappingProfile : Profile { public MappingProfile() { - CreateMap() + CreateMap() .ForMember(dest => dest.Type, opt => opt.MapFrom(src => src.TypeId)); - CreateMap() + CreateMap() .ForMember(dest => dest.ActorType, opt => opt.MapFrom(src => src.ActorTypeId)) .ForMember(dest => dest.ActorId, opt => opt.MapFrom(src => IdentifierMasker.GetMaybeMaskedIdentifier(src.ActorId))); } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Search/SearchDialogActivityDto.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Search/ActivityDto.cs similarity index 91% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Search/SearchDialogActivityDto.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Search/ActivityDto.cs index 7fe30d478d..3792ffbdb6 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Search/SearchDialogActivityDto.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Search/ActivityDto.cs @@ -2,7 +2,7 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogActivities.Queries.Search; -public sealed class SearchDialogActivityDto +public sealed class ActivityDto { public Guid Id { get; set; } public DateTimeOffset CreatedAt { get; set; } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Search/MappingProfile.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Search/MappingProfile.cs index b363412f8c..c729d53f39 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Search/MappingProfile.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Search/MappingProfile.cs @@ -7,7 +7,7 @@ internal sealed class MappingProfile : Profile { public MappingProfile() { - CreateMap() + CreateMap() .ForMember(dest => dest.Type, opt => opt.MapFrom(src => src.TypeId)); } } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Search/SearchDialogActivityQuery.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Search/SearchActivityQuery.cs similarity index 76% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Search/SearchDialogActivityQuery.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Search/SearchActivityQuery.cs index e5a8c17e23..09b46bdc5e 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Search/SearchDialogActivityQuery.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogActivities/Queries/Search/SearchActivityQuery.cs @@ -9,21 +9,21 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogActivities.Queries.Search; -public sealed class SearchDialogActivityQuery : IRequest +public sealed class SearchActivityQuery : IRequest { public Guid DialogId { get; set; } } [GenerateOneOf] -public sealed partial class SearchDialogActivityResult : OneOfBase, EntityNotFound, EntityDeleted>; +public sealed partial class SearchActivityResult : OneOfBase, EntityNotFound, EntityDeleted>; -internal sealed class SearchDialogActivityQueryHandler : IRequestHandler +internal sealed class SearchActivityQueryHandler : IRequestHandler { private readonly IDialogDbContext _db; private readonly IMapper _mapper; private readonly IAltinnAuthorization _altinnAuthorization; - public SearchDialogActivityQueryHandler( + public SearchActivityQueryHandler( IDialogDbContext db, IMapper mapper, IAltinnAuthorization altinnAuthorization) @@ -33,7 +33,7 @@ public SearchDialogActivityQueryHandler( _altinnAuthorization = altinnAuthorization ?? throw new ArgumentNullException(nameof(altinnAuthorization)); } - public async Task Handle(SearchDialogActivityQuery request, CancellationToken cancellationToken) + public async Task Handle(SearchActivityQuery request, CancellationToken cancellationToken) { var dialog = await _db.Dialogs .Include(x => x.Activities) @@ -61,6 +61,6 @@ public async Task Handle(SearchDialogActivityQuery r return new EntityDeleted(request.DialogId); } - return _mapper.Map>(dialog.Activities); + return _mapper.Map>(dialog.Activities); } } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogLabelAssignmentLog/Queries/Search/SearchDialogLabelAssignmentLogDto.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogLabelAssignmentLog/Queries/Search/LabelAssignmentLogDto.cs similarity index 90% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogLabelAssignmentLog/Queries/Search/SearchDialogLabelAssignmentLogDto.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogLabelAssignmentLog/Queries/Search/LabelAssignmentLogDto.cs index 00b0ae9ecd..8e20618ae6 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogLabelAssignmentLog/Queries/Search/SearchDialogLabelAssignmentLogDto.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogLabelAssignmentLog/Queries/Search/LabelAssignmentLogDto.cs @@ -1,6 +1,6 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogLabelAssignmentLog.Queries.Search; -public sealed class SearchDialogLabelAssignmentLogDto +public sealed class LabelAssignmentLogDto { public DateTimeOffset CreatedAt { get; set; } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogLabelAssignmentLog/Queries/Search/MappingProfile.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogLabelAssignmentLog/Queries/Search/MappingProfile.cs index 12c4780e4b..9d801ae4e0 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogLabelAssignmentLog/Queries/Search/MappingProfile.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogLabelAssignmentLog/Queries/Search/MappingProfile.cs @@ -7,7 +7,7 @@ public sealed class MappingProfile : Profile { public MappingProfile() { - CreateMap(); + CreateMap(); CreateMap(); } } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogLabelAssignmentLog/Queries/Search/SearchDialogLabelAssignmentLogQuery.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogLabelAssignmentLog/Queries/Search/SearchLabelAssignmentLogQuery.cs similarity index 69% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogLabelAssignmentLog/Queries/Search/SearchDialogLabelAssignmentLogQuery.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogLabelAssignmentLog/Queries/Search/SearchLabelAssignmentLogQuery.cs index fe3bef95df..5d229e1bcf 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogLabelAssignmentLog/Queries/Search/SearchDialogLabelAssignmentLogQuery.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogLabelAssignmentLog/Queries/Search/SearchLabelAssignmentLogQuery.cs @@ -9,28 +9,28 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogLabelAssignmentLog.Queries.Search; -public sealed class SearchDialogLabelAssignmentLogQuery : IRequest +public sealed class SearchLabelAssignmentLogQuery : IRequest { public Guid DialogId { get; set; } } [GenerateOneOf] -public sealed partial class SearchDialogLabelAssignmentLogResult : OneOfBase, EntityNotFound, EntityDeleted>; +public sealed partial class SearchLabelAssignmentLogResult : OneOfBase, EntityNotFound, EntityDeleted>; -internal sealed class SearchDialogLabelAssignmentLogQueryHandler : IRequestHandler +internal sealed class SearchLabelAssignmentLogQueryHandler : IRequestHandler { private readonly IDialogDbContext _dialogDbContext; private readonly IMapper _mapper; private readonly IAltinnAuthorization _altinnAuthorization; - public SearchDialogLabelAssignmentLogQueryHandler(IDialogDbContext dialogDbContext, IMapper mapper, IAltinnAuthorization altinnAuthorization) + public SearchLabelAssignmentLogQueryHandler(IDialogDbContext dialogDbContext, IMapper mapper, IAltinnAuthorization altinnAuthorization) { _dialogDbContext = dialogDbContext ?? throw new ArgumentNullException(nameof(dialogDbContext)); _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); _altinnAuthorization = altinnAuthorization ?? throw new ArgumentNullException(nameof(altinnAuthorization)); } - public async Task Handle(SearchDialogLabelAssignmentLogQuery request, CancellationToken cancellationToken) + public async Task Handle(SearchLabelAssignmentLogQuery request, CancellationToken cancellationToken) { var dialog = await _dialogDbContext.Dialogs .AsNoTracking() @@ -55,6 +55,6 @@ public async Task Handle(SearchDialogLabel return new EntityDeleted(request.DialogId); } - return _mapper.Map>(dialog.DialogEndUserContext.LabelAssignmentLogs); + return _mapper.Map>(dialog.DialogEndUserContext.LabelAssignmentLogs); } } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Get/GetDialogSeenLogQuery.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Get/GetSeenLogQuery.cs similarity index 84% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Get/GetDialogSeenLogQuery.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Get/GetSeenLogQuery.cs index f7173f092e..e4c79666c2 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Get/GetDialogSeenLogQuery.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Get/GetSeenLogQuery.cs @@ -10,23 +10,23 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogSeenLogs.Queries.Get; -public sealed class GetDialogSeenLogQuery : IRequest +public sealed class GetSeenLogQuery : IRequest { public Guid DialogId { get; set; } public Guid SeenLogId { get; set; } } [GenerateOneOf] -public sealed partial class GetDialogSeenLogResult : OneOfBase; +public sealed partial class GetSeenLogResult : OneOfBase; -internal sealed class GetDialogSeenLogQueryHandler : IRequestHandler +internal sealed class GetSeenLogQueryHandler : IRequestHandler { private readonly IMapper _mapper; private readonly IDialogDbContext _dbContext; private readonly IAltinnAuthorization _altinnAuthorization; private readonly IUserRegistry _userRegistry; - public GetDialogSeenLogQueryHandler( + public GetSeenLogQueryHandler( IMapper mapper, IDialogDbContext dbContext, IAltinnAuthorization altinnAuthorization, @@ -38,7 +38,7 @@ public GetDialogSeenLogQueryHandler( _userRegistry = userRegistry ?? throw new ArgumentNullException(nameof(userRegistry)); } - public async Task Handle(GetDialogSeenLogQuery request, + public async Task Handle(GetSeenLogQuery request, CancellationToken cancellationToken) { var currentUserInformation = await _userRegistry.GetCurrentUserInformation(cancellationToken); @@ -77,7 +77,7 @@ public async Task Handle(GetDialogSeenLogQuery request, return new EntityNotFound(request.SeenLogId); } - var dto = _mapper.Map(seenLog); + var dto = _mapper.Map(seenLog); dto.IsCurrentEndUser = currentUserInformation.UserId.ExternalIdWithPrefix == seenLog.SeenBy.ActorId; return dto; diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Get/MappingProfile.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Get/MappingProfile.cs index f15a924070..c3cb377a3b 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Get/MappingProfile.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Get/MappingProfile.cs @@ -8,10 +8,10 @@ public sealed class MappingProfile : Profile { public MappingProfile() { - CreateMap() + CreateMap() .ForMember(dest => dest.SeenAt, opt => opt.MapFrom(src => src.CreatedAt)); - CreateMap() + CreateMap() .ForMember(dest => dest.ActorId, opt => opt.MapFrom(src => IdentifierMasker.GetMaybeMaskedIdentifier(src.ActorId))); } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Get/GetDialogSeenLogDto.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Get/SeenLogDto.cs similarity index 71% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Get/GetDialogSeenLogDto.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Get/SeenLogDto.cs index d9d8466be1..eab7c1eda3 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Get/GetDialogSeenLogDto.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Get/SeenLogDto.cs @@ -1,16 +1,16 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogSeenLogs.Queries.Get; -public sealed class GetDialogSeenLogDto +public sealed class SeenLogDto { public Guid Id { get; set; } public DateTimeOffset SeenAt { get; set; } - public GetDialogSeenLogSeenByActorDto SeenBy { get; set; } = null!; + public SeenLogSeenByActorDto SeenBy { get; set; } = null!; public bool IsViaServiceOwner { get; set; } public bool IsCurrentEndUser { get; set; } } -public sealed class GetDialogSeenLogSeenByActorDto +public sealed class SeenLogSeenByActorDto { public Guid Id { get; set; } public string ActorName { get; set; } = null!; diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Search/MappingProfile.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Search/MappingProfile.cs index 836b5df65a..be1f80c876 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Search/MappingProfile.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Search/MappingProfile.cs @@ -8,10 +8,10 @@ public sealed class MappingProfile : Profile { public MappingProfile() { - CreateMap() + CreateMap() .ForMember(dest => dest.SeenAt, opt => opt.MapFrom(src => src.CreatedAt)); - CreateMap() + CreateMap() .ForMember(dest => dest.ActorId, opt => opt.MapFrom(src => IdentifierMasker.GetMaybeMaskedIdentifier(src.ActorId))); } } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Search/SearchDialogSeenLogQuery.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Search/SearchSeenLogQuery.cs similarity index 81% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Search/SearchDialogSeenLogQuery.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Search/SearchSeenLogQuery.cs index ad7cc50775..8aa65d356b 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Search/SearchDialogSeenLogQuery.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Search/SearchSeenLogQuery.cs @@ -10,22 +10,22 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogSeenLogs.Queries.Search; -public sealed class SearchDialogSeenLogQuery : IRequest +public sealed class SearchSeenLogQuery : IRequest { public Guid DialogId { get; set; } } [GenerateOneOf] -public sealed partial class SearchDialogSeenLogResult : OneOfBase, EntityNotFound, EntityDeleted, Forbidden>; +public sealed partial class SearchSeenLogResult : OneOfBase, EntityNotFound, EntityDeleted, Forbidden>; -internal sealed class SearchDialogSeenLogQueryHandler : IRequestHandler +internal sealed class SearchSeenLogQueryHandler : IRequestHandler { private readonly IDialogDbContext _db; private readonly IMapper _mapper; private readonly IAltinnAuthorization _altinnAuthorization; private readonly IUserRegistry _userRegistry; - public SearchDialogSeenLogQueryHandler( + public SearchSeenLogQueryHandler( IDialogDbContext db, IMapper mapper, IAltinnAuthorization altinnAuthorization, @@ -37,7 +37,7 @@ public SearchDialogSeenLogQueryHandler( _userRegistry = userRegistry ?? throw new ArgumentNullException(nameof(userRegistry)); } - public async Task Handle(SearchDialogSeenLogQuery request, CancellationToken cancellationToken) + public async Task Handle(SearchSeenLogQuery request, CancellationToken cancellationToken) { var currentUserInformation = await _userRegistry.GetCurrentUserInformation(cancellationToken); @@ -72,7 +72,7 @@ public async Task Handle(SearchDialogSeenLogQuery req return dialog.SeenLog .Select(x => { - var dto = _mapper.Map(x); + var dto = _mapper.Map(x); dto.IsCurrentEndUser = currentUserInformation.UserId.ExternalIdWithPrefix == x.SeenBy.ActorId; return dto; }) diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Search/SearchDialogSeenLogDto.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Search/SeenLogDto.cs similarity index 70% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Search/SearchDialogSeenLogDto.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Search/SeenLogDto.cs index 754f4a5a69..0bf9b14c02 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Search/SearchDialogSeenLogDto.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSeenLogs/Queries/Search/SeenLogDto.cs @@ -1,17 +1,17 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogSeenLogs.Queries.Search; -public sealed class SearchDialogSeenLogDto +public sealed class SeenLogDto { public Guid Id { get; set; } public DateTimeOffset SeenAt { get; set; } - public SearchDialogSeenLogSeenByActorDto SeenBy { get; set; } = null!; + public SeenLogSeenByActorDto SeenBy { get; set; } = null!; public bool IsViaServiceOwner { get; set; } public bool IsCurrentEndUser { get; set; } } -public sealed class SearchDialogSeenLogSeenByActorDto +public sealed class SeenLogSeenByActorDto { public Guid Id { get; set; } public string ActorName { get; set; } = null!; diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSystemLabels/Commands/Set/SetDialogSystemLabelCommandValidator.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSystemLabels/Commands/Set/SetDialogSystemLabelCommandValidator.cs index 3596c52673..e72ef1c69b 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSystemLabels/Commands/Set/SetDialogSystemLabelCommandValidator.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSystemLabels/Commands/Set/SetDialogSystemLabelCommandValidator.cs @@ -2,7 +2,7 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogSystemLabels.Commands.Set; -public sealed class SetDialogSystemLabelCommandValidator : AbstractValidator +public sealed class SetDialogSystemLabelCommandValidator : AbstractValidator { public SetDialogSystemLabelCommandValidator() { diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSystemLabels/Commands/Set/SetDialogSystemLabelCommand.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSystemLabels/Commands/Set/SystemLabelCommand.cs similarity index 77% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSystemLabels/Commands/Set/SetDialogSystemLabelCommand.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSystemLabels/Commands/Set/SystemLabelCommand.cs index 71edd68314..0ffbc14cd0 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSystemLabels/Commands/Set/SetDialogSystemLabelCommand.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSystemLabels/Commands/Set/SystemLabelCommand.cs @@ -10,22 +10,22 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogSystemLabels.Commands.Set; -public sealed class SetDialogSystemLabelCommand : SetDialogSystemLabelDto, IRequest +public sealed class SystemLabelCommand : SystemLabelDto, IRequest { public Guid? IfMatchDialogRevision { get; set; } } [GenerateOneOf] -public sealed partial class SetDialogSystemLabelResult : OneOfBase; +public sealed partial class SetSystemLabelResult : OneOfBase; -internal sealed class SetDialogSystemLabelCommandHandler : IRequestHandler +internal sealed class SetSystemLabelCommandHandler : IRequestHandler { private readonly IDialogDbContext _db; private readonly IUnitOfWork _unitOfWork; private readonly IUserRegistry _userRegistry; private readonly IAltinnAuthorization _altinnAuthorization; - public SetDialogSystemLabelCommandHandler(IDialogDbContext db, IUnitOfWork unitOfWork, IUserRegistry userRegistry, IAltinnAuthorization altinnAuthorization) + public SetSystemLabelCommandHandler(IDialogDbContext db, IUnitOfWork unitOfWork, IUserRegistry userRegistry, IAltinnAuthorization altinnAuthorization) { _db = db ?? throw new ArgumentNullException(nameof(db)); _unitOfWork = unitOfWork ?? throw new ArgumentNullException(nameof(unitOfWork)); @@ -33,8 +33,8 @@ public SetDialogSystemLabelCommandHandler(IDialogDbContext db, IUnitOfWork unitO _altinnAuthorization = altinnAuthorization ?? throw new ArgumentNullException(nameof(altinnAuthorization)); } - public async Task Handle( - SetDialogSystemLabelCommand request, + public async Task Handle( + SystemLabelCommand request, CancellationToken cancellationToken) { var dialog = await _db.Dialogs @@ -64,7 +64,7 @@ public async Task Handle( var saveResult = await _unitOfWork .EnableConcurrencyCheck(dialog.DialogEndUserContext, request.IfMatchDialogRevision) .SaveChangesAsync(cancellationToken); - return saveResult.Match( + return saveResult.Match( success => success, domainError => domainError, concurrencyError => concurrencyError); diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSystemLabels/Commands/Set/SetDialogSystemLabelDto.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSystemLabels/Commands/Set/SystemLabelDto.cs similarity index 87% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSystemLabels/Commands/Set/SetDialogSystemLabelDto.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSystemLabels/Commands/Set/SystemLabelDto.cs index 8a6a9cac76..fde03c0e2f 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSystemLabels/Commands/Set/SetDialogSystemLabelDto.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogSystemLabels/Commands/Set/SystemLabelDto.cs @@ -2,7 +2,7 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogSystemLabels.Commands.Set; -public class SetDialogSystemLabelDto +public class SystemLabelDto { public Guid DialogId { get; set; } public SystemLabel.Values Label { get; set; } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Get/GetDialogTransmissionQuery.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Get/GetTransmissionQuery.cs similarity index 84% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Get/GetDialogTransmissionQuery.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Get/GetTransmissionQuery.cs index 36cd8e8934..f887403302 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Get/GetDialogTransmissionQuery.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Get/GetTransmissionQuery.cs @@ -11,29 +11,29 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogTransmissions.Queries.Get; -public sealed class GetDialogTransmissionQuery : IRequest +public sealed class GetTransmissionQuery : IRequest { public Guid DialogId { get; set; } public Guid TransmissionId { get; set; } } [GenerateOneOf] -public sealed partial class GetDialogTransmissionResult : OneOfBase; +public sealed partial class GetTransmissionResult : OneOfBase; -internal sealed class GetDialogTransmissionQueryHandler : IRequestHandler +internal sealed class GetTransmissionQueryHandler : IRequestHandler { private readonly IMapper _mapper; private readonly IDialogDbContext _dbContext; private readonly IAltinnAuthorization _altinnAuthorization; - public GetDialogTransmissionQueryHandler(IMapper mapper, IDialogDbContext dbContext, IAltinnAuthorization altinnAuthorization) + public GetTransmissionQueryHandler(IMapper mapper, IDialogDbContext dbContext, IAltinnAuthorization altinnAuthorization) { _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); _dbContext = dbContext ?? throw new ArgumentNullException(nameof(dbContext)); _altinnAuthorization = altinnAuthorization ?? throw new ArgumentNullException(nameof(altinnAuthorization)); } - public async Task Handle(GetDialogTransmissionQuery request, + public async Task Handle(GetTransmissionQuery request, CancellationToken cancellationToken) { var dialog = await _dbContext.Dialogs @@ -78,7 +78,7 @@ public async Task Handle(GetDialogTransmissionQuery return new EntityNotFound(request.TransmissionId); } - var dto = _mapper.Map(transmission); + var dto = _mapper.Map(transmission); dto.IsAuthorized = authorizationResult.HasReadAccessToDialogTransmission(transmission.AuthorizationAttribute); if (dto.IsAuthorized) return dto; diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Get/MappingProfile.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Get/MappingProfile.cs index 19b7216158..315cc06f25 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Get/MappingProfile.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Get/MappingProfile.cs @@ -10,18 +10,18 @@ public sealed class MappingProfile : Profile { public MappingProfile() { - CreateMap() + CreateMap() .ForMember(dest => dest.Type, opt => opt.MapFrom(src => src.TypeId)) .ForMember(dest => dest.DeletedAt, opt => opt.MapFrom(src => src.Dialog.DeletedAt)); - CreateMap() + CreateMap() .ForMember(dest => dest.ActorType, opt => opt.MapFrom(src => src.ActorTypeId)); - CreateMap?, GetDialogTransmissionContentDto?>() - .ConvertUsing>(); + CreateMap?, ContentDto?>() + .ConvertUsing>(); - CreateMap(); - CreateMap() + CreateMap(); + CreateMap() .ForMember(dest => dest.ConsumerType, opt => opt.MapFrom(src => src.ConsumerTypeId)); } } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Get/GetDialogTransmissionDto.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Get/TransmissionDto.cs similarity index 88% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Get/GetDialogTransmissionDto.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Get/TransmissionDto.cs index 0beb4312fe..b065b0c66d 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Get/GetDialogTransmissionDto.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Get/TransmissionDto.cs @@ -6,7 +6,7 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogTransmissions.Queries.Get; -public sealed class GetDialogTransmissionDto +public sealed class TransmissionDto { /// /// The unique identifier for the transmission in UUIDv7 format. @@ -52,20 +52,20 @@ public sealed class GetDialogTransmissionDto /// /// The sender actor information for the transmission. /// - public GetDialogTransmissionSenderActorDto Sender { get; set; } = null!; + public SenderActorDto Sender { get; set; } = null!; /// /// The content of the transmission. /// - public GetDialogTransmissionContentDto Content { get; set; } = null!; + public ContentDto Content { get; set; } = null!; /// /// The attachments associated with the transmission. /// - public List Attachments { get; set; } = []; + public List Attachments { get; set; } = []; } -public sealed class GetDialogTransmissionSenderActorDto +public sealed class SenderActorDto { /// /// The unique identifier for the sender actor in UUIDv7 format. @@ -88,7 +88,7 @@ public sealed class GetDialogTransmissionSenderActorDto public string ActorId { get; set; } = null!; } -public sealed class GetDialogTransmissionContentDto +public sealed class ContentDto { /// /// The title of the content. @@ -107,7 +107,7 @@ public sealed class GetDialogTransmissionContentDto public ContentValueDto? ContentReference { get; set; } } -public sealed class GetDialogTransmissionAttachmentDto +public sealed class AttachmentDto { /// /// The unique identifier for the attachment in UUIDv7 format. @@ -122,10 +122,10 @@ public sealed class GetDialogTransmissionAttachmentDto /// /// The URLs associated with the attachment, each referring to a different representation of the attachment. /// - public List Urls { get; set; } = []; + public List Urls { get; set; } = []; } -public sealed class GetDialogTransmissionAttachmentUrlDto +public sealed class AttachmentUrlDto { /// /// The unique identifier for the attachment URL in UUIDv7 format. diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Search/MappingProfile.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Search/MappingProfile.cs index 8905956560..32b6860638 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Search/MappingProfile.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Search/MappingProfile.cs @@ -10,18 +10,18 @@ public sealed class MappingProfile : Profile { public MappingProfile() { - CreateMap() + CreateMap() .ForMember(dest => dest.Type, opt => opt.MapFrom(src => src.TypeId)) .ForMember(dest => dest.DeletedAt, opt => opt.MapFrom(src => src.Dialog.DeletedAt)); - CreateMap() + CreateMap() .ForMember(dest => dest.ActorType, opt => opt.MapFrom(src => src.ActorTypeId)); - CreateMap?, SearchDialogTransmissionContentDto?>() - .ConvertUsing>(); + CreateMap?, ContentDto?>() + .ConvertUsing>(); - CreateMap(); - CreateMap() + CreateMap(); + CreateMap() .ForMember(dest => dest.ConsumerType, opt => opt.MapFrom(src => src.ConsumerTypeId)); } } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Search/SearchDialogTransmissionQuery.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Search/SearchTransmissionQuery.cs similarity index 78% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Search/SearchDialogTransmissionQuery.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Search/SearchTransmissionQuery.cs index f57625e0c7..48b0535cb4 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Search/SearchDialogTransmissionQuery.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Search/SearchTransmissionQuery.cs @@ -9,28 +9,28 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogTransmissions.Queries.Search; -public sealed class SearchDialogTransmissionQuery : IRequest +public sealed class SearchTransmissionQuery : IRequest { public Guid DialogId { get; set; } } [GenerateOneOf] -public sealed partial class SearchDialogTransmissionResult : OneOfBase, EntityNotFound, EntityDeleted>; +public sealed partial class SearchTransmissionResult : OneOfBase, EntityNotFound, EntityDeleted>; -internal sealed class SearchDialogTransmissionQueryHandler : IRequestHandler +internal sealed class SearchTransmissionQueryHandler : IRequestHandler { private readonly IDialogDbContext _db; private readonly IMapper _mapper; private readonly IAltinnAuthorization _altinnAuthorization; - public SearchDialogTransmissionQueryHandler(IDialogDbContext db, IMapper mapper, IAltinnAuthorization altinnAuthorization) + public SearchTransmissionQueryHandler(IDialogDbContext db, IMapper mapper, IAltinnAuthorization altinnAuthorization) { _db = db ?? throw new ArgumentNullException(nameof(db)); _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); _altinnAuthorization = altinnAuthorization ?? throw new ArgumentNullException(nameof(altinnAuthorization)); } - public async Task Handle(SearchDialogTransmissionQuery request, CancellationToken cancellationToken) + public async Task Handle(SearchTransmissionQuery request, CancellationToken cancellationToken) { var dialog = await _db.Dialogs .Include(x => x.Transmissions) @@ -68,6 +68,6 @@ public async Task Handle(SearchDialogTransmissio return new EntityDeleted(request.DialogId); } - return _mapper.Map>(dialog.Transmissions); + return _mapper.Map>(dialog.Transmissions); } } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Search/SearchDialogTransmissionDto.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Search/TransmissionDto.cs similarity index 87% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Search/SearchDialogTransmissionDto.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Search/TransmissionDto.cs index eac474d0bd..e35a0b21ef 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Search/SearchDialogTransmissionDto.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Search/TransmissionDto.cs @@ -6,7 +6,7 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogTransmissions.Queries.Search; -public sealed class SearchDialogTransmissionDto +public sealed class TransmissionDto { /// /// The unique identifier for the transmission in UUIDv7 format. @@ -52,20 +52,20 @@ public sealed class SearchDialogTransmissionDto /// /// The sender actor information for the transmission. /// - public SearchDialogTransmissionSenderActorDto Sender { get; set; } = null!; + public SenderActorDto Sender { get; set; } = null!; /// /// The content of the transmission. /// - public SearchDialogTransmissionContentDto Content { get; set; } = null!; + public ContentDto Content { get; set; } = null!; /// /// The attachments associated with the transmission. /// - public List Attachments { get; set; } = []; + public List Attachments { get; set; } = []; } -public sealed class SearchDialogTransmissionSenderActorDto +public sealed class SenderActorDto { /// /// The unique identifier for the sender actor in UUIDv7 format. @@ -88,7 +88,7 @@ public sealed class SearchDialogTransmissionSenderActorDto public string ActorId { get; set; } = null!; } -public sealed class SearchDialogTransmissionContentDto +public sealed class ContentDto { /// /// The title of the content. @@ -107,7 +107,7 @@ public sealed class SearchDialogTransmissionContentDto public ContentValueDto? ContentReference { get; set; } } -public sealed class SearchDialogTransmissionAttachmentDto +public sealed class AttachmentDto { /// /// The unique identifier for the attachment in UUIDv7 format. @@ -122,10 +122,10 @@ public sealed class SearchDialogTransmissionAttachmentDto /// /// The URLs associated with the attachment, each referring to a different representation of the attachment. /// - public List Urls { get; set; } = []; + public List Urls { get; set; } = []; } -public sealed class SearchDialogTransmissionAttachmentUrlDto +public sealed class AttachmentUrlDto { /// /// The unique identifier for the attachment URL in UUIDv7 format. diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Get/GetDialogDto.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Get/DialogDto.cs similarity index 91% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Get/GetDialogDto.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Get/DialogDto.cs index 40ab0988f7..d20183a809 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Get/GetDialogDto.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Get/DialogDto.cs @@ -11,7 +11,7 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.Dialogs.Queries.Get; -public sealed class GetDialogDto +public sealed class DialogDto { /// /// The unique identifier for the dialog in UUIDv7 format. @@ -124,7 +124,7 @@ public sealed class GetDialogDto /// /// The dialog unstructured text content. /// - public GetDialogContentDto Content { get; set; } = null!; + public ContentDto Content { get; set; } = null!; /// /// The dialog token. May be used (if supported) against external URLs referred to in this dialog's apiActions, @@ -135,35 +135,35 @@ public sealed class GetDialogDto /// /// The attachments associated with the dialog (on an aggregate level). /// - public List Attachments { get; set; } = []; + public List Attachments { get; set; } = []; /// /// The immutable list of transmissions associated with the dialog. /// - public List Transmissions { get; set; } = []; + public List Transmissions { get; set; } = []; /// /// The GUI actions associated with the dialog. Should be used in browser-based interactive frontends. /// - public List GuiActions { get; set; } = []; + public List GuiActions { get; set; } = []; /// /// The API actions associated with the dialog. Should be used in specialized, non-browser-based integrations. /// - public List ApiActions { get; set; } = []; + public List ApiActions { get; set; } = []; /// /// An immutable list of activities associated with the dialog. /// - public List Activities { get; set; } = []; + public List Activities { get; set; } = []; /// /// The list of seen log entries for the dialog newer than the dialog ChangedAt date. /// - public List SeenSinceLastUpdate { get; set; } = []; + public List SeenSinceLastUpdate { get; set; } = []; } -public sealed class GetDialogDialogTransmissionDto +public sealed class DialogTransmissionDto { /// /// The unique identifier for the transmission in UUIDv7 format. @@ -217,20 +217,20 @@ public sealed class GetDialogDialogTransmissionDto /// /// The actor that sent the transmission. /// - public GetDialogDialogTransmissionSenderActorDto Sender { get; set; } = null!; + public DialogTransmissionSenderActorDto Sender { get; set; } = null!; /// /// The transmission unstructured text content. /// - public GetDialogDialogTransmissionContentDto Content { get; set; } = null!; + public DialogTransmissionContentDto Content { get; set; } = null!; /// /// The transmission-level attachments. /// - public List Attachments { get; set; } = []; + public List Attachments { get; set; } = []; } -public sealed class GetDialogDialogSeenLogDto +public sealed class DialogSeenLogDto { /// /// The unique identifier for the seen log entry in UUIDv7 format. @@ -245,7 +245,7 @@ public sealed class GetDialogDialogSeenLogDto /// /// The actor that saw the dialog revision. /// - public GetDialogDialogSeenLogSeenByActorDto SeenBy { get; set; } = null!; + public DialogSeenLogSeenByActorDto SeenBy { get; set; } = null!; /// /// Flag indicating whether the seen log entry was created via the service owner. @@ -260,7 +260,7 @@ public sealed class GetDialogDialogSeenLogDto public bool IsCurrentEndUser { get; set; } } -public sealed class GetDialogDialogSeenLogSeenByActorDto +public sealed class DialogSeenLogSeenByActorDto { /// /// The natural name of the person/business that saw the dialog revision. @@ -277,7 +277,7 @@ public sealed class GetDialogDialogSeenLogSeenByActorDto public string ActorId { get; set; } = null!; } -public sealed class GetDialogDialogTransmissionSenderActorDto +public sealed class DialogTransmissionSenderActorDto { /// /// The type of actor that sent the transmission. @@ -297,7 +297,7 @@ public sealed class GetDialogDialogTransmissionSenderActorDto public string ActorId { get; set; } = null!; } -public sealed class GetDialogContentDto +public sealed class ContentDto { /// /// The title of the dialog. @@ -330,7 +330,7 @@ public sealed class GetDialogContentDto public ContentValueDto? MainContentReference { get; set; } } -public sealed class GetDialogDialogTransmissionContentDto +public sealed class DialogTransmissionContentDto { /// /// The transmission title. @@ -349,7 +349,7 @@ public sealed class GetDialogDialogTransmissionContentDto public ContentValueDto? ContentReference { get; set; } } -public sealed class GetDialogDialogActivityDto +public sealed class DialogActivityDto { /// /// The unique identifier for the activity in UUIDv7 format. @@ -381,7 +381,7 @@ public sealed class GetDialogDialogActivityDto /// /// The actor that performed the activity. /// - public GetDialogDialogActivityPerformedByActorDto PerformedBy { get; set; } = null!; + public DialogActivityPerformedByActorDto PerformedBy { get; set; } = null!; /// /// Unstructured text describing the activity. Only set if the activity type is "Information". @@ -389,7 +389,7 @@ public sealed class GetDialogDialogActivityDto public List Description { get; set; } = []; } -public sealed class GetDialogDialogActivityPerformedByActorDto +public sealed class DialogActivityPerformedByActorDto { /// /// The type of actor that performed the activity. @@ -409,7 +409,7 @@ public sealed class GetDialogDialogActivityPerformedByActorDto public string? ActorId { get; set; } } -public sealed class GetDialogDialogApiActionDto +public sealed class DialogApiActionDto { /// /// The unique identifier for the action in UUIDv7 format. @@ -448,10 +448,10 @@ public sealed class GetDialogDialogApiActionDto /// /// The endpoints associated with the action. /// - public List Endpoints { get; set; } = []; + public List Endpoints { get; set; } = []; } -public sealed class GetDialogDialogApiActionEndpointDto +public sealed class DialogApiActionEndpointDto { /// /// The unique identifier for the endpoint in UUIDv7 format. @@ -510,7 +510,7 @@ public sealed class GetDialogDialogApiActionEndpointDto public DateTimeOffset? SunsetAt { get; set; } } -public sealed class GetDialogDialogGuiActionDto +public sealed class DialogGuiActionDto { /// /// The unique identifier for the action in UUIDv7 format. @@ -582,7 +582,7 @@ public sealed class GetDialogDialogGuiActionDto public List? Prompt { get; set; } } -public sealed class GetDialogDialogAttachmentDto +public sealed class DialogAttachmentDto { /// /// The unique identifier for the attachment in UUIDv7 format. @@ -597,10 +597,10 @@ public sealed class GetDialogDialogAttachmentDto /// /// The URLs associated with the attachment, each referring to a different representation of the attachment. /// - public List Urls { get; set; } = []; + public List Urls { get; set; } = []; } -public sealed class GetDialogDialogAttachmentUrlDto +public sealed class DialogAttachmentUrlDto { /// /// The unique identifier for the attachment URL in UUIDv7 format. @@ -630,7 +630,7 @@ public sealed class GetDialogDialogAttachmentUrlDto public AttachmentUrlConsumerType.Values ConsumerType { get; set; } } -public sealed class GetDialogDialogTransmissionAttachmentDto +public sealed class DialogTransmissionAttachmentDto { /// /// The unique identifier for the attachment in UUIDv7 format. @@ -645,10 +645,10 @@ public sealed class GetDialogDialogTransmissionAttachmentDto /// /// The URLs associated with the attachment, each referring to a different representation of the attachment. /// - public List Urls { get; set; } = []; + public List Urls { get; set; } = []; } -public sealed class GetDialogDialogTransmissionAttachmentUrlDto +public sealed class DialogTransmissionAttachmentUrlDto { /// /// The fully qualified URL of the attachment. Will be set to "urn:dialogporten:unauthorized" if the user is diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Get/GetDialogQuery.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Get/GetDialogQuery.cs index 2889d9e604..6766e0f32f 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Get/GetDialogQuery.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Get/GetDialogQuery.cs @@ -19,7 +19,7 @@ public sealed class GetDialogQuery : IRequest } [GenerateOneOf] -public sealed partial class GetDialogResult : OneOfBase; +public sealed partial class GetDialogResult : OneOfBase; internal sealed class GetDialogQueryHandler : IRequestHandler { @@ -134,12 +134,12 @@ public async Task Handle(GetDialogQuery request, CancellationTo domainError => throw new UnreachableException("Should not get domain error when updating SeenAt."), concurrencyError => throw new UnreachableException("Should not get concurrencyError when updating SeenAt.")); - var dialogDto = _mapper.Map(dialog); + var dialogDto = _mapper.Map(dialog); dialogDto.SeenSinceLastUpdate = dialog.SeenLog .Select(log => { - var logDto = _mapper.Map(log); + var logDto = _mapper.Map(log); logDto.IsCurrentEndUser = currentUserInformation.UserId.ExternalIdWithPrefix == log.SeenBy.ActorId; return logDto; }) @@ -157,7 +157,7 @@ public async Task Handle(GetDialogQuery request, CancellationTo return dialogDto; } - private static void DecorateWithAuthorization(GetDialogDto dto, + private static void DecorateWithAuthorization(DialogDto dto, DialogDetailsAuthorizationResult authorizationResult) { foreach (var (action, resource) in authorizationResult.AuthorizedAltinnActions) @@ -188,7 +188,7 @@ private static void DecorateWithAuthorization(GetDialogDto dto, } } - private static void ReplaceUnauthorizedUrls(GetDialogDto dto) + private static void ReplaceUnauthorizedUrls(DialogDto dto) { // For all API and GUI actions and transmissions where isAuthorized is false, replace the URLs with Constants.UnauthorizedUrl foreach (var guiAction in dto.GuiActions.Where(a => !a.IsAuthorized)) diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Get/MappingProfile.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Get/MappingProfile.cs index 5fca629ec3..f98167e5f6 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Get/MappingProfile.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Get/MappingProfile.cs @@ -15,54 +15,54 @@ internal sealed class MappingProfile : Profile { public MappingProfile() { - CreateMap() + CreateMap() .ForMember(dest => dest.Revision, opt => opt.MapFrom(src => src.Revision)) .ForMember(dest => dest.Status, opt => opt.MapFrom(src => src.StatusId)) .ForMember(dest => dest.SeenSinceLastUpdate, opt => opt.Ignore()) .ForMember(dest => dest.SystemLabel, opt => opt.MapFrom(src => src.DialogEndUserContext.SystemLabelId)); - CreateMap() + CreateMap() .ForMember(dest => dest.SeenAt, opt => opt.MapFrom(src => src.CreatedAt)); - CreateMap() + CreateMap() .ForMember(dest => dest.ActorId, opt => opt.MapFrom(src => IdentifierMasker.GetMaybeMaskedIdentifier(src.ActorId))); - CreateMap() + CreateMap() .ForMember(dest => dest.Type, opt => opt.MapFrom(src => src.TypeId)); - CreateMap() + CreateMap() .ForMember(dest => dest.ActorType, opt => opt.MapFrom(src => src.ActorTypeId)) .ForMember(dest => dest.ActorId, opt => opt.MapFrom(src => IdentifierMasker.GetMaybeMaskedIdentifier(src.ActorId))); - CreateMap(); + CreateMap(); - CreateMap() + CreateMap() .ForMember(dest => dest.HttpMethod, opt => opt.MapFrom(src => src.HttpMethodId)); - CreateMap() + CreateMap() .ForMember(dest => dest.Priority, opt => opt.MapFrom(src => src.PriorityId)) .ForMember(dest => dest.HttpMethod, opt => opt.MapFrom(src => src.HttpMethodId)); - CreateMap(); + CreateMap(); - CreateMap() + CreateMap() .ForMember(dest => dest.ConsumerType, opt => opt.MapFrom(src => src.ConsumerTypeId)); - CreateMap?, GetDialogContentDto?>() - .ConvertUsing>(); + CreateMap?, ContentDto?>() + .ConvertUsing>(); - CreateMap() + CreateMap() .ForMember(dest => dest.ActorType, opt => opt.MapFrom(src => src.ActorTypeId)) .ForMember(dest => dest.ActorId, opt => opt.MapFrom(src => IdentifierMasker.GetMaybeMaskedIdentifier(src.ActorId))); - CreateMap?, GetDialogDialogTransmissionContentDto?>() - .ConvertUsing>(); + CreateMap?, DialogTransmissionContentDto?>() + .ConvertUsing>(); - CreateMap() + CreateMap() .ForMember(dest => dest.Type, opt => opt.MapFrom(src => src.TypeId)); - CreateMap(); - CreateMap() + CreateMap(); + CreateMap() .ForMember(dest => dest.ConsumerType, opt => opt.MapFrom(src => src.ConsumerTypeId)); } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/SearchDialogDto.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/DialogDto.cs similarity index 86% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/SearchDialogDto.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/DialogDto.cs index f4c2a854dd..effe86e775 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/SearchDialogDto.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/DialogDto.cs @@ -4,16 +4,16 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.Dialogs.Queries.Search; -public sealed class SearchDialogDto : SearchDialogDtoBase +public sealed class DialogDto : DialogDtoBase { /// /// The content of the dialog in search results. /// [JsonPropertyOrder(100)] // ILU MAGNUS - public SearchDialogContentDto Content { get; set; } = null!; + public ContentDto Content { get; set; } = null!; } -public sealed class SearchDialogContentDto +public sealed class ContentDto { /// /// The title of the dialog. @@ -43,7 +43,7 @@ public sealed class SearchDialogContentDto /// in the SearchDialog handlers, after EF core is done loading the data. /// Then we create a new PaginatedList with the outwards facing dto /// -public sealed class IntermediateSearchDialogDto : SearchDialogDtoBase +public sealed class IntermediateDialogDto : DialogDtoBase { public List Content { get; set; } = []; } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/SearchDialogDtoBase.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/DialogDtoBase.cs similarity index 92% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/SearchDialogDtoBase.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/DialogDtoBase.cs index 92d14120af..9303298ec8 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/SearchDialogDtoBase.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/DialogDtoBase.cs @@ -6,7 +6,7 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.Dialogs.Queries.Search; -public class SearchDialogDtoBase +public class DialogDtoBase { /// /// The unique identifier for the dialog in UUIDv7 format. @@ -101,15 +101,15 @@ public class SearchDialogDtoBase /// /// The latest entry in the dialog's activity log. /// - public SearchDialogDialogActivityDto? LatestActivity { get; set; } + public DialogActivityDto? LatestActivity { get; set; } /// /// The list of seen log entries for the dialog newer than the dialog ChangedAt date. /// - public List SeenSinceLastUpdate { get; set; } = []; + public List SeenSinceLastUpdate { get; set; } = []; } -public sealed class SearchDialogDialogSeenLogDto +public sealed class DialogSeenLogDto { /// /// The unique identifier for the seen log entry in UUIDv7 format. @@ -124,7 +124,7 @@ public sealed class SearchDialogDialogSeenLogDto /// /// The actor that saw the dialog revision. /// - public SearchDialogDialogSeenLogSeenByActorDto SeenBy { get; set; } = null!; + public DialogSeenLogSeenByActorDto SeenBy { get; set; } = null!; /// /// Flag indicating whether the seen log entry was created via the service owner. @@ -139,7 +139,7 @@ public sealed class SearchDialogDialogSeenLogDto public bool IsCurrentEndUser { get; set; } } -public sealed class SearchDialogDialogSeenLogSeenByActorDto +public sealed class DialogSeenLogSeenByActorDto { /// /// The natural name of the person/business that saw the dialog revision. @@ -156,7 +156,7 @@ public sealed class SearchDialogDialogSeenLogSeenByActorDto public string ActorId { get; set; } = null!; } -public sealed class SearchDialogDialogActivityDto +public sealed class DialogActivityDto { /// /// The unique identifier for the activity in UUIDv7 format. @@ -188,7 +188,7 @@ public sealed class SearchDialogDialogActivityDto /// /// The actor that performed the activity. /// - public SearchDialogDialogActivityPerformedByActorDto PerformedBy { get; set; } = null!; + public DialogActivityPerformedByActorDto PerformedBy { get; set; } = null!; /// /// Unstructured text describing the activity. Only set if the activity type is "Information". @@ -196,7 +196,7 @@ public sealed class SearchDialogDialogActivityDto public List Description { get; set; } = []; } -public sealed class SearchDialogDialogActivityPerformedByActorDto +public sealed class DialogActivityPerformedByActorDto { /// /// What type of actor performed the activity. diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/MappingProfile.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/MappingProfile.cs index 800faa7c41..badefbcb39 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/MappingProfile.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/MappingProfile.cs @@ -13,8 +13,8 @@ internal sealed class MappingProfile : Profile public MappingProfile() { // See IntermediateSearchDialogDto - CreateMap(); - CreateMap() + CreateMap(); + CreateMap() .ForMember(dest => dest.LatestActivity, opt => opt.MapFrom(src => src.Activities .OrderByDescending(activity => activity.CreatedAt).ThenByDescending(activity => activity.Id) .FirstOrDefault() @@ -30,20 +30,20 @@ public MappingProfile() .ForMember(dest => dest.Status, opt => opt.MapFrom(src => src.StatusId)) .ForMember(dest => dest.SystemLabel, opt => opt.MapFrom(src => src.DialogEndUserContext.SystemLabelId)); - CreateMap() + CreateMap() .ForMember(dest => dest.SeenAt, opt => opt.MapFrom(src => src.CreatedAt)); - CreateMap() + CreateMap() .ForMember(dest => dest.ActorId, opt => opt.MapFrom(src => IdentifierMasker.GetMaybeMaskedIdentifier(src.ActorId))); - CreateMap() + CreateMap() .ForMember(dest => dest.Type, opt => opt.MapFrom(src => src.TypeId)); - CreateMap() + CreateMap() .ForMember(dest => dest.ActorType, opt => opt.MapFrom(src => src.ActorTypeId)) .ForMember(dest => dest.ActorId, opt => opt.MapFrom(src => IdentifierMasker.GetMaybeMaskedIdentifier(src.ActorId))); - CreateMap?, SearchDialogContentDto?>() - .ConvertUsing>(); + CreateMap?, ContentDto?>() + .ConvertUsing>(); } } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/SearchDialogQuery.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/SearchDialogQuery.cs index 590c02a99e..0be92d0a10 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/SearchDialogQuery.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/SearchDialogQuery.cs @@ -17,7 +17,7 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.Dialogs.Queries.Search; -public sealed class SearchDialogQuery : SortablePaginationParameter, IRequest +public sealed class SearchDialogQuery : SortablePaginationParameter, IRequest { private readonly string? _searchLanguageCode; @@ -106,9 +106,9 @@ public string? SearchLanguageCode } } -public sealed class SearchDialogQueryOrderDefinition : IOrderDefinition +public sealed class SearchDialogQueryOrderDefinition : IOrderDefinition { - public static IOrderOptions Configure(IOrderOptionsBuilder options) => + public static IOrderOptions Configure(IOrderOptionsBuilder options) => options.AddId(x => x.Id) .AddDefault("createdAt", x => x.CreatedAt) .AddOption("updatedAt", x => x.UpdatedAt) @@ -117,7 +117,7 @@ public static IOrderOptions Configure(IOrderOptions } [GenerateOneOf] -public sealed partial class SearchDialogResult : OneOfBase, ValidationError, Forbidden>; +public sealed partial class SearchDialogResult : OneOfBase, ValidationError, Forbidden>; internal sealed class SearchDialogQueryHandler : IRequestHandler { @@ -153,7 +153,7 @@ public async Task Handle(SearchDialogQuery request, Cancella if (authorizedResources.HasNoAuthorizations) { - return PaginatedList.CreateEmpty(request); + return PaginatedList.CreateEmpty(request); } var paginatedList = await _db.Dialogs @@ -183,7 +183,7 @@ public async Task Handle(SearchDialogQuery request, Cancella ) .Where(x => !x.VisibleFrom.HasValue || _clock.UtcNowOffset > x.VisibleFrom) .Where(x => !x.ExpiresAt.HasValue || x.ExpiresAt > _clock.UtcNowOffset) - .ProjectTo(_mapper.ConfigurationProvider) + .ProjectTo(_mapper.ConfigurationProvider) .ToPaginatedListAsync(request, cancellationToken: cancellationToken); foreach (var seenLog in paginatedList.Items.SelectMany(x => x.SeenSinceLastUpdate)) @@ -191,6 +191,6 @@ public async Task Handle(SearchDialogQuery request, Cancella seenLog.IsCurrentEndUser = IdentifierMasker.GetMaybeMaskedIdentifier(currentUserInfo.UserId.ExternalIdWithPrefix) == seenLog.SeenBy.ActorId; } - return paginatedList.ConvertTo(_mapper.Map); + return paginatedList.ConvertTo(_mapper.Map); } } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/SearchDialogQueryValidator.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/SearchDialogQueryValidator.cs index ecf96f38d2..eb824f6af0 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/SearchDialogQueryValidator.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/SearchDialogQueryValidator.cs @@ -12,7 +12,7 @@ internal sealed class SearchDialogQueryValidator : AbstractValidator()); + Include(new PaginationParameterValidator()); RuleFor(x => x.Search) .MinimumLength(3) .When(x => x.Search is not null); diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Parties/Queries/Get/GetPartiesQuery.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Parties/Queries/Get/GetPartiesQuery.cs index 303ae717d7..2d71adaa06 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Parties/Queries/Get/GetPartiesQuery.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Parties/Queries/Get/GetPartiesQuery.cs @@ -4,9 +4,9 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.Parties.Queries.Get; -public sealed class GetPartiesQuery : IRequest; +public sealed class GetPartiesQuery : IRequest; -internal sealed class GetPartiesQueryHandler : IRequestHandler +internal sealed class GetPartiesQueryHandler : IRequestHandler { private readonly IUserParties _userParties; private readonly IMapper _mapper; @@ -17,9 +17,9 @@ public GetPartiesQueryHandler(IUserParties userParties, IMapper mapper) _mapper = mapper; } - public async Task Handle(GetPartiesQuery request, CancellationToken cancellationToken) + public async Task Handle(GetPartiesQuery request, CancellationToken cancellationToken) { var authorizedPartiesResult = await _userParties.GetUserParties(cancellationToken); - return _mapper.Map(authorizedPartiesResult); + return _mapper.Map(authorizedPartiesResult); } } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Parties/Queries/Get/MappingProfile.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Parties/Queries/Get/MappingProfile.cs index c4021ca128..decdfb1fde 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Parties/Queries/Get/MappingProfile.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Parties/Queries/Get/MappingProfile.cs @@ -7,7 +7,7 @@ internal sealed class MappingProfile : Profile { public MappingProfile() { - CreateMap(); + CreateMap(); CreateMap(); } } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Parties/Queries/Get/GetPartiesDto.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Parties/Queries/Get/PartiesDto.cs similarity index 95% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Parties/Queries/Get/GetPartiesDto.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Parties/Queries/Get/PartiesDto.cs index 9345c6a994..8d00dd366c 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Parties/Queries/Get/GetPartiesDto.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Parties/Queries/Get/PartiesDto.cs @@ -1,6 +1,6 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.Parties.Queries.Get; -public sealed class GetPartiesDto +public sealed class PartiesDto { public List AuthorizedParties { get; init; } = []; } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Get/GetDialogActivityDto.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Get/ActivityDto.cs similarity index 82% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Get/GetDialogActivityDto.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Get/ActivityDto.cs index 46d3e9f55f..4175bfe731 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Get/GetDialogActivityDto.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Get/ActivityDto.cs @@ -4,7 +4,7 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.DialogActivities.Queries.Get; -public sealed class GetDialogActivityDto +public sealed class ActivityDto { public Guid Id { get; set; } public DateTimeOffset? CreatedAt { get; set; } @@ -16,11 +16,11 @@ public sealed class GetDialogActivityDto public Guid? TransmissionId { get; set; } - public GetDialogActivityPerformedByActorDto PerformedBy { get; set; } = null!; + public ActivityPerformedByActorDto PerformedBy { get; set; } = null!; public List Description { get; set; } = []; } -public sealed class GetDialogActivityPerformedByActorDto +public sealed class ActivityPerformedByActorDto { public Guid Id { get; set; } public ActorType.Values ActorType { get; set; } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Get/GetDialogActivityQuery.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Get/GetActivityQuery.cs similarity index 78% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Get/GetDialogActivityQuery.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Get/GetActivityQuery.cs index a5bcccc22a..9d68d7f100 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Get/GetDialogActivityQuery.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Get/GetActivityQuery.cs @@ -10,29 +10,29 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.DialogActivities.Queries.Get; -public sealed class GetDialogActivityQuery : IRequest +public sealed class GetActivityQuery : IRequest { public Guid DialogId { get; set; } public Guid ActivityId { get; set; } } [GenerateOneOf] -public sealed partial class GetDialogActivityResult : OneOfBase; +public sealed partial class GetActivityResult : OneOfBase; -internal sealed class GetDialogActivityQueryHandler : IRequestHandler +internal sealed class GetActivityQueryHandler : IRequestHandler { private readonly IMapper _mapper; private readonly IDialogDbContext _dbContext; private readonly IUserResourceRegistry _userResourceRegistry; - public GetDialogActivityQueryHandler(IMapper mapper, IDialogDbContext dbContext, IUserResourceRegistry userResourceRegistry) + public GetActivityQueryHandler(IMapper mapper, IDialogDbContext dbContext, IUserResourceRegistry userResourceRegistry) { _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); _dbContext = dbContext ?? throw new ArgumentNullException(nameof(dbContext)); _userResourceRegistry = userResourceRegistry ?? throw new ArgumentNullException(nameof(userResourceRegistry)); } - public async Task Handle(GetDialogActivityQuery request, + public async Task Handle(GetActivityQuery request, CancellationToken cancellationToken) { var resourceIds = await _userResourceRegistry.GetCurrentUserResourceIds(cancellationToken); @@ -59,6 +59,6 @@ public async Task Handle(GetDialogActivityQuery request return new EntityNotFound(request.ActivityId); } - return _mapper.Map(activity); + return _mapper.Map(activity); } } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Get/MappingProfile.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Get/MappingProfile.cs index 58351f97fd..e5c55c1df8 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Get/MappingProfile.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Get/MappingProfile.cs @@ -7,11 +7,11 @@ public sealed class MappingProfile : Profile { public MappingProfile() { - CreateMap() + CreateMap() .ForMember(dest => dest.Type, opt => opt.MapFrom(src => src.TypeId)) .ForMember(dest => dest.DeletedAt, opt => opt.MapFrom(src => src.Dialog.DeletedAt)); - CreateMap() + CreateMap() .ForMember(dest => dest.ActorType, opt => opt.MapFrom(src => src.ActorTypeId)); } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Search/SearchDialogActivityDto.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Search/ActivityDto.cs similarity index 91% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Search/SearchDialogActivityDto.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Search/ActivityDto.cs index d9dfdf4ea4..f6fe730cc7 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Search/SearchDialogActivityDto.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Search/ActivityDto.cs @@ -2,7 +2,7 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.DialogActivities.Queries.Search; -public sealed class SearchDialogActivityDto +public sealed class ActivityDto { public Guid Id { get; set; } public DateTimeOffset CreatedAt { get; set; } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Search/MappingProfile.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Search/MappingProfile.cs index 06012831f9..c123c3b881 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Search/MappingProfile.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Search/MappingProfile.cs @@ -7,7 +7,7 @@ public sealed class MappingProfile : Profile { public MappingProfile() { - CreateMap() + CreateMap() .ForMember(dest => dest.Type, opt => opt.MapFrom(src => src.TypeId)) .ForMember(dest => dest.DeletedAt, opt => opt.MapFrom(src => src.Dialog.DeletedAt)); } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Search/SearchDialogActivityQuery.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Search/SearchActivityQuery.cs similarity index 68% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Search/SearchDialogActivityQuery.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Search/SearchActivityQuery.cs index d04369fd1b..2659970eaf 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Search/SearchDialogActivityQuery.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogActivities/Queries/Search/SearchActivityQuery.cs @@ -9,28 +9,28 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.DialogActivities.Queries.Search; -public sealed class SearchDialogActivityQuery : IRequest +public sealed class SearchActivityQuery : IRequest { public Guid DialogId { get; set; } } [GenerateOneOf] -public sealed partial class SearchDialogActivityResult : OneOfBase, EntityNotFound>; +public sealed partial class SearchActivityResult : OneOfBase, EntityNotFound>; -internal sealed class SearchDialogActivityQueryHandler : IRequestHandler +internal sealed class SearchActivityQueryHandler : IRequestHandler { private readonly IDialogDbContext _db; private readonly IMapper _mapper; private readonly IUserResourceRegistry _userResourceRegistry; - public SearchDialogActivityQueryHandler(IDialogDbContext db, IMapper mapper, IUserResourceRegistry userResourceRegistry) + public SearchActivityQueryHandler(IDialogDbContext db, IMapper mapper, IUserResourceRegistry userResourceRegistry) { _db = db ?? throw new ArgumentNullException(nameof(db)); _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); _userResourceRegistry = userResourceRegistry ?? throw new ArgumentNullException(nameof(userResourceRegistry)); } - public async Task Handle(SearchDialogActivityQuery request, CancellationToken cancellationToken) + public async Task Handle(SearchActivityQuery request, CancellationToken cancellationToken) { var resourceIds = await _userResourceRegistry.GetCurrentUserResourceIds(cancellationToken); @@ -46,6 +46,6 @@ public async Task Handle(SearchDialogActivityQuery r return new EntityNotFound(request.DialogId); } - return _mapper.Map>(dialog.Activities); + return _mapper.Map>(dialog.Activities); } } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Get/GetDialogSeenLogQuery.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Get/GetSeenLogQuery.cs similarity index 80% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Get/GetDialogSeenLogQuery.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Get/GetSeenLogQuery.cs index 54df538a5c..9f68f416f9 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Get/GetDialogSeenLogQuery.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Get/GetSeenLogQuery.cs @@ -9,22 +9,22 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.DialogSeenLogs.Queries.Get; -public sealed class GetDialogSeenLogQuery : IRequest +public sealed class GetSeenLogQuery : IRequest { public Guid DialogId { get; set; } public Guid SeenLogId { get; set; } } [GenerateOneOf] -public sealed partial class GetDialogSeenLogResult : OneOfBase; +public sealed partial class GetSeenLogResult : OneOfBase; -internal sealed class GetDialogSeenLogQueryHandler : IRequestHandler +internal sealed class GetSeenLogQueryHandler : IRequestHandler { private readonly IMapper _mapper; private readonly IDialogDbContext _dbContext; private readonly IUserResourceRegistry _userResourceRegistry; - public GetDialogSeenLogQueryHandler( + public GetSeenLogQueryHandler( IMapper mapper, IDialogDbContext dbContext, IUserResourceRegistry userResourceRegistry) @@ -34,7 +34,7 @@ public GetDialogSeenLogQueryHandler( _userResourceRegistry = userResourceRegistry ?? throw new ArgumentNullException(nameof(userResourceRegistry)); } - public async Task Handle(GetDialogSeenLogQuery request, + public async Task Handle(GetSeenLogQuery request, CancellationToken cancellationToken) { var resourceIds = await _userResourceRegistry.GetCurrentUserResourceIds(cancellationToken); @@ -59,7 +59,7 @@ public async Task Handle(GetDialogSeenLogQuery request, return new EntityNotFound(request.SeenLogId); } - var dto = _mapper.Map(seenLog); + var dto = _mapper.Map(seenLog); return dto; } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Get/MappingProfile.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Get/MappingProfile.cs index 194753b1fa..3b03e5be78 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Get/MappingProfile.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Get/MappingProfile.cs @@ -7,9 +7,9 @@ public sealed class MappingProfile : Profile { public MappingProfile() { - CreateMap() + CreateMap() .ForMember(dest => dest.SeenAt, opt => opt.MapFrom(src => src.CreatedAt)); - CreateMap(); + CreateMap(); } } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Get/GetDialogSeenLogDto.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Get/SeenLogDto.cs similarity index 69% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Get/GetDialogSeenLogDto.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Get/SeenLogDto.cs index b60c39f3fe..bc679ce0a0 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Get/GetDialogSeenLogDto.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Get/SeenLogDto.cs @@ -1,16 +1,16 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.DialogSeenLogs.Queries.Get; -public sealed class GetDialogSeenLogDto +public sealed class SeenLogDto { public Guid Id { get; set; } public DateTimeOffset SeenAt { get; set; } - public GetDialogSeenLogSeenByActorDto SeenBy { get; set; } = null!; + public SeenLogSeenByActorDto SeenBy { get; set; } = null!; public bool? IsViaServiceOwner { get; set; } } -public sealed class GetDialogSeenLogSeenByActorDto +public sealed class SeenLogSeenByActorDto { public Guid Id { get; set; } public string ActorName { get; set; } = null!; diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Search/MappingProfile.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Search/MappingProfile.cs index 087171d4f3..00aa445098 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Search/MappingProfile.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Search/MappingProfile.cs @@ -7,9 +7,9 @@ public sealed class MappingProfile : Profile { public MappingProfile() { - CreateMap() + CreateMap() .ForMember(dest => dest.SeenAt, opt => opt.MapFrom(src => src.CreatedAt)); - CreateMap(); + CreateMap(); } } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Search/SearchDialogSeenLogQuery.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Search/SearchSeenLogQuery.cs similarity index 75% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Search/SearchDialogSeenLogQuery.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Search/SearchSeenLogQuery.cs index 8e5e17b6de..de530bb3d6 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Search/SearchDialogSeenLogQuery.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Search/SearchSeenLogQuery.cs @@ -9,21 +9,21 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.DialogSeenLogs.Queries.Search; -public sealed class SearchDialogSeenLogQuery : IRequest +public sealed class SearchSeenLogQuery : IRequest { public Guid DialogId { get; set; } } [GenerateOneOf] -public sealed partial class SearchDialogSeenLogResult : OneOfBase, EntityNotFound>; +public sealed partial class SearchSeenLogResult : OneOfBase, EntityNotFound>; -internal sealed class SearchDialogSeenLogQueryHandler : IRequestHandler +internal sealed class SearchSeenLogQueryHandler : IRequestHandler { private readonly IDialogDbContext _db; private readonly IMapper _mapper; private readonly IUserResourceRegistry _userResourceRegistry; - public SearchDialogSeenLogQueryHandler( + public SearchSeenLogQueryHandler( IDialogDbContext db, IMapper mapper, IUserResourceRegistry userResourceRegistry) @@ -33,7 +33,7 @@ public SearchDialogSeenLogQueryHandler( _userResourceRegistry = userResourceRegistry; } - public async Task Handle(SearchDialogSeenLogQuery request, CancellationToken cancellationToken) + public async Task Handle(SearchSeenLogQuery request, CancellationToken cancellationToken) { var resourceIds = await _userResourceRegistry.GetCurrentUserResourceIds(cancellationToken); @@ -54,7 +54,7 @@ public async Task Handle(SearchDialogSeenLogQuery req return dialog.SeenLog .Select(x => { - var dto = _mapper.Map(x); + var dto = _mapper.Map(x); return dto; }) .ToList(); diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Search/SearchSeenLogDto.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Search/SeenLogDto.cs similarity index 71% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Search/SearchSeenLogDto.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Search/SeenLogDto.cs index 8d005dfe9e..818d7e208d 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Search/SearchSeenLogDto.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogSeenLogs/Queries/Search/SeenLogDto.cs @@ -1,16 +1,16 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.DialogSeenLogs.Queries.Search; -public sealed class SearchSeenLogDto +public sealed class SeenLogDto { public Guid Id { get; set; } public DateTimeOffset SeenAt { get; set; } - public SearchSeenLogSeenByActorDto SeenBy { get; set; } = null!; + public SeenByActorDto SeenBy { get; set; } = null!; public bool? IsViaServiceOwner { get; set; } } -public sealed class SearchSeenLogSeenByActorDto +public sealed class SeenByActorDto { public Guid Id { get; set; } public string ActorName { get; set; } = null!; diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Get/GetDialogTransmissionQuery.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Get/GetTransmissionQuery.cs similarity index 77% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Get/GetDialogTransmissionQuery.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Get/GetTransmissionQuery.cs index ec10854962..97c6c1d26b 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Get/GetDialogTransmissionQuery.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Get/GetTransmissionQuery.cs @@ -10,29 +10,29 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.DialogTransmissions.Queries.Get; -public sealed class GetDialogTransmissionQuery : IRequest +public sealed class GetTransmissionQuery : IRequest { public Guid DialogId { get; set; } public Guid TransmissionId { get; set; } } [GenerateOneOf] -public sealed partial class GetDialogTransmissionResult : OneOfBase; +public sealed partial class GetTransmissionResult : OneOfBase; -internal sealed class GetDialogTransmissionQueryHandler : IRequestHandler +internal sealed class GetTransmissionQueryHandler : IRequestHandler { private readonly IMapper _mapper; private readonly IDialogDbContext _dbContext; private readonly IUserResourceRegistry _userResourceRegistry; - public GetDialogTransmissionQueryHandler(IMapper mapper, IDialogDbContext dbContext, IUserResourceRegistry userResourceRegistry) + public GetTransmissionQueryHandler(IMapper mapper, IDialogDbContext dbContext, IUserResourceRegistry userResourceRegistry) { _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); _dbContext = dbContext ?? throw new ArgumentNullException(nameof(dbContext)); _userResourceRegistry = userResourceRegistry ?? throw new ArgumentNullException(nameof(userResourceRegistry)); } - public async Task Handle(GetDialogTransmissionQuery request, + public async Task Handle(GetTransmissionQuery request, CancellationToken cancellationToken) { var resourceIds = await _userResourceRegistry.GetCurrentUserResourceIds(cancellationToken); @@ -62,7 +62,7 @@ public async Task Handle(GetDialogTransmissionQuery var transmission = dialog.Transmissions.FirstOrDefault(); return transmission is null - ? (GetDialogTransmissionResult)new EntityNotFound(request.TransmissionId) - : _mapper.Map(transmission); + ? (GetTransmissionResult)new EntityNotFound(request.TransmissionId) + : _mapper.Map(transmission); } } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Get/MappingProfile.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Get/MappingProfile.cs index 44a24fb171..5d219c6e82 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Get/MappingProfile.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Get/MappingProfile.cs @@ -10,18 +10,18 @@ public sealed class MappingProfile : Profile { public MappingProfile() { - CreateMap() + CreateMap() .ForMember(dest => dest.Type, opt => opt.MapFrom(src => src.TypeId)) .ForMember(dest => dest.DeletedAt, opt => opt.MapFrom(src => src.Dialog.DeletedAt)); - CreateMap() + CreateMap() .ForMember(dest => dest.ActorType, opt => opt.MapFrom(src => src.ActorTypeId)); - CreateMap?, GetDialogTransmissionContentDto?>() - .ConvertUsing>(); + CreateMap?, ContentDto?>() + .ConvertUsing>(); - CreateMap(); - CreateMap() + CreateMap(); + CreateMap() .ForMember(dest => dest.ConsumerType, opt => opt.MapFrom(src => src.ConsumerTypeId)); } } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Get/GetDialogTransmissionDto.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Get/TransmissionDto.cs similarity index 87% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Get/GetDialogTransmissionDto.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Get/TransmissionDto.cs index 4e73ead084..9bbbce81d9 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Get/GetDialogTransmissionDto.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Get/TransmissionDto.cs @@ -6,7 +6,7 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.DialogTransmissions.Queries.Get; -public sealed class GetDialogTransmissionDto +public sealed class TransmissionDto { /// /// The unique identifier for the transmission in UUIDv7 format. @@ -46,20 +46,20 @@ public sealed class GetDialogTransmissionDto /// /// The sender actor information for the transmission. /// - public GetDialogTransmissionSenderActorDto Sender { get; set; } = null!; + public SenderActorDto Sender { get; set; } = null!; /// /// The content of the transmission. /// - public GetDialogTransmissionContentDto Content { get; set; } = null!; + public ContentDto Content { get; set; } = null!; /// /// The attachments associated with the transmission. /// - public List Attachments { get; set; } = []; + public List Attachments { get; set; } = []; } -public sealed class GetDialogTransmissionSenderActorDto +public sealed class SenderActorDto { /// /// The unique identifier for the sender actor in UUIDv7 format. @@ -82,7 +82,7 @@ public sealed class GetDialogTransmissionSenderActorDto public string ActorId { get; set; } = null!; } -public sealed class GetDialogTransmissionContentDto +public sealed class ContentDto { /// /// The title of the content. @@ -101,7 +101,7 @@ public sealed class GetDialogTransmissionContentDto public ContentValueDto? ContentReference { get; set; } } -public sealed class GetDialogTransmissionAttachmentDto +public sealed class AttachmentDto { /// /// The unique identifier for the attachment in UUIDv7 format. @@ -116,10 +116,10 @@ public sealed class GetDialogTransmissionAttachmentDto /// /// The URLs associated with the attachment, each referring to a different representation of the attachment. /// - public List Urls { get; set; } = []; + public List Urls { get; set; } = []; } -public sealed class GetDialogTransmissionAttachmentUrlDto +public sealed class AttachmentUrlDto { /// /// The unique identifier for the attachment URL in UUIDv7 format. diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Search/MappingProfile.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Search/MappingProfile.cs index 15437490fc..559a2a1b07 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Search/MappingProfile.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Search/MappingProfile.cs @@ -10,18 +10,18 @@ public sealed class MappingProfile : Profile { public MappingProfile() { - CreateMap() + CreateMap() .ForMember(dest => dest.Type, opt => opt.MapFrom(src => src.TypeId)) .ForMember(dest => dest.DeletedAt, opt => opt.MapFrom(src => src.Dialog.DeletedAt)); - CreateMap() + CreateMap() .ForMember(dest => dest.ActorType, opt => opt.MapFrom(src => src.ActorTypeId)); - CreateMap?, SearchDialogTransmissionContentDto?>() - .ConvertUsing>(); + CreateMap?, ContentDto?>() + .ConvertUsing>(); - CreateMap(); - CreateMap() + CreateMap(); + CreateMap() .ForMember(dest => dest.ConsumerType, opt => opt.MapFrom(src => src.ConsumerTypeId)); } } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Search/SearchDialogTransmissionQuery.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Search/SearchTransmissionQuery.cs similarity index 72% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Search/SearchDialogTransmissionQuery.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Search/SearchTransmissionQuery.cs index 6381cf4bd8..cb207e3bb5 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Search/SearchDialogTransmissionQuery.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Search/SearchTransmissionQuery.cs @@ -9,28 +9,28 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.DialogTransmissions.Queries.Search; -public sealed class SearchDialogTransmissionQuery : IRequest +public sealed class SearchTransmissionQuery : IRequest { public Guid DialogId { get; set; } } [GenerateOneOf] -public sealed partial class SearchDialogTransmissionResult : OneOfBase, EntityNotFound>; +public sealed partial class SearchTransmissionResult : OneOfBase, EntityNotFound>; -internal sealed class SearchDialogTransmissionQueryHandler : IRequestHandler +internal sealed class SearchTransmissionQueryHandler : IRequestHandler { private readonly IDialogDbContext _db; private readonly IMapper _mapper; private readonly IUserResourceRegistry _userResourceRegistry; - public SearchDialogTransmissionQueryHandler(IDialogDbContext db, IMapper mapper, IUserResourceRegistry userResourceRegistry) + public SearchTransmissionQueryHandler(IDialogDbContext db, IMapper mapper, IUserResourceRegistry userResourceRegistry) { _db = db ?? throw new ArgumentNullException(nameof(db)); _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); _userResourceRegistry = userResourceRegistry ?? throw new ArgumentNullException(nameof(userResourceRegistry)); } - public async Task Handle(SearchDialogTransmissionQuery request, CancellationToken cancellationToken) + public async Task Handle(SearchTransmissionQuery request, CancellationToken cancellationToken) { var resourceIds = await _userResourceRegistry.GetCurrentUserResourceIds(cancellationToken); @@ -52,7 +52,7 @@ public async Task Handle(SearchDialogTransmissio cancellationToken: cancellationToken); return dialog is null - ? (SearchDialogTransmissionResult)new EntityNotFound(request.DialogId) - : _mapper.Map>(dialog.Transmissions); + ? (SearchTransmissionResult)new EntityNotFound(request.DialogId) + : _mapper.Map>(dialog.Transmissions); } } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Search/SearchDialogTransmissionDto.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Search/TransmissionDto.cs similarity index 87% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Search/SearchDialogTransmissionDto.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Search/TransmissionDto.cs index 95de19045f..0a2cc431eb 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Search/SearchDialogTransmissionDto.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/DialogTransmissions/Queries/Search/TransmissionDto.cs @@ -6,7 +6,7 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.DialogTransmissions.Queries.Search; -public sealed class SearchDialogTransmissionDto +public sealed class TransmissionDto { /// /// The unique identifier for the transmission in UUIDv7 format. @@ -46,20 +46,20 @@ public sealed class SearchDialogTransmissionDto /// /// The sender actor information for the transmission. /// - public SearchDialogTransmissionSenderActorDto Sender { get; set; } = null!; + public SenderActorDto Sender { get; set; } = null!; /// /// The content of the transmission. /// - public SearchDialogTransmissionContentDto Content { get; set; } = null!; + public ContentDto Content { get; set; } = null!; /// /// The attachments associated with the transmission. /// - public List Attachments { get; set; } = []; + public List Attachments { get; set; } = []; } -public sealed class SearchDialogTransmissionSenderActorDto +public sealed class SenderActorDto { /// /// The unique identifier for the sender actor in UUIDv7 format. @@ -82,7 +82,7 @@ public sealed class SearchDialogTransmissionSenderActorDto public string ActorId { get; set; } = null!; } -public sealed class SearchDialogTransmissionContentDto +public sealed class ContentDto { /// /// The title of the content. @@ -100,7 +100,7 @@ public sealed class SearchDialogTransmissionContentDto public ContentValueDto? ContentReference { get; set; } } -public sealed class SearchDialogTransmissionAttachmentDto +public sealed class AttachmentDto { /// /// The unique identifier for the attachment in UUIDv7 format. @@ -115,10 +115,10 @@ public sealed class SearchDialogTransmissionAttachmentDto /// /// The URLs associated with the attachment, each referring to a different representation of the attachment. /// - public List Urls { get; set; } = []; + public List Urls { get; set; } = []; } -public sealed class SearchDialogTransmissionAttachmentUrlDto +public sealed class AttachmentUrlDto { /// /// The unique identifier for the attachment URL in UUIDv7 format. diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Create/CreateDialogCommandValidator.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Create/CreateDialogCommandValidator.cs index 8c24c27ea3..4f04c7a759 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Create/CreateDialogCommandValidator.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Create/CreateDialogCommandValidator.cs @@ -19,13 +19,13 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.Dialog internal sealed class CreateDialogCommandValidator : AbstractValidator { public CreateDialogCommandValidator( - IValidator transmissionValidator, - IValidator attachmentValidator, - IValidator guiActionValidator, - IValidator apiActionValidator, - IValidator activityValidator, - IValidator searchTagValidator, - IValidator contentValidator) + IValidator transmissionValidator, + IValidator attachmentValidator, + IValidator guiActionValidator, + IValidator apiActionValidator, + IValidator activityValidator, + IValidator searchTagValidator, + IValidator contentValidator) { RuleFor(x => x.Id) .IsValidUuidV7() @@ -147,12 +147,12 @@ public CreateDialogCommandValidator( } } -internal sealed class CreateDialogDialogTransmissionDtoValidator : AbstractValidator +internal sealed class CreateDialogDialogTransmissionDtoValidator : AbstractValidator { public CreateDialogDialogTransmissionDtoValidator( - IValidator actorValidator, - IValidator contentValidator, - IValidator attachmentValidator) + IValidator actorValidator, + IValidator contentValidator, + IValidator attachmentValidator) { RuleFor(x => x.Id) .IsValidUuidV7() @@ -182,10 +182,10 @@ public CreateDialogDialogTransmissionDtoValidator( } } -internal sealed class CreateDialogContentDtoValidator : AbstractValidator +internal sealed class CreateDialogContentDtoValidator : AbstractValidator { private static readonly NullabilityInfoContext Context = new(); - private static readonly Dictionary SourcePropertyMetaDataByName = typeof(CreateDialogContentDto) + private static readonly Dictionary SourcePropertyMetaDataByName = typeof(ContentDto) .GetProperties() .Select(x => { @@ -223,10 +223,10 @@ public CreateDialogContentDtoValidator(IUser? user) } } -internal sealed class CreateDialogDialogTransmissionContentDtoValidator : AbstractValidator +internal sealed class CreateDialogDialogTransmissionContentDtoValidator : AbstractValidator { private static readonly NullabilityInfoContext Context = new(); - private static readonly Dictionary SourcePropertyMetaDataByName = typeof(CreateDialogDialogTransmissionContentDto) + private static readonly Dictionary SourcePropertyMetaDataByName = typeof(TransmissionContentDto) .GetProperties() .Select(x => { @@ -264,11 +264,11 @@ public CreateDialogDialogTransmissionContentDtoValidator() } } -internal sealed class CreateDialogDialogAttachmentDtoValidator : AbstractValidator +internal sealed class CreateDialogDialogAttachmentDtoValidator : AbstractValidator { public CreateDialogDialogAttachmentDtoValidator( IValidator> localizationsValidator, - IValidator urlValidator) + IValidator urlValidator) { RuleFor(x => x.DisplayName) .SetValidator(localizationsValidator); @@ -278,7 +278,7 @@ public CreateDialogDialogAttachmentDtoValidator( } } -internal sealed class CreateDialogDialogAttachmentUrlDtoValidator : AbstractValidator +internal sealed class CreateDialogDialogAttachmentUrlDtoValidator : AbstractValidator { public CreateDialogDialogAttachmentUrlDtoValidator() { @@ -291,11 +291,11 @@ public CreateDialogDialogAttachmentUrlDtoValidator() } } -internal sealed class CreateDialogTransmissionAttachmentDtoValidator : AbstractValidator +internal sealed class CreateDialogTransmissionAttachmentDtoValidator : AbstractValidator { public CreateDialogTransmissionAttachmentDtoValidator( IValidator> localizationsValidator, - IValidator urlValidator) + IValidator urlValidator) { RuleFor(x => x.Id) .IsValidUuidV7() @@ -309,7 +309,7 @@ public CreateDialogTransmissionAttachmentDtoValidator( } } -internal sealed class CreateDialogTransmissionAttachmentUrlDtoValidator : AbstractValidator +internal sealed class CreateDialogTransmissionAttachmentUrlDtoValidator : AbstractValidator { public CreateDialogTransmissionAttachmentUrlDtoValidator() { @@ -322,7 +322,7 @@ public CreateDialogTransmissionAttachmentUrlDtoValidator() } } -internal sealed class CreateDialogSearchTagDtoValidator : AbstractValidator +internal sealed class CreateDialogSearchTagDtoValidator : AbstractValidator { public CreateDialogSearchTagDtoValidator() { @@ -332,7 +332,7 @@ public CreateDialogSearchTagDtoValidator() } } -internal sealed class CreateDialogDialogGuiActionDtoValidator : AbstractValidator +internal sealed class CreateDialogDialogGuiActionDtoValidator : AbstractValidator { public CreateDialogDialogGuiActionDtoValidator( IValidator> localizationsValidator) @@ -361,10 +361,10 @@ public CreateDialogDialogGuiActionDtoValidator( } } -internal sealed class CreateDialogDialogApiActionDtoValidator : AbstractValidator +internal sealed class CreateDialogDialogApiActionDtoValidator : AbstractValidator { public CreateDialogDialogApiActionDtoValidator( - IValidator apiActionEndpointValidator) + IValidator apiActionEndpointValidator) { RuleFor(x => x.Action) .NotEmpty() @@ -377,7 +377,7 @@ public CreateDialogDialogApiActionDtoValidator( } } -internal sealed class CreateDialogDialogApiActionEndpointDtoValidator : AbstractValidator +internal sealed class CreateDialogDialogApiActionEndpointDtoValidator : AbstractValidator { public CreateDialogDialogApiActionEndpointDtoValidator() { @@ -400,16 +400,16 @@ public CreateDialogDialogApiActionEndpointDtoValidator() .MaximumLength(Constants.DefaultMaxUriLength); RuleFor(x => x.Deprecated) .Equal(true) - .WithMessage($"'{{PropertyName}}' must be equal to 'True' when {nameof(CreateDialogDialogApiActionEndpointDto.SunsetAt)} is set.") + .WithMessage($"'{{PropertyName}}' must be equal to 'True' when {nameof(ApiActionEndpointDto.SunsetAt)} is set.") .When(x => x.SunsetAt.HasValue); } } -internal sealed class CreateDialogDialogActivityDtoValidator : AbstractValidator +internal sealed class CreateDialogDialogActivityDtoValidator : AbstractValidator { public CreateDialogDialogActivityDtoValidator( IValidator> localizationsValidator, - IValidator actorValidator) + IValidator actorValidator) { RuleFor(x => x.Id) .IsValidUuidV7() @@ -444,7 +444,7 @@ public CreateDialogDialogActivityDtoValidator( } } -internal sealed class CreateDialogDialogTransmissionActorDtoValidator : AbstractValidator +internal sealed class CreateDialogDialogTransmissionActorDtoValidator : AbstractValidator { public CreateDialogDialogTransmissionActorDtoValidator() { @@ -463,7 +463,7 @@ public CreateDialogDialogTransmissionActorDtoValidator() } } -internal sealed class CreateDialogDialogActivityActorDtoValidator : AbstractValidator +internal sealed class CreateDialogDialogActivityActorDtoValidator : AbstractValidator { public CreateDialogDialogActivityActorDtoValidator() { diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Create/CreateDialogDto.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Create/CreateDialogDto.cs index d7e75b3296..1458d12a51 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Create/CreateDialogDto.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Create/CreateDialogDto.cs @@ -110,40 +110,40 @@ public class CreateDialogDto /// /// The dialog unstructured text content. /// - public CreateDialogContentDto Content { get; set; } = null!; + public ContentDto Content { get; set; } = null!; /// /// A list of words (tags) that will be used in dialog search queries. Not visible in end-user DTO. /// - public List SearchTags { get; set; } = []; + public List SearchTags { get; set; } = []; /// /// The attachments associated with the dialog (on an aggregate level). /// - public List Attachments { get; set; } = []; + public List Attachments { get; set; } = []; /// /// The immutable list of transmissions associated with the dialog. /// - public List Transmissions { get; set; } = []; + public List Transmissions { get; set; } = []; /// /// The GUI actions associated with the dialog. Should be used in browser-based interactive frontends. /// - public List GuiActions { get; set; } = []; + public List GuiActions { get; set; } = []; /// /// The API actions associated with the dialog. Should be used in specialized, non-browser-based integrations. /// - public List ApiActions { get; set; } = []; + public List ApiActions { get; set; } = []; /// /// An immutable list of activities associated with the dialog. /// - public List Activities { get; set; } = []; + public List Activities { get; set; } = []; } -public sealed class CreateDialogDialogTransmissionDto +public sealed class TransmissionDto { /// /// A self-defined UUIDv7 may be provided to support idempotent creation of transmissions. If not provided, a new UUIDv7 will be generated. @@ -193,20 +193,20 @@ public sealed class CreateDialogDialogTransmissionDto /// /// The actor that sent the transmission. /// - public CreateDialogDialogTransmissionSenderActorDto Sender { get; set; } = null!; + public TransmissionSenderActorDto Sender { get; set; } = null!; /// /// The transmission unstructured text content. /// - public CreateDialogDialogTransmissionContentDto Content { get; set; } = null!; + public TransmissionContentDto Content { get; set; } = null!; /// /// The transmission-level attachments. /// - public List Attachments { get; set; } = []; + public List Attachments { get; set; } = []; } -public sealed class CreateDialogContentDto +public sealed class ContentDto { /// /// The title of the dialog. @@ -245,7 +245,7 @@ public sealed class CreateDialogContentDto public ContentValueDto? MainContentReference { get; set; } } -public sealed class CreateDialogDialogTransmissionContentDto +public sealed class TransmissionContentDto { /// /// The transmission title. Must be text/plain. @@ -264,7 +264,7 @@ public sealed class CreateDialogDialogTransmissionContentDto public ContentValueDto? ContentReference { get; set; } } -public sealed class CreateDialogSearchTagDto +public sealed class SearchTagDto { /// /// A search tag value. @@ -272,7 +272,7 @@ public sealed class CreateDialogSearchTagDto public string Value { get; set; } = null!; } -public sealed class CreateDialogDialogActivityDto +public sealed class ActivityDto { /// /// A self-defined UUIDv7 may be provided to support idempotent creation of activities. If not provided, a new UUIDv7 will be generated. @@ -305,7 +305,7 @@ public sealed class CreateDialogDialogActivityDto /// /// The actor that performed the activity. /// - public CreateDialogDialogActivityPerformedByActorDto PerformedBy { get; set; } = null!; + public ActivityPerformedByActorDto PerformedBy { get; set; } = null!; /// /// Unstructured text describing the activity. Only set if the activity type is "Information". @@ -313,7 +313,7 @@ public sealed class CreateDialogDialogActivityDto public List Description { get; set; } = []; } -public sealed class CreateDialogDialogActivityPerformedByActorDto +public sealed class ActivityPerformedByActorDto { /// /// What type of actor performed the activity. @@ -335,7 +335,7 @@ public sealed class CreateDialogDialogActivityPerformedByActorDto public string? ActorId { get; set; } } -public sealed class CreateDialogDialogTransmissionSenderActorDto +public sealed class TransmissionSenderActorDto { /// /// The type of actor that sent the transmission. @@ -357,7 +357,7 @@ public sealed class CreateDialogDialogTransmissionSenderActorDto public string? ActorId { get; set; } } -public sealed class CreateDialogDialogApiActionDto +public sealed class ApiActionDto { /// /// String identifier for the action, corresponding to the "action" attributeId used in the XACML service policy, @@ -385,10 +385,10 @@ public sealed class CreateDialogDialogApiActionDto /// /// The endpoints associated with the action. /// - public List Endpoints { get; set; } = []; + public List Endpoints { get; set; } = []; } -public sealed class CreateDialogDialogApiActionEndpointDto +public sealed class ApiActionEndpointDto { /// /// Arbitrary string indicating the version of the endpoint. @@ -435,7 +435,7 @@ public sealed class CreateDialogDialogApiActionEndpointDto public DateTimeOffset? SunsetAt { get; set; } } -public sealed class CreateDialogDialogGuiActionDto +public sealed class GuiActionDto { /// /// The action identifier for the action, corresponding to the "action" attributeId used in the XACML service policy. @@ -497,7 +497,7 @@ public sealed class CreateDialogDialogGuiActionDto public List? Prompt { get; set; } } -public sealed class CreateDialogDialogAttachmentDto +public sealed class AttachmentDto { /// /// The display name of the attachment that should be used in GUIs. @@ -507,10 +507,10 @@ public sealed class CreateDialogDialogAttachmentDto /// /// The URLs associated with the attachment, each referring to a different representation of the attachment. /// - public List Urls { get; set; } = []; + public List Urls { get; set; } = []; } -public sealed class CreateDialogDialogAttachmentUrlDto +public sealed class AttachmentUrlDto { /// /// The fully qualified URL of the attachment. @@ -532,7 +532,7 @@ public sealed class CreateDialogDialogAttachmentUrlDto public AttachmentUrlConsumerType.Values ConsumerType { get; set; } } -public sealed class CreateDialogTransmissionAttachmentDto +public sealed class TransmissionAttachmentDto { /// /// A self-defined UUIDv7 may be provided to support idempotent creation of transmission attachments. If not provided, a new UUIDv7 will be generated. @@ -548,10 +548,10 @@ public sealed class CreateDialogTransmissionAttachmentDto /// /// The URLs associated with the attachment, each referring to a different representation of the attachment. /// - public List Urls { get; set; } = []; + public List Urls { get; set; } = []; } -public sealed class CreateDialogTransmissionAttachmentUrlDto +public sealed class TransmissionAttachmentUrlDto { /// /// The fully qualified URL of the attachment. diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Create/MappingProfile.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Create/MappingProfile.cs index 6549fa1d55..abc884a5fa 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Create/MappingProfile.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Create/MappingProfile.cs @@ -17,49 +17,49 @@ public MappingProfile() CreateMap() .ForMember(dest => dest.Status, opt => opt.Ignore()) .ForMember(dest => dest.StatusId, opt => opt.MapFrom(src => src.Status)); - CreateMap(); + CreateMap(); - CreateMap(); - CreateMap() + CreateMap(); + CreateMap() .ForMember(dest => dest.ConsumerType, opt => opt.Ignore()) .ForMember(dest => dest.ConsumerTypeId, opt => opt.MapFrom(src => src.ConsumerType)); - CreateMap() + CreateMap() .ForMember(dest => dest.Priority, opt => opt.Ignore()) .ForMember(dest => dest.PriorityId, opt => opt.MapFrom(src => src.Priority)) .ForMember(dest => dest.HttpMethod, opt => opt.Ignore()) .ForMember(dest => dest.HttpMethodId, opt => opt.MapFrom(src => src.HttpMethod)); - CreateMap(); + CreateMap(); - CreateMap() + CreateMap() .ForMember(dest => dest.HttpMethod, opt => opt.Ignore()) .ForMember(dest => dest.HttpMethodId, opt => opt.MapFrom(src => src.HttpMethod)); - CreateMap() + CreateMap() .ForMember(dest => dest.Type, opt => opt.Ignore()) .ForMember(dest => dest.TypeId, opt => opt.MapFrom(src => src.Type)); - CreateMap() + CreateMap() .ForMember(dest => dest.ActorType, opt => opt.Ignore()) .ForMember(dest => dest.ActorTypeId, opt => opt.MapFrom(src => src.ActorType)); - CreateMap?>() - .ConvertUsing>(); + CreateMap?>() + .ConvertUsing>(); - CreateMap?>() - .ConvertUsing>(); + CreateMap?>() + .ConvertUsing>(); - CreateMap() + CreateMap() .ForMember(dest => dest.ActorType, opt => opt.Ignore()) .ForMember(dest => dest.ActorTypeId, opt => opt.MapFrom(src => src.ActorType)); - CreateMap() + CreateMap() .ForMember(dest => dest.Type, opt => opt.Ignore()) .ForMember(dest => dest.TypeId, opt => opt.MapFrom(src => src.Type)); - CreateMap(); - CreateMap() + CreateMap(); + CreateMap() .ForMember(dest => dest.ConsumerType, opt => opt.Ignore()) .ForMember(dest => dest.ConsumerTypeId, opt => opt.MapFrom(src => src.ConsumerType)); } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Update/MappingProfile.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Update/MappingProfile.cs index aa7d94d00b..d13fd80f0a 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Update/MappingProfile.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Update/MappingProfile.cs @@ -25,21 +25,21 @@ public MappingProfile() .ForMember(dest => dest.StatusId, opt => opt.MapFrom(src => src.Status)) .ForMember(dest => dest.Content, opt => opt.MapFrom(src => src.Content)); - CreateMap() + CreateMap() .IgnoreComplexDestinationProperties() .ForMember(x => x.Id, opt => opt.Ignore()); - CreateMap() + CreateMap() .IgnoreComplexDestinationProperties() .ForMember(x => x.Id, opt => opt.Ignore()); - CreateMap() + CreateMap() .IgnoreComplexDestinationProperties() .ForMember(x => x.Id, opt => opt.Ignore()) .ForMember(dest => dest.HttpMethod, opt => opt.Ignore()) .ForMember(dest => dest.HttpMethodId, opt => opt.MapFrom(src => src.HttpMethod)); - CreateMap() + CreateMap() .IgnoreComplexDestinationProperties() .ForMember(x => x.Id, opt => opt.Ignore()) .ForMember(dest => dest.Priority, opt => opt.Ignore()) @@ -47,43 +47,43 @@ public MappingProfile() .ForMember(dest => dest.HttpMethod, opt => opt.Ignore()) .ForMember(dest => dest.HttpMethodId, opt => opt.MapFrom(src => src.HttpMethod)); - CreateMap() + CreateMap() .IgnoreComplexDestinationProperties() .ForMember(x => x.Id, opt => opt.Ignore()); - CreateMap() + CreateMap() .IgnoreComplexDestinationProperties() .ForMember(x => x.Id, opt => opt.Ignore()) .ForMember(dest => dest.ConsumerType, opt => opt.Ignore()) .ForMember(dest => dest.ConsumerTypeId, opt => opt.MapFrom(src => src.ConsumerType)); - CreateMap?>() - .ConvertUsing>(); + CreateMap?>() + .ConvertUsing>(); // Since these are append-only, we don't need to merge with existing // activity/transmission records and thus can map complex properties - CreateMap() + CreateMap() .ForMember(dest => dest.Type, opt => opt.Ignore()) .ForMember(dest => dest.TypeId, opt => opt.MapFrom(src => src.Type)); - CreateMap() + CreateMap() .ForMember(dest => dest.ActorType, opt => opt.Ignore()) .ForMember(dest => dest.ActorTypeId, opt => opt.MapFrom(src => src.ActorType)); - CreateMap() + CreateMap() .ForMember(dest => dest.Type, opt => opt.Ignore()) .ForMember(dest => dest.TypeId, opt => opt.MapFrom(src => src.Type)); - CreateMap?>() - .ConvertUsing>(); + CreateMap?>() + .ConvertUsing>(); - CreateMap() + CreateMap() .ForMember(dest => dest.ActorType, opt => opt.Ignore()) .ForMember(dest => dest.ActorTypeId, opt => opt.MapFrom(src => src.ActorType)); - CreateMap(); + CreateMap(); - CreateMap() + CreateMap() .ForMember(x => x.Id, opt => opt.Ignore()) .ForMember(dest => dest.ConsumerType, opt => opt.Ignore()) .ForMember(dest => dest.ConsumerTypeId, opt => opt.MapFrom(src => src.ConsumerType)); @@ -91,19 +91,19 @@ public MappingProfile() // =========================================== // ================== Patch ================== // =========================================== - CreateMap() + CreateMap() // Remove all existing activities and transmissions, since these lists are append only and // existing activities/transmissions should not be considered in the update request. .ForMember(dest => dest.Activities, opt => opt.Ignore()) .ForMember(dest => dest.Transmissions, opt => opt.Ignore()); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); } } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Update/UpdateDialogCommand.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Update/UpdateDialogCommand.cs index f247a3f81e..52cad684ed 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Update/UpdateDialogCommand.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Update/UpdateDialogCommand.cs @@ -283,7 +283,7 @@ private async Task AppendTransmission(DialogEntity dialog, UpdateDialogDto dto, _db.DialogTransmissions.AddRange(newDialogTransmissions); } - private IEnumerable CreateApiActions(IEnumerable creatables) + private IEnumerable CreateApiActions(IEnumerable creatables) { return creatables.Select(x => { @@ -293,7 +293,7 @@ private IEnumerable CreateApiActions(IEnumerable> updateSets) + private void UpdateApiActions(IEnumerable> updateSets) { foreach (var (source, destination) in updateSets) { @@ -309,7 +309,7 @@ private void UpdateApiActions(IEnumerable CreateAttachments(IEnumerable creatables) + private IEnumerable CreateAttachments(IEnumerable creatables) { return creatables.Select(attachmentDto => { @@ -319,7 +319,7 @@ private IEnumerable CreateAttachments(IEnumerable> updateSets) + private void UpdateAttachments(IEnumerable> updateSets) { foreach (var updateSet in updateSets) { diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Update/UpdateDialogCommandValidator.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Update/UpdateDialogCommandValidator.cs index c7d65daada..8778a3550a 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Update/UpdateDialogCommandValidator.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Update/UpdateDialogCommandValidator.cs @@ -31,13 +31,13 @@ public UpdateDialogCommandValidator(IValidator updateDialogDtoV internal sealed class UpdateDialogDtoValidator : AbstractValidator { public UpdateDialogDtoValidator( - IValidator transmissionValidator, - IValidator attachmentValidator, - IValidator guiActionValidator, - IValidator apiActionValidator, - IValidator activityValidator, - IValidator searchTagValidator, - IValidator contentValidator) + IValidator transmissionValidator, + IValidator attachmentValidator, + IValidator guiActionValidator, + IValidator apiActionValidator, + IValidator activityValidator, + IValidator searchTagValidator, + IValidator contentValidator) { RuleFor(x => x.Progress) .InclusiveBetween(0, 100); @@ -108,11 +108,11 @@ public UpdateDialogDtoValidator( } } -internal sealed class UpdateDialogTransmissionAttachmentDtoValidator : AbstractValidator +internal sealed class UpdateDialogTransmissionAttachmentDtoValidator : AbstractValidator { public UpdateDialogTransmissionAttachmentDtoValidator( IValidator> localizationsValidator, - IValidator urlValidator) + IValidator urlValidator) { RuleFor(x => x.Id) .IsValidUuidV7() @@ -126,7 +126,7 @@ public UpdateDialogTransmissionAttachmentDtoValidator( } } -internal sealed class UpdateDialogTransmissionAttachmentUrlDtoValidator : AbstractValidator +internal sealed class UpdateDialogTransmissionAttachmentUrlDtoValidator : AbstractValidator { public UpdateDialogTransmissionAttachmentUrlDtoValidator() { @@ -139,7 +139,7 @@ public UpdateDialogTransmissionAttachmentUrlDtoValidator() } } -internal sealed class UpdateDialogDialogTransmissionActorDtoValidator : AbstractValidator +internal sealed class UpdateDialogDialogTransmissionActorDtoValidator : AbstractValidator { public UpdateDialogDialogTransmissionActorDtoValidator() { @@ -158,10 +158,10 @@ public UpdateDialogDialogTransmissionActorDtoValidator() } } -internal sealed class UpdateDialogDialogTransmissionContentDtoValidator : AbstractValidator +internal sealed class UpdateDialogDialogTransmissionContentDtoValidator : AbstractValidator { private static readonly NullabilityInfoContext Context = new(); - private static readonly Dictionary SourcePropertyMetaDataByName = typeof(UpdateDialogDialogTransmissionContentDto) + private static readonly Dictionary SourcePropertyMetaDataByName = typeof(TransmissionContentDto) .GetProperties() .Select(x => { @@ -198,12 +198,12 @@ public UpdateDialogDialogTransmissionContentDtoValidator() } } -internal sealed class UpdateDialogDialogTransmissionDtoValidator : AbstractValidator +internal sealed class UpdateDialogDialogTransmissionDtoValidator : AbstractValidator { public UpdateDialogDialogTransmissionDtoValidator( - IValidator actorValidator, - IValidator contentValidator, - IValidator attachmentValidator) + IValidator actorValidator, + IValidator contentValidator, + IValidator attachmentValidator) { RuleFor(x => x.Id) .IsValidUuidV7() @@ -233,11 +233,11 @@ public UpdateDialogDialogTransmissionDtoValidator( } } -internal sealed class UpdateDialogContentDtoValidator : AbstractValidator +internal sealed class UpdateDialogContentDtoValidator : AbstractValidator { private static readonly NullabilityInfoContext Context = new(); private static readonly Dictionary SourcePropertyMetaDataByName = - typeof(UpdateDialogContentDto).GetProperties() + typeof(ContentDto).GetProperties() .Select(x => { var nullabilityInfo = Context.Create(x); @@ -273,11 +273,11 @@ public UpdateDialogContentDtoValidator(IUser? user) } } -internal sealed class UpdateDialogDialogAttachmentDtoValidator : AbstractValidator +internal sealed class UpdateDialogDialogAttachmentDtoValidator : AbstractValidator { public UpdateDialogDialogAttachmentDtoValidator( IValidator> localizationsValidator, - IValidator urlValidator) + IValidator urlValidator) { RuleFor(x => x.Id) .IsValidUuidV7() @@ -292,7 +292,7 @@ public UpdateDialogDialogAttachmentDtoValidator( } } -internal sealed class UpdateDialogDialogAttachmentUrlDtoValidator : AbstractValidator +internal sealed class UpdateDialogDialogAttachmentUrlDtoValidator : AbstractValidator { public UpdateDialogDialogAttachmentUrlDtoValidator() { @@ -305,7 +305,7 @@ public UpdateDialogDialogAttachmentUrlDtoValidator() } } -internal sealed class UpdateDialogSearchTagDtoValidator : AbstractValidator +internal sealed class UpdateDialogSearchTagDtoValidator : AbstractValidator { public UpdateDialogSearchTagDtoValidator() { @@ -315,7 +315,7 @@ public UpdateDialogSearchTagDtoValidator() } } -internal sealed class UpdateDialogDialogGuiActionDtoValidator : AbstractValidator +internal sealed class UpdateDialogDialogGuiActionDtoValidator : AbstractValidator { public UpdateDialogDialogGuiActionDtoValidator( IValidator> localizationsValidator) @@ -344,10 +344,10 @@ public UpdateDialogDialogGuiActionDtoValidator( } } -internal sealed class UpdateDialogDialogApiActionDtoValidator : AbstractValidator +internal sealed class UpdateDialogDialogApiActionDtoValidator : AbstractValidator { public UpdateDialogDialogApiActionDtoValidator( - IValidator apiActionEndpointValidator) + IValidator apiActionEndpointValidator) { RuleFor(x => x.Action) .NotEmpty() @@ -362,7 +362,7 @@ public UpdateDialogDialogApiActionDtoValidator( } } -internal sealed class UpdateDialogDialogApiActionEndpointDtoValidator : AbstractValidator +internal sealed class UpdateDialogDialogApiActionEndpointDtoValidator : AbstractValidator { public UpdateDialogDialogApiActionEndpointDtoValidator() { @@ -385,16 +385,16 @@ public UpdateDialogDialogApiActionEndpointDtoValidator() .MaximumLength(Constants.DefaultMaxUriLength); RuleFor(x => x.Deprecated) .Equal(true) - .WithMessage($"'{{PropertyName}}' must be equal to 'True' when {nameof(UpdateDialogDialogApiActionEndpointDto.SunsetAt)} is set.") + .WithMessage($"'{{PropertyName}}' must be equal to 'True' when {nameof(ApiActionEndpointDto.SunsetAt)} is set.") .When(x => x.SunsetAt.HasValue); } } -internal sealed class UpdateDialogDialogActivityDtoValidator : AbstractValidator +internal sealed class UpdateDialogDialogActivityDtoValidator : AbstractValidator { public UpdateDialogDialogActivityDtoValidator( IValidator> localizationsValidator, - IValidator actorValidator) + IValidator actorValidator) { RuleFor(x => x.Id) .IsValidUuidV7() @@ -429,7 +429,7 @@ public UpdateDialogDialogActivityDtoValidator( } } -internal sealed class UpdateDialogDialogActivityActorDtoValidator : AbstractValidator +internal sealed class UpdateDialogDialogActivityActorDtoValidator : AbstractValidator { public UpdateDialogDialogActivityActorDtoValidator() { diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Update/UpdateDialogDto.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Update/UpdateDialogDto.cs index fb3cdd3d6a..f65c6347ea 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Update/UpdateDialogDto.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Update/UpdateDialogDto.cs @@ -59,42 +59,42 @@ public sealed class UpdateDialogDto /// /// The dialog unstructured text content. /// - public UpdateDialogContentDto Content { get; set; } = null!; + public ContentDto Content { get; set; } = null!; /// /// A list of words (tags) that will be used in dialog search queries. Not visible in end-user DTO. /// - public List SearchTags { get; set; } = []; + public List SearchTags { get; set; } = []; /// /// The attachments associated with the dialog (on an aggregate level). /// - public List Attachments { get; set; } = []; + public List Attachments { get; set; } = []; /// /// The immutable list of transmissions associated with the dialog. When updating via PUT, any transmissions /// added here will be appended to the existing list of transmissions. /// - public List Transmissions { get; set; } = []; + public List Transmissions { get; set; } = []; /// /// The GUI actions associated with the dialog. Should be used in browser-based interactive frontends. /// - public List GuiActions { get; set; } = []; + public List GuiActions { get; set; } = []; /// /// The API actions associated with the dialog. Should be used in specialized, non-browser-based integrations. /// - public List ApiActions { get; set; } = []; + public List ApiActions { get; set; } = []; /// /// An immutable list of activities associated with the dialog. When updating via PUT, any activities added here /// will be appended to the existing list of activities. /// - public List Activities { get; set; } = []; + public List Activities { get; set; } = []; } -public class UpdateDialogDialogTransmissionDto +public class TransmissionDto { /// /// The UUDIv7 of the action may be provided to support idempotent additions to the list of transmissions. @@ -145,20 +145,20 @@ public class UpdateDialogDialogTransmissionDto /// /// The actor that sent the transmission. /// - public UpdateDialogDialogTransmissionSenderActorDto Sender { get; set; } = null!; + public TransmissionSenderActorDto Sender { get; set; } = null!; /// /// The transmission unstructured text content. /// - public UpdateDialogDialogTransmissionContentDto Content { get; set; } = null!; + public TransmissionContentDto Content { get; set; } = null!; /// /// The transmission-level attachments. /// - public List Attachments { get; set; } = []; + public List Attachments { get; set; } = []; } -public sealed class UpdateDialogDialogTransmissionContentDto +public sealed class TransmissionContentDto { /// /// The transmission title. Must be text/plain. @@ -177,7 +177,7 @@ public sealed class UpdateDialogDialogTransmissionContentDto public ContentValueDto? ContentReference { get; set; } } -public sealed class UpdateDialogDialogTransmissionSenderActorDto +public sealed class TransmissionSenderActorDto { /// /// The type of actor that sent the transmission. @@ -199,7 +199,7 @@ public sealed class UpdateDialogDialogTransmissionSenderActorDto public string? ActorId { get; set; } } -public sealed class UpdateDialogContentDto +public sealed class ContentDto { /// /// The title of the dialog. Must be text/plain. @@ -232,7 +232,7 @@ public sealed class UpdateDialogContentDto public ContentValueDto? MainContentReference { get; set; } } -public sealed class UpdateDialogSearchTagDto +public sealed class SearchTagDto { /// /// A search tag value. @@ -240,7 +240,7 @@ public sealed class UpdateDialogSearchTagDto public string Value { get; set; } = null!; } -public class UpdateDialogDialogActivityDto +public class ActivityDto { /// /// The UUDIv7 of the action may be provided to support idempotent additions to the list of activities. @@ -274,7 +274,7 @@ public class UpdateDialogDialogActivityDto /// /// The actor that performed the activity. /// - public UpdateDialogDialogActivityPerformedByActorDto PerformedBy { get; set; } = null!; + public ActivityPerformedByActorDto PerformedBy { get; set; } = null!; /// /// Unstructured text describing the activity. Only set if the activity type is "Information". @@ -282,7 +282,7 @@ public class UpdateDialogDialogActivityDto public List Description { get; set; } = []; } -public sealed class UpdateDialogDialogActivityPerformedByActorDto +public sealed class ActivityPerformedByActorDto { /// /// What type of actor performed the activity. @@ -304,7 +304,7 @@ public sealed class UpdateDialogDialogActivityPerformedByActorDto public string? ActorId { get; set; } } -public sealed class UpdateDialogDialogApiActionDto +public sealed class ApiActionDto { /// /// A UUIDv7 used for merging existing data, unknown IDs will be ignored as this entity does not support user-defined IDs. @@ -338,10 +338,10 @@ public sealed class UpdateDialogDialogApiActionDto /// /// The endpoints associated with the action. /// - public List Endpoints { get; set; } = []; + public List Endpoints { get; set; } = []; } -public sealed class UpdateDialogDialogApiActionEndpointDto +public sealed class ApiActionEndpointDto { /// /// A UUIDv7 used for merging existing data, unknown IDs will be ignored as this entity does not support user-defined IDs. @@ -394,7 +394,7 @@ public sealed class UpdateDialogDialogApiActionEndpointDto public DateTimeOffset? SunsetAt { get; set; } } -public sealed class UpdateDialogDialogGuiActionDto +public sealed class GuiActionDto { /// /// A UUIDv7 used for merging existing data, unknown IDs will be ignored as this entity does not support user-defined IDs. @@ -462,7 +462,7 @@ public sealed class UpdateDialogDialogGuiActionDto public List? Prompt { get; set; } } -public sealed class UpdateDialogDialogAttachmentDto +public sealed class AttachmentDto { /// /// A UUIDv7 used for merging existing data, unknown IDs will be ignored as this entity does not support user-defined IDs. @@ -478,10 +478,10 @@ public sealed class UpdateDialogDialogAttachmentDto /// /// The URLs associated with the attachment, each referring to a different representation of the attachment. /// - public List Urls { get; set; } = []; + public List Urls { get; set; } = []; } -public sealed class UpdateDialogDialogAttachmentUrlDto +public sealed class AttachmentUrlDto { /// /// A UUIDv7 used for merging existing data, unknown IDs will be ignored as this entity does not support user-defined IDs. @@ -509,7 +509,7 @@ public sealed class UpdateDialogDialogAttachmentUrlDto public AttachmentUrlConsumerType.Values ConsumerType { get; set; } } -public sealed class UpdateDialogTransmissionAttachmentDto +public sealed class TransmissionAttachmentDto { /// /// A self-defined UUIDv7 may be provided to support idempotent creation of transmission attachments. If not provided, a new UUIDv7 will be generated. @@ -525,10 +525,10 @@ public sealed class UpdateDialogTransmissionAttachmentDto /// /// The URLs associated with the attachment, each referring to a different representation of the attachment. /// - public List Urls { get; set; } = []; + public List Urls { get; set; } = []; } -public sealed class UpdateDialogTransmissionAttachmentUrlDto +public sealed class TransmissionAttachmentUrlDto { /// /// The fully qualified URL of the attachment. diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Get/GetDialogDto.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Get/DialogDto.cs similarity index 91% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Get/GetDialogDto.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Get/DialogDto.cs index 8b067b71fb..84bc3ae9c6 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Get/GetDialogDto.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Get/DialogDto.cs @@ -11,7 +11,7 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.Dialogs.Queries.Get; -public sealed class GetDialogDto +public sealed class DialogDto { /// /// The unique identifier for the dialog in UUIDv7 format. @@ -136,45 +136,45 @@ public sealed class GetDialogDto /// /// The dialog unstructured text content. /// - public GetDialogContentDto Content { get; set; } = null!; + public ContentDto Content { get; set; } = null!; /// /// The list of words (tags) that will be used in dialog search queries. Not visible in end-user DTO. /// - public List? SearchTags { get; set; } + public List? SearchTags { get; set; } /// /// The attachments associated with the dialog (on an aggregate level). /// - public List Attachments { get; set; } = []; + public List Attachments { get; set; } = []; /// /// The immutable list of transmissions associated with the dialog. /// - public List Transmissions { get; set; } = []; + public List Transmissions { get; set; } = []; /// /// The GUI actions associated with the dialog. Should be used in browser-based interactive frontends. /// - public List GuiActions { get; set; } = []; + public List GuiActions { get; set; } = []; /// /// The API actions associated with the dialog. Should be used in specialized, non-browser-based integrations. /// - public List ApiActions { get; set; } = []; + public List ApiActions { get; set; } = []; /// /// An immutable list of activities associated with the dialog. /// - public List Activities { get; set; } = []; + public List Activities { get; set; } = []; /// /// The list of seen log entries for the dialog newer than the dialog ChangedAt date. /// - public List SeenSinceLastUpdate { get; set; } = []; + public List SeenSinceLastUpdate { get; set; } = []; } -public sealed class GetDialogDialogTransmissionDto +public sealed class DialogTransmissionDto { /// /// The unique identifier for the transmission in UUIDv7 format. @@ -227,20 +227,20 @@ public sealed class GetDialogDialogTransmissionDto /// /// The actor that sent the transmission. /// - public GetDialogDialogTransmissionSenderActorDto Sender { get; set; } = null!; + public DialogTransmissionSenderActorDto Sender { get; set; } = null!; /// /// The transmission unstructured text content. /// - public GetDialogDialogTransmissionContentDto Content { get; set; } = null!; + public DialogTransmissionContentDto Content { get; set; } = null!; /// /// The transmission-level attachments. /// - public List Attachments { get; set; } = []; + public List Attachments { get; set; } = []; } -public sealed class GetDialogDialogSeenLogDto +public sealed class DialogSeenLogDto { /// /// The unique identifier for the seen log entry in UUIDv7 format. @@ -255,7 +255,7 @@ public sealed class GetDialogDialogSeenLogDto /// /// The actor that saw the dialog revision. /// - public GetDialogDialogSeenLogSeenByActorDto SeenBy { get; set; } = null!; + public DialogSeenLogSeenByActorDto SeenBy { get; set; } = null!; /// /// Flag indicating whether the seen log entry was created via the service owner. @@ -270,7 +270,7 @@ public sealed class GetDialogDialogSeenLogDto public bool IsCurrentEndUser { get; set; } } -public sealed class GetDialogDialogSeenLogSeenByActorDto +public sealed class DialogSeenLogSeenByActorDto { /// /// The natural name of the person/business that saw the dialog revision. @@ -287,7 +287,7 @@ public sealed class GetDialogDialogSeenLogSeenByActorDto public string ActorId { get; set; } = null!; } -public sealed class GetDialogDialogTransmissionSenderActorDto +public sealed class DialogTransmissionSenderActorDto { /// /// The type of actor that sent the transmission. @@ -307,7 +307,7 @@ public sealed class GetDialogDialogTransmissionSenderActorDto public string ActorId { get; set; } = null!; } -public sealed class GetDialogContentDto +public sealed class ContentDto { /// /// The title of the dialog. @@ -341,7 +341,7 @@ public sealed class GetDialogContentDto public ContentValueDto? MainContentReference { get; set; } } -public sealed class GetDialogDialogTransmissionContentDto +public sealed class DialogTransmissionContentDto { /// /// The transmission title. @@ -360,7 +360,7 @@ public sealed class GetDialogDialogTransmissionContentDto public ContentValueDto? ContentReference { get; set; } } -public sealed class GetDialogSearchTagDto +public sealed class SearchTagDto { /// /// A search tag value. @@ -368,7 +368,7 @@ public sealed class GetDialogSearchTagDto public string Value { get; set; } = null!; } -public sealed class GetDialogDialogActivityDto +public sealed class DialogActivityDto { /// /// The unique identifier for the activity in UUIDv7 format. @@ -400,7 +400,7 @@ public sealed class GetDialogDialogActivityDto /// /// The actor that performed the activity. /// - public GetDialogDialogActivityPerformedByActorDto PerformedBy { get; set; } = null!; + public DialogActivityPerformedByActorDto PerformedBy { get; set; } = null!; /// /// Unstructured text describing the activity. Only set if the activity type is "Information". @@ -408,7 +408,7 @@ public sealed class GetDialogDialogActivityDto public List Description { get; set; } = []; } -public sealed class GetDialogDialogActivityPerformedByActorDto +public sealed class DialogActivityPerformedByActorDto { /// /// What type of actor performed the activity. @@ -428,7 +428,7 @@ public sealed class GetDialogDialogActivityPerformedByActorDto public string? ActorId { get; set; } } -public sealed class GetDialogDialogApiActionDto +public sealed class DialogApiActionDto { /// /// The unique identifier for the action in UUIDv7 format. @@ -466,10 +466,10 @@ public sealed class GetDialogDialogApiActionDto /// /// The endpoints associated with the action. /// - public List Endpoints { get; set; } = []; + public List Endpoints { get; set; } = []; } -public sealed class GetDialogDialogApiActionEndpointDto +public sealed class DialogApiActionEndpointDto { /// /// The unique identifier for the endpoint in UUIDv7 format. @@ -523,7 +523,7 @@ public sealed class GetDialogDialogApiActionEndpointDto public DateTimeOffset? SunsetAt { get; set; } } -public sealed class GetDialogDialogGuiActionDto +public sealed class DialogGuiActionDto { /// /// The unique identifier for the action in UUIDv7 format. @@ -590,7 +590,7 @@ public sealed class GetDialogDialogGuiActionDto public List? Prompt { get; set; } } -public sealed class GetDialogDialogAttachmentDto +public sealed class DialogAttachmentDto { /// /// The unique identifier for the attachment in UUIDv7 format. @@ -605,10 +605,10 @@ public sealed class GetDialogDialogAttachmentDto /// /// The URLs associated with the attachment, each referring to a different representation of the attachment. /// - public List Urls { get; set; } = []; + public List Urls { get; set; } = []; } -public sealed class GetDialogDialogAttachmentUrlDto +public sealed class DialogAttachmentUrlDto { /// /// The unique identifier for the attachment URL in UUIDv7 format. @@ -638,7 +638,7 @@ public sealed class GetDialogDialogAttachmentUrlDto public AttachmentUrlConsumerType.Values ConsumerType { get; set; } } -public sealed class GetDialogDialogTransmissionAttachmentDto +public sealed class DialogTransmissionAttachmentDto { /// /// The unique identifier for the attachment in UUIDv7 format. @@ -653,10 +653,10 @@ public sealed class GetDialogDialogTransmissionAttachmentDto /// /// The URLs associated with the attachment, each referring to a different representation of the attachment. /// - public List Urls { get; set; } = []; + public List Urls { get; set; } = []; } -public sealed class GetDialogDialogTransmissionAttachmentUrlDto +public sealed class DialogTransmissionAttachmentUrlDto { /// /// The fully qualified URL of the attachment. Will be set to "urn:dialogporten:unauthorized" if the user is diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Get/GetDialogQuery.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Get/GetDialogQuery.cs index f3129159ff..dd99329cfd 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Get/GetDialogQuery.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Get/GetDialogQuery.cs @@ -23,7 +23,7 @@ public sealed class GetDialogQuery : IRequest } [GenerateOneOf] -public sealed partial class GetDialogResult : OneOfBase; +public sealed partial class GetDialogResult : OneOfBase; internal sealed class GetDialogQueryHandler : IRequestHandler { @@ -93,7 +93,7 @@ public async Task Handle(GetDialogQuery request, CancellationTo return new EntityNotFound(request.DialogId); } - var dialogDto = _mapper.Map(dialog); + var dialogDto = _mapper.Map(dialog); if (request.EndUserId is not null) { @@ -128,7 +128,7 @@ public async Task Handle(GetDialogQuery request, CancellationTo dialogDto.SeenSinceLastUpdate = dialog.SeenLog .Select(log => { - var logDto = _mapper.Map(log); + var logDto = _mapper.Map(log); logDto.IsViaServiceOwner = true; return logDto; }) @@ -137,7 +137,7 @@ public async Task Handle(GetDialogQuery request, CancellationTo return dialogDto; } - private static void DecorateWithAuthorization(GetDialogDto dto, + private static void DecorateWithAuthorization(DialogDto dto, DialogDetailsAuthorizationResult authorizationResult) { foreach (var (action, resource) in authorizationResult.AuthorizedAltinnActions) diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Get/MappingProfile.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Get/MappingProfile.cs index 9338669434..4e01c904d6 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Get/MappingProfile.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Get/MappingProfile.cs @@ -14,48 +14,48 @@ internal sealed class MappingProfile : Profile { public MappingProfile() { - CreateMap() + CreateMap() .ForMember(dest => dest.Status, opt => opt.MapFrom(src => src.StatusId)) .ForMember(dest => dest.SeenSinceLastUpdate, opt => opt.Ignore()) .ForMember(dest => dest.SystemLabel, opt => opt.MapFrom(src => src.DialogEndUserContext.SystemLabelId)); - CreateMap(); - CreateMap() + CreateMap(); + CreateMap() .ForMember(dest => dest.SeenAt, opt => opt.MapFrom(src => src.CreatedAt)); - CreateMap() + CreateMap() .ForMember(dest => dest.Type, opt => opt.MapFrom(src => src.TypeId)); - CreateMap() + CreateMap() .ForMember(dest => dest.ActorType, opt => opt.MapFrom(src => src.ActorTypeId)); - CreateMap(); - CreateMap() + CreateMap(); + CreateMap() .ForMember(dest => dest.HttpMethod, opt => opt.MapFrom(src => src.HttpMethodId)); - CreateMap() + CreateMap() .ForMember(dest => dest.Priority, opt => opt.MapFrom(src => src.PriorityId)) .ForMember(dest => dest.HttpMethod, opt => opt.MapFrom(src => src.HttpMethodId)); - CreateMap(); - CreateMap() + CreateMap(); + CreateMap() .ForMember(dest => dest.ConsumerType, opt => opt.MapFrom(src => src.ConsumerTypeId)); - CreateMap(); + CreateMap(); - CreateMap?, GetDialogContentDto?>() - .ConvertUsing>(); + CreateMap?, ContentDto?>() + .ConvertUsing>(); - CreateMap() + CreateMap() .ForMember(dest => dest.ActorType, opt => opt.MapFrom(src => src.ActorTypeId)); - CreateMap?, GetDialogDialogTransmissionContentDto?>() - .ConvertUsing>(); + CreateMap?, DialogTransmissionContentDto?>() + .ConvertUsing>(); - CreateMap() + CreateMap() .ForMember(dest => dest.Type, opt => opt.MapFrom(src => src.TypeId)); - CreateMap(); - CreateMap() + CreateMap(); + CreateMap() .ForMember(dest => dest.ConsumerType, opt => opt.MapFrom(src => src.ConsumerTypeId)); } } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/SearchDialogDto.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/DialogDto.cs similarity index 86% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/SearchDialogDto.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/DialogDto.cs index 398b6cb024..6a852a27cb 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/SearchDialogDto.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/DialogDto.cs @@ -4,16 +4,16 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.Dialogs.Queries.Search; -public sealed class SearchDialogDto : SearchDialogDtoBase +public sealed class DialogDto : DialogDtoBase { /// /// The content of the dialog in search results. /// [JsonPropertyOrder(100)] // ILU MAGNUS - public SearchDialogContentDto Content { get; set; } = null!; + public ContentDto Content { get; set; } = null!; } -public sealed class SearchDialogContentDto +public sealed class ContentDto { /// /// The title of the dialog. @@ -43,7 +43,7 @@ public sealed class SearchDialogContentDto /// in the SearchDialog handlers, after EF core is done loading the data. /// Then we create a new PaginatedList with the outwards facing dto. /// -public sealed class IntermediateSearchDialogDto : SearchDialogDtoBase +public sealed class IntermediateDialogDto : DialogDtoBase { public List Content { get; set; } = []; } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/SearchDialogDtoBase.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/DialogDtoBase.cs similarity index 92% rename from src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/SearchDialogDtoBase.cs rename to src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/DialogDtoBase.cs index e2620a405c..ac46deaf25 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/SearchDialogDtoBase.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/DialogDtoBase.cs @@ -6,7 +6,7 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.Dialogs.Queries.Search; -public class SearchDialogDtoBase +public class DialogDtoBase { /// /// The unique identifier for the dialog in UUIDv7 format. @@ -113,15 +113,15 @@ public class SearchDialogDtoBase /// /// The latest entry in the dialog's activity log. /// - public SearchDialogDialogActivityDto? LatestActivity { get; set; } + public DialogActivityDto? LatestActivity { get; set; } /// /// The list of seen log entries for the dialog newer than the dialog ChangedAt date. /// - public List SeenSinceLastUpdate { get; set; } = []; + public List SeenSinceLastUpdate { get; set; } = []; } -public sealed class SearchDialogDialogSeenLogDto +public sealed class DialogSeenLogDto { /// /// The unique identifier for the seen log entry in UUIDv7 format. @@ -136,7 +136,7 @@ public sealed class SearchDialogDialogSeenLogDto /// /// The actor that saw the dialog revision. /// - public SearchDialogDialogSeenLogSeenByActorDto SeenBy { get; set; } = null!; + public DialogSeenLogSeenByActorDto SeenBy { get; set; } = null!; /// /// Flag indicating whether the seen log entry was created via the service owner. @@ -151,7 +151,7 @@ public sealed class SearchDialogDialogSeenLogDto public bool IsCurrentEndUser { get; set; } } -public sealed class SearchDialogDialogSeenLogSeenByActorDto +public sealed class DialogSeenLogSeenByActorDto { /// /// The natural name of the person/business that saw the dialog revision. @@ -168,7 +168,7 @@ public sealed class SearchDialogDialogSeenLogSeenByActorDto public string ActorId { get; set; } = null!; } -public sealed class SearchDialogDialogActivityDto +public sealed class DialogActivityDto { /// /// The unique identifier for the activity in UUIDv7 format. @@ -200,7 +200,7 @@ public sealed class SearchDialogDialogActivityDto /// /// The actor that performed the activity. /// - public SearchDialogDialogActivityPerformedByActorDto PerformedBy { get; set; } = null!; + public DialogActivityPerformedByActorDto PerformedBy { get; set; } = null!; /// /// Unstructured text describing the activity. Only set if the activity type is "Information". @@ -208,7 +208,7 @@ public sealed class SearchDialogDialogActivityDto public List Description { get; set; } = []; } -public sealed class SearchDialogDialogActivityPerformedByActorDto +public sealed class DialogActivityPerformedByActorDto { /// /// What type of actor performed the activity. diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/MappingProfile.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/MappingProfile.cs index a6e5c140ed..0f61aa4e8a 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/MappingProfile.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/MappingProfile.cs @@ -12,8 +12,8 @@ internal sealed class MappingProfile : Profile public MappingProfile() { // See IntermediateSearchDialogDto - CreateMap(); - CreateMap() + CreateMap(); + CreateMap() .ForMember(dest => dest.LatestActivity, opt => opt.MapFrom(src => src.Activities .OrderByDescending(activity => activity.CreatedAt).ThenByDescending(activity => activity.Id) .FirstOrDefault() @@ -29,20 +29,20 @@ public MappingProfile() .ForMember(dest => dest.Status, opt => opt.MapFrom(src => src.StatusId)) .ForMember(dest => dest.SystemLabel, opt => opt.MapFrom(src => src.DialogEndUserContext.SystemLabelId)); - CreateMap() + CreateMap() .ForMember(dest => dest.SeenAt, opt => opt.MapFrom(src => src.CreatedAt)); - CreateMap() + CreateMap() .ForMember(dest => dest.ActorId, opt => opt.MapFrom(src => src.ActorId)); - CreateMap() + CreateMap() .ForMember(dest => dest.Type, opt => opt.MapFrom(src => src.TypeId)); - CreateMap() + CreateMap() .ForMember(dest => dest.ActorType, opt => opt.MapFrom(src => src.ActorTypeId)) .ForMember(dest => dest.ActorId, opt => opt.MapFrom(src => src.ActorId)); - CreateMap?, SearchDialogContentDto?>() - .ConvertUsing>(); + CreateMap?, ContentDto?>() + .ConvertUsing>(); } } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/SearchDialogQuery.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/SearchDialogQuery.cs index ba853b699d..1e94c680b6 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/SearchDialogQuery.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/SearchDialogQuery.cs @@ -17,7 +17,7 @@ namespace Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.Dialogs.Queries.Search; -public sealed class SearchDialogQuery : SortablePaginationParameter, IRequest +public sealed class SearchDialogQuery : SortablePaginationParameter, IRequest { private string? _searchLanguageCode; @@ -115,9 +115,9 @@ public string? SearchLanguageCode } } -public sealed class SearchDialogQueryOrderDefinition : IOrderDefinition +public sealed class SearchDialogQueryOrderDefinition : IOrderDefinition { - public static IOrderOptions Configure(IOrderOptionsBuilder options) => + public static IOrderOptions Configure(IOrderOptionsBuilder options) => options.AddId(x => x.Id) .AddDefault("createdAt", x => x.CreatedAt) .AddOption("updatedAt", x => x.UpdatedAt) @@ -126,7 +126,7 @@ public static IOrderOptions Configure(IOrderOptions } [GenerateOneOf] -public sealed partial class SearchDialogResult : OneOfBase, ValidationError>; +public sealed partial class SearchDialogResult : OneOfBase, ValidationError>; internal sealed class SearchDialogQueryHandler : IRequestHandler { @@ -192,7 +192,7 @@ public async Task Handle(SearchDialogQuery request, Cancella x.SearchTags.Any(x => EF.Functions.ILike(x.Value, request.Search!)) ) .Where(x => resourceIds.Contains(x.ServiceResource)) - .ProjectTo(_mapper.ConfigurationProvider) + .ProjectTo(_mapper.ConfigurationProvider) .ToPaginatedListAsync(request, cancellationToken: cancellationToken); if (request.EndUserId is not null) @@ -203,6 +203,6 @@ public async Task Handle(SearchDialogQuery request, Cancella } } - return paginatedList.ConvertTo(_mapper.Map); + return paginatedList.ConvertTo(_mapper.Map); } } diff --git a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/SearchDialogQueryValidator.cs b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/SearchDialogQueryValidator.cs index 0ce1a1a3cc..30a3485c2f 100644 --- a/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/SearchDialogQueryValidator.cs +++ b/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/SearchDialogQueryValidator.cs @@ -14,7 +14,7 @@ internal sealed class SearchDialogQueryValidator : AbstractValidator()); + Include(new PaginationParameterValidator()); RuleFor(x => x.Search) .MinimumLength(3) .When(x => x.Search is not null); diff --git a/src/Digdir.Domain.Dialogporten.GraphQL/EndUser/Common/MappingProfile.cs b/src/Digdir.Domain.Dialogporten.GraphQL/EndUser/Common/MappingProfile.cs index 776900b3c1..28124881a2 100644 --- a/src/Digdir.Domain.Dialogporten.GraphQL/EndUser/Common/MappingProfile.cs +++ b/src/Digdir.Domain.Dialogporten.GraphQL/EndUser/Common/MappingProfile.cs @@ -1,8 +1,10 @@ using AutoMapper; using Digdir.Domain.Dialogporten.Application.Features.V1.Common.Content; using Digdir.Domain.Dialogporten.Application.Features.V1.Common.Localizations; -using Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.Dialogs.Queries.Get; -using Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.Dialogs.Queries.Search; +using DialogActivityDto = Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.Dialogs.Queries.Search.DialogActivityDto; +using DialogActivityPerformedByActorDto = Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.Dialogs.Queries.Search.DialogActivityPerformedByActorDto; +using DialogSeenLogDto = Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.Dialogs.Queries.Search.DialogSeenLogDto; +using DialogSeenLogSeenByActorDto = Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.Dialogs.Queries.Search.DialogSeenLogSeenByActorDto; namespace Digdir.Domain.Dialogporten.GraphQL.EndUser.Common; @@ -14,20 +16,20 @@ public MappingProfile() CreateMap(); - CreateMap(); - CreateMap(); + CreateMap(); + CreateMap(); - CreateMap(); - CreateMap(); + CreateMap(); + CreateMap(); - CreateMap() + CreateMap() .ForMember(dest => dest.Type, opt => opt.MapFrom(src => src.Type)); - CreateMap() + CreateMap() .ForMember(dest => dest.ActorType, opt => opt.MapFrom(src => src.ActorType)); - CreateMap() + CreateMap() .ForMember(dest => dest.Type, opt => opt.MapFrom(src => src.Type)); - CreateMap() + CreateMap() .ForMember(dest => dest.ActorType, opt => opt.MapFrom(src => src.ActorType)); } } diff --git a/src/Digdir.Domain.Dialogporten.GraphQL/EndUser/DialogById/MappingProfile.cs b/src/Digdir.Domain.Dialogporten.GraphQL/EndUser/DialogById/MappingProfile.cs index 856b24d2e1..b42d1a9976 100644 --- a/src/Digdir.Domain.Dialogporten.GraphQL/EndUser/DialogById/MappingProfile.cs +++ b/src/Digdir.Domain.Dialogporten.GraphQL/EndUser/DialogById/MappingProfile.cs @@ -8,30 +8,30 @@ public sealed class MappingProfile : Profile { public MappingProfile() { - CreateMap() + CreateMap() .ForMember(dest => dest.Status, opt => opt.MapFrom(src => src.Status)); - CreateMap(); - CreateMap() + CreateMap(); + CreateMap() .ForMember(dest => dest.ConsumerType, opt => opt.MapFrom(src => src.ConsumerType)); - CreateMap() + CreateMap() .ForMember(dest => dest.Priority, opt => opt.MapFrom(src => src.Priority)) .ForMember(dest => dest.HttpMethod, opt => opt.MapFrom(src => src.HttpMethod)); - CreateMap(); - CreateMap() + CreateMap(); + CreateMap() .ForMember(dest => dest.HttpMethod, opt => opt.MapFrom(src => src.HttpMethod)); - CreateMap(); - CreateMap(); + CreateMap(); + CreateMap(); - CreateMap() + CreateMap() .ForMember(dest => dest.Type, opt => opt.MapFrom(src => src.Type)); - CreateMap(); - CreateMap(); - CreateMap() + CreateMap(); + CreateMap(); + CreateMap() .ForMember(dest => dest.ConsumerType, opt => opt.MapFrom(src => src.ConsumerType)); - CreateMap(); + CreateMap(); } } diff --git a/src/Digdir.Domain.Dialogporten.GraphQL/EndUser/MutationTypes/MappingProfile.cs b/src/Digdir.Domain.Dialogporten.GraphQL/EndUser/MutationTypes/MappingProfile.cs index 057f14b122..d4b87bdd39 100644 --- a/src/Digdir.Domain.Dialogporten.GraphQL/EndUser/MutationTypes/MappingProfile.cs +++ b/src/Digdir.Domain.Dialogporten.GraphQL/EndUser/MutationTypes/MappingProfile.cs @@ -7,7 +7,7 @@ public sealed class MappingProfile : Profile { public MappingProfile() { - CreateMap() + CreateMap() .ForMember(dest => dest.Label, opt => opt.MapFrom(src => src.Label)); } } diff --git a/src/Digdir.Domain.Dialogporten.GraphQL/EndUser/MutationTypes/Mutations.cs b/src/Digdir.Domain.Dialogporten.GraphQL/EndUser/MutationTypes/Mutations.cs index 11d16718e0..1304329c54 100644 --- a/src/Digdir.Domain.Dialogporten.GraphQL/EndUser/MutationTypes/Mutations.cs +++ b/src/Digdir.Domain.Dialogporten.GraphQL/EndUser/MutationTypes/Mutations.cs @@ -11,7 +11,7 @@ public async Task SetSystemLabel( [Service] IMapper mapper, SetSystemLabelInput input) { - var command = mapper.Map(input); + var command = mapper.Map(input); var result = await mediator.Send(command); return result.Match( diff --git a/src/Digdir.Domain.Dialogporten.GraphQL/EndUser/SearchDialogs/MappingProfile.cs b/src/Digdir.Domain.Dialogporten.GraphQL/EndUser/SearchDialogs/MappingProfile.cs index b978ec1e73..e9ae6be2ad 100644 --- a/src/Digdir.Domain.Dialogporten.GraphQL/EndUser/SearchDialogs/MappingProfile.cs +++ b/src/Digdir.Domain.Dialogporten.GraphQL/EndUser/SearchDialogs/MappingProfile.cs @@ -11,10 +11,10 @@ public MappingProfile() CreateMap() .ForMember(dest => dest.Status, opt => opt.MapFrom(src => src.Status)); - CreateMap, SearchDialogsPayload>(); + CreateMap, SearchDialogsPayload>(); - CreateMap(); + CreateMap(); - CreateMap(); + CreateMap(); } } diff --git a/src/Digdir.Domain.Dialogporten.Infrastructure/Persistence/DialogDbContext.cs b/src/Digdir.Domain.Dialogporten.Infrastructure/Persistence/DialogDbContext.cs index 2bd9b20748..cf67170d9d 100644 --- a/src/Digdir.Domain.Dialogporten.Infrastructure/Persistence/DialogDbContext.cs +++ b/src/Digdir.Domain.Dialogporten.Infrastructure/Persistence/DialogDbContext.cs @@ -18,8 +18,6 @@ using Digdir.Domain.Dialogporten.Domain.SubjectResources; using Digdir.Domain.Dialogporten.Infrastructure.Persistence.IdempotentNotifications; using MassTransit; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using OutboxMessage = MassTransit.EntityFrameworkCoreIntegration.OutboxMessage; namespace Digdir.Domain.Dialogporten.Infrastructure.Persistence; diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Common/Json/SuffixedSchemaNameGenerator.cs b/src/Digdir.Domain.Dialogporten.WebApi/Common/Json/SuffixedSchemaNameGenerator.cs index 06f36e7560..55dab0cb71 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Common/Json/SuffixedSchemaNameGenerator.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Common/Json/SuffixedSchemaNameGenerator.cs @@ -1,4 +1,4 @@ -using System.Text; +using Digdir.Domain.Dialogporten.WebApi.Common.Swagger; using NJsonSchema.Generation; namespace Digdir.Domain.Dialogporten.WebApi.Common.Json; @@ -13,64 +13,5 @@ namespace Digdir.Domain.Dialogporten.WebApi.Common.Json; /// internal sealed class SuffixedSchemaNameGenerator : ISchemaNameGenerator { - public string Generate(Type type) - { - var baseName = BaseGenerate(type); - - // TODO! Find a more typed approach - if (type.FullName != null && - (baseName.StartsWith("GetDialog", StringComparison.Ordinal) || - baseName.StartsWith("SearchDialog", StringComparison.Ordinal) || - baseName.StartsWith("PaginatedList", StringComparison.Ordinal)) && type.FullName.Contains(".ServiceOwner")) - { - baseName += "SO"; - } - return baseName; - } - - private static string BaseGenerate(Type type) - { - var isGeneric = type.IsGenericType; - var fullNameWithoutGenericArgs = - isGeneric - ? type.FullName![..type.FullName!.IndexOf('`')] - : type.FullName; - - var index = fullNameWithoutGenericArgs!.LastIndexOf('.'); - index = index == -1 ? 0 : index + 1; - var shortName = fullNameWithoutGenericArgs[index..]; - - return isGeneric - ? shortName + GenericArgString(type) - : shortName; - - static string GenericArgString(Type type) - { - if (!type.IsGenericType) return type.Name; - - var sb = new StringBuilder(); - var args = type.GetGenericArguments(); - - for (var i = 0; i < args.Length; i++) - { - var arg = args[i]; - if (i == 0) - sb.Append("Of"); - sb.Append(TypeNameWithoutGenericArgs(arg)); - sb.Append(GenericArgString(arg)); - if (i < args.Length - 1) - sb.Append("And"); - } - - return sb.ToString(); - - static string TypeNameWithoutGenericArgs(Type type) - { - var index = type.Name.IndexOf('`'); - index = index == -1 ? 0 : index; - - return type.Name[..index]; - } - } - } + public string Generate(Type type) => TypeNameConverter.ToShortName(type); } diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Common/Swagger/ISwaggerConfig.cs b/src/Digdir.Domain.Dialogporten.WebApi/Common/Swagger/ISwaggerConfig.cs deleted file mode 100644 index 6e197a2416..0000000000 --- a/src/Digdir.Domain.Dialogporten.WebApi/Common/Swagger/ISwaggerConfig.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Digdir.Domain.Dialogporten.WebApi.Common.Swagger; - -public interface ISwaggerConfig -{ - public static abstract string OperationId { get; } - static abstract RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder); - // TODO: Does this need to be split in two? One for request, one for response - static abstract object GetExample(); -} diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Common/Swagger/TypeNameConverter.cs b/src/Digdir.Domain.Dialogporten.WebApi/Common/Swagger/TypeNameConverter.cs new file mode 100644 index 0000000000..b3d93e3115 --- /dev/null +++ b/src/Digdir.Domain.Dialogporten.WebApi/Common/Swagger/TypeNameConverter.cs @@ -0,0 +1,153 @@ +using System.Diagnostics; + +namespace Digdir.Domain.Dialogporten.WebApi.Common.Swagger; + +internal static class TypeNameConverter +{ + private const string Of = "Of"; + private const string And = "And"; + private const string NamespaceClassSeparator = "_"; + + private static readonly string[] ExcludedClassPostfixes = ["Endpoint", "+Values", "Dto"]; + private static readonly string[] ExcludedClassPrefixes = ["Create", "Update", "Delete", "Patch"]; + private static readonly string[] ExcludedNamespacePostfixes = []; + private static readonly string[] ExcludedNamespacePrefixes = + [ + "FastEndpoints", + "Digdir.Domain.Dialogporten.Domain.", + "Digdir.Domain.Dialogporten.WebApi.Endpoints.", + "Digdir.Domain.Dialogporten.Application.Features." + ]; + + internal static string ToShortName(Type type) + { + var index = 0; + Span finalName = stackalloc char[type.FullName!.Length]; + ToShortName(type, finalName, ref index); + return finalName[..index].ToString(); + } + + private static void ToShortName(Type type, Span finalName, ref int index) + { + if (type.IsGenericType) + { + WriteGenericType(type, finalName, ref index); + return; + } + + WriteNonGenericType(type, finalName, ref index); + } + + private static void WriteGenericType(Type type, Span finalName, ref int index) + { + var genericName = type.Name.AsSpan(); + genericName[..genericName.IndexOf('`')].CopyTo(finalName, ref index); + Of.AsSpan().CopyTo(finalName, ref index); + + using var typeArguments = type + .GetGenericArguments() + .AsEnumerable() + .GetEnumerator(); + + if (!typeArguments.MoveNext()) + { + throw new UnreachableException("Assumption: Generic type has at least one generic argument."); + } + + ToShortName(typeArguments.Current, finalName, ref index); + while (typeArguments.MoveNext()) + { + And.AsSpan().CopyTo(finalName, ref index); + ToShortName(typeArguments.Current, finalName, ref index); + } + } + + private static void WriteNonGenericType(Type type, Span finalName, ref int index) + { + // If the input type is a generic parameter, use its name as is. For example, in the + // generic type List, T is a generic parameter. Concrete types are not generic + // parameters and will be processed as usual. For example in List, int is a + // concrete type, and not a generic parameter. + if (type.IsGenericTypeParameter) + { + type.Name.AsSpan().CopyTo(finalName, ref index); + return; + } + + type.FullName + .AsSpan() + .SplitNamespaceAndClassName(out var namespaceName, out var className); + className = className + .ExcludePrefix(ExcludedClassPrefixes) + .ExcludePostfix(ExcludedClassPostfixes); + namespaceName = namespaceName + .ExcludePrefix(ExcludedNamespacePrefixes) + .ExcludePostfix(ExcludedNamespacePostfixes); + var namespaceWritten = false; + + // Copy namespace without '.' + foreach (var @char in namespaceName) + { + if (@char != '.') + { + finalName[index++] = @char; + namespaceWritten = true; + } + } + + // Add separator between namespace and class name + if (namespaceWritten) + { + NamespaceClassSeparator.AsSpan().CopyTo(finalName, ref index); + } + + // Copy class name + className.CopyTo(finalName, ref index); + } + + private static ReadOnlySpan ExcludePrefix(this ReadOnlySpan name, IEnumerable prefixes) + { + foreach (var prefix in prefixes) + { + if (name.StartsWith(prefix)) + { + name = name[prefix.Length..]; + break; + } + } + + return name; + } + + private static ReadOnlySpan ExcludePostfix(this ReadOnlySpan name, IEnumerable postfixes) + { + foreach (var postfix in postfixes) + { + if (name.EndsWith(postfix)) + { + name = name[..^postfix.Length]; + break; + } + } + + return name; + } + + private static void SplitNamespaceAndClassName(this ReadOnlySpan fullName, out ReadOnlySpan namespaceName, out ReadOnlySpan className) + { + const int notFound = -1; + var classNamespaceSeparatorIndex = fullName.LastIndexOf('.'); + className = classNamespaceSeparatorIndex == notFound + ? fullName + : fullName[(classNamespaceSeparatorIndex + 1)..]; + namespaceName = classNamespaceSeparatorIndex == notFound + ? ReadOnlySpan.Empty + : fullName[..classNamespaceSeparatorIndex]; + } + + private static void CopyTo(this ReadOnlySpan source, Span destination, ref int index) + { + source.CopyTo(destination[index..]); + index += source.Length; + } +} diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogActivities/Get/GetDialogActivityEndpoint.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogActivities/Get/GetDialogActivityEndpoint.cs index ab14dce1d2..74028e0dc6 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogActivities/Get/GetDialogActivityEndpoint.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogActivities/Get/GetDialogActivityEndpoint.cs @@ -1,12 +1,13 @@ using Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogActivities.Queries.Get; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; +using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; using MediatR; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.EndUser.DialogActivities.Get; -public sealed class GetDialogActivityEndpoint : Endpoint +public sealed class GetDialogActivityEndpoint : Endpoint { private readonly ISender _sender; @@ -21,10 +22,12 @@ public override void Configure() Policies(AuthorizationPolicy.EndUser); Group(); - Description(b => GetDialogActivitySwaggerConfig.SetDescription(b)); + Description(b => b.ProducesOneOf( + StatusCodes.Status200OK, + StatusCodes.Status404NotFound)); } - public override async Task HandleAsync(GetDialogActivityQuery req, CancellationToken ct) + public override async Task HandleAsync(GetActivityQuery req, CancellationToken ct) { var result = await _sender.Send(req, ct); await result.Match( diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogActivities/Get/GetDialogActivitySwaggerConfig.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogActivities/Get/GetDialogActivityEndpointSummary.cs similarity index 60% rename from src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogActivities/Get/GetDialogActivitySwaggerConfig.cs rename to src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogActivities/Get/GetDialogActivityEndpointSummary.cs index 01d931c087..8162d6dee6 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogActivities/Get/GetDialogActivitySwaggerConfig.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogActivities/Get/GetDialogActivityEndpointSummary.cs @@ -1,25 +1,9 @@ -using Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogActivities.Queries.Get; using Digdir.Domain.Dialogporten.WebApi.Common; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; -using Digdir.Domain.Dialogporten.WebApi.Common.Swagger; -using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.EndUser.DialogActivities.Get; -public sealed class GetDialogActivitySwaggerConfig : ISwaggerConfig -{ - public static string OperationId => "GetDialogActivity"; - - public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) => - builder.OperationId(OperationId) - .ProducesOneOf( - StatusCodes.Status200OK, - StatusCodes.Status404NotFound); - - public static object GetExample() => throw new NotImplementedException(); -} - public sealed class GetDialogActivityEndpointSummary : Summary { public GetDialogActivityEndpointSummary() diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogActivities/Search/SearchDialogActivityEndpoint.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogActivities/Search/SearchDialogActivityEndpoint.cs index bbbbb170f8..4877e132d7 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogActivities/Search/SearchDialogActivityEndpoint.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogActivities/Search/SearchDialogActivityEndpoint.cs @@ -6,7 +6,7 @@ namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.EndUser.DialogActivities.Search; -public sealed class SearchDialogActivityEndpoint : Endpoint> +public sealed class SearchDialogActivityEndpoint : Endpoint> { private readonly ISender _sender; @@ -20,11 +20,9 @@ public override void Configure() Get("dialogs/{dialogId}/activities"); Policies(AuthorizationPolicy.EndUser); Group(); - - Description(b => SearchDialogActivitySwaggerConfig.SetDescription(b)); } - public override async Task HandleAsync(SearchDialogActivityQuery req, CancellationToken ct) + public override async Task HandleAsync(SearchActivityQuery req, CancellationToken ct) { var result = await _sender.Send(req, ct); await result.Match( diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogActivities/Search/SearchDialogActivitySwaggerConfig.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogActivities/Search/SearchDialogActivityEndpointSummary.cs similarity index 66% rename from src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogActivities/Search/SearchDialogActivitySwaggerConfig.cs rename to src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogActivities/Search/SearchDialogActivityEndpointSummary.cs index b215d79ef9..90d791ee62 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogActivities/Search/SearchDialogActivitySwaggerConfig.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogActivities/Search/SearchDialogActivityEndpointSummary.cs @@ -1,23 +1,11 @@ using Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogActivities.Queries.Search; using Digdir.Domain.Dialogporten.WebApi.Common; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; -using Digdir.Domain.Dialogporten.WebApi.Common.Swagger; -using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.EndUser.DialogActivities.Search; -public sealed class SearchDialogActivitySwaggerConfig : ISwaggerConfig -{ - public static string OperationId => "GetDialogActivityList"; - - public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) - => builder.OperationId(OperationId); - - public static object GetExample() => throw new NotImplementedException(); -} - -public sealed class SearchDialogActivityEndpointSummary : Summary +public sealed class SearchDialogActivityEndpointSummary : Summary { public SearchDialogActivityEndpointSummary() { diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogLabelAssignmentLogs/Search/SearchDialogLabelAssignmentLogEndpoint.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogLabelAssignmentLogs/Search/SearchDialogLabelAssignmentLogEndpoint.cs index f87b992bf2..48b5366467 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogLabelAssignmentLogs/Search/SearchDialogLabelAssignmentLogEndpoint.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogLabelAssignmentLogs/Search/SearchDialogLabelAssignmentLogEndpoint.cs @@ -1,12 +1,13 @@ using Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogLabelAssignmentLog.Queries.Search; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; +using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; using MediatR; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.EndUser.DialogLabelAssignmentLogs.Search; -public sealed class SearchDialogLabelAssignmentLogEndpoint : Endpoint> +public sealed class SearchDialogLabelAssignmentLogEndpoint : Endpoint> { private readonly ISender _sender; @@ -20,9 +21,12 @@ public override void Configure() Policies(AuthorizationPolicy.EndUser); Group(); - Description(d => SearchDialogLabelAssignmentSwaggerConfig.SetDescription(d)); + Description(d => d.ProducesOneOf>( + StatusCodes.Status200OK, + StatusCodes.Status404NotFound, + StatusCodes.Status410Gone)); } - public override async Task HandleAsync(SearchDialogLabelAssignmentLogQuery req, CancellationToken ct) + public override async Task HandleAsync(SearchLabelAssignmentLogQuery req, CancellationToken ct) { var result = await _sender.Send(req, ct); await result.Match( diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogLabelAssignmentLogs/Search/SearchDialogLabelAssignmentSwaggerConfig.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogLabelAssignmentLogs/Search/SearchDialogLabelAssignmentSwaggerConfig.cs deleted file mode 100644 index a506acf981..0000000000 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogLabelAssignmentLogs/Search/SearchDialogLabelAssignmentSwaggerConfig.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogLabelAssignmentLog.Queries.Search; -using Digdir.Domain.Dialogporten.WebApi.Common.Swagger; -using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; - -namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.EndUser.DialogLabelAssignmentLogs.Search; - -public sealed class SearchDialogLabelAssignmentSwaggerConfig : ISwaggerConfig -{ - - public static string OperationId => "SearchDialogLabelAssignmentLog"; - public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) - => builder.OperationId(OperationId).ProducesOneOf>( - StatusCodes.Status200OK, - StatusCodes.Status404NotFound, - StatusCodes.Status410Gone); - public static object GetExample() => throw new NotImplementedException(); -} diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogSeenLogs/Get/GetDialogSeenLogEndpoint.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogSeenLogs/Get/GetDialogSeenLogEndpoint.cs index 230cc0d57a..99aa49da6f 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogSeenLogs/Get/GetDialogSeenLogEndpoint.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogSeenLogs/Get/GetDialogSeenLogEndpoint.cs @@ -1,12 +1,13 @@ using Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogSeenLogs.Queries.Get; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; +using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; using MediatR; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.EndUser.DialogSeenLogs.Get; -public sealed class GetDialogSeenLogEndpoint : Endpoint +public sealed class GetDialogSeenLogEndpoint : Endpoint { private readonly ISender _sender; @@ -20,11 +21,12 @@ public override void Configure() Get("dialogs/{dialogId}/seenlog/{seenLogId}"); Policies(AuthorizationPolicy.EndUser); Group(); - - Description(d => GetDialogSeenLogSwaggerConfig.SetDescription(d)); + Description(d => d.ProducesOneOf( + StatusCodes.Status200OK, + StatusCodes.Status404NotFound)); } - public override async Task HandleAsync(GetDialogSeenLogQuery req, CancellationToken ct) + public override async Task HandleAsync(GetSeenLogQuery req, CancellationToken ct) { var result = await _sender.Send(req, ct); await result.Match( diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogSeenLogs/Get/GetDialogSeenLogSwaggerConfig.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogSeenLogs/Get/GetDialogSeenLogEndpointSummary.cs similarity index 54% rename from src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogSeenLogs/Get/GetDialogSeenLogSwaggerConfig.cs rename to src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogSeenLogs/Get/GetDialogSeenLogEndpointSummary.cs index 970aa9c081..65d1e06d1a 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogSeenLogs/Get/GetDialogSeenLogSwaggerConfig.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogSeenLogs/Get/GetDialogSeenLogEndpointSummary.cs @@ -1,24 +1,9 @@ -using Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogSeenLogs.Queries.Get; using Digdir.Domain.Dialogporten.WebApi.Common; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; -using Digdir.Domain.Dialogporten.WebApi.Common.Swagger; -using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.EndUser.DialogSeenLogs.Get; -public sealed class GetDialogSeenLogSwaggerConfig : ISwaggerConfig -{ - public static string OperationId => "GetDialogSeenLog"; - public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) - => builder.OperationId(OperationId) - .ProducesOneOf( - StatusCodes.Status200OK, - StatusCodes.Status404NotFound); - - public static object GetExample() => throw new NotImplementedException(); -} - public sealed class GetDialogSeenLogEndpointSummary : Summary { public GetDialogSeenLogEndpointSummary() diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogSeenLogs/Search/SearchDialogSeenLogEndpoint.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogSeenLogs/Search/SearchDialogSeenLogEndpoint.cs index 9f449cfd15..0aa0f44401 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogSeenLogs/Search/SearchDialogSeenLogEndpoint.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogSeenLogs/Search/SearchDialogSeenLogEndpoint.cs @@ -1,12 +1,13 @@ using Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogSeenLogs.Queries.Search; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; +using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; using MediatR; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.EndUser.DialogSeenLogs.Search; -public sealed class SearchDialogSeenLogEndpoint : Endpoint> +public sealed class SearchDialogSeenLogEndpoint : Endpoint> { private readonly ISender _sender; @@ -21,10 +22,12 @@ public override void Configure() Policies(AuthorizationPolicy.EndUser); Group(); - Description(d => SearchDialogSeenLogSwaggerConfig.SetDescription(d)); + Description(d => d.ProducesOneOf>( + StatusCodes.Status200OK, + StatusCodes.Status404NotFound)); } - public override async Task HandleAsync(SearchDialogSeenLogQuery req, CancellationToken ct) + public override async Task HandleAsync(SearchSeenLogQuery req, CancellationToken ct) { var result = await _sender.Send(req, ct); await result.Match( diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogSeenLogs/Search/SearchDialogSeenLogSwaggerConfig.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogSeenLogs/Search/SearchDialogSeenLogEndpointSummary.cs similarity index 54% rename from src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogSeenLogs/Search/SearchDialogSeenLogSwaggerConfig.cs rename to src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogSeenLogs/Search/SearchDialogSeenLogEndpointSummary.cs index f1df426bce..59f6274dab 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogSeenLogs/Search/SearchDialogSeenLogSwaggerConfig.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogSeenLogs/Search/SearchDialogSeenLogEndpointSummary.cs @@ -1,25 +1,9 @@ -using Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogSeenLogs.Queries.Search; using Digdir.Domain.Dialogporten.WebApi.Common; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; -using Digdir.Domain.Dialogporten.WebApi.Common.Swagger; -using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.EndUser.DialogSeenLogs.Search; -public sealed class SearchDialogSeenLogSwaggerConfig : ISwaggerConfig -{ - public static string OperationId => "SearchDialogSeenLog"; - - public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) - => builder.OperationId(OperationId) - .ProducesOneOf>( - StatusCodes.Status200OK, - StatusCodes.Status404NotFound); - - public static object GetExample() => throw new NotImplementedException(); -} - public sealed class SearchDialogSeenLogEndpointSummary : Summary { public SearchDialogSeenLogEndpointSummary() diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogSystemLabels/Set/SetDialogSystemLabelEndpoint.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogSystemLabels/Set/SetDialogSystemLabelEndpoint.cs index 4a3afe3f84..b0ce50bcf5 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogSystemLabels/Set/SetDialogSystemLabelEndpoint.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogSystemLabels/Set/SetDialogSystemLabelEndpoint.cs @@ -1,12 +1,13 @@ using Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogSystemLabels.Commands.Set; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; +using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; using MediatR; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.EndUser.DialogSystemLabels.Set; -public sealed class SetDialogSystemLabelEndpoint(ISender sender) : Endpoint +public sealed class SetDialogSystemLabelEndpoint(ISender sender) : Endpoint { private readonly ISender _sender = sender ?? throw new ArgumentNullException(nameof(sender)); @@ -16,9 +17,16 @@ public override void Configure() Policies(AuthorizationPolicy.EndUser); Group(); - Description(b => SetDialogSystemLabelSwaggerConfig.SetDescription(b)); + Description(b => b.ProducesOneOf( + StatusCodes.Status204NoContent, + StatusCodes.Status400BadRequest, + StatusCodes.Status403Forbidden, + StatusCodes.Status404NotFound, + StatusCodes.Status410Gone, + StatusCodes.Status412PreconditionFailed, + StatusCodes.Status422UnprocessableEntity)); } - public override async Task HandleAsync(SetDialogSystemLabelCommand req, CancellationToken ct) + public override async Task HandleAsync(SystemLabelCommand req, CancellationToken ct) { var result = await _sender.Send(req, ct); await result.Match( diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogSystemLabels/Set/SetDialogSystemLabelSwaggerConfig.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogSystemLabels/Set/SetDialogSystemLabelSwaggerConfig.cs deleted file mode 100644 index b7c9235142..0000000000 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogSystemLabels/Set/SetDialogSystemLabelSwaggerConfig.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; - -namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.EndUser.DialogSystemLabels.Set; - -public sealed class SetDialogSystemLabelSwaggerConfig -{ - public static string OperationId => "SetDialogLabel"; - public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) => builder.OperationId(OperationId).ProducesOneOf( - StatusCodes.Status204NoContent, - StatusCodes.Status400BadRequest, - StatusCodes.Status403Forbidden, - StatusCodes.Status404NotFound, - StatusCodes.Status410Gone, - StatusCodes.Status412PreconditionFailed, - StatusCodes.Status422UnprocessableEntity); -} diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogTransmissions/Get/GetDialogTransmissionEndpoint.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogTransmissions/Get/GetDialogTransmissionEndpoint.cs index f788e65cf2..7f1c9481c5 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogTransmissions/Get/GetDialogTransmissionEndpoint.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogTransmissions/Get/GetDialogTransmissionEndpoint.cs @@ -1,12 +1,13 @@ using Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogTransmissions.Queries.Get; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; +using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; using MediatR; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.EndUser.DialogTransmissions.Get; -public sealed class GetDialogTransmissionEndpoint : Endpoint +public sealed class GetDialogTransmissionEndpoint : Endpoint { private readonly ISender _sender; @@ -21,10 +22,12 @@ public override void Configure() Policies(AuthorizationPolicy.EndUser); Group(); - Description(b => GetDialogTransmissionSwaggerConfig.SetDescription(b)); + Description(b => b.ProducesOneOf( + StatusCodes.Status200OK, + StatusCodes.Status404NotFound)); } - public override async Task HandleAsync(GetDialogTransmissionQuery req, CancellationToken ct) + public override async Task HandleAsync(GetTransmissionQuery req, CancellationToken ct) { var result = await _sender.Send(req, ct); await result.Match( diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogTransmissions/Get/GetDialogTransmissionSwaggerConfig.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogTransmissions/Get/GetDialogTransmissionEndpointSummary.cs similarity index 62% rename from src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogTransmissions/Get/GetDialogTransmissionSwaggerConfig.cs rename to src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogTransmissions/Get/GetDialogTransmissionEndpointSummary.cs index 14e6d64eb1..993d711cc6 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogTransmissions/Get/GetDialogTransmissionSwaggerConfig.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogTransmissions/Get/GetDialogTransmissionEndpointSummary.cs @@ -1,26 +1,10 @@ -using Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.DialogTransmissions.Queries.Get; using Digdir.Domain.Dialogporten.WebApi.Common; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; -using Digdir.Domain.Dialogporten.WebApi.Common.Swagger; -using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.EndUser.DialogTransmissions.Get; -public sealed class GetDialogTransmissionSwaggerConfig : ISwaggerConfig -{ - public static string OperationId => "GetDialogTransmission"; - - public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) - => builder.OperationId(OperationId) - .ProducesOneOf( - StatusCodes.Status200OK, - StatusCodes.Status404NotFound); - - public static object GetExample() => throw new NotImplementedException(); -} - public sealed class GetDialogTransmissionEndpointSummary : Summary { public GetDialogTransmissionEndpointSummary() diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogTransmissions/Search/SearchDialogTransmissionEndpoint.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogTransmissions/Search/SearchDialogTransmissionEndpoint.cs index ec110f6704..4b87ac8ae5 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogTransmissions/Search/SearchDialogTransmissionEndpoint.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogTransmissions/Search/SearchDialogTransmissionEndpoint.cs @@ -6,7 +6,7 @@ namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.EndUser.DialogTransmissions.Search; -public sealed class SearchDialogTransmissionEndpoint : Endpoint> +public sealed class SearchDialogTransmissionEndpoint : Endpoint> { private readonly ISender _sender; @@ -20,11 +20,9 @@ public override void Configure() Get("dialogs/{dialogId}/transmissions"); Policies(AuthorizationPolicy.EndUser); Group(); - - Description(b => SearchDialogTransmissionSwaggerConfig.SetDescription(b)); } - public override async Task HandleAsync(SearchDialogTransmissionQuery req, CancellationToken ct) + public override async Task HandleAsync(SearchTransmissionQuery req, CancellationToken ct) { var result = await _sender.Send(req, ct); await result.Match( diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogTransmissions/Search/SearchDialogTransmissionSwaggerConfig.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogTransmissions/Search/SearchDialogTransmissionEndpointSummary.cs similarity index 68% rename from src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogTransmissions/Search/SearchDialogTransmissionSwaggerConfig.cs rename to src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogTransmissions/Search/SearchDialogTransmissionEndpointSummary.cs index 7da6f7ca75..3756b2a4f5 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogTransmissions/Search/SearchDialogTransmissionSwaggerConfig.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/DialogTransmissions/Search/SearchDialogTransmissionEndpointSummary.cs @@ -2,22 +2,11 @@ using Digdir.Domain.Dialogporten.WebApi.Common; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; -using Digdir.Domain.Dialogporten.WebApi.Common.Swagger; -using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.EndUser.DialogTransmissions.Search; -public sealed class SearchDialogTransmissionSwaggerConfig : ISwaggerConfig -{ - public static string OperationId => "GetDialogTransmissionList"; - public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) - => builder.OperationId(OperationId); - - public static object GetExample() => throw new NotImplementedException(); -} - -public sealed class SearchDialogTransmissionEndpointSummary : Summary +public sealed class SearchDialogTransmissionEndpointSummary : Summary { public SearchDialogTransmissionEndpointSummary() { diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Dialogs/Get/GetDialogEndpoint.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Dialogs/Get/GetDialogEndpoint.cs index bfafbb5643..5f3fcdba13 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Dialogs/Get/GetDialogEndpoint.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Dialogs/Get/GetDialogEndpoint.cs @@ -1,12 +1,13 @@ using Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.Dialogs.Queries.Get; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; +using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; using MediatR; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.EndUser.Dialogs.Get; -public sealed class GetDialogEndpoint : Endpoint +public sealed class GetDialogEndpoint : Endpoint { private readonly ISender _sender; @@ -21,7 +22,9 @@ public override void Configure() Policies(AuthorizationPolicy.EndUser); Group(); - Description(d => GetDialogSwaggerConfig.SetDescription(d)); + Description(d => d.ProducesOneOf( + StatusCodes.Status200OK, + StatusCodes.Status404NotFound)); } public override async Task HandleAsync(GetDialogQuery req, CancellationToken ct) diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Dialogs/Get/GetDialogSwaggerConfig.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Dialogs/Get/GetDialogEndpointSummary.cs similarity index 59% rename from src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Dialogs/Get/GetDialogSwaggerConfig.cs rename to src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Dialogs/Get/GetDialogEndpointSummary.cs index 80f986c6ff..60a8fb0ecf 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Dialogs/Get/GetDialogSwaggerConfig.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Dialogs/Get/GetDialogEndpointSummary.cs @@ -1,25 +1,9 @@ -using Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.Dialogs.Queries.Get; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; -using Digdir.Domain.Dialogporten.WebApi.Common.Swagger; using Digdir.Domain.Dialogporten.WebApi.Common; -using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.EndUser.Dialogs.Get; -public abstract class GetDialogSwaggerConfig : ISwaggerConfig -{ - public static string OperationId => "GetDialog"; - - public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) => - builder.OperationId(OperationId) - .ProducesOneOf( - StatusCodes.Status200OK, - StatusCodes.Status404NotFound); - - public static object GetExample() => throw new NotImplementedException(); -} - public sealed class GetDialogEndpointSummary : Summary { public GetDialogEndpointSummary() diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Dialogs/Search/SearchDialogEndpoint.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Dialogs/Search/SearchDialogEndpoint.cs index 591732bd9c..aca85891e4 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Dialogs/Search/SearchDialogEndpoint.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Dialogs/Search/SearchDialogEndpoint.cs @@ -7,7 +7,7 @@ namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.EndUser.Dialogs.Search; -public sealed class SearchDialogEndpoint : Endpoint> +public sealed class SearchDialogEndpoint : Endpoint> { private readonly ISender _sender; @@ -21,8 +21,7 @@ public override void Configure() Get("dialogs"); Policies(AuthorizationPolicy.EndUser); Group(); - - Description(d => SearchDialogSwaggerConfig.SetDescription(d)); + Description(d => d.ClearDefaultProduces(StatusCodes.Status403Forbidden)); } public override async Task HandleAsync(SearchDialogQuery req, CancellationToken ct) diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Dialogs/Search/SearchDialogSwaggerConfig.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Dialogs/Search/SearchDialogEndpointSummary.cs similarity index 75% rename from src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Dialogs/Search/SearchDialogSwaggerConfig.cs rename to src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Dialogs/Search/SearchDialogEndpointSummary.cs index 1fc4667d17..3095a51a39 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Dialogs/Search/SearchDialogSwaggerConfig.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Dialogs/Search/SearchDialogEndpointSummary.cs @@ -1,24 +1,11 @@ using Digdir.Domain.Dialogporten.Application.Common.Pagination; using Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.Dialogs.Queries.Search; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; -using Digdir.Domain.Dialogporten.WebApi.Common.Swagger; using Digdir.Domain.Dialogporten.WebApi.Common; -using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.EndUser.Dialogs.Search; -public abstract class SearchDialogSwaggerConfig : ISwaggerConfig -{ - public static string OperationId => "GetDialogList"; - - public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) => - builder.OperationId(OperationId) - .ClearDefaultProduces(StatusCodes.Status403Forbidden); - - public static object GetExample() => throw new NotImplementedException(); -} - public sealed class SearchDialogEndpointSummary : Summary { public SearchDialogEndpointSummary() diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Parties/Get/GetPartiesEndpoint.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Parties/Get/GetPartiesEndpoint.cs index 949f137195..005bfae228 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Parties/Get/GetPartiesEndpoint.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Parties/Get/GetPartiesEndpoint.cs @@ -5,7 +5,7 @@ namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.EndUser.Parties.Get; -public sealed class GetPartiesEndpoint : EndpointWithoutRequest +public sealed class GetPartiesEndpoint : EndpointWithoutRequest { private readonly ISender _sender; @@ -20,7 +20,7 @@ public override void Configure() Policies(AuthorizationPolicy.EndUser); Group(); - Description(d => GetPartiesSwaggerConfig.SetDescription(d)); + Description(d => d.Produces>()); } public override async Task HandleAsync(CancellationToken ct) diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Parties/Get/GetPartiesSwaggerConfig.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Parties/Get/GetPartiesEndpointSummary.cs similarity index 50% rename from src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Parties/Get/GetPartiesSwaggerConfig.cs rename to src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Parties/Get/GetPartiesEndpointSummary.cs index fe761bd1ab..05b95ee72c 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Parties/Get/GetPartiesSwaggerConfig.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/EndUser/Parties/Get/GetPartiesEndpointSummary.cs @@ -1,21 +1,7 @@ -using Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.Parties.Queries.Get; -using Digdir.Domain.Dialogporten.WebApi.Common.Swagger; -using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.EndUser.Parties.Get; -public sealed class GetPartiesSwaggerConfig : ISwaggerConfig -{ - public static string OperationId => "GetParties"; - - public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) - => builder.OperationId(OperationId) - .Produces>(); - - public static object GetExample() => throw new NotImplementedException(); -} - public sealed class GetPartiesEndpointSummary : Summary { public GetPartiesEndpointSummary() diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Create/CreateDialogActivityEndpoint.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Create/CreateDialogActivityEndpoint.cs index e77a9779b5..1d58c7cdc4 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Create/CreateDialogActivityEndpoint.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Create/CreateDialogActivityEndpoint.cs @@ -3,16 +3,18 @@ using Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.Dialogs.Queries.Get; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; +using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.ServiceOwner.DialogActivities.Get; using Digdir.Library.Entity.Abstractions.Features.Identifiable; using FastEndpoints; using MediatR; +using ActivityDto = Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.Dialogs.Commands.Update.ActivityDto; using Constants = Digdir.Domain.Dialogporten.WebApi.Common.Constants; using IMapper = AutoMapper.IMapper; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.ServiceOwner.DialogActivities.Create; -public sealed class CreateDialogActivityEndpoint : Endpoint +public sealed class CreateDialogActivityEndpoint : Endpoint { private readonly IMapper _mapper; private readonly ISender _sender; @@ -29,10 +31,15 @@ public override void Configure() Policies(AuthorizationPolicy.ServiceProvider); Group(); - Description(b => CreateDialogActivitySwaggerConfig.SetDescription(b)); + Description(b => b.ProducesOneOf( + StatusCodes.Status201Created, + StatusCodes.Status400BadRequest, + StatusCodes.Status404NotFound, + StatusCodes.Status412PreconditionFailed, + StatusCodes.Status422UnprocessableEntity)); } - public override async Task HandleAsync(CreateDialogActivityRequest req, CancellationToken ct) + public override async Task HandleAsync(CreateActivityRequest req, CancellationToken ct) { var dialogQueryResult = await _sender.Send(new GetDialogQuery { DialogId = req.DialogId }, ct); if (!dialogQueryResult.TryPickT0(out var dialog, out var errors)) @@ -57,7 +64,7 @@ await errors.Match( var result = await _sender.Send(updateDialogCommand, ct); await result.Match( - success => SendCreatedAtAsync(new GetDialogActivityQuery { DialogId = dialog.Id, ActivityId = req.Id.Value }, req.Id, cancellation: ct), + success => SendCreatedAtAsync(new GetActivityQuery { DialogId = dialog.Id, ActivityId = req.Id.Value }, req.Id, cancellation: ct), notFound => this.NotFoundAsync(notFound, ct), badRequest => this.BadRequestAsync(badRequest, ct), validationError => this.BadRequestAsync(validationError, ct), @@ -67,7 +74,7 @@ await result.Match( } } -public sealed class CreateDialogActivityRequest : UpdateDialogDialogActivityDto +public sealed class CreateActivityRequest : ActivityDto { public Guid DialogId { get; set; } diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Create/CreateDialogActivitySwaggerConfig.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Create/CreateDialogActivityEndpointSummary.cs similarity index 68% rename from src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Create/CreateDialogActivitySwaggerConfig.cs rename to src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Create/CreateDialogActivityEndpointSummary.cs index 116b6c0204..3a74141dbb 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Create/CreateDialogActivitySwaggerConfig.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Create/CreateDialogActivityEndpointSummary.cs @@ -1,28 +1,10 @@ using Digdir.Domain.Dialogporten.WebApi.Common; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; -using Digdir.Domain.Dialogporten.WebApi.Common.Swagger; -using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.ServiceOwner.DialogActivities.Create; -public sealed class CreateDialogActivitySwaggerConfig : ISwaggerConfig -{ - public static string OperationId => "CreateDialogActivity"; - - public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) - => builder.OperationId("CreateDialogActivity") - .ProducesOneOf( - StatusCodes.Status201Created, - StatusCodes.Status400BadRequest, - StatusCodes.Status404NotFound, - StatusCodes.Status412PreconditionFailed, - StatusCodes.Status422UnprocessableEntity); - - public static object GetExample() => throw new NotImplementedException(); -} - public sealed class CreateDialogActivityEndpointSummary : Summary { public CreateDialogActivityEndpointSummary() diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Get/GetDialogActivityEndpoint.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Get/GetDialogActivityEndpoint.cs index 16fb86db5f..c4458f825b 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Get/GetDialogActivityEndpoint.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Get/GetDialogActivityEndpoint.cs @@ -1,12 +1,13 @@ using Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.DialogActivities.Queries.Get; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; +using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; using MediatR; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.ServiceOwner.DialogActivities.Get; -public sealed class GetDialogActivityEndpoint : Endpoint +public sealed class GetDialogActivityEndpoint : Endpoint { private readonly ISender _sender; @@ -20,11 +21,12 @@ public override void Configure() Get("dialogs/{dialogId}/activities/{activityId}"); Policies(AuthorizationPolicy.ServiceProvider); Group(); - - Description(b => GetDialogActivitySwaggerConfig.SetDescription(b)); + Description(b => b.ProducesOneOf( + StatusCodes.Status200OK, + StatusCodes.Status404NotFound)); } - public override async Task HandleAsync(GetDialogActivityQuery req, CancellationToken ct) + public override async Task HandleAsync(GetActivityQuery req, CancellationToken ct) { var result = await _sender.Send(req, ct); await result.Match( diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Get/GetDialogActivitySwaggerConfig.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Get/GetDialogActivitySwaggerConfig.cs index ec793a0f1e..b143b49fe8 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Get/GetDialogActivitySwaggerConfig.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Get/GetDialogActivitySwaggerConfig.cs @@ -1,26 +1,10 @@ -using Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.DialogActivities.Queries.Get; using Digdir.Domain.Dialogporten.WebApi.Common; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; -using Digdir.Domain.Dialogporten.WebApi.Common.Swagger; -using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.ServiceOwner.DialogActivities.Get; -public sealed class GetDialogActivitySwaggerConfig : ISwaggerConfig -{ - public static string OperationId => "GetDialogActivitySO"; - - public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) - => builder.OperationId(OperationId) - .ProducesOneOf( - StatusCodes.Status200OK, - StatusCodes.Status404NotFound); - - public static object GetExample() => throw new NotImplementedException(); -} - public sealed class GetDialogActivityEndpointSummary : Summary { public GetDialogActivityEndpointSummary() diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/NotificationCondition/NotificationConditionEndpoint.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/NotificationCondition/NotificationConditionEndpoint.cs index 1c47a4cdd2..95dbaffa58 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/NotificationCondition/NotificationConditionEndpoint.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/NotificationCondition/NotificationConditionEndpoint.cs @@ -20,8 +20,6 @@ public override void Configure() Get("dialogs/{dialogId}/actions/should-send-notification"); Policies(AuthorizationPolicy.NotificationConditionCheck); Group(); - - Description(b => NotificationConditionSwaggerConfig.SetDescription(b)); } public override async Task HandleAsync(NotificationConditionQuery req, CancellationToken ct) diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/NotificationCondition/NotificationConditionSwaggerConfig.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/NotificationCondition/SearchDialogActivityEndpointSummary.cs similarity index 72% rename from src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/NotificationCondition/NotificationConditionSwaggerConfig.cs rename to src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/NotificationCondition/SearchDialogActivityEndpointSummary.cs index adc8f6b068..b865cd724c 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/NotificationCondition/NotificationConditionSwaggerConfig.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/NotificationCondition/SearchDialogActivityEndpointSummary.cs @@ -2,23 +2,11 @@ using Digdir.Domain.Dialogporten.WebApi.Common; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; -using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; -using Digdir.Domain.Dialogporten.WebApi.Common.Swagger; using FastEndpoints; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.ServiceOwner.DialogActivities.NotificationCondition; -public sealed class NotificationConditionSwaggerConfig : ISwaggerConfig -{ - public static string OperationId => "GetDialogActivityNotificationConditionSO"; - - public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) - => builder.OperationId(OperationId); - - public static object GetExample() => throw new NotImplementedException(); -} - public sealed class SearchDialogActivityEndpointSummary : Summary { public SearchDialogActivityEndpointSummary() diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Search/SearchDialogActivityEndpoint.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Search/SearchDialogActivityEndpoint.cs index 4b4f54b6e7..8f4bbbe498 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Search/SearchDialogActivityEndpoint.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Search/SearchDialogActivityEndpoint.cs @@ -6,7 +6,7 @@ namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.ServiceOwner.DialogActivities.Search; -public sealed class SearchDialogActivityEndpoint : Endpoint> +public sealed class SearchDialogActivityEndpoint : Endpoint> { private readonly ISender _sender; @@ -20,11 +20,9 @@ public override void Configure() Get("dialogs/{dialogId}/activities"); Policies(AuthorizationPolicy.ServiceProvider); Group(); - - Description(b => SearchDialogActivitySwaggerConfig.SetDescription(b)); } - public override async Task HandleAsync(SearchDialogActivityQuery req, CancellationToken ct) + public override async Task HandleAsync(SearchActivityQuery req, CancellationToken ct) { var result = await _sender.Send(req, ct); await result.Match( diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Search/SearchDialogActivitySwaggerConfig.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Search/SearchDialogActivityEndpointSummary.cs similarity index 69% rename from src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Search/SearchDialogActivitySwaggerConfig.cs rename to src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Search/SearchDialogActivityEndpointSummary.cs index f44d5905ae..39cf27bf6c 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Search/SearchDialogActivitySwaggerConfig.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogActivities/Search/SearchDialogActivityEndpointSummary.cs @@ -2,22 +2,11 @@ using Digdir.Domain.Dialogporten.WebApi.Common; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; -using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; -using Digdir.Domain.Dialogporten.WebApi.Common.Swagger; using FastEndpoints; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.ServiceOwner.DialogActivities.Search; -public sealed class SearchDialogActivitySwaggerConfig : ISwaggerConfig -{ - public static string OperationId => "GetDialogActivityListSO"; - public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) - => builder.OperationId(OperationId); - - public static object GetExample() => throw new NotImplementedException(); -} - -public sealed class SearchDialogActivityEndpointSummary : Summary +public sealed class SearchDialogActivityEndpointSummary : Summary { public SearchDialogActivityEndpointSummary() { diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogSeenLogs/Get/GetDialogSeenLogEndpoint.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogSeenLogs/Get/GetDialogSeenLogEndpoint.cs index d46749684a..be2ef224fe 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogSeenLogs/Get/GetDialogSeenLogEndpoint.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogSeenLogs/Get/GetDialogSeenLogEndpoint.cs @@ -1,12 +1,13 @@ using Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.DialogSeenLogs.Queries.Get; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; +using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; using MediatR; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.ServiceOwner.DialogSeenLogs.Get; -public sealed class GetDialogSeenLogEndpoint : Endpoint +public sealed class GetDialogSeenLogEndpoint : Endpoint { private readonly ISender _sender; @@ -21,10 +22,12 @@ public override void Configure() Policies(AuthorizationPolicy.ServiceProvider); Group(); - Description(d => GetDialogSeenLogSwaggerConfig.SetDescription(d)); + Description(d => d.ProducesOneOf( + StatusCodes.Status200OK, + StatusCodes.Status404NotFound)); } - public override async Task HandleAsync(GetDialogSeenLogQuery req, CancellationToken ct) + public override async Task HandleAsync(GetSeenLogQuery req, CancellationToken ct) { var result = await _sender.Send(req, ct); await result.Match( diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogSeenLogs/Get/GetDialogSeenLogSwaggerConfig.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogSeenLogs/Get/GetDialogSeenLogEndpointSummary.cs similarity index 50% rename from src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogSeenLogs/Get/GetDialogSeenLogSwaggerConfig.cs rename to src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogSeenLogs/Get/GetDialogSeenLogEndpointSummary.cs index 469dafdf72..57fd7a70a0 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogSeenLogs/Get/GetDialogSeenLogSwaggerConfig.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogSeenLogs/Get/GetDialogSeenLogEndpointSummary.cs @@ -1,24 +1,9 @@ -using Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.DialogSeenLogs.Queries.Get; using Digdir.Domain.Dialogporten.WebApi.Common; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; -using Digdir.Domain.Dialogporten.WebApi.Common.Swagger; -using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.ServiceOwner.DialogSeenLogs.Get; -public sealed class GetDialogSeenLogSwaggerConfig : ISwaggerConfig -{ - public static string OperationId => "GetDialogSeenLogSO"; - public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) - => builder.OperationId(OperationId) - .ProducesOneOf( - StatusCodes.Status200OK, - StatusCodes.Status404NotFound); - - public static object GetExample() => throw new NotImplementedException(); -} - public sealed class GetDialogSeenLogEndpointSummary : Summary { public GetDialogSeenLogEndpointSummary() diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogSeenLogs/Search/SearchDialogSeenLogEndpoint.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogSeenLogs/Search/SearchDialogSeenLogEndpoint.cs index 5bb9239e1f..a00d6b4aff 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogSeenLogs/Search/SearchDialogSeenLogEndpoint.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogSeenLogs/Search/SearchDialogSeenLogEndpoint.cs @@ -1,12 +1,13 @@ using Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.DialogSeenLogs.Queries.Search; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; +using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; using MediatR; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.ServiceOwner.DialogSeenLogs.Search; -public sealed class SearchDialogSeenLogEndpoint : Endpoint> +public sealed class SearchDialogSeenLogEndpoint : Endpoint> { private readonly ISender _sender; @@ -21,10 +22,12 @@ public override void Configure() Policies(AuthorizationPolicy.ServiceProvider); Group(); - Description(d => SearchDialogSeenLogSwaggerConfig.SetDescription(d)); + Description(d => d.ProducesOneOf>( + StatusCodes.Status200OK, + StatusCodes.Status404NotFound)); } - public override async Task HandleAsync(SearchDialogSeenLogQuery req, CancellationToken ct) + public override async Task HandleAsync(SearchSeenLogQuery req, CancellationToken ct) { var result = await _sender.Send(req, ct); await result.Match( diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogSeenLogs/Search/SearchDialogSeenLogSwaggerConfig.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogSeenLogs/Search/SearchDialogSeenLogEndpointSummary.cs similarity index 51% rename from src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogSeenLogs/Search/SearchDialogSeenLogSwaggerConfig.cs rename to src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogSeenLogs/Search/SearchDialogSeenLogEndpointSummary.cs index 2233d36cf1..b44311f0b8 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogSeenLogs/Search/SearchDialogSeenLogSwaggerConfig.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogSeenLogs/Search/SearchDialogSeenLogEndpointSummary.cs @@ -1,25 +1,9 @@ -using Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.DialogSeenLogs.Queries.Search; using Digdir.Domain.Dialogporten.WebApi.Common; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; -using Digdir.Domain.Dialogporten.WebApi.Common.Swagger; -using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.ServiceOwner.DialogSeenLogs.Search; -public sealed class SearchDialogSeenLogSwaggerConfig : ISwaggerConfig -{ - public static string OperationId => "SearchDialogSeenLogSO"; - - public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) - => builder.OperationId(OperationId) - .ProducesOneOf>( - StatusCodes.Status200OK, - StatusCodes.Status404NotFound); - - public static object GetExample() => throw new NotImplementedException(); -} - public sealed class SearchDialogSeenLogEndpointSummary : Summary { public SearchDialogSeenLogEndpointSummary() diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Create/CreateDialogTransmissionEndpoint.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Create/CreateDialogTransmissionEndpoint.cs index 929acc7ef2..fc3b8adc06 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Create/CreateDialogTransmissionEndpoint.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Create/CreateDialogTransmissionEndpoint.cs @@ -3,16 +3,18 @@ using Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.DialogTransmissions.Queries.Get; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; +using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.ServiceOwner.DialogTransmissions.Get; using Digdir.Library.Entity.Abstractions.Features.Identifiable; using FastEndpoints; using MediatR; using Constants = Digdir.Domain.Dialogporten.WebApi.Common.Constants; using IMapper = AutoMapper.IMapper; +using TransmissionDto = Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.Dialogs.Commands.Update.TransmissionDto; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.ServiceOwner.DialogTransmissions.Create; -public sealed class CreateDialogTransmissionEndpoint : Endpoint +public sealed class CreateDialogTransmissionEndpoint : Endpoint { private readonly IMapper _mapper; private readonly ISender _sender; @@ -29,10 +31,15 @@ public override void Configure() Policies(AuthorizationPolicy.ServiceProvider); Group(); - Description(b => CreateDialogTransmissionSwaggerConfig.SetDescription(b)); + Description(b => b.ProducesOneOf( + StatusCodes.Status201Created, + StatusCodes.Status400BadRequest, + StatusCodes.Status404NotFound, + StatusCodes.Status412PreconditionFailed, + StatusCodes.Status422UnprocessableEntity)); } - public override async Task HandleAsync(CreateDialogTransmissionRequest req, CancellationToken ct) + public override async Task HandleAsync(CreateTransmissionRequest req, CancellationToken ct) { var dialogQueryResult = await _sender.Send(new GetDialogQuery { DialogId = req.DialogId }, ct); if (!dialogQueryResult.TryPickT0(out var dialog, out var errors)) @@ -58,7 +65,7 @@ await errors.Match( var result = await _sender.Send(updateDialogCommand, ct); await result.Match( - success => SendCreatedAtAsync(new GetDialogTransmissionQuery { DialogId = dialog.Id, TransmissionId = req.Id.Value }, req.Id, cancellation: ct), + success => SendCreatedAtAsync(new GetTransmissionQuery { DialogId = dialog.Id, TransmissionId = req.Id.Value }, req.Id, cancellation: ct), notFound => this.NotFoundAsync(notFound, ct), badRequest => this.BadRequestAsync(badRequest, ct), validationError => this.BadRequestAsync(validationError, ct), @@ -68,7 +75,7 @@ await result.Match( } } -public sealed class CreateDialogTransmissionRequest : UpdateDialogDialogTransmissionDto +public sealed class CreateTransmissionRequest : TransmissionDto { public Guid DialogId { get; set; } diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Create/CreateDialogTransmissionSwaggerConfig.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Create/CreateDialogTransmissionEndpointSummary.cs similarity index 68% rename from src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Create/CreateDialogTransmissionSwaggerConfig.cs rename to src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Create/CreateDialogTransmissionEndpointSummary.cs index 5c1ba3ec94..c0971d2168 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Create/CreateDialogTransmissionSwaggerConfig.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Create/CreateDialogTransmissionEndpointSummary.cs @@ -1,28 +1,10 @@ using Digdir.Domain.Dialogporten.WebApi.Common; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; -using Digdir.Domain.Dialogporten.WebApi.Common.Swagger; -using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.ServiceOwner.DialogTransmissions.Create; -public sealed class CreateDialogTransmissionSwaggerConfig : ISwaggerConfig -{ - public static string OperationId => "CreateDialogTransmission"; - - public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) - => builder.OperationId(OperationId) - .ProducesOneOf( - StatusCodes.Status201Created, - StatusCodes.Status400BadRequest, - StatusCodes.Status404NotFound, - StatusCodes.Status412PreconditionFailed, - StatusCodes.Status422UnprocessableEntity); - - public static object GetExample() => throw new NotImplementedException(); -} - public sealed class CreateDialogTransmissionEndpointSummary : Summary { public CreateDialogTransmissionEndpointSummary() diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Get/GetDialogTransmissionEndpoint.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Get/GetDialogTransmissionEndpoint.cs index 9315072090..b3a1d75387 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Get/GetDialogTransmissionEndpoint.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Get/GetDialogTransmissionEndpoint.cs @@ -1,12 +1,13 @@ using Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.DialogTransmissions.Queries.Get; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; +using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; using MediatR; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.ServiceOwner.DialogTransmissions.Get; -public sealed class GetDialogTransmissionEndpoint : Endpoint +public sealed class GetDialogTransmissionEndpoint : Endpoint { private readonly ISender _sender; @@ -21,10 +22,12 @@ public override void Configure() Policies(AuthorizationPolicy.ServiceProvider); Group(); - Description(b => GetDialogTransmissionSwaggerConfig.SetDescription(b)); + Description(b => b.ProducesOneOf( + StatusCodes.Status200OK, + StatusCodes.Status404NotFound)); } - public override async Task HandleAsync(GetDialogTransmissionQuery req, CancellationToken ct) + public override async Task HandleAsync(GetTransmissionQuery req, CancellationToken ct) { var result = await _sender.Send(req, ct); await result.Match( diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Get/GetDialogTransmissionSwaggerConfig.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Get/GetDialogTransmissionEndpointSummary.cs similarity index 62% rename from src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Get/GetDialogTransmissionSwaggerConfig.cs rename to src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Get/GetDialogTransmissionEndpointSummary.cs index 30975dc37d..778fea10a4 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Get/GetDialogTransmissionSwaggerConfig.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Get/GetDialogTransmissionEndpointSummary.cs @@ -1,26 +1,10 @@ -using Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.DialogTransmissions.Queries.Get; using Digdir.Domain.Dialogporten.WebApi.Common; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; -using Digdir.Domain.Dialogporten.WebApi.Common.Swagger; -using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.ServiceOwner.DialogTransmissions.Get; -public sealed class GetDialogTransmissionSwaggerConfig : ISwaggerConfig -{ - public static string OperationId => "GetDialogTransmissionSO"; - - public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) - => builder.OperationId(OperationId) - .ProducesOneOf( - StatusCodes.Status200OK, - StatusCodes.Status404NotFound); - - public static object GetExample() => throw new NotImplementedException(); -} - public sealed class GetDialogTransmissionEndpointSummary : Summary { public GetDialogTransmissionEndpointSummary() diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Search/SearchDialogTransmissionEndpoint.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Search/SearchDialogTransmissionEndpoint.cs index 01117f5c18..aa8c416c76 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Search/SearchDialogTransmissionEndpoint.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Search/SearchDialogTransmissionEndpoint.cs @@ -1,12 +1,13 @@ using Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.DialogTransmissions.Queries.Search; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; +using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; using MediatR; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.ServiceOwner.DialogTransmissions.Search; -public sealed class SearchDialogTransmissionEndpoint : Endpoint> +public sealed class SearchDialogTransmissionEndpoint : Endpoint> { private readonly ISender _sender; @@ -21,10 +22,12 @@ public override void Configure() Policies(AuthorizationPolicy.ServiceProvider); Group(); - Description(b => SearchDialogTransmissionSwaggerConfig.SetDescription(b)); + Description(b => b.ProducesOneOf( + StatusCodes.Status200OK, + StatusCodes.Status404NotFound)); } - public override async Task HandleAsync(SearchDialogTransmissionQuery req, CancellationToken ct) + public override async Task HandleAsync(SearchTransmissionQuery req, CancellationToken ct) { var result = await _sender.Send(req, ct); await result.Match( diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Search/SearchDialogTransmissionSwaggerConfig.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Search/SearchDialogTransmissionEndpointSummary.cs similarity index 68% rename from src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Search/SearchDialogTransmissionSwaggerConfig.cs rename to src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Search/SearchDialogTransmissionEndpointSummary.cs index a19b76dd17..1e780af8c4 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Search/SearchDialogTransmissionSwaggerConfig.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/DialogTransmissions/Search/SearchDialogTransmissionEndpointSummary.cs @@ -2,22 +2,11 @@ using Digdir.Domain.Dialogporten.WebApi.Common; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; -using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; -using Digdir.Domain.Dialogporten.WebApi.Common.Swagger; using FastEndpoints; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.ServiceOwner.DialogTransmissions.Search; -public sealed class SearchDialogTransmissionSwaggerConfig : ISwaggerConfig -{ - public static string OperationId => "GetDialogTransmissionListSO"; - public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) - => builder.OperationId(OperationId); - - public static object GetExample() => throw new NotImplementedException(); -} - -public sealed class SearchDialogTransmissionEndpointSummary : Summary +public sealed class SearchDialogTransmissionEndpointSummary : Summary { public SearchDialogTransmissionEndpointSummary() { diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Create/CreateDialogEndpoint.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Create/CreateDialogEndpoint.cs index a7076cdebd..cbc9938e7d 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Create/CreateDialogEndpoint.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Create/CreateDialogEndpoint.cs @@ -2,6 +2,7 @@ using Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.Dialogs.Queries.Get; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; +using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.ServiceOwner.Dialogs.Get; using FastEndpoints; using MediatR; @@ -23,7 +24,10 @@ public override void Configure() Policies(AuthorizationPolicy.ServiceProvider); Group(); - Description(b => CreateDialogSwaggerConfig.SetDescription(b)); + Description(b => b.ProducesOneOf( + StatusCodes.Status201Created, + StatusCodes.Status400BadRequest, + StatusCodes.Status422UnprocessableEntity)); } public override async Task HandleAsync(CreateDialogCommand req, CancellationToken ct) diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Create/CreateDialogSwaggerConfig.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Create/CreateDialogEndpointSummary.cs similarity index 71% rename from src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Create/CreateDialogSwaggerConfig.cs rename to src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Create/CreateDialogEndpointSummary.cs index 19f0991c89..ae324eb51f 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Create/CreateDialogSwaggerConfig.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Create/CreateDialogEndpointSummary.cs @@ -1,26 +1,10 @@ using Digdir.Domain.Dialogporten.WebApi.Common; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; -using Digdir.Domain.Dialogporten.WebApi.Common.Swagger; -using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.ServiceOwner.Dialogs.Create; -public sealed class CreateDialogSwaggerConfig : ISwaggerConfig -{ - public static string OperationId => "CreateDialog"; - - public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) - => builder.OperationId(OperationId) - .ProducesOneOf( - StatusCodes.Status201Created, - StatusCodes.Status400BadRequest, - StatusCodes.Status422UnprocessableEntity); - - public static object GetExample() => throw new NotImplementedException(); -} - public sealed class CreateDialogEndpointSummary : Summary { public CreateDialogEndpointSummary() diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Delete/DeleteDialogEndpoint.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Delete/DeleteDialogEndpoint.cs index 459126e88a..8e2aeac560 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Delete/DeleteDialogEndpoint.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Delete/DeleteDialogEndpoint.cs @@ -2,6 +2,7 @@ using Digdir.Domain.Dialogporten.WebApi.Common; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; +using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; using MediatR; @@ -22,7 +23,10 @@ public override void Configure() Policies(AuthorizationPolicy.ServiceProvider); Group(); - Description(b => DeleteDialogSwaggerConfig.SetDescription(b)); + Description(b => b.ProducesOneOf( + StatusCodes.Status204NoContent, + StatusCodes.Status404NotFound, + StatusCodes.Status412PreconditionFailed)); } public override async Task HandleAsync(DeleteDialogRequest req, CancellationToken ct) diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Delete/DeleteDialogSwaggerConfig.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Delete/DeleteDialogEndpointSummary.cs similarity index 73% rename from src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Delete/DeleteDialogSwaggerConfig.cs rename to src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Delete/DeleteDialogEndpointSummary.cs index b1b8b981a2..c9d2b1a683 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Delete/DeleteDialogSwaggerConfig.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Delete/DeleteDialogEndpointSummary.cs @@ -1,26 +1,10 @@ using Digdir.Domain.Dialogporten.WebApi.Common; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; -using Digdir.Domain.Dialogporten.WebApi.Common.Swagger; -using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.ServiceOwner.Dialogs.Delete; -public sealed class DeleteDialogSwaggerConfig : ISwaggerConfig -{ - public static string OperationId => "DeleteDialog"; - - public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) - => builder.OperationId(OperationId) - .ProducesOneOf( - StatusCodes.Status204NoContent, - StatusCodes.Status404NotFound, - StatusCodes.Status412PreconditionFailed); - - public static object GetExample() => throw new NotImplementedException(); -} - public sealed class DeleteDialogEndpointSummary : Summary { public DeleteDialogEndpointSummary() diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Get/GetDialogEndpoint.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Get/GetDialogEndpoint.cs index 639cb7e47a..0cc1ae8d7c 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Get/GetDialogEndpoint.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Get/GetDialogEndpoint.cs @@ -1,12 +1,13 @@ using Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.Dialogs.Queries.Get; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; +using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; using MediatR; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.ServiceOwner.Dialogs.Get; -public sealed class GetDialogEndpoint : Endpoint +public sealed class GetDialogEndpoint : Endpoint { private readonly ISender _sender; @@ -21,7 +22,9 @@ public override void Configure() Policies(AuthorizationPolicy.ServiceProvider); Group(); - Description(b => GetDialogSwaggerConfig.SetDescription(b)); + Description(b => b.ProducesOneOf( + StatusCodes.Status200OK, + StatusCodes.Status404NotFound)); } public override async Task HandleAsync(GetDialogQuery req, CancellationToken ct) diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Get/GetDialogSwaggerConfig.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Get/GetDialogEndpointSummary.cs similarity index 64% rename from src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Get/GetDialogSwaggerConfig.cs rename to src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Get/GetDialogEndpointSummary.cs index 81f05fa786..b6ba4d1253 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Get/GetDialogSwaggerConfig.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Get/GetDialogEndpointSummary.cs @@ -1,26 +1,10 @@ -using Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.Dialogs.Queries.Get; using Digdir.Domain.Dialogporten.WebApi.Common; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; -using Digdir.Domain.Dialogporten.WebApi.Common.Swagger; -using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.ServiceOwner.Dialogs.Get; -public sealed class GetDialogSwaggerConfig : ISwaggerConfig -{ - public static string OperationId => "GetDialogSO"; - - public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) - => builder.OperationId(OperationId) - .ProducesOneOf( - StatusCodes.Status200OK, - StatusCodes.Status404NotFound); - - public static object GetExample() => throw new NotImplementedException(); -} - public sealed class GetDialogEndpointSummary : Summary { public GetDialogEndpointSummary() diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Purge/PurgeDialogEndpoint.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Purge/PurgeDialogEndpoint.cs index 6f404e9f7e..f949bea3b9 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Purge/PurgeDialogEndpoint.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Purge/PurgeDialogEndpoint.cs @@ -2,6 +2,7 @@ using Digdir.Domain.Dialogporten.WebApi.Common; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; +using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; using MediatR; @@ -23,7 +24,10 @@ public override void Configure() Policies(AuthorizationPolicy.ServiceProvider); Group(); - Description(b => PurgeDialogSwaggerConfig.SetDescription(b)); + Description(b => b.ProducesOneOf( + StatusCodes.Status204NoContent, + StatusCodes.Status404NotFound, + StatusCodes.Status412PreconditionFailed)); } public override async Task HandleAsync(PurgeDialogRequest req, CancellationToken ct) diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Purge/PurgeDialogSwaggerConfig.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Purge/PurgeDialogEndpointSummary.cs similarity index 68% rename from src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Purge/PurgeDialogSwaggerConfig.cs rename to src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Purge/PurgeDialogEndpointSummary.cs index f3a59458e3..3a95f9f65b 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Purge/PurgeDialogSwaggerConfig.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Purge/PurgeDialogEndpointSummary.cs @@ -1,27 +1,10 @@ using Digdir.Domain.Dialogporten.WebApi.Common; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; -using Digdir.Domain.Dialogporten.WebApi.Common.Swagger; -using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.ServiceOwner.Dialogs.Purge; -public sealed class PurgeDialogSwaggerConfig : ISwaggerConfig -{ - public static string OperationId => "PurgeDialog"; - - public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) - => builder.OperationId(OperationId) - .Accepts() - .ProducesOneOf( - StatusCodes.Status204NoContent, - StatusCodes.Status404NotFound, - StatusCodes.Status412PreconditionFailed); - - public static object GetExample() => throw new NotImplementedException(); -} - public sealed class PurgeDialogEndpointSummary : Summary { public PurgeDialogEndpointSummary() diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Search/SwaggerConfig.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Search/ListDialogEndpointSummary.cs similarity index 78% rename from src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Search/SwaggerConfig.cs rename to src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Search/ListDialogEndpointSummary.cs index ba7236de9c..d139dc6e21 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Search/SwaggerConfig.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Search/ListDialogEndpointSummary.cs @@ -3,23 +3,10 @@ using Digdir.Domain.Dialogporten.WebApi.Common; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; -using Digdir.Domain.Dialogporten.WebApi.Common.Swagger; -using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.ServiceOwner.Dialogs.Search; -public sealed class SwaggerConfig : ISwaggerConfig -{ - public static string OperationId => "GetDialogListSO"; - - public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) - => builder.OperationId(OperationId) - .ClearDefaultProduces(StatusCodes.Status403Forbidden); - - public static object GetExample() => throw new NotImplementedException(); -} - public sealed class ListDialogEndpointSummary : Summary { public ListDialogEndpointSummary() diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Search/SearchDialogEndpoint.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Search/SearchDialogEndpoint.cs index da91031f3c..32ce98897c 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Search/SearchDialogEndpoint.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Search/SearchDialogEndpoint.cs @@ -7,7 +7,7 @@ namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.ServiceOwner.Dialogs.Search; -public sealed class SearchDialogEndpoint : Endpoint> +public sealed class SearchDialogEndpoint : Endpoint> { private readonly ISender _sender; @@ -22,7 +22,7 @@ public override void Configure() Policies(AuthorizationPolicy.ServiceProviderSearch); Group(); - Description(b => SwaggerConfig.SetDescription(b)); + Description(b => b.ClearDefaultProduces(StatusCodes.Status403Forbidden)); } public override async Task HandleAsync(SearchDialogQuery req, CancellationToken ct) diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Update/UpdateDialogEndpoint.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Update/UpdateDialogEndpoint.cs index c259cd3089..30ed6d14ca 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Update/UpdateDialogEndpoint.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Update/UpdateDialogEndpoint.cs @@ -2,6 +2,7 @@ using Digdir.Domain.Dialogporten.WebApi.Common; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; +using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; using MediatR; @@ -22,7 +23,12 @@ public override void Configure() Policies(AuthorizationPolicy.ServiceProvider); Group(); - Description(b => UpdateDialogSwaggerConfig.SetDescription(b)); + Description(b => b.ProducesOneOf( + StatusCodes.Status204NoContent, + StatusCodes.Status400BadRequest, + StatusCodes.Status404NotFound, + StatusCodes.Status412PreconditionFailed, + StatusCodes.Status422UnprocessableEntity)); } public override async Task HandleAsync(UpdateDialogRequest req, CancellationToken ct) diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Update/UpdateDialogSwaggerConfig.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Update/UpdateDialogSwaggerConfig.cs index 2d5e1aadb0..99dbb6e82b 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Update/UpdateDialogSwaggerConfig.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Update/UpdateDialogSwaggerConfig.cs @@ -10,26 +10,12 @@ using Digdir.Domain.Dialogporten.WebApi.Common; using Digdir.Domain.Dialogporten.WebApi.Common.Authorization; using Digdir.Domain.Dialogporten.WebApi.Common.Extensions; -using Digdir.Domain.Dialogporten.WebApi.Common.Swagger; -using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.ServiceOwner.Dialogs.Update; -internal abstract class UpdateDialogSwaggerConfig : ISwaggerConfig +internal abstract class UpdateDialogSwaggerConfig { - public static string OperationId => "ReplaceDialog"; - - public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) => - builder - .OperationId(OperationId) - .ProducesOneOf( - StatusCodes.Status204NoContent, - StatusCodes.Status400BadRequest, - StatusCodes.Status404NotFound, - StatusCodes.Status412PreconditionFailed, - StatusCodes.Status422UnprocessableEntity); - // TODO: Create fakers public static object GetExample() => new UpdateDialogDto { @@ -39,11 +25,11 @@ public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) => Status = DialogStatus.Values.New, SearchTags = [ - new UpdateDialogSearchTagDto + new SearchTagDto { Value = "searchTag" }, - new UpdateDialogSearchTagDto + new SearchTagDto { Value = "anotherSearchTag" } @@ -90,7 +76,7 @@ public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) => DueAt = DateTimeOffset.Parse("2084-04-04T12:13:10.0134400+00:00", CultureInfo.InvariantCulture), Attachments = [ - new UpdateDialogDialogAttachmentDto + new AttachmentDto { Id = Guid.Parse("02a72809-eddd-4192-864d-8f1755d72f4e"), DisplayName = @@ -103,7 +89,7 @@ public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) => ], Urls = [ - new UpdateDialogDialogAttachmentUrlDto + new AttachmentUrlDto { Id = Guid.Parse("858177cb-8584-4d10-a086-3a5defa7a6c3"), Url = new Uri("https://example.com/some-url") @@ -113,7 +99,7 @@ public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) => ], GuiActions = [ - new UpdateDialogDialogGuiActionDto + new GuiActionDto { Id = Guid.Parse("8c64ecc8-7678-44b2-8788-0b5852dd8fa0"), Action = "submit", @@ -137,13 +123,13 @@ public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) => ], ApiActions = [ - new UpdateDialogDialogApiActionDto + new ApiActionDto { Id = Guid.Parse("948b07ba-1a82-403e-8eaa-2e5784af07a9"), Action = "submit", Endpoints = [ - new UpdateDialogDialogApiActionEndpointDto + new ApiActionEndpointDto { Version = "20231015", HttpMethod = HttpVerb.Values.POST, @@ -158,11 +144,11 @@ public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) => ], Activities = [ - new UpdateDialogDialogActivityDto + new ActivityDto { Id = Guid.Parse("8b95d42d-d2b6-4c01-8ca0-a817a4b3c50d"), Type = DialogActivityType.Values.Information, - PerformedBy = new UpdateDialogDialogActivityPerformedByActorDto + PerformedBy = new ActivityPerformedByActorDto { ActorType = ActorType.Values.ServiceOwner }, diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/WellKnown/Jwks/Get/GetJwksEndpoint.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/WellKnown/Jwks/Get/GetJwksEndpoint.cs index 0191583f4a..b24776e70b 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/WellKnown/Jwks/Get/GetJwksEndpoint.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/WellKnown/Jwks/Get/GetJwksEndpoint.cs @@ -1,4 +1,5 @@ using Digdir.Domain.Dialogporten.Application.Features.V1.WellKnown.Jwks.Queries.Get; +using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; using MediatR; using Microsoft.Net.Http.Headers; @@ -19,7 +20,7 @@ public override void Configure() Get(".well-known/jwks.json"); Group(); - Description(b => GetJwksSwaggerConfig.SetDescription(b)); + Description(b => b.ProducesOneOf(StatusCodes.Status200OK)); } public override async Task HandleAsync(CancellationToken ct) diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/WellKnown/Jwks/Get/GetJwksSwaggerConfig.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/WellKnown/Jwks/Get/GetJwksEndpointSummary.cs similarity index 53% rename from src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/WellKnown/Jwks/Get/GetJwksSwaggerConfig.cs rename to src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/WellKnown/Jwks/Get/GetJwksEndpointSummary.cs index 07da496acd..bf35eed5c7 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/WellKnown/Jwks/Get/GetJwksSwaggerConfig.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/WellKnown/Jwks/Get/GetJwksEndpointSummary.cs @@ -1,22 +1,7 @@ -using Digdir.Domain.Dialogporten.Application.Features.V1.WellKnown.Jwks.Queries.Get; -using Digdir.Domain.Dialogporten.WebApi.Common.Swagger; -using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.WellKnown.Jwks.Get; -public sealed class GetJwksSwaggerConfig : ISwaggerConfig -{ - public static string OperationId => "GetJwks"; - - public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) - => builder.OperationId(OperationId) - .ProducesOneOf( - StatusCodes.Status200OK); - - public static object GetExample() => throw new NotImplementedException(); -} - public sealed class GetJwksEndpointSummary : Summary { public GetJwksEndpointSummary() diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/WellKnown/OauthAuthorizationServer/Get/GetOauthAuthorizationServerEndpoint.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/WellKnown/OauthAuthorizationServer/Get/GetOauthAuthorizationServerEndpoint.cs index bb78725caf..53331d36cb 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/WellKnown/OauthAuthorizationServer/Get/GetOauthAuthorizationServerEndpoint.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/WellKnown/OauthAuthorizationServer/Get/GetOauthAuthorizationServerEndpoint.cs @@ -1,4 +1,5 @@ using Digdir.Domain.Dialogporten.Application.Features.V1.WellKnown.OauthAuthorizationServer.Queries.Get; +using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; using MediatR; using Microsoft.Net.Http.Headers; @@ -19,7 +20,7 @@ public override void Configure() Get(".well-known/oauth-authorization-server"); Group(); - Description(b => GetOauthAuthorizationServerSwaggerConfig.SetDescription(b)); + Description(b => b.ProducesOneOf(StatusCodes.Status200OK)); } public override async Task HandleAsync(CancellationToken ct) diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/WellKnown/OauthAuthorizationServer/Get/GetOauthAuthorizationServerSwaggerConfig.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/WellKnown/OauthAuthorizationServer/Get/GetOauthAuthorizationServerEndpointSummary.cs similarity index 52% rename from src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/WellKnown/OauthAuthorizationServer/Get/GetOauthAuthorizationServerSwaggerConfig.cs rename to src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/WellKnown/OauthAuthorizationServer/Get/GetOauthAuthorizationServerEndpointSummary.cs index 2d642a86dc..fef5d28aad 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/WellKnown/OauthAuthorizationServer/Get/GetOauthAuthorizationServerSwaggerConfig.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/WellKnown/OauthAuthorizationServer/Get/GetOauthAuthorizationServerEndpointSummary.cs @@ -1,22 +1,7 @@ -using Digdir.Domain.Dialogporten.Application.Features.V1.WellKnown.OauthAuthorizationServer.Queries.Get; -using Digdir.Domain.Dialogporten.WebApi.Common.Swagger; -using Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.Common.Extensions; using FastEndpoints; namespace Digdir.Domain.Dialogporten.WebApi.Endpoints.V1.WellKnown.OauthAuthorizationServer.Get; -public sealed class GetOauthAuthorizationServerSwaggerConfig : ISwaggerConfig -{ - public static string OperationId => "GetOauthAuthorizationServer"; - - public static RouteHandlerBuilder SetDescription(RouteHandlerBuilder builder) - => builder.OperationId(OperationId) - .ProducesOneOf( - StatusCodes.Status200OK); - - public static object GetExample() => throw new NotImplementedException(); -} - public sealed class GetOauthAuthorizationServerEndpointSummary : Summary { public GetOauthAuthorizationServerEndpointSummary() diff --git a/src/Digdir.Domain.Dialogporten.WebApi/OpenApiDocumentExtensions.cs b/src/Digdir.Domain.Dialogporten.WebApi/OpenApiDocumentExtensions.cs index 6ef78a972a..785dc3bb20 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/OpenApiDocumentExtensions.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/OpenApiDocumentExtensions.cs @@ -36,7 +36,7 @@ private static void ReplaceRequestExampleBody(this OpenApiOperation openApiOpera // TEMP hard coding of operationId, there is only one endpoint with a request body example // More to follow, make look up function based on operationId - if (operationId != "ReplaceDialog") return; + if (operationId != "V1ServiceOwnerDialogsUpdate_Dialog") return; foreach (var (_, value) in openApiOperation.RequestBody.Content) { diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Program.cs b/src/Digdir.Domain.Dialogporten.WebApi/Program.cs index f694977788..dea11d4d36 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Program.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Program.cs @@ -158,6 +158,14 @@ static void BuildAndRun(string[] args, TelemetryConfiguration telemetryConfigura x.Versioning.Prefix = "v"; x.Versioning.PrependToRoute = true; x.Versioning.DefaultVersion = 1; + x.Endpoints.Configurator = endpointDefinition => + { + endpointDefinition.Description(routeHandlerBuilder + => routeHandlerBuilder.Add(endpointBuilder + => endpointBuilder.Metadata.Add( + new EndpointNameMetadata( + TypeNameConverter.ToShortName(endpointDefinition.EndpointType))))); + }; x.Serializer.Options.DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull; // Do not serialize empty collections x.Serializer.Options.TypeInfoResolver = new DefaultJsonTypeInfoResolver diff --git a/src/Digdir.Tool.Dialogporten.GenerateFakeData/DialogGenerator.cs b/src/Digdir.Tool.Dialogporten.GenerateFakeData/DialogGenerator.cs index 91919b3f03..eadeca86ff 100644 --- a/src/Digdir.Tool.Dialogporten.GenerateFakeData/DialogGenerator.cs +++ b/src/Digdir.Tool.Dialogporten.GenerateFakeData/DialogGenerator.cs @@ -32,13 +32,13 @@ public static CreateDialogCommand GenerateFakeDialog( DateTimeOffset? expiresAt = null, string? process = null, DialogStatus.Values? status = null, - CreateDialogContentDto? content = null, - List? searchTags = null, - List? attachments = null, - List? guiActions = null, - List? apiActions = null, - List? activities = null, - List? transmissions = null) + ContentDto? content = null, + List? searchTags = null, + List? attachments = null, + List? guiActions = null, + List? apiActions = null, + List? activities = null, + List? transmissions = null) { return GenerateFakeDialogs( seed, @@ -83,13 +83,13 @@ public static List GenerateFakeDialogs(int? seed = null, DateTimeOffset? expiresAt = null, string? process = null, DialogStatus.Values? status = null, - CreateDialogContentDto? content = null, - List? searchTags = null, - List? attachments = null, - List? guiActions = null, - List? apiActions = null, - List? activities = null, - List? transmissions = null) + ContentDto? content = null, + List? searchTags = null, + List? attachments = null, + List? guiActions = null, + List? apiActions = null, + List? activities = null, + List? transmissions = null) { Randomizer.Seed = seed.HasValue ? new Random(seed.Value) : new Random(); return new Faker() @@ -234,13 +234,13 @@ private static int CalculateControlDigit(string input, int[] weights) return mod == 10 ? -1 : mod; } - public static CreateDialogDialogActivityDto GenerateFakeDialogActivity(DialogActivityType.Values? type = null) + public static ActivityDto GenerateFakeDialogActivity(DialogActivityType.Values? type = null) => GenerateFakeDialogActivities(1, type)[0]; - public static List GenerateFakeDialogTransmissions(int? count = null, + public static List GenerateFakeDialogTransmissions(int? count = null, DialogTransmissionType.Values? type = null) { - return new Faker() + return new Faker() .RuleFor(o => o.Id, _ => Uuid7.NewUuid7().ToGuid(true)) .RuleFor(o => o.CreatedAt, f => f.Date.Past()) .RuleFor(o => o.Type, f => type ?? f.PickRandom()) @@ -253,34 +253,34 @@ public static List GenerateFakeDialogTransmis .Generate(count ?? new Randomizer().Number(1, 4)); } - public static List GenerateFakeDialogActivities(int? count = null, DialogActivityType.Values? type = null) + public static List GenerateFakeDialogActivities(int? count = null, DialogActivityType.Values? type = null) { // Temporarily removing the ActivityType TransmissionOpened from the list of possible types for random picking. // Going to have a look at re-writing the generator https://github.com/digdir/dialogporten/issues/1123 var activityTypes = Enum.GetValues() .Where(x => x != DialogActivityType.Values.TransmissionOpened).ToList(); - return new Faker() + return new Faker() .RuleFor(o => o.Id, () => Uuid7.NewUuid7().ToGuid(true)) .RuleFor(o => o.CreatedAt, f => f.Date.Past()) .RuleFor(o => o.ExtendedType, f => new Uri(f.Internet.UrlWithPath(Uri.UriSchemeHttps))) .RuleFor(o => o.Type, f => type ?? f.PickRandom(activityTypes)) - .RuleFor(o => o.PerformedBy, f => new CreateDialogDialogActivityPerformedByActorDto { ActorType = ActorType.Values.PartyRepresentative, ActorName = f.Name.FullName() }) + .RuleFor(o => o.PerformedBy, f => new ActivityPerformedByActorDto { ActorType = ActorType.Values.PartyRepresentative, ActorName = f.Name.FullName() }) .RuleFor(o => o.Description, (f, o) => o.Type == DialogActivityType.Values.Information ? GenerateFakeLocalizations(f.Random.Number(4, 8)) : null) .Generate(count ?? new Randomizer().Number(1, 4)); } - public static List GenerateFakeDialogApiActions() + public static List GenerateFakeDialogApiActions() { - return new Faker() + return new Faker() .RuleFor(o => o.Action, f => f.Random.AlphaNumeric(8)) .RuleFor(o => o.Endpoints, _ => GenerateFakeDialogApiActionEndpoints()) .Generate(new Randomizer().Number(1, 4)); } - public static List GenerateFakeDialogApiActionEndpoints() + public static List GenerateFakeDialogApiActionEndpoints() { - return new Faker() + return new Faker() .RuleFor(o => o.Url, f => new Uri(f.Internet.UrlWithPath(Uri.UriSchemeHttps))) .RuleFor(o => o.HttpMethod, f => f.PickRandom()) .RuleFor(o => o.Version, f => "v" + f.Random.Number(100, 999)) @@ -296,11 +296,11 @@ public static string GenerateFakeProcessUri() return new Faker().Internet.UrlWithPath(Uri.UriSchemeHttps); } - public static List GenerateFakeDialogGuiActions() + public static List GenerateFakeDialogGuiActions() { var hasPrimary = false; var hasSecondary = false; - return new Faker() + return new Faker() .RuleFor(o => o.Action, f => f.Random.AlphaNumeric(8)) .RuleFor(o => o.Priority, _ => { @@ -323,38 +323,38 @@ public static List GenerateFakeDialogGuiActions( .Generate(new Randomizer().Number(min: 1, 4)); } - public static CreateDialogDialogAttachmentDto GenerateFakeDialogAttachment() + public static AttachmentDto GenerateFakeDialogAttachment() => GenerateFakeDialogAttachments(1)[0]; - public static List GenerateFakeDialogAttachments(int? count = null) + public static List GenerateFakeDialogAttachments(int? count = null) { - return new Faker() + return new Faker() .RuleFor(o => o.DisplayName, f => GenerateFakeLocalizations(f.Random.Number(2, 5))) .RuleFor(o => o.Urls, _ => GenerateFakeDialogAttachmentUrls()) .Generate(count ?? new Randomizer().Number(1, 6)); } - public static List GenerateFakeDialogAttachmentUrls() + public static List GenerateFakeDialogAttachmentUrls() { - return new Faker() + return new Faker() .RuleFor(o => o.Url, f => new Uri(f.Internet.UrlWithPath(Uri.UriSchemeHttps))) .RuleFor(o => o.ConsumerType, f => f.PickRandom()) .Generate(new Randomizer().Number(1, 3)); } - public static List GenerateFakeSearchTags() + public static List GenerateFakeSearchTags() { - return new Faker() + return new Faker() .RuleFor(o => o.Value, f => f.Random.AlphaNumeric(10)) .Generate(new Randomizer().Number(1, 6)); } - public static CreateDialogContentDto GenerateFakeDialogContent() + public static ContentDto GenerateFakeDialogContent() { // We always need Title and Summary. Coin flip to determine to include AdditionalInfo // and/or SendersName var r = new Randomizer(); - var content = new CreateDialogContentDto + var content = new ContentDto { Title = new() { diff --git a/tests/Digdir.Domain.Dialogporten.Application.Integration.Tests/Features/V1/Common/Events/DomainEventsTests.cs b/tests/Digdir.Domain.Dialogporten.Application.Integration.Tests/Features/V1/Common/Events/DomainEventsTests.cs index d8e6aa2e72..115184cb99 100644 --- a/tests/Digdir.Domain.Dialogporten.Application.Integration.Tests/Features/V1/Common/Events/DomainEventsTests.cs +++ b/tests/Digdir.Domain.Dialogporten.Application.Integration.Tests/Features/V1/Common/Events/DomainEventsTests.cs @@ -139,7 +139,7 @@ public async Task Creates_CloudEvent_When_Attachments_Updates() var updateDialogDto = Mapper.Map(getDialogDto); // Act - updateDialogDto.Attachments = [new UpdateDialogDialogAttachmentDto + updateDialogDto.Attachments = [new AttachmentDto { DisplayName = DialogGenerator.GenerateFakeLocalizations(3), Urls = [new() diff --git a/tests/Digdir.Domain.Dialogporten.Application.Integration.Tests/Features/V1/EndUser/Dialogs/Queries/ActivityLogTests.cs b/tests/Digdir.Domain.Dialogporten.Application.Integration.Tests/Features/V1/EndUser/Dialogs/Queries/ActivityLogTests.cs index d13344ad6a..d5495680e7 100644 --- a/tests/Digdir.Domain.Dialogporten.Application.Integration.Tests/Features/V1/EndUser/Dialogs/Queries/ActivityLogTests.cs +++ b/tests/Digdir.Domain.Dialogporten.Application.Integration.Tests/Features/V1/EndUser/Dialogs/Queries/ActivityLogTests.cs @@ -67,7 +67,7 @@ public async Task Get_ActivityLog_Should_Not_Return_User_Ids_Unhashed() var activityId = getDialogResult.AsT0.Activities.First().Id; // Act - var response = await Application.Send(new GetDialogActivityQuery + var response = await Application.Send(new GetActivityQuery { DialogId = createCommandResponse.AsT0.Value, ActivityId = activityId diff --git a/tests/Digdir.Domain.Dialogporten.Application.Integration.Tests/Features/V1/EndUser/Dialogs/Queries/SeenLogTests.cs b/tests/Digdir.Domain.Dialogporten.Application.Integration.Tests/Features/V1/EndUser/Dialogs/Queries/SeenLogTests.cs index 709b29b11f..ab9cb0bfe7 100644 --- a/tests/Digdir.Domain.Dialogporten.Application.Integration.Tests/Features/V1/EndUser/Dialogs/Queries/SeenLogTests.cs +++ b/tests/Digdir.Domain.Dialogporten.Application.Integration.Tests/Features/V1/EndUser/Dialogs/Queries/SeenLogTests.cs @@ -74,7 +74,7 @@ public async Task Get_SeenLog_Should_Not_Return_User_Ids_Unhashed() var seenLogId = triggerSeenLogResponse.AsT0.SeenSinceLastUpdate.Single().Id; // Act - var response = await Application.Send(new GetDialogSeenLogQuery + var response = await Application.Send(new GetSeenLogQuery { DialogId = createCommandResponse.AsT0.Value, SeenLogId = seenLogId @@ -100,7 +100,7 @@ public async Task Search_SeenLog_Should_Not_Return_User_Ids_Unhashed() await Application.Send(new GetDialogQuery { DialogId = createCommandResponse.AsT0.Value }); // Act - var response = await Application.Send(new SearchDialogSeenLogQuery + var response = await Application.Send(new SearchSeenLogQuery { DialogId = createCommandResponse.AsT0.Value }); diff --git a/tests/Digdir.Domain.Dialogporten.Application.Integration.Tests/Features/V1/ServiceOwner/Dialogs/Commands/UpdateDialogTests.cs b/tests/Digdir.Domain.Dialogporten.Application.Integration.Tests/Features/V1/ServiceOwner/Dialogs/Commands/UpdateDialogTests.cs index 406e380d92..871ad6faf8 100644 --- a/tests/Digdir.Domain.Dialogporten.Application.Integration.Tests/Features/V1/ServiceOwner/Dialogs/Commands/UpdateDialogTests.cs +++ b/tests/Digdir.Domain.Dialogporten.Application.Integration.Tests/Features/V1/ServiceOwner/Dialogs/Commands/UpdateDialogTests.cs @@ -7,6 +7,9 @@ using Digdir.Domain.Dialogporten.Domain.Dialogs.Entities.Transmissions; using Digdir.Tool.Dialogporten.GenerateFakeData; using FluentAssertions; +using ActivityDto = Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.Dialogs.Commands.Update.ActivityDto; +using ActivityPerformedByActorDto = Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.Dialogs.Commands.Update.ActivityPerformedByActorDto; +using TransmissionDto = Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.Dialogs.Commands.Update.TransmissionDto; namespace Digdir.Domain.Dialogporten.Application.Integration.Tests.Features.V1.ServiceOwner.Dialogs.Commands; @@ -25,11 +28,11 @@ public async Task Cannot_Include_Old_Activities_To_UpdateCommand() var updateDialogDto = mapper.Map(getDialogDto.AsT0); // Ref. old activity - updateDialogDto.Activities.Add(new UpdateDialogDialogActivityDto + updateDialogDto.Activities.Add(new ActivityDto { Id = getDialogDto.AsT0.Activities.First().Id, Type = DialogActivityType.Values.DialogCreated, - PerformedBy = new UpdateDialogDialogActivityPerformedByActorDto + PerformedBy = new ActivityPerformedByActorDto { ActorType = ActorType.Values.ServiceOwner } @@ -60,7 +63,7 @@ public async Task Cannot_Include_Old_Transmissions_In_UpdateCommand() var updateDialogDto = mapper.Map(getDialogDto.AsT0); // Ref. old transmission - updateDialogDto.Transmissions.Add(new UpdateDialogDialogTransmissionDto + updateDialogDto.Transmissions.Add(new TransmissionDto { Id = existingTransmission.Id, Type = DialogTransmissionType.Values.Information, diff --git a/tests/Digdir.Domain.Dialogporten.Application.Integration.Tests/Features/V1/ServiceOwner/Dialogs/Queries/ActivityLogTests.cs b/tests/Digdir.Domain.Dialogporten.Application.Integration.Tests/Features/V1/ServiceOwner/Dialogs/Queries/ActivityLogTests.cs index 4b796bf755..6b899cff3d 100644 --- a/tests/Digdir.Domain.Dialogporten.Application.Integration.Tests/Features/V1/ServiceOwner/Dialogs/Queries/ActivityLogTests.cs +++ b/tests/Digdir.Domain.Dialogporten.Application.Integration.Tests/Features/V1/ServiceOwner/Dialogs/Queries/ActivityLogTests.cs @@ -68,7 +68,7 @@ public async Task Get_ActivityLog_Should_Return_User_Ids_Unhashed() var activityId = getDialogResult.AsT0.Activities.First().Id; // Act - var response = await Application.Send(new GetDialogActivityQuery + var response = await Application.Send(new GetActivityQuery { DialogId = createCommandResponse.AsT0.Value, ActivityId = activityId diff --git a/tests/Digdir.Domain.Dialogporten.Application.Integration.Tests/Features/V1/ServiceOwner/Dialogs/Queries/SeenLogTests.cs b/tests/Digdir.Domain.Dialogporten.Application.Integration.Tests/Features/V1/ServiceOwner/Dialogs/Queries/SeenLogTests.cs index a5b9f7ac7e..49502e2a03 100644 --- a/tests/Digdir.Domain.Dialogporten.Application.Integration.Tests/Features/V1/ServiceOwner/Dialogs/Queries/SeenLogTests.cs +++ b/tests/Digdir.Domain.Dialogporten.Application.Integration.Tests/Features/V1/ServiceOwner/Dialogs/Queries/SeenLogTests.cs @@ -77,7 +77,7 @@ public async Task Get_SeenLog_Should_Return_User_Ids_Unhashed() var seenLogId = triggerSeenLogResponse.AsT0.SeenSinceLastUpdate.Single().Id; // Act - var response = await Application.Send(new GetDialogSeenLogQuery + var response = await Application.Send(new GetSeenLogQuery { DialogId = createCommandResponse.AsT0.Value, SeenLogId = seenLogId @@ -103,7 +103,7 @@ public async Task Search_SeenLog_Should_Return_User_Ids_Unhashed() await Application.Send(new GetDialogQueryEndUser { DialogId = createCommandResponse.AsT0.Value }); // Act - var response = await Application.Send(new SearchDialogSeenLogQuery + var response = await Application.Send(new SearchSeenLogQuery { DialogId = createCommandResponse.AsT0.Value }); diff --git a/tests/Digdir.Domain.Dialogporten.Application.Integration.Tests/Features/V1/ServiceOwner/Transmissions/Commands/UpdateTransmissionTests.cs b/tests/Digdir.Domain.Dialogporten.Application.Integration.Tests/Features/V1/ServiceOwner/Transmissions/Commands/UpdateTransmissionTests.cs index 95371becae..261e36056f 100644 --- a/tests/Digdir.Domain.Dialogporten.Application.Integration.Tests/Features/V1/ServiceOwner/Transmissions/Commands/UpdateTransmissionTests.cs +++ b/tests/Digdir.Domain.Dialogporten.Application.Integration.Tests/Features/V1/ServiceOwner/Transmissions/Commands/UpdateTransmissionTests.cs @@ -120,7 +120,7 @@ public async Task Cannot_Include_Old_Transmissions_In_UpdateCommand() domainError.Errors.Should().Contain(e => e.ErrorMessage.Contains(existingTransmission.Id.ToString()!)); } - private static UpdateDialogDialogTransmissionDto UpdateDialogDialogTransmissionDto() => new() + private static TransmissionDto UpdateDialogDialogTransmissionDto() => new() { Id = GenerateBigEndianUuidV7(), Type = DialogTransmissionType.Values.Information, diff --git a/tests/Digdir.Domain.Dialogporten.Application.Unit.Tests/Features/V1/Common/ContentTypeTests.cs b/tests/Digdir.Domain.Dialogporten.Application.Unit.Tests/Features/V1/Common/ContentTypeTests.cs index 09e07a518e..020497a7d3 100644 --- a/tests/Digdir.Domain.Dialogporten.Application.Unit.Tests/Features/V1/Common/ContentTypeTests.cs +++ b/tests/Digdir.Domain.Dialogporten.Application.Unit.Tests/Features/V1/Common/ContentTypeTests.cs @@ -1,15 +1,7 @@ -using Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.Dialogs.Commands.Create; -using Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.Dialogs.Commands.Update; using Digdir.Domain.Dialogporten.Domain.Dialogs.Entities.Contents; using Digdir.Domain.Dialogporten.Domain.Dialogs.Entities.Transmissions.Contents; -using GetDialogContentDtoEU = Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.Dialogs.Queries.Get.GetDialogContentDto; -using GetDialogContentDtoSO = Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.Dialogs.Queries.Get.GetDialogContentDto; - -using SearchDialogContentDtoEU = Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.Dialogs.Queries.Search.SearchDialogContentDto; -using SearchDialogDtoContentSO = Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.Dialogs.Queries.Search.SearchDialogContentDto; - -using GetDialogDialogTransmissionContentDtoSO = Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.Dialogs.Queries.Get.GetDialogDialogTransmissionContentDto; -using GetDialogDialogTransmissionContentDtoEU = Digdir.Domain.Dialogporten.Application.Features.V1.EndUser.Dialogs.Queries.Get.GetDialogDialogTransmissionContentDto; +using ContentDto = Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.Dialogs.Commands.Create.ContentDto; +using TransmissionContentDto = Digdir.Domain.Dialogporten.Application.Features.V1.ServiceOwner.Dialogs.Commands.Create.TransmissionContentDto; namespace Digdir.Domain.Dialogporten.Application.Unit.Tests.Features.V1.Common; @@ -25,10 +17,10 @@ public void DialogContentType_Names_Should_Match_Props_On_All_DTOs() var dtoTypes = new[] { - typeof(CreateDialogContentDto), - typeof(UpdateDialogContentDto), - typeof(GetDialogContentDtoEU), - typeof(GetDialogContentDtoSO) + typeof(ContentDto), + typeof(Application.Features.V1.ServiceOwner.Dialogs.Commands.Update.ContentDto), + typeof(Application.Features.V1.EndUser.Dialogs.Queries.Get.ContentDto), + typeof(Application.Features.V1.ServiceOwner.Dialogs.Queries.Get.ContentDto) }; foreach (var dtoType in dtoTypes) @@ -56,8 +48,8 @@ public void OutPutInList_DialogContentType_Names_Should_Match_Props_On_All_Searc var dtoTypes = new[] { - typeof(SearchDialogContentDtoEU), - typeof(SearchDialogDtoContentSO) + typeof(Application.Features.V1.EndUser.Dialogs.Queries.Search.ContentDto), + typeof(Application.Features.V1.ServiceOwner.Dialogs.Queries.Search.ContentDto) }; foreach (var dtoType in dtoTypes) @@ -84,10 +76,10 @@ public void TransmissionContentType_Names_Should_Match_Props_On_All_DTOs() var dtoTypes = new[] { - typeof(CreateDialogDialogTransmissionContentDto), - typeof(UpdateDialogDialogTransmissionContentDto), - typeof(GetDialogDialogTransmissionContentDtoSO), - typeof(GetDialogDialogTransmissionContentDtoEU) + typeof(TransmissionContentDto), + typeof(Application.Features.V1.ServiceOwner.Dialogs.Commands.Update.TransmissionContentDto), + typeof(Application.Features.V1.ServiceOwner.Dialogs.Queries.Get.DialogTransmissionContentDto), + typeof(Application.Features.V1.EndUser.Dialogs.Queries.Get.DialogTransmissionContentDto) }; foreach (var dtoType in dtoTypes) diff --git a/tests/Digdir.Domain.Dialogporten.GraphQl.Unit.Tests/ObjectTypes/ContentTypeTests.cs b/tests/Digdir.Domain.Dialogporten.GraphQl.Unit.Tests/ObjectTypes/ContentTypeTests.cs index 9b0d54b4d0..1367a1408d 100644 --- a/tests/Digdir.Domain.Dialogporten.GraphQl.Unit.Tests/ObjectTypes/ContentTypeTests.cs +++ b/tests/Digdir.Domain.Dialogporten.GraphQl.Unit.Tests/ObjectTypes/ContentTypeTests.cs @@ -35,7 +35,7 @@ public void OutPutInList_DialogContentType_Names_Should_Match_Props_On_SearchCon .Select(x => x.Name) .ToList(); - var dtoPropertyNames = typeof(SearchDialogContentDto) + var dtoPropertyNames = typeof(ContentDto) .GetProperties() .Select(p => p.Name) .ToList();