Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce namespace-based Versioning #20

Merged
merged 4 commits into from
Nov 11, 2024
Merged
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
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace MaLoIdentModels;

using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;

namespace MaLoIdentModels.v1;

public class Address
{
[JsonIgnore]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;

namespace MaLoIdentModels;
namespace MaLoIdentModels.v1;

public class DataControllableResource
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace MaLoIdentModels;
namespace MaLoIdentModels.v1;

public class DataMarketLocation
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Text.Json.Serialization;
using MaLoIdentModels.JsonSettings;

namespace MaLoIdentModels;
namespace MaLoIdentModels.v1;

public class DataMarketLocationProperties
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace MaLoIdentModels;
namespace MaLoIdentModels.v1;

public class DataMeterLocation
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace MaLoIdentModels;
namespace MaLoIdentModels.v1;

public class DataNetworkLocation
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Text.Json.Serialization;

namespace MaLoIdentModels;
namespace MaLoIdentModels.v1;

public class DataTechnicalResource
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace MaLoIdentModels;
namespace MaLoIdentModels.v1;

public class DataTranche
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Runtime.Serialization;
using System.Text.Json.Serialization;

namespace MaLoIdentModels;
namespace MaLoIdentModels.v1;

public enum EnergyDirection
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Text.Json.Serialization;

namespace MaLoIdentModels;
namespace MaLoIdentModels.v1;

public class GeographicCoordinates
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Text.Json.Serialization;
using MaLoIdentModels.JsonSettings;

namespace MaLoIdentModels;
namespace MaLoIdentModels.v1;

public class IdentificationParameter
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace MaLoIdentModels;
namespace MaLoIdentModels.v1;

public class IdentificationParameterIdentificationParameterAddress
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;

namespace MaLoIdentModels;
namespace MaLoIdentModels.v1;

public class IdentificationParameterIdentificationParameterId
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Text.Json.Serialization;

namespace MaLoIdentModels;
namespace MaLoIdentModels.v1;

public class LandParcel
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Text.Json.Serialization;
using MaLoIdentModels.JsonSettings;

namespace MaLoIdentModels;
namespace MaLoIdentModels.v1;

public class MarketLocationDateTime
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System;
using System.Text.Json.Serialization;
using MaLoIdentModels.JsonSettings;

namespace MaLoIdentModels;

using JsonSettings;
namespace MaLoIdentModels.v1;

public class MarketLocationMeasuringPointOperator
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System;
using System.Text.Json.Serialization;
using MaLoIdentModels.JsonSettings;

namespace MaLoIdentModels;

using JsonSettings;
namespace MaLoIdentModels.v1;

public class MarketLocationNetworkOperator
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System;
using System.Text.Json.Serialization;
using MaLoIdentModels.JsonSettings;

namespace MaLoIdentModels;

using JsonSettings;
namespace MaLoIdentModels.v1;

public class MarketLocationProperties
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Runtime.Serialization;
using System.Text.Json.Serialization;

namespace MaLoIdentModels;
namespace MaLoIdentModels.v1;

public enum MarketLocationProperty
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System;
using System.Text.Json.Serialization;
using MaLoIdentModels.JsonSettings;

namespace MaLoIdentModels;

using JsonSettings;
namespace MaLoIdentModels.v1;

public class MarketLocationSupplier
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System;
using System.Text.Json.Serialization;
using MaLoIdentModels.JsonSettings;

namespace MaLoIdentModels;

using JsonSettings;
namespace MaLoIdentModels.v1;

public class MarketLocationTransmissionSystemOperator
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Runtime.Serialization;
using System.Text.Json.Serialization;

namespace MaLoIdentModels;
namespace MaLoIdentModels.v1;

public enum MeasurementTechnologyClassification
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System;
using System.Text.Json.Serialization;
using MaLoIdentModels.JsonSettings;

namespace MaLoIdentModels;

using JsonSettings;
namespace MaLoIdentModels.v1;

public class MeterLocationMeasuringPointOperator
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Text.Json.Serialization;

namespace MaLoIdentModels;
namespace MaLoIdentModels.v1;

public class Name
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System;
using System.Text.Json.Serialization;
using MaLoIdentModels.JsonSettings;

namespace MaLoIdentModels;

using JsonSettings;
namespace MaLoIdentModels.v1;

public class NetworkLocationMeasuringPointOperator
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Runtime.Serialization;
using System.Text.Json.Serialization;

namespace MaLoIdentModels;
namespace MaLoIdentModels.v1;

public enum OptionalChangeForecastBasis
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Runtime.Serialization;
using System.Text.Json.Serialization;

namespace MaLoIdentModels;
namespace MaLoIdentModels.v1;

public enum Proportion
{
Expand Down
4 changes: 4 additions & 0 deletions MaLoIdentModels/MaLoIdentModels/v1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# FV2504

Contains the data model as of April 2025.
EDI@Energy names this "v1.0.0".
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;

namespace MaLoIdentModels;
namespace MaLoIdentModels.v1;

public class ResultNegative
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;

namespace MaLoIdentModels;
namespace MaLoIdentModels.v1;

public class ResultPositive
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System;
using System.Text.Json.Serialization;
using MaLoIdentModels.JsonSettings;

namespace MaLoIdentModels;

using JsonSettings;
namespace MaLoIdentModels.v1;

public class SrMarketPartner
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Text.Json.Serialization;

namespace MaLoIdentModels;
namespace MaLoIdentModels.v1;

public class TrancheSupplier
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Runtime.Serialization;
using System.Text.Json.Serialization;

namespace MaLoIdentModels;
namespace MaLoIdentModels.v1;

public enum Zone
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
</ItemGroup>

<ItemGroup>
<None Update="examples\request.json">
<None Update="v1Tests\examples\request.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="examples\result_negative.json">
<None Update="v1Tests\examples\result_negative.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="examples\result_positive.json">
<None Update="v1Tests\examples\result_positive.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Text.Json;
using FluentAssertions;
using MaLoIdentModels;
using MaLoIdentModels.v1;

namespace MaLoIdentModelsTests;
namespace MaLoIdentModelsTests.v1Tests;

public class DateTimeOffsetDeserializationTests
{
Expand All @@ -21,7 +21,7 @@ public void Deserializing_An_DatetimeOffset_Without_Explicit_Offset_Throws_JsonE
string invalidDateTimeOffsetString
)
{
var fileBody = File.ReadAllText("examples/request.json");
var fileBody = File.ReadAllText("v1Tests/examples/request.json");
fileBody
.Should()
.Contain(
Expand Down Expand Up @@ -58,7 +58,7 @@ public void Deserializing_An_DatetimeOffset_With_Explicit_Offset_Works(
string dateTimeOffsetString
)
{
var fileBody = File.ReadAllText("examples/request.json");
var fileBody = File.ReadAllText("v1Tests/examples/request.json");
fileBody
.Should()
.Contain(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using FluentAssertions;
using MaLoIdentModels;
using MaLoIdentModels.v1;

namespace MaLoIdentModelsTests;
namespace MaLoIdentModelsTests.v1Tests;

/// <summary>
/// test serialization and deserialization roundtrips
Expand All @@ -11,7 +11,7 @@ public class RoundTripTests
[Fact]
public void Test_Request()
{
var fileBody = File.ReadAllText("examples/request.json");
var fileBody = File.ReadAllText("v1Tests/examples/request.json");
var model = System.Text.Json.JsonSerializer.Deserialize<IdentificationParameter>(fileBody);
model.Should().NotBeNull();
{
Expand All @@ -28,7 +28,7 @@ public void Test_Request()
[Fact]
public void Test_Positive_Result()
{
var fileBody = File.ReadAllText("examples/result_positive.json");
var fileBody = File.ReadAllText("v1Tests/examples/result_positive.json");
var model = System.Text.Json.JsonSerializer.Deserialize<ResultPositive>(fileBody);
model.Should().NotBeNull();
var reSererialized = System.Text.Json.JsonSerializer.Serialize(model);
Expand All @@ -42,7 +42,7 @@ public void Test_Positive_Result()
[Fact]
public void Test_Positive_Negative()
{
var fileBody = File.ReadAllText("examples/result_negative.json");
var fileBody = File.ReadAllText("v1Tests/examples/result_negative.json");
var model = System.Text.Json.JsonSerializer.Deserialize<ResultNegative>(fileBody);
model.Should().NotBeNull();
var reSererialized = System.Text.Json.JsonSerializer.Serialize(model);
Expand Down
Loading
Loading