Bug 32030: Move cypress to t/
[koha-ffzg.git] / Koha / Suggestion.pm
index f9f8c2a..9d9e460 100644 (file)
@@ -19,10 +19,9 @@ package Koha::Suggestion;
 
 use Modern::Perl;
 
-use Carp;
 
 use Koha::Database;
-use Koha::DateUtils qw(dt_from_string);
+use Koha::DateUtils qw( dt_from_string );
 use Koha::Patrons;
 
 use base qw(Koha::Object);
@@ -139,6 +138,53 @@ sub _type {
     return 'Suggestion';
 }
 
+=head3 to_api_mapping
+
+This method returns the mapping for representing a Koha::Patron object
+on the API.
+
+=cut
+
+sub to_api_mapping {
+    return {
+        suggestionid         => 'suggestion_id',
+        suggestedby          => 'suggested_by',
+        suggesteddate        => 'suggestion_date',
+        managedby            => 'managed_by',
+        manageddate          => 'managed_date',
+        acceptedby           => 'accepted_by',
+        accepteddate         => 'accepted_date',
+        rejectedby           => 'rejected_by',
+        rejecteddate         => 'rejected_date',
+        lastmodificationdate => 'last_status_change_date',
+        lastmodificationby   => 'last_status_change_by',
+        STATUS               => 'status',
+        note                 => 'note',
+        staff_note           => 'staff_note',
+        author               => 'author',
+        title                => 'title',
+        copyrightdate        => 'copyright_date',
+        publishercode        => 'publisher_code',
+        date                 => 'timestamp',
+        volumedesc           => 'volume_desc',
+        publicationyear      => 'publication_year',
+        place                => 'publication_place',
+        isbn                 => 'isbn',
+        biblionumber         => 'biblio_id',
+        reason               => 'reason',
+        patronreason         => 'patron_reason',
+        budgetid             => 'budget_id',
+        branchcode           => 'library_id',
+        collectiontitle      => 'collection_title',
+        itemtype             => 'item_type',
+        quantity             => 'quantity',
+        currency             => 'currency',
+        price                => 'item_price',
+        total                => 'total_price',
+        archived             => 'archived',
+    };
+}
+
 =head1 AUTHOR
 
 Kyle M Hall <kyle@bywatersolutions.com>