diff --git a/lib/NGCP/Schema/Result/location.pm b/lib/NGCP/Schema/Result/location.pm index 8205f682..3a74e86c 100644 --- a/lib/NGCP/Schema/Result/location.pm +++ b/lib/NGCP/Schema/Result/location.pm @@ -78,6 +78,20 @@ __PACKAGE__->set_primary_key("id"); __PACKAGE__->add_unique_constraint("ruid_idx", ["ruid"]); +# handle with care, you need to join them together yourself, like: +# { 'domain.id' => { -ident => 'subscriber.domain_id' } }, +# { join => [ 'subscriber', 'domain' ] } +__PACKAGE__->belongs_to( + "subscriber", + "NGCP::Schema::Result::provisioning_voip_subscribers", + { "foreign.username" => "self.username" }, +); +__PACKAGE__->belongs_to( + "domain", + "NGCP::Schema::Result::voip_domains", + { "foreign.domain" => "self.domain" }, +); + sub TO_JSON { my ($self) = @_; return {