feat(bisaya-course): add new lesson and update course creation logic
All checks were successful
Deploy to production / deploy (push) Successful in 2m51s
All checks were successful
Deploy to production / deploy (push) Successful in 2m51s
- Introduced a new lesson titled "Zahlen & Preise" to enhance the numerical curriculum in Bisaya. - Updated the course creation logic to check for existing "Familien"-Bisaya courses, ensuring idempotency in course creation. - Enhanced the lesson didactics by mapping legacy titles to current lesson keys, improving data consistency. - Adjusted the course generation script to limit Bisaya courses to German-speaking learners only, streamlining course offerings.
This commit is contained in:
@@ -1076,6 +1076,8 @@ const LESSONS = [
|
||||
...BISAYA_PHASE5_LESSONS
|
||||
];
|
||||
|
||||
const BISAYA_FAMILY_COURSE_TITLE = 'Bisaya für Familien - Alltag & Stabilisierung';
|
||||
|
||||
async function createBisayaCourse(languageId, ownerHashedId) {
|
||||
try {
|
||||
// Finde User
|
||||
@@ -1093,11 +1095,25 @@ async function createBisayaCourse(languageId, ownerHashedId) {
|
||||
throw new Error(`Sprache mit ID ${languageId} nicht gefunden`);
|
||||
}
|
||||
|
||||
const existing = await VocabCourse.findOne({
|
||||
where: {
|
||||
languageId: Number(languageId),
|
||||
title: BISAYA_FAMILY_COURSE_TITLE
|
||||
}
|
||||
});
|
||||
if (existing) {
|
||||
console.log(
|
||||
`⏭️ Es existiert bereits ein „Familien“-Bisaya-Kurs für diese Zielsprache (language_id=${languageId}, Kurs-ID ${existing.id}).`
|
||||
);
|
||||
console.log(' Es wird kein zweiter Kurs angelegt (idempotent).');
|
||||
return existing;
|
||||
}
|
||||
|
||||
// Erstelle Kurs
|
||||
const shareCode = crypto.randomBytes(8).toString('hex');
|
||||
const course = await VocabCourse.create({
|
||||
ownerUserId: user.id,
|
||||
title: 'Bisaya für Familien - Alltag & Stabilisierung',
|
||||
title: BISAYA_FAMILY_COURSE_TITLE,
|
||||
description: 'Lerne Bisaya (Cebuano) praxisnah für den Familienalltag. Der Pfad verbindet Schnellstart, Alltagsmodule und Stabilisierungsblöcke mit Spiralwiederholung, Fehlertraining und freier Produktion.',
|
||||
languageId: Number(languageId),
|
||||
difficultyLevel: 1,
|
||||
|
||||
Reference in New Issue
Block a user