refactor(member): replace slackInviteStatus with slackInvitedAt
Schema change for wave-based Slack onboarding. The string enum slackInviteStatus is replaced with a simple slackInvitedAt: Date — boolean slackInvited is the source of truth, the date records when. Call sites that flip slackInvited:true must stamp slackInvitedAt in the same update (no pre-save hook, per findByIdAndUpdate convention). Sweeps of remaining slackInviteStatus references land in later tasks.
This commit is contained in:
parent
3c49317437
commit
2f6a92ac61
1 changed files with 1 additions and 5 deletions
|
|
@ -59,11 +59,7 @@ const memberSchema = new mongoose.Schema({
|
||||||
nextBillingDate: Date,
|
nextBillingDate: Date,
|
||||||
lastCancelledAt: Date,
|
lastCancelledAt: Date,
|
||||||
slackInvited: { type: Boolean, default: false },
|
slackInvited: { type: Boolean, default: false },
|
||||||
slackInviteStatus: {
|
slackInvitedAt: { type: Date },
|
||||||
type: String,
|
|
||||||
enum: ["pending", "sent", "failed", "accepted", "joined"],
|
|
||||||
default: "pending",
|
|
||||||
},
|
|
||||||
slackUserId: String,
|
slackUserId: String,
|
||||||
|
|
||||||
// Profile fields
|
// Profile fields
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue