/*
 * @Author: WuXiangNan
 * @Date: 2021-02-21 16:29:41
 * @LastEditTime: 2021-03-16 11:55:43
 * @LastEditors: WuXiangNan
 * @Description: 考勤日历
 */
import './clock_infos_model.dart';

class CalendarModel {
  int? day;
  int? clockStatus;
  String? shiftInfo;
  List<ClockInfosModel>? clockInfos;
  String? clockSummary;

  CalendarModel({
    this.day,
    this.clockStatus,
    this.shiftInfo,
    this.clockInfos,
    this.clockSummary,
  });

  CalendarModel.fromJson(json) {
    Map<String, dynamic> map = Map.from(json ?? {});

    day = map['day'];
    clockStatus = map['clockStatus'];
    shiftInfo = map['shiftInfo'];
    clockInfos = List<ClockInfosModel>.from(
        (map["clockInfos"] ?? []).map((x) => ClockInfosModel.fromJson(x)));
    clockSummary = map['clockSummary'];
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();

    json['day'] = this.day;
    json['clockStatus'] = this.clockStatus;
    json['shiftInfo'] = this.shiftInfo;
    json['clockInfos'] =
        List<dynamic>.from(clockInfos ?? []).map((e) => e.toJson());
    json['clockSummary'] = this.clockSummary;

    return json;
  }
}
