immich/mobile/lib/domain/models/asset/trashed_asset.model.dart
Peter Ombodi bec1b30554 trashed_local_asset table mirror of local_asset table structure
trashed_local_asset<->local_asset transfer data on move to trash or restore
refactor code
2025-09-24 16:58:56 +03:00

76 lines
1.9 KiB
Dart

import 'package:immich_mobile/domain/models/asset/base_asset.model.dart';
class TrashedAsset {
final String id;
final String name;
final String? volume;
final String albumId;
final String? checksum;
final AssetType type;
final DateTime createdAt;
final DateTime updatedAt;
const TrashedAsset({
required this.id,
required this.name,
required this.albumId,
required this.type,
required this.createdAt,
required this.updatedAt,
this.volume,
this.checksum,
});
TrashedAsset copyWith({
String? id,
String? name,
String? volume,
String? albumId,
String? checksum,
AssetType? type,
DateTime? createdAt,
DateTime? updatedAt,
}) {
return TrashedAsset(
id: id ?? this.id,
name: name ?? this.name,
volume: volume ?? this.volume,
albumId: albumId ?? this.albumId,
checksum: checksum ?? this.checksum,
type: type ?? this.type,
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt,
);
}
@override
String toString() {
return 'TrashedAsset('
'id: $id, '
'name: $name, '
'volume: $volume, '
'albumId: $albumId, '
'checksum: $checksum, '
'type: $type, '
'createdAt: $createdAt, '
'updatedAt: $updatedAt, '
')';
}
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is TrashedAsset &&
runtimeType == other.runtimeType &&
id == other.id &&
name == other.name &&
volume == other.volume &&
albumId == other.albumId &&
checksum == other.checksum &&
type == other.type &&
createdAt == other.createdAt &&
updatedAt == other.updatedAt;
@override
int get hashCode => Object.hash(id, name, volume, albumId, checksum, type, createdAt, updatedAt);
}