MT#59835 /api/billingzones fix HAL ngcp:billingfees relation

* billing fees relation was rendering all associated billing fees
  and that was causing huge data sets to be returned if a billing
  zones had many fees, now instead a single link is returned
  /api/billingfees/?billing_zone_id=:id. this is also on par
  with other links like /api/billingfees/:id

Change-Id: Iabb7afb3bf43abf9a22c71750d45a1962a7f16ec
(cherry picked from commit e4cda08bd4)
mr11.5
Kirill Solomko 1 year ago
parent 8d97e6631f
commit 96364f14a5

@ -56,7 +56,7 @@ sub hal_from_zone {
Data::HAL::Link->new(relation => 'profile', href => 'http://purl.org/sipwise/ngcp-api/'),
Data::HAL::Link->new(relation => 'self', href => sprintf("%s%d", $self->dispatch_path, $zone->id)),
Data::HAL::Link->new(relation => 'ngcp:billingprofiles', href => sprintf("/api/billingprofiles/%d", $zone->billing_profile->id)),
( map { Data::HAL::Link->new(relation => 'ngcp:billingfees', href => sprintf("/api/billingfees/%d", $_->id)) } $zone->billing_fees->all ),
Data::HAL::Link->new(relation => 'ngcp:billingfees', href => sprintf("/api/billingfees/?billing_zone_id=%d", $zone->id)),
$self->get_journal_relation_link($c, $zone->id),
],
relation => 'ngcp:'.$self->resource_name,

Loading…
Cancel
Save