Compare commits
34 Commits
v.1.9.4
...
main_produ
| Author | SHA1 | Date |
|---|---|---|
|
|
7c6443185d | 3 weeks ago |
|
|
f9f1728abf | 3 weeks ago |
|
|
bce5691b13 | 3 weeks ago |
|
|
08d8bd9304 | 3 weeks ago |
|
|
50df0fb5b8 | 3 weeks ago |
|
|
7490544084 | 3 weeks ago |
|
|
a9000de678 | 4 weeks ago |
|
|
4218acb4b8 | 4 weeks ago |
|
|
494d9ba8d7 | 4 weeks ago |
|
|
2ab2abd693 | 4 weeks ago |
|
|
e4a09fed1f | 4 weeks ago |
|
|
072953a3a7 | 4 weeks ago |
|
|
85bcc1a0ea | 2 months ago |
|
|
fa254ca73b | 2 months ago |
|
|
709b8a699b | 2 months ago |
|
|
4bdb5c2da3 | 2 months ago |
|
|
e1f52b9925 | 2 months ago |
|
|
4ca6862f3b | 2 months ago |
|
|
3eb1088b94 | 2 months ago |
|
|
fac7b92711 | 2 months ago |
|
|
a01f40e20d | 2 months ago |
|
|
3ebb1d7fab | 2 months ago |
|
|
f3722e3671 | 2 months ago |
|
|
2304700fb8 | 2 months ago |
|
|
9f76874217 | 2 months ago |
|
|
55f39fadbc | 2 months ago |
|
|
448a85522a | 2 months ago |
|
|
dd644732c9 | 3 months ago |
|
|
56322d8db3 | 3 months ago |
|
|
392136dbe4 | 3 months ago |
|
|
1d4ed83a4b | 3 months ago |
|
|
9fbb2efa55 | 3 months ago |
|
|
3412345a4a | 3 months ago |
|
|
63d4c79a73 | 3 months ago |
@ -1,30 +1,39 @@
|
||||
class AssetTransferAttachment {
|
||||
AssetTransferAttachment({
|
||||
this.id,
|
||||
this.attachmentName,
|
||||
});
|
||||
|
||||
AssetTransferAttachment.fromJson(dynamic json) {
|
||||
id = json['id'];
|
||||
attachmentName = json['attachmentName'];
|
||||
}
|
||||
|
||||
num? id; // Now nullable
|
||||
String? attachmentName; // Now nullable
|
||||
|
||||
AssetTransferAttachment copyWith({
|
||||
num? id, // Parameter is now nullable
|
||||
String? attachmentName, // Parameter is now nullable
|
||||
}) =>
|
||||
AssetTransferAttachment(
|
||||
id: id ?? this.id,
|
||||
attachmentName: attachmentName ?? this.attachmentName,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final map = <String, dynamic>{};
|
||||
map['id'] = id;
|
||||
map['attachmentName'] = attachmentName;
|
||||
return map;
|
||||
}
|
||||
}
|
||||
//TODO: need to remove this class
|
||||
// import 'package:test_sa/models/lookup.dart';
|
||||
//
|
||||
// class AssetTransferAttachment {
|
||||
// AssetTransferAttachment({
|
||||
// this.id,
|
||||
// this.attachmentName,
|
||||
// this.documentType,
|
||||
//
|
||||
// });
|
||||
//
|
||||
// AssetTransferAttachment.fromJson(dynamic json) {
|
||||
// id = json['id'];
|
||||
// attachmentName = json['attachmentName'];
|
||||
// }
|
||||
//
|
||||
// num? id; // Now nullable
|
||||
// String? attachmentName; // Now nullable
|
||||
// Lookup ? documentType;
|
||||
//
|
||||
// AssetTransferAttachment copyWith({
|
||||
// num? id, // Parameter is now nullable
|
||||
// String? attachmentName, // Parameter is now nullable
|
||||
// Lookup? documentType, // Parameter is now nullable
|
||||
// }) =>
|
||||
// AssetTransferAttachment(
|
||||
// id: id ?? this.id,
|
||||
// attachmentName: attachmentName ?? this.attachmentName,
|
||||
// documentType: documentType ?? this.documentType,
|
||||
// );
|
||||
//
|
||||
// Map<String, dynamic> toJson() {
|
||||
// final map = <String, dynamic>{};
|
||||
// map['id'] = id;
|
||||
// map['attachmentName'] = attachmentName;
|
||||
// map['documentTypeId'] = documentType?.id;
|
||||
// return map;
|
||||
// }
|
||||
// }
|
||||
|
||||
@ -0,0 +1,213 @@
|
||||
|
||||
enum RequestAttachmentTypeEnum {
|
||||
correctiveMaintenance, // 1
|
||||
gasRefill, // 2
|
||||
transferAsset, // 3
|
||||
preventiveMaintenance, // 4
|
||||
recurrentWo, // 5
|
||||
taskRequest, // 6
|
||||
recallAndAlert, // 7
|
||||
assetInventory, // 8
|
||||
assessmentOfNeedAndTechnology, // 9
|
||||
equipmentInternalAudit, // 10
|
||||
systemInternalAudit, // 11
|
||||
loanEquipment, // 12
|
||||
assetDelivery, // 13
|
||||
medicalGasInspection, // 14
|
||||
demo, // 15
|
||||
incidents, // 16
|
||||
sparePartActivity, // 17
|
||||
updateDeliveryNotes, // 18
|
||||
traf,//19
|
||||
ppmSparePartActivity// 20
|
||||
}
|
||||
|
||||
extension RequestAttachmentTypeEnumExtension on RequestAttachmentTypeEnum {
|
||||
int get id {
|
||||
switch (this) {
|
||||
case RequestAttachmentTypeEnum.correctiveMaintenance:
|
||||
return 1;
|
||||
case RequestAttachmentTypeEnum.gasRefill:
|
||||
return 2;
|
||||
case RequestAttachmentTypeEnum.transferAsset:
|
||||
return 3;
|
||||
case RequestAttachmentTypeEnum.preventiveMaintenance:
|
||||
return 4;
|
||||
case RequestAttachmentTypeEnum.recurrentWo:
|
||||
return 5;
|
||||
case RequestAttachmentTypeEnum.taskRequest:
|
||||
return 6;
|
||||
case RequestAttachmentTypeEnum.recallAndAlert:
|
||||
return 7;
|
||||
case RequestAttachmentTypeEnum.assetInventory:
|
||||
return 8;
|
||||
case RequestAttachmentTypeEnum.assessmentOfNeedAndTechnology:
|
||||
return 9;
|
||||
case RequestAttachmentTypeEnum.equipmentInternalAudit:
|
||||
return 10;
|
||||
case RequestAttachmentTypeEnum.systemInternalAudit:
|
||||
return 11;
|
||||
case RequestAttachmentTypeEnum.loanEquipment:
|
||||
return 12;
|
||||
case RequestAttachmentTypeEnum.assetDelivery:
|
||||
return 13;
|
||||
case RequestAttachmentTypeEnum.medicalGasInspection:
|
||||
return 14;
|
||||
case RequestAttachmentTypeEnum.demo:
|
||||
return 15;
|
||||
case RequestAttachmentTypeEnum.incidents:
|
||||
return 16;
|
||||
case RequestAttachmentTypeEnum.sparePartActivity:
|
||||
return 17;
|
||||
case RequestAttachmentTypeEnum.updateDeliveryNotes:
|
||||
return 18;
|
||||
case RequestAttachmentTypeEnum.traf:
|
||||
return 19;
|
||||
case RequestAttachmentTypeEnum.ppmSparePartActivity:
|
||||
return 20;
|
||||
}
|
||||
}
|
||||
int get lookupEnumId {
|
||||
switch (this) {
|
||||
///values with 0 we need to check with backend team for the correct lookupEnumId
|
||||
case RequestAttachmentTypeEnum.correctiveMaintenance:
|
||||
return 40305;
|
||||
case RequestAttachmentTypeEnum.gasRefill:
|
||||
return 40307;
|
||||
case RequestAttachmentTypeEnum.transferAsset:
|
||||
return 40304;
|
||||
case RequestAttachmentTypeEnum.preventiveMaintenance:
|
||||
return 40313;
|
||||
case RequestAttachmentTypeEnum.recurrentWo:
|
||||
return 40314;
|
||||
case RequestAttachmentTypeEnum.taskRequest:
|
||||
return 40317;
|
||||
case RequestAttachmentTypeEnum.recallAndAlert:
|
||||
return 40316;
|
||||
case RequestAttachmentTypeEnum.assetInventory:
|
||||
return 40303;
|
||||
case RequestAttachmentTypeEnum.assessmentOfNeedAndTechnology:
|
||||
return 40319;
|
||||
case RequestAttachmentTypeEnum.equipmentInternalAudit:
|
||||
return 40323;
|
||||
case RequestAttachmentTypeEnum.systemInternalAudit:
|
||||
return 40322;
|
||||
case RequestAttachmentTypeEnum.loanEquipment:
|
||||
return 3053;
|
||||
case RequestAttachmentTypeEnum.assetDelivery:
|
||||
return 5009;
|
||||
case RequestAttachmentTypeEnum.medicalGasInspection:
|
||||
return 3012;
|
||||
case RequestAttachmentTypeEnum.demo:
|
||||
return 4106;
|
||||
case RequestAttachmentTypeEnum.incidents:
|
||||
return 40308;
|
||||
case RequestAttachmentTypeEnum.sparePartActivity:
|
||||
return 40321;
|
||||
case RequestAttachmentTypeEnum.ppmSparePartActivity:
|
||||
return 4021;
|
||||
case RequestAttachmentTypeEnum.updateDeliveryNotes:
|
||||
return 40309;
|
||||
case RequestAttachmentTypeEnum.traf:
|
||||
return 40319;
|
||||
}
|
||||
}
|
||||
// String getName(BuildContext context) {
|
||||
// switch (this) {
|
||||
// case RequestTypeEnum.correctiveMaintenance:
|
||||
// return context.translation.correctiveMaintenance;
|
||||
// case RequestTypeEnum.gasRefill:
|
||||
// return context.translation.gasRefill;
|
||||
// case RequestTypeEnum.transferAsset:
|
||||
// return context.translation.transferAsset;
|
||||
// case RequestTypeEnum.preventiveMaintenance:
|
||||
// return context.translation.preventiveMaintenance;
|
||||
// case RequestTypeEnum.recurrentWo:
|
||||
// return context.translation.recurrentWo;
|
||||
// case RequestTypeEnum.taskRequest:
|
||||
// return context.translation.taskRequest;
|
||||
// case RequestTypeEnum.recallAndAlert:
|
||||
// return 'Recall and Alert';
|
||||
// case RequestTypeEnum.assetInventory:
|
||||
// return 'Asset Inventory';
|
||||
// case RequestTypeEnum.assessmentOfNeedAndTechnology:
|
||||
// return 'Assessment of Need & Technology';
|
||||
// case RequestTypeEnum.equipmentInternalAudit:
|
||||
// return 'Equipment Internal Audit';
|
||||
// case RequestTypeEnum.systemInternalAudit:
|
||||
// return 'System Internal Audit';
|
||||
// case RequestTypeEnum.loanEquipment:
|
||||
// return 'Loan Equipment';
|
||||
// case RequestTypeEnum.assetDelivery:
|
||||
// return 'Asset Delivery';
|
||||
// case RequestTypeEnum.medicalGasInspection:
|
||||
// return 'Medical Gas Inspection';
|
||||
// case RequestTypeEnum.demo:
|
||||
// return 'Demo';
|
||||
// case RequestTypeEnum.incidents:
|
||||
// return 'Incidents';
|
||||
// case RequestTypeEnum.sparePartActivity:
|
||||
// return 'Spare Part Activity';
|
||||
// case RequestTypeEnum.updateDeliveryNotes:
|
||||
// return 'Update Delivery Notes';
|
||||
// case RequestTypeEnum.traf:
|
||||
// return 'Traf';
|
||||
// }
|
||||
// }
|
||||
|
||||
static RequestAttachmentTypeEnum? fromId(int? id) {
|
||||
if (id == null) return null;
|
||||
switch (id) {
|
||||
case 1:
|
||||
return RequestAttachmentTypeEnum.correctiveMaintenance;
|
||||
case 2:
|
||||
return RequestAttachmentTypeEnum.gasRefill;
|
||||
case 3:
|
||||
return RequestAttachmentTypeEnum.transferAsset;
|
||||
case 4:
|
||||
return RequestAttachmentTypeEnum.preventiveMaintenance;
|
||||
case 5:
|
||||
return RequestAttachmentTypeEnum.recurrentWo;
|
||||
case 6:
|
||||
return RequestAttachmentTypeEnum.taskRequest;
|
||||
case 7:
|
||||
return RequestAttachmentTypeEnum.recallAndAlert;
|
||||
case 8:
|
||||
return RequestAttachmentTypeEnum.assetInventory;
|
||||
case 9:
|
||||
return RequestAttachmentTypeEnum.assessmentOfNeedAndTechnology;
|
||||
case 10:
|
||||
return RequestAttachmentTypeEnum.equipmentInternalAudit;
|
||||
case 11:
|
||||
return RequestAttachmentTypeEnum.systemInternalAudit;
|
||||
case 12:
|
||||
return RequestAttachmentTypeEnum.loanEquipment;
|
||||
case 13:
|
||||
return RequestAttachmentTypeEnum.assetDelivery;
|
||||
case 14:
|
||||
return RequestAttachmentTypeEnum.medicalGasInspection;
|
||||
case 15:
|
||||
return RequestAttachmentTypeEnum.demo;
|
||||
case 16:
|
||||
return RequestAttachmentTypeEnum.incidents;
|
||||
case 17:
|
||||
return RequestAttachmentTypeEnum.sparePartActivity;
|
||||
case 18:
|
||||
return RequestAttachmentTypeEnum.updateDeliveryNotes;
|
||||
case 19:
|
||||
return RequestAttachmentTypeEnum.traf;
|
||||
case 20:
|
||||
return RequestAttachmentTypeEnum.ppmSparePartActivity;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
// static String getNameFromId(int id, BuildContext context) {
|
||||
// final requestType = fromId(id);
|
||||
// return requestType?.getName(context) ?? "Type $id";
|
||||
// }
|
||||
static int? getLookupEnumIdFromId(int? id) {
|
||||
final requestType = fromId(id);
|
||||
return requestType?.lookupEnumId;
|
||||
}
|
||||
}
|
||||
@ -1,33 +1,358 @@
|
||||
import 'dart:io';
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:test_sa/controllers/api_routes/urls.dart';
|
||||
import 'package:test_sa/models/lookup.dart';
|
||||
|
||||
|
||||
class GenericAttachmentModel {
|
||||
GenericAttachmentModel({this.id, this.name, this.originalName, this.createdBy, this.documentTypeId});
|
||||
GenericAttachmentModel({
|
||||
this.id,
|
||||
this.name,
|
||||
this.module,
|
||||
this.subModule,
|
||||
this.uploadedBy,
|
||||
this.originalName,
|
||||
this.createdBy,
|
||||
this.documentType,
|
||||
this.attachmentDescription,
|
||||
this.attachmentURL,
|
||||
this.moduleReferenceId,
|
||||
this.attachmentTypeId,
|
||||
this.createdDate,
|
||||
this.modifiedBy,
|
||||
this.modifiedDate,
|
||||
this.supplierId,
|
||||
});
|
||||
|
||||
int? id;
|
||||
String? name;
|
||||
String? module;
|
||||
String? subModule;
|
||||
String? uploadedBy;
|
||||
String? createdBy;
|
||||
String? originalName;
|
||||
Lookup? documentTypeId;
|
||||
Lookup? documentType;
|
||||
String? attachmentDescription;
|
||||
String? attachmentURL;
|
||||
num? moduleReferenceId;
|
||||
num? attachmentTypeId;
|
||||
String? createdDate;
|
||||
String? modifiedBy;
|
||||
String? modifiedDate;
|
||||
num? supplierId;
|
||||
|
||||
GenericAttachmentModel.fromJson(Map<String, dynamic> json, {bool convertToLink = false}) {
|
||||
id = json['id'];
|
||||
name = json['name'] ?? json['imageName'];
|
||||
name = json['name'] ?? json['attachmentName'] ?? json['imageName'];
|
||||
createdBy = json['createdBy'];
|
||||
documentType = json['attachmentType'] != null ? Lookup.fromJson(json['attachmentType']) : null;
|
||||
originalName = json['originalName'] ?? json['imageOriginalName'];
|
||||
if (convertToLink) {
|
||||
name = URLs.getFileUrl(name);
|
||||
}
|
||||
}
|
||||
|
||||
GenericAttachmentModel.fromAssetDocumentJson(Map<String, dynamic> json, {bool convertToLink = false}) {
|
||||
id = json['id'];
|
||||
name = json['attachmentName'] ?? json['name'] ?? json['imageName'];
|
||||
module = json['module'];
|
||||
subModule = json['subModule'];
|
||||
createdBy = json['createdBy'];
|
||||
createdDate = json['createdDate'];
|
||||
uploadedBy = json['uploadedBy'];
|
||||
originalName = json['originalName'] ?? json['imageOriginalName'];
|
||||
documentType = json['attachmentType'] != null ? Lookup(name: json['attachmentType'], id: 0) : null;
|
||||
if (convertToLink && name != null) {
|
||||
name = URLs.getFileUrl(name);
|
||||
}
|
||||
}
|
||||
|
||||
GenericAttachmentModel.fromWorkOrderJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
documentType = json['attachmentType'] != null ? Lookup.fromJson(json['attachmentType']) : null;
|
||||
createdBy = json['createdBy'];
|
||||
}
|
||||
|
||||
GenericAttachmentModel.fromLoanJson(Map<String, dynamic> json) {
|
||||
id = json['id']?.toInt();
|
||||
name = json['attachmentName'];
|
||||
attachmentDescription = json['attachmentDescription'];
|
||||
documentType = json['documentType'] != null ? Lookup.fromJson(json['documentType']) : null;
|
||||
moduleReferenceId = json['loanId'];
|
||||
attachmentTypeId = json['loanAttachmentTypeId'];
|
||||
}
|
||||
|
||||
GenericAttachmentModel.fromLoanDetailJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['attachmentName'];
|
||||
attachmentDescription = json['attachmentDescription'];
|
||||
moduleReferenceId = json['loanId'];
|
||||
documentType = json['documentType'] != null ? Lookup.fromJson(json['documentType']) : null;
|
||||
attachmentTypeId = json['loanAttachmentTypeId'];
|
||||
createdBy = json['createdBy'];
|
||||
createdDate = json['createdDate'];
|
||||
modifiedBy = json['modifiedBy'];
|
||||
modifiedDate = json['modifiedDate'];
|
||||
}
|
||||
|
||||
GenericAttachmentModel.fromPpmJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['attachmentName'] ?? json['name'];
|
||||
moduleReferenceId = json['visitId'];
|
||||
documentType = json['attachmentType'] != null ? Lookup.fromJson(json['attachmentType']) : null;
|
||||
attachmentURL = json['attachmentURL'];
|
||||
}
|
||||
|
||||
GenericAttachmentModel.fromSupplierJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['attachmentName'] ?? json['name'];
|
||||
supplierId = json['supplierId'];
|
||||
moduleReferenceId = json['visitId'];
|
||||
documentType = json['attachmentType'] != null ? Lookup.fromJson(json['attachmentType']) : null;
|
||||
attachmentURL = json['attachmentURL'];
|
||||
}
|
||||
|
||||
GenericAttachmentModel.fromGasRefillJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['attachmentName'];
|
||||
moduleReferenceId = json['gasRefillId'];
|
||||
documentType = json['documentType'] != null ? Lookup.fromJson(json['documentType']) : null;
|
||||
}
|
||||
|
||||
GenericAttachmentModel.fromIncidentJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['attachmentName'];
|
||||
moduleReferenceId = json['incidentId'];
|
||||
attachmentDescription = json['attachmentDescription'];
|
||||
documentType = json['attachmentType'] != null ? Lookup.fromJson(json['attachmentType']) : null;
|
||||
}
|
||||
|
||||
GenericAttachmentModel.fromAssetTransferJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['attachmentName'];
|
||||
documentType = json['attachmentType'] != null ? Lookup.fromJson(json['attachmentType']) : null;
|
||||
}
|
||||
|
||||
GenericAttachmentModel.fromDemoJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['attachmentName'];
|
||||
originalName = json['originalName'];
|
||||
documentType = json['documentType'] != null ? Lookup.fromJson(json['documentType']) : null;
|
||||
moduleReferenceId = json['demoRequestId'];
|
||||
}
|
||||
|
||||
GenericAttachmentModel.fromInternalAuditJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = (json['name'] != null && !json['name'].toString().startsWith('data:image/jpeg')) ? json['name'] : null;
|
||||
originalName = json['originalName'];
|
||||
createdBy = json['createdBy'];
|
||||
documentType = json['attachmentType'] != null ? Lookup.fromJson(json['attachmentType']) : null;
|
||||
}
|
||||
|
||||
GenericAttachmentModel.fromPreventiveVisitJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['attachmentName'];
|
||||
documentType = json['attachmentType'] != null ? Lookup.fromJson(json['attachmentType']) : null;
|
||||
}
|
||||
|
||||
GenericAttachmentModel.fromAssetJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['attachmentName'];
|
||||
attachmentURL = json['attachmentURL'];
|
||||
documentType = json['documentType'] != null ? Lookup.fromJson(json['documentType']) : null;
|
||||
originalName = json['originalName'];
|
||||
}
|
||||
|
||||
GenericAttachmentModel.fromAssetInventoryJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['attachmentName'];
|
||||
attachmentURL = json['attachmentURL'];
|
||||
documentType = json['attachmentType'] != null ? Lookup.fromJson(json['attachmentType']) : null;
|
||||
originalName = json['originalName'];
|
||||
}
|
||||
|
||||
GenericAttachmentModel.fromTrafJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
moduleReferenceId = json['trafId'];
|
||||
name = json['attachmentName'];
|
||||
attachmentDescription = json['attachmentDescription'];
|
||||
moduleReferenceId = json['trafId'];
|
||||
documentType = json['attachmentType'] != null ? Lookup.fromJson(json['attachmentType']) : null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['name'] = name;
|
||||
data['createdBy'] = createdBy;
|
||||
data['originalName'] = originalName;
|
||||
data['documentTypeId'] = documentType?.id;
|
||||
return data;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toSparePartJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['name'] = name;
|
||||
data['createdBy'] = createdBy;
|
||||
data['originalName'] = originalName;
|
||||
data['attachmentTypeId'] = documentType?.id;
|
||||
return data;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toWorkOrderJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['name'] = name;
|
||||
data['createdBy'] = createdBy;
|
||||
|
||||
///TODO need to keep same variable for document type in backend for all modules, currently it is different for different modules
|
||||
if (documentType != null) {
|
||||
data['attachmentTypeId'] = documentType?.id;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toLoanJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['attachmentName'] = name;
|
||||
data['loanId'] = moduleReferenceId;
|
||||
data['loanAttachmentTypeId'] = documentType?.id;
|
||||
// data['documentTypeId'] = documentType?.id;
|
||||
data['attachmentDescription'] = attachmentDescription;
|
||||
return data;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toLoanDetailJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['attachmentName'] = name;
|
||||
data['loanId'] = moduleReferenceId;
|
||||
data['loanAttachmentTypeId'] = attachmentTypeId;
|
||||
data['attachmentDescription'] = attachmentDescription;
|
||||
data['createdBy'] = createdBy;
|
||||
data['createdDate'] = createdDate;
|
||||
data['documentTypeId'] = documentType?.id;
|
||||
|
||||
data['modifiedBy'] = modifiedBy;
|
||||
data['modifiedDate'] = modifiedDate;
|
||||
return data;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toGasRefillJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['gasRefillId'] = moduleReferenceId;
|
||||
data['attachmentName'] = name;
|
||||
data['documentTypeId'] = documentType?.id;
|
||||
return data;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toIncidentJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['attachmentName'] = name;
|
||||
data['incidentId'] = moduleReferenceId;
|
||||
data['attachmentTypeId'] = documentType?.id;
|
||||
data['attachmentDescription'] = attachmentDescription;
|
||||
return data;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toAssetTransferJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['attachmentName'] = name;
|
||||
data['attachmentTypeId'] = documentType?.id;
|
||||
return data;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toDemoJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['attachmentName'] = name;
|
||||
data['demoRequestId'] = moduleReferenceId;
|
||||
data['originalName'] = originalName;
|
||||
if (documentType != null) {
|
||||
data['documentTypeId'] = documentType?.id;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toInternalAuditJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['name'] = name;
|
||||
data['originalName'] = originalName;
|
||||
data['attachmentTypeId'] = documentType?.id;
|
||||
return data;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toPreventiveVisitJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['attachmentName'] = name;
|
||||
data['attachmentTypeId'] = documentType?.id;
|
||||
return data;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toAssetJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['attachmentName'] = name;
|
||||
data['attachmentURL'] = attachmentURL;
|
||||
data['documentTypeId'] = documentType?.id;
|
||||
data['originalName'] = originalName;
|
||||
return data;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toAssetDeliveryJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['name'] = name;
|
||||
data['attachmentTypeId'] = documentType?.id;
|
||||
data['originalName'] = originalName;
|
||||
data['createdBy'] = createdBy;
|
||||
return data;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toInventoryJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['Name'] = name;
|
||||
data['attachmentURL'] = attachmentURL;
|
||||
data['attachmentTypeId'] = documentType?.id;
|
||||
data['originalName'] = originalName;
|
||||
return data;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toTrafJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['trafId'] = moduleReferenceId;
|
||||
data['attachmentName'] = name;
|
||||
data['attachmentTypeId'] = documentType?.id;
|
||||
return data;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toSupplierJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['supplierId'] = supplierId;
|
||||
data['documentTypeId'] = documentType?.id;
|
||||
data['attachmentName'] = name;
|
||||
data['attachmentURL'] = attachmentURL;
|
||||
return data;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toTaskJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['name'] = name;
|
||||
data['createdBy'] = createdBy;
|
||||
data['originalName'] = originalName;
|
||||
data['attachmentTypeId'] = documentType?.id;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,40 +1,42 @@
|
||||
class PpmAttachments {
|
||||
PpmAttachments({
|
||||
this.id,
|
||||
this.visitId,
|
||||
this.attachmentName,
|
||||
this.attachmentURL,
|
||||
});
|
||||
//TODO need to delete this
|
||||
|
||||
PpmAttachments.fromJson(dynamic json) {
|
||||
id = json['id'];
|
||||
visitId = json['visitId'];
|
||||
attachmentName = json['attachmentName'] ?? json['attachmentURL']; // Handle potential null and prioritize'attachmentName'
|
||||
}
|
||||
|
||||
num? id; // Now nullable
|
||||
num? visitId; // Now nullable
|
||||
String? attachmentName; // Now nullable
|
||||
String? attachmentURL; // Now nullable
|
||||
|
||||
PpmAttachments copyWith({
|
||||
num? id,
|
||||
num? visitId,
|
||||
String? attachmentName,
|
||||
String? attachmentURL,
|
||||
}) =>
|
||||
PpmAttachments(
|
||||
id: id ?? this.id,
|
||||
visitId: visitId ?? this.visitId,
|
||||
attachmentName: attachmentName ?? this.attachmentName,attachmentURL: attachmentURL ?? this.attachmentURL,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final map = <String, dynamic>{};
|
||||
map['id'] = id;
|
||||
map['visitId'] = visitId;
|
||||
map['attachmentName'] = attachmentName;
|
||||
map['attachmentURL'] = attachmentURL;
|
||||
return map;
|
||||
}
|
||||
}
|
||||
// class PpmAttachments {
|
||||
// PpmAttachments({
|
||||
// this.id,
|
||||
// this.visitId,
|
||||
// this.attachmentName,
|
||||
// this.attachmentURL,
|
||||
// });
|
||||
//
|
||||
// PpmAttachments.fromJson(dynamic json) {
|
||||
// id = json['id'];
|
||||
// visitId = json['visitId'];
|
||||
// attachmentName = json['attachmentName'] ?? json['attachmentURL']; // Handle potential null and prioritize'attachmentName'
|
||||
// }
|
||||
//
|
||||
// num? id; // Now nullable
|
||||
// num? visitId; // Now nullable
|
||||
// String? attachmentName; // Now nullable
|
||||
// String? attachmentURL; // Now nullable
|
||||
//
|
||||
// PpmAttachments copyWith({
|
||||
// num? id,
|
||||
// num? visitId,
|
||||
// String? attachmentName,
|
||||
// String? attachmentURL,
|
||||
// }) =>
|
||||
// PpmAttachments(
|
||||
// id: id ?? this.id,
|
||||
// visitId: visitId ?? this.visitId,
|
||||
// attachmentName: attachmentName ?? this.attachmentName,attachmentURL: attachmentURL ?? this.attachmentURL,
|
||||
// );
|
||||
//
|
||||
// Map<String, dynamic> toJson() {
|
||||
// final map = <String, dynamic>{};
|
||||
// map['id'] = id;
|
||||
// map['visitId'] = visitId;
|
||||
// map['attachmentName'] = attachmentName;
|
||||
// map['attachmentURL'] = attachmentURL;
|
||||
// return map;
|
||||
// }
|
||||
// }
|
||||
@ -1,31 +1,33 @@
|
||||
import 'package:test_sa/models/lookup.dart';
|
||||
//TODO : need to remove this class
|
||||
|
||||
class DemoAttachments {
|
||||
int? id;
|
||||
num? demoRequestId;
|
||||
num? documentTypeId;
|
||||
Lookup? documentType;
|
||||
String? attachmentName;
|
||||
String? originalName;
|
||||
|
||||
DemoAttachments({this.id, this.documentTypeId, this.documentType, this.attachmentName, this.demoRequestId, this.originalName});
|
||||
|
||||
DemoAttachments.fromJson(dynamic json) {
|
||||
id = json['id'];
|
||||
documentTypeId = json['documentTypeId'];
|
||||
documentType = json['documentType'] != null ? Lookup.fromJson(json['documentType']) : null;
|
||||
demoRequestId = json['demoRequestId'];
|
||||
attachmentName = json['attachmentName'];
|
||||
originalName = json['originalName'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final map = <String, dynamic>{};
|
||||
map['id'] = id;
|
||||
map['documentTypeId'] = documentTypeId;
|
||||
map['attachmentName'] = attachmentName;
|
||||
map['demoRequestId'] = demoRequestId;
|
||||
map['originalName'] = originalName;
|
||||
return map;
|
||||
}
|
||||
}
|
||||
// import 'package:test_sa/models/lookup.dart';
|
||||
//
|
||||
// class DemoAttachments {
|
||||
// int? id;
|
||||
// num? demoRequestId;
|
||||
// Lookup? documentType;
|
||||
// String? attachmentName;
|
||||
// String? originalName;
|
||||
//
|
||||
// DemoAttachments({this.id, this.documentType, this.attachmentName, this.demoRequestId, this.originalName});
|
||||
//
|
||||
// DemoAttachments.fromJson(dynamic json) {
|
||||
// id = json['id'];
|
||||
// documentType = json['documentType'] != null ? Lookup.fromJson(json['documentType']) : null;
|
||||
// demoRequestId = json['demoRequestId'];
|
||||
// attachmentName = json['attachmentName'];
|
||||
// originalName = json['originalName'];
|
||||
// }
|
||||
//
|
||||
// Map<String, dynamic> toJson() {
|
||||
// final map = <String, dynamic>{};
|
||||
// map['id'] = id;
|
||||
// if(documentType!=null){
|
||||
// map['documentTypeId'] = documentType?.id;
|
||||
// }
|
||||
// map['attachmentName'] = attachmentName;
|
||||
// map['demoRequestId'] = demoRequestId;
|
||||
// map['originalName'] = originalName;
|
||||
// return map;
|
||||
// }
|
||||
// }
|
||||
|
||||
@ -1,24 +1,26 @@
|
||||
class IncidentAttachments {
|
||||
num? id;
|
||||
num? incidentId;
|
||||
String? attachmentName;
|
||||
String? attachmentDescription;
|
||||
//TODO : need to delete this
|
||||
|
||||
IncidentAttachments({this.id, this.attachmentName, this.incidentId, this.attachmentDescription});
|
||||
|
||||
IncidentAttachments.fromJson(dynamic json) {
|
||||
id = json['id'];
|
||||
incidentId = json['incidentId'];
|
||||
attachmentName = json['attachmentName'];
|
||||
attachmentDescription = json['attachmentDescription'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final map = <String, dynamic>{};
|
||||
map['id'] = id;
|
||||
map['attachmentName'] = attachmentName;
|
||||
map['incidentId'] = incidentId;
|
||||
map['attachmentDescription'] = attachmentDescription;
|
||||
return map;
|
||||
}
|
||||
}
|
||||
// class IncidentAttachments {
|
||||
// num? id;
|
||||
// num? incidentId;
|
||||
// String? attachmentName;
|
||||
// String? attachmentDescription;
|
||||
//
|
||||
// IncidentAttachments({this.id, this.attachmentName, this.incidentId, this.attachmentDescription});
|
||||
//
|
||||
// IncidentAttachments.fromJson(dynamic json) {
|
||||
// id = json['id'];
|
||||
// incidentId = json['incidentId'];
|
||||
// attachmentName = json['attachmentName'];
|
||||
// attachmentDescription = json['attachmentDescription'];
|
||||
// }
|
||||
//
|
||||
// Map<String, dynamic> toJson() {
|
||||
// final map = <String, dynamic>{};
|
||||
// map['id'] = id;
|
||||
// map['attachmentName'] = attachmentName;
|
||||
// map['incidentId'] = incidentId;
|
||||
// map['attachmentDescription'] = attachmentDescription;
|
||||
// return map;
|
||||
// }
|
||||
// }
|
||||
|
||||
@ -1,26 +1,32 @@
|
||||
import 'dart:developer';
|
||||
|
||||
class InternalAuditAttachments {
|
||||
InternalAuditAttachments({this.id, this.originalName, this.name, this.createdBy});
|
||||
|
||||
int? id;
|
||||
String? name;
|
||||
String? originalName;
|
||||
String? createdBy;
|
||||
|
||||
InternalAuditAttachments.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = (json['name'] != null && !json['name'].toString().startsWith('data:image/jpeg')) ? json['name'] : null;
|
||||
originalName = json['originalName'];
|
||||
createdBy = json['createdBy'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['name'] = name;
|
||||
data['originalName'] = originalName;
|
||||
// data['createdBy'] = createdBy;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
//TODO : need to remove this class.
|
||||
// import 'dart:developer';
|
||||
//
|
||||
// import 'package:test_sa/models/lookup.dart';
|
||||
//
|
||||
// class InternalAuditAttachments {
|
||||
// InternalAuditAttachments({this.id, this.originalName, this.name, this.createdBy,this.documentType});
|
||||
//
|
||||
// int? id;
|
||||
// String? name;
|
||||
// String? originalName;
|
||||
// String? createdBy;
|
||||
// Lookup ? documentType;
|
||||
//
|
||||
// InternalAuditAttachments.fromJson(Map<String, dynamic> json) {
|
||||
// id = json['id'];
|
||||
// name = (json['name'] != null && !json['name'].toString().startsWith('data:image/jpeg')) ? json['name'] : null;
|
||||
// originalName = json['originalName'];
|
||||
// createdBy = json['createdBy'];
|
||||
// documentType =json['documentType'];
|
||||
// }
|
||||
//
|
||||
// Map<String, dynamic> toJson() {
|
||||
// final Map<String, dynamic> data = <String, dynamic>{};
|
||||
// data['id'] = id;
|
||||
// data['name'] = name;
|
||||
// data['originalName'] = originalName;
|
||||
// data['documentTypeId'] = documentType?.id;
|
||||
// // data['createdBy'] = createdBy;
|
||||
// return data;
|
||||
// }
|
||||
// }
|
||||
|
||||
@ -1,39 +1,40 @@
|
||||
class LoanAttachmentModel {
|
||||
int? loanId;
|
||||
String? attachmentName;
|
||||
int? loanAttachmentTypeId;
|
||||
String? attachmentDescription;
|
||||
int? id;
|
||||
String? createdBy;
|
||||
String? createdDate;
|
||||
String? modifiedBy;
|
||||
String? modifiedDate;
|
||||
|
||||
LoanAttachmentModel({this.loanId, this.attachmentName, this.loanAttachmentTypeId, this.attachmentDescription, this.id, this.createdBy, this.createdDate, this.modifiedBy, this.modifiedDate});
|
||||
|
||||
LoanAttachmentModel.fromJson(Map<String, dynamic> json) {
|
||||
loanId = json['loanId'];
|
||||
attachmentName = json['attachmentName'];
|
||||
loanAttachmentTypeId = json['loanAttachmentTypeId'];
|
||||
attachmentDescription = json['attachmentDescription'];
|
||||
id = json['id'];
|
||||
createdBy = json['createdBy'];
|
||||
createdDate = json['createdDate'];
|
||||
modifiedBy = json['modifiedBy'];
|
||||
modifiedDate = json['modifiedDate'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['loanId'] = this.loanId;
|
||||
data['attachmentName'] = this.attachmentName;
|
||||
data['loanAttachmentTypeId'] = this.loanAttachmentTypeId;
|
||||
data['attachmentDescription'] = this.attachmentDescription;
|
||||
data['id'] = this.id;
|
||||
data['createdBy'] = this.createdBy;
|
||||
data['createdDate'] = this.createdDate;
|
||||
data['modifiedBy'] = this.modifiedBy;
|
||||
data['modifiedDate'] = this.modifiedDate;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
//TODO need to delete this .
|
||||
// class LoanAttachmentModel {
|
||||
// int? loanId;
|
||||
// String? attachmentName;
|
||||
// int? loanAttachmentTypeId;
|
||||
// String? attachmentDescription;
|
||||
// int? id;
|
||||
// String? createdBy;
|
||||
// String? createdDate;
|
||||
// String? modifiedBy;
|
||||
// String? modifiedDate;
|
||||
//
|
||||
// LoanAttachmentModel({this.loanId, this.attachmentName, this.loanAttachmentTypeId, this.attachmentDescription, this.id, this.createdBy, this.createdDate, this.modifiedBy, this.modifiedDate});
|
||||
//
|
||||
// LoanAttachmentModel.fromJson(Map<String, dynamic> json) {
|
||||
// loanId = json['loanId'];
|
||||
// attachmentName = json['attachmentName'];
|
||||
// loanAttachmentTypeId = json['loanAttachmentTypeId'];
|
||||
// attachmentDescription = json['attachmentDescription'];
|
||||
// id = json['id'];
|
||||
// createdBy = json['createdBy'];
|
||||
// createdDate = json['createdDate'];
|
||||
// modifiedBy = json['modifiedBy'];
|
||||
// modifiedDate = json['modifiedDate'];
|
||||
// }
|
||||
//
|
||||
// Map<String, dynamic> toJson() {
|
||||
// final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
// data['loanId'] = this.loanId;
|
||||
// data['attachmentName'] = this.attachmentName;
|
||||
// data['loanAttachmentTypeId'] = this.loanAttachmentTypeId;
|
||||
// data['attachmentDescription'] = this.attachmentDescription;
|
||||
// data['id'] = this.id;
|
||||
// data['createdBy'] = this.createdBy;
|
||||
// data['createdDate'] = this.createdDate;
|
||||
// data['modifiedBy'] = this.modifiedBy;
|
||||
// data['modifiedDate'] = this.modifiedDate;
|
||||
// return data;
|
||||
// }
|
||||
// }
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue