export type PartnerType = 'person' | 'company';

export interface Partner {
  id: string;
  tenantId: string;
  name: string;
  legalName?: string | null;
  partnerType: PartnerType;
  isCustomer: boolean;
  isSupplier: boolean;
  isEmployee: boolean;
  isCompany: boolean;
  email?: string | null;
  phone?: string | null;
  mobile?: string | null;
  website?: string | null;
  taxId?: string | null;
  companyId?: string | null;
  companyName?: string | null;
  parentId?: string | null;
  parentName?: string | null;
  userId?: string | null;
  paymentTermId?: string | null;
  pricelistId?: string | null;
  language: string;
  currencyId?: string | null;
  currencyCode?: string | null;
  notes?: string | null;
  internalNotes?: string | null;
  active: boolean;
  createdAt: string;
  createdBy?: string | null;
  updatedAt?: string | null;
  updatedBy?: string | null;
  deletedAt?: string | null;
  deletedBy?: string | null;
}

export interface CreatePartnerDto {
  name: string;
  legalName?: string;
  partnerType: PartnerType;
  isCustomer?: boolean;
  isSupplier?: boolean;
  isEmployee?: boolean;
  isCompany?: boolean;
  email?: string;
  phone?: string;
  mobile?: string;
  website?: string;
  taxId?: string;
  companyId?: string;
  parentId?: string;
  language?: string;
  currencyId?: string;
  notes?: string;
  internalNotes?: string;
}

export interface UpdatePartnerDto {
  name?: string;
  legalName?: string;
  partnerType?: PartnerType;
  isCustomer?: boolean;
  isSupplier?: boolean;
  isEmployee?: boolean;
  isCompany?: boolean;
  email?: string;
  phone?: string;
  mobile?: string;
  website?: string;
  taxId?: string;
  companyId?: string;
  parentId?: string | null;
  language?: string;
  currencyId?: string;
  notes?: string;
  internalNotes?: string;
  active?: boolean;
}

export interface PartnerFilters {
  search?: string;
  partnerType?: PartnerType;
  isCustomer?: boolean;
  isSupplier?: boolean;
  active?: boolean;
  page?: number;
  limit?: number;
  sortBy?: string;
  sortOrder?: 'asc' | 'desc';
}

export interface PartnersResponse {
  data: Partner[];
  meta: {
    total: number;
    page: number;
    limit: number;
    totalPages: number;
  };
}
