feat: Add conference manager (#71)

This commit is contained in:
Thomas Durieux
2021-09-06 09:34:39 +02:00
committed by GitHub
parent 6dba366296
commit 49da267d5f
23 changed files with 2085 additions and 30 deletions

View File

@@ -0,0 +1,12 @@
import * as mongoose from "mongoose";
const { model } = mongoose;
import { IConferenceDocument, IConferenceModel } from "./conferences.types";
import ConferenceSchema from "./conferences.schema";
const ConferenceModel = model<IConferenceDocument>(
"Conference",
ConferenceSchema
) as IConferenceModel;
export default ConferenceModel;

View File

@@ -0,0 +1,59 @@
import * as mongoose from "mongoose";
const { Schema } = mongoose;
const RepositorySchema = new Schema({
name: String,
conferenceID: {
type: String,
index: { unique: true },
},
url: String,
startDate: Date,
endDate: Date,
status: String,
owners: { type: [mongoose.Schema.Types.ObjectId] },
repositories: {
type: [
{
id: { type: mongoose.Schema.Types.ObjectId },
addDate: { type: Date },
removeDate: { type: Date },
},
],
},
options: {
expirationMode: String,
expirationDate: Date,
update: Boolean,
image: Boolean,
pdf: Boolean,
notebook: Boolean,
link: Boolean,
page: Boolean,
},
dateOfEntry: {
type: Date,
default: new Date(),
},
plan: {
planID: String,
pricePerRepository: Number,
quota: {
repository: Number,
size: Number,
file: Number,
},
},
billing: {
name: String,
email: String,
address: String,
address2: String,
city: String,
zip: String,
country: String,
vat: String,
},
});
export default RepositorySchema;

View File

@@ -0,0 +1,49 @@
import * as mongoose from "mongoose";
import { ConferenceStatus } from "../../types";
export interface IConference {
name: string;
conferenceID: string;
startDate: Date;
endDate: Date;
url: string;
status: ConferenceStatus;
owners: string[];
repositories: {
id: string;
addDate: Date;
removeDate?: Date;
}[];
options: {
expirationMode: "never" | "redirect" | "remove";
expirationDate?: Date;
update: boolean;
image: boolean;
pdf: boolean;
notebook: boolean;
link: boolean;
page: boolean;
};
plan: {
planID: string;
pricePerRepository: number;
quota: {
repository: number;
size: number;
file: number;
};
};
billing?: {
name: string;
email: string;
address: string;
address2?: string;
city: string;
zip: string;
country: string;
vat?: string;
};
}
export interface IConferenceDocument extends IConference, mongoose.Document {}
export interface IConferenceModel extends mongoose.Model<IConferenceDocument> {}