summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlevinse <levinse>2010-11-22 20:53:22 +0000
committerlevinse <levinse>2010-11-22 20:53:22 +0000
commit0873b7a148165c2022e64832c36481fd4f943732 (patch)
tree3bafe7a5880cb7e09078574675c5d8a7b5ac3099
parent82cdd3bf93ccc681baa762322e123b45eac104a7 (diff)
initial commit of svc_dsl, qual, and qual_option - schema and new modules which do nothing
currently, RT7111
-rw-r--r--FS/FS.pm6
-rw-r--r--FS/FS/Mason.pm3
-rw-r--r--FS/FS/Schema.pm62
-rw-r--r--FS/FS/qual.pm132
-rw-r--r--FS/FS/qual_option.pm128
-rw-r--r--FS/FS/svc_dsl.pm247
-rw-r--r--FS/MANIFEST6
-rw-r--r--FS/t/qual.t5
-rw-r--r--FS/t/qual_option.t5
-rw-r--r--FS/t/svc_dsl.t5
10 files changed, 599 insertions, 0 deletions
diff --git a/FS/FS.pm b/FS/FS.pm
index aca33de..668af0a 100644
--- a/FS/FS.pm
+++ b/FS/FS.pm
@@ -148,6 +148,8 @@ L<FS::svc_www> - Web virtual host class.
L<FS::svc_broadband> - DSL, wireless and other broadband class.
+L<FS::svc_dsl> - DSL
+
L<FS::addr_block> - Address block class
L<FS::router> - Router class
@@ -210,6 +212,10 @@ L<FS::part_pkg_report_option> - Package reporting classification class
L<FS::pkg_svc> - Class linking package definitions (see L<FS::part_pkg>) with
service definitions (see L<FS::part_svc>)
+L<FS::qual> - Service qualification class
+
+L<FS::qual_option> - Qualification option class
+
L<FS::reg_code> - One-time registration codes
L<FS::reg_code_pkg> - Class linking registration codes (see L<FS::reg_code>) with package definitions (see L<FS::part_pkg>)
diff --git a/FS/FS/Mason.pm b/FS/FS/Mason.pm
index d3c04db..cb8130f 100644
--- a/FS/FS/Mason.pm
+++ b/FS/FS/Mason.pm
@@ -258,6 +258,9 @@ if ( -e $addl_handler_use_file ) {
use FS::acct_snarf;
use FS::part_pkg_discount;
use FS::svc_cert;
+ use FS::svc_dsl;
+ use FS::qual;
+ use FS::qual_option;
# Sammath Naur
if ( $FS::Mason::addl_handler_use ) {
diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm
index 95c1ce4..89f3c63 100644
--- a/FS/FS/Schema.pm
+++ b/FS/FS/Schema.pm
@@ -906,6 +906,9 @@ sub tables_hashref {
'zip', 'varchar', 'NULL', 10, '', '',
'country', 'char', '', 2, '', '',
'geocode', 'varchar', 'NULL', 20, '', '',
+ 'location_type', 'varchar', 'NULL', 20, '', '',
+ 'location_number', 'varchar', 'NULL', 20, '', '',
+ 'location_kind', 'char', 'NULL', 1, '', '',
],
'primary_key' => 'locationnum',
'unique' => [],
@@ -1674,6 +1677,32 @@ sub tables_hashref {
'unique' => [],
'index' => [ [ 'npa', 'nxx' ], [ 'popnum' ] ],
},
+
+ 'qual' => {
+ 'columns' => [
+ 'qualnum', 'serial', '', '', '', '',
+ 'contactnum', 'int', '', '', '', '',
+ 'svctn', 'int', 'NULL', '', '', '',
+ 'svcdb', 'varchar', '', $char_d, '', '',
+ 'vendor_qual_id', 'varchar', 'NULL', $char_d, '', '',
+ 'status', 'char', '', 1, '', '',
+ ],
+ 'primary_key' => 'qualnum',
+ 'unique' => [],
+ 'index' => [ [ 'contactnum' ] ],
+ },
+
+ 'qual_option' => {
+ 'columns' => [
+ 'optionnum', 'serial', '', '', '', '',
+ 'qualnum', 'int', '', '', '', '',
+ 'optionname', 'varchar', '', $char_d, '', '',
+ 'optionvalue', 'text', 'NULL', '', '', '',
+ ],
+ 'primary_key' => 'optionnum',
+ 'unique' => [],
+ 'index' => [],
+ },
'svc_acct' => {
'columns' => [
@@ -1803,6 +1832,39 @@ sub tables_hashref {
'unique' => [ ],
'index' => [ ['domain'] ],
},
+
+ 'svc_dsl' => {
+ 'columns' => [
+ 'svcnum', 'int', '', '', '', '',
+ 'pushed', 'int', 'NULL', '', '', '',
+ 'desired_dd', 'int', '', '', '', '',
+ 'dd', 'int', 'NULL', '', '', '',
+ 'vendor_order_id', 'varchar', 'NULL', $char_d, '', '',
+ 'vendor_qual_id', 'varchar', 'NULL', $char_d, '', '',
+ 'vendor_order_type', 'char', '', 1, '', '',
+ 'vendor_order_status', 'char', 'NULL', 1, '', '',
+ 'first', 'varchar', '', $char_d, '', '',
+ 'last', 'varchar', '', $char_d, '', '',
+ 'company', 'varchar', 'NULL', $char_d, '', '',
+ 'svctn', 'int', 'NULL', '', '', '',
+ 'loop_type', 'char', 'NULL', 1, '', '',
+ 'lvp', 'varchar', 'NULL', $char_d, '', '',
+ 'cktnum', 'varchar', 'NULL', $char_d, '', '',
+ 'rate_band', 'varchar', 'NULL', $char_d, '', '',
+ 'isp_chg', 'char', 'NULL', 1, '', '',
+ 'isp_prev', 'varchar', 'NULL', $char_d, '', '',
+ 'username', 'varchar', 'NULL', $char_d, '', '',
+ 'password', 'varchar', 'NULL', $char_d, '', '',
+ 'staticips', 'text', 'NULL', '', '', '',
+ 'monitored', 'char', '', 1, '', '',
+ 'last_pull', 'int', 'NULL', '', '', '',
+ 'notes', 'text', 'NULL', '', '', '',
+ ],
+ 'primary_key' => 'svcnum',
+ 'unique' => [ ],
+ 'index' => [ ['svctn'] ],
+ },
+
'domain_record' => {
'columns' => [
diff --git a/FS/FS/qual.pm b/FS/FS/qual.pm
new file mode 100644
index 0000000..30f8e69
--- /dev/null
+++ b/FS/FS/qual.pm
@@ -0,0 +1,132 @@
+package FS::qual;
+
+use strict;
+use base qw( FS::Record );
+use FS::Record qw( qsearch qsearchs );
+
+=head1 NAME
+
+FS::qual - Object methods for qual records
+
+=head1 SYNOPSIS
+
+ use FS::qual;
+
+ $record = new FS::qual \%hash;
+ $record = new FS::qual { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::qual object represents a qualification for service. FS::qual inherits from
+FS::Record. The following fields are currently supported:
+
+=over 4
+
+=item qualnum - primary key
+
+=item contactnum - Contact (Prospect/Customer) - see L<FS::contact>
+
+=item svctn - Service Telephone Number
+
+=item svcdb - table used for this service. See L<FS::svc_dsl> and
+L<FS::svc_broadband>, among others.
+
+=item vendor_qual_id - qualification id from vendor/telco
+
+=item status - qualification status (e.g. (N)ew, (P)ending, (Q)ualifies)
+
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new qualification. To add the qualification to the database, see L<"insert">.
+
+Note that this stores the hash reference, not a distinct copy of the hash it
+points to. You can ask the object for a copy with the I<hash> method.
+
+=cut
+
+# the new method can be inherited from FS::Record, if a table method is defined
+
+sub table { 'qual'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=cut
+
+# the insert method can be inherited from FS::Record
+
+=item delete
+
+Delete this record from the database.
+
+=cut
+
+# the delete method can be inherited from FS::Record
+
+=item replace OLD_RECORD
+
+Replaces the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+# the replace method can be inherited from FS::Record
+
+=item check
+
+Checks all fields to make sure this is a valid qualification. If there is
+an error, returns the error, otherwise returns false. Called by the insert
+and replace methods.
+
+=cut
+
+# the check method should currently be supplied - FS::Record contains some
+# data checking routines
+
+sub check {
+ my $self = shift;
+
+ my $error =
+ $self->ut_numbern('qualnum')
+ || $self->ut_number('contactnum')
+ || $self->ut_numbern('svctn')
+ || $self->ut_alpha('svcdb')
+ || $self->ut_textn('vendor_qual_id')
+ || $self->ut_alpha('status')
+ ;
+ return $error if $error;
+
+ $self->SUPER::check;
+}
+
+=back
+
+=head1 BUGS
+
+This doesn't do anything yet.
+
+=head1 SEE ALSO
+
+L<FS::Record>, schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/qual_option.pm b/FS/FS/qual_option.pm
new file mode 100644
index 0000000..c8b7547
--- /dev/null
+++ b/FS/FS/qual_option.pm
@@ -0,0 +1,128 @@
+package FS::qual_option;
+
+use strict;
+use base qw( FS::Record );
+use FS::Record qw( qsearch qsearchs );
+use FS::qual;
+
+=head1 NAME
+
+FS::qual_option - Object methods for qual_option records
+
+=head1 SYNOPSIS
+
+ use FS::qual_option;
+
+ $record = new FS::qual_option \%hash;
+ $record = new FS::qual_option { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::qual_option object represents a qualification option.
+FS::qual_option inherits from FS::Record. The following fields are currently
+supported:
+
+=over 4
+
+=item optionnum - primary key
+
+=item qualnum - qualification (see L<FS::qual>)
+
+=item optionname - option name
+
+=item optionvalue - option value
+
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new qualification option. To add the qualification option to the
+database, see L<"insert">.
+
+Note that this stores the hash reference, not a distinct copy of the hash it
+points to. You can ask the object for a copy with the I<hash> method.
+
+=cut
+
+# the new method can be inherited from FS::Record, if a table method is defined
+
+sub table { 'qual_option'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=cut
+
+# the insert method can be inherited from FS::Record
+
+=item delete
+
+Delete this record from the database.
+
+=cut
+
+# the delete method can be inherited from FS::Record
+
+=item replace OLD_RECORD
+
+Replaces the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+# the replace method can be inherited from FS::Record
+
+=item check
+
+Checks all fields to make sure this is a valid qualification option. If there
+is an error, returns the error, otherwise returns false. Called by the insert
+and replace methods.
+
+=cut
+
+# the check method should currently be supplied - FS::Record contains some
+# data checking routines
+
+sub check {
+ my $self = shift;
+
+ my $error =
+ $self->ut_numbern('optionnum')
+ || $self->ut_foreign_key('qualnum', 'qual', 'qualnum')
+ || $self->ut_alpha('optionname')
+ || $self->ut_textn('optionvalue')
+ ;
+ return $error if $error;
+
+ $self->SUPER::check;
+}
+
+=back
+
+=head1 BUGS
+
+This doesn't do anything yet.
+
+=head1 SEE ALSO
+
+L<FS::qual>, L<FS::Record>, schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/svc_dsl.pm b/FS/FS/svc_dsl.pm
new file mode 100644
index 0000000..0b4b0d1
--- /dev/null
+++ b/FS/FS/svc_dsl.pm
@@ -0,0 +1,247 @@
+package FS::svc_dsl;
+
+use strict;
+use vars qw( @ISA $conf $DEBUG $me );
+use FS::Record qw( qsearch qsearchs );
+use FS::svc_Common;
+
+@ISA = qw( FS::svc_Common );
+$DEBUG = 0;
+$me = '[FS::svc_dsl]';
+
+FS::UID->install_callback( sub {
+ $conf = new FS::Conf;
+}
+);
+
+=head1 NAME
+
+FS::svc_dsl - Object methods for svc_dsl records
+
+=head1 SYNOPSIS
+
+ use FS::svc_dsl;
+
+ $record = new FS::svc_dsl \%hash;
+ $record = new FS::svc_dsl { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+ $error = $record->suspend;
+
+ $error = $record->unsuspend;
+
+ $error = $record->cancel;
+
+=head1 DESCRIPTION
+
+An FS::svc_dsl object represents a DSL service. FS::svc_dsl inherits from
+FS::svc_Common. The following fields are currently supported:
+
+=over 4
+
+=item svcnum
+
+Primary key (assigned automatcially for new DSL))
+
+=item pushed
+
+Time the DSL order was pushed to a vendor, if exporting orders to a vendor/telco
+
+=item desired_dd
+
+Desired Due Date
+
+=item dd
+
+Due Date (e.g. once order is in Assigned status or similar by the telco)
+
+=item vendor_order_id
+
+Vendor/telco DSL order #
+
+=item vendor_order_type
+
+Vendor/telco DSL order type (e.g. (M)ove, (A)dd, (C)hange, (D)elete, or similar)
+
+=item vendor_order_status
+
+Vendor/telco DSL order status (e.g. (N)ew, (A)ssigned, (R)ejected, (M)revised,
+(C)ompleted, (X)cancelled, or similar)
+
+=item first
+
+End-user first name
+
+=item last
+
+End-user last name
+
+=item company
+
+End-user company name
+
+=item svctn
+
+DSL Telephone Number
+
+=item loop_type
+
+Loop-type - vendor/telco-specific
+
+=item lvp
+
+Local Voice Provider's name
+
+=item cktnum
+
+Circuit #
+
+=item rate_band
+
+Rate Band
+
+=item isp_chg
+
+=item isp_prev
+
+=item staticips
+
+=item vendor_qual_id
+
+Ikano-specific fields, do not use otherwise
+
+=item username
+
+If outsourced PPPoE/RADIUS, username
+
+=item password
+
+If outsourced PPPoE/RADIUS, password
+
+=item monitored
+
+Order is monitored (auto-pull/sync), either Y or blank
+
+=item last_pull
+
+Time of last data pull from vendor/telco
+
+=item notes
+
+DSL order notes placed by staff or vendor/telco on the vendor/telco order
+
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new DSL. To add the DSL to the database, see L<"insert">.
+
+Note that this stores the hash reference, not a distinct copy of the hash it
+points to. You can ask the object for a copy with the I<hash> method.
+
+=cut
+
+# the new method can be inherited from FS::Record, if a table method is defined
+
+sub table { 'svc_dsl'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=cut
+
+# the insert method can be inherited from FS::Record
+
+=item delete
+
+Delete this record from the database.
+
+=cut
+
+# the delete method can be inherited from FS::Record
+
+=item replace OLD_RECORD
+
+Replaces the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+# the replace method can be inherited from FS::Record
+
+=item check
+
+Checks all fields to make sure this is a valid DSL. If there is
+an error, returns the error, otherwise returns false. Called by the insert
+and replace methods.
+
+=cut
+
+# the check method should currently be supplied - FS::Record contains some
+# data checking routines
+
+sub check {
+ my $self = shift;
+
+ my $error =
+ $self->ut_numbern('svcnum')
+ || $self->ut_numbern('pushed')
+ || $self->ut_number('desired_dd')
+ || $self->ut_numbern('dd')
+ || $self->ut_textn('vendor_order_id')
+ || $self->ut_textn('vendor_qual_id')
+ || $self->ut_alpha('vendor_order_type')
+ || $self->ut_alphan('vendor_order_status')
+ || $self->ut_text('first')
+ || $self->ut_text('last')
+ || $self->ut_textn('company')
+ || $self->ut_numbern('svctn')
+ || $self->ut_alphasn('loop_type')
+ || $self->ut_textn('lvp')
+ || $self->ut_textn('cktnum')
+ || $self->ut_textn('rate_band')
+ || $self->ut_alphan('isp_chg')
+ || $self->ut_textn('isp_prev')
+ || $self->ut_textn('username')
+ || $self->ut_textn('password')
+ || $self->ut_textn('staticips')
+ || $self->ut_enum('monitored', [ '', 'Y' ])
+ || $self->ut_numbern('last_pull')
+ || $self->ut_textn('notes')
+ ;
+ return $error if $error;
+
+ $self->SUPER::check;
+}
+
+=back
+
+=head1 BUGS
+
+This doesn't do anything yet.
+
+=head1 SEE ALSO
+
+L<FS::svc_Common>, edit/part_svc.cgi from an installed web interface,
+export.html from the base documentation, L<FS::Record>, L<FS::Conf>,
+L<FS::cust_svc>, L<FS::part_svc>, L<FS::cust_pkg>, L<FS::queue>,
+L<freeside-queued>, schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/MANIFEST b/FS/MANIFEST
index 8fd6726..bd37d7b 100644
--- a/FS/MANIFEST
+++ b/FS/MANIFEST
@@ -540,3 +540,9 @@ FS/part_pkg_discount.pm
t/part_pkg_discount.t
FS/svc_cert.pm
t/svc_cert.t
+FS/svc_dsl.pm
+t/svc_dsl.t
+FS/qual.pm
+t/qual.t
+FS/qual_option.pm
+t/qual_option.t
diff --git a/FS/t/qual.t b/FS/t/qual.t
new file mode 100644
index 0000000..5744483
--- /dev/null
+++ b/FS/t/qual.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::qual;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/qual_option.t b/FS/t/qual_option.t
new file mode 100644
index 0000000..a5f7678
--- /dev/null
+++ b/FS/t/qual_option.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::qual_option;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/svc_dsl.t b/FS/t/svc_dsl.t
new file mode 100644
index 0000000..58cd0cf
--- /dev/null
+++ b/FS/t/svc_dsl.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::svc_dsl;
+$loaded=1;
+print "ok 1\n";