import 'package:latlong2/latlong.dart';
import 'package:uuid/uuid.dart';

class UserDeletedByOutlet {
  final String outletId;
  final int amount;

  const UserDeletedByOutlet({
    required this.outletId,
    required this.amount
  });
}

enum DisplayOutletEmpty { loading, empty_database, has_data }

class DisplayOutlet {
  final String id;
  final String? bannerPath;
  final String name;
  final bool isMainOutlet;
  final bool isActive;
  final String? fullAddress;
  final int userStaffAmount;
  final int transactionAmount;

  const DisplayOutlet({
    required this.id,
    this.bannerPath,
    required this.name,
    required this.isMainOutlet,
    required this.isActive,
    this.fullAddress,
    required this.userStaffAmount,
    required this.transactionAmount,
  });
}

class OutletDetail {
  final String id;
  final String? bannerPath;
  final String tenantName;
  final String name;
  final String phoneNumber;
  final String? email;
  final String? fullAddress;
  final double? latitude;
  final double? longitude;
  final bool isMainOutlet;
  final bool isActive;
  final int transactionAmount;

  const OutletDetail({
    required this.id,
    this.bannerPath,
    required this.tenantName,
    required this.name,
    required this.phoneNumber,
    this.email,
    this.fullAddress,
    this.latitude,
    this.longitude,
    required this.isMainOutlet,
    required this.isActive,
    required this.transactionAmount
  });
}

class StaffAdminDetail {
  final String id;
  final String name;
  final String phoneNumber;
  final String email;
  final bool isActive;
  final int transactionAmount;
  final String shiftName;
  final String shiftStartTime;
  final String shiftEndTime;

  const StaffAdminDetail({
    required this.id,
    required this.name,
    required this.phoneNumber,
    required this.email,
    required this.isActive,
    required this.transactionAmount,
    required this.shiftName,
    required this.shiftStartTime,
    required this.shiftEndTime,
  });
}

class UpsertOutlet {
  final String id;
  final String? bannerPath;
  final String name;
  final String? phoneNumber;
  final String? email;
  final UpsertStaffAdmin? firstStaffAdmin;
  final UpsertStaffAdmin? secondStaffAdmin;
  final String? fullAddress;
  final double? latitude;
  final double? longitude;
  final bool isMainOutlet;
  final bool isActive;

  UpsertOutlet({
    String? id,
    this.bannerPath,
    required this.name,
    this.phoneNumber,
    this.email,
    this.firstStaffAdmin,
    this.secondStaffAdmin,
    this.fullAddress,
    this.latitude,
    this.longitude,
    this.isMainOutlet = false,
    this.isActive = true
  }) : id = id ?? const Uuid().v7().toString();
}

class UpsertStaffAdmin {
  final String id;
  final String name;
  final String phoneNumber;
  final String email;
  final String? passwordHash;
  final String shiftName;
  final String shiftStartTime;
  final String shiftEndTime;
  final bool isActive;

  UpsertStaffAdmin({
    String? id,
    required this.name,
    required this.phoneNumber,
    required this.email,
    this.passwordHash,
    required this.shiftName,
    required this.shiftStartTime,
    required this.shiftEndTime,
    this.isActive = true,
  }) : id = id ?? const Uuid().v7().toString();

  UpsertStaffAdmin copyWith({bool? isActive}) {
    return UpsertStaffAdmin(
      id: id,
      name: name,
      phoneNumber: phoneNumber,
      email: email,
      passwordHash: passwordHash,
      shiftName: shiftName,
      shiftStartTime: shiftStartTime,
      shiftEndTime: shiftEndTime,
      isActive: isActive ?? this.isActive
    );
  }
}

class Outlet {
  final String id;
  final String name;
  final String? photoPath;
  final bool isMainOutlet;
  final bool isActive;

  Outlet({
    required this.id,
    required this.name,
    this.photoPath,
    this.isMainOutlet = false,
    this.isActive = true,
  });
}

class OutletAddressSelected {
  final String fullAddress;
  final LatLng currentLocation;

  const OutletAddressSelected({
    required this.fullAddress,
    required this.currentLocation,
  });
}

class MainOutlet {
  final String id;
  final String name;

  const MainOutlet({
    required this.id,
    required this.name
  });
}
