Merge dev
This commit is contained in:
@@ -26,7 +26,11 @@ class PermanentOrder extends Equatable {
|
||||
final Map<String, double> roleRates;
|
||||
|
||||
@override
|
||||
<<<<<<< Updated upstream
|
||||
List<Object?> get props => <Object?>[
|
||||
=======
|
||||
List<Object?> get props => [
|
||||
>>>>>>> Stashed changes
|
||||
startDate,
|
||||
permanentDays,
|
||||
positions,
|
||||
|
||||
@@ -1,13 +1,23 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
<<<<<<< Updated upstream
|
||||
import 'recurring_order_position.dart';
|
||||
|
||||
/// Represents a recurring staffing request spanning a date range.
|
||||
=======
|
||||
import 'one_time_order.dart';
|
||||
import 'one_time_order_position.dart';
|
||||
|
||||
/// Represents a customer's request for recurring staffing.
|
||||
>>>>>>> Stashed changes
|
||||
class RecurringOrder extends Equatable {
|
||||
const RecurringOrder({
|
||||
required this.startDate,
|
||||
required this.endDate,
|
||||
required this.recurringDays,
|
||||
<<<<<<< Updated upstream
|
||||
required this.location,
|
||||
=======
|
||||
>>>>>>> Stashed changes
|
||||
required this.positions,
|
||||
this.hub,
|
||||
this.eventName,
|
||||
@@ -15,6 +25,7 @@ class RecurringOrder extends Equatable {
|
||||
this.roleRates = const <String, double>{},
|
||||
});
|
||||
|
||||
<<<<<<< Updated upstream
|
||||
/// Start date for the recurring schedule.
|
||||
final DateTime startDate;
|
||||
|
||||
@@ -48,6 +59,25 @@ class RecurringOrder extends Equatable {
|
||||
endDate,
|
||||
recurringDays,
|
||||
location,
|
||||
=======
|
||||
final DateTime startDate;
|
||||
final DateTime endDate;
|
||||
|
||||
/// List of days (e.g., ['Monday', 'Wednesday']) or bitmask.
|
||||
final List<String> recurringDays;
|
||||
|
||||
final List<OneTimeOrderPosition> positions;
|
||||
final OneTimeOrderHubDetails? hub;
|
||||
final String? eventName;
|
||||
final String? vendorId;
|
||||
final Map<String, double> roleRates;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
startDate,
|
||||
endDate,
|
||||
recurringDays,
|
||||
>>>>>>> Stashed changes
|
||||
positions,
|
||||
hub,
|
||||
eventName,
|
||||
@@ -55,6 +85,7 @@ class RecurringOrder extends Equatable {
|
||||
roleRates,
|
||||
];
|
||||
}
|
||||
<<<<<<< Updated upstream
|
||||
|
||||
/// Minimal hub details used during recurring order creation.
|
||||
class RecurringOrderHubDetails extends Equatable {
|
||||
@@ -99,3 +130,5 @@ class RecurringOrderHubDetails extends Equatable {
|
||||
zipCode,
|
||||
];
|
||||
}
|
||||
=======
|
||||
>>>>>>> Stashed changes
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<<<<<<< Updated upstream
|
||||
import 'package:krow_core/core.dart';
|
||||
import 'package:krow_domain/krow_domain.dart';
|
||||
|
||||
@@ -5,6 +6,15 @@ import '../repositories/hub_repository_interface.dart';
|
||||
|
||||
/// Arguments for the UpdateHubUseCase.
|
||||
class UpdateHubArguments extends UseCaseArgument {
|
||||
=======
|
||||
import 'package:krow_domain/krow_domain.dart';
|
||||
|
||||
import '../repositories/hub_repository_interface.dart';
|
||||
import '../../domain/arguments/create_hub_arguments.dart';
|
||||
|
||||
/// Arguments for the UpdateHubUseCase.
|
||||
class UpdateHubArguments {
|
||||
>>>>>>> Stashed changes
|
||||
const UpdateHubArguments({
|
||||
required this.id,
|
||||
this.name,
|
||||
@@ -16,9 +26,13 @@ class UpdateHubArguments extends UseCaseArgument {
|
||||
this.state,
|
||||
this.street,
|
||||
this.country,
|
||||
<<<<<<< Updated upstream
|
||||
this.country,
|
||||
this.zipCode,
|
||||
this.costCenter,
|
||||
=======
|
||||
this.zipCode,
|
||||
>>>>>>> Stashed changes
|
||||
});
|
||||
|
||||
final String id;
|
||||
@@ -32,6 +46,7 @@ class UpdateHubArguments extends UseCaseArgument {
|
||||
final String? street;
|
||||
final String? country;
|
||||
final String? zipCode;
|
||||
<<<<<<< Updated upstream
|
||||
final String? costCenter;
|
||||
|
||||
@override
|
||||
@@ -53,6 +68,12 @@ class UpdateHubArguments extends UseCaseArgument {
|
||||
|
||||
/// Use case for updating an existing hub.
|
||||
class UpdateHubUseCase implements UseCase<UpdateHubArguments, Hub> {
|
||||
=======
|
||||
}
|
||||
|
||||
/// Use case for updating an existing hub.
|
||||
class UpdateHubUseCase implements UseCase<Future<Hub>, UpdateHubArguments> {
|
||||
>>>>>>> Stashed changes
|
||||
UpdateHubUseCase(this.repository);
|
||||
|
||||
final HubRepositoryInterface repository;
|
||||
@@ -71,7 +92,10 @@ class UpdateHubUseCase implements UseCase<UpdateHubArguments, Hub> {
|
||||
street: params.street,
|
||||
country: params.country,
|
||||
zipCode: params.zipCode,
|
||||
<<<<<<< Updated upstream
|
||||
costCenter: params.costCenter,
|
||||
=======
|
||||
>>>>>>> Stashed changes
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
<<<<<<< Updated upstream
|
||||
import 'package:core_localization/core_localization.dart';
|
||||
=======
|
||||
>>>>>>> Stashed changes
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
<<<<<<< Updated upstream
|
||||
import 'package:krow_core/core.dart';
|
||||
import 'package:krow_domain/krow_domain.dart';
|
||||
|
||||
@@ -95,11 +99,74 @@ class HubDetailsPage extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
},
|
||||
=======
|
||||
import 'package:krow_domain/krow_domain.dart';
|
||||
import '../blocs/client_hubs_bloc.dart';
|
||||
import '../blocs/client_hubs_event.dart';
|
||||
import '../widgets/hub_form_dialog.dart';
|
||||
|
||||
class HubDetailsPage extends StatelessWidget {
|
||||
const HubDetailsPage({
|
||||
required this.hub,
|
||||
required this.bloc,
|
||||
super.key,
|
||||
});
|
||||
|
||||
final Hub hub;
|
||||
final ClientHubsBloc bloc;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocProvider<ClientHubsBloc>.value(
|
||||
value: bloc,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(hub.name),
|
||||
backgroundColor: UiColors.foreground,
|
||||
leading: IconButton(
|
||||
icon: const Icon(UiIcons.arrowLeft, color: UiColors.white),
|
||||
onPressed: () => Modular.to.pop(),
|
||||
),
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: const Icon(UiIcons.edit, color: UiColors.white),
|
||||
onPressed: () => _showEditDialog(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
backgroundColor: UiColors.bgMenu,
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(UiConstants.space5),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_buildDetailItem(
|
||||
label: 'Name',
|
||||
value: hub.name,
|
||||
icon: UiIcons.home,
|
||||
),
|
||||
const SizedBox(height: UiConstants.space4),
|
||||
_buildDetailItem(
|
||||
label: 'Address',
|
||||
value: hub.address,
|
||||
icon: UiIcons.mapPin,
|
||||
),
|
||||
const SizedBox(height: UiConstants.space4),
|
||||
_buildDetailItem(
|
||||
label: 'NFC Tag',
|
||||
value: hub.nfcTagId ?? 'Not Assigned',
|
||||
icon: UiIcons.nfc,
|
||||
isHighlight: hub.nfcTagId != null,
|
||||
),
|
||||
],
|
||||
),
|
||||
>>>>>>> Stashed changes
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
<<<<<<< Updated upstream
|
||||
Future<void> _navigateToEditPage(BuildContext context) async {
|
||||
final bool? saved = await Modular.to.toEditHub(hub: hub);
|
||||
if (saved == true && context.mounted) {
|
||||
@@ -122,13 +189,97 @@ class HubDetailsPage extends StatelessWidget {
|
||||
onPressed: () => Navigator.of(context).pop(true),
|
||||
style: TextButton.styleFrom(foregroundColor: UiColors.destructive),
|
||||
child: Text(t.client_hubs.delete_dialog.delete),
|
||||
=======
|
||||
Widget _buildDetailItem({
|
||||
required String label,
|
||||
required String value,
|
||||
required IconData icon,
|
||||
bool isHighlight = false,
|
||||
}) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(UiConstants.space4),
|
||||
decoration: BoxDecoration(
|
||||
color: UiColors.white,
|
||||
borderRadius: BorderRadius.circular(UiConstants.radiusBase),
|
||||
boxShadow: const [
|
||||
BoxShadow(
|
||||
color: UiColors.popupShadow,
|
||||
blurRadius: 10,
|
||||
offset: Offset(0, 4),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(UiConstants.space3),
|
||||
decoration: BoxDecoration(
|
||||
color: isHighlight ? UiColors.tagInProgress : UiColors.bgInput,
|
||||
borderRadius: BorderRadius.circular(UiConstants.radiusBase),
|
||||
),
|
||||
child: Icon(
|
||||
icon,
|
||||
color: isHighlight ? UiColors.iconSuccess : UiColors.iconPrimary,
|
||||
size: 20,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: UiConstants.space4),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
label,
|
||||
style: UiTypography.footnote1r.textSecondary,
|
||||
),
|
||||
const SizedBox(height: UiConstants.space1),
|
||||
Text(
|
||||
value,
|
||||
style: UiTypography.body1m.textPrimary,
|
||||
),
|
||||
],
|
||||
),
|
||||
>>>>>>> Stashed changes
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
<<<<<<< Updated upstream
|
||||
|
||||
if (confirm == true) {
|
||||
bloc.add(HubDetailsDeleteRequested(hub.id));
|
||||
}
|
||||
=======
|
||||
}
|
||||
|
||||
void _showEditDialog(BuildContext context) {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (_) => HubFormDialog(
|
||||
hub: hub,
|
||||
onSave: (name, address, {placeId, latitude, longitude, city, state, street, country, zipCode}) {
|
||||
bloc.add(
|
||||
ClientHubsUpdateRequested(
|
||||
id: hub.id,
|
||||
name: name,
|
||||
address: address,
|
||||
placeId: placeId,
|
||||
latitude: latitude,
|
||||
longitude: longitude,
|
||||
city: city,
|
||||
state: state,
|
||||
street: street,
|
||||
country: country,
|
||||
zipCode: zipCode,
|
||||
),
|
||||
);
|
||||
Navigator.of(context).pop(); // Close dialog
|
||||
Navigator.of(context).pop(); // Go back to list to refresh
|
||||
},
|
||||
onCancel: () => Navigator.of(context).pop(),
|
||||
),
|
||||
);
|
||||
>>>>>>> Stashed changes
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,10 @@ class HubFormDialog extends StatefulWidget {
|
||||
String? placeId,
|
||||
double? latitude,
|
||||
double? longitude,
|
||||
<<<<<<< Updated upstream
|
||||
String? costCenter,
|
||||
=======
|
||||
>>>>>>> Stashed changes
|
||||
}) onSave;
|
||||
|
||||
/// Callback when the dialog is cancelled.
|
||||
@@ -39,7 +42,10 @@ class HubFormDialog extends StatefulWidget {
|
||||
|
||||
class _HubFormDialogState extends State<HubFormDialog> {
|
||||
late final TextEditingController _nameController;
|
||||
<<<<<<< Updated upstream
|
||||
late final TextEditingController _costCenterController;
|
||||
=======
|
||||
>>>>>>> Stashed changes
|
||||
late final TextEditingController _addressController;
|
||||
late final FocusNode _addressFocusNode;
|
||||
Prediction? _selectedPrediction;
|
||||
@@ -48,7 +54,10 @@ class _HubFormDialogState extends State<HubFormDialog> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
_nameController = TextEditingController(text: widget.hub?.name);
|
||||
<<<<<<< Updated upstream
|
||||
_costCenterController = TextEditingController(text: widget.hub?.costCenter);
|
||||
=======
|
||||
>>>>>>> Stashed changes
|
||||
_addressController = TextEditingController(text: widget.hub?.address);
|
||||
_addressFocusNode = FocusNode();
|
||||
}
|
||||
@@ -56,7 +65,10 @@ class _HubFormDialogState extends State<HubFormDialog> {
|
||||
@override
|
||||
void dispose() {
|
||||
_nameController.dispose();
|
||||
<<<<<<< Updated upstream
|
||||
_costCenterController.dispose();
|
||||
=======
|
||||
>>>>>>> Stashed changes
|
||||
_addressController.dispose();
|
||||
_addressFocusNode.dispose();
|
||||
super.dispose();
|
||||
@@ -72,7 +84,11 @@ class _HubFormDialogState extends State<HubFormDialog> {
|
||||
: t.client_hubs.add_hub_dialog.title;
|
||||
|
||||
final String buttonText = isEditing
|
||||
<<<<<<< Updated upstream
|
||||
? t.client_hubs.edit_hub.save_button
|
||||
=======
|
||||
? 'Save Changes' // TODO: localize
|
||||
>>>>>>> Stashed changes
|
||||
: t.client_hubs.add_hub_dialog.create_button;
|
||||
|
||||
return Container(
|
||||
@@ -115,6 +131,7 @@ class _HubFormDialogState extends State<HubFormDialog> {
|
||||
),
|
||||
),
|
||||
const SizedBox(height: UiConstants.space4),
|
||||
<<<<<<< Updated upstream
|
||||
_buildFieldLabel(t.client_hubs.add_hub_dialog.cost_center_label),
|
||||
TextFormField(
|
||||
controller: _costCenterController,
|
||||
@@ -125,6 +142,8 @@ class _HubFormDialogState extends State<HubFormDialog> {
|
||||
textInputAction: TextInputAction.next,
|
||||
),
|
||||
const SizedBox(height: UiConstants.space4),
|
||||
=======
|
||||
>>>>>>> Stashed changes
|
||||
_buildFieldLabel(t.client_hubs.add_hub_dialog.address_label),
|
||||
HubAddressAutocomplete(
|
||||
controller: _addressController,
|
||||
@@ -160,11 +179,18 @@ class _HubFormDialogState extends State<HubFormDialog> {
|
||||
latitude: double.tryParse(
|
||||
_selectedPrediction?.lat ?? '',
|
||||
),
|
||||
<<<<<<< Updated upstream
|
||||
longitude: double.tryParse(
|
||||
_selectedPrediction?.lng ?? '',
|
||||
),
|
||||
costCenter: _costCenterController.text.trim().isEmpty ? null : _costCenterController.text.trim(),
|
||||
);
|
||||
=======
|
||||
longitude: double.tryParse(
|
||||
_selectedPrediction?.lng ?? '',
|
||||
),
|
||||
);
|
||||
>>>>>>> Stashed changes
|
||||
}
|
||||
},
|
||||
text: buttonText,
|
||||
|
||||
@@ -3,7 +3,11 @@ import 'package:krow_domain/krow_domain.dart';
|
||||
import '../repositories/client_create_order_repository_interface.dart';
|
||||
|
||||
/// Use case for creating a permanent staffing order.
|
||||
<<<<<<< Updated upstream:apps/mobile/packages/features/client/orders/create_order/lib/src/domain/usecases/create_permanent_order_usecase.dart
|
||||
class CreatePermanentOrderUseCase implements UseCase<PermanentOrder, void> {
|
||||
=======
|
||||
class CreatePermanentOrderUseCase implements UseCase<Future<void>, PermanentOrder> {
|
||||
>>>>>>> Stashed changes:apps/mobile/packages/features/client/create_order/lib/src/domain/usecases/create_permanent_order_usecase.dart
|
||||
const CreatePermanentOrderUseCase(this._repository);
|
||||
|
||||
final ClientCreateOrderRepositoryInterface _repository;
|
||||
|
||||
@@ -3,7 +3,11 @@ import 'package:krow_domain/krow_domain.dart';
|
||||
import '../repositories/client_create_order_repository_interface.dart';
|
||||
|
||||
/// Use case for creating a recurring staffing order.
|
||||
<<<<<<< Updated upstream:apps/mobile/packages/features/client/orders/create_order/lib/src/domain/usecases/create_recurring_order_usecase.dart
|
||||
class CreateRecurringOrderUseCase implements UseCase<RecurringOrder, void> {
|
||||
=======
|
||||
class CreateRecurringOrderUseCase implements UseCase<Future<void>, RecurringOrder> {
|
||||
>>>>>>> Stashed changes:apps/mobile/packages/features/client/create_order/lib/src/domain/usecases/create_recurring_order_usecase.dart
|
||||
const CreateRecurringOrderUseCase(this._repository);
|
||||
|
||||
final ClientCreateOrderRepositoryInterface _repository;
|
||||
|
||||
@@ -13,7 +13,11 @@ class ReorderArguments {
|
||||
}
|
||||
|
||||
/// Use case for reordering an existing staffing order.
|
||||
<<<<<<< Updated upstream:apps/mobile/packages/features/client/orders/create_order/lib/src/domain/usecases/reorder_usecase.dart
|
||||
class ReorderUseCase implements UseCase<ReorderArguments, void> {
|
||||
=======
|
||||
class ReorderUseCase implements UseCase<Future<void>, ReorderArguments> {
|
||||
>>>>>>> Stashed changes:apps/mobile/packages/features/client/create_order/lib/src/domain/usecases/reorder_usecase.dart
|
||||
const ReorderUseCase(this._repository);
|
||||
|
||||
final ClientCreateOrderRepositoryInterface _repository;
|
||||
|
||||
@@ -3,6 +3,10 @@ import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
<<<<<<< Updated upstream
|
||||
=======
|
||||
import 'package:krow_core/core.dart';
|
||||
>>>>>>> Stashed changes
|
||||
import '../../blocs/client_settings_bloc.dart';
|
||||
|
||||
/// A widget that displays the log out button.
|
||||
@@ -58,7 +62,11 @@ class SettingsLogout extends StatelessWidget {
|
||||
style: UiTypography.headline3m.textPrimary,
|
||||
),
|
||||
content: Text(
|
||||
<<<<<<< Updated upstream
|
||||
'Are you sure you want to log out?',
|
||||
=======
|
||||
t.client_settings.profile.log_out_confirmation,
|
||||
>>>>>>> Stashed changes
|
||||
style: UiTypography.body2r.textSecondary,
|
||||
),
|
||||
actions: <Widget>[
|
||||
|
||||
Reference in New Issue
Block a user