import 'article.dart'; import 'basic_response.dart'; import 'package:json_annotation/json_annotation.dart'; part 'discount_add_response.g.dart'; @JsonSerializable(fieldRename: FieldRename.snake) class PriceInformation { PriceInformation({required this.net, required this.gross}); double net; double gross; factory PriceInformation.fromJson(Map json) => _$PriceInformationFromJson(json); Map toJson() => _$PriceInformationToJson(this); } @JsonSerializable(fieldRename: FieldRename.snake) class NoteInformation { NoteInformation({required this.rowId, required this.noteDescription}); String rowId; String noteDescription; factory NoteInformation.fromJson(Map json) => _$NoteInformationFromJson(json); Map toJson() => _$NoteInformationToJson(this); } @JsonSerializable(fieldRename: FieldRename.snake) class UpdatedValues { UpdatedValues( {required this.discount, required this.receipt, required this.article, required this.note}); PriceInformation discount; PriceInformation receipt; NoteInformation note; ArticleDTO article; factory UpdatedValues.fromJson(Map json) => _$UpdatedValuesFromJson(json); Map toJson() => _$UpdatedValuesToJson(this); } @JsonSerializable(fieldRename: FieldRename.snake) class DiscountAddResponseDTO extends BasicResponseDTO { DiscountAddResponseDTO( {required this.values, required super.succeeded, required super.message}); UpdatedValues values; factory DiscountAddResponseDTO.fromJson(Map json) => _$DiscountAddResponseDTOFromJson(json); Map toJson() => _$DiscountAddResponseDTOToJson(this); }