Spaces:
Sleeping
Sleeping
| const mongoose = require('mongoose'); | |
| const verificationSchema = new mongoose.Schema( | |
| { | |
| photographerId: { | |
| type: mongoose.Schema.Types.ObjectId, | |
| ref: 'Photographer', | |
| required: true, | |
| unique: true, | |
| }, | |
| status: { | |
| type: String, | |
| enum: ['pending', 'verified', 'rejected'], | |
| default: 'pending', | |
| }, | |
| idDocument: { | |
| type: String, // URL to uploaded ID | |
| default: null, | |
| }, | |
| idVerifiedAt: { | |
| type: Date, | |
| default: null, | |
| }, | |
| portfolioSamples: [ | |
| { | |
| url: String, | |
| uploadedAt: { | |
| type: Date, | |
| default: Date.now, | |
| }, | |
| }, | |
| ], | |
| submittedAt: { | |
| type: Date, | |
| default: Date.now, | |
| }, | |
| verifiedAt: { | |
| type: Date, | |
| default: null, | |
| }, | |
| adminNotes: { | |
| type: String, | |
| default: '', | |
| }, | |
| rejectionReason: { | |
| type: String, | |
| default: '', | |
| }, | |
| resubmissionAllowed: { | |
| type: Boolean, | |
| default: false, | |
| }, | |
| }, | |
| { timestamps: true } | |
| ); | |
| module.exports = mongoose.model('Verification', verificationSchema); | |