You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
792 B
24 lines
792 B
// venue-channel.js
|
|
// Copyright (C) 2022 DTP Technologies, LLC
|
|
// License: Apache-2.0
|
|
|
|
'use strict';
|
|
|
|
const mongoose = require('mongoose');
|
|
|
|
const Schema = mongoose.Schema;
|
|
|
|
const ChannelCredentialsSchema = new Schema({
|
|
streamKey: { type: String, required: true },
|
|
widgetKey: { type: String, required: true },
|
|
});
|
|
|
|
const VenueChannelSchema = new Schema({
|
|
ownerType: { type: String, enum: ['CoreUser','User'], required: true },
|
|
owner: { type: Schema.ObjectId, required: true, index: 1, refPath: 'ownerType' },
|
|
slug: { type: String, lowercase: true, unique: true, index: 1 },
|
|
lastStatus: { type: Schema.ObjectId, ref: 'VenueChannelStatus' },
|
|
credentials: { type: ChannelCredentialsSchema, select: false },
|
|
});
|
|
|
|
module.exports = mongoose.model('VenueChannel', VenueChannelSchema); |