Refactor staff data models to use List<String> for skills and industries
- Updated GetStaffByIdStaff, GetStaffByUserIdStaffs, ListStaffStaffs, and UpdateStaffVariablesBuilder classes to replace AnyValue with List<String> for skills and industries. - Modified JSON serialization and deserialization logic accordingly. - Adjusted ExperienceRepositoryImpl to handle List<String> for industries and skills. - Updated GraphQL mutations and schema to reflect changes in data types for skills and industries.
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
import 'package:firebase_auth/firebase_auth.dart';
|
||||
import 'package:firebase_data_connect/firebase_data_connect.dart' as fdc;
|
||||
import 'package:krow_data_connect/krow_data_connect.dart' as dc;
|
||||
import 'package:krow_domain/krow_domain.dart';
|
||||
import '../../domain/repositories/experience_repository_interface.dart';
|
||||
|
||||
/// Implementation of [ExperienceRepositoryInterface] that delegates to Data Connect.
|
||||
@@ -10,7 +8,7 @@ class ExperienceRepositoryImpl implements ExperienceRepositoryInterface {
|
||||
// ignore: unused_field
|
||||
final FirebaseAuth _firebaseAuth;
|
||||
|
||||
/// Creates a [ExperienceRepositoryImpl] using Data Connect and Auth.
|
||||
/// Creates a [ExperienceRepositoryImpl] using Da a Connect and Auth.
|
||||
ExperienceRepositoryImpl({
|
||||
required dc.ExampleConnector dataConnect,
|
||||
required FirebaseAuth firebaseAuth,
|
||||
@@ -28,13 +26,13 @@ class ExperienceRepositoryImpl implements ExperienceRepositoryInterface {
|
||||
@override
|
||||
Future<List<String>> getIndustries(String staffId) async {
|
||||
final staff = await _getStaff(staffId);
|
||||
return ExperienceAdapter.fromDynamicList(staff.industries?.value);
|
||||
return staff.industries ?? [];
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<String>> getSkills(String staffId) async {
|
||||
final staff = await _getStaff(staffId);
|
||||
return ExperienceAdapter.fromDynamicList(staff.skills?.value);
|
||||
return staff.skills ?? [];
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -45,8 +43,8 @@ class ExperienceRepositoryImpl implements ExperienceRepositoryInterface {
|
||||
) async {
|
||||
await _dataConnect
|
||||
.updateStaff(id: staffId)
|
||||
.industries(fdc.AnyValue(industries))
|
||||
.skills(fdc.AnyValue(skills))
|
||||
.industries(industries)
|
||||
.skills(skills)
|
||||
.execute();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,16 +17,16 @@ dependencies:
|
||||
|
||||
# Architecture Packages
|
||||
krow_domain:
|
||||
path: ../../../../../../domain
|
||||
path: ../../../../../domain
|
||||
krow_core:
|
||||
path: ../../../../../../core
|
||||
path: ../../../../../core
|
||||
krow_data_connect:
|
||||
path: ../../../../../../data_connect
|
||||
firebase_auth: ^5.0.0
|
||||
path: ../../../../../data_connect
|
||||
firebase_auth: ^6.1.2
|
||||
design_system:
|
||||
path: ../../../../../../design_system
|
||||
path: ../../../../../design_system
|
||||
core_localization:
|
||||
path: ../../../../../../core_localization
|
||||
path: ../../../../../core_localization
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
||||
Reference in New Issue
Block a user