Re: [CSplus/RelationshipCRM] feat: Google Calendar連携(予定同期・次のアクション登録・フォロー漏れ警告) (PR #12)
- 相手(連絡先)
- -
- 会社
- -
- From(Gmail)
- notifications@github.com
- To / Cc(Gmail)
- relationshipcrm@noreply.github.com, koshiba@csplus.jp, state_change@noreply.github.com
- 作成日時
- 2026/07/12 11:08
- 更新日時
- 2026/07/12 11:08
本文
@chatgpt-codex-connector[bot] commented on this pull request. ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `563307d1c9` <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". </details> > + startAt, + endAt, + attendeeEmails, + syncedAt: syncStartedAt, + }, + }); + stats.updated++; + continue; + } + + const contact = matchSingleContact(attendeeEmails, contactsByEmail); + + // キーワード一致かつ連絡先が一意 → Interaction を自動生成 + let interactionId: string | null = null; + const keyword = matchKeyword(title); + if (keyword && contact) { **<sub><sub></sub></sub> Skip auto-creating interactions for future events** Because the sync window includes events up to 90 days in the future, this condition also creates `Interaction` records for scheduled meetings that have not happened yet. Those records use `occurredAt: startAt` and immediately call `refreshLastContactAt`, so a contact with a meeting next month gets `lastContactAt` set to a future date and disappears from stale-contact/follow-up reporting before any contact occurred. Gate auto-creation/last-contact refresh to events whose start or end is not in the future. Useful? React with 👍 / 👎. > @@ -114,6 +123,26 @@ async function loadDashboard() { orderBy: { createdAt: "desc" }, take: 5, }), + // カレンダー: 今日の予定 / 今週の予定数 / フォロー漏れ警告 + prisma.calendarEvent.findMany({ + where: { startAt: { gte: todayStart, lt: todayEnd } }, + include: { contact: true }, + orderBy: { startAt: "asc" }, + take: 10, + }), + prisma.calendarEvent.count({ + where: { startAt: { gte: todayStart, lt: weekLater } }, + }), + // 過去7日の予定のうち対応履歴が作られていないもの(フォロー漏れの可能性) + prisma.calendarEvent.findMany({ + where: { + startAt: { gte: staleBefore7(now), lt: now }, + interactionId: null, **<sub><sub></sub></sub> Mark manually recorded calendar follow-ups as handled** For synced events that did not auto-create an interaction, the dashboard's `対応を記録` link only opens `/interactions/new?contactId=...`, and `createInteraction` never writes back to `CalendarEvent.interactionId`. Since this query only excludes rows where `interactionId` is set, the same past event stays in the follow-up warning even after the user records the response manually, making the warning effectively impossible to clear for those cases. Useful? React with 👍 / 👎. -- Reply to this email directly or view it on GitHub: https://github.com/CSplus/RelationshipCRM/pull/12#pullrequestreview-4678158250 You are receiving this because you modified the open/close state. Message ID: <CSplus/RelationshipCRM/pull/12/review/4678158250@github.com>