import 'package:cashier_reserve/common/request/request_manager.dart';
import 'package:cashier_reserve/datas/reserve/table_area_model.dart';

/// ReserveModel 台桌预定相关请求
class ReserveModel {
  /// getShopTableAreaList 获取店铺桌台区域列表
  static Future<List<TableAreaModel?>> getShopTableAreaList() async {
    final r = await RequestManager.get("/api/booking/shop-table/area");
    if (r == null) {
      return [];
    }
    List<TableAreaModel?> list = [];
    for (var item in r as List) {
      list.add(TableAreaModel.fromJson(item));
    }
    return list;
  }
}