- 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:
@@ -52,6 +52,7 @@ export 'src/entities/skills/certificate.dart';
|
||||
export 'src/entities/skills/skill_kit.dart';
|
||||
|
||||
// Financial & Payroll
|
||||
export 'src/entities/benefits/benefit.dart';
|
||||
export 'src/entities/financial/invoice.dart';
|
||||
export 'src/entities/financial/time_card.dart';
|
||||
export 'src/entities/financial/invoice_item.dart';
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
@@ -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,
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user