You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
car_common_app/lib/models/requests_models/provider_offers_model.dart

78 lines
2.0 KiB
Dart

import 'dart:developer';
import 'package:mc_common_app/models/chat_models/chat_message_model.dart';
class ProviderOffersModel {
int? id;
int? customerID;
int? requestType;
int? requestStatus;
String? brand;
String? model;
int? year;
bool? isNew;
String? description;
double? price;
int? spOfferCount;
List<ServiceProvidersOffers>? serviceProviders;
ProviderOffersModel({
this.id,
this.customerID,
this.requestType,
this.requestStatus,
this.brand,
this.model,
this.year,
this.isNew,
this.description,
this.price,
this.spOfferCount,
this.serviceProviders,
});
ProviderOffersModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
customerID = json['customerID'];
requestType = json['requestType'];
requestStatus = json['requestStatus'];
brand = json['brand'];
model = json['model'];
year = json['year'];
isNew = json['isNew'];
description = json['description'];
price = json['price'];
spOfferCount = json['spOfferCount'];
if (json['serviceProviders'] != null) {
serviceProviders = <ServiceProvidersOffers>[];
json['serviceProviders'].forEach((v) {
serviceProviders!.add(ServiceProvidersOffers.fromJson(v));
});
}
}
}
class ServiceProvidersOffers {
String? providerUserId;
int? providerId;
String? name;
String? mobileNo;
String? email;
String? companyName;
int? offerCount;
List<ChatMessageModel>? chatMessages;
ServiceProvidersOffers({this.providerId, this.name, this.mobileNo, this.email, this.companyName, this.offerCount, this.chatMessages, this.providerUserId});
ServiceProvidersOffers.fromJson(Map<String, dynamic> json) {
providerId = json['providerID'];
providerUserId = json['providerUserId'] ?? "c680271c-b2a7-4ecf-7e95-08db545aec1b"; //TODO Remove this when parameter is added in backend
name = json['name'];
mobileNo = json['mobileNo'];
email = json['email'];
companyName = json['companyName'];
offerCount = json['offerCount'];
chatMessages = [];
}
}