Add order entities and mocks for client order feature
Introduces new domain entities for order types and one-time orders, along with their positions. Adds a mock OrderRepository to the data_connect package and wires it into the module. Updates localization files for new order flows and refactors Equatable usage for consistency. Also adds a minus icon to the design system.
This commit is contained in:
@@ -26,6 +26,15 @@ enum AssignmentStatus {
|
||||
|
||||
/// Represents the link between a [Staff] member and an [EventShiftPosition].
|
||||
class Assignment extends Equatable {
|
||||
|
||||
const Assignment({
|
||||
required this.id,
|
||||
required this.positionId,
|
||||
required this.staffId,
|
||||
required this.status,
|
||||
this.clockIn,
|
||||
this.clockOut,
|
||||
});
|
||||
/// Unique identifier.
|
||||
final String id;
|
||||
|
||||
@@ -44,15 +53,6 @@ class Assignment extends Equatable {
|
||||
/// Actual timestamp when staff clocked out.
|
||||
final DateTime? clockOut;
|
||||
|
||||
const Assignment({
|
||||
required this.id,
|
||||
required this.positionId,
|
||||
required this.staffId,
|
||||
required this.status,
|
||||
this.clockIn,
|
||||
this.clockOut,
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [id, positionId, staffId, status, clockIn, clockOut];
|
||||
List<Object?> get props => <Object?>[id, positionId, staffId, status, clockIn, clockOut];
|
||||
}
|
||||
@@ -34,6 +34,16 @@ enum EventStatus {
|
||||
///
|
||||
/// This is the central entity for scheduling work. An Event contains [EventShift]s.
|
||||
class Event extends Equatable {
|
||||
|
||||
const Event({
|
||||
required this.id,
|
||||
required this.businessId,
|
||||
required this.hubId,
|
||||
required this.name,
|
||||
required this.date,
|
||||
required this.status,
|
||||
required this.contractType,
|
||||
});
|
||||
/// Unique identifier.
|
||||
final String id;
|
||||
|
||||
@@ -55,16 +65,6 @@ class Event extends Equatable {
|
||||
/// Type of employment contract (e.g., 'freelance', 'permanent').
|
||||
final String contractType;
|
||||
|
||||
const Event({
|
||||
required this.id,
|
||||
required this.businessId,
|
||||
required this.hubId,
|
||||
required this.name,
|
||||
required this.date,
|
||||
required this.status,
|
||||
required this.contractType,
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [id, businessId, hubId, name, date, status, contractType];
|
||||
List<Object?> get props => <Object?>[id, businessId, hubId, name, date, status, contractType];
|
||||
}
|
||||
@@ -4,6 +4,13 @@ import 'package:equatable/equatable.dart';
|
||||
///
|
||||
/// An Event can have multiple shifts (e.g. "Morning Shift", "Evening Shift").
|
||||
class EventShift extends Equatable {
|
||||
|
||||
const EventShift({
|
||||
required this.id,
|
||||
required this.eventId,
|
||||
required this.name,
|
||||
required this.address,
|
||||
});
|
||||
/// Unique identifier.
|
||||
final String id;
|
||||
|
||||
@@ -16,13 +23,6 @@ class EventShift extends Equatable {
|
||||
/// Specific address for this shift (if different from Hub).
|
||||
final String address;
|
||||
|
||||
const EventShift({
|
||||
required this.id,
|
||||
required this.eventId,
|
||||
required this.name,
|
||||
required this.address,
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [id, eventId, name, address];
|
||||
List<Object?> get props => <Object?>[id, eventId, name, address];
|
||||
}
|
||||
@@ -4,6 +4,17 @@ import 'package:equatable/equatable.dart';
|
||||
///
|
||||
/// Defines the requirement for a specific [Skill], the quantity needed, and the pay.
|
||||
class EventShiftPosition extends Equatable {
|
||||
|
||||
const EventShiftPosition({
|
||||
required this.id,
|
||||
required this.shiftId,
|
||||
required this.skillId,
|
||||
required this.count,
|
||||
required this.rate,
|
||||
required this.startTime,
|
||||
required this.endTime,
|
||||
required this.breakDurationMinutes,
|
||||
});
|
||||
/// Unique identifier.
|
||||
final String id;
|
||||
|
||||
@@ -28,19 +39,8 @@ class EventShiftPosition extends Equatable {
|
||||
/// Deducted break duration in minutes.
|
||||
final int breakDurationMinutes;
|
||||
|
||||
const EventShiftPosition({
|
||||
required this.id,
|
||||
required this.shiftId,
|
||||
required this.skillId,
|
||||
required this.count,
|
||||
required this.rate,
|
||||
required this.startTime,
|
||||
required this.endTime,
|
||||
required this.breakDurationMinutes,
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
List<Object?> get props => <Object?>[
|
||||
id,
|
||||
shiftId,
|
||||
skillId,
|
||||
|
||||
@@ -4,6 +4,14 @@ import 'package:equatable/equatable.dart';
|
||||
///
|
||||
/// Derived from [Assignment] clock-in/out times, used for payroll.
|
||||
class WorkSession extends Equatable {
|
||||
|
||||
const WorkSession({
|
||||
required this.id,
|
||||
required this.assignmentId,
|
||||
required this.startTime,
|
||||
this.endTime,
|
||||
required this.breakDurationMinutes,
|
||||
});
|
||||
/// Unique identifier.
|
||||
final String id;
|
||||
|
||||
@@ -19,14 +27,6 @@ class WorkSession extends Equatable {
|
||||
/// Verified break duration.
|
||||
final int breakDurationMinutes;
|
||||
|
||||
const WorkSession({
|
||||
required this.id,
|
||||
required this.assignmentId,
|
||||
required this.startTime,
|
||||
this.endTime,
|
||||
required this.breakDurationMinutes,
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [id, assignmentId, startTime, endTime, breakDurationMinutes];
|
||||
List<Object?> get props => <Object?>[id, assignmentId, startTime, endTime, breakDurationMinutes];
|
||||
}
|
||||
Reference in New Issue
Block a user