feat: complete client billing UI and staff benefits display (#524, #527)

- Client App: Built dedicated ShiftCompletionReviewPage  and InvoiceReadyPage
- Client App: Wired up invoice summary mapping and parsing logic from Data Connect
- Staff App: Added dynamic BenefitsOverviewPage tracking worker limits matching client mockup
- Staff App: Display progress ring values wired to real VendorBenefitPlan & BenefitsData balances
This commit is contained in:
2026-02-24 16:17:19 +05:30
parent 98c0b8a644
commit 7e26b54c50
35 changed files with 2038 additions and 199 deletions

View File

@@ -0,0 +1,26 @@
import 'package:equatable/equatable.dart';
/// Represents a staff member's benefit balance.
class Benefit extends Equatable {
/// The title of the benefit (e.g., Sick Leave, Holiday, Vacation).
final String title;
/// The total entitlement in hours.
final double entitlementHours;
/// The hours used so far.
final double usedHours;
/// The hours remaining.
double get remainingHours => entitlementHours - usedHours;
/// Creates a [Benefit].
const Benefit({
required this.title,
required this.entitlementHours,
required this.usedHours,
});
@override
List<Object?> get props => [title, entitlementHours, usedHours];
}

View File

@@ -37,6 +37,12 @@ class Invoice extends Equatable {
required this.addonsAmount,
this.invoiceNumber,
this.issueDate,
this.title,
this.clientName,
this.locationAddress,
this.staffCount,
this.totalHours,
this.workers = const [],
});
/// Unique identifier.
final String id;
@@ -65,6 +71,24 @@ class Invoice extends Equatable {
/// Date when the invoice was issued.
final DateTime? issueDate;
/// Human-readable title (e.g. event name).
final String? title;
/// Name of the client business.
final String? clientName;
/// Address of the event/location.
final String? locationAddress;
/// Number of staff worked.
final int? staffCount;
/// Total hours worked.
final double? totalHours;
/// List of workers associated with this invoice.
final List<InvoiceWorker> workers;
@override
List<Object?> get props => <Object?>[
id,
@@ -76,5 +100,49 @@ class Invoice extends Equatable {
addonsAmount,
invoiceNumber,
issueDate,
title,
clientName,
locationAddress,
staffCount,
totalHours,
workers,
];
}
/// Represents a worker entry in an [Invoice].
class InvoiceWorker extends Equatable {
const InvoiceWorker({
required this.name,
required this.role,
required this.amount,
required this.hours,
required this.rate,
this.checkIn,
this.checkOut,
this.breakMinutes = 0,
this.avatarUrl,
});
final String name;
final String role;
final double amount;
final double hours;
final double rate;
final DateTime? checkIn;
final DateTime? checkOut;
final int breakMinutes;
final String? avatarUrl;
@override
List<Object?> get props => [
name,
role,
amount,
hours,
rate,
checkIn,
checkOut,
breakMinutes,
avatarUrl,
];
}