// Типы для auth сервисов

export type RoleName = "admin" | "director" | "manager";

export type BranchResponse = {
  id: string;
  name: string;
  address: string | null;
  city: string | null;
  country: string | null;
};

export type CompanyResponse = {
  id: string;
  name: string;
  description: string | null;
};

export type UserResponse = {
  id: string;
  email: string;
  fullName: string;
  role: RoleName;
  createdAt: Date;
  currentBranch?: BranchResponse;
  currentCompany?: CompanyResponse;
};

export type LoginResult = {
  user: UserResponse;
  session: {
    id: string;
    token: string;
    expiresAt: string;
  };
};

export type RegisterData = {
  email: string;
  password: string;
  fullName: string;
  role?: RoleName; // Опциональное поле, по умолчанию используется "manager"
};

export type LoginData = {
  email: string;
  password: string;
};

export type SessionMetadata = {
  userAgent: string | null;
  ipAddress: string | null;
};
