import type { Address, SocialMedia } from "~/types/general";
type JuridicalType =
| "IBUYER"
| "INCORPORADOR"
| "IMOBILIARIA"
| "GRUPO_IMOBILIARIO"
| "FUNDO_IMOBILIARIO"
| "GESTAO_DE_PATRIMONIO";
interface Portfolio {
vgv: number;
total: number;
soldVgv: number;
soldTotal: number;
}
// Usado por `UserProfile` (rota de perfil do corretor).
interface BrokerageEmbed {
id: string;
name: string | null;
email: string;
corporateEmail: string | null;
phone: string | null;
whatsapp: string | null;
hrWhatsapp: string | null;
profileImage: string | null;
slug: string;
site: string | null;
type: "IMOBILIARIA";
network: NetworkEmbed | null;
}
// Usado por `UserEmbed`, que acompanha imóveis. Só identifica a loja para
// exibição — o contato do anúncio é o `whatsapp` do corretor.
interface ApiBrokerageEmbed {
id: string;
name: string | null;
slug: string;
profileImage: string | null;
type: "IMOBILIARIA";
}
interface NetworkEmbed {
id: string;
name: string;
logo: string | null;
}
export interface UserEmbed {
id: string;
name: string | null;
type: "AGENTE" | JuridicalType;
email: string;
corporateEmail: string | null;
whatsapp: string | null;
profileImage: string | null;
slug: string;
brokerage: ApiBrokerageEmbed | null;
network: NetworkEmbed | null;
}
export interface Contact {
name: string | null;
phone: string | null;
whatsapp: string | null;
email: string;
address: Address;
socialMedias: SocialMedia[];
}Mudança no UserEmbed
O embed que acompanha imóveis (nas APIs de imóvel e nos webhooks de publicação) foi enxugado dos dois lados:
UserEmbedperdeuphone,hrWhatsapp,siteereputation.UserEmbed.brokeragedeixou de serBrokerageEmbede virouApiBrokerageEmbed, que tem só o que identifica a imobiliária para exibição (id,name,slug,profileImage,type). Saíramemail,corporateEmail,phone,whatsapp,hrWhatsappesite; saiu também onetwork, que continua disponível emUserEmbed.network.
O BrokerageEmbed completo continua existindo e não mudou — ele é o que
UserProfile devolve na rota de perfil do corretor.
Use whatsapp como contato — é o campo canônico, fica no corretor e está
preenchido em praticamente todo o acervo. Não há mais canal de contato da
imobiliária no embed do imóvel.
O UserProfile (rota de perfil do corretor) não mudou e segue trazendo
phone, site e reputation.
ActuationArea
import type { UF } from "~/types/general";
export interface ActuationArea {
id: string;
state: UF;
city: string;
area: string;
}AgentsPageAgent
import type { ActuationArea } from "~/types/user";
export interface AgentsPageAgent {
id: string;
profileImage: string | null;
whatsapp: string | null;
actuationAreas: ActuationArea[];
name: string;
email: string;
vgv: number;
slug: string;
}UserProfile
Perfil completo do usuário. É uma união discriminada pelo campo type: agentes
(type: "AGENTE") trazem cpf, education, languages e brokerage; pessoas
jurídicas (IBUYER, INCORPORADOR, IMOBILIARIA, GRUPO_IMOBILIARIO,
FUNDO_IMOBILIARIO, GESTAO_DE_PATRIMONIO) trazem apenas o type.
import type { OptionalAddress, SocialMedia, UF } from "~/types/general";
import type { ActuationArea, BrokerageEmbed, Portfolio } from "~/types/user";
type Language = "PORTUGUES" | "INGLES" | "ESPANHOL" | "FRANCES" | "ALEMAO" | "ITALIANO" | "MANDARIM" | "JAPONES";
interface BaseProfile {
id: string;
slug: string;
name: string | null;
email: string;
corporateEmail: string | null;
creci: string | null;
profileImage: string | null;
about: string | null;
site: string | null;
whatsapp: string | null;
phone: string | null;
actuationAreas: ActuationArea[];
socialMedias: SocialMedia[];
partnershipRules: string | null;
zapRating: number | null;
portfolio: Portfolio;
reputation: number;
network: { id: string; name: string } | null;
}
interface AgentProfile extends BaseProfile {
type: "AGENTE";
cpf: string | null;
education: string | null;
languages: Language[];
brokerage: BrokerageEmbed | null;
}
interface JuridicalProfile extends BaseProfile {
type:
| "IBUYER"
| "INCORPORADOR"
| "IMOBILIARIA"
| "GRUPO_IMOBILIARIO"
| "FUNDO_IMOBILIARIO"
| "GESTAO_DE_PATRIMONIO";
}
export type UserProfile = AgentProfile | JuridicalProfile;