feat: social graph features

This commit is contained in:
gosangam
2026-06-04 19:30:50 +05:30
parent 0f433c5708
commit 684ea2ae97
16 changed files with 2504 additions and 119 deletions
+26
View File
@@ -0,0 +1,26 @@
/**
* Sampradāya (spiritual lineage) options for the profile field.
*
* Stored as a lowercase `code` on the account; the `name` is the display
* label shown in the searchable picker. Only Gaudiya exists today —
* append more entries here as they're supported (the BFF allow-list in
* user_service.go must be extended in lockstep).
*/
export const SAMPRADAYAS: { code: string; name: string }[] = [
{ code: "gaudiya", name: "Gaudiya" },
];
/** Display label for a sampradāya code, or null when unknown. */
export function sampradayaName(code: string | null | undefined): string | null {
if (!code) return null;
return SAMPRADAYAS.find((s) => s.code === code)?.name ?? null;
}
/** Resolve a typed display name back to its code (case-insensitive), or
* null when it doesn't match a known lineage. */
export function sampradayaCode(name: string): string | null {
const n = name.trim().toLowerCase();
if (!n) return null;
return SAMPRADAYAS.find((s) => s.name.toLowerCase() === n)?.code ?? null;
}