change configuration file layout to support multiple distinct databases (with
[freeside.git] / htdocs / docs / man / cust_svc.txt
1 NAME
2     FS::cust_svc - Object method for cust_svc objects
3
4 SYNOPSIS
5       use FS::cust_svc;
6
7       $record = create FS::cust_svc \%hash
8       $record = create FS::cust_svc { 'column' => 'value' };
9
10       $error = $record->insert;
11
12       $error = $new_record->replace($old_record);
13
14       $error = $record->delete;
15
16       $error = $record->check;
17
18       ($label, $value) = $record->label;
19
20 DESCRIPTION
21     An FS::cust_svc represents a service. FS::cust_svc inherits from
22     FS::Record. The following fields are currently supported:
23
24     svcnum - primary key (assigned automatically for new services)
25     pkgnum - Package (see the FS::cust_pkg manpage)
26     svcpart - Service definition (see the FS::part_svc manpage)
27 METHODS
28     create HASHREF
29         Creates a new service. To add the refund to the database,
30         see the section on "insert". Services are normally created
31         by creating FS::svc_ objects (see the FS::svc_acct manpage,
32         the FS::svc_domain manpage, and the FS::svc_acct_sm manpage,
33         among others).
34
35     insert
36         Adds this service to the database. If there is an error,
37         returns the error, otherwise returns false.
38
39     delete
40         Deletes this service from the database. If there is an
41         error, returns the error, otherwise returns false.
42
43         Called by the cancel method of the package (see the
44         FS::cust_pkg manpage).
45
46     replace OLD_RECORD
47         Replaces the OLD_RECORD with this one in the database. If
48         there is an error, returns the error, otherwise returns
49         false.
50
51     check
52         Checks all fields to make sure this is a valid service. If
53         there is an error, returns the error, otehrwise returns
54         false. Called by the insert and replace methods.
55
56     label
57         Returns a list consisting of: - The name of this service
58         (from part_svc) - A meaningful identifier (username, domain,
59         or mail alias) - The table name (i.e. svc_domain) for this
60         service
61
62 BUGS
63     Behaviour of changing the svcpart of cust_svc records is
64     undefined and should possibly be prohibited, and pkg_svc records
65     are not checked.
66
67     pkg_svc records are not checked in general (here).
68
69 SEE ALSO
70     the FS::Record manpage, the FS::cust_pkg manpage, the
71     FS::part_svc manpage, the FS::pkg_svc manpage, schema.html from
72     the base documentation
73
74 HISTORY
75     ivan@voicenet.com 97-jul-10,14
76
77     no TableUtil, no FS::Lock ivan@sisd.com 98-mar-7
78
79     pod ivan@sisd.com 98-sep-21
80
81     $Log: cust_svc.txt,v $
82     Revision 1.2  1998-11-13 09:56:41  ivan
83     change configuration file layout to support multiple distinct databases (with
84     own set of config files, export, etc.)
85  Revision 1.4 1998/11/12 07:58:15 ivan
86     added svcdb to label
87
88     Revision 1.3 1998/11/12 03:45:38 ivan use FS::table_name for all
89     tables qsearch()'ed
90
91     Revision 1.2 1998/11/12 03:32:46 ivan added label method
92