feat: 支持课后评价与成长档案

完成后即可评价并订阅提醒,馆主可记录体测、笔记与成长照片,首页展示匿名星级均分。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
richarjiang
2026-09-09 15:55:48 +08:00
parent c3e46f7ffa
commit 139882d7a1
50 changed files with 1307 additions and 15 deletions

View File

@@ -0,0 +1,27 @@
import { buildClassReviewSubscribeData } from '../subscription-message.service'
describe('Class review subscribe payload', () => {
it('fills thing1 course, thing2 coach, time3 class time and thing4 tip', () => {
expect(buildClassReviewSubscribeData({
studioName: 'Focus Core 普拉提工作室',
date: new Date('2026-09-09T00:00:00.000Z'),
startTime: '10:00:00',
})).toEqual({
thing1: { value: 'Focus Core 普拉提工作室' },
thing2: { value: 'Iris' },
time3: { value: '2026年09月09日 10:00' },
thing4: { value: '欢迎留下这节课的感受' },
})
})
it('falls back to a short course name and trims thing fields to 20 characters', () => {
const data = buildClassReviewSubscribeData({
studioName: '超长工作室名称用来测试微信订阅消息字段截断是否生效',
date: new Date('2026-01-02T00:00:00.000Z'),
startTime: '09:30',
})
expect(data.thing1.value).toHaveLength(20)
expect(data.thing1.value).toBe('超长工作室名称用来测试微信订阅消息字段截断是否生效'.slice(0, 20))
expect(data.time3.value).toBe('2026年01月02日 09:30')
})
})