Spaces:
Sleeping
Sleeping
| const mongoose = require('mongoose'); | |
| const packageSchema = new mongoose.Schema( | |
| { | |
| photographerId: { | |
| type: mongoose.Schema.Types.ObjectId, | |
| ref: 'Photographer', | |
| required: true, | |
| }, | |
| name: { | |
| type: String, | |
| required: true, | |
| trim: true, | |
| }, | |
| description: { | |
| type: String, | |
| default: '', | |
| }, | |
| price: { | |
| type: Number, | |
| required: true, | |
| min: 0, | |
| }, | |
| priceUnit: { | |
| type: String, | |
| enum: ['hourly', 'session', 'daily'], | |
| default: 'session', | |
| }, | |
| duration: { | |
| type: Number, // in hours | |
| default: 2, | |
| }, | |
| deliverables: { | |
| numPhotos: { | |
| type: Number, | |
| default: 100, | |
| }, | |
| numEdited: { | |
| type: Number, | |
| default: 10, | |
| }, | |
| numLocations: { | |
| type: Number, | |
| default: 1, | |
| }, | |
| includesAlbum: { | |
| type: Boolean, | |
| default: false, | |
| }, | |
| revisions: { | |
| type: Number, | |
| default: 0, // unlimited if 0 | |
| }, | |
| additionalFeatures: [String], // e.g., ["Drone shots", "Video highlights"] | |
| }, | |
| active: { | |
| type: Boolean, | |
| default: true, | |
| }, | |
| bookingCount: { | |
| type: Number, | |
| default: 0, | |
| }, | |
| tags: [String], // e.g., ['wedding', 'couple-shoot'] | |
| }, | |
| { timestamps: true } | |
| ); | |
| module.exports = mongoose.model('Package', packageSchema); | |