feat: Introduce AttireVerificationStatus enum and add verificationId to staff attire items.

This commit is contained in:
Achintha Isuru
2026-02-24 17:31:41 -05:00
parent 616f23fec9
commit fd0208efa0
10 changed files with 64 additions and 14 deletions

View File

@@ -74,18 +74,26 @@ class _AttireCapturePageState extends State<AttireCapturePage> {
state.photoUrl ?? widget.initialPhotoUrl;
final bool hasUploadedPhoto = currentPhotoUrl != null;
final String statusText =
widget.item.verificationStatus ??
(hasUploadedPhoto
? 'Pending Verification'
: 'Not Uploaded');
final String statusText = switch (widget
.item
.verificationStatus) {
AttireVerificationStatus.success => 'Approved',
AttireVerificationStatus.failed => 'Rejected',
AttireVerificationStatus.pending => 'Pending Verification',
_ =>
hasUploadedPhoto ? 'Pending Verification' : 'Not Uploaded',
};
final Color statusColor =
widget.item.verificationStatus == 'SUCCESS'
? UiColors.textPrimary
: (hasUploadedPhoto
? UiColors.textWarning
: UiColors.textInactive);
switch (widget.item.verificationStatus) {
AttireVerificationStatus.success => UiColors.textSuccess,
AttireVerificationStatus.failed => UiColors.textError,
AttireVerificationStatus.pending => UiColors.textWarning,
_ =>
hasUploadedPhoto
? UiColors.textWarning
: UiColors.textInactive,
};
return Column(
children: <Widget>[

View File

@@ -19,7 +19,12 @@ class AttireItemCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
final bool hasPhoto = item.photoUrl != null;
final String statusText = item.verificationStatus ?? 'Not Uploaded';
final String statusText = switch (item.verificationStatus) {
AttireVerificationStatus.success => 'Approved',
AttireVerificationStatus.failed => 'Rejected',
AttireVerificationStatus.pending => 'Pending',
_ => hasPhoto ? 'Pending' : 'To Do',
};
return GestureDetector(
onTap: onTap,