File: Merchandise.pm

package info (click to toggle)
libur-perl 0.470%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,192 kB
  • sloc: perl: 61,814; javascript: 255; xml: 108; sh: 13; makefile: 9
file content (32 lines) | stat: -rw-r--r-- 971 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package Vending::Merchandise;

use strict;
use warnings;

use Vending;
class Vending::Merchandise {
    is => [ 'Vending::Content' ],
    table_name => 'merchandise',
    id_sequence_generator_name => 'URMETA_coin_coin_ID_seq',
    id_by => [
        merchandise_id => { is => 'integer' },
    ],
    has => [
        product      => { is => 'Vending::Product', id_by => 'product_id', constraint_name => 'inventory_product_ID_product_product_ID_FK' },
        insert_date  => { is => 'datetime' },
        product_id   => { is => 'integer', implied_by => 'product' },
        name         => { via => 'product' },
        cost_cents   => { via => 'product' },
        price        => { via => 'product' },
        manufacturer => { via => 'product' },
    ],
    schema_name => 'Machine',
    data_source => 'Vending::DataSource::Machine',
    doc => 'instances of things the machine will sell and dispense',
};

sub subtype_name_resolver {
    return __PACKAGE__;
}

1;