Hi Marcin,
Please see inline ...
Am Dienstag, den 04.06.2019, 12:06 -0700 schrieb Marcin Kowalczyk:
> Hi,
>
> So in general - add entry to data db
>
> insert into tp_shared_groups values
> ('2','main_plan','shared_balance','*any','*highest','',NOW());
We don't recommend you updating StorDB directly with queries. You
should either use APIs or .csv.
>
> and then following api calls
>
> {"method":"ApierV1.LoadSharedGroup","params":[{"TPid":"main_plan","Sh
> aredGroupId":"shared_balance"}]}
This is only needed in case you want to change the charging for that
particular shared group.
>
> {"method":"ApierV1.SetBalance","params":[{"Tenant":"shared_balance","
> Account":"user1","BalanceType":"*monetary",
> "BalanceID":"shared","Directions":null,"ExpiryTime":null,"RatingSubje
> ct":null,"Categories":null,"DestinationIds":null,"TimingIds":null,"We
> ight":null,"SharedGroups":"shared_balance","Blocker":null,"Disabled":
> null,"Cdrlog":null,"ExtraData":null}],"id":10}
> {"method":"ApierV1.SetBalance","params":[{"Tenant":"shared_balance","
> Account":"user2","BalanceType":"*monetary",
> "BalanceID":"shared","Directions":null,"ExpiryTime":null,"RatingSubje
> ct":null,"Categories":null,"DestinationIds":null,"TimingIds":null,"We
> ight":null,"SharedGroups":"shared_balance","Blocker":null,"Disabled":
> null,"Cdrlog":null,"ExtraData":null}],"id":10}
> {"method":"ApierV1.SetBalance","params":[{"Tenant":"shared_balance","
> Account":"glowne","BalanceType":"*monetary","BalanceID":"shared","Dir
> ections":null,"Value":30000,"ExpiryTime":null,"RatingSubject":null,"C
> ategories":null,"DestinationIds":null,"TimingIds":null,"Weight":null,
> "SharedGroups":"shared_balance","Blocker":null,"Disabled":null,"Cdrlo
> g":null,"ExtraData":null}],"id":10}
>
>
> {"method":"ApierV1.GetAccount","params":[{"Account":"main","Tenant":"
> shared_balance"}]}
> {"method":"ApierV1.GetAccount","params":[{"Account":"user1","Tenant":
> "shared_balance"}]}
> {"method":"ApierV1.GetAccount","params":[{"Account":"user2","Tenant":
> "shared_balance"}]}
>
> Then assign shared monetary balance to account "main"?
I think you are making it too complicated.
All you need to do is have 2 accounts and assign a shared balance tag
to common balances. The rest is standard.
DanB
>
> Should all balances in users share same "BalanceID" tag?
>
> Thx in advance!
>
> W dniu wtorek, 4 czerwca 2019 13:49:35 UTC+2 użytkownik DanB napisał:
> > Marcin,
> >
> > Yes, shared balance is just a tag to a normal balance. You can add
> > it
> > via either SetAccount or SetBalance.
> >
> > DanB
> >
> > On Mon, 2019-06-03 at 08:48 -0700, Marcin Kowalczyk wrote:
> > > Hi Dan,
> > >
> > > Can it be done by API somehow? I mean creation of shared
> > balance?
> > >
> > >
> >
>
> --
> You received this message because you are subscribed to the Google
> Groups "CGRateS" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to
cgrates+u...@googlegroups.com.
>
https://groups.google.com/d/msgid/cgrates/4784be39-1e25-4a0c-b574-062c113fa482%40googlegroups.com