dating-schema 0.47.0 → 0.48.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.
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/onboarding-config.d.ts.map +1 -1
- package/dist/onboarding-config.js +46 -8
- package/dist/onboarding-config.js.map +1 -1
- package/dist/onboarding-progress.d.ts +51 -0
- package/dist/onboarding-progress.d.ts.map +1 -0
- package/dist/onboarding-progress.js +118 -0
- package/dist/onboarding-progress.js.map +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export { type AgeRange, ageRangeSchema, emptyStringToUndefined, type Gender, gen
|
|
|
11
11
|
export { getFieldMeta, getFieldOptions } from './field-helpers.js';
|
|
12
12
|
export { type BoostBody, boostBodySchema, type ComplimentBody, complimentBodySchema, type ImageLikeBody, type InteractionListQuery, type InteractionType, imageLikeBodySchema, interactionListQuerySchema, interactionTypeSchema, type RewindBody, rewindBodySchema, type SwipeBody, type SwipeResponse, swipeBodySchema, swipeResponseSchema, } from './interactions.js';
|
|
13
13
|
export { getOnboardingFieldConfig, ONBOARDING_FIELDS, ONBOARDING_STEP_GROUPS, ONBOARDING_TOTAL_MAIN_STEPS, ONBOARDING_TOTAL_SUB_STEPS, type OnboardingFieldConfig, type OnboardingStepGroup, } from './onboarding-config.js';
|
|
14
|
+
export { DATING_PROGRESS_FIELDS, DATING_PROGRESS_TOTAL_STEPS, calculateDatingStepProgress, calculateDatingOverallProgress, getNestedValue, isFieldFilled, } from './onboarding-progress.js';
|
|
14
15
|
export { type BooleanFeatureKey, type EnumFeatureKey, type ExploreAccessLevel, type FeatureDisplayItem, type FeatureKey, type FilterLevel, getMinPlanForFeature, getPlanFeatureDisplay, getPlanLimit, getPlanLimits, hasRemainingQuota, isFeatureEnabled, isPaidPlan, type NumericFeatureKey, PAID_PLANS, PLAN_FEATURE_DISPLAY, PLAN_IDS, PLAN_LIMITS, type PlanDisplayValue, type PlanId, type PlanLimits, PREMIUM_EXPLORE_CATEGORIES, PREMIUM_PLANS, renderPlanDisplayValue, type ScoreBreakdownLevel, TOP_PLANS, type WhoLikedYouLevel, } from './plan-limits.js';
|
|
15
16
|
export { type CreateProfileInput, createProfileSchema, type FullProfileData, fullProfileSchema, getCognitiveBandRank, type OnboardingFormData, onboardingFormSchema, type UpdateProfileInput, updateProfileSchema, } from './profile.js';
|
|
16
17
|
export { allFieldGroups, basics, career, cognitive, type FieldGroup, type FieldOption, familyHome, favourites, financeLegal, healthWellness, heroIdentity, interestCategories, interests, lifestyle, lookingFor, type MultiSelectField, type OptionCategory, type ProfileField, personality, relationshipIntimacy, religionCommunity, type SelectField, selfAssessment, storyPrompts, values, } from './profile-fields/index.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EACL,aAAa,EACb,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACb,cAAc,EACd,KAAK,gBAAgB,EACrB,sBAAsB,GACvB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,KAAK,QAAQ,EAEb,cAAc,EACd,sBAAsB,EACtB,KAAK,MAAM,EAEX,YAAY,EACZ,KAAK,YAAY,EACjB,kBAAkB,EAClB,KAAK,UAAU,EACf,gBAAgB,EAChB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,KAAK,UAAU,EACf,KAAK,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,KAAK,WAAW,EAChB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEnE,OAAO,EACL,KAAK,SAAS,EACd,eAAe,EACf,KAAK,cAAc,EACnB,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,mBAAmB,EACnB,0BAA0B,EAC1B,qBAAqB,EACrB,KAAK,UAAU,EACf,gBAAgB,EAChB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,eAAe,EACf,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EACjB,sBAAsB,EACtB,2BAA2B,EAC3B,0BAA0B,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,GACzB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EACL,aAAa,EACb,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACb,cAAc,EACd,KAAK,gBAAgB,EACrB,sBAAsB,GACvB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,KAAK,QAAQ,EAEb,cAAc,EACd,sBAAsB,EACtB,KAAK,MAAM,EAEX,YAAY,EACZ,KAAK,YAAY,EACjB,kBAAkB,EAClB,KAAK,UAAU,EACf,gBAAgB,EAChB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,KAAK,UAAU,EACf,KAAK,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,KAAK,WAAW,EAChB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEnE,OAAO,EACL,KAAK,SAAS,EACd,eAAe,EACf,KAAK,cAAc,EACnB,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,eA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Y,EACZ,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,UAAU,EACV,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,WAAW,EACX,oBAAoB,EACpB,iBAAiB,EACjB,KAAK,WAAW,EAChB,cAAc,EACd,YAAY,EACZ,MAAM,GACP,MAAM,2BAA2B,CAAC;AAEnC,cAAc,sBAAsB,CAAC;AAGrC,OAAO,EACL,KAAK,SAAS,EACd,eAAe,EACf,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,KAAK,sBAAsB,EAC3B,4BAA4B,EAC5B,KAAK,kBAAkB,EACvB,wBAAwB,EACxB,KAAK,MAAM,EACX,YAAY,GACb,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -18,6 +18,7 @@ export { getFieldMeta, getFieldOptions } from './field-helpers.js';
|
|
|
18
18
|
// ─── Interaction schemas ─────────────────────────────────────────────────────
|
|
19
19
|
export { boostBodySchema, complimentBodySchema, imageLikeBodySchema, interactionListQuerySchema, interactionTypeSchema, rewindBodySchema, swipeBodySchema, swipeResponseSchema, } from './interactions.js';
|
|
20
20
|
export { getOnboardingFieldConfig, ONBOARDING_FIELDS, ONBOARDING_STEP_GROUPS, ONBOARDING_TOTAL_MAIN_STEPS, ONBOARDING_TOTAL_SUB_STEPS, } from './onboarding-config.js';
|
|
21
|
+
export { DATING_PROGRESS_FIELDS, DATING_PROGRESS_TOTAL_STEPS, calculateDatingStepProgress, calculateDatingOverallProgress, getNestedValue, isFieldFilled, } from './onboarding-progress.js';
|
|
21
22
|
// ─── Plan limits ─────────────────────────────────────────────────────────────
|
|
22
23
|
export { getMinPlanForFeature, getPlanFeatureDisplay, getPlanLimit, getPlanLimits, hasRemainingQuota, isFeatureEnabled, isPaidPlan, PAID_PLANS, PLAN_FEATURE_DISPLAY, PLAN_IDS, PLAN_LIMITS, PREMIUM_EXPLORE_CATEGORIES, PREMIUM_PLANS, renderPlanDisplayValue, TOP_PLANS, } from './plan-limits.js';
|
|
23
24
|
// ─── Profile schemas ─────────────────────────────────────────────────────────
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,+EAA+E;AAC/E,OAAO,EACL,aAAa,EAGb,cAAc,EAEd,sBAAsB,GACvB,MAAM,aAAa,CAAC;AACrB,gFAAgF;AAChF,OAAO;AAEL,cAAc;AACd,cAAc,EACd,sBAAsB;AAEtB,QAAQ;AACR,YAAY,EAEZ,kBAAkB,EAElB,gBAAgB,EAIhB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EAGrB,gBAAgB,EAChB,WAAW,EAEX,iBAAiB,GAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACnE,gFAAgF;AAChF,OAAO,EAEL,eAAe,EAEf,oBAAoB,EAIpB,mBAAmB,EACnB,0BAA0B,EAC1B,qBAAqB,EAErB,gBAAgB,EAGhB,eAAe,EACf,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EACjB,sBAAsB,EACtB,2BAA2B,EAC3B,0BAA0B,GAG3B,MAAM,wBAAwB,CAAC;AAChC,gFAAgF;AAChF,OAAO,EAOL,oBAAoB,EACpB,qBAAqB,EACrB,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EAEV,UAAU,EACV,oBAAoB,EACpB,QAAQ,EACR,WAAW,EAIX,0BAA0B,EAC1B,aAAa,EACb,sBAAsB,EAEtB,SAAS,GAEV,MAAM,kBAAkB,CAAC;AAC1B,gFAAgF;AAChF,OAAO,EAEL,mBAAmB,EAEnB,iBAAiB,EACjB,oBAAoB,EAEpB,oBAAoB,EAEpB,mBAAmB,GACpB,MAAM,cAAc,CAAC;AACtB,gFAAgF;AAChF,OAAO,EACL,cAAc,EACd,MAAM,EACN,MAAM,EACN,SAAS,EAGT,UAAU,EACV,UAAU,EACV,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,UAAU,EAIV,WAAW,EACX,oBAAoB,EACpB,iBAAiB,EAEjB,cAAc,EACd,YAAY,EACZ,MAAM,GACP,MAAM,2BAA2B,CAAC;AACnC,+EAA+E;AAC/E,cAAc,sBAAsB,CAAC;AAErC,gFAAgF;AAChF,OAAO,EAEL,eAAe,EAIf,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAErB,gFAAgF;AAChF,OAAO,EAEL,4BAA4B,EAE5B,wBAAwB,EAExB,YAAY,GACb,MAAM,mBAAmB,CAAC","sourcesContent":["/**\n * dating-schema — Shared Zod schemas for the Dating feature\n *\n * Single source of truth consumed by both jansathi-frontend and reform-backend.\n * Guarantees identical validation logic and TypeScript types on both sides.\n *\n * @module dating-schema\n */\n\n// ─── Badge schemas ──────────────────────────────────────────────────────────\nexport {\n BADGE_DISPLAY,\n type BadgeDisplayInfo,\n type BadgeKey,\n badgeKeySchema,\n type UpdateBadgesBody,\n updateBadgesBodySchema,\n} from './badges.js';\n// ─── Common helpers and enums ────────────────────────────────────────────────\nexport {\n type AgeRange,\n // sub-schemas\n ageRangeSchema,\n emptyStringToUndefined,\n type Gender,\n // enums\n genderSchema,\n type InterestedIn,\n interestedInSchema,\n type LookingFor,\n lookingForSchema,\n type MaritalStatus,\n type MatchStatus,\n type MessageType,\n maritalStatusSchema,\n matchStatusSchema,\n messageTypeSchema,\n optionalTrimmedString,\n type Pagination,\n type Photo,\n paginationSchema,\n photoSchema,\n type SwipeAction,\n swipeActionSchema,\n} from './common.js';\nexport { getFieldMeta, getFieldOptions } from './field-helpers.js';\n// ─── Interaction schemas ─────────────────────────────────────────────────────\nexport {\n type BoostBody,\n boostBodySchema,\n type ComplimentBody,\n complimentBodySchema,\n type ImageLikeBody,\n type InteractionListQuery,\n type InteractionType,\n imageLikeBodySchema,\n interactionListQuerySchema,\n interactionTypeSchema,\n type RewindBody,\n rewindBodySchema,\n type SwipeBody,\n type SwipeResponse,\n swipeBodySchema,\n swipeResponseSchema,\n} from './interactions.js';\nexport {\n getOnboardingFieldConfig,\n ONBOARDING_FIELDS,\n ONBOARDING_STEP_GROUPS,\n ONBOARDING_TOTAL_MAIN_STEPS,\n ONBOARDING_TOTAL_SUB_STEPS,\n type OnboardingFieldConfig,\n type OnboardingStepGroup,\n} from './onboarding-config.js';\n// ─── Plan limits ─────────────────────────────────────────────────────────────\nexport {\n type BooleanFeatureKey,\n type EnumFeatureKey,\n type ExploreAccessLevel,\n type FeatureDisplayItem,\n type FeatureKey,\n type FilterLevel,\n getMinPlanForFeature,\n getPlanFeatureDisplay,\n getPlanLimit,\n getPlanLimits,\n hasRemainingQuota,\n isFeatureEnabled,\n isPaidPlan,\n type NumericFeatureKey,\n PAID_PLANS,\n PLAN_FEATURE_DISPLAY,\n PLAN_IDS,\n PLAN_LIMITS,\n type PlanDisplayValue,\n type PlanId,\n type PlanLimits,\n PREMIUM_EXPLORE_CATEGORIES,\n PREMIUM_PLANS,\n renderPlanDisplayValue,\n type ScoreBreakdownLevel,\n TOP_PLANS,\n type WhoLikedYouLevel,\n} from './plan-limits.js';\n// ─── Profile schemas ─────────────────────────────────────────────────────────\nexport {\n type CreateProfileInput,\n createProfileSchema,\n type FullProfileData,\n fullProfileSchema,\n getCognitiveBandRank,\n type OnboardingFormData,\n onboardingFormSchema,\n type UpdateProfileInput,\n updateProfileSchema,\n} from './profile.js';\n// ─── Profile field configs (option arrays with labels for UI rendering) ──────\nexport {\n allFieldGroups,\n basics,\n career,\n cognitive,\n type FieldGroup,\n type FieldOption,\n familyHome,\n favourites,\n financeLegal,\n healthWellness,\n heroIdentity,\n interestCategories,\n interests,\n lifestyle,\n lookingFor,\n type MultiSelectField,\n type OptionCategory,\n type ProfileField,\n personality,\n relationshipIntimacy,\n religionCommunity,\n type SelectField,\n selfAssessment,\n storyPrompts,\n values,\n} from './profile-fields/index.js';\n// ─── API Response types (entities, results, params) ─────────────────────────\nexport * from './responses/index.js';\n\n// ─── Safety schemas ──────────────────────────────────────────────────────────\nexport {\n type BlockBody,\n blockBodySchema,\n type ReportBody,\n type ReportReason,\n type ReportStatus,\n reportBodySchema,\n reportReasonSchema,\n reportStatusSchema,\n} from './safety.js';\n\n// ─── Subscription schemas ────────────────────────────────────────────────────\nexport {\n type CreateSubscriptionBody,\n createSubscriptionBodySchema,\n type SubscriptionStatus,\n subscriptionStatusSchema,\n type Tenure,\n tenureSchema,\n} from './subscription.js';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,+EAA+E;AAC/E,OAAO,EACL,aAAa,EAGb,cAAc,EAEd,sBAAsB,GACvB,MAAM,aAAa,CAAC;AACrB,gFAAgF;AAChF,OAAO;AAEL,cAAc;AACd,cAAc,EACd,sBAAsB;AAEtB,QAAQ;AACR,YAAY,EAEZ,kBAAkB,EAElB,gBAAgB,EAIhB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EAGrB,gBAAgB,EAChB,WAAW,EAEX,iBAAiB,GAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACnE,gFAAgF;AAChF,OAAO,EAEL,eAAe,EAEf,oBAAoB,EAIpB,mBAAmB,EACnB,0BAA0B,EAC1B,qBAAqB,EAErB,gBAAgB,EAGhB,eAAe,EACf,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EACjB,sBAAsB,EACtB,2BAA2B,EAC3B,0BAA0B,GAG3B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,2BAA2B,EAC3B,8BAA8B,EAC9B,cAAc,EACd,aAAa,GACd,MAAM,0BAA0B,CAAC;AAClC,gFAAgF;AAChF,OAAO,EAOL,oBAAoB,EACpB,qBAAqB,EACrB,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EAEV,UAAU,EACV,oBAAoB,EACpB,QAAQ,EACR,WAAW,EAIX,0BAA0B,EAC1B,aAAa,EACb,sBAAsB,EAEtB,SAAS,GAEV,MAAM,kBAAkB,CAAC;AAC1B,gFAAgF;AAChF,OAAO,EAEL,mBAAmB,EAEnB,iBAAiB,EACjB,oBAAoB,EAEpB,oBAAoB,EAEpB,mBAAmB,GACpB,MAAM,cAAc,CAAC;AACtB,gFAAgF;AAChF,OAAO,EACL,cAAc,EACd,MAAM,EACN,MAAM,EACN,SAAS,EAGT,UAAU,EACV,UAAU,EACV,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,UAAU,EAIV,WAAW,EACX,oBAAoB,EACpB,iBAAiB,EAEjB,cAAc,EACd,YAAY,EACZ,MAAM,GACP,MAAM,2BAA2B,CAAC;AACnC,+EAA+E;AAC/E,cAAc,sBAAsB,CAAC;AAErC,gFAAgF;AAChF,OAAO,EAEL,eAAe,EAIf,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAErB,gFAAgF;AAChF,OAAO,EAEL,4BAA4B,EAE5B,wBAAwB,EAExB,YAAY,GACb,MAAM,mBAAmB,CAAC","sourcesContent":["/**\n * dating-schema — Shared Zod schemas for the Dating feature\n *\n * Single source of truth consumed by both jansathi-frontend and reform-backend.\n * Guarantees identical validation logic and TypeScript types on both sides.\n *\n * @module dating-schema\n */\n\n// ─── Badge schemas ──────────────────────────────────────────────────────────\nexport {\n BADGE_DISPLAY,\n type BadgeDisplayInfo,\n type BadgeKey,\n badgeKeySchema,\n type UpdateBadgesBody,\n updateBadgesBodySchema,\n} from './badges.js';\n// ─── Common helpers and enums ────────────────────────────────────────────────\nexport {\n type AgeRange,\n // sub-schemas\n ageRangeSchema,\n emptyStringToUndefined,\n type Gender,\n // enums\n genderSchema,\n type InterestedIn,\n interestedInSchema,\n type LookingFor,\n lookingForSchema,\n type MaritalStatus,\n type MatchStatus,\n type MessageType,\n maritalStatusSchema,\n matchStatusSchema,\n messageTypeSchema,\n optionalTrimmedString,\n type Pagination,\n type Photo,\n paginationSchema,\n photoSchema,\n type SwipeAction,\n swipeActionSchema,\n} from './common.js';\nexport { getFieldMeta, getFieldOptions } from './field-helpers.js';\n// ─── Interaction schemas ─────────────────────────────────────────────────────\nexport {\n type BoostBody,\n boostBodySchema,\n type ComplimentBody,\n complimentBodySchema,\n type ImageLikeBody,\n type InteractionListQuery,\n type InteractionType,\n imageLikeBodySchema,\n interactionListQuerySchema,\n interactionTypeSchema,\n type RewindBody,\n rewindBodySchema,\n type SwipeBody,\n type SwipeResponse,\n swipeBodySchema,\n swipeResponseSchema,\n} from './interactions.js';\nexport {\n getOnboardingFieldConfig,\n ONBOARDING_FIELDS,\n ONBOARDING_STEP_GROUPS,\n ONBOARDING_TOTAL_MAIN_STEPS,\n ONBOARDING_TOTAL_SUB_STEPS,\n type OnboardingFieldConfig,\n type OnboardingStepGroup,\n} from './onboarding-config.js';\nexport {\n DATING_PROGRESS_FIELDS,\n DATING_PROGRESS_TOTAL_STEPS,\n calculateDatingStepProgress,\n calculateDatingOverallProgress,\n getNestedValue,\n isFieldFilled,\n} from './onboarding-progress.js';\n// ─── Plan limits ─────────────────────────────────────────────────────────────\nexport {\n type BooleanFeatureKey,\n type EnumFeatureKey,\n type ExploreAccessLevel,\n type FeatureDisplayItem,\n type FeatureKey,\n type FilterLevel,\n getMinPlanForFeature,\n getPlanFeatureDisplay,\n getPlanLimit,\n getPlanLimits,\n hasRemainingQuota,\n isFeatureEnabled,\n isPaidPlan,\n type NumericFeatureKey,\n PAID_PLANS,\n PLAN_FEATURE_DISPLAY,\n PLAN_IDS,\n PLAN_LIMITS,\n type PlanDisplayValue,\n type PlanId,\n type PlanLimits,\n PREMIUM_EXPLORE_CATEGORIES,\n PREMIUM_PLANS,\n renderPlanDisplayValue,\n type ScoreBreakdownLevel,\n TOP_PLANS,\n type WhoLikedYouLevel,\n} from './plan-limits.js';\n// ─── Profile schemas ─────────────────────────────────────────────────────────\nexport {\n type CreateProfileInput,\n createProfileSchema,\n type FullProfileData,\n fullProfileSchema,\n getCognitiveBandRank,\n type OnboardingFormData,\n onboardingFormSchema,\n type UpdateProfileInput,\n updateProfileSchema,\n} from './profile.js';\n// ─── Profile field configs (option arrays with labels for UI rendering) ──────\nexport {\n allFieldGroups,\n basics,\n career,\n cognitive,\n type FieldGroup,\n type FieldOption,\n familyHome,\n favourites,\n financeLegal,\n healthWellness,\n heroIdentity,\n interestCategories,\n interests,\n lifestyle,\n lookingFor,\n type MultiSelectField,\n type OptionCategory,\n type ProfileField,\n personality,\n relationshipIntimacy,\n religionCommunity,\n type SelectField,\n selfAssessment,\n storyPrompts,\n values,\n} from './profile-fields/index.js';\n// ─── API Response types (entities, results, params) ─────────────────────────\nexport * from './responses/index.js';\n\n// ─── Safety schemas ──────────────────────────────────────────────────────────\nexport {\n type BlockBody,\n blockBodySchema,\n type ReportBody,\n type ReportReason,\n type ReportStatus,\n reportBodySchema,\n reportReasonSchema,\n reportStatusSchema,\n} from './safety.js';\n\n// ─── Subscription schemas ────────────────────────────────────────────────────\nexport {\n type CreateSubscriptionBody,\n createSubscriptionBodySchema,\n type SubscriptionStatus,\n subscriptionStatusSchema,\n type Tenure,\n tenureSchema,\n} from './subscription.js';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onboarding-config.d.ts","sourceRoot":"","sources":["../src/onboarding-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,MAAM,WAAW,qBAAqB;IACpC,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,cAAc,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,+CAA+C;IAC/C,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,4CAA4C;AAC5C,MAAM,WAAW,mBAAmB;IAClC,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAID,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CA+SnE,CAAC;AAIF,eAAO,MAAM,sBAAsB,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"onboarding-config.d.ts","sourceRoot":"","sources":["../src/onboarding-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,MAAM,WAAW,qBAAqB;IACpC,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,cAAc,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,+CAA+C;IAC/C,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,4CAA4C;AAC5C,MAAM,WAAW,mBAAmB;IAClC,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAID,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CA+SnE,CAAC;AAIF,eAAO,MAAM,sBAAsB,EAAE,mBAAmB,EAmDvD,CAAC;AAIF,gDAAgD;AAChD,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC3B,qBAAqB,GAAG,SAAS,CAGnC;AAED,kCAAkC;AAClC,eAAO,MAAM,2BAA2B,QAAgC,CAAC;AAEzE,uDAAuD;AACvD,eAAO,MAAM,0BAA0B,QAGtC,CAAC"}
|
|
@@ -310,18 +310,56 @@ export const ONBOARDING_FIELDS = {
|
|
|
310
310
|
};
|
|
311
311
|
// ─── Step grouping ──────────────────────────────────────────────────────────
|
|
312
312
|
export const ONBOARDING_STEP_GROUPS = [
|
|
313
|
-
{
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
313
|
+
{
|
|
314
|
+
label: 'steps.basics',
|
|
315
|
+
icon: 'User',
|
|
316
|
+
fields: ['displayName', 'dateOfBirth', 'gender', 'phoneNumbers', 'pronouns'],
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
label: 'steps.relationship',
|
|
320
|
+
icon: 'Heart',
|
|
321
|
+
fields: [
|
|
322
|
+
'relationshipStatus',
|
|
323
|
+
'relationshipIntent',
|
|
324
|
+
'sexualOrientation',
|
|
325
|
+
'preferredGenders',
|
|
326
|
+
'relationshipStructure',
|
|
327
|
+
],
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
label: 'steps.mindEducation',
|
|
331
|
+
icon: 'Brain',
|
|
332
|
+
fields: ['educationLevel', 'institutionTier', 'cognitiveBand', 'politicalOrientation'],
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
label: 'steps.careerFinance',
|
|
336
|
+
icon: 'Briefcase',
|
|
337
|
+
fields: ['profession', 'careerStage', 'incomeRange'],
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
label: 'steps.appearance',
|
|
341
|
+
icon: 'Ruler',
|
|
342
|
+
fields: ['height', 'weight', 'bodyBuild', 'complexion'],
|
|
343
|
+
},
|
|
318
344
|
{ label: 'steps.photos', icon: 'Camera', fields: ['photos'] },
|
|
319
|
-
{
|
|
345
|
+
{
|
|
346
|
+
label: 'steps.yourRoots',
|
|
347
|
+
icon: 'TreePine',
|
|
348
|
+
fields: ['hometown', 'familyReligion', 'personalReligion', 'motherTongue', 'familyValues'],
|
|
349
|
+
},
|
|
320
350
|
{ label: 'steps.interests', icon: 'Sparkles', fields: ['hobbies'] },
|
|
321
351
|
{ label: 'steps.habits', icon: 'Cigarette', fields: ['diet', 'smoking', 'alcohol'] },
|
|
322
352
|
{ label: 'steps.bio', icon: 'PenLine', fields: ['bio', 'myStory'] },
|
|
323
|
-
{
|
|
324
|
-
|
|
353
|
+
{
|
|
354
|
+
label: 'steps.favourites',
|
|
355
|
+
icon: 'Star',
|
|
356
|
+
fields: ['favouriteBooks', 'favouriteShows', 'idols'],
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
label: 'steps.personality',
|
|
360
|
+
icon: 'Puzzle',
|
|
361
|
+
fields: ['mbtiType', 'attachmentStyle', 'loveLanguage', 'oceanScores', 'conflictStyle'],
|
|
362
|
+
},
|
|
325
363
|
];
|
|
326
364
|
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
|
327
365
|
/** Get onboarding config for a single field. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onboarding-config.js","sourceRoot":"","sources":["../src/onboarding-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA2BH,+EAA+E;AAE/E,MAAM,CAAC,MAAM,iBAAiB,GAA0C;IACtE,uBAAuB;IACvB,WAAW,EAAE;QACX,KAAK,EAAE,mBAAmB;QAC1B,QAAQ,EAAE,sBAAsB;QAChC,cAAc,EAAE,qBAAqB;QACrC,eAAe,EAAE,sBAAsB;QACvC,QAAQ,EAAE,IAAI;KACf;IACD,WAAW,EAAE;QACX,KAAK,EAAE,mBAA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E,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE;IACnE,EAAE,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE;IAClG,EAAE,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,UAAU,EAAE,iBAAiB,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,CAAC,EAAE;CACxI,CAAC;AAEF,gFAAgF;AAEhF,gDAAgD;AAChD,MAAM,UAAU,wBAAwB,CACtC,QAA4B;IAE5B,IAAI,CAAC,QAAQ;QAAE,OAAO,SAAS,CAAC;IAChC,OAAO,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AACrC,CAAC;AAED,kCAAkC;AAClC,MAAM,CAAC,MAAM,2BAA2B,GAAG,sBAAsB,CAAC,MAAM,CAAC;AAEzE,uDAAuD;AACvD,MAAM,CAAC,MAAM,0BAA0B,GAAG,sBAAsB,CAAC,MAAM,CACrE,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC,MAAM,EACjC,CAAC,CACF,CAAC","sourcesContent":["/**\n * Onboarding Field Configuration\n * ================================\n * Single source of truth for all per-field onboarding metadata.\n * Both frontend and backend import this.\n *\n * IMPORTANT: All string properties (title, subtitle, successMessage, visibilityLabel,\n * step group label) are i18n KEYS, not display text. The frontend resolves them via\n * useTranslations(\"datingOnboarding\") → t(config.title).\n *\n * Translation files:\n * - messages/en/dating-onboarding.json (English)\n * - messages/hi/dating-onboarding.json (Hindi)\n *\n * @module dating-schema/onboarding-config\n */\n\n// ─── Types ───────────────────────────────────────────────────────────────────\n\nexport interface OnboardingFieldConfig {\n /** i18n key for the question heading (resolved via t(title)) */\n title: string;\n /** i18n key for help text below the heading */\n subtitle?: string;\n /** i18n key for toast message on successful save */\n successMessage: string;\n /** i18n key for \"Show on profile\" toggle label (null = no toggle) */\n visibilityLabel?: string;\n /** Whether the field is required to proceed */\n required: boolean;\n}\n\n/** Step grouping for the onboarding flow */\nexport interface OnboardingStepGroup {\n /** i18n key for section label */\n label: string;\n /** Icon name from lucide-react (resolved at runtime by frontend) */\n icon: string;\n /** Ordered list of field keys in this section */\n fields: string[];\n}\n\n// ─── Per-field onboarding metadata ──────────────────────────────────────────\n\nexport const ONBOARDING_FIELDS: Record<string, OnboardingFieldConfig> = {\n // ── Step 1: Basics ──\n displayName: {\n title: 'displayName.title',\n subtitle: 'displayName.subtitle',\n successMessage: 'displayName.success',\n visibilityLabel: 'common.showOnProfile',\n required: true,\n },\n dateOfBirth: {\n title: 'dateOfBirth.title',\n subtitle: 'dateOfBirth.subtitle',\n successMessage: 'dateOfBirth.success',\n visibilityLabel: 'dateOfBirth.visibility',\n required: true,\n },\n gender: {\n title: 'gender.title',\n subtitle: 'gender.subtitle',\n successMessage: 'gender.success',\n visibilityLabel: 'gender.visibility',\n required: true,\n },\n phoneNumbers: {\n title: 'phoneNumbers.title',\n subtitle: 'phoneNumbers.subtitle',\n successMessage: 'phoneNumbers.success',\n required: true,\n },\n pronouns: {\n title: 'pronouns.title',\n subtitle: 'pronouns.subtitle',\n successMessage: 'pronouns.success',\n visibilityLabel: 'pronouns.visibility',\n required: true,\n },\n\n // ── Step 2: Relationship ──\n relationshipStatus: {\n title: 'relationshipStatus.title',\n subtitle: 'relationshipStatus.subtitle',\n successMessage: 'relationshipStatus.success',\n visibilityLabel: 'common.showOnProfile',\n required: true,\n },\n relationshipIntent: {\n title: 'relationshipIntent.title',\n subtitle: 'relationshipIntent.subtitle',\n successMessage: 'relationshipIntent.success',\n visibilityLabel: 'common.showOnProfile',\n required: true,\n },\n sexualOrientation: {\n title: 'sexualOrientation.title',\n subtitle: 'sexualOrientation.subtitle',\n successMessage: 'sexualOrientation.success',\n visibilityLabel: 'sexualOrientation.visibility',\n required: false,\n },\n preferredGenders: {\n title: 'preferredGenders.title',\n subtitle: 'preferredGenders.subtitle',\n successMessage: 'preferredGenders.success',\n visibilityLabel: 'common.showOnProfile',\n required: true,\n },\n relationshipStructure: {\n title: 'relationshipStructure.title',\n subtitle: 'relationshipStructure.subtitle',\n successMessage: 'relationshipStructure.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n\n // ── Step 3: Mind & Education ──\n educationLevel: {\n title: 'educationLevel.title',\n subtitle: 'educationLevel.subtitle',\n successMessage: 'educationLevel.success',\n visibilityLabel: 'educationLevel.visibility',\n required: false,\n },\n institutionTier: {\n title: 'institutionTier.title',\n subtitle: 'institutionTier.subtitle',\n successMessage: 'institutionTier.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n cognitiveBand: {\n title: 'cognitiveBand.title',\n subtitle: 'cognitiveBand.subtitle',\n successMessage: 'cognitiveBand.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n politicalOrientation: {\n title: 'politicalOrientation.title',\n subtitle: 'politicalOrientation.subtitle',\n successMessage: 'politicalOrientation.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n\n // ── Step 4: Career & Finance ──\n profession: {\n title: 'profession.title',\n subtitle: 'profession.subtitle',\n successMessage: 'profession.success',\n visibilityLabel: 'profession.visibility',\n required: false,\n },\n careerStage: {\n title: 'careerStage.title',\n subtitle: 'careerStage.subtitle',\n successMessage: 'careerStage.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n incomeRange: {\n title: 'incomeRange.title',\n subtitle: 'incomeRange.subtitle',\n successMessage: 'incomeRange.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n\n // ── Step 5: Appearance ──\n height: {\n title: 'height.title',\n subtitle: 'height.subtitle',\n successMessage: 'height.success',\n visibilityLabel: 'height.visibility',\n required: false,\n },\n weight: {\n title: 'weight.title',\n subtitle: 'weight.subtitle',\n successMessage: 'weight.success',\n visibilityLabel: 'weight.visibility',\n required: false,\n },\n bodyBuild: {\n title: 'bodyBuild.title',\n subtitle: 'bodyBuild.subtitle',\n successMessage: 'bodyBuild.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n complexion: {\n title: 'complexion.title',\n subtitle: 'complexion.subtitle',\n successMessage: 'complexion.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n\n // ── Step 6: Photos ──\n photos: {\n title: 'photos.title',\n subtitle: 'photos.subtitle',\n successMessage: 'photos.success',\n required: true,\n },\n\n // ── Step 7: Your Roots ──\n hometown: {\n title: 'hometown.title',\n subtitle: 'hometown.subtitle',\n successMessage: 'hometown.success',\n visibilityLabel: 'common.showOnProfile',\n required: true,\n },\n familyReligion: {\n title: 'familyReligion.title',\n subtitle: 'familyReligion.subtitle',\n successMessage: 'familyReligion.success',\n visibilityLabel: 'common.showOnProfile',\n required: true,\n },\n personalReligion: {\n title: 'personalReligion.title',\n subtitle: 'personalReligion.subtitle',\n successMessage: 'personalReligion.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n motherTongue: {\n title: 'motherTongue.title',\n subtitle: 'motherTongue.subtitle',\n successMessage: 'motherTongue.success',\n visibilityLabel: 'common.showOnProfile',\n required: true,\n },\n familyValues: {\n title: 'familyValues.title',\n subtitle: 'familyValues.subtitle',\n successMessage: 'familyValues.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n\n // ── Step 8: Interests ──\n hobbies: {\n title: 'hobbies.title',\n subtitle: 'hobbies.subtitle',\n successMessage: 'hobbies.success',\n required: false,\n },\n\n // ── Step 9: Habits ──\n diet: {\n title: 'diet.title',\n subtitle: 'diet.subtitle',\n successMessage: 'diet.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n smoking: {\n title: 'smoking.title',\n subtitle: 'smoking.subtitle',\n successMessage: 'smoking.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n alcohol: {\n title: 'alcohol.title',\n subtitle: 'alcohol.subtitle',\n successMessage: 'alcohol.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n\n // ── Step 10: Bio ──\n bio: {\n title: 'bio.title',\n subtitle: 'bio.subtitle',\n successMessage: 'bio.success',\n visibilityLabel: 'common.showOnProfile',\n required: true,\n },\n myStory: {\n title: 'myStory.title',\n subtitle: 'myStory.subtitle',\n successMessage: 'myStory.success',\n required: false,\n },\n\n // ── Step 11: Favourites ──\n favouriteBooks: {\n title: 'favouriteBooks.title',\n subtitle: 'favouriteBooks.subtitle',\n successMessage: 'favouriteBooks.success',\n required: false,\n },\n favouriteShows: {\n title: 'favouriteShows.title',\n subtitle: 'favouriteShows.subtitle',\n successMessage: 'favouriteShows.success',\n required: false,\n },\n idols: {\n title: 'idols.title',\n subtitle: 'idols.subtitle',\n successMessage: 'idols.success',\n required: false,\n },\n\n // ── Step 12: Personality ──\n mbtiType: {\n title: 'mbtiType.title',\n subtitle: 'mbtiType.subtitle',\n successMessage: 'mbtiType.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n attachmentStyle: {\n title: 'attachmentStyle.title',\n subtitle: 'attachmentStyle.subtitle',\n successMessage: 'attachmentStyle.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n loveLanguage: {\n title: 'loveLanguage.title',\n subtitle: 'loveLanguage.subtitle',\n successMessage: 'loveLanguage.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n oceanScores: {\n title: 'oceanScores.title',\n subtitle: 'oceanScores.subtitle',\n successMessage: 'oceanScores.success',\n required: false,\n },\n conflictStyle: {\n title: 'conflictStyle.title',\n subtitle: 'conflictStyle.subtitle',\n successMessage: 'conflictStyle.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n};\n\n// ─── Step grouping ──────────────────────────────────────────────────────────\n\nexport const ONBOARDING_STEP_GROUPS: OnboardingStepGroup[] = [\n { label: 'steps.basics', icon: 'User', fields: ['displayName', 'dateOfBirth', 'gender', 'phoneNumbers', 'pronouns'] },\n { label: 'steps.relationship', icon: 'Heart', fields: ['relationshipStatus', 'relationshipIntent', 'sexualOrientation', 'preferredGenders', 'relationshipStructure'] },\n { label: 'steps.mindEducation', icon: 'Brain', fields: ['educationLevel', 'institutionTier', 'cognitiveBand', 'politicalOrientation'] },\n { label: 'steps.careerFinance', icon: 'Briefcase', fields: ['profession', 'careerStage', 'incomeRange'] },\n { label: 'steps.appearance', icon: 'Ruler', fields: ['height', 'weight', 'bodyBuild', 'complexion'] },\n { label: 'steps.photos', icon: 'Camera', fields: ['photos'] },\n { label: 'steps.yourRoots', icon: 'TreePine', fields: ['hometown', 'familyReligion', 'personalReligion', 'motherTongue', 'familyValues'] },\n { label: 'steps.interests', icon: 'Sparkles', fields: ['hobbies'] },\n { label: 'steps.habits', icon: 'Cigarette', fields: ['diet', 'smoking', 'alcohol'] },\n { label: 'steps.bio', icon: 'PenLine', fields: ['bio', 'myStory'] },\n { label: 'steps.favourites', icon: 'Star', fields: ['favouriteBooks', 'favouriteShows', 'idols'] },\n { label: 'steps.personality', icon: 'Puzzle', fields: ['mbtiType', 'attachmentStyle', 'loveLanguage', 'oceanScores', 'conflictStyle'] },\n];\n\n// ─── Helpers ─────────────────────────────────────────────────────────────────\n\n/** Get onboarding config for a single field. */\nexport function getOnboardingFieldConfig(\n fieldKey: string | undefined,\n): OnboardingFieldConfig | undefined {\n if (!fieldKey) return undefined;\n return ONBOARDING_FIELDS[fieldKey];\n}\n\n/** Total number of main steps. */\nexport const ONBOARDING_TOTAL_MAIN_STEPS = ONBOARDING_STEP_GROUPS.length;\n\n/** Total number of sub-steps across all main steps. */\nexport const ONBOARDING_TOTAL_SUB_STEPS = ONBOARDING_STEP_GROUPS.reduce(\n (sum, g) => sum + g.fields.length,\n 0,\n);\n"]}
|
|
1
|
+
{"version":3,"file":"onboarding-config.js","sourceRoot":"","sources":["../src/onboarding-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA2BH,+EAA+E;AAE/E,MAAM,CAAC,MAAM,i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AAE,UAAU,EAAE,MAAM,EAAE,CAAC,SAAS,CAAC,EAAE;IACnE,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC,EAAE;IACpF,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE;IACnE;QACE,KAAK,EAAE,kBAAkB;QACzB,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,CAAC;KACtD;IACD;QACE,KAAK,EAAE,mBAAmB;QAC1B,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,CAAC,UAAU,EAAE,iBAAiB,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,CAAC;KACxF;CACF,CAAC;AAEF,gFAAgF;AAEhF,gDAAgD;AAChD,MAAM,UAAU,wBAAwB,CACtC,QAA4B;IAE5B,IAAI,CAAC,QAAQ;QAAE,OAAO,SAAS,CAAC;IAChC,OAAO,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AACrC,CAAC;AAED,kCAAkC;AAClC,MAAM,CAAC,MAAM,2BAA2B,GAAG,sBAAsB,CAAC,MAAM,CAAC;AAEzE,uDAAuD;AACvD,MAAM,CAAC,MAAM,0BAA0B,GAAG,sBAAsB,CAAC,MAAM,CACrE,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC,MAAM,EACjC,CAAC,CACF,CAAC","sourcesContent":["/**\n * Onboarding Field Configuration\n * ================================\n * Single source of truth for all per-field onboarding metadata.\n * Both frontend and backend import this.\n *\n * IMPORTANT: All string properties (title, subtitle, successMessage, visibilityLabel,\n * step group label) are i18n KEYS, not display text. The frontend resolves them via\n * useTranslations(\"datingOnboarding\") → t(config.title).\n *\n * Translation files:\n * - messages/en/dating-onboarding.json (English)\n * - messages/hi/dating-onboarding.json (Hindi)\n *\n * @module dating-schema/onboarding-config\n */\n\n// ─── Types ───────────────────────────────────────────────────────────────────\n\nexport interface OnboardingFieldConfig {\n /** i18n key for the question heading (resolved via t(title)) */\n title: string;\n /** i18n key for help text below the heading */\n subtitle?: string;\n /** i18n key for toast message on successful save */\n successMessage: string;\n /** i18n key for \"Show on profile\" toggle label (null = no toggle) */\n visibilityLabel?: string;\n /** Whether the field is required to proceed */\n required: boolean;\n}\n\n/** Step grouping for the onboarding flow */\nexport interface OnboardingStepGroup {\n /** i18n key for section label */\n label: string;\n /** Icon name from lucide-react (resolved at runtime by frontend) */\n icon: string;\n /** Ordered list of field keys in this section */\n fields: string[];\n}\n\n// ─── Per-field onboarding metadata ──────────────────────────────────────────\n\nexport const ONBOARDING_FIELDS: Record<string, OnboardingFieldConfig> = {\n // ── Step 1: Basics ──\n displayName: {\n title: 'displayName.title',\n subtitle: 'displayName.subtitle',\n successMessage: 'displayName.success',\n visibilityLabel: 'common.showOnProfile',\n required: true,\n },\n dateOfBirth: {\n title: 'dateOfBirth.title',\n subtitle: 'dateOfBirth.subtitle',\n successMessage: 'dateOfBirth.success',\n visibilityLabel: 'dateOfBirth.visibility',\n required: true,\n },\n gender: {\n title: 'gender.title',\n subtitle: 'gender.subtitle',\n successMessage: 'gender.success',\n visibilityLabel: 'gender.visibility',\n required: true,\n },\n phoneNumbers: {\n title: 'phoneNumbers.title',\n subtitle: 'phoneNumbers.subtitle',\n successMessage: 'phoneNumbers.success',\n required: true,\n },\n pronouns: {\n title: 'pronouns.title',\n subtitle: 'pronouns.subtitle',\n successMessage: 'pronouns.success',\n visibilityLabel: 'pronouns.visibility',\n required: true,\n },\n\n // ── Step 2: Relationship ──\n relationshipStatus: {\n title: 'relationshipStatus.title',\n subtitle: 'relationshipStatus.subtitle',\n successMessage: 'relationshipStatus.success',\n visibilityLabel: 'common.showOnProfile',\n required: true,\n },\n relationshipIntent: {\n title: 'relationshipIntent.title',\n subtitle: 'relationshipIntent.subtitle',\n successMessage: 'relationshipIntent.success',\n visibilityLabel: 'common.showOnProfile',\n required: true,\n },\n sexualOrientation: {\n title: 'sexualOrientation.title',\n subtitle: 'sexualOrientation.subtitle',\n successMessage: 'sexualOrientation.success',\n visibilityLabel: 'sexualOrientation.visibility',\n required: false,\n },\n preferredGenders: {\n title: 'preferredGenders.title',\n subtitle: 'preferredGenders.subtitle',\n successMessage: 'preferredGenders.success',\n visibilityLabel: 'common.showOnProfile',\n required: true,\n },\n relationshipStructure: {\n title: 'relationshipStructure.title',\n subtitle: 'relationshipStructure.subtitle',\n successMessage: 'relationshipStructure.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n\n // ── Step 3: Mind & Education ──\n educationLevel: {\n title: 'educationLevel.title',\n subtitle: 'educationLevel.subtitle',\n successMessage: 'educationLevel.success',\n visibilityLabel: 'educationLevel.visibility',\n required: false,\n },\n institutionTier: {\n title: 'institutionTier.title',\n subtitle: 'institutionTier.subtitle',\n successMessage: 'institutionTier.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n cognitiveBand: {\n title: 'cognitiveBand.title',\n subtitle: 'cognitiveBand.subtitle',\n successMessage: 'cognitiveBand.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n politicalOrientation: {\n title: 'politicalOrientation.title',\n subtitle: 'politicalOrientation.subtitle',\n successMessage: 'politicalOrientation.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n\n // ── Step 4: Career & Finance ──\n profession: {\n title: 'profession.title',\n subtitle: 'profession.subtitle',\n successMessage: 'profession.success',\n visibilityLabel: 'profession.visibility',\n required: false,\n },\n careerStage: {\n title: 'careerStage.title',\n subtitle: 'careerStage.subtitle',\n successMessage: 'careerStage.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n incomeRange: {\n title: 'incomeRange.title',\n subtitle: 'incomeRange.subtitle',\n successMessage: 'incomeRange.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n\n // ── Step 5: Appearance ──\n height: {\n title: 'height.title',\n subtitle: 'height.subtitle',\n successMessage: 'height.success',\n visibilityLabel: 'height.visibility',\n required: false,\n },\n weight: {\n title: 'weight.title',\n subtitle: 'weight.subtitle',\n successMessage: 'weight.success',\n visibilityLabel: 'weight.visibility',\n required: false,\n },\n bodyBuild: {\n title: 'bodyBuild.title',\n subtitle: 'bodyBuild.subtitle',\n successMessage: 'bodyBuild.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n complexion: {\n title: 'complexion.title',\n subtitle: 'complexion.subtitle',\n successMessage: 'complexion.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n\n // ── Step 6: Photos ──\n photos: {\n title: 'photos.title',\n subtitle: 'photos.subtitle',\n successMessage: 'photos.success',\n required: true,\n },\n\n // ── Step 7: Your Roots ──\n hometown: {\n title: 'hometown.title',\n subtitle: 'hometown.subtitle',\n successMessage: 'hometown.success',\n visibilityLabel: 'common.showOnProfile',\n required: true,\n },\n familyReligion: {\n title: 'familyReligion.title',\n subtitle: 'familyReligion.subtitle',\n successMessage: 'familyReligion.success',\n visibilityLabel: 'common.showOnProfile',\n required: true,\n },\n personalReligion: {\n title: 'personalReligion.title',\n subtitle: 'personalReligion.subtitle',\n successMessage: 'personalReligion.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n motherTongue: {\n title: 'motherTongue.title',\n subtitle: 'motherTongue.subtitle',\n successMessage: 'motherTongue.success',\n visibilityLabel: 'common.showOnProfile',\n required: true,\n },\n familyValues: {\n title: 'familyValues.title',\n subtitle: 'familyValues.subtitle',\n successMessage: 'familyValues.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n\n // ── Step 8: Interests ──\n hobbies: {\n title: 'hobbies.title',\n subtitle: 'hobbies.subtitle',\n successMessage: 'hobbies.success',\n required: false,\n },\n\n // ── Step 9: Habits ──\n diet: {\n title: 'diet.title',\n subtitle: 'diet.subtitle',\n successMessage: 'diet.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n smoking: {\n title: 'smoking.title',\n subtitle: 'smoking.subtitle',\n successMessage: 'smoking.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n alcohol: {\n title: 'alcohol.title',\n subtitle: 'alcohol.subtitle',\n successMessage: 'alcohol.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n\n // ── Step 10: Bio ──\n bio: {\n title: 'bio.title',\n subtitle: 'bio.subtitle',\n successMessage: 'bio.success',\n visibilityLabel: 'common.showOnProfile',\n required: true,\n },\n myStory: {\n title: 'myStory.title',\n subtitle: 'myStory.subtitle',\n successMessage: 'myStory.success',\n required: false,\n },\n\n // ── Step 11: Favourites ──\n favouriteBooks: {\n title: 'favouriteBooks.title',\n subtitle: 'favouriteBooks.subtitle',\n successMessage: 'favouriteBooks.success',\n required: false,\n },\n favouriteShows: {\n title: 'favouriteShows.title',\n subtitle: 'favouriteShows.subtitle',\n successMessage: 'favouriteShows.success',\n required: false,\n },\n idols: {\n title: 'idols.title',\n subtitle: 'idols.subtitle',\n successMessage: 'idols.success',\n required: false,\n },\n\n // ── Step 12: Personality ──\n mbtiType: {\n title: 'mbtiType.title',\n subtitle: 'mbtiType.subtitle',\n successMessage: 'mbtiType.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n attachmentStyle: {\n title: 'attachmentStyle.title',\n subtitle: 'attachmentStyle.subtitle',\n successMessage: 'attachmentStyle.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n loveLanguage: {\n title: 'loveLanguage.title',\n subtitle: 'loveLanguage.subtitle',\n successMessage: 'loveLanguage.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n oceanScores: {\n title: 'oceanScores.title',\n subtitle: 'oceanScores.subtitle',\n successMessage: 'oceanScores.success',\n required: false,\n },\n conflictStyle: {\n title: 'conflictStyle.title',\n subtitle: 'conflictStyle.subtitle',\n successMessage: 'conflictStyle.success',\n visibilityLabel: 'common.showOnProfile',\n required: false,\n },\n};\n\n// ─── Step grouping ──────────────────────────────────────────────────────────\n\nexport const ONBOARDING_STEP_GROUPS: OnboardingStepGroup[] = [\n {\n label: 'steps.basics',\n icon: 'User',\n fields: ['displayName', 'dateOfBirth', 'gender', 'phoneNumbers', 'pronouns'],\n },\n {\n label: 'steps.relationship',\n icon: 'Heart',\n fields: [\n 'relationshipStatus',\n 'relationshipIntent',\n 'sexualOrientation',\n 'preferredGenders',\n 'relationshipStructure',\n ],\n },\n {\n label: 'steps.mindEducation',\n icon: 'Brain',\n fields: ['educationLevel', 'institutionTier', 'cognitiveBand', 'politicalOrientation'],\n },\n {\n label: 'steps.careerFinance',\n icon: 'Briefcase',\n fields: ['profession', 'careerStage', 'incomeRange'],\n },\n {\n label: 'steps.appearance',\n icon: 'Ruler',\n fields: ['height', 'weight', 'bodyBuild', 'complexion'],\n },\n { label: 'steps.photos', icon: 'Camera', fields: ['photos'] },\n {\n label: 'steps.yourRoots',\n icon: 'TreePine',\n fields: ['hometown', 'familyReligion', 'personalReligion', 'motherTongue', 'familyValues'],\n },\n { label: 'steps.interests', icon: 'Sparkles', fields: ['hobbies'] },\n { label: 'steps.habits', icon: 'Cigarette', fields: ['diet', 'smoking', 'alcohol'] },\n { label: 'steps.bio', icon: 'PenLine', fields: ['bio', 'myStory'] },\n {\n label: 'steps.favourites',\n icon: 'Star',\n fields: ['favouriteBooks', 'favouriteShows', 'idols'],\n },\n {\n label: 'steps.personality',\n icon: 'Puzzle',\n fields: ['mbtiType', 'attachmentStyle', 'loveLanguage', 'oceanScores', 'conflictStyle'],\n },\n];\n\n// ─── Helpers ─────────────────────────────────────────────────────────────────\n\n/** Get onboarding config for a single field. */\nexport function getOnboardingFieldConfig(\n fieldKey: string | undefined,\n): OnboardingFieldConfig | undefined {\n if (!fieldKey) return undefined;\n return ONBOARDING_FIELDS[fieldKey];\n}\n\n/** Total number of main steps. */\nexport const ONBOARDING_TOTAL_MAIN_STEPS = ONBOARDING_STEP_GROUPS.length;\n\n/** Total number of sub-steps across all main steps. */\nexport const ONBOARDING_TOTAL_SUB_STEPS = ONBOARDING_STEP_GROUPS.reduce(\n (sum, g) => sum + g.fields.length,\n 0,\n);\n"]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dating Onboarding Progress — Shared between frontend and backend.
|
|
3
|
+
*
|
|
4
|
+
* Maps each onboarding step to the DB fields that count toward progress.
|
|
5
|
+
* Used by frontend (stepper UI: "3/5 filled") and backend (API progress response).
|
|
6
|
+
*
|
|
7
|
+
* Keys are 0-indexed step numbers matching ONBOARDING_STEP_GROUPS order.
|
|
8
|
+
* Values are DB field paths on the DatingProfile document.
|
|
9
|
+
*
|
|
10
|
+
* @module dating-schema/onboarding-progress
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Per-step progress fields.
|
|
14
|
+
* Each key is a step index (0-11), each value is the list of DB field paths
|
|
15
|
+
* that count toward that step's completion.
|
|
16
|
+
*/
|
|
17
|
+
export declare const DATING_PROGRESS_FIELDS: Record<number, readonly string[]>;
|
|
18
|
+
/** Total number of steps with progress tracking. */
|
|
19
|
+
export declare const DATING_PROGRESS_TOTAL_STEPS: number;
|
|
20
|
+
/**
|
|
21
|
+
* Navigate nested object properties using dot-path notation.
|
|
22
|
+
* e.g., getNestedValue(profile, "guardianContact.phoneNumber")
|
|
23
|
+
*/
|
|
24
|
+
export declare function getNestedValue(obj: Record<string, unknown>, path: string): unknown;
|
|
25
|
+
/** Determine if a field value counts as "filled" for progress. */
|
|
26
|
+
export declare function isFieldFilled(value: unknown): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Calculate progress for a single dating onboarding step.
|
|
29
|
+
* Returns { filled, total } counts.
|
|
30
|
+
*
|
|
31
|
+
* @param stepIndex - 0-indexed step number (0-11)
|
|
32
|
+
* @param profile - Dating profile document (or partial record)
|
|
33
|
+
*/
|
|
34
|
+
export declare function calculateDatingStepProgress(stepIndex: number, profile: Record<string, unknown> | undefined | null): {
|
|
35
|
+
filled: number;
|
|
36
|
+
total: number;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Calculate overall dating onboarding progress across all steps.
|
|
40
|
+
* Returns per-step breakdowns + overall percentage.
|
|
41
|
+
*/
|
|
42
|
+
export declare function calculateDatingOverallProgress(profile: Record<string, unknown> | undefined | null): {
|
|
43
|
+
steps: {
|
|
44
|
+
filled: number;
|
|
45
|
+
total: number;
|
|
46
|
+
}[];
|
|
47
|
+
totalFilled: number;
|
|
48
|
+
totalFields: number;
|
|
49
|
+
percent: number;
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=onboarding-progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onboarding-progress.d.ts","sourceRoot":"","sources":["../src/onboarding-progress.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAyBpE,CAAC;AAEF,oDAAoD;AACpD,eAAO,MAAM,2BAA2B,QAA6C,CAAC;AAEtF;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAQlF;AAED,kEAAkE;AAClE,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAarD;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,IAAI,GAClD;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAcnC;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,IAAI,GAClD;IACD,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB,CAcA"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dating Onboarding Progress — Shared between frontend and backend.
|
|
3
|
+
*
|
|
4
|
+
* Maps each onboarding step to the DB fields that count toward progress.
|
|
5
|
+
* Used by frontend (stepper UI: "3/5 filled") and backend (API progress response).
|
|
6
|
+
*
|
|
7
|
+
* Keys are 0-indexed step numbers matching ONBOARDING_STEP_GROUPS order.
|
|
8
|
+
* Values are DB field paths on the DatingProfile document.
|
|
9
|
+
*
|
|
10
|
+
* @module dating-schema/onboarding-progress
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Per-step progress fields.
|
|
14
|
+
* Each key is a step index (0-11), each value is the list of DB field paths
|
|
15
|
+
* that count toward that step's completion.
|
|
16
|
+
*/
|
|
17
|
+
export const DATING_PROGRESS_FIELDS = {
|
|
18
|
+
// Step 0: Basics
|
|
19
|
+
0: ['displayName', 'dateOfBirth', 'gender', 'phoneNumber', 'pronouns'],
|
|
20
|
+
// Step 1: Relationship
|
|
21
|
+
1: ['relationshipStatus', 'relationshipIntent', 'sexualOrientation', 'preferredGenders', 'relationshipStructure'],
|
|
22
|
+
// Step 2: Mind & Education
|
|
23
|
+
2: ['educationLevel', 'institutionTier', 'cognitiveBand', 'politicalOrientation'],
|
|
24
|
+
// Step 3: Career & Finance
|
|
25
|
+
3: ['profession', 'careerStage', 'incomeRange'],
|
|
26
|
+
// Step 4: Appearance
|
|
27
|
+
4: ['height', 'weight', 'bodyBuild', 'complexion'],
|
|
28
|
+
// Step 5: Photos
|
|
29
|
+
5: ['photos'],
|
|
30
|
+
// Step 6: Your Roots
|
|
31
|
+
6: ['hometownState', 'hometownDistrict', 'familyReligion', 'personalReligion', 'motherTongue', 'familyValues'],
|
|
32
|
+
// Step 7: Interests
|
|
33
|
+
7: ['hobbies'],
|
|
34
|
+
// Step 8: Habits
|
|
35
|
+
8: ['diet', 'smoking', 'alcohol'],
|
|
36
|
+
// Step 9: Bio
|
|
37
|
+
9: ['bio', 'myStory'],
|
|
38
|
+
// Step 10: Favourites
|
|
39
|
+
10: ['favouriteBooks', 'favouriteShows', 'idols'],
|
|
40
|
+
// Step 11: Personality & Mindset
|
|
41
|
+
11: ['mbtiType', 'attachmentStyle', 'loveLanguage', 'oceanOpenness', 'oceanConscientiousness', 'oceanExtraversion', 'oceanAgreeableness', 'oceanNeuroticism', 'conflictStyle'],
|
|
42
|
+
};
|
|
43
|
+
/** Total number of steps with progress tracking. */
|
|
44
|
+
export const DATING_PROGRESS_TOTAL_STEPS = Object.keys(DATING_PROGRESS_FIELDS).length;
|
|
45
|
+
/**
|
|
46
|
+
* Navigate nested object properties using dot-path notation.
|
|
47
|
+
* e.g., getNestedValue(profile, "guardianContact.phoneNumber")
|
|
48
|
+
*/
|
|
49
|
+
export function getNestedValue(obj, path) {
|
|
50
|
+
const parts = path.split('.');
|
|
51
|
+
let current = obj;
|
|
52
|
+
for (const part of parts) {
|
|
53
|
+
if (current === null || current === undefined || typeof current !== 'object')
|
|
54
|
+
return undefined;
|
|
55
|
+
current = current[part];
|
|
56
|
+
}
|
|
57
|
+
return current;
|
|
58
|
+
}
|
|
59
|
+
/** Determine if a field value counts as "filled" for progress. */
|
|
60
|
+
export function isFieldFilled(value) {
|
|
61
|
+
if (value === null || value === undefined)
|
|
62
|
+
return false;
|
|
63
|
+
if (typeof value === 'string')
|
|
64
|
+
return value.trim().length > 0;
|
|
65
|
+
if (typeof value === 'number')
|
|
66
|
+
return true;
|
|
67
|
+
if (typeof value === 'boolean')
|
|
68
|
+
return true;
|
|
69
|
+
if (Array.isArray(value))
|
|
70
|
+
return value.length > 0;
|
|
71
|
+
if (typeof value === 'object') {
|
|
72
|
+
if ('name' in value && typeof value.name === 'string') {
|
|
73
|
+
return value.name !== '';
|
|
74
|
+
}
|
|
75
|
+
return Object.keys(value).length > 0;
|
|
76
|
+
}
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Calculate progress for a single dating onboarding step.
|
|
81
|
+
* Returns { filled, total } counts.
|
|
82
|
+
*
|
|
83
|
+
* @param stepIndex - 0-indexed step number (0-11)
|
|
84
|
+
* @param profile - Dating profile document (or partial record)
|
|
85
|
+
*/
|
|
86
|
+
export function calculateDatingStepProgress(stepIndex, profile) {
|
|
87
|
+
const fields = DATING_PROGRESS_FIELDS[stepIndex];
|
|
88
|
+
if (!fields)
|
|
89
|
+
return { filled: 0, total: 0 };
|
|
90
|
+
const total = fields.length;
|
|
91
|
+
if (!profile || total === 0)
|
|
92
|
+
return { filled: 0, total };
|
|
93
|
+
let filled = 0;
|
|
94
|
+
for (const fieldPath of fields) {
|
|
95
|
+
if (isFieldFilled(getNestedValue(profile, fieldPath))) {
|
|
96
|
+
filled++;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return { filled, total };
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Calculate overall dating onboarding progress across all steps.
|
|
103
|
+
* Returns per-step breakdowns + overall percentage.
|
|
104
|
+
*/
|
|
105
|
+
export function calculateDatingOverallProgress(profile) {
|
|
106
|
+
const steps = [];
|
|
107
|
+
let totalFilled = 0;
|
|
108
|
+
let totalFields = 0;
|
|
109
|
+
for (let i = 0; i < DATING_PROGRESS_TOTAL_STEPS; i++) {
|
|
110
|
+
const step = calculateDatingStepProgress(i, profile);
|
|
111
|
+
steps.push(step);
|
|
112
|
+
totalFilled += step.filled;
|
|
113
|
+
totalFields += step.total;
|
|
114
|
+
}
|
|
115
|
+
const percent = totalFields > 0 ? Math.round((totalFilled / totalFields) * 100) : 0;
|
|
116
|
+
return { steps, totalFilled, totalFields, percent };
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=onboarding-progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onboarding-progress.js","sourceRoot":"","sources":["../src/onboarding-progress.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAsC;IACvE,iBAAiB;IACjB,CAAC,EAAE,CAAC,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU,CAAC;IACtE,uBAAuB;IACvB,CAAC,EAAE,CAAC,oBAAoB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,uBAAuB,CAAC;IACjH,2BAA2B;IAC3B,CAAC,EAAE,CAAC,gBAAgB,EAAE,iBAAiB,EAAE,eAAe,EAAE,sBAAsB,CAAC;IACjF,2BAA2B;IAC3B,CAAC,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,aAAa,CAAC;IAC/C,qBAAqB;IACrB,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,CAAC;IAClD,iBAAiB;IACjB,CAAC,EAAE,CAAC,QAAQ,CAAC;IACb,qBAAqB;IACrB,CAAC,EAAE,CAAC,eAAe,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,cAAc,EAAE,cAAc,CAAC;IAC9G,oBAAoB;IACpB,CAAC,EAAE,CAAC,SAAS,CAAC;IACd,iBAAiB;IACjB,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC;IACjC,cAAc;IACd,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC;IACrB,sBAAsB;IACtB,EAAE,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,CAAC;IACjD,iCAAiC;IACjC,EAAE,EAAE,CAAC,UAAU,EAAE,iBAAiB,E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,IAAI,CAAC,MAAM,CAAC;QAC3B,WAAW,IAAI,IAAI,CAAC,KAAK,CAAC;IAC5B,CAAC;IAED,MAAM,OAAO,GAAG,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,WAAW,GAAG,WAAW,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACpF,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC;AACtD,CAAC","sourcesContent":["/**\n * Dating Onboarding Progress — Shared between frontend and backend.\n *\n * Maps each onboarding step to the DB fields that count toward progress.\n * Used by frontend (stepper UI: \"3/5 filled\") and backend (API progress response).\n *\n * Keys are 0-indexed step numbers matching ONBOARDING_STEP_GROUPS order.\n * Values are DB field paths on the DatingProfile document.\n *\n * @module dating-schema/onboarding-progress\n */\n\n/**\n * Per-step progress fields.\n * Each key is a step index (0-11), each value is the list of DB field paths\n * that count toward that step's completion.\n */\nexport const DATING_PROGRESS_FIELDS: Record<number, readonly string[]> = {\n // Step 0: Basics\n 0: ['displayName', 'dateOfBirth', 'gender', 'phoneNumber', 'pronouns'],\n // Step 1: Relationship\n 1: ['relationshipStatus', 'relationshipIntent', 'sexualOrientation', 'preferredGenders', 'relationshipStructure'],\n // Step 2: Mind & Education\n 2: ['educationLevel', 'institutionTier', 'cognitiveBand', 'politicalOrientation'],\n // Step 3: Career & Finance\n 3: ['profession', 'careerStage', 'incomeRange'],\n // Step 4: Appearance\n 4: ['height', 'weight', 'bodyBuild', 'complexion'],\n // Step 5: Photos\n 5: ['photos'],\n // Step 6: Your Roots\n 6: ['hometownState', 'hometownDistrict', 'familyReligion', 'personalReligion', 'motherTongue', 'familyValues'],\n // Step 7: Interests\n 7: ['hobbies'],\n // Step 8: Habits\n 8: ['diet', 'smoking', 'alcohol'],\n // Step 9: Bio\n 9: ['bio', 'myStory'],\n // Step 10: Favourites\n 10: ['favouriteBooks', 'favouriteShows', 'idols'],\n // Step 11: Personality & Mindset\n 11: ['mbtiType', 'attachmentStyle', 'loveLanguage', 'oceanOpenness', 'oceanConscientiousness', 'oceanExtraversion', 'oceanAgreeableness', 'oceanNeuroticism', 'conflictStyle'],\n};\n\n/** Total number of steps with progress tracking. */\nexport const DATING_PROGRESS_TOTAL_STEPS = Object.keys(DATING_PROGRESS_FIELDS).length;\n\n/**\n * Navigate nested object properties using dot-path notation.\n * e.g., getNestedValue(profile, \"guardianContact.phoneNumber\")\n */\nexport function getNestedValue(obj: Record<string, unknown>, path: string): unknown {\n const parts = path.split('.');\n let current: unknown = obj;\n for (const part of parts) {\n if (current === null || current === undefined || typeof current !== 'object') return undefined;\n current = (current as Record<string, unknown>)[part];\n }\n return current;\n}\n\n/** Determine if a field value counts as \"filled\" for progress. */\nexport function isFieldFilled(value: unknown): boolean {\n if (value === null || value === undefined) return false;\n if (typeof value === 'string') return value.trim().length > 0;\n if (typeof value === 'number') return true;\n if (typeof value === 'boolean') return true;\n if (Array.isArray(value)) return value.length > 0;\n if (typeof value === 'object') {\n if ('name' in value && typeof (value as Record<string, unknown>).name === 'string') {\n return (value as Record<string, unknown>).name !== '';\n }\n return Object.keys(value).length > 0;\n }\n return false;\n}\n\n/**\n * Calculate progress for a single dating onboarding step.\n * Returns { filled, total } counts.\n *\n * @param stepIndex - 0-indexed step number (0-11)\n * @param profile - Dating profile document (or partial record)\n */\nexport function calculateDatingStepProgress(\n stepIndex: number,\n profile: Record<string, unknown> | undefined | null,\n): { filled: number; total: number } {\n const fields = DATING_PROGRESS_FIELDS[stepIndex];\n if (!fields) return { filled: 0, total: 0 };\n\n const total = fields.length;\n if (!profile || total === 0) return { filled: 0, total };\n\n let filled = 0;\n for (const fieldPath of fields) {\n if (isFieldFilled(getNestedValue(profile, fieldPath))) {\n filled++;\n }\n }\n return { filled, total };\n}\n\n/**\n * Calculate overall dating onboarding progress across all steps.\n * Returns per-step breakdowns + overall percentage.\n */\nexport function calculateDatingOverallProgress(\n profile: Record<string, unknown> | undefined | null,\n): {\n steps: { filled: number; total: number }[];\n totalFilled: number;\n totalFields: number;\n percent: number;\n} {\n const steps: { filled: number; total: number }[] = [];\n let totalFilled = 0;\n let totalFields = 0;\n\n for (let i = 0; i < DATING_PROGRESS_TOTAL_STEPS; i++) {\n const step = calculateDatingStepProgress(i, profile);\n steps.push(step);\n totalFilled += step.filled;\n totalFields += step.total;\n }\n\n const percent = totalFields > 0 ? Math.round((totalFilled / totalFields) * 100) : 0;\n return { steps, totalFilled, totalFields, percent };\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dating-schema",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.48.0",
|
|
4
4
|
"description": "Shared Zod schemas for the Dating feature — single source of truth for API contracts, validation, and TypeScript types (frontend + backend).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|