data class OrderStatus(
val occurredAt: OffsetDateTime,
/** one of SalesOrderStatus||ShipmentStatus */
val status: String,
val orderNumber: OrderNumber,
val items: List<OrderItem>,
/** just in ShipmentStatus */
val shipmentNumber: String?,
/** just in SalesOrderStatus */
val payments: List<Payment>?
) {
// for a sales order
constructor(
occurredAt: OffsetDateTime,
status: SalesOrderStatus,
orderNumber: OrderNumber,
items: List<OrderItem>,
payments: List<Payment>
) : this( // the following arguments should be generated by the plugin
occurredAt = occurredAt,
orderNumber = orderNumber,
status = status.name, // type mismatch should be ignored, just match names
items = items,
shipmentNumber = null, // if not found in parameter list, just add not the argument, <null> it or add no value add all, just name it
payments = payments
)
}