File Coverage

blib/lib/Interchange6/Schema/Result/ShipmentMethod.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1 2     2   1313 use utf8;
  2         5  
  2         13  
2              
3             package Interchange6::Schema::Result::ShipmentMethod;
4              
5             =head1 NAME
6              
7             Interchange6::Schema::Result::ShipmentMethod
8              
9             =cut
10              
11 2         20 use Interchange6::Schema::Candy -components =>
12 2     2   110 [qw(InflateColumn::DateTime TimeStamp)];
  2         5  
13              
14             =head1 ACCESSORS
15              
16             =head2 shipment_methods_id
17              
18             Primary key.
19              
20             =cut
21              
22             primary_column shipment_methods_id =>
23             { data_type => "integer", is_auto_increment => 1 };
24              
25             =head2 name
26              
27             Name. e.g.: priority.
28              
29             Defaults to empty string.
30              
31             =cut
32              
33             column name => {
34             data_type => "varchar",
35             default_value => "",
36             size => 255
37             };
38              
39             =head2 title
40              
41             Full title of shipment method, e.g.: Priority 3-5 busines days.
42              
43             Defaults to empty string.
44              
45             =cut
46              
47             column title => {
48             data_type => "varchar",
49             default_value => "",
50             size => 255
51             };
52              
53             =head2 shipment_carriers_id
54              
55             FK on L<Interchange6::Schema::Result::ShipmentCarrier/shipment_carriers_id>.
56              
57             =cut
58              
59             column shipment_carriers_id =>
60             { data_type => "integer" };
61              
62             =head2 active
63              
64             Whether this shipment method is active. Defaults to 1 (true).
65              
66             =cut
67              
68             column active =>
69             { data_type => "boolean", default_value => 1 };
70              
71             =head2 created
72              
73             Date and time when this record was created returned as L<DateTime> object.
74             Value is auto-set on insert.
75              
76             =cut
77              
78             column created => {
79             data_type => "datetime",
80             set_on_create => 1
81             };
82              
83             =head2 last_modified
84              
85             Date and time when this record was last modified returned as L<DateTime> object.
86             Value is auto-set on insert and update.
87              
88             =cut
89              
90             column last_modified => {
91             data_type => "datetime",
92             set_on_create => 1,
93             set_on_update => 1
94             };
95              
96             =head1 RELATIONS
97              
98             =head2 shipment_carrier
99              
100             Type: belongs_to
101              
102             Related object: L<Interchange6::Schema::Result::ShipmentCarrier>
103              
104             =cut
105              
106             belongs_to
107             shipment_carrier => "Interchange6::Schema::Result::ShipmentCarrier",
108             "shipment_carriers_id",
109             { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" };
110              
111             =head2 shipment_rates
112              
113             Type: has_many
114              
115             Related object: L<Interchange6::Schema::Result::ShipmentRate>
116              
117             =cut
118              
119             has_many
120             shipment_rates => "Interchange6::Schema::Result::ShipmentRate",
121             "shipment_methods_id",
122             { cascade_copy => 0, cascade_delete => 0 };
123              
124             1;