api intigreted of scan Qr and recent scan histoy ,scan history,scan history details

This commit is contained in:
Raj.Ghag
2026-04-17 15:55:54 +05:30
parent f301585948
commit 94cd74a135
60 changed files with 3678 additions and 1119 deletions

View File

@@ -0,0 +1,190 @@
// ================= RESPONSE WRAPPER =================
class SupportDetailResponse {
final SupportDetailModel data;
SupportDetailResponse({
required this.data,
});
factory SupportDetailResponse.fromJson(Map<String, dynamic>? json) {
return SupportDetailResponse(
data: json != null
? SupportDetailModel.fromJson(json)
: SupportDetailModel.empty(),
);
}
}
// ================= MAIN MODEL =================
class SupportDetailModel {
final int id;
final int partnerXid;
final int userXid;
final int roleXid;
final String fullName;
final String email;
final String phone;
final String round;
final bool isActive;
final bool isDeleted;
final String lastLoginAt;
final String createdAt;
final String updatedAt;
final SupportRoleModel role;
final PartnerModel partner;
SupportDetailModel({
required this.id,
required this.partnerXid,
required this.userXid,
required this.roleXid,
required this.fullName,
required this.email,
required this.phone,
required this.round,
required this.isActive,
required this.isDeleted,
required this.lastLoginAt,
required this.createdAt,
required this.updatedAt,
required this.role,
required this.partner,
});
factory SupportDetailModel.fromJson(Map<String, dynamic> json) {
return SupportDetailModel(
id: json['id'] ?? 0,
partnerXid: json['partnerXid'] ?? 0,
userXid: json['userXid'] ?? 0,
roleXid: json['roleXid'] ?? 0,
fullName: json['fullName'] ?? "N/A",
email: json['email'] ?? "N/A",
phone: json['phone'] ?? "N/A",
round: json['round'] ?? "N/A",
isActive: json['isActive'] ?? false,
isDeleted: json['isDeleted'] ?? false,
lastLoginAt: json['lastLoginAt'] ?? "N/A",
createdAt: json['createdAt'] ?? "N/A",
updatedAt: json['updatedAt'] ?? "N/A",
role: json['role'] != null
? SupportRoleModel.fromJson(json['role'])
: SupportRoleModel.empty(),
partner: json['partner'] != null
? PartnerModel.fromJson(json['partner'])
: PartnerModel.empty(),
);
}
factory SupportDetailModel.empty() {
return SupportDetailModel(
id: 0,
partnerXid: 0,
userXid: 0,
roleXid: 0,
fullName: "N/A",
email: "N/A",
phone: "N/A",
round: "N/A",
isActive: false,
isDeleted: false,
lastLoginAt: "N/A",
createdAt: "N/A",
updatedAt: "N/A",
role: SupportRoleModel.empty(),
partner: PartnerModel.empty(),
);
}
}
// ================= ROLE MODEL =================
class SupportRoleModel {
final int id;
final String name;
final bool isActive;
final String createdAt;
final String updatedAt;
SupportRoleModel({
required this.id,
required this.name,
required this.isActive,
required this.createdAt,
required this.updatedAt,
});
factory SupportRoleModel.fromJson(Map<String, dynamic> json) {
return SupportRoleModel(
id: json['id'] ?? 0,
name: json['name'] ?? "N/A",
isActive: json['isActive'] ?? false,
createdAt: json['createdAt'] ?? "N/A",
updatedAt: json['updatedAt'] ?? "N/A",
);
}
factory SupportRoleModel.empty() {
return SupportRoleModel(
id: 0,
name: "N/A",
isActive: false,
createdAt: "N/A",
updatedAt: "N/A",
);
}
Map<String, dynamic> toJson() {
return {
"id": id,
"name": name,
"isActive": isActive,
"createdAt": createdAt,
"updatedAt": updatedAt,
};
}
}
// ================= PARTNER MODEL =================
class PartnerModel {
final int id;
final String businessName;
final String emailAddress;
final String phoneNumber;
PartnerModel({
required this.id,
required this.businessName,
required this.emailAddress,
required this.phoneNumber,
});
factory PartnerModel.fromJson(Map<String, dynamic> json) {
return PartnerModel(
id: json['id'] ?? 0,
businessName: json['businessName'] ?? "N/A",
emailAddress: json['emailAddress'] ?? "N/A",
phoneNumber: json['phoneNumber'] ?? "N/A",
);
}
factory PartnerModel.empty() {
return PartnerModel(
id: 0,
businessName: "N/A",
emailAddress: "N/A",
phoneNumber: "N/A",
);
}
Map<String, dynamic> toJson() {
return {
"id": id,
"businessName": businessName,
"emailAddress": emailAddress,
"phoneNumber": phoneNumber,
};
}
}