// English: Model representing a connected Meta session (Facebook Page or Instagram Business Profile)
class MetaSessionModel {
  final int id;
  final int companyId;
  final String channelType;
  final String pageId;
  final String pageName;
  final String status;
  final String? createdAt;
  final String? updatedAt;

  MetaSessionModel({
    required this.id,
    required this.companyId,
    required this.channelType,
    required this.pageId,
    required this.pageName,
    required this.status,
    this.createdAt,
    this.updatedAt,
  });

  factory MetaSessionModel.fromJson(Map<String, dynamic> json) {
    return MetaSessionModel(
      id: json['id'] as int,
      companyId: json['company_id'] as int,
      channelType: json['channel_type'] as String,
      pageId: json['page_id'] as String,
      pageName: json['page_name'] as String,
      status: json['status'] as String,
      createdAt: json['created_at'] as String?,
      updatedAt: json['updated_at'] as String?,
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'id': id,
      'company_id': companyId,
      'channel_type': channelType,
      'page_id': pageId,
      'page_name': pageName,
      'status': status,
      'created_at': createdAt,
      'updated_at': updatedAt,
    };
  }
}
