Fundings:
const schema = mongoose.Schema(
{
funder: { type: mongoose.Schema.Types.ObjectId, ref: "Funders" },
lead: { type: mongoose.Schema.Types.ObjectId, ref: "Leads" },
documents: [{ type: mongoose.Schema.Types.ObjectId, ref: "Documents" }],
gocardless: {
paymentId: String,
},
externalReference: String,
paymentMethod: String,
paymentStatus: {
type: String,
default: "toClaim",
},
amount: Number,
amountAlt: Number,
vat: Number,
currency: {
type: String,
default: "EUR",
},
discountType: {
type: String,
default: "none",
},
discountValue: Number,
invoices: [{ type: mongoose.Schema.Types.ObjectId, ref: "Invoicing" }],
credits: [{ type: mongoose.Schema.Types.ObjectId, ref: "Invoicing" }],
incomings: [{ type: mongoose.Schema.Types.ObjectId, ref: "Incomings" }],
refundPaymentId: String,
chargeDate: Date,
claimedAt: Date,
createdAt: {
type: Date,
default: Date.now,
},
updatedAt: {
type: Date,
default: Date.now,
},
},
{
timestamps: false,
},
);
module.exports = mongoose.model("Fundings", schema, "fundings");
Leads:
const schema = mongoose.Schema(
{
unread: {
type: Boolean,
default: true,
},
email: String,
telephone: String,
firstname: String,
lastname: String,
companyName: String,
birthDate: Date,
address: String,
zipCode: String,
city: String,
country: String,
kairos: String,
cpf: String,
session: { type: mongoose.Schema.Types.ObjectId, ref: "SessionsApollo" },
format: String,
logicalTest: {
candidate_id: String,
link: String,
score: Number,
result: Object,
},
logicalTestStatus: {
type: String,
default: "unsent",
},
todolist: [Object],
price: Number,
currency: {
type: String,
default: "EUR",
},
infos: String,
commentsArr: [
{ type: mongoose.Schema.Types.ObjectId, ref: "CommentsLeads" },
],
students: [{ type: mongoose.Schema.Types.ObjectId, ref: "Students" }],
fundings: [{ type: mongoose.Schema.Types.ObjectId, ref: "Fundings" }],
funders: [{ type: mongoose.Schema.Types.ObjectId, ref: "Funders" }],
quotes: [{ type: mongoose.Schema.Types.ObjectId, ref: "Invoicing" }],
documents: [{ type: mongoose.Schema.Types.ObjectId, ref: "Documents" }],
mailinglist: Boolean,
utmSource: String,
source: String,
gclid: String,
fbclid: String,
referrer: String,
marketing: {
step: {
type: Number,
default: 0,
},
sentAt: {
type: Date,
default: Date.now,
},
},
lastMailSent: Date,
status: String,
createdAt: {
type: Date,
default: Date.now,
},
updatedAt: {
type: Date,
default: Date.now,
},
},
{
timestamps: false,
},
);
module.exports = mongoose.model("Leads", schema, "leads");
I have to say everything was working fine past days. I even rollback my commits and the problem is still the same… And I haven’t touch this collection and/or CRUD files.