feat: Enhance tax forms page with progress overview and refactor components for better structure
This commit is contained in:
@@ -107,7 +107,21 @@ class StaffConnectorRepositoryImpl implements StaffConnectorRepository {
|
||||
.getStaffTaxFormsProfileCompletion(id: staffId)
|
||||
.execute();
|
||||
|
||||
return response.data.taxForms.isNotEmpty;
|
||||
final List<dc.GetStaffTaxFormsProfileCompletionTaxForms> taxForms =
|
||||
response.data.taxForms;
|
||||
|
||||
// Return false if no tax forms exist
|
||||
if (taxForms.isEmpty) return false;
|
||||
|
||||
// Return true only if all tax forms have status == "SUBMITTED"
|
||||
return taxForms.every(
|
||||
(dc.GetStaffTaxFormsProfileCompletionTaxForms form) {
|
||||
if (form.status is dc.Unknown) return false;
|
||||
final dc.TaxFormStatus status =
|
||||
(form.status as dc.Known<dc.TaxFormStatus>).value;
|
||||
return status == dc.TaxFormStatus.SUBMITTED;
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user