Move apps to mobile directory structure
Relocated all app directories (client, design_system_viewer, staff) and their contents under the new 'apps/mobile' path. This change improves project organization and prepares for future platform-specific structuring.
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
import 'package:krow_domain/krow_domain.dart';
|
||||
|
||||
// TODO: Implement AuthRepositoryInterface once defined in a feature package.
|
||||
class AuthRepositoryMock {
|
||||
Stream<User?> get currentUser => Stream.value(
|
||||
const User(id: 'mock_user_1', email: 'test@krow.com', role: 'staff'),
|
||||
);
|
||||
|
||||
Future<String?> signInWithPhone(String phoneNumber) async {
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
return 'mock_verification_id';
|
||||
}
|
||||
|
||||
Future<User?> verifyOtp(String verificationId, String smsCode) async {
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
return const User(id: 'mock_user_1', email: 'test@krow.com', role: 'staff');
|
||||
}
|
||||
|
||||
Future<void> signOut() async {
|
||||
await Future.delayed(const Duration(milliseconds: 200));
|
||||
}
|
||||
|
||||
/// Signs in a user with email and password (Mock).
|
||||
Future<User> signInWithEmail(String email, String password) async {
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
return User(id: 'mock_client_1', email: email, role: 'client_admin');
|
||||
}
|
||||
|
||||
/// Registers a new user with email and password (Mock).
|
||||
Future<User> signUpWithEmail(
|
||||
String email,
|
||||
String password,
|
||||
String companyName,
|
||||
) async {
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
return User(id: 'mock_client_new', email: email, role: 'client_admin');
|
||||
}
|
||||
|
||||
/// Authenticates using a social provider (Mock).
|
||||
Future<User> signInWithSocial(String provider) async {
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
return const User(
|
||||
id: 'mock_social_user',
|
||||
email: 'social@example.com',
|
||||
role: 'client_admin',
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
import 'package:krow_domain/krow_domain.dart';
|
||||
|
||||
// TODO: Implement BusinessRepositoryInterface once defined in a feature package.
|
||||
class BusinessRepositoryMock {
|
||||
Future<Business?> getBusiness(String id) async {
|
||||
await Future.delayed(const Duration(milliseconds: 300));
|
||||
return const Business(
|
||||
id: 'biz_1',
|
||||
name: 'Acme Events Ltd',
|
||||
registrationNumber: 'REG123456',
|
||||
status: BusinessStatus.active,
|
||||
avatar: 'https://via.placeholder.com/150',
|
||||
);
|
||||
}
|
||||
|
||||
Future<List<Hub>> getHubs(String businessId) async {
|
||||
await Future.delayed(const Duration(milliseconds: 300));
|
||||
return [
|
||||
const Hub(
|
||||
id: 'hub_1',
|
||||
businessId: 'biz_1',
|
||||
name: 'London HQ',
|
||||
address: '123 Oxford Street, London',
|
||||
status: HubStatus.active,
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
Future<Hub> createHub({
|
||||
required String businessId,
|
||||
required String name,
|
||||
required String address,
|
||||
}) async {
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
return Hub(
|
||||
id: 'hub_${DateTime.now().millisecondsSinceEpoch}',
|
||||
businessId: businessId,
|
||||
name: name,
|
||||
address: address,
|
||||
status: HubStatus.active,
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> deleteHub(String id) async {
|
||||
await Future.delayed(const Duration(milliseconds: 300));
|
||||
}
|
||||
|
||||
Future<void> assignNfcTag({
|
||||
required String hubId,
|
||||
required String nfcTagId,
|
||||
}) async {
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
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));
|
||||
return Assignment(
|
||||
id: 'assign_1',
|
||||
positionId: positionId,
|
||||
staffId: staffId,
|
||||
status: AssignmentStatus.assigned,
|
||||
);
|
||||
}
|
||||
|
||||
Future<Event?> getEvent(String id) async {
|
||||
await Future.delayed(const Duration(milliseconds: 300));
|
||||
return _mockEvent;
|
||||
}
|
||||
|
||||
Future<List<EventShift>> getEventShifts(String eventId) async {
|
||||
await Future.delayed(const Duration(milliseconds: 300));
|
||||
return [
|
||||
const EventShift(
|
||||
id: 'shift_1',
|
||||
eventId: 'event_1',
|
||||
name: 'Morning Setup',
|
||||
address: 'Hyde Park, London',
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
Future<List<Assignment>> getStaffAssignments(String staffId) async {
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
return [
|
||||
const Assignment(
|
||||
id: 'assign_1',
|
||||
positionId: 'pos_1',
|
||||
staffId: 'staff_1',
|
||||
status: AssignmentStatus.confirmed,
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
Future<List<Event>> getUpcomingEvents() async {
|
||||
await Future.delayed(const Duration(milliseconds: 800));
|
||||
return [_mockEvent];
|
||||
}
|
||||
|
||||
static final _mockEvent = Event(
|
||||
id: 'event_1',
|
||||
businessId: 'biz_1',
|
||||
hubId: 'hub_1',
|
||||
name: 'Summer Festival 2026',
|
||||
date: DateTime.now().add(const Duration(days: 10)),
|
||||
status: EventStatus.active,
|
||||
contractType: 'freelance',
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import 'package:krow_domain/krow_domain.dart';
|
||||
|
||||
// TODO: Implement FinancialRepositoryInterface once defined in a feature package.
|
||||
class FinancialRepositoryMock {
|
||||
Future<List<Invoice>> getInvoices(String businessId) async {
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
return [
|
||||
const Invoice(
|
||||
id: 'inv_1',
|
||||
eventId: 'event_1',
|
||||
businessId: 'biz_1',
|
||||
status: InvoiceStatus.paid,
|
||||
totalAmount: 1500.0,
|
||||
workAmount: 1400.0,
|
||||
addonsAmount: 100.0,
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
Future<List<StaffPayment>> getStaffPayments(String staffId) async {
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
return [
|
||||
StaffPayment(
|
||||
id: 'pay_1',
|
||||
staffId: staffId,
|
||||
assignmentId: 'assign_1',
|
||||
amount: 120.0,
|
||||
status: PaymentStatus.paid,
|
||||
paidAt: DateTime.now().subtract(const Duration(days: 2)),
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import 'package:krow_domain/krow_domain.dart';
|
||||
|
||||
/// Mock implementation of data source for Home dashboard data.
|
||||
///
|
||||
/// This mock simulates backend responses for dashboard-related queries.
|
||||
class HomeRepositoryMock {
|
||||
/// Returns a mock [HomeDashboardData].
|
||||
Future<HomeDashboardData> getDashboardData() async {
|
||||
// Simulate network delay
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
|
||||
return const HomeDashboardData(
|
||||
weeklySpending: 4250.0,
|
||||
next7DaysSpending: 6100.0,
|
||||
weeklyShifts: 12,
|
||||
next7DaysScheduled: 18,
|
||||
totalNeeded: 10,
|
||||
totalFilled: 8,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import 'package:krow_domain/krow_domain.dart';
|
||||
|
||||
// TODO: Implement RatingRepositoryInterface once defined in a feature package.
|
||||
class RatingRepositoryMock {
|
||||
Future<List<StaffRating>> getStaffRatings(String staffId) async {
|
||||
await Future.delayed(const Duration(milliseconds: 400));
|
||||
return [
|
||||
const StaffRating(
|
||||
id: 'rate_1',
|
||||
staffId: 'staff_1',
|
||||
eventId: 'event_1',
|
||||
businessId: 'biz_1',
|
||||
rating: 5,
|
||||
comment: 'Great work!',
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
Future<void> submitRating(StaffRating rating) async {
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
import 'package:krow_domain/krow_domain.dart';
|
||||
|
||||
// TODO: Implement SkillRepositoryInterface once defined in a feature package.
|
||||
class SkillRepositoryMock {
|
||||
Future<void> addStaffSkill(StaffSkill skill) async {
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
}
|
||||
|
||||
Future<List<Skill>> getAllSkills() async {
|
||||
await Future.delayed(const Duration(milliseconds: 300));
|
||||
return [
|
||||
const Skill(
|
||||
id: 'skill_1',
|
||||
categoryId: 'cat_1',
|
||||
name: 'Bartender',
|
||||
basePrice: 15.0,
|
||||
),
|
||||
const Skill(
|
||||
id: 'skill_2',
|
||||
categoryId: 'cat_2',
|
||||
name: 'Security Guard',
|
||||
basePrice: 18.0,
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
Future<List<StaffSkill>> getStaffSkills(String staffId) async {
|
||||
await Future.delayed(const Duration(milliseconds: 400));
|
||||
return [
|
||||
const StaffSkill(
|
||||
id: 'staff_skill_1',
|
||||
staffId: 'staff_1',
|
||||
skillId: 'skill_1',
|
||||
level: SkillLevel.skilled,
|
||||
experienceYears: 3,
|
||||
status: StaffSkillStatus.verified,
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import 'package:krow_domain/krow_domain.dart';
|
||||
|
||||
// TODO: Implement StaffRepositoryInterface once defined in a feature package.
|
||||
class StaffRepositoryMock {
|
||||
Future<Staff> createStaffProfile(Staff staff) async {
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
return staff;
|
||||
}
|
||||
|
||||
Future<List<Membership>> getMemberships(String userId) async {
|
||||
await Future.delayed(const Duration(milliseconds: 300));
|
||||
return [
|
||||
Membership(
|
||||
id: 'mem_1',
|
||||
userId: userId,
|
||||
memberableId: 'biz_1',
|
||||
memberableType: 'business',
|
||||
role: 'staff',
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
Future<Staff?> getStaffProfile(String userId) async {
|
||||
await Future.delayed(const Duration(milliseconds: 400));
|
||||
return Staff(
|
||||
id: 'staff_1',
|
||||
authProviderId: userId,
|
||||
name: 'John Doe',
|
||||
email: 'john@krow.com',
|
||||
status: StaffStatus.active,
|
||||
avatar: 'https://i.pravatar.cc/300',
|
||||
);
|
||||
}
|
||||
|
||||
Future<Staff> updateStaffProfile(Staff staff) async {
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
return staff;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import 'package:krow_domain/krow_domain.dart';
|
||||
|
||||
// TODO: Implement SupportRepositoryInterface once defined in a feature package.
|
||||
class SupportRepositoryMock {
|
||||
Future<List<Tag>> getTags() async {
|
||||
await Future.delayed(const Duration(milliseconds: 200));
|
||||
return [
|
||||
const Tag(id: 'tag_1', label: 'Urgent'),
|
||||
const Tag(id: 'tag_2', label: 'VIP Event'),
|
||||
];
|
||||
}
|
||||
|
||||
Future<List<WorkingArea>> getWorkingAreas() async {
|
||||
await Future.delayed(const Duration(milliseconds: 200));
|
||||
return [
|
||||
const WorkingArea(
|
||||
id: 'area_1',
|
||||
name: 'Central London',
|
||||
centerLat: 51.5074,
|
||||
centerLng: -0.1278,
|
||||
radiusKm: 10.0,
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user