From 0e0f9e110117cb8e9aa287a91f78b258cbcb8f0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Mon, 24 Sep 2018 13:50:54 +0300 Subject: [PATCH 01/98] Minor improvement --- app/services/lib/services/yoksis/base.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/services/lib/services/yoksis/base.rb b/app/services/lib/services/yoksis/base.rb index 43523088..4f1a03ac 100644 --- a/app/services/lib/services/yoksis/base.rb +++ b/app/services/lib/services/yoksis/base.rb @@ -4,7 +4,8 @@ module Services module Yoksis class Base def initialize(**options) - @client = Client.new(self.class::WSDL_URL, savon_options: options) + @client = Client.new(self.class::WSDL_URL, savon_options: options) + @options = options after_initialize end From 8f82116f91c43e1b12f14906f5d60e00808a2737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Mon, 24 Sep 2018 13:51:24 +0300 Subject: [PATCH 02/98] Add citations action to resumes endpoint --- app/services/lib/services/yoksis/constants.rb | 5 ++ .../lib/services/yoksis/endpoints/resumes.rb | 50 +++++++++++++++---- 2 files changed, 45 insertions(+), 10 deletions(-) diff --git a/app/services/lib/services/yoksis/constants.rb b/app/services/lib/services/yoksis/constants.rb index adb42f5f..b9ec54b9 100644 --- a/app/services/lib/services/yoksis/constants.rb +++ b/app/services/lib/services/yoksis/constants.rb @@ -177,6 +177,11 @@ class Resumes < Base result: %i[getir_proje_listesi_response proje_listesi], status: %i[getir_proje_listesi_response sonuc durum_kodu] }, + citations: { + operation: :get_atif_sayilari_v1, + result: %i[get_atif_sayilari_v1_response atif_sayi_listesi], + status: %i[get_atif_sayilari_v1_response sonuc durum_kodu], + } }.freeze end class Staff < Base diff --git a/app/services/lib/services/yoksis/endpoints/resumes.rb b/app/services/lib/services/yoksis/endpoints/resumes.rb index 1e88251f..cf210955 100644 --- a/app/services/lib/services/yoksis/endpoints/resumes.rb +++ b/app/services/lib/services/yoksis/endpoints/resumes.rb @@ -5,17 +5,22 @@ module Yoksis class Resumes WSDL_URL = 'http://servisler.yok.gov.tr/ws/ozgecmisv1?WSDL' - # rubocop:disable Metrics/MethodLength - def articles(username:, password:, id_number:) + def citations(id_number:, year:) + @citations = client.request( + ARGS.dig(:citations, :operation), + args: params_with_defaults(P_TC_KIMLIK_NO: id_number, P_DONEM: year) + ) + + raise InvalidResponseError if citations_has_error? + raise NoContentError unless citations_has_response? + + citations_result + end + + def articles(id_number:) @resumes = client.request( ARGS.dig(__callee__, :operation), - args: { - parametre: { - P_KULLANICI_ID: username, - P_SIFRE: password, - P_TC_KIMLIK_NO: id_number - } - } + args: params_with_defaults(P_TC_KIMLIK_NO: id_number) ) raise InvalidResponseError if resumes_has_error? __callee__ @@ -23,7 +28,6 @@ def articles(username:, password:, id_number:) resumes_result __callee__ end - # rubocop:enable Metrics/MethodLength alias certifications articles alias projects articles @@ -41,6 +45,32 @@ def resumes_has_response?(method) def resumes_result(method) @resumes.dig(*ARGS.dig(method, :result)) end + + def citations_has_error? + @citations.dig(*ARGS.dig(:citations, :status)) { |data| data.to_i.zero? } + end + + def citations_has_response? + @citations.dig(*ARGS.dig(:citations, :result), &:present?) + end + + def citations_result + @citations.dig(*ARGS.dig(:citations, :result)) + end + + def params_with_defaults(**params) + { + parametre: { + P_KULLANICI_ID: @username, P_SIFRE: @password + }.merge(params) + } + end + + protected + + def after_initialize + @username, @password = @options[:basic_auth] + end end end end From caf4f4637827fa3d5e4a7f80736afdf049625fb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Mon, 24 Sep 2018 13:51:55 +0300 Subject: [PATCH 03/98] Add citations action to resumes controller --- app/controllers/yoksis/resumes_controller.rb | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/app/controllers/yoksis/resumes_controller.rb b/app/controllers/yoksis/resumes_controller.rb index c8ac9d48..bf1ee13d 100644 --- a/app/controllers/yoksis/resumes_controller.rb +++ b/app/controllers/yoksis/resumes_controller.rb @@ -6,17 +6,21 @@ class ResumesController < ApplicationController include ActionsResource - def certifications + def citations + render_as_json @resumes.citations( + id_number: secure_params.require(:id_number), + year: secure_params.require(:year) + ) + end + + def articles render_as_json @resumes.send( - action_name, - username: @username, - password: @password, - id_number: secure_params.require(:id_number) + action_name, id_number: secure_params.require(:id_number) ) end - alias projects certifications - alias articles certifications + alias certifications articles + alias projects articles private @@ -30,7 +34,7 @@ def set_resumes end def secure_params - params.require(:resume).permit(:id_number) + params.require(:resume).permit(:id_number, :year) end end end From 3a64d3a350c34fea6a981591e92a0b2aa6ceb800 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Mon, 24 Sep 2018 13:52:05 +0300 Subject: [PATCH 04/98] Add citations serializer --- .../yoksis/resumes/citations_serializer.rb | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 app/serializers/yoksis/resumes/citations_serializer.rb diff --git a/app/serializers/yoksis/resumes/citations_serializer.rb b/app/serializers/yoksis/resumes/citations_serializer.rb new file mode 100644 index 00000000..b3108181 --- /dev/null +++ b/app/serializers/yoksis/resumes/citations_serializer.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Yoksis + module Resumes + class CitationsSerializer < Serializer + attribute(:id) { object[:a_id].safe_to_i } + attribute(:year) { object[:donem].safe_to_i } + attribute(:type_id) { object[:tur].safe_to_i } + attribute(:type_name) { object[:tur_ad].titleize_tr } + attribute(:work_type) { object[:eser_turu].titleize_tr } + attribute(:work_id) { object[:eser_id].safe_to_i } + attribute(:uluslar_kit_atf) { object[:uluslar_kit_atf].safe_to_i } + attribute(:ulusal_kit_atf) { object[:ulusal_kit_atf].safe_to_i } + attribute(:ssci_index) { object[:ssci_indeks_atf].safe_to_i } + attribute(:scope_index) { object[:alan_indeks_atf].safe_to_i } + attribute(:other_citation) { object[:diger_atif] } + attribute(:incentive_point) { object[:tesv_puan].safe_to_f } + attribute(:esci) { object[:esci].safe_to_i } + attribute(:besteci_eser) { object[:besteci_eser] } + attribute(:date_of_update) { Time.zone.parse object[:guncelleme_tarihi] || '' } + end + end +end From fcb7c7f72af9576f41c45d4056008c76578352aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Mon, 24 Sep 2018 13:52:14 +0300 Subject: [PATCH 05/98] Update routes for citations --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/routes.rb b/config/routes.rb index b756c8be..5869869e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -69,6 +69,7 @@ collection do get :articles get :certifications + get :citations get :projects end end From b7759c993a0980edfa5c58523b8dd4d2e0a74b2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Mon, 24 Sep 2018 15:54:56 +0300 Subject: [PATCH 06/98] Add papers action to resumes endpoint --- app/services/lib/services/yoksis/constants.rb | 5 ++++ .../lib/services/yoksis/endpoints/resumes.rb | 29 +++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/app/services/lib/services/yoksis/constants.rb b/app/services/lib/services/yoksis/constants.rb index b9ec54b9..f203b21d 100644 --- a/app/services/lib/services/yoksis/constants.rb +++ b/app/services/lib/services/yoksis/constants.rb @@ -181,6 +181,11 @@ class Resumes < Base operation: :get_atif_sayilari_v1, result: %i[get_atif_sayilari_v1_response atif_sayi_listesi], status: %i[get_atif_sayilari_v1_response sonuc durum_kodu], + }, + papers: { + operation: :get_bildiri_bilgisi_v1, + result: %i[get_bildiri_bilgisi_v1_response bildiri_liste], + status: %i[get_bildiri_bilgisi_v1_response sonuc durum_kodu], } }.freeze end diff --git a/app/services/lib/services/yoksis/endpoints/resumes.rb b/app/services/lib/services/yoksis/endpoints/resumes.rb index cf210955..b6186124 100644 --- a/app/services/lib/services/yoksis/endpoints/resumes.rb +++ b/app/services/lib/services/yoksis/endpoints/resumes.rb @@ -17,6 +17,20 @@ def citations(id_number:, year:) citations_result end + def papers(id_number:, year:, month:, day:) + @papers = client.request( + ARGS.dig(:papers, :operation), + args: params_with_defaults( + P_TC_KIMLIK_NO: id_number, P_TARIH: "#{year}-#{month}-#{day}" + ) + ) + + raise InvalidResponseError if papers_has_error? + raise NoContentError unless papers_has_response? + + papers_result + end + def articles(id_number:) @resumes = client.request( ARGS.dig(__callee__, :operation), @@ -34,6 +48,9 @@ def articles(id_number:) private + # TODO: Refactor the error and response handling in the future. Because + # there are too many repetitive code blocks. + def resumes_has_error?(method) @resumes.dig(*ARGS.dig(method, :status)) { |data| data.to_i.zero? } end @@ -58,6 +75,18 @@ def citations_result @citations.dig(*ARGS.dig(:citations, :result)) end + def papers_has_error? + @papers.dig(*ARGS.dig(:papers, :status)) { |data| data.to_i.zero? } + end + + def papers_has_response? + @papers.dig(*ARGS.dig(:papers, :result), &:present?) + end + + def papers_result + @papers.dig(*ARGS.dig(:papers, :result)) + end + def params_with_defaults(**params) { parametre: { From d6427a40fd304f8cbec7766e44c1a0af8ad5775b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Mon, 24 Sep 2018 15:55:24 +0300 Subject: [PATCH 07/98] Add papers action to resumes controller --- app/controllers/yoksis/resumes_controller.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/controllers/yoksis/resumes_controller.rb b/app/controllers/yoksis/resumes_controller.rb index bf1ee13d..3f07658d 100644 --- a/app/controllers/yoksis/resumes_controller.rb +++ b/app/controllers/yoksis/resumes_controller.rb @@ -9,7 +9,15 @@ class ResumesController < ApplicationController def citations render_as_json @resumes.citations( id_number: secure_params.require(:id_number), - year: secure_params.require(:year) + year: secure_params.require(:year) + ) + end + + def papers + year, month, day = *secure_params.require(%i[year month day]) + render_as_json @resumes.papers( + id_number: secure_params.require(:id_number), + year: year, month: month, day: day ) end @@ -34,7 +42,7 @@ def set_resumes end def secure_params - params.require(:resume).permit(:id_number, :year) + params.require(:resume).permit(:id_number, :year, :month, :day) end end end From faab45cf130308855b6f7a4c3933c91a2cea516d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Mon, 24 Sep 2018 15:55:38 +0300 Subject: [PATCH 08/98] Add papers serializer --- .../yoksis/resumes/papers_serializer.rb | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 app/serializers/yoksis/resumes/papers_serializer.rb diff --git a/app/serializers/yoksis/resumes/papers_serializer.rb b/app/serializers/yoksis/resumes/papers_serializer.rb new file mode 100644 index 00000000..6f74ad98 --- /dev/null +++ b/app/serializers/yoksis/resumes/papers_serializer.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module Yoksis + module Resumes + class PapersSerializer < Serializer + attribute(:id) { object[:yayin_id].safe_to_i } + attribute(:name) { object[:bildiri_adi] } + attribute(:scope_id) { object[:kapsam_id].safe_to_i } + attribute(:scope_name) { object[:kapsam_ad] } + attribute(:type_id) { object[:bildiri_tur_id].safe_to_i } + attribute(:type_name) { object[:bildiri_tur].titleize_tr } + attribute(:author_id) { object[:yazar_id].safe_to_i } + attribute(:authors_number) { object[:yazar_sayisi].safe_to_i } + attribute(:authors) { object[:yazar_adi].split(',').map(&:strip).map(&:titleize_tr) } + attribute(:city) { object[:sehir].titleize_tr } + attribute(:country_id) { object[:ulke].safe_to_i } + attribute(:country_name) { object[:ulke_adi].titleize_tr } + attribute(:language_id) { object[:yayin_dili].safe_to_i } + attribute(:language_name) { object[:yayin_dili_adi].titleize_tr } + attribute(:status_id) { object[:yayin_durumu].safe_to_i } + attribute(:status_name) { object[:yayin_durumu_ad].titleize_tr } + attribute(:date_of_release) { object[:basim_tarihi] && Date.parse(object[:basim_tarihi]) } + attribute(:release_type_id) { object[:basim_turu].safe_to_i } + attribute(:release_type_name) { object[:basim_turu_ad].titleize_tr } + attribute(:volume) { object[:cilt].safe_to_i } + attribute(:issue) { object[:sayi].safe_to_i } + attribute(:first_page) { object[:ilk_sayfa].safe_to_i } + attribute(:last_page) { object[:son_sayfa].safe_to_i } + attribute(:doi) { object[:doi].safe_to_i } + attribute(:issn) { object[:issn].safe_to_i } + attribute(:print_isbn) { object[:print_isbn].safe_to_i } + attribute(:access_link) { object[:access_link] } + attribute(:citations_number) { object[:atif_sayisi].safe_to_i } + attribute(:field) { object[:alan_bilgisi].titleize_tr } + attribute(:keywords) { object[:anahtar_kelime].titleize_tr } + attribute(:special_number_id) { object[:ozel_sayi].safe_to_i } + attribute(:special_number_name) { object[:ozel_sayi_ad].titleize_tr } + attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } + attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } + attribute(:incentive_points) { object[:tesv_puan].safe_to_f } + attribute(:presentation_type_id) { object[:bildiri_sunum_turu].safe_to_i } + attribute(:presentation_type_name) { object[:bildiri_sunum_turu_ad].titleize_tr } + attribute(:date_of_update) { Time.zone.parse object[:guncelleme_tarihi] || '' } + end + end +end From a1ec51c70d38ee544507ab59c8004b0d0da25af9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Mon, 24 Sep 2018 15:56:05 +0300 Subject: [PATCH 09/98] Update routes for papers --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/routes.rb b/config/routes.rb index 5869869e..4fad1424 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -70,6 +70,7 @@ get :articles get :certifications get :citations + get :papers get :projects end end From 363ee6eb5f66c0d732d1a0d0b583e6be298ebf52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Mon, 24 Sep 2018 15:56:13 +0300 Subject: [PATCH 10/98] Minor changes --- .../yoksis/resumes/articles_serializer.rb | 78 +++++++++---------- .../resumes/certifications_serializer.rb | 6 +- .../yoksis/resumes/citations_serializer.rb | 30 +++---- .../yoksis/resumes/projects_serializer.rb | 10 +-- 4 files changed, 62 insertions(+), 62 deletions(-) diff --git a/app/serializers/yoksis/resumes/articles_serializer.rb b/app/serializers/yoksis/resumes/articles_serializer.rb index 1c3ea80d..199c8b13 100644 --- a/app/serializers/yoksis/resumes/articles_serializer.rb +++ b/app/serializers/yoksis/resumes/articles_serializer.rb @@ -3,45 +3,45 @@ module Yoksis module Resumes class ArticlesSerializer < Serializer - attribute(:id) { object[:yayin_id].safe_to_i } - attribute(:name) { object[:makale_adi].titleize_tr } - attribute(:type_id) { object[:makale_turu_id].safe_to_i } - attribute(:type_name) { object[:makale_turu_ad].titleize_tr } - attribute(:scope_id) { object[:kapsam_id].safe_to_i } - attribute(:scope_name) { object[:kapsam_ad].titleize_tr } - attribute(:referee_type_id) { object[:hakem_tur].safe_to_i } - attribute(:referee_type_name) { object[:hakem_tur_ad].titleize_tr } - attribute(:index_id) { object[:endeks_id].safe_to_i } - attribute(:index) { object[:endeks].titleize_tr } - attribute(:author_id) { object[:yazar_id].safe_to_i } - attribute(:author_name) { object[:yazar_adi].upcase_tr } - attribute(:authors_number) { object[:yazar_sayisi].safe_to_i } - attribute(:country_id) { object[:ulke].safe_to_i } - attribute(:country_name) { object[:ulke_adi].titleize_tr } - attribute(:city) { object[:sehir].titleize_tr } - attribute(:journal_name) { object[:dergi_adi].titleize_tr } - attribute(:language_id) { object[:yayin_dili].safe_to_i } - attribute(:language_name) { object[:yayin_dili_adi].titleize_tr } - attribute(:month) { object[:ay].safe_to_i } - attribute(:year) { object[:yil].safe_to_i } - attribute(:volume) { object[:cilt].safe_to_i } - attribute(:issue) { object[:sayi].safe_to_i } - attribute(:first_page) { object[:ilk_sayfa].safe_to_i } - attribute(:last_page) { object[:son_sayfa].safe_to_i } - attribute(:doi) { object[:doi].safe_to_i } - attribute(:issn) { object[:issn].safe_to_i } - attribute(:access_type_id) { object[:erisim_turu].safe_to_i } - attribute(:access_type_name) { object[:erisim_turu_ad] } - attribute(:access_link) { object[:erisim_linki] } - attribute(:citation_number) { object[:atif_sayisi].safe_to_i } - attribute(:field) { object[:alan_bilgisi].titleize_tr } - attribute(:keyword) { object[:anahtar_kelime].titleize_tr } - attribute(:special_number_id) { object[:ozel_sayi].safe_to_i } - attribute(:special_number_name) { object[:ozel_sayi_ad].titleize_tr } - attribute(:date_of_update) { Time.zone.parse object[:guncelleme_tarihi] || '' } - attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } - attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } - attribute(:incentive_point) { object[:tesv_puan].safe_to_f } + attribute(:id) { object[:yayin_id].safe_to_i } + attribute(:name) { object[:makale_adi].titleize_tr } + attribute(:type_id) { object[:makale_turu_id].safe_to_i } + attribute(:type_name) { object[:makale_turu_ad].titleize_tr } + attribute(:scope_id) { object[:kapsam_id].safe_to_i } + attribute(:scope_name) { object[:kapsam_ad].titleize_tr } + attribute(:referee_type_id) { object[:hakem_tur].safe_to_i } + attribute(:referee_type_name) { object[:hakem_tur_ad].titleize_tr } + attribute(:index_id) { object[:endeks_id].safe_to_i } + attribute(:index) { object[:endeks].titleize_tr } + attribute(:author_id) { object[:yazar_id].safe_to_i } + attribute(:authors) { object[:yazar_adi].split(',').map(&:strip).map(&:titleize_tr) } + attribute(:authors_number) { object[:yazar_sayisi].safe_to_i } + attribute(:country_id) { object[:ulke].safe_to_i } + attribute(:country_name) { object[:ulke_adi].titleize_tr } + attribute(:city) { object[:sehir].titleize_tr } + attribute(:journal_name) { object[:dergi_adi].titleize_tr } + attribute(:language_id) { object[:yayin_dili].safe_to_i } + attribute(:language_name) { object[:yayin_dili_adi].titleize_tr } + attribute(:month) { object[:ay].safe_to_i } + attribute(:year) { object[:yil].safe_to_i } + attribute(:volume) { object[:cilt].safe_to_i } + attribute(:issue) { object[:sayi].safe_to_i } + attribute(:first_page) { object[:ilk_sayfa].safe_to_i } + attribute(:last_page) { object[:son_sayfa].safe_to_i } + attribute(:doi) { object[:doi].safe_to_i } + attribute(:issn) { object[:issn].safe_to_i } + attribute(:access_type_id) { object[:erisim_turu].safe_to_i } + attribute(:access_type_name) { object[:erisim_turu_ad] } + attribute(:access_link) { object[:erisim_linki] } + attribute(:citations_number) { object[:atif_sayisi].safe_to_i } + attribute(:field) { object[:alan_bilgisi].titleize_tr } + attribute(:keywords) { object[:anahtar_kelime].titleize_tr } + attribute(:special_number_id) { object[:ozel_sayi].safe_to_i } + attribute(:special_number_name) { object[:ozel_sayi_ad].titleize_tr } + attribute(:date_of_update) { Time.zone.parse object[:guncelleme_tarihi] || '' } + attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } + attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } + attribute(:incentive_points) { object[:tesv_puan].safe_to_f } end end end diff --git a/app/serializers/yoksis/resumes/certifications_serializer.rb b/app/serializers/yoksis/resumes/certifications_serializer.rb index eed895e8..51c74067 100644 --- a/app/serializers/yoksis/resumes/certifications_serializer.rb +++ b/app/serializers/yoksis/resumes/certifications_serializer.rb @@ -14,15 +14,15 @@ class CertificationsSerializer < Serializer attribute(:stint) { object[:sure].safe_to_i } attribute(:title_id) { object[:unvan_id].safe_to_i } attribute(:title_name) { object[:unvan_ad].titleize_tr } - attribute(:university_id) { object[:kurum_id].safe_to_i } - attribute(:university_name) { object[:kurum_ad].titleize_tr } + attribute(:institution_id) { object[:kurum_id].safe_to_i } + attribute(:institution_name) { object[:kurum_ad].titleize_tr } attribute(:members_number) { object[:kisi_sayisi].safe_to_i } attribute(:country) { object[:ulke_sehir] && object[:ulke_sehir].split('/').first.titleize_tr } attribute(:city) { object[:ulke_sehir] && object[:ulke_sehir].split('/').last.titleize_tr } attribute(:date_of_update) { Time.zone.parse object[:guncelleme_tarihi] || '' } attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } - attribute(:incentive_point) { object[:tesv_puan].safe_to_f } + attribute(:incentive_points) { object[:tesv_puan].safe_to_f } attribute :date_of_start do next unless object[:bastar] diff --git a/app/serializers/yoksis/resumes/citations_serializer.rb b/app/serializers/yoksis/resumes/citations_serializer.rb index b3108181..2210ff33 100644 --- a/app/serializers/yoksis/resumes/citations_serializer.rb +++ b/app/serializers/yoksis/resumes/citations_serializer.rb @@ -3,21 +3,21 @@ module Yoksis module Resumes class CitationsSerializer < Serializer - attribute(:id) { object[:a_id].safe_to_i } - attribute(:year) { object[:donem].safe_to_i } - attribute(:type_id) { object[:tur].safe_to_i } - attribute(:type_name) { object[:tur_ad].titleize_tr } - attribute(:work_type) { object[:eser_turu].titleize_tr } - attribute(:work_id) { object[:eser_id].safe_to_i } - attribute(:uluslar_kit_atf) { object[:uluslar_kit_atf].safe_to_i } - attribute(:ulusal_kit_atf) { object[:ulusal_kit_atf].safe_to_i } - attribute(:ssci_index) { object[:ssci_indeks_atf].safe_to_i } - attribute(:scope_index) { object[:alan_indeks_atf].safe_to_i } - attribute(:other_citation) { object[:diger_atif] } - attribute(:incentive_point) { object[:tesv_puan].safe_to_f } - attribute(:esci) { object[:esci].safe_to_i } - attribute(:besteci_eser) { object[:besteci_eser] } - attribute(:date_of_update) { Time.zone.parse object[:guncelleme_tarihi] || '' } + attribute(:id) { object[:a_id].safe_to_i } + attribute(:year) { object[:donem].safe_to_i } + attribute(:type_id) { object[:tur].safe_to_i } + attribute(:type_name) { object[:tur_ad].titleize_tr } + attribute(:work_type) { object[:eser_turu].titleize_tr } + attribute(:work_id) { object[:eser_id].safe_to_i } + attribute(:international_book_citation) { object[:uluslar_kit_atf].safe_to_i } + attribute(:national_book_citation) { object[:ulusal_kit_atf].safe_to_i } + attribute(:ssci_index) { object[:ssci_indeks_atf].safe_to_i } + attribute(:scope_index) { object[:alan_indeks_atf].safe_to_i } + attribute(:other_citations) { object[:diger_atif] } + attribute(:incentive_points) { object[:tesv_puan].safe_to_f } + attribute(:esci) { object[:esci].safe_to_i } + attribute(:composer_work) { object[:besteci_eser] } + attribute(:date_of_update) { Time.zone.parse object[:guncelleme_tarihi] || '' } end end end diff --git a/app/serializers/yoksis/resumes/projects_serializer.rb b/app/serializers/yoksis/resumes/projects_serializer.rb index 6c1918a2..88d93416 100644 --- a/app/serializers/yoksis/resumes/projects_serializer.rb +++ b/app/serializers/yoksis/resumes/projects_serializer.rb @@ -22,17 +22,17 @@ class ProjectsSerializer < Serializer attribute(:scope_name) { object[:kapsam_ad].titleize_tr } attribute(:title_id) { object[:unvan_id].safe_to_i } attribute(:title_name) { object[:unvan_ad].titleize_tr } - attribute(:university_id) { object[:kurum_id].safe_to_i } - attribute(:university_name) { object[:kurum_ad].titleize_tr } - attribute(:incentive_point) { object[:tesv_puan].safe_to_f } + attribute(:institution_id) { object[:kurum_id].safe_to_i } + attribute(:institution_name) { object[:kurum_ad].titleize_tr } + attribute(:incentive_points) { object[:tesv_puan].safe_to_f } - attribute :started_at do + attribute :date_of_start do next unless object[:bas_tar] build_date(*object[:bas_tar].split('.').reverse.collect(&:safe_to_i)) end - attribute :ended_at do + attribute :date_of_end do next unless object[:bit_tar] build_date(*object[:bit_tar].split('.').reverse.collect(&:safe_to_i)) end From fdb0321f9d2909fba28b7bbb9ca2f83a7e8d3a8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 11:51:18 +0300 Subject: [PATCH 11/98] Add duties action to resumes service --- app/services/lib/services/yoksis/constants.rb | 5 ++++ .../lib/services/yoksis/endpoints/resumes.rb | 26 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/app/services/lib/services/yoksis/constants.rb b/app/services/lib/services/yoksis/constants.rb index f203b21d..9aae5704 100644 --- a/app/services/lib/services/yoksis/constants.rb +++ b/app/services/lib/services/yoksis/constants.rb @@ -186,6 +186,11 @@ class Resumes < Base operation: :get_bildiri_bilgisi_v1, result: %i[get_bildiri_bilgisi_v1_response bildiri_liste], status: %i[get_bildiri_bilgisi_v1_response sonuc durum_kodu], + }, + duties: { + operation: :getir_akademik_gorev_listesi, + result: %i[getir_akademik_gorev_listesi_response akademik_gorev_listesi], + status: %i[getir_akademik_gorev_listesi_response sonuc durum_kodu], } }.freeze end diff --git a/app/services/lib/services/yoksis/endpoints/resumes.rb b/app/services/lib/services/yoksis/endpoints/resumes.rb index b6186124..582e2b41 100644 --- a/app/services/lib/services/yoksis/endpoints/resumes.rb +++ b/app/services/lib/services/yoksis/endpoints/resumes.rb @@ -17,6 +17,20 @@ def citations(id_number:, year:) citations_result end + def duties(id_number:, year:, month:, day:) + @duties = client.request( + ARGS.dig(:duties, :operation), + args: params_with_defaults( + P_TC_KIMLIK_NO: id_number, P_TARIH: "#{year}-#{month}-#{day}" + ) + ) + + raise InvalidResponseError if duties_has_error? + raise NoContentError unless duties_has_response? + + duties_result + end + def papers(id_number:, year:, month:, day:) @papers = client.request( ARGS.dig(:papers, :operation), @@ -87,6 +101,18 @@ def papers_result @papers.dig(*ARGS.dig(:papers, :result)) end + def duties_has_error? + @duties.dig(*ARGS.dig(:duties, :status)) { |data| data.to_i.zero? } + end + + def duties_has_response? + @duties.dig(*ARGS.dig(:duties, :result), &:present?) + end + + def duties_result + @duties.dig(*ARGS.dig(:duties, :result)) + end + def params_with_defaults(**params) { parametre: { From 907f88b7dcf11428f4f758945908a68ec9c04270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 11:51:36 +0300 Subject: [PATCH 12/98] Add duties action to resumes controller --- app/controllers/yoksis/resumes_controller.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/controllers/yoksis/resumes_controller.rb b/app/controllers/yoksis/resumes_controller.rb index 3f07658d..85d5d65f 100644 --- a/app/controllers/yoksis/resumes_controller.rb +++ b/app/controllers/yoksis/resumes_controller.rb @@ -21,6 +21,14 @@ def papers ) end + def duties + year, month, day = *secure_params.require(%i[year month day]) + render_as_json @resumes.duties( + id_number: secure_params.require(:id_number), + year: year, month: month, day: day + ) + end + def articles render_as_json @resumes.send( action_name, id_number: secure_params.require(:id_number) From b2228ddf5c3347cf7c8002e412b5f12a7145239a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 11:51:44 +0300 Subject: [PATCH 13/98] Add duties serializer --- .../yoksis/resumes/duties_serializer.rb | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 app/serializers/yoksis/resumes/duties_serializer.rb diff --git a/app/serializers/yoksis/resumes/duties_serializer.rb b/app/serializers/yoksis/resumes/duties_serializer.rb new file mode 100644 index 00000000..29e4a280 --- /dev/null +++ b/app/serializers/yoksis/resumes/duties_serializer.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Yoksis + module Resumes + class DutiesSerializer < Serializer + attribute(:id) { object[:gorev_id].safe_to_i } + attribute(:place_id) { object[:yer_id].safe_to_i } + attribute(:place_name) { object[:yer_ad].titleize_tr } + attribute(:country_id) { object[:ulke_id].safe_to_i } + attribute(:country_name) { object[:ulke_ad].titleize_tr } + attribute(:year_of_start) { object[:bastar1].titleize_tr } + attribute(:year_of_end) { object[:bittar1].titleize_tr } + attribute(:scientific_field_name) { object[:bilimalan_adi].titleize_tr } + attribute(:field_of_specialization_id) { object[:uzmanlik_alani].safe_to_i } + attribute(:field_of_specialization_name) { object[:uzmanlik_alani_ad].titleize_tr } + attribute(:university_id) { object[:univ_id].safe_to_i } + attribute(:university_name) { object[:univ_birim_adi].titleize_tr } + attribute(:unit_id) { object[:birim_id].safe_to_i } + attribute(:faculty) { object[:fakultebilgisi].titleize_tr } + attribute(:department) { object[:bolumbilgisi].titleize_tr } + attribute(:field) { object[:alanbilgisi].titleize_tr } + attribute(:title_id) { object[:kadro_unvan_id].safe_to_i } + attribute(:title_name) { object[:kadro_unvan_adi].titleize_tr } + attribute(:academic_status_id) { object[:akademik_durum].safe_to_i } + attribute(:academic_status_name) { object[:akademik_durum_adi].titleize_tr } + attribute(:academic_unit_name) { object[:akademik_birim_adi].titleize_tr } + attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } + attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } + attribute(:date_of_update) { Time.zone.parse object[:guncelleme_tarihi] || '' } + end + end +end From 479af1ac397241f079ca7b0556c88359442bd6c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 11:51:52 +0300 Subject: [PATCH 14/98] Update routes for duties --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/routes.rb b/config/routes.rb index 72c5be73..64a89285 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -70,6 +70,7 @@ get :articles get :certifications get :citations + get :duties get :papers get :projects end From 35890ff77121d11899c722ad44e878e1a4c2daf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 13:47:53 +0300 Subject: [PATCH 15/98] Add lectures action to resumes service --- app/services/lib/services/yoksis/constants.rb | 5 +++ .../lib/services/yoksis/endpoints/resumes.rb | 38 +++++++++++++++---- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/app/services/lib/services/yoksis/constants.rb b/app/services/lib/services/yoksis/constants.rb index 9aae5704..dac1dcf3 100644 --- a/app/services/lib/services/yoksis/constants.rb +++ b/app/services/lib/services/yoksis/constants.rb @@ -191,6 +191,11 @@ class Resumes < Base operation: :getir_akademik_gorev_listesi, result: %i[getir_akademik_gorev_listesi_response akademik_gorev_listesi], status: %i[getir_akademik_gorev_listesi_response sonuc durum_kodu], + }, + lectures: { + operation: :getir_ders_listesi, + result: %i[getir_ders_listesi_response ders_listesi], + status: %i[getir_ders_listesi_response sonuc durum_kodu], } }.freeze end diff --git a/app/services/lib/services/yoksis/endpoints/resumes.rb b/app/services/lib/services/yoksis/endpoints/resumes.rb index 582e2b41..12d43b89 100644 --- a/app/services/lib/services/yoksis/endpoints/resumes.rb +++ b/app/services/lib/services/yoksis/endpoints/resumes.rb @@ -5,6 +5,8 @@ module Yoksis class Resumes WSDL_URL = 'http://servisler.yok.gov.tr/ws/ozgecmisv1?WSDL' + # TODO: Fix repetitive methods. Use aliases instead. + def citations(id_number:, year:) @citations = client.request( ARGS.dig(:citations, :operation), @@ -17,12 +19,10 @@ def citations(id_number:, year:) citations_result end - def duties(id_number:, year:, month:, day:) + def duties(id_number:) @duties = client.request( ARGS.dig(:duties, :operation), - args: params_with_defaults( - P_TC_KIMLIK_NO: id_number, P_TARIH: "#{year}-#{month}-#{day}" - ) + args: params_with_defaults(P_TC_KIMLIK_NO: id_number) ) raise InvalidResponseError if duties_has_error? @@ -31,12 +31,22 @@ def duties(id_number:, year:, month:, day:) duties_result end - def papers(id_number:, year:, month:, day:) + def lectures(id_number:) + @lectures = client.request( + ARGS.dig(:lectures, :operation), + args: params_with_defaults(P_TC_KIMLIK_NO: id_number) + ) + + raise InvalidResponseError if lectures_has_error? + raise NoContentError unless lectures_has_response? + + lectures_result + end + + def papers(id_number:) @papers = client.request( ARGS.dig(:papers, :operation), - args: params_with_defaults( - P_TC_KIMLIK_NO: id_number, P_TARIH: "#{year}-#{month}-#{day}" - ) + args: params_with_defaults(P_TC_KIMLIK_NO: id_number) ) raise InvalidResponseError if papers_has_error? @@ -113,6 +123,18 @@ def duties_result @duties.dig(*ARGS.dig(:duties, :result)) end + def lectures_has_error? + @lectures.dig(*ARGS.dig(:lectures, :status)) { |data| data.to_i.zero? } + end + + def lectures_has_response? + @lectures.dig(*ARGS.dig(:lectures, :result), &:present?) + end + + def lectures_result + @lectures.dig(*ARGS.dig(:lectures, :result)) + end + def params_with_defaults(**params) { parametre: { From 5ef39480fd7c756677e45ff8f71efcd86a8fffed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 13:48:18 +0300 Subject: [PATCH 16/98] Minor change in duties serializer --- app/serializers/yoksis/resumes/duties_serializer.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/serializers/yoksis/resumes/duties_serializer.rb b/app/serializers/yoksis/resumes/duties_serializer.rb index 29e4a280..ba15c3e4 100644 --- a/app/serializers/yoksis/resumes/duties_serializer.rb +++ b/app/serializers/yoksis/resumes/duties_serializer.rb @@ -8,8 +8,8 @@ class DutiesSerializer < Serializer attribute(:place_name) { object[:yer_ad].titleize_tr } attribute(:country_id) { object[:ulke_id].safe_to_i } attribute(:country_name) { object[:ulke_ad].titleize_tr } - attribute(:year_of_start) { object[:bastar1].titleize_tr } - attribute(:year_of_end) { object[:bittar1].titleize_tr } + attribute(:year_of_start) { object[:bastar1].safe_to_i } + attribute(:year_of_end) { object[:bittar1].safe_to_i } attribute(:scientific_field_name) { object[:bilimalan_adi].titleize_tr } attribute(:field_of_specialization_id) { object[:uzmanlik_alani].safe_to_i } attribute(:field_of_specialization_name) { object[:uzmanlik_alani_ad].titleize_tr } From 74f1c2282fca13e21d7d55d2a02f2b4a4b3e02e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 13:48:35 +0300 Subject: [PATCH 17/98] Add lectures action to resumes controller --- app/controllers/yoksis/resumes_controller.rb | 27 ++++++++------------ 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/app/controllers/yoksis/resumes_controller.rb b/app/controllers/yoksis/resumes_controller.rb index 85d5d65f..a9ee4f15 100644 --- a/app/controllers/yoksis/resumes_controller.rb +++ b/app/controllers/yoksis/resumes_controller.rb @@ -6,33 +6,28 @@ class ResumesController < ApplicationController include ActionsResource + # TODO: Fix stylistic issues + def citations render_as_json @resumes.citations( - id_number: secure_params.require(:id_number), - year: secure_params.require(:year) + id_number: secure_params.require(:id_number), year: secure_params.require(:year) ) end def papers - year, month, day = *secure_params.require(%i[year month day]) - render_as_json @resumes.papers( - id_number: secure_params.require(:id_number), - year: year, month: month, day: day - ) + render_as_json @resumes.papers(id_number: secure_params.require(:id_number)) end def duties - year, month, day = *secure_params.require(%i[year month day]) - render_as_json @resumes.duties( - id_number: secure_params.require(:id_number), - year: year, month: month, day: day - ) + render_as_json @resumes.duties(id_number: secure_params.require(:id_number)) + end + + def lectures + render_as_json @resumes.lectures(id_number: secure_params.require(:id_number)) end def articles - render_as_json @resumes.send( - action_name, id_number: secure_params.require(:id_number) - ) + render_as_json @resumes.send(action_name, id_number: secure_params.require(:id_number)) end alias certifications articles @@ -50,7 +45,7 @@ def set_resumes end def secure_params - params.require(:resume).permit(:id_number, :year, :month, :day) + params.require(:resume).permit(:id_number, :year) end end end From 234644242f3f3c080f04180d6ba850663e4ee9b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 13:48:45 +0300 Subject: [PATCH 18/98] Add lectures serializer --- .../yoksis/resumes/lectures_serializer.rb | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 app/serializers/yoksis/resumes/lectures_serializer.rb diff --git a/app/serializers/yoksis/resumes/lectures_serializer.rb b/app/serializers/yoksis/resumes/lectures_serializer.rb new file mode 100644 index 00000000..77b6dea0 --- /dev/null +++ b/app/serializers/yoksis/resumes/lectures_serializer.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Yoksis + module Resumes + class LecturesSerializer < Serializer + attribute(:id) { object[:ders_id].safe_to_i } + attribute(:name) { object[:ders_adi].titleize_tr } + attribute(:education_level_id) { object[:ogrenim_id].safe_to_i } + attribute(:education_level_name) { object[:ogrenim_adi].titleize_tr } + attribute(:academic_term_id) { object[:akademik_yil_id].safe_to_i } + attribute(:academic_term) { object[:akademik_yil] } + attribute(:language_id) { object[:dil_id].safe_to_i } + attribute(:language_name) { object[:dil_adi].titleize_tr } + attribute(:period) { object[:ders_saati].safe_to_i } + attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } + attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } + attribute(:date_of_update) { Time.zone.parse object[:guncelleme_tarihi] || '' } + attribute(:date_of_insert) { Time.zone.parse object[:ekleme_tarihi] || '' } + end + end +end From b9c8fd35b36a5a013e41a1f65123d5ca5cb198a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 13:49:01 +0300 Subject: [PATCH 19/98] Update routes for lectures --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/routes.rb b/config/routes.rb index 64a89285..378b026a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -71,6 +71,7 @@ get :certifications get :citations get :duties + get :lectures get :papers get :projects end From 164a6906dfa8c8c7db1a2cd9ce050ca1ab88c4d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 13:50:23 +0300 Subject: [PATCH 20/98] Fix rubocop offense --- app/services/lib/services/yoksis/endpoints/resumes.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/services/lib/services/yoksis/endpoints/resumes.rb b/app/services/lib/services/yoksis/endpoints/resumes.rb index 12d43b89..0e0c2202 100644 --- a/app/services/lib/services/yoksis/endpoints/resumes.rb +++ b/app/services/lib/services/yoksis/endpoints/resumes.rb @@ -2,6 +2,7 @@ module Services module Yoksis + # rubocop:disable Metrics/ClassLength class Resumes WSDL_URL = 'http://servisler.yok.gov.tr/ws/ozgecmisv1?WSDL' @@ -149,5 +150,6 @@ def after_initialize @username, @password = @options[:basic_auth] end end + # rubocop:enable Metrics/ClassLength end end From 1a6f3eabb7bd67544bd172510a7391c4c565c5d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 14:32:00 +0300 Subject: [PATCH 21/98] Change action name as academic_duties --- .../{duties_serializer.rb => academic_duties_serializer.rb} | 2 +- config/routes.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) rename app/serializers/yoksis/resumes/{duties_serializer.rb => academic_duties_serializer.rb} (98%) diff --git a/app/serializers/yoksis/resumes/duties_serializer.rb b/app/serializers/yoksis/resumes/academic_duties_serializer.rb similarity index 98% rename from app/serializers/yoksis/resumes/duties_serializer.rb rename to app/serializers/yoksis/resumes/academic_duties_serializer.rb index ba15c3e4..d52d7407 100644 --- a/app/serializers/yoksis/resumes/duties_serializer.rb +++ b/app/serializers/yoksis/resumes/academic_duties_serializer.rb @@ -2,7 +2,7 @@ module Yoksis module Resumes - class DutiesSerializer < Serializer + class AcademicDutiesSerializer < Serializer attribute(:id) { object[:gorev_id].safe_to_i } attribute(:place_id) { object[:yer_id].safe_to_i } attribute(:place_name) { object[:yer_ad].titleize_tr } diff --git a/config/routes.rb b/config/routes.rb index 378b026a..d9e1c4d1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -67,10 +67,11 @@ resources :resumes do collection do + get :academic_duties + get :administrative_duties get :articles get :certifications get :citations - get :duties get :lectures get :papers get :projects From 497dfc0b489386eb05fd35e7efa64ec2a1a6e322 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 14:32:46 +0300 Subject: [PATCH 22/98] Add administrative_duties action to resumes endpoint --- app/services/lib/services/yoksis/constants.rb | 7 ++- .../lib/services/yoksis/endpoints/resumes.rb | 48 ++++++++++++++----- 2 files changed, 42 insertions(+), 13 deletions(-) diff --git a/app/services/lib/services/yoksis/constants.rb b/app/services/lib/services/yoksis/constants.rb index dac1dcf3..15243f21 100644 --- a/app/services/lib/services/yoksis/constants.rb +++ b/app/services/lib/services/yoksis/constants.rb @@ -187,11 +187,16 @@ class Resumes < Base result: %i[get_bildiri_bilgisi_v1_response bildiri_liste], status: %i[get_bildiri_bilgisi_v1_response sonuc durum_kodu], }, - duties: { + academic_duties: { operation: :getir_akademik_gorev_listesi, result: %i[getir_akademik_gorev_listesi_response akademik_gorev_listesi], status: %i[getir_akademik_gorev_listesi_response sonuc durum_kodu], }, + administrative_duties: { + operation: :getir_idari_gorev_listesi, + result: %i[getir_idari_gorev_listesi_response idari_gorev_listesi], + status: %i[getir_idari_gorev_listesi_response sonuc durum_kodu], + }, lectures: { operation: :getir_ders_listesi, result: %i[getir_ders_listesi_response ders_listesi], diff --git a/app/services/lib/services/yoksis/endpoints/resumes.rb b/app/services/lib/services/yoksis/endpoints/resumes.rb index 0e0c2202..efd09c88 100644 --- a/app/services/lib/services/yoksis/endpoints/resumes.rb +++ b/app/services/lib/services/yoksis/endpoints/resumes.rb @@ -20,16 +20,16 @@ def citations(id_number:, year:) citations_result end - def duties(id_number:) - @duties = client.request( - ARGS.dig(:duties, :operation), + def academic_duties(id_number:) + @academic_duties = client.request( + ARGS.dig(:academic_duties, :operation), args: params_with_defaults(P_TC_KIMLIK_NO: id_number) ) - raise InvalidResponseError if duties_has_error? - raise NoContentError unless duties_has_response? + raise InvalidResponseError if academic_duties_has_error? + raise NoContentError unless academic_duties_has_response? - duties_result + academic_duties_result end def lectures(id_number:) @@ -56,6 +56,18 @@ def papers(id_number:) papers_result end + def administrative_duties(id_number:) + @administrative_duties = client.request( + ARGS.dig(:administrative_duties, :operation), + args: params_with_defaults(P_TC_KIMLIK_NO: id_number) + ) + + raise InvalidResponseError if administrative_duties_has_error? + raise NoContentError unless administrative_duties_has_response? + + administrative_duties_result + end + def articles(id_number:) @resumes = client.request( ARGS.dig(__callee__, :operation), @@ -112,16 +124,16 @@ def papers_result @papers.dig(*ARGS.dig(:papers, :result)) end - def duties_has_error? - @duties.dig(*ARGS.dig(:duties, :status)) { |data| data.to_i.zero? } + def academic_duties_has_error? + @academic_duties.dig(*ARGS.dig(:academic_duties, :status)) { |data| data.to_i.zero? } end - def duties_has_response? - @duties.dig(*ARGS.dig(:duties, :result), &:present?) + def academic_duties_has_response? + @academic_duties.dig(*ARGS.dig(:academic_duties, :result), &:present?) end - def duties_result - @duties.dig(*ARGS.dig(:duties, :result)) + def academic_duties_result + @academic_duties.dig(*ARGS.dig(:academic_duties, :result)) end def lectures_has_error? @@ -136,6 +148,18 @@ def lectures_result @lectures.dig(*ARGS.dig(:lectures, :result)) end + def administrative_duties_has_error? + @administrative_duties.dig(*ARGS.dig(:administrative_duties, :status)) { |data| data.to_i.zero? } + end + + def administrative_duties_has_response? + @administrative_duties.dig(*ARGS.dig(:administrative_duties, :result), &:present?) + end + + def administrative_duties_result + @administrative_duties.dig(*ARGS.dig(:administrative_duties, :result)) + end + def params_with_defaults(**params) { parametre: { From 49cec4128967ecf839b58f2fb3113d6636ce36c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 14:33:12 +0300 Subject: [PATCH 23/98] Add administrative_duties action to controller --- app/controllers/yoksis/resumes_controller.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/controllers/yoksis/resumes_controller.rb b/app/controllers/yoksis/resumes_controller.rb index a9ee4f15..f8255f33 100644 --- a/app/controllers/yoksis/resumes_controller.rb +++ b/app/controllers/yoksis/resumes_controller.rb @@ -18,8 +18,12 @@ def papers render_as_json @resumes.papers(id_number: secure_params.require(:id_number)) end - def duties - render_as_json @resumes.duties(id_number: secure_params.require(:id_number)) + def academic_duties + render_as_json @resumes.academic_duties(id_number: secure_params.require(:id_number)) + end + + def administrative_duties + render_as_json @resumes.administrative_duties(id_number: secure_params.require(:id_number)) end def lectures From 854e5d26d15385ddaa800f46ea1fe61030872593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 14:34:28 +0300 Subject: [PATCH 24/98] Add administrative_duties serializer --- .../administrative_duties_serializer.rb | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 app/serializers/yoksis/resumes/administrative_duties_serializer.rb diff --git a/app/serializers/yoksis/resumes/administrative_duties_serializer.rb b/app/serializers/yoksis/resumes/administrative_duties_serializer.rb new file mode 100644 index 00000000..1b37d292 --- /dev/null +++ b/app/serializers/yoksis/resumes/administrative_duties_serializer.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Yoksis + module Resumes + class AdministrativeDutiesSerializer < Serializer + attribute(:administrative_duty_id) { object[:idgor_id].safe_to_i } + attribute(:id) { object[:gorev_id].safe_to_i } + attribute(:name) { object[:gorev_adi].titleize_tr } + attribute(:place_id) { object[:yer_id].safe_to_i } + attribute(:place_name) { object[:yer_ad].titleize_tr } + attribute(:country_id) { object[:ulke_id].safe_to_i } + attribute(:country_name) { object[:ulke_ad].titleize_tr } + attribute(:year_of_start) { object[:bas_tar].safe_to_i } + attribute(:year_of_end) { object[:bit_tar].safe_to_i } + attribute(:university_id) { object[:unv_id].safe_to_i } + attribute(:university_name) { object[:unv_birim_adi].titleize_tr } + attribute(:institution) { object[:fakultemyoenst].titleize_tr } + attribute(:major) { object[:abd].titleize_tr } + attribute(:department) { object[:bolumbilgisi].titleize_tr } + attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } + attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } + attribute(:date_of_update) { Time.zone.parse object[:guncelleme_tarihi] || '' } + end + end +end From 673e7aacce2b62dfa3b91dfbdfcbfdf249226e18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 15:53:29 +0300 Subject: [PATCH 25/98] Add editorships action to resumes endpoint --- app/services/lib/services/yoksis/constants.rb | 49 +++--- .../lib/services/yoksis/endpoints/resumes.rb | 148 +++--------------- 2 files changed, 46 insertions(+), 151 deletions(-) diff --git a/app/services/lib/services/yoksis/constants.rb b/app/services/lib/services/yoksis/constants.rb index 15243f21..aa86f72d 100644 --- a/app/services/lib/services/yoksis/constants.rb +++ b/app/services/lib/services/yoksis/constants.rb @@ -162,46 +162,51 @@ class References < Base end class Resumes < Base ARGS = { - certifications: { - operation: :get_arastirma_sertifka_bilgisi_v1, - result: %i[get_arastirma_sertifka_bilgisi_v1_response arastirma_liste], - status: %i[get_arastirma_sertifka_bilgisi_v1_response sonuc durum_kodu] + academic_duties: { + operation: :getir_akademik_gorev_listesi, + result: %i[getir_akademik_gorev_listesi_response akademik_gorev_listesi], + status: %i[getir_akademik_gorev_listesi_response sonuc durum_kodu], + }, + administrative_duties: { + operation: :getir_idari_gorev_listesi, + result: %i[getir_idari_gorev_listesi_response idari_gorev_listesi], + status: %i[getir_idari_gorev_listesi_response sonuc durum_kodu], }, articles: { operation: :get_makale_bilgisi_v1, result: %i[get_makale_bilgisi_v1_response makale_liste], status: %i[get_makale_bilgisi_v1_response sonuc durum_kodu] }, - projects: { - operation: :getir_proje_listesi, - result: %i[getir_proje_listesi_response proje_listesi], - status: %i[getir_proje_listesi_response sonuc durum_kodu] + certifications: { + operation: :get_arastirma_sertifka_bilgisi_v1, + result: %i[get_arastirma_sertifka_bilgisi_v1_response arastirma_liste], + status: %i[get_arastirma_sertifka_bilgisi_v1_response sonuc durum_kodu] }, citations: { operation: :get_atif_sayilari_v1, result: %i[get_atif_sayilari_v1_response atif_sayi_listesi], status: %i[get_atif_sayilari_v1_response sonuc durum_kodu], }, + editorships: { + operation: :get_editorluk_bilgisi_v1, + result: %i[get_editorluk_bilgisi_v1_response editorluk_liste], + status: %i[get_editorluk_bilgisi_v1_response sonuc durum_kodu], + }, + lectures: { + operation: :getir_ders_listesi, + result: %i[getir_ders_listesi_response ders_listesi], + status: %i[getir_ders_listesi_response sonuc durum_kodu], + }, papers: { operation: :get_bildiri_bilgisi_v1, result: %i[get_bildiri_bilgisi_v1_response bildiri_liste], status: %i[get_bildiri_bilgisi_v1_response sonuc durum_kodu], }, - academic_duties: { - operation: :getir_akademik_gorev_listesi, - result: %i[getir_akademik_gorev_listesi_response akademik_gorev_listesi], - status: %i[getir_akademik_gorev_listesi_response sonuc durum_kodu], - }, - administrative_duties: { - operation: :getir_idari_gorev_listesi, - result: %i[getir_idari_gorev_listesi_response idari_gorev_listesi], - status: %i[getir_idari_gorev_listesi_response sonuc durum_kodu], + projects: { + operation: :getir_proje_listesi, + result: %i[getir_proje_listesi_response proje_listesi], + status: %i[getir_proje_listesi_response sonuc durum_kodu] }, - lectures: { - operation: :getir_ders_listesi, - result: %i[getir_ders_listesi_response ders_listesi], - status: %i[getir_ders_listesi_response sonuc durum_kodu], - } }.freeze end class Staff < Base diff --git a/app/services/lib/services/yoksis/endpoints/resumes.rb b/app/services/lib/services/yoksis/endpoints/resumes.rb index efd09c88..f636eb00 100644 --- a/app/services/lib/services/yoksis/endpoints/resumes.rb +++ b/app/services/lib/services/yoksis/endpoints/resumes.rb @@ -2,72 +2,9 @@ module Services module Yoksis - # rubocop:disable Metrics/ClassLength class Resumes WSDL_URL = 'http://servisler.yok.gov.tr/ws/ozgecmisv1?WSDL' - # TODO: Fix repetitive methods. Use aliases instead. - - def citations(id_number:, year:) - @citations = client.request( - ARGS.dig(:citations, :operation), - args: params_with_defaults(P_TC_KIMLIK_NO: id_number, P_DONEM: year) - ) - - raise InvalidResponseError if citations_has_error? - raise NoContentError unless citations_has_response? - - citations_result - end - - def academic_duties(id_number:) - @academic_duties = client.request( - ARGS.dig(:academic_duties, :operation), - args: params_with_defaults(P_TC_KIMLIK_NO: id_number) - ) - - raise InvalidResponseError if academic_duties_has_error? - raise NoContentError unless academic_duties_has_response? - - academic_duties_result - end - - def lectures(id_number:) - @lectures = client.request( - ARGS.dig(:lectures, :operation), - args: params_with_defaults(P_TC_KIMLIK_NO: id_number) - ) - - raise InvalidResponseError if lectures_has_error? - raise NoContentError unless lectures_has_response? - - lectures_result - end - - def papers(id_number:) - @papers = client.request( - ARGS.dig(:papers, :operation), - args: params_with_defaults(P_TC_KIMLIK_NO: id_number) - ) - - raise InvalidResponseError if papers_has_error? - raise NoContentError unless papers_has_response? - - papers_result - end - - def administrative_duties(id_number:) - @administrative_duties = client.request( - ARGS.dig(:administrative_duties, :operation), - args: params_with_defaults(P_TC_KIMLIK_NO: id_number) - ) - - raise InvalidResponseError if administrative_duties_has_error? - raise NoContentError unless administrative_duties_has_response? - - administrative_duties_result - end - def articles(id_number:) @resumes = client.request( ARGS.dig(__callee__, :operation), @@ -80,13 +17,27 @@ def articles(id_number:) resumes_result __callee__ end - alias certifications articles - alias projects articles + def citations(id_number:, year:) + @resumes = client.request( + ARGS.dig(:citations, :operation), + args: params_with_defaults(P_TC_KIMLIK_NO: id_number, P_DONEM: year) + ) - private + raise InvalidResponseError if resumes_has_error? __method__ + raise NoContentError unless resumes_has_response? __method__ - # TODO: Refactor the error and response handling in the future. Because - # there are too many repetitive code blocks. + resumes_result __method__ + end + + alias academic_duties articles + alias administrative_duties articles + alias certifications articles + alias editorships articles + alias lectures articles + alias papers articles + alias projects articles + + private def resumes_has_error?(method) @resumes.dig(*ARGS.dig(method, :status)) { |data| data.to_i.zero? } @@ -100,66 +51,6 @@ def resumes_result(method) @resumes.dig(*ARGS.dig(method, :result)) end - def citations_has_error? - @citations.dig(*ARGS.dig(:citations, :status)) { |data| data.to_i.zero? } - end - - def citations_has_response? - @citations.dig(*ARGS.dig(:citations, :result), &:present?) - end - - def citations_result - @citations.dig(*ARGS.dig(:citations, :result)) - end - - def papers_has_error? - @papers.dig(*ARGS.dig(:papers, :status)) { |data| data.to_i.zero? } - end - - def papers_has_response? - @papers.dig(*ARGS.dig(:papers, :result), &:present?) - end - - def papers_result - @papers.dig(*ARGS.dig(:papers, :result)) - end - - def academic_duties_has_error? - @academic_duties.dig(*ARGS.dig(:academic_duties, :status)) { |data| data.to_i.zero? } - end - - def academic_duties_has_response? - @academic_duties.dig(*ARGS.dig(:academic_duties, :result), &:present?) - end - - def academic_duties_result - @academic_duties.dig(*ARGS.dig(:academic_duties, :result)) - end - - def lectures_has_error? - @lectures.dig(*ARGS.dig(:lectures, :status)) { |data| data.to_i.zero? } - end - - def lectures_has_response? - @lectures.dig(*ARGS.dig(:lectures, :result), &:present?) - end - - def lectures_result - @lectures.dig(*ARGS.dig(:lectures, :result)) - end - - def administrative_duties_has_error? - @administrative_duties.dig(*ARGS.dig(:administrative_duties, :status)) { |data| data.to_i.zero? } - end - - def administrative_duties_has_response? - @administrative_duties.dig(*ARGS.dig(:administrative_duties, :result), &:present?) - end - - def administrative_duties_result - @administrative_duties.dig(*ARGS.dig(:administrative_duties, :result)) - end - def params_with_defaults(**params) { parametre: { @@ -174,6 +65,5 @@ def after_initialize @username, @password = @options[:basic_auth] end end - # rubocop:enable Metrics/ClassLength end end From cbce1368fa953ae937ce68860fd4305c6a8318c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 15:53:45 +0300 Subject: [PATCH 26/98] Add editorships action to resumes controller --- app/controllers/yoksis/resumes_controller.rb | 33 ++++++-------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/app/controllers/yoksis/resumes_controller.rb b/app/controllers/yoksis/resumes_controller.rb index f8255f33..19125851 100644 --- a/app/controllers/yoksis/resumes_controller.rb +++ b/app/controllers/yoksis/resumes_controller.rb @@ -6,7 +6,9 @@ class ResumesController < ApplicationController include ActionsResource - # TODO: Fix stylistic issues + def articles + render_as_json @resumes.send(action_name, id_number: secure_params.require(:id_number)) + end def citations render_as_json @resumes.citations( @@ -14,28 +16,13 @@ def citations ) end - def papers - render_as_json @resumes.papers(id_number: secure_params.require(:id_number)) - end - - def academic_duties - render_as_json @resumes.academic_duties(id_number: secure_params.require(:id_number)) - end - - def administrative_duties - render_as_json @resumes.administrative_duties(id_number: secure_params.require(:id_number)) - end - - def lectures - render_as_json @resumes.lectures(id_number: secure_params.require(:id_number)) - end - - def articles - render_as_json @resumes.send(action_name, id_number: secure_params.require(:id_number)) - end - - alias certifications articles - alias projects articles + alias academic_duties articles + alias administrative_duties articles + alias certifications articles + alias editorships articles + alias lectures articles + alias projects articles + alias papers articles private From ddec8246ec022a26f0465d4eb2776f91d536bf11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 15:53:54 +0300 Subject: [PATCH 27/98] Add editorships serializer --- .../yoksis/resumes/editorships_serializer.rb | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 app/serializers/yoksis/resumes/editorships_serializer.rb diff --git a/app/serializers/yoksis/resumes/editorships_serializer.rb b/app/serializers/yoksis/resumes/editorships_serializer.rb new file mode 100644 index 00000000..a4089405 --- /dev/null +++ b/app/serializers/yoksis/resumes/editorships_serializer.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module Yoksis + module Resumes + class EditorshipsSerializer < Serializer + attribute(:publishing_id) { object[:yayin_id].safe_to_i } + attribute(:publishing_name) { object[:yayin_adi].titleize_tr } + attribute(:publishing_house) { object[:yayin_evi].titleize_tr } + attribute(:publishing_language_id) { object[:yayin_dili].safe_to_i } + attribute(:publishing_language_name) { object[:yayin_dili_adi].titleize_tr } + attribute(:type_id) { object[:editorluk_tur].safe_to_i } + attribute(:type_name) { object[:editorluk_tur_ad].titleize_tr } + attribute(:scope_id) { object[:kapsam_id].safe_to_i } + attribute(:scope_name) { object[:kapsam_ad].titleize_tr } + attribute(:duty_id) { object[:editor_gorev].safe_to_i } + attribute(:duty_name) { object[:editor_gorev_ad].titleize_tr } + attribute(:authors) { object[:yazar_adi] && object[:yazar_adi].split(',').map(&:strip).map(&:titleize_tr) } + attribute(:authors_number) { object[:yazar_sayisi].safe_to_i } + attribute(:country_id) { object[:ulke].safe_to_i } + attribute(:country_name) { object[:ulke_adi].titleize_tr } + attribute(:city) { object[:sehir].titleize_tr } + attribute(:index_id) { object[:endeks_id].safe_to_i } + attribute(:index) { object[:endeks] } + attribute(:year) { object[:yil].safe_to_i } + attribute(:date_of_start) { object[:bas_tarih] && Date.parse(object[:bas_tarih]) } + attribute(:date_of_end) { object[:bit_tarih] && Date.parse(object[:bit_tarih]) } + attribute(:doi) { object[:doi].safe_to_i } + attribute(:issn) { object[:issn].safe_to_i } + attribute(:access_type_id) { object[:erisim_turu].safe_to_i } + attribute(:access_type_name) { object[:erisim_turu_ad].titleize_tr } + attribute(:access_link) { object[:erisim_linki] } + attribute(:citations_number) { object[:atif_sayisi].safe_to_i } + attribute(:field) { object[:alan_bilgisi].titleize_tr } + attribute(:keywords) { object[:anahtar_kelime].titleize_tr } + attribute(:author_id) { object[:yazar_id].safe_to_i } + attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } + attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } + attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } + attribute(:incentive_points) { object[:tesv_puan].safe_to_f } + end + end +end From 6db7ecddc6b0be7f4275d23d56e13a41120939fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 15:54:05 +0300 Subject: [PATCH 28/98] Update routes for editorships --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/routes.rb b/config/routes.rb index d9e1c4d1..4c111200 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -72,6 +72,7 @@ get :articles get :certifications get :citations + get :editorships get :lectures get :papers get :projects From b8d527720b3398b5185caea4fb0b6509ad3ca3e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 16:03:27 +0300 Subject: [PATCH 29/98] Refactor all resumes serializers --- .../resumes/academic_duties_serializer.rb | 48 ++++++------ .../administrative_duties_serializer.rb | 34 ++++---- .../yoksis/resumes/articles_serializer.rb | 78 +++++++++---------- .../resumes/certifications_serializer.rb | 40 +++++----- .../yoksis/resumes/citations_serializer.rb | 30 +++---- .../yoksis/resumes/lectures_serializer.rb | 26 +++---- .../yoksis/resumes/papers_serializer.rb | 76 +++++++++--------- .../yoksis/resumes/projects_serializer.rb | 44 +++++------ 8 files changed, 188 insertions(+), 188 deletions(-) diff --git a/app/serializers/yoksis/resumes/academic_duties_serializer.rb b/app/serializers/yoksis/resumes/academic_duties_serializer.rb index d52d7407..5f03dc0d 100644 --- a/app/serializers/yoksis/resumes/academic_duties_serializer.rb +++ b/app/serializers/yoksis/resumes/academic_duties_serializer.rb @@ -3,30 +3,30 @@ module Yoksis module Resumes class AcademicDutiesSerializer < Serializer - attribute(:id) { object[:gorev_id].safe_to_i } - attribute(:place_id) { object[:yer_id].safe_to_i } - attribute(:place_name) { object[:yer_ad].titleize_tr } - attribute(:country_id) { object[:ulke_id].safe_to_i } - attribute(:country_name) { object[:ulke_ad].titleize_tr } - attribute(:year_of_start) { object[:bastar1].safe_to_i } - attribute(:year_of_end) { object[:bittar1].safe_to_i } - attribute(:scientific_field_name) { object[:bilimalan_adi].titleize_tr } - attribute(:field_of_specialization_id) { object[:uzmanlik_alani].safe_to_i } - attribute(:field_of_specialization_name) { object[:uzmanlik_alani_ad].titleize_tr } - attribute(:university_id) { object[:univ_id].safe_to_i } - attribute(:university_name) { object[:univ_birim_adi].titleize_tr } - attribute(:unit_id) { object[:birim_id].safe_to_i } - attribute(:faculty) { object[:fakultebilgisi].titleize_tr } - attribute(:department) { object[:bolumbilgisi].titleize_tr } - attribute(:field) { object[:alanbilgisi].titleize_tr } - attribute(:title_id) { object[:kadro_unvan_id].safe_to_i } - attribute(:title_name) { object[:kadro_unvan_adi].titleize_tr } - attribute(:academic_status_id) { object[:akademik_durum].safe_to_i } - attribute(:academic_status_name) { object[:akademik_durum_adi].titleize_tr } - attribute(:academic_unit_name) { object[:akademik_birim_adi].titleize_tr } - attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } - attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } - attribute(:date_of_update) { Time.zone.parse object[:guncelleme_tarihi] || '' } + attribute(:id) { object[:gorev_id].safe_to_i } + attribute(:place_id) { object[:yer_id].safe_to_i } + attribute(:place_name) { object[:yer_ad].titleize_tr } + attribute(:country_id) { object[:ulke_id].safe_to_i } + attribute(:country_name) { object[:ulke_ad].titleize_tr } + attribute(:year_of_start) { object[:bastar1].safe_to_i } + attribute(:year_of_end) { object[:bittar1].safe_to_i } + attribute(:scientific_field_name) { object[:bilimalan_adi].titleize_tr } + attribute(:field_of_specialization_id) { object[:uzmanlik_alani].safe_to_i } + attribute(:field_of_specialization_name) { object[:uzmanlik_alani_ad].titleize_tr } + attribute(:university_id) { object[:univ_id].safe_to_i } + attribute(:university_name) { object[:univ_birim_adi].titleize_tr } + attribute(:unit_id) { object[:birim_id].safe_to_i } + attribute(:faculty) { object[:fakultebilgisi].titleize_tr } + attribute(:department) { object[:bolumbilgisi].titleize_tr } + attribute(:field) { object[:alanbilgisi].titleize_tr } + attribute(:title_id) { object[:kadro_unvan_id].safe_to_i } + attribute(:title_name) { object[:kadro_unvan_adi].titleize_tr } + attribute(:academic_status_id) { object[:akademik_durum].safe_to_i } + attribute(:academic_status_name) { object[:akademik_durum_adi].titleize_tr } + attribute(:academic_unit_name) { object[:akademik_birim_adi].titleize_tr } + attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } + attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } + attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } end end end diff --git a/app/serializers/yoksis/resumes/administrative_duties_serializer.rb b/app/serializers/yoksis/resumes/administrative_duties_serializer.rb index 1b37d292..436638c1 100644 --- a/app/serializers/yoksis/resumes/administrative_duties_serializer.rb +++ b/app/serializers/yoksis/resumes/administrative_duties_serializer.rb @@ -3,23 +3,23 @@ module Yoksis module Resumes class AdministrativeDutiesSerializer < Serializer - attribute(:administrative_duty_id) { object[:idgor_id].safe_to_i } - attribute(:id) { object[:gorev_id].safe_to_i } - attribute(:name) { object[:gorev_adi].titleize_tr } - attribute(:place_id) { object[:yer_id].safe_to_i } - attribute(:place_name) { object[:yer_ad].titleize_tr } - attribute(:country_id) { object[:ulke_id].safe_to_i } - attribute(:country_name) { object[:ulke_ad].titleize_tr } - attribute(:year_of_start) { object[:bas_tar].safe_to_i } - attribute(:year_of_end) { object[:bit_tar].safe_to_i } - attribute(:university_id) { object[:unv_id].safe_to_i } - attribute(:university_name) { object[:unv_birim_adi].titleize_tr } - attribute(:institution) { object[:fakultemyoenst].titleize_tr } - attribute(:major) { object[:abd].titleize_tr } - attribute(:department) { object[:bolumbilgisi].titleize_tr } - attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } - attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } - attribute(:date_of_update) { Time.zone.parse object[:guncelleme_tarihi] || '' } + attribute(:administrative_duty_id) { object[:idgor_id].safe_to_i } + attribute(:id) { object[:gorev_id].safe_to_i } + attribute(:name) { object[:gorev_adi].titleize_tr } + attribute(:place_id) { object[:yer_id].safe_to_i } + attribute(:place_name) { object[:yer_ad].titleize_tr } + attribute(:country_id) { object[:ulke_id].safe_to_i } + attribute(:country_name) { object[:ulke_ad].titleize_tr } + attribute(:year_of_start) { object[:bas_tar].safe_to_i } + attribute(:year_of_end) { object[:bit_tar].safe_to_i } + attribute(:university_id) { object[:unv_id].safe_to_i } + attribute(:university_name) { object[:unv_birim_adi].titleize_tr } + attribute(:institution) { object[:fakultemyoenst].titleize_tr } + attribute(:major) { object[:abd].titleize_tr } + attribute(:department) { object[:bolumbilgisi].titleize_tr } + attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } + attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } + attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } end end end diff --git a/app/serializers/yoksis/resumes/articles_serializer.rb b/app/serializers/yoksis/resumes/articles_serializer.rb index 199c8b13..1213a7a0 100644 --- a/app/serializers/yoksis/resumes/articles_serializer.rb +++ b/app/serializers/yoksis/resumes/articles_serializer.rb @@ -3,45 +3,45 @@ module Yoksis module Resumes class ArticlesSerializer < Serializer - attribute(:id) { object[:yayin_id].safe_to_i } - attribute(:name) { object[:makale_adi].titleize_tr } - attribute(:type_id) { object[:makale_turu_id].safe_to_i } - attribute(:type_name) { object[:makale_turu_ad].titleize_tr } - attribute(:scope_id) { object[:kapsam_id].safe_to_i } - attribute(:scope_name) { object[:kapsam_ad].titleize_tr } - attribute(:referee_type_id) { object[:hakem_tur].safe_to_i } - attribute(:referee_type_name) { object[:hakem_tur_ad].titleize_tr } - attribute(:index_id) { object[:endeks_id].safe_to_i } - attribute(:index) { object[:endeks].titleize_tr } - attribute(:author_id) { object[:yazar_id].safe_to_i } - attribute(:authors) { object[:yazar_adi].split(',').map(&:strip).map(&:titleize_tr) } - attribute(:authors_number) { object[:yazar_sayisi].safe_to_i } - attribute(:country_id) { object[:ulke].safe_to_i } - attribute(:country_name) { object[:ulke_adi].titleize_tr } - attribute(:city) { object[:sehir].titleize_tr } - attribute(:journal_name) { object[:dergi_adi].titleize_tr } - attribute(:language_id) { object[:yayin_dili].safe_to_i } - attribute(:language_name) { object[:yayin_dili_adi].titleize_tr } - attribute(:month) { object[:ay].safe_to_i } - attribute(:year) { object[:yil].safe_to_i } - attribute(:volume) { object[:cilt].safe_to_i } - attribute(:issue) { object[:sayi].safe_to_i } - attribute(:first_page) { object[:ilk_sayfa].safe_to_i } - attribute(:last_page) { object[:son_sayfa].safe_to_i } - attribute(:doi) { object[:doi].safe_to_i } - attribute(:issn) { object[:issn].safe_to_i } - attribute(:access_type_id) { object[:erisim_turu].safe_to_i } - attribute(:access_type_name) { object[:erisim_turu_ad] } - attribute(:access_link) { object[:erisim_linki] } - attribute(:citations_number) { object[:atif_sayisi].safe_to_i } - attribute(:field) { object[:alan_bilgisi].titleize_tr } - attribute(:keywords) { object[:anahtar_kelime].titleize_tr } - attribute(:special_number_id) { object[:ozel_sayi].safe_to_i } - attribute(:special_number_name) { object[:ozel_sayi_ad].titleize_tr } - attribute(:date_of_update) { Time.zone.parse object[:guncelleme_tarihi] || '' } - attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } - attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } - attribute(:incentive_points) { object[:tesv_puan].safe_to_f } + attribute(:id) { object[:yayin_id].safe_to_i } + attribute(:name) { object[:makale_adi].titleize_tr } + attribute(:type_id) { object[:makale_turu_id].safe_to_i } + attribute(:type_name) { object[:makale_turu_ad].titleize_tr } + attribute(:scope_id) { object[:kapsam_id].safe_to_i } + attribute(:scope_name) { object[:kapsam_ad].titleize_tr } + attribute(:referee_type_id) { object[:hakem_tur].safe_to_i } + attribute(:referee_type_name) { object[:hakem_tur_ad].titleize_tr } + attribute(:index_id) { object[:endeks_id].safe_to_i } + attribute(:index) { object[:endeks].titleize_tr } + attribute(:author_id) { object[:yazar_id].safe_to_i } + attribute(:authors) { object[:yazar_adi] && object[:yazar_adi].split(',').map(&:strip).map(&:titleize_tr) } + attribute(:authors_number) { object[:yazar_sayisi].safe_to_i } + attribute(:country_id) { object[:ulke].safe_to_i } + attribute(:country_name) { object[:ulke_adi].titleize_tr } + attribute(:city) { object[:sehir].titleize_tr } + attribute(:journal_name) { object[:dergi_adi].titleize_tr } + attribute(:language_id) { object[:yayin_dili].safe_to_i } + attribute(:language_name) { object[:yayin_dili_adi].titleize_tr } + attribute(:month) { object[:ay].safe_to_i } + attribute(:year) { object[:yil].safe_to_i } + attribute(:volume) { object[:cilt].safe_to_i } + attribute(:issue) { object[:sayi].safe_to_i } + attribute(:first_page) { object[:ilk_sayfa].safe_to_i } + attribute(:last_page) { object[:son_sayfa].safe_to_i } + attribute(:doi) { object[:doi].safe_to_i } + attribute(:issn) { object[:issn].safe_to_i } + attribute(:access_type_id) { object[:erisim_turu].safe_to_i } + attribute(:access_type_name) { object[:erisim_turu_ad] } + attribute(:access_link) { object[:erisim_linki] } + attribute(:citations_number) { object[:atif_sayisi].safe_to_i } + attribute(:field) { object[:alan_bilgisi].titleize_tr } + attribute(:keywords) { object[:anahtar_kelime].titleize_tr } + attribute(:special_number_id) { object[:ozel_sayi].safe_to_i } + attribute(:special_number_name) { object[:ozel_sayi_ad].titleize_tr } + attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } + attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } + attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } + attribute(:incentive_points) { object[:tesv_puan].safe_to_f } end end end diff --git a/app/serializers/yoksis/resumes/certifications_serializer.rb b/app/serializers/yoksis/resumes/certifications_serializer.rb index 51c74067..dac0ea61 100644 --- a/app/serializers/yoksis/resumes/certifications_serializer.rb +++ b/app/serializers/yoksis/resumes/certifications_serializer.rb @@ -3,26 +3,26 @@ module Yoksis module Resumes class CertificationsSerializer < Serializer - attribute(:id) { object[:s_id].safe_to_i } - attribute(:name) { object[:adi].titleize_tr } - attribute(:content) { object[:icerik].titleize_tr } - attribute(:type_id) { object[:tur_id].safe_to_i } - attribute(:type_name) { object[:tur_adi].titleize_tr } - attribute(:location) { object[:yer].titleize_tr } - attribute(:scope_id) { object[:kapsam].safe_to_i } - attribute(:scope_name) { object[:kapsam_ad].titleize_tr } - attribute(:stint) { object[:sure].safe_to_i } - attribute(:title_id) { object[:unvan_id].safe_to_i } - attribute(:title_name) { object[:unvan_ad].titleize_tr } - attribute(:institution_id) { object[:kurum_id].safe_to_i } - attribute(:institution_name) { object[:kurum_ad].titleize_tr } - attribute(:members_number) { object[:kisi_sayisi].safe_to_i } - attribute(:country) { object[:ulke_sehir] && object[:ulke_sehir].split('/').first.titleize_tr } - attribute(:city) { object[:ulke_sehir] && object[:ulke_sehir].split('/').last.titleize_tr } - attribute(:date_of_update) { Time.zone.parse object[:guncelleme_tarihi] || '' } - attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } - attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } - attribute(:incentive_points) { object[:tesv_puan].safe_to_f } + attribute(:id) { object[:s_id].safe_to_i } + attribute(:name) { object[:adi].titleize_tr } + attribute(:content) { object[:icerik].titleize_tr } + attribute(:type_id) { object[:tur_id].safe_to_i } + attribute(:type_name) { object[:tur_adi].titleize_tr } + attribute(:location) { object[:yer].titleize_tr } + attribute(:scope_id) { object[:kapsam].safe_to_i } + attribute(:scope_name) { object[:kapsam_ad].titleize_tr } + attribute(:stint) { object[:sure].safe_to_i } + attribute(:title_id) { object[:unvan_id].safe_to_i } + attribute(:title_name) { object[:unvan_ad].titleize_tr } + attribute(:institution_id) { object[:kurum_id].safe_to_i } + attribute(:institution_name) { object[:kurum_ad].titleize_tr } + attribute(:members_number) { object[:kisi_sayisi].safe_to_i } + attribute(:country) { object[:ulke_sehir] && object[:ulke_sehir].split('/').first.titleize_tr } + attribute(:city) { object[:ulke_sehir] && object[:ulke_sehir].split('/').last.titleize_tr } + attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } + attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } + attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } + attribute(:incentive_points) { object[:tesv_puan].safe_to_f } attribute :date_of_start do next unless object[:bastar] diff --git a/app/serializers/yoksis/resumes/citations_serializer.rb b/app/serializers/yoksis/resumes/citations_serializer.rb index 2210ff33..31272b81 100644 --- a/app/serializers/yoksis/resumes/citations_serializer.rb +++ b/app/serializers/yoksis/resumes/citations_serializer.rb @@ -3,21 +3,21 @@ module Yoksis module Resumes class CitationsSerializer < Serializer - attribute(:id) { object[:a_id].safe_to_i } - attribute(:year) { object[:donem].safe_to_i } - attribute(:type_id) { object[:tur].safe_to_i } - attribute(:type_name) { object[:tur_ad].titleize_tr } - attribute(:work_type) { object[:eser_turu].titleize_tr } - attribute(:work_id) { object[:eser_id].safe_to_i } - attribute(:international_book_citation) { object[:uluslar_kit_atf].safe_to_i } - attribute(:national_book_citation) { object[:ulusal_kit_atf].safe_to_i } - attribute(:ssci_index) { object[:ssci_indeks_atf].safe_to_i } - attribute(:scope_index) { object[:alan_indeks_atf].safe_to_i } - attribute(:other_citations) { object[:diger_atif] } - attribute(:incentive_points) { object[:tesv_puan].safe_to_f } - attribute(:esci) { object[:esci].safe_to_i } - attribute(:composer_work) { object[:besteci_eser] } - attribute(:date_of_update) { Time.zone.parse object[:guncelleme_tarihi] || '' } + attribute(:id) { object[:a_id].safe_to_i } + attribute(:year) { object[:donem].safe_to_i } + attribute(:type_id) { object[:tur].safe_to_i } + attribute(:type_name) { object[:tur_ad].titleize_tr } + attribute(:work_type) { object[:eser_turu].titleize_tr } + attribute(:work_id) { object[:eser_id].safe_to_i } + attribute(:international_book_citation) { object[:uluslar_kit_atf].safe_to_i } + attribute(:national_book_citation) { object[:ulusal_kit_atf].safe_to_i } + attribute(:ssci_index) { object[:ssci_indeks_atf].safe_to_i } + attribute(:scope_index) { object[:alan_indeks_atf].safe_to_i } + attribute(:other_citations) { object[:diger_atif] } + attribute(:incentive_points) { object[:tesv_puan].safe_to_f } + attribute(:esci) { object[:esci].safe_to_i } + attribute(:composer_work) { object[:besteci_eser] } + attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } end end end diff --git a/app/serializers/yoksis/resumes/lectures_serializer.rb b/app/serializers/yoksis/resumes/lectures_serializer.rb index 77b6dea0..7e0b8ae0 100644 --- a/app/serializers/yoksis/resumes/lectures_serializer.rb +++ b/app/serializers/yoksis/resumes/lectures_serializer.rb @@ -3,19 +3,19 @@ module Yoksis module Resumes class LecturesSerializer < Serializer - attribute(:id) { object[:ders_id].safe_to_i } - attribute(:name) { object[:ders_adi].titleize_tr } - attribute(:education_level_id) { object[:ogrenim_id].safe_to_i } - attribute(:education_level_name) { object[:ogrenim_adi].titleize_tr } - attribute(:academic_term_id) { object[:akademik_yil_id].safe_to_i } - attribute(:academic_term) { object[:akademik_yil] } - attribute(:language_id) { object[:dil_id].safe_to_i } - attribute(:language_name) { object[:dil_adi].titleize_tr } - attribute(:period) { object[:ders_saati].safe_to_i } - attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } - attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } - attribute(:date_of_update) { Time.zone.parse object[:guncelleme_tarihi] || '' } - attribute(:date_of_insert) { Time.zone.parse object[:ekleme_tarihi] || '' } + attribute(:id) { object[:ders_id].safe_to_i } + attribute(:name) { object[:ders_adi].titleize_tr } + attribute(:education_level_id) { object[:ogrenim_id].safe_to_i } + attribute(:education_level_name) { object[:ogrenim_adi].titleize_tr } + attribute(:academic_term_id) { object[:akademik_yil_id].safe_to_i } + attribute(:academic_term) { object[:akademik_yil] } + attribute(:language_id) { object[:dil_id].safe_to_i } + attribute(:language_name) { object[:dil_adi].titleize_tr } + attribute(:period) { object[:ders_saati].safe_to_i } + attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } + attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } + attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } + attribute(:date_of_insert) { object[:ekleme_tarihi] && Time.zone.parse(object[:ekleme_tarihi]) } end end end diff --git a/app/serializers/yoksis/resumes/papers_serializer.rb b/app/serializers/yoksis/resumes/papers_serializer.rb index 6f74ad98..568a819b 100644 --- a/app/serializers/yoksis/resumes/papers_serializer.rb +++ b/app/serializers/yoksis/resumes/papers_serializer.rb @@ -3,44 +3,44 @@ module Yoksis module Resumes class PapersSerializer < Serializer - attribute(:id) { object[:yayin_id].safe_to_i } - attribute(:name) { object[:bildiri_adi] } - attribute(:scope_id) { object[:kapsam_id].safe_to_i } - attribute(:scope_name) { object[:kapsam_ad] } - attribute(:type_id) { object[:bildiri_tur_id].safe_to_i } - attribute(:type_name) { object[:bildiri_tur].titleize_tr } - attribute(:author_id) { object[:yazar_id].safe_to_i } - attribute(:authors_number) { object[:yazar_sayisi].safe_to_i } - attribute(:authors) { object[:yazar_adi].split(',').map(&:strip).map(&:titleize_tr) } - attribute(:city) { object[:sehir].titleize_tr } - attribute(:country_id) { object[:ulke].safe_to_i } - attribute(:country_name) { object[:ulke_adi].titleize_tr } - attribute(:language_id) { object[:yayin_dili].safe_to_i } - attribute(:language_name) { object[:yayin_dili_adi].titleize_tr } - attribute(:status_id) { object[:yayin_durumu].safe_to_i } - attribute(:status_name) { object[:yayin_durumu_ad].titleize_tr } - attribute(:date_of_release) { object[:basim_tarihi] && Date.parse(object[:basim_tarihi]) } - attribute(:release_type_id) { object[:basim_turu].safe_to_i } - attribute(:release_type_name) { object[:basim_turu_ad].titleize_tr } - attribute(:volume) { object[:cilt].safe_to_i } - attribute(:issue) { object[:sayi].safe_to_i } - attribute(:first_page) { object[:ilk_sayfa].safe_to_i } - attribute(:last_page) { object[:son_sayfa].safe_to_i } - attribute(:doi) { object[:doi].safe_to_i } - attribute(:issn) { object[:issn].safe_to_i } - attribute(:print_isbn) { object[:print_isbn].safe_to_i } - attribute(:access_link) { object[:access_link] } - attribute(:citations_number) { object[:atif_sayisi].safe_to_i } - attribute(:field) { object[:alan_bilgisi].titleize_tr } - attribute(:keywords) { object[:anahtar_kelime].titleize_tr } - attribute(:special_number_id) { object[:ozel_sayi].safe_to_i } - attribute(:special_number_name) { object[:ozel_sayi_ad].titleize_tr } - attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } - attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } - attribute(:incentive_points) { object[:tesv_puan].safe_to_f } - attribute(:presentation_type_id) { object[:bildiri_sunum_turu].safe_to_i } - attribute(:presentation_type_name) { object[:bildiri_sunum_turu_ad].titleize_tr } - attribute(:date_of_update) { Time.zone.parse object[:guncelleme_tarihi] || '' } + attribute(:id) { object[:yayin_id].safe_to_i } + attribute(:name) { object[:bildiri_adi] } + attribute(:scope_id) { object[:kapsam_id].safe_to_i } + attribute(:scope_name) { object[:kapsam_ad] } + attribute(:type_id) { object[:bildiri_tur_id].safe_to_i } + attribute(:type_name) { object[:bildiri_tur].titleize_tr } + attribute(:author_id) { object[:yazar_id].safe_to_i } + attribute(:authors_number) { object[:yazar_sayisi].safe_to_i } + attribute(:authors) { object[:yazar_adi] && object[:yazar_adi].split(',').map(&:strip).map(&:titleize_tr) } + attribute(:city) { object[:sehir].titleize_tr } + attribute(:country_id) { object[:ulke].safe_to_i } + attribute(:country_name) { object[:ulke_adi].titleize_tr } + attribute(:language_id) { object[:yayin_dili].safe_to_i } + attribute(:language_name) { object[:yayin_dili_adi].titleize_tr } + attribute(:status_id) { object[:yayin_durumu].safe_to_i } + attribute(:status_name) { object[:yayin_durumu_ad].titleize_tr } + attribute(:date_of_release) { object[:basim_tarihi] && Date.parse(object[:basim_tarihi]) } + attribute(:release_type_id) { object[:basim_turu].safe_to_i } + attribute(:release_type_name) { object[:basim_turu_ad].titleize_tr } + attribute(:volume) { object[:cilt].safe_to_i } + attribute(:issue) { object[:sayi].safe_to_i } + attribute(:first_page) { object[:ilk_sayfa].safe_to_i } + attribute(:last_page) { object[:son_sayfa].safe_to_i } + attribute(:doi) { object[:doi].safe_to_i } + attribute(:issn) { object[:issn].safe_to_i } + attribute(:print_isbn) { object[:print_isbn].safe_to_i } + attribute(:access_link) { object[:access_link] } + attribute(:citations_number) { object[:atif_sayisi].safe_to_i } + attribute(:field) { object[:alan_bilgisi].titleize_tr } + attribute(:keywords) { object[:anahtar_kelime].titleize_tr } + attribute(:special_number_id) { object[:ozel_sayi].safe_to_i } + attribute(:special_number_name) { object[:ozel_sayi_ad].titleize_tr } + attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } + attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } + attribute(:incentive_points) { object[:tesv_puan].safe_to_f } + attribute(:presentation_type_id) { object[:bildiri_sunum_turu].safe_to_i } + attribute(:presentation_type_name) { object[:bildiri_sunum_turu_ad].titleize_tr } + attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } end end end diff --git a/app/serializers/yoksis/resumes/projects_serializer.rb b/app/serializers/yoksis/resumes/projects_serializer.rb index 88d93416..c1e78581 100644 --- a/app/serializers/yoksis/resumes/projects_serializer.rb +++ b/app/serializers/yoksis/resumes/projects_serializer.rb @@ -3,28 +3,28 @@ module Yoksis module Resumes class ProjectsSerializer < Serializer - attribute(:id) { object[:proje_id].safe_to_i } - attribute(:name) { object[:proje_ad].titleize_tr } - attribute(:subject) { object[:proje_konusu].titleize_tr } - attribute(:status_id) { object[:proje_durumu_id].safe_to_i } - attribute(:status_name) { object[:proje_durumu_ad].titleize_tr } - attribute(:date_of_update) { Time.zone.parse object[:guncelleme_tarihi] || '' } - attribute(:budget) { object[:butce].safe_to_i } - attribute(:location_id) { object[:proje_konumu_id].safe_to_i } - attribute(:location_name) { object[:proje_konumu_ad].titleize_tr } - attribute(:type_id) { object[:proje_turu_id].safe_to_i } - attribute(:type_name) { object[:proje_turu_ad].titleize_tr } - attribute(:currency_id) { object[:para_birimi_id].safe_to_i } - attribute(:currency_name) { object[:para_birimi_ad].titleize_tr } - attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } - attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } - attribute(:scope_id) { object[:kapsam].safe_to_i } - attribute(:scope_name) { object[:kapsam_ad].titleize_tr } - attribute(:title_id) { object[:unvan_id].safe_to_i } - attribute(:title_name) { object[:unvan_ad].titleize_tr } - attribute(:institution_id) { object[:kurum_id].safe_to_i } - attribute(:institution_name) { object[:kurum_ad].titleize_tr } - attribute(:incentive_points) { object[:tesv_puan].safe_to_f } + attribute(:id) { object[:proje_id].safe_to_i } + attribute(:name) { object[:proje_ad].titleize_tr } + attribute(:subject) { object[:proje_konusu].titleize_tr } + attribute(:status_id) { object[:proje_durumu_id].safe_to_i } + attribute(:status_name) { object[:proje_durumu_ad].titleize_tr } + attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } + attribute(:budget) { object[:butce].safe_to_i } + attribute(:location_id) { object[:proje_konumu_id].safe_to_i } + attribute(:location_name) { object[:proje_konumu_ad].titleize_tr } + attribute(:type_id) { object[:proje_turu_id].safe_to_i } + attribute(:type_name) { object[:proje_turu_ad].titleize_tr } + attribute(:currency_id) { object[:para_birimi_id].safe_to_i } + attribute(:currency_name) { object[:para_birimi_ad].titleize_tr } + attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } + attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } + attribute(:scope_id) { object[:kapsam].safe_to_i } + attribute(:scope_name) { object[:kapsam_ad].titleize_tr } + attribute(:title_id) { object[:unvan_id].safe_to_i } + attribute(:title_name) { object[:unvan_ad].titleize_tr } + attribute(:institution_id) { object[:kurum_id].safe_to_i } + attribute(:institution_name) { object[:kurum_ad].titleize_tr } + attribute(:incentive_points) { object[:tesv_puan].safe_to_f } attribute :date_of_start do next unless object[:bas_tar] From 989e6ec8293b285481a867d75ba4e3ea42810ed8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 16:30:12 +0300 Subject: [PATCH 30/98] Add refereeing action to resumes endpoint --- app/services/lib/services/yoksis/constants.rb | 5 +++++ app/services/lib/services/yoksis/endpoints/resumes.rb | 1 + 2 files changed, 6 insertions(+) diff --git a/app/services/lib/services/yoksis/constants.rb b/app/services/lib/services/yoksis/constants.rb index aa86f72d..1167acb5 100644 --- a/app/services/lib/services/yoksis/constants.rb +++ b/app/services/lib/services/yoksis/constants.rb @@ -207,6 +207,11 @@ class Resumes < Base result: %i[getir_proje_listesi_response proje_listesi], status: %i[getir_proje_listesi_response sonuc durum_kodu] }, + refereeing: { + operation: :get_hakemlik_bilgisi_v1, + result: %i[get_hakemlik_bilgisi_v1_response hakemlik_liste], + status: %i[get_hakemlik_bilgisi_v1_response sonuc durum_kodu] + }, }.freeze end class Staff < Base diff --git a/app/services/lib/services/yoksis/endpoints/resumes.rb b/app/services/lib/services/yoksis/endpoints/resumes.rb index f636eb00..9184e231 100644 --- a/app/services/lib/services/yoksis/endpoints/resumes.rb +++ b/app/services/lib/services/yoksis/endpoints/resumes.rb @@ -36,6 +36,7 @@ def citations(id_number:, year:) alias lectures articles alias papers articles alias projects articles + alias refereeing articles private From 04b94cd407f285dd91e901c385128652446e0d2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 16:30:32 +0300 Subject: [PATCH 31/98] Add refereeing action to resumes controller --- app/controllers/yoksis/resumes_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/yoksis/resumes_controller.rb b/app/controllers/yoksis/resumes_controller.rb index 19125851..e6194c83 100644 --- a/app/controllers/yoksis/resumes_controller.rb +++ b/app/controllers/yoksis/resumes_controller.rb @@ -21,8 +21,9 @@ def citations alias certifications articles alias editorships articles alias lectures articles - alias projects articles alias papers articles + alias projects articles + alias refereeing articles private From b2f32a851263f4b7b1cc1da676daa4cd02685831 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 16:30:47 +0300 Subject: [PATCH 32/98] Add refereeing serializer --- .../yoksis/resumes/refereeing_serializer.rb | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 app/serializers/yoksis/resumes/refereeing_serializer.rb diff --git a/app/serializers/yoksis/resumes/refereeing_serializer.rb b/app/serializers/yoksis/resumes/refereeing_serializer.rb new file mode 100644 index 00000000..b063e4be --- /dev/null +++ b/app/serializers/yoksis/resumes/refereeing_serializer.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Yoksis + module Resumes + class RefereeingSerializer < Serializer + attribute(:publishing_id) { object[:yayin_id].safe_to_i } + attribute(:publishing_place) { object[:yayin_yeri].titleize_tr } + attribute(:publishing_language_id) { object[:yayin_dili].safe_to_i } + attribute(:publishing_language_name) { object[:yayin_dili_adi].titleize_tr } + attribute(:type_id) { object[:hakemlik_turu].safe_to_i } + attribute(:type_name) { object[:hakemlik_turu_ad].titleize_tr } + attribute(:numbers) { object[:hakemlik_sayisi].safe_to_i } + attribute(:scope_id) { object[:kapsam_id].safe_to_i } + attribute(:scope_name) { object[:kapsam_ad].titleize_tr } + attribute(:country_id) { object[:ulke].safe_to_i } + attribute(:country_name) { object[:ulke_adi].titleize_tr } + attribute(:city) { object[:sehir].titleize_tr } + attribute(:index_id) { object[:endeks_id].safe_to_i } + attribute(:index) { object[:endeks] } + attribute(:year) { object[:yil].safe_to_i } + attribute(:field) { object[:alan_bilgisi].titleize_tr } + attribute(:keywords) { object[:anahtar_kelime].titleize_tr } + attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } + attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } + attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } + attribute(:incentive_points) { object[:tesv_puan].safe_to_f } + end + end +end From 4318843734e0146b201089d6872811e05eab9a12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 16:30:59 +0300 Subject: [PATCH 33/98] Update routes for refereeing --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/routes.rb b/config/routes.rb index 4c111200..90e03924 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -76,6 +76,7 @@ get :lectures get :papers get :projects + get :refereeing end end From ddd73c7a0b51d9811aabe30b0d83627fbc8ea9cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 17:16:46 +0300 Subject: [PATCH 34/98] Add thesis_advisors action to resumes endpoint --- app/services/lib/services/yoksis/constants.rb | 5 +++++ app/services/lib/services/yoksis/endpoints/resumes.rb | 1 + 2 files changed, 6 insertions(+) diff --git a/app/services/lib/services/yoksis/constants.rb b/app/services/lib/services/yoksis/constants.rb index 1167acb5..668ac9e4 100644 --- a/app/services/lib/services/yoksis/constants.rb +++ b/app/services/lib/services/yoksis/constants.rb @@ -212,6 +212,11 @@ class Resumes < Base result: %i[get_hakemlik_bilgisi_v1_response hakemlik_liste], status: %i[get_hakemlik_bilgisi_v1_response sonuc durum_kodu] }, + thesis_advisors: { + operation: :getir_tez_danisman_listesi, + result: %i[getir_tez_danisman_listesi_response tez_danisman_listesi], + status: %i[getir_tez_danisman_listesi_response sonuc durum_kodu] + }, }.freeze end class Staff < Base diff --git a/app/services/lib/services/yoksis/endpoints/resumes.rb b/app/services/lib/services/yoksis/endpoints/resumes.rb index 9184e231..6724f80e 100644 --- a/app/services/lib/services/yoksis/endpoints/resumes.rb +++ b/app/services/lib/services/yoksis/endpoints/resumes.rb @@ -37,6 +37,7 @@ def citations(id_number:, year:) alias papers articles alias projects articles alias refereeing articles + alias thesis_advisors articles private From 18ad85ef1131917bf45628c1b8434eb8ce7d17f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 17:17:07 +0300 Subject: [PATCH 35/98] Add thesis_advisors action to resumes controller --- app/controllers/yoksis/resumes_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/yoksis/resumes_controller.rb b/app/controllers/yoksis/resumes_controller.rb index e6194c83..b2a69f25 100644 --- a/app/controllers/yoksis/resumes_controller.rb +++ b/app/controllers/yoksis/resumes_controller.rb @@ -24,6 +24,7 @@ def citations alias papers articles alias projects articles alias refereeing articles + alias thesis_advisors articles private From 403d4b9e8e1d9ddfdcc5d558f3786b159822ffc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 17:17:22 +0300 Subject: [PATCH 36/98] Add thesis_advisors serializer --- .../resumes/thesis_advisors_serializer.rb | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 app/serializers/yoksis/resumes/thesis_advisors_serializer.rb diff --git a/app/serializers/yoksis/resumes/thesis_advisors_serializer.rb b/app/serializers/yoksis/resumes/thesis_advisors_serializer.rb new file mode 100644 index 00000000..dd85d7e2 --- /dev/null +++ b/app/serializers/yoksis/resumes/thesis_advisors_serializer.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Yoksis + module Resumes + class ThesisAdvisorsSerializer < Serializer + attribute(:data_source) { object[:verikaynak].titleize_tr } + attribute(:thesis_name) { object[:tez_adi].titleize_tr } + attribute(:type_id) { object[:tur_id].safe_to_i } + attribute(:type_name) { object[:tur_adi].titleize_tr } + attribute(:location_id) { object[:yer_id].safe_to_i } + attribute(:location_name) { object[:yer_adi].titleize_tr } + attribute(:country) { object[:ulke].titleize_tr } + attribute(:year) { object[:yil].safe_to_i } + attribute(:registration_id) { object[:kayit_id].safe_to_i } + attribute(:status) { object[:durum_adi].titleize_tr } + attribute(:author) { "#{object[:yazar_adi]} #{object[:yazar_soyadi]}".titleize_tr } + attribute(:university) { object[:universite_ad].titleize_tr } + attribute(:institution) { object[:enstitu_ad].titleize_tr } + attribute(:major) { object[:abd_ad].titleize_tr } + attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } + attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } + attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } + end + end +end From e42f27c95670112d6f8b0da0d9f7c64027580a5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 17:17:35 +0300 Subject: [PATCH 37/98] Update routes for thesis_advisors --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/routes.rb b/config/routes.rb index 90e03924..7d66426c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -77,6 +77,7 @@ get :papers get :projects get :refereeing + get :thesis_advisors end end From 3af72e51e98a585008c8eda545c05fd6ea46c444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 18:24:41 +0300 Subject: [PATCH 38/98] Add other_experiences action to resumes endpoint --- app/services/lib/services/yoksis/constants.rb | 5 +++++ app/services/lib/services/yoksis/endpoints/resumes.rb | 1 + 2 files changed, 6 insertions(+) diff --git a/app/services/lib/services/yoksis/constants.rb b/app/services/lib/services/yoksis/constants.rb index 668ac9e4..74edb649 100644 --- a/app/services/lib/services/yoksis/constants.rb +++ b/app/services/lib/services/yoksis/constants.rb @@ -197,6 +197,11 @@ class Resumes < Base result: %i[getir_ders_listesi_response ders_listesi], status: %i[getir_ders_listesi_response sonuc durum_kodu], }, + other_experiences: { + operation: :getir_unv_disi_deneyim_listesi, + result: %i[getir_unv_disi_deneyim_listesi_response deneyim_listesi], + status: %i[getir_unv_disi_deneyim_listesi_response sonuc durum_kodu], + }, papers: { operation: :get_bildiri_bilgisi_v1, result: %i[get_bildiri_bilgisi_v1_response bildiri_liste], diff --git a/app/services/lib/services/yoksis/endpoints/resumes.rb b/app/services/lib/services/yoksis/endpoints/resumes.rb index 6724f80e..658de1a0 100644 --- a/app/services/lib/services/yoksis/endpoints/resumes.rb +++ b/app/services/lib/services/yoksis/endpoints/resumes.rb @@ -34,6 +34,7 @@ def citations(id_number:, year:) alias certifications articles alias editorships articles alias lectures articles + alias other_experiences articles alias papers articles alias projects articles alias refereeing articles From 669a0ca3412e170584a45c80608a05411ccc2318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 18:24:54 +0300 Subject: [PATCH 39/98] Add other_experiences action to resumes controller --- app/controllers/yoksis/resumes_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/yoksis/resumes_controller.rb b/app/controllers/yoksis/resumes_controller.rb index b2a69f25..22eddc86 100644 --- a/app/controllers/yoksis/resumes_controller.rb +++ b/app/controllers/yoksis/resumes_controller.rb @@ -21,6 +21,7 @@ def citations alias certifications articles alias editorships articles alias lectures articles + alias other_experiences articles alias papers articles alias projects articles alias refereeing articles From 9fcf6b5d2f9a388c88b4fd1f732cf0892489bb36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 18:25:10 +0300 Subject: [PATCH 40/98] Add other_experiences serializer --- .../resumes/other_experiences_serializer.rb | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 app/serializers/yoksis/resumes/other_experiences_serializer.rb diff --git a/app/serializers/yoksis/resumes/other_experiences_serializer.rb b/app/serializers/yoksis/resumes/other_experiences_serializer.rb new file mode 100644 index 00000000..88493541 --- /dev/null +++ b/app/serializers/yoksis/resumes/other_experiences_serializer.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Yoksis + module Resumes + class OtherExperiencesSerializer < Serializer + attribute(:experience_id) { object[:deneyim_id].titleize_tr } + attribute(:university_id) { object[:kurulus_id].safe_to_i } + attribute(:university_name) { object[:kurulus_adi].titleize_tr } + attribute(:duty_name) { object[:gorev_adi].titleize_tr } + attribute(:year_of_start) { object[:bas_tar].safe_to_i } + attribute(:year_of_end) { object[:bit_tar].safe_to_i } + attribute(:job_description) { object[:is_tanimi].titleize_tr } + attribute(:workplace_type_id) { object[:isyeri_tur_id].safe_to_i } + attribute(:workplace_type_name) { object[:isyeri_tur_ad].titleize_tr } + attribute(:position_type) { object[:calisma_durumu].titleize_tr } + attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } + attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } + attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } + end + end +end From 2b53e212af18da40dbaf01b2a404200d475de305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 18:25:34 +0300 Subject: [PATCH 41/98] Update routes for other_experiences --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/routes.rb b/config/routes.rb index 7d66426c..e662358f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -74,6 +74,7 @@ get :citations get :editorships get :lectures + get :other_experiences get :papers get :projects get :refereeing From dadfdc6389c813bc4b9866a1af22bb5c5144a3bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 18:40:23 +0300 Subject: [PATCH 42/98] Add memberships action to resumes endpoint --- app/services/lib/services/yoksis/constants.rb | 5 +++++ app/services/lib/services/yoksis/endpoints/resumes.rb | 1 + 2 files changed, 6 insertions(+) diff --git a/app/services/lib/services/yoksis/constants.rb b/app/services/lib/services/yoksis/constants.rb index 74edb649..263d463e 100644 --- a/app/services/lib/services/yoksis/constants.rb +++ b/app/services/lib/services/yoksis/constants.rb @@ -197,6 +197,11 @@ class Resumes < Base result: %i[getir_ders_listesi_response ders_listesi], status: %i[getir_ders_listesi_response sonuc durum_kodu], }, + memberships: { + operation: :getir_uyelik_listesi, + result: %i[getir_uyelik_listesi_response uyelik_listesi], + status: %i[getir_uyelik_listesi_response sonuc durum_kodu], + }, other_experiences: { operation: :getir_unv_disi_deneyim_listesi, result: %i[getir_unv_disi_deneyim_listesi_response deneyim_listesi], diff --git a/app/services/lib/services/yoksis/endpoints/resumes.rb b/app/services/lib/services/yoksis/endpoints/resumes.rb index 658de1a0..f1909ffd 100644 --- a/app/services/lib/services/yoksis/endpoints/resumes.rb +++ b/app/services/lib/services/yoksis/endpoints/resumes.rb @@ -34,6 +34,7 @@ def citations(id_number:, year:) alias certifications articles alias editorships articles alias lectures articles + alias memberships articles alias other_experiences articles alias papers articles alias projects articles From 15b08baca41b37a7e45faf131e84e174ad21a209 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 18:40:47 +0300 Subject: [PATCH 43/98] Add memberships action to resumes controller --- app/controllers/yoksis/resumes_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/yoksis/resumes_controller.rb b/app/controllers/yoksis/resumes_controller.rb index 22eddc86..a817f450 100644 --- a/app/controllers/yoksis/resumes_controller.rb +++ b/app/controllers/yoksis/resumes_controller.rb @@ -21,6 +21,7 @@ def citations alias certifications articles alias editorships articles alias lectures articles + alias memberships articles alias other_experiences articles alias papers articles alias projects articles From 4b2823f14bbea06bc6cc67e9e4747210265296ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 18:40:58 +0300 Subject: [PATCH 44/98] Add memberships serializer --- .../yoksis/resumes/memberships_serializer.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 app/serializers/yoksis/resumes/memberships_serializer.rb diff --git a/app/serializers/yoksis/resumes/memberships_serializer.rb b/app/serializers/yoksis/resumes/memberships_serializer.rb new file mode 100644 index 00000000..abca7ebb --- /dev/null +++ b/app/serializers/yoksis/resumes/memberships_serializer.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Yoksis + module Resumes + class MembershipsSerializer < Serializer + attribute(:membership_id) { object[:uyelik_id].safe_to_i } + attribute(:membership_status_id) { object[:uyelik_durumu].safe_to_i } + attribute(:membership_status_name) { object[:uyelik_durumu_ad].titleize_tr } + attribute(:institution_name) { object[:kurulus_adi].titleize_tr } + attribute(:institution_type_id) { object[:kurulus_turu].safe_to_i } + attribute(:institution_type_name) { object[:kurulus_turu_ad].titleize_tr } + attribute(:year_of_start) { object[:bas_tar].safe_to_i } + attribute(:year_of_end) { object[:bit_tar].safe_to_i } + attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } + attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } + attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } + end + end +end From f7a64b534f378a8dad3b0dc044da82b8bbc0e6eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 18:41:07 +0300 Subject: [PATCH 45/98] Update routes for memberships --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/routes.rb b/config/routes.rb index e662358f..eae7cba4 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -74,6 +74,7 @@ get :citations get :editorships get :lectures + get :memberships get :other_experiences get :papers get :projects From 5d5242e44538a4ca925208655342674e667b0ace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 19:06:04 +0300 Subject: [PATCH 46/98] Add foreign_languages action to resumes endpoint --- app/services/lib/services/yoksis/constants.rb | 5 +++++ app/services/lib/services/yoksis/endpoints/resumes.rb | 1 + 2 files changed, 6 insertions(+) diff --git a/app/services/lib/services/yoksis/constants.rb b/app/services/lib/services/yoksis/constants.rb index 263d463e..89162630 100644 --- a/app/services/lib/services/yoksis/constants.rb +++ b/app/services/lib/services/yoksis/constants.rb @@ -192,6 +192,11 @@ class Resumes < Base result: %i[get_editorluk_bilgisi_v1_response editorluk_liste], status: %i[get_editorluk_bilgisi_v1_response sonuc durum_kodu], }, + foreign_languages: { + operation: :getir_yabanci_dil_listesi, + result: %i[getir_yabanci_dil_listesi_response yabanci_dil_listesi], + status: %i[getir_yabanci_dil_listesi_response sonuc durum_kodu], + }, lectures: { operation: :getir_ders_listesi, result: %i[getir_ders_listesi_response ders_listesi], diff --git a/app/services/lib/services/yoksis/endpoints/resumes.rb b/app/services/lib/services/yoksis/endpoints/resumes.rb index f1909ffd..1fec742c 100644 --- a/app/services/lib/services/yoksis/endpoints/resumes.rb +++ b/app/services/lib/services/yoksis/endpoints/resumes.rb @@ -33,6 +33,7 @@ def citations(id_number:, year:) alias administrative_duties articles alias certifications articles alias editorships articles + alias foreign_languages articles alias lectures articles alias memberships articles alias other_experiences articles From c91425a45a144e7694c0f1f1508357ebe902726f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 19:06:28 +0300 Subject: [PATCH 47/98] Add foreign_languages action to resumes controller --- app/controllers/yoksis/resumes_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/yoksis/resumes_controller.rb b/app/controllers/yoksis/resumes_controller.rb index a817f450..aac7144e 100644 --- a/app/controllers/yoksis/resumes_controller.rb +++ b/app/controllers/yoksis/resumes_controller.rb @@ -20,6 +20,7 @@ def citations alias administrative_duties articles alias certifications articles alias editorships articles + alias foreign_languages articles alias lectures articles alias memberships articles alias other_experiences articles From 16fe0bd15aadaec3b8ed4beb1538d2b987fbb60f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 19:06:35 +0300 Subject: [PATCH 48/98] Add foreign_languages serializer --- .../resumes/foreign_languages_serializer.rb | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 app/serializers/yoksis/resumes/foreign_languages_serializer.rb diff --git a/app/serializers/yoksis/resumes/foreign_languages_serializer.rb b/app/serializers/yoksis/resumes/foreign_languages_serializer.rb new file mode 100644 index 00000000..dad62fac --- /dev/null +++ b/app/serializers/yoksis/resumes/foreign_languages_serializer.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Yoksis + module Resumes + class ForeignLanguagesSerializer < Serializer + attribute(:id) { object[:y_id].safe_to_i } + attribute(:language_id) { object[:dil_id].safe_to_i } + attribute(:language_name) { object[:dil_ad].titleize_tr } + attribute(:language_testing_id) { object[:dil_sinav_id].safe_to_i } + attribute(:language_testing_name) { object[:dil_sinav_ad].upcase_tr } + attribute(:language_testing_point) { object[:puan].safe_to_i } + attribute(:equivalent_point) { object[:esdegerpuan].safe_to_i } + attribute(:year) { object[:yil].safe_to_i } + attribute(:term_id) { object[:donem_id].safe_to_i } + attribute(:term_name) { object[:donem_ad].titleize_tr } + attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } + attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } + attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } + end + end +end From 8d69adee8bc9506906734f20dbed8b8fa5bc0e2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 19:06:47 +0300 Subject: [PATCH 49/98] Update routes for foreign_languages --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/routes.rb b/config/routes.rb index eae7cba4..a85ca74f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -73,6 +73,7 @@ get :certifications get :citations get :editorships + get :foreign_languages get :lectures get :memberships get :other_experiences From 608040397cab4e31fed2440003d2f5826d207f48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 19:56:07 +0300 Subject: [PATCH 50/98] Add books action to resumes endpoint --- app/services/lib/services/yoksis/constants.rb | 5 +++++ app/services/lib/services/yoksis/endpoints/resumes.rb | 1 + 2 files changed, 6 insertions(+) diff --git a/app/services/lib/services/yoksis/constants.rb b/app/services/lib/services/yoksis/constants.rb index 89162630..2d783ea3 100644 --- a/app/services/lib/services/yoksis/constants.rb +++ b/app/services/lib/services/yoksis/constants.rb @@ -177,6 +177,11 @@ class Resumes < Base result: %i[get_makale_bilgisi_v1_response makale_liste], status: %i[get_makale_bilgisi_v1_response sonuc durum_kodu] }, + books: { + operation: :get_kitap_bilgisi_v1, + result: %i[get_kitap_bilgisi_v1_response kitap_liste], + status: %i[get_kitap_bilgisi_v1_response sonuc durum_kodu] + }, certifications: { operation: :get_arastirma_sertifka_bilgisi_v1, result: %i[get_arastirma_sertifka_bilgisi_v1_response arastirma_liste], diff --git a/app/services/lib/services/yoksis/endpoints/resumes.rb b/app/services/lib/services/yoksis/endpoints/resumes.rb index 1fec742c..78887fd8 100644 --- a/app/services/lib/services/yoksis/endpoints/resumes.rb +++ b/app/services/lib/services/yoksis/endpoints/resumes.rb @@ -31,6 +31,7 @@ def citations(id_number:, year:) alias academic_duties articles alias administrative_duties articles + alias books articles alias certifications articles alias editorships articles alias foreign_languages articles From fdce16d66890db392808283564a5b140327063c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 19:56:23 +0300 Subject: [PATCH 51/98] Add books action to resumes controller --- app/controllers/yoksis/resumes_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/yoksis/resumes_controller.rb b/app/controllers/yoksis/resumes_controller.rb index aac7144e..ed3e6610 100644 --- a/app/controllers/yoksis/resumes_controller.rb +++ b/app/controllers/yoksis/resumes_controller.rb @@ -18,6 +18,7 @@ def citations alias academic_duties articles alias administrative_duties articles + alias books articles alias certifications articles alias editorships articles alias foreign_languages articles From 75a756ff8064858119b74fe7d7d497c88db53467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 19:56:30 +0300 Subject: [PATCH 52/98] Add books serializer --- .../yoksis/resumes/books_serializer.rb | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 app/serializers/yoksis/resumes/books_serializer.rb diff --git a/app/serializers/yoksis/resumes/books_serializer.rb b/app/serializers/yoksis/resumes/books_serializer.rb new file mode 100644 index 00000000..ef5f5dbc --- /dev/null +++ b/app/serializers/yoksis/resumes/books_serializer.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +module Yoksis + module Resumes + class BooksSerializer < Serializer + attribute(:publishing_id) { object[:y_id].safe_to_i } + attribute(:publishing_house) { object[:yayin_evi].titleize_tr } + attribute(:publishing_language_id) { object[:yayin_dili].safe_to_i } + attribute(:publishing_language_name) { object[:yayin_dili_adi].titleize_tr } + attribute(:scope_id) { object[:kapsam_id].safe_to_i } + attribute(:scope_name) { object[:kapsam_ad].titleize_tr } + attribute(:name) { object[:kitap_adi].safe_to_i } + attribute(:type_id) { object[:kitap_tur_id].safe_to_i } + attribute(:type_name) { object[:kitap_tur].titleize_tr } + attribute(:contribution_rate_id) { object[:katki_duzeyi].safe_to_i } + attribute(:contribution_rate_name) { object[:katki_duzeyi_ad].titleize_tr } + attribute(:chapter_name) { object[:bolum_adi].titleize_tr } + attribute(:authors_number) { object[:yazar_sayisi].safe_to_i } + attribute(:author_name) { object[:yazar_adi].titleize_tr } + attribute(:editor_name) { object[:editor_adi].titleize_tr } + attribute(:country_id) { object[:ulke].safe_to_i } + attribute(:country_name) { object[:ulke_adi].titleize_tr } + attribute(:city) { object[:sehir].titleize_tr } + attribute(:year) { object[:yil].safe_to_i } + attribute(:isbn) { object[:isbn].titleize_tr } + attribute(:copies_number) { object[:kacinci_basim].safe_to_i } + attribute(:pages_number) { object[:sayfa_sayisi].safe_to_i } + attribute(:chapter_first_page) { object[:bolum_ilk_sayfa].safe_to_i } + attribute(:chapter_last_page) { object[:bolum_son_sayfa].safe_to_i } + attribute(:releasing_type_id) { object[:basim_turu].safe_to_i } + attribute(:releasing_type_name) { object[:basim_turu_ad].titleize_tr } + attribute(:access_link) { object[:erisim_linki] } + attribute(:field) { object[:alan_bilgisi].titleize_tr } + attribute(:keywords) { object[:anahtar_kelime].titleize_tr } + attribute(:author_id) { object[:yazar_id].safe_to_i } + attribute(:citations_number) { object[:atif_sayisi].safe_to_i } + attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } + attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } + attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } + attribute(:incentive_points) { object[:tesv_puan].safe_to_f } + end + end +end From aa10e46e63791e2147b64a25dcc5bb612957d651 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 19:56:45 +0300 Subject: [PATCH 53/98] Update routes for books --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/routes.rb b/config/routes.rb index a85ca74f..089be5c1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -70,6 +70,7 @@ get :academic_duties get :administrative_duties get :articles + get :books get :certifications get :citations get :editorships From a124682c5d3c4a83efc250c35364dc66e06d9d4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 23:52:26 +0300 Subject: [PATCH 54/98] Add awards action to resumes endpoint --- app/services/lib/services/yoksis/constants.rb | 5 +++++ app/services/lib/services/yoksis/endpoints/resumes.rb | 1 + 2 files changed, 6 insertions(+) diff --git a/app/services/lib/services/yoksis/constants.rb b/app/services/lib/services/yoksis/constants.rb index 2d783ea3..4f8d9d08 100644 --- a/app/services/lib/services/yoksis/constants.rb +++ b/app/services/lib/services/yoksis/constants.rb @@ -177,6 +177,11 @@ class Resumes < Base result: %i[get_makale_bilgisi_v1_response makale_liste], status: %i[get_makale_bilgisi_v1_response sonuc durum_kodu] }, + awards: { + operation: :get_odul_listesi_v1, + result: %i[get_odul_listesi_v1_response odul_listesi], + status: %i[get_odul_listesi_v1_response sonuc durum_kodu] + }, books: { operation: :get_kitap_bilgisi_v1, result: %i[get_kitap_bilgisi_v1_response kitap_liste], diff --git a/app/services/lib/services/yoksis/endpoints/resumes.rb b/app/services/lib/services/yoksis/endpoints/resumes.rb index 78887fd8..d93a521b 100644 --- a/app/services/lib/services/yoksis/endpoints/resumes.rb +++ b/app/services/lib/services/yoksis/endpoints/resumes.rb @@ -31,6 +31,7 @@ def citations(id_number:, year:) alias academic_duties articles alias administrative_duties articles + alias awards articles alias books articles alias certifications articles alias editorships articles From 7601c238215f863da4f290ac33403cf1480f4ac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 23:52:42 +0300 Subject: [PATCH 55/98] Add awards action to resumes controller --- app/controllers/yoksis/resumes_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/yoksis/resumes_controller.rb b/app/controllers/yoksis/resumes_controller.rb index ed3e6610..5cafd3b3 100644 --- a/app/controllers/yoksis/resumes_controller.rb +++ b/app/controllers/yoksis/resumes_controller.rb @@ -18,6 +18,7 @@ def citations alias academic_duties articles alias administrative_duties articles + alias awards articles alias books articles alias certifications articles alias editorships articles From 61d73d0c744031ceb798433567883642afdc7f73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 23:52:51 +0300 Subject: [PATCH 56/98] Add awards serializer --- .../yoksis/resumes/awards_serializer.rb | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 app/serializers/yoksis/resumes/awards_serializer.rb diff --git a/app/serializers/yoksis/resumes/awards_serializer.rb b/app/serializers/yoksis/resumes/awards_serializer.rb new file mode 100644 index 00000000..9f525a74 --- /dev/null +++ b/app/serializers/yoksis/resumes/awards_serializer.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Yoksis + module Resumes + class AwardsSerializer < Serializer + attribute(:id) { object[:odul_id].safe_to_i } + attribute(:name) { object[:odul_adi].titleize_tr } + attribute(:description) { object[:odul_aciklama].titleize_tr } + attribute(:year) { object[:odul_tarih].safe_to_i } + attribute(:detail_id) { object[:faal_detay_id].safe_to_i } + attribute(:detail_name) { object[:faal_detay_adi].titleize_tr } + attribute(:type_id) { object[:odul_tur_id].safe_to_i } + attribute(:type_name) { object[:odul_turu].titleize_tr } + attribute(:country_id) { object[:ulke_id].safe_to_i } + attribute(:country_name) { object[:ulke_ad].titleize_tr } + attribute(:number_of_persons) { object[:odul_turu].titleize_tr } + + attribute :awarder do + { + institution_name: object[:kurulus_adi].titleize_tr, + workplace_type_id: object[:isyeri_turu_id].safe_to_i, + workplace_type_name: object[:isyeri_turu_adi].titleize_tr + } + end + + attribute :conferee do + { + title_id: object[:p_unvan_id].safe_to_i, + title_name: object[:p_unvan_ad].titleize_tr, + institution_id: object[:p_kurum_id].safe_to_i, + institution_name: object[:p_kurum_ad].titleize_tr + } + end + + attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } + attribute(:incentive_points) { object[:tesv_puan].safe_to_f } + end + end +end From 0e64fba0ed952b83e64fa479645822f764184b46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Wed, 26 Sep 2018 23:53:03 +0300 Subject: [PATCH 57/98] Update routes for awards --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/routes.rb b/config/routes.rb index 089be5c1..9b375d4b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -70,6 +70,7 @@ get :academic_duties get :administrative_duties get :articles + get :awards get :books get :certifications get :citations From 932d938ee5d807e786b21c9594c35cd5770c57a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 11:17:32 +0300 Subject: [PATCH 58/98] Add patents action to resumes endpoint --- app/services/lib/services/yoksis/constants.rb | 5 +++++ app/services/lib/services/yoksis/endpoints/resumes.rb | 1 + 2 files changed, 6 insertions(+) diff --git a/app/services/lib/services/yoksis/constants.rb b/app/services/lib/services/yoksis/constants.rb index 4f8d9d08..37595154 100644 --- a/app/services/lib/services/yoksis/constants.rb +++ b/app/services/lib/services/yoksis/constants.rb @@ -227,6 +227,11 @@ class Resumes < Base result: %i[get_bildiri_bilgisi_v1_response bildiri_liste], status: %i[get_bildiri_bilgisi_v1_response sonuc durum_kodu], }, + patents: { + operation: :get_patent_bilgisi_v1, + result: %i[get_patent_bilgisi_v1_response patent_liste], + status: %i[get_patent_bilgisi_v1_response sonuc durum_kodu], + }, projects: { operation: :getir_proje_listesi, result: %i[getir_proje_listesi_response proje_listesi], diff --git a/app/services/lib/services/yoksis/endpoints/resumes.rb b/app/services/lib/services/yoksis/endpoints/resumes.rb index d93a521b..99baf903 100644 --- a/app/services/lib/services/yoksis/endpoints/resumes.rb +++ b/app/services/lib/services/yoksis/endpoints/resumes.rb @@ -40,6 +40,7 @@ def citations(id_number:, year:) alias memberships articles alias other_experiences articles alias papers articles + alias patents articles alias projects articles alias refereeing articles alias thesis_advisors articles From b0d7527a2e188ddb6b67a3a703b12221099a6db4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 11:17:44 +0300 Subject: [PATCH 59/98] Add patents action to resumes controller --- app/controllers/yoksis/resumes_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/yoksis/resumes_controller.rb b/app/controllers/yoksis/resumes_controller.rb index 5cafd3b3..6900211d 100644 --- a/app/controllers/yoksis/resumes_controller.rb +++ b/app/controllers/yoksis/resumes_controller.rb @@ -27,6 +27,7 @@ def citations alias memberships articles alias other_experiences articles alias papers articles + alias patents articles alias projects articles alias refereeing articles alias thesis_advisors articles From beaa9a8f820bf315be08efbde057f73ece8e99da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 11:17:54 +0300 Subject: [PATCH 60/98] Add patents serializer --- .../yoksis/resumes/patents_serializer.rb | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 app/serializers/yoksis/resumes/patents_serializer.rb diff --git a/app/serializers/yoksis/resumes/patents_serializer.rb b/app/serializers/yoksis/resumes/patents_serializer.rb new file mode 100644 index 00000000..6b4ad6f0 --- /dev/null +++ b/app/serializers/yoksis/resumes/patents_serializer.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module Yoksis + module Resumes + class PatentsSerializer < Serializer + attribute(:id) { object[:patent_id].safe_to_i } + attribute(:name) { object[:patent_adi].titleize_tr } + attribute(:no) { object[:patent_no].safe_to_i } + attribute(:class) { object[:patent_sinif].upcase_tr } + attribute(:year) { object[:patent_tarihi].safe_to_i } + attribute(:applicants) { object[:basvuru_sahipleri].upcase_tr } + attribute(:inventors) { object[:bulus_sahipleri].upcase_tr } + attribute(:number_of_persons) { object[:kisi_sayisi].safe_to_i } + attribute(:category_id) { object[:kategori_id].safe_to_i } + attribute(:category_name) { object[:kategori].titleize_tr } + attribute(:file_type_id) { object[:dosya_tipi_id].safe_to_i } + attribute(:file_type_name) { object[:dosya_tipi].titleize_tr } + attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } + attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } + attribute(:scope_id) { object[:kapsam_id].safe_to_i } + attribute(:scope_name) { object[:kapsam].titleize_tr } + attribute(:title_id) { object[:unvan_id].safe_to_i } + attribute(:title_name) { object[:unvan_ad].titleize_tr } + attribute(:institution_id) { object[:kurum_id].safe_to_i } + attribute(:institution_name) { object[:kurum_ad].titleize_tr } + attribute(:incentive_points) { object[:tesv_puan].safe_to_f } + attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } + end + end +end From 597c53ea7eecf0e790e7e53d1980ae39aff14cc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 11:18:03 +0300 Subject: [PATCH 61/98] Update routes for patents --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/routes.rb b/config/routes.rb index 9b375d4b..0fe6e3e5 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -80,6 +80,7 @@ get :memberships get :other_experiences get :papers + get :patents get :projects get :refereeing get :thesis_advisors From e1fe5be24b5c2fe1f4863f28651c268787e47fa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 11:18:11 +0300 Subject: [PATCH 62/98] Minor change --- app/serializers/yoksis/resumes/awards_serializer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/serializers/yoksis/resumes/awards_serializer.rb b/app/serializers/yoksis/resumes/awards_serializer.rb index 9f525a74..a8fb18a6 100644 --- a/app/serializers/yoksis/resumes/awards_serializer.rb +++ b/app/serializers/yoksis/resumes/awards_serializer.rb @@ -13,7 +13,7 @@ class AwardsSerializer < Serializer attribute(:type_name) { object[:odul_turu].titleize_tr } attribute(:country_id) { object[:ulke_id].safe_to_i } attribute(:country_name) { object[:ulke_ad].titleize_tr } - attribute(:number_of_persons) { object[:odul_turu].titleize_tr } + attribute(:number_of_persons) { object[:kisi_sayisi].titleize_tr } attribute :awarder do { From 8f37625597d734da455315ee24bd07e526c67b1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 11:32:19 +0300 Subject: [PATCH 63/98] Add academic_links action to resumes endpoint --- app/services/lib/services/yoksis/constants.rb | 5 +++++ app/services/lib/services/yoksis/endpoints/resumes.rb | 1 + 2 files changed, 6 insertions(+) diff --git a/app/services/lib/services/yoksis/constants.rb b/app/services/lib/services/yoksis/constants.rb index 37595154..3f894845 100644 --- a/app/services/lib/services/yoksis/constants.rb +++ b/app/services/lib/services/yoksis/constants.rb @@ -167,6 +167,11 @@ class Resumes < Base result: %i[getir_akademik_gorev_listesi_response akademik_gorev_listesi], status: %i[getir_akademik_gorev_listesi_response sonuc durum_kodu], }, + academic_links: { + operation: :get_personel_link_v1, + result: %i[get_personel_link_v1_response personel_link_liste], + status: %i[get_personel_link_v1_response sonuc durum_kodu], + }, administrative_duties: { operation: :getir_idari_gorev_listesi, result: %i[getir_idari_gorev_listesi_response idari_gorev_listesi], diff --git a/app/services/lib/services/yoksis/endpoints/resumes.rb b/app/services/lib/services/yoksis/endpoints/resumes.rb index 99baf903..f79e4214 100644 --- a/app/services/lib/services/yoksis/endpoints/resumes.rb +++ b/app/services/lib/services/yoksis/endpoints/resumes.rb @@ -30,6 +30,7 @@ def citations(id_number:, year:) end alias academic_duties articles + alias academic_links articles alias administrative_duties articles alias awards articles alias books articles From 9b1627d15ed25bb123b3aec1ed74f4b108b3c477 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 11:32:44 +0300 Subject: [PATCH 64/98] Add academic_links action to resumes controller --- app/controllers/yoksis/resumes_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/yoksis/resumes_controller.rb b/app/controllers/yoksis/resumes_controller.rb index 6900211d..39097dd8 100644 --- a/app/controllers/yoksis/resumes_controller.rb +++ b/app/controllers/yoksis/resumes_controller.rb @@ -17,6 +17,7 @@ def citations end alias academic_duties articles + alias academic_links articles alias administrative_duties articles alias awards articles alias books articles From 1ce50af3e8bc83b1d477fdf3766b89f23af131f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 11:32:53 +0300 Subject: [PATCH 65/98] Add academic_links serializer --- .../yoksis/resumes/academic_links_serializer.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 app/serializers/yoksis/resumes/academic_links_serializer.rb diff --git a/app/serializers/yoksis/resumes/academic_links_serializer.rb b/app/serializers/yoksis/resumes/academic_links_serializer.rb new file mode 100644 index 00000000..faca2095 --- /dev/null +++ b/app/serializers/yoksis/resumes/academic_links_serializer.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Yoksis + module Resumes + class AcademicLinksSerializer < Serializer + attribute(:researcher_id) { object[:arastirmaci_id].safe_to_i } + attribute(:staff_first_name) { object[:personel_adi].titleize_tr } + attribute(:staff_last_name) { object[:personel_soyadi].titleize_tr } + attribute(:staff_title) { object[:kadro_unvan_adi].titleize_tr } + attribute(:staff_workplace) { object[:kadro_yeri].titleize_tr } + attribute(:yok_link) { object[:yokakademik_link] } + attribute(:photograph_link) { object[:resim_link] } + end + end +end From 6914c310b35f630b9fbcfbdc67b6c8aecc6db4d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 11:33:07 +0300 Subject: [PATCH 66/98] Update routes for academic_links --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/routes.rb b/config/routes.rb index 0fe6e3e5..7519478f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -68,6 +68,7 @@ resources :resumes do collection do get :academic_duties + get :academic_links get :administrative_duties get :articles get :awards From 2abbc079827f3f1324a903a559bbf9d4bce28cf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 14:05:33 +0300 Subject: [PATCH 67/98] Add artistic_activities action to resumes endpoint --- app/services/lib/services/yoksis/constants.rb | 5 +++++ app/services/lib/services/yoksis/endpoints/resumes.rb | 1 + 2 files changed, 6 insertions(+) diff --git a/app/services/lib/services/yoksis/constants.rb b/app/services/lib/services/yoksis/constants.rb index 3f894845..b8d5ec0f 100644 --- a/app/services/lib/services/yoksis/constants.rb +++ b/app/services/lib/services/yoksis/constants.rb @@ -182,6 +182,11 @@ class Resumes < Base result: %i[get_makale_bilgisi_v1_response makale_liste], status: %i[get_makale_bilgisi_v1_response sonuc durum_kodu] }, + artistic_activities: { + operation: :get_sanatsal_faal_v1, + result: %i[get_sanatsal_faal_v1_response sanatsal_faal_liste], + status: %i[get_sanatsal_faal_v1_response sonuc durum_kodu] + }, awards: { operation: :get_odul_listesi_v1, result: %i[get_odul_listesi_v1_response odul_listesi], diff --git a/app/services/lib/services/yoksis/endpoints/resumes.rb b/app/services/lib/services/yoksis/endpoints/resumes.rb index f79e4214..719bffec 100644 --- a/app/services/lib/services/yoksis/endpoints/resumes.rb +++ b/app/services/lib/services/yoksis/endpoints/resumes.rb @@ -32,6 +32,7 @@ def citations(id_number:, year:) alias academic_duties articles alias academic_links articles alias administrative_duties articles + alias artistic_activities articles alias awards articles alias books articles alias certifications articles From b9bfe361f5b92a186d64b079cada469ea05f52ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 14:05:55 +0300 Subject: [PATCH 68/98] Add artistic_activities action to resumes controller --- app/controllers/yoksis/resumes_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/yoksis/resumes_controller.rb b/app/controllers/yoksis/resumes_controller.rb index 39097dd8..d6786393 100644 --- a/app/controllers/yoksis/resumes_controller.rb +++ b/app/controllers/yoksis/resumes_controller.rb @@ -19,6 +19,7 @@ def citations alias academic_duties articles alias academic_links articles alias administrative_duties articles + alias artistic_activities articles alias awards articles alias books articles alias certifications articles From b1931c93a708fd31c2a7bf0499a416bd2dd31999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 14:06:10 +0300 Subject: [PATCH 69/98] Add artistic_activities serializer --- .../resumes/artistic_activities_serializer.rb | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 app/serializers/yoksis/resumes/artistic_activities_serializer.rb diff --git a/app/serializers/yoksis/resumes/artistic_activities_serializer.rb b/app/serializers/yoksis/resumes/artistic_activities_serializer.rb new file mode 100644 index 00000000..8ea94bba --- /dev/null +++ b/app/serializers/yoksis/resumes/artistic_activities_serializer.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +module Yoksis + module Resumes + class ArtisticActivitiesSerializer < Serializer + attribute(:id) { object[:s_id].safe_to_i } + attribute(:name) { object[:etkinlik_adi].titleize_tr } + attribute(:place) { object[:etkinlik_yeri].titleize_tr } + attribute(:type_id) { object[:etkinlik_turu].safe_to_i } + attribute(:type_name) { object[:etkinlik_turu_ad].titleize_tr } + attribute(:duration) { object[:etkinlik_suresi].safe_to_i } + attribute(:scope_id) { object[:kapsam].safe_to_i } + attribute(:scope_name) { object[:kapsam_ad].titleize_tr } + attribute(:language_id) { object[:etkinlik_dili].safe_to_i } + attribute(:language_name) { object[:dil_adi].titleize_tr } + attribute(:date_of_start) { object[:bas_tarih] && Date.parse(object[:bas_tarih]) } + attribute(:date_of_end) { object[:bit_tarih] && Date.parse(object[:bit_tarih]) } + attribute(:organizers) { object[:duzenleyenler].titleize_tr } + attribute(:number_of_persons) { object[:kisi_sayisi].safe_to_i } + attribute(:country_id) { object[:ulke].safe_to_i } + attribute(:country_name) { object[:ulke_adi].titleize_tr } + attribute(:city) { object[:sehir].titleize_tr } + attribute(:title_id) { object[:unvan_id].safe_to_i } + attribute(:title_name) { object[:unvan_ad].titleize_tr } + attribute(:institution_id) { object[:kurum_id].safe_to_i } + attribute(:institution_name) { object[:kurum_ad].titleize_tr } + attribute(:work_type_id) { object[:tip].safe_to_i } + attribute(:work_type_name) { object[:tip_adi].titleize_tr } + attribute(:main_type_id) { object[:ana_tur].safe_to_i } + attribute(:main_type_name) { object[:anatur_adi] && Time.zone.parse(object[:guncelleme_tarihi]) } + attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } + attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } + attribute(:incentive_points) { object[:tesv_puan].safe_to_f } + end + end +end From 1a7d6778eefccd5f61b8cf9143fa552228606e57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 14:06:23 +0300 Subject: [PATCH 70/98] Update routes for artistic_activities --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/routes.rb b/config/routes.rb index 7519478f..5ec95b1e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -71,6 +71,7 @@ get :academic_links get :administrative_duties get :articles + get :artistic_activities get :awards get :books get :certifications From 2af9f9687f9a5a752be5753c25eb975fe9f61a51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 14:41:45 +0300 Subject: [PATCH 71/98] Add designs action to resumes endpoint --- app/services/lib/services/yoksis/constants.rb | 5 +++++ app/services/lib/services/yoksis/endpoints/resumes.rb | 1 + 2 files changed, 6 insertions(+) diff --git a/app/services/lib/services/yoksis/constants.rb b/app/services/lib/services/yoksis/constants.rb index b8d5ec0f..35a79e57 100644 --- a/app/services/lib/services/yoksis/constants.rb +++ b/app/services/lib/services/yoksis/constants.rb @@ -207,6 +207,11 @@ class Resumes < Base result: %i[get_atif_sayilari_v1_response atif_sayi_listesi], status: %i[get_atif_sayilari_v1_response sonuc durum_kodu], }, + designs: { + operation: :get_tasarim_bilgisi_v1, + result: %i[get_tasarim_bilgisi_v1_response tasarim_liste], + status: %i[get_tasarim_bilgisi_v1_response sonuc durum_kodu], + }, editorships: { operation: :get_editorluk_bilgisi_v1, result: %i[get_editorluk_bilgisi_v1_response editorluk_liste], diff --git a/app/services/lib/services/yoksis/endpoints/resumes.rb b/app/services/lib/services/yoksis/endpoints/resumes.rb index 719bffec..88eb1aa2 100644 --- a/app/services/lib/services/yoksis/endpoints/resumes.rb +++ b/app/services/lib/services/yoksis/endpoints/resumes.rb @@ -37,6 +37,7 @@ def citations(id_number:, year:) alias books articles alias certifications articles alias editorships articles + alias designs articles alias foreign_languages articles alias lectures articles alias memberships articles From 7e51f444085e905633d6d3a3f9a41aa28e867ba4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 14:42:08 +0300 Subject: [PATCH 72/98] Add designs action to resumes controller --- app/controllers/yoksis/resumes_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/yoksis/resumes_controller.rb b/app/controllers/yoksis/resumes_controller.rb index d6786393..89110cc1 100644 --- a/app/controllers/yoksis/resumes_controller.rb +++ b/app/controllers/yoksis/resumes_controller.rb @@ -24,6 +24,7 @@ def citations alias books articles alias certifications articles alias editorships articles + alias designs articles alias foreign_languages articles alias lectures articles alias memberships articles From ce101efd9f076b10ab79deb1d24ceeb03f611009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 14:42:17 +0300 Subject: [PATCH 73/98] Add designs serializer --- .../yoksis/resumes/designs_serializer.rb | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 app/serializers/yoksis/resumes/designs_serializer.rb diff --git a/app/serializers/yoksis/resumes/designs_serializer.rb b/app/serializers/yoksis/resumes/designs_serializer.rb new file mode 100644 index 00000000..43e27465 --- /dev/null +++ b/app/serializers/yoksis/resumes/designs_serializer.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Yoksis + module Resumes + class DesignsSerializer < Serializer + attribute(:id) { object[:p_tasarim_id].safe_to_i } + attribute(:name) { object[:tasarim_adi].titleize_tr } + attribute(:summary) { object[:tasarim_ozeti].titleize_tr } + attribute(:type_id) { object[:tasarim_turu].safe_to_i } + attribute(:type_name) { object[:tasarim_turu_adi].titleize_tr } + attribute(:type_detail_id) { object[:tasarim_turu_detay].safe_to_i } + attribute(:type_detail_name) { object[:tasarim_turu_detay_ad].titleize_tr } + attribute(:date_of_start) { object[:bas_tarihi] && Date.parse(object[:bas_tarihi]) } + attribute(:date_of_end) { object[:bitis_tarih] && Date.parse(object[:bitis_tarih]) } + attribute(:scope_id) { object[:kapsam].safe_to_i } + attribute(:scope_name) { object[:kapsam_ad].titleize_tr } + attribute(:owners) { object[:tasarim_sahipleri] && object[:tasarim_sahipleri].split(',').map(&:strip).map(&:titleize_tr) } + attribute(:title_id) { object[:unvan_id].safe_to_i } + attribute(:title_name) { object[:unvan_ad].titleize_tr } + attribute(:institution_id) { object[:kurum_id].safe_to_i } + attribute(:institution_name) { object[:kurum_ad].titleize_tr } + attribute(:number_of_people) { object[:kisi_sayisi].safe_to_i } + attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } + attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } + attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } + attribute(:incentive_points) { object[:tesv_puan].safe_to_f } + end + end +end From e68febad882d3fdc1406bea3fb40faad7e8f5fa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 14:42:26 +0300 Subject: [PATCH 74/98] Update routes for designs --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/routes.rb b/config/routes.rb index 5ec95b1e..dc4900c7 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -77,6 +77,7 @@ get :certifications get :citations get :editorships + get :designs get :foreign_languages get :lectures get :memberships From 17e4046099e91fe2d86d8021b51b757aa134b052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 14:57:50 +0300 Subject: [PATCH 75/98] Add fields action to resumes endpoint --- app/services/lib/services/yoksis/constants.rb | 5 +++++ app/services/lib/services/yoksis/endpoints/resumes.rb | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/services/lib/services/yoksis/constants.rb b/app/services/lib/services/yoksis/constants.rb index 35a79e57..0a4af84e 100644 --- a/app/services/lib/services/yoksis/constants.rb +++ b/app/services/lib/services/yoksis/constants.rb @@ -217,6 +217,11 @@ class Resumes < Base result: %i[get_editorluk_bilgisi_v1_response editorluk_liste], status: %i[get_editorluk_bilgisi_v1_response sonuc durum_kodu], }, + fields: { + operation: :get_temel_alan_bilgisi_v1, + result: %i[get_temel_alan_bilgisi_v1_response temel_alan_liste], + status: %i[get_temel_alan_bilgisi_v1_response sonuc durum_kodu], + }, foreign_languages: { operation: :getir_yabanci_dil_listesi, result: %i[getir_yabanci_dil_listesi_response yabanci_dil_listesi], diff --git a/app/services/lib/services/yoksis/endpoints/resumes.rb b/app/services/lib/services/yoksis/endpoints/resumes.rb index 88eb1aa2..9ce8bc7a 100644 --- a/app/services/lib/services/yoksis/endpoints/resumes.rb +++ b/app/services/lib/services/yoksis/endpoints/resumes.rb @@ -36,8 +36,9 @@ def citations(id_number:, year:) alias awards articles alias books articles alias certifications articles - alias editorships articles alias designs articles + alias editorships articles + alias fields articles alias foreign_languages articles alias lectures articles alias memberships articles From 300a862ce1e9de03ee1097f76259a353a2573862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 14:57:59 +0300 Subject: [PATCH 76/98] Add fields action to resumes controller --- app/controllers/yoksis/resumes_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/yoksis/resumes_controller.rb b/app/controllers/yoksis/resumes_controller.rb index 89110cc1..95eacde8 100644 --- a/app/controllers/yoksis/resumes_controller.rb +++ b/app/controllers/yoksis/resumes_controller.rb @@ -25,6 +25,7 @@ def citations alias certifications articles alias editorships articles alias designs articles + alias fields articles alias foreign_languages articles alias lectures articles alias memberships articles From 0f0e818cf4c5de8609a946673f145aabce31fc99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 14:58:06 +0300 Subject: [PATCH 77/98] Add fields serializer --- .../yoksis/resumes/fields_serializer.rb | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 app/serializers/yoksis/resumes/fields_serializer.rb diff --git a/app/serializers/yoksis/resumes/fields_serializer.rb b/app/serializers/yoksis/resumes/fields_serializer.rb new file mode 100644 index 00000000..a63f4263 --- /dev/null +++ b/app/serializers/yoksis/resumes/fields_serializer.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Yoksis + module Resumes + class FieldsSerializer < Serializer + attribute(:registration_id) { object[:t_uak_id].safe_to_i } + attribute(:id) { object[:temel_alan_id].safe_to_i } + attribute(:name) { object[:temel_alan_ad].titleize_tr } + attribute(:scientific_field_id) { object[:bilim_alan_id].safe_to_i } + attribute(:scientific_field_name) { object[:bilim_alan_ad].titleize_tr } + attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } + attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } + attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } + + attribute :keywords do + [ + { id: object[:anahtarkelime1_id].safe_to_i, name: object[:anahtarkelime1_ad].titleize_tr }, + { id: object[:anahtarkelime2_id].safe_to_i, name: object[:anahtarkelime2_ad].titleize_tr }, + { id: object[:anahtarkelime3_id].safe_to_i, name: object[:anahtarkelime3_ad].titleize_tr } + ] + end + end + end +end From e4c16e6110d4d7d40844c4217b96cc56a782a023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 14:58:19 +0300 Subject: [PATCH 78/98] Update routes for fields --- config/routes.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/routes.rb b/config/routes.rb index dc4900c7..4994c6db 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -76,8 +76,9 @@ get :books get :certifications get :citations - get :editorships get :designs + get :editorships + get :fields get :foreign_languages get :lectures get :memberships From 0e2814c4d9d84393fd96ed253cfd84de8ded0ebb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 15:16:34 +0300 Subject: [PATCH 79/98] Add incentive_applications action to resumes endpoint --- app/services/lib/services/yoksis/constants.rb | 5 ++ .../lib/services/yoksis/endpoints/resumes.rb | 47 ++++++++++--------- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/app/services/lib/services/yoksis/constants.rb b/app/services/lib/services/yoksis/constants.rb index 0a4af84e..e593e84a 100644 --- a/app/services/lib/services/yoksis/constants.rb +++ b/app/services/lib/services/yoksis/constants.rb @@ -227,6 +227,11 @@ class Resumes < Base result: %i[getir_yabanci_dil_listesi_response yabanci_dil_listesi], status: %i[getir_yabanci_dil_listesi_response sonuc durum_kodu], }, + incentive_applications: { + operation: :get_tesvik_basvuru_varmi_v1, + result: %i[get_tesvik_basvuru_varmi_v1_response basvuru_durumu], + status: %i[get_tesvik_basvuru_varmi_v1_response sonuc durum_kodu], + }, lectures: { operation: :getir_ders_listesi, result: %i[getir_ders_listesi_response ders_listesi], diff --git a/app/services/lib/services/yoksis/endpoints/resumes.rb b/app/services/lib/services/yoksis/endpoints/resumes.rb index 9ce8bc7a..a9dc30c6 100644 --- a/app/services/lib/services/yoksis/endpoints/resumes.rb +++ b/app/services/lib/services/yoksis/endpoints/resumes.rb @@ -19,35 +19,36 @@ def articles(id_number:) def citations(id_number:, year:) @resumes = client.request( - ARGS.dig(:citations, :operation), + ARGS.dig(__callee__, :operation), args: params_with_defaults(P_TC_KIMLIK_NO: id_number, P_DONEM: year) ) - raise InvalidResponseError if resumes_has_error? __method__ - raise NoContentError unless resumes_has_response? __method__ + raise InvalidResponseError if resumes_has_error? __callee__ + raise NoContentError unless resumes_has_response? __callee__ - resumes_result __method__ + resumes_result __callee__ end - alias academic_duties articles - alias academic_links articles - alias administrative_duties articles - alias artistic_activities articles - alias awards articles - alias books articles - alias certifications articles - alias designs articles - alias editorships articles - alias fields articles - alias foreign_languages articles - alias lectures articles - alias memberships articles - alias other_experiences articles - alias papers articles - alias patents articles - alias projects articles - alias refereeing articles - alias thesis_advisors articles + alias academic_duties articles + alias academic_links articles + alias administrative_duties articles + alias artistic_activities articles + alias awards articles + alias books articles + alias certifications articles + alias designs articles + alias editorships articles + alias fields articles + alias foreign_languages articles + alias incentive_applications citations + alias lectures articles + alias memberships articles + alias other_experiences articles + alias papers articles + alias patents articles + alias projects articles + alias refereeing articles + alias thesis_advisors articles private From a59b1f4bbf2e4cad203836fbbf8054dcd01046f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 15:16:51 +0300 Subject: [PATCH 80/98] Add incentive_applications action to resumes controller --- app/controllers/yoksis/resumes_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/yoksis/resumes_controller.rb b/app/controllers/yoksis/resumes_controller.rb index 95eacde8..4acb01a0 100644 --- a/app/controllers/yoksis/resumes_controller.rb +++ b/app/controllers/yoksis/resumes_controller.rb @@ -11,7 +11,8 @@ def articles end def citations - render_as_json @resumes.citations( + render_as_json @resumes.send( + action_name, id_number: secure_params.require(:id_number), year: secure_params.require(:year) ) end @@ -36,6 +37,8 @@ def citations alias refereeing articles alias thesis_advisors articles + alias incentive_applications citations + private def set_client_variables From 2ac9201dc3d029c3abad6dd98f2dbfcc8e72efef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 15:17:09 +0300 Subject: [PATCH 81/98] Add incentive_applications serializer --- .../resumes/incentive_applications_serializer.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 app/serializers/yoksis/resumes/incentive_applications_serializer.rb diff --git a/app/serializers/yoksis/resumes/incentive_applications_serializer.rb b/app/serializers/yoksis/resumes/incentive_applications_serializer.rb new file mode 100644 index 00000000..df2a9695 --- /dev/null +++ b/app/serializers/yoksis/resumes/incentive_applications_serializer.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Yoksis + module Resumes + class IncentiveApplicationsSerializer < Serializer + attribute(:id) { object[:basvuru_id].safe_to_i } + attribute(:term_id) { object[:donem_id].safe_to_i } + attribute(:term_name) { object[:donem_ad].titleize_tr } + attribute(:date_of_application) { object[:basvuru_tarihi] && Date.parse(object[:basvuru_tarihi]) } + attribute(:date_of_final_application) { object[:son_islem_tarihi] && Date.parse(object[:son_islem_tarihi]) } + end + end +end From 36702304dac1440ff9a064325db3b087da50eb92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 15:17:23 +0300 Subject: [PATCH 82/98] Update routes for incentive_applications --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/routes.rb b/config/routes.rb index 4994c6db..8336ac2e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -80,6 +80,7 @@ get :editorships get :fields get :foreign_languages + get :incentive_applications get :lectures get :memberships get :other_experiences From 402bcd9f58b7244cb762e9e7f4abf2aef9ae814c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 15:29:10 +0300 Subject: [PATCH 83/98] Add incentive_activity_declarations action to resumes endpoint --- app/services/lib/services/yoksis/constants.rb | 5 +++ .../lib/services/yoksis/endpoints/resumes.rb | 40 ++++++++++--------- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/app/services/lib/services/yoksis/constants.rb b/app/services/lib/services/yoksis/constants.rb index e593e84a..51bb6d81 100644 --- a/app/services/lib/services/yoksis/constants.rb +++ b/app/services/lib/services/yoksis/constants.rb @@ -232,6 +232,11 @@ class Resumes < Base result: %i[get_tesvik_basvuru_varmi_v1_response basvuru_durumu], status: %i[get_tesvik_basvuru_varmi_v1_response sonuc durum_kodu], }, + incentive_activity_declarations: { + operation: :get_tesvik_faaliyet_beyan_v1, + result: %i[get_tesvik_faaliyet_beyan_v1_response tesvik_beyan_listesi], + status: %i[get_tesvik_faaliyet_beyan_v1_response sonuc durum_kodu], + }, lectures: { operation: :getir_ders_listesi, result: %i[getir_ders_listesi_response ders_listesi], diff --git a/app/services/lib/services/yoksis/endpoints/resumes.rb b/app/services/lib/services/yoksis/endpoints/resumes.rb index a9dc30c6..e5f8082a 100644 --- a/app/services/lib/services/yoksis/endpoints/resumes.rb +++ b/app/services/lib/services/yoksis/endpoints/resumes.rb @@ -29,26 +29,28 @@ def citations(id_number:, year:) resumes_result __callee__ end - alias academic_duties articles - alias academic_links articles - alias administrative_duties articles - alias artistic_activities articles - alias awards articles - alias books articles - alias certifications articles - alias designs articles - alias editorships articles - alias fields articles - alias foreign_languages articles + alias academic_duties articles + alias academic_links articles + alias administrative_duties articles + alias artistic_activities articles + alias awards articles + alias books articles + alias certifications articles + alias designs articles + alias editorships articles + alias fields articles + alias foreign_languages articles + alias lectures articles + alias memberships articles + alias other_experiences articles + alias papers articles + alias patents articles + alias projects articles + alias refereeing articles + alias thesis_advisors articles + alias incentive_applications citations - alias lectures articles - alias memberships articles - alias other_experiences articles - alias papers articles - alias patents articles - alias projects articles - alias refereeing articles - alias thesis_advisors articles + alias incentive_activity_declarations citations private From 8326931a20fbeb1c1bd28b7dec0e8b349cb7997f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 15:29:19 +0300 Subject: [PATCH 84/98] Add incentive_activity_declarations action to resumes controller --- app/controllers/yoksis/resumes_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/yoksis/resumes_controller.rb b/app/controllers/yoksis/resumes_controller.rb index 4acb01a0..de5d2071 100644 --- a/app/controllers/yoksis/resumes_controller.rb +++ b/app/controllers/yoksis/resumes_controller.rb @@ -38,6 +38,7 @@ def citations alias thesis_advisors articles alias incentive_applications citations + alias incentive_activity_declarations citations private From db917098f7005de27879bd2b381e480b0193fee0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 15:29:49 +0300 Subject: [PATCH 85/98] Add incentive_activity_declarations serializer --- .../incentive_activity_declarations_serializer.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 app/serializers/yoksis/resumes/incentive_activity_declarations_serializer.rb diff --git a/app/serializers/yoksis/resumes/incentive_activity_declarations_serializer.rb b/app/serializers/yoksis/resumes/incentive_activity_declarations_serializer.rb new file mode 100644 index 00000000..2e58ef6c --- /dev/null +++ b/app/serializers/yoksis/resumes/incentive_activity_declarations_serializer.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Yoksis + module Resumes + class IncentiveActivityDeclarationsSerializer < Serializer + attribute(:id) { object[:fb_id].safe_to_i } + attribute(:type_id) { object[:tur].safe_to_i } + attribute(:type_name) { object[:tur_ad].titleize_tr } + attribute(:work_id) { object[:eser_id].safe_to_i } + attribute(:work_type_id) { object[:eser_tur].safe_to_i } + attribute(:work_type_name) { object[:eser_tur_ad].titleize_tr } + attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } + end + end +end From 2c3cddfeb0989050c2617f5441b160d5c1b3a4c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 15:30:01 +0300 Subject: [PATCH 86/98] Update routes for incentive_activity_declarations --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/routes.rb b/config/routes.rb index 8336ac2e..0b21b625 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -81,6 +81,7 @@ get :fields get :foreign_languages get :incentive_applications + get :incentive_activity_declarations get :lectures get :memberships get :other_experiences From c7c44b43703365299a4d4b47b0649408b99af996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 15:46:30 +0300 Subject: [PATCH 87/98] Add authors action to resumes endpoint --- app/services/lib/services/yoksis/constants.rb | 5 +++++ .../lib/services/yoksis/endpoints/resumes.rb | 14 ++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/app/services/lib/services/yoksis/constants.rb b/app/services/lib/services/yoksis/constants.rb index 51bb6d81..0b32c6ab 100644 --- a/app/services/lib/services/yoksis/constants.rb +++ b/app/services/lib/services/yoksis/constants.rb @@ -187,6 +187,11 @@ class Resumes < Base result: %i[get_sanatsal_faal_v1_response sanatsal_faal_liste], status: %i[get_sanatsal_faal_v1_response sonuc durum_kodu] }, + authors: { + operation: :get_yazar_listesi_v1, + result: %i[get_yazar_listesi_v1_response yazarlar_listesi], + status: %i[get_yazar_listesi_v1_response sonuc durum_kodu] + }, awards: { operation: :get_odul_listesi_v1, result: %i[get_odul_listesi_v1_response odul_listesi], diff --git a/app/services/lib/services/yoksis/endpoints/resumes.rb b/app/services/lib/services/yoksis/endpoints/resumes.rb index e5f8082a..dcff6467 100644 --- a/app/services/lib/services/yoksis/endpoints/resumes.rb +++ b/app/services/lib/services/yoksis/endpoints/resumes.rb @@ -17,6 +17,20 @@ def articles(id_number:) resumes_result __callee__ end + def authors(id_number:, author_id:) + @resumes = client.request( + ARGS.dig(:authors, :operation), + args: params_with_defaults( + P_TC_KIMLIK_NO: id_number, P_YAZAR_ID: author_id + ) + ) + + raise InvalidResponseError if resumes_has_error? :authors + raise NoContentError unless resumes_has_response? :authors + + resumes_result :authors + end + def citations(id_number:, year:) @resumes = client.request( ARGS.dig(__callee__, :operation), From 3feb517ac081f3b5993ce742ba46994b9989dc98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 15:46:37 +0300 Subject: [PATCH 88/98] Add authors action to resumes controller --- app/controllers/yoksis/resumes_controller.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/controllers/yoksis/resumes_controller.rb b/app/controllers/yoksis/resumes_controller.rb index de5d2071..d170fa0d 100644 --- a/app/controllers/yoksis/resumes_controller.rb +++ b/app/controllers/yoksis/resumes_controller.rb @@ -10,6 +10,12 @@ def articles render_as_json @resumes.send(action_name, id_number: secure_params.require(:id_number)) end + def authors + render_as_json @resumes.authors( + id_number: secure_params.require(:id_number), author_id: secure_params.require(:author_id) + ) + end + def citations render_as_json @resumes.send( action_name, @@ -52,7 +58,7 @@ def set_resumes end def secure_params - params.require(:resume).permit(:id_number, :year) + params.require(:resume).permit(:id_number, :year, :author_id) end end end From acb667f85f4ab0d0c4116d337e027bc85d44aacb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 15:46:54 +0300 Subject: [PATCH 89/98] Add authors serializer --- .../yoksis/resumes/authors_serializer.rb | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 app/serializers/yoksis/resumes/authors_serializer.rb diff --git a/app/serializers/yoksis/resumes/authors_serializer.rb b/app/serializers/yoksis/resumes/authors_serializer.rb new file mode 100644 index 00000000..62134c3f --- /dev/null +++ b/app/serializers/yoksis/resumes/authors_serializer.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Yoksis + module Resumes + class AuthorsSerializer < Serializer + attribute(:yoksis_id) { object[:y_id].safe_to_i } + attribute(:id_number) { object[:tc_kimlik_no].safe_to_i } + attribute(:first_name) { object[:yazarad].titleize_tr } + attribute(:last_name) { object[:yazarsoyad].titleize_tr } + attribute(:researcher_id) { object[:arastirmaci_id].safe_to_i } + attribute(:title_id) { object[:kadro_unvan_id].safe_to_i } + attribute(:title_name) { object[:kadro_unvan_adi].titleize_tr } + attribute(:type_id) { object[:yazar_tur].safe_to_i } + attribute(:type_name) { object[:yazar_tur_ad].titleize_tr } + attribute(:form_id) { object[:yazar_form_id].safe_to_i } + attribute(:university_id) { object[:univ_id].safe_to_i } + attribute(:university_name) { object[:universite].titleize_tr } + attribute(:users_ars_id) { object[:kullanicinin_ars_id].safe_to_i } + attribute(:orc_id) { object[:yazar_orcid].safe_to_i } + attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } + end + end +end From fce18dc5d0028570b7d306c9e6050575ce914dff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 15:47:03 +0300 Subject: [PATCH 90/98] Update routes for authors --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/routes.rb b/config/routes.rb index 0b21b625..4aff1530 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -72,6 +72,7 @@ get :administrative_duties get :articles get :artistic_activities + get :authors get :awards get :books get :certifications From ea0eff19ad4d3ecb373549f9995ad3892df674cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 16:26:38 +0300 Subject: [PATCH 91/98] Add education_informations action to resumes endpoint --- app/services/lib/services/yoksis/constants.rb | 5 +++ .../lib/services/yoksis/endpoints/resumes.rb | 39 ++++++++++--------- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/app/services/lib/services/yoksis/constants.rb b/app/services/lib/services/yoksis/constants.rb index 0b32c6ab..3a47a14a 100644 --- a/app/services/lib/services/yoksis/constants.rb +++ b/app/services/lib/services/yoksis/constants.rb @@ -222,6 +222,11 @@ class Resumes < Base result: %i[get_editorluk_bilgisi_v1_response editorluk_liste], status: %i[get_editorluk_bilgisi_v1_response sonuc durum_kodu], }, + education_informations: { + operation: :getir_ogrenim_bilgisi_listesi, + result: %i[getir_ogrenim_bilgisi_listesi_response ogrenim_bilgisi_listesi], + status: %i[getir_ogrenim_bilgisi_listesi_response sonuc durum_kodu], + }, fields: { operation: :get_temel_alan_bilgisi_v1, result: %i[get_temel_alan_bilgisi_v1_response temel_alan_liste], diff --git a/app/services/lib/services/yoksis/endpoints/resumes.rb b/app/services/lib/services/yoksis/endpoints/resumes.rb index dcff6467..ae125b2e 100644 --- a/app/services/lib/services/yoksis/endpoints/resumes.rb +++ b/app/services/lib/services/yoksis/endpoints/resumes.rb @@ -43,25 +43,26 @@ def citations(id_number:, year:) resumes_result __callee__ end - alias academic_duties articles - alias academic_links articles - alias administrative_duties articles - alias artistic_activities articles - alias awards articles - alias books articles - alias certifications articles - alias designs articles - alias editorships articles - alias fields articles - alias foreign_languages articles - alias lectures articles - alias memberships articles - alias other_experiences articles - alias papers articles - alias patents articles - alias projects articles - alias refereeing articles - alias thesis_advisors articles + alias academic_duties articles + alias academic_links articles + alias administrative_duties articles + alias artistic_activities articles + alias awards articles + alias books articles + alias certifications articles + alias designs articles + alias editorships articles + alias education_informations articles + alias fields articles + alias foreign_languages articles + alias lectures articles + alias memberships articles + alias other_experiences articles + alias papers articles + alias patents articles + alias projects articles + alias refereeing articles + alias thesis_advisors articles alias incentive_applications citations alias incentive_activity_declarations citations From ec52abe37356ccafaba5673895c15de668c085bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 16:26:56 +0300 Subject: [PATCH 92/98] Add education_informations action to resumes controller --- app/controllers/yoksis/resumes_controller.rb | 39 ++++++++++---------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/app/controllers/yoksis/resumes_controller.rb b/app/controllers/yoksis/resumes_controller.rb index d170fa0d..5b298e82 100644 --- a/app/controllers/yoksis/resumes_controller.rb +++ b/app/controllers/yoksis/resumes_controller.rb @@ -23,25 +23,26 @@ def citations ) end - alias academic_duties articles - alias academic_links articles - alias administrative_duties articles - alias artistic_activities articles - alias awards articles - alias books articles - alias certifications articles - alias editorships articles - alias designs articles - alias fields articles - alias foreign_languages articles - alias lectures articles - alias memberships articles - alias other_experiences articles - alias papers articles - alias patents articles - alias projects articles - alias refereeing articles - alias thesis_advisors articles + alias academic_duties articles + alias academic_links articles + alias administrative_duties articles + alias artistic_activities articles + alias awards articles + alias books articles + alias certifications articles + alias editorships articles + alias education_informations articles + alias designs articles + alias fields articles + alias foreign_languages articles + alias lectures articles + alias memberships articles + alias other_experiences articles + alias papers articles + alias patents articles + alias projects articles + alias refereeing articles + alias thesis_advisors articles alias incentive_applications citations alias incentive_activity_declarations citations From 1aeea81a209bb0305dba870bea9384cf08770884 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 16:27:07 +0300 Subject: [PATCH 93/98] Add education_informations serializer --- .../education_informations_serializer.rb | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 app/serializers/yoksis/resumes/education_informations_serializer.rb diff --git a/app/serializers/yoksis/resumes/education_informations_serializer.rb b/app/serializers/yoksis/resumes/education_informations_serializer.rb new file mode 100644 index 00000000..4652cbfa --- /dev/null +++ b/app/serializers/yoksis/resumes/education_informations_serializer.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module Yoksis + module Resumes + class EducationInformationsSerializer < Serializer + attribute(:id) { object[:id].safe_to_i } + attribute(:place_id) { object[:yer_id].safe_to_i } + attribute(:place_name) { object[:yer_ad].titleize_tr } + attribute(:year_of_start) { object[:bastar1].safe_to_i } + attribute(:year_of_end) { object[:bittar1].safe_to_i } + attribute(:country_id) { object[:ulke_id].safe_to_i } + attribute(:country_name) { object[:ulke_ad].titleize_tr } + attribute(:other_field) { object[:diger_alan].titleize_tr } + attribute(:yok_unit_id) { object[:birim_yok].safe_to_i } + attribute(:program_id) { object[:program_id].safe_to_i } + attribute(:program_name) { object[:program_adi].titleize_tr } + attribute(:other_university) { object[:diger_universite].titleize_tr } + attribute(:thesis_step_id) { object[:tez_asamasi].safe_to_i } + attribute(:thesis_step_name) { object[:tez_asamasi_ad].titleize_tr } + attribute(:university_id) { object[:univ_id].safe_to_i } + attribute(:university_name) { object[:unv_birim_adi].titleize_tr } + attribute(:academic_unit_id) { object[:akademik_birim_id].safe_to_i } + attribute(:academic_unit_name) { object[:akademik_birim_adi].titleize_tr } + attribute(:faculty) { object[:fakultebilgisi].titleize_tr } + attribute(:department) { object[:bolumbilgisi].titleize_tr } + attribute(:field) { object[:alanbilgisi].titleize_tr } + attribute(:diploma_no) { object[:diploma_no].safe_to_i } + attribute(:number_of_diploma_equivalency) { object[:diplomadenklik_tarih_sayi].safe_to_i } + attribute(:advisors_id_number) { object[:danisman_tc].safe_to_i } + attribute(:advisor) { object[:danisman_ad_soyad].titleize_tr } + attribute(:thesis_name) { object[:tez_adi].titleize_tr } + attribute(:start_date_of_thesis) { object[:tez_bas_tar].safe_to_i } + attribute(:end_date_of_thesis) { object[:tez_bit_tar].safe_to_i } + attribute(:c_unit_id) { object[:c_birim_id].safe_to_i } + attribute(:c_unit_name) { object[:c_birim_ad].safe_to_i } + attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } + attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } + attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } + end + end +end From 908973ea04e5a402a33826542d6e89769e9a97dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 16:27:18 +0300 Subject: [PATCH 94/98] Update routes for education_informations --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/routes.rb b/config/routes.rb index 4aff1530..d60ec8d1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -79,6 +79,7 @@ get :citations get :designs get :editorships + get :education_informations get :fields get :foreign_languages get :incentive_applications From 369630f569830b7c6d525933940e9e29d1a1d5d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 17:02:50 +0300 Subject: [PATCH 95/98] Refactor --- app/controllers/yoksis/resumes_controller.rb | 55 +++++++++--------- .../lib/services/yoksis/endpoints/resumes.rb | 57 ++++++++----------- 2 files changed, 52 insertions(+), 60 deletions(-) diff --git a/app/controllers/yoksis/resumes_controller.rb b/app/controllers/yoksis/resumes_controller.rb index 5b298e82..a5f38d11 100644 --- a/app/controllers/yoksis/resumes_controller.rb +++ b/app/controllers/yoksis/resumes_controller.rb @@ -6,44 +6,37 @@ class ResumesController < ApplicationController include ActionsResource - def articles - render_as_json @resumes.send(action_name, id_number: secure_params.require(:id_number)) + UNDEFINABLE_ACTIONS_IN_ITERATION = %i[ + authors + citations + incentive_applications + incentive_activity_declarations + ].freeze + private_constant :UNDEFINABLE_ACTIONS_IN_ITERATION + + Services::Yoksis::Resumes::ARGS.each_key do |method| + next if method.in?(UNDEFINABLE_ACTIONS_IN_ITERATION) + + define_method(method) do + render_as_json @resumes.send( + method, id_number: undefinable_actions_in_iteration_params.require(:id_number) + ) + end end def authors render_as_json @resumes.authors( - id_number: secure_params.require(:id_number), author_id: secure_params.require(:author_id) + id_number: authors_params.require(:id_number), author_id: authors_params.require(:author_id) ) end def citations render_as_json @resumes.send( action_name, - id_number: secure_params.require(:id_number), year: secure_params.require(:year) + id_number: citations_params.require(:id_number), year: citations_params.require(:year) ) end - alias academic_duties articles - alias academic_links articles - alias administrative_duties articles - alias artistic_activities articles - alias awards articles - alias books articles - alias certifications articles - alias editorships articles - alias education_informations articles - alias designs articles - alias fields articles - alias foreign_languages articles - alias lectures articles - alias memberships articles - alias other_experiences articles - alias papers articles - alias patents articles - alias projects articles - alias refereeing articles - alias thesis_advisors articles - alias incentive_applications citations alias incentive_activity_declarations citations @@ -58,8 +51,16 @@ def set_resumes @resumes = Services::Yoksis::Resumes.new(basic_auth: [@username, @password]) end - def secure_params - params.require(:resume).permit(:id_number, :year, :author_id) + def undefinable_actions_in_iteration_params + params.require(:resume).permit(:id_number) + end + + def authors_params + params.require(:resume).permit(:id_number, :author_id) + end + + def citations_params + params.require(:resume).permit(:id_number, :year) end end end diff --git a/app/services/lib/services/yoksis/endpoints/resumes.rb b/app/services/lib/services/yoksis/endpoints/resumes.rb index ae125b2e..40e8448c 100644 --- a/app/services/lib/services/yoksis/endpoints/resumes.rb +++ b/app/services/lib/services/yoksis/endpoints/resumes.rb @@ -5,30 +5,42 @@ module Yoksis class Resumes WSDL_URL = 'http://servisler.yok.gov.tr/ws/ozgecmisv1?WSDL' - def articles(id_number:) - @resumes = client.request( - ARGS.dig(__callee__, :operation), - args: params_with_defaults(P_TC_KIMLIK_NO: id_number) - ) + UNDEFINABLE_METHODS_IN_ITERATION = %i[ + authors + citations + incentive_applications + incentive_activity_declarations + ].freeze + private_constant :UNDEFINABLE_METHODS_IN_ITERATION + + ARGS.each_key do |method| + define_method method do |id_number:| + next if method.in?(UNDEFINABLE_METHODS_IN_ITERATION) + + @resumes = client.request( + ARGS.dig(method, :operation), + args: params_with_defaults(P_TC_KIMLIK_NO: id_number) + ) - raise InvalidResponseError if resumes_has_error? __callee__ - raise NoContentError unless resumes_has_response? __callee__ + raise InvalidResponseError if resumes_has_error? method + raise NoContentError unless resumes_has_response? method - resumes_result __callee__ + resumes_result method + end end def authors(id_number:, author_id:) @resumes = client.request( - ARGS.dig(:authors, :operation), + ARGS.dig(__method__, :operation), args: params_with_defaults( P_TC_KIMLIK_NO: id_number, P_YAZAR_ID: author_id ) ) - raise InvalidResponseError if resumes_has_error? :authors - raise NoContentError unless resumes_has_response? :authors + raise InvalidResponseError if resumes_has_error? __method__ + raise NoContentError unless resumes_has_response? __method__ - resumes_result :authors + resumes_result __method__ end def citations(id_number:, year:) @@ -43,27 +55,6 @@ def citations(id_number:, year:) resumes_result __callee__ end - alias academic_duties articles - alias academic_links articles - alias administrative_duties articles - alias artistic_activities articles - alias awards articles - alias books articles - alias certifications articles - alias designs articles - alias editorships articles - alias education_informations articles - alias fields articles - alias foreign_languages articles - alias lectures articles - alias memberships articles - alias other_experiences articles - alias papers articles - alias patents articles - alias projects articles - alias refereeing articles - alias thesis_advisors articles - alias incentive_applications citations alias incentive_activity_declarations citations From 99daf7ca5e523edccb504ebe0d9d32de3cce0ed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 17:32:12 +0300 Subject: [PATCH 96/98] Refactor all resumes serializers --- .../resumes/academic_duties_serializer.rb | 12 +-- .../administrative_duties_serializer.rb | 6 +- .../yoksis/resumes/articles_serializer.rb | 78 +++++++++---------- .../resumes/artistic_activities_serializer.rb | 4 +- .../yoksis/resumes/authors_serializer.rb | 2 +- .../yoksis/resumes/awards_serializer.rb | 22 +++--- .../yoksis/resumes/books_serializer.rb | 70 ++++++++--------- .../resumes/certifications_serializer.rb | 6 +- .../yoksis/resumes/citations_serializer.rb | 4 +- .../yoksis/resumes/designs_serializer.rb | 4 +- .../yoksis/resumes/editorships_serializer.rb | 6 +- .../education_informations_serializer.rb | 8 +- .../yoksis/resumes/fields_serializer.rb | 6 +- .../resumes/foreign_languages_serializer.rb | 2 +- ...entive_activity_declarations_serializer.rb | 2 +- .../incentive_applications_serializer.rb | 2 +- .../yoksis/resumes/lectures_serializer.rb | 6 +- .../yoksis/resumes/papers_serializer.rb | 76 +++++++++--------- .../yoksis/resumes/patents_serializer.rb | 8 +- .../yoksis/resumes/projects_serializer.rb | 8 +- .../yoksis/resumes/refereeing_serializer.rb | 2 +- .../resumes/thesis_advisors_serializer.rb | 10 +-- 22 files changed, 172 insertions(+), 172 deletions(-) diff --git a/app/serializers/yoksis/resumes/academic_duties_serializer.rb b/app/serializers/yoksis/resumes/academic_duties_serializer.rb index 5f03dc0d..3b35d7c1 100644 --- a/app/serializers/yoksis/resumes/academic_duties_serializer.rb +++ b/app/serializers/yoksis/resumes/academic_duties_serializer.rb @@ -3,7 +3,9 @@ module Yoksis module Resumes class AcademicDutiesSerializer < Serializer - attribute(:id) { object[:gorev_id].safe_to_i } + attribute(:duty_id) { object[:gorev_id].safe_to_i } + attribute(:title_id) { object[:kadro_unvan_id].safe_to_i } + attribute(:title_name) { object[:kadro_unvan_adi].titleize_tr } attribute(:place_id) { object[:yer_id].safe_to_i } attribute(:place_name) { object[:yer_ad].titleize_tr } attribute(:country_id) { object[:ulke_id].safe_to_i } @@ -11,16 +13,14 @@ class AcademicDutiesSerializer < Serializer attribute(:year_of_start) { object[:bastar1].safe_to_i } attribute(:year_of_end) { object[:bittar1].safe_to_i } attribute(:scientific_field_name) { object[:bilimalan_adi].titleize_tr } - attribute(:field_of_specialization_id) { object[:uzmanlik_alani].safe_to_i } - attribute(:field_of_specialization_name) { object[:uzmanlik_alani_ad].titleize_tr } attribute(:university_id) { object[:univ_id].safe_to_i } attribute(:university_name) { object[:univ_birim_adi].titleize_tr } - attribute(:unit_id) { object[:birim_id].safe_to_i } attribute(:faculty) { object[:fakultebilgisi].titleize_tr } attribute(:department) { object[:bolumbilgisi].titleize_tr } attribute(:field) { object[:alanbilgisi].titleize_tr } - attribute(:title_id) { object[:kadro_unvan_id].safe_to_i } - attribute(:title_name) { object[:kadro_unvan_adi].titleize_tr } + attribute(:field_of_specialization_id) { object[:uzmanlik_alani].safe_to_i } + attribute(:field_of_specialization_name) { object[:uzmanlik_alani_ad].titleize_tr } + attribute(:unit_id) { object[:birim_id].safe_to_i } attribute(:academic_status_id) { object[:akademik_durum].safe_to_i } attribute(:academic_status_name) { object[:akademik_durum_adi].titleize_tr } attribute(:academic_unit_name) { object[:akademik_birim_adi].titleize_tr } diff --git a/app/serializers/yoksis/resumes/administrative_duties_serializer.rb b/app/serializers/yoksis/resumes/administrative_duties_serializer.rb index 436638c1..fdf95f75 100644 --- a/app/serializers/yoksis/resumes/administrative_duties_serializer.rb +++ b/app/serializers/yoksis/resumes/administrative_duties_serializer.rb @@ -3,8 +3,8 @@ module Yoksis module Resumes class AdministrativeDutiesSerializer < Serializer - attribute(:administrative_duty_id) { object[:idgor_id].safe_to_i } - attribute(:id) { object[:gorev_id].safe_to_i } + attribute(:registry_id) { object[:idgor_id].safe_to_i } + attribute(:duty_id) { object[:gorev_id].safe_to_i } attribute(:name) { object[:gorev_adi].titleize_tr } attribute(:place_id) { object[:yer_id].safe_to_i } attribute(:place_name) { object[:yer_ad].titleize_tr } @@ -14,8 +14,8 @@ class AdministrativeDutiesSerializer < Serializer attribute(:year_of_end) { object[:bit_tar].safe_to_i } attribute(:university_id) { object[:unv_id].safe_to_i } attribute(:university_name) { object[:unv_birim_adi].titleize_tr } - attribute(:institution) { object[:fakultemyoenst].titleize_tr } attribute(:major) { object[:abd].titleize_tr } + attribute(:faculty) { object[:fakultemyoenst].titleize_tr } attribute(:department) { object[:bolumbilgisi].titleize_tr } attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } diff --git a/app/serializers/yoksis/resumes/articles_serializer.rb b/app/serializers/yoksis/resumes/articles_serializer.rb index 1213a7a0..b188ea43 100644 --- a/app/serializers/yoksis/resumes/articles_serializer.rb +++ b/app/serializers/yoksis/resumes/articles_serializer.rb @@ -3,45 +3,45 @@ module Yoksis module Resumes class ArticlesSerializer < Serializer - attribute(:id) { object[:yayin_id].safe_to_i } - attribute(:name) { object[:makale_adi].titleize_tr } - attribute(:type_id) { object[:makale_turu_id].safe_to_i } - attribute(:type_name) { object[:makale_turu_ad].titleize_tr } - attribute(:scope_id) { object[:kapsam_id].safe_to_i } - attribute(:scope_name) { object[:kapsam_ad].titleize_tr } - attribute(:referee_type_id) { object[:hakem_tur].safe_to_i } - attribute(:referee_type_name) { object[:hakem_tur_ad].titleize_tr } - attribute(:index_id) { object[:endeks_id].safe_to_i } - attribute(:index) { object[:endeks].titleize_tr } - attribute(:author_id) { object[:yazar_id].safe_to_i } - attribute(:authors) { object[:yazar_adi] && object[:yazar_adi].split(',').map(&:strip).map(&:titleize_tr) } - attribute(:authors_number) { object[:yazar_sayisi].safe_to_i } - attribute(:country_id) { object[:ulke].safe_to_i } - attribute(:country_name) { object[:ulke_adi].titleize_tr } - attribute(:city) { object[:sehir].titleize_tr } - attribute(:journal_name) { object[:dergi_adi].titleize_tr } - attribute(:language_id) { object[:yayin_dili].safe_to_i } - attribute(:language_name) { object[:yayin_dili_adi].titleize_tr } - attribute(:month) { object[:ay].safe_to_i } - attribute(:year) { object[:yil].safe_to_i } - attribute(:volume) { object[:cilt].safe_to_i } - attribute(:issue) { object[:sayi].safe_to_i } - attribute(:first_page) { object[:ilk_sayfa].safe_to_i } - attribute(:last_page) { object[:son_sayfa].safe_to_i } - attribute(:doi) { object[:doi].safe_to_i } - attribute(:issn) { object[:issn].safe_to_i } - attribute(:access_type_id) { object[:erisim_turu].safe_to_i } - attribute(:access_type_name) { object[:erisim_turu_ad] } - attribute(:access_link) { object[:erisim_linki] } - attribute(:citations_number) { object[:atif_sayisi].safe_to_i } - attribute(:field) { object[:alan_bilgisi].titleize_tr } - attribute(:keywords) { object[:anahtar_kelime].titleize_tr } - attribute(:special_number_id) { object[:ozel_sayi].safe_to_i } - attribute(:special_number_name) { object[:ozel_sayi_ad].titleize_tr } - attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } - attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } - attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } - attribute(:incentive_points) { object[:tesv_puan].safe_to_f } + attribute(:publishing_id) { object[:yayin_id].safe_to_i } + attribute(:publishing_language_id) { object[:yayin_dili].safe_to_i } + attribute(:publishing_language_name) { object[:yayin_dili_adi].titleize_tr } + attribute(:name) { object[:makale_adi].titleize_tr } + attribute(:type_id) { object[:makale_turu_id].safe_to_i } + attribute(:type_name) { object[:makale_turu_ad].titleize_tr } + attribute(:scope_id) { object[:kapsam_id].safe_to_i } + attribute(:scope_name) { object[:kapsam_ad].titleize_tr } + attribute(:referee_type_id) { object[:hakem_tur].safe_to_i } + attribute(:referee_type_name) { object[:hakem_tur_ad].titleize_tr } + attribute(:index_id) { object[:endeks_id].safe_to_i } + attribute(:index) { object[:endeks].titleize_tr } + attribute(:author_id) { object[:yazar_id].safe_to_i } + attribute(:authors) { object[:yazar_adi] && object[:yazar_adi].split(',').map(&:strip).map(&:titleize_tr) } + attribute(:number_of_author) { object[:yazar_sayisi].safe_to_i } + attribute(:country_id) { object[:ulke].safe_to_i } + attribute(:country_name) { object[:ulke_adi].titleize_tr } + attribute(:city) { object[:sehir].titleize_tr } + attribute(:journal_name) { object[:dergi_adi].titleize_tr } + attribute(:month) { object[:ay].safe_to_i } + attribute(:year) { object[:yil].safe_to_i } + attribute(:volume) { object[:cilt].safe_to_i } + attribute(:issue) { object[:sayi].safe_to_i } + attribute(:first_page) { object[:ilk_sayfa].safe_to_i } + attribute(:last_page) { object[:son_sayfa].safe_to_i } + attribute(:doi) { object[:doi].safe_to_i } + attribute(:issn) { object[:issn].safe_to_i } + attribute(:access_type_id) { object[:erisim_turu].safe_to_i } + attribute(:access_type_name) { object[:erisim_turu_ad] } + attribute(:access_link) { object[:erisim_linki] } + attribute(:number_of_citation) { object[:atif_sayisi].safe_to_i } + attribute(:field) { object[:alan_bilgisi].titleize_tr } + attribute(:keywords) { object[:anahtar_kelime].titleize_tr } + attribute(:special_edition_id) { object[:ozel_sayi].safe_to_i } + attribute(:special_edition_name) { object[:ozel_sayi_ad].titleize_tr } + attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } + attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } + attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } + attribute(:incentive_points) { object[:tesv_puan].safe_to_f } end end end diff --git a/app/serializers/yoksis/resumes/artistic_activities_serializer.rb b/app/serializers/yoksis/resumes/artistic_activities_serializer.rb index 8ea94bba..d9852f12 100644 --- a/app/serializers/yoksis/resumes/artistic_activities_serializer.rb +++ b/app/serializers/yoksis/resumes/artistic_activities_serializer.rb @@ -3,7 +3,7 @@ module Yoksis module Resumes class ArtisticActivitiesSerializer < Serializer - attribute(:id) { object[:s_id].safe_to_i } + attribute(:registry_id) { object[:s_id].safe_to_i } attribute(:name) { object[:etkinlik_adi].titleize_tr } attribute(:place) { object[:etkinlik_yeri].titleize_tr } attribute(:type_id) { object[:etkinlik_turu].safe_to_i } @@ -16,7 +16,7 @@ class ArtisticActivitiesSerializer < Serializer attribute(:date_of_start) { object[:bas_tarih] && Date.parse(object[:bas_tarih]) } attribute(:date_of_end) { object[:bit_tarih] && Date.parse(object[:bit_tarih]) } attribute(:organizers) { object[:duzenleyenler].titleize_tr } - attribute(:number_of_persons) { object[:kisi_sayisi].safe_to_i } + attribute(:number_of_person) { object[:kisi_sayisi].safe_to_i } attribute(:country_id) { object[:ulke].safe_to_i } attribute(:country_name) { object[:ulke_adi].titleize_tr } attribute(:city) { object[:sehir].titleize_tr } diff --git a/app/serializers/yoksis/resumes/authors_serializer.rb b/app/serializers/yoksis/resumes/authors_serializer.rb index 62134c3f..6d6814df 100644 --- a/app/serializers/yoksis/resumes/authors_serializer.rb +++ b/app/serializers/yoksis/resumes/authors_serializer.rb @@ -3,7 +3,7 @@ module Yoksis module Resumes class AuthorsSerializer < Serializer - attribute(:yoksis_id) { object[:y_id].safe_to_i } + attribute(:registry_id) { object[:y_id].safe_to_i } attribute(:id_number) { object[:tc_kimlik_no].safe_to_i } attribute(:first_name) { object[:yazarad].titleize_tr } attribute(:last_name) { object[:yazarsoyad].titleize_tr } diff --git a/app/serializers/yoksis/resumes/awards_serializer.rb b/app/serializers/yoksis/resumes/awards_serializer.rb index a8fb18a6..16eba4d9 100644 --- a/app/serializers/yoksis/resumes/awards_serializer.rb +++ b/app/serializers/yoksis/resumes/awards_serializer.rb @@ -3,17 +3,17 @@ module Yoksis module Resumes class AwardsSerializer < Serializer - attribute(:id) { object[:odul_id].safe_to_i } - attribute(:name) { object[:odul_adi].titleize_tr } - attribute(:description) { object[:odul_aciklama].titleize_tr } - attribute(:year) { object[:odul_tarih].safe_to_i } - attribute(:detail_id) { object[:faal_detay_id].safe_to_i } - attribute(:detail_name) { object[:faal_detay_adi].titleize_tr } - attribute(:type_id) { object[:odul_tur_id].safe_to_i } - attribute(:type_name) { object[:odul_turu].titleize_tr } - attribute(:country_id) { object[:ulke_id].safe_to_i } - attribute(:country_name) { object[:ulke_ad].titleize_tr } - attribute(:number_of_persons) { object[:kisi_sayisi].titleize_tr } + attribute(:id) { object[:odul_id].safe_to_i } + attribute(:name) { object[:odul_adi].titleize_tr } + attribute(:description) { object[:odul_aciklama].titleize_tr } + attribute(:year) { object[:odul_tarih].safe_to_i } + attribute(:activity_detail_id) { object[:faal_detay_id].safe_to_i } + attribute(:activity_detail_name) { object[:faal_detay_adi].titleize_tr } + attribute(:type_id) { object[:odul_tur_id].safe_to_i } + attribute(:type_name) { object[:odul_turu].titleize_tr } + attribute(:country_id) { object[:ulke_id].safe_to_i } + attribute(:country_name) { object[:ulke_ad].titleize_tr } + attribute(:number_of_person) { object[:kisi_sayisi].titleize_tr } attribute :awarder do { diff --git a/app/serializers/yoksis/resumes/books_serializer.rb b/app/serializers/yoksis/resumes/books_serializer.rb index ef5f5dbc..7118812d 100644 --- a/app/serializers/yoksis/resumes/books_serializer.rb +++ b/app/serializers/yoksis/resumes/books_serializer.rb @@ -3,41 +3,41 @@ module Yoksis module Resumes class BooksSerializer < Serializer - attribute(:publishing_id) { object[:y_id].safe_to_i } - attribute(:publishing_house) { object[:yayin_evi].titleize_tr } - attribute(:publishing_language_id) { object[:yayin_dili].safe_to_i } - attribute(:publishing_language_name) { object[:yayin_dili_adi].titleize_tr } - attribute(:scope_id) { object[:kapsam_id].safe_to_i } - attribute(:scope_name) { object[:kapsam_ad].titleize_tr } - attribute(:name) { object[:kitap_adi].safe_to_i } - attribute(:type_id) { object[:kitap_tur_id].safe_to_i } - attribute(:type_name) { object[:kitap_tur].titleize_tr } - attribute(:contribution_rate_id) { object[:katki_duzeyi].safe_to_i } - attribute(:contribution_rate_name) { object[:katki_duzeyi_ad].titleize_tr } - attribute(:chapter_name) { object[:bolum_adi].titleize_tr } - attribute(:authors_number) { object[:yazar_sayisi].safe_to_i } - attribute(:author_name) { object[:yazar_adi].titleize_tr } - attribute(:editor_name) { object[:editor_adi].titleize_tr } - attribute(:country_id) { object[:ulke].safe_to_i } - attribute(:country_name) { object[:ulke_adi].titleize_tr } - attribute(:city) { object[:sehir].titleize_tr } - attribute(:year) { object[:yil].safe_to_i } - attribute(:isbn) { object[:isbn].titleize_tr } - attribute(:copies_number) { object[:kacinci_basim].safe_to_i } - attribute(:pages_number) { object[:sayfa_sayisi].safe_to_i } - attribute(:chapter_first_page) { object[:bolum_ilk_sayfa].safe_to_i } - attribute(:chapter_last_page) { object[:bolum_son_sayfa].safe_to_i } - attribute(:releasing_type_id) { object[:basim_turu].safe_to_i } - attribute(:releasing_type_name) { object[:basim_turu_ad].titleize_tr } - attribute(:access_link) { object[:erisim_linki] } - attribute(:field) { object[:alan_bilgisi].titleize_tr } - attribute(:keywords) { object[:anahtar_kelime].titleize_tr } - attribute(:author_id) { object[:yazar_id].safe_to_i } - attribute(:citations_number) { object[:atif_sayisi].safe_to_i } - attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } - attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } - attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } - attribute(:incentive_points) { object[:tesv_puan].safe_to_f } + attribute(:registry_id) { object[:y_id].safe_to_i } + attribute(:publishing_house) { object[:yayin_evi].titleize_tr } + attribute(:publishing_language_id) { object[:yayin_dili].safe_to_i } + attribute(:publishing_language_name) { object[:yayin_dili_adi].titleize_tr } + attribute(:name) { object[:kitap_adi].safe_to_i } + attribute(:type_id) { object[:kitap_tur_id].safe_to_i } + attribute(:type_name) { object[:kitap_tur].titleize_tr } + attribute(:scope_id) { object[:kapsam_id].safe_to_i } + attribute(:scope_name) { object[:kapsam_ad].titleize_tr } + attribute(:contribution_rate_id) { object[:katki_duzeyi].safe_to_i } + attribute(:contribution_rate_name) { object[:katki_duzeyi_ad].titleize_tr } + attribute(:chapter_name) { object[:bolum_adi].titleize_tr } + attribute(:number_of_author) { object[:yazar_sayisi].safe_to_i } + attribute(:authors) { object[:yazar_adi] && object[:yazar_adi].split(',').map(&:strip).map(&:titleize_tr).titleize_tr } + attribute(:editor_name) { object[:editor_adi].titleize_tr } + attribute(:country_id) { object[:ulke].safe_to_i } + attribute(:country_name) { object[:ulke_adi].titleize_tr } + attribute(:city) { object[:sehir].titleize_tr } + attribute(:year) { object[:yil].safe_to_i } + attribute(:isbn) { object[:isbn].titleize_tr } + attribute(:number_of_copy) { object[:kacinci_basim].safe_to_i } + attribute(:number_of_page) { object[:sayfa_sayisi].safe_to_i } + attribute(:chapter_first_page) { object[:bolum_ilk_sayfa].safe_to_i } + attribute(:chapter_last_page) { object[:bolum_son_sayfa].safe_to_i } + attribute(:releasing_type_id) { object[:basim_turu].safe_to_i } + attribute(:releasing_type_name) { object[:basim_turu_ad].titleize_tr } + attribute(:access_link) { object[:erisim_linki] } + attribute(:field) { object[:alan_bilgisi].titleize_tr } + attribute(:keywords) { object[:anahtar_kelime].titleize_tr } + attribute(:author_id) { object[:yazar_id].safe_to_i } + attribute(:number_of_citation) { object[:atif_sayisi].safe_to_i } + attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } + attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } + attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } + attribute(:incentive_points) { object[:tesv_puan].safe_to_f } end end end diff --git a/app/serializers/yoksis/resumes/certifications_serializer.rb b/app/serializers/yoksis/resumes/certifications_serializer.rb index dac0ea61..148db7a1 100644 --- a/app/serializers/yoksis/resumes/certifications_serializer.rb +++ b/app/serializers/yoksis/resumes/certifications_serializer.rb @@ -3,12 +3,12 @@ module Yoksis module Resumes class CertificationsSerializer < Serializer - attribute(:id) { object[:s_id].safe_to_i } + attribute(:registry_id) { object[:s_id].safe_to_i } attribute(:name) { object[:adi].titleize_tr } attribute(:content) { object[:icerik].titleize_tr } attribute(:type_id) { object[:tur_id].safe_to_i } attribute(:type_name) { object[:tur_adi].titleize_tr } - attribute(:location) { object[:yer].titleize_tr } + attribute(:place) { object[:yer].titleize_tr } attribute(:scope_id) { object[:kapsam].safe_to_i } attribute(:scope_name) { object[:kapsam_ad].titleize_tr } attribute(:stint) { object[:sure].safe_to_i } @@ -16,7 +16,7 @@ class CertificationsSerializer < Serializer attribute(:title_name) { object[:unvan_ad].titleize_tr } attribute(:institution_id) { object[:kurum_id].safe_to_i } attribute(:institution_name) { object[:kurum_ad].titleize_tr } - attribute(:members_number) { object[:kisi_sayisi].safe_to_i } + attribute(:number_of_person) { object[:kisi_sayisi].safe_to_i } attribute(:country) { object[:ulke_sehir] && object[:ulke_sehir].split('/').first.titleize_tr } attribute(:city) { object[:ulke_sehir] && object[:ulke_sehir].split('/').last.titleize_tr } attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } diff --git a/app/serializers/yoksis/resumes/citations_serializer.rb b/app/serializers/yoksis/resumes/citations_serializer.rb index 31272b81..3a8861a8 100644 --- a/app/serializers/yoksis/resumes/citations_serializer.rb +++ b/app/serializers/yoksis/resumes/citations_serializer.rb @@ -3,8 +3,8 @@ module Yoksis module Resumes class CitationsSerializer < Serializer - attribute(:id) { object[:a_id].safe_to_i } - attribute(:year) { object[:donem].safe_to_i } + attribute(:registry_id) { object[:a_id].safe_to_i } + attribute(:term) { object[:donem].safe_to_i } attribute(:type_id) { object[:tur].safe_to_i } attribute(:type_name) { object[:tur_ad].titleize_tr } attribute(:work_type) { object[:eser_turu].titleize_tr } diff --git a/app/serializers/yoksis/resumes/designs_serializer.rb b/app/serializers/yoksis/resumes/designs_serializer.rb index 43e27465..c0c51270 100644 --- a/app/serializers/yoksis/resumes/designs_serializer.rb +++ b/app/serializers/yoksis/resumes/designs_serializer.rb @@ -3,7 +3,7 @@ module Yoksis module Resumes class DesignsSerializer < Serializer - attribute(:id) { object[:p_tasarim_id].safe_to_i } + attribute(:registry_id) { object[:p_tasarim_id].safe_to_i } attribute(:name) { object[:tasarim_adi].titleize_tr } attribute(:summary) { object[:tasarim_ozeti].titleize_tr } attribute(:type_id) { object[:tasarim_turu].safe_to_i } @@ -19,7 +19,7 @@ class DesignsSerializer < Serializer attribute(:title_name) { object[:unvan_ad].titleize_tr } attribute(:institution_id) { object[:kurum_id].safe_to_i } attribute(:institution_name) { object[:kurum_ad].titleize_tr } - attribute(:number_of_people) { object[:kisi_sayisi].safe_to_i } + attribute(:number_of_person) { object[:kisi_sayisi].safe_to_i } attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } diff --git a/app/serializers/yoksis/resumes/editorships_serializer.rb b/app/serializers/yoksis/resumes/editorships_serializer.rb index a4089405..e769c148 100644 --- a/app/serializers/yoksis/resumes/editorships_serializer.rb +++ b/app/serializers/yoksis/resumes/editorships_serializer.rb @@ -12,10 +12,10 @@ class EditorshipsSerializer < Serializer attribute(:type_name) { object[:editorluk_tur_ad].titleize_tr } attribute(:scope_id) { object[:kapsam_id].safe_to_i } attribute(:scope_name) { object[:kapsam_ad].titleize_tr } - attribute(:duty_id) { object[:editor_gorev].safe_to_i } - attribute(:duty_name) { object[:editor_gorev_ad].titleize_tr } + attribute(:editor_duty_id) { object[:editor_gorev].safe_to_i } + attribute(:editor_duty_name) { object[:editor_gorev_ad].titleize_tr } attribute(:authors) { object[:yazar_adi] && object[:yazar_adi].split(',').map(&:strip).map(&:titleize_tr) } - attribute(:authors_number) { object[:yazar_sayisi].safe_to_i } + attribute(:number_of_author) { object[:yazar_sayisi].safe_to_i } attribute(:country_id) { object[:ulke].safe_to_i } attribute(:country_name) { object[:ulke_adi].titleize_tr } attribute(:city) { object[:sehir].titleize_tr } diff --git a/app/serializers/yoksis/resumes/education_informations_serializer.rb b/app/serializers/yoksis/resumes/education_informations_serializer.rb index 4652cbfa..029b59d6 100644 --- a/app/serializers/yoksis/resumes/education_informations_serializer.rb +++ b/app/serializers/yoksis/resumes/education_informations_serializer.rb @@ -3,7 +3,7 @@ module Yoksis module Resumes class EducationInformationsSerializer < Serializer - attribute(:id) { object[:id].safe_to_i } + attribute(:registry_id) { object[:id].safe_to_i } attribute(:place_id) { object[:yer_id].safe_to_i } attribute(:place_name) { object[:yer_ad].titleize_tr } attribute(:year_of_start) { object[:bastar1].safe_to_i } @@ -15,8 +15,11 @@ class EducationInformationsSerializer < Serializer attribute(:program_id) { object[:program_id].safe_to_i } attribute(:program_name) { object[:program_adi].titleize_tr } attribute(:other_university) { object[:diger_universite].titleize_tr } + attribute(:thesis_name) { object[:tez_adi].titleize_tr } attribute(:thesis_step_id) { object[:tez_asamasi].safe_to_i } attribute(:thesis_step_name) { object[:tez_asamasi_ad].titleize_tr } + attribute(:start_date_of_thesis) { object[:tez_bas_tar].safe_to_i } + attribute(:end_date_of_thesis) { object[:tez_bit_tar].safe_to_i } attribute(:university_id) { object[:univ_id].safe_to_i } attribute(:university_name) { object[:unv_birim_adi].titleize_tr } attribute(:academic_unit_id) { object[:akademik_birim_id].safe_to_i } @@ -28,9 +31,6 @@ class EducationInformationsSerializer < Serializer attribute(:number_of_diploma_equivalency) { object[:diplomadenklik_tarih_sayi].safe_to_i } attribute(:advisors_id_number) { object[:danisman_tc].safe_to_i } attribute(:advisor) { object[:danisman_ad_soyad].titleize_tr } - attribute(:thesis_name) { object[:tez_adi].titleize_tr } - attribute(:start_date_of_thesis) { object[:tez_bas_tar].safe_to_i } - attribute(:end_date_of_thesis) { object[:tez_bit_tar].safe_to_i } attribute(:c_unit_id) { object[:c_birim_id].safe_to_i } attribute(:c_unit_name) { object[:c_birim_ad].safe_to_i } attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } diff --git a/app/serializers/yoksis/resumes/fields_serializer.rb b/app/serializers/yoksis/resumes/fields_serializer.rb index a63f4263..71924246 100644 --- a/app/serializers/yoksis/resumes/fields_serializer.rb +++ b/app/serializers/yoksis/resumes/fields_serializer.rb @@ -3,9 +3,9 @@ module Yoksis module Resumes class FieldsSerializer < Serializer - attribute(:registration_id) { object[:t_uak_id].safe_to_i } - attribute(:id) { object[:temel_alan_id].safe_to_i } - attribute(:name) { object[:temel_alan_ad].titleize_tr } + attribute(:registry_id) { object[:t_uak_id].safe_to_i } + attribute(:field_id) { object[:temel_alan_id].safe_to_i } + attribute(:field_name) { object[:temel_alan_ad].titleize_tr } attribute(:scientific_field_id) { object[:bilim_alan_id].safe_to_i } attribute(:scientific_field_name) { object[:bilim_alan_ad].titleize_tr } attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } diff --git a/app/serializers/yoksis/resumes/foreign_languages_serializer.rb b/app/serializers/yoksis/resumes/foreign_languages_serializer.rb index dad62fac..709c0b73 100644 --- a/app/serializers/yoksis/resumes/foreign_languages_serializer.rb +++ b/app/serializers/yoksis/resumes/foreign_languages_serializer.rb @@ -3,7 +3,7 @@ module Yoksis module Resumes class ForeignLanguagesSerializer < Serializer - attribute(:id) { object[:y_id].safe_to_i } + attribute(:registry_id) { object[:y_id].safe_to_i } attribute(:language_id) { object[:dil_id].safe_to_i } attribute(:language_name) { object[:dil_ad].titleize_tr } attribute(:language_testing_id) { object[:dil_sinav_id].safe_to_i } diff --git a/app/serializers/yoksis/resumes/incentive_activity_declarations_serializer.rb b/app/serializers/yoksis/resumes/incentive_activity_declarations_serializer.rb index 2e58ef6c..fb07a3e0 100644 --- a/app/serializers/yoksis/resumes/incentive_activity_declarations_serializer.rb +++ b/app/serializers/yoksis/resumes/incentive_activity_declarations_serializer.rb @@ -3,7 +3,7 @@ module Yoksis module Resumes class IncentiveActivityDeclarationsSerializer < Serializer - attribute(:id) { object[:fb_id].safe_to_i } + attribute(:registry_id) { object[:fb_id].safe_to_i } attribute(:type_id) { object[:tur].safe_to_i } attribute(:type_name) { object[:tur_ad].titleize_tr } attribute(:work_id) { object[:eser_id].safe_to_i } diff --git a/app/serializers/yoksis/resumes/incentive_applications_serializer.rb b/app/serializers/yoksis/resumes/incentive_applications_serializer.rb index df2a9695..4c412244 100644 --- a/app/serializers/yoksis/resumes/incentive_applications_serializer.rb +++ b/app/serializers/yoksis/resumes/incentive_applications_serializer.rb @@ -3,7 +3,7 @@ module Yoksis module Resumes class IncentiveApplicationsSerializer < Serializer - attribute(:id) { object[:basvuru_id].safe_to_i } + attribute(:application_id) { object[:basvuru_id].safe_to_i } attribute(:term_id) { object[:donem_id].safe_to_i } attribute(:term_name) { object[:donem_ad].titleize_tr } attribute(:date_of_application) { object[:basvuru_tarihi] && Date.parse(object[:basvuru_tarihi]) } diff --git a/app/serializers/yoksis/resumes/lectures_serializer.rb b/app/serializers/yoksis/resumes/lectures_serializer.rb index 7e0b8ae0..c3d31b1a 100644 --- a/app/serializers/yoksis/resumes/lectures_serializer.rb +++ b/app/serializers/yoksis/resumes/lectures_serializer.rb @@ -3,15 +3,15 @@ module Yoksis module Resumes class LecturesSerializer < Serializer - attribute(:id) { object[:ders_id].safe_to_i } - attribute(:name) { object[:ders_adi].titleize_tr } + attribute(:lecture_id) { object[:ders_id].safe_to_i } + attribute(:lecture_name) { object[:ders_adi].titleize_tr } attribute(:education_level_id) { object[:ogrenim_id].safe_to_i } attribute(:education_level_name) { object[:ogrenim_adi].titleize_tr } attribute(:academic_term_id) { object[:akademik_yil_id].safe_to_i } attribute(:academic_term) { object[:akademik_yil] } attribute(:language_id) { object[:dil_id].safe_to_i } attribute(:language_name) { object[:dil_adi].titleize_tr } - attribute(:period) { object[:ders_saati].safe_to_i } + attribute(:weekly_course_hours) { object[:ders_saati].safe_to_i } attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } diff --git a/app/serializers/yoksis/resumes/papers_serializer.rb b/app/serializers/yoksis/resumes/papers_serializer.rb index 568a819b..585e7fe3 100644 --- a/app/serializers/yoksis/resumes/papers_serializer.rb +++ b/app/serializers/yoksis/resumes/papers_serializer.rb @@ -3,44 +3,44 @@ module Yoksis module Resumes class PapersSerializer < Serializer - attribute(:id) { object[:yayin_id].safe_to_i } - attribute(:name) { object[:bildiri_adi] } - attribute(:scope_id) { object[:kapsam_id].safe_to_i } - attribute(:scope_name) { object[:kapsam_ad] } - attribute(:type_id) { object[:bildiri_tur_id].safe_to_i } - attribute(:type_name) { object[:bildiri_tur].titleize_tr } - attribute(:author_id) { object[:yazar_id].safe_to_i } - attribute(:authors_number) { object[:yazar_sayisi].safe_to_i } - attribute(:authors) { object[:yazar_adi] && object[:yazar_adi].split(',').map(&:strip).map(&:titleize_tr) } - attribute(:city) { object[:sehir].titleize_tr } - attribute(:country_id) { object[:ulke].safe_to_i } - attribute(:country_name) { object[:ulke_adi].titleize_tr } - attribute(:language_id) { object[:yayin_dili].safe_to_i } - attribute(:language_name) { object[:yayin_dili_adi].titleize_tr } - attribute(:status_id) { object[:yayin_durumu].safe_to_i } - attribute(:status_name) { object[:yayin_durumu_ad].titleize_tr } - attribute(:date_of_release) { object[:basim_tarihi] && Date.parse(object[:basim_tarihi]) } - attribute(:release_type_id) { object[:basim_turu].safe_to_i } - attribute(:release_type_name) { object[:basim_turu_ad].titleize_tr } - attribute(:volume) { object[:cilt].safe_to_i } - attribute(:issue) { object[:sayi].safe_to_i } - attribute(:first_page) { object[:ilk_sayfa].safe_to_i } - attribute(:last_page) { object[:son_sayfa].safe_to_i } - attribute(:doi) { object[:doi].safe_to_i } - attribute(:issn) { object[:issn].safe_to_i } - attribute(:print_isbn) { object[:print_isbn].safe_to_i } - attribute(:access_link) { object[:access_link] } - attribute(:citations_number) { object[:atif_sayisi].safe_to_i } - attribute(:field) { object[:alan_bilgisi].titleize_tr } - attribute(:keywords) { object[:anahtar_kelime].titleize_tr } - attribute(:special_number_id) { object[:ozel_sayi].safe_to_i } - attribute(:special_number_name) { object[:ozel_sayi_ad].titleize_tr } - attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } - attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } - attribute(:incentive_points) { object[:tesv_puan].safe_to_f } - attribute(:presentation_type_id) { object[:bildiri_sunum_turu].safe_to_i } - attribute(:presentation_type_name) { object[:bildiri_sunum_turu_ad].titleize_tr } - attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } + attribute(:publishing_id) { object[:yayin_id].safe_to_i } + attribute(:publishing_language_id) { object[:yayin_dili].safe_to_i } + attribute(:publishing_language_name) { object[:yayin_dili_adi].titleize_tr } + attribute(:publishing_status_id) { object[:yayin_durumu].safe_to_i } + attribute(:publishing_status_name) { object[:yayin_durumu_ad].titleize_tr } + attribute(:presentation_type_id) { object[:bildiri_sunum_turu].safe_to_i } + attribute(:presentation_type_name) { object[:bildiri_sunum_turu_ad].titleize_tr } + attribute(:name) { object[:bildiri_adi] } + attribute(:scope_id) { object[:kapsam_id].safe_to_i } + attribute(:scope_name) { object[:kapsam_ad] } + attribute(:type_id) { object[:bildiri_tur_id].safe_to_i } + attribute(:type_name) { object[:bildiri_tur].titleize_tr } + attribute(:author_id) { object[:yazar_id].safe_to_i } + attribute(:number_of_author) { object[:yazar_sayisi].safe_to_i } + attribute(:authors) { object[:yazar_adi] && object[:yazar_adi].split(',').map(&:strip).map(&:titleize_tr) } + attribute(:city) { object[:sehir].titleize_tr } + attribute(:country_id) { object[:ulke].safe_to_i } + attribute(:country_name) { object[:ulke_adi].titleize_tr } + attribute(:date_of_release) { object[:basim_tarihi] && Date.parse(object[:basim_tarihi]) } + attribute(:release_type_id) { object[:basim_turu].safe_to_i } + attribute(:release_type_name) { object[:basim_turu_ad].titleize_tr } + attribute(:volume) { object[:cilt].safe_to_i } + attribute(:issue) { object[:sayi].safe_to_i } + attribute(:first_page) { object[:ilk_sayfa].safe_to_i } + attribute(:last_page) { object[:son_sayfa].safe_to_i } + attribute(:doi) { object[:doi].safe_to_i } + attribute(:issn) { object[:issn].safe_to_i } + attribute(:print_isbn) { object[:print_isbn].safe_to_i } + attribute(:access_link) { object[:access_link] } + attribute(:number_of_citation) { object[:atif_sayisi].safe_to_i } + attribute(:field) { object[:alan_bilgisi].titleize_tr } + attribute(:keywords) { object[:anahtar_kelime].titleize_tr } + attribute(:special_edition_id) { object[:ozel_sayi].safe_to_i } + attribute(:special_edition_name) { object[:ozel_sayi_ad].titleize_tr } + attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } + attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } + attribute(:incentive_points) { object[:tesv_puan].safe_to_f } + attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } end end end diff --git a/app/serializers/yoksis/resumes/patents_serializer.rb b/app/serializers/yoksis/resumes/patents_serializer.rb index 6b4ad6f0..6ca3daef 100644 --- a/app/serializers/yoksis/resumes/patents_serializer.rb +++ b/app/serializers/yoksis/resumes/patents_serializer.rb @@ -3,20 +3,18 @@ module Yoksis module Resumes class PatentsSerializer < Serializer - attribute(:id) { object[:patent_id].safe_to_i } + attribute(:patent_id) { object[:patent_id].safe_to_i } attribute(:name) { object[:patent_adi].titleize_tr } attribute(:no) { object[:patent_no].safe_to_i } attribute(:class) { object[:patent_sinif].upcase_tr } attribute(:year) { object[:patent_tarihi].safe_to_i } attribute(:applicants) { object[:basvuru_sahipleri].upcase_tr } attribute(:inventors) { object[:bulus_sahipleri].upcase_tr } - attribute(:number_of_persons) { object[:kisi_sayisi].safe_to_i } + attribute(:number_of_person) { object[:kisi_sayisi].safe_to_i } attribute(:category_id) { object[:kategori_id].safe_to_i } attribute(:category_name) { object[:kategori].titleize_tr } attribute(:file_type_id) { object[:dosya_tipi_id].safe_to_i } attribute(:file_type_name) { object[:dosya_tipi].titleize_tr } - attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } - attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } attribute(:scope_id) { object[:kapsam_id].safe_to_i } attribute(:scope_name) { object[:kapsam].titleize_tr } attribute(:title_id) { object[:unvan_id].safe_to_i } @@ -24,6 +22,8 @@ class PatentsSerializer < Serializer attribute(:institution_id) { object[:kurum_id].safe_to_i } attribute(:institution_name) { object[:kurum_ad].titleize_tr } attribute(:incentive_points) { object[:tesv_puan].safe_to_f } + attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } + attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } end end diff --git a/app/serializers/yoksis/resumes/projects_serializer.rb b/app/serializers/yoksis/resumes/projects_serializer.rb index c1e78581..727ffb52 100644 --- a/app/serializers/yoksis/resumes/projects_serializer.rb +++ b/app/serializers/yoksis/resumes/projects_serializer.rb @@ -3,12 +3,11 @@ module Yoksis module Resumes class ProjectsSerializer < Serializer - attribute(:id) { object[:proje_id].safe_to_i } + attribute(:project_id) { object[:proje_id].safe_to_i } attribute(:name) { object[:proje_ad].titleize_tr } attribute(:subject) { object[:proje_konusu].titleize_tr } attribute(:status_id) { object[:proje_durumu_id].safe_to_i } attribute(:status_name) { object[:proje_durumu_ad].titleize_tr } - attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } attribute(:budget) { object[:butce].safe_to_i } attribute(:location_id) { object[:proje_konumu_id].safe_to_i } attribute(:location_name) { object[:proje_konumu_ad].titleize_tr } @@ -16,14 +15,15 @@ class ProjectsSerializer < Serializer attribute(:type_name) { object[:proje_turu_ad].titleize_tr } attribute(:currency_id) { object[:para_birimi_id].safe_to_i } attribute(:currency_name) { object[:para_birimi_ad].titleize_tr } - attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } - attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } attribute(:scope_id) { object[:kapsam].safe_to_i } attribute(:scope_name) { object[:kapsam_ad].titleize_tr } attribute(:title_id) { object[:unvan_id].safe_to_i } attribute(:title_name) { object[:unvan_ad].titleize_tr } attribute(:institution_id) { object[:kurum_id].safe_to_i } attribute(:institution_name) { object[:kurum_ad].titleize_tr } + attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } + attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } + attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } attribute(:incentive_points) { object[:tesv_puan].safe_to_f } attribute :date_of_start do diff --git a/app/serializers/yoksis/resumes/refereeing_serializer.rb b/app/serializers/yoksis/resumes/refereeing_serializer.rb index b063e4be..ceff631c 100644 --- a/app/serializers/yoksis/resumes/refereeing_serializer.rb +++ b/app/serializers/yoksis/resumes/refereeing_serializer.rb @@ -9,7 +9,7 @@ class RefereeingSerializer < Serializer attribute(:publishing_language_name) { object[:yayin_dili_adi].titleize_tr } attribute(:type_id) { object[:hakemlik_turu].safe_to_i } attribute(:type_name) { object[:hakemlik_turu_ad].titleize_tr } - attribute(:numbers) { object[:hakemlik_sayisi].safe_to_i } + attribute(:number_of_refereeing) { object[:hakemlik_sayisi].safe_to_i } attribute(:scope_id) { object[:kapsam_id].safe_to_i } attribute(:scope_name) { object[:kapsam_ad].titleize_tr } attribute(:country_id) { object[:ulke].safe_to_i } diff --git a/app/serializers/yoksis/resumes/thesis_advisors_serializer.rb b/app/serializers/yoksis/resumes/thesis_advisors_serializer.rb index dd85d7e2..dc158f75 100644 --- a/app/serializers/yoksis/resumes/thesis_advisors_serializer.rb +++ b/app/serializers/yoksis/resumes/thesis_advisors_serializer.rb @@ -4,19 +4,19 @@ module Yoksis module Resumes class ThesisAdvisorsSerializer < Serializer attribute(:data_source) { object[:verikaynak].titleize_tr } - attribute(:thesis_name) { object[:tez_adi].titleize_tr } + attribute(:name) { object[:tez_adi].titleize_tr } attribute(:type_id) { object[:tur_id].safe_to_i } attribute(:type_name) { object[:tur_adi].titleize_tr } - attribute(:location_id) { object[:yer_id].safe_to_i } - attribute(:location_name) { object[:yer_adi].titleize_tr } + attribute(:place_id) { object[:yer_id].safe_to_i } + attribute(:place_name) { object[:yer_adi].titleize_tr } attribute(:country) { object[:ulke].titleize_tr } attribute(:year) { object[:yil].safe_to_i } - attribute(:registration_id) { object[:kayit_id].safe_to_i } + attribute(:registry_id) { object[:kayit_id].safe_to_i } attribute(:status) { object[:durum_adi].titleize_tr } attribute(:author) { "#{object[:yazar_adi]} #{object[:yazar_soyadi]}".titleize_tr } attribute(:university) { object[:universite_ad].titleize_tr } - attribute(:institution) { object[:enstitu_ad].titleize_tr } attribute(:major) { object[:abd_ad].titleize_tr } + attribute(:institution) { object[:enstitu_ad].titleize_tr } attribute(:date_of_update) { object[:guncelleme_tarihi] && Time.zone.parse(object[:guncelleme_tarihi]) } attribute(:active_or_passive_id) { object[:aktif_pasif].safe_to_i } attribute(:active_or_passive_name) { object[:aktif_pasif_ad].titleize_tr } From 35a5872f74d606e325858effa0fc82646843f60f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Thu, 27 Sep 2018 18:06:15 +0300 Subject: [PATCH 97/98] Update yoksis service document for resumes endpoint --- doc/services/yoksis.md | 59 +++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/doc/services/yoksis.md b/doc/services/yoksis.md index 748763b0..b27efd43 100644 --- a/doc/services/yoksis.md +++ b/doc/services/yoksis.md @@ -87,36 +87,35 @@ Askerlik bilgilerini sunan arayüze sahiptir. Akademik özgeçmişe dair bilgiler sunan arayüze sahiptir. -|Action |Method|Required parameters|Description| -|----------------|------|-------------------|-----------| -|`articles` |GET |`id_number` |Makale bilgileri -|`certifications`|GET |`id_number` |Sertifika bilgileri -|`projects` |GET |`id_number` |Proje bilgileri - -**Not**: Bu endpoint'in şu action'ları eksiktir: - -- `getir_ders_listesi` -- `getir_ogrenim_bilgisi_listesi` -- `get_bildiri_bilgisi_v1` -- `getir_akademik_gorev_listesi` -- `get_odul_listesi_v1` -- `get_tesvik_faaliyet_beyan_v1` -- `getir_idari_gorev_listesi` -- `get_editorluk_bilgisi_v1` -- `getir_tez_danisman_listesi` -- `getir_uyelik_listesi` -- `get_hakemlik_bilgisi_v1` -- `get_temel_alan_bilgisi_v1` -- `get_personel_link_v1` -- `get_yazar_listesi_v1` -- `get_tesvik_basvuru_varmi_v1` -- `get_tasarim_bilgisi_v1` -- `get_kitap_bilgisi_v1` -- `getir_yabanci_dil_listesi` -- `get_sanatsal_faal_v1` -- `getir_unv_disi_deneyim_listesi` -- `get_atif_sayilari_v1` -- `get_patent_bilgisi_v1` +|Action |Method|Required parameters |Description| +|---------------------------------|------|------------------------|-----------| +|`academic_duties` |GET |`id_number` |Akademik görevler +|`academic_links` |GET |`id_number` |Akademik sayfa bilgileri +|`administrative_duties` |GET |`id_number` |İdari görevler +|`articles` |GET |`id_number` |Makaleler +|`artistic_activities` |GET |`id_number` |Sanatsal faaliyetler +|`authors` |GET |`id_number`, `author_id`|Yazar listesi +|`awards` |GET |`id_number` |Ödüller +|`books` |GET |`id_number` |Kitaplar +|`certifications` |GET |`id_number` |Sertifikalar +|`citations` |GET |`id_number`, `year` |Atıflar +|`designs` |GET |`id_number` |Tasarım bilgileri +|`editorships` |GET |`id_number` |Editörlük bilgileri +|`education_informations` |GET |`id_number` |Eğitim bilgileri +|`fields` |GET |`id_number` |Alan bilgisi +|`foreign_languages` |GET |`id_number` |Yabancı diller listesi +|`incentive_applications` |GET |`id_number`, `year` |Akademik teşvik başvuruları +|`incentive_activity_declarations`|GET |`id_number`, `year` |Akademik teşvik faaliyet beyanları +|`lectures` |GET |`id_number` |Verdiği dersler +|`memberships` |GET |`id_number` |Üyelik listesi +|`other_experiences` |GET |`id_number` |Üniversite dışı diğer deneyimler +|`papers` |GET |`id_number` |Bildiriler +|`patents` |GET |`id_number` |Patentler +|`projects` |GET |`id_number` |Projeler +|`refereeing` |GET |`id_number` |Hakemlik bilgileri +|`thesis_advisors` |GET |`id_number` |Tez danışmanlıkları + +**Not**: Bu endpoint'in altındaki tüm action'lar gerçeklenmiştir. ### Staff From ef1e16791643da12ee93b16cd23c13e9dec37dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Tekinaslan?= Date: Tue, 2 Oct 2018 15:45:18 +0300 Subject: [PATCH 98/98] Fix errors in identities serializer --- .../kps/queries/identities_serializer.rb | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/app/serializers/kps/queries/identities_serializer.rb b/app/serializers/kps/queries/identities_serializer.rb index b1b61748..b779b7a9 100644 --- a/app/serializers/kps/queries/identities_serializer.rb +++ b/app/serializers/kps/queries/identities_serializer.rb @@ -44,7 +44,10 @@ class IdentitiesSerializer < Serializer fathers_id_number: personal_informations[:baba_tc_kimlik_no].safe_to_i, mothers_id_number: personal_informations[:anne_tc_kimlik_no].safe_to_i, real_person_id_number: personal_informations[:gercek_kisi_kimlik_no].safe_to_i, - country: personal_informations[:ulke].titleize_tr, + country: { + code: personal_informations.dig(:ulke, :kod).safe_to_i, + description: personal_informations.dig(:ulke, :aciklama).titleize_tr + }, status_informations: status_informations, basic_informations: basic_informations } @@ -60,7 +63,10 @@ class IdentitiesSerializer < Serializer code: card_informations.dig(:cinsiyet, :kod).safe_to_i, description: card_informations.dig(:cinsiyet, :aciklama).titleize_tr }, - nationality: card_informations[:uyruk].titleize_tr, + nationality: { + code: card_informations.dig(:uyruk, :kod).safe_to_i, + description: card_informations.dig(:uyruk, :aciklama).titleize_tr + }, marital_status: { code: card_informations.dig(:medeni_hal, :kod).safe_to_i, description: card_informations.dig(:medeni_hal, :aciklama).titleize_tr @@ -73,7 +79,10 @@ class IdentitiesSerializer < Serializer number: card_informations[:no].safe_to_i, registration_number: card_informations[:kayit_no].safe_to_i, serial_number: card_informations[:seri], - issuing_reason: card_informations[:verilis_neden].titleize_tr, + issuing_reason: { + code: card_informations.dig(:verilis_neden, :kod).safe_to_i, + description: card_informations.dig(:verilis_neden, :aciklama).titleize_tr + }, issuing_date: build_date(*card_informations[:verilme_tarih].values_at(:yil, :ay, :gun)) }