Enhance Customer model to include role attribute and update related components

- Added a new `role` attribute to the `Customer` model in `customer.dart` and updated the corresponding generated files.
- Modified the `AuthViewModel` to set the user role based on the logged-in user's role.
- Updated UI components in `TenderDetailActions` and `DesktopTendersPage` to conditionally render elements based on the user's role.
- Refactored tests to validate the new role attribute in the `Customer` model.
This commit is contained in:
amirrezaghabeli
2025-10-14 09:12:24 +03:30
parent 504fa1e80a
commit 13dbb5fae5
10 changed files with 109 additions and 53 deletions
@@ -29,6 +29,7 @@ _Customer _$CustomerFromJson(Map<String, dynamic> json) => _Customer(
language: json['language'] as String?,
username: json['username'] as String?,
currency: json['currency'] as String?,
role: json['role'] as String?,
timezone: json['timezone'] as String?,
createdAt: (json['created_at'] as num?)?.toInt(),
updatedAt: (json['updated_at'] as num?)?.toInt(),
@@ -69,6 +70,7 @@ Map<String, dynamic> _$CustomerToJson(_Customer instance) => <String, dynamic>{
'language': instance.language,
'username': instance.username,
'currency': instance.currency,
'role': instance.role,
'timezone': instance.timezone,
'created_at': instance.createdAt,
'updated_at': instance.updatedAt,