v1.5.0: Complete documentation rewrite - 50+ files with AlisaReactionBot style

- Box-style header comments (Project, Author, License) on every file
- Section headers using double-line box decorators
- Feature markers (// ---- FEATURE: XYZ ----) before every major function
- JSDoc comments for EVERY function with @param, @returns, @example
- Inline notes (NOTE, WARNING, TIP) for non-obvious logic
- Footer END markers on every module
- Matched code style to AlisaReactionBot repository
- All files now searchable by feature name via grep

Author: Shinei Nouzen <157171073+Shineii86@users.noreply.github.com>
This commit is contained in:
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ
2026-06-08 16:14:01 +05:30
parent 87d6d4dbf2
commit 0034617c3b
55 changed files with 2965 additions and 108 deletions
+43 -4
View File
@@ -1,20 +1,57 @@
/*
* ======= • ======= • ======= • ======= • =======• =======
* AniKatoAPI — watchOrder.controller.js
* Repository: https://github.com/Shineii86/AniKatoAPI
*
* @description
* Controller for recommended watch order. Returns the optimal
* viewing order for anime with multiple seasons, movies, and OVAs.
* Requires an anime ID as a route parameter.
*
* @exports
* getWatchOrder - Express route handler for GET /api/watch-order/:id
*
* @author Shinei Nouzen
* @license MIT
* ======= • ======= • ======= • ======= • =======• =======
*/
import { extractWatchOrder } from "../extractors/watchOrder.extractor.js";
import { getCache, setCache } from "../helper/cache.helper.js";
// ══════════════════════════════════════════════════════════════
// CONTROLLER: WATCH ORDER
// ══════════════════════════════════════════════════════════════
// ---- FEATURE: Recommended watch order endpoint ----
/**
* Handles GET /api/watch-order/:id requests. Returns recommended
* viewing order for the specified anime franchise.
*
* @param {object} req - Express request object
* @param {string} req.params.id - Anime ID
* @param {object} res - Express response object
* @param {Function} next - Express next middleware function
* @returns {void} Sends JSON response with watch order data
*
* @example
* GET /api/watch-order/12345
* Response: { success: true, results: [{ order, title, ... }] }
*
* @throws {400} If anime ID is not provided
* TIP: Useful for anime franchises with complex viewing orders
*/
const getWatchOrder = async (req, res, next) => {
try {
const { id } = req.params;
if (!id) {
return res.status(400).json({ success: false, message: "Anime ID is required" });
}
const cacheKey = `watchorder_${id}`;
const cached = getCache(cacheKey);
if (cached) {
return res.json({ success: true, results: cached });
}
const data = await extractWatchOrder(id);
setCache(cacheKey, data);
res.json({ success: true, results: data });
@@ -23,4 +60,6 @@ const getWatchOrder = async (req, res, next) => {
}
};
export { getWatchOrder };
export { getWatchOrder };
// ══════════════════════════════════════════════════════════════ END: watchOrder.controller.js