diff --git a/lib/Model/model/booking/car_model.dart b/lib/Model/model/booking/car_model.dart index f60d19b..dc38c51 100644 --- a/lib/Model/model/booking/car_model.dart +++ b/lib/Model/model/booking/car_model.dart @@ -136,6 +136,8 @@ class CarBookingHistoryData { class CarBookingHistory { int id; int targetId; + String? reservatorName; + String? reservatorPhone; String name; String? location; String startDateTime; @@ -146,6 +148,8 @@ class CarBookingHistory { CarBookingHistory({ required this.id, required this.targetId, + this.reservatorName, + this.reservatorPhone, required this.name, this.location, required this.startDateTime, diff --git a/lib/Model/model/booking/car_model.g.dart b/lib/Model/model/booking/car_model.g.dart index c8d8c15..ad73ea4 100644 --- a/lib/Model/model/booking/car_model.g.dart +++ b/lib/Model/model/booking/car_model.g.dart @@ -146,6 +146,8 @@ CarBookingHistory _$CarBookingHistoryFromJson(Map json) => CarBookingHistory( id: json['id'] as int, targetId: json['targetId'] as int, + reservatorName: json['reservatorName'] as String?, + reservatorPhone: json['reservatorPhone'] as String?, name: json['name'] as String, location: json['location'] as String?, startDateTime: json['startDateTime'] as String, @@ -158,6 +160,8 @@ Map _$CarBookingHistoryToJson(CarBookingHistory instance) => { 'id': instance.id, 'targetId': instance.targetId, + 'reservatorName': instance.reservatorName, + 'reservatorPhone': instance.reservatorPhone, 'name': instance.name, 'location': instance.location, 'startDateTime': instance.startDateTime, diff --git a/lib/Model/model/booking/office_model.dart b/lib/Model/model/booking/office_model.dart index 3633e9e..00d4b4b 100644 --- a/lib/Model/model/booking/office_model.dart +++ b/lib/Model/model/booking/office_model.dart @@ -234,6 +234,8 @@ class OfficeBookingHistoryData { class OfficeBookingHistory { int id; int targetId; + String? reservatorName; + String? reservatorPhone; String name; String? detailInfo; String startDateTime; @@ -244,6 +246,8 @@ class OfficeBookingHistory { OfficeBookingHistory({ required this.id, required this.targetId, + this.reservatorName, + this.reservatorPhone, required this.name, this.detailInfo, required this.startDateTime, diff --git a/lib/Model/model/booking/office_model.g.dart b/lib/Model/model/booking/office_model.g.dart index cab2d3d..cd643f4 100644 --- a/lib/Model/model/booking/office_model.g.dart +++ b/lib/Model/model/booking/office_model.g.dart @@ -258,6 +258,8 @@ OfficeBookingHistory _$OfficeBookingHistoryFromJson( OfficeBookingHistory( id: json['id'] as int, targetId: json['targetId'] as int, + reservatorName: json['reservatorName'] as String?, + reservatorPhone: json['reservatorPhone'] as String?, name: json['name'] as String, detailInfo: json['detailInfo'] as String?, startDateTime: json['startDateTime'] as String, @@ -271,6 +273,8 @@ Map _$OfficeBookingHistoryToJson( { 'id': instance.id, 'targetId': instance.targetId, + 'reservatorName': instance.reservatorName, + 'reservatorPhone': instance.reservatorPhone, 'name': instance.name, 'detailInfo': instance.detailInfo, 'startDateTime': instance.startDateTime, diff --git a/lib/Model/model/booking/resource_model.dart b/lib/Model/model/booking/resource_model.dart index 20b78d1..bfc3488 100644 --- a/lib/Model/model/booking/resource_model.dart +++ b/lib/Model/model/booking/resource_model.dart @@ -237,6 +237,8 @@ class ResourceBookingHistoryData { class ResourceBookingHistory { int id; int targetId; + String? reservatorName; + String? reservatorPhone; String name; String? location; String startDateTime; @@ -247,6 +249,8 @@ class ResourceBookingHistory { ResourceBookingHistory({ required this.id, required this.targetId, + this.reservatorName, + this.reservatorPhone, required this.name, this.location, required this.startDateTime, diff --git a/lib/Model/model/booking/resource_model.g.dart b/lib/Model/model/booking/resource_model.g.dart index 9f97df1..3475a39 100644 --- a/lib/Model/model/booking/resource_model.g.dart +++ b/lib/Model/model/booking/resource_model.g.dart @@ -266,6 +266,8 @@ ResourceBookingHistory _$ResourceBookingHistoryFromJson( ResourceBookingHistory( id: json['id'] as int, targetId: json['targetId'] as int, + reservatorName: json['reservatorName'] as String?, + reservatorPhone: json['reservatorPhone'] as String?, name: json['name'] as String, location: json['location'] as String?, startDateTime: json['startDateTime'] as String, @@ -279,6 +281,8 @@ Map _$ResourceBookingHistoryToJson( { 'id': instance.id, 'targetId': instance.targetId, + 'reservatorName': instance.reservatorName, + 'reservatorPhone': instance.reservatorPhone, 'name': instance.name, 'location': instance.location, 'startDateTime': instance.startDateTime, diff --git a/lib/View/booking/component/booking_item_card.dart b/lib/View/booking/component/booking_item_card.dart index 69148a5..c6ae04f 100644 --- a/lib/View/booking/component/booking_item_card.dart +++ b/lib/View/booking/component/booking_item_card.dart @@ -17,7 +17,9 @@ class BookingItemCard extends StatefulWidget { final bool isAdmin; final BookingType type; final int id; - final int tergetId; + final int targetId; + final String? reservatorName; + final String? reservatorPhone; final String name; final String? location; final String startDateTime; @@ -29,7 +31,9 @@ class BookingItemCard extends StatefulWidget { required this.isAdmin, required this.type, required this.id, - required this.tergetId, + required this.targetId, + this.reservatorName, + this.reservatorPhone, required this.name, required this.location, required this.startDateTime, @@ -95,7 +99,22 @@ class _BookingItemCardState extends State { ), const Divider(thickness: 1.2,), - /// 예약일시, 이용목적, 예약상태 + /// 예약자, 예약일시, 이용목적, 예약상태 + widget.isAdmin + ? Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Text('예약자', style: titleStyle,), + ), + Text('${widget.reservatorName} (${widget.reservatorPhone})', style: contentStyle, overflow: TextOverflow.ellipsis) + ], + ), + ) + : const SizedBox(height: 0,), + Padding( padding: const EdgeInsets.all(8.0), child: Row( @@ -344,9 +363,9 @@ class _BookingItemCardState extends State { void didTapMoveToDetailButton() { switch (widget.type) { case BookingType.office: - Navigator.of(context).push(MaterialPageRoute(builder: (_) => OfficeDetailScreen(officeId: widget.tergetId,))); + Navigator.of(context).push(MaterialPageRoute(builder: (_) => OfficeDetailScreen(officeId: widget.targetId,))); default: - Navigator.of(context).push(MaterialPageRoute(builder: (_) => GeneralDetailScreen(type: widget.type, id: widget.tergetId,))); + Navigator.of(context).push(MaterialPageRoute(builder: (_) => GeneralDetailScreen(type: widget.type, id: widget.targetId,))); } } } diff --git a/lib/View/booking/screen/booking_history_screen.dart b/lib/View/booking/screen/booking_history_screen.dart index e0809f2..6f7353c 100644 --- a/lib/View/booking/screen/booking_history_screen.dart +++ b/lib/View/booking/screen/booking_history_screen.dart @@ -157,7 +157,9 @@ class BookingHistoryScreenState extends State with SingleT isAdmin: widget.isAdmin, type: currentType, id: data.data.content[index].id, - tergetId: data.data.content[index].targetId, + targetId: data.data.content[index].targetId, + reservatorName: widget.isAdmin ? data.data.content[index].reservatorName : null, + reservatorPhone: widget.isAdmin ? data.data.content[index].reservatorPhone : null, name: data.data.content[index].name, location: (currentType == BookingType.office) ? data.data.content[index].detailInfo