import 'package:concierge/data/remote/converters/flag_converter.dart';
import 'package:json_annotation/json_annotation.dart';

import 'media_image.dart';
import 'property_area.dart';
import 'property_intro.dart';
import 'reject_message.dart';

part '../../../_generated/data/remote/models/property.g.dart';

@JsonSerializable(fieldRename: FieldRename.snake)
class Property {
  final int id;
  final String name;
  final String domain;
  final String languageCode;
  final String currency;
  final String hotline;
  @FlagConverter()
  final bool showInMenu;
  final String helpBody;
  final String? splashVideo;
  final List<PropertyArea> areas;
  final List<MediaImage> heroImages;
  final MediaImage logoImage;
  final MediaImage profileImage;
  final List<PropertyIntro> intros;
  final List<dynamic> menuItems;
  final List<RejectMessage> rejectMessages;

  const Property({
    required this.id,
    required this.name,
    required this.domain,
    required this.languageCode,
    required this.currency,
    required this.hotline,
    required this.showInMenu,
    required this.helpBody,
    required this.splashVideo,
    required this.areas,
    required this.heroImages,
    required this.logoImage,
    required this.profileImage,
    required this.intros,
    required this.menuItems,
    required this.rejectMessages,
  });

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

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