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:
Jennie Robinson Faber 2026-04-29 12:11:25 +01:00
parent 3c49317437
commit 2f6a92ac61

View file

@ -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