cleanup and added unit tests

This commit is contained in:
verboomp
2026-01-27 14:09:12 +01:00
parent 3d456128b1
commit e4b2dd0462
42 changed files with 1467 additions and 977 deletions

View File

@@ -1,3 +1,4 @@
import 'package:fotodocumentation/dto/picture_dto.dart';
import 'package:fotodocumentation/utils/date_time_utils.dart';
class CustomerListDto {
@@ -38,28 +39,4 @@ class CustomerDto {
}
}
class PictureDto {
final int id;
final String? comment;
final String? category;
final String image;
final DateTime pictureDate;
final String? username;
final CustomerListDto customerListDto;
PictureDto(
{required this.id, required this.comment, required this.category, required this.image, required this.pictureDate, required this.username, required this.customerListDto});
/// Create from JSON response
factory PictureDto.fromJson(Map<String, dynamic> json) {
return PictureDto(
id: json['id'] as int,
comment: json['comment'] as String?,
category: json['category'] as String?,
image: json['image'] as String,
pictureDate: DateTimeUtils.toDateTime(json['pictureDate']) ?? DateTime.now(),
username: json['username'] as String?,
customerListDto: CustomerListDto.fromJson(json['customer']),
);
}
}