13dbb5fae5
- 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.
82 lines
2.9 KiB
Dart
82 lines
2.9 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'customer.dart';
|
|
|
|
// **************************************************************************
|
|
// JsonSerializableGenerator
|
|
// **************************************************************************
|
|
|
|
_Customer _$CustomerFromJson(Map<String, dynamic> json) => _Customer(
|
|
id: json['id'] as String?,
|
|
type: json['type'] as String?,
|
|
status: json['status'] as String?,
|
|
firstName: json['first_name'] as String?,
|
|
lastName: json['last_name'] as String?,
|
|
fullName: json['full_name'] as String?,
|
|
email: json['email'] as String?,
|
|
phone: json['phone'] as String?,
|
|
mobile: json['mobile'] as String?,
|
|
registrationNumber: json['registration_number'] as String?,
|
|
taxId: json['tax_id'] as String?,
|
|
industry: json['industry'] as String?,
|
|
businessType: json['business_type'] as String?,
|
|
employeeCount: (json['employee_count'] as num?)?.toInt(),
|
|
annualRevenue: (json['annual_revenue'] as num?)?.toInt(),
|
|
foundedYear: (json['founded_year'] as num?)?.toInt(),
|
|
isVerified: json['is_verified'] as bool?,
|
|
isCompliant: json['is_compliant'] as bool?,
|
|
complianceNotes: json['compliance_notes'] as String?,
|
|
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(),
|
|
createdBy: json['created_by'] as String?,
|
|
updatedBy: json['updated_by'] as String?,
|
|
address:
|
|
json['address'] == null
|
|
? null
|
|
: Address.fromJson(json['address'] as Map<String, dynamic>),
|
|
contactPersons:
|
|
json['contactPersons'] == null
|
|
? null
|
|
: ContactPerson.fromJson(
|
|
json['contactPersons'] as Map<String, dynamic>,
|
|
),
|
|
);
|
|
|
|
Map<String, dynamic> _$CustomerToJson(_Customer instance) => <String, dynamic>{
|
|
'id': instance.id,
|
|
'type': instance.type,
|
|
'status': instance.status,
|
|
'first_name': instance.firstName,
|
|
'last_name': instance.lastName,
|
|
'full_name': instance.fullName,
|
|
'email': instance.email,
|
|
'phone': instance.phone,
|
|
'mobile': instance.mobile,
|
|
'registration_number': instance.registrationNumber,
|
|
'tax_id': instance.taxId,
|
|
'industry': instance.industry,
|
|
'business_type': instance.businessType,
|
|
'employee_count': instance.employeeCount,
|
|
'annual_revenue': instance.annualRevenue,
|
|
'founded_year': instance.foundedYear,
|
|
'is_verified': instance.isVerified,
|
|
'is_compliant': instance.isCompliant,
|
|
'compliance_notes': instance.complianceNotes,
|
|
'language': instance.language,
|
|
'username': instance.username,
|
|
'currency': instance.currency,
|
|
'role': instance.role,
|
|
'timezone': instance.timezone,
|
|
'created_at': instance.createdAt,
|
|
'updated_at': instance.updatedAt,
|
|
'created_by': instance.createdBy,
|
|
'updated_by': instance.updatedBy,
|
|
'address': instance.address,
|
|
'contactPersons': instance.contactPersons,
|
|
};
|