export interface User {
  id: string;
  username: string;
  email: string;
  passwordHash: string;
  companyName?: string;
  phone?: string;
  businessType?: string;
  role: 'ADMIN' | 'MANAGER' | 'OPERATOR' | 'FINANCE' | 'SOURCING' | 'LOGISTICS' | 'ANALYST';
  status: 'active' | 'inactive' | 'suspended';
  tenantId: string;
  createdAt: Date;
  updatedAt: Date;
}

export class UserEntity {
  static create(data: Partial<User>): User {
    return {
      id: data.id || `user-${Date.now()}`,
      username: data.username || '',
      email: data.email || '',
      passwordHash: data.passwordHash || '',
      companyName: data.companyName,
      phone: data.phone,
      businessType: data.businessType,
      role: data.role || 'OPERATOR',
      status: data.status || 'active',
      tenantId: data.tenantId || '',
      createdAt: data.createdAt || new Date(),
      updatedAt: data.updatedAt || new Date()
    };
  }
}
