123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- import 'package:domain/generated/json/base/json_convert_content.dart';
- import 'package:domain/entity/response/uk_attendance_review_entity.dart';
- UkAttendanceReviewEntity $UkAttendanceReviewEntityFromJson(
- Map<String, dynamic> json) {
- final UkAttendanceReviewEntity ukAttendanceReviewEntity = UkAttendanceReviewEntity();
- final int? total = jsonConvert.convert<int>(json['total']);
- if (total != null) {
- ukAttendanceReviewEntity.total = total;
- }
- final List<UkAttendanceReviewRows>? rows = (json['rows'] as List<dynamic>?)
- ?.map(
- (e) =>
- jsonConvert.convert<UkAttendanceReviewRows>(e) as UkAttendanceReviewRows)
- .toList();
- if (rows != null) {
- ukAttendanceReviewEntity.rows = rows;
- }
- return ukAttendanceReviewEntity;
- }
- Map<String, dynamic> $UkAttendanceReviewEntityToJson(
- UkAttendanceReviewEntity entity) {
- final Map<String, dynamic> data = <String, dynamic>{};
- data['total'] = entity.total;
- data['rows'] = entity.rows?.map((v) => v.toJson()).toList();
- return data;
- }
- extension UkAttendanceReviewEntityExtension on UkAttendanceReviewEntity {
- UkAttendanceReviewEntity copyWith({
- int? total,
- List<UkAttendanceReviewRows>? rows,
- }) {
- return UkAttendanceReviewEntity()
- ..total = total ?? this.total
- ..rows = rows ?? this.rows;
- }
- }
- UkAttendanceReviewRows $UkAttendanceReviewRowsFromJson(
- Map<String, dynamic> json) {
- final UkAttendanceReviewRows ukAttendanceReviewRows = UkAttendanceReviewRows();
- final int? recordId = jsonConvert.convert<int>(json['record_id']);
- if (recordId != null) {
- ukAttendanceReviewRows.recordId = recordId;
- }
- final int? orderId = jsonConvert.convert<int>(json['order_id']);
- if (orderId != null) {
- ukAttendanceReviewRows.orderId = orderId;
- }
- final int? appliedId = jsonConvert.convert<int>(json['applied_id']);
- if (appliedId != null) {
- ukAttendanceReviewRows.appliedId = appliedId;
- }
- final String? staffName = jsonConvert.convert<String>(json['staff_name']);
- if (staffName != null) {
- ukAttendanceReviewRows.staffName = staffName;
- }
- final String? jobTitle = jsonConvert.convert<String>(json['job_title']);
- if (jobTitle != null) {
- ukAttendanceReviewRows.jobTitle = jobTitle;
- }
- final String? departmentName = jsonConvert.convert<String>(
- json['department_name']);
- if (departmentName != null) {
- ukAttendanceReviewRows.departmentName = departmentName;
- }
- final String? jobTime = jsonConvert.convert<String>(json['job_time']);
- if (jobTime != null) {
- ukAttendanceReviewRows.jobTime = jobTime;
- }
- final String? statusShow = jsonConvert.convert<String>(json['status_show']);
- if (statusShow != null) {
- ukAttendanceReviewRows.statusShow = statusShow;
- }
- final String? adjustShow = jsonConvert.convert<String>(json['adjust_show']);
- if (adjustShow != null) {
- ukAttendanceReviewRows.adjustShow = adjustShow;
- }
- final String? totalShow = jsonConvert.convert<String>(json['total_show']);
- if (totalShow != null) {
- ukAttendanceReviewRows.totalShow = totalShow;
- }
- final String? clockIn = jsonConvert.convert<String>(json['clock_in']);
- if (clockIn != null) {
- ukAttendanceReviewRows.clockIn = clockIn;
- }
- final int? inClass = jsonConvert.convert<int>(json['in_class']);
- if (inClass != null) {
- ukAttendanceReviewRows.inClass = inClass;
- }
- final String? clockOut = jsonConvert.convert<String>(json['clock_out']);
- if (clockOut != null) {
- ukAttendanceReviewRows.clockOut = clockOut;
- }
- final int? outClass = jsonConvert.convert<int>(json['out_class']);
- if (outClass != null) {
- ukAttendanceReviewRows.outClass = outClass;
- }
- final String? createdAt = jsonConvert.convert<String>(json['created_at']);
- if (createdAt != null) {
- ukAttendanceReviewRows.createdAt = createdAt;
- }
- final int? hasReason = jsonConvert.convert<int>(json['has_reason']);
- if (hasReason != null) {
- ukAttendanceReviewRows.hasReason = hasReason;
- }
- final List<String>? actionList = (json['action_list'] as List<dynamic>?)?.map(
- (e) => jsonConvert.convert<String>(e) as String).toList();
- if (actionList != null) {
- ukAttendanceReviewRows.actionList = actionList;
- }
- final bool? isSelected = jsonConvert.convert<bool>(json['isSelected']);
- if (isSelected != null) {
- ukAttendanceReviewRows.isSelected = isSelected;
- }
- return ukAttendanceReviewRows;
- }
- Map<String, dynamic> $UkAttendanceReviewRowsToJson(
- UkAttendanceReviewRows entity) {
- final Map<String, dynamic> data = <String, dynamic>{};
- data['record_id'] = entity.recordId;
- data['order_id'] = entity.orderId;
- data['applied_id'] = entity.appliedId;
- data['staff_name'] = entity.staffName;
- data['job_title'] = entity.jobTitle;
- data['department_name'] = entity.departmentName;
- data['job_time'] = entity.jobTime;
- data['status_show'] = entity.statusShow;
- data['adjust_show'] = entity.adjustShow;
- data['total_show'] = entity.totalShow;
- data['clock_in'] = entity.clockIn;
- data['in_class'] = entity.inClass;
- data['clock_out'] = entity.clockOut;
- data['out_class'] = entity.outClass;
- data['created_at'] = entity.createdAt;
- data['has_reason'] = entity.hasReason;
- data['action_list'] = entity.actionList;
- data['isSelected'] = entity.isSelected;
- return data;
- }
- extension UkAttendanceReviewRowsExtension on UkAttendanceReviewRows {
- UkAttendanceReviewRows copyWith({
- int? recordId,
- int? orderId,
- int? appliedId,
- String? staffName,
- String? jobTitle,
- String? departmentName,
- String? jobTime,
- String? statusShow,
- String? adjustShow,
- String? totalShow,
- String? clockIn,
- int? inClass,
- String? clockOut,
- int? outClass,
- String? createdAt,
- int? hasReason,
- List<String>? actionList,
- bool? isSelected,
- }) {
- return UkAttendanceReviewRows()
- ..recordId = recordId ?? this.recordId
- ..orderId = orderId ?? this.orderId
- ..appliedId = appliedId ?? this.appliedId
- ..staffName = staffName ?? this.staffName
- ..jobTitle = jobTitle ?? this.jobTitle
- ..departmentName = departmentName ?? this.departmentName
- ..jobTime = jobTime ?? this.jobTime
- ..statusShow = statusShow ?? this.statusShow
- ..adjustShow = adjustShow ?? this.adjustShow
- ..totalShow = totalShow ?? this.totalShow
- ..clockIn = clockIn ?? this.clockIn
- ..inClass = inClass ?? this.inClass
- ..clockOut = clockOut ?? this.clockOut
- ..outClass = outClass ?? this.outClass
- ..createdAt = createdAt ?? this.createdAt
- ..hasReason = hasReason ?? this.hasReason
- ..actionList = actionList ?? this.actionList
- ..isSelected = isSelected ?? this.isSelected;
- }
- }
|