Files
Dennis Nemec b19a6e1cd4 Initial draft
2025-09-20 16:14:06 +02:00

84 lines
2.0 KiB
Dart

import 'article.dart';
import 'contact_person.dart';
import 'customer.dart';
import 'discount.dart';
import 'image.dart';
import 'note.dart';
import 'payment.dart';
import 'package:json_annotation/json_annotation.dart';
part 'delivery.g.dart';
@JsonSerializable(fieldRename: FieldRename.snake)
class DeliveryOptionDTO {
DeliveryOptionDTO({
required this.numerical,
required this.value,
required this.display,
required this.key,
});
bool numerical;
String value;
String display;
String key;
factory DeliveryOptionDTO.fromJson(Map<String, dynamic> json) =>
_$DeliveryOptionDTOFromJson(json);
Map<dynamic, dynamic> toJson() => _$DeliveryOptionDTOToJson(this);
}
@JsonSerializable(fieldRename: FieldRename.snake)
class DeliveryDTO {
DeliveryDTO({
required this.internalReceiptNo,
required this.specialAggreements,
required this.currency,
required this.notes,
required this.totalPrice,
required this.prepayment,
required this.paymentAtDelivery,
required this.desiredTime,
required this.contactPerson,
required this.articles,
required this.totalNetValue,
required this.totalGrossValue,
required this.images,
required this.customer,
required this.finishedTime,
required this.note,
required this.state,
required this.payment,
required this.carId,
required this.options,
});
String internalReceiptNo;
String? specialAggreements;
CustomerDTO customer;
String totalPrice;
String desiredTime;
String totalGrossValue;
String totalNetValue;
ContactPersonDTO contactPerson;
String? currency;
List<ArticleDTO> articles;
String note;
String finishedTime;
String carId;
String state;
String prepayment;
String paymentAtDelivery;
DiscountDTO? discount;
PaymentMethodDTO payment;
List<NoteDTO> notes;
List<ImageDTO> images;
List<DeliveryOptionDTO> options;
factory DeliveryDTO.fromJson(Map<String, dynamic> json) =>
_$DeliveryDTOFromJson(json);
Map<dynamic, dynamic> toJson() => _$DeliveryDTOToJson(this);
}