From dd9f5363c78a623dd1a6c995670526bda36bc964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matija=20Ko=C5=BEelj?= Date: Wed, 7 Dec 2022 14:09:03 +0100 Subject: [PATCH] Initial commit --- Contacts.Types.Model/Addresses/IAddress.cs | 11 ++++ .../Contacts.Types.Model.csproj | 14 +++++ Contacts.Types.Model/ContactsUrls.cs | 5 ++ Contacts.Types.Model/IBusinessPartner.cs | 28 ++++++++++ .../IBusinessPartnerService.cs | 12 ++++ Contacts.Types.Model/IContact.cs | 13 +++++ .../Organizations/IOrganization.cs | 10 ++++ .../Organizations/IOrganizationContact.cs | 9 +++ Contacts.Types/Bootstrapper.cs | 9 +++ Contacts.Types/BusinessPartnerService.cs | 15 +++++ Contacts.Types/Contacts.Types.csproj | 15 +++++ Customers.sln | 56 +++++++++++++++++++ 12 files changed, 197 insertions(+) create mode 100644 Contacts.Types.Model/Addresses/IAddress.cs create mode 100644 Contacts.Types.Model/Contacts.Types.Model.csproj create mode 100644 Contacts.Types.Model/ContactsUrls.cs create mode 100644 Contacts.Types.Model/IBusinessPartner.cs create mode 100644 Contacts.Types.Model/IBusinessPartnerService.cs create mode 100644 Contacts.Types.Model/IContact.cs create mode 100644 Contacts.Types.Model/Organizations/IOrganization.cs create mode 100644 Contacts.Types.Model/Organizations/IOrganizationContact.cs create mode 100644 Contacts.Types/Bootstrapper.cs create mode 100644 Contacts.Types/BusinessPartnerService.cs create mode 100644 Contacts.Types/Contacts.Types.csproj create mode 100644 Customers.sln diff --git a/Contacts.Types.Model/Addresses/IAddress.cs b/Contacts.Types.Model/Addresses/IAddress.cs new file mode 100644 index 0000000..7291b1a --- /dev/null +++ b/Contacts.Types.Model/Addresses/IAddress.cs @@ -0,0 +1,11 @@ +using Connected.Data; + +namespace Contacts.Types.Addresses; + +public interface IAddress : IPrimaryKey +{ + int PostalCode { get; init; } + string Street { get; init; } + string Number { get; init; } + +} diff --git a/Contacts.Types.Model/Contacts.Types.Model.csproj b/Contacts.Types.Model/Contacts.Types.Model.csproj new file mode 100644 index 0000000..fb792f1 --- /dev/null +++ b/Contacts.Types.Model/Contacts.Types.Model.csproj @@ -0,0 +1,14 @@ + + + + net7.0 + enable + enable + Contacts.Types + + + + + + + diff --git a/Contacts.Types.Model/ContactsUrls.cs b/Contacts.Types.Model/ContactsUrls.cs new file mode 100644 index 0000000..ce8e62d --- /dev/null +++ b/Contacts.Types.Model/ContactsUrls.cs @@ -0,0 +1,5 @@ +namespace Contacts.Types; +public static class ContactsUrls +{ + public const string BusinessPartners = "/contacts/businessPartners"; +} diff --git a/Contacts.Types.Model/IBusinessPartner.cs b/Contacts.Types.Model/IBusinessPartner.cs new file mode 100644 index 0000000..a15920e --- /dev/null +++ b/Contacts.Types.Model/IBusinessPartner.cs @@ -0,0 +1,28 @@ +using Connected.Data; + +namespace Contacts.Types; + +[Flags] +public enum CustomerRoles +{ + None = 0, + Supplier = 1, + Customer = 2 +} +/// +/// An entity which represents a business partner. +/// +/// +/// A business partner can be an +/// or an . An is tipically a person +/// which buys products and/or services. An is a business +/// entity which can be , +/// or both. +/// +public interface IBusinessPartner : IPrimaryKey +{ + int? Organization { get; init; } + int? Contact { get; init; } + + CustomerRoles Roles { get; init; } +} diff --git a/Contacts.Types.Model/IBusinessPartnerService.cs b/Contacts.Types.Model/IBusinessPartnerService.cs new file mode 100644 index 0000000..474d803 --- /dev/null +++ b/Contacts.Types.Model/IBusinessPartnerService.cs @@ -0,0 +1,12 @@ +using Connected.Annotations; +using Connected.Notifications; +using Connected.ServiceModel; + +namespace Contacts.Types; + +[Service] +[ServiceUrl(ContactsUrls.BusinessPartners)] +public interface IBusinessPartnerService : IServiceNotifications +{ + Task Select(PrimaryKeyArgs args); +} diff --git a/Contacts.Types.Model/IContact.cs b/Contacts.Types.Model/IContact.cs new file mode 100644 index 0000000..144e4f5 --- /dev/null +++ b/Contacts.Types.Model/IContact.cs @@ -0,0 +1,13 @@ +using Connected.Data; + +namespace Contacts.Types; + +public interface IContact : IPrimaryKey +{ + string? FirstName { get; init; } + string? MiddleName { get; init; } + string? LastName { get; init; } + + string? Phone { get; init; } + string? Email { get; init; } +} diff --git a/Contacts.Types.Model/Organizations/IOrganization.cs b/Contacts.Types.Model/Organizations/IOrganization.cs new file mode 100644 index 0000000..b747400 --- /dev/null +++ b/Contacts.Types.Model/Organizations/IOrganization.cs @@ -0,0 +1,10 @@ +using Connected.Data; + +namespace Contacts.Types.Organizations; + +public interface IOrganization : IPrimaryKey +{ + string Name { get; init; } + int PrimaryAddress { get; init; } + int BillingAddress { get; init; } +} diff --git a/Contacts.Types.Model/Organizations/IOrganizationContact.cs b/Contacts.Types.Model/Organizations/IOrganizationContact.cs new file mode 100644 index 0000000..dc74ab0 --- /dev/null +++ b/Contacts.Types.Model/Organizations/IOrganizationContact.cs @@ -0,0 +1,9 @@ +using Connected.Data; + +namespace Contacts.Types.Organizations; + +public interface IOrganizationContact : IPrimaryKey +{ + int Organization { get; init; } + int Contact { get; init; } +} diff --git a/Contacts.Types/Bootstrapper.cs b/Contacts.Types/Bootstrapper.cs new file mode 100644 index 0000000..2fee05c --- /dev/null +++ b/Contacts.Types/Bootstrapper.cs @@ -0,0 +1,9 @@ +using Connected; +using Connected.Annotations; + +[assembly: MicroService(MicroServiceType.Service)] + +namespace Contacts.Types; +internal sealed class Bootstrapper : Startup +{ +} diff --git a/Contacts.Types/BusinessPartnerService.cs b/Contacts.Types/BusinessPartnerService.cs new file mode 100644 index 0000000..68a8328 --- /dev/null +++ b/Contacts.Types/BusinessPartnerService.cs @@ -0,0 +1,15 @@ +using Connected.ServiceModel; +using Connected.Services; + +namespace Contacts.Types; +internal sealed class BusinessPartnerService : EntityService, IBusinessPartnerService +{ + public BusinessPartnerService(IContext context) : base(context) + { + } + + public Task Select(PrimaryKeyArgs args) + { + throw new NotImplementedException(); + } +} diff --git a/Contacts.Types/Contacts.Types.csproj b/Contacts.Types/Contacts.Types.csproj new file mode 100644 index 0000000..beec823 --- /dev/null +++ b/Contacts.Types/Contacts.Types.csproj @@ -0,0 +1,15 @@ + + + + net7.0 + enable + enable + + + + + + + + + diff --git a/Customers.sln b/Customers.sln new file mode 100644 index 0000000..6cbe934 --- /dev/null +++ b/Customers.sln @@ -0,0 +1,56 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.33020.496 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dependencies", "Dependencies", "{AE326167-90A7-4D49-BB24-BA7DEE6A2F26}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Common.Types.Model", "..\Common.Types\Common.Types.Model\Common.Types.Model.csproj", "{3839CE71-C1DD-467E-B1E4-8D00C3460CC5}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Contacts.Types.Model", "Contacts.Types.Model\Contacts.Types.Model.csproj", "{AA722E99-87C8-4D8F-ACB5-2F2D07669BC6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Contacts.Types", "Contacts.Types\Contacts.Types.csproj", "{D465F1C6-42CE-445A-9CCE-5DD6D8A30055}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Entities", "..\Framework\Connected.Entities\Connected.Entities.csproj", "{31825097-E9A6-4643-9118-BE007ABEA405}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Services", "..\Framework\Connected.Services\Connected.Services.csproj", "{F254B9EC-9F32-4304-8855-17DCA60C5EC5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3839CE71-C1DD-467E-B1E4-8D00C3460CC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3839CE71-C1DD-467E-B1E4-8D00C3460CC5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3839CE71-C1DD-467E-B1E4-8D00C3460CC5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3839CE71-C1DD-467E-B1E4-8D00C3460CC5}.Release|Any CPU.Build.0 = Release|Any CPU + {AA722E99-87C8-4D8F-ACB5-2F2D07669BC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AA722E99-87C8-4D8F-ACB5-2F2D07669BC6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AA722E99-87C8-4D8F-ACB5-2F2D07669BC6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AA722E99-87C8-4D8F-ACB5-2F2D07669BC6}.Release|Any CPU.Build.0 = Release|Any CPU + {D465F1C6-42CE-445A-9CCE-5DD6D8A30055}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D465F1C6-42CE-445A-9CCE-5DD6D8A30055}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D465F1C6-42CE-445A-9CCE-5DD6D8A30055}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D465F1C6-42CE-445A-9CCE-5DD6D8A30055}.Release|Any CPU.Build.0 = Release|Any CPU + {31825097-E9A6-4643-9118-BE007ABEA405}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {31825097-E9A6-4643-9118-BE007ABEA405}.Debug|Any CPU.Build.0 = Debug|Any CPU + {31825097-E9A6-4643-9118-BE007ABEA405}.Release|Any CPU.ActiveCfg = Release|Any CPU + {31825097-E9A6-4643-9118-BE007ABEA405}.Release|Any CPU.Build.0 = Release|Any CPU + {F254B9EC-9F32-4304-8855-17DCA60C5EC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F254B9EC-9F32-4304-8855-17DCA60C5EC5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F254B9EC-9F32-4304-8855-17DCA60C5EC5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F254B9EC-9F32-4304-8855-17DCA60C5EC5}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {3839CE71-C1DD-467E-B1E4-8D00C3460CC5} = {AE326167-90A7-4D49-BB24-BA7DEE6A2F26} + {31825097-E9A6-4643-9118-BE007ABEA405} = {AE326167-90A7-4D49-BB24-BA7DEE6A2F26} + {F254B9EC-9F32-4304-8855-17DCA60C5EC5} = {AE326167-90A7-4D49-BB24-BA7DEE6A2F26} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {89478694-8DAA-4C4E-8047-8B516C5E26AE} + EndGlobalSection +EndGlobal