Skip to content

Commit 6897694

Browse files
author
Aleksander Aas Sjåfjell
committed
Updates Xsd
Updates Xsd with the xsd:int for Order
1 parent ff01e48 commit 6897694

File tree

4 files changed

+28
-9
lines changed

4 files changed

+28
-9
lines changed

Digipost.Signature.Api.Client.Portal.Tests/DataTransferObjects/DataTransferObjectConverterTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ public void ConvertsManifestWithOrderedSignersSuccessfully()
9898
},
9999
signers = new[]
100100
{
101-
new signer {personalidentificationnumber = source.Signers.ElementAt(0).PersonalIdentificationNumber, order = "1"},
102-
new signer {personalidentificationnumber = source.Signers.ElementAt(1).PersonalIdentificationNumber, order = "2"}
101+
new signer {personalidentificationnumber = source.Signers.ElementAt(0).PersonalIdentificationNumber, order = 1},
102+
new signer {personalidentificationnumber = source.Signers.ElementAt(1).PersonalIdentificationNumber, order = 2}
103103
}
104104
};
105105

Digipost.Signature.Api.Client.Portal/DataTransferObjects/DataTransferObjectConverter.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,17 @@ private static IEnumerable<signer> ToDataTransferObject(IEnumerable<Signer> sign
5252

5353
private static signer ToDataTransferObject(Signer signer)
5454
{
55-
return new signer
55+
var dataTransferObject = new signer
5656
{
57-
personalidentificationnumber = signer.PersonalIdentificationNumber,
58-
order = signer.Order?.ToString()
57+
personalidentificationnumber = signer.PersonalIdentificationNumber
5958
};
59+
60+
if (signer.Order != null)
61+
{
62+
dataTransferObject.order = signer.Order.Value;
63+
}
64+
65+
return dataTransferObject;
6066
}
6167

6268
public static sender ToDataTransferObject(Sender sender)

Digipost.Signature.Api.Client.Scripts/XsdToCode/Code/direct-and-portal.cs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,9 @@ public partial class signer {
320320

321321
private string personalidentificationnumberField;
322322

323-
private string orderField;
323+
private int orderField;
324+
325+
private bool orderFieldSpecified;
324326

325327
/// <remarks/>
326328
[System.Xml.Serialization.XmlElementAttribute("personal-identification-number")]
@@ -334,15 +336,26 @@ public string personalidentificationnumber {
334336
}
335337

336338
/// <remarks/>
337-
[System.Xml.Serialization.XmlAttributeAttribute(DataType="integer")]
338-
public string order {
339+
[System.Xml.Serialization.XmlAttributeAttribute()]
340+
public int order {
339341
get {
340342
return this.orderField;
341343
}
342344
set {
343345
this.orderField = value;
344346
}
345347
}
348+
349+
/// <remarks/>
350+
[System.Xml.Serialization.XmlIgnoreAttribute()]
351+
public bool orderSpecified {
352+
get {
353+
return this.orderFieldSpecified;
354+
}
355+
set {
356+
this.orderFieldSpecified = value;
357+
}
358+
}
346359
}
347360

348361
/// <remarks/>

Digipost.Signature.Api.Client.Scripts/XsdToCode/Xsd/common.xsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
</xs:documentation>
7474
</xs:annotation>
7575
<xs:simpleType>
76-
<xs:restriction base="xs:integer">
76+
<xs:restriction base="xs:int">
7777
<xs:minInclusive value="0"/>
7878
<xs:maxInclusive value="9"/>
7979
</xs:restriction>

0 commit comments

Comments
 (0)