forked from UKSOURCE/ipv6
Adding UI of FeedBack, Registration, Admin console
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
import type { SubmissionStatus } from "@/types/admin-submission";
|
||||
import { Schema, model, models } from "mongoose";
|
||||
|
||||
export type SummitRequestSource = "registration" | "feedback";
|
||||
|
||||
export interface ISummitRequest {
|
||||
publicId: string;
|
||||
submittedAt: string;
|
||||
displayDate: string;
|
||||
fullName: string;
|
||||
jobTitle: string;
|
||||
company: string;
|
||||
segment: string;
|
||||
email: string;
|
||||
phone: string;
|
||||
status: SubmissionStatus;
|
||||
notes: string;
|
||||
source?: SummitRequestSource;
|
||||
}
|
||||
|
||||
const summitRequestSchema = new Schema<ISummitRequest>(
|
||||
{
|
||||
publicId: { type: String, required: true, unique: true, index: true },
|
||||
submittedAt: { type: String, required: true, index: true },
|
||||
displayDate: { type: String, required: true },
|
||||
fullName: { type: String, required: true },
|
||||
jobTitle: { type: String, default: "" },
|
||||
company: { type: String, default: "" },
|
||||
segment: { type: String, required: true },
|
||||
email: { type: String, default: "" },
|
||||
phone: { type: String, default: "" },
|
||||
status: {
|
||||
type: String,
|
||||
enum: ["pending", "approved", "rejected"],
|
||||
default: "pending",
|
||||
index: true,
|
||||
},
|
||||
notes: { type: String, default: "" },
|
||||
source: { type: String, enum: ["registration", "feedback"] },
|
||||
},
|
||||
{ timestamps: true },
|
||||
);
|
||||
|
||||
const SummitRequest = models.SummitRequest ?? model<ISummitRequest>("SummitRequest", summitRequestSchema, "summit_requests");
|
||||
|
||||
export default SummitRequest;
|
||||
Reference in New Issue
Block a user