copyWith method

DVSale copyWith({
  1. DVSaleStatus? status,
  2. String? chargeReference,
  3. DVMoney? refunded,
  4. DVMoney? taxRefunded,
  5. DateTime? revokedAt,
  6. bool clearRevokedAt = false,
})

Implementation

DVSale copyWith({
  DVSaleStatus? status,
  String? chargeReference,
  DVMoney? refunded,
  DVMoney? taxRefunded,
  DateTime? revokedAt,
  bool clearRevokedAt = false,
}) =>
    DVSale(
      id: id,
      customerKey: customerKey,
      lines: lines,
      subtotal: subtotal,
      discount: discount,
      tax: tax,
      total: total,
      behavior: behavior,
      taxSource: taxSource,
      taxJurisdiction: taxJurisdiction,
      taxReference: taxReference,
      promotions: promotions,
      entitlements: entitlements,
      createdAt: createdAt,
      status: status ?? this.status,
      chargeReference: chargeReference ?? this.chargeReference,
      refunded: refunded ?? this.refunded,
      taxRefunded: taxRefunded ?? this.taxRefunded,
      revokedAt: clearRevokedAt ? null : revokedAt ?? this.revokedAt,
    );