contactProfileChanged (database/contactProfileChange.ts)

deplao-builder · src/services/database/contactProfileChange.ts · typescript · MIT
database, tag:embed-classified

Utility functions to detect changes between old and new contact profile records, used for event triggering.

// Source: https://github.com/babyvibe/deplao-builder | License: MIT | Copyright 2026 babyvibe
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * contactProfileChange.ts — hồ sơ liên hệ có THẬT SỰ đổi sau một lần ghi không (phần thuần, có test).
 *
 * Boss gọi db:updateContactProfile cho gần như mọi tin nhắn đến (tên / ảnh người gửi) và mỗi lần kết nối lại Zalo lưu
 * lại bí danh của cả danh bạ. Phát db:contactProfileUpdated / db:contactAliasChanged cho mỗi lần ghi = một event relay
 * tới nhân viên cho mỗi tin nhắn. So bản ghi trước / sau (đúng ngữ nghĩa CASE … ELSE giữ giá trị cũ của câu UPDATE).
 */

/** Cột hồ sơ UI hiển thị (danh sách hội thoại, thông tin liên hệ). */
export const CONTACT_PROFILE_COLUMNS = ['display_name', 'avatar_url', 'phone', 'gender', 'birthda

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key