mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Updated Accounts
This commit is contained in:
committed by
Dan Christian Bogos
parent
6d9585b1ff
commit
167f7c0a4a
@@ -110,14 +110,9 @@ func (aS *AccountS) matchingAccountForEvent(tnt string, cgrEv *utils.CGREvent,
|
||||
}
|
||||
return
|
||||
}
|
||||
if _, isDisabled := qAcnt.Opts[utils.Disabled]; isDisabled {
|
||||
if lked {
|
||||
guardian.Guardian.UnguardIDs(refID)
|
||||
}
|
||||
continue
|
||||
}
|
||||
if qAcnt.ActivationInterval != nil && cgrEv.Time != nil &&
|
||||
!qAcnt.ActivationInterval.IsActiveAtTime(*cgrEv.Time) { // not active
|
||||
if _, isDisabled := qAcnt.Opts[utils.Disabled]; isDisabled ||
|
||||
(qAcnt.ActivationInterval != nil && cgrEv.Time != nil &&
|
||||
!qAcnt.ActivationInterval.IsActiveAtTime(*cgrEv.Time)) { // not active
|
||||
if lked {
|
||||
guardian.Guardian.UnguardIDs(refID)
|
||||
}
|
||||
@@ -138,6 +133,9 @@ func (aS *AccountS) matchingAccountForEvent(tnt string, cgrEv *utils.CGREvent,
|
||||
if acnt == nil || acnt.Weight < qAcnt.Weight {
|
||||
acnt = qAcnt
|
||||
if lked {
|
||||
if lkID != utils.EmptyString {
|
||||
guardian.Guardian.UnguardIDs(lkID)
|
||||
}
|
||||
lkID = refID
|
||||
}
|
||||
} else if lked {
|
||||
|
||||
@@ -941,7 +941,7 @@ func (iDB *InternalDB) GetAccountProfileDrv(tenant, id string) (ap *utils.Accoun
|
||||
if !ok || x == nil {
|
||||
return nil, utils.ErrNotFound
|
||||
}
|
||||
return x.(*utils.AccountProfile), nil
|
||||
return x.(*utils.AccountProfile).Clone(), nil
|
||||
}
|
||||
|
||||
func (iDB *InternalDB) SetAccountProfileDrv(ap *utils.AccountProfile) (err error) {
|
||||
|
||||
@@ -139,6 +139,9 @@ func (aP *AccountProfile) Clone() (acnt *AccountProfile) {
|
||||
|
||||
//Clone returns a clone of the ActivationInterval
|
||||
func (aI *ActivationInterval) Clone() *ActivationInterval {
|
||||
if aI == nil {
|
||||
return nil
|
||||
}
|
||||
return &ActivationInterval{
|
||||
ActivationTime: aI.ActivationTime,
|
||||
ExpiryTime: aI.ExpiryTime,
|
||||
|
||||
Reference in New Issue
Block a user