feat: Simplify proposals events and add warehouse events

This commit is contained in:
Josepablo C
2025-03-20 00:39:15 -06:00
parent 5ba802498f
commit 1d3c9bd443
9 changed files with 207 additions and 76 deletions

View File

@@ -39,7 +39,7 @@ const schema = new Schema({
driver: { type: Schema.Types.ObjectId, ref: 'users' },
posted_by: { type: Schema.Types.ObjectId, ref: 'users' }, // shipper
posted_by_name: { type: String }, // search purpose
bidder: { type: Schema.Types.ObjectId, ref: 'users' },
bidder: { type: Schema.Types.ObjectId, ref: 'users' }, // who sent the proposal (carrier user)
shipper_warehouse : { type: Schema.Types.ObjectId, ref: 'branches' },

View File

@@ -7,11 +7,11 @@ const schema = new Schema({
carrier: { type: Schema.Types.ObjectId, ref: 'companies' }, // who transport the load
vehicle: { type: Schema.Types.ObjectId, ref: 'vehicles' },
bidder: { type: Schema.Types.ObjectId, ref: 'users' },
bidder: { type: Schema.Types.ObjectId, ref: 'users' }, // who sends the proposal (proposal author, carrier)
comment: { type: String },
accepted_by: { type: Schema.Types.ObjectId, ref: 'users' },
accepted_by: { type: Schema.Types.ObjectId, ref: 'users' }, // who accepts the proposal (shipper)
accepted_date: { type: Date },
is_withdrawn: { type: Boolean, default: false },