// segmentation_model.dart
import 'package:freezed_annotation/freezed_annotation.dart';

part 'segmentation_model.freezed.dart';
part 'segmentation_model.g.dart';

@freezed
abstract class SegmentationModel with _$SegmentationModel {
  const factory SegmentationModel({
    String? key,
    String? productKey,
    String? guildKey,
    String? result,
    String? quota,
    String? saleType,
    int? weight,
    Buyer? buyer,
    DateTime? date,
    ToGuild? toGuild,
  }) = _SegmentationModel;

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

@freezed
abstract class Buyer with _$Buyer {
  const factory Buyer({
   String? fullname,
   String? mobile,
   String? shop,
  }) = _Buyer;

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

@freezed
abstract class ToGuild with _$ToGuild {
  const factory ToGuild({
    String? key,
    String? guildsName,
    String? typeActivity,
    String? areaActivity,
    String? guildsId,
    bool? steward,
    User? user,
  }) = _ToGuild;

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

@freezed
abstract class User with _$User {
  const factory User({
    String? fullname,
    String? firstName,
    String? lastName,
    String? mobile,
    String? nationalId,
    String? city,
  }) = _User;

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