@nimt/scholarship-slabs
v1.0.0
Published
Single source of truth for NIMT merit-based and entrance-exam scholarship slabs. Consumed by the public site (nimt.ac.in) and UniOS (lead pipeline, cloud dialer, course fee).
Maintainers
Readme
@nimt/scholarship-slabs
Single source of truth for NIMT scholarship policy — merit-based slabs, entrance-exam slabs (CLAT / LSAT / CAT), course→slab mapping, and a fee calculator.
Used by:
- nimt.ac.in (public site) — course pages,
/scholarships-education-loans - UniOS dashboard — lead detail panel, cloud-dialer course-fee widget, counsellor fee-quote builder, parent fee statement
Update the slabs here, bump the version, npm publish, and npm update @nimt/scholarship-slabs in both repos — the website and UniOS stay in lockstep.
Install
npm install @nimt/scholarship-slabsUse
List slabs for a course
import { getScholarshipsForCourse } from '@nimt/scholarship-slabs';
const applicable = getScholarshipsForCourse(
'master-of-business-administration-mba', // course.webflow_slug
'MBA', // course.name (optional)
'MBA-GN', // course.code (optional)
);
// applicable.merit → MeritSlab (pg-mba: 25/15/10% by grad %)
// applicable.entrance → [ EntranceSlab for CAT (MBA) ]
// applicable.meritTier → 'pg-mba'Calculate the best scholarship a lead qualifies for
import { calculateBestScholarship } from '@nimt/scholarship-slabs';
const quote = calculateBestScholarship(
{ slug: 'master-of-business-administration-mba', name: 'MBA' },
{
qualifyingPercent: 88, // graduation %
scores: { 'cat-mba': 20000 }, // CAT rank
},
200_000, // year-1 tuition base fee from your fee_structure_items
);
// quote = {
// percent: 50, // CAT slab wins over 15% merit
// source: 'entrance',
// band: '15,001 – 25,000',
// sourceLabel: 'CAT Rank',
// baseFee: 200000,
// discount: 100000,
// netFee: 100000,
// }The calculator picks whichever of (merit, entrance) gives the bigger discount and returns null if the lead doesn't qualify for any slab.
Show the renewal-policy disclaimer
import { RENEWAL_POLICY_NOTE } from '@nimt/scholarship-slabs';
// Render in every UI surface where you display a calculated scholarship.
// "Merit-based scholarship is applicable for the first year only…"CAHET-only courses
import { isCAHETProgramme } from '@nimt/scholarship-slabs';
if (isCAHETProgramme(course.slug, course.name, course.code)) {
// Lead can only be progressed via CAHET counselling (ABVMU Lucknow).
// No institute entrance exam, no direct merit-only admission.
}UniOS integration checklist
Surface scholarship in every place a fee is shown, not only the counsellor view:
| Surface | What to add |
|---|---|
| Lead detail page | Eligibility-aware scholarship calculator. Inputs: qualifying %, entrance score. Output: discount %, net year-1 fee. |
| Cloud-dialer call screen | Same calculator surfaced as a live widget so the agent can quote on-call. |
| Course Fee page / fee_structure_items rendering | Show the published fee and the dynamic "you may qualify for X% scholarship → ₹Y" line below it. |
| Counsellor fee-quote builder | Auto-applies the best scholarship; counsellor can override (with reason). |
| Parent / student fee statement | Renders the chosen scholarship + RENEWAL_POLICY_NOTE so the year-2 rule is explicit. |
| PDF offer letter | Line-item: base fee, scholarship band & %, net fee, disclaimer. |
| Lead-list filters | "Eligible for ≥ X% scholarship" (uses getScholarshipsForCourse + lead's qualifying %). |
| Admin reports | Aggregate discount given vs. base fee per programme / per counsellor. |
Suggested wiring in UniOS
// src/lib/scholarships.ts (UniOS)
import {
calculateBestScholarship,
getScholarshipsForCourse,
isCAHETProgramme,
RENEWAL_POLICY_NOTE,
} from '@nimt/scholarship-slabs';
export function quoteForLead(lead, course, baseFee) {
return calculateBestScholarship(
{ slug: course.webflow_slug, name: course.name, code: course.code },
{
qualifyingPercent: lead.qualifying_percent,
scores: {
'cat-mba': lead.cat_rank,
'cat-pgdm': lead.cat_rank,
clat: lead.clat_rank,
lsat: lead.lsat_percentile,
},
},
baseFee,
);
}Then in any UniOS view that already renders course.fee_per_year or fee_structure_items.year_1, call quoteForLead(lead, course, baseFee) and render the result.
Lead-table schema additions (UniOS Supabase)
Add columns to leads if not already present:
alter table leads
add column if not exists qualifying_percent numeric,
add column if not exists clat_rank int,
add column if not exists lsat_percentile numeric,
add column if not exists cat_rank int;Populate these from the application form so the calculator has inputs.
Publishing
cd packages/scholarship-slabs
npm run build # tsc → dist/
npm version patch # or minor / major
npm publish # requires @nimt org access on npmBoth repos (nimt.ac.in and UniOS) should then run npm update @nimt/scholarship-slabs.
Local development (without publishing)
In this repo, the website already consumes the package via local path. From UniOS, you can do the same during development:
# In UniOS, link to a local checkout of this repo
npm link /path/to/nimtweb/packages/scholarship-slabsWhen you're done, run npm unlink @nimt/scholarship-slabs and switch to the published version.
What lives here vs. elsewhere
- Here: slab data + lookup + calculator (pure functions, zero deps).
- Not here: fee data, course catalog, lead data — those stay in Supabase. This package only knows policy.
