From d59b2ac557c028247534679c3fe406548714766a Mon Sep 17 00:00:00 2001 From: Richard Garcia Date: Sat, 21 Feb 2026 10:54:36 -0300 Subject: [PATCH 01/11] =?UTF-8?q?feature(#2):=20this=20commit=20introduces?= =?UTF-8?q?=20the=20new=20=E2=80=9Caddress=E2=80=9D=20class=20as=20a=20val?= =?UTF-8?q?ue=20object=20with=20detailed=20address=20fields?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{Entities => Aggregates}/Order.cs | 2 ++ .../Comanda.Orders.Domain/Concepts/Address.cs | 15 +++++++++++++++ 2 files changed, 17 insertions(+) rename Boundaries/Comanda.Orders/Source/Comanda.Orders.Domain/{Entities => Aggregates}/Order.cs (90%) create mode 100644 Boundaries/Comanda.Orders/Source/Comanda.Orders.Domain/Concepts/Address.cs diff --git a/Boundaries/Comanda.Orders/Source/Comanda.Orders.Domain/Entities/Order.cs b/Boundaries/Comanda.Orders/Source/Comanda.Orders.Domain/Aggregates/Order.cs similarity index 90% rename from Boundaries/Comanda.Orders/Source/Comanda.Orders.Domain/Entities/Order.cs rename to Boundaries/Comanda.Orders/Source/Comanda.Orders.Domain/Aggregates/Order.cs index e3960de..68c1cb1 100644 --- a/Boundaries/Comanda.Orders/Source/Comanda.Orders.Domain/Entities/Order.cs +++ b/Boundaries/Comanda.Orders/Source/Comanda.Orders.Domain/Aggregates/Order.cs @@ -4,6 +4,8 @@ public sealed class Order : Aggregate { public Code Code { get; set; } = default!; public Metadata Metadata { get; set; } = default!; + public Address Address { get; set; } = default!; + public Status Status { get; set; } = Status.Pending; public Priority Priority { get; set; } = Priority.Normal; public Fulfillment Fulfillment { get; set; } = Fulfillment.Unspecified; diff --git a/Boundaries/Comanda.Orders/Source/Comanda.Orders.Domain/Concepts/Address.cs b/Boundaries/Comanda.Orders/Source/Comanda.Orders.Domain/Concepts/Address.cs new file mode 100644 index 0000000..255454c --- /dev/null +++ b/Boundaries/Comanda.Orders/Source/Comanda.Orders.Domain/Concepts/Address.cs @@ -0,0 +1,15 @@ +namespace Comanda.Orders.Domain.Concepts; + +public sealed record Address : IValueObject
+{ + public string Street { get; init; } = default!; + public string Number { get; init; } = default!; + public string City { get; init; } = default!; + + public string State { get; init; } = default!; + public string ZipCode { get; init; } = default!; + public string Neighborhood { get; init; } = default!; + + public string? Complement { get; init; } + public string? Reference { get; init; } +} From 51e6d8d24f5544ec238a3c81ce13cc609fcd2323 Mon Sep 17 00:00:00 2001 From: Richard Garcia Date: Sat, 21 Feb 2026 11:05:19 -0300 Subject: [PATCH 02/11] feature(#2): the address property of the order class has been changed to be of type "address?", allowing it to accept null values. --- .../Source/Comanda.Orders.Domain/Aggregates/Order.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Boundaries/Comanda.Orders/Source/Comanda.Orders.Domain/Aggregates/Order.cs b/Boundaries/Comanda.Orders/Source/Comanda.Orders.Domain/Aggregates/Order.cs index 68c1cb1..98225e4 100644 --- a/Boundaries/Comanda.Orders/Source/Comanda.Orders.Domain/Aggregates/Order.cs +++ b/Boundaries/Comanda.Orders/Source/Comanda.Orders.Domain/Aggregates/Order.cs @@ -4,7 +4,7 @@ public sealed class Order : Aggregate { public Code Code { get; set; } = default!; public Metadata Metadata { get; set; } = default!; - public Address Address { get; set; } = default!; + public Address? Address { get; set; } = default!; public Status Status { get; set; } = Status.Pending; public Priority Priority { get; set; } = Priority.Normal; From 2e81ef11611a52034d1d17101113e05e057540fb Mon Sep 17 00:00:00 2001 From: Richard Garcia Date: Sat, 21 Feb 2026 11:06:20 -0300 Subject: [PATCH 03/11] feature(#2): includes the "address" property in the schemes records, allowing the address associated with the order to be stored during its creation and representation. --- .../Payloads/Order/OrderCreationScheme.cs | 1 + .../Comanda.Orders.Application/Payloads/Order/OrderScheme.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/Boundaries/Comanda.Orders/Source/Comanda.Orders.Application/Payloads/Order/OrderCreationScheme.cs b/Boundaries/Comanda.Orders/Source/Comanda.Orders.Application/Payloads/Order/OrderCreationScheme.cs index 19f68ed..ffd1729 100644 --- a/Boundaries/Comanda.Orders/Source/Comanda.Orders.Application/Payloads/Order/OrderCreationScheme.cs +++ b/Boundaries/Comanda.Orders/Source/Comanda.Orders.Application/Payloads/Order/OrderCreationScheme.cs @@ -4,6 +4,7 @@ public sealed record OrderCreationScheme : IDispatchable> { public Fulfillment Fulfillment { get; init; } public Priority Priority { get; init; } + public Address? Address { get; init; } = default!; public Metadata Metadata { get; init; } = default!; public IEnumerable Items { get; init; } = []; } diff --git a/Boundaries/Comanda.Orders/Source/Comanda.Orders.Application/Payloads/Order/OrderScheme.cs b/Boundaries/Comanda.Orders/Source/Comanda.Orders.Application/Payloads/Order/OrderScheme.cs index 2d1faad..f899343 100644 --- a/Boundaries/Comanda.Orders/Source/Comanda.Orders.Application/Payloads/Order/OrderScheme.cs +++ b/Boundaries/Comanda.Orders/Source/Comanda.Orders.Application/Payloads/Order/OrderScheme.cs @@ -5,6 +5,7 @@ public sealed record OrderScheme public string Identifier { get; init; } = default!; public string Code { get; init; } = default!; + public Address? Address { get; init; } = default!; public Status Status { get; init; } public Priority Priority { get; init; } public Fulfillment Fulfillment { get; init; } From 34b41c106b01ce21b01c73e7196ac0d8d274a917 Mon Sep 17 00:00:00 2001 From: Richard Garcia Date: Sat, 21 Feb 2026 11:07:20 -0300 Subject: [PATCH 04/11] feature(#2): this commit introduces global imports in usings.cs --- .../Comanda.Orders/Source/Comanda.Orders.Application/Usings.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Boundaries/Comanda.Orders/Source/Comanda.Orders.Application/Usings.cs b/Boundaries/Comanda.Orders/Source/Comanda.Orders.Application/Usings.cs index 43601d3..d25a2e0 100644 --- a/Boundaries/Comanda.Orders/Source/Comanda.Orders.Application/Usings.cs +++ b/Boundaries/Comanda.Orders/Source/Comanda.Orders.Application/Usings.cs @@ -11,6 +11,7 @@ global using Comanda.Orders.Application.Payloads.Order; global using Comanda.Orders.Application.Mappers; +global using HttpsRichardy.Internal.Essentials.Utilities; global using HttpsRichardy.Internal.Essentials.Patterns; global using HttpsRichardy.Internal.Essentials.Filtering; global using HttpsRichardy.Internal.Essentials.Concepts; From a3ad588a38d2dcc4d63605f52e315261639e00a7 Mon Sep 17 00:00:00 2001 From: Richard Garcia Date: Sat, 21 Feb 2026 11:08:43 -0300 Subject: [PATCH 05/11] =?UTF-8?q?feature(#2):=20this=20commit=20introduces?= =?UTF-8?q?=20the=20mapping=20of=20the=20=E2=80=9Caddress=E2=80=9D=20prope?= =?UTF-8?q?rty=20in=20the=20response=20schema=20and=20in=20the=20entity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Source/Comanda.Orders.Application/Mappers/OrderMapper.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Boundaries/Comanda.Orders/Source/Comanda.Orders.Application/Mappers/OrderMapper.cs b/Boundaries/Comanda.Orders/Source/Comanda.Orders.Application/Mappers/OrderMapper.cs index b1ce359..4a8d814 100644 --- a/Boundaries/Comanda.Orders/Source/Comanda.Orders.Application/Mappers/OrderMapper.cs +++ b/Boundaries/Comanda.Orders/Source/Comanda.Orders.Application/Mappers/OrderMapper.cs @@ -7,6 +7,7 @@ public static Order AsOrder(this OrderCreationScheme scheme, Code code) var order = new Order { Code = code, + Address = scheme.Address, Fulfillment = scheme.Fulfillment, Priority = scheme.Priority, Metadata = scheme.Metadata, @@ -47,6 +48,7 @@ public static Order AsOrder(this OrderCreationScheme scheme, Code code) { Identifier = order.Id, Code = order.Code.Identifier, + Address = order.Address, Priority = order.Priority, Status = order.Status, Fulfillment = order.Fulfillment, From 27fe84c876cdd05c80fda8af173ecd9f9eb950a1 Mon Sep 17 00:00:00 2001 From: Richard Garcia Date: Sat, 21 Feb 2026 11:09:48 -0300 Subject: [PATCH 06/11] feature(#2): this commit introduces mandatory validations for the address field when the fulfillment is delivery, including checking internal fields and validating the Brazilian ZIP code format. --- .../OrderCreationSchemeValidator.cs | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Boundaries/Comanda.Orders/Source/Comanda.Orders.Application/Validators/OrderCreationSchemeValidator.cs b/Boundaries/Comanda.Orders/Source/Comanda.Orders.Application/Validators/OrderCreationSchemeValidator.cs index 9c30fcc..51acb31 100644 --- a/Boundaries/Comanda.Orders/Source/Comanda.Orders.Application/Validators/OrderCreationSchemeValidator.cs +++ b/Boundaries/Comanda.Orders/Source/Comanda.Orders.Application/Validators/OrderCreationSchemeValidator.cs @@ -12,6 +12,11 @@ public OrderCreationSchemeValidator() .IsInEnum() .WithMessage("fulfillment must be a valid enum value."); + RuleFor(order => order.Address) + .NotNull() + .WithMessage("address must be provided when fulfillment is delivery.") + .When(order => order.Fulfillment == Fulfillment.Delivery); + RuleFor(order => order.Priority) .IsInEnum() .WithMessage("priority must be a valid enum value."); @@ -20,6 +25,31 @@ public OrderCreationSchemeValidator() .NotNull() .WithMessage("metadata must be provided."); + When(order => order.Fulfillment == Fulfillment.Delivery && order.Address is not null, () => + { + RuleFor(order => order.Address!.Street) + .NotEmpty() + .WithMessage("The street field is required and cannot be empty."); + + RuleFor(order => order.Address!.Number) + .NotEmpty() + .WithMessage("The number field is required and represents the street number of the address."); + + RuleFor(order => order.Address!.City) + .NotEmpty() + .WithMessage("The city field is required and cannot be empty."); + + RuleFor(order => order.Address!.State) + .NotEmpty() + .WithMessage("The state field is required and cannot be empty."); + + RuleFor(order => order.Address!.ZipCode) + .NotEmpty() + .WithMessage("The zip code field is required.") + .Matches(ExpressionPatterns.Cep) + .WithMessage("The zip code is invalid. It must match the Brazilian postal code format."); + }); + When(order => order.Metadata is not null, () => { RuleFor(order => order.Metadata!.MerchantId) From 799918bdfa70ae2be901fbb2b5f645775e6243b4 Mon Sep 17 00:00:00 2001 From: Richard Garcia Date: Sat, 21 Feb 2026 11:25:55 -0300 Subject: [PATCH 07/11] =?UTF-8?q?feature(#2):=20this=20commit=20introduces?= =?UTF-8?q?=20the=20=E2=80=9Caddress=E2=80=9D=20property=20to=20order=20sc?= =?UTF-8?q?hemas,=20updating=20contracts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Source/Transport/Internal/Orders/OrderCreationScheme.cs | 1 + .../Source/Transport/Internal/Orders/OrderScheme.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/Artifacts/Comanda.Internal.Contracts/Source/Transport/Internal/Orders/OrderCreationScheme.cs b/Artifacts/Comanda.Internal.Contracts/Source/Transport/Internal/Orders/OrderCreationScheme.cs index cde8d44..891e025 100644 --- a/Artifacts/Comanda.Internal.Contracts/Source/Transport/Internal/Orders/OrderCreationScheme.cs +++ b/Artifacts/Comanda.Internal.Contracts/Source/Transport/Internal/Orders/OrderCreationScheme.cs @@ -4,6 +4,7 @@ public sealed record OrderCreationScheme : IDispatchable> { public Fulfillment Fulfillment { get; init; } public Priority Priority { get; init; } + public Address? Address { get; init; } = default!; public Metadata Metadata { get; init; } = default!; public IEnumerable Items { get; init; } = []; } diff --git a/Artifacts/Comanda.Internal.Contracts/Source/Transport/Internal/Orders/OrderScheme.cs b/Artifacts/Comanda.Internal.Contracts/Source/Transport/Internal/Orders/OrderScheme.cs index f26592b..a9e62ab 100644 --- a/Artifacts/Comanda.Internal.Contracts/Source/Transport/Internal/Orders/OrderScheme.cs +++ b/Artifacts/Comanda.Internal.Contracts/Source/Transport/Internal/Orders/OrderScheme.cs @@ -5,6 +5,7 @@ public sealed record OrderScheme public string Identifier { get; init; } = default!; public string Code { get; init; } = default!; + public Address? Address { get; init; } = default!; public Status Status { get; init; } public Priority Priority { get; init; } public Fulfillment Fulfillment { get; init; } From 5a34ce7b8f2b8965f9eccb93f2e044971f2b09d3 Mon Sep 17 00:00:00 2001 From: Richard Garcia Date: Sat, 21 Feb 2026 11:29:59 -0300 Subject: [PATCH 08/11] =?UTF-8?q?feature(#2):=20includes=20configuration?= =?UTF-8?q?=20to=20trigger=20publish-package-pipeline.yml=20also=20in=20pu?= =?UTF-8?q?ll=20requests=20in=20the=20master=20and=20development=20branche?= =?UTF-8?q?s,=20in=20addition=20to=20pushes,=20considering=20the=20path=20?= =?UTF-8?q?=E2=80=98Artifacts/Comanda.Internal.Contracts/**=E2=80=99.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/publish-package-pipeline.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/publish-package-pipeline.yml b/.github/workflows/publish-package-pipeline.yml index 1581233..e51f8ca 100644 --- a/.github/workflows/publish-package-pipeline.yml +++ b/.github/workflows/publish-package-pipeline.yml @@ -7,6 +7,12 @@ on: - development paths: - 'Artifacts/Comanda.Internal.Contracts/**' + pull_request: + branches: + - master + - development + paths: + - 'Artifacts/Comanda.Internal.Contracts/**' jobs: publish: From a1641f5608bcd72d135087bae1d6ddde0006e732 Mon Sep 17 00:00:00 2001 From: Richard Garcia Date: Sat, 21 Feb 2026 11:35:17 -0300 Subject: [PATCH 09/11] feature(#2): removed handling of unconfigured branches; now only master and development are considered for defining the package version. Maintained NuGet publishing command without changes. --- .github/workflows/publish-package-pipeline.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish-package-pipeline.yml b/.github/workflows/publish-package-pipeline.yml index e51f8ca..9185b1a 100644 --- a/.github/workflows/publish-package-pipeline.yml +++ b/.github/workflows/publish-package-pipeline.yml @@ -44,11 +44,8 @@ jobs: if [[ "${GITHUB_REF}" == "refs/heads/master" ]]; then VERSION="${BASE_VERSION}.${GITHUB_RUN_NUMBER}" - elif [[ "${GITHUB_REF}" == "refs/heads/development" ]]; then - VERSION="${BASE_VERSION}-beta.${GITHUB_RUN_NUMBER}" else - echo "branch not configured for publication" - exit 1 + VERSION="${BASE_VERSION}-beta.${GITHUB_RUN_NUMBER}" fi echo "use version: $VERSION" @@ -57,4 +54,4 @@ jobs: echo "package_version=$VERSION" >> $GITHUB_OUTPUT - name: push package to nuget - run: dotnet nuget push ./output/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate + run: dotnet nuget push ./output/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate \ No newline at end of file From c742221b8f12601d1db9a7f3d406d4d3b26e5381 Mon Sep 17 00:00:00 2001 From: Richard Garcia Date: Sat, 21 Feb 2026 11:49:07 -0300 Subject: [PATCH 10/11] feature(#2): removed the line break between the method signature and its parameters, making the code more compact and aligned --- .../Comanda.Internal.Contracts/Source/Clients/OrderClient.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Artifacts/Comanda.Internal.Contracts/Source/Clients/OrderClient.cs b/Artifacts/Comanda.Internal.Contracts/Source/Clients/OrderClient.cs index 293d173..a3e233c 100644 --- a/Artifacts/Comanda.Internal.Contracts/Source/Clients/OrderClient.cs +++ b/Artifacts/Comanda.Internal.Contracts/Source/Clients/OrderClient.cs @@ -8,8 +8,7 @@ public sealed class OrderClient(HttpClient httpClient) : IOrderClient PropertyNameCaseInsensitive = true }; - public async Task>> GetOrdersAsync( - OrdersFetchParameters parameters, CancellationToken cancellation = default) + public async Task>> GetOrdersAsync(OrdersFetchParameters parameters, CancellationToken cancellation = default) { var queryString = QueryParametersParser.ToQueryString(parameters); From 29515f8f47dd3d354d2a8e16133ff4eddb977afe Mon Sep 17 00:00:00 2001 From: Richard Garcia Date: Sat, 21 Feb 2026 11:49:33 -0300 Subject: [PATCH 11/11] feature(#2): removed the line break between the method signature and its parameters, making the code more compact and aligned --- .../Comanda.Internal.Contracts/Source/Clients/OrderClient.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Artifacts/Comanda.Internal.Contracts/Source/Clients/OrderClient.cs b/Artifacts/Comanda.Internal.Contracts/Source/Clients/OrderClient.cs index a3e233c..173a11d 100644 --- a/Artifacts/Comanda.Internal.Contracts/Source/Clients/OrderClient.cs +++ b/Artifacts/Comanda.Internal.Contracts/Source/Clients/OrderClient.cs @@ -61,8 +61,7 @@ public async Task>> GetOrdersAsync(OrdersFe return Result>.Success(result); } - public async Task> CreateOrderAsync( - OrderCreationScheme parameters, CancellationToken cancellation = default) + public async Task> CreateOrderAsync(OrderCreationScheme parameters, CancellationToken cancellation = default) { var response = await httpClient.PostAsJsonAsync("orders", parameters, cancellation); var content = await response.Content.ReadAsStringAsync(cancellation);