From 933d3b8d2bd6005af70ae918087489eeea91d47a Mon Sep 17 00:00:00 2001 From: Kirill Solomko Date: Mon, 12 Oct 2015 13:11:41 +0200 Subject: [PATCH] MT#14679 new voip_mail_to_fax tables, new voip_fax_journal table Change-Id: I2d8d3b26613582a77a211fa469ce08548071f949 --- .../Result/provisioning_voip_subscribers.pm | 52 +++++ lib/NGCP/Schema/Result/voip_fax_journal.pm | 217 ++++++++++++++++++ .../Schema/Result/voip_mail_to_fax_acl.pm | 139 +++++++++++ .../Result/voip_mail_to_fax_preferences.pm | 150 ++++++++++++ .../voip_mail_to_fax_secret_renew_notify.pm | 117 ++++++++++ 5 files changed, 675 insertions(+) create mode 100644 lib/NGCP/Schema/Result/voip_fax_journal.pm create mode 100644 lib/NGCP/Schema/Result/voip_mail_to_fax_acl.pm create mode 100644 lib/NGCP/Schema/Result/voip_mail_to_fax_preferences.pm create mode 100644 lib/NGCP/Schema/Result/voip_mail_to_fax_secret_renew_notify.pm diff --git a/lib/NGCP/Schema/Result/provisioning_voip_subscribers.pm b/lib/NGCP/Schema/Result/provisioning_voip_subscribers.pm index 79797c63..80b1c046 100644 --- a/lib/NGCP/Schema/Result/provisioning_voip_subscribers.pm +++ b/lib/NGCP/Schema/Result/provisioning_voip_subscribers.pm @@ -154,6 +154,34 @@ __PACKAGE__->might_have( { cascade_copy => 0, cascade_delete => 0 }, ); +__PACKAGE__->has_many( + "voip_fax_journals", + "NGCP::Schema::Result::voip_fax_journal", + { 'foreign.subscriber_id' => 'self.id' }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +__PACKAGE__->has_many( + "voip_mail_to_fax_secrets_renew_notify", + "NGCP::Schema::Result::voip_mail_to_fax_secret_renew_notify", + { "foreign.subscriber_id" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +__PACKAGE__->has_many( + "voip_mail_to_fax_acls", + "NGCP::Schema::Result::voip_mail_to_fax_acl", + { "foreign.subscriber_id" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +__PACKAGE__->might_have( + "voip_mail_to_fax_preference", + "NGCP::Schema::Result::voip_mail_to_fax_preferences", + { "foreign.subscriber_id" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + __PACKAGE__->has_many( "voip_pbx_groups", "NGCP::Schema::Result::voip_pbx_groups", @@ -465,6 +493,30 @@ Type: might_have Related object: L +=head2 voip_fax_journals + +Type: has_many + +Related object: L + +=head2 voip_mail_to_fax_preference + +Type: might_have + +Related object: L + +=head2 voip_mail_to_fax_secrets_renew_notify + +Type: has_many + +Related object: L + +=head2 voip_mail_to_fax_acls + +Type: has_many + +Related object: L + =head2 voip_reminder Type: might_have diff --git a/lib/NGCP/Schema/Result/voip_fax_journal.pm b/lib/NGCP/Schema/Result/voip_fax_journal.pm new file mode 100644 index 00000000..fc042a4c --- /dev/null +++ b/lib/NGCP/Schema/Result/voip_fax_journal.pm @@ -0,0 +1,217 @@ +package NGCP::Schema::Result::voip_fax_journal; +use Scalar::Util qw(blessed); +use parent 'DBIx::Class::Core'; + +our $VERSION = '2.007'; + +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "Helper::Row::ToJSON", + "+NGCP::Schema::InflateColumn::DateTime::EpochString", +); + +__PACKAGE__->table("provisioning.voip_fax_journal"); + +__PACKAGE__->add_columns( + "id", + { + data_type => "integer", + extra => { unsigned => 1 }, + is_auto_increment => 1, + is_nullable => 0, + }, + "subscriber_id", + { + data_type => "integer", + default_value => 0, + extra => { unsigned => 1 }, + is_nullable => 0, + }, + "time", + { data_type => "decimal", + is_nullable => 0, + size => [13, 3], + inflate_datetime => 'epoch_milli' + }, + "direction", + { + data_type => "enum", + extra => { list => ["in", "out", "mtf" ] }, + is_nullable => 0, + }, + "duration", + { + data_type => "integer", + default_value => 0, + extra => { unsigned => 1 }, + is_nullable => 0, + }, + "caller", + { data_type => "varchar", is_nullable => 0, size => 255 }, + "callee", + { data_type => "varchar", is_nullable => 0, size => 255 }, + "pages", + { + data_type => "integer", + default_value => 0, + extra => { unsigned => 1 }, + is_nullable => 0, + }, + "reason", + { data_type => "varchar", is_nullable => 0, size => 255 }, + "status", + { data_type => "varchar", default_value => "", is_nullable => 0, size => 255 }, + "signal_rate", + { + data_type => "integer", + default_value => 0, + extra => { unsigned => 1 }, + is_nullable => 0, + }, + "quality", + { data_type => "varchar", default_value => "", is_nullable => 0, size => 255 }, + "filename", + { data_type => "varchar", default_value => "", is_nullable => 0, size => 255 }, + "sid", + { data_type => "varchar", is_nullable => 0, size => 255 }, +); +__PACKAGE__->belongs_to( + "provisioning_voip_subscriber", + "NGCP::Schema::Result::provisioning_voip_subscribers", + { 'foreign.id' => 'self.subscriber_id' }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +__PACKAGE__->set_primary_key("id"); + +sub TO_JSON { + my ($self) = @_; + return { + map { blessed($_) && $_->isa('DateTime') ? $_->datetime : $_ } %{ $self->next::method } + }; +} + +1; +__END__ + +=encoding UTF-8 + +=head1 NAME + +NGCP::Schema::Result::voip_fax_journal + +=head1 COMPONENTS LOADED + +=over 4 + +=item * L + +=item * L + +=back + +=head1 TABLE: C + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + extra: {unsigned => 1} + is_auto_increment: 1 + is_nullable: 0 + +=head2 subscriber_id + + data_type: 'integer' + default_value: 0 + extra: {unsigned => 1} + is_nullable: 0 + +=head2 time + + data_type: 'decimal' + is_nullable: 0 + size: [13,3] + +=head2 direction + + data_type: 'enum' + default_value: 'in' + extra: {list => ["in","out","mtf"]} + is_nullable: 0 + +=head2 duration + + data_type: 'integer' + default_value: 0 + extra: {unsigned => 1} + is_nullable: 0 + +=head2 caller + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +=head2 callee + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +=head2 pages + + data_type: 'integer' + default_value: 0 + extra: {unsigned => 1} + is_nullable: 0 + +=head2 reason + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +=head2 status + + data_type: 'varchar' + default_value: (empty string) + is_nullable: 0 + size: 255 + +=head2 signal_rate + + data_type: 'integer' + default_value: 0 + extra: {unsigned => 1} + is_nullable: 0 + +=head2 quality + + data_type: 'varchar' + default_value: (empty string) + is_nullable: 0 + size: 255 + +=head2 filename + + data_type: 'varchar' + default_value: (empty string) + is_nullable: 0 + size: 255 + +=head2 sid + + data_type: 'varchar' + is_nullable: 0 + size: 255 + + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back diff --git a/lib/NGCP/Schema/Result/voip_mail_to_fax_acl.pm b/lib/NGCP/Schema/Result/voip_mail_to_fax_acl.pm new file mode 100644 index 00000000..55c110ba --- /dev/null +++ b/lib/NGCP/Schema/Result/voip_mail_to_fax_acl.pm @@ -0,0 +1,139 @@ +package NGCP::Schema::Result::voip_mail_to_fax_acl; +use Scalar::Util qw(blessed); +use parent 'DBIx::Class::Core'; + +our $VERSION = '2.007'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Helper::Row::ToJSON"); + +__PACKAGE__->table("provisioning.voip_mail_to_fax_acl"); + +__PACKAGE__->add_columns( + "id", + { + data_type => "integer", + extra => { unsigned => 1 }, + is_auto_increment => 1, + is_nullable => 0, + }, + "subscriber_id", + { + data_type => "integer", + extra => { unsigned => 1 }, + is_foreign_key => 1, + is_nullable => 0, + }, + "from_email", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "received_from", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "destination", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "use_regex", + { data_type => "integer", is_nullable => 0, default_value => 0 }, +); + +__PACKAGE__->set_primary_key("id"); + +__PACKAGE__->belongs_to( + "provisioning_voip_subscriber", + "NGCP::Schema::Result::provisioning_voip_subscribers", + { id => "subscriber_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + +sub TO_JSON { + my ($self) = @_; + return { + map { blessed($_) && $_->isa('DateTime') ? $_->datetime : $_ } %{ $self->next::method } + }; +} + +1; +__END__ + +=encoding UTF-8 + +=head1 NAME + +NGCP::Schema::Result::voip_mail_to_fax_acl + +=head1 COMPONENTS LOADED + +=over 4 + +=item * L + +=item * L + +=back + +=head1 TABLE: C + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + extra: {unsigned => 1} + is_auto_increment: 1 + is_nullable: 0 + +=head2 subscriber_id + + data_type: 'integer' + extra: {unsigned => 1} + is_foreign_key: 1 + is_nullable: 0 + +=head2 from_email + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 received_from + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 destination + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 use_regex + + data_type: 'integer' + is_nullable: 0 + default_value: 0 + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=head1 UNIQUE CONSTRAINTS + +=head2 C + +=over 4 + +=item * L + +=item * L + +=back + +=head1 RELATIONS + +=head2 subscriber + +Type: belongs_to + +Related object: L diff --git a/lib/NGCP/Schema/Result/voip_mail_to_fax_preferences.pm b/lib/NGCP/Schema/Result/voip_mail_to_fax_preferences.pm new file mode 100644 index 00000000..b767763f --- /dev/null +++ b/lib/NGCP/Schema/Result/voip_mail_to_fax_preferences.pm @@ -0,0 +1,150 @@ +package NGCP::Schema::Result::voip_mail_to_fax_preferences; +use Scalar::Util qw(blessed); +use parent 'DBIx::Class::Core'; + +our $VERSION = '2.007'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Helper::Row::ToJSON"); + +__PACKAGE__->table("provisioning.voip_mail_to_fax_preferences"); + +__PACKAGE__->add_columns( + "id", + { + data_type => "integer", + extra => { unsigned => 1 }, + is_auto_increment => 1, + is_nullable => 0, + }, + "subscriber_id", + { + data_type => "integer", + extra => { unsigned => 1 }, + is_foreign_key => 1, + is_nullable => 0, + }, + "active", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, + "secret_key", + { data_type => "varchar", is_nullable => 1 }, + "last_secret_key_modify", + { + data_type => 'timestamp', + datetime_undef_if_invalid => 1, + default_value => '0000-00-00 00:00:00', + is_nullable => 0, + }, + "secret_key_renew", + { + data_type => "enum", + default_value => "never", + extra => { list => ["never", "daily", "weekly", "monthly"] }, + is_nullable => 0, + }, +); + +__PACKAGE__->set_primary_key("id"); + +__PACKAGE__->add_unique_constraint("subscriberid_idx", ["subscriber_id"]); + +__PACKAGE__->belongs_to( + "provisioning_voip_subscriber", + "NGCP::Schema::Result::provisioning_voip_subscribers", + { id => "subscriber_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + +sub TO_JSON { + my ($self) = @_; + return { + map { blessed($_) && $_->isa('DateTime') ? $_->datetime : $_ } %{ $self->next::method } + }; +} + +1; +__END__ + +=encoding UTF-8 + +=head1 NAME + +NGCP::Schema::Result::voip_mail_to_fax_preferences + +=head1 COMPONENTS LOADED + +=over 4 + +=item * L + +=item * L + +=back + +=head1 TABLE: C + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + extra: {unsigned => 1} + is_auto_increment: 1 + is_nullable: 0 + +=head2 subscriber_id + + data_type: 'integer' + extra: {unsigned => 1} + is_foreign_key: 1 + is_nullable: 0 + +=head2 active + + data_type: 'tinyint' + default_value: 0 + is_nullable: 0 + +=head2 secret_key + + data_type: 'varchar' + is_nullable: 1 + +=head2 last_secret_key_modify + + data_type: 'timestamp', + datetime_undef_if_invalid: 1 + default_value: '0000-00-00 00:00:00' + is_nullable: 0 + +=head2 secret_key_renew + + data_type: 'enum' + default_value: 'never' + extra: {list => ["never","daily","weekly","monthly"]} + is_nullable: 0 + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=head1 UNIQUE CONSTRAINTS + +=head2 C + +=over 4 + +=item * L + +=back + +=head1 RELATIONS + +=head2 subscriber + +Type: belongs_to + +Related object: L diff --git a/lib/NGCP/Schema/Result/voip_mail_to_fax_secret_renew_notify.pm b/lib/NGCP/Schema/Result/voip_mail_to_fax_secret_renew_notify.pm new file mode 100644 index 00000000..1c95e38c --- /dev/null +++ b/lib/NGCP/Schema/Result/voip_mail_to_fax_secret_renew_notify.pm @@ -0,0 +1,117 @@ +package NGCP::Schema::Result::voip_mail_to_fax_secret_renew_notify; +use Scalar::Util qw(blessed); +use parent 'DBIx::Class::Core'; + +our $VERSION = '2.007'; + +__PACKAGE__->load_components("InflateColumn::DateTime", "Helper::Row::ToJSON"); + +__PACKAGE__->table("provisioning.voip_mail_to_fax_secret_renew_notify"); + +__PACKAGE__->add_columns( + "id", + { + data_type => "integer", + extra => { unsigned => 1 }, + is_auto_increment => 1, + is_nullable => 0, + }, + "subscriber_id", + { + data_type => "integer", + extra => { unsigned => 1 }, + is_foreign_key => 1, + is_nullable => 0, + }, + "destination", + { data_type => "varchar", is_nullable => 0, size => 255 }, +); + +__PACKAGE__->set_primary_key("id"); + +__PACKAGE__->add_unique_constraint("subdest_idx", ["subscriber_id", "destination"]); + +__PACKAGE__->belongs_to( + "provisioning_voip_subscriber", + "NGCP::Schema::Result::provisioning_voip_subscribers", + { id => "subscriber_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + +sub TO_JSON { + my ($self) = @_; + return { + map { blessed($_) && $_->isa('DateTime') ? $_->datetime : $_ } %{ $self->next::method } + }; +} + +1; +__END__ + +=encoding UTF-8 + +=head1 NAME + +NGCP::Schema::Result::voip_mail_to_fax_secret_renew_notify + +=head1 COMPONENTS LOADED + +=over 4 + +=item * L + +=item * L + +=back + +=head1 TABLE: C + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + extra: {unsigned => 1} + is_auto_increment: 1 + is_nullable: 0 + +=head2 subscriber_id + + data_type: 'integer' + extra: {unsigned => 1} + is_foreign_key: 1 + is_nullable: 0 + +=head2 destination + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=head1 UNIQUE CONSTRAINTS + +=head2 C + +=over 4 + +=item * L + +=item * L + +=back + +=head1 RELATIONS + +=head2 subscriber + +Type: belongs_to + +Related object: L