import 'package:p_tits_pas/models/user.dart';

class ParentModel {
  final AppUser user;
  final int childrenCount;

  ParentModel({required this.user, this.childrenCount = 0});

  factory ParentModel.fromJson(Map<String, dynamic> json) {
    final userJson = json['user'] ?? json;
    final user = AppUser.fromJson(userJson);
    final children = json['parentChildren'] as List?;
    return ParentModel(
      user: user,
      childrenCount: children?.length ?? 0,
    );
  }
}
