use strict;
use warnings;

package Liberl::Model::Book;
use Jifty::DBI::Schema;

use Liberl::Record schema {
    column title =>
        type is 'text';
    column publisher =>
        references Liberl::Model::Publisher;
    column isbn =>
        type is 'text';
    column edition =>
        type is 'text';
    column numpages =>
        type is 'integer';
    column exemplaires =>
        type is 'integer',
        since '0.0.6';
    column publication_date =>
        filters are 'Jifty::DBI::Filter::Date';
    column created_on =>
        type is 'timestamp',
        label is 'Created On',
        default is defer { DateTime->now },
        filters are 'Jifty::DBI::Filter::DateTime';
    column format =>
        references Liberl::Model::Format,
        since '0.0.5';
    column library =>
        references Liberl::Model::Library;
    column owner =>
        references Liberl::Model::User;
    column comments =>
        references Liberl::Model::CommentCollection;
    column categories =>
        references Liberl::Model::CategoryCollection;
    column description =>
        type is 'text';
    column cover_key =>
        type is 'text';
};

# Your model-specific methods go here.
sub current_user_can {
    return 1;
}

1;

