Rakshitjan commited on
Commit
c35118e
·
verified ·
1 Parent(s): 6f5fd0c

Update models.js

Browse files
Files changed (1) hide show
  1. models.js +3 -75
models.js CHANGED
@@ -392,79 +392,7 @@ const caseSchema = new mongoose.Schema({
392
  enum: ['Completed', 'In Progress', 'Pending', 'Unassigned']
393
  },
394
 
395
- // Legacy fields (restored for Flutter app compatibility)
396
- demographic_details: {
397
- aadhaar_photo_match: { type: Boolean, default: null },
398
- contact_information: {
399
- email_id: String,
400
- mobile_number: String
401
- },
402
- personal_details: {
403
- gender: String,
404
- education: String,
405
- number_of_family_members: Number
406
- },
407
- customer_photo_id: String,
408
- address_details: {
409
- residence_address_type: String,
410
- residential_address: String,
411
- city: String,
412
- state: String,
413
- district: String,
414
- pincode: String
415
- },
416
- residence_photo_id: String,
417
- aadhaar_photo_id: String,
418
- // UAPMP nested structure (for backward compatibility)
419
- applicantDetail: { type: mongoose.Schema.Types.Mixed },
420
- residenceDetail: { type: mongoose.Schema.Types.Mixed }
421
- },
422
-
423
- business_details: {
424
- enterprise_information: {
425
- enterprise_name: String,
426
- type_of_organization: String
427
- },
428
- business_location_details: {
429
- business_address_type: String,
430
- business_location: String
431
- },
432
- business_address: {
433
- address: String,
434
- city: String,
435
- district: String,
436
- state: String,
437
- pincode: String,
438
- landmark: String
439
- },
440
- business_address_photo_id: String,
441
- business_activity: {
442
- business_activity: String,
443
- activity_type: String
444
- },
445
- business_info: {
446
- employee_count: Number,
447
- years_of_running_business: Number,
448
- additional_business: String
449
- },
450
- // UAPMP nested structure (for backward compatibility)
451
- businessDetail: { type: mongoose.Schema.Types.Mixed }
452
- },
453
-
454
- financial_details: {
455
- business_financial_information: {
456
- monthly_income_from_business: Number,
457
- monthly_expense_of_business: Number
458
- },
459
- loans_and_emis: {
460
- current_loans_emis: String
461
- },
462
- family_financial_information: {
463
- monthly_family_income: Number,
464
- number_of_working_members: Number,
465
- monthly_family_expense: Number
466
- }
467
- },
468
 
469
  created_at: { type: Date, default: Date.now },
470
  assigned_at: Date,
@@ -473,7 +401,7 @@ const caseSchema = new mongoose.Schema({
473
  updated_at: { type: Date, default: Date.now },
474
  remarks: String,
475
 
476
- // UAPMP fields for final submission (extracted from nested structures)
477
  applicantDetail: { type: mongoose.Schema.Types.Mixed },
478
  residenceDetail: { type: mongoose.Schema.Types.Mixed },
479
  coApplicantDetail: { type: mongoose.Schema.Types.Mixed },
@@ -516,4 +444,4 @@ const Agent = mongoose.model('Agent', agentSchema);
516
  const Case = mongoose.model('Case', caseSchema);
517
  const File = mongoose.model('File', fileSchema);
518
 
519
- module.exports = { connectDB, Admin, Agent, Case, File, CaseCreationWebhook };
 
392
  enum: ['Completed', 'In Progress', 'Pending', 'Unassigned']
393
  },
394
 
395
+ // Legacy fields removed: demographic_details, business_details, financial_details
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
396
 
397
  created_at: { type: Date, default: Date.now },
398
  assigned_at: Date,
 
401
  updated_at: { type: Date, default: Date.now },
402
  remarks: String,
403
 
404
+ // New fields for UAPMP API integration
405
  applicantDetail: { type: mongoose.Schema.Types.Mixed },
406
  residenceDetail: { type: mongoose.Schema.Types.Mixed },
407
  coApplicantDetail: { type: mongoose.Schema.Types.Mixed },
 
444
  const Case = mongoose.model('Case', caseSchema);
445
  const File = mongoose.model('File', fileSchema);
446
 
447
+ module.exports = { connectDB, Admin, Agent, Case, File, CaseCreationWebhook };