jansathi-community-schema 0.27.0 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -153,4 +153,31 @@ export declare const CROWDFUNDING_TIER_MAXIMUM_INR = 1000000;
153
153
  export declare const CROWDFUNDING_MAX_DONATION_INR = 2500000;
154
154
  /** Listing page size when crowdfunding is fetched as its own list. */
155
155
  export declare const CROWDFUNDING_PAGE_SIZE = 20;
156
+ /**
157
+ * Flat platform-fee rate. Applied to the campaign target for upfront
158
+ * billing or to collected donations for deferred billing.
159
+ */
160
+ export declare const CROWDFUNDING_PLATFORM_FEE_RATE = 0.05;
161
+ /**
162
+ * Indian GST rate on platform-service charges (18 %). Applied to the
163
+ * platform-fee component only, NOT to the whole campaign amount.
164
+ */
165
+ export declare const CROWDFUNDING_FEE_GST_RATE = 0.18;
166
+ /**
167
+ * Compute the fee + GST + total for a given target amount in INR
168
+ * (integer rupees, not paise). Returns integer rupees throughout —
169
+ * Razorpay-wire conversion to paise (× 100) is the caller's job
170
+ * so this helper stays unit-agnostic.
171
+ *
172
+ * Used by:
173
+ * - Frontend composer pricing UI (the "Pay ₹X" button label)
174
+ * - Backend payment dispatcher (computes order amount server-side
175
+ * so the client can't tamper with the rupee figure)
176
+ * - Disbursement service (deferred-billing deduction at payout)
177
+ */
178
+ export declare function computeCrowdfundingFee(goalInr: number): {
179
+ platformFeeInr: number;
180
+ gstInr: number;
181
+ totalInr: number;
182
+ };
156
183
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,mCAAmC;AACnC,eAAO,MAAM,cAAc,KAAK,CAAC;AAEjC,qCAAqC;AACrC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,0CAA0C;AAC1C,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC,yEAAyE;A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OAL_INR;
163
163
  /** Listing page size when crowdfunding is fetched as its own list. */
164
164
  export const CROWDFUNDING_PAGE_SIZE = 20;
165
+ // ─── Platform-fee model ──────────────────────────────────────────────
166
+ //
167
+ // Jansathi charges a flat 5 % platform fee on the campaign target
168
+ // (upfront billing) OR the collected amount (deferred billing), plus
169
+ // Indian GST on the fee component. These constants are the SINGLE
170
+ // SOURCE OF TRUTH — the frontend pricing UI, the backend payment
171
+ // dispatcher, and the disbursement deduction all derive their numbers
172
+ // from here so the math never drifts across surfaces.
173
+ //
174
+ // If the rate ever changes (e.g. GST council moves services to a
175
+ // different band), bumping these constants is the only edit needed.
176
+ /**
177
+ * Flat platform-fee rate. Applied to the campaign target for upfront
178
+ * billing or to collected donations for deferred billing.
179
+ */
180
+ export const CROWDFUNDING_PLATFORM_FEE_RATE = 0.05;
181
+ /**
182
+ * Indian GST rate on platform-service charges (18 %). Applied to the
183
+ * platform-fee component only, NOT to the whole campaign amount.
184
+ */
185
+ export const CROWDFUNDING_FEE_GST_RATE = 0.18;
186
+ /**
187
+ * Compute the fee + GST + total for a given target amount in INR
188
+ * (integer rupees, not paise). Returns integer rupees throughout —
189
+ * Razorpay-wire conversion to paise (× 100) is the caller's job
190
+ * so this helper stays unit-agnostic.
191
+ *
192
+ * Used by:
193
+ * - Frontend composer pricing UI (the "Pay ₹X" button label)
194
+ * - Backend payment dispatcher (computes order amount server-side
195
+ * so the client can't tamper with the rupee figure)
196
+ * - Disbursement service (deferred-billing deduction at payout)
197
+ */
198
+ export function computeCrowdfundingFee(goalInr) {
199
+ const safeGoal = Number.isFinite(goalInr) && goalInr > 0 ? goalInr : 0;
200
+ const platformFeeInr = Math.round(safeGoal * CROWDFUNDING_PLATFORM_FEE_RATE);
201
+ const gstInr = Math.round(platformFeeInr * CROWDFUNDING_FEE_GST_RATE);
202
+ return {
203
+ platformFeeInr,
204
+ gstInr,
205
+ totalInr: platformFeeInr + gstInr,
206
+ };
207
+ }
165
208
  //# sourceMappingURL=constants.js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EzC;;aAEa;AACb,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC;AAElD,0BAA0B;AAC1B,MAAM,CAAC,MAAM,uCAAuC,GAAG,GAAG,CAAC;AAC3D,MAAM,CAAC,MAAM,2CAA2C,GAAG,EAAE,CAAC;AAE9D,mDAAmD;AACnD,MAAM,CAAC,MAAM,uCAAuC,GAAG,EAAE,CAAC;AAC1D,MAAM,CAAC,MAAM,uCAAuC,GAAG,GAAG,CAAC;AAE3D;;;;;;;;mEAQmE;AACnE,MAAM,CAAC,MAAM,8BAA8B,GAAG,MAAM,CAAC;AACrD,MAAM,CAAC,MAAM,8BAA8B,GAAG,QAAQ,CAAC;AACvD,MAAM,CAAC,MAAM,6BAA6B,GAAG,SAAS,CAAC;AAEvD;sEACsE;AACtE,MAAM,CAAC,MAAM,6BAA6B,GAAG,yBAAyB,CAAC;AAEvE,sEAAsE;AACtE,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC","sourcesContent":["/**\n * Tunable constants shared across the community feature.\n *\n * Live here (not inline in feature code) so backend and every frontend\n * agree byte-for-byte on the same limits, paginations, and timeouts.\n * Bump versions of this package when these change.\n *\n * @module community-schema/constants\n */\n\n// ─── Pagination ─────────────────────────────────────────────────────────────\n\n/** Feed list default page size. */\nexport const FEED_PAGE_SIZE = 20;\n\n/** People list default page size. */\nexport const PEOPLE_PAGE_SIZE = 30;\n\n/** Comments per page on a single post. */\nexport const COMMENTS_PAGE_SIZE = 20;\n\n/** Replies per top-level comment loaded with the first comments page. */\nexport const REPLIES_PRELOAD_COUNT = 3;\n\n// ─── Post media limits ─────────────────────────────────────────────────────\n\n/** Max images per post. */\nexport const POST_MAX_IMAGES = 10;\n\n/** Max videos per post. */\nexport const POST_MAX_VIDEOS = 5;\n\n/** Max duration of a single video in seconds (10 min). */\nexport const POST_MAX_VIDEO_SECONDS = 10 * 60;\n\n/** Per-image hard cap (15 MB). The file service compresses to fit. */\nexport const POST_MAX_IMAGE_BYTES = 15 * 1024 * 1024;\n\n/** Per-video hard cap (200 MB). */\nexport const POST_MAX_VIDEO_BYTES = 200 * 1024 * 1024;\n\n// ─── Text limits ────────────────────────────────────────────────────────────\n\n/** Post body character cap. Long enough for long-form, short enough to\n * keep feed rendering snappy. */\nexport const POST_MAX_BODY_CHARS = 5000;\n\n/** Comment + reply body character cap. */\nexport const COMMENT_MAX_BODY_CHARS = 2000;\n\n/** Free-text bio on a public profile. */\nexport const PROFILE_MAX_BIO_CHARS = 280;\n\n// ─── Engagement ─────────────────────────────────────────────────────────────\n\n/** Window during which an author can edit their own post / comment, in ms. */\nexport const EDIT_GRACE_WINDOW_MS = 5 * 60 * 1000;\n\n// ─── Groups ─────────────────────────────────────────────────────────────────\n\n/** Max members in a single user-created group chat. */\nexport const GROUP_MAX_MEMBERS = 256;\n\n/** Group name length. */\nexport const GROUP_NAME_MAX_CHARS = 60;\nexport const GROUP_NAME_MIN_CHARS = 2;\n\n// ─── Communities ───────────────────────────────────────────────────────────\n\n/** Community name length. Same range as a group, with room for a real\n * topic title. */\nexport const COMMUNITY_NAME_MAX_CHARS = 60;\nexport const COMMUNITY_NAME_MIN_CHARS = 2;\n\n/** Slug is auto-generated from name on create (lowercase, hyphenated)\n * but the user may also pick one explicitly on the create form. Match\n * Reddit's vibes: 3-21 chars, lower alphanumeric + underscore + hyphen. */\nexport const COMMUNITY_SLUG_MAX_CHARS = 21;\nexport const COMMUNITY_SLUG_MIN_CHARS = 3;\n/** Slug character class — kept in lockstep with the regex enforced by\n * the create-body Zod schema and the backend's slug normaliser. */\nexport const COMMUNITY_SLUG_PATTERN = /^[a-z0-9_-]+$/;\n\n/** Description shown on the community card + header. */\nexport const COMMUNITY_DESCRIPTION_MAX_CHARS = 500;\n\n/** Communities discover + members + posts page sizes. */\nexport const COMMUNITIES_PAGE_SIZE = 20;\nexport const COMMUNITY_MEMBERS_PAGE_SIZE = 50;\n\n// ─── Community v2 (taxonomy + reach + tags + verification + designation) ──\n\n/** Max tags a community can carry. Tags are picked from a curated\n * enum (`COMMUNITY_TAG_VALUES`), not free text — keeps the picker\n * + discovery filters meaningful. */\nexport const COMMUNITY_MAX_TAGS = 10;\n\n/** Hyperlocal discovery radius. Set generously because GPS accuracy\n * is noisy on phones — 5 km usually covers a viewer's neighborhood\n * plus a buffer of adjacent localities. Single source of truth so\n * backend filter + frontend copy agree. */\nexport const COMMUNITY_HYPERLOCAL_RADIUS_KM = 5;\n\n/** Custom (free-text) designation length bounds — used when the\n * owner / admin types a designation that isn't in the preset enum.\n * The preset path takes precedence; custom is the fallback. */\nexport const COMMUNITY_DESIGNATION_CUSTOM_MIN_CHARS = 2;\nexport const COMMUNITY_DESIGNATION_CUSTOM_MAX_CHARS = 30;\n/** Alphanumeric + space + ampersand — covers natural English labels\n * (\"Vice Chairman\", \"Press & Media\") without opening the door to\n * punctuation soup. */\nexport const COMMUNITY_DESIGNATION_CUSTOM_PATTERN = /^[A-Za-z0-9 &]+$/;\n\n// ─── Polls ─────────────────────────────────────────────────────────────────\n\n/** Poll question (the \"What's your favourite Diwali sweet?\" prompt).\n * Twitter caps at 280; we match for a snappy feed read. */\nexport const POLL_QUESTION_MAX_CHARS = 280;\nexport const POLL_QUESTION_MIN_CHARS = 1;\n\n/** Per-option label length. Long enough for a phrase, short enough that\n * options stack readably in a feed card on a phone. */\nexport const POLL_OPTION_MAX_CHARS = 80;\nexport const POLL_OPTION_MIN_CHARS = 1;\n\n/** A poll must offer at least two options (else it's not a choice) and\n * at most six (more than that fragments votes and tanks readability —\n * matches Twitter's 4 / WhatsApp's 12 / our pick is the middle). */\nexport const POLL_MIN_OPTIONS = 2;\nexport const POLL_MAX_OPTIONS = 6;\n\n/** Duration bounds. Polls MUST have an expiry — open-ended polls go\n * stale and clutter feeds (see PoLLs spec discussion). The floor stops\n * accidental \"1 second\" polls; the ceiling caps a single poll's\n * visibility window so authors think about timing. */\nexport const POLL_MIN_DURATION_MS = 5 * 60 * 1000; // 5 minutes\nexport const POLL_MAX_DURATION_MS = 30 * 24 * 60 * 60 * 1000; // 30 days\n\n/** Composer presets (the radio chips in the duration picker). Custom\n * date entry covers everything in between. Server still validates the\n * resolved `closesAt` against the bounds above. */\nexport const POLL_DURATION_PRESETS_MS = {\n oneDay: 24 * 60 * 60 * 1000,\n threeDays: 3 * 24 * 60 * 60 * 1000,\n sevenDays: 7 * 24 * 60 * 60 * 1000,\n fourteenDays: 14 * 24 * 60 * 60 * 1000,\n} as const;\n\n/** Feed page size for polls when fetched as their own list (rare —\n * polls usually surface via the unified feed). Keeps memory bounded. */\nexport const POLLS_PAGE_SIZE = 20;\n\n// ─── Crowdfunding ──────────────────────────────────────────────────────────\n\n/** Min goal in ₹. Filters spam while staying low enough for genuine\n * community-level requests (small medical bills, school fees, etc.). */\nexport const CROWDFUNDING_MIN_GOAL_INR = 500;\n\n/** Max goal in ₹. v1 ceiling — high enough for real medical/disaster\n * cases, low enough to discourage professional-fundraising adoption\n * before we have escrow infrastructure. */\nexport const CROWDFUNDING_MAX_GOAL_INR = 25_00_000;\n\n/** Minimum campaign duration in days. Below this and there's not enough\n * time for verification + visibility. */\nexport const CROWDFUNDING_MIN_DURATION_DAYS = 7;\n\n/** Max campaign duration in days. Industry norm — active campaigns feel\n * urgent; stagnant ones don't. Creator can always re-launch a follow-up. */\nexport const CROWDFUNDING_MAX_DURATION_DAYS = 60;\n\n/** Title + body limits. Title is the card headline; body is the\n * scrollable story below the goal block. */\nexport const CROWDFUNDING_TITLE_MAX_CHARS = 120;\nexport const CROWDFUNDING_TITLE_MIN_CHARS = 5;\nexport const CROWDFUNDING_DESCRIPTION_MAX_CHARS = 4000;\nexport const CROWDFUNDING_DESCRIPTION_MIN_CHARS = 50;\n\n/** Max story images (different from supporting docs). */\nexport const CROWDFUNDING_MAX_IMAGES = 5;\n\n/** Max supporting documents (medical invoice, school admission letter,\n * etc.). Kept off the wire; only the verifier and the creator see\n * these. */\nexport const CROWDFUNDING_MAX_SUPPORTING_DOCS = 5;\n\n/** Beneficiary fields. */\nexport const CROWDFUNDING_BENEFICIARY_NAME_MAX_CHARS = 100;\nexport const CROWDFUNDING_BENEFICIARY_RELATION_MAX_CHARS = 50;\n\n/** Rejection reason length (verifier-supplied). */\nexport const CROWDFUNDING_REJECTION_REASON_MIN_CHARS = 10;\nexport const CROWDFUNDING_REJECTION_REASON_MAX_CHARS = 500;\n\n/** Identity-tier thresholds keyed to Indian regulatory practice:\n * ≤ 25k → Basic (UDP step 9 verified identity only)\n * 25k–2L → Standard (+ PAN + bank-holder-name match)\n * 2L–10L → Enhanced (+ Aadhaar last-4 + category supporting docs)\n * > 10L → Maximum (+ video KYC or in-person verification by\n * district leader)\n * ₹25k = PAN-mandatory threshold for cash deposits.\n * ₹2L = \"substantial money\" line for verification scrutiny.\n * ₹10L = mandatory video/in-person KYC tier in Indian fintech. */\nexport const CROWDFUNDING_TIER_STANDARD_INR = 25_000;\nexport const CROWDFUNDING_TIER_ENHANCED_INR = 2_00_000;\nexport const CROWDFUNDING_TIER_MAXIMUM_INR = 10_00_000;\n\n/** Max single self-attested donation amount. Capped at the campaign\n * ceiling — a single donor can't claim more than the entire goal. */\nexport const CROWDFUNDING_MAX_DONATION_INR = CROWDFUNDING_MAX_GOAL_INR;\n\n/** Listing page size when crowdfunding is fetched as its own list. */\nexport const CROWDFUNDING_PAGE_SIZE = 20;\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,+EAA+E;AAE/E,mCAAmC;AACnC,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAC;AAEjC,qCAAqC;AACrC,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAEnC,0CAA0C;AAC1C,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAErC,yEAAyE;AACzE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAEvC,8EAA8E;AAE9E,2BAA2B;AAC3B,M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CAAC;AACvD,MAAM,CAAC,MAAM,6BAA6B,GAAG,SAAS,CAAC;AAEvD;sEACsE;AACtE,MAAM,CAAC,MAAM,6BAA6B,GAAG,yBAAyB,CAAC;AAEvE,sEAAsE;AACtE,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAEzC,wEAAwE;AACxE,EAAE;AACF,kEAAkE;AAClE,qEAAqE;AACrE,kEAAkE;AAClE,iEAAiE;AACjE,sEAAsE;AACtE,sDAAsD;AACtD,EAAE;AACF,iEAAiE;AACjE,oEAAoE;AAEpE;;;GAGG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,IAAI,CAAC;AAEnD;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC;AAE9C;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAe;IAKpD,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IACvE,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,8BAA8B,CAAC,CAAC;IAC7E,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,GAAG,yBAAyB,CAAC,CAAC;IACtE,OAAO;QACL,cAAc;QACd,MAAM;QACN,QAAQ,EAAE,cAAc,GAAG,MAAM;KAClC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Tunable constants shared across the community feature.\n *\n * Live here (not inline in feature code) so backend and every frontend\n * agree byte-for-byte on the same limits, paginations, and timeouts.\n * Bump versions of this package when these change.\n *\n * @module community-schema/constants\n */\n\n// ─── Pagination ─────────────────────────────────────────────────────────────\n\n/** Feed list default page size. */\nexport const FEED_PAGE_SIZE = 20;\n\n/** People list default page size. */\nexport const PEOPLE_PAGE_SIZE = 30;\n\n/** Comments per page on a single post. */\nexport const COMMENTS_PAGE_SIZE = 20;\n\n/** Replies per top-level comment loaded with the first comments page. */\nexport const REPLIES_PRELOAD_COUNT = 3;\n\n// ─── Post media limits ─────────────────────────────────────────────────────\n\n/** Max images per post. */\nexport const POST_MAX_IMAGES = 10;\n\n/** Max videos per post. */\nexport const POST_MAX_VIDEOS = 5;\n\n/** Max duration of a single video in seconds (10 min). */\nexport const POST_MAX_VIDEO_SECONDS = 10 * 60;\n\n/** Per-image hard cap (15 MB). The file service compresses to fit. */\nexport const POST_MAX_IMAGE_BYTES = 15 * 1024 * 1024;\n\n/** Per-video hard cap (200 MB). */\nexport const POST_MAX_VIDEO_BYTES = 200 * 1024 * 1024;\n\n// ─── Text limits ────────────────────────────────────────────────────────────\n\n/** Post body character cap. Long enough for long-form, short enough to\n * keep feed rendering snappy. */\nexport const POST_MAX_BODY_CHARS = 5000;\n\n/** Comment + reply body character cap. */\nexport const COMMENT_MAX_BODY_CHARS = 2000;\n\n/** Free-text bio on a public profile. */\nexport const PROFILE_MAX_BIO_CHARS = 280;\n\n// ─── Engagement ─────────────────────────────────────────────────────────────\n\n/** Window during which an author can edit their own post / comment, in ms. */\nexport const EDIT_GRACE_WINDOW_MS = 5 * 60 * 1000;\n\n// ─── Groups ─────────────────────────────────────────────────────────────────\n\n/** Max members in a single user-created group chat. */\nexport const GROUP_MAX_MEMBERS = 256;\n\n/** Group name length. */\nexport const GROUP_NAME_MAX_CHARS = 60;\nexport const GROUP_NAME_MIN_CHARS = 2;\n\n// ─── Communities ───────────────────────────────────────────────────────────\n\n/** Community name length. Same range as a group, with room for a real\n * topic title. */\nexport const COMMUNITY_NAME_MAX_CHARS = 60;\nexport const COMMUNITY_NAME_MIN_CHARS = 2;\n\n/** Slug is auto-generated from name on create (lowercase, hyphenated)\n * but the user may also pick one explicitly on the create form. Match\n * Reddit's vibes: 3-21 chars, lower alphanumeric + underscore + hyphen. */\nexport const COMMUNITY_SLUG_MAX_CHARS = 21;\nexport const COMMUNITY_SLUG_MIN_CHARS = 3;\n/** Slug character class — kept in lockstep with the regex enforced by\n * the create-body Zod schema and the backend's slug normaliser. */\nexport const COMMUNITY_SLUG_PATTERN = /^[a-z0-9_-]+$/;\n\n/** Description shown on the community card + header. */\nexport const COMMUNITY_DESCRIPTION_MAX_CHARS = 500;\n\n/** Communities discover + members + posts page sizes. */\nexport const COMMUNITIES_PAGE_SIZE = 20;\nexport const COMMUNITY_MEMBERS_PAGE_SIZE = 50;\n\n// ─── Community v2 (taxonomy + reach + tags + verification + designation) ──\n\n/** Max tags a community can carry. Tags are picked from a curated\n * enum (`COMMUNITY_TAG_VALUES`), not free text — keeps the picker\n * + discovery filters meaningful. */\nexport const COMMUNITY_MAX_TAGS = 10;\n\n/** Hyperlocal discovery radius. Set generously because GPS accuracy\n * is noisy on phones — 5 km usually covers a viewer's neighborhood\n * plus a buffer of adjacent localities. Single source of truth so\n * backend filter + frontend copy agree. */\nexport const COMMUNITY_HYPERLOCAL_RADIUS_KM = 5;\n\n/** Custom (free-text) designation length bounds — used when the\n * owner / admin types a designation that isn't in the preset enum.\n * The preset path takes precedence; custom is the fallback. */\nexport const COMMUNITY_DESIGNATION_CUSTOM_MIN_CHARS = 2;\nexport const COMMUNITY_DESIGNATION_CUSTOM_MAX_CHARS = 30;\n/** Alphanumeric + space + ampersand — covers natural English labels\n * (\"Vice Chairman\", \"Press & Media\") without opening the door to\n * punctuation soup. */\nexport const COMMUNITY_DESIGNATION_CUSTOM_PATTERN = /^[A-Za-z0-9 &]+$/;\n\n// ─── Polls ─────────────────────────────────────────────────────────────────\n\n/** Poll question (the \"What's your favourite Diwali sweet?\" prompt).\n * Twitter caps at 280; we match for a snappy feed read. */\nexport const POLL_QUESTION_MAX_CHARS = 280;\nexport const POLL_QUESTION_MIN_CHARS = 1;\n\n/** Per-option label length. Long enough for a phrase, short enough that\n * options stack readably in a feed card on a phone. */\nexport const POLL_OPTION_MAX_CHARS = 80;\nexport const POLL_OPTION_MIN_CHARS = 1;\n\n/** A poll must offer at least two options (else it's not a choice) and\n * at most six (more than that fragments votes and tanks readability —\n * matches Twitter's 4 / WhatsApp's 12 / our pick is the middle). */\nexport const POLL_MIN_OPTIONS = 2;\nexport const POLL_MAX_OPTIONS = 6;\n\n/** Duration bounds. Polls MUST have an expiry — open-ended polls go\n * stale and clutter feeds (see PoLLs spec discussion). The floor stops\n * accidental \"1 second\" polls; the ceiling caps a single poll's\n * visibility window so authors think about timing. */\nexport const POLL_MIN_DURATION_MS = 5 * 60 * 1000; // 5 minutes\nexport const POLL_MAX_DURATION_MS = 30 * 24 * 60 * 60 * 1000; // 30 days\n\n/** Composer presets (the radio chips in the duration picker). Custom\n * date entry covers everything in between. Server still validates the\n * resolved `closesAt` against the bounds above. */\nexport const POLL_DURATION_PRESETS_MS = {\n oneDay: 24 * 60 * 60 * 1000,\n threeDays: 3 * 24 * 60 * 60 * 1000,\n sevenDays: 7 * 24 * 60 * 60 * 1000,\n fourteenDays: 14 * 24 * 60 * 60 * 1000,\n} as const;\n\n/** Feed page size for polls when fetched as their own list (rare —\n * polls usually surface via the unified feed). Keeps memory bounded. */\nexport const POLLS_PAGE_SIZE = 20;\n\n// ─── Crowdfunding ──────────────────────────────────────────────────────────\n\n/** Min goal in ₹. Filters spam while staying low enough for genuine\n * community-level requests (small medical bills, school fees, etc.). */\nexport const CROWDFUNDING_MIN_GOAL_INR = 500;\n\n/** Max goal in ₹. v1 ceiling — high enough for real medical/disaster\n * cases, low enough to discourage professional-fundraising adoption\n * before we have escrow infrastructure. */\nexport const CROWDFUNDING_MAX_GOAL_INR = 25_00_000;\n\n/** Minimum campaign duration in days. Below this and there's not enough\n * time for verification + visibility. */\nexport const CROWDFUNDING_MIN_DURATION_DAYS = 7;\n\n/** Max campaign duration in days. Industry norm — active campaigns feel\n * urgent; stagnant ones don't. Creator can always re-launch a follow-up. */\nexport const CROWDFUNDING_MAX_DURATION_DAYS = 60;\n\n/** Title + body limits. Title is the card headline; body is the\n * scrollable story below the goal block. */\nexport const CROWDFUNDING_TITLE_MAX_CHARS = 120;\nexport const CROWDFUNDING_TITLE_MIN_CHARS = 5;\nexport const CROWDFUNDING_DESCRIPTION_MAX_CHARS = 4000;\nexport const CROWDFUNDING_DESCRIPTION_MIN_CHARS = 50;\n\n/** Max story images (different from supporting docs). */\nexport const CROWDFUNDING_MAX_IMAGES = 5;\n\n/** Max supporting documents (medical invoice, school admission letter,\n * etc.). Kept off the wire; only the verifier and the creator see\n * these. */\nexport const CROWDFUNDING_MAX_SUPPORTING_DOCS = 5;\n\n/** Beneficiary fields. */\nexport const CROWDFUNDING_BENEFICIARY_NAME_MAX_CHARS = 100;\nexport const CROWDFUNDING_BENEFICIARY_RELATION_MAX_CHARS = 50;\n\n/** Rejection reason length (verifier-supplied). */\nexport const CROWDFUNDING_REJECTION_REASON_MIN_CHARS = 10;\nexport const CROWDFUNDING_REJECTION_REASON_MAX_CHARS = 500;\n\n/** Identity-tier thresholds keyed to Indian regulatory practice:\n * ≤ 25k → Basic (UDP step 9 verified identity only)\n * 25k–2L → Standard (+ PAN + bank-holder-name match)\n * 2L–10L → Enhanced (+ Aadhaar last-4 + category supporting docs)\n * > 10L → Maximum (+ video KYC or in-person verification by\n * district leader)\n * ₹25k = PAN-mandatory threshold for cash deposits.\n * ₹2L = \"substantial money\" line for verification scrutiny.\n * ₹10L = mandatory video/in-person KYC tier in Indian fintech. */\nexport const CROWDFUNDING_TIER_STANDARD_INR = 25_000;\nexport const CROWDFUNDING_TIER_ENHANCED_INR = 2_00_000;\nexport const CROWDFUNDING_TIER_MAXIMUM_INR = 10_00_000;\n\n/** Max single self-attested donation amount. Capped at the campaign\n * ceiling — a single donor can't claim more than the entire goal. */\nexport const CROWDFUNDING_MAX_DONATION_INR = CROWDFUNDING_MAX_GOAL_INR;\n\n/** Listing page size when crowdfunding is fetched as its own list. */\nexport const CROWDFUNDING_PAGE_SIZE = 20;\n\n// ─── Platform-fee model ──────────────────────────────────────────────\n//\n// Jansathi charges a flat 5 % platform fee on the campaign target\n// (upfront billing) OR the collected amount (deferred billing), plus\n// Indian GST on the fee component. These constants are the SINGLE\n// SOURCE OF TRUTH — the frontend pricing UI, the backend payment\n// dispatcher, and the disbursement deduction all derive their numbers\n// from here so the math never drifts across surfaces.\n//\n// If the rate ever changes (e.g. GST council moves services to a\n// different band), bumping these constants is the only edit needed.\n\n/**\n * Flat platform-fee rate. Applied to the campaign target for upfront\n * billing or to collected donations for deferred billing.\n */\nexport const CROWDFUNDING_PLATFORM_FEE_RATE = 0.05;\n\n/**\n * Indian GST rate on platform-service charges (18 %). Applied to the\n * platform-fee component only, NOT to the whole campaign amount.\n */\nexport const CROWDFUNDING_FEE_GST_RATE = 0.18;\n\n/**\n * Compute the fee + GST + total for a given target amount in INR\n * (integer rupees, not paise). Returns integer rupees throughout —\n * Razorpay-wire conversion to paise (× 100) is the caller's job\n * so this helper stays unit-agnostic.\n *\n * Used by:\n * - Frontend composer pricing UI (the \"Pay ₹X\" button label)\n * - Backend payment dispatcher (computes order amount server-side\n * so the client can't tamper with the rupee figure)\n * - Disbursement service (deferred-billing deduction at payout)\n */\nexport function computeCrowdfundingFee(goalInr: number): {\n platformFeeInr: number;\n gstInr: number;\n totalInr: number;\n} {\n const safeGoal = Number.isFinite(goalInr) && goalInr > 0 ? goalInr : 0;\n const platformFeeInr = Math.round(safeGoal * CROWDFUNDING_PLATFORM_FEE_RATE);\n const gstInr = Math.round(platformFeeInr * CROWDFUNDING_FEE_GST_RATE);\n return {\n platformFeeInr,\n gstInr,\n totalInr: platformFeeInr + gstInr,\n };\n}\n"]}
@@ -129,6 +129,44 @@ export declare const crowdfundingDonationStateSchema: z.ZodEnum<{
129
129
  disputed: "disputed";
130
130
  }>;
131
131
  export type CrowdfundingDonationState = z.infer<typeof crowdfundingDonationStateSchema>;
132
+ /**
133
+ * When the platform fee is settled:
134
+ * - `'upfront'` — Creator pays 5 % of TARGET + 18 % GST via
135
+ * Razorpay BEFORE the campaign goes to leader review. Approved
136
+ * campaigns then disburse 100 % of donations to the creator.
137
+ * - `'deferred'` — Nothing paid upfront. At disbursement time the
138
+ * platform deducts 5 % of COLLECTED + 18 % GST before transferring
139
+ * the rest to the creator.
140
+ *
141
+ * The choice is captured at submit time on the composer's Pricing
142
+ * step and surfaced on the wire so the My Campaigns surface can show
143
+ * "Fee paid" / "Fee deducted at payout" badges per campaign.
144
+ */
145
+ export declare const CROWDFUNDING_FEE_BILLING_MODE_VALUES: readonly ["upfront", "deferred"];
146
+ export declare const crowdfundingFeeBillingModeSchema: z.ZodEnum<{
147
+ upfront: "upfront";
148
+ deferred: "deferred";
149
+ }>;
150
+ export type CrowdfundingFeeBillingMode = z.infer<typeof crowdfundingFeeBillingModeSchema>;
151
+ /**
152
+ * Server-tracked state of the upfront-billing payment. Always
153
+ * `'deferred'` when the creator picked the on-collection mode (there
154
+ * is nothing to pay until disbursement). For upfront mode it starts
155
+ * at `'pending'` on draft create, flips to `'paid'` after Razorpay
156
+ * verify, and stays `'paid'` for the campaign lifetime.
157
+ *
158
+ * `'failed'` is reserved for the rare case where activation crosses
159
+ * with a Razorpay refund — surfaced so the My Campaigns surface can
160
+ * prompt the creator to retry payment without breaking the draft.
161
+ */
162
+ export declare const CROWDFUNDING_FEE_PAYMENT_STATUS_VALUES: readonly ["pending", "paid", "deferred", "failed"];
163
+ export declare const crowdfundingFeePaymentStatusSchema: z.ZodEnum<{
164
+ pending: "pending";
165
+ deferred: "deferred";
166
+ paid: "paid";
167
+ failed: "failed";
168
+ }>;
169
+ export type CrowdfundingFeePaymentStatus = z.infer<typeof crowdfundingFeePaymentStatusSchema>;
132
170
  /**
133
171
  * Per-campaign verification block. `approved` is the only state that
134
172
  * lets the campaign go ACTIVE; `pending` keeps it queued; `rejected`
@@ -300,6 +338,18 @@ export declare const crowdfundingFeedItemSchema: z.ZodObject<{
300
338
  closed_by_creator: "closed_by_creator";
301
339
  }>;
302
340
  closedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
341
+ feeBillingMode: z.ZodOptional<z.ZodEnum<{
342
+ upfront: "upfront";
343
+ deferred: "deferred";
344
+ }>>;
345
+ feePaymentStatus: z.ZodOptional<z.ZodEnum<{
346
+ pending: "pending";
347
+ deferred: "deferred";
348
+ paid: "paid";
349
+ failed: "failed";
350
+ }>>;
351
+ platformFeeAmountInr: z.ZodOptional<z.ZodNumber>;
352
+ feeGstAmountInr: z.ZodOptional<z.ZodNumber>;
303
353
  score: z.ZodNumber;
304
354
  commentCount: z.ZodNumber;
305
355
  repostCount: z.ZodNumber;
@@ -459,6 +509,18 @@ export declare const communityCrowdfundingWireSchema: z.ZodObject<{
459
509
  closed_by_creator: "closed_by_creator";
460
510
  }>;
461
511
  closedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
512
+ feeBillingMode: z.ZodOptional<z.ZodEnum<{
513
+ upfront: "upfront";
514
+ deferred: "deferred";
515
+ }>>;
516
+ feePaymentStatus: z.ZodOptional<z.ZodEnum<{
517
+ pending: "pending";
518
+ deferred: "deferred";
519
+ paid: "paid";
520
+ failed: "failed";
521
+ }>>;
522
+ platformFeeAmountInr: z.ZodOptional<z.ZodNumber>;
523
+ feeGstAmountInr: z.ZodOptional<z.ZodNumber>;
462
524
  score: z.ZodNumber;
463
525
  commentCount: z.ZodNumber;
464
526
  repostCount: z.ZodNumber;
@@ -584,6 +646,10 @@ export declare const createCrowdfundingBodySchema: z.ZodObject<{
584
646
  aadhaarLast4: z.ZodOptional<z.ZodString>;
585
647
  supportingDocs: z.ZodOptional<z.ZodArray<z.ZodString>>;
586
648
  communityId: z.ZodOptional<z.ZodString>;
649
+ feeBillingMode: z.ZodOptional<z.ZodEnum<{
650
+ upfront: "upfront";
651
+ deferred: "deferred";
652
+ }>>;
587
653
  }, z.core.$strip>;
588
654
  export type CreateCrowdfundingBody = z.infer<typeof createCrowdfundingBodySchema>;
589
655
  /**
@@ -656,6 +722,10 @@ export declare const updateCrowdfundingBodySchema: z.ZodObject<{
656
722
  aadhaarLast4: z.ZodOptional<z.ZodOptional<z.ZodString>>;
657
723
  supportingDocs: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
658
724
  communityId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
725
+ feeBillingMode: z.ZodOptional<z.ZodOptional<z.ZodEnum<{
726
+ upfront: "upfront";
727
+ deferred: "deferred";
728
+ }>>>;
659
729
  }, z.core.$strip>;
660
730
  export type UpdateCrowdfundingBody = z.infer<typeof updateCrowdfundingBodySchema>;
661
731
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"crowdfunding.d.ts","sourceRoot":"","sources":["../src/crowdfunding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAwBxB;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,2PAwB/B,CAAC;AAEX;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,oEAM/B,CAAC;AACX,eAAO,MAAM,0BAA0B;;;;;;EAAuC,CAAC;AAC/E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,4DAM/B,CAAC;AACX,eAAO,MAAM,yBAAyB;;;;;;EAAuC,CAAC;AAC9E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;EAAuC,CAAC;AAC/E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,+DAM5B,CAAC;AACX,eAAO,MAAM,uBAAuB;;;;;;EAAoC,CAAC;AACzE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AA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;;;GAGG;AACH,eAAO,MAAM,4BAA4B;;iBAMvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAIlF;;;;;GAKG;AACH,eAAO,MAAM,oCAAoC;;;;iBAM/C,CAAC;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAElG;;;;GAIG;AACH,eAAO,MAAM,mCAAmC;;iBAE9C,CAAC;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAIhG,eAAO,MAAM,oCAAoC;;;;;;;;iBAI/C,CAAC;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAElG;;;;;GAKG;AACH,eAAO,MAAM,sCAAsC;;;;;;;;iBAIjD,CAAC;AACH,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CACpD,OAAO,sCAAsC,CAC9C,CAAC"}
@@ -130,6 +130,39 @@ export const crowdfundingStatusSchema = z.enum(CROWDFUNDING_STATUS_VALUES);
130
130
  */
131
131
  export const CROWDFUNDING_DONATION_STATE_VALUES = ['pending', 'verified', 'disputed'];
132
132
  export const crowdfundingDonationStateSchema = z.enum(CROWDFUNDING_DONATION_STATE_VALUES);
133
+ /**
134
+ * When the platform fee is settled:
135
+ * - `'upfront'` — Creator pays 5 % of TARGET + 18 % GST via
136
+ * Razorpay BEFORE the campaign goes to leader review. Approved
137
+ * campaigns then disburse 100 % of donations to the creator.
138
+ * - `'deferred'` — Nothing paid upfront. At disbursement time the
139
+ * platform deducts 5 % of COLLECTED + 18 % GST before transferring
140
+ * the rest to the creator.
141
+ *
142
+ * The choice is captured at submit time on the composer's Pricing
143
+ * step and surfaced on the wire so the My Campaigns surface can show
144
+ * "Fee paid" / "Fee deducted at payout" badges per campaign.
145
+ */
146
+ export const CROWDFUNDING_FEE_BILLING_MODE_VALUES = ['upfront', 'deferred'];
147
+ export const crowdfundingFeeBillingModeSchema = z.enum(CROWDFUNDING_FEE_BILLING_MODE_VALUES);
148
+ /**
149
+ * Server-tracked state of the upfront-billing payment. Always
150
+ * `'deferred'` when the creator picked the on-collection mode (there
151
+ * is nothing to pay until disbursement). For upfront mode it starts
152
+ * at `'pending'` on draft create, flips to `'paid'` after Razorpay
153
+ * verify, and stays `'paid'` for the campaign lifetime.
154
+ *
155
+ * `'failed'` is reserved for the rare case where activation crosses
156
+ * with a Razorpay refund — surfaced so the My Campaigns surface can
157
+ * prompt the creator to retry payment without breaking the draft.
158
+ */
159
+ export const CROWDFUNDING_FEE_PAYMENT_STATUS_VALUES = [
160
+ 'pending',
161
+ 'paid',
162
+ 'deferred',
163
+ 'failed',
164
+ ];
165
+ export const crowdfundingFeePaymentStatusSchema = z.enum(CROWDFUNDING_FEE_PAYMENT_STATUS_VALUES);
133
166
  // ─── Sub-shapes ────────────────────────────────────────────────────────────
134
167
  /**
135
168
  * Per-campaign verification block. `approved` is the only state that
@@ -243,6 +276,35 @@ export const crowdfundingFeedItemSchema = z.object({
243
276
  // ─── Lifecycle ───────────────────────────────────────────────────
244
277
  status: crowdfundingStatusSchema,
245
278
  closedAt: z.string().datetime().nullable().optional(),
279
+ // ─── Platform fee — set on the composer's Pricing step ───────────
280
+ /**
281
+ * Creator's choice for how the platform fee is settled. Optional
282
+ * on the wire so legacy campaigns created before this field landed
283
+ * still validate; the My Campaigns surface falls back to "deferred
284
+ * (legacy)" copy when missing.
285
+ */
286
+ feeBillingMode: crowdfundingFeeBillingModeSchema.optional(),
287
+ /**
288
+ * Server-tracked state of the upfront-billing payment. Always
289
+ * `'deferred'` when `feeBillingMode === 'deferred'`. For upfront
290
+ * campaigns: `'pending'` while the Razorpay flow is open, `'paid'`
291
+ * after verify, `'failed'` if activation fails after capture.
292
+ */
293
+ feePaymentStatus: crowdfundingFeePaymentStatusSchema.optional(),
294
+ /**
295
+ * The platform fee in rupees the creator was (or will be) charged
296
+ * — derived server-side from `goalAmountInr × CROWDFUNDING_
297
+ * PLATFORM_FEE_RATE`. Surfaced so the My Campaigns surface can
298
+ * show the exact rupee figure without recomputing client-side
299
+ * (and so a future rate change doesn't retroactively rewrite
300
+ * historic numbers).
301
+ */
302
+ platformFeeAmountInr: z.number().int().nonnegative().optional(),
303
+ /**
304
+ * GST on the platform fee in rupees — derived server-side from
305
+ * `platformFeeAmountInr × CROWDFUNDING_FEE_GST_RATE`.
306
+ */
307
+ feeGstAmountInr: z.number().int().nonnegative().optional(),
246
308
  // ─── Standard engagement (same axis as other kinds) ──────────────
247
309
  score: z.number().int(),
248
310
  commentCount: z.number().int().nonnegative(),
@@ -406,6 +468,17 @@ export const createCrowdfundingBodySchema = z.object({
406
468
  /** Optional community scoping. If set the creator must be an active
407
469
  * member; non-members get a 403 server-side. */
408
470
  communityId: z.string().optional(),
471
+ /**
472
+ * How the platform fee is settled — set on the composer's Pricing
473
+ * step. Optional on the wire so legacy clients (and older drafts
474
+ * being resumed) still validate; the backend defaults a missing
475
+ * value to `'deferred'` (the no-money-now path) since that's the
476
+ * non-destructive default — if the creator never explicitly picks
477
+ * upfront the platform won't surprise-charge them. The submit-for-
478
+ * review handler enforces that an `'upfront'` choice has actually
479
+ * been paid before the campaign enters the verifier queue.
480
+ */
481
+ feeBillingMode: crowdfundingFeeBillingModeSchema.optional(),
409
482
  });
410
483
  /**
411
484
  * Update body — only fields that are safe to change on a `draft` or
@@ -1 +1 @@
1
- {"version":3,"file":"crowdfunding.js","sourceRoot":"","sources":["../src/crowdfunding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EACL,uCAAuC,EACvC,2CAA2C,EAC3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,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IACtD,KAAK,EAAE,+BAA+B,CAAC,QAAQ,EAAE;CAClD,CAAC,CAAC;AAGH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7D,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC5C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IACtD,KAAK,EAAE,+BAA+B,CAAC,QAAQ,EAAE;CAClD,CAAC,CAAC","sourcesContent":["/**\n * Community crowdfunding wire shapes.\n *\n * A crowdfunding campaign is a verified civic fundraiser surfaced in\n * the feed alongside posts / polls / lost-found / voice-box / donate-\n * item. The model is:\n *\n * 1. Creator drafts a campaign, fills bank + UPI QR + identity tier\n * based on the goal amount, picks an area scope.\n * 2. A leader at the matching scope (or any leader higher up the\n * hierarchy) reviews and approves OR rejects with reason.\n * Approved campaigns transition to ACTIVE and appear in the feed.\n * 3. Donors view the card, tap \"Donate\", pay externally via UPI\n * directly to the creator's bank — the platform never sees the\n * money. After paying, the donor self-attests amount + uploads a\n * receipt screenshot (optional). Without a screenshot the\n * donation enters PENDING state — the donor can upload the\n * receipt later (anytime, from settings → My Donations).\n * 4. The live progress bar shows ONLY verified amount (receipt\n * uploaded). Pending donations are counted separately and\n * surfaced as a secondary \"₹X pending receipt\" note. This is the\n * product decision: the visible progress reflects trust-grounded\n * money, not claims.\n *\n * Privacy: bank account number, IFSC, PAN, Aadhaar last-4, and\n * supporting documents are NEVER on the wire. Only `bankAccountLast4`,\n * `bankAccountHolderName`, and a UPI QR URL surface to donors.\n *\n * @module community-schema/crowdfunding\n */\n\nimport { z } from 'zod';\nimport { areaLineageSnapshotSchema } from './area.js';\nimport {\n CROWDFUNDING_BENEFICIARY_NAME_MAX_CHARS,\n CROWDFUNDING_BENEFICIARY_RELATION_MAX_CHARS,\n CROWDFUNDING_DESCRIPTION_MAX_CHARS,\n CROWDFUNDING_DESCRIPTION_MIN_CHARS,\n CROWDFUNDING_MAX_DONATION_INR,\n CROWDFUNDING_MAX_DURATION_DAYS,\n CROWDFUNDING_MAX_GOAL_INR,\n CROWDFUNDING_MAX_IMAGES,\n CROWDFUNDING_MAX_SUPPORTING_DOCS,\n CROWDFUNDING_MIN_DURATION_DAYS,\n CROWDFUNDING_MIN_GOAL_INR,\n CROWDFUNDING_REJECTION_REASON_MAX_CHARS,\n CROWDFUNDING_REJECTION_REASON_MIN_CHARS,\n CROWDFUNDING_TITLE_MAX_CHARS,\n CROWDFUNDING_TITLE_MIN_CHARS,\n} from './constants.js';\nimport { voteValueSchema } from './engagement.js';\nimport { postAuthorSnapshotSchema } from './post.js';\n\n// ─── Enums ─────────────────────────────────────────────────────────────────\n\n/**\n * Top-level categories — drives the chip + icon on the card and the\n * verifier's per-category supporting-doc requirements (medical needs\n * hospital invoice; education needs admission letter; etc.).\n */\nexport const CROWDFUNDING_CATEGORY_VALUES = [\n 'medical',\n 'maternity',\n 'senior_care',\n 'special_needs',\n 'education',\n 'memorial',\n 'disaster',\n 'civic',\n 'faith',\n 'sports_talent',\n 'animal_welfare',\n 'environment',\n 'legal_aid',\n 'arts_culture',\n 'self_improvement',\n /**\n * Startup / prototype building — distinct from `self_improvement`\n * (which is now strictly skill / coursework). Covers MVP builds,\n * tooling, initial inventory, working capital, registration fees,\n * marketing for genuine first-stage entrepreneurs.\n */\n 'startup_prototype',\n 'other',\n] as const;\n\n/**\n * Who the campaign is for — drives the relation chip set and the\n * organization-specific identity asks on the composer. Captured so the\n * verifier can match the campaign narrative to the supporting docs\n * (e.g. an `organization` audience should produce 12A / 80G papers,\n * not a personal hospital bill).\n */\nexport const CROWDFUNDING_AUDIENCE_VALUES = [\n 'self',\n 'family',\n 'friend',\n 'community',\n 'organization',\n] as const;\nexport const crowdfundingAudienceSchema = z.enum(CROWDFUNDING_AUDIENCE_VALUES);\nexport type CrowdfundingAudience = z.infer<typeof crowdfundingAudienceSchema>;\n\n/**\n * Org-registration class — only meaningful when `audience ===\n * 'organization'`. Drives the verifier's expected document set\n * (12A/80G for trust, FCRA-style papers for NGO, etc.).\n */\nexport const CROWDFUNDING_ORG_KIND_VALUES = [\n 'ngo',\n 'trust',\n 'society',\n 'section_8',\n 'other',\n] as const;\nexport const crowdfundingOrgKindSchema = z.enum(CROWDFUNDING_ORG_KIND_VALUES);\nexport type CrowdfundingOrgKind = z.infer<typeof crowdfundingOrgKindSchema>;\nexport const crowdfundingCategorySchema = z.enum(CROWDFUNDING_CATEGORY_VALUES);\nexport type CrowdfundingCategory = z.infer<typeof crowdfundingCategorySchema>;\n\n/**\n * Area scope — drives the required verifier role. A higher-tier\n * leader can always verify a lower-tier campaign (escalation path);\n * the reverse is rejected.\n */\nexport const CROWDFUNDING_SCOPE_VALUES = [\n 'local',\n 'district',\n 'state',\n 'national',\n 'global',\n] as const;\nexport const crowdfundingScopeSchema = z.enum(CROWDFUNDING_SCOPE_VALUES);\nexport type CrowdfundingScope = z.infer<typeof crowdfundingScopeSchema>;\n\n/**\n * Lifecycle state. `submitted` is the verifier's queue; `active` is\n * publishable in the feed; the three `closed_*` are terminal end-states\n * with different reasons.\n */\nexport const CROWDFUNDING_STATUS_VALUES = [\n 'draft',\n 'submitted',\n 'rejected',\n 'active',\n 'closed_success',\n 'closed_timeout',\n 'closed_by_creator',\n] as const;\nexport const crowdfundingStatusSchema = z.enum(CROWDFUNDING_STATUS_VALUES);\nexport type CrowdfundingStatus = z.infer<typeof crowdfundingStatusSchema>;\n\n/**\n * Per-donation verification state. `pending` = attested but no\n * receipt. `verified` = receipt uploaded (creator confirmation\n * optional). `disputed` = creator marked \"I didn't receive this\".\n * Only `verified` rolls into the campaign's `verifiedAmountInr`\n * which drives the visible progress bar.\n */\nexport const CROWDFUNDING_DONATION_STATE_VALUES = ['pending', 'verified', 'disputed'] as const;\nexport const crowdfundingDonationStateSchema = z.enum(CROWDFUNDING_DONATION_STATE_VALUES);\nexport type CrowdfundingDonationState = z.infer<typeof crowdfundingDonationStateSchema>;\n\n// ─── Sub-shapes ────────────────────────────────────────────────────────────\n\n/**\n * Per-campaign verification block. `approved` is the only state that\n * lets the campaign go ACTIVE; `pending` keeps it queued; `rejected`\n * is terminal-with-resubmit-allowed.\n */\nexport const crowdfundingVerificationSchema = z.object({\n status: z.enum(['pending', 'approved', 'rejected']),\n /** The leader who acted on this submission (display name —\n * live-joined from User at projection time). */\n verifiedByDisplayName: z.string().optional(),\n verifiedByUserId: z.string().optional(),\n /** When the leader acted. Approved + rejected both stamp this. */\n verifiedAt: z.string().datetime().optional(),\n /** The scope the verifier claimed when acting. A district leader\n * acting on a local campaign records `district` here so the\n * audit log shows the escalation path. */\n verifierScope: crowdfundingScopeSchema.optional(),\n /** Required when `status === 'rejected'`. Why the leader said no. */\n rejectionReason: z.string().optional(),\n});\nexport type CrowdfundingVerification = z.infer<typeof crowdfundingVerificationSchema>;\n\n/**\n * Public-facing payment surface — what the donor sees in the Donate\n * dialog. The full account number, IFSC, PAN, Aadhaar, supporting\n * docs etc. are kept server-side; only what's needed for the donor\n * to send money + recognise the recipient is exposed.\n */\nexport const crowdfundingPaymentSchema = z.object({\n /** GCS URL of the UPI QR code image uploaded by the creator. The\n * Donate dialog renders this for the donor to scan. */\n upiQrUrl: z.string().url(),\n /** Optional VPA — lets the donor tap a one-tap UPI deep link\n * instead of scanning the QR. e.g. \"ravi@okhdfcbank\". */\n upiId: z.string().optional(),\n /** Last 4 digits of the bank account — shown to the donor as\n * reassurance (\"ending in ••1234\"). Full number never surfaces. */\n bankAccountLast4: z.string().length(4),\n /** Account holder's name — must match the verified author display\n * name (penny-drop + UDP cross-check at submission time). */\n bankAccountHolderName: z.string(),\n /** Optional bank short name surfaced on the dialog. */\n bankName: z.string().optional(),\n});\nexport type CrowdfundingPayment = z.infer<typeof crowdfundingPaymentSchema>;\n\n// ─── Wire shape — feed item ────────────────────────────────────────────────\n\n/**\n * The card-renderable wire shape. Mirrors the engagement + author +\n * area-lineage shape of other feed kinds so the existing\n * EngagementBar, AuthorByline, and feed-projection helpers slot in\n * 1:1 without per-kind branches.\n */\nexport const crowdfundingFeedItemSchema = z.object({\n _id: z.string(),\n contentKind: z.literal('crowdfunding'),\n author: postAuthorSnapshotSchema,\n\n // ─── Campaign content ────────────────────────────────────────────\n title: z.string(),\n description: z.string(),\n category: crowdfundingCategorySchema,\n beneficiaryName: z.string(),\n beneficiaryRelation: z.string().optional(),\n /** Who the campaign is for. Optional on the wire so historic\n * campaigns created before this field landed still validate. */\n audience: crowdfundingAudienceSchema.optional(),\n /** Optional explainer when `category === 'other'` — the writer's\n * short label for the custom cause (e.g. \"Wedding emergency\"). */\n categoryOther: z.string().optional(),\n /** Up to 3 sub-causes within the chosen category, e.g.\n * [\"Cancer treatment\", \"ICU / critical care\"] for `medical`. */\n subCauses: z.array(z.string()).max(3).optional(),\n /** When one of the picked sub-causes is \"Other\", this carries the\n * writer's clarification (e.g. \"Reconstructive surgery\"). */\n subCauseOther: z.string().optional(),\n /** Org-registration class. Only meaningful when\n * `audience === 'organization'`. */\n organizationKind: crowdfundingOrgKindSchema.optional(),\n /** When `organizationKind === 'other'`, the writer's clarification\n * (e.g. \"Religious body\", \"Cooperative\"). */\n organizationKindOther: z.string().optional(),\n /** Story images (separate from supporting documents, which are\n * verifier-only). Up to `CROWDFUNDING_MAX_IMAGES`. */\n images: z.array(z.string().url()).max(CROWDFUNDING_MAX_IMAGES).optional(),\n /** Optional YouTube URL surfaced as a preview/playback embed\n * alongside the story photos. Accepted forms: youtube.com/watch?v=,\n * youtu.be/, youtube.com/shorts/, youtube.com/embed/,\n * m.youtube.com/watch?v=. The wire stores whatever the creator\n * pasted; clients extract the video id themselves at render time. */\n youtubeUrl: z.string().url().optional(),\n\n // ─── Goal + progress ─────────────────────────────────────────────\n goalAmountInr: z.number().int().positive(),\n /** Sum of donations whose `verificationState === 'verified'`\n * (receipt uploaded or creator confirmed). THIS drives the visible\n * progress bar — the product decision is that only trust-grounded\n * money counts visually. */\n verifiedAmountInr: z.number().int().nonnegative(),\n /** Total attested amount — verified + pending + disputed\n * combined. Surfaced as secondary text (\"₹X pending receipt\")\n * so creator + donors can see the full attested pipeline without\n * it inflating the headline progress. */\n attestedAmountInr: z.number().int().nonnegative(),\n /** Distinct donors who attested any state. */\n donorCount: z.number().int().nonnegative(),\n /** Distinct donors whose latest donation is `verified`. The card\n * uses this for \"47 verified supporters\" copy. */\n verifiedDonorCount: z.number().int().nonnegative(),\n\n closesAt: z.string().datetime(),\n\n // ─── Verification surface ────────────────────────────────────────\n scope: crowdfundingScopeSchema,\n verification: crowdfundingVerificationSchema,\n\n // ─── Payment surface (donor-facing) ──────────────────────────────\n payment: crowdfundingPaymentSchema,\n\n // ─── Lifecycle ───────────────────────────────────────────────────\n status: crowdfundingStatusSchema,\n closedAt: z.string().datetime().nullable().optional(),\n\n // ─── Standard engagement (same axis as other kinds) ──────────────\n score: z.number().int(),\n commentCount: z.number().int().nonnegative(),\n repostCount: z.number().int().nonnegative(),\n reactionCounts: z.record(z.string(), z.number().int().nonnegative()),\n\n areaLineage: areaLineageSnapshotSchema,\n /** When set, the campaign is scoped to a topical community and the\n * geo-cascade feed query skips it (mirrors the post + poll\n * community-scoping rule). */\n communityId: z.string().optional(),\n\n createdAt: z.string().datetime(),\n\n viewer: z\n .object({\n vote: voteValueSchema.nullable(),\n reaction: z.string().nullable(),\n bookmarked: z.boolean(),\n isAuthor: z.boolean(),\n reposted: z.boolean(),\n /** The viewer's own donation state on THIS campaign. `null`\n * means they haven't attested anything yet. Populated from\n * the latest CrowdfundingDonation row keyed by\n * (campaignId, viewerUserId). */\n donationState: crowdfundingDonationStateSchema.nullable(),\n /** Amount the viewer last attested, in ₹. Null when no\n * attestation. The card uses this to render the \"You gave\n * ₹500 — upload receipt\" prompt. */\n donationAmountInr: z.number().int().positive().nullable(),\n /** True when the viewer is eligible to verify this campaign\n * (matching-or-higher leader at the campaign's scope, viewing\n * a `submitted` campaign). Renders the in-card Verify CTA. */\n canVerify: z.boolean(),\n })\n .optional(),\n});\nexport type CrowdfundingFeedItem = z.infer<typeof crowdfundingFeedItemSchema>;\n\n// Same shape mirrored as the public \"wire\" alias for parity with the\n// other kinds whose feed envelope === detail envelope.\nexport const communityCrowdfundingWireSchema = crowdfundingFeedItemSchema;\nexport type CommunityCrowdfundingWire = z.infer<typeof communityCrowdfundingWireSchema>;\n\n// ─── Donation wire ─────────────────────────────────────────────────────────\n\n/**\n * Single donation row — surfaced on the campaign's public donor list\n * and on the donor's own \"My Donations\" surface. The full bank /\n * receipt URL stays server-side; the wire carries display info plus\n * the verification state.\n */\nexport const crowdfundingDonationWireSchema = z.object({\n _id: z.string(),\n campaignId: z.string(),\n /** Donor's userId — omitted when `isAnonymous`, so the wire is the\n * privacy boundary not the card. */\n donorUserId: z.string().optional(),\n donorDisplayName: z.string(),\n amountInr: z.number().int().positive(),\n isAnonymous: z.boolean(),\n attestedAt: z.string().datetime(),\n /** When the receipt was uploaded. Absent on pending donations. */\n receiptUploadedAt: z.string().datetime().nullable().optional(),\n /** Signed URL for the receipt screenshot. Visible only to:\n * - the donor (their own row)\n * - the campaign creator\n * - the verifier on review\n * - admin / moderators\n * The list endpoint scrubs this for all other viewers. */\n receiptUrl: z.string().url().nullable().optional(),\n verificationState: crowdfundingDonationStateSchema,\n /** Set when the creator confirmed receipt independently of a\n * receipt upload. e.g. \"I see ₹500 from Ravi in my account\". */\n creatorConfirmed: z.boolean().optional(),\n /** Set when the creator marked \"I didn't receive this\". Donor is\n * notified to upload the receipt; auto-reverts after 7 days. */\n disputeReason: z.string().optional(),\n});\nexport type CrowdfundingDonationWire = z.infer<typeof crowdfundingDonationWireSchema>;\n\n// ─── Create / update / lifecycle bodies ────────────────────────────────────\n\n/**\n * Composer payload. Identity + bank fields are tier-conditional —\n * the server cross-checks the chosen `goalAmountInr` against the\n * provided fields per the tier matrix in constants.ts.\n */\nexport const createCrowdfundingBodySchema = z.object({\n title: z.string().trim().min(CROWDFUNDING_TITLE_MIN_CHARS).max(CROWDFUNDING_TITLE_MAX_CHARS),\n description: z\n .string()\n .trim()\n .min(CROWDFUNDING_DESCRIPTION_MIN_CHARS)\n .max(CROWDFUNDING_DESCRIPTION_MAX_CHARS),\n category: crowdfundingCategorySchema,\n beneficiaryName: z.string().trim().min(2).max(CROWDFUNDING_BENEFICIARY_NAME_MAX_CHARS),\n beneficiaryRelation: z\n .string()\n .trim()\n .max(CROWDFUNDING_BENEFICIARY_RELATION_MAX_CHARS)\n .optional(),\n /** Audience picker — drives the relation chip set + the\n * organization-specific identity sub-steps on the composer. */\n audience: crowdfundingAudienceSchema.optional(),\n /** When `category === 'other'`, the writer's short label for the\n * custom cause. Bounded to keep the database column sane. */\n categoryOther: z.string().trim().max(80).optional(),\n /** Up to 3 sub-causes within the chosen category. */\n subCauses: z.array(z.string().trim().max(60)).max(3).optional(),\n /** Writer's clarification when one of the picked sub-causes is\n * \"Other\". */\n subCauseOther: z.string().trim().max(80).optional(),\n /** Org-registration class. Only set when `audience === 'organization'`. */\n organizationKind: crowdfundingOrgKindSchema.optional(),\n /** Writer's clarification when `organizationKind === 'other'`. */\n organizationKindOther: z.string().trim().max(80).optional(),\n images: z.array(z.string().url()).max(CROWDFUNDING_MAX_IMAGES).optional(),\n /** Optional YouTube video URL. Validated as a URL here; the\n * client-side validator additionally checks the host/path matches\n * a recognised YouTube shape and extracts the video id for the\n * preview component. */\n youtubeUrl: z.string().url().optional(),\n\n goalAmountInr: z.number().int().min(CROWDFUNDING_MIN_GOAL_INR).max(CROWDFUNDING_MAX_GOAL_INR),\n /** Duration in days. The server resolves `closesAt = now +\n * durationDays * 86400 * 1000` so client clock skew can't push\n * the close-time into the past. */\n durationDays: z\n .number()\n .int()\n .min(CROWDFUNDING_MIN_DURATION_DAYS)\n .max(CROWDFUNDING_MAX_DURATION_DAYS),\n\n scope: crowdfundingScopeSchema,\n\n // ─── Payment fields (server keeps full account + IFSC encrypted;\n // wire only carries last-4 + holder name + optional UPI ID) ──\n upiQrUrl: z.string().url(),\n upiId: z.string().trim().max(50).optional(),\n /** Full bank account number — 9-18 digits per RBI's range. Stored\n * encrypted server-side; never on the public wire. */\n bankAccountNumber: z\n .string()\n .trim()\n .regex(/^[0-9]{9,18}$/),\n bankAccountHolderName: z.string().trim().min(2).max(100),\n /** Indian IFSC code — 4 letters + 0 + 6 alphanumerics. Stored\n * encrypted; truncated on the wire. */\n ifsc: z\n .string()\n .trim()\n .regex(/^[A-Z]{4}0[A-Z0-9]{6}$/),\n bankName: z.string().trim().max(100).optional(),\n\n // ─── Identity (tier-conditional, validated server-side) ──────────\n /** PAN — 5 letters + 4 digits + 1 letter. Required for goal ≥\n * ₹25k (Standard tier). Stored encrypted; never on the wire (the\n * audit log surfaces a masked \"ABCDE****F\" form to verifiers). */\n pan: z\n .string()\n .trim()\n .regex(/^[A-Z]{5}[0-9]{4}[A-Z]$/)\n .optional(),\n /** Aadhaar last-4 only (never the full number — Aadhaar Act\n * restricts storage). Required for goal ≥ ₹2L (Enhanced tier). */\n aadhaarLast4: z\n .string()\n .trim()\n .regex(/^[0-9]{4}$/)\n .optional(),\n /** GCS URLs of supporting documents (hospital invoice / school\n * admission letter / FIR / etc.). Required for goal ≥ ₹2L.\n * Verifier sees these on the review queue; donors do not. */\n supportingDocs: z.array(z.string().url()).max(CROWDFUNDING_MAX_SUPPORTING_DOCS).optional(),\n\n /** Optional community scoping. If set the creator must be an active\n * member; non-members get a 403 server-side. */\n communityId: z.string().optional(),\n});\nexport type CreateCrowdfundingBody = z.infer<typeof createCrowdfundingBodySchema>;\n\n/**\n * Update body — only fields that are safe to change on a `draft` or\n * `rejected` campaign before resubmission. Verification + lifecycle\n * fields cannot be updated through this endpoint. Tier + identity\n * fields stay editable so a rejected campaign can fix what the\n * verifier flagged.\n */\nexport const updateCrowdfundingBodySchema = createCrowdfundingBodySchema.partial();\nexport type UpdateCrowdfundingBody = z.infer<typeof updateCrowdfundingBodySchema>;\n\n/**\n * What the verifier sends when approving. The `verifierScope`\n * lets a higher-tier leader claim their tier at action time (a\n * district leader approving a local campaign records `district`).\n */\nexport const approveCrowdfundingBodySchema = z.object({\n verifierScope: crowdfundingScopeSchema,\n});\nexport type ApproveCrowdfundingBody = z.infer<typeof approveCrowdfundingBodySchema>;\n\n/**\n * Rejection body. Reason is required and surfaces back to the creator\n * so they can fix the gap and resubmit.\n */\nexport const rejectCrowdfundingBodySchema = z.object({\n reason: z\n .string()\n .trim()\n .min(CROWDFUNDING_REJECTION_REASON_MIN_CHARS)\n .max(CROWDFUNDING_REJECTION_REASON_MAX_CHARS),\n});\nexport type RejectCrowdfundingBody = z.infer<typeof rejectCrowdfundingBodySchema>;\n\n// ─── Donation bodies ───────────────────────────────────────────────────────\n\n/**\n * Donor self-attests a donation. Receipt is OPTIONAL — the\n * attestation creates a `pending` row that the donor can attach a\n * receipt to later (anytime, from settings → My Donations) which\n * promotes it to `verified` and counts toward the progress bar.\n */\nexport const attestCrowdfundingDonationBodySchema = z.object({\n amountInr: z.number().int().min(1).max(CROWDFUNDING_MAX_DONATION_INR),\n isAnonymous: z.boolean().default(false),\n /** GCS URL of the receipt screenshot. When omitted the donation\n * enters `pending` state. */\n receiptUrl: z.string().url().optional(),\n});\nexport type AttestCrowdfundingDonationBody = z.infer<typeof attestCrowdfundingDonationBodySchema>;\n\n/**\n * Upload (or re-upload) a receipt for a previously-attested donation.\n * Promotes a `pending` row to `verified`; for an already-`verified`\n * row it replaces the receipt.\n */\nexport const uploadCrowdfundingReceiptBodySchema = z.object({\n receiptUrl: z.string().url(),\n});\nexport type UploadCrowdfundingReceiptBody = z.infer<typeof uploadCrowdfundingReceiptBodySchema>;\n\n// ─── Listing query ─────────────────────────────────────────────────────────\n\nexport const listCrowdfundingDonationsQuerySchema = z.object({\n page: z.number().int().positive().optional(),\n limit: z.number().int().positive().max(100).optional(),\n state: crowdfundingDonationStateSchema.optional(),\n});\nexport type ListCrowdfundingDonationsQuery = z.infer<typeof listCrowdfundingDonationsQuerySchema>;\n\n/**\n * Per-donor \"My Donations\" surface — different from the per-campaign\n * donor list. Returns every donation the viewer has attested, across\n * all campaigns, so the donor can spot any row that's still\n * `pending` and upload a receipt.\n */\nexport const listMyCrowdfundingDonationsQuerySchema = z.object({\n page: z.number().int().positive().optional(),\n limit: z.number().int().positive().max(100).optional(),\n state: crowdfundingDonationStateSchema.optional(),\n});\nexport type ListMyCrowdfundingDonationsQuery = z.infer<\n typeof listMyCrowdfundingDonationsQuerySchema\n>;\n"]}
1
+ {"version":3,"file":"crowdfunding.js","sourceRoot":"","sources":["../src/crowdfunding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EACL,uCAAuC,EACvC,2CAA2C,EAC3C,kCAAkC,EAClC,kCAAkC,EAClC,6BAA6B,EAC7B,8BAA8B,EAC9B,yBAAyB,EACzB,uBAAuB,EACvB,gCAAgC,EAChC,8BAA8B,EAC9B,yBAAyB,EACzB,uCAAuC,EACvC,uCAAuC,EACvC,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAErD,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,SAAS;IACT,WAAW;IACX,aAAa;IACb,eAAe;IACf,WAAW;IACX,UAAU;IACV,UAAU;IACV,OAAO;IACP,OAAO;IACP,eAAe;IACf,gBAAgB;IAChB,aAAa;IACb,WA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E,CAAC,GAAG,EAAE;CAC7B,CAAC,CAAC;AAGH,8EAA8E;AAE9E,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3D,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC5C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IACtD,KAAK,EAAE,+BAA+B,CAAC,QAAQ,EAAE;CAClD,CAAC,CAAC;AAGH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7D,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC5C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IACtD,KAAK,EAAE,+BAA+B,CAAC,QAAQ,EAAE;CAClD,CAAC,CAAC","sourcesContent":["/**\n * Community crowdfunding wire shapes.\n *\n * A crowdfunding campaign is a verified civic fundraiser surfaced in\n * the feed alongside posts / polls / lost-found / voice-box / donate-\n * item. The model is:\n *\n * 1. Creator drafts a campaign, fills bank + UPI QR + identity tier\n * based on the goal amount, picks an area scope.\n * 2. A leader at the matching scope (or any leader higher up the\n * hierarchy) reviews and approves OR rejects with reason.\n * Approved campaigns transition to ACTIVE and appear in the feed.\n * 3. Donors view the card, tap \"Donate\", pay externally via UPI\n * directly to the creator's bank — the platform never sees the\n * money. After paying, the donor self-attests amount + uploads a\n * receipt screenshot (optional). Without a screenshot the\n * donation enters PENDING state — the donor can upload the\n * receipt later (anytime, from settings → My Donations).\n * 4. The live progress bar shows ONLY verified amount (receipt\n * uploaded). Pending donations are counted separately and\n * surfaced as a secondary \"₹X pending receipt\" note. This is the\n * product decision: the visible progress reflects trust-grounded\n * money, not claims.\n *\n * Privacy: bank account number, IFSC, PAN, Aadhaar last-4, and\n * supporting documents are NEVER on the wire. Only `bankAccountLast4`,\n * `bankAccountHolderName`, and a UPI QR URL surface to donors.\n *\n * @module community-schema/crowdfunding\n */\n\nimport { z } from 'zod';\nimport { areaLineageSnapshotSchema } from './area.js';\nimport {\n CROWDFUNDING_BENEFICIARY_NAME_MAX_CHARS,\n CROWDFUNDING_BENEFICIARY_RELATION_MAX_CHARS,\n CROWDFUNDING_DESCRIPTION_MAX_CHARS,\n CROWDFUNDING_DESCRIPTION_MIN_CHARS,\n CROWDFUNDING_MAX_DONATION_INR,\n CROWDFUNDING_MAX_DURATION_DAYS,\n CROWDFUNDING_MAX_GOAL_INR,\n CROWDFUNDING_MAX_IMAGES,\n CROWDFUNDING_MAX_SUPPORTING_DOCS,\n CROWDFUNDING_MIN_DURATION_DAYS,\n CROWDFUNDING_MIN_GOAL_INR,\n CROWDFUNDING_REJECTION_REASON_MAX_CHARS,\n CROWDFUNDING_REJECTION_REASON_MIN_CHARS,\n CROWDFUNDING_TITLE_MAX_CHARS,\n CROWDFUNDING_TITLE_MIN_CHARS,\n} from './constants.js';\nimport { voteValueSchema } from './engagement.js';\nimport { postAuthorSnapshotSchema } from './post.js';\n\n// ─── Enums ─────────────────────────────────────────────────────────────────\n\n/**\n * Top-level categories — drives the chip + icon on the card and the\n * verifier's per-category supporting-doc requirements (medical needs\n * hospital invoice; education needs admission letter; etc.).\n */\nexport const CROWDFUNDING_CATEGORY_VALUES = [\n 'medical',\n 'maternity',\n 'senior_care',\n 'special_needs',\n 'education',\n 'memorial',\n 'disaster',\n 'civic',\n 'faith',\n 'sports_talent',\n 'animal_welfare',\n 'environment',\n 'legal_aid',\n 'arts_culture',\n 'self_improvement',\n /**\n * Startup / prototype building — distinct from `self_improvement`\n * (which is now strictly skill / coursework). Covers MVP builds,\n * tooling, initial inventory, working capital, registration fees,\n * marketing for genuine first-stage entrepreneurs.\n */\n 'startup_prototype',\n 'other',\n] as const;\n\n/**\n * Who the campaign is for — drives the relation chip set and the\n * organization-specific identity asks on the composer. Captured so the\n * verifier can match the campaign narrative to the supporting docs\n * (e.g. an `organization` audience should produce 12A / 80G papers,\n * not a personal hospital bill).\n */\nexport const CROWDFUNDING_AUDIENCE_VALUES = [\n 'self',\n 'family',\n 'friend',\n 'community',\n 'organization',\n] as const;\nexport const crowdfundingAudienceSchema = z.enum(CROWDFUNDING_AUDIENCE_VALUES);\nexport type CrowdfundingAudience = z.infer<typeof crowdfundingAudienceSchema>;\n\n/**\n * Org-registration class — only meaningful when `audience ===\n * 'organization'`. Drives the verifier's expected document set\n * (12A/80G for trust, FCRA-style papers for NGO, etc.).\n */\nexport const CROWDFUNDING_ORG_KIND_VALUES = [\n 'ngo',\n 'trust',\n 'society',\n 'section_8',\n 'other',\n] as const;\nexport const crowdfundingOrgKindSchema = z.enum(CROWDFUNDING_ORG_KIND_VALUES);\nexport type CrowdfundingOrgKind = z.infer<typeof crowdfundingOrgKindSchema>;\nexport const crowdfundingCategorySchema = z.enum(CROWDFUNDING_CATEGORY_VALUES);\nexport type CrowdfundingCategory = z.infer<typeof crowdfundingCategorySchema>;\n\n/**\n * Area scope — drives the required verifier role. A higher-tier\n * leader can always verify a lower-tier campaign (escalation path);\n * the reverse is rejected.\n */\nexport const CROWDFUNDING_SCOPE_VALUES = [\n 'local',\n 'district',\n 'state',\n 'national',\n 'global',\n] as const;\nexport const crowdfundingScopeSchema = z.enum(CROWDFUNDING_SCOPE_VALUES);\nexport type CrowdfundingScope = z.infer<typeof crowdfundingScopeSchema>;\n\n/**\n * Lifecycle state. `submitted` is the verifier's queue; `active` is\n * publishable in the feed; the three `closed_*` are terminal end-states\n * with different reasons.\n */\nexport const CROWDFUNDING_STATUS_VALUES = [\n 'draft',\n 'submitted',\n 'rejected',\n 'active',\n 'closed_success',\n 'closed_timeout',\n 'closed_by_creator',\n] as const;\nexport const crowdfundingStatusSchema = z.enum(CROWDFUNDING_STATUS_VALUES);\nexport type CrowdfundingStatus = z.infer<typeof crowdfundingStatusSchema>;\n\n/**\n * Per-donation verification state. `pending` = attested but no\n * receipt. `verified` = receipt uploaded (creator confirmation\n * optional). `disputed` = creator marked \"I didn't receive this\".\n * Only `verified` rolls into the campaign's `verifiedAmountInr`\n * which drives the visible progress bar.\n */\nexport const CROWDFUNDING_DONATION_STATE_VALUES = ['pending', 'verified', 'disputed'] as const;\nexport const crowdfundingDonationStateSchema = z.enum(CROWDFUNDING_DONATION_STATE_VALUES);\nexport type CrowdfundingDonationState = z.infer<typeof crowdfundingDonationStateSchema>;\n\n/**\n * When the platform fee is settled:\n * - `'upfront'` — Creator pays 5 % of TARGET + 18 % GST via\n * Razorpay BEFORE the campaign goes to leader review. Approved\n * campaigns then disburse 100 % of donations to the creator.\n * - `'deferred'` — Nothing paid upfront. At disbursement time the\n * platform deducts 5 % of COLLECTED + 18 % GST before transferring\n * the rest to the creator.\n *\n * The choice is captured at submit time on the composer's Pricing\n * step and surfaced on the wire so the My Campaigns surface can show\n * \"Fee paid\" / \"Fee deducted at payout\" badges per campaign.\n */\nexport const CROWDFUNDING_FEE_BILLING_MODE_VALUES = ['upfront', 'deferred'] as const;\nexport const crowdfundingFeeBillingModeSchema = z.enum(CROWDFUNDING_FEE_BILLING_MODE_VALUES);\nexport type CrowdfundingFeeBillingMode = z.infer<typeof crowdfundingFeeBillingModeSchema>;\n\n/**\n * Server-tracked state of the upfront-billing payment. Always\n * `'deferred'` when the creator picked the on-collection mode (there\n * is nothing to pay until disbursement). For upfront mode it starts\n * at `'pending'` on draft create, flips to `'paid'` after Razorpay\n * verify, and stays `'paid'` for the campaign lifetime.\n *\n * `'failed'` is reserved for the rare case where activation crosses\n * with a Razorpay refund — surfaced so the My Campaigns surface can\n * prompt the creator to retry payment without breaking the draft.\n */\nexport const CROWDFUNDING_FEE_PAYMENT_STATUS_VALUES = [\n 'pending',\n 'paid',\n 'deferred',\n 'failed',\n] as const;\nexport const crowdfundingFeePaymentStatusSchema = z.enum(\n CROWDFUNDING_FEE_PAYMENT_STATUS_VALUES,\n);\nexport type CrowdfundingFeePaymentStatus = z.infer<typeof crowdfundingFeePaymentStatusSchema>;\n\n// ─── Sub-shapes ────────────────────────────────────────────────────────────\n\n/**\n * Per-campaign verification block. `approved` is the only state that\n * lets the campaign go ACTIVE; `pending` keeps it queued; `rejected`\n * is terminal-with-resubmit-allowed.\n */\nexport const crowdfundingVerificationSchema = z.object({\n status: z.enum(['pending', 'approved', 'rejected']),\n /** The leader who acted on this submission (display name —\n * live-joined from User at projection time). */\n verifiedByDisplayName: z.string().optional(),\n verifiedByUserId: z.string().optional(),\n /** When the leader acted. Approved + rejected both stamp this. */\n verifiedAt: z.string().datetime().optional(),\n /** The scope the verifier claimed when acting. A district leader\n * acting on a local campaign records `district` here so the\n * audit log shows the escalation path. */\n verifierScope: crowdfundingScopeSchema.optional(),\n /** Required when `status === 'rejected'`. Why the leader said no. */\n rejectionReason: z.string().optional(),\n});\nexport type CrowdfundingVerification = z.infer<typeof crowdfundingVerificationSchema>;\n\n/**\n * Public-facing payment surface — what the donor sees in the Donate\n * dialog. The full account number, IFSC, PAN, Aadhaar, supporting\n * docs etc. are kept server-side; only what's needed for the donor\n * to send money + recognise the recipient is exposed.\n */\nexport const crowdfundingPaymentSchema = z.object({\n /** GCS URL of the UPI QR code image uploaded by the creator. The\n * Donate dialog renders this for the donor to scan. */\n upiQrUrl: z.string().url(),\n /** Optional VPA — lets the donor tap a one-tap UPI deep link\n * instead of scanning the QR. e.g. \"ravi@okhdfcbank\". */\n upiId: z.string().optional(),\n /** Last 4 digits of the bank account — shown to the donor as\n * reassurance (\"ending in ••1234\"). Full number never surfaces. */\n bankAccountLast4: z.string().length(4),\n /** Account holder's name — must match the verified author display\n * name (penny-drop + UDP cross-check at submission time). */\n bankAccountHolderName: z.string(),\n /** Optional bank short name surfaced on the dialog. */\n bankName: z.string().optional(),\n});\nexport type CrowdfundingPayment = z.infer<typeof crowdfundingPaymentSchema>;\n\n// ─── Wire shape — feed item ────────────────────────────────────────────────\n\n/**\n * The card-renderable wire shape. Mirrors the engagement + author +\n * area-lineage shape of other feed kinds so the existing\n * EngagementBar, AuthorByline, and feed-projection helpers slot in\n * 1:1 without per-kind branches.\n */\nexport const crowdfundingFeedItemSchema = z.object({\n _id: z.string(),\n contentKind: z.literal('crowdfunding'),\n author: postAuthorSnapshotSchema,\n\n // ─── Campaign content ────────────────────────────────────────────\n title: z.string(),\n description: z.string(),\n category: crowdfundingCategorySchema,\n beneficiaryName: z.string(),\n beneficiaryRelation: z.string().optional(),\n /** Who the campaign is for. Optional on the wire so historic\n * campaigns created before this field landed still validate. */\n audience: crowdfundingAudienceSchema.optional(),\n /** Optional explainer when `category === 'other'` — the writer's\n * short label for the custom cause (e.g. \"Wedding emergency\"). */\n categoryOther: z.string().optional(),\n /** Up to 3 sub-causes within the chosen category, e.g.\n * [\"Cancer treatment\", \"ICU / critical care\"] for `medical`. */\n subCauses: z.array(z.string()).max(3).optional(),\n /** When one of the picked sub-causes is \"Other\", this carries the\n * writer's clarification (e.g. \"Reconstructive surgery\"). */\n subCauseOther: z.string().optional(),\n /** Org-registration class. Only meaningful when\n * `audience === 'organization'`. */\n organizationKind: crowdfundingOrgKindSchema.optional(),\n /** When `organizationKind === 'other'`, the writer's clarification\n * (e.g. \"Religious body\", \"Cooperative\"). */\n organizationKindOther: z.string().optional(),\n /** Story images (separate from supporting documents, which are\n * verifier-only). Up to `CROWDFUNDING_MAX_IMAGES`. */\n images: z.array(z.string().url()).max(CROWDFUNDING_MAX_IMAGES).optional(),\n /** Optional YouTube URL surfaced as a preview/playback embed\n * alongside the story photos. Accepted forms: youtube.com/watch?v=,\n * youtu.be/, youtube.com/shorts/, youtube.com/embed/,\n * m.youtube.com/watch?v=. The wire stores whatever the creator\n * pasted; clients extract the video id themselves at render time. */\n youtubeUrl: z.string().url().optional(),\n\n // ─── Goal + progress ─────────────────────────────────────────────\n goalAmountInr: z.number().int().positive(),\n /** Sum of donations whose `verificationState === 'verified'`\n * (receipt uploaded or creator confirmed). THIS drives the visible\n * progress bar — the product decision is that only trust-grounded\n * money counts visually. */\n verifiedAmountInr: z.number().int().nonnegative(),\n /** Total attested amount — verified + pending + disputed\n * combined. Surfaced as secondary text (\"₹X pending receipt\")\n * so creator + donors can see the full attested pipeline without\n * it inflating the headline progress. */\n attestedAmountInr: z.number().int().nonnegative(),\n /** Distinct donors who attested any state. */\n donorCount: z.number().int().nonnegative(),\n /** Distinct donors whose latest donation is `verified`. The card\n * uses this for \"47 verified supporters\" copy. */\n verifiedDonorCount: z.number().int().nonnegative(),\n\n closesAt: z.string().datetime(),\n\n // ─── Verification surface ────────────────────────────────────────\n scope: crowdfundingScopeSchema,\n verification: crowdfundingVerificationSchema,\n\n // ─── Payment surface (donor-facing) ──────────────────────────────\n payment: crowdfundingPaymentSchema,\n\n // ─── Lifecycle ───────────────────────────────────────────────────\n status: crowdfundingStatusSchema,\n closedAt: z.string().datetime().nullable().optional(),\n\n // ─── Platform fee — set on the composer's Pricing step ───────────\n /**\n * Creator's choice for how the platform fee is settled. Optional\n * on the wire so legacy campaigns created before this field landed\n * still validate; the My Campaigns surface falls back to \"deferred\n * (legacy)\" copy when missing.\n */\n feeBillingMode: crowdfundingFeeBillingModeSchema.optional(),\n /**\n * Server-tracked state of the upfront-billing payment. Always\n * `'deferred'` when `feeBillingMode === 'deferred'`. For upfront\n * campaigns: `'pending'` while the Razorpay flow is open, `'paid'`\n * after verify, `'failed'` if activation fails after capture.\n */\n feePaymentStatus: crowdfundingFeePaymentStatusSchema.optional(),\n /**\n * The platform fee in rupees the creator was (or will be) charged\n * — derived server-side from `goalAmountInr × CROWDFUNDING_\n * PLATFORM_FEE_RATE`. Surfaced so the My Campaigns surface can\n * show the exact rupee figure without recomputing client-side\n * (and so a future rate change doesn't retroactively rewrite\n * historic numbers).\n */\n platformFeeAmountInr: z.number().int().nonnegative().optional(),\n /**\n * GST on the platform fee in rupees — derived server-side from\n * `platformFeeAmountInr × CROWDFUNDING_FEE_GST_RATE`.\n */\n feeGstAmountInr: z.number().int().nonnegative().optional(),\n\n // ─── Standard engagement (same axis as other kinds) ──────────────\n score: z.number().int(),\n commentCount: z.number().int().nonnegative(),\n repostCount: z.number().int().nonnegative(),\n reactionCounts: z.record(z.string(), z.number().int().nonnegative()),\n\n areaLineage: areaLineageSnapshotSchema,\n /** When set, the campaign is scoped to a topical community and the\n * geo-cascade feed query skips it (mirrors the post + poll\n * community-scoping rule). */\n communityId: z.string().optional(),\n\n createdAt: z.string().datetime(),\n\n viewer: z\n .object({\n vote: voteValueSchema.nullable(),\n reaction: z.string().nullable(),\n bookmarked: z.boolean(),\n isAuthor: z.boolean(),\n reposted: z.boolean(),\n /** The viewer's own donation state on THIS campaign. `null`\n * means they haven't attested anything yet. Populated from\n * the latest CrowdfundingDonation row keyed by\n * (campaignId, viewerUserId). */\n donationState: crowdfundingDonationStateSchema.nullable(),\n /** Amount the viewer last attested, in ₹. Null when no\n * attestation. The card uses this to render the \"You gave\n * ₹500 — upload receipt\" prompt. */\n donationAmountInr: z.number().int().positive().nullable(),\n /** True when the viewer is eligible to verify this campaign\n * (matching-or-higher leader at the campaign's scope, viewing\n * a `submitted` campaign). Renders the in-card Verify CTA. */\n canVerify: z.boolean(),\n })\n .optional(),\n});\nexport type CrowdfundingFeedItem = z.infer<typeof crowdfundingFeedItemSchema>;\n\n// Same shape mirrored as the public \"wire\" alias for parity with the\n// other kinds whose feed envelope === detail envelope.\nexport const communityCrowdfundingWireSchema = crowdfundingFeedItemSchema;\nexport type CommunityCrowdfundingWire = z.infer<typeof communityCrowdfundingWireSchema>;\n\n// ─── Donation wire ─────────────────────────────────────────────────────────\n\n/**\n * Single donation row — surfaced on the campaign's public donor list\n * and on the donor's own \"My Donations\" surface. The full bank /\n * receipt URL stays server-side; the wire carries display info plus\n * the verification state.\n */\nexport const crowdfundingDonationWireSchema = z.object({\n _id: z.string(),\n campaignId: z.string(),\n /** Donor's userId — omitted when `isAnonymous`, so the wire is the\n * privacy boundary not the card. */\n donorUserId: z.string().optional(),\n donorDisplayName: z.string(),\n amountInr: z.number().int().positive(),\n isAnonymous: z.boolean(),\n attestedAt: z.string().datetime(),\n /** When the receipt was uploaded. Absent on pending donations. */\n receiptUploadedAt: z.string().datetime().nullable().optional(),\n /** Signed URL for the receipt screenshot. Visible only to:\n * - the donor (their own row)\n * - the campaign creator\n * - the verifier on review\n * - admin / moderators\n * The list endpoint scrubs this for all other viewers. */\n receiptUrl: z.string().url().nullable().optional(),\n verificationState: crowdfundingDonationStateSchema,\n /** Set when the creator confirmed receipt independently of a\n * receipt upload. e.g. \"I see ₹500 from Ravi in my account\". */\n creatorConfirmed: z.boolean().optional(),\n /** Set when the creator marked \"I didn't receive this\". Donor is\n * notified to upload the receipt; auto-reverts after 7 days. */\n disputeReason: z.string().optional(),\n});\nexport type CrowdfundingDonationWire = z.infer<typeof crowdfundingDonationWireSchema>;\n\n// ─── Create / update / lifecycle bodies ────────────────────────────────────\n\n/**\n * Composer payload. Identity + bank fields are tier-conditional —\n * the server cross-checks the chosen `goalAmountInr` against the\n * provided fields per the tier matrix in constants.ts.\n */\nexport const createCrowdfundingBodySchema = z.object({\n title: z.string().trim().min(CROWDFUNDING_TITLE_MIN_CHARS).max(CROWDFUNDING_TITLE_MAX_CHARS),\n description: z\n .string()\n .trim()\n .min(CROWDFUNDING_DESCRIPTION_MIN_CHARS)\n .max(CROWDFUNDING_DESCRIPTION_MAX_CHARS),\n category: crowdfundingCategorySchema,\n beneficiaryName: z.string().trim().min(2).max(CROWDFUNDING_BENEFICIARY_NAME_MAX_CHARS),\n beneficiaryRelation: z\n .string()\n .trim()\n .max(CROWDFUNDING_BENEFICIARY_RELATION_MAX_CHARS)\n .optional(),\n /** Audience picker — drives the relation chip set + the\n * organization-specific identity sub-steps on the composer. */\n audience: crowdfundingAudienceSchema.optional(),\n /** When `category === 'other'`, the writer's short label for the\n * custom cause. Bounded to keep the database column sane. */\n categoryOther: z.string().trim().max(80).optional(),\n /** Up to 3 sub-causes within the chosen category. */\n subCauses: z.array(z.string().trim().max(60)).max(3).optional(),\n /** Writer's clarification when one of the picked sub-causes is\n * \"Other\". */\n subCauseOther: z.string().trim().max(80).optional(),\n /** Org-registration class. Only set when `audience === 'organization'`. */\n organizationKind: crowdfundingOrgKindSchema.optional(),\n /** Writer's clarification when `organizationKind === 'other'`. */\n organizationKindOther: z.string().trim().max(80).optional(),\n images: z.array(z.string().url()).max(CROWDFUNDING_MAX_IMAGES).optional(),\n /** Optional YouTube video URL. Validated as a URL here; the\n * client-side validator additionally checks the host/path matches\n * a recognised YouTube shape and extracts the video id for the\n * preview component. */\n youtubeUrl: z.string().url().optional(),\n\n goalAmountInr: z.number().int().min(CROWDFUNDING_MIN_GOAL_INR).max(CROWDFUNDING_MAX_GOAL_INR),\n /** Duration in days. The server resolves `closesAt = now +\n * durationDays * 86400 * 1000` so client clock skew can't push\n * the close-time into the past. */\n durationDays: z\n .number()\n .int()\n .min(CROWDFUNDING_MIN_DURATION_DAYS)\n .max(CROWDFUNDING_MAX_DURATION_DAYS),\n\n scope: crowdfundingScopeSchema,\n\n // ─── Payment fields (server keeps full account + IFSC encrypted;\n // wire only carries last-4 + holder name + optional UPI ID) ──\n upiQrUrl: z.string().url(),\n upiId: z.string().trim().max(50).optional(),\n /** Full bank account number — 9-18 digits per RBI's range. Stored\n * encrypted server-side; never on the public wire. */\n bankAccountNumber: z\n .string()\n .trim()\n .regex(/^[0-9]{9,18}$/),\n bankAccountHolderName: z.string().trim().min(2).max(100),\n /** Indian IFSC code — 4 letters + 0 + 6 alphanumerics. Stored\n * encrypted; truncated on the wire. */\n ifsc: z\n .string()\n .trim()\n .regex(/^[A-Z]{4}0[A-Z0-9]{6}$/),\n bankName: z.string().trim().max(100).optional(),\n\n // ─── Identity (tier-conditional, validated server-side) ──────────\n /** PAN — 5 letters + 4 digits + 1 letter. Required for goal ≥\n * ₹25k (Standard tier). Stored encrypted; never on the wire (the\n * audit log surfaces a masked \"ABCDE****F\" form to verifiers). */\n pan: z\n .string()\n .trim()\n .regex(/^[A-Z]{5}[0-9]{4}[A-Z]$/)\n .optional(),\n /** Aadhaar last-4 only (never the full number — Aadhaar Act\n * restricts storage). Required for goal ≥ ₹2L (Enhanced tier). */\n aadhaarLast4: z\n .string()\n .trim()\n .regex(/^[0-9]{4}$/)\n .optional(),\n /** GCS URLs of supporting documents (hospital invoice / school\n * admission letter / FIR / etc.). Required for goal ≥ ₹2L.\n * Verifier sees these on the review queue; donors do not. */\n supportingDocs: z.array(z.string().url()).max(CROWDFUNDING_MAX_SUPPORTING_DOCS).optional(),\n\n /** Optional community scoping. If set the creator must be an active\n * member; non-members get a 403 server-side. */\n communityId: z.string().optional(),\n\n /**\n * How the platform fee is settled — set on the composer's Pricing\n * step. Optional on the wire so legacy clients (and older drafts\n * being resumed) still validate; the backend defaults a missing\n * value to `'deferred'` (the no-money-now path) since that's the\n * non-destructive default — if the creator never explicitly picks\n * upfront the platform won't surprise-charge them. The submit-for-\n * review handler enforces that an `'upfront'` choice has actually\n * been paid before the campaign enters the verifier queue.\n */\n feeBillingMode: crowdfundingFeeBillingModeSchema.optional(),\n});\nexport type CreateCrowdfundingBody = z.infer<typeof createCrowdfundingBodySchema>;\n\n/**\n * Update body — only fields that are safe to change on a `draft` or\n * `rejected` campaign before resubmission. Verification + lifecycle\n * fields cannot be updated through this endpoint. Tier + identity\n * fields stay editable so a rejected campaign can fix what the\n * verifier flagged.\n */\nexport const updateCrowdfundingBodySchema = createCrowdfundingBodySchema.partial();\nexport type UpdateCrowdfundingBody = z.infer<typeof updateCrowdfundingBodySchema>;\n\n/**\n * What the verifier sends when approving. The `verifierScope`\n * lets a higher-tier leader claim their tier at action time (a\n * district leader approving a local campaign records `district`).\n */\nexport const approveCrowdfundingBodySchema = z.object({\n verifierScope: crowdfundingScopeSchema,\n});\nexport type ApproveCrowdfundingBody = z.infer<typeof approveCrowdfundingBodySchema>;\n\n/**\n * Rejection body. Reason is required and surfaces back to the creator\n * so they can fix the gap and resubmit.\n */\nexport const rejectCrowdfundingBodySchema = z.object({\n reason: z\n .string()\n .trim()\n .min(CROWDFUNDING_REJECTION_REASON_MIN_CHARS)\n .max(CROWDFUNDING_REJECTION_REASON_MAX_CHARS),\n});\nexport type RejectCrowdfundingBody = z.infer<typeof rejectCrowdfundingBodySchema>;\n\n// ─── Donation bodies ───────────────────────────────────────────────────────\n\n/**\n * Donor self-attests a donation. Receipt is OPTIONAL — the\n * attestation creates a `pending` row that the donor can attach a\n * receipt to later (anytime, from settings → My Donations) which\n * promotes it to `verified` and counts toward the progress bar.\n */\nexport const attestCrowdfundingDonationBodySchema = z.object({\n amountInr: z.number().int().min(1).max(CROWDFUNDING_MAX_DONATION_INR),\n isAnonymous: z.boolean().default(false),\n /** GCS URL of the receipt screenshot. When omitted the donation\n * enters `pending` state. */\n receiptUrl: z.string().url().optional(),\n});\nexport type AttestCrowdfundingDonationBody = z.infer<typeof attestCrowdfundingDonationBodySchema>;\n\n/**\n * Upload (or re-upload) a receipt for a previously-attested donation.\n * Promotes a `pending` row to `verified`; for an already-`verified`\n * row it replaces the receipt.\n */\nexport const uploadCrowdfundingReceiptBodySchema = z.object({\n receiptUrl: z.string().url(),\n});\nexport type UploadCrowdfundingReceiptBody = z.infer<typeof uploadCrowdfundingReceiptBodySchema>;\n\n// ─── Listing query ─────────────────────────────────────────────────────────\n\nexport const listCrowdfundingDonationsQuerySchema = z.object({\n page: z.number().int().positive().optional(),\n limit: z.number().int().positive().max(100).optional(),\n state: crowdfundingDonationStateSchema.optional(),\n});\nexport type ListCrowdfundingDonationsQuery = z.infer<typeof listCrowdfundingDonationsQuerySchema>;\n\n/**\n * Per-donor \"My Donations\" surface — different from the per-campaign\n * donor list. Returns every donation the viewer has attested, across\n * all campaigns, so the donor can spot any row that's still\n * `pending` and upload a receipt.\n */\nexport const listMyCrowdfundingDonationsQuerySchema = z.object({\n page: z.number().int().positive().optional(),\n limit: z.number().int().positive().max(100).optional(),\n state: crowdfundingDonationStateSchema.optional(),\n});\nexport type ListMyCrowdfundingDonationsQuery = z.infer<\n typeof listMyCrowdfundingDonationsQuerySchema\n>;\n"]}
package/dist/feed.d.ts CHANGED
@@ -1059,6 +1059,18 @@ export declare const feedItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1059
1059
  closed_by_creator: "closed_by_creator";
1060
1060
  }>;
1061
1061
  closedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1062
+ feeBillingMode: z.ZodOptional<z.ZodEnum<{
1063
+ upfront: "upfront";
1064
+ deferred: "deferred";
1065
+ }>>;
1066
+ feePaymentStatus: z.ZodOptional<z.ZodEnum<{
1067
+ pending: "pending";
1068
+ deferred: "deferred";
1069
+ paid: "paid";
1070
+ failed: "failed";
1071
+ }>>;
1072
+ platformFeeAmountInr: z.ZodOptional<z.ZodNumber>;
1073
+ feeGstAmountInr: z.ZodOptional<z.ZodNumber>;
1062
1074
  score: z.ZodNumber;
1063
1075
  commentCount: z.ZodNumber;
1064
1076
  repostCount: z.ZodNumber;
@@ -1716,6 +1728,18 @@ export declare const feedResponseSchema: z.ZodObject<{
1716
1728
  closed_by_creator: "closed_by_creator";
1717
1729
  }>;
1718
1730
  closedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1731
+ feeBillingMode: z.ZodOptional<z.ZodEnum<{
1732
+ upfront: "upfront";
1733
+ deferred: "deferred";
1734
+ }>>;
1735
+ feePaymentStatus: z.ZodOptional<z.ZodEnum<{
1736
+ pending: "pending";
1737
+ deferred: "deferred";
1738
+ paid: "paid";
1739
+ failed: "failed";
1740
+ }>>;
1741
+ platformFeeAmountInr: z.ZodOptional<z.ZodNumber>;
1742
+ feeGstAmountInr: z.ZodOptional<z.ZodNumber>;
1719
1743
  score: z.ZodNumber;
1720
1744
  commentCount: z.ZodNumber;
1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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAG7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAG9D,OAAO,EAAE,cAAc,EAAE,CAAC"}
package/dist/index.d.ts CHANGED
@@ -17,9 +17,8 @@
17
17
  export { type AreaLineageSnapshot, areaLineageSnapshotSchema, } from './area.js';
18
18
  export { type CommunityCommentWire, type CreateCommentBody, communityCommentWireSchema, createCommentBodySchema, type UpdateCommentBody, updateCommentBodySchema, } from './comment.js';
19
19
  export { type AddOfficialModeratorBody, AREA_PICKER_LEVEL_VALUES, type AreaPickerItem, type AreaPickerLevel, type AreaPickerQuery, type AreaPickerResponse, addOfficialModeratorBodySchema, areaPickerItemSchema, areaPickerLevelSchema, areaPickerQuerySchema, areaPickerResponseSchema, COMMUNITY_CATEGORY_VALUES, COMMUNITY_DESIGNATION_PRESETS, COMMUNITY_DISCOVER_SORT_VALUES, COMMUNITY_KIND_VALUES, COMMUNITY_MEMBERSHIP_STATUS_VALUES, COMMUNITY_REACH_VALUES, COMMUNITY_ROLE_VALUES, COMMUNITY_TAG_VALUES, COMMUNITY_TYPE_VALUES, COMMUNITY_VERIFIED_SCOPE_VALUES, type CommunityCategory, type CommunityCenterCoords, type CommunityDesignation, type CommunityDesignationPreset, type CommunityDiscoverSort, type CommunityKind, type CommunityListQuery, type CommunityListResponse, type CommunityMembershipStatus, type CommunityMembersListResponse, type CommunityMemberWire, type CommunityReach, type CommunityRole, type CommunityTag, type CommunityType, type CommunityVerifiedScope, type CommunityWire, type CreateCommunityBody, type CreateOfficialCommunityBody, communityCategorySchema, communityCenterCoordsSchema, communityDesignationPresetSchema, communityDesignationSchema, communityDiscoverSortSchema, communityKindSchema, communityListQuerySchema, communityListResponseSchema, communityMembershipStatusSchema, communityMembersListResponseSchema, communityMemberWireSchema, communityReachSchema, communityRoleSchema, communityTagSchema, communityTypeSchema, communityVerifiedScopeSchema, communityWireSchema, createCommunityBodySchema, createOfficialCommunityBodySchema, type HidePostBody, hidePostBodySchema, type JoinCommunityResponse, joinCommunityResponseSchema, OFFICIAL_COMMUNITY_AREA_KIND_VALUES, type OfficialCommunityAreaKind, officialCommunityAreaKindSchema, type SetMemberDesignationBody, type SetOfficialRepresentativeBody, setMemberDesignationBodySchema, setOfficialRepresentativeBodySchema, type UpdateCommunityBody, type UpdateMemberRoleBody, updateCommunityBodySchema, updateMemberRoleBodySchema, type VerifyCommunityBody, verifyCommunityBodySchema, } from './community.js';
20
- export { COMMENT_MAX_BODY_CHARS, COMMENTS_PAGE_SIZE, COMMUNITIES_PAGE_SIZE, COMMUNITY_DESCRIPTION_MAX_CHARS, COMMUNITY_DESIGNATION_CUSTOM_MAX_CHARS, COMMUNITY_DESIGNATION_CUSTOM_MIN_CHARS, COMMUNITY_DESIGNATION_CUSTOM_PATTERN, COMMUNITY_HYPERLOCAL_RADIUS_KM, COMMUNITY_MAX_TAGS, COMMUNITY_MEMBERS_PAGE_SIZE, COMMUNITY_NAME_MAX_CHARS, COMMUNITY_NAME_MIN_CHARS, COMMUNITY_SLUG_MAX_CHARS, COMMUNITY_SLUG_MIN_CHARS, COMMUNITY_SLUG_PATTERN, CROWDFUNDING_BENEFICIARY_NAME_MAX_CHARS, CROWDFUNDING_BENEFICIARY_RELATION_MAX_CHARS, CROWDFUNDING_DESCRIPTION_MAX_CHARS, CROWDFUNDING_DESCRIPTION_MIN_CHARS, CROWDFUNDING_MAX_DONATION_INR, CROWDFUNDING_MAX_DURATION_DAYS, CROWDFUNDING_MAX_GOAL_INR, CROWDFUNDING_MAX_IMAGES, CROWDFUNDING_MAX_SUPPORTING_DOCS, CROWDFUNDING_MIN_DURATION_DAYS, CROWDFUNDING_MIN_GOAL_INR, CROWDFUNDING_PAGE_SIZE, CROWDFUNDING_REJECTION_REASON_MAX_CHARS, CROWDFUNDING_REJECTION_REASON_MIN_CHARS, CROWDFUNDING_TIER_ENHANCED_INR, CROWDFUNDING_TIER_MAXIMUM_INR, CROWDFUNDING_TIER_STANDARD_INR, CROWDFUNDING_TITLE_MAX_CHARS, CROWDFUNDING_TITLE_MIN_CHARS, EDIT_GRACE_WINDOW_MS, FEED_PAGE_SIZE, GROUP_MAX_MEMBERS, GROUP_NAME_MAX_CHARS, GROUP_NAME_MIN_CHARS, PEOPLE_PAGE_SIZE, POLL_DURATION_PRESETS_MS, POLL_MAX_DURATION_MS, POLL_MAX_OPTIONS, POLL_MIN_DURATION_MS, POLL_MIN_OPTIONS, POLL_OPTION_MAX_CHARS, POLL_OPTION_MIN_CHARS, POLL_QUESTION_MAX_CHARS, POLL_QUESTION_MIN_CHARS, POLLS_PAGE_SIZE, POST_MAX_BODY_CHARS, POST_MAX_IMAGE_BYTES, POST_MAX_IMAGES, POST_MAX_VIDEO_BYTES, POST_MAX_VIDEO_SECONDS, POST_MAX_VIDEOS, PROFILE_MAX_BIO_CHARS, REPLIES_PRELOAD_COUNT, } from './constants.js';
21
- export { type ApproveCrowdfundingBody, type AttestCrowdfundingDonationBody, approveCrowdfundingBodySchema, attestCrowdfundingDonationBodySchema, type CommunityCrowdfundingWire, CROWDFUNDING_AUDIENCE_VALUES, CROWDFUNDING_CATEGORY_VALUES, CROWDFUNDING_DONATION_STATE_VALUES, CROWDFUNDING_ORG_KIND_VALUES, CROWDFUNDING_SCOPE_VALUES, CROWDFUNDING_STATUS_VALUES, type CreateCrowdfundingBody, type CrowdfundingAudience, type CrowdfundingCategory, type CrowdfundingDonationState, type CrowdfundingDonationWire, type CrowdfundingFeedItem, type CrowdfundingOrgKind, type CrowdfundingPayment, type CrowdfundingScope, type CrowdfundingStatus, type CrowdfundingVerification, communityCrowdfundingWireSchema, createCrowdfundingBodySchema, crowdfundingAudienceSchema, crowdfundingCategorySchema, crowdfundingDonationStateSchema, crowdfundingDonationWireSchema, crowdfundingFeedItemSchema, crowdfundingOrgKindSchema, crowdfundingPaymentSchema, crowdfundingScopeSchema, crowdfundingStatusSchema, crowdfundingVerificationSchema, type ListCrowdfundingDonationsQuery, type ListMyCrowdfundingDonationsQuery, listCrowdfundingDonationsQuerySchema, listMyCrowdfundingDonationsQuerySchema, type RejectCrowdfundingBody, rejectCrowdfundingBodySchema, type UpdateCrowdfundingBody, type UploadCrowdfundingReceiptBody, updateCrowdfundingBodySchema, uploadCrowdfundingReceiptBodySchema, } from './crowdfunding.js';
22
- export { SOCIAL_SCORE_TIER_NAMES, SOCIAL_SCORE_TIERS, type SocialScoreTier, type SocialScoreTierName, tierFromSocialScore, } from './social-score.js';
20
+ export { COMMENT_MAX_BODY_CHARS, COMMENTS_PAGE_SIZE, COMMUNITIES_PAGE_SIZE, COMMUNITY_DESCRIPTION_MAX_CHARS, COMMUNITY_DESIGNATION_CUSTOM_MAX_CHARS, COMMUNITY_DESIGNATION_CUSTOM_MIN_CHARS, COMMUNITY_DESIGNATION_CUSTOM_PATTERN, COMMUNITY_HYPERLOCAL_RADIUS_KM, COMMUNITY_MAX_TAGS, COMMUNITY_MEMBERS_PAGE_SIZE, COMMUNITY_NAME_MAX_CHARS, COMMUNITY_NAME_MIN_CHARS, COMMUNITY_SLUG_MAX_CHARS, COMMUNITY_SLUG_MIN_CHARS, COMMUNITY_SLUG_PATTERN, computeCrowdfundingFee, CROWDFUNDING_BENEFICIARY_NAME_MAX_CHARS, CROWDFUNDING_BENEFICIARY_RELATION_MAX_CHARS, CROWDFUNDING_DESCRIPTION_MAX_CHARS, CROWDFUNDING_DESCRIPTION_MIN_CHARS, CROWDFUNDING_FEE_GST_RATE, CROWDFUNDING_MAX_DONATION_INR, CROWDFUNDING_MAX_DURATION_DAYS, CROWDFUNDING_MAX_GOAL_INR, CROWDFUNDING_MAX_IMAGES, CROWDFUNDING_MAX_SUPPORTING_DOCS, CROWDFUNDING_MIN_DURATION_DAYS, CROWDFUNDING_MIN_GOAL_INR, CROWDFUNDING_PAGE_SIZE, CROWDFUNDING_PLATFORM_FEE_RATE, CROWDFUNDING_REJECTION_REASON_MAX_CHARS, CROWDFUNDING_REJECTION_REASON_MIN_CHARS, CROWDFUNDING_TIER_ENHANCED_INR, CROWDFUNDING_TIER_MAXIMUM_INR, CROWDFUNDING_TIER_STANDARD_INR, CROWDFUNDING_TITLE_MAX_CHARS, CROWDFUNDING_TITLE_MIN_CHARS, EDIT_GRACE_WINDOW_MS, FEED_PAGE_SIZE, GROUP_MAX_MEMBERS, GROUP_NAME_MAX_CHARS, GROUP_NAME_MIN_CHARS, PEOPLE_PAGE_SIZE, POLL_DURATION_PRESETS_MS, POLL_MAX_DURATION_MS, POLL_MAX_OPTIONS, POLL_MIN_DURATION_MS, POLL_MIN_OPTIONS, POLL_OPTION_MAX_CHARS, POLL_OPTION_MIN_CHARS, POLL_QUESTION_MAX_CHARS, POLL_QUESTION_MIN_CHARS, POLLS_PAGE_SIZE, POST_MAX_BODY_CHARS, POST_MAX_IMAGE_BYTES, POST_MAX_IMAGES, POST_MAX_VIDEO_BYTES, POST_MAX_VIDEO_SECONDS, POST_MAX_VIDEOS, PROFILE_MAX_BIO_CHARS, REPLIES_PRELOAD_COUNT, } from './constants.js';
21
+ export { type ApproveCrowdfundingBody, type AttestCrowdfundingDonationBody, approveCrowdfundingBodySchema, attestCrowdfundingDonationBodySchema, type CommunityCrowdfundingWire, CROWDFUNDING_AUDIENCE_VALUES, CROWDFUNDING_CATEGORY_VALUES, CROWDFUNDING_DONATION_STATE_VALUES, CROWDFUNDING_FEE_BILLING_MODE_VALUES, CROWDFUNDING_FEE_PAYMENT_STATUS_VALUES, CROWDFUNDING_ORG_KIND_VALUES, CROWDFUNDING_SCOPE_VALUES, CROWDFUNDING_STATUS_VALUES, type CreateCrowdfundingBody, type CrowdfundingAudience, type CrowdfundingCategory, type CrowdfundingDonationState, type CrowdfundingDonationWire, type CrowdfundingFeeBillingMode, type CrowdfundingFeePaymentStatus, type CrowdfundingFeedItem, type CrowdfundingOrgKind, type CrowdfundingPayment, type CrowdfundingScope, type CrowdfundingStatus, type CrowdfundingVerification, communityCrowdfundingWireSchema, createCrowdfundingBodySchema, crowdfundingAudienceSchema, crowdfundingCategorySchema, crowdfundingDonationStateSchema, crowdfundingDonationWireSchema, crowdfundingFeeBillingModeSchema, crowdfundingFeePaymentStatusSchema, crowdfundingFeedItemSchema, crowdfundingOrgKindSchema, crowdfundingPaymentSchema, crowdfundingScopeSchema, crowdfundingStatusSchema, crowdfundingVerificationSchema, type ListCrowdfundingDonationsQuery, type ListMyCrowdfundingDonationsQuery, listCrowdfundingDonationsQuerySchema, listMyCrowdfundingDonationsQuerySchema, type RejectCrowdfundingBody, rejectCrowdfundingBodySchema, type UpdateCrowdfundingBody, type UploadCrowdfundingReceiptBody, updateCrowdfundingBodySchema, uploadCrowdfundingReceiptBodySchema, } from './crowdfunding.js';
23
22
  export { type SetReactionBody, type SetReactionResponse, type SetVoteBody, type SetVoteResponse, setReactionBodySchema, setReactionResponseSchema, setVoteBodySchema, setVoteResponseSchema, type ToggleBookmarkResponse, toggleBookmarkResponseSchema, VOTE_VALUES, type VoteValue, voteValueSchema, } from './engagement.js';
24
23
  export { CONTENT_KIND_VALUES, type ContentKind, contentKindSchema, FEED_SORT_VALUES, type FeedSort, feedSortSchema, PROFILE_PRIVACY_VALUES, type ProfilePrivacy, profilePrivacySchema, REACTION_TYPE_VALUES, REPORT_REASON_VALUES, REPORT_STATUS_VALUES, type ReactionType, type ReportReason, type ReportStatus, reactionTypeSchema, reportReasonSchema, reportStatusSchema, VISIBILITY_LEVEL_RANK, VISIBILITY_LEVEL_VALUES, type VisibilityLevel, visibilityLevelSchema, } from './enums.js';
25
24
  export { DONATE_ITEM_CONDITION_VALUES, DONATE_ITEM_STATUS_VALUES, type DonateItemCondition, type DonateItemFeedItem, type DonateItemStatus, donateAuditAtSchema, donateAuditByAtSchema, donateDonatedToSchema, donateItemConditionSchema, donateItemFeedItemSchema, donateItemStatusSchema, type FeedItem, type FeedQueryParams, type FeedResponse, feedItemSchema, feedQueryParamsSchema, feedResponseSchema, LOST_FOUND_CATEGORY_VALUES, LOST_FOUND_STATUS_VALUES, type LostFoundCategory, type LostFoundFeedItem, type LostFoundStatus, lostFoundCategorySchema, lostFoundFeedItemSchema, lostFoundStatusSchema, VOICE_BOX_PRIORITY_VALUES, VOICE_BOX_STATUS_VALUES, type VoiceBoxFeedItem, type VoiceBoxPriority, type VoiceBoxStatus, voiceBoxAudioSchema, voiceBoxFeedItemSchema, voiceBoxLocationSchema, voiceBoxOfficerResponseSchema, voiceBoxPrioritySchema, voiceBoxStatusSchema, voiceBoxVideoSchema, } from './feed.js';
@@ -33,5 +32,6 @@ export { type ReportContentBody, type ReportContentKind, type ReportRecordWire,
33
32
  export { type CreateRepostBody, type CreateRepostResponse, createRepostBodySchema, createRepostResponseSchema, } from './repost.js';
34
33
  export { type BlockedUsersListResponse, type BlockedUserWire, blockedUsersListResponseSchema, blockedUserWireSchema, COMMUNITY_SETTINGS_DEFAULTS, type CommunitySettingsWire, communitySettingsWireSchema, type UpdateCommunitySettingsBody, updateCommunitySettingsBodySchema, } from './settings.js';
35
34
  export { type ToggleFollowResponse, toggleFollowResponseSchema, type ViewerSocialState, viewerSocialStateSchema, } from './social.js';
35
+ export { SOCIAL_SCORE_TIER_NAMES, SOCIAL_SCORE_TIERS, type SocialScoreTier, type SocialScoreTierName, tierFromSocialScore, } from './social-score.js';
36
36
  export { type CurrentUsernameState, currentUsernameStateSchema, type UpdateUsernameBody, type UpdateUsernameResponse, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, USERNAME_PATTERN, USERNAME_UNAVAILABLE_REASONS, type Username, type UsernameAvailabilityResponse, type UsernameUnavailableReason, updateUsernameBodySchema, updateUsernameResponseSchema, usernameAvailabilityResponseSchema, usernameSchema, usernameUnavailableReasonSchema, } from './username.js';
37
37
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[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A0B,EAC1B,KAAK,iBAAiB,EACtB,uBAAuB,GACxB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,KAAK,oBAAoB,EACzB,0BAA0B,EAC1B,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,4BAA4B,EAC5B,KAAK,QAAQ,EACb,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC9B,wBAAwB,EACxB,4BAA4B,EAC5B,kCAAkC,EAClC,cAAc,EACd,+BAA+B,GAChC,MAAM,eAAe,CAAC"}
package/dist/index.js CHANGED
@@ -21,11 +21,9 @@ export { communityCommentWireSchema, createCommentBodySchema, updateCommentBodyS
21
21
  // ─── Communities ───────────────────────────────────────────────────────────
22
22
  export { AREA_PICKER_LEVEL_VALUES, addOfficialModeratorBodySchema, areaPickerItemSchema, areaPickerLevelSchema, areaPickerQuerySchema, areaPickerResponseSchema, COMMUNITY_CATEGORY_VALUES, COMMUNITY_DESIGNATION_PRESETS, COMMUNITY_DISCOVER_SORT_VALUES, COMMUNITY_KIND_VALUES, COMMUNITY_MEMBERSHIP_STATUS_VALUES, COMMUNITY_REACH_VALUES, COMMUNITY_ROLE_VALUES, COMMUNITY_TAG_VALUES, COMMUNITY_TYPE_VALUES, COMMUNITY_VERIFIED_SCOPE_VALUES, communityCategorySchema, communityCenterCoordsSchema, communityDesignationPresetSchema, communityDesignationSchema, communityDiscoverSortSchema, communityKindSchema, communityListQuerySchema, communityListResponseSchema, communityMembershipStatusSchema, communityMembersListResponseSchema, communityMemberWireSchema, communityReachSchema, communityRoleSchema, communityTagSchema, communityTypeSchema, communityVerifiedScopeSchema, communityWireSchema, createCommunityBodySchema, createOfficialCommunityBodySchema, hidePostBodySchema, joinCommunityResponseSchema, OFFICIAL_COMMUNITY_AREA_KIND_VALUES, officialCommunityAreaKindSchema, setMemberDesignationBodySchema, setOfficialRepresentativeBodySchema, updateCommunityBodySchema, updateMemberRoleBodySchema, verifyCommunityBodySchema, } from './community.js';
23
23
  // ─── Constants ─────────────────────────────────────────────────────────────
24
- export { COMMENT_MAX_BODY_CHARS, COMMENTS_PAGE_SIZE, COMMUNITIES_PAGE_SIZE, COMMUNITY_DESCRIPTION_MAX_CHARS, COMMUNITY_DESIGNATION_CUSTOM_MAX_CHARS, COMMUNITY_DESIGNATION_CUSTOM_MIN_CHARS, COMMUNITY_DESIGNATION_CUSTOM_PATTERN, COMMUNITY_HYPERLOCAL_RADIUS_KM, COMMUNITY_MAX_TAGS, COMMUNITY_MEMBERS_PAGE_SIZE, COMMUNITY_NAME_MAX_CHARS, COMMUNITY_NAME_MIN_CHARS, COMMUNITY_SLUG_MAX_CHARS, COMMUNITY_SLUG_MIN_CHARS, COMMUNITY_SLUG_PATTERN, CROWDFUNDING_BENEFICIARY_NAME_MAX_CHARS, CROWDFUNDING_BENEFICIARY_RELATION_MAX_CHARS, CROWDFUNDING_DESCRIPTION_MAX_CHARS, CROWDFUNDING_DESCRIPTION_MIN_CHARS, CROWDFUNDING_MAX_DONATION_INR, CROWDFUNDING_MAX_DURATION_DAYS, CROWDFUNDING_MAX_GOAL_INR, CROWDFUNDING_MAX_IMAGES, CROWDFUNDING_MAX_SUPPORTING_DOCS, CROWDFUNDING_MIN_DURATION_DAYS, CROWDFUNDING_MIN_GOAL_INR, CROWDFUNDING_PAGE_SIZE, CROWDFUNDING_REJECTION_REASON_MAX_CHARS, CROWDFUNDING_REJECTION_REASON_MIN_CHARS, CROWDFUNDING_TIER_ENHANCED_INR, CROWDFUNDING_TIER_MAXIMUM_INR, CROWDFUNDING_TIER_STANDARD_INR, CROWDFUNDING_TITLE_MAX_CHARS, CROWDFUNDING_TITLE_MIN_CHARS, EDIT_GRACE_WINDOW_MS, FEED_PAGE_SIZE, GROUP_MAX_MEMBERS, GROUP_NAME_MAX_CHARS, GROUP_NAME_MIN_CHARS, PEOPLE_PAGE_SIZE, POLL_DURATION_PRESETS_MS, POLL_MAX_DURATION_MS, POLL_MAX_OPTIONS, POLL_MIN_DURATION_MS, POLL_MIN_OPTIONS, POLL_OPTION_MAX_CHARS, POLL_OPTION_MIN_CHARS, POLL_QUESTION_MAX_CHARS, POLL_QUESTION_MIN_CHARS, POLLS_PAGE_SIZE, POST_MAX_BODY_CHARS, POST_MAX_IMAGE_BYTES, POST_MAX_IMAGES, POST_MAX_VIDEO_BYTES, POST_MAX_VIDEO_SECONDS, POST_MAX_VIDEOS, PROFILE_MAX_BIO_CHARS, REPLIES_PRELOAD_COUNT, } from './constants.js';
24
+ export { COMMENT_MAX_BODY_CHARS, COMMENTS_PAGE_SIZE, COMMUNITIES_PAGE_SIZE, COMMUNITY_DESCRIPTION_MAX_CHARS, COMMUNITY_DESIGNATION_CUSTOM_MAX_CHARS, COMMUNITY_DESIGNATION_CUSTOM_MIN_CHARS, COMMUNITY_DESIGNATION_CUSTOM_PATTERN, COMMUNITY_HYPERLOCAL_RADIUS_KM, COMMUNITY_MAX_TAGS, COMMUNITY_MEMBERS_PAGE_SIZE, COMMUNITY_NAME_MAX_CHARS, COMMUNITY_NAME_MIN_CHARS, COMMUNITY_SLUG_MAX_CHARS, COMMUNITY_SLUG_MIN_CHARS, COMMUNITY_SLUG_PATTERN, computeCrowdfundingFee, CROWDFUNDING_BENEFICIARY_NAME_MAX_CHARS, CROWDFUNDING_BENEFICIARY_RELATION_MAX_CHARS, CROWDFUNDING_DESCRIPTION_MAX_CHARS, CROWDFUNDING_DESCRIPTION_MIN_CHARS, CROWDFUNDING_FEE_GST_RATE, CROWDFUNDING_MAX_DONATION_INR, CROWDFUNDING_MAX_DURATION_DAYS, CROWDFUNDING_MAX_GOAL_INR, CROWDFUNDING_MAX_IMAGES, CROWDFUNDING_MAX_SUPPORTING_DOCS, CROWDFUNDING_MIN_DURATION_DAYS, CROWDFUNDING_MIN_GOAL_INR, CROWDFUNDING_PAGE_SIZE, CROWDFUNDING_PLATFORM_FEE_RATE, CROWDFUNDING_REJECTION_REASON_MAX_CHARS, CROWDFUNDING_REJECTION_REASON_MIN_CHARS, CROWDFUNDING_TIER_ENHANCED_INR, CROWDFUNDING_TIER_MAXIMUM_INR, CROWDFUNDING_TIER_STANDARD_INR, CROWDFUNDING_TITLE_MAX_CHARS, CROWDFUNDING_TITLE_MIN_CHARS, EDIT_GRACE_WINDOW_MS, FEED_PAGE_SIZE, GROUP_MAX_MEMBERS, GROUP_NAME_MAX_CHARS, GROUP_NAME_MIN_CHARS, PEOPLE_PAGE_SIZE, POLL_DURATION_PRESETS_MS, POLL_MAX_DURATION_MS, POLL_MAX_OPTIONS, POLL_MIN_DURATION_MS, POLL_MIN_OPTIONS, POLL_OPTION_MAX_CHARS, POLL_OPTION_MIN_CHARS, POLL_QUESTION_MAX_CHARS, POLL_QUESTION_MIN_CHARS, POLLS_PAGE_SIZE, POST_MAX_BODY_CHARS, POST_MAX_IMAGE_BYTES, POST_MAX_IMAGES, POST_MAX_VIDEO_BYTES, POST_MAX_VIDEO_SECONDS, POST_MAX_VIDEOS, PROFILE_MAX_BIO_CHARS, REPLIES_PRELOAD_COUNT, } from './constants.js';
25
25
  // ─── Crowdfunding ──────────────────────────────────────────────────────────
26
- export { approveCrowdfundingBodySchema, attestCrowdfundingDonationBodySchema, CROWDFUNDING_AUDIENCE_VALUES, CROWDFUNDING_CATEGORY_VALUES, CROWDFUNDING_DONATION_STATE_VALUES, CROWDFUNDING_ORG_KIND_VALUES, CROWDFUNDING_SCOPE_VALUES, CROWDFUNDING_STATUS_VALUES, communityCrowdfundingWireSchema, createCrowdfundingBodySchema, crowdfundingAudienceSchema, crowdfundingCategorySchema, crowdfundingDonationStateSchema, crowdfundingDonationWireSchema, crowdfundingFeedItemSchema, crowdfundingOrgKindSchema, crowdfundingPaymentSchema, crowdfundingScopeSchema, crowdfundingStatusSchema, crowdfundingVerificationSchema, listCrowdfundingDonationsQuerySchema, listMyCrowdfundingDonationsQuerySchema, rejectCrowdfundingBodySchema, updateCrowdfundingBodySchema, uploadCrowdfundingReceiptBodySchema, } from './crowdfunding.js';
27
- // ─── Social score (shared tier table) ─────────────────────────────────────
28
- export { SOCIAL_SCORE_TIER_NAMES, SOCIAL_SCORE_TIERS, tierFromSocialScore, } from './social-score.js';
26
+ export { approveCrowdfundingBodySchema, attestCrowdfundingDonationBodySchema, CROWDFUNDING_AUDIENCE_VALUES, CROWDFUNDING_CATEGORY_VALUES, CROWDFUNDING_DONATION_STATE_VALUES, CROWDFUNDING_FEE_BILLING_MODE_VALUES, CROWDFUNDING_FEE_PAYMENT_STATUS_VALUES, CROWDFUNDING_ORG_KIND_VALUES, CROWDFUNDING_SCOPE_VALUES, CROWDFUNDING_STATUS_VALUES, communityCrowdfundingWireSchema, createCrowdfundingBodySchema, crowdfundingAudienceSchema, crowdfundingCategorySchema, crowdfundingDonationStateSchema, crowdfundingDonationWireSchema, crowdfundingFeeBillingModeSchema, crowdfundingFeePaymentStatusSchema, crowdfundingFeedItemSchema, crowdfundingOrgKindSchema, crowdfundingPaymentSchema, crowdfundingScopeSchema, crowdfundingStatusSchema, crowdfundingVerificationSchema, listCrowdfundingDonationsQuerySchema, listMyCrowdfundingDonationsQuerySchema, rejectCrowdfundingBodySchema, updateCrowdfundingBodySchema, uploadCrowdfundingReceiptBodySchema, } from './crowdfunding.js';
29
27
  // ─── Engagement (vote + reactions + bookmark) ─────────────────────────────
30
28
  export { setReactionBodySchema, setReactionResponseSchema, setVoteBodySchema, setVoteResponseSchema, toggleBookmarkResponseSchema, VOTE_VALUES, voteValueSchema, } from './engagement.js';
31
29
  // ─── Enums ─────────────────────────────────────────────────────────────────
@@ -52,6 +50,8 @@ export { createRepostBodySchema, createRepostResponseSchema, } from './repost.js
52
50
  export { blockedUsersListResponseSchema, blockedUserWireSchema, COMMUNITY_SETTINGS_DEFAULTS, communitySettingsWireSchema, updateCommunitySettingsBodySchema, } from './settings.js';
53
51
  // ─── Social (follow) ───────────────────────────────────────────────────────
54
52
  export { toggleFollowResponseSchema, viewerSocialStateSchema, } from './social.js';
53
+ // ─── Social score (shared tier table) ─────────────────────────────────────
54
+ export { SOCIAL_SCORE_TIER_NAMES, SOCIAL_SCORE_TIERS, tierFromSocialScore, } from './social-score.js';
55
55
  // ─── Username (URL handle + change / availability) ────────────────────────
56
56
  export { currentUsernameStateSchema, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, USERNAME_PATTERN, USERNAME_UNAVAILABLE_REASONS, updateUsernameBodySchema, updateUsernameResponseSchema, usernameAvailabilityResponseSchema, usernameSchema, usernameUnavailableReasonSchema, } from './username.js';
57
57
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,8EAA8E;AAC9E,OAAO,EAEL,yBAAyB,GAC1B,MAAM,WAAW,CAAC;AAEnB,8EAA8E;AAC9E,OAAO,EAGL,0BAA0B,EAC1B,uBAAuB,EAEvB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AAEtB,8EAA8E;AAC9E,OAAO,EAEL,wBAAwB,EAKxB,8BAA8B,EAC9B,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,6BAA6B,EAC7B,8BAA8B,EAC9B,qBAAqB,EACrB,kCAAkC,EAClC,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,+BAA+B,EAoB/B,uBAAuB,EACvB,2BAA2B,EAC3B,gCAAgC,EAChC,0BAA0B,EAC1B,2BAA2B,EAC3B,mBAAmB,EACnB,wBAAwB,EACxB,2BAA2B,EAC3B,+BAA+B,EAC/B,kCAAkC,EAClC,yBAAyB,EACzB,oBAAoB,EACpB,mBAAmB,EACnB,kBAA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C9E,OAAO,EAEL,0BAA0B,EAE1B,uBAAuB,GACxB,MAAM,aAAa,CAAC;AAErB,6EAA6E;AAC7E,OAAO,EAEL,0BAA0B,EAG1B,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,4BAA4B,EAI5B,wBAAwB,EACxB,4BAA4B,EAC5B,kCAAkC,EAClC,cAAc,EACd,+BAA+B,GAChC,MAAM,eAAe,CAAC","sourcesContent":["/**\n * community-schema — Shared Zod schemas + TypeScript types for the\n * Jansathi hyperlocal community feature (feed, posts, engagement,\n * social graph, groups, settings).\n *\n * Single source of truth consumed by reform-backend and every product\n * frontend. The schemas mirror MongoDB / Mongoose document shapes\n * 1:1 so the same Zod validation runs at the controller boundary on\n * the backend and in the form handlers on the client.\n *\n * Cascade-upward visibility semantics: a viewer whose feed level is L\n * sees posts at L and every BROADER level matching their area lineage.\n * See `./enums.ts#VISIBILITY_LEVEL_VALUES` for the level rank table.\n *\n * @module community-schema\n */\n\n// ─── Area lineage snapshot ─────────────────────────────────────────────────\nexport {\n type AreaLineageSnapshot,\n areaLineageSnapshotSchema,\n} from './area.js';\n\n// ─── Comment ───────────────────────────────────────────────────────────────\nexport {\n type CommunityCommentWire,\n type CreateCommentBody,\n communityCommentWireSchema,\n createCommentBodySchema,\n type UpdateCommentBody,\n updateCommentBodySchema,\n} from './comment.js';\n\n// ─── Communities ───────────────────────────────────────────────────────────\nexport {\n type AddOfficialModeratorBody,\n AREA_PICKER_LEVEL_VALUES,\n type AreaPickerItem,\n type AreaPickerLevel,\n type AreaPickerQuery,\n type AreaPickerResponse,\n addOfficialModeratorBodySchema,\n areaPickerItemSchema,\n areaPickerLevelSchema,\n areaPickerQuerySchema,\n areaPickerResponseSchema,\n COMMUNITY_CATEGORY_VALUES,\n COMMUNITY_DESIGNATION_PRESETS,\n COMMUNITY_DISCOVER_SORT_VALUES,\n COMMUNITY_KIND_VALUES,\n COMMUNITY_MEMBERSHIP_STATUS_VALUES,\n COMMUNITY_REACH_VALUES,\n COMMUNITY_ROLE_VALUES,\n COMMUNITY_TAG_VALUES,\n COMMUNITY_TYPE_VALUES,\n COMMUNITY_VERIFIED_SCOPE_VALUES,\n type CommunityCategory,\n type CommunityCenterCoords,\n type CommunityDesignation,\n type CommunityDesignationPreset,\n type CommunityDiscoverSort,\n type CommunityKind,\n type CommunityListQuery,\n type CommunityListResponse,\n type CommunityMembershipStatus,\n type CommunityMembersListResponse,\n type CommunityMemberWire,\n type CommunityReach,\n type CommunityRole,\n type CommunityTag,\n type CommunityType,\n type CommunityVerifiedScope,\n type CommunityWire,\n type CreateCommunityBody,\n type CreateOfficialCommunityBody,\n communityCategorySchema,\n communityCenterCoordsSchema,\n communityDesignationPresetSchema,\n communityDesignationSchema,\n communityDiscoverSortSchema,\n communityKindSchema,\n communityListQuerySchema,\n communityListResponseSchema,\n communityMembershipStatusSchema,\n communityMembersListResponseSchema,\n communityMemberWireSchema,\n communityReachSchema,\n communityRoleSchema,\n communityTagSchema,\n communityTypeSchema,\n communityVerifiedScopeSchema,\n communityWireSchema,\n createCommunityBodySchema,\n createOfficialCommunityBodySchema,\n type HidePostBody,\n hidePostBodySchema,\n type JoinCommunityResponse,\n joinCommunityResponseSchema,\n OFFICIAL_COMMUNITY_AREA_KIND_VALUES,\n type OfficialCommunityAreaKind,\n officialCommunityAreaKindSchema,\n type SetMemberDesignationBody,\n type SetOfficialRepresentativeBody,\n setMemberDesignationBodySchema,\n setOfficialRepresentativeBodySchema,\n type UpdateCommunityBody,\n type UpdateMemberRoleBody,\n updateCommunityBodySchema,\n updateMemberRoleBodySchema,\n type VerifyCommunityBody,\n verifyCommunityBodySchema,\n} from './community.js';\n\n// ─── Constants ─────────────────────────────────────────────────────────────\nexport {\n COMMENT_MAX_BODY_CHARS,\n COMMENTS_PAGE_SIZE,\n COMMUNITIES_PAGE_SIZE,\n COMMUNITY_DESCRIPTION_MAX_CHARS,\n COMMUNITY_DESIGNATION_CUSTOM_MAX_CHARS,\n COMMUNITY_DESIGNATION_CUSTOM_MIN_CHARS,\n COMMUNITY_DESIGNATION_CUSTOM_PATTERN,\n COMMUNITY_HYPERLOCAL_RADIUS_KM,\n COMMUNITY_MAX_TAGS,\n COMMUNITY_MEMBERS_PAGE_SIZE,\n COMMUNITY_NAME_MAX_CHARS,\n COMMUNITY_NAME_MIN_CHARS,\n COMMUNITY_SLUG_MAX_CHARS,\n COMMUNITY_SLUG_MIN_CHARS,\n COMMUNITY_SLUG_PATTERN,\n CROWDFUNDING_BENEFICIARY_NAME_MAX_CHARS,\n CROWDFUNDING_BENEFICIARY_RELATION_MAX_CHARS,\n CROWDFUNDING_DESCRIPTION_MAX_CHARS,\n CROWDFUNDING_DESCRIPTION_MIN_CHARS,\n CROWDFUNDING_MAX_DONATION_INR,\n CROWDFUNDING_MAX_DURATION_DAYS,\n CROWDFUNDING_MAX_GOAL_INR,\n CROWDFUNDING_MAX_IMAGES,\n CROWDFUNDING_MAX_SUPPORTING_DOCS,\n CROWDFUNDING_MIN_DURATION_DAYS,\n CROWDFUNDING_MIN_GOAL_INR,\n CROWDFUNDING_PAGE_SIZE,\n CROWDFUNDING_REJECTION_REASON_MAX_CHARS,\n CROWDFUNDING_REJECTION_REASON_MIN_CHARS,\n CROWDFUNDING_TIER_ENHANCED_INR,\n CROWDFUNDING_TIER_MAXIMUM_INR,\n CROWDFUNDING_TIER_STANDARD_INR,\n CROWDFUNDING_TITLE_MAX_CHARS,\n CROWDFUNDING_TITLE_MIN_CHARS,\n EDIT_GRACE_WINDOW_MS,\n FEED_PAGE_SIZE,\n GROUP_MAX_MEMBERS,\n GROUP_NAME_MAX_CHARS,\n GROUP_NAME_MIN_CHARS,\n PEOPLE_PAGE_SIZE,\n POLL_DURATION_PRESETS_MS,\n POLL_MAX_DURATION_MS,\n POLL_MAX_OPTIONS,\n POLL_MIN_DURATION_MS,\n POLL_MIN_OPTIONS,\n POLL_OPTION_MAX_CHARS,\n POLL_OPTION_MIN_CHARS,\n POLL_QUESTION_MAX_CHARS,\n POLL_QUESTION_MIN_CHARS,\n POLLS_PAGE_SIZE,\n POST_MAX_BODY_CHARS,\n POST_MAX_IMAGE_BYTES,\n POST_MAX_IMAGES,\n POST_MAX_VIDEO_BYTES,\n POST_MAX_VIDEO_SECONDS,\n POST_MAX_VIDEOS,\n PROFILE_MAX_BIO_CHARS,\n REPLIES_PRELOAD_COUNT,\n} from './constants.js';\n\n// ─── Crowdfunding ──────────────────────────────────────────────────────────\nexport {\n type ApproveCrowdfundingBody,\n type AttestCrowdfundingDonationBody,\n approveCrowdfundingBodySchema,\n attestCrowdfundingDonationBodySchema,\n type CommunityCrowdfundingWire,\n CROWDFUNDING_AUDIENCE_VALUES,\n CROWDFUNDING_CATEGORY_VALUES,\n CROWDFUNDING_DONATION_STATE_VALUES,\n CROWDFUNDING_ORG_KIND_VALUES,\n CROWDFUNDING_SCOPE_VALUES,\n CROWDFUNDING_STATUS_VALUES,\n type CreateCrowdfundingBody,\n type CrowdfundingAudience,\n type CrowdfundingCategory,\n type CrowdfundingDonationState,\n type CrowdfundingDonationWire,\n type CrowdfundingFeedItem,\n type CrowdfundingOrgKind,\n type CrowdfundingPayment,\n type CrowdfundingScope,\n type CrowdfundingStatus,\n type CrowdfundingVerification,\n communityCrowdfundingWireSchema,\n createCrowdfundingBodySchema,\n crowdfundingAudienceSchema,\n crowdfundingCategorySchema,\n crowdfundingDonationStateSchema,\n crowdfundingDonationWireSchema,\n crowdfundingFeedItemSchema,\n crowdfundingOrgKindSchema,\n crowdfundingPaymentSchema,\n crowdfundingScopeSchema,\n crowdfundingStatusSchema,\n crowdfundingVerificationSchema,\n type ListCrowdfundingDonationsQuery,\n type ListMyCrowdfundingDonationsQuery,\n listCrowdfundingDonationsQuerySchema,\n listMyCrowdfundingDonationsQuerySchema,\n type RejectCrowdfundingBody,\n rejectCrowdfundingBodySchema,\n type UpdateCrowdfundingBody,\n type UploadCrowdfundingReceiptBody,\n updateCrowdfundingBodySchema,\n uploadCrowdfundingReceiptBodySchema,\n} from './crowdfunding.js';\n\n// ─── Social score (shared tier table) ─────────────────────────────────────\nexport {\n SOCIAL_SCORE_TIER_NAMES,\n SOCIAL_SCORE_TIERS,\n type SocialScoreTier,\n type SocialScoreTierName,\n tierFromSocialScore,\n} from './social-score.js';\n\n// ─── Engagement (vote + reactions + bookmark) ─────────────────────────────\nexport {\n type SetReactionBody,\n type SetReactionResponse,\n type SetVoteBody,\n type SetVoteResponse,\n setReactionBodySchema,\n setReactionResponseSchema,\n setVoteBodySchema,\n setVoteResponseSchema,\n type ToggleBookmarkResponse,\n toggleBookmarkResponseSchema,\n VOTE_VALUES,\n type VoteValue,\n voteValueSchema,\n} from './engagement.js';\n\n// ─── Enums ─────────────────────────────────────────────────────────────────\nexport {\n CONTENT_KIND_VALUES,\n type ContentKind,\n contentKindSchema,\n FEED_SORT_VALUES,\n type FeedSort,\n feedSortSchema,\n PROFILE_PRIVACY_VALUES,\n type ProfilePrivacy,\n profilePrivacySchema,\n REACTION_TYPE_VALUES,\n REPORT_REASON_VALUES,\n REPORT_STATUS_VALUES,\n type ReactionType,\n type ReportReason,\n type ReportStatus,\n reactionTypeSchema,\n reportReasonSchema,\n reportStatusSchema,\n VISIBILITY_LEVEL_RANK,\n VISIBILITY_LEVEL_VALUES,\n type VisibilityLevel,\n visibilityLevelSchema,\n} from './enums.js';\n\n// ─── Feed (polymorphic union) ──────────────────────────────────────────────\nexport {\n DONATE_ITEM_CONDITION_VALUES,\n DONATE_ITEM_STATUS_VALUES,\n type DonateItemCondition,\n type DonateItemFeedItem,\n type DonateItemStatus,\n donateAuditAtSchema,\n donateAuditByAtSchema,\n donateDonatedToSchema,\n donateItemConditionSchema,\n donateItemFeedItemSchema,\n donateItemStatusSchema,\n type FeedItem,\n type FeedQueryParams,\n type FeedResponse,\n feedItemSchema,\n feedQueryParamsSchema,\n feedResponseSchema,\n LOST_FOUND_CATEGORY_VALUES,\n LOST_FOUND_STATUS_VALUES,\n type LostFoundCategory,\n type LostFoundFeedItem,\n type LostFoundStatus,\n lostFoundCategorySchema,\n lostFoundFeedItemSchema,\n lostFoundStatusSchema,\n VOICE_BOX_PRIORITY_VALUES,\n VOICE_BOX_STATUS_VALUES,\n type VoiceBoxFeedItem,\n type VoiceBoxPriority,\n type VoiceBoxStatus,\n voiceBoxAudioSchema,\n voiceBoxFeedItemSchema,\n voiceBoxLocationSchema,\n voiceBoxOfficerResponseSchema,\n voiceBoxPrioritySchema,\n voiceBoxStatusSchema,\n voiceBoxVideoSchema,\n} from './feed.js';\n// ─── Groups ────────────────────────────────────────────────────────────────\nexport {\n type AddGroupMembersBody,\n addGroupMembersBodySchema,\n type CommunityGroupWire,\n type CommunityGroupWithMembers,\n type CreateGroupBody,\n communityGroupWireSchema,\n communityGroupWithMembersSchema,\n createGroupBodySchema,\n type GroupMembersListResponse,\n type GroupMemberWire,\n type GroupRole,\n type GroupsListResponse,\n groupMembersListResponseSchema,\n groupMemberWireSchema,\n groupRoleSchema,\n groupsListResponseSchema,\n type UpdateGroupBody,\n updateGroupBodySchema,\n} from './group.js';\n// ─── Link preview (auto-extracted URL embed) ──────────────────────────────\nexport {\n LINK_PREVIEW_KIND_VALUES,\n type LinkPreview,\n type LinkPreviewKind,\n linkPreviewKindSchema,\n linkPreviewSchema,\n} from './link-preview.js';\n// ─── Media ─────────────────────────────────────────────────────────────────\nexport {\n type PostImage,\n type PostVideo,\n postImageSchema,\n postVideoSchema,\n} from './media.js';\n// ─── Poll ──────────────────────────────────────────────────────────────────\nexport {\n type CastVoteBody,\n type CommunityPollFeedItem,\n type CommunityPollWire,\n type CreatePollBody,\n castVoteBodySchema,\n communityPollFeedItemSchema,\n communityPollWireSchema,\n createPollBodySchema,\n POLL_RESULTS_VISIBILITY_VALUES,\n type PollOptionInput,\n type PollOptionWire,\n type PollResultsVisibility,\n pollOptionInputSchema,\n pollOptionWireSchema,\n pollResultsVisibilitySchema,\n type VoteResponse,\n voteResponseSchema,\n} from './poll.js';\n\n// ─── Post ──────────────────────────────────────────────────────────────────\nexport {\n type CommunityPostWire,\n type CreatePostBody,\n communityPostWireSchema,\n createPostBodySchema,\n type PostAuthorSnapshot,\n postAuthorSnapshotSchema,\n type RepostedSource,\n repostedSourceSchema,\n type UpdatePostBody,\n updatePostBodySchema,\n} from './post.js';\n// ─── Profile + People list ─────────────────────────────────────────────────\nexport {\n PEOPLE_LIST_FILTER_DEFAULT,\n PEOPLE_LIST_FILTER_VALUES,\n type PeopleListFilter,\n type PeopleListItem,\n type PeopleListResponse,\n type PeopleQueryParams,\n type ProfileMutuals,\n type PublicProfileWire,\n peopleListFilterSchema,\n peopleListItemSchema,\n peopleListResponseSchema,\n peopleQueryParamsSchema,\n profileMutualsSchema,\n publicProfileWireSchema,\n} from './profile.js';\n// ─── Reports (moderation) ──────────────────────────────────────────────────\nexport {\n type ReportContentBody,\n type ReportContentKind,\n type ReportRecordWire,\n type ReportSubmissionResponse,\n type ReportUserBody,\n reportContentBodySchema,\n reportContentKindSchema,\n reportRecordWireSchema,\n reportSubmissionResponseSchema,\n reportUserBodySchema,\n} from './report.js';\n// ─── Repost (quote / amplify) ──────────────────────────────────────────────\nexport {\n type CreateRepostBody,\n type CreateRepostResponse,\n createRepostBodySchema,\n createRepostResponseSchema,\n} from './repost.js';\n\n// ─── Settings ──────────────────────────────────────────────────────────────\nexport {\n type BlockedUsersListResponse,\n type BlockedUserWire,\n blockedUsersListResponseSchema,\n blockedUserWireSchema,\n COMMUNITY_SETTINGS_DEFAULTS,\n type CommunitySettingsWire,\n communitySettingsWireSchema,\n type UpdateCommunitySettingsBody,\n updateCommunitySettingsBodySchema,\n} from './settings.js';\n\n// ─── Social (follow) ───────────────────────────────────────────────────────\nexport {\n type ToggleFollowResponse,\n toggleFollowResponseSchema,\n type ViewerSocialState,\n viewerSocialStateSchema,\n} from './social.js';\n\n// ─── Username (URL handle + change / availability) ────────────────────────\nexport {\n type CurrentUsernameState,\n currentUsernameStateSchema,\n type UpdateUsernameBody,\n type UpdateUsernameResponse,\n USERNAME_MAX_LENGTH,\n USERNAME_MIN_LENGTH,\n USERNAME_PATTERN,\n USERNAME_UNAVAILABLE_REASONS,\n type Username,\n type UsernameAvailabilityResponse,\n type UsernameUnavailableReason,\n updateUsernameBodySchema,\n updateUsernameResponseSchema,\n usernameAvailabilityResponseSchema,\n usernameSchema,\n usernameUnavailableReasonSchema,\n} from './username.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,8EAA8E;AAC9E,OAAO,EAEL,yBAAyB,GAC1B,MAAM,WAAW,CAAC;AAEnB,8EAA8E;AAC9E,OAAO,EAGL,0BAA0B,EAC1B,uBAAuB,EAEvB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AAEtB,8EAA8E;AAC9E,OAAO,EAEL,wBAAwB,EAKxB,8BAA8B,EAC9B,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,6BAA6B,EAC7B,8BAA8B,EAC9B,qBAAqB,EACrB,kCAAkC,EAClC,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,+BAA+B,EAoB/B,uBAAuB,EACvB,2BAA2B,EAC3B,gCAAgC,EAChC,0BAA0B,EAC1B,2BAA2B,EAC3B,mBAAmB,EACnB,wBAAwB,EACxB,2BAA2B,EAC3B,+BAA+B,EAC/B,kCAAkC,EAClC,yBAAyB,EACzB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,4BAA4B,EAC5B,mBAAmB,EACnB,yBAAyB,EACzB,iCAAiC,EAEjC,kBAAkB,EAElB,2BAA2B,EAC3B,mCAAmC,EAEnC,+BAA+B,EAG/B,8BAA8B,EAC9B,mCAAmC,EAGnC,yBAAyB,EACzB,0BAA0B,EAE1B,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC;AAExB,8EAA8E;AAC9E,OAAO,EACL,sBA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EACxB,4BAA4B,EAC5B,kCAAkC,EAClC,cAAc,EACd,+BAA+B,GAChC,MAAM,eAAe,CAAC","sourcesContent":["/**\n * community-schema — Shared Zod schemas + TypeScript types for the\n * Jansathi hyperlocal community feature (feed, posts, engagement,\n * social graph, groups, settings).\n *\n * Single source of truth consumed by reform-backend and every product\n * frontend. The schemas mirror MongoDB / Mongoose document shapes\n * 1:1 so the same Zod validation runs at the controller boundary on\n * the backend and in the form handlers on the client.\n *\n * Cascade-upward visibility semantics: a viewer whose feed level is L\n * sees posts at L and every BROADER level matching their area lineage.\n * See `./enums.ts#VISIBILITY_LEVEL_VALUES` for the level rank table.\n *\n * @module community-schema\n */\n\n// ─── Area lineage snapshot ─────────────────────────────────────────────────\nexport {\n type AreaLineageSnapshot,\n areaLineageSnapshotSchema,\n} from './area.js';\n\n// ─── Comment ───────────────────────────────────────────────────────────────\nexport {\n type CommunityCommentWire,\n type CreateCommentBody,\n communityCommentWireSchema,\n createCommentBodySchema,\n type UpdateCommentBody,\n updateCommentBodySchema,\n} from './comment.js';\n\n// ─── Communities ───────────────────────────────────────────────────────────\nexport {\n type AddOfficialModeratorBody,\n AREA_PICKER_LEVEL_VALUES,\n type AreaPickerItem,\n type AreaPickerLevel,\n type AreaPickerQuery,\n type AreaPickerResponse,\n addOfficialModeratorBodySchema,\n areaPickerItemSchema,\n areaPickerLevelSchema,\n areaPickerQuerySchema,\n areaPickerResponseSchema,\n COMMUNITY_CATEGORY_VALUES,\n COMMUNITY_DESIGNATION_PRESETS,\n COMMUNITY_DISCOVER_SORT_VALUES,\n COMMUNITY_KIND_VALUES,\n COMMUNITY_MEMBERSHIP_STATUS_VALUES,\n COMMUNITY_REACH_VALUES,\n COMMUNITY_ROLE_VALUES,\n COMMUNITY_TAG_VALUES,\n COMMUNITY_TYPE_VALUES,\n COMMUNITY_VERIFIED_SCOPE_VALUES,\n type CommunityCategory,\n type CommunityCenterCoords,\n type CommunityDesignation,\n type CommunityDesignationPreset,\n type CommunityDiscoverSort,\n type CommunityKind,\n type CommunityListQuery,\n type CommunityListResponse,\n type CommunityMembershipStatus,\n type CommunityMembersListResponse,\n type CommunityMemberWire,\n type CommunityReach,\n type CommunityRole,\n type CommunityTag,\n type CommunityType,\n type CommunityVerifiedScope,\n type CommunityWire,\n type CreateCommunityBody,\n type CreateOfficialCommunityBody,\n communityCategorySchema,\n communityCenterCoordsSchema,\n communityDesignationPresetSchema,\n communityDesignationSchema,\n communityDiscoverSortSchema,\n communityKindSchema,\n communityListQuerySchema,\n communityListResponseSchema,\n communityMembershipStatusSchema,\n communityMembersListResponseSchema,\n communityMemberWireSchema,\n communityReachSchema,\n communityRoleSchema,\n communityTagSchema,\n communityTypeSchema,\n communityVerifiedScopeSchema,\n communityWireSchema,\n createCommunityBodySchema,\n createOfficialCommunityBodySchema,\n type HidePostBody,\n hidePostBodySchema,\n type JoinCommunityResponse,\n joinCommunityResponseSchema,\n OFFICIAL_COMMUNITY_AREA_KIND_VALUES,\n type OfficialCommunityAreaKind,\n officialCommunityAreaKindSchema,\n type SetMemberDesignationBody,\n type SetOfficialRepresentativeBody,\n setMemberDesignationBodySchema,\n setOfficialRepresentativeBodySchema,\n type UpdateCommunityBody,\n type UpdateMemberRoleBody,\n updateCommunityBodySchema,\n updateMemberRoleBodySchema,\n type VerifyCommunityBody,\n verifyCommunityBodySchema,\n} from './community.js';\n\n// ─── Constants ─────────────────────────────────────────────────────────────\nexport {\n COMMENT_MAX_BODY_CHARS,\n COMMENTS_PAGE_SIZE,\n COMMUNITIES_PAGE_SIZE,\n COMMUNITY_DESCRIPTION_MAX_CHARS,\n COMMUNITY_DESIGNATION_CUSTOM_MAX_CHARS,\n COMMUNITY_DESIGNATION_CUSTOM_MIN_CHARS,\n COMMUNITY_DESIGNATION_CUSTOM_PATTERN,\n COMMUNITY_HYPERLOCAL_RADIUS_KM,\n COMMUNITY_MAX_TAGS,\n COMMUNITY_MEMBERS_PAGE_SIZE,\n COMMUNITY_NAME_MAX_CHARS,\n COMMUNITY_NAME_MIN_CHARS,\n COMMUNITY_SLUG_MAX_CHARS,\n COMMUNITY_SLUG_MIN_CHARS,\n COMMUNITY_SLUG_PATTERN,\n computeCrowdfundingFee,\n CROWDFUNDING_BENEFICIARY_NAME_MAX_CHARS,\n CROWDFUNDING_BENEFICIARY_RELATION_MAX_CHARS,\n CROWDFUNDING_DESCRIPTION_MAX_CHARS,\n CROWDFUNDING_DESCRIPTION_MIN_CHARS,\n CROWDFUNDING_FEE_GST_RATE,\n CROWDFUNDING_MAX_DONATION_INR,\n CROWDFUNDING_MAX_DURATION_DAYS,\n CROWDFUNDING_MAX_GOAL_INR,\n CROWDFUNDING_MAX_IMAGES,\n CROWDFUNDING_MAX_SUPPORTING_DOCS,\n CROWDFUNDING_MIN_DURATION_DAYS,\n CROWDFUNDING_MIN_GOAL_INR,\n CROWDFUNDING_PAGE_SIZE,\n CROWDFUNDING_PLATFORM_FEE_RATE,\n CROWDFUNDING_REJECTION_REASON_MAX_CHARS,\n CROWDFUNDING_REJECTION_REASON_MIN_CHARS,\n CROWDFUNDING_TIER_ENHANCED_INR,\n CROWDFUNDING_TIER_MAXIMUM_INR,\n CROWDFUNDING_TIER_STANDARD_INR,\n CROWDFUNDING_TITLE_MAX_CHARS,\n CROWDFUNDING_TITLE_MIN_CHARS,\n EDIT_GRACE_WINDOW_MS,\n FEED_PAGE_SIZE,\n GROUP_MAX_MEMBERS,\n GROUP_NAME_MAX_CHARS,\n GROUP_NAME_MIN_CHARS,\n PEOPLE_PAGE_SIZE,\n POLL_DURATION_PRESETS_MS,\n POLL_MAX_DURATION_MS,\n POLL_MAX_OPTIONS,\n POLL_MIN_DURATION_MS,\n POLL_MIN_OPTIONS,\n POLL_OPTION_MAX_CHARS,\n POLL_OPTION_MIN_CHARS,\n POLL_QUESTION_MAX_CHARS,\n POLL_QUESTION_MIN_CHARS,\n POLLS_PAGE_SIZE,\n POST_MAX_BODY_CHARS,\n POST_MAX_IMAGE_BYTES,\n POST_MAX_IMAGES,\n POST_MAX_VIDEO_BYTES,\n POST_MAX_VIDEO_SECONDS,\n POST_MAX_VIDEOS,\n PROFILE_MAX_BIO_CHARS,\n REPLIES_PRELOAD_COUNT,\n} from './constants.js';\n\n// ─── Crowdfunding ──────────────────────────────────────────────────────────\nexport {\n type ApproveCrowdfundingBody,\n type AttestCrowdfundingDonationBody,\n approveCrowdfundingBodySchema,\n attestCrowdfundingDonationBodySchema,\n type CommunityCrowdfundingWire,\n CROWDFUNDING_AUDIENCE_VALUES,\n CROWDFUNDING_CATEGORY_VALUES,\n CROWDFUNDING_DONATION_STATE_VALUES,\n CROWDFUNDING_FEE_BILLING_MODE_VALUES,\n CROWDFUNDING_FEE_PAYMENT_STATUS_VALUES,\n CROWDFUNDING_ORG_KIND_VALUES,\n CROWDFUNDING_SCOPE_VALUES,\n CROWDFUNDING_STATUS_VALUES,\n type CreateCrowdfundingBody,\n type CrowdfundingAudience,\n type CrowdfundingCategory,\n type CrowdfundingDonationState,\n type CrowdfundingDonationWire,\n type CrowdfundingFeeBillingMode,\n type CrowdfundingFeePaymentStatus,\n type CrowdfundingFeedItem,\n type CrowdfundingOrgKind,\n type CrowdfundingPayment,\n type CrowdfundingScope,\n type CrowdfundingStatus,\n type CrowdfundingVerification,\n communityCrowdfundingWireSchema,\n createCrowdfundingBodySchema,\n crowdfundingAudienceSchema,\n crowdfundingCategorySchema,\n crowdfundingDonationStateSchema,\n crowdfundingDonationWireSchema,\n crowdfundingFeeBillingModeSchema,\n crowdfundingFeePaymentStatusSchema,\n crowdfundingFeedItemSchema,\n crowdfundingOrgKindSchema,\n crowdfundingPaymentSchema,\n crowdfundingScopeSchema,\n crowdfundingStatusSchema,\n crowdfundingVerificationSchema,\n type ListCrowdfundingDonationsQuery,\n type ListMyCrowdfundingDonationsQuery,\n listCrowdfundingDonationsQuerySchema,\n listMyCrowdfundingDonationsQuerySchema,\n type RejectCrowdfundingBody,\n rejectCrowdfundingBodySchema,\n type UpdateCrowdfundingBody,\n type UploadCrowdfundingReceiptBody,\n updateCrowdfundingBodySchema,\n uploadCrowdfundingReceiptBodySchema,\n} from './crowdfunding.js';\n// ─── Engagement (vote + reactions + bookmark) ─────────────────────────────\nexport {\n type SetReactionBody,\n type SetReactionResponse,\n type SetVoteBody,\n type SetVoteResponse,\n setReactionBodySchema,\n setReactionResponseSchema,\n setVoteBodySchema,\n setVoteResponseSchema,\n type ToggleBookmarkResponse,\n toggleBookmarkResponseSchema,\n VOTE_VALUES,\n type VoteValue,\n voteValueSchema,\n} from './engagement.js';\n// ─── Enums ─────────────────────────────────────────────────────────────────\nexport {\n CONTENT_KIND_VALUES,\n type ContentKind,\n contentKindSchema,\n FEED_SORT_VALUES,\n type FeedSort,\n feedSortSchema,\n PROFILE_PRIVACY_VALUES,\n type ProfilePrivacy,\n profilePrivacySchema,\n REACTION_TYPE_VALUES,\n REPORT_REASON_VALUES,\n REPORT_STATUS_VALUES,\n type ReactionType,\n type ReportReason,\n type ReportStatus,\n reactionTypeSchema,\n reportReasonSchema,\n reportStatusSchema,\n VISIBILITY_LEVEL_RANK,\n VISIBILITY_LEVEL_VALUES,\n type VisibilityLevel,\n visibilityLevelSchema,\n} from './enums.js';\n// ─── Feed (polymorphic union) ──────────────────────────────────────────────\nexport {\n DONATE_ITEM_CONDITION_VALUES,\n DONATE_ITEM_STATUS_VALUES,\n type DonateItemCondition,\n type DonateItemFeedItem,\n type DonateItemStatus,\n donateAuditAtSchema,\n donateAuditByAtSchema,\n donateDonatedToSchema,\n donateItemConditionSchema,\n donateItemFeedItemSchema,\n donateItemStatusSchema,\n type FeedItem,\n type FeedQueryParams,\n type FeedResponse,\n feedItemSchema,\n feedQueryParamsSchema,\n feedResponseSchema,\n LOST_FOUND_CATEGORY_VALUES,\n LOST_FOUND_STATUS_VALUES,\n type LostFoundCategory,\n type LostFoundFeedItem,\n type LostFoundStatus,\n lostFoundCategorySchema,\n lostFoundFeedItemSchema,\n lostFoundStatusSchema,\n VOICE_BOX_PRIORITY_VALUES,\n VOICE_BOX_STATUS_VALUES,\n type VoiceBoxFeedItem,\n type VoiceBoxPriority,\n type VoiceBoxStatus,\n voiceBoxAudioSchema,\n voiceBoxFeedItemSchema,\n voiceBoxLocationSchema,\n voiceBoxOfficerResponseSchema,\n voiceBoxPrioritySchema,\n voiceBoxStatusSchema,\n voiceBoxVideoSchema,\n} from './feed.js';\n// ─── Groups ────────────────────────────────────────────────────────────────\nexport {\n type AddGroupMembersBody,\n addGroupMembersBodySchema,\n type CommunityGroupWire,\n type CommunityGroupWithMembers,\n type CreateGroupBody,\n communityGroupWireSchema,\n communityGroupWithMembersSchema,\n createGroupBodySchema,\n type GroupMembersListResponse,\n type GroupMemberWire,\n type GroupRole,\n type GroupsListResponse,\n groupMembersListResponseSchema,\n groupMemberWireSchema,\n groupRoleSchema,\n groupsListResponseSchema,\n type UpdateGroupBody,\n updateGroupBodySchema,\n} from './group.js';\n// ─── Link preview (auto-extracted URL embed) ──────────────────────────────\nexport {\n LINK_PREVIEW_KIND_VALUES,\n type LinkPreview,\n type LinkPreviewKind,\n linkPreviewKindSchema,\n linkPreviewSchema,\n} from './link-preview.js';\n// ─── Media ─────────────────────────────────────────────────────────────────\nexport {\n type PostImage,\n type PostVideo,\n postImageSchema,\n postVideoSchema,\n} from './media.js';\n// ─── Poll ──────────────────────────────────────────────────────────────────\nexport {\n type CastVoteBody,\n type CommunityPollFeedItem,\n type CommunityPollWire,\n type CreatePollBody,\n castVoteBodySchema,\n communityPollFeedItemSchema,\n communityPollWireSchema,\n createPollBodySchema,\n POLL_RESULTS_VISIBILITY_VALUES,\n type PollOptionInput,\n type PollOptionWire,\n type PollResultsVisibility,\n pollOptionInputSchema,\n pollOptionWireSchema,\n pollResultsVisibilitySchema,\n type VoteResponse,\n voteResponseSchema,\n} from './poll.js';\n// ─── Post ──────────────────────────────────────────────────────────────────\nexport {\n type CommunityPostWire,\n type CreatePostBody,\n communityPostWireSchema,\n createPostBodySchema,\n type PostAuthorSnapshot,\n postAuthorSnapshotSchema,\n type RepostedSource,\n repostedSourceSchema,\n type UpdatePostBody,\n updatePostBodySchema,\n} from './post.js';\n// ─── Profile + People list ─────────────────────────────────────────────────\nexport {\n PEOPLE_LIST_FILTER_DEFAULT,\n PEOPLE_LIST_FILTER_VALUES,\n type PeopleListFilter,\n type PeopleListItem,\n type PeopleListResponse,\n type PeopleQueryParams,\n type ProfileMutuals,\n type PublicProfileWire,\n peopleListFilterSchema,\n peopleListItemSchema,\n peopleListResponseSchema,\n peopleQueryParamsSchema,\n profileMutualsSchema,\n publicProfileWireSchema,\n} from './profile.js';\n// ─── Reports (moderation) ──────────────────────────────────────────────────\nexport {\n type ReportContentBody,\n type ReportContentKind,\n type ReportRecordWire,\n type ReportSubmissionResponse,\n type ReportUserBody,\n reportContentBodySchema,\n reportContentKindSchema,\n reportRecordWireSchema,\n reportSubmissionResponseSchema,\n reportUserBodySchema,\n} from './report.js';\n// ─── Repost (quote / amplify) ──────────────────────────────────────────────\nexport {\n type CreateRepostBody,\n type CreateRepostResponse,\n createRepostBodySchema,\n createRepostResponseSchema,\n} from './repost.js';\n// ─── Settings ──────────────────────────────────────────────────────────────\nexport {\n type BlockedUsersListResponse,\n type BlockedUserWire,\n blockedUsersListResponseSchema,\n blockedUserWireSchema,\n COMMUNITY_SETTINGS_DEFAULTS,\n type CommunitySettingsWire,\n communitySettingsWireSchema,\n type UpdateCommunitySettingsBody,\n updateCommunitySettingsBodySchema,\n} from './settings.js';\n// ─── Social (follow) ───────────────────────────────────────────────────────\nexport {\n type ToggleFollowResponse,\n toggleFollowResponseSchema,\n type ViewerSocialState,\n viewerSocialStateSchema,\n} from './social.js';\n// ─── Social score (shared tier table) ─────────────────────────────────────\nexport {\n SOCIAL_SCORE_TIER_NAMES,\n SOCIAL_SCORE_TIERS,\n type SocialScoreTier,\n type SocialScoreTierName,\n tierFromSocialScore,\n} from './social-score.js';\n\n// ─── Username (URL handle + change / availability) ────────────────────────\nexport {\n type CurrentUsernameState,\n currentUsernameStateSchema,\n type UpdateUsernameBody,\n type UpdateUsernameResponse,\n USERNAME_MAX_LENGTH,\n USERNAME_MIN_LENGTH,\n USERNAME_PATTERN,\n USERNAME_UNAVAILABLE_REASONS,\n type Username,\n type UsernameAvailabilityResponse,\n type UsernameUnavailableReason,\n updateUsernameBodySchema,\n updateUsernameResponseSchema,\n usernameAvailabilityResponseSchema,\n usernameSchema,\n usernameUnavailableReasonSchema,\n} from './username.js';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"social-score.d.ts","sourceRoot":"","sources":["../src/social-score.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,eAAO,MAAM,uBAAuB,4DAK1B,CAAC;AACX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3E,MAAM,WAAW,eAAe;IAC9B,4DAA4D;IAC5D,IAAI,EAAE,mBAAmB,CAAC;IAC1B;yDACqD;IACrD,QAAQ,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,eAAe,EAK/C,CAAC;AAEX;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,eAAe,CAMvE"}
1
+ {"version":3,"file":"social-score.d.ts","sourceRoot":"","sources":["../src/social-score.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,eAAO,MAAM,uBAAuB,4DAA6D,CAAC;AAClG,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3E,MAAM,WAAW,eAAe;IAC9B,4DAA4D;IAC5D,IAAI,EAAE,mBAAmB,CAAC;IAC1B;yDACqD;IACrD,QAAQ,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,eAAe,EAK/C,CAAC;AAEX;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,eAAe,CAMvE"}
@@ -24,12 +24,7 @@
24
24
  *
25
25
  * @module community-schema/social-score
26
26
  */
27
- export const SOCIAL_SCORE_TIER_NAMES = [
28
- 'newcomer',
29
- 'contributor',
30
- 'pillar',
31
- 'champion',
32
- ];
27
+ export const SOCIAL_SCORE_TIER_NAMES = ['newcomer', 'contributor', 'pillar', 'champion'];
33
28
  /**
34
29
  * Tier table — ordered ascending by `minScore`. Adding a new tier:
35
30
  * insert in score order and bump the package minor version so
@@ -1 +1 @@
1
- {"version":3,"file":"social-score.js","sourceRoot":"","sources":["../src/social-score.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,UAAU;IACV,aAAa;IACb,QAAQ;IACR,UAAU;CACF,CAAC;AAaX;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAA+B;IAC5D,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE;IACpD,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,aAAa,EAAE;IAC5D,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE;IAClD,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE;CAChD,CAAC;AAEX;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,UAAkB;IACpD,IAAI,MAAM,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC;IACnC,KAAK,MAAM,IAAI,IAAI,kBAAkB,EAAE,CAAC;QACtC,IAAI,UAAU,IAAI,IAAI,CAAC,QAAQ;YAAE,MAAM,GAAG,IAAI,CAAC;IACjD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/**\n * Social-score tier table — shared single source of truth.\n *\n * Why this lives in the schema package\n * ────────────────────────────────────\n * Backend (`reform-backend/.../config/score-rules.ts`) sorts the\n * leaderboard by tier and applies tier-based gates on a few admin\n * surfaces. Frontend (`features/social-score/lib/tiers.ts`) renders\n * the badge tone + label off the same table. A bump from `pillar:\n * 500` → `pillar: 600` on the backend without a matching frontend\n * deploy would render a \"Pillar 525\" badge on a user the backend\n * is treating as a Contributor — silent drift.\n *\n * Centralising the table here makes the schema-package version bump\n * the single shipping signal: bump community-schema, both consumers\n * pick up the new thresholds on `npm install`.\n *\n * Categories (`profile / civic / engagement / leadership`) and the\n * full rules table (kind → points + cap) DO NOT live here yet — the\n * server is the source of truth for emission policy and there's no\n * frontend consumer that needs to know them. Move them here when a\n * UI surface starts depending on the per-kind weights or category\n * labels.\n *\n * @module community-schema/social-score\n */\n\nexport const SOCIAL_SCORE_TIER_NAMES = [\n 'newcomer',\n 'contributor',\n 'pillar',\n 'champion',\n] as const;\nexport type SocialScoreTierName = (typeof SOCIAL_SCORE_TIER_NAMES)[number];\n\nexport interface SocialScoreTier {\n /** Stable slug used in API responses + serialised state. */\n name: SocialScoreTierName;\n /** Lowest total score that puts a user in this tier. The next\n * tier's `minScore` is the implicit upper bound. */\n minScore: number;\n /** Human-facing label rendered in badges + leaderboards. */\n label: string;\n}\n\n/**\n * Tier table — ordered ascending by `minScore`. Adding a new tier:\n * insert in score order and bump the package minor version so\n * consumers pick it up. Reordering an existing tier is a breaking\n * change (it changes which slug a given score maps to) — bump major.\n */\nexport const SOCIAL_SCORE_TIERS: readonly SocialScoreTier[] = [\n { name: 'newcomer', minScore: 0, label: 'Newcomer' },\n { name: 'contributor', minScore: 100, label: 'Contributor' },\n { name: 'pillar', minScore: 500, label: 'Pillar' },\n { name: 'champion', minScore: 2_000, label: 'Champion' },\n] as const;\n\n/**\n * Resolve a total-score number to its tier. The table is iterated in\n * ascending order; the LAST tier whose `minScore <= totalScore` wins.\n * Pure function — safe to call inline during render.\n */\nexport function tierFromSocialScore(totalScore: number): SocialScoreTier {\n let result = SOCIAL_SCORE_TIERS[0];\n for (const tier of SOCIAL_SCORE_TIERS) {\n if (totalScore >= tier.minScore) result = tier;\n }\n return result;\n}\n"]}
1
+ {"version":3,"file":"social-score.js","sourceRoot":"","sources":["../src/social-score.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,CAAU,CAAC;AAalG;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAA+B;IAC5D,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE;IACpD,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,aAAa,EAAE;IAC5D,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE;IAClD,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE;CAChD,CAAC;AAEX;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,UAAkB;IACpD,IAAI,MAAM,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC;IACnC,KAAK,MAAM,IAAI,IAAI,kBAAkB,EAAE,CAAC;QACtC,IAAI,UAAU,IAAI,IAAI,CAAC,QAAQ;YAAE,MAAM,GAAG,IAAI,CAAC;IACjD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/**\n * Social-score tier table — shared single source of truth.\n *\n * Why this lives in the schema package\n * ────────────────────────────────────\n * Backend (`reform-backend/.../config/score-rules.ts`) sorts the\n * leaderboard by tier and applies tier-based gates on a few admin\n * surfaces. Frontend (`features/social-score/lib/tiers.ts`) renders\n * the badge tone + label off the same table. A bump from `pillar:\n * 500` → `pillar: 600` on the backend without a matching frontend\n * deploy would render a \"Pillar 525\" badge on a user the backend\n * is treating as a Contributor — silent drift.\n *\n * Centralising the table here makes the schema-package version bump\n * the single shipping signal: bump community-schema, both consumers\n * pick up the new thresholds on `npm install`.\n *\n * Categories (`profile / civic / engagement / leadership`) and the\n * full rules table (kind → points + cap) DO NOT live here yet — the\n * server is the source of truth for emission policy and there's no\n * frontend consumer that needs to know them. Move them here when a\n * UI surface starts depending on the per-kind weights or category\n * labels.\n *\n * @module community-schema/social-score\n */\n\nexport const SOCIAL_SCORE_TIER_NAMES = ['newcomer', 'contributor', 'pillar', 'champion'] as const;\nexport type SocialScoreTierName = (typeof SOCIAL_SCORE_TIER_NAMES)[number];\n\nexport interface SocialScoreTier {\n /** Stable slug used in API responses + serialised state. */\n name: SocialScoreTierName;\n /** Lowest total score that puts a user in this tier. The next\n * tier's `minScore` is the implicit upper bound. */\n minScore: number;\n /** Human-facing label rendered in badges + leaderboards. */\n label: string;\n}\n\n/**\n * Tier table — ordered ascending by `minScore`. Adding a new tier:\n * insert in score order and bump the package minor version so\n * consumers pick it up. Reordering an existing tier is a breaking\n * change (it changes which slug a given score maps to) — bump major.\n */\nexport const SOCIAL_SCORE_TIERS: readonly SocialScoreTier[] = [\n { name: 'newcomer', minScore: 0, label: 'Newcomer' },\n { name: 'contributor', minScore: 100, label: 'Contributor' },\n { name: 'pillar', minScore: 500, label: 'Pillar' },\n { name: 'champion', minScore: 2_000, label: 'Champion' },\n] as const;\n\n/**\n * Resolve a total-score number to its tier. The table is iterated in\n * ascending order; the LAST tier whose `minScore <= totalScore` wins.\n * Pure function — safe to call inline during render.\n */\nexport function tierFromSocialScore(totalScore: number): SocialScoreTier {\n let result = SOCIAL_SCORE_TIERS[0];\n for (const tier of SOCIAL_SCORE_TIERS) {\n if (totalScore >= tier.minScore) result = tier;\n }\n return result;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jansathi-community-schema",
3
- "version": "0.27.0",
3
+ "version": "0.28.0",
4
4
  "description": "Shared Zod schemas + TypeScript types for the Jansathi hyperlocal community feature (feed, posts, engagement, social graph, groups, communities).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",