Add builder, job and generator for json data with provider regions #444#479
Open
dmitrytrager wants to merge 1 commit intomainfrom
Open
Add builder, job and generator for json data with provider regions #444#479dmitrytrager wants to merge 1 commit intomainfrom
dmitrytrager wants to merge 1 commit intomainfrom
Conversation
a00e354 to
3b0acc4
Compare
dmitrytrager
commented
Nov 17, 2025
| def provider_region_data(language) | ||
| FileToUpload.new( | ||
| content: JsonGenerator::ProviderRegions.new(language).perform, | ||
| name: "#{language.file_storage_prefix}provider_region_data.json", |
Collaborator
Author
There was a problem hiding this comment.
Filename TBD
Collaborator
There was a problem hiding this comment.
They'll get back to us on this.
Collaborator
Author
There was a problem hiding this comment.
Ok, will wait
dmitrytrager
commented
Nov 17, 2025
|
|
||
| def json_content | ||
| scope | ||
| .map { |provider| { name: provider.name, prefix: provider.file_name_prefix, regions: provider.regions } } |
Collaborator
Author
There was a problem hiding this comment.
Field names TBD
Collaborator
There was a problem hiding this comment.
Can we get a sample file to send them?
Collaborator
Author
There was a problem hiding this comment.
Like locally generated, for example?
Collaborator
Author
There was a problem hiding this comment.
English language:
"[{\"name\":\"Provided by the government\",\"prefix\":\"pref\",\"regions\":[{\"id\":1,\"name\":\"Africa\",\"created_at\":\"2025-02-03T16:02:20.957Z\",\"updated_at\":\"2025-10-13T21:19:47.221Z\"},{\"id\":2,\"name\":\"Asia\",\"created_at\":\"2025-10-13T21:19:53.908Z\",\"updated_at\":\"2025-10-13T21:19:53.908Z\"}]}]"
Spanish language:
"[{\"name\":\"Provided by the government\",\"prefix\":\"pref\",\"regions\":[{\"id\":1,\"name\":\"Africa\",\"created_at\":\"2025-02-03T16:02:20.957Z\",\"updated_at\":\"2025-10-13T21:19:47.221Z\"},{\"id\":2,\"name\":\"Asia\",\"created_at\":\"2025-10-13T21:19:53.908Z\",\"updated_at\":\"2025-10-13T21:19:53.908Z\"}]}]"
Second file, if parsed, looks like this:
[{"name" => "Provided by the government",
"prefix" => "pref",
"regions" =>
[{"id" => 1, "name" => "Africa", "created_at" => "2025-02-03T16:02:20.957Z", "updated_at" => "2025-10-13T21:19:47.221Z"},
{"id" => 2, "name" => "Asia", "created_at" => "2025-10-13T21:19:53.908Z", "updated_at" => "2025-10-13T21:19:53.908Z"}]}]
dmitrytrager
commented
Nov 17, 2025
| provider_region_data: | ||
| command: ProviderRegionDataBuilder.new.perform | ||
| queue: default | ||
| schedule: "@daily" |
Collaborator
There was a problem hiding this comment.
This shouldn't change very often. Daily should be fine.
3b0acc4 to
909db49
Compare
909db49 to
c209c96
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Issue Does This PR Cover, If Any?
Addresses first bullet from #444
What Changed? And Why Did It Change?
Added new json generator along with job and other classes to deliver provider regions data to Azure
How Has This Been Tested?
Added rspec tests for generator and job
Please Provide Screenshots
Additional Comments