use utf8;
package CLMApp::Schema::Result::ChainConcept;

# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

=head1 NAME

CLMApp::Schema::Result::ChainConcept

=cut

use strict;
use warnings;

use base 'DBIx::Class::Core';

=head1 COMPONENTS LOADED

=over 4

=item * L<DBIx::Class::InflateColumn::DateTime>

=back

=cut

__PACKAGE__->load_components("InflateColumn::DateTime");

=head1 TABLE: C<ChainConcept>

=cut

__PACKAGE__->table("ChainConcept");

=head1 ACCESSORS

=head2 chainconceptid

  data_type: 'integer'
  is_auto_increment: 1
  is_foreign_key: 1
  is_nullable: 0

=head2 chainconceptname

  data_type: 'varchar'
  is_nullable: 1
  size: 50

=head2 chainconceptamphireid

  data_type: 'varchar'
  is_nullable: 1
  size: 50

=head2 parentid

  data_type: 'varchar'
  is_nullable: 1
  size: 50

=head2 chaingroupid

  data_type: 'integer'
  is_foreign_key: 1
  is_nullable: 0

=head2 active

  data_type: 'integer'
  default_value: 1
  is_nullable: 1

=head2 thresholdtype

  data_type: 'varchar'
  is_nullable: 1
  size: 255

=head2 thresholdvalue

  data_type: 'integer'
  default_value: 1
  is_nullable: 1

=head2 arrowstreamid

  data_type: 'integer'
  default_value: 0
  is_nullable: 1

=cut

__PACKAGE__->add_columns(
  "chainconceptid",
  {
    data_type         => "integer",
    is_auto_increment => 1,
    is_foreign_key    => 1,
    is_nullable       => 0,
  },
  "chainconceptname",
  { data_type => "varchar", is_nullable => 1, size => 50 },
  "chainconceptamphireid",
  { data_type => "varchar", is_nullable => 1, size => 50 },
  "parentid",
  { data_type => "varchar", is_nullable => 1, size => 50 },
  "active",
  { data_type => "integer", is_nullable => 1 },   
  "chaingroupid",
  {
    data_type         => "integer",
    is_auto_increment => 0,
    is_foreign_key    => 1,
    is_nullable       => 0,
  },  
  "thresholdtype",
  { data_type => "varchar", is_nullable => 1, size => 255 },  
  "thresholdvalue",
  { data_type => "integer", is_nullable => 1 },
  "arrowstreamid",
  { data_type => "integer", default_value => 0, is_nullable => 1 },
);

=head1 PRIMARY KEY

=over 4

=item * L</chainconceptid>

=back

=cut

__PACKAGE__->set_primary_key("chainconceptid");


__PACKAGE__->belongs_to(
  "chaingrp",
  "CLMApp::Schema::Result::ChainGroup",
  { "foreign.chaingroupid" => "self.chaingroupid" },
  { is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" },
);


=head1 RELATIONS

=head2 back_office_system_chain_concepts

Type: has_many

Related object: L<CLMApp::Schema::Result::BackOfficeSystemChainConcept>

=cut

__PACKAGE__->has_many(
  "back_office_system_chain_concepts",
  "CLMApp::Schema::Result::BackOfficeSystemChainConcept",
  { "foreign.chainconceptid" => "self.chainconceptid" },
  { cascade_copy => 0, cascade_delete => 0 },
);

__PACKAGE__->many_to_many(
  "systems" => "back_office_system_chain_concepts", "system"
);

=head2 chainconceptid

Type: belongs_to

Related object: L<CLMApp::Schema::Result::BackOfficeSystemChainConcept>

=cut

__PACKAGE__->belongs_to(
  "chainconceptbackoffice",
  "CLMApp::Schema::Result::BackOfficeSystemChainConcept",
  { "chainconceptid" => "chainconceptid" },
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" },
);

__PACKAGE__->belongs_to(
  "customerconcept",
  "CLMApp::Schema::Result::Customer",
  { "foreign.chainconceptamphireid" => "self.chainconceptamphireid" },
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" },
);


# Created by DBIx::Class::Schema::Loader v0.07039 @ 2017-06-01 23:07:51
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:HQWtWcA4VZ1ke+Iiqf/n5w

__PACKAGE__->has_many(
  "customer",
  "CLMApp::Schema::Result::Customer",
  { "foreign.chainconceptid" => "self.chainconceptid" },
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" },
);

# You can replace this text with custom code or comments, and it will be preserved on regeneration
1;
