AttachmentService 统一接口, attachmentIndex 与 IndexedDB 的作用, "删除整个 entity" 时附件是否同步清理 (解决 v1 历史 bug)。 contact_card · cert_image · dd_attach · comm_attach · followup_dd_attach · followup_comm_attach 这是 v1 历史 bug 修复点:AttachmentService.removeByEntity('contact_card', ...) 会一次性清掉这个联系人所有名片附件 (index + blob 同步)。
v1 中 Storage.deleteDueDiligence 只删数据,附件成为孤儿。 v2 通过 AttachmentService.removeByEntity('dd_attach', ...) 一次性清理。
v1 中 Storage.deleteCommunication 也不删附件。 v2 同样用统一接口清理。
| attachmentId | moduleType | lpId | entityId | fieldName | storedName | size | uploaded |
|---|