import 'package:mc_common_app/extensions/string_extensions.dart';
import 'package:mc_common_app/utils/enums.dart';

class ProviderOffersChatsModel {
  int? id;
  int? requestID;
  int? serviceProviderID;
  ServiceProviderModel? serviceProvider;
  int? offerStatus;
  RequestOfferStatusEnum? requestOfferStatusEnum;
  String? offerStatusText;
  String? comment;
  String? customerName;
  double? price;
  String? serviceItem;
  String? offeredItemCreatedBy;
  String? offeredItemCreatedByName;
  String? offeredItemCreatedOn;
  String? reqOfferImages;
  bool? isDeliveryAvailable;
  String? createdOn;

  ProviderOffersChatsModel({
    this.id,
    this.requestID,
    this.serviceProviderID,
    this.serviceProvider,
    this.offerStatus,
    this.requestOfferStatusEnum,
    this.offerStatusText,
    this.comment,
    this.customerName,
    this.price,
    this.serviceItem,
    this.offeredItemCreatedBy,
    this.offeredItemCreatedByName,
    this.offeredItemCreatedOn,
    this.reqOfferImages,
    this.isDeliveryAvailable,
    this.createdOn,
  });

  ProviderOffersChatsModel.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    requestID = json['requestID'];
    serviceProviderID = json['serviceProviderID'];
    serviceProvider = json['serviceProvider'] != null ? ServiceProviderModel.fromJson(json['serviceProvider']) : null;
    offerStatus = json['offerStatus'];
    requestOfferStatusEnum = ((json['offerStatus']) as int).toRequestOfferStatusEnum();
    offerStatusText = json['offerStatusText'];
    comment = json['comment'];
    customerName = json['customerName'];
    price = json['price'];
    serviceItem = json['serviceItem'];
    offeredItemCreatedBy = json['offeredItemCreatedBy'];
    offeredItemCreatedByName = json['offeredItemCreatedByName'];
    offeredItemCreatedOn = json['offeredItemCreatedOn'];
    reqOfferImages = json['reqOfferImages'];
    isDeliveryAvailable = json['isDeliveryAvailable'];
    createdOn = json['createdOn'];
  }
}

class ServiceProviderModel {
  int? providerId;
  String? providerGUID;
  String? firstName;
  String? lastName;
  String? name;
  int? gender;
  String? genderName;
  String? mobileNo;
  String? email;
  bool? isEmailVerified;
  bool? isCompleted;
  int? city;
  String? cityName;
  int? country;
  String? countryName;
  int? accountStatus;
  String? accountStatusText;
  int? activityStatus;
  String? activityStatusText;
  String? bankName;
  String? iBanNo;
  bool? isActive;
  String? subscriptionDate;
  String? createdOn;
  String? companyName;
  String? currency;
  String? branch;
  bool? isChatted;
  bool? isDealership;

  ServiceProviderModel({
    this.providerId,
    this.providerGUID,
    this.firstName,
    this.lastName,
    this.name,
    this.gender,
    this.genderName,
    this.mobileNo,
    this.email,
    this.isEmailVerified,
    this.isCompleted,
    this.city,
    this.cityName,
    this.country,
    this.countryName,
    this.accountStatus,
    this.accountStatusText,
    this.activityStatus,
    this.activityStatusText,
    this.bankName,
    this.iBanNo,
    this.isActive,
    this.subscriptionDate,
    this.createdOn,
    this.companyName,
    this.currency,
    this.branch,
    this.isChatted,
    this.isDealership,
  });

  ServiceProviderModel.fromJson(Map<String, dynamic> json) {
    providerId = json['providerId'];
    providerGUID = json['providerGUID'];
    firstName = json['firstName'];
    lastName = json['lastName'];
    name = json['name'];
    gender = json['gender'];
    genderName = json['genderName'];
    mobileNo = json['mobileNo'];
    email = json['email'];
    isEmailVerified = json['isEmailVerfied'];
    isCompleted = json['isCompleted'];
    city = json['city'];
    cityName = json['cityName'];
    country = json['country'];
    countryName = json['countryName'];
    accountStatus = json['accountStatus'];
    accountStatusText = json['accountStatusText'];
    activityStatus = json['activityStatus'];
    activityStatusText = json['activityStatusText'];
    bankName = json['bankName'];
    iBanNo = json['iBanNo'];
    isActive = json['isActive'];
    subscriptionDate = json['subscriptionDate'];
    createdOn = json['createdOn'];
    companyName = json['companyName'];
    currency = json['currency'];
    branch = json['branch'];
    isChatted = json['isChatted'];
    isDealership = json['isDealership'];
  }
}
