MT#53849 peer/reseller invoicing

Change-Id: Ifdb7b18b28782dca4f33c4e384711ed95e3befc8
mr11.5
Rene Krenn 2 years ago
parent 96b852757f
commit 6366ec8512

@ -285,6 +285,54 @@ __PACKAGE__->belongs_to(
}, },
); );
__PACKAGE__->belongs_to(
"source_reseller_billing_zones_history",
"NGCP::Schema::Result::billing_zones_history",
{ "id" => "source_reseller_billing_zone_id" },
{
is_deferrable => 1,
join_type => "LEFT",
on_delete => "SET NULL",
on_update => "NO ACTION",
},
);
__PACKAGE__->belongs_to(
"destination_reseller_billing_zones_history",
"NGCP::Schema::Result::billing_zones_history",
{ "id" => "destination_reseller_billing_zone_id" },
{
is_deferrable => 1,
join_type => "LEFT",
on_delete => "SET NULL",
on_update => "NO ACTION",
},
);
__PACKAGE__->belongs_to(
"source_carrier_billing_zones_history",
"NGCP::Schema::Result::billing_zones_history",
{ "id" => "source_carrier_billing_zone_id" },
{
is_deferrable => 1,
join_type => "LEFT",
on_delete => "SET NULL",
on_update => "NO ACTION",
},
);
__PACKAGE__->belongs_to(
"destination_carrier_billing_zones_history",
"NGCP::Schema::Result::billing_zones_history",
{ "id" => "destination_carrier_billing_zone_id" },
{
is_deferrable => 1,
join_type => "LEFT",
on_delete => "SET NULL",
on_update => "NO ACTION",
},
);
__PACKAGE__->belongs_to( __PACKAGE__->belongs_to(
"source_account", "source_account",
"NGCP::Schema::Result::contracts", "NGCP::Schema::Result::contracts",

@ -27,7 +27,7 @@ __PACKAGE__->add_columns(
data_type => "integer", data_type => "integer",
extra => { unsigned => 1 }, extra => { unsigned => 1 },
is_foreign_key => 1, is_foreign_key => 1,
is_nullable => 0, is_nullable => 1,
}, },
"name", "name",
{ data_type => "varchar", is_nullable => 0, size => 255 }, { data_type => "varchar", is_nullable => 0, size => 255 },
@ -47,6 +47,13 @@ __PACKAGE__->add_columns(
extra => { list => [ "in", "out", "in_out" ] }, extra => { list => [ "in", "out", "in_out" ] },
is_nullable => 0, is_nullable => 0,
}, },
"category",
{
data_type => "enum",
default_value => "customer",
extra => { list => [ "customer", "peer", "reseller", "did" ] },
is_nullable => 0,
},
); );
@ -56,7 +63,12 @@ __PACKAGE__->belongs_to(
"reseller", "reseller",
"NGCP::Schema::Result::resellers", "NGCP::Schema::Result::resellers",
{ id => "reseller_id" }, { id => "reseller_id" },
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, {
is_deferrable => 1,
join_type => "LEFT",
on_delete => "CASCADE",
on_update => "CASCADE",
},
); );
sub TO_JSON { sub TO_JSON {

Loading…
Cancel
Save