From 626e7a8817979c62a67cb1a166c5db3cb8c6f500 Mon Sep 17 00:00:00 2001 From: Hugh Jeremy Date: Thu, 21 Jan 2021 16:18:05 +1100 Subject: [PATCH] remove LinkOpen --- ProcuretAPI/src/InstalmentLink.cs | 18 ++++++------------ ProcuretAPI/src/LinkOpen.cs | 12 ------------ ProcuretAPI_Tests/InstalmentLink.cs | 6 +++++- 3 files changed, 11 insertions(+), 25 deletions(-) delete mode 100644 ProcuretAPI/src/LinkOpen.cs diff --git a/ProcuretAPI/src/InstalmentLink.cs b/ProcuretAPI/src/InstalmentLink.cs index 7c78cef..2c1df1b 100644 --- a/ProcuretAPI/src/InstalmentLink.cs +++ b/ProcuretAPI/src/InstalmentLink.cs @@ -17,15 +17,13 @@ public struct InstalmentLink public readonly Decimal InvoiceAmount; public readonly String InvoiceIdentifier; public readonly String InviteeEmail; - public readonly LinkOpen[] Opens; internal InstalmentLink( String publicId, EntityHeadline supplier, String inviteeEmail, Decimal invoiceAmount, - String invoiceIdentifier, - LinkOpen[] linkOpens + String invoiceIdentifier ) { this.PublicId = publicId; @@ -33,7 +31,7 @@ LinkOpen[] linkOpens this.InviteeEmail = inviteeEmail; this.InvoiceAmount = invoiceAmount; this.InvoiceIdentifier = invoiceIdentifier; - this.Opens = linkOpens; + return; } @@ -56,7 +54,7 @@ Session session } String stringSupplierId = supplierId.ToString(); - String stringInvoiceValue = invoiceValue.ToString(); + String stringInvoiceValue = Math.Round(invoiceValue, 2).ToString(); CreatePayload payload = new CreatePayload( stringSupplierId, @@ -82,8 +80,7 @@ Session session decodePayload.supplier, decodePayload.invitee_email, Convert.ToDecimal(decodePayload.invoice_amount), - decodePayload.invoice_identifier, - decodePayload.opens + decodePayload.invoice_identifier ); return link; @@ -142,13 +139,13 @@ public static async Task RetrieveMany( foreach (InstalmentLink.DecodePayload link in decodePayload) { + resultList.Add(new InstalmentLink( link.public_id, link.supplier, link.invitee_email, Convert.ToDecimal(link.invoice_amount), - link.invoice_identifier, - link.opens + link.invoice_identifier )); continue; } @@ -210,9 +207,6 @@ internal class DecodePayload [DataMember] internal readonly String invoice_identifier; - [DataMember] - internal readonly LinkOpen[] opens; - } } } diff --git a/ProcuretAPI/src/LinkOpen.cs b/ProcuretAPI/src/LinkOpen.cs deleted file mode 100644 index ca11bc4..0000000 --- a/ProcuretAPI/src/LinkOpen.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Runtime.Serialization; - -namespace ProcuretAPI -{ - [DataContract(Name="procuret_data", Namespace="")] - public struct LinkOpen - { - public readonly Int32 Sequence; - public readonly String Created; - } -} diff --git a/ProcuretAPI_Tests/InstalmentLink.cs b/ProcuretAPI_Tests/InstalmentLink.cs index 9c68bbe..8f473a0 100644 --- a/ProcuretAPI_Tests/InstalmentLink.cs +++ b/ProcuretAPI_Tests/InstalmentLink.cs @@ -45,7 +45,11 @@ public async Task TestListInstalmentLink() session: this.Session ); - Assert.True(links.Length > 0, "Actual length: " + links.Length.ToString()); + Assert.True( + links.Length > 0, + "Actual length: " + links.Length.ToString() + ); + return;