forked from UKSOURCE/ipv6
paypal
This commit is contained in:
@@ -3,6 +3,13 @@ import { Schema, model, models } from "mongoose";
|
||||
|
||||
export type SummitRequestSource = "registration" | "feedback";
|
||||
|
||||
export type PaymentStatus =
|
||||
| "not_required"
|
||||
| "payment_pending"
|
||||
| "paid"
|
||||
| "payment_failed"
|
||||
| "payment_cancelled";
|
||||
|
||||
export interface ISummitRequest {
|
||||
publicId: string;
|
||||
submittedAt: string;
|
||||
@@ -16,6 +23,12 @@ export interface ISummitRequest {
|
||||
status: SubmissionStatus;
|
||||
notes: string;
|
||||
source?: SummitRequestSource;
|
||||
paymentStatus: PaymentStatus;
|
||||
paypalOrderId?: string;
|
||||
paypalCaptureId?: string;
|
||||
paymentAmount?: number;
|
||||
paymentCurrency?: string;
|
||||
paymentCompletedAt?: Date;
|
||||
}
|
||||
|
||||
const summitRequestSchema = new Schema<ISummitRequest>(
|
||||
@@ -37,6 +50,17 @@ const summitRequestSchema = new Schema<ISummitRequest>(
|
||||
},
|
||||
notes: { type: String, default: "" },
|
||||
source: { type: String, enum: ["registration", "feedback"] },
|
||||
paymentStatus: {
|
||||
type: String,
|
||||
enum: ["not_required", "payment_pending", "paid", "payment_failed", "payment_cancelled"],
|
||||
default: "not_required",
|
||||
index: true,
|
||||
},
|
||||
paypalOrderId: { type: String, sparse: true, index: true },
|
||||
paypalCaptureId: { type: String },
|
||||
paymentAmount: { type: Number, default: 120 },
|
||||
paymentCurrency: { type: String, default: "USD" },
|
||||
paymentCompletedAt: { type: Date },
|
||||
},
|
||||
{ timestamps: true },
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user