import 'package:fis_jsonrpc/services/report.m.dart';

///报告缓存状态
class ReportCache {
  static ReportCache? _reportCache;

  ReportCache._internal();

  ///ReportCache全局单例
  static ReportCache get instance {
    _reportCache ??= ReportCache._internal();
    return _reportCache!;
  }

  ///报告编辑和已完成报告缓存
  ///已完成的报告：Key = reportId,Value = json
  ///正在编辑中报告： Key = recordId,Value =json
  static Map<String, ReportInfoItem> cache = {};

  ///报告模板缓存
  static Map<String, ReportTemplateDTO> templates = {};
}

///用于报告单个缓存存储
class ReportInfoItem {
  ///报告信息Json存储
  String reportInfoJson = '';

  ///报告模板Json
  String reportTemplateJson = '';

  ReportInfoItem(String reportinfoJson, String reportTemplateJson) {
    this.reportInfoJson = reportinfoJson;
    this.reportTemplateJson = reportTemplateJson;
  }
}
