View | Details | Raw Unified | Return to bug 38689
Collapse All | Expand All

(-)a/Koha/Edifact/File.pm (+16 lines)
Lines 19-24 use Modern::Perl; Link Here
19
19
20
use base qw(Koha::Object);
20
use base qw(Koha::Object);
21
21
22
use Koha::Edifact::File::Errors;
23
22
=encoding utf8
24
=encoding utf8
23
25
24
=head1 Name
26
=head1 Name
Lines 57-62 sub basket { Link Here
57
    return Koha::Acquisition::Basket->_new_from_dbic($basket_rs);
59
    return Koha::Acquisition::Basket->_new_from_dbic($basket_rs);
58
}
60
}
59
61
62
=head3 errors
63
64
  my $errors = $edifile->errors;
65
66
Returns any I<Koha::Edifact::File::Errors> associated with this EDIFACT file
67
68
=cut
69
70
sub errors {
71
    my ($self) = @_;
72
    my $errors_rs = $self->_result->edifact_errors;
73
    return Koha::Edifact::File::Errors->_new_from_dbic($errors_rs);
74
}
75
60
=head3 to_api_mapping
76
=head3 to_api_mapping
61
77
62
This method returns the mapping for representing a Koha::Edifact::File object
78
This method returns the mapping for representing a Koha::Edifact::File object
(-)a/Koha/Edifact/File/Error.pm (+78 lines)
Line 0 Link Here
1
package Koha::Edifact::File::Error;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
19
20
use base qw(Koha::Object);
21
22
=encoding utf8
23
24
=head1 Name
25
26
Koha::Edifact::File::Error - Koha::Object class for single EDIFACT file
27
28
=head2 Class methods
29
30
=head3 file
31
32
  my $file = $error->file;
33
34
Returns the I<Koha::Edifact::File> associated with this error
35
36
=cut
37
38
sub file {
39
    my ($self) = @_;
40
    my $file_rs = $self->_result->message;
41
    return unless $file_rs;
42
    return Koha::Edifact::File->_new_from_dbic($file_rs);
43
}
44
45
=head3 to_api_mapping
46
47
This method returns the mapping for representing a Koha::Edifact::File::Error object
48
on the API.
49
50
=cut
51
52
sub to_api_mapping {
53
    return {
54
        message_id => 'file_id',
55
    };
56
}
57
58
=head2 Internal methods
59
60
=head3 _type
61
62
Returns name of corresponding DBIC resultset
63
64
=cut
65
66
sub _type {
67
    return 'EdifactError';
68
}
69
70
=head1 AUTHOR
71
72
Martin Renvoize <martin.renvoize@ptfs-europe.com>
73
74
Koha Development Team
75
76
=cut
77
78
1;
(-)a/Koha/Edifact/File/Errors.pm (+61 lines)
Line 0 Link Here
1
package Koha::Edifact::File::Errors;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
19
20
use Koha::Database;
21
use Koha::Edifact::File::Error;
22
23
use base qw(Koha::Objects);
24
25
=head1 NAME
26
27
Koha::Edifact::File::Errors - Koha Edifact File Error Object set class
28
29
=head1 API
30
31
=head2 Internal methods
32
33
=head3 _type
34
35
Returns name of corresponding DBIC resultset
36
37
=cut
38
39
sub _type {
40
    return 'EdifactError';
41
}
42
43
=head3 object_class
44
45
Returns name of corresponding koha object class
46
47
=cut
48
49
sub object_class {
50
    return 'Koha::Edifact::File::Error';
51
}
52
53
=head1 AUTHOR
54
55
Martin Renvoize <martin.renvoize@ptfs-europe.com>
56
57
Koha Development Team
58
59
=cut
60
61
1;
(-)a/api/v1/swagger/paths/acquisitions_edifiles.yaml (-1 / +1 lines)
Lines 26-31 Link Here
26
          enum:
26
          enum:
27
            - vendor
27
            - vendor
28
            - basket
28
            - basket
29
            - errors
29
        collectionFormat: csv
30
        collectionFormat: csv
30
31
31
    responses:
32
    responses:
32
- 

Return to bug 38689