feat: implement staff documents feature with localization and navigation updates
This commit is contained in:
@@ -580,5 +580,24 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"staff_documents": {
|
||||
"title": "Documents",
|
||||
"verification_card": {
|
||||
"title": "Document Verification",
|
||||
"progress": "$completed/$total Complete"
|
||||
},
|
||||
"list": {
|
||||
"empty": "No documents found",
|
||||
"error": "Error: $message"
|
||||
},
|
||||
"card": {
|
||||
"view": "View",
|
||||
"upload": "Upload",
|
||||
"verified": "Verified",
|
||||
"pending": "Pending",
|
||||
"missing": "Missing",
|
||||
"rejected": "Rejected"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ extension ProfileNavigator on IModularNavigator {
|
||||
|
||||
/// Navigates to the documents page.
|
||||
void pushDocuments() {
|
||||
pushNamed('/documents');
|
||||
pushNamed('../documents');
|
||||
}
|
||||
|
||||
/// Navigates to the certificates page.
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
import 'package:krow_domain/krow_domain.dart';
|
||||
import '../../domain/repositories/documents_repository.dart';
|
||||
|
||||
class DocumentsRepositoryMock implements DocumentsRepository {
|
||||
@override
|
||||
Future<List<StaffDocument>> getDocuments() async {
|
||||
const List<StaffDocument> documents = <StaffDocument>[
|
||||
StaffDocument(
|
||||
id: '1',
|
||||
documentId: 'gov_id_1',
|
||||
staffId: 'current_user',
|
||||
name: 'Government ID',
|
||||
description: 'Passport, Driver\'s License, or State ID',
|
||||
status: DocumentStatus.verified,
|
||||
),
|
||||
StaffDocument(
|
||||
id: '2',
|
||||
documentId: 'ssn_1',
|
||||
staffId: 'current_user',
|
||||
name: 'Social Security Card',
|
||||
description: 'Or W-9 Form',
|
||||
status: DocumentStatus.pending,
|
||||
),
|
||||
StaffDocument(
|
||||
id: '3',
|
||||
documentId: 'work_auth_1',
|
||||
staffId: 'current_user',
|
||||
name: 'Work Authorization',
|
||||
description: 'I-9 or Work Permit',
|
||||
status: DocumentStatus.verified,
|
||||
),
|
||||
StaffDocument(
|
||||
id: '4',
|
||||
documentId: 'address_1',
|
||||
staffId: 'current_user',
|
||||
name: 'Proof of Address',
|
||||
description: 'Utility bill or bank statement',
|
||||
status: DocumentStatus.missing,
|
||||
),
|
||||
];
|
||||
|
||||
await Future<void>.delayed(const Duration(seconds: 1)); // Simulate network delay
|
||||
return documents;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
import 'package:krow_core/core.dart';
|
||||
|
||||
/// Arguments for the [GetDocumentsUseCase].
|
||||
class GetDocumentsArguments extends UseCaseArgument {
|
||||
/// The ID of the staff member to fetch documents for.
|
||||
final String staffId;
|
||||
|
||||
const GetDocumentsArguments({required this.staffId});
|
||||
|
||||
@override
|
||||
List<Object?> get props => <Object?>[staffId];
|
||||
}
|
||||
@@ -23,9 +23,7 @@ class DocumentsPage extends StatelessWidget {
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: UiColors.background,
|
||||
appBar: AppBar(
|
||||
backgroundColor: UiColors.bgPopup,
|
||||
elevation: 0,
|
||||
leading: IconButton(
|
||||
icon: const Icon(UiIcons.arrowLeft, color: UiColors.iconSecondary),
|
||||
|
||||
@@ -12,7 +12,7 @@ class StaffDocumentsModule extends Module {
|
||||
void binds(Injector i) {
|
||||
i.addLazySingleton<DocumentsRepository>(
|
||||
() => DocumentsRepositoryImpl(
|
||||
dataConnect: i.get<ExampleConnector>(),
|
||||
dataConnect: ExampleConnector.instance,
|
||||
firebaseAuth: FirebaseAuth.instance,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
library staff_documents;
|
||||
|
||||
export 'src/staff_documents_module.dart';
|
||||
@@ -1,58 +0,0 @@
|
||||
import 'package:staff_tax_forms/src/domain/entities/tax_form_entity.dart';
|
||||
import 'package:staff_tax_forms/src/domain/repositories/tax_forms_repository.dart';
|
||||
|
||||
class TaxFormsRepositoryMock implements TaxFormsRepository {
|
||||
final List<TaxFormEntity> _forms = [
|
||||
const TaxFormEntity(
|
||||
type: TaxFormType.i9,
|
||||
title: 'Form I-9',
|
||||
subtitle: 'Employment Eligibility Verification',
|
||||
description: 'Required to verify your identity and work authorization',
|
||||
status: TaxFormStatus.submitted,
|
||||
),
|
||||
const TaxFormEntity(
|
||||
type: TaxFormType.w4,
|
||||
title: 'Form W-4',
|
||||
subtitle: 'Employee\'s Withholding Certificate',
|
||||
description: 'Set up your federal tax withholding',
|
||||
status: TaxFormStatus.notStarted,
|
||||
),
|
||||
];
|
||||
|
||||
@override
|
||||
Future<List<TaxFormEntity>> getTaxForms() async {
|
||||
await Future.delayed(const Duration(milliseconds: 800)); // Simulating network
|
||||
return _forms;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> submitForm(TaxFormType type, Map<String, dynamic> data) async {
|
||||
await Future.delayed(const Duration(seconds: 1));
|
||||
final index = _forms.indexWhere((f) => f.type == type);
|
||||
if (index != -1) {
|
||||
_forms[index] = TaxFormEntity(
|
||||
type: _forms[index].type,
|
||||
title: _forms[index].title,
|
||||
subtitle: _forms[index].subtitle,
|
||||
description: _forms[index].description,
|
||||
status: TaxFormStatus.submitted,
|
||||
lastUpdated: DateTime.now(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> updateFormStatus(TaxFormType type, TaxFormStatus status) async {
|
||||
final index = _forms.indexWhere((f) => f.type == type);
|
||||
if (index != -1) {
|
||||
_forms[index] = TaxFormEntity(
|
||||
type: _forms[index].type,
|
||||
title: _forms[index].title,
|
||||
subtitle: _forms[index].subtitle,
|
||||
description: _forms[index].description,
|
||||
status: status,
|
||||
lastUpdated: DateTime.now(),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import 'package:staff_emergency_contact/staff_emergency_contact.dart';
|
||||
import 'package:staff_profile_experience/staff_profile_experience.dart';
|
||||
import 'package:staff_bank_account/staff_bank_account.dart';
|
||||
import 'package:staff_tax_forms/staff_tax_forms.dart';
|
||||
import 'package:staff_documents/staff_documents.dart';
|
||||
|
||||
import 'package:staff_main/src/presentation/blocs/staff_main_cubit.dart';
|
||||
import 'package:staff_main/src/presentation/constants/staff_main_routes.dart';
|
||||
@@ -55,5 +56,9 @@ class StaffMainModule extends Module {
|
||||
r.module('/experience', module: StaffProfileExperienceModule());
|
||||
r.module('/bank-account', module: StaffBankAccountModule());
|
||||
r.module('/tax-forms', module: StaffTaxFormsModule());
|
||||
r.module(
|
||||
'/documents',
|
||||
module: StaffDocumentsModule(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,8 @@ dependencies:
|
||||
path: ../profile_sections/finances/staff_bank_account
|
||||
staff_tax_forms:
|
||||
path: ../profile_sections/compliance/tax_forms
|
||||
staff_documents:
|
||||
path: ../profile_sections/compliance/documents
|
||||
# staff_shifts:
|
||||
# path: ../shifts
|
||||
# staff_payments:
|
||||
|
||||
@@ -1071,6 +1071,13 @@ packages:
|
||||
relative: true
|
||||
source: path
|
||||
version: "0.0.1"
|
||||
staff_documents:
|
||||
dependency: transitive
|
||||
description:
|
||||
path: "packages/features/staff/profile_sections/compliance/documents"
|
||||
relative: true
|
||||
source: path
|
||||
version: "0.0.1"
|
||||
staff_tax_forms:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
Reference in New Issue
Block a user