import type { UpdateUserBasicInfoBody } from "@workspace/ui/services/admin/user";

export type UserBasicInfoPayload = Omit<UpdateUserBasicInfoBody, "remark"> & {
  remark: string;
};

export function buildUserBasicInfoPayload(
  user: API.User,
  remark: string
): UserBasicInfoPayload {
  return {
    user_id: user.id,
    avatar: user.avatar,
    balance: user.balance,
    commission: user.commission,
    referral_percentage: user.referral_percentage,
    only_first_purchase: user.only_first_purchase,
    gift_amount: user.gift_amount,
    telegram: user.telegram,
    refer_code: user.refer_code,
    referer_id: user.referer_id,
    enable: user.enable,
    is_admin: user.is_admin ?? false,
    remark,
  };
}
