From 1f0de13db050da3049c6908eb49535b98f0a21e0 Mon Sep 17 00:00:00 2001 From: Klaus Fischer <klaus.fischer@eloware.com> Date: Thu, 9 Jun 2022 08:12:50 +0200 Subject: [PATCH] Added DTOs for Destination service --- FitConnect.sln | 6 +++ FitConnect/FitConnect.csproj | 1 + .../Models/Api/Services/SubmissionService.cs | 24 ------------ Services/DestinationService.cs | 11 ++++++ Services/InfoService.cs | 8 ++++ Services/Models/ApiInfoDto.cs | 5 +++ .../Api => Services}/Models/CallbackDto.cs | 4 +- .../Models/CreateCallbackDto.cs | 4 +- .../Models/CreateSubmission.cs | 2 +- .../Destination/ContactInformationDto.cs | 20 ++++++++++ .../Destination/CreateDestinationDto.cs | 36 +++++++++++++++++ Services/Models/Destination/DeMailDto.cs | 4 ++ .../Models/Destination/DestinationListDto.cs | 20 ++++++++++ .../DestinationReplyChannelsDto.cs | 33 ++++++++++++++++ .../Destination/DestinationServiceDto.cs | 15 +++++++ Services/Models/Destination/ElsterDto.cs | 4 ++ Services/Models/Destination/EmailDto.cs | 4 ++ Services/Models/Destination/FinkDto.cs | 4 ++ .../Models/Destination/PatchDestinationDto.cs | 32 +++++++++++++++ .../Destination/PrivateDestinationDto.cs | 36 +++++++++++++++++ .../Destination/PublicDestinationDto.cs | 28 +++++++++++++ .../Models/Destination/SubmissionSchemaDto.cs | 13 +++++++ .../Destination/UpdateDestinationDto.cs | 32 +++++++++++++++ .../Api => Services}/Models/ServiceTypeDto.cs | 2 +- .../Submission}/SubmissionCreatedDto.cs | 2 +- Services/Models/Submission/SubmissionDto.cs | 39 +++++++++++++++++++ .../Submission/SubmissionForPickupDto.cs | 14 +++++++ .../Submission}/SubmissionReducedDto.cs | 2 +- .../Submission/SubmissionsForPickupDto.cs | 19 +++++++++ .../Models/Submission}/SubmitSubmissionDto.cs | 6 +-- Services/Services.csproj | 10 +++++ Services/Services.csproj.DotSettings | 4 ++ Services/SubmissionService.cs | 37 ++++++++++++++++++ 33 files changed, 446 insertions(+), 35 deletions(-) delete mode 100644 FitConnect/Models/Api/Services/SubmissionService.cs create mode 100644 Services/DestinationService.cs create mode 100644 Services/InfoService.cs create mode 100644 Services/Models/ApiInfoDto.cs rename {FitConnect/Models/Api => Services}/Models/CallbackDto.cs (60%) rename {FitConnect/Models/Api => Services}/Models/CreateCallbackDto.cs (70%) rename {FitConnect/Models/Api => Services}/Models/CreateSubmission.cs (92%) create mode 100644 Services/Models/Destination/ContactInformationDto.cs create mode 100644 Services/Models/Destination/CreateDestinationDto.cs create mode 100644 Services/Models/Destination/DeMailDto.cs create mode 100644 Services/Models/Destination/DestinationListDto.cs create mode 100644 Services/Models/Destination/DestinationReplyChannelsDto.cs create mode 100644 Services/Models/Destination/DestinationServiceDto.cs create mode 100644 Services/Models/Destination/ElsterDto.cs create mode 100644 Services/Models/Destination/EmailDto.cs create mode 100644 Services/Models/Destination/FinkDto.cs create mode 100644 Services/Models/Destination/PatchDestinationDto.cs create mode 100644 Services/Models/Destination/PrivateDestinationDto.cs create mode 100644 Services/Models/Destination/PublicDestinationDto.cs create mode 100644 Services/Models/Destination/SubmissionSchemaDto.cs create mode 100644 Services/Models/Destination/UpdateDestinationDto.cs rename {FitConnect/Models/Api => Services}/Models/ServiceTypeDto.cs (88%) rename {FitConnect/Models/Api/Models => Services/Models/Submission}/SubmissionCreatedDto.cs (88%) create mode 100644 Services/Models/Submission/SubmissionDto.cs create mode 100644 Services/Models/Submission/SubmissionForPickupDto.cs rename {FitConnect/Models/Api/Models => Services/Models/Submission}/SubmissionReducedDto.cs (92%) create mode 100644 Services/Models/Submission/SubmissionsForPickupDto.cs rename {FitConnect/Models/Api/Models => Services/Models/Submission}/SubmitSubmissionDto.cs (59%) create mode 100644 Services/Services.csproj create mode 100644 Services/Services.csproj.DotSettings create mode 100644 Services/SubmissionService.cs diff --git a/FitConnect.sln b/FitConnect.sln index af5f9912..40c705a9 100644 --- a/FitConnect.sln +++ b/FitConnect.sln @@ -10,6 +10,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "E2ETests", "E2ETests\E2ETes EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EncryptionTests", "EncryptionTests\EncryptionTests.csproj", "{68F1EC39-B234-4422-9AA8-E55CFA15025D}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Services", "Services\Services.csproj", "{1BB06AF4-492C-4041-A947-FE65F7A48698}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -32,6 +34,10 @@ Global {68F1EC39-B234-4422-9AA8-E55CFA15025D}.Debug|Any CPU.Build.0 = Debug|Any CPU {68F1EC39-B234-4422-9AA8-E55CFA15025D}.Release|Any CPU.ActiveCfg = Release|Any CPU {68F1EC39-B234-4422-9AA8-E55CFA15025D}.Release|Any CPU.Build.0 = Release|Any CPU + {1BB06AF4-492C-4041-A947-FE65F7A48698}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1BB06AF4-492C-4041-A947-FE65F7A48698}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1BB06AF4-492C-4041-A947-FE65F7A48698}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1BB06AF4-492C-4041-A947-FE65F7A48698}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution {73CE5625-4C13-458E-B524-0DAA850F4041} = {D382641C-B027-411A-814C-C8C20A9505F3} diff --git a/FitConnect/FitConnect.csproj b/FitConnect/FitConnect.csproj index fa839cf2..f6330364 100644 --- a/FitConnect/FitConnect.csproj +++ b/FitConnect/FitConnect.csproj @@ -24,6 +24,7 @@ <ItemGroup> <Folder Include="Interfaces" /> + <Folder Include="Models\Api" /> </ItemGroup> </Project> diff --git a/FitConnect/Models/Api/Services/SubmissionService.cs b/FitConnect/Models/Api/Services/SubmissionService.cs deleted file mode 100644 index 1bd90c40..00000000 --- a/FitConnect/Models/Api/Services/SubmissionService.cs +++ /dev/null @@ -1,24 +0,0 @@ -using FitConnect.Models.Api.Models; - -namespace FitConnect.Models.Api.Services; - -public class SubmissionService { - internal SubmissionCreatedDto CreateSubmission(CreateSubmission submission) { - // @PostMapping("/submissions") - throw new NotImplementedException(); - } - - internal bool AddSubmissionAttachment(string submissionId, string attachmentId, - string encryptedAttachmentContent) { - // @PutMapping(value = "/submissions/{submissionId}/attachments/{attachmentId}", consumes = "application/jose") - - throw new NotImplementedException(); - } - - internal SubmissionReducedDto SubmitSubmission(string submissionId, - SubmitSubmissionDto submitSubmission) { - //@PutMapping(value = "/submissions/{submissionId}", consumes = "application/json") - throw new NotImplementedException(); - } - -} diff --git a/Services/DestinationService.cs b/Services/DestinationService.cs new file mode 100644 index 00000000..0f13f80c --- /dev/null +++ b/Services/DestinationService.cs @@ -0,0 +1,11 @@ +namespace FitConnect.Services; + +internal class DestinationService { + + // @PostMapping("/destinations") + // @GetMapping("/destinations/{destinationId}") + // @DeleteMapping("/destinations/{destinationId}") + // @PatchMapping("/destinations/{destinationId}") + // @GetMapping("/destinations") + // @PutMapping("/destinations/{destinationId}") +} \ No newline at end of file diff --git a/Services/InfoService.cs b/Services/InfoService.cs new file mode 100644 index 00000000..1b2e9aca --- /dev/null +++ b/Services/InfoService.cs @@ -0,0 +1,8 @@ +namespace FitConnect.Services; + +internal class InfoService { + // @GetMapping("/info") + internal string GetInfo() { + throw new NotImplementedException(); + } +} diff --git a/Services/Models/ApiInfoDto.cs b/Services/Models/ApiInfoDto.cs new file mode 100644 index 00000000..439bda3b --- /dev/null +++ b/Services/Models/ApiInfoDto.cs @@ -0,0 +1,5 @@ +namespace FitConnect.Services.Models; + +internal class ApiInfoDto { + +} diff --git a/FitConnect/Models/Api/Models/CallbackDto.cs b/Services/Models/CallbackDto.cs similarity index 60% rename from FitConnect/Models/Api/Models/CallbackDto.cs rename to Services/Models/CallbackDto.cs index 379d4d7c..83d57754 100644 --- a/FitConnect/Models/Api/Models/CallbackDto.cs +++ b/Services/Models/CallbackDto.cs @@ -1,8 +1,8 @@ using System.Text.Json.Serialization; -namespace FitConnect.Models.Api.Models; +namespace FitConnect.Services.Models; -internal class CallbackDto { +public class CallbackDto { [JsonPropertyName("url")] public string Url { get; set; } } \ No newline at end of file diff --git a/FitConnect/Models/Api/Models/CreateCallbackDto.cs b/Services/Models/CreateCallbackDto.cs similarity index 70% rename from FitConnect/Models/Api/Models/CreateCallbackDto.cs rename to Services/Models/CreateCallbackDto.cs index 13fc9392..8900885c 100644 --- a/FitConnect/Models/Api/Models/CreateCallbackDto.cs +++ b/Services/Models/CreateCallbackDto.cs @@ -1,8 +1,8 @@ using System.Text.Json.Serialization; -namespace FitConnect.Models.Api.Models; +namespace FitConnect.Services.Models; -internal class CreateCallbackDto { +public class CreateCallbackDto { [JsonPropertyName("url")] public string Url { get; set; } diff --git a/FitConnect/Models/Api/Models/CreateSubmission.cs b/Services/Models/CreateSubmission.cs similarity index 92% rename from FitConnect/Models/Api/Models/CreateSubmission.cs rename to Services/Models/CreateSubmission.cs index 4faa1d3d..c3bd7bd3 100644 --- a/FitConnect/Models/Api/Models/CreateSubmission.cs +++ b/Services/Models/CreateSubmission.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace FitConnect.Models.Api.Models; +namespace FitConnect.Services.Models; internal class CreateSubmission { [JsonPropertyName("destinationId")] diff --git a/Services/Models/Destination/ContactInformationDto.cs b/Services/Models/Destination/ContactInformationDto.cs new file mode 100644 index 00000000..b4c1da94 --- /dev/null +++ b/Services/Models/Destination/ContactInformationDto.cs @@ -0,0 +1,20 @@ +using System.Text.Json.Serialization; + +namespace FitConnect.Services.Models; + +public class ContactInformationDto { + [JsonPropertyName("legalName")] + public string LegalName; + + [JsonPropertyName("address")] + public string Address; + + [JsonPropertyName("phone")] + public string Phone; + + [JsonPropertyName("email")] + public string Email; + + [JsonPropertyName("unit")] + public string Unit; +} \ No newline at end of file diff --git a/Services/Models/Destination/CreateDestinationDto.cs b/Services/Models/Destination/CreateDestinationDto.cs new file mode 100644 index 00000000..b3f474da --- /dev/null +++ b/Services/Models/Destination/CreateDestinationDto.cs @@ -0,0 +1,36 @@ +using System.Text.Json.Serialization; + +namespace FitConnect.Services.Models; + +public class CreateDestinationDto { + [JsonPropertyName("contactInformation")] + public ContactInformationDto ContactInformation; + + + [JsonPropertyName("services")] + public List<DestinationServiceDto> Services; + + + [JsonPropertyName("callback")] + public CreateCallbackDto Callback; + + + [JsonPropertyName("encryptionKid")] + public string EncryptionKid; + + + [JsonPropertyName("encryptionPublicKey")] + public string EncryptionPublicKey; + + + [JsonPropertyName("signingPublicKey")] + public string SigningPublicKey; + + + [JsonPropertyName("metadataVersions")] + public List<string> metadataVersions; + + + [JsonPropertyName("replyChannels")] + public DestinationReplyChannelsDto ReplyChannels; +} diff --git a/Services/Models/Destination/DeMailDto.cs b/Services/Models/Destination/DeMailDto.cs new file mode 100644 index 00000000..26a69e65 --- /dev/null +++ b/Services/Models/Destination/DeMailDto.cs @@ -0,0 +1,4 @@ +namespace FitConnect.Services.Models; + +public class DeMailDto { +} \ No newline at end of file diff --git a/Services/Models/Destination/DestinationListDto.cs b/Services/Models/Destination/DestinationListDto.cs new file mode 100644 index 00000000..7f0a7ea3 --- /dev/null +++ b/Services/Models/Destination/DestinationListDto.cs @@ -0,0 +1,20 @@ +using System.Text.Json.Serialization; + +namespace FitConnect.Services.Models; + +public class DestinationListDto { + [JsonPropertyName("count")] + public int Count; + + + [JsonPropertyName("offset")] + public int Offset; + + + [JsonPropertyName("totalCount")] + public long TotalCount; + + + [JsonPropertyName("destinations")] + public List<PrivateDestinationDto> Destinations; +} \ No newline at end of file diff --git a/Services/Models/Destination/DestinationReplyChannelsDto.cs b/Services/Models/Destination/DestinationReplyChannelsDto.cs new file mode 100644 index 00000000..609a73a2 --- /dev/null +++ b/Services/Models/Destination/DestinationReplyChannelsDto.cs @@ -0,0 +1,33 @@ +using System.Text.Json.Serialization; + +namespace FitConnect.Services.Models; + +public class DestinationReplyChannelsDto { + public EmailDto? EMail; + + + public DeMailDto? DeMail; + + + public FinkDto? Fink; + + + public ElsterDto? Elster; + + + public DestinationReplyChannelsDto( + EmailDto eMail, + DeMailDto deMail, + FinkDto fink, + ElsterDto elster) { + this.EMail = EMail; + this.DeMail = DeMail; + this.Fink = Fink; + this.Elster = Elster; + } + + + public bool IsEmpty() { + return EMail == null && DeMail == null && Fink == null && Elster == null; + } +} \ No newline at end of file diff --git a/Services/Models/Destination/DestinationServiceDto.cs b/Services/Models/Destination/DestinationServiceDto.cs new file mode 100644 index 00000000..ea2d277d --- /dev/null +++ b/Services/Models/Destination/DestinationServiceDto.cs @@ -0,0 +1,15 @@ +using System.Text.Json.Serialization; + +namespace FitConnect.Services.Models; + +public class DestinationServiceDto { + [JsonPropertyName("identifier")] + public string Identifier; + + [JsonPropertyName("submissionSchemas")] + public List<SubmissionSchemaDto> SubmissionSchemas; + + + [JsonPropertyName("regions")] + public List<string> Regions; +} \ No newline at end of file diff --git a/Services/Models/Destination/ElsterDto.cs b/Services/Models/Destination/ElsterDto.cs new file mode 100644 index 00000000..7410f97c --- /dev/null +++ b/Services/Models/Destination/ElsterDto.cs @@ -0,0 +1,4 @@ +namespace FitConnect.Services.Models; + +public class ElsterDto { +} \ No newline at end of file diff --git a/Services/Models/Destination/EmailDto.cs b/Services/Models/Destination/EmailDto.cs new file mode 100644 index 00000000..b13c0bea --- /dev/null +++ b/Services/Models/Destination/EmailDto.cs @@ -0,0 +1,4 @@ +namespace FitConnect.Services.Models; + +public class EmailDto { +} \ No newline at end of file diff --git a/Services/Models/Destination/FinkDto.cs b/Services/Models/Destination/FinkDto.cs new file mode 100644 index 00000000..8af1b41b --- /dev/null +++ b/Services/Models/Destination/FinkDto.cs @@ -0,0 +1,4 @@ +namespace FitConnect.Services.Models; + +public class FinkDto { +} \ No newline at end of file diff --git a/Services/Models/Destination/PatchDestinationDto.cs b/Services/Models/Destination/PatchDestinationDto.cs new file mode 100644 index 00000000..59ad71b3 --- /dev/null +++ b/Services/Models/Destination/PatchDestinationDto.cs @@ -0,0 +1,32 @@ +using System.Text.Json.Serialization; + +namespace FitConnect.Services.Models; + +public class PatchDestinationDto { + [JsonPropertyName("status")] + public string Status; + + + [JsonPropertyName("contactInformation")] + public ContactInformationDto ContactInformation; + + + [JsonPropertyName("services")] + public List<DestinationServiceDto> Services; + + + [JsonPropertyName("callback")] + public CreateCallbackDto Callback; + + + [JsonPropertyName("encryptionKid")] + public string EncryptionKid; + + + [JsonPropertyName("metadataVersions")] + public List<string> metadataVersions; + + + [JsonPropertyName("replyChannels")] + public DestinationReplyChannelsDto ReplyChannels; +} \ No newline at end of file diff --git a/Services/Models/Destination/PrivateDestinationDto.cs b/Services/Models/Destination/PrivateDestinationDto.cs new file mode 100644 index 00000000..7f6dd0e5 --- /dev/null +++ b/Services/Models/Destination/PrivateDestinationDto.cs @@ -0,0 +1,36 @@ +using System.Text.Json.Serialization; + +namespace FitConnect.Services.Models; + +public class PrivateDestinationDto { + [JsonPropertyName("destinationId")] + public string DestinationId; + + + [JsonPropertyName("status")] + public string Status; + + + [JsonPropertyName("services")] + public List<DestinationServiceDto> Services; + + + [JsonPropertyName("encryptionKid")] + public string EncryptionKid; + + + [JsonPropertyName("contactInformation")] + public ContactInformationDto ContactInformation; + + + [JsonPropertyName("callback")] + public CallbackDto Callback; + + + [JsonPropertyName("metadataVersions")] + public List<string> MetadataVersions; + + + [JsonPropertyName("replyChannels")] + public DestinationReplyChannelsDto ReplyChannels; +} \ No newline at end of file diff --git a/Services/Models/Destination/PublicDestinationDto.cs b/Services/Models/Destination/PublicDestinationDto.cs new file mode 100644 index 00000000..19ce3b4f --- /dev/null +++ b/Services/Models/Destination/PublicDestinationDto.cs @@ -0,0 +1,28 @@ +using System.Text.Json.Serialization; + +namespace FitConnect.Services.Models; + +public class PublicDestinationDto { + [JsonPropertyName("destinationId")] + public string DestinationId; + + + [JsonPropertyName("status")] + public string Status; + + + [JsonPropertyName("services")] + public List<DestinationServiceDto> Services; + + + [JsonPropertyName("encryptionKid")] + public string EncryptionKid; + + + [JsonPropertyName("metadataVersions")] + public List<string> MetadataVersions; + + + [JsonPropertyName("replyChannels")] + public DestinationReplyChannelsDto ReplyChannels; +} \ No newline at end of file diff --git a/Services/Models/Destination/SubmissionSchemaDto.cs b/Services/Models/Destination/SubmissionSchemaDto.cs new file mode 100644 index 00000000..970a898f --- /dev/null +++ b/Services/Models/Destination/SubmissionSchemaDto.cs @@ -0,0 +1,13 @@ +using System.Text.Json.Serialization; + +namespace FitConnect.Services.Models; + +public class SubmissionSchemaDto { + [JsonPropertyName("schemaUri")] + public string schemaUri; + + + [JsonPropertyName("mimeType")] + //private SubmissionSchemaMimeTypeDto mimeType; + public int mimeType; +} \ No newline at end of file diff --git a/Services/Models/Destination/UpdateDestinationDto.cs b/Services/Models/Destination/UpdateDestinationDto.cs new file mode 100644 index 00000000..f5b28423 --- /dev/null +++ b/Services/Models/Destination/UpdateDestinationDto.cs @@ -0,0 +1,32 @@ +using System.Text.Json.Serialization; + +namespace FitConnect.Services.Models; + +public class UpdateDestinationDto { + [JsonPropertyName("status")] + public string Status; + + + [JsonPropertyName("contactInformation")] + public ContactInformationDto ContactInformation; + + + [JsonPropertyName("services")] + public List<DestinationServiceDto> Services; + + + [JsonPropertyName("callback")] + public CreateCallbackDto Callback; + + + [JsonPropertyName("encryptionKid")] + public string EncryptionKid; + + + [JsonPropertyName("metadataVersions")] + public List<string> metadataVersions; + + + [JsonPropertyName("replyChannels")] + public DestinationReplyChannelsDto ReplyChannels; +} \ No newline at end of file diff --git a/FitConnect/Models/Api/Models/ServiceTypeDto.cs b/Services/Models/ServiceTypeDto.cs similarity index 88% rename from FitConnect/Models/Api/Models/ServiceTypeDto.cs rename to Services/Models/ServiceTypeDto.cs index 7da1aed2..c3ed37c0 100644 --- a/FitConnect/Models/Api/Models/ServiceTypeDto.cs +++ b/Services/Models/ServiceTypeDto.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace FitConnect.Models.Api.Models; +namespace FitConnect.Services.Models; internal class ServiceTypeDto { [JsonPropertyName("name")] diff --git a/FitConnect/Models/Api/Models/SubmissionCreatedDto.cs b/Services/Models/Submission/SubmissionCreatedDto.cs similarity index 88% rename from FitConnect/Models/Api/Models/SubmissionCreatedDto.cs rename to Services/Models/Submission/SubmissionCreatedDto.cs index 95f03c94..e279046d 100644 --- a/FitConnect/Models/Api/Models/SubmissionCreatedDto.cs +++ b/Services/Models/Submission/SubmissionCreatedDto.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace FitConnect.Models.Api.Models; +namespace FitConnect.Services.Models; internal class SubmissionCreatedDto { [JsonPropertyName("destinationId")] diff --git a/Services/Models/Submission/SubmissionDto.cs b/Services/Models/Submission/SubmissionDto.cs new file mode 100644 index 00000000..08df2fbc --- /dev/null +++ b/Services/Models/Submission/SubmissionDto.cs @@ -0,0 +1,39 @@ +using System.Text.Json.Serialization; + +namespace FitConnect.Services.Models; + +internal class SubmissionDto{ + + [JsonPropertyName("destinationId")] + public string DestinationId; + + + [JsonPropertyName("submissionId")] + public string SubmissionId; + + + [JsonPropertyName("caseId")] + public string CaseId; + + + [JsonPropertyName("attachments")] + public List<string> Attachments; + + + + [JsonPropertyName("serviceType")] + public ServiceTypeDto ServiceType; + + + [JsonPropertyName("callback")] + public CallbackDto Callback; + + + [JsonPropertyName("encryptedMetadata")] + public string EncryptedMetadata; + + + [JsonPropertyName("encryptedData")] + public string EncryptedData; + +} \ No newline at end of file diff --git a/Services/Models/Submission/SubmissionForPickupDto.cs b/Services/Models/Submission/SubmissionForPickupDto.cs new file mode 100644 index 00000000..5be2b1ea --- /dev/null +++ b/Services/Models/Submission/SubmissionForPickupDto.cs @@ -0,0 +1,14 @@ +using System.Text.Json.Serialization; + +namespace FitConnect.Services.Models; + +internal class SubmissionForPickupDto { + [JsonPropertyName("destinationId")] + public string DestinationId; + + [JsonPropertyName("submissionId")] + public string SubmissionId; + + [JsonPropertyName("caseId")] + public string CaseId; +} \ No newline at end of file diff --git a/FitConnect/Models/Api/Models/SubmissionReducedDto.cs b/Services/Models/Submission/SubmissionReducedDto.cs similarity index 92% rename from FitConnect/Models/Api/Models/SubmissionReducedDto.cs rename to Services/Models/Submission/SubmissionReducedDto.cs index 4c7de5e2..04bb6a1c 100644 --- a/FitConnect/Models/Api/Models/SubmissionReducedDto.cs +++ b/Services/Models/Submission/SubmissionReducedDto.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace FitConnect.Models.Api.Models; +namespace FitConnect.Services.Models; public class SubmissionReducedDto { [JsonPropertyName("destinationId")] diff --git a/Services/Models/Submission/SubmissionsForPickupDto.cs b/Services/Models/Submission/SubmissionsForPickupDto.cs new file mode 100644 index 00000000..978aa6cd --- /dev/null +++ b/Services/Models/Submission/SubmissionsForPickupDto.cs @@ -0,0 +1,19 @@ +using System.Text.Json.Serialization; + +namespace FitConnect.Services.Models; + +internal class SubmissionsForPickupDto { + + [JsonPropertyName("count")] + public int Count; + + [JsonPropertyName("offset")] + public int Offset; + + [JsonPropertyName("totalCount")] + public long TotalCount; + + [JsonPropertyName("submissions")] + public List<SubmissionForPickupDto> Submissions; + +} \ No newline at end of file diff --git a/FitConnect/Models/Api/Models/SubmitSubmissionDto.cs b/Services/Models/Submission/SubmitSubmissionDto.cs similarity index 59% rename from FitConnect/Models/Api/Models/SubmitSubmissionDto.cs rename to Services/Models/Submission/SubmitSubmissionDto.cs index c8b7ca65..ed2e1eee 100644 --- a/FitConnect/Models/Api/Models/SubmitSubmissionDto.cs +++ b/Services/Models/Submission/SubmitSubmissionDto.cs @@ -1,11 +1,11 @@ using System.Text.Json.Serialization; -namespace FitConnect.Models.Api.Models; +namespace FitConnect.Services.Models; internal class SubmitSubmissionDto { [JsonPropertyName("encryptedMetadata")] - private string EncryptedMetadata; + public string EncryptedMetadata; [JsonPropertyName("encryptedData")] - private string EncryptedData; + public string EncryptedData; } \ No newline at end of file diff --git a/Services/Services.csproj b/Services/Services.csproj new file mode 100644 index 00000000..d40e84f5 --- /dev/null +++ b/Services/Services.csproj @@ -0,0 +1,10 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <TargetFramework>net6.0</TargetFramework> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>enable</Nullable> + <RootNamespace>FitConnect.Services</RootNamespace> + </PropertyGroup> + +</Project> diff --git a/Services/Services.csproj.DotSettings b/Services/Services.csproj.DotSettings new file mode 100644 index 00000000..8576e8bb --- /dev/null +++ b/Services/Services.csproj.DotSettings @@ -0,0 +1,4 @@ +<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> + <s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=models_005Cdestination/@EntryIndexedValue">True</s:Boolean> + <s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=models_005Cdestinations/@EntryIndexedValue">True</s:Boolean> + <s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=models_005Csubmission/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> \ No newline at end of file diff --git a/Services/SubmissionService.cs b/Services/SubmissionService.cs new file mode 100644 index 00000000..9905772d --- /dev/null +++ b/Services/SubmissionService.cs @@ -0,0 +1,37 @@ +using FitConnect.Services.Models; + +namespace FitConnect.Services; + +public class SubmissionService { + // @PostMapping("/submissions") + internal SubmissionCreatedDto CreateSubmission(CreateSubmission submission) { + throw new NotImplementedException(); + } + + // @PutMapping(value = "/submissions/{submissionId}/attachments/{attachmentId}", consumes = "application/jose") + internal bool AddSubmissionAttachment(string submissionId, string attachmentId, + string encryptedAttachmentContent) { + throw new NotImplementedException(); + } + + //@PutMapping(value = "/submissions/{submissionId}", consumes = "application/json") + internal SubmissionReducedDto SubmitSubmission(string submissionId, + SubmitSubmissionDto submitSubmission) { + throw new NotImplementedException(); + } + + // @GetMapping("/submissions") + internal SubmissionsForPickupDto ListSubmissions(string destinationId, int offset, int limit) { + throw new NotImplementedException(); + } + + // @GetMapping("/submissions/{submissionId}") + internal SubmissionDto GetSubmission(string submissionId) { + throw new NotImplementedException(); + } + + // @GetMapping(value = "/submissions/{submissionId}/attachments/{attachmentId}", produces = "application/jose") + internal string GetAttachment(string submissionId, string attachmentId) { + throw new NotImplementedException(); + } +} -- GitLab