Skip to content

Commit

Permalink
Merge branch 'release/3.803.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
vc-ci committed Feb 1, 2024
2 parents 4ad8938 + 3d787e6 commit 2b70fdd
Show file tree
Hide file tree
Showing 22 changed files with 539 additions and 58 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/module-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# v3.200.36
# v3.800.0
name: Module CI

on:
Expand Down Expand Up @@ -240,7 +240,7 @@ jobs:
if: ${{ ((github.ref == 'refs/heads/dev') && (github.event_name == 'push') && (needs.ci.outputs.run-e2e == 'true')) ||
(github.event_name == 'workflow_dispatch')}}
needs: 'ci'
uses: VirtoCommerce/.github/.github/workflows/e2e.yml@v3.200.36
uses: VirtoCommerce/.github/.github/workflows/e2e.yml@v3.800.0
with:
katalonRepo: 'VirtoCommerce/vc-quality-gate-katalon'
katalonRepoBranch: 'dev'
Expand All @@ -260,7 +260,7 @@ jobs:
(github.ref == 'refs/heads/dev')) &&
github.event_name == 'push' }}
needs: ci
uses: VirtoCommerce/.github/.github/workflows/deploy-cloud.yml@v3.200.36
uses: VirtoCommerce/.github/.github/workflows/deploy-cloud.yml@v3.800.0
with:
releaseSource: module
moduleId: ${{ needs.ci.outputs.moduleId }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/module-release-hotfix.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# v3.200.36
# v3.800.0
name: Release hotfix

on:
Expand All @@ -12,12 +12,12 @@ on:

jobs:
test:
uses: VirtoCommerce/.github/.github/workflows/test-and-sonar.yml@v3.200.36
uses: VirtoCommerce/.github/.github/workflows/test-and-sonar.yml@v3.800.0
secrets:
sonarToken: ${{ secrets.SONAR_TOKEN }}

build:
uses: VirtoCommerce/.github/.github/workflows/build.yml@v3.200.36
uses: VirtoCommerce/.github/.github/workflows/build.yml@v3.800.0
with:
uploadPackage: 'true'
uploadDocker: 'false'
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:
publish-github-release:
needs:
[build, test, get-metadata]
uses: VirtoCommerce/.github/.github/workflows/publish-github.yml@v3.200.36
uses: VirtoCommerce/.github/.github/workflows/publish-github.yml@v3.800.0
with:
fullKey: ${{ needs.build.outputs.packageFullKey }}
changeLog: '${{ needs.get-metadata.outputs.changeLog }}'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-nugets.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# v3.200.36
# v3.800.0
name: Publish nuget

on:
Expand All @@ -12,12 +12,12 @@ on:

jobs:
test:
uses: VirtoCommerce/.github/.github/workflows/test-and-sonar.yml@v3.200.36
uses: VirtoCommerce/.github/.github/workflows/test-and-sonar.yml@v3.800.0
secrets:
sonarToken: ${{ secrets.SONAR_TOKEN }}

build:
uses: VirtoCommerce/.github/.github/workflows/build.yml@v3.200.36
uses: VirtoCommerce/.github/.github/workflows/build.yml@v3.800.0
with:
uploadPackage: 'true'
uploadDocker: 'false'
Expand All @@ -28,7 +28,7 @@ jobs:
publish-nuget:
needs:
[build, test]
uses: VirtoCommerce/.github/.github/workflows/publish-github.yml@v3.200.36
uses: VirtoCommerce/.github/.github/workflows/publish-github.yml@v3.800.0
with:
fullKey: ${{ needs.build.outputs.packageFullKey }}
forceGithub: false
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# v3.200.36
# v3.800.0
name: Release

on:
workflow_dispatch:

jobs:
release:
uses: VirtoCommerce/.github/.github/workflows/release.yml@v3.200.36
uses: VirtoCommerce/.github/.github/workflows/release.yml@v3.800.0
secrets:
envPAT: ${{ secrets.REPO_TOKEN }}
1 change: 0 additions & 1 deletion .nuke

This file was deleted.

4 changes: 4 additions & 0 deletions .nuke/parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "./build.schema.json",
"Solution": "VirtoCommerce.OrdersModule.sln"
}
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project>
<!-- These properties will be shared for all projects -->
<PropertyGroup>
<VersionPrefix>3.802.0</VersionPrefix>
<VersionPrefix>3.803.0</VersionPrefix>
<VersionSuffix>
</VersionSuffix>
<VersionSuffix Condition=" '$(VersionSuffix)' != '' AND '$(BuildNumber)' != '' ">$(VersionSuffix)-$(BuildNumber)</VersionSuffix>
Expand Down
61 changes: 61 additions & 0 deletions samples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Order Extension Sample Module

This sample demonstrates the Virto Commerce Extensibility Framework in action by extending the native Order Module. It includes various scenarios to showcase extensibility features for REST API contracts, database contracts, and Admin Back Office extension points.

**Note:** This sample is intended for demo purposes, training sessions, etc. We recommend following a 3-tier architecture (Core, Data, Web, or XApi) for custom modules, as well as for Virto Commerce.

**Note:** The sample doesn't support the `vc-build` command.

## Extension Scenarios

1. **Extend CustomerOrder with Invoices and NewField:** Demonstrates how to extend REST API contracts.
2. **Extend CustomerOrder2Entity and Order2DbContext:** Demonstrates how to extend database contracts.
3. **Extend LineItem2Entity with OuterId custom property.**
4. **Override implementation with AbstractTypeFactory and DI:** Demonstrates initialization with dependency injection.
5. **Line Item Validator:** Demonstrates how to create a custom line item validator.
6. **Create CustomOrderAuthorizationHandler.**
7. **Admin Back Office Extension Points:**
* Register Invoice Order Document with the ability to create, view, edit, and delete.
* Extend CustomerOrder blade with NewField via Virto Commerce MetaFields.
* Extend Custom Order Grid View with NewField column.

## Getting Started

### Prerequisites

1. Download and run the latest Virto Commerce Edge Release with ECommerce Bundle.

### Installation

1. Download and open the `VirtoCommerce.OrdersModule` solution in Visual Studio 2022.
2. Compile `VirtoCommerce.OrdersModule2.Web`.
3. Build Admin UI code by running the following commands in the `VirtoCommerce.OrdersModule2.Web` folder:

```cmd
npm ci
```

```cmd
npm run webpack:dev
```

4. Rename `_module.manifest` to `module.manifest`.
5. Install the module by creating a symbolic link in the Virto Commerce Modules folder using the following command (change the path):

```cmd
mklink /D "c:\vc-platform-3-demo\platform\modules\Order.Ext" "c:\Projects\git\VirtoCommerce\vc-module-order\samples\VirtoCommerce.OrdersModule2.Web"
```

6. Run Virto Commerce Platform and enjoy the Virto Commerce Extensibility Framework.

## Screenshots

![image](https://github.com/VirtoCommerce/vc-module-order/assets/7639413/e9c320e7-611b-47ad-9df5-e08e4862c7e1)
![image](https://github.com/VirtoCommerce/vc-module-order/assets/7639413/ec24497d-62e4-4622-ace3-60f0e220a0d2)
![image](https://github.com/VirtoCommerce/vc-module-order/assets/7639413/03338cd7-02ab-4473-bde2-5712a09c4b16)
![image](https://github.com/VirtoCommerce/vc-module-order/assets/7639413/70dbd44c-19d1-4db2-9842-802a0b4471a7)
![image](https://github.com/VirtoCommerce/vc-module-order/assets/7639413/fe10182c-b304-4dac-a492-57fa44ba3167)




7 changes: 4 additions & 3 deletions samples/VirtoCommerce.OrdersModule2.Web/Module.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ public void PostInitialize(IApplicationBuilder appBuilder)
AbstractTypeFactory<PermissionScope>.RegisterType<OrderSelectedStatusScope>();

var permissionsProvider = appBuilder.ApplicationServices.GetRequiredService<IPermissionsRegistrar>();
permissionsProvider.WithAvailabeScopesForPermissions(new[]
{
permissionsProvider.WithAvailabeScopesForPermissions(
[
// Permission list
OrdersModule.Core.ModuleConstants.Security.Permissions.Read
}, new OrderSelectedStatusScope());
],
new OrderSelectedStatusScope());

AbstractTypeFactory<IOperation>.OverrideType<CustomerOrder, CustomerOrder2>();
AbstractTypeFactory<CustomerOrderEntity>.OverrideType<CustomerOrderEntity, CustomerOrder2Entity>();
Expand Down
8 changes: 4 additions & 4 deletions samples/VirtoCommerce.OrdersModule2.Web/_module.manifest
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<module>
<id>VirtoCommerce.Orders2</id>
<version>3.400.0</version>
<version>3.800.0</version>
<version-tag>demo</version-tag>
<platformVersion>3.413.0</platformVersion>
<platformVersion>3.800.0</platformVersion>
<dependencies>
<dependency id="VirtoCommerce.Orders" version="3.414.0" />
<dependency id="VirtoCommerce.Orders" version="3.800.0" />
</dependencies>

<title>Order extension sample module</title>
Expand All @@ -19,7 +19,7 @@
<projectUrl>http://virtocommerce.com/</projectUrl>
<iconUrl>Modules/$(VirtoCommerce.Orders)/Content/logo.png</iconUrl>
<releaseNotes>First version.</releaseNotes>
<copyright>Copyright © 2011-2023 Virto Commerce. All rights reserved</copyright>
<copyright>Copyright © 2011-2024 Virto Commerce. All rights reserved</copyright>
<tags>orders</tags>

<assemblyFile>VirtoCommerce.OrdersModule2.Web.dll</assemblyFile>
Expand Down
14 changes: 7 additions & 7 deletions samples/VirtoCommerce.OrdersModule2.Web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using System;
using VirtoCommerce.Platform.Core.Common;

namespace VirtoCommerce.OrdersModule.Core.Model.Search
{
[Obsolete("Use CustomerOrderSearchCriteria", DiagnosticId = "VC0008", UrlFormat = "https://docs.virtocommerce.org/products/products-virto3-versions/")]
public class CustomerOrderIndexedSearchCriteria : SearchCriteriaBase
public class CustomerOrderIndexedSearchCriteria : CustomerOrderSearchCriteria
{
public string Facet { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using System.Collections.Generic;

namespace VirtoCommerce.OrdersModule.Core.Model.Search
{
public class CustomerOrderIndexedSearchResult : CustomerOrderSearchResult
{
public virtual IList<OrderAggregation> Aggregations { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System.Collections.Generic;

namespace VirtoCommerce.OrdersModule.Core.Model.Search
{
public class OrderAggregation
{
/// <summary>
/// Gets or sets the value of the aggregation type
/// </summary>
/// <value>
/// "Attribute", "Range"
/// </value>
public string AggregationType { get; set; }

/// <summary>
/// Gets or sets the value of the aggregation field
/// </summary>
public string Field { get; set; }

/// <summary>
/// Gets or sets the collection of the aggregation labels
/// </summary>
public IList<OrderAggregationLabel> Labels { get; set; }

/// <summary>
/// Gets or sets the collection of the aggregation items
/// </summary>
public IList<OrderAggregationItem> Items { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using System.Collections.Generic;

namespace VirtoCommerce.OrdersModule.Core.Model.Search
{
public class OrderAggregationItem
{
/// <summary>
/// Gets or sets the aggregation item value
/// </summary>
public object Value { get; set; }

/// <summary>
/// Gets or sets the aggregation item count
/// </summary>
public int Count { get; set; }

/// <summary>
/// Gets or sets the flag for aggregation item is applied
/// </summary>
public bool IsApplied { get; set; }

/// <summary>
/// Gets or sets the collection of the aggregation item labels
/// </summary>
public IList<OrderAggregationLabel> Labels { get; set; }

/// <summary>
/// Gets or sets the request lower bound for range aggregation value
/// </summary>
public string RequestedLowerBound { get; set; }

/// <summary>
/// Gets or sets the request lower bound for range aggregation value
/// </summary>
public string RequestedUpperBound { get; set; }

/// <summary>
/// Is lower bound for range included
/// </summary>
public bool IncludeLower { get; set; }

/// <summary>
/// Is upper bound for range included
/// </summary>
public bool IncludeUpper { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace VirtoCommerce.OrdersModule.Core.Model.Search
{
public class OrderAggregationLabel
{
public string Language { get; set; }
public string Label { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ namespace VirtoCommerce.OrdersModule.Core.Search.Indexed
{
public interface IIndexedCustomerOrderSearchService
{
Task<CustomerOrderSearchResult> SearchCustomerOrdersAsync(CustomerOrderSearchCriteria criteria);
Task<CustomerOrderIndexedSearchResult> SearchCustomerOrdersAsync(CustomerOrderIndexedSearchCriteria criteria);
}
}
Loading

0 comments on commit 2b70fdd

Please sign in to comment.