import 'package:freezed_annotation/freezed_annotation.dart';

part 'steward_free_bar.freezed.dart';
part 'steward_free_bar.g.dart';

@freezed
abstract class StewardFreeBar with _$StewardFreeBar {
  const factory StewardFreeBar({
    int? id,
    Steward? steward,
    dynamic guild,
    Product? product,
    String? key,
    String? createDate,
    String? modifyDate,
    bool? trash,
    String? killHouseName,
    String? killHouseMobile,
    String? killHouseVetName,
    String? killHouseVetMobile,
    String? province,
    String? city,
    String? driverName,
    String? driverMobile,
    dynamic car,
    String? pelak,
    int? numberOfCarcasses,
    double? weightOfCarcasses,
    String? barImage,
    String? date,
    bool? temporaryTrash,
    bool? temporaryDeleted,
    String? createdBy,
    String? modifiedBy,
  }) = _StewardFreeBar;

  factory StewardFreeBar.fromJson(Map<String, dynamic> json) =>
      _$StewardFreeBarFromJson(json);
}

@freezed
abstract class Steward with _$Steward {
  const factory Steward({
    User? user,
    String? guildsName,
    bool? steward,
    int? allocationLimit,
    Address? address,
    String? licenseNumber,
    String? typeActivity,
    String? areaActivity,
    String? guildsId,
    String? createDate,
  }) = _Steward;

  factory Steward.fromJson(Map<String, dynamic> json) => _$StewardFromJson(json);
}

@freezed
abstract class User with _$User {
  const factory User({
    String? fullname,
    String? firstName,
    String? lastName,
    int? baseOrder,
    String? mobile,
    String? nationalId,
    String? nationalCode,
    String? key,
    City? city,
    String? unitName,
    String? unitNationalId,
    String? unitRegistrationNumber,
    String? unitEconomicalNumber,
    String? unitProvince,
    String? unitCity,
    String? unitPostalCode,
    String? unitAddress,
  }) = _User;

  factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
}

@freezed
abstract class City with _$City {
  const factory City({
    int? id,
    String? key,
    String? createDate,
    String? modifyDate,
    bool? trash,
    int? provinceIdForeignKey,
    int? cityIdKey,
    String? name,
    double? productPrice,
    bool? provinceCenter,
    int? cityNumber,
    String? cityName,
    int? provinceNumber,
    String? provinceName,
    String? createdBy,
    String? modifiedBy,
    int? province,
  }) = _City;

  factory City.fromJson(Map<String, dynamic> json) => _$CityFromJson(json);
}

@freezed
abstract class Address with _$Address {
  const factory Address({
    Province? province,
    City? city,
    String? address,
    String? postalCode,
  }) = _Address;

  factory Address.fromJson(Map<String, dynamic> json) => _$AddressFromJson(json);
}

@freezed
abstract class Province with _$Province {
  const factory Province({
    String? key,
    String? name,
  }) = _Province;

  factory Province.fromJson(Map<String, dynamic> json) =>
      _$ProvinceFromJson(json);
}

@freezed
abstract class Product with _$Product {
  const factory Product({
    String? key,
    String? name,
  }) = _Product;

  factory Product.fromJson(Map<String, dynamic> json) => _$ProductFromJson(json);
}