kyc and update risk profile api integration and issues fixed

This commit is contained in:
jayesh
2024-05-10 15:48:07 +05:30
parent a6df6e9be0
commit 112ece34cf
16 changed files with 610 additions and 170 deletions

View File

@@ -0,0 +1,118 @@
class GetUserRiskProfileModel {
String? status;
int? statusCode;
String? message;
List<Data>? data;
GetUserRiskProfileModel(
{this.status, this.statusCode, this.message, this.data});
GetUserRiskProfileModel.fromJson(Map<String, dynamic> json) {
status = json['status'];
statusCode = json['status_code'];
message = json['message'];
if (json['data'] != null) {
data = <Data>[];
json['data'].forEach((v) {
data!.add(Data.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['status'] = status;
data['status_code'] = statusCode;
data['message'] = message;
if (this.data != null) {
data['data'] = this.data!.map((v) => v.toJson()).toList();
}
return data;
}
}
class Data {
int? id;
int? userId;
int? questionId;
int? answerId;
QuestionData? questionData;
AnswerData? answerData;
Data(
{this.id,
this.userId,
this.questionId,
this.answerId,
this.questionData,
this.answerData});
Data.fromJson(Map<String, dynamic> json) {
id = json['id'];
userId = json['user_id'];
questionId = json['question_id'];
answerId = json['answer_id'];
questionData = json['question_data'] != null
? QuestionData.fromJson(json['question_data'])
: null;
answerData = json['answer_data'] != null
? AnswerData.fromJson(json['answer_data'])
: null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = id;
data['user_id'] = userId;
data['question_id'] = questionId;
data['answer_id'] = answerId;
if (questionData != null) {
data['question_data'] = questionData!.toJson();
}
if (answerData != null) {
data['answer_data'] = answerData!.toJson();
}
return data;
}
}
class QuestionData {
int? id;
String? question;
String? hint;
QuestionData({this.id, this.question, this.hint});
QuestionData.fromJson(Map<String, dynamic> json) {
id = json['id'];
question = json['question'];
hint = json['hint'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = id;
data['question'] = question;
data['hint'] = hint;
return data;
}
}
class AnswerData {
int? id;
String? answer;
AnswerData({this.id, this.answer});
AnswerData.fromJson(Map<String, dynamic> json) {
id = json['id'];
answer = json['answer'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = id;
data['answer'] = answer;
return data;
}
}

View File

@@ -35,7 +35,7 @@ class Data {
int? id;
String? question;
String? isActive;
String? hint;
String? createdAt;
String? updatedAt;
List<Answer>? answer;
@@ -43,6 +43,7 @@ class Data {
Data(
{this.id,
this.question,
this.hint,
this.isActive,
this.createdAt,
this.updatedAt,
@@ -52,7 +53,7 @@ class Data {
id = json['id'];
question = json['question'];
isActive = json['is_active'];
hint = json['hint'];
createdAt = json['created_at'];
updatedAt = json['updated_at'];
if (json['answer'] != null) {
@@ -68,7 +69,7 @@ class Data {
data['id'] = id;
data['question'] = question;
data['is_active'] = isActive;
data['hint'] = hint;
data['created_at'] = createdAt;
data['updated_at'] = updatedAt;
if (answer != null) {
@@ -84,7 +85,6 @@ class Answer {
String? answer;
int? points;
String? isActive;
String? createdAt;
String? updatedAt;