Discount constructor

Discount({
  1. VoucherRuleId? id,
  2. VoucherCode? code,
  3. StringValue? title,
  4. StringValue? decription,
  5. Price? value,
  6. Any? details,
  7. StoredImage? image,
  8. PriceComposition? priceComposition,
  9. Iterable<PriceRule>? priceRules,
  10. PromotionId? promotionId,
})

Implementation

factory Discount({
  $0.VoucherRuleId? id,
  $0.VoucherCode? code,
  $1.StringValue? title,
  $1.StringValue? decription,
  $4.Price? value,
  $11.Any? details,
  $9.StoredImage? image,
  $4.PriceComposition? priceComposition,
  $core.Iterable<$4.PriceRule>? priceRules,
  $0.PromotionId? promotionId,
}) {
  final result = create();
  if (id != null) result.id = id;
  if (code != null) result.code = code;
  if (title != null) result.title = title;
  if (decription != null) result.decription = decription;
  if (value != null) result.value = value;
  if (details != null) result.details = details;
  if (image != null) result.image = image;
  if (priceComposition != null) result.priceComposition = priceComposition;
  if (priceRules != null) result.priceRules.addAll(priceRules);
  if (promotionId != null) result.promotionId = promotionId;
  return result;
}