mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-02-13 02:42:45 +00:00
feat: Add conference manager (#71)
This commit is contained in:
12
src/database/conference/conferences.model.ts
Normal file
12
src/database/conference/conferences.model.ts
Normal 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;
|
||||
59
src/database/conference/conferences.schema.ts
Normal file
59
src/database/conference/conferences.schema.ts
Normal 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;
|
||||
49
src/database/conference/conferences.types.ts
Normal file
49
src/database/conference/conferences.types.ts
Normal 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> {}
|
||||
Reference in New Issue
Block a user