From 1cea8fb01de9b585739ef829ce803b17c36cdaf6 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Wed, 12 Feb 2025 15:58:32 -0100 Subject: [PATCH] Bug 37893: SIP accounts - automated dbic - add register Signed-off-by: Andrew Fuerste Henry Signed-off-by: Lisette Scheer Signed-off-by: Martin Renvoize Signed-off-by: Lucas Gass --- Koha/Schema/Result/CashRegister.pm | 19 +++++++++++-- Koha/Schema/Result/SipAccount.pm | 43 ++++++++++++++++++++++++++++-- 2 files changed, 58 insertions(+), 4 deletions(-) diff --git a/Koha/Schema/Result/CashRegister.pm b/Koha/Schema/Result/CashRegister.pm index ac6f51c104..be8ad089a6 100644 --- a/Koha/Schema/Result/CashRegister.pm +++ b/Koha/Schema/Result/CashRegister.pm @@ -173,9 +173,24 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 sip_accounts -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:NNSzc20vEH34dmEsTb5K0Q +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "sip_accounts", + "Koha::Schema::Result::SipAccount", + { "foreign.register_id" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-02-12 16:06:18 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:l32Vqvfc8q/PREZ9BWu5zw __PACKAGE__->add_columns( '+archived' => { is_boolean => 1 }, diff --git a/Koha/Schema/Result/SipAccount.pm b/Koha/Schema/Result/SipAccount.pm index 8d64553b1d..ebf0009ff0 100644 --- a/Koha/Schema/Result/SipAccount.pm +++ b/Koha/Schema/Result/SipAccount.pm @@ -178,6 +178,20 @@ PREVIOUSLY id in Sipconfig.xml is_nullable: 1 size: 255 +=head2 lost_block_checkout + + data_type: 'tinyint' + is_nullable: 1 + +actual tinyint, not boolean + +=head2 lost_block_checkout_value + + data_type: 'tinyint' + is_nullable: 1 + +actual tinyint, not boolean + =head2 lost_status_for_missing data_type: 'tinyint' @@ -204,9 +218,10 @@ actual tinyint, not boolean =head2 register_id data_type: 'integer' + is_foreign_key: 1 is_nullable: 1 -SHOULD THIS BE A FK TO cash_registers? +Foreign key to cash_registers.id =head2 seen_on_item_information @@ -292,6 +307,10 @@ __PACKAGE__->add_columns( { data_type => "varchar", is_nullable => 0, size => 255 }, "login_password", { data_type => "varchar", is_nullable => 1, size => 255 }, + "lost_block_checkout", + { data_type => "tinyint", is_nullable => 1 }, + "lost_block_checkout_value", + { data_type => "tinyint", is_nullable => 1 }, "lost_status_for_missing", { data_type => "tinyint", is_nullable => 1 }, "overdues_block_checkout", @@ -301,7 +320,7 @@ __PACKAGE__->add_columns( "prevcheckout_block_checkout", { data_type => "tinyint", is_nullable => 1 }, "register_id", - { data_type => "integer", is_nullable => 1 }, + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "seen_on_item_information", { data_type => "varchar", is_nullable => 1, size => 255 }, "send_patron_home_library_in_af", @@ -346,6 +365,26 @@ __PACKAGE__->add_unique_constraint("account_login_id", ["login_id"]); =head1 RELATIONS +=head2 register + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "register", + "Koha::Schema::Result::CashRegister", + { id => "register_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "CASCADE", + }, +); + =head2 sip_account_custom_item_fields Type: has_many