janssenr / SendCloudApi.Net

A C#/.net wrapper for the SendCloud API
MIT License
6 stars 5 forks source link

Nullable date values in Parcel.cs #19

Closed davidkdb closed 2 years ago

davidkdb commented 2 years ago

Hi,

We just had a case when the announcement to DHL failed in creating a parcel.

It returned null in DateAnnounced. So the fields below should be nullable in Parcel.cs so that it does not fail on serialization, and then the error can be retrieved from the status property.

[DataMember(Name = "date_created", EmitDefaultValue = false, IsRequired = false)] public DateTime DateCreated { get; set; }

    [DataMember(Name = "date_announced", EmitDefaultValue = false, IsRequired = false)]
    public DateTime DateAnnounced { get; set; }

    [DataMember(Name = "date_updated", EmitDefaultValue = false, IsRequired = false)]
    public DateTime DateUpdated { get; set; }
janssenr commented 2 years ago

Make DateAnnounced and DateUpdated Nullable