FulfillmentOrderEvent
FulfillmentOrderEvent schema
Properties
EventSchemaVersion(string)Version of event schema being used.-
FulfillmentOrder(object)Details for Fulfillment Order JSON schema. Cannot contain additional properties.CustomerId(['string', 'null'])Customer ID tied to the fulfillment order.FulfillmentOrderId(string, required)Unique ID for fulfillment order.FulfillmentSystemCustomerId(['string', 'null'])ID of customer within the fulfillment system.FulfillmentSystemId(['string', 'null'])System used to fulfill the order.FulfillmentSystemLocationId(['string', 'null'])ID of location within the fulfillment system.FulfillmentSystemOrderId(['string', 'null'])Fulfillment order ID within the fulfillment system.ReferenceId(['string', 'null'])Reference ID for the fulfillment order.XmlSenderId(['string', 'null'])XML sender identifier for the fulfillment order.AllowPartialShipments(['boolean', 'null'])Flag indicating whether partial shipments are allowed for this fulfillment order.-
BillTo(['object', 'null'])Fulfillment order level bill to contact and address details.Address1(['string', 'null'])Address line 1 for address.Address2(['string', 'null'])Address line 2 for address.Address3(['string', 'null'])Address line 3 for address.AddressCode(['string', 'null'])Address code for address.City(['string', 'null'])City name for address.Company(['string', 'null'])Company name for address.Country(['string', 'null'])Country name for address.EmailAddress(['string', 'null'])Contact email address for address.FaxNumber(['string', 'null'])Fax number for address.Name(['string', 'null'])Contact name for this address.PhoneNumber(['string', 'null'])Phone number for address.PostalCode(['string', 'null'])Postal code for address.StateProvince(['string', 'null'])State or province name for address.
-
CreateDateTime(['string', 'null'])Created date time of the fulfillment order. DefaultShipToKey(['string', 'null'])Default key for ShipTo.DueDate(['string', 'null'])Due date of the fulfillment order.-
OrderIds(['array', 'null'])Order IDs tied to the fulfillment order.- Items (string)
-
OrderVariables(['string', 'null'])Order variables tied to the fulfillment order in JSON format. PONumber(['string', 'null'])PO number tied to the fulfillment order.PackListNotes(['string', 'null'])Notes related to the pack list for the order.-
PaymentMethods(['array', 'null'])PaymentMethod details.-
Items (object)
Amount(['number', 'null'])Amount for the payment method.MethodName(['string', 'null'])Name of the payment method.
-
-
PicklistNotes(['string', 'null'])Notes related to the picklist for the order. -
Products(['array', 'null'])Fulfillment order level product details.-
Items (object)
FulfillmentSystemId(['string', 'null'])Fulfillment system ID.FulfillmentSystemProductId(['string', 'null'])Fulfillment system product ID.ProductId(['string', 'null'])Product ID.ProductLineId(['string', 'null'])Product line ID.AssociatedFileName(['string', 'null'])Associated file name.Comment(['string', 'null'])Comment for the product.IsDeleted(['boolean', 'null'])Whether the product is deleted.PageCount(['integer', 'null'])Page count for the product.Price(['number', 'null'])Price of the product.QuantityOrdered(['integer', 'null'])Quantity ordered.ShipToKey(['string', 'null'])Ship to key for the product.Status(['string', 'null'])Status of the product.
-
-
RushOrder(['boolean', 'null'])Indicator if the order is a rush order. -
ShipTos(['array', 'null'])Fulfillment order level ship to details.-
Items (object)
FulfillmentSystemShippingMethodId(['string', 'null'])Fulfillment system shipping method ID.ReferenceId(['string', 'null'])Reference ID.Comment(['string', 'null'])Comment.DeliveryNotes(['string', 'null'])Notes related to delivery for this ship to location.DueDate(['string', 'null'])Due date.IsDeleted(['boolean', 'null'])Whether the ship to is deleted.Key(string, required)Key for the ship to.PONumber(['string', 'null'])PO number.-
PaymentMethods(['array', 'null'])Payment methods for this ship to.-
Items (object)
Amount(['number', 'null'])Amount for the payment method.MethodName(['string', 'null'])Name of the payment method.
-
-
RushFee(['number', 'null'])Rush fee. RushOrder(['boolean', 'null'])Whether this is a rush order.-
ShipToAddress(['object', 'null'])Ship to address.Address1(['string', 'null'])Address line 1 for address.Address2(['string', 'null'])Address line 2 for address.Address3(['string', 'null'])Address line 3 for address.AddressCode(['string', 'null'])Address code for address.City(['string', 'null'])City name for address.Company(['string', 'null'])Company name for address.Country(['string', 'null'])Country name for address.EmailAddress(['string', 'null'])Contact email address for address.FaxNumber(['string', 'null'])Fax number for address.Name(['string', 'null'])Contact name for this address.PhoneNumber(['string', 'null'])Phone number for address.PostalCode(['string', 'null'])Postal code for address.StateProvince(['string', 'null'])State or province name for address.
-
ShippingCarrier(['string', 'null'])Shipping carrier. ShippingCost(['number', 'null'])Shipping cost.ShippingService(['string', 'null'])Shipping service.Status(['string', 'null'])Status.ThirdPartyAccountNumber(['string', 'null'])Third party account number to use for ship method carrier.
-
-
Shipments(['array', 'null'])Shipments tied to the fulfillment order.-
Items (object)
FulfillmentSystemId(['string', 'null'])Fulfillment system ID.FulfillmentSystemLocationId(['string', 'null'])Fulfillment system location ID.ShipmentId(['string', 'null'])Shipment ID.Carrier(['string', 'null'])Carrier.Freight(['number', 'null'])Freight cost.IsDeleted(['boolean', 'null'])Whether the shipment is deleted.MasterTrackingNumber(['string', 'null'])Master tracking number.-
Packages(['array', 'null'])Packages in the shipment.-
Items (object)
IsDeleted(['boolean', 'null'])Whether the package is deleted.PackageNumber(['string', 'null'])Package number.-
Products(['array', 'null'])Products in the package.-
Items (object)
ProductLineId(['string', 'null'])Product line ID.ShipQuantity(['number', 'null'])Ship quantity.
-
-
QuantityInPackage(['integer', 'null'])Quantity of items in the package. Reference1(['string', 'null'])First reference field for the package.Reference2(['string', 'null'])Second reference field for the package.TrackingNumber(['string', 'null'])Tracking number.Weight(['number', 'null'])Weight of the package.
-
-
PackingSlipNumber(['string', 'null'])Packing slip number. Service(['string', 'null'])Service.ShipDateUtc(['string', 'null'])Ship date in UTC.-
ShipToAddress(['object', 'null'])Ship to address.Address1(['string', 'null'])Address line 1 for address.Address2(['string', 'null'])Address line 2 for address.Address3(['string', 'null'])Address line 3 for address.AddressCode(['string', 'null'])Address code for address.City(['string', 'null'])City name for address.Company(['string', 'null'])Company name for address.Country(['string', 'null'])Country name for address.EmailAddress(['string', 'null'])Contact email address for address.FaxNumber(['string', 'null'])Fax number for address.Name(['string', 'null'])Contact name for this address.PhoneNumber(['string', 'null'])Phone number for address.PostalCode(['string', 'null'])Postal code for address.StateProvince(['string', 'null'])State or province name for address.
-
TotalNumberOfPackages(['integer', 'null'])Total number of packages in the shipment.
-
-
Statuses(['array', 'null'])Statuses tied to the fulfillment order.- Items (string)
-
AggregateId(string)Unique ID for aggregate type within Suite of Brokers. CorrelationId(string)Unique ID for SOB-external event trigger.AggregateType(string)Type of event schema.EventActionUser(['string', 'null'])Username of user who triggered event.EventDateTimeUtc(string)UTC based datetime of when event was triggered.EventName(string)Name of triggered event for FulfillmentOrder. Must be one of:["Fulfillment Order Created", "Fulfillment Order Updated", "Fulfillment Order Submitted to Fulfillment System", "Fulfillment Order Submission Failed", "Fulfillment Order Update Validation Failed", "Fulfillment Order Update Request Validated", "Update Failed to Submit to Fulfillment System"].-
EventNameValuePairs(['array', 'null'])-
Items (object)
Name(['string', 'null'])Name of the name-value pair.Value(['string', 'null'])Value of the name-value pair.
-
-
EventPublisherApp(string)Name of source application that published event. EventSchemaVersion(string)Version of event schema being used.EventSource(string)Name of system where event was triggered.
Quicktype Command
quicktype \
--framework SystemTextJson \
--lang cs \
--number-type double \
--src-lang schema \
--no-check-required \
--density dense \
--features complete \
--namespace OtpSchema.Event.FulfillmentOrder.FulfillmentOrderEvent \
--src .working/build/internal/json-schema-for-cs/FulfillmentOrderEvent.json -o .working/build/internal/csharp/OtpSchema/Event/FulfillmentOrder/FulfillmentOrderEvent.cs
// <auto-generated />
//
// To parse this JSON data, add NuGet 'System.Text.Json' then do:
//
// using OtpSchema.Event.FulfillmentOrder.FulfillmentOrderEvent;
//
// var fulfillmentOrderEvent = FulfillmentOrderEvent.FromJson(jsonString);
#nullable enable
#pragma warning disable CS8618
#pragma warning disable CS8601
#pragma warning disable CS8603
namespace OtpSchema.Event.FulfillmentOrder.FulfillmentOrderEvent
{
using System;
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Globalization;
using J = System.Text.Json.Serialization.JsonPropertyNameAttribute;
using N = System.Text.Json.Serialization.JsonIgnoreCondition;
/// <summary>FulfillmentOrderEvent schema</summary>
public partial class FulfillmentOrderEvent
{
[J("EventSchemaVersion")] public string EventSchemaVersion { get; set; } // Version of event schema being used
[J("FulfillmentOrder")] public FulfillmentOrder FulfillmentOrder { get; set; } // Details for Fulfillment Order JSON schema
[J("AggregateId")] public string AggregateId { get; set; } // Unique ID for aggregate type within Suite of Brokers
[J("AggregateType")] public string AggregateType { get; set; } // Type of event schema
[J("CorrelationId")] public string CorrelationId { get; set; } // Unique ID for SOB-external event trigger
[J("EventActionUser")] public string EventActionUser { get; set; } // Username of user who triggered event
[J("EventDateTimeUtc")] public string EventDateTimeUtc { get; set; } // UTC based datetime of when event was triggered
[J("EventName")] public EventName EventName { get; set; } // Name of triggered event for FulfillmentOrder
[J("EventNameValuePairs")] public EventNameValuePair[]? EventNameValuePairs { get; set; }
[J("EventPublisherApp")] public string EventPublisherApp { get; set; } // Name of source application that published event
[J("EventSource")] public string EventSource { get; set; } // Name of system where event was triggered
}
public partial class EventNameValuePair
{
[J("Name")] public string Name { get; set; } // Name of the name-value pair
[J("Value")] public string Value { get; set; } // Value of the name-value pair
}
/// <summary>Details for Fulfillment Order JSON schema</summary>
public partial class FulfillmentOrder
{
[J("AllowPartialShipments")] public bool? AllowPartialShipments { get; set; } // Flag indicating whether partial shipments are allowed for this fulfillment order
[J("BillTo")] public BillTo BillTo { get; set; } // Fulfillment order level bill to contact and address details
[J("CreateDateTime")] public string CreateDateTime { get; set; } // Created date time of the fulfillment order
[J("CustomerId")] public string CustomerId { get; set; } // Customer ID tied to the fulfillment order
[J("DefaultShipToKey")] public string DefaultShipToKey { get; set; } // Default key for ShipTo
[J("DueDate")] public string DueDate { get; set; } // Due date of the fulfillment order
[J("FulfillmentOrderId")] public string FulfillmentOrderId { get; set; } // Unique ID for fulfillment order
[J("FulfillmentSystemCustomerId")] public string FulfillmentSystemCustomerId { get; set; } // ID of customer within the fulfillment system
[J("FulfillmentSystemId")] public string FulfillmentSystemId { get; set; } // System used to fulfill the order
[J("FulfillmentSystemLocationId")] public string FulfillmentSystemLocationId { get; set; } // ID of location within the fulfillment system
[J("FulfillmentSystemOrderId")] public string FulfillmentSystemOrderId { get; set; } // Fulfillment order ID within the fulfillment system
[J("OrderIds")] public string[]? OrderIds { get; set; } // Order IDs tied to the fulfillment order
[J("OrderVariables")] public string OrderVariables { get; set; } // Order variables tied to the fulfillment order in JSON format
[J("PackListNotes")] public string PackListNotes { get; set; } // Notes related to the pack list for the order
[J("PaymentMethods")] public FulfillmentOrderPaymentMethod[]? PaymentMethods { get; set; } // PaymentMethod details
[J("PicklistNotes")] public string PicklistNotes { get; set; } // Notes related to the picklist for the order
[J("PONumber")] public string PoNumber { get; set; } // PO number tied to the fulfillment order
[J("Products")] public FulfillmentOrderProduct[]? Products { get; set; } // Fulfillment order level product details
[J("ReferenceId")] public string ReferenceId { get; set; } // Reference ID for the fulfillment order
[J("RushOrder")] public bool? RushOrder { get; set; } // Indicator if the order is a rush order
[J("Shipments")] public Shipment[]? Shipments { get; set; } // Shipments tied to the fulfillment order
[J("ShipTos")] public ShipTo[]? ShipTos { get; set; } // Fulfillment order level ship to details
[J("Statuses")] public string[]? Statuses { get; set; } // Statuses tied to the fulfillment order
[J("XmlSenderId")] public string XmlSenderId { get; set; } // XML sender identifier for the fulfillment order
}
public partial class BillTo
{
[J("Address1")] public string Address1 { get; set; } // Address line 1 for address
[J("Address2")] public string Address2 { get; set; } // Address line 2 for address
[J("Address3")] public string Address3 { get; set; } // Address line 3 for address
[J("AddressCode")] public string AddressCode { get; set; } // Address code for address
[J("City")] public string City { get; set; } // City name for address
[J("Company")] public string Company { get; set; } // Company name for address
[J("Country")] public string Country { get; set; } // Country name for address
[J("EmailAddress")] public string EmailAddress { get; set; } // Contact email address for address
[J("FaxNumber")] public string FaxNumber { get; set; } // Fax number for address
[J("Name")] public string Name { get; set; } // Contact name for this address
[J("PhoneNumber")] public string PhoneNumber { get; set; } // Phone number for address
[J("PostalCode")] public string PostalCode { get; set; } // Postal code for address
[J("StateProvince")] public string StateProvince { get; set; } // State or province name for address
}
public partial class FulfillmentOrderPaymentMethod
{
[J("Amount")] public double? Amount { get; set; } // Amount for the payment method
[J("MethodName")] public string MethodName { get; set; } // Name of the payment method
}
public partial class FulfillmentOrderProduct
{
[J("AssociatedFileName")] public string AssociatedFileName { get; set; } // Associated file name
[J("Comment")] public string Comment { get; set; } // Comment for the product
[J("FulfillmentSystemId")] public string FulfillmentSystemId { get; set; } // Fulfillment system ID
[J("FulfillmentSystemProductId")] public string FulfillmentSystemProductId { get; set; } // Fulfillment system product ID
[J("IsDeleted")] public bool? IsDeleted { get; set; } // Whether the product is deleted
[J("PageCount")] public long? PageCount { get; set; } // Page count for the product
[J("Price")] public double? Price { get; set; } // Price of the product
[J("ProductId")] public string ProductId { get; set; } // Product ID
[J("ProductLineId")] public string ProductLineId { get; set; } // Product line ID
[J("QuantityOrdered")] public long? QuantityOrdered { get; set; } // Quantity ordered
[J("ShipToKey")] public string ShipToKey { get; set; } // Ship to key for the product
[J("Status")] public string Status { get; set; } // Status of the product
}
public partial class ShipTo
{
[J("Comment")] public string Comment { get; set; } // Comment
[J("DeliveryNotes")] public string DeliveryNotes { get; set; } // Notes related to delivery for this ship to location
[J("DueDate")] public string DueDate { get; set; } // Due date
[J("FulfillmentSystemShippingMethodId")] public string FulfillmentSystemShippingMethodId { get; set; } // Fulfillment system shipping method ID
[J("IsDeleted")] public bool? IsDeleted { get; set; } // Whether the ship to is deleted
[J("Key")] public string Key { get; set; } // Key for the ship to
[J("PaymentMethods")] public ShipToPaymentMethod[]? PaymentMethods { get; set; } // Payment methods for this ship to
[J("PONumber")] public string PoNumber { get; set; } // PO number
[J("ReferenceId")] public string ReferenceId { get; set; } // Reference ID
[J("RushFee")] public double? RushFee { get; set; } // Rush fee
[J("RushOrder")] public bool? RushOrder { get; set; } // Whether this is a rush order
[J("ShippingCarrier")] public string ShippingCarrier { get; set; } // Shipping carrier
[J("ShippingCost")] public double? ShippingCost { get; set; } // Shipping cost
[J("ShippingService")] public string ShippingService { get; set; } // Shipping service
[J("ShipToAddress")] public ShipToShipToAddress ShipToAddress { get; set; } // Ship to address
[J("Status")] public string Status { get; set; } // Status
[J("ThirdPartyAccountNumber")] public string ThirdPartyAccountNumber { get; set; } // Third party account number to use for ship method carrier
}
public partial class ShipToPaymentMethod
{
[J("Amount")] public double? Amount { get; set; } // Amount for the payment method
[J("MethodName")] public string MethodName { get; set; } // Name of the payment method
}
public partial class ShipToShipToAddress
{
[J("Address1")] public string Address1 { get; set; } // Address line 1 for address
[J("Address2")] public string Address2 { get; set; } // Address line 2 for address
[J("Address3")] public string Address3 { get; set; } // Address line 3 for address
[J("AddressCode")] public string AddressCode { get; set; } // Address code for address
[J("City")] public string City { get; set; } // City name for address
[J("Company")] public string Company { get; set; } // Company name for address
[J("Country")] public string Country { get; set; } // Country name for address
[J("EmailAddress")] public string EmailAddress { get; set; } // Contact email address for address
[J("FaxNumber")] public string FaxNumber { get; set; } // Fax number for address
[J("Name")] public string Name { get; set; } // Contact name for this address
[J("PhoneNumber")] public string PhoneNumber { get; set; } // Phone number for address
[J("PostalCode")] public string PostalCode { get; set; } // Postal code for address
[J("StateProvince")] public string StateProvince { get; set; } // State or province name for address
}
public partial class Shipment
{
[J("Carrier")] public string Carrier { get; set; } // Carrier
[J("Freight")] public double? Freight { get; set; } // Freight cost
[J("FulfillmentSystemId")] public string FulfillmentSystemId { get; set; } // Fulfillment system ID
[J("FulfillmentSystemLocationId")] public string FulfillmentSystemLocationId { get; set; } // Fulfillment system location ID
[J("IsDeleted")] public bool? IsDeleted { get; set; } // Whether the shipment is deleted
[J("MasterTrackingNumber")] public string MasterTrackingNumber { get; set; } // Master tracking number
[J("Packages")] public Package[]? Packages { get; set; } // Packages in the shipment
[J("PackingSlipNumber")] public string PackingSlipNumber { get; set; } // Packing slip number
[J("Service")] public string Service { get; set; } // Service
[J("ShipDateUtc")] public string ShipDateUtc { get; set; } // Ship date in UTC
[J("ShipmentId")] public string ShipmentId { get; set; } // Shipment ID
[J("ShipToAddress")] public ShipmentShipToAddress ShipToAddress { get; set; } // Ship to address
[J("TotalNumberOfPackages")] public long? TotalNumberOfPackages { get; set; } // Total number of packages in the shipment
}
public partial class Package
{
[J("IsDeleted")] public bool? IsDeleted { get; set; } // Whether the package is deleted
[J("PackageNumber")] public string PackageNumber { get; set; } // Package number
[J("Products")] public PackageProduct[]? Products { get; set; } // Products in the package
[J("QuantityInPackage")] public long? QuantityInPackage { get; set; } // Quantity of items in the package
[J("Reference1")] public string Reference1 { get; set; } // First reference field for the package
[J("Reference2")] public string Reference2 { get; set; } // Second reference field for the package
[J("TrackingNumber")] public string TrackingNumber { get; set; } // Tracking number
[J("Weight")] public double? Weight { get; set; } // Weight of the package
}
public partial class PackageProduct
{
[J("ProductLineId")] public string ProductLineId { get; set; } // Product line ID
[J("ShipQuantity")] public double? ShipQuantity { get; set; } // Ship quantity
}
public partial class ShipmentShipToAddress
{
[J("Address1")] public string Address1 { get; set; } // Address line 1 for address
[J("Address2")] public string Address2 { get; set; } // Address line 2 for address
[J("Address3")] public string Address3 { get; set; } // Address line 3 for address
[J("AddressCode")] public string AddressCode { get; set; } // Address code for address
[J("City")] public string City { get; set; } // City name for address
[J("Company")] public string Company { get; set; } // Company name for address
[J("Country")] public string Country { get; set; } // Country name for address
[J("EmailAddress")] public string EmailAddress { get; set; } // Contact email address for address
[J("FaxNumber")] public string FaxNumber { get; set; } // Fax number for address
[J("Name")] public string Name { get; set; } // Contact name for this address
[J("PhoneNumber")] public string PhoneNumber { get; set; } // Phone number for address
[J("PostalCode")] public string PostalCode { get; set; } // Postal code for address
[J("StateProvince")] public string StateProvince { get; set; } // State or province name for address
}
/// <summary>Name of triggered event for FulfillmentOrder</summary>
public enum EventName { FulfillmentOrderCreated, FulfillmentOrderSubmissionFailed, FulfillmentOrderSubmittedToFulfillmentSystem, FulfillmentOrderUpdateRequestValidated, FulfillmentOrderUpdateValidationFailed, FulfillmentOrderUpdated, UpdateFailedToSubmitToFulfillmentSystem };
public partial class FulfillmentOrderEvent
{
public static FulfillmentOrderEvent FromJson(string json) => JsonSerializer.Deserialize<FulfillmentOrderEvent>(json, OtpSchema.Event.FulfillmentOrder.FulfillmentOrderEvent.Converter.Settings);
}
public static class Serialize
{
public static string ToJson(this FulfillmentOrderEvent self) => JsonSerializer.Serialize(self, OtpSchema.Event.FulfillmentOrder.FulfillmentOrderEvent.Converter.Settings);
}
internal static class Converter
{
public static readonly JsonSerializerOptions Settings = new(JsonSerializerDefaults.General)
{
Converters =
{
EventNameConverter.Singleton,
new DateOnlyConverter(),
new TimeOnlyConverter(),
IsoDateTimeOffsetConverter.Singleton
},
};
}
internal class EventNameConverter : JsonConverter<EventName>
{
public override bool CanConvert(Type t) => t == typeof(EventName);
public override EventName Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
switch (value)
{
case "Fulfillment Order Created":
return EventName.FulfillmentOrderCreated;
case "Fulfillment Order Submission Failed":
return EventName.FulfillmentOrderSubmissionFailed;
case "Fulfillment Order Submitted to Fulfillment System":
return EventName.FulfillmentOrderSubmittedToFulfillmentSystem;
case "Fulfillment Order Update Request Validated":
return EventName.FulfillmentOrderUpdateRequestValidated;
case "Fulfillment Order Update Validation Failed":
return EventName.FulfillmentOrderUpdateValidationFailed;
case "Fulfillment Order Updated":
return EventName.FulfillmentOrderUpdated;
case "Update Failed to Submit to Fulfillment System":
return EventName.UpdateFailedToSubmitToFulfillmentSystem;
}
throw new Exception("Cannot unmarshal type EventName");
}
public override void Write(Utf8JsonWriter writer, EventName value, JsonSerializerOptions options)
{
switch (value)
{
case EventName.FulfillmentOrderCreated:
JsonSerializer.Serialize(writer, "Fulfillment Order Created", options);
return;
case EventName.FulfillmentOrderSubmissionFailed:
JsonSerializer.Serialize(writer, "Fulfillment Order Submission Failed", options);
return;
case EventName.FulfillmentOrderSubmittedToFulfillmentSystem:
JsonSerializer.Serialize(writer, "Fulfillment Order Submitted to Fulfillment System", options);
return;
case EventName.FulfillmentOrderUpdateRequestValidated:
JsonSerializer.Serialize(writer, "Fulfillment Order Update Request Validated", options);
return;
case EventName.FulfillmentOrderUpdateValidationFailed:
JsonSerializer.Serialize(writer, "Fulfillment Order Update Validation Failed", options);
return;
case EventName.FulfillmentOrderUpdated:
JsonSerializer.Serialize(writer, "Fulfillment Order Updated", options);
return;
case EventName.UpdateFailedToSubmitToFulfillmentSystem:
JsonSerializer.Serialize(writer, "Update Failed to Submit to Fulfillment System", options);
return;
}
throw new Exception("Cannot marshal type EventName");
}
public static readonly EventNameConverter Singleton = new EventNameConverter();
}
public class DateOnlyConverter : JsonConverter<DateOnly>
{
private readonly string serializationFormat;
public DateOnlyConverter() : this(null) { }
public DateOnlyConverter(string? serializationFormat)
{
this.serializationFormat = serializationFormat ?? "yyyy-MM-dd";
}
public override DateOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
return DateOnly.Parse(value!);
}
public override void Write(Utf8JsonWriter writer, DateOnly value, JsonSerializerOptions options)
=> writer.WriteStringValue(value.ToString(serializationFormat));
}
public class TimeOnlyConverter : JsonConverter<TimeOnly>
{
private readonly string serializationFormat;
public TimeOnlyConverter() : this(null) { }
public TimeOnlyConverter(string? serializationFormat)
{
this.serializationFormat = serializationFormat ?? "HH:mm:ss.fff";
}
public override TimeOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
return TimeOnly.Parse(value!);
}
public override void Write(Utf8JsonWriter writer, TimeOnly value, JsonSerializerOptions options)
=> writer.WriteStringValue(value.ToString(serializationFormat));
}
internal class IsoDateTimeOffsetConverter : JsonConverter<DateTimeOffset>
{
public override bool CanConvert(Type t) => t == typeof(DateTimeOffset);
private const string DefaultDateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK";
private DateTimeStyles _dateTimeStyles = DateTimeStyles.RoundtripKind;
private string? _dateTimeFormat;
private CultureInfo? _culture;
public DateTimeStyles DateTimeStyles
{
get => _dateTimeStyles;
set => _dateTimeStyles = value;
}
public string? DateTimeFormat
{
get => _dateTimeFormat ?? string.Empty;
set => _dateTimeFormat = (string.IsNullOrEmpty(value)) ? null : value;
}
public CultureInfo Culture
{
get => _culture ?? CultureInfo.CurrentCulture;
set => _culture = value;
}
public override void Write(Utf8JsonWriter writer, DateTimeOffset value, JsonSerializerOptions options)
{
string text;
if ((_dateTimeStyles & DateTimeStyles.AdjustToUniversal) == DateTimeStyles.AdjustToUniversal
|| (_dateTimeStyles & DateTimeStyles.AssumeUniversal) == DateTimeStyles.AssumeUniversal)
{
value = value.ToUniversalTime();
}
text = value.ToString(_dateTimeFormat ?? DefaultDateTimeFormat, Culture);
writer.WriteStringValue(text);
}
public override DateTimeOffset Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
string? dateText = reader.GetString();
if (string.IsNullOrEmpty(dateText) == false)
{
if (!string.IsNullOrEmpty(_dateTimeFormat))
{
return DateTimeOffset.ParseExact(dateText, _dateTimeFormat, Culture, _dateTimeStyles);
}
else
{
return DateTimeOffset.Parse(dateText, Culture, _dateTimeStyles);
}
}
else
{
return default(DateTimeOffset);
}
}
public static readonly IsoDateTimeOffsetConverter Singleton = new IsoDateTimeOffsetConverter();
}
}
#pragma warning restore CS8618
#pragma warning restore CS8601
#pragma warning restore CS8603
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "FulfillmentOrderEvent.json",
"description": "FulfillmentOrderEvent schema",
"type": "object",
"allOf": [
{
"type": "object",
"properties": {
"EventSchemaVersion": {"description": "Version of event schema being used", "type": "string"},
"FulfillmentOrder": {
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "FulfillmentOrder.json",
"description": "Details for Fulfillment Order JSON schema",
"type": "object",
"additionalProperties": false,
"title": "FulfillmentOrder",
"properties": {
"CustomerId": {
"description": "Customer ID tied to the fulfillment order",
"type": ["string", "null"]
},
"FulfillmentOrderId": {"description": "Unique ID for fulfillment order", "type": "string"},
"FulfillmentSystemCustomerId": {
"description": "ID of customer within the fulfillment system",
"type": ["string", "null"]
},
"FulfillmentSystemId": {
"description": "System used to fulfill the order",
"type": ["string", "null"]
},
"FulfillmentSystemLocationId": {
"description": "ID of location within the fulfillment system",
"type": ["string", "null"]
},
"FulfillmentSystemOrderId": {
"description": "Fulfillment order ID within the fulfillment system",
"type": ["string", "null"]
},
"ReferenceId": {
"description": "Reference ID for the fulfillment order",
"type": ["string", "null"]
},
"XmlSenderId": {
"description": "XML sender identifier for the fulfillment order",
"type": ["string", "null"]
},
"AllowPartialShipments": {
"description": "Flag indicating whether partial shipments are allowed for this fulfillment order",
"type": ["boolean", "null"]
},
"BillTo": {
"description": "Fulfillment order level bill to contact and address details",
"type": ["object", "null"],
"properties": {
"Address1": { "description": "Address line 1 for address", "type": ["string", "null"] },
"Address2": { "description": "Address line 2 for address", "type": ["string", "null"] },
"Address3": { "description": "Address line 3 for address", "type": ["string", "null"] },
"AddressCode": { "description": "Address code for address", "type": ["string", "null"] },
"City": { "description": "City name for address", "type": ["string", "null"] },
"Company": { "description": "Company name for address", "type": ["string", "null"] },
"Country": { "description": "Country name for address", "type": ["string", "null"] },
"EmailAddress": {
"description": "Contact email address for address",
"type": ["string", "null"]
},
"FaxNumber": { "description": "Fax number for address", "type": ["string", "null"] },
"Name": { "description": "Contact name for this address", "type": ["string", "null"] },
"PhoneNumber": { "description": "Phone number for address", "type": ["string", "null"] },
"PostalCode": { "description": "Postal code for address", "type": ["string", "null"] },
"StateProvince": {
"description": "State or province name for address",
"type": ["string", "null"]
}
}
},
"CreateDateTime": {
"description": "Created date time of the fulfillment order",
"type": ["string", "null"]
},
"DefaultShipToKey": { "description": "Default key for ShipTo", "type": ["string", "null"] },
"DueDate": {
"description": "Due date of the fulfillment order",
"type": ["string", "null"]
},
"OrderIds": {
"description": "Order IDs tied to the fulfillment order",
"type": ["array", "null"],
"items": {"type": "string"}
},
"OrderVariables": {
"description": "Order variables tied to the fulfillment order in JSON format",
"type": ["string", "null"]
},
"PONumber": {
"description": "PO number tied to the fulfillment order",
"type": ["string", "null"]
},
"PackListNotes": {
"description": "Notes related to the pack list for the order",
"type": ["string", "null"]
},
"PaymentMethods": {
"description": "PaymentMethod details",
"type": ["array", "null"],
"items": {
"type": "object",
"properties": {
"Amount" : { "description": "Amount for the payment method", "type": ["number", "null"] },
"MethodName": { "description": "Name of the payment method" , "type": ["string", "null"] }
}
}
},
"PicklistNotes": {
"description": "Notes related to the picklist for the order",
"type": ["string", "null"]
},
"Products": {
"description": "Fulfillment order level product details",
"type": ["array", "null"],
"items": {
"type": "object",
"properties": {
"FulfillmentSystemId" : { "description": "Fulfillment system ID" , "type": ["string", "null"] },
"FulfillmentSystemProductId": { "description": "Fulfillment system product ID" , "type": ["string", "null"] },
"ProductId" : { "description": "Product ID" , "type": ["string", "null"] },
"ProductLineId" : { "description": "Product line ID" , "type": ["string", "null"] },
"AssociatedFileName" : { "description": "Associated file name" , "type": ["string", "null"] },
"Comment" : { "description": "Comment for the product" , "type": ["string", "null"] },
"IsDeleted" : { "description": "Whether the product is deleted", "type": ["boolean", "null"] },
"PageCount" : { "description": "Page count for the product" , "type": ["integer", "null"] },
"Price" : { "description": "Price of the product" , "type": ["number", "null"] },
"QuantityOrdered" : { "description": "Quantity ordered" , "type": ["integer", "null"] },
"ShipToKey" : { "description": "Ship to key for the product" , "type": ["string", "null"] },
"Status" : { "description": "Status of the product" , "type": ["string", "null"] }
}
}
},
"RushOrder": {
"description": "Indicator if the order is a rush order",
"type": ["boolean", "null"]
},
"ShipTos": {
"description": "Fulfillment order level ship to details",
"type": ["array", "null"],
"items": {
"type": "object",
"properties": {
"FulfillmentSystemShippingMethodId": {
"description": "Fulfillment system shipping method ID",
"type": ["string", "null"]
},
"ReferenceId": { "description": "Reference ID", "type": ["string", "null"] },
"Comment": { "description": "Comment", "type": ["string", "null"] },
"DeliveryNotes": {
"description": "Notes related to delivery for this ship to location",
"type": ["string", "null"]
},
"DueDate": { "description": "Due date", "type": ["string", "null"] },
"IsDeleted": { "description": "Whether the ship to is deleted", "type": ["boolean", "null"] },
"Key": {"description": "Key for the ship to", "type": "string"},
"PONumber": { "description": "PO number", "type": ["string", "null"] },
"PaymentMethods": {
"description": "Payment methods for this ship to",
"type": ["array", "null"],
"items": {
"type": "object",
"properties": {
"Amount" : { "description": "Amount for the payment method", "type": ["number", "null"] },
"MethodName": { "description": "Name of the payment method" , "type": ["string", "null"] }
}
}
},
"RushFee": { "description": "Rush fee", "type": ["number", "null"] },
"RushOrder": { "description": "Whether this is a rush order", "type": ["boolean", "null"] },
"ShipToAddress": {
"description": "Ship to address",
"type": ["object", "null"],
"properties": {
"Address1": { "description": "Address line 1 for address", "type": ["string", "null"] },
"Address2": { "description": "Address line 2 for address", "type": ["string", "null"] },
"Address3": { "description": "Address line 3 for address", "type": ["string", "null"] },
"AddressCode": { "description": "Address code for address", "type": ["string", "null"] },
"City": { "description": "City name for address", "type": ["string", "null"] },
"Company": { "description": "Company name for address", "type": ["string", "null"] },
"Country": { "description": "Country name for address", "type": ["string", "null"] },
"EmailAddress": {
"description": "Contact email address for address",
"type": ["string", "null"]
},
"FaxNumber": { "description": "Fax number for address", "type": ["string", "null"] },
"Name": { "description": "Contact name for this address", "type": ["string", "null"] },
"PhoneNumber": { "description": "Phone number for address", "type": ["string", "null"] },
"PostalCode": { "description": "Postal code for address", "type": ["string", "null"] },
"StateProvince": {
"description": "State or province name for address",
"type": ["string", "null"]
}
}
},
"ShippingCarrier": { "description": "Shipping carrier", "type": ["string", "null"] },
"ShippingCost": { "description": "Shipping cost", "type": ["number", "null"] },
"ShippingService": { "description": "Shipping service", "type": ["string", "null"] },
"Status": { "description": "Status", "type": ["string", "null"] },
"ThirdPartyAccountNumber": {
"description": "Third party account number to use for ship method carrier",
"type": ["string", "null"]
}
},
"required": ["Key"]
}
},
"Shipments": {
"description": "Shipments tied to the fulfillment order",
"type": ["array", "null"],
"items": {
"type": "object",
"properties": {
"FulfillmentSystemId": { "description": "Fulfillment system ID", "type": ["string", "null"] },
"FulfillmentSystemLocationId": { "description": "Fulfillment system location ID", "type": ["string", "null"] },
"ShipmentId": { "description": "Shipment ID", "type": ["string", "null"] },
"Carrier": { "description": "Carrier", "type": ["string", "null"] },
"Freight": { "description": "Freight cost", "type": ["number", "null"] },
"IsDeleted": {
"description": "Whether the shipment is deleted",
"type": ["boolean", "null"]
},
"MasterTrackingNumber": { "description": "Master tracking number", "type": ["string", "null"] },
"Packages": {
"description": "Packages in the shipment",
"type": ["array", "null"],
"items": {
"type": "object",
"properties": {
"IsDeleted": { "description": "Whether the package is deleted", "type": ["boolean", "null"] },
"PackageNumber": { "description": "Package number", "type": ["string", "null"] },
"Products": {
"description": "Products in the package",
"type": ["array", "null"],
"items": {
"type": "object",
"properties": {
"ProductLineId": { "description": "Product line ID", "type": ["string", "null"] },
"ShipQuantity" : { "description": "Ship quantity" , "type": ["number", "null"] }
}
}
},
"QuantityInPackage": {
"description": "Quantity of items in the package",
"type": ["integer", "null"]
},
"Reference1": {
"description": "First reference field for the package",
"type": ["string", "null"]
},
"Reference2": {
"description": "Second reference field for the package",
"type": ["string", "null"]
},
"TrackingNumber": { "description": "Tracking number", "type": ["string", "null"] },
"Weight": { "description": "Weight of the package", "type": ["number", "null"] }
}
}
},
"PackingSlipNumber": { "description": "Packing slip number", "type": ["string", "null"] },
"Service": { "description": "Service", "type": ["string", "null"] },
"ShipDateUtc": { "description": "Ship date in UTC", "type": ["string", "null"] },
"ShipToAddress": {
"description": "Ship to address",
"type": ["object", "null"],
"properties": {
"Address1": { "description": "Address line 1 for address", "type": ["string", "null"] },
"Address2": { "description": "Address line 2 for address", "type": ["string", "null"] },
"Address3": { "description": "Address line 3 for address", "type": ["string", "null"] },
"AddressCode": { "description": "Address code for address", "type": ["string", "null"] },
"City": { "description": "City name for address", "type": ["string", "null"] },
"Company": { "description": "Company name for address", "type": ["string", "null"] },
"Country": { "description": "Country name for address", "type": ["string", "null"] },
"EmailAddress": {
"description": "Contact email address for address",
"type": ["string", "null"]
},
"FaxNumber": { "description": "Fax number for address", "type": ["string", "null"] },
"Name": { "description": "Contact name for this address", "type": ["string", "null"] },
"PhoneNumber": { "description": "Phone number for address", "type": ["string", "null"] },
"PostalCode": { "description": "Postal code for address", "type": ["string", "null"] },
"StateProvince": {
"description": "State or province name for address",
"type": ["string", "null"]
}
}
},
"TotalNumberOfPackages": {
"description": "Total number of packages in the shipment",
"type": ["integer", "null"]
}
}
}
},
"Statuses": {
"description": "Statuses tied to the fulfillment order",
"type": ["array", "null"],
"items": {"type": "string"}
}
},
"required": ["FulfillmentOrderId"]
}
},
"required": ["FulfillmentOrder"]
},
{
"type": "object",
"properties": {
"AggregateId": {
"description": "Unique ID for aggregate type within Suite of Brokers",
"type": "string"
},
"CorrelationId": {"description": "Unique ID for SOB-external event trigger", "type": "string"},
"AggregateType": {"description": "Type of event schema", "type": "string"},
"EventActionUser": {
"description": "Username of user who triggered event",
"type": ["string", "null"]
},
"EventDateTimeUtc": {
"description": "UTC based datetime of when event was triggered",
"type": "string"
},
"EventName": {
"description": "Name of triggered event for FulfillmentOrder",
"type": "string",
"enum": [
"Fulfillment Order Created", "Fulfillment Order Updated",
"Fulfillment Order Submitted to Fulfillment System",
"Fulfillment Order Submission Failed",
"Fulfillment Order Update Validation Failed",
"Fulfillment Order Update Request Validated",
"Update Failed to Submit to Fulfillment System"
]
},
"EventNameValuePairs": {
"type": ["array", "null"],
"items": {
"type": "object",
"properties": {
"Name" : { "description": "Name of the name-value pair" , "type": ["string", "null"] },
"Value": { "description": "Value of the name-value pair", "type": ["string", "null"] }
}
}
},
"EventPublisherApp": {
"description": "Name of source application that published event",
"type": "string"
},
"EventSchemaVersion": {"description": "Version of event schema being used", "type": "string"},
"EventSource": {"description": "Name of system where event was triggered", "type": "string"}
},
"required": [
"AggregateId", "AggregateType", "CorrelationId", "EventDateTimeUtc", "EventName",
"EventPublisherApp", "EventSchemaVersion", "EventSource"
]
}
]
}