-use FS::ClientAPI;
-FS::ClientAPI->register_handlers(
- 'Agent/agent_login' => \&agent_login,
- 'Agent/agent_info' => \&agent_info,
- 'Agent/agent_list_customers' => \&agent_list_customers,
-);
+sub _cache {
+ $cache ||= new FS::ClientAPI_SessionCache( {
+ 'namespace' => 'FS::ClientAPI::Agent',
+ } );
+}
+
+sub new_agent {
+ my $p = shift;
+
+ my $conf = new FS::Conf;
+ return { error=>'Disabled' } unless $conf->exists('selfservice-agent_signup');
+
+ #add a customer record and set agent_custnum?
+
+ my $agent = new FS::agent {
+ 'typenum' => $conf->config('selfservice-agent_signup-agent_type'),
+ 'agent' => $p->{'agent'},
+ 'username' => $p->{'username'},
+ '_password' => $p->{'password'},
+ #
+ };