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,28 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
/// Represents a member of a Business.
|
||||
///
|
||||
/// Grants a user access to business-level operations.
|
||||
class BizMember extends Equatable {
|
||||
/// Unique identifier for this membership.
|
||||
final String id;
|
||||
|
||||
/// The [Business] the user belongs to.
|
||||
final String businessId;
|
||||
|
||||
/// The [User] who is a member.
|
||||
final String userId;
|
||||
|
||||
/// The role within the business.
|
||||
final String role;
|
||||
|
||||
const BizMember({
|
||||
required this.id,
|
||||
required this.businessId,
|
||||
required this.userId,
|
||||
required this.role,
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [id, businessId, userId, role];
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
/// Represents a member of a Hub.
|
||||
///
|
||||
/// Grants a user access to specific [Hub] operations, distinct from [BizMember].
|
||||
class HubMember extends Equatable {
|
||||
/// Unique identifier for this membership.
|
||||
final String id;
|
||||
|
||||
/// The [Hub] the user belongs to.
|
||||
final String hubId;
|
||||
|
||||
/// The [User] who is a member.
|
||||
final String userId;
|
||||
|
||||
/// The role within the hub.
|
||||
final String role;
|
||||
|
||||
const HubMember({
|
||||
required this.id,
|
||||
required this.hubId,
|
||||
required this.userId,
|
||||
required this.role,
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [id, hubId, userId, role];
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
/// Represents a polymorphic membership to an organization unit.
|
||||
///
|
||||
/// Allows a [User] to be a member of either a [Business] or a [Hub].
|
||||
class Membership extends Equatable {
|
||||
/// Unique identifier for the membership record.
|
||||
final String id;
|
||||
|
||||
/// The [User] holding this membership.
|
||||
final String userId;
|
||||
|
||||
/// The ID of the organization unit (Business or Hub).
|
||||
final String memberableId;
|
||||
|
||||
/// The type of the organization unit ('business' or 'hub').
|
||||
final String memberableType;
|
||||
|
||||
/// The role within that organization (e.g., 'manager', 'viewer').
|
||||
final String role;
|
||||
|
||||
const Membership({
|
||||
required this.id,
|
||||
required this.userId,
|
||||
required this.memberableId,
|
||||
required this.memberableType,
|
||||
required this.role,
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [id, userId, memberableId, memberableType, role];
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
/// The lifecycle status of a [Staff] account.
|
||||
enum StaffStatus {
|
||||
/// Account created but profile not started.
|
||||
registered,
|
||||
|
||||
/// Profile submitted and awaiting verification.
|
||||
pending,
|
||||
|
||||
/// Profile information filled but not submitted for verification.
|
||||
completedProfile,
|
||||
|
||||
/// Profile verified by admin.
|
||||
verified,
|
||||
|
||||
/// Staff is currently active and eligible for work.
|
||||
active,
|
||||
|
||||
/// Account is temporarily suspended.
|
||||
blocked,
|
||||
|
||||
/// Account is permanently inactive.
|
||||
inactive,
|
||||
}
|
||||
|
||||
/// Represents a worker profile.
|
||||
///
|
||||
/// Contains all personal and professional details of a staff member.
|
||||
/// Linked to a [User] via [authProviderId].
|
||||
class Staff extends Equatable {
|
||||
/// Unique identifier for the staff profile.
|
||||
final String id;
|
||||
|
||||
/// Link to the [User] authentication record.
|
||||
final String authProviderId;
|
||||
|
||||
/// Full display name.
|
||||
final String name;
|
||||
|
||||
/// Contact email.
|
||||
final String email;
|
||||
|
||||
/// Contact phone number.
|
||||
final String? phone;
|
||||
|
||||
/// Current workflow status of the staff member.
|
||||
final StaffStatus status;
|
||||
|
||||
/// Physical address string.
|
||||
final String? address;
|
||||
|
||||
/// URL to the avatar image.
|
||||
final String? avatar;
|
||||
|
||||
/// URL to a verified live photo for identity verification.
|
||||
final String? livePhoto;
|
||||
|
||||
const Staff({
|
||||
required this.id,
|
||||
required this.authProviderId,
|
||||
required this.name,
|
||||
required this.email,
|
||||
this.phone,
|
||||
required this.status,
|
||||
this.address,
|
||||
this.avatar,
|
||||
this.livePhoto,
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
id,
|
||||
authProviderId,
|
||||
name,
|
||||
email,
|
||||
phone,
|
||||
status,
|
||||
address,
|
||||
avatar,
|
||||
livePhoto,
|
||||
];
|
||||
}
|
||||
30
apps/mobile/packages/domain/lib/src/entities/users/user.dart
Normal file
30
apps/mobile/packages/domain/lib/src/entities/users/user.dart
Normal file
@@ -0,0 +1,30 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
/// Represents a base authenticated user in the KROW platform.
|
||||
///
|
||||
/// This entity corresponds to the Firebase Auth user record and acts as the
|
||||
/// linkage between the authentication system and the specific [Staff] or Client profiles.
|
||||
class User extends Equatable {
|
||||
/// The unique identifier from the authentication provider (e.g., Firebase UID).
|
||||
final String id;
|
||||
|
||||
/// The user's email address.
|
||||
final String email;
|
||||
|
||||
/// The user's phone number, if available.
|
||||
final String? phone;
|
||||
|
||||
/// The primary role of the user (e.g., 'staff', 'client_admin').
|
||||
/// This determines the initial routing and permissions.
|
||||
final String role;
|
||||
|
||||
const User({
|
||||
required this.id,
|
||||
required this.email,
|
||||
this.phone,
|
||||
required this.role,
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [id, email, phone, role];
|
||||
}
|
||||
Reference in New Issue
Block a user