diff --git a/Common.Types.Client/ClientBootstrapper.cs b/Common.Types.Client/ClientBootstrapper.cs
new file mode 100644
index 0000000..86c4a0d
--- /dev/null
+++ b/Common.Types.Client/ClientBootstrapper.cs
@@ -0,0 +1,21 @@
+using Common.Types.TaxRates;
+using Connected.Startup;
+using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
+using Microsoft.Extensions.DependencyInjection;
+
+namespace Common.Types;
+
+public class ClientBootstrapper : IStartup
+{
+ public async Task Configure(WebAssemblyHost host)
+ {
+ await Task.CompletedTask;
+ }
+
+ public async Task ConfigureServices(IServiceCollection services)
+ {
+ services.Add(ServiceDescriptor.Scoped(typeof(ITaxRateService), typeof(TaxRateService)));
+
+ await Task.CompletedTask;
+ }
+}
diff --git a/Common.Types.Client/Common.Types.Client.csproj b/Common.Types.Client/Common.Types.Client.csproj
new file mode 100644
index 0000000..6f62c7f
--- /dev/null
+++ b/Common.Types.Client/Common.Types.Client.csproj
@@ -0,0 +1,15 @@
+
+
+
+ net7.0
+ enable
+ enable
+ Common.Types
+
+
+
+
+
+
+
+
diff --git a/Common.Types.Client/TaxRates/TaxRate.cs b/Common.Types.Client/TaxRates/TaxRate.cs
new file mode 100644
index 0000000..e1c8743
--- /dev/null
+++ b/Common.Types.Client/TaxRates/TaxRate.cs
@@ -0,0 +1,13 @@
+using Connected.Data;
+
+namespace Common.Types.TaxRates;
+
+///
+/// This is the client implementation if the .
+///
+public class TaxRate : PrimaryKey, ITaxRate
+{
+ public string? Name { get; init; }
+ public float Rate { get; init; }
+ public Status Status { get; init; } = Status.Enabled;
+}
diff --git a/Common.Types.Client/TaxRates/TaxRateService.cs b/Common.Types.Client/TaxRates/TaxRateService.cs
new file mode 100644
index 0000000..194968d
--- /dev/null
+++ b/Common.Types.Client/TaxRates/TaxRateService.cs
@@ -0,0 +1,56 @@
+using System.Collections.Immutable;
+using Connected.Net;
+using Connected.Remote;
+using Connected.ServiceModel;
+using Connected.Services;
+
+namespace Common.Types.TaxRates;
+
+///
+/// This is the client implementation of the .
+///
+internal class TaxRateService : EntityService, ITaxRateService, IRemoteService
+{
+ public TaxRateService(IHttpService http)
+ {
+ Http = http;
+ }
+
+ private IHttpService Http { get; }
+
+
+ public async Task Delete(PrimaryKeyArgs e)
+ {
+ await Http.Post("http://localhost:5063/management/commonTypes/taxRates/delete", e);
+ }
+
+ public async Task Insert(InsertTaxRateArgs e)
+ {
+ return await Http.Post("http://localhost:5063/management/commonTypes/taxRates/insert", e);
+ }
+
+ public async Task?> Query(PrimaryKeyListArgs e)
+ {
+ return (await Http.Post?>("http://localhost:5063/management/commonTypes/taxRates/select", e)).ToImmutableList();
+ }
+
+ public async Task?> Query(QueryArgs? args)
+ {
+ return (await Http.Post?>("http://localhost:5063/management/commonTypes/taxRates/query", args ?? QueryArgs.NoPaging)).ToImmutableList();
+ }
+
+ public async Task Select(PrimaryKeyArgs e)
+ {
+ return await Http.Post("http://localhost:5063/management/commonTypes/taxRates/select", e);
+ }
+
+ public async Task Select(TaxRateArgs e)
+ {
+ return await Http.Post("http://localhost:5063/management/commonTypes/taxRates/select", e);
+ }
+
+ public async Task Update(UpdateTaxRateArgs e)
+ {
+ await Http.Post("http://localhost:5063/management/commonTypes/taxRates/update", e);
+ }
+}
diff --git a/Common.Types.Middleware/Common.Types.Middleware.csproj b/Common.Types.Middleware/Common.Types.Middleware.csproj
new file mode 100644
index 0000000..217fffd
--- /dev/null
+++ b/Common.Types.Middleware/Common.Types.Middleware.csproj
@@ -0,0 +1,15 @@
+
+
+
+ net7.0
+ enable
+ enable
+ Common.Types
+
+
+
+
+
+
+
+
diff --git a/Common.Types.Middleware/Currencies/ICurrencyFormatterMiddleware.cs b/Common.Types.Middleware/Currencies/ICurrencyFormatterMiddleware.cs
new file mode 100644
index 0000000..3585e6a
--- /dev/null
+++ b/Common.Types.Middleware/Currencies/ICurrencyFormatterMiddleware.cs
@@ -0,0 +1,9 @@
+using Common.Types.Currencies;
+using Connected;
+
+namespace Common.Types.Middleware.Currencies;
+
+public interface ICurrencyFormatterMiddleware : IMiddleware
+{
+ Task Format(TValue value, ICurrency currency, string format);
+}
diff --git a/Common.Types.Model/BankAccounts/BankAccountArgs.cs b/Common.Types.Model/BankAccounts/BankAccountArgs.cs
new file mode 100644
index 0000000..088f938
--- /dev/null
+++ b/Common.Types.Model/BankAccounts/BankAccountArgs.cs
@@ -0,0 +1,32 @@
+using Connected.Annotations;
+using Connected.Data;
+using Connected.ServiceModel;
+using System.ComponentModel.DataAnnotations;
+
+namespace Common.Types.BankAccounts;
+
+public class BankAccountInsertArgs : Dto
+{
+ [MinValue(1)]
+ public int Bank { get; set; }
+
+ [Required]
+ [MaxLength(128)]
+ public string? Iban { get; set; }
+
+ [Required]
+ [MaxLength(128)]
+ public string? Type { get; set; }
+
+ [Required]
+ [MaxLength(128)]
+ public string? PrimaryKey { get; set; }
+
+ public Status Status { get; set; } = Status.Enabled;
+}
+
+public sealed class BankAccountUpdateArgs : BankAccountInsertArgs
+{
+ [MinValue(1)]
+ public int Id { get; set; }
+}
diff --git a/Common.Types.Model/BankAccounts/IBankAccount.cs b/Common.Types.Model/BankAccounts/IBankAccount.cs
new file mode 100644
index 0000000..4e3029d
--- /dev/null
+++ b/Common.Types.Model/BankAccounts/IBankAccount.cs
@@ -0,0 +1,12 @@
+using Connected.Data;
+
+namespace Common.Types.BankAccounts;
+
+public interface IBankAccount : IPrimaryKey
+{
+ string Iban { get; init; }
+ Status Status { get; init; }
+ int Bank { get; init; }
+ string Type { get; init; }
+ string PrimaryKey { get; init; }
+}
diff --git a/Common.Types.Model/BankAccounts/IBankAccountService.cs b/Common.Types.Model/BankAccounts/IBankAccountService.cs
new file mode 100644
index 0000000..287e529
--- /dev/null
+++ b/Common.Types.Model/BankAccounts/IBankAccountService.cs
@@ -0,0 +1,32 @@
+using Connected.Annotations;
+using Connected.Notifications;
+using Connected.ServiceModel;
+using System.Collections.Immutable;
+
+namespace Common.Types.BankAccounts;
+
+[Service]
+[ServiceUrl(Routes.BankAccounts)]
+public interface IBankAccountService : IServiceNotifications
+{
+ [ServiceMethod(ServiceMethodVerbs.Get)]
+ Task?> Query();
+
+ [ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
+ Task?> Query(PrimaryKeyArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
+ Task?> Query(PrimaryKeyListArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
+ Task Select(PrimaryKeyArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Post | ServiceMethodVerbs.Delete)]
+ Task Delete(PrimaryKeyArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Post | ServiceMethodVerbs.Put)]
+ Task Insert(BankAccountInsertArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Post | ServiceMethodVerbs.Put | ServiceMethodVerbs.Patch)]
+ Task Update(BankAccountUpdateArgs args);
+}
diff --git a/Common.Types.Model/Banks/BankArgs.cs b/Common.Types.Model/Banks/BankArgs.cs
new file mode 100644
index 0000000..0e178b8
--- /dev/null
+++ b/Common.Types.Model/Banks/BankArgs.cs
@@ -0,0 +1,28 @@
+using Connected.Annotations;
+using Connected.Data;
+using Connected.ServiceModel;
+using System.ComponentModel.DataAnnotations;
+
+namespace Common.Types.Banks;
+
+public class InsertBankArgs : Dto
+{
+ [Required]
+ [MaxLength(128)]
+ public string? Name { get; set; }
+
+ [MinValue(1)]
+ public int Country { get; set; }
+
+ [Required]
+ [MaxLength(128)]
+ public string? Bic { get; set; }
+
+ public Status Status { get; set; } = Status.Enabled;
+}
+
+public class UpdateBankArgs : InsertBankArgs
+{
+ [MinValue(1)]
+ public int Id { get; set; }
+}
\ No newline at end of file
diff --git a/Common.Types.Model/Banks/IBank.cs b/Common.Types.Model/Banks/IBank.cs
new file mode 100644
index 0000000..02e4484
--- /dev/null
+++ b/Common.Types.Model/Banks/IBank.cs
@@ -0,0 +1,11 @@
+using Connected.Data;
+
+namespace Common.Types.Banks;
+
+public interface IBank : IPrimaryKey
+{
+ string Name { get; init; }
+ int Country { get; init; }
+ string Bic { get; init; }
+ Status Status { get; init; }
+}
diff --git a/Common.Types.Model/Banks/IBankService.cs b/Common.Types.Model/Banks/IBankService.cs
new file mode 100644
index 0000000..b9ee88c
--- /dev/null
+++ b/Common.Types.Model/Banks/IBankService.cs
@@ -0,0 +1,29 @@
+using Connected.Annotations;
+using Connected.Notifications;
+using Connected.ServiceModel;
+using System.Collections.Immutable;
+
+namespace Common.Types.Banks;
+
+[Service]
+[ServiceUrl(Routes.Banks)]
+public interface IBankService : IServiceNotifications
+{
+ [ServiceMethod(ServiceMethodVerbs.Get)]
+ Task?> Query();
+
+ [ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
+ Task?> Query(PrimaryKeyListArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
+ Task Select(PrimaryKeyArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Post | ServiceMethodVerbs.Put)]
+ Task Insert(InsertBankArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Post | ServiceMethodVerbs.Put | ServiceMethodVerbs.Patch)]
+ Task Update(UpdateBankArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Post | ServiceMethodVerbs.Delete)]
+ Task Delete(PrimaryKeyArgs args);
+}
diff --git a/Common.Types.Model/Common - Backup.Types.Model.csproj b/Common.Types.Model/Common - Backup.Types.Model.csproj
new file mode 100644
index 0000000..bb4fcea
--- /dev/null
+++ b/Common.Types.Model/Common - Backup.Types.Model.csproj
@@ -0,0 +1,15 @@
+
+
+
+ net7.0
+ enable
+ enable
+ $(MSBuildProjectName.Replace(" ", "_"))
+
+
+
+
+
+
+
+
diff --git a/Common.Types.Model/Common.Types.Model.csproj b/Common.Types.Model/Common.Types.Model.csproj
new file mode 100644
index 0000000..5c4b483
--- /dev/null
+++ b/Common.Types.Model/Common.Types.Model.csproj
@@ -0,0 +1,15 @@
+
+
+
+ net7.0
+ enable
+ enable
+ Common.Types
+
+
+
+
+
+
+
+
diff --git a/Common.Types.Model/Continent/ContinentArgs.cs b/Common.Types.Model/Continent/ContinentArgs.cs
new file mode 100644
index 0000000..ed6a324
--- /dev/null
+++ b/Common.Types.Model/Continent/ContinentArgs.cs
@@ -0,0 +1,18 @@
+using Connected.Annotations;
+using Connected.ServiceModel;
+using System.ComponentModel.DataAnnotations;
+
+namespace Common.Types.Continent;
+
+public class InsertContinentArgs : Dto
+{
+ [Required]
+ [MaxLength(128)]
+ public string? Name { get; set; }
+}
+
+public sealed class UpdateContitentArgs : InsertContinentArgs
+{
+ [MinValue(1)]
+ public int Id { get; set; }
+}
diff --git a/Common.Types.Model/Continent/Countries/ContinentCountryArgs.cs b/Common.Types.Model/Continent/Countries/ContinentCountryArgs.cs
new file mode 100644
index 0000000..f8174c0
--- /dev/null
+++ b/Common.Types.Model/Continent/Countries/ContinentCountryArgs.cs
@@ -0,0 +1,13 @@
+using Connected.Annotations;
+using Connected.ServiceModel;
+
+namespace Common.Types.Continent.Countries;
+
+public class InsertContinentCountryArgs : Dto
+{
+ [MinValue(1)]
+ public int Continent { get; set; }
+
+ [MinValue(1)]
+ public int Country { get; set; }
+}
diff --git a/Common.Types.Model/Continent/Countries/IContinentCountry.cs b/Common.Types.Model/Continent/Countries/IContinentCountry.cs
new file mode 100644
index 0000000..a1eb464
--- /dev/null
+++ b/Common.Types.Model/Continent/Countries/IContinentCountry.cs
@@ -0,0 +1,9 @@
+using Connected.Data;
+
+namespace Common.Types.Continent.Countries;
+
+public interface IContinentCountry : IPrimaryKey
+{
+ int Continent { get; init; }
+ int Country { get; init; }
+}
diff --git a/Common.Types.Model/Continent/Countries/IContinentCountryService.cs b/Common.Types.Model/Continent/Countries/IContinentCountryService.cs
new file mode 100644
index 0000000..6de38bf
--- /dev/null
+++ b/Common.Types.Model/Continent/Countries/IContinentCountryService.cs
@@ -0,0 +1,34 @@
+using Connected.Annotations;
+using Connected.Notifications;
+using Connected.ServiceModel;
+using System.Collections.Immutable;
+
+namespace Common.Types.Continent.Countries;
+
+[Service]
+[ServiceUrl(Routes.ContinentCountries)]
+public interface IContinentCountryService : IServiceNotifications
+{
+ [ServiceMethod(ServiceMethodVerbs.Get)]
+ Task?> Query();
+ ///
+ /// Queries countries for the specified continent id.
+ ///
+ /// The id fo the continent.
+ /// The list of countries.
+ [ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
+ Task?> QueryCountries(PrimaryKeyArgs args);
+ ///
+ /// Select a entity for the specified country id.
+ ///
+ /// The country id.
+ /// The entity if exists, null
otherwise.
+ [ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
+ Task SelectCountry(PrimaryKeyArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Post | ServiceMethodVerbs.Put)]
+ Task Insert(InsertContinentCountryArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Post | ServiceMethodVerbs.Delete)]
+ Task Delete(PrimaryKeyArgs args);
+}
diff --git a/Common.Types.Model/Continent/IContinent.cs b/Common.Types.Model/Continent/IContinent.cs
new file mode 100644
index 0000000..b6c389c
--- /dev/null
+++ b/Common.Types.Model/Continent/IContinent.cs
@@ -0,0 +1,8 @@
+using Connected.Data;
+
+namespace Common.Types.Continent;
+
+public interface IContinent : IPrimaryKey
+{
+ string Name { get; init; }
+}
diff --git a/Common.Types.Model/Continent/IContinentService.cs b/Common.Types.Model/Continent/IContinentService.cs
new file mode 100644
index 0000000..e0de3f2
--- /dev/null
+++ b/Common.Types.Model/Continent/IContinentService.cs
@@ -0,0 +1,29 @@
+using Connected.Annotations;
+using Connected.Notifications;
+using Connected.ServiceModel;
+using System.Collections.Immutable;
+
+namespace Common.Types.Continent;
+
+[Service]
+[ServiceUrl(Routes.Continents)]
+public interface IContinentService : IServiceNotifications
+{
+ [ServiceMethod(ServiceMethodVerbs.Get)]
+ Task?> Query();
+
+ [ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
+ Task> Query(PrimaryKeyListArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
+ Task Select(PrimaryKeyArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Put | ServiceMethodVerbs.Post)]
+ Task Insert(InsertContinentArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Put | ServiceMethodVerbs.Post | ServiceMethodVerbs.Patch)]
+ Task Update(UpdateContitentArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Delete | ServiceMethodVerbs.Post)]
+ Task Delete(PrimaryKeyArgs args);
+}
diff --git a/Common.Types.Model/Countries/CountryArgs.cs b/Common.Types.Model/Countries/CountryArgs.cs
new file mode 100644
index 0000000..51c1a61
--- /dev/null
+++ b/Common.Types.Model/Countries/CountryArgs.cs
@@ -0,0 +1,27 @@
+using Connected.Annotations;
+using Connected.Data;
+using Connected.ServiceModel;
+using System.ComponentModel.DataAnnotations;
+
+namespace Common.Types.Countries;
+
+public class InsertCountryArgs : Dto
+{
+ [Required]
+ [MaxLength(128)]
+ public string Name { get; set; }
+
+ [MinValue(0)]
+ public int Lcid { get; set; }
+
+ [MaxLength(128)]
+ public string? IsoCode { get; set; }
+
+ public Status Status { get; set; } = Status.Enabled;
+}
+
+public class UpdateCountryArgs : InsertCountryArgs
+{
+ [MinValue(1)]
+ public int Id { get; set; }
+}
diff --git a/Common.Types.Model/Countries/ICountry.cs b/Common.Types.Model/Countries/ICountry.cs
new file mode 100644
index 0000000..60b906a
--- /dev/null
+++ b/Common.Types.Model/Countries/ICountry.cs
@@ -0,0 +1,11 @@
+using Connected.Data;
+
+namespace Common.Types.Countries;
+
+public interface ICountry : IPrimaryKey
+{
+ string Name { get; init; }
+ int Lcid { get; init; }
+ string IsoCode { get; init; }
+ Status Status { get; init; }
+}
diff --git a/Common.Types.Model/Countries/ICountryService.cs b/Common.Types.Model/Countries/ICountryService.cs
new file mode 100644
index 0000000..2215333
--- /dev/null
+++ b/Common.Types.Model/Countries/ICountryService.cs
@@ -0,0 +1,33 @@
+using Connected.Annotations;
+using Connected.Notifications;
+using Connected.ServiceModel;
+using System.Collections.Immutable;
+
+namespace Common.Types.Countries;
+
+[Service]
+[ServiceUrl(Routes.Countries)]
+
+public interface ICountryService : IServiceNotifications
+{
+ [ServiceMethod(ServiceMethodVerbs.Get)]
+ Task?> Query();
+
+ [ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
+ Task?> Query(PrimaryKeyListArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
+ Task Select(PrimaryKeyArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
+ Task Select(NameArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Delete | ServiceMethodVerbs.Post)]
+ Task Delete(PrimaryKeyArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Put | ServiceMethodVerbs.Post)]
+ Task Insert(InsertCountryArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Put | ServiceMethodVerbs.Post | ServiceMethodVerbs.Patch)]
+ Task Update(UpdateCountryArgs args);
+}
diff --git a/Common.Types.Model/Currencies/CurrencyArgs.cs b/Common.Types.Model/Currencies/CurrencyArgs.cs
new file mode 100644
index 0000000..e05aeae
--- /dev/null
+++ b/Common.Types.Model/Currencies/CurrencyArgs.cs
@@ -0,0 +1,40 @@
+using Connected.Annotations;
+using Connected.Data;
+using Connected.ServiceModel;
+using System.ComponentModel.DataAnnotations;
+
+namespace Common.Types.Currencies;
+
+public class CurrencyInsertArgs : Dto
+{
+ [Required]
+ [MaxLength(128)]
+ public string? Name { get; set; }
+
+ [Required]
+ [MaxLength(32)]
+ public string? Code { get; set; }
+
+ [Required]
+ [MaxLength(8)]
+ public string? Symbol { get; set; }
+
+ [MinValue(0)]
+ public int Lcid { get; set; }
+
+ public Status Status { get; set; } = Status.Enabled;
+}
+
+public sealed class CurrencyUpdateArgs : CurrencyInsertArgs
+{
+ [MinValue(1)]
+ public int Id { get; set; }
+}
+
+public sealed class CurrencyFormatArgs : Dto
+{
+ [Range(0, int.MaxValue)]
+ public int Currency { get; set; }
+
+ public double Value { get; set; }
+}
diff --git a/Common.Types.Model/Currencies/ICurrency.cs b/Common.Types.Model/Currencies/ICurrency.cs
new file mode 100644
index 0000000..972eeae
--- /dev/null
+++ b/Common.Types.Model/Currencies/ICurrency.cs
@@ -0,0 +1,12 @@
+using Connected.Data;
+
+namespace Common.Types.Currencies;
+
+public interface ICurrency : IPrimaryKey
+{
+ string Name { get; init; }
+ string Code { get; init; }
+ string Symbol { get; init; }
+ int Lcid { get; init; }
+ Status Status { get; init; }
+}
diff --git a/Common.Types.Model/Currencies/ICurrencyService.cs b/Common.Types.Model/Currencies/ICurrencyService.cs
new file mode 100644
index 0000000..e6081e8
--- /dev/null
+++ b/Common.Types.Model/Currencies/ICurrencyService.cs
@@ -0,0 +1,32 @@
+using Connected.Annotations;
+using Connected.Notifications;
+using Connected.ServiceModel;
+using System.Collections.Immutable;
+
+namespace Common.Types.Currencies;
+
+[Service]
+[ServiceUrl(Routes.Currencies)]
+public interface ICurrencyService : IServiceNotifications
+{
+ [ServiceMethod(ServiceMethodVerbs.Get)]
+ Task> Query();
+
+ [ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
+ Task> Query(PrimaryKeyListArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
+ Task Select(PrimaryKeyArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
+ Task Format(CurrencyFormatArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Post | ServiceMethodVerbs.Put)]
+ Task Insert(CurrencyInsertArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Post | ServiceMethodVerbs.Patch | ServiceMethodVerbs.Put)]
+ Task Update(CurrencyUpdateArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Post | ServiceMethodVerbs.Delete)]
+ Task Delete(PrimaryKeyArgs args);
+}
diff --git a/Common.Types.Model/MeasureUnits/IMeasureUnit.cs b/Common.Types.Model/MeasureUnits/IMeasureUnit.cs
new file mode 100644
index 0000000..7cdfb22
--- /dev/null
+++ b/Common.Types.Model/MeasureUnits/IMeasureUnit.cs
@@ -0,0 +1,11 @@
+using Connected.Data;
+
+namespace Common.Types.MeasureUnits;
+
+public interface IMeasureUnit : IPrimaryKey
+{
+ string Name { get; init; }
+ string Code { get; init; }
+ byte Precision { get; init; }
+ Status Status { get; init; }
+}
diff --git a/Common.Types.Model/MeasureUnits/IMeasureUnitService.cs b/Common.Types.Model/MeasureUnits/IMeasureUnitService.cs
new file mode 100644
index 0000000..8bf2880
--- /dev/null
+++ b/Common.Types.Model/MeasureUnits/IMeasureUnitService.cs
@@ -0,0 +1,29 @@
+using Connected.Annotations;
+using Connected.Notifications;
+using Connected.ServiceModel;
+using System.Collections.Immutable;
+
+namespace Common.Types.MeasureUnits;
+
+[Service]
+[ServiceUrl(Routes.MeasureUnits)]
+public interface IMeasureUnitService : IServiceNotifications
+{
+ [ServiceMethod(ServiceMethodVerbs.Get)]
+ Task?> Query();
+
+ [ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
+ Task?> Query(PrimaryKeyListArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
+ Task Select(PrimaryKeyArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Post | ServiceMethodVerbs.Delete)]
+ Task Delete(PrimaryKeyArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Post | ServiceMethodVerbs.Put)]
+ Task Insert(MeasureUnitInsertArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Post | ServiceMethodVerbs.Put | ServiceMethodVerbs.Patch)]
+ Task Update(MeasureUnitUpdateArgs args);
+}
diff --git a/Common.Types.Model/MeasureUnits/MeasureUnitArgs.cs b/Common.Types.Model/MeasureUnits/MeasureUnitArgs.cs
new file mode 100644
index 0000000..f54131e
--- /dev/null
+++ b/Common.Types.Model/MeasureUnits/MeasureUnitArgs.cs
@@ -0,0 +1,27 @@
+using Connected.Data;
+using Connected.ServiceModel;
+using System.ComponentModel.DataAnnotations;
+
+namespace Common.Types.MeasureUnits;
+
+public class MeasureUnitInsertArgs : Dto
+{
+ [Required]
+ [MaxLength(128)]
+ public string? Name { get; set; }
+
+ [Required]
+ [MaxLength(8)]
+ public string? Code { get; set; }
+
+ [Range(0, 32)]
+ public byte Precision { get; set; }
+
+ public Status Status { get; set; } = Status.Enabled;
+}
+
+public sealed class MeasureUnitUpdateArgs : MeasureUnitInsertArgs
+{
+ [Range(1, int.MaxValue)]
+ public int Id { get; set; }
+}
diff --git a/Common.Types.Model/MicroService.cs b/Common.Types.Model/MicroService.cs
new file mode 100644
index 0000000..c8460b9
--- /dev/null
+++ b/Common.Types.Model/MicroService.cs
@@ -0,0 +1,7 @@
+using System.Runtime.CompilerServices;
+
+using Connected.Annotations;
+
+[assembly: MicroService(MicroServiceType.Contract)]
+[assembly: InternalsVisibleTo("Common.Types.Tests")]
+[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
\ No newline at end of file
diff --git a/Common.Types.Model/PostalCodes/IPostalCode.cs b/Common.Types.Model/PostalCodes/IPostalCode.cs
new file mode 100644
index 0000000..a77b892
--- /dev/null
+++ b/Common.Types.Model/PostalCodes/IPostalCode.cs
@@ -0,0 +1,11 @@
+using Connected.Data;
+
+namespace Common.Types.PostalCodes;
+
+public interface IPostalCode : IPrimaryKey
+{
+ int Country { get; init; }
+ string Name { get; init; }
+ string Code { get; init; }
+ Status Status { get; init; }
+}
diff --git a/Common.Types.Model/PostalCodes/IPostalCodeService.cs b/Common.Types.Model/PostalCodes/IPostalCodeService.cs
new file mode 100644
index 0000000..c768539
--- /dev/null
+++ b/Common.Types.Model/PostalCodes/IPostalCodeService.cs
@@ -0,0 +1,35 @@
+using Connected.Annotations;
+using Connected.Notifications;
+using Connected.ServiceModel;
+using System.Collections.Immutable;
+
+namespace Common.Types.PostalCodes;
+
+[Service]
+[ServiceUrl(Routes.PostalCodes)]
+public interface IPostalCodeService : IServiceNotifications
+{
+ [ServiceMethod(ServiceMethodVerbs.Get)]
+ Task?> Query();
+
+ [ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
+ Task?> Query(PrimaryKeyListArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
+ Task?> Query(PrimaryKeyArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
+ Task?> Search(PostalCodeSearchArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
+ Task Select(PrimaryKeyArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Post | ServiceMethodVerbs.Delete)]
+ Task Delete(PrimaryKeyArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Post | ServiceMethodVerbs.Put)]
+ Task Insert(PostalCodeInsertArgs args);
+
+ [ServiceMethod(ServiceMethodVerbs.Post | ServiceMethodVerbs.Put | ServiceMethodVerbs.Patch)]
+ Task Update(PostalCodeInsertArgs args);
+}
diff --git a/Common.Types.Model/PostalCodes/PostalCodeArgs.cs b/Common.Types.Model/PostalCodes/PostalCodeArgs.cs
new file mode 100644
index 0000000..f12d5f1
--- /dev/null
+++ b/Common.Types.Model/PostalCodes/PostalCodeArgs.cs
@@ -0,0 +1,40 @@
+using Connected.Annotations;
+using Connected.Data;
+using Connected.ServiceModel;
+using System.ComponentModel.DataAnnotations;
+
+namespace Common.Types.PostalCodes;
+
+public class PostalCodeInsertArgs : Dto
+{
+ [MinValue(1)]
+ public int Country { get; set; }
+
+ [Required]
+ [MaxLength(128)]
+ public string? Name { get; set; }
+
+ [Required]
+ [MaxLength(16)]
+ public string? Code { get; set; }
+
+ public Status Status { get; set; } = Status.Enabled;
+}
+
+public sealed class PostalCodeUpdateArgs : PostalCodeInsertArgs
+{
+ [Range(1, int.MaxValue)]
+ public int Id { get; set; }
+}
+
+public sealed class PostalCodeSearchArgs : Dto
+{
+ [Range(0, int.MaxValue)]
+ public int Country { get; set; }
+
+ [MaxLength(128)]
+ public string? Name { get; set; }
+
+ [MaxLength(16)]
+ public string? Code { get; set; }
+}
diff --git a/Common.Types.Model/Routes.cs b/Common.Types.Model/Routes.cs
new file mode 100644
index 0000000..92b7922
--- /dev/null
+++ b/Common.Types.Model/Routes.cs
@@ -0,0 +1,19 @@
+using C = Common.CommonRoutes;
+
+namespace Common.Types
+{
+ public static class Routes
+ {
+ public const string CommonTypes = "commonTypes";
+
+ public const string TaxRates = $"{C.Management}/{CommonTypes}/taxRates";
+ public const string Countries = $"{C.Management}/{CommonTypes}/countries";
+ public const string Continents = $"{C.Management}/{CommonTypes}/continents";
+ public const string ContinentCountries = $"{C.Management}/{CommonTypes}/continents/countries";
+ public const string Banks = $"{C.Management}/{CommonTypes}/banks";
+ public const string BankAccounts = $"{C.Management}/{CommonTypes}/bankAccounts";
+ public const string Currencies = $"{C.Management}/{CommonTypes}/currencies";
+ public const string PostalCodes = $"{C.Management}/{CommonTypes}/postalCodes";
+ public const string MeasureUnits = $"{C.Management}/{CommonTypes}/measureUnits";
+ }
+}
diff --git a/Common.Types.Model/TaxRates/ITaxRate.cs b/Common.Types.Model/TaxRates/ITaxRate.cs
new file mode 100644
index 0000000..c38ad31
--- /dev/null
+++ b/Common.Types.Model/TaxRates/ITaxRate.cs
@@ -0,0 +1,36 @@
+using Connected.Data;
+
+namespace Common.Types.TaxRates;
+
+///
+/// Represents an entity which contains information about tax rate.
+///
+///
+/// Every Tax system has one or more tax rates, for example one tax rate is for
+/// products and the other is for servies. This entity enables the environment
+/// to manage different tax rates.
+///
+public interface ITaxRate : IPrimaryKey
+{
+ ///
+ /// The name of the tax rate.
+ ///
+ ///
+ /// Define this value as descriptive as possible so users can
+ /// quickly recognize whyt kind of tax rate defines each record.
+ ///
+ string? Name { get; init; }
+ ///
+ /// The rate or value of the tax rate. Should be a positive number.
+ ///
+ ///
+ /// Avoid updating this value. Create a new entity instead
+ /// and disable the previous entity by setting its value to .
+ ///
+ float Rate { get; init; }
+ ///
+ /// The status of tax rate. Tax rates that are not used in the environment should be marked
+ /// as so users can use only valid records.
+ ///
+ Status Status { get; init; }
+}
\ No newline at end of file
diff --git a/Common.Types.Model/TaxRates/ITaxRateService.cs b/Common.Types.Model/TaxRates/ITaxRateService.cs
new file mode 100644
index 0000000..42f3903
--- /dev/null
+++ b/Common.Types.Model/TaxRates/ITaxRateService.cs
@@ -0,0 +1,63 @@
+using System.Collections.Immutable;
+using Connected.Annotations;
+using Connected.Notifications;
+using Connected.ServiceModel;
+
+namespace Common.Types.TaxRates;
+
+///
+/// The service used to manipulate with the entity.
+///
+[Service]
+[ServiceUrl(Routes.TaxRates)]
+public interface ITaxRateService : IServiceNotifications
+{
+ ///
+ /// Queries all valid entities.
+ ///
+ /// An representing all valid entities.
+ [ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
+ Task?> Query(QueryArgs? args);
+ ///
+ /// Performs a lookup on entities for the specified list of ids.
+ ///
+ /// The List of the ids for which the perform a query.
+ /// An of entities that matches
+ /// the passed ids.
+ [ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
+ Task?> Query(PrimaryKeyListArgs e);
+ ///
+ /// Selects an entity for the specified id.
+ ///
+ /// The which contains id.
+ /// First that matches the arguments.
+ [ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
+ Task Select(PrimaryKeyArgs e);
+ ///
+ /// Selects an for the specified arguments.
+ ///
+ /// The arguments for which the entity
+ /// will be returned.
+ /// First that matches the arguments.
+ [ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
+ Task Select(TaxRateArgs e);
+ ///
+ /// Inserts a new entity.
+ ///
+ ///
+ /// An Id of the newly inserted entity.
+ ///
+ [ServiceMethod(ServiceMethodVerbs.Post)]
+ Task Insert(InsertTaxRateArgs e);
+ ///
+ /// Updates entity.
+ ///
+ /// The containing values to be updated.
+ [ServiceMethod(ServiceMethodVerbs.Post)]
+ Task Update(UpdateTaxRateArgs e);
+ ///
+ /// Deletes entity.
+ ///
+ [ServiceMethod(ServiceMethodVerbs.Delete | ServiceMethodVerbs.Post)]
+ Task Delete(PrimaryKeyArgs e);
+}
diff --git a/Common.Types.Model/TaxRates/TaxRateArgs.cs b/Common.Types.Model/TaxRates/TaxRateArgs.cs
new file mode 100644
index 0000000..8c18f39
--- /dev/null
+++ b/Common.Types.Model/TaxRates/TaxRateArgs.cs
@@ -0,0 +1,45 @@
+using Connected.Annotations;
+using Connected.ServiceModel;
+using System.ComponentModel.DataAnnotations;
+
+namespace Common.Types.TaxRates;
+
+///
+/// The arguments class for methods.
+///
+public class TaxRateArgs : Dto
+{
+ ///
+ /// The name.
+ ///
+ ///
+ /// This is a required property with its max length of 128 characters.
+ ///
+ [Required]
+ [MaxLength(128)]
+ public string? Name { get; set; }
+ ///
+ /// The rate.
+ ///
+ ///
+ /// This is a required property with it min value of 0.
+ ///
+ [MinValue(0)]
+ public float Rate { get; set; }
+}
+///
+/// The arguments used when inserting a new entity.
+/// This is only a markup class serving primary for validation distinction.
+///
+public sealed class InsertTaxRateArgs : TaxRateArgs
+{
+
+}
+///
+/// The arguments class used when updating entity.
+///
+public class UpdateTaxRateArgs : TaxRateArgs
+{
+ [MinValue(0)]
+ public int Id { get; set; }
+}
diff --git a/Common.Types.Tests/Common.Types.Tests.csproj b/Common.Types.Tests/Common.Types.Tests.csproj
new file mode 100644
index 0000000..5a21ae0
--- /dev/null
+++ b/Common.Types.Tests/Common.Types.Tests.csproj
@@ -0,0 +1,25 @@
+
+
+
+ net7.0
+ enable
+ enable
+
+ false
+
+ Common.Types
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Common.Types.Tests/InstanceFaker.cs b/Common.Types.Tests/InstanceFaker.cs
new file mode 100644
index 0000000..7b8f8b6
--- /dev/null
+++ b/Common.Types.Tests/InstanceFaker.cs
@@ -0,0 +1,61 @@
+using Moq;
+
+namespace Common.Types;
+
+internal class InstanceFaker
+{
+ private readonly Dictionary _mocks = new();
+ private bool _mocksGenerated = false;
+
+ public InstanceFaker()
+ {
+ if (typeof(T).GetConstructors().Length > 1)
+ throw new Exception($"Multiple constructors for type {typeof(T).FullName} found. Auto resolve not possible.");
+
+ GenerateMocks();
+ }
+
+ private void GenerateMocks()
+ {
+ if (_mocksGenerated)
+ return;
+
+ _mocksGenerated = true;
+
+ var constructor = typeof(T).GetConstructors()[0];
+
+ var parameters = constructor.GetParameters();
+
+ foreach (var parameter in parameters)
+ {
+ if (!parameter.ParameterType.IsInterface)
+ throw new Exception($"Constructor parameter {parameter.Name} of type {parameter.ParameterType.FullName} is not an interface, cannot mock.");
+
+ _mocks.Add(parameter.ParameterType, CreateMock(parameter.ParameterType));
+ }
+ }
+
+ private T ProcessType()
+ {
+ GenerateMocks();
+
+ var constructor = typeof(T).GetConstructors()[0];
+
+ var mocks = _mocks.Select(e => e.Value.Object);
+
+ return (T)constructor.Invoke(mocks.Cast