Spaces:
Sleeping
Sleeping
File size: 1,382 Bytes
0f8617c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | 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);
|