musora-content-services 2.113.0 → 2.114.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [2.114.0](https://github.com/railroadmedia/musora-content-services/compare/v2.113.0...v2.114.0) (2026-01-08)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* extra data for method card ([#691](https://github.com/railroadmedia/musora-content-services/issues/691)) ([36b034c](https://github.com/railroadmedia/musora-content-services/commit/36b034c83b86f0ff825dfc00af6a6b97b793c4c6))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **T3PS-1347:** Update getUserWeeklyStats to include query for past 60 days for streak calculation, retain original contract of the function ([d798acf](https://github.com/railroadmedia/musora-content-services/commit/d798acf2a01f25551746030722a41ccb81030ed9))
|
|
16
|
+
* **T3PS:** Cleanup ([07f057f](https://github.com/railroadmedia/musora-content-services/commit/07f057f867c8a3931ae6cbf5ecca9ae471f23d00))
|
|
17
|
+
|
|
5
18
|
## [2.113.0](https://github.com/railroadmedia/musora-content-services/compare/v2.112.2...v2.113.0) (2026-01-08)
|
|
6
19
|
|
|
7
20
|
|
package/package.json
CHANGED
|
@@ -112,11 +112,12 @@ export async function getMethodCard(brand) {
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
return {
|
|
115
|
-
id:
|
|
115
|
+
id: learningPath?.id,
|
|
116
116
|
type: COLLECTION_TYPE.LEARNING_PATH,
|
|
117
117
|
progressType: 'method',
|
|
118
118
|
header: 'Method',
|
|
119
119
|
body: learningPath,
|
|
120
|
+
content: learningPath, // FE uses this field for cards, MA uses `body`
|
|
120
121
|
cta: {
|
|
121
122
|
text: ctaText,
|
|
122
123
|
action: action,
|
|
@@ -96,12 +96,24 @@ export async function getUserWeeklyStats() {
|
|
|
96
96
|
const today = dayjs()
|
|
97
97
|
const startOfWeek = getMonday(today, timeZone)
|
|
98
98
|
const weekDays = Array.from({ length: 7 }, (_, i) => startOfWeek.add(i, 'day').format('YYYY-MM-DD'))
|
|
99
|
-
|
|
100
|
-
const
|
|
99
|
+
// Query THIS WEEK's practices for display
|
|
100
|
+
const weekPractices = await getOwnPractices(
|
|
101
101
|
Q.where('date', Q.oneOf(weekDays)),
|
|
102
102
|
Q.sortBy('date', 'desc')
|
|
103
103
|
)
|
|
104
|
-
|
|
104
|
+
|
|
105
|
+
// Query LAST 60 DAYS for streak calculation (balances accuracy vs performance)
|
|
106
|
+
// This captures:
|
|
107
|
+
// - Current active streaks up to 60 days
|
|
108
|
+
// - Recent breaks (to show "restart" message)
|
|
109
|
+
// - Sufficient context for accurate weekly streak calculation
|
|
110
|
+
const sixtyDaysAgo = today.subtract(60, 'days').format('YYYY-MM-DD')
|
|
111
|
+
const recentPractices = await getOwnPractices(
|
|
112
|
+
Q.where('date', Q.gte(sixtyDaysAgo)),
|
|
113
|
+
Q.sortBy('date', 'desc')
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
const practiceDaysSet = new Set(Object.keys(weekPractices))
|
|
105
117
|
let dailyStats = []
|
|
106
118
|
for (let i = 0; i < 7; i++) {
|
|
107
119
|
const day = startOfWeek.add(i, 'day')
|
|
@@ -119,9 +131,8 @@ export async function getUserWeeklyStats() {
|
|
|
119
131
|
})
|
|
120
132
|
}
|
|
121
133
|
|
|
122
|
-
let { streakMessage } = getStreaksAndMessage(
|
|
123
|
-
|
|
124
|
-
return { data: { dailyActiveStats: dailyStats, streakMessage, practices } }
|
|
134
|
+
let { streakMessage } = getStreaksAndMessage(recentPractices)
|
|
135
|
+
return { data: { dailyActiveStats: dailyStats, streakMessage, practices: weekPractices } }
|
|
125
136
|
}
|
|
126
137
|
|
|
127
138
|
/**
|