Files
Holzleitner-Lieferservice-App/lib/dto/discount_add_response.dart
Dennis Nemec b19a6e1cd4 Initial draft
2025-09-20 16:14:06 +02:00

64 lines
1.7 KiB
Dart

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<String, dynamic> json) =>
_$PriceInformationFromJson(json);
Map<dynamic, dynamic> toJson() => _$PriceInformationToJson(this);
}
@JsonSerializable(fieldRename: FieldRename.snake)
class NoteInformation {
NoteInformation({required this.rowId, required this.noteDescription});
String rowId;
String noteDescription;
factory NoteInformation.fromJson(Map<String, dynamic> json) =>
_$NoteInformationFromJson(json);
Map<dynamic, dynamic> 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<String, dynamic> json) =>
_$UpdatedValuesFromJson(json);
Map<dynamic, dynamic> 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<String, dynamic> json) =>
_$DiscountAddResponseDTOFromJson(json);
Map<dynamic, dynamic> toJson() => _$DiscountAddResponseDTOToJson(this);
}