import 'package:freezed_annotation/freezed_annotation.dart';

part 'auth_user.freezed.dart';
part 'auth_user.g.dart';

@freezed
class AuthUser with _$AuthUser {
  const factory AuthUser({
    required int id,
    String? username,  // API doesn't return username
    required String email,
    required String name,
    @Default('admin') String role,  // Default to 'admin' if not provided
    String? phone,    // Added for /auth/me API
    String? mobile,   // Added for /auth/me API
  }) = _AuthUser;

  factory AuthUser.fromJson(Map<String, dynamic> json) =>
      _$AuthUserFromJson(json);
}