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:
Achintha Isuru
2026-01-22 16:47:39 -05:00
parent 7090efb583
commit 4b3125de1a
80 changed files with 2472 additions and 531 deletions

View File

@@ -26,6 +26,16 @@ enum InvoiceStatus {
/// Represents a bill sent to a [Business] for services rendered.
class Invoice extends Equatable {
const Invoice({
required this.id,
required this.eventId,
required this.businessId,
required this.status,
required this.totalAmount,
required this.workAmount,
required this.addonsAmount,
});
/// Unique identifier.
final String id;
@@ -47,18 +57,8 @@ class Invoice extends Equatable {
/// Total amount for addons/extras.
final double addonsAmount;
const Invoice({
required this.id,
required this.eventId,
required this.businessId,
required this.status,
required this.totalAmount,
required this.workAmount,
required this.addonsAmount,
});
@override
List<Object?> get props => [
List<Object?> get props => <Object?>[
id,
eventId,
businessId,

View File

@@ -2,6 +2,13 @@ import 'package:equatable/equatable.dart';
/// Represents a reason or log for a declined [Invoice].
class InvoiceDecline extends Equatable {
const InvoiceDecline({
required this.id,
required this.invoiceId,
required this.reason,
required this.declinedAt,
});
/// Unique identifier.
final String id;
@@ -14,13 +21,6 @@ class InvoiceDecline extends Equatable {
/// When the decline happened.
final DateTime declinedAt;
const InvoiceDecline({
required this.id,
required this.invoiceId,
required this.reason,
required this.declinedAt,
});
@override
List<Object?> get props => [id, invoiceId, reason, declinedAt];
List<Object?> get props => <Object?>[id, invoiceId, reason, declinedAt];
}

View File

@@ -4,6 +4,15 @@ import 'package:equatable/equatable.dart';
///
/// Corresponds to the work done by one [Staff] member.
class InvoiceItem extends Equatable {
const InvoiceItem({
required this.id,
required this.invoiceId,
required this.staffId,
required this.workHours,
required this.rate,
required this.amount,
});
/// Unique identifier.
final String id;
@@ -22,15 +31,6 @@ class InvoiceItem extends Equatable {
/// Total line item amount (workHours * rate).
final double amount;
const InvoiceItem({
required this.id,
required this.invoiceId,
required this.staffId,
required this.workHours,
required this.rate,
required this.amount,
});
@override
List<Object?> get props => [id, invoiceId, staffId, workHours, rate, amount];
List<Object?> get props => <Object?>[id, invoiceId, staffId, workHours, rate, amount];
}

View File

@@ -17,6 +17,15 @@ enum PaymentStatus {
/// Represents a payout to a [Staff] member for a completed [Assignment].
class StaffPayment extends Equatable {
const StaffPayment({
required this.id,
required this.staffId,
required this.assignmentId,
required this.amount,
required this.status,
this.paidAt,
});
/// Unique identifier.
final String id;
@@ -35,15 +44,6 @@ class StaffPayment extends Equatable {
/// When the payment was successfully processed.
final DateTime? paidAt;
const StaffPayment({
required this.id,
required this.staffId,
required this.assignmentId,
required this.amount,
required this.status,
this.paidAt,
});
@override
List<Object?> get props => [id, staffId, assignmentId, amount, status, paidAt];
List<Object?> get props => <Object?>[id, staffId, assignmentId, amount, status, paidAt];
}