Skip to content

Commit

Permalink
[WIP] Constraint refactoring DO NOT MERGE!!!
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander van Delft committed Nov 17, 2023
1 parent 246a608 commit b5495ef
Show file tree
Hide file tree
Showing 34 changed files with 1,535 additions and 455 deletions.
86 changes: 86 additions & 0 deletions Kalliope.DTO/AutoGenDto/Constraint.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
// -------------------------------------------------------------------------------------------------
// <copyright file="Constraint.cs" company="RHEA System S.A.">
//
// Copyright 2022-2023 RHEA System S.A.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
// ------------------------------------------------------------------------------------------------

// ------------------------------------------------------------------------------------------------
// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
// ------------------------------------------------------------------------------------------------

namespace Kalliope.DTO
{
using System;
using System.Collections.Generic;

using Kalliope.Common;

/// <summary>
/// A Data Transfer Object that represents a Constraint
/// </summary>
public abstract partial class Constraint : OrmNamedElement
{
/// <summary>
/// Initializes a new instance of the <see cref="Constraint"/> class.
/// </summary>
protected Constraint()
{
this.Modality = ConstraintModality.Alethic;
}


/// <summary>
/// Gets or sets the unique identifier of the contained <see cref="Definition"/>
/// </summary>
[Description("")]
[Property(name: "Definition", aggregation: AggregationKind.Composite, multiplicity: "0..1", typeKind: TypeKind.Object, defaultValue: "", typeName: "Definition", allowOverride: false, isOverride: false, isDerived: false)]
public string Definition { get; set; }

/// <summary>
/// Gets or sets the unique identifier of the referenced <see cref="ConstraintDuplicateNameError"/>
/// </summary>
[Description("")]
[Property(name: "DuplicateNameError", aggregation: AggregationKind.None, multiplicity: "0..1", typeKind: TypeKind.Object, defaultValue: "", typeName: "ConstraintDuplicateNameError", allowOverride: false, isOverride: false, isDerived: false)]
public string DuplicateNameError { get; set; }

/// <summary>
/// Gets or sets the unique identifier of the contained <see cref="ImplicationError"/>
/// </summary>
[Description("")]
[Property(name: "ImplicationError", aggregation: AggregationKind.Composite, multiplicity: "0..1", typeKind: TypeKind.Object, defaultValue: "", typeName: "ImplicationError", allowOverride: false, isOverride: false, isDerived: false)]
public string ImplicationError { get; set; }

/// <summary>
/// Gets or sets a Modality
/// </summary>
[Description("The constraint Modality. Alethic modality means the constraint is structurally enforced and data violating the constraint cannot be entered in the system. Deontic modality means that data violating the constraint can be recorded.")]
[Property(name: "Modality", aggregation: AggregationKind.None, multiplicity: "1..1", typeKind: TypeKind.Enumeration, defaultValue: "Alethic", typeName: "ConstraintModality", allowOverride: false, isOverride: false, isDerived: false)]
public ConstraintModality Modality { get; set; }

/// <summary>
/// Gets or sets the unique identifier of the contained <see cref="Note"/>
/// </summary>
[Description("")]
[Property(name: "Note", aggregation: AggregationKind.Composite, multiplicity: "0..1", typeKind: TypeKind.Object, defaultValue: "", typeName: "Note", allowOverride: false, isOverride: false, isDerived: false)]
public string Note { get; set; }

}
}

// ------------------------------------------------------------------------------------------------
// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
// ------------------------------------------------------------------------------------------------
20 changes: 6 additions & 14 deletions Kalliope.DTO/AutoGenDto/ConstraintRoleSequence.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,31 +32,23 @@ namespace Kalliope.DTO
/// <summary>
/// A Data Transfer Object that represents a ConstraintRoleSequence
/// </summary>
public abstract partial class ConstraintRoleSequence : OrmNamedElement
[Container(typeName: "SetConstraint", propertyName: "RoleSequence")]
public partial class ConstraintRoleSequence : OrmNamedElement
{
/// <summary>
/// Initializes a new instance of the <see cref="ConstraintRoleSequence"/> class.
/// </summary>
protected ConstraintRoleSequence()
public ConstraintRoleSequence()
{
this.Roles = new List<string>();
}


/// <summary>
/// Gets or sets the unique identifier of the contained <see cref="ConstraintRoleSequenceJoinPath"/>
/// Gets or sets the unique identifier of the container
/// </summary>
[Description("")]
[Property(name: "JoinPath", aggregation: AggregationKind.Composite, multiplicity: "0..1", typeKind: TypeKind.Object, defaultValue: "", typeName: "ConstraintRoleSequenceJoinPath", allowOverride: false, isOverride: false, isDerived: false)]
public string JoinPath { get; set; }

/// <summary>
/// Gets or sets the unique identifier of the contained <see cref="JoinPathRequiredError"/>
/// </summary>
[Description("")]
[Property(name: "JoinPathRequiredError", aggregation: AggregationKind.Composite, multiplicity: "0..1", typeKind: TypeKind.Object, defaultValue: "", typeName: "JoinPathRequiredError", allowOverride: false, isOverride: false, isDerived: false)]
public string JoinPathRequiredError { get; set; }
public string Container {get; set;}


/// <summary>
/// Gets or sets a list unique identifiers of the contained <see cref="RoleBase"/> instances
/// </summary>
Expand Down
78 changes: 78 additions & 0 deletions Kalliope.DTO/AutoGenDto/ConstraintRoleSequenceWithJoin.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// -------------------------------------------------------------------------------------------------
// <copyright file="ConstraintRoleSequenceWithJoin.cs" company="RHEA System S.A.">
//
// Copyright 2022-2023 RHEA System S.A.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
// ------------------------------------------------------------------------------------------------

// ------------------------------------------------------------------------------------------------
// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
// ------------------------------------------------------------------------------------------------

namespace Kalliope.DTO
{
using System;
using System.Collections.Generic;

using Kalliope.Common;

/// <summary>
/// A Data Transfer Object that represents a ConstraintRoleSequenceWithJoin
/// </summary>
[Container(typeName: "SetConstraintWithJoin", propertyName: "RoleSequence")]
public partial class ConstraintRoleSequenceWithJoin : OrmNamedElement
{
/// <summary>
/// Initializes a new instance of the <see cref="ConstraintRoleSequenceWithJoin"/> class.
/// </summary>
public ConstraintRoleSequenceWithJoin()
{
this.Roles = new List<string>();
}

/// <summary>
/// Gets or sets the unique identifier of the container
/// </summary>
public string Container {get; set;}


/// <summary>
/// Gets or sets the unique identifier of the contained <see cref="ConstraintRoleSequenceJoinPath"/>
/// </summary>
[Description("")]
[Property(name: "JoinPath", aggregation: AggregationKind.Composite, multiplicity: "0..1", typeKind: TypeKind.Object, defaultValue: "", typeName: "ConstraintRoleSequenceJoinPath", allowOverride: false, isOverride: false, isDerived: false)]
public string JoinPath { get; set; }

/// <summary>
/// Gets or sets the unique identifier of the contained <see cref="JoinPathRequiredError"/>
/// </summary>
[Description("")]
[Property(name: "JoinPathRequiredError", aggregation: AggregationKind.Composite, multiplicity: "0..1", typeKind: TypeKind.Object, defaultValue: "", typeName: "JoinPathRequiredError", allowOverride: false, isOverride: false, isDerived: false)]
public string JoinPathRequiredError { get; set; }

/// <summary>
/// Gets or sets a list unique identifiers of the contained <see cref="RoleBase"/> instances
/// </summary>
[Description("")]
[Property(name: "Roles", aggregation: AggregationKind.Composite, multiplicity: "0..*", typeKind: TypeKind.Object, defaultValue: "", typeName: "RoleBase", allowOverride: false, isOverride: false, isDerived: false)]
public List<string> Roles { get; set; }

}
}

// ------------------------------------------------------------------------------------------------
// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
// ------------------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ public SetComparisonConstraintRoleSequence()
{
}

/// <summary>
/// Gets or sets the unique identifier of the container
/// </summary>
public string Container {get; set;}

}
}

Expand Down
46 changes: 5 additions & 41 deletions Kalliope.DTO/AutoGenDto/SetConstraint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,14 @@ namespace Kalliope.DTO
/// A Data Transfer Object that represents a SetConstraint
/// </summary>
[Container(typeName: "OrmModel", propertyName: "SetConstraints")]
public abstract partial class SetConstraint : ConstraintRoleSequence
public abstract partial class SetConstraint : Constraint
{
/// <summary>
/// Initializes a new instance of the <see cref="SetConstraint"/> class.
/// </summary>
protected SetConstraint()
{
this.FactTypes = new List<string>();
this.Modality = ConstraintModality.Alethic;
this.RoleSequences = new List<string>();
}

/// <summary>
Expand All @@ -58,46 +57,11 @@ protected SetConstraint()
public string CompatibleRolePlayerTypeError { get; set; }

/// <summary>
/// Gets or sets the unique identifier of the contained <see cref="Definition"/>
/// Gets or sets a list unique identifiers of the referenced <see cref="ConstraintRoleSequence"/> instances
/// </summary>
[Description("")]
[Property(name: "Definition", aggregation: AggregationKind.Composite, multiplicity: "0..1", typeKind: TypeKind.Object, defaultValue: "", typeName: "Definition", allowOverride: false, isOverride: false, isDerived: false)]
public string Definition { get; set; }

/// <summary>
/// Gets or sets the unique identifier of the referenced <see cref="ConstraintDuplicateNameError"/>
/// </summary>
[Description("")]
[Property(name: "DuplicateNameError", aggregation: AggregationKind.None, multiplicity: "0..1", typeKind: TypeKind.Object, defaultValue: "", typeName: "ConstraintDuplicateNameError", allowOverride: false, isOverride: false, isDerived: false)]
public string DuplicateNameError { get; set; }

/// <summary>
/// Gets or sets a list unique identifiers of the referenced <see cref="FactType"/> instances
/// </summary>
[Description("")]
[Property(name: "FactTypes", aggregation: AggregationKind.None, multiplicity: "0..*", typeKind: TypeKind.Object, defaultValue: "", typeName: "FactType", allowOverride: false, isOverride: false, isDerived: false)]
public List<string> FactTypes { get; set; }

/// <summary>
/// Gets or sets the unique identifier of the contained <see cref="ImplicationError"/>
/// </summary>
[Description("")]
[Property(name: "ImplicationError", aggregation: AggregationKind.Composite, multiplicity: "0..1", typeKind: TypeKind.Object, defaultValue: "", typeName: "ImplicationError", allowOverride: false, isOverride: false, isDerived: false)]
public string ImplicationError { get; set; }

/// <summary>
/// Gets or sets a Modality
/// </summary>
[Description("The constraint Modality. Alethic modality means the constraint is structurally enforced and data violating the constraint cannot be entered in the system. Deontic modality means that data violating the constraint can be recorded.")]
[Property(name: "Modality", aggregation: AggregationKind.None, multiplicity: "1..1", typeKind: TypeKind.Enumeration, defaultValue: "Alethic", typeName: "ConstraintModality", allowOverride: false, isOverride: false, isDerived: false)]
public ConstraintModality Modality { get; set; }

/// <summary>
/// Gets or sets the unique identifier of the contained <see cref="Note"/>
/// </summary>
[Description("")]
[Property(name: "Note", aggregation: AggregationKind.Composite, multiplicity: "0..1", typeKind: TypeKind.Object, defaultValue: "", typeName: "Note", allowOverride: false, isOverride: false, isDerived: false)]
public string Note { get; set; }
[Property(name: "RoleSequences", aggregation: AggregationKind.None, multiplicity: "0..*", typeKind: TypeKind.Object, defaultValue: "", typeName: "ConstraintRoleSequence", allowOverride: false, isOverride: false, isDerived: false)]
public List<string> RoleSequences { get; set; }

/// <summary>
/// Gets or sets the unique identifier of the contained <see cref="TooFewRoleSequencesError"/>
Expand Down
84 changes: 84 additions & 0 deletions Kalliope.DTO/AutoGenDto/SetConstraintWithJoin.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
// -------------------------------------------------------------------------------------------------
// <copyright file="SetConstraintWithJoin.cs" company="RHEA System S.A.">
//
// Copyright 2022-2023 RHEA System S.A.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// </copyright>
// ------------------------------------------------------------------------------------------------

// ------------------------------------------------------------------------------------------------
// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
// ------------------------------------------------------------------------------------------------

namespace Kalliope.DTO
{
using System;
using System.Collections.Generic;

using Kalliope.Common;

/// <summary>
/// A Data Transfer Object that represents a SetConstraintWithJoin
/// </summary>
[Container(typeName: "OrmModel", propertyName: "Constraints")]
public abstract partial class SetConstraintWithJoin : Constraint
{
/// <summary>
/// Initializes a new instance of the <see cref="SetConstraintWithJoin"/> class.
/// </summary>
protected SetConstraintWithJoin()
{
}

/// <summary>
/// Gets or sets the unique identifier of the container
/// </summary>
public string Container {get; set;}


/// <summary>
/// Gets or sets the unique identifier of the contained <see cref="CompatibleRolePlayerTypeError"/>
/// </summary>
[Description("")]
[Property(name: "CompatibleRolePlayerTypeError", aggregation: AggregationKind.Composite, multiplicity: "0..1", typeKind: TypeKind.Object, defaultValue: "", typeName: "CompatibleRolePlayerTypeError", allowOverride: false, isOverride: false, isDerived: false)]
public string CompatibleRolePlayerTypeError { get; set; }

/// <summary>
/// Gets or sets the unique identifier of the referenced <see cref="ConstraintRoleSequenceWithJoin"/>
/// </summary>
[Description("")]
[Property(name: "RoleSequence", aggregation: AggregationKind.None, multiplicity: "0..1", typeKind: TypeKind.Object, defaultValue: "", typeName: "ConstraintRoleSequenceWithJoin", allowOverride: false, isOverride: false, isDerived: false)]
public string RoleSequence { get; set; }

/// <summary>
/// Gets or sets the unique identifier of the contained <see cref="TooFewRoleSequencesError"/>
/// </summary>
[Description("")]
[Property(name: "TooFewRoleSequencesError", aggregation: AggregationKind.Composite, multiplicity: "0..1", typeKind: TypeKind.Object, defaultValue: "", typeName: "TooFewRoleSequencesError", allowOverride: false, isOverride: false, isDerived: false)]
public string TooFewRoleSequencesError { get; set; }

/// <summary>
/// Gets or sets the unique identifier of the contained <see cref="TooManyRoleSequencesError"/>
/// </summary>
[Description("")]
[Property(name: "TooManyRoleSequencesError", aggregation: AggregationKind.Composite, multiplicity: "0..1", typeKind: TypeKind.Object, defaultValue: "", typeName: "TooManyRoleSequencesError", allowOverride: false, isOverride: false, isDerived: false)]
public string TooManyRoleSequencesError { get; set; }

}
}

// ------------------------------------------------------------------------------------------------
// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
// ------------------------------------------------------------------------------------------------
Loading

0 comments on commit b5495ef

Please sign in to comment.