All checks were successful
Deploy / deploy (push) Successful in 2m38s
- Updated the `page.tsx` component to enhance user experience with new UI elements and improved layout. - Modified the `funnel-banner.tsx` to include dynamic text and improved styling for better engagement. - Adjusted the `liste-paneli.tsx` to provide clearer information on user credits and package details. - Enhanced the `rapor-listesi.tsx` to display additional data points for better insights. - Updated the database schema in `app.db` to reflect recent changes in the application logic. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
44 lines
1.4 KiB
TypeScript
44 lines
1.4 KiB
TypeScript
// Paketsiz kullanıcıya giden raporun sunucu tarafı maskesi.
|
||
// YÖK Atlas'ın ham program ve taban sıralaması verileri ücretsiz kalır.
|
||
// Yalnızca AI'ın ürettiği kişisel gerekçe/risk/trend yorumu maskelenir;
|
||
// böylece istemciye ücretli analiz metni hiç inmez.
|
||
|
||
import type { RaporSonuc } from "./ai/rapor";
|
||
|
||
export const ACIK_SATIR = 3;
|
||
|
||
const SAHTE_GEREKCE =
|
||
"Bu tercih için kişisel gerekçe paketle açılır.";
|
||
const SAHTE_RISK =
|
||
"Sıralamana özel yerleşme riski paketle açılır.";
|
||
const SAHTE_TREND =
|
||
"Ham trend verisi ücretsizdir; AI yorumu paketle açılır.";
|
||
|
||
/** genelDegerlendirme'nin yalnızca ilk 1-2 cümlesini bırakır. */
|
||
function degerlendirmeKirp(metin: string): string {
|
||
const cumleler = metin.match(/[^.!?]+[.!?]+/g);
|
||
if (!cumleler || cumleler.length <= 2) return metin;
|
||
return `${cumleler.slice(0, 2).join(" ").trim()} …`;
|
||
}
|
||
|
||
export function raporMaskele(rapor: RaporSonuc): RaporSonuc {
|
||
const tercihler = rapor.tercihler.map((t, i) =>
|
||
i < ACIK_SATIR
|
||
? t
|
||
: {
|
||
...t,
|
||
gerekce: SAHTE_GEREKCE,
|
||
riskNotu: SAHTE_RISK,
|
||
trendOzeti: SAHTE_TREND,
|
||
},
|
||
);
|
||
|
||
return {
|
||
tercihler,
|
||
genelDegerlendirme: degerlendirmeKirp(rapor.genelDegerlendirme),
|
||
uyarilar: rapor.uyarilar,
|
||
// Program adı, üniversite ve 2021–2025 taban sıralamaları ham veridir.
|
||
programlar: rapor.programlar,
|
||
};
|
||
}
|