Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ lib/Interchange6/Schema/Result/Cart.pm
lib/Interchange6/Schema/Result/CartProduct.pm
lib/Interchange6/Schema/Result/Country.pm
lib/Interchange6/Schema/Result/Inventory.pm
lib/Interchange6/Schema/Result/InventoryLog.pm
lib/Interchange6/Schema/Result/Location.pm
lib/Interchange6/Schema/Result/LocationType.pm
lib/Interchange6/Schema/Result/Media.pm
lib/Interchange6/Schema/Result/MediaDisplay.pm
lib/Interchange6/Schema/Result/MediaProduct.pm
Expand All @@ -43,6 +46,7 @@ lib/Interchange6/Schema/Result/Product.pm
lib/Interchange6/Schema/Result/ProductAttribute.pm
lib/Interchange6/Schema/Result/ProductAttributeValue.pm
lib/Interchange6/Schema/Result/ProductReview.pm
lib/Interchange6/Schema/Result/ProductSupplier.pm
lib/Interchange6/Schema/Result/Role.pm
lib/Interchange6/Schema/Result/Session.pm
lib/Interchange6/Schema/Result/Setting.pm
Expand All @@ -52,6 +56,7 @@ lib/Interchange6/Schema/Result/ShipmentDestination.pm
lib/Interchange6/Schema/Result/ShipmentRate.pm
lib/Interchange6/Schema/Result/ShipmentMethod.pm
lib/Interchange6/Schema/Result/State.pm
lib/Interchange6/Schema/Result/Supplier.pm
lib/Interchange6/Schema/Result/Tax.pm
lib/Interchange6/Schema/Result/User.pm
lib/Interchange6/Schema/Result/UserAttribute.pm
Expand Down Expand Up @@ -94,3 +99,4 @@ t/lib/Test/Tax.pm
t/lib/Test/User.pm
t/lib/Test/Variant.pm
t/lib/Test/Zone.pm

27 changes: 27 additions & 0 deletions lib/Interchange6/Schema/Result/Address.pm
Original file line number Diff line number Diff line change
Expand Up @@ -339,4 +339,31 @@ Composing rels: L</orderlines_shipping> -> orderline

many_to_many orderlines => "orderlines_shipping", "orderline";

=head2 locations

Type: has_many

Related object: L<Interchange6::Schema::Result::Location>

=cut

has_many
locations => "Interchange6::Schema::Result::Location",
{ "foreign.addresses_id" => "self.addresses_id" },
{ cascade_copy => 0, cascade_delete => 0 };

=head2 suppliers

Type: has_many

Related object: L<Interchange6::Schema::Result::Supplier>

=cut

has_many
suppliers => "Interchange6::Schema::Result::Supplier",
{ "foreign.addresses_id" => "self.addresses_id" },
{ cascade_copy => 0, cascade_delete => 0 };


1;
132 changes: 132 additions & 0 deletions lib/Interchange6/Schema/Result/InventoryLog.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
use utf8;
package Interchange6::Schema::Result::InventoryLog;

=head1 NAME

Interchange6::Schema::Result::InventoryLog

=cut

use Interchange6::Schema::Candy -components =>
[qw(InflateColumn::DateTime TimeStamp)];

=head1 ACCESSORS

=head2 inventory_logs_id

data_type: 'integer'
is_auto_increment: 1
is_nullable: 0
primary key

=cut

primary_column inventory_logs_id => {
data_type => "integer",
is_auto_increment => 1,
is_nullable => 0,
};

=head2 sku

data_type: 'varchar'
is_foreign_key_constraint: 1
is_nullable: 0
size: 64

=cut

column sku => {
data_type => "varchar",
is_foreign_key_constraint => 1,
is_nullable => 0,
size => 64,
};

=head2 datetime

data_type: 'datetime'
set_on_create: 1
is_nullable: 0

=cut

column datetime => {
data_type => "datetime",
set_on_create => 1,
is_nullable => 0
};

=head2 quantity

data_type: 'numeric'
size: [9,2]
is_nullable: 0
default_value: 0

=cut

column quantity => {
data_type => 'numeric',
size => [9,2],
is_nullable => 0,
default_value => 0,
};

=head2 locations_id

data_type: 'integer'
is_foreign_key_constraint: 1
is_nullable: 0

=cut

column locations_id => {
data_type => "integer",
is_foreign_key_constraint => 1,
is_nullable => 0,
};

=head2 suppliers_id

data_type: 'integer'
is_foreign_key_constraint: 1
is_nullable: 0

=cut

column suppliers_id => {
data_type => "integer",
is_foreign_key_constraint => 1,
is_nullable => 0,
};

=head1 RELATIONS

=head2 locations

Type: has_many

Related object: L<Interchange6::Schema::Result::Location>

=cut

belongs_to
locations => "Interchange6::Schema::Result::Location",
{ "foreign.locations_id" => "self.locations_id" },
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" };

=head2 product_suppliers

Type: has_many

Related object: L<Interchange6::Schema::Result::ProductSupplier>

=cut

belongs_to
product_suppliers => "Interchange6::Schema::Result::ProductSupplier",
{ "foreign.suppliers_id" => "self.suppliers_id", "foreign.sku" => "self.sku"},
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" };

1;
156 changes: 156 additions & 0 deletions lib/Interchange6/Schema/Result/Location.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
use utf8;
package Interchange6::Schema::Result::Location;

=head1 NAME

Interchange6::Schema::Result::Location

=cut

use Interchange6::Schema::Candy -components =>
[qw(InflateColumn::DateTime TimeStamp)];

=head1 ACCESSORS

=head2 locations_id

data_type: 'integer'
is_auto_increment: 1
is_nullable: 0
primary key

=cut

primary_column locations_id => {
data_type => "integer",
is_auto_increment => 1,
is_nullable => 0,
};

=head2 name

data_type: 'varchar'
default_value: (empty string)
is_nullable: 0
size: 255

=cut

column name => {
data_type => "varchar",
default_value => "",
is_nullable => 0,
size => 255,
};

=head2 parents_id

data_type: 'integer'
is_foreign_key_constraint: 1
is_nullable: 1

=cut

column parents_id => {
data_type => "integer",
is_foreign_key_constraint => 1,
is_nullable => 1,
};


=head2 addresses_id

data_type: 'integer'
is_foreign_key_constraint: 1
is_nullable: 0

=cut

column addresses_id => {
data_type => "integer",
is_foreign_key_constraint => 1,
is_nullable => 0,
};

=head2 location_types_id

data_type: 'integer'
is_foreign_key_constraint: 1
is_nullable: 0

=cut

column location_types_id => {
data_type => "integer",
is_foreign_key_constraint => 1,
is_nullable => 0,
};

=head1 RELATIONS

=head2 addresses

Type: belongs_to

Related object: L<Interchange6::Schema::Result::Adress>

=cut

belongs_to
addresses => "Interchange6::Schema::Result::Address",
{ "foreign.addresses_id" => "self.addresses_id" },
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" };

=head2 children

Type: has_many

Related object: L<Interchange6::Schema::Result::Location>

=cut

has_many
children => "Interchange6::Schema::Result::Location",
{ "foreign.parents_id" => "self.locations_id" },
{ cascade_copy => 0, cascade_delete => 0 };

=head2 parents

Type: belongs_to

Related object: L<Interchange6::Schema::Result::Location>

=cut

belongs_to
parents => "Interchange6::Schema::Result::Location",
{ "foreign.locations_id" => "self.parents_id" },
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" };

=head2 location_types

Type: belongs_to

Related object: L<Interchange6::Schema::Result::LocationType>

=cut

belongs_to
location_types => "Interchange6::Schema::Result::LocationType",
{ "foreign.location_types_id" => "self.location_types_id" },
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" };

=head2 inventory_logs

Type: has_many

Related object: L<Interchange6::Schema::Result::InventoryLog>

=cut

has_many
inventory_logs => "Interchange6::Schema::Result::InventoryLog",
{ "foreign.locations_id" => "self.locations_id" },
{ cascade_copy => 0, cascade_delete => 0 };

1;
Loading