feat(medications): 添加药物超时提醒功能

在MedicationRecord模型中添加overdueReminderSent字段追踪超时提醒状态,在提醒服务中新增定时任务检查超过服药时间1小时的未服用记录,并向用户发送鼓励提醒。该功能每10分钟检查一次,避免重复发送提醒,帮助用户及时补服错过的药物。
This commit is contained in:
richarjiang
2025-11-14 14:47:44 +08:00
parent 5a9be42a93
commit f04c2ccd5d
2 changed files with 165 additions and 2 deletions

View File

@@ -91,6 +91,14 @@ export class MedicationRecord extends Model {
})
declare reminderSent: boolean;
@Column({
type: DataType.BOOLEAN,
allowNull: false,
defaultValue: false,
comment: '是否已发送超时提醒',
})
declare overdueReminderSent: boolean;
// 关联关系
@BelongsTo(() => Medication, 'medicationId')
declare medication: Medication;