Skip to content

Releases

v1.3.1 - Fix AYAHS duration mode working-day calculation

Choose a tag to compare

@7odaifa-ab 7odaifa-ab released this 26 Nov 19:06

Fixed

  • planByDuration with unit: 'AYAHS' working-day calculation: getEffectiveMemorizationDays now converts durationDays (calendar window) into working study days via getStudyDaysWithinDuration(durationDays, daysPerWeek) before subtracting holidays, consolidation days, and catch-up days (and respects endDate), matching the LINES duration path.

v1.3.0 - First-class AYAHS daily amount unit

Choose a tag to compare

@7odaifa-ab 7odaifa-ab released this 26 Nov 18:47

Changelog

All notable changes to @zakhm_sa/makeen-core are documented in this file.

[1.3.0] - 2026-11-26

Added

  • First-class AYAHS daily amount unit for HIFZ:
    • DTO (MakeenEngine.generatePlan): TrackConfigDTO.amountUnit now supports 'AYAHS' for HIFZ tracks (amountUnit: 'AYAHS', amountValue: N). Rejects 'AYAHS' on review tracks (MINOR_REVIEW / MAJOR_REVIEW) with a typed PlanError(INVALID_INPUT).
    • Builder (PlanBuilder):
      • addHifz(amount, start, end?, { unit?: 'LINES' | 'AYAHS' }) and convenience alias addHifzByAyahs(ayahsPerDay, start, end?).
      • planByDailyAmount({ from, to, dailyLines?, dailyAyahs?, unit? }) and convenience alias planByDailyAyahs({ from, to, dailyAyahs }).
      • planByDuration({ from, to, durationDays, unit?: 'LINES' | 'AYAHS' }) derives dailyAyahs = ceil(totalAyahsInRange / effectiveWorkingDays) accounting for holidays, consolidation days, and catch-up days, and exposes the derived amount via builder.getDerivedDailyAmount() / manager.getDerivedDailyAmount().
    • Surah completion in AYAHS mode: SurahCompletionConfig.maxOverflowAyahs?: number (default 2). Completes the active surah on the same day if the remaining ayahs are <= maxOverflowAyahs and marks overflowReason: 'SURAH_COMPLETION'. (maxOverflowLines is ignored in AYAHS mode).
    • Optional line guard (ScheduleConfig.maxLinesPerDay): Hard line cap in AYAHS mode so N long ayahs cannot produce an oversized lesson; stops at the last whole ayah that fits (minimum 1 ayah — never emits an empty lesson) and records 'LINE_GUARD' in appliedRules.
    • Output fields (PlanEvent.data & PlanEventDTO):
      • ayahsCount: number on every memorization and review event (inclusive count of whole ayahs in traversal direction).
      • requestedAyahs?: number and overflowAyahs?: number on HIFZ events in AYAHS mode.
    • QuranRepository / QuranRepositoryOptimized helpers: countAyahs(start, end, direction?) and advanceByAyahs(location, n, direction?, bound?).

Guaranteed Backwards Compatibility

  • Zero behavior or output coordinate changes for existing LINES and PAGES plans.
  • Minor review (both lesson-count and minorReviewPagesCount modes) and major review operate over canonical index ranges and remain 100% compatible with AYAHS Hifz tracks.

v1.1.0 — Horizon, Snapshot/Resume, Hijri

Choose a tag to compare

@7odaifa-ab 7odaifa-ab released this 08 Jul 19:28

✨ Features (all additive & backward compatible)

  • Configurable Major Review Horizon — HorizonConstraint completed as a sliding floor consumed by LoopingStrategy. Bound the major review to the most recently memorized N lines via addMajorReview(amount, start?, end?, { horizonLines }) or DTO config.horizonLines.
  • Snapshot & Resume — persist/restore live plan state for intermittent students: TrackManager.exportSnapshot() / importSnapshot(), BaseTrack.exportState() / importState(), and the PlanSnapshot type. Full history is preserved so the minor-review window stays correct.
  • Opt-in Hijri dates — zero-dependency HijriDateUtils (Umm al-Qura via Intl). Set includeHijri: true to attach hijriDate to each PlanDay / PlanDayDTO.

✅ Quality

  • 63/63 tests passing (11 new).
  • Docs updated (README, README.ar, USER_GUIDE, API contracts).

npm: @zakhm_sa/makeen-core@1.1.0

v1.0.0

Choose a tag to compare

@7odaifa-ab 7odaifa-ab released this 10 Apr 13:23

First Release

  • Multi-track planning engine
  • Hifz, Minor Review, Major Review tracks
  • Rule-based planning with pedagogical constraints
  • Excel/PDF export