feat: integrate payment summary and adapter for staff earnings management

This commit is contained in:
Achintha Isuru
2026-01-30 17:37:08 -05:00
parent 1268da45b0
commit 452f029108
10 changed files with 138 additions and 100 deletions

View File

@@ -0,0 +1,19 @@
import '../../entities/financial/staff_payment.dart';
/// Adapter for Payment related data.
class PaymentAdapter {
/// Converts string status to [PaymentStatus].
static PaymentStatus toPaymentStatus(String status) {
switch (status) {
case 'PAID':
return PaymentStatus.paid;
case 'PENDING':
return PaymentStatus.pending;
case 'FAILED':
return PaymentStatus.failed;
default:
return PaymentStatus.unknown;
}
}
}

View File

@@ -0,0 +1,24 @@
import 'package:equatable/equatable.dart';
/// Summary of staff earnings.
class PaymentSummary extends Equatable {
final double weeklyEarnings;
final double monthlyEarnings;
final double pendingEarnings;
final double totalEarnings;
const PaymentSummary({
required this.weeklyEarnings,
required this.monthlyEarnings,
required this.pendingEarnings,
required this.totalEarnings,
});
@override
List<Object?> get props => [
weeklyEarnings,
monthlyEarnings,
pendingEarnings,
totalEarnings,
];
}

View File

@@ -13,6 +13,9 @@ enum PaymentStatus {
/// Transfer failed.
failed,
/// Status unknown.
unknown,
}
/// Represents a payout to a [Staff] member for a completed [Assignment].