feat(frontend): connect borrow flow to api
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import "materiel_item.dart";
|
||||
|
||||
/// Réponse renvoyée par l'API après création d'un emprunt.
|
||||
class EmpruntResponse {
|
||||
const EmpruntResponse({
|
||||
required this.id,
|
||||
required this.dateEmprunt,
|
||||
required this.dateRetourPrevue,
|
||||
required this.statut,
|
||||
required this.materiel,
|
||||
});
|
||||
|
||||
factory EmpruntResponse.fromJson(Map<String, dynamic> json) {
|
||||
return EmpruntResponse(
|
||||
id: json["id"] as int,
|
||||
dateEmprunt: DateTime.parse(json["dateEmprunt"] as String),
|
||||
dateRetourPrevue: DateTime.parse(json["dateRetourPrevue"] as String),
|
||||
statut: json["statut"] as String,
|
||||
materiel: MaterielItem.fromJson(json["materiel"] as Map<String, dynamic>),
|
||||
);
|
||||
}
|
||||
|
||||
final int id;
|
||||
final DateTime dateEmprunt;
|
||||
final DateTime dateRetourPrevue;
|
||||
final String statut;
|
||||
final MaterielItem materiel;
|
||||
}
|
||||
Reference in New Issue
Block a user