backend requirements onthe xustomer app
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
"doormile/constants"
|
||||
"doormile/db"
|
||||
"doormile/internal/cxstage"
|
||||
"doormile/internal/notify"
|
||||
"doormile/internal/routing"
|
||||
"doormile/models"
|
||||
@@ -71,6 +72,21 @@ func assignMilerTx(tx *gorm.DB, bookingID, milerUserID int, assignedByUserID *in
|
||||
return nil, fmt.Errorf("failed to update miler availability: %w", err)
|
||||
}
|
||||
|
||||
// The customer's "Miler assigned" milestone, recorded where the assignment
|
||||
// is actually created rather than where a rider taps Accept. A rider who
|
||||
// never opens the app would otherwise leave the customer watching "finding
|
||||
// a Miler" while ops has the booking down as assigned — two surfaces
|
||||
// disagreeing about the same fact.
|
||||
if err := cxstage.Record(tx, cxstage.Event{
|
||||
BookingID: booking.Bookingid,
|
||||
Stage: constants.CxStageAssigned,
|
||||
ActorType: constants.CxActorOps,
|
||||
ActorID: assignedByUserID,
|
||||
Source: "assignMilerTx",
|
||||
}); err != nil {
|
||||
return nil, fmt.Errorf("failed to record the assigned stage: %w", err)
|
||||
}
|
||||
|
||||
return &booking, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user