Skip to content

Commit 875f61d

Browse files
committed
Merge remote-tracking branch 'origin/dev'
2 parents d75cb1d + 70e83e6 commit 875f61d

File tree

3 files changed

+57
-5
lines changed

3 files changed

+57
-5
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.3.0
1+
8.3.1

src/Moryx.Orders/BeginContext.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, Phoenix Contact GmbH & Co. KG
1+
// Copyright (c) 2025, Phoenix Contact GmbH & Co. KG
22
// Licensed under the Apache License, Version 2.0
33

44
using Moryx.Orders.Restrictions;
@@ -20,14 +20,24 @@ public class BeginContext : OperationInfo
2020
/// </summary>
2121
public int PartialAmount { get; set; }
2222

23+
/// <summary>
24+
/// Provides the minimum value that can be set for the target amount when adjusting the operation.
25+
/// </summary>
26+
public int MinimalTargetAmount { get; set; }
27+
2328
/// <summary>
2429
/// Indicator if a begin is possible
2530
/// </summary>
2631
public bool CanBegin { get; set; }
2732

33+
/// <summary>
34+
/// Indicator if an adjustment of the operation is possible
35+
/// </summary>
36+
public bool CanReduce { get; set; }
37+
2838
/// <summary>
2939
/// Reasons why a begin is not possible
3040
/// </summary>
3141
public RestrictionDescription[] Restrictions { get; set; }
3242
}
33-
}
43+
}

src/Moryx.Orders/Restrictions/BeginRestriction.cs

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, Phoenix Contact GmbH & Co. KG
1+
// Copyright (c) 2025, Phoenix Contact GmbH & Co. KG
22
// Licensed under the Apache License, Version 2.0
33

44
namespace Moryx.Orders.Restrictions
@@ -11,6 +11,8 @@ public class BeginRestriction : IOperationRestriction
1111
/// <summary>
1212
/// Creates a new instance of <see cref="BeginRestriction"/>
1313
/// </summary>
14+
/// <param name="canBegin">Indicates whether this restriction still allows to begin the operation</param>
15+
/// <param name="description">Provides a <see cref="RestrictionDescription"/> for the restriction</param>
1416
public BeginRestriction(bool canBegin, RestrictionDescription description)
1517
{
1618
CanBegin = canBegin;
@@ -20,19 +22,59 @@ public BeginRestriction(bool canBegin, RestrictionDescription description)
2022
/// <summary>
2123
/// Creates a new instance of <see cref="BeginRestriction"/>
2224
/// </summary>
25+
/// <param name="canBegin">Indicates whether this restriction still allows to begin the operation</param>
26+
/// <param name="text">Provides a textual description for the restriction</param>
27+
/// <param name="severity">Sets the severity of the restriction</param>
2328
public BeginRestriction(bool canBegin, string text, RestrictionSeverity severity)
2429
: this(canBegin, new RestrictionDescription(text, severity))
2530
{
2631
}
2732

33+
/// <summary>
34+
/// Creates a new <see cref="BeginRestriction"/>
35+
/// </summary>
36+
/// <param name="canBegin">Indicates whether this restriction still allows to begin the operation</param>
37+
/// <param name="canReduce">Indicates whether this restriction still allows to reduce the target amount of the operation</param>
38+
/// <param name="minimalTargetAmount">Provides the minimal target amount that can be set in the adjustment</param>
39+
/// <param name="description">Provides a <see cref="RestrictionDescription"/> for the restriction</param>
40+
public BeginRestriction(bool canBegin, bool canReduce, int minimalTargetAmount, RestrictionDescription description)
41+
: this(canBegin, description)
42+
{
43+
CanReduce = canReduce;
44+
MinimalTargetAmount = minimalTargetAmount;
45+
}
46+
47+
/// <summary>
48+
/// Creates a new <see cref="BeginRestriction"/>
49+
/// </summary>
50+
/// <param name="canBegin">Indicates whether this restriction still allows to begin the operation</param>
51+
/// <param name="canReduce">Indicates whether this restriction still allows to reduce the target amount of the operation</param>
52+
/// <param name="minimalTargetAmount">Provides the minimal target amount that can be set in the adjustment</param>
53+
/// <param name="description">Provides a textual description for the restriction</param>
54+
/// <param name="severity">Sets the severity of the restriction</param>
55+
public BeginRestriction(bool canBegin, bool canReduce, int minimalTargetAmount, string description, RestrictionSeverity severity)
56+
: this(canBegin, canReduce, minimalTargetAmount, new RestrictionDescription(description, severity))
57+
{
58+
}
59+
2860
/// <summary>
2961
/// Indicator if a begin is possible
3062
/// </summary>
3163
public bool CanBegin { get; }
3264

65+
/// <summary>
66+
/// Indicator if an adjustement of the operation is possible
67+
/// </summary>
68+
public bool CanReduce { get; }
69+
70+
/// <summary>
71+
/// Minimal target amount that can be set in the adjustement
72+
/// </summary>
73+
public int MinimalTargetAmount { get; }
74+
3375
/// <summary>
3476
/// Description of the Result why the rule was not complied
3577
/// </summary>
3678
public RestrictionDescription Description { get; }
3779
}
38-
}
80+
}

0 commit comments

Comments
 (0)