import 'dart:convert';

import '../../../requestCache.dart';
import 'getHolidays.dart';
import 'getHolidaysResponse.dart';

class GetHolidaysCache extends RequestCache<GetHolidaysResponse> {
  GetHolidaysCache({onUpdate}) : super(RequestCache.cacheDay, onUpdate) {
    start('MarianumMobile', 'wu-holidays');
  }

  @override
  Future<GetHolidaysResponse> onLoad() => GetHolidays().run();

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