Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ Tools/NuGet/mxtires.microdata.1.0.3.4.nupkg1/lib/net45/MXTires.Microdata.XML
Tools/NuGet/mxtires.microdata.1.0.3.4.nupkg1/lib/net461/MXTires.Microdata.XML
Tools/NuGet/mxtires.microdata.1.0.3.4.nupkg1/lib/net48/MXTires.Microdata.XML
Tools/NuGet/mxtires.microdata.1.0.3.4.nupkg1/package/services/metadata/core-properties/a5ad0c42a2cb49b9b6ac94c92fc9d3d1.psmdcp
.vs/
43 changes: 43 additions & 0 deletions Intangible/MemberProgramTier.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#region License
// Copyright (c) 2026 1010Tires.com
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
#endregion

using Newtonsoft.Json;

namespace MXTires.Microdata.Intangible
{
/// <summary>
/// A membership program tier, for example a club card tier, frequent flyer tier, etc.
/// </summary>
public class MemberProgramTier : Thing
{
/// <summary>
/// Text - A requirement for a user to join a membership tier, for example: a CreditCard if the tier requires sign up for a credit card,
/// A textual summary of the required threshold or expectations to meet the tier.
/// </summary>
/// <value>The tier requirement.</value>
[JsonProperty("tierRequirement")]
public string TierRequirement { get; set; }
}
}
5 changes: 4 additions & 1 deletion Intangible/Offer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ public object PriceSpecification
get { return priceSpecification; }
set
{
var validator = new TypeValidator(typeof(PriceSpecification), typeof(IList<PriceSpecification>));
var validator = new TypeValidator(
"MXTires.Microdata.Intangible.StructuredValues.PriceSpecifications",
null,
new List<Type>() { typeof(PriceSpecification), typeof(IList<PriceSpecification>) });
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TypeValidator checks exact runtime types; allowing typeof(IList<PriceSpecification>) does not allow a List<PriceSpecification> instance. As written, assigning a List<PriceSpecification> to Offer.PriceSpecification will fail validation. Add typeof(List<PriceSpecification>) (and/or update the validator strategy to use assignability) so common list implementations are accepted.

Suggested change
new List<Type>() { typeof(PriceSpecification), typeof(IList<PriceSpecification>) });
new List<Type>() { typeof(PriceSpecification), typeof(IList<PriceSpecification>), typeof(List<PriceSpecification>) });

Copilot uses AI. Check for mistakes.
validator.Validate(value);
priceSpecification = value;
}
Expand Down
10 changes: 5 additions & 5 deletions MXTires.Microdata.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net461;net472;net48;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<Version>1.0.4.5</Version>
<TargetFrameworks>net461;net472;net48;net6.0;net8.0</TargetFrameworks>
<Version>1.0.4.6</Version>
Comment on lines +3 to +4
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TargetFrameworks no longer includes netcoreapp3.1, but the project file still contains an ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'" later in the file. This condition is now dead code and can be removed to avoid confusion and accidental maintenance drift.

Copilot uses AI. Check for mistakes.
<Authors>1010Tires.com Inc.</Authors>
<Company>1010Tires.com Inc.</Company>
<Copyright>Copyright© 1010Tires.com Inc. 2023. All rights reserved.</Copyright>
Expand All @@ -13,8 +13,8 @@
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>MXTires.MicroData.snk</AssemblyOriginatorKeyFile>
<RepositoryUrl>https://github.com/idenys/MXTires.Microdata</RepositoryUrl>
<AssemblyVersion>1.0.4.5</AssemblyVersion>
<FileVersion>1.0.4.5</FileVersion>
<AssemblyVersion>1.0.4.6</AssemblyVersion>
<FileVersion>1.0.4.6</FileVersion>
<Title>MXTires.Microdata</Title>
<PackageReadmeFile>README.md</PackageReadmeFile>
<LangVersion>latest</LangVersion>
Expand All @@ -38,7 +38,7 @@
<Compile Remove="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
Expand Down
36 changes: 34 additions & 2 deletions PriceSpecification.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
#endregion

using MXTires.Microdata.Intangible;
using Newtonsoft.Json;
using System;

Expand All @@ -36,8 +37,22 @@ public class PriceSpecification : Thing

#region Properties

//eligibleQuantity QuantitativeValue The interval and unit of measurement of ordering quantities for which the offer or price specification is valid. This allows e.g. specifying that a certain freight charge is valid only for a certain quantity.
//eligibleTransactionVolume PriceSpecification The transaction volume, in a monetary unit, for which the offer or price specification is valid, e.g. for indicating a minimal purchasing volume, to express free shipping above a certain order volume, or to limit the acceptance of credit cards to purchases to a certain minimal amount.
/// <summary>
/// QuantitativeValue - The interval and unit of measurement of ordering quantities for which the offer or price specification is valid.
/// This allows e.g. specifying that a certain freight charge is valid only for a certain quantity.
/// </summary>
/// <value>The eligible quantity.</value>
[JsonProperty("eligibleQuantity")]
public QuantitativeValue EligibleQuantity { get; set; }

/// <summary>
/// PriceSpecification - The transaction volume, in a monetary unit, for which the offer or price specification is valid,
/// e.g. for indicating a minimal purchasing volume, to express free shipping above a certain order volume,
/// or to limit the acceptance of credit cards to purchases to a certain minimal amount.
/// </summary>
/// <value>The eligible transaction volume.</value>
[JsonProperty("eligibleTransactionVolume")]
public PriceSpecification EligibleTransactionVolume { get; set; }
/// <summary>
/// Number The highest price if the price is a range.
/// </summary>
Expand All @@ -62,7 +77,24 @@ public class PriceSpecification : Thing
/// Text. The currency (in 3-letter ISO 4217 format) of the price or a price component, when attached to PriceSpecification and its subtypes.
/// </summary>
/// <value>The price currency.</value>
[JsonProperty("priceCurrency")]
public string PriceCurrency { get; set; }

/// <summary>
/// Number or QuantitativeValue - The number of membership points earned by the member.
/// If necessary, the unitText can be used to express the units the points are issued in. (E.g. stars, miles, etc.)
/// </summary>
/// <value>The membership points earned.</value>
[JsonProperty("membershipPointsEarned")]
public QuantitativeValue MembershipPointsEarned { get; set; }

Comment on lines +83 to +90
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

membershipPointsEarned is documented as Number or QuantitativeValue, but the property type is QuantitativeValue only. Elsewhere in the codebase, similar unions are modeled as object (e.g., FinancialProduct.AnnualPercentageRate). Consider changing this to object with type validation (number types + QuantitativeValue) so numeric values are supported.

Copilot uses AI. Check for mistakes.
/// <summary>
/// MemberProgramTier - The membership program tier an Offer (or a PriceSpecification, OfferShippingDetails,
/// or MerchantReturnPolicy under an Offer) is valid for.
/// </summary>
/// <value>The eligible member tier.</value>
[JsonProperty("eligibleMemberTier")]
public MemberProgramTier EligibleMemberTier { get; set; }

/// <summary>
/// The date when the item becomes valid.
Expand Down
2 changes: 0 additions & 2 deletions Products/Product.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MXTires.Microdata.Intangible;
using MXTires.Microdata.Intangible.Enumeration;
using Newtonsoft.Json.Converters;
Expand Down
96 changes: 14 additions & 82 deletions Tests/MXTires.Microdata.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,90 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E0A5D9F0-0521-4646-A2B7-C4A34B414F71}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MXTires.Microdata.Tests</RootNamespace>
<AssemblyName>MXTires.Microdata.Tests</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
<TargetFrameworkProfile />
<TargetFramework>net48</TargetFramework>
<IsPackable>false</IsPackable>

<!-- MSTest project behavior -->
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<Choose>
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
</ItemGroup>
</Otherwise>
</Choose>

<ItemGroup>
<Compile Include="DemoTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<PackageReference Include="MSTest.TestAdapter" Version="4.0.2" />
<PackageReference Include="MSTest.TestFramework" Version="4.0.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\MXTires.Microdata.csproj">
<Project>{f2a9b387-b954-4895-8ed7-ae95850b1bc1}</Project>
<Name>MXTires.Microdata</Name>
</ProjectReference>
<ProjectReference Include="..\MXTires.Microdata.csproj" />
</ItemGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
</ItemGroup>
</When>
</Choose>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->

</Project>
36 changes: 0 additions & 36 deletions Tests/Properties/AssemblyInfo.cs

This file was deleted.

Loading