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.
96 lines
2.3 KiB
Dart
96 lines
2.3 KiB
Dart
import 'package:test_sa/models/lookup.dart';
|
|
import 'package:test_sa/models/new_models/building.dart';
|
|
import 'package:test_sa/models/new_models/site.dart';
|
|
|
|
class LoanFormModel {
|
|
String? docName;
|
|
String? docNumber;
|
|
String? docEmail;
|
|
String? itemDescription;
|
|
String? requestDescription;
|
|
String? model;
|
|
String? manufacturer;
|
|
Lookup? loanProvided;
|
|
String? vendorName;
|
|
String? vendorRepresentativeName;
|
|
String? vendorNumber;
|
|
String? vendorEmail;
|
|
Site? site;
|
|
Building? building;
|
|
List<LoanAttachments>? loanAttachment;
|
|
|
|
LoanFormModel({
|
|
this.docName,
|
|
this.docNumber,
|
|
this.docEmail,
|
|
this.itemDescription,
|
|
this.requestDescription,
|
|
this.model,
|
|
this.manufacturer,
|
|
this.loanProvided,
|
|
this.vendorName,
|
|
this.vendorRepresentativeName,
|
|
this.vendorNumber,
|
|
this.vendorEmail,
|
|
this.loanAttachment,
|
|
this.site,
|
|
this.building,
|
|
});
|
|
|
|
Map<String, dynamic> toJson() {
|
|
return {
|
|
"docName": docName,
|
|
"docNumber": docNumber,
|
|
"docEmail": docEmail,
|
|
"itemDescription": itemDescription,
|
|
"requestDescription": requestDescription,
|
|
"model": model,
|
|
"manufacturer": manufacturer,
|
|
"loanProvided": loanProvided?.toJson(),
|
|
"vendorName": vendorName,
|
|
"vendorRepresentativeName": vendorRepresentativeName,
|
|
"vendorNumber": vendorNumber,
|
|
"vendorEmail": vendorEmail,
|
|
'site' : site?.toJson(),
|
|
'building' : building?.toJson(),
|
|
"loanAttachment": loanAttachment != null ? loanAttachment!.map((v) => v.toJson()).toList() : [],
|
|
};
|
|
}
|
|
}
|
|
class LoanAttachments {
|
|
LoanAttachments({
|
|
this.id,
|
|
this.name,
|
|
this.originalName,
|
|
});
|
|
|
|
LoanAttachments.fromJson(dynamic json) {
|
|
id = json['id'];
|
|
name = json['name'];
|
|
originalName = json['originalName'];
|
|
}
|
|
|
|
num? id;
|
|
String? name;
|
|
String? originalName;
|
|
|
|
LoanAttachments copyWith({
|
|
num? id, // Parameter is now nullable
|
|
String? name, // Parameter is now nullable
|
|
String? originalName, // Parameter is now nullable
|
|
}) =>
|
|
LoanAttachments(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
originalName: originalName ?? this.originalName,
|
|
);
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final map = <String, dynamic>{};
|
|
map['id'] = id;
|
|
map['name'] = name;
|
|
map['originalName'] = originalName;
|
|
return map;
|
|
}
|
|
}
|