bharat_erp/lib/shared/models/audit_log_model.g.dart

142 lines
4.6 KiB
Dart

// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'audit_log_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_$AuditLogUserModelImpl _$$AuditLogUserModelImplFromJson(
Map<String, dynamic> json,
) => _$AuditLogUserModelImpl(
id: _idFromJson(json['id']),
fullName: json['full_name'] as String?,
employeeCode: json['employee_code'] as String?,
email: json['email'] as String?,
);
Map<String, dynamic> _$$AuditLogUserModelImplToJson(
_$AuditLogUserModelImpl instance,
) => <String, dynamic>{
'id': instance.id,
'full_name': instance.fullName,
'employee_code': instance.employeeCode,
'email': instance.email,
};
_$AuditLogPerformerOptionImpl _$$AuditLogPerformerOptionImplFromJson(
Map<String, dynamic> json,
) => _$AuditLogPerformerOptionImpl(
id: _idFromJson(json['id']),
fullName: json['full_name'] as String?,
employeeCode: json['employee_code'] as String?,
);
Map<String, dynamic> _$$AuditLogPerformerOptionImplToJson(
_$AuditLogPerformerOptionImpl instance,
) => <String, dynamic>{
'id': instance.id,
'full_name': instance.fullName,
'employee_code': instance.employeeCode,
};
_$AuditLogFilterOptionsImpl _$$AuditLogFilterOptionsImplFromJson(
Map<String, dynamic> json,
) => _$AuditLogFilterOptionsImpl(
tableNames:
(json['table_names'] as List<dynamic>?)
?.map((e) => e as String)
.toList() ??
const [],
actions:
(json['actions'] as List<dynamic>?)?.map((e) => e as String).toList() ??
const [],
performers:
(json['performers'] as List<dynamic>?)
?.map(
(e) => AuditLogPerformerOption.fromJson(e as Map<String, dynamic>),
)
.toList() ??
const [],
);
Map<String, dynamic> _$$AuditLogFilterOptionsImplToJson(
_$AuditLogFilterOptionsImpl instance,
) => <String, dynamic>{
'table_names': instance.tableNames,
'actions': instance.actions,
'performers': instance.performers,
};
_$AuditLogEntryModelImpl _$$AuditLogEntryModelImplFromJson(
Map<String, dynamic> json,
) => _$AuditLogEntryModelImpl(
id: _idFromJson(json['id']),
tableName: json['table_name'] as String,
recordId: _idFromJsonNullable(json['record_id']),
action: json['action'] as String,
performedAt: _dateFromJsonNullable(json['performed_at']),
performedBy: _idFromJsonNullable(json['performed_by']),
requestId: json['request_id'] as String?,
performedByUser: json['performed_by_user'] == null
? null
: AuditLogUserModel.fromJson(
json['performed_by_user'] as Map<String, dynamic>,
),
hasOldValue: json['has_old_value'] as bool? ?? false,
hasNewValue: json['has_new_value'] as bool? ?? false,
);
Map<String, dynamic> _$$AuditLogEntryModelImplToJson(
_$AuditLogEntryModelImpl instance,
) => <String, dynamic>{
'id': instance.id,
'table_name': instance.tableName,
'record_id': instance.recordId,
'action': instance.action,
'performed_at': instance.performedAt?.toIso8601String(),
'performed_by': instance.performedBy,
'request_id': instance.requestId,
'performed_by_user': instance.performedByUser,
'has_old_value': instance.hasOldValue,
'has_new_value': instance.hasNewValue,
};
_$AuditLogDetailModelImpl _$$AuditLogDetailModelImplFromJson(
Map<String, dynamic> json,
) => _$AuditLogDetailModelImpl(
id: _idFromJson(json['id']),
tableName: json['table_name'] as String,
recordId: _idFromJsonNullable(json['record_id']),
action: json['action'] as String,
performedAt: _dateFromJsonNullable(json['performed_at']),
performedBy: _idFromJsonNullable(json['performed_by']),
requestId: json['request_id'] as String?,
performedByUser: json['performed_by_user'] == null
? null
: AuditLogUserModel.fromJson(
json['performed_by_user'] as Map<String, dynamic>,
),
hasOldValue: json['has_old_value'] as bool? ?? false,
hasNewValue: json['has_new_value'] as bool? ?? false,
oldValue: _mapFromJsonNullable(json['old_value']),
newValue: _mapFromJsonNullable(json['new_value']),
);
Map<String, dynamic> _$$AuditLogDetailModelImplToJson(
_$AuditLogDetailModelImpl instance,
) => <String, dynamic>{
'id': instance.id,
'table_name': instance.tableName,
'record_id': instance.recordId,
'action': instance.action,
'performed_at': instance.performedAt?.toIso8601String(),
'performed_by': instance.performedBy,
'request_id': instance.requestId,
'performed_by_user': instance.performedByUser,
'has_old_value': instance.hasOldValue,
'has_new_value': instance.hasNewValue,
'old_value': instance.oldValue,
'new_value': instance.newValue,
};