@chevre/domain
Version:
Chevre Domain Library for Node.js
369 lines (306 loc) • 10.9 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Chevre Domain Library for Node.js Source: repo/mongoose/model/event.js</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
<link type="text/css" rel="stylesheet" href="styles/site.cosmo.css">
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top navbar-inverse">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="index.html">Chevre Domain Library for Node.js</a>
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="navbar-collapse collapse" id="topNavigation">
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a>
<ul class="dropdown-menu ">
<li><a href="MongoRepository.html">MongoRepository</a></li><li><a href="RedisRepository.html">RedisRepository</a></li><li><a href="Repository.html">Repository</a></li>
</ul>
</li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a>
<ul class="dropdown-menu ">
<li><a href="global.html#abort">abort</a></li><li><a href="global.html#accountTitle_1">accountTitle_1</a></li><li><a href="global.html#aggregateScreeningEvent">aggregateScreeningEvent</a></li><li><a href="global.html#AggregationService">AggregationService</a></li><li><a href="global.html#call">call</a></li><li><a href="global.html#cancel">cancel</a></li><li><a href="global.html#cancelPendingReservation">cancelPendingReservation</a></li><li><a href="global.html#cancelReservation">cancelReservation</a></li><li><a href="global.html#confirm">confirm</a></li><li><a href="global.html#confirmReservation">confirmReservation</a></li><li><a href="global.html#createDebug">createDebug</a></li><li><a href="global.html#default">default</a></li><li><a href="global.html#execute">execute</a></li><li><a href="global.html#executeByName">executeByName</a></li><li><a href="global.html#exportTasks">exportTasks</a></li><li><a href="global.html#exportTasksById">exportTasksById</a></li><li><a href="global.html#mongoose">mongoose</a></li><li><a href="global.html#redis">redis</a></li><li><a href="global.html#retry">retry</a></li><li><a href="global.html#schema">schema</a></li><li><a href="global.html#searchScreeningEventTicketOffers">searchScreeningEventTicketOffers</a></li><li><a href="global.html#sortOrder4executionOfTasks">sortOrder4executionOfTasks</a></li><li><a href="global.html#start">start</a></li>
</ul>
</li>
</ul>
<div class="col-sm-3 col-md-3">
<form class="navbar-form" role="search">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search" name="q" id="search-input">
<div class="input-group-btn">
<button class="btn btn-default" id="search-submit"><i class="glyphicon glyphicon-search"></i></button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="container" id="toc-content">
<div class="row">
<div class="col-md-12">
<div id="main">
<h1 class="page-title">Source: repo/mongoose/model/event.js</h1>
<section>
<article>
<pre
class="sunlight-highlight-javascript linenums">"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const mongoose = require("mongoose");
const multilingualString_1 = require("../schemaTypes/multilingualString");
const safe = { j: true, w: 'majority', wtimeout: 10000 };
const locationSchema = new mongoose.Schema({}, {
id: false,
_id: false,
strict: false
});
const workPerformedSchema = new mongoose.Schema({}, {
id: false,
_id: false,
strict: false
});
const superEventSchema = new mongoose.Schema({}, {
id: false,
_id: false,
strict: false
});
const videoFormatSchema = new mongoose.Schema({}, {
id: false,
_id: false,
strict: false
});
const soundFormatSchema = new mongoose.Schema({}, {
id: false,
_id: false,
strict: false
});
const offersSchema = new mongoose.Schema({}, {
id: false,
_id: false,
strict: false
});
/**
* イベント(公演など)スキーマ
*/
const schema = new mongoose.Schema({
_id: String,
typeOf: {
type: String,
required: true
},
identifier: String,
name: multilingualString_1.default,
additionalProperty: mongoose.SchemaTypes.Mixed,
alternateName: multilingualString_1.default,
alternativeHeadline: multilingualString_1.default,
description: multilingualString_1.default,
doorTime: Date,
duration: String,
endDate: Date,
eventStatus: String,
headline: multilingualString_1.default,
location: locationSchema,
startDate: Date,
workPerformed: workPerformedSchema,
superEvent: superEventSchema,
videoFormat: [videoFormatSchema],
soundFormat: [soundFormatSchema],
subtitleLanguage: mongoose.SchemaTypes.Mixed,
dubLanguage: mongoose.SchemaTypes.Mixed,
kanaName: String,
offers: offersSchema,
maximumAttendeeCapacity: { type: Number, default: 0 },
remainingAttendeeCapacity: { type: Number, default: 0 },
checkInCount: { type: Number, default: 0 },
attendeeCount: { type: Number, default: 0 }
}, {
collection: 'events',
id: true,
read: 'primaryPreferred',
safe: safe,
strict: true,
useNestedStrict: true,
timestamps: {
createdAt: 'createdAt',
updatedAt: 'updatedAt'
},
toJSON: { getters: true },
toObject: { getters: true }
});
schema.index({ createdAt: 1 }, { name: 'searchByCreatedAt' });
schema.index({ updatedAt: 1 }, { name: 'searchByUpdatedAt' });
// 上映イベント検索に使用
schema.index({
typeOf: 1,
'superEvent.location.branchCode': 1
}, {
partialFilterExpression: {
'superEvent.location.branchCode': { $exists: true }
},
name: 'searchScreeningEventsByLocationBranchCode'
});
schema.index({
typeOf: 1,
'superEvent.workPerformed.identifier': 1,
startDate: 1
}, {
partialFilterExpression: {
'superEvent.workPerformed.identifier': { $exists: true }
},
name: 'searchScreeningEventsByWorkPerformedIdentifier'
});
schema.index({ typeOf: 1, startDate: 1 });
schema.index({ typeOf: 1, endDate: 1 });
schema.index({
'offers.availabilityEnds': 1
}, {
partialFilterExpression: {
'offers.availabilityEnds': { $exists: true }
},
name: 'searchByOffersAvailabilityEnds'
});
schema.index({
'offers.availabilityStarts': 1
}, {
partialFilterExpression: {
'offers.availabilityStarts': { $exists: true }
},
name: 'searchByOffersAvailabilityStarts'
});
schema.index({
'offers.validThrough': 1
}, {
partialFilterExpression: {
'offers.validThrough': { $exists: true }
},
name: 'searchByOffersValidThrough'
});
schema.index({
'offers.validFrom': 1
}, {
partialFilterExpression: {
'offers.validFrom': { $exists: true }
},
name: 'searchByOffersValidFrom'
});
schema.index({
'offers.id': 1
}, {
partialFilterExpression: {
'offers.id': { $exists: true }
},
name: 'searchByOffersId'
});
exports.default = mongoose.model('Event', schema).on('index',
// tslint:disable-next-line:no-single-line-block-comment
/* istanbul ignore next */
(error) => {
if (error !== undefined) {
// tslint:disable-next-line:no-console
console.error(error);
}
});
</pre>
</article>
</section>
</div>
</div>
<div class="clearfix"></div>
</div>
</div>
<div class="modal fade" id="searchResults">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">Search results</h4>
</div>
<div class="modal-body"></div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
<footer>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
on Sun Dec 16th 2018
using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
</footer>
<script src="scripts/docstrap.lib.js"></script>
<script src="scripts/toc.js"></script>
<script type="text/javascript" src="scripts/fulltext-search-ui.js"></script>
<script>
$( function () {
$( "[id*='$']" ).each( function () {
var $this = $( this );
$this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
} );
$( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () {
var $this = $( this );
var example = $this.find( "code" );
exampleText = example.html();
var lang = /{@lang (.*?)}/.exec( exampleText );
if ( lang && lang[1] ) {
exampleText = exampleText.replace( lang[0], "" );
example.html( exampleText );
lang = lang[1];
} else {
var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/);
lang = langClassMatch ? langClassMatch[1] : "javascript";
}
if ( lang ) {
$this
.addClass( "sunlight-highlight-" + lang )
.addClass( "linenums" )
.html( example.html() );
}
} );
Sunlight.highlightAll( {
lineNumbers : true,
showMenu : true,
enableDoclinks : true
} );
$.catchAnchorLinks( {
navbarOffset: 10
} );
$( "#toc" ).toc( {
anchorName : function ( i, heading, prefix ) {
return $( heading ).attr( "id" ) || ( prefix + i );
},
selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4",
showAndHide : false,
smoothScrolling: true
} );
$( "#main span[id^='toc']" ).addClass( "toc-shim" );
$( '.dropdown-toggle' ).dropdown();
$( "table" ).each( function () {
var $this = $( this );
$this.addClass('table');
} );
} );
</script>
<!--Navigation and Symbol Display-->
<!--Google Analytics-->
<script type="text/javascript">
$(document).ready(function() {
SearcherDisplay.init();
});
</script>
</body>
</html>