import 'package:json_annotation/json_annotation.dart';
import '../converters/flag_converter.dart';
import 'area_category.dart';
import 'promotion.dart';
import 'property_event.dart';
part '../../../_generated/data/remote/models/area_details.g.dart';
@JsonSerializable(fieldRename: FieldRename.snake)
class AreaDetails {
final int id;
final String name;
final String pickupText;
final String deliveryText;
@FlagConverter()
final bool isOpen;
@FlagConverter()
final bool isMeetingArea;
@FlagConverter()
final bool isGuestArea;
@FlagConverter()
final bool isPrearrivalArea;
final String theme;
/// Note: in some endpoints this is a string like "BED"; in others it may be a URL.
final String icon;
final int? deliveryPrice;
@FlagConverter()
final bool isDeliveryDefault;
@FlagConverter()
final bool hasDelivery;
final List<PropertyEvent> events;
final bool skipLocation;
final List<AreaCategory> categories;
final Promotion promotion;
final List<dynamic> deliveryTimes;
final List<dynamic> supportItems;
const AreaDetails({
required this.id,
required this.name,
required this.pickupText,
required this.deliveryText,
required this.isOpen,
required this.isMeetingArea,
required this.isGuestArea,
required this.isPrearrivalArea,
required this.theme,
required this.icon,
required this.deliveryPrice,
required this.isDeliveryDefault,
required this.hasDelivery,
required this.events,
required this.skipLocation,
required this.categories,
required this.promotion,
required this.deliveryTimes,
required this.supportItems,
});
factory AreaDetails.fromJson(Map<String, dynamic> json) => _$AreaDetailsFromJson(json);
Map<String, dynamic> toJson() => _$AreaDetailsToJson(this);
}