Add client view orders feature module

Introduces the client 'View Orders' feature, including domain entity, repository, use case, Cubit, state, navigation extension, UI page, and widget. Integrates the feature into the client main module, updates localization files for English and Spanish, and adds supporting icons to the design system. Also updates the mock repository to provide sample order data.
This commit is contained in:
Achintha Isuru
2026-01-23 11:28:51 -05:00
parent a964fcabd7
commit 960b21ec8c
21 changed files with 1695 additions and 8 deletions

View File

@@ -31,6 +31,7 @@ export 'src/entities/events/work_session.dart';
export 'src/entities/orders/order_type.dart';
export 'src/entities/orders/one_time_order.dart';
export 'src/entities/orders/one_time_order_position.dart';
export 'src/entities/orders/order_item.dart';
// Skills & Certs
export 'src/entities/skills/skill.dart';

View File

@@ -0,0 +1,80 @@
import 'package:equatable/equatable.dart';
/// Represents a customer's view of an order or shift.
///
/// This entity captures the details necessary for the dashboard/view orders screen,
/// including status and worker assignments.
class OrderItem extends Equatable {
/// Creates an [OrderItem].
const OrderItem({
required this.id,
required this.title,
required this.clientName,
required this.status,
required this.date,
required this.startTime,
required this.endTime,
required this.location,
required this.locationAddress,
required this.filled,
required this.workersNeeded,
required this.hourlyRate,
this.confirmedApps = const <Map<String, dynamic>>[],
});
/// Unique identifier of the order.
final String id;
/// Title or name of the role.
final String title;
/// Name of the client company.
final String clientName;
/// status of the order (e.g., 'open', 'filled', 'completed').
final String status;
/// Date of the shift (ISO format).
final String date;
/// Start time of the shift.
final String startTime;
/// End time of the shift.
final String endTime;
/// Location name.
final String location;
/// Full address of the location.
final String locationAddress;
/// Number of workers currently filled.
final int filled;
/// Total number of workers required.
final int workersNeeded;
/// Hourly pay rate.
final double hourlyRate;
/// List of confirmed worker applications.
final List<Map<String, dynamic>> confirmedApps;
@override
List<Object?> get props => <Object?>[
id,
title,
clientName,
status,
date,
startTime,
endTime,
location,
locationAddress,
filled,
workersNeeded,
hourlyRate,
confirmedApps,
];
}