This repository has been archived by the owner on Jun 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #105 from omu/develop
Merge develop into master
- Loading branch information
Showing
44 changed files
with
885 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# frozen_string_literal: true | ||
|
||
module Yoksis | ||
class ArticlesCreateJob < ApplicationJob | ||
queue_as :high | ||
|
||
# slow operation | ||
def perform(user) | ||
@response = Services::Yoksis::V1::Ozgecmis.new(user.id_number.to_i).articles | ||
end | ||
|
||
# callbacks | ||
|
||
# rubocop:disable Metrics/BlockLength | ||
after_perform do |job| | ||
user = job.arguments.first | ||
if @response[:sonuc][:durum_kodu].eql?('1') && @response[:makale_liste].present? | ||
response = [@response[:makale_liste]].flatten | ||
|
||
response.each do |study| | ||
user.articles.create( | ||
yoksis_id: study[:yayin_id], | ||
scope: study[:kapsam_id].try(:to_i), | ||
review: study[:hakem_tur].try(:to_i), | ||
index: study[:endeks_id].try(:to_i), | ||
title: study[:makale_adi], | ||
authors: study[:yazar_adi], | ||
number_of_authors: study[:yazar_sayisi], | ||
country: study[:ulke], | ||
city: study[:sehir], | ||
journal: study[:dergi_adi], | ||
language_of_publication: study[:yayin_dili_adi], | ||
month: study[:ay], | ||
year: study[:yil], | ||
volume: study[:cilt], | ||
issue: study[:sayi], | ||
first_page: study[:ilk_sayfa], | ||
last_page: study[:son_sayfa], | ||
doi: study[:doi], | ||
issn: study[:issn], | ||
access_type: study[:erisim_turu].try(:to_i), | ||
access_link: study[:erisim_linki], | ||
discipline: study[:alan_bilgisi], | ||
keyword: study[:anahtar_kelime], | ||
special_issue: study[:ozel_sayi], | ||
special_issue_name: study[:ozel_sayi_ad], | ||
sponsored_by: study[:sponsor], | ||
author_id: study[:yazar_id], | ||
last_update: study[:guncelleme_tarihi], | ||
status: study[:aktif_pasif].try(:to_i), | ||
type: study[:makale_turu_id].try(:to_i), | ||
incentive_point: study[:tesv_puan] | ||
) | ||
end | ||
end | ||
end | ||
# rubocop:enable Metrics/BlockLength | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# frozen_string_literal: true | ||
|
||
module Yoksis | ||
class CertificationsCreateJob < ApplicationJob | ||
queue_as :high | ||
|
||
# slow operation | ||
def perform(user) | ||
@response = Services::Yoksis::V1::Ozgecmis.new(user.id_number.to_i).certifications | ||
end | ||
|
||
# callbacks | ||
after_perform do |job| | ||
user = job.arguments.first | ||
if @response[:sonuc][:durum_kodu].eql?('1') && @response[:arastirma_liste].present? | ||
response = [@response[:arastirma_liste]].flatten | ||
|
||
response.each do |study| | ||
user.certifications.create( | ||
yoksis_id: study[:s_id].try(:to_i), | ||
type: study[:tur_id].try(:to_i), | ||
name: study[:adi], | ||
content: study[:icerik], | ||
location: study[:yer], | ||
scope: study[:kapsam].try(:to_i), | ||
duration: study[:sure], | ||
start_date: study[:bastar], | ||
end_date: study[:bittar], | ||
title: study[:unvan_ad].try(:capitalize_all), | ||
number_of_authors: study[:kisi_sayisi], | ||
city_and_country: study[:ulke_sehir], | ||
last_update: study[:guncelleme_tarihi], | ||
incentive_point: study[:tesv_puan], | ||
status: study[:aktif_pasif].try(:to_i) | ||
) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# frozen_string_literal: true | ||
|
||
module Yoksis | ||
class ProjectsCreateJob < ApplicationJob | ||
queue_as :high | ||
|
||
# slow operation | ||
def perform(user) | ||
@response = Services::Yoksis::V1::Ozgecmis.new(user.id_number.to_i).projects | ||
end | ||
|
||
# callbacks | ||
after_perform do |job| | ||
user = job.arguments.first | ||
if @response[:sonuc][:durum_kodu].eql?('1') && @response[:proje_listesi].present? | ||
response = [@response[:proje_listesi]].flatten | ||
|
||
response.each do |study| | ||
user.projects.create( | ||
yoksis_id: study[:proje_id].try(:to_i), | ||
name: study[:proje_ad], | ||
subject: study[:proje_konusu], | ||
status: study[:proje_durumu_id].try(:to_i), | ||
bastar: study[:bas_tar], | ||
bittar: study[:bit_tar], | ||
budget: study[:butce], | ||
duty: study[:proje_konumu_ad], | ||
type: study[:proje_turu_ad], | ||
currency: study[:para_birimi_ad], | ||
last_update: study[:guncelleme_tarihi], | ||
activity: study[:aktif_pasif].try(:to_i), | ||
scope: study[:kapsam].try(:to_i), | ||
title: study[:unvan_ad], | ||
unit_id: study[:kurum_id].try(:to_i), | ||
incentive_point: study[:tesv_puan] | ||
) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# frozen_string_literal: true | ||
|
||
class Article < ApplicationRecord | ||
self.inheritance_column = nil | ||
|
||
# relations | ||
belongs_to :user | ||
|
||
# validations | ||
validates :yoksis_id, presence: true | ||
validates :title, presence: true | ||
|
||
# enums | ||
enum scope: { national: 0, international: 1 } | ||
enum review: { reviewed: 0, not_reviewed: 1 } | ||
enum access_type: { printed: 1, electronic: 2, printed_and_electronic: 3 } | ||
enum status: { deleted: 0, active: 1 } | ||
|
||
enum index: { | ||
ssci: 5, | ||
sci_expanded: 6, | ||
ahci: 7, | ||
field_indexes: 8, | ||
well_established_indexes: 9, | ||
sci: 40, | ||
not_indexed: 42, | ||
ebsco: 46, | ||
index_islamicus: 47, | ||
index_medicus: 48, | ||
dental_index: 49, | ||
engineering_index: 50, | ||
compumath_index: 51, | ||
education_index: 52, | ||
australian_education_index: 53, | ||
british_education_index: 54, | ||
eric: 55, | ||
esci: 56, | ||
index_chemicus: 59, | ||
turkish_index: 45 | ||
} | ||
|
||
enum type: { | ||
original_article: 1, | ||
technical_note: 2, | ||
commentary: 3, | ||
case_report: 4, | ||
letter_to_the_editor: 5, | ||
abstract: 6, | ||
book_review: 7, | ||
research_note: 8, | ||
export_report: 9, | ||
review_article: 10, | ||
short_article: 11 | ||
} | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# frozen_string_literal: true | ||
|
||
class Project < ApplicationRecord | ||
self.inheritance_column = nil | ||
|
||
# relations | ||
belongs_to :user | ||
|
||
# validations | ||
validates :yoksis_id, presence: true | ||
|
||
# enums | ||
enum status: { | ||
completed: 1, | ||
continuing: 2, | ||
deferred: 3, | ||
pending: 4 | ||
} | ||
|
||
enum activity: { passive: 0, active: 1 } | ||
enum scope: { national: 0, international: 1 } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.