import 'package:ambito/src/domain/entity/file/thumbnails.dart';
import 'package:isar/isar.dart';
import 'package:json_annotation/json_annotation.dart';

part 'file_part.g.dart';

@JsonSerializable(explicitToJson: true)
@embedded
class FilePart {
  FilePart();

  String? url;
  Thumbnails? thumbnails;
  @JsonKey(name: 'visible_name')
  String? visibleName;
  String? name;
  int? size;
  @JsonKey(name: 'mime_type')
  String? mimeType;
  @JsonKey(name: 'is_image')
  bool? isImage;
  @JsonKey(name: 'image_width')
  int? imageWidth;
  @JsonKey(name: 'image_height')
  int? imageHeight;
  @JsonKey(name: 'uploaded_at')
  String? uploadedAt;

  factory FilePart.fromJson(Map<String, dynamic> json) =>
      _$FilePartFromJson(json);

  Map<String, dynamic> toJson() => _$FilePartToJson(this);
}
