Bugzilla – Attachment 175815 Details for
Bug 38689
EDIFACT errors should log to a staff accessible location
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38689: Add Koha::Edifact::File::Error(s) classes
Bug-38689-Add-KohaEdifactFileErrors-classes.patch (text/plain), 5.09 KB, created by
Martin Renvoize (ashimema)
on 2024-12-20 09:05:27 UTC
(
hide
)
Description:
Bug 38689: Add Koha::Edifact::File::Error(s) classes
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-12-20 09:05:27 UTC
Size:
5.09 KB
patch
obsolete
>From a7ba62fb6209b2e08c1cce182346e992c6dab50b Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 19 Dec 2024 17:16:47 +0000 >Subject: [PATCH] Bug 38689: Add Koha::Edifact::File::Error(s) classes > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Edifact/File.pm | 16 ++++ > Koha/Edifact/File/Error.pm | 78 +++++++++++++++++++ > Koha/Edifact/File/Errors.pm | 61 +++++++++++++++ > .../swagger/paths/acquisitions_edifiles.yaml | 1 + > 4 files changed, 156 insertions(+) > create mode 100644 Koha/Edifact/File/Error.pm > create mode 100644 Koha/Edifact/File/Errors.pm > >diff --git a/Koha/Edifact/File.pm b/Koha/Edifact/File.pm >index 9f24b08f0a8..d71d9e7f231 100644 >--- a/Koha/Edifact/File.pm >+++ b/Koha/Edifact/File.pm >@@ -19,6 +19,8 @@ use Modern::Perl; > > use base qw(Koha::Object); > >+use Koha::Edifact::File::Errors; >+ > =encoding utf8 > > =head1 Name >@@ -57,6 +59,20 @@ sub basket { > return Koha::Acquisition::Basket->_new_from_dbic($basket_rs); > } > >+=head3 errors >+ >+ my $errors = $edifile->errors; >+ >+Returns any I<Koha::Edifact::File::Errors> associated with this EDIFACT file >+ >+=cut >+ >+sub errors { >+ my ($self) = @_; >+ my $errors_rs = $self->_result->edifact_errors; >+ return Koha::Edifact::File::Errors->_new_from_dbic($errors_rs); >+} >+ > =head3 to_api_mapping > > This method returns the mapping for representing a Koha::Edifact::File object >diff --git a/Koha/Edifact/File/Error.pm b/Koha/Edifact/File/Error.pm >new file mode 100644 >index 00000000000..1b8235f515f >--- /dev/null >+++ b/Koha/Edifact/File/Error.pm >@@ -0,0 +1,78 @@ >+package Koha::Edifact::File::Error; >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use base qw(Koha::Object); >+ >+=encoding utf8 >+ >+=head1 Name >+ >+Koha::Edifact::File::Error - Koha::Object class for single EDIFACT file >+ >+=head2 Class methods >+ >+=head3 file >+ >+ my $file = $error->file; >+ >+Returns the I<Koha::Edifact::File> associated with this error >+ >+=cut >+ >+sub file { >+ my ($self) = @_; >+ my $file_rs = $self->_result->message; >+ return unless $file_rs; >+ return Koha::Edifact::File->_new_from_dbic($file_rs); >+} >+ >+=head3 to_api_mapping >+ >+This method returns the mapping for representing a Koha::Edifact::File::Error object >+on the API. >+ >+=cut >+ >+sub to_api_mapping { >+ return { >+ message_id => 'file_id', >+ }; >+} >+ >+=head2 Internal methods >+ >+=head3 _type >+ >+Returns name of corresponding DBIC resultset >+ >+=cut >+ >+sub _type { >+ return 'EdifactError'; >+} >+ >+=head1 AUTHOR >+ >+Martin Renvoize <martin.renvoize@ptfs-europe.com> >+ >+Koha Development Team >+ >+=cut >+ >+1; >diff --git a/Koha/Edifact/File/Errors.pm b/Koha/Edifact/File/Errors.pm >new file mode 100644 >index 00000000000..7a04f9714cc >--- /dev/null >+++ b/Koha/Edifact/File/Errors.pm >@@ -0,0 +1,61 @@ >+package Koha::Edifact::File::Errors; >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use Koha::Database; >+use Koha::Edifact::File::Error; >+ >+use base qw(Koha::Objects); >+ >+=head1 NAME >+ >+Koha::Edifact::File::Errors - Koha Edifact File Error Object set class >+ >+=head1 API >+ >+=head2 Internal methods >+ >+=head3 _type >+ >+Returns name of corresponding DBIC resultset >+ >+=cut >+ >+sub _type { >+ return 'EdifactError'; >+} >+ >+=head3 object_class >+ >+Returns name of corresponding koha object class >+ >+=cut >+ >+sub object_class { >+ return 'Koha::Edifact::File::Error'; >+} >+ >+=head1 AUTHOR >+ >+Martin Renvoize <martin.renvoize@ptfs-europe.com> >+ >+Koha Development Team >+ >+=cut >+ >+1; >diff --git a/api/v1/swagger/paths/acquisitions_edifiles.yaml b/api/v1/swagger/paths/acquisitions_edifiles.yaml >index 99de6d59491..5f317217261 100644 >--- a/api/v1/swagger/paths/acquisitions_edifiles.yaml >+++ b/api/v1/swagger/paths/acquisitions_edifiles.yaml >@@ -26,6 +26,7 @@ > enum: > - vendor > - basket >+ - errors > collectionFormat: csv > > responses: >-- >2.47.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 38689
:
175788
|
175789
|
175790
|
175793
|
175794
|
175795
|
175796
|
175797
|
175809
|
175810
|
175811
|
175812
|
175813
|
175814
|
175815
|
175816
|
175817
|
176127
|
176128
|
176129
|
176130
|
176131
|
176132
|
176133
|
176134
|
176173
|
176174
|
176175
|
176176
|
176177
|
176178
|
176179
|
176180
|
176181
|
176182
|
176183
|
176373
|
176374
|
176375
|
176376
|
176377
|
176378
|
176379
|
176380
|
176381
|
176382
|
176524
|
176525
|
176526
|
176527
|
176528
|
176529
|
176530
|
176531
|
176532
|
176533
|
176605
|
176606
|
176607
|
176608
|
176609
|
176610
|
176611
|
176612
|
176613
|
176614