// Base entity interface
export interface BaseEntity {
  id: string;
  createdAt: string;
  updatedAt?: string;
}

// Re-export from features para evitar duplicados
// User types - fuente de verdad: features/users/types/user.types.ts
export type {
  User,
  Role,
  UserStatus,
  CreateUserDto,
  UpdateUserDto,
  UserFilters,
  UsersResponse,
} from '@features/users/types/user.types';

// Partner types - fuente de verdad: features/partners/types/partner.types.ts
export type {
  Partner,
  PartnerType,
  CreatePartnerDto,
  UpdatePartnerDto,
  PartnerFilters,
  PartnersResponse,
} from '@features/partners/types/partner.types';

// Company types - fuente de verdad: features/companies/types/company.types.ts
export type {
  Company,
  CompanySettings,
  CreateCompanyDto,
  UpdateCompanyDto,
  CompanyFilters,
  CompaniesResponse,
} from '@features/companies/types/company.types';

// Product - mantener aqui por ahora (no hay feature dedicado aun)
export interface Product extends BaseEntity {
  name: string;
  code?: string;
  barcode?: string;
  description?: string;
  type: 'goods' | 'service' | 'consumable';
  categoryId?: string;
  uomId?: string;
  salePrice?: number;
  cost?: number;
  isActive: boolean;
  tenantId: string;
}

// Auth
export interface LoginCredentials {
  email: string;
  password: string;
}

export interface RegisterData {
  email: string;
  password: string;
  firstName: string;
  lastName: string;
  companyName?: string;
}

export interface AuthResponse {
  user: import('@features/users/types/user.types').User;
  token: string;
  refreshToken?: string;
}

export interface TokenPayload {
  userId: string;
  tenantId: string;
  email: string;
  roles: string[];
  iat: number;
  exp: number;
}
