diff --git a/lib/NGCP/Panel/Field/CFSimpleAPICompound.pm b/lib/NGCP/Panel/Field/CFSimpleAPICompound.pm index 4a0d0d3911..466e637ed0 100644 --- a/lib/NGCP/Panel/Field/CFSimpleAPICompound.pm +++ b/lib/NGCP/Panel/Field/CFSimpleAPICompound.pm @@ -21,12 +21,44 @@ has_field 'destinations.announcement_id' => ( type => 'PosInteger', ); +has_field 'destinations.simple_destination' => ( + type => 'Text', +); + +has_field 'destinations.priority' => ( + type => 'Integer', +); + has_field 'times' => ( type => 'Repeatable', do_wrapper => 1, do_label => 0, ); +has_field 'times.hour' => ( + type => 'Text', +); + +has_field 'times.mday' => ( + type => 'Text', +); + +has_field 'times.minute' => ( + type => 'Text', +); + +has_field 'times.month' => ( + type => 'Text', +); + +has_field 'times.wday' => ( + type => 'Text', +); + +has_field 'times.year' => ( + type => 'Text', +); + has_field 'sources' => ( type => 'Repeatable', do_wrapper => 1, diff --git a/lib/NGCP/Panel/Form/Peering/Group.pm b/lib/NGCP/Panel/Form/Peering/Group.pm index ea06483082..7a5ef5ef40 100644 --- a/lib/NGCP/Panel/Form/Peering/Group.pm +++ b/lib/NGCP/Panel/Form/Peering/Group.pm @@ -4,7 +4,6 @@ use HTML::FormHandler::Moose; extends 'HTML::FormHandler'; use HTML::FormHandler::Widget::Block::Bootstrap; -use NGCP::Panel::Field::BillingZone; has '+widget_wrapper' => ( default => 'Bootstrap' ); has_field 'submitid' => ( type => 'Hidden' ); diff --git a/lib/NGCP/Panel/Role/API.pm b/lib/NGCP/Panel/Role/API.pm index 0d029d3a38..7745fe1208 100644 --- a/lib/NGCP/Panel/Role/API.pm +++ b/lib/NGCP/Panel/Role/API.pm @@ -315,6 +315,15 @@ sub validate_fields { } } } + if (defined $resource->{$k} && + $fields->{$k}->$_isa('HTML::FormHandler::Field::Compound') && + "HASH" eq ref $resource->{$k}) { + my @compound_subfields = $fields->{$k}->fields; + if (@compound_subfields) { + my %subfields = map { $_->name => $_ } @compound_subfields; + $self->validate_fields($c, $resource->{$k}, \%subfields, $run); + } + } # only do this for converting back from obj to hal # otherwise it breaks db fields with the \0 and \1 notation