Updated status events to happen before subscribed events

no-issue

Given that status events are used to determine signup events,
they should be the first event for a member.
This commit is contained in:
Fabien O'Carroll 2021-03-05 12:39:30 +00:00
parent 58c9c1c649
commit d662003fdb

View File

@ -89,6 +89,12 @@ module.exports = class MemberRepository {
source = 'member';
}
await this._MemberStatusEvent.add({
member_id: member.id,
from_status: null,
to_status: member.get('status')
}, options);
if (member.get('subscribed')) {
await this._MemberSubscribeEvent.add({
member_id: member.id,
@ -97,12 +103,6 @@ module.exports = class MemberRepository {
}, options);
}
await this._MemberStatusEvent.add({
member_id: member.id,
from_status: null,
to_status: member.get('status')
}, options);
return member;
}