Skip to content

Commit

Permalink
Update the metais api endpoints to match new version of metais
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasdrga committed Nov 22, 2024
1 parent 94fe8fd commit f4db2d4
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/jobs/metais/sync_all_projects_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class Metais::SyncAllProjectsJob < ApplicationJob
queue_as :metais

API_ENDPOINT = 'https://metais.vicepremier.gov.sk/cmdb/read/cilistfiltered'
API_ENDPOINT = 'https://metais.slovensko.sk/api/cmdb/read/cilistfiltered'
PROJECTS_REQUEST_TEMPLATE = '{"filter":{"type":["Projekt"],"metaAttributes":{"state":["DRAFT"]}},"page":%{page},"perpage":5}'

def perform
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/metais/sync_codelist_investment_type_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class Metais::SyncCodelistInvestmentTypeJob < ApplicationJob
queue_as :metais

API_ENDPOINT = 'https://metais.vicepremier.gov.sk/enumsrepository/enums/enum/all/TYP_INVESTICIE?lang=sk'
API_ENDPOINT = 'https://metais.slovensko.sk/api/enums-repo/enums/enum/valid/TYP_INVESTICIE?lang=sk'

def perform
conn = Faraday.new(url: API_ENDPOINT)
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/metais/sync_codelist_program_job.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class Metais::SyncCodelistProgramJob < ApplicationJob
queue_as :metais

API_ENDPOINT = 'https://metais.vicepremier.gov.sk/cmdb/read/cilistfiltered'
API_ENDPOINT = 'https://metais.slovensko.sk/api/cmdb/read/cilistfiltered'
REQUEST_BODY = '{"filter":{"type":["Program"],"metaAttributes":{"state":["DRAFT"]}},"page":1,"perpage":10000,"sortBy":"Gen_Profil_nazov","sortType":"ASC"}'

def perform
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/metais/sync_codelist_project_phase_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class Metais::SyncCodelistProjectPhaseJob < ApplicationJob
queue_as :metais

API_ENDPOINT = 'https://metais.vicepremier.gov.sk/enumsrepository/enums/enum/all/FAZA_PROJEKTU?lang=sk'
API_ENDPOINT = 'https://metais.slovensko.sk/api/enums-repo/enums/enum/valid/FAZA_PROJEKTU?lang=sk'

def perform
conn = Faraday.new(url: API_ENDPOINT)
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/metais/sync_codelist_project_state_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class Metais::SyncCodelistProjectStateJob < ApplicationJob
queue_as :metais

API_ENDPOINT = 'https://metais.vicepremier.gov.sk/enumsrepository/enums/enum/all/STAV_PROJEKTU?lang=sk'
API_ENDPOINT = 'https://metais.slovensko.sk/api/enums-repo/enums/enum/valid/STAV_PROJEKTU?lang=sk'

def perform
conn = Faraday.new(url: API_ENDPOINT)
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/metais/sync_codelist_source_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class Metais::SyncCodelistSourceJob < ApplicationJob
queue_as :metais

API_ENDPOINT = 'https://metais.vicepremier.gov.sk/enumsrepository/enums/enum/all/ZDROJ?lang=sk'
API_ENDPOINT = 'https://metais.slovensko.sk/api/enums-repo/enums/enum/valid/ZDROJ?lang=sk'

def perform
conn = Faraday.new(url: API_ENDPOINT)
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/metais/sync_document_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class Metais::SyncDocumentJob < ApplicationJob
queue_as :metais

API_ENDPOINT = 'https://metais.vicepremier.gov.sk/dms/file/meta/'
API_ENDPOINT = 'https://metais.slovensko.sk/api/dms/file/meta/'
NOT_FOUND_METADATA_TYPE = 'gnr404'

def perform(parent, json)
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/metais/sync_projects_isvs_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class Metais::SyncProjectsIsvsJob < ApplicationJob
queue_as :metais

API_ENDPOINT = 'https://metais.vicepremier.gov.sk/cmdb/read/relations/neighbourswithallrels/'
API_ENDPOINT = 'https://metais.slovensko.sk/api/cmdb/read/relations/neighbourswithallrels/'
RELATED_ISVS_REQUEST_TEMPLATE = '%{uuid}?ciTypes=ISVS&page=1&perPage=5'

def perform(project)
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/metais/sync_related_documents_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class Metais::SyncRelatedDocumentsJob < ApplicationJob
queue_as :metais

API_ENDPOINT = 'https://metais.vicepremier.gov.sk/cmdb/read/relations/neighbours/'
API_ENDPOINT = 'https://metais.slovensko.sk/api/cmdb/read/relations/neighbours/'
RELATED_DOCUMENTS_REQUEST_TEMPLATE = '{"neighboursFilter":{"usageType":["system","application"],"metaAttributes":{"state":["DRAFT"]},"relType":["CI_HAS_DOCUMENT","Dokument_sa_tyka_KRIS","CONTROL_HAS_DOCUMENT","PROJECT_HAS_DOCUMENT"],"ciType":["Dokument"]},"page":%{page},"perpage":100}'

def perform(parent)
Expand Down

0 comments on commit f4db2d4

Please sign in to comment.