hub & manager issues

This commit is contained in:
2026-02-25 19:58:28 +05:30
parent 27754524f5
commit eeb8c28a61
53 changed files with 1571 additions and 245 deletions

View File

@@ -19,6 +19,7 @@ export 'src/entities/business/business_setting.dart';
export 'src/entities/business/hub.dart';
export 'src/entities/business/hub_department.dart';
export 'src/entities/business/vendor.dart';
export 'src/entities/business/cost_center.dart';
// Events & Assignments
export 'src/entities/events/event.dart';

View File

@@ -0,0 +1,22 @@
import 'package:equatable/equatable.dart';
/// Represents a financial cost center used for billing and tracking.
class CostCenter extends Equatable {
const CostCenter({
required this.id,
required this.name,
this.code,
});
/// Unique identifier.
final String id;
/// Display name of the cost center.
final String name;
/// Optional alphanumeric code associated with this cost center.
final String? code;
@override
List<Object?> get props => <Object?>[id, name, code];
}

View File

@@ -1,5 +1,7 @@
import 'package:equatable/equatable.dart';
import 'cost_center.dart';
/// The status of a [Hub].
enum HubStatus {
/// Fully operational.
@@ -42,7 +44,7 @@ class Hub extends Equatable {
final HubStatus status;
/// Assigned cost center for this hub.
final String? costCenter;
final CostCenter? costCenter;
@override
List<Object?> get props => <Object?>[id, businessId, name, address, nfcTagId, status, costCenter];

View File

@@ -13,6 +13,7 @@ class OneTimeOrder extends Equatable {
this.hub,
this.eventName,
this.vendorId,
this.hubManagerId,
this.roleRates = const <String, double>{},
});
/// The specific date for the shift or event.
@@ -33,6 +34,9 @@ class OneTimeOrder extends Equatable {
/// Selected vendor id for this order.
final String? vendorId;
/// Optional hub manager id.
final String? hubManagerId;
/// Role hourly rates keyed by role id.
final Map<String, double> roleRates;
@@ -44,6 +48,7 @@ class OneTimeOrder extends Equatable {
hub,
eventName,
vendorId,
hubManagerId,
roleRates,
];
}

View File

@@ -27,6 +27,8 @@ class OrderItem extends Equatable {
this.hours = 0,
this.totalValue = 0,
this.confirmedApps = const <Map<String, dynamic>>[],
this.hubManagerId,
this.hubManagerName,
});
/// Unique identifier of the order.
@@ -83,6 +85,12 @@ class OrderItem extends Equatable {
/// List of confirmed worker applications.
final List<Map<String, dynamic>> confirmedApps;
/// Optional ID of the assigned hub manager.
final String? hubManagerId;
/// Optional Name of the assigned hub manager.
final String? hubManagerName;
@override
List<Object?> get props => <Object?>[
id,
@@ -103,5 +111,7 @@ class OrderItem extends Equatable {
totalValue,
eventName,
confirmedApps,
hubManagerId,
hubManagerName,
];
}

View File

@@ -11,6 +11,7 @@ class PermanentOrder extends Equatable {
this.hub,
this.eventName,
this.vendorId,
this.hubManagerId,
this.roleRates = const <String, double>{},
});
@@ -23,6 +24,7 @@ class PermanentOrder extends Equatable {
final OneTimeOrderHubDetails? hub;
final String? eventName;
final String? vendorId;
final String? hubManagerId;
final Map<String, double> roleRates;
@override
@@ -33,6 +35,7 @@ class PermanentOrder extends Equatable {
hub,
eventName,
vendorId,
hubManagerId,
roleRates,
];
}

View File

@@ -12,6 +12,7 @@ class RecurringOrder extends Equatable {
this.hub,
this.eventName,
this.vendorId,
this.hubManagerId,
this.roleRates = const <String, double>{},
});
@@ -39,6 +40,9 @@ class RecurringOrder extends Equatable {
/// Selected vendor id for this order.
final String? vendorId;
/// Optional hub manager id.
final String? hubManagerId;
/// Role hourly rates keyed by role id.
final Map<String, double> roleRates;
@@ -52,6 +56,7 @@ class RecurringOrder extends Equatable {
hub,
eventName,
vendorId,
hubManagerId,
roleRates,
];
}