Added Streams to TourRepository

This commit is contained in:
Dennis Nemec
2026-01-03 01:29:21 +01:00
parent edb8676f5a
commit 9111dc92db
43 changed files with 1232 additions and 931 deletions

View File

@ -1,3 +1,5 @@
import 'package:hl_lieferservice/dto/image_note_response.dart';
import 'article.dart';
import 'contact_person.dart';
import 'customer.dart';
@ -73,7 +75,7 @@ class DeliveryDTO {
DiscountDTO? discount;
PaymentMethodDTO payment;
List<NoteDTO> notes;
List<ImageDTO> images;
List<ImageNoteDTO> images;
List<DeliveryOptionDTO> options;
factory DeliveryDTO.fromJson(Map<String, dynamic> json) =>

View File

@ -45,7 +45,7 @@ DeliveryDTO _$DeliveryDTOFromJson(Map<String, dynamic> json) => DeliveryDTO(
totalGrossValue: json['total_gross_value'] as String,
images:
(json['images'] as List<dynamic>)
.map((e) => ImageDTO.fromJson(e as Map<String, dynamic>))
.map((e) => ImageNoteDTO.fromJson(e as Map<String, dynamic>))
.toList(),
customer: CustomerDTO.fromJson(json['customer'] as Map<String, dynamic>),
finishedTime: json['finished_time'] as String,

View File

@ -0,0 +1,18 @@
import 'note.dart';
import 'package:json_annotation/json_annotation.dart';
part 'image_note_response.g.dart';
@JsonSerializable(fieldRename: FieldRename.snake)
class ImageNoteDTO {
final String url;
final String oid;
final String name;
ImageNoteDTO({required this.url, required this.oid, required this.name});
factory ImageNoteDTO.fromJson(Map<String, dynamic> json) =>
_$ImageNoteDTOFromJson(json);
Map<dynamic, dynamic> toJson() => _$ImageNoteDTOToJson(this);
}

View File

@ -0,0 +1,20 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'image_note_response.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
ImageNoteDTO _$ImageNoteDTOFromJson(Map<String, dynamic> json) => ImageNoteDTO(
url: json['url'] as String,
oid: json['oid'] as String,
name: json['name'] as String,
);
Map<String, dynamic> _$ImageNoteDTOToJson(ImageNoteDTO instance) =>
<String, dynamic>{
'url': instance.url,
'oid': instance.oid,
'name': instance.name,
};

View File

@ -1,3 +1,5 @@
import 'package:hl_lieferservice/dto/image_note_response.dart';
import 'note.dart';
import 'package:json_annotation/json_annotation.dart';
@ -6,9 +8,10 @@ part 'note_get_response.g.dart';
@JsonSerializable(fieldRename: FieldRename.snake)
class NoteGetResponseDTO {
NoteGetResponseDTO(
{required this.notes, required this.succeeded, required this.message});
{required this.notes, required this.succeeded, required this.message, required this.images});
final List<NoteDTO> notes;
final List<ImageNoteDTO> images;
final bool succeeded;
final String message;

View File

@ -14,11 +14,16 @@ NoteGetResponseDTO _$NoteGetResponseDTOFromJson(Map<String, dynamic> json) =>
.toList(),
succeeded: json['succeeded'] as bool,
message: json['message'] as String,
images:
(json['images'] as List<dynamic>)
.map((e) => ImageNoteDTO.fromJson(e as Map<String, dynamic>))
.toList(),
);
Map<String, dynamic> _$NoteGetResponseDTOToJson(NoteGetResponseDTO instance) =>
<String, dynamic>{
'notes': instance.notes,
'images': instance.images,
'succeeded': instance.succeeded,
'message': instance.message,
};