Beispiel #1
0
 private void Handle(PartnerCreatedEvent evnt)
 {
     _userId        = evnt.UserId;
     _walletId      = evnt.WalletId;
     _info          = evnt.Info;
     _statisticInfo = new PartnerStatisticInfo(0M, 0M, 0M, 0M, 0M, 0M, DateTime.Now);
 }
Beispiel #2
0
        public void Update(PartnerInfo info)
        {
            info.CheckNotNull(nameof(info));

            if (_info.IsLocked && !info.IsLocked)
            {
                //如果原来是锁定状态 现在是解锁 更新结算日期到解锁日期
                var statisticInfo = _statisticInfo;
                statisticInfo.BalancedDate = DateTime.Now;
                ApplyEvent(new PartnerStatisticInfoChangedEvent(statisticInfo));
            }
            ApplyEvent(new PartnerUpdatedEvent(info));
        }
Beispiel #3
0
        private PartnerStatisticInfo _statisticInfo; //统计信息

        public Partner(Guid id, Guid userId, Guid walletId, PartnerInfo info) : base(id)
        {
            ApplyEvent(new PartnerCreatedEvent(userId, walletId, info));
        }
Beispiel #4
0
 private void Handle(PartnerDeletedEvent evnt)
 {
     _info          = null;
     _statisticInfo = null;
 }
Beispiel #5
0
 private void Handle(PartnerUpdatedEvent evnt)
 {
     _info = evnt.Info;
 }