import 'dart:convert';


import '../../../requestCache.dart';
import 'getRoom.dart';
import 'getRoomParams.dart';
import 'getRoomResponse.dart';

class GetRoomCache extends RequestCache<GetRoomResponse> {
  GetRoomCache({onUpdate, renew}) : super(RequestCache.cacheMinute, onUpdate, renew: renew) {
    start('MarianumMobile', 'nc-rooms');
  }

  @override
  GetRoomResponse onLocalData(String json) => GetRoomResponse.fromJson(jsonDecode(json));

  @override
  Future<GetRoomResponse> onLoad() => GetRoom(
      GetRoomParams(
        includeStatus: true,
      )
    ).run();
}
