ambil data stok bantuan
This commit is contained in:
@ -1,25 +1,29 @@
|
||||
import 'dart:convert';
|
||||
|
||||
class PengaduanModel {
|
||||
final String id;
|
||||
final String judul;
|
||||
final String deskripsi;
|
||||
final String? userId; // Pengguna yang membuat pengaduan
|
||||
final String? penyaluranBantuanId; // Referensi ke PenyaluranBantuan
|
||||
final String status; // Contoh: 'pending', 'diproses', 'selesai'
|
||||
final List<String>? gambarUrls; // URL gambar bukti pengaduan
|
||||
final DateTime createdAt;
|
||||
final String? id;
|
||||
final String? judul;
|
||||
final String? deskripsi;
|
||||
final String? status;
|
||||
final String? kategori;
|
||||
final String? pelapor;
|
||||
final String? kontakPelapor;
|
||||
final List<String>? gambarUrls;
|
||||
final DateTime? tanggalPengaduan;
|
||||
final DateTime? createdAt;
|
||||
final DateTime? updatedAt;
|
||||
|
||||
PengaduanModel({
|
||||
required this.id,
|
||||
required this.judul,
|
||||
required this.deskripsi,
|
||||
this.userId,
|
||||
this.penyaluranBantuanId,
|
||||
required this.status,
|
||||
this.id,
|
||||
this.judul,
|
||||
this.deskripsi,
|
||||
this.status,
|
||||
this.kategori,
|
||||
this.pelapor,
|
||||
this.kontakPelapor,
|
||||
this.gambarUrls,
|
||||
required this.createdAt,
|
||||
this.tanggalPengaduan,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
});
|
||||
|
||||
@ -32,29 +36,37 @@ class PengaduanModel {
|
||||
id: json["id"],
|
||||
judul: json["judul"],
|
||||
deskripsi: json["deskripsi"],
|
||||
userId: json["user_id"],
|
||||
penyaluranBantuanId: json["penyaluran_bantuan_id"],
|
||||
status: json["status"],
|
||||
kategori: json["kategori"],
|
||||
pelapor: json["pelapor"],
|
||||
kontakPelapor: json["kontak_pelapor"],
|
||||
gambarUrls: json["gambar_urls"] == null
|
||||
? null
|
||||
: List<String>.from(json["gambar_urls"].map((x) => x)),
|
||||
createdAt: DateTime.parse(json["created_at"]),
|
||||
updatedAt: json["updated_at"] == null
|
||||
? null
|
||||
: DateTime.parse(json["updated_at"]),
|
||||
tanggalPengaduan: json["tanggal_pengaduan"] != null
|
||||
? DateTime.parse(json["tanggal_pengaduan"])
|
||||
: null,
|
||||
createdAt: json["created_at"] != null
|
||||
? DateTime.parse(json["created_at"])
|
||||
: null,
|
||||
updatedAt: json["updated_at"] != null
|
||||
? DateTime.parse(json["updated_at"])
|
||||
: null,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"judul": judul,
|
||||
"deskripsi": deskripsi,
|
||||
"user_id": userId,
|
||||
"penyaluran_bantuan_id": penyaluranBantuanId,
|
||||
"status": status,
|
||||
"kategori": kategori,
|
||||
"pelapor": pelapor,
|
||||
"kontak_pelapor": kontakPelapor,
|
||||
"gambar_urls": gambarUrls == null
|
||||
? null
|
||||
: List<dynamic>.from(gambarUrls!.map((x) => x)),
|
||||
"created_at": createdAt.toIso8601String(),
|
||||
"tanggal_pengaduan": tanggalPengaduan?.toIso8601String(),
|
||||
"created_at": createdAt?.toIso8601String(),
|
||||
"updated_at": updatedAt?.toIso8601String(),
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user