This commit is contained in:
payacom
2026-09-13 21:32:36 +03:30
parent 90c5f94b57
commit c302aea177
49 changed files with 4063 additions and 920 deletions

View File

@@ -258,7 +258,159 @@ const userSchema = new mongoose.Schema({
},
marital_status: {
type: String,
enum: ['single', 'divorced'],
enum: ['single', 'divorced', 'widowed', 'not_in_relationship', 'prefer_not_to_say'],
required: false,
default: null
},
relationship_goal: {
type: [{
type: String,
enum: [
'friendship',
'serious_partner',
'marriage_intro',
'emotional_relationship',
'travel_event_companion',
'social_networking',
'not_sure'
]
}],
required: false,
default: []
},
seeking_gender: {
type: String,
enum: ['female', 'male', 'both', 'not_important'],
required: false,
default: null
},
desired_age_range: {
type: String,
enum: ['18_24', '25_30', '31_35', '36_40', '41_50', 'over_50', 'not_important'],
required: false,
default: null
},
personality_traits: {
type: [{
type: String,
enum: [
'kind',
'loyal',
'funny',
'calm',
'energetic',
'responsible',
'ambitious',
'emotional',
'logical',
'patient',
'honest',
'romantic',
'independent',
'family_oriented',
'adventurous',
'introvert',
'extrovert'
]
}],
required: false,
default: []
},
lifestyle: {
type: [{
type: String,
enum: [
'active_healthy',
'homebody_calm',
'social_outgoing',
'busy_career',
'traveler',
'night_owl',
'early_riser',
'minimalist',
'luxury_lover'
]
}],
required: false,
default: []
},
interests: {
type: [{
type: String,
enum: [
'movies_series',
'music',
'books_reading',
'sports',
'cooking',
'photography',
'travel',
'nature',
'gaming',
'art_painting',
'fashion',
'pets',
'dancing',
'language_learning'
]
}],
required: false,
default: []
},
values: {
type: [{
type: String,
enum: [
'family',
'career_growth',
'religion_spirituality',
'personal_freedom',
'financial_stability',
'health_fitness',
'personal_growth',
'excitement_new_experiences'
]
}],
required: false,
default: []
},
relationship_view: {
type: String,
enum: [
'traditional',
'modern',
'long_term',
'friendship_first',
'marriage_soon',
'friendship_only_for_now'
],
required: false,
default: null
},
geo_preference: {
type: String,
enum: [
'same_city_only',
'nearby_cities',
'whole_province',
'whole_iran',
'even_abroad',
'online_is_fine'
],
required: false,
default: null
},
children_status: {
type: [{
type: String,
enum: ['no_children', 'has_children', 'open_to_children', 'not_now', 'prefer_not_to_say']
}],
required: false,
default: []
},
smoking_status: {
type: String,
enum: ['none', 'sometimes', 'yes', 'doesnt_matter', 'prefer_not_to_say'],
required: false,
default: null
},
@@ -292,7 +444,7 @@ const userSchema = new mongoose.Schema({
},
personal_style: {
type: String,
enum: ['formal', 'sporty'],
enum: ['casual', 'classic', 'minimal', 'formal', 'street', 'romantic'],
required: false,
default: null
},
@@ -306,18 +458,13 @@ const userSchema = new mongoose.Schema({
},
income_range: {
type: String,
enum: ['under_5m', '5m_10m', '10m_20m', 'over_20m'],
enum: [
'under_40m', '40m_50m', '50m_60m', '60m_70m', '70m_80m',
'80m_90m', '90m_100m', '100m_150m', '150m_200m', 'over_200m'
],
required: false,
default: null
},
moral_traits: {
type: String,
required: false,
trim: true,
minLength: 1,
maxLength: 1024,
default: null
},
personal_details_public: {
type: Boolean,
required: false,
@@ -618,6 +765,30 @@ const userSchema = new mongoose.Schema({
required: false,
default: null
},
// بک‌آپ کلید خصوصیِ E2EE رمزنگاری‌شده با رمز/PIN انتخابیِ کاربر (سرور هیچ‌وقت PIN یا
// کلید خام رو نمی‌بینه، فقط این بلاکِ رمزنگاری‌شده رو ذخیره می‌کنه) — برای بازیابیِ
// هویتِ رمزنگاری وقتی هیچ دستگاه دیگه‌ای لینک‌شده در دسترس نیست
e2ee_key_backup: {
type: {
salt: String,
iv: String,
ciphertext: String,
iterations: Number
},
required: false,
default: null
},
// یک رشته‌ی تصادفیِ ۳۲بایتیِ per-account که با درخواستِ احرازهویت‌شده به همین
// اکانت، از هر دستگاهی (وب/اندروید) قابل‌دریافته — به‌جای PIN دستی، به‌عنوانِ
// رمزِ رمزنگاریِ e2ee_key_backup استفاده می‌شه تا بازیابیِ هویتِ E2EE روی دستگاهِ
// جدید کاملاً خودکار و بدون دخالتِ کاربر انجام بشه. توجه: این یعنی تضمینِ
// end-to-end دیگه واقعی نیست — هرکسی که به این فیلد (یا سرور) دسترسی پیدا کنه
// می‌تونه بک‌آپ رو باز کنه؛ این تصمیم آگاهانه به نفعِ هیچ‌وقت‌گم‌نشدنِ پیام‌ها گرفته شده
e2ee_auto_backup_secret: {
type: String,
required: false,
default: null
},
pinned_post_ids: {
type: [{
type: mongoose.Schema.Types.ObjectId,