attendence records, extra hours , rewards and punishment funnctionality have been added

This commit is contained in:
Daniah Ayad Al-sultani
2026-02-10 16:27:08 +03:00
parent cd7ba8e9d5
commit 1002937045
25 changed files with 1048 additions and 181 deletions

View File

@@ -0,0 +1,46 @@
class RewardDto {
final String id;
final DateTime date;
final double amount;
final String? reason;
final String? note;
final String employeeId;
RewardDto({
required this.id,
required this.date,
required this.amount,
this.reason,
this.note,
required this.employeeId,
});
factory RewardDto.fromJson(Map<String, dynamic> json) {
return RewardDto(
id: json['id']?.toString() ?? '',
date:
json['date'] != null ? DateTime.parse(json['date']) : DateTime.now(),
amount: (json['amount'] as num?)?.toDouble() ?? 0.0,
reason: json['reason'],
note: json['note'],
employeeId: json['employeeId']?.toString() ?? '',
);
}
}
class RewardListResponseDto {
final List<RewardDto> items;
RewardListResponseDto({required this.items});
factory RewardListResponseDto.fromJson(Map<String, dynamic> json) {
final data = json['data'];
if (data == null || data is! Map<String, dynamic>) {
return RewardListResponseDto(items: []);
}
final itemsJson = data['items'] as List? ?? [];
return RewardListResponseDto(
items: itemsJson.map((e) => RewardDto.fromJson(e)).toList(),
);
}
}