feat: add ShiftAssignmentCard widget and StaffShifts module
- Implemented ShiftAssignmentCard widget for displaying shift assignments with client details, pay calculation, and confirmation actions. - Created StaffShiftsModule to manage dependencies, routes, and use cases related to staff shifts. - Added necessary dependencies in pubspec.yaml and generated pubspec.lock.
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
library;
|
||||
|
||||
export 'src/mocks/auth_repository_mock.dart';
|
||||
export 'src/mocks/shifts_repository_mock.dart';
|
||||
export 'src/mocks/staff_repository_mock.dart';
|
||||
export 'src/mocks/profile_repository_mock.dart';
|
||||
export 'src/mocks/event_repository_mock.dart';
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:krow_domain/krow_domain.dart';
|
||||
// TODO: Implement EventRepositoryInterface once defined in a feature package.
|
||||
class EventRepositoryMock {
|
||||
Future<Assignment> applyForPosition(String positionId, String staffId) async {
|
||||
await Future.delayed(const Duration(milliseconds: 600));
|
||||
await Future<void>.delayed(const Duration(milliseconds: 600));
|
||||
return Assignment(
|
||||
id: 'assign_1',
|
||||
positionId: positionId,
|
||||
@@ -13,12 +13,12 @@ class EventRepositoryMock {
|
||||
}
|
||||
|
||||
Future<Event?> getEvent(String id) async {
|
||||
await Future.delayed(const Duration(milliseconds: 300));
|
||||
await Future<void>.delayed(const Duration(milliseconds: 300));
|
||||
return _mockEvent;
|
||||
}
|
||||
|
||||
Future<List<EventShift>> getEventShifts(String eventId) async {
|
||||
await Future.delayed(const Duration(milliseconds: 300));
|
||||
await Future<void>.delayed(const Duration(milliseconds: 300));
|
||||
return <EventShift>[
|
||||
const EventShift(
|
||||
id: 'shift_1',
|
||||
@@ -30,7 +30,7 @@ class EventRepositoryMock {
|
||||
}
|
||||
|
||||
Future<List<Assignment>> getStaffAssignments(String staffId) async {
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
await Future<void>.delayed(const Duration(milliseconds: 500));
|
||||
return <Assignment>[
|
||||
const Assignment(
|
||||
id: 'assign_1',
|
||||
@@ -42,7 +42,7 @@ class EventRepositoryMock {
|
||||
}
|
||||
|
||||
Future<List<Event>> getUpcomingEvents() async {
|
||||
await Future.delayed(const Duration(milliseconds: 800));
|
||||
await Future<void>.delayed(const Duration(milliseconds: 800));
|
||||
return <Event>[_mockEvent];
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
import 'package:krow_domain/krow_domain.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
// Mock Implementation for now.
|
||||
class ShiftsRepositoryMock {
|
||||
|
||||
Future<List<Shift>> getMyShifts() async {
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
return [
|
||||
Shift(
|
||||
id: 'm1',
|
||||
title: 'Warehouse Assistant',
|
||||
clientName: 'Amazon',
|
||||
logoUrl: 'https://upload.wikimedia.org/wikipedia/commons/thumb/0/06/Amazon_2024.svg/500px-Amazon_2024.svg.png',
|
||||
hourlyRate: 22.5,
|
||||
date: DateFormat('yyyy-MM-dd').format(DateTime.now().add(const Duration(days: 1))),
|
||||
startTime: '09:00',
|
||||
endTime: '17:00',
|
||||
location: 'Logistics Park',
|
||||
locationAddress: '456 Industrial Way',
|
||||
status: 'confirmed',
|
||||
createdDate: DateTime.now().toIso8601String(),
|
||||
description: 'Standard warehouse duties. Safety boots required.',
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
Future<List<Shift>> getAvailableShifts() async {
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
return [
|
||||
Shift(
|
||||
id: 'a1',
|
||||
title: 'Bartender',
|
||||
clientName: 'Club Luxe',
|
||||
logoUrl: null,
|
||||
hourlyRate: 30.0,
|
||||
date: DateFormat('yyyy-MM-dd').format(DateTime.now().add(const Duration(days: 3))),
|
||||
startTime: '20:00',
|
||||
endTime: '02:00',
|
||||
location: 'City Center',
|
||||
locationAddress: '789 Nightlife Blvd',
|
||||
status: 'open',
|
||||
createdDate: DateTime.now().toIso8601String(),
|
||||
description: 'Experience mixing cocktails required.',
|
||||
),
|
||||
// Add more mocks if needed
|
||||
];
|
||||
}
|
||||
|
||||
Future<List<Shift>> getPendingAssignments() async {
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
return [
|
||||
Shift(
|
||||
id: 'p1',
|
||||
title: 'Event Server',
|
||||
clientName: 'Grand Hotel',
|
||||
logoUrl: null,
|
||||
hourlyRate: 25.0,
|
||||
date: DateFormat('yyyy-MM-dd').format(DateTime.now().add(const Duration(days: 2))),
|
||||
startTime: '16:00',
|
||||
endTime: '22:00',
|
||||
location: 'Downtown',
|
||||
locationAddress: '123 Main St',
|
||||
status: 'pending',
|
||||
createdDate: DateTime.now().toIso8601String(),
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
Future<Shift?> getShiftDetails(String shiftId) async {
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
return Shift(
|
||||
id: shiftId,
|
||||
title: 'Event Server',
|
||||
clientName: 'Grand Hotel',
|
||||
logoUrl: null,
|
||||
hourlyRate: 25.0,
|
||||
date: DateFormat('yyyy-MM-dd').format(DateTime.now()),
|
||||
startTime: '16:00',
|
||||
endTime: '22:00',
|
||||
location: 'Downtown',
|
||||
locationAddress: '123 Main St, New York, NY',
|
||||
status: 'open',
|
||||
createdDate: DateTime.now().toIso8601String(),
|
||||
description: 'Provide exceptional customer service. Respond to guest requests or concerns promptly and professionally.',
|
||||
managers: [],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user