-
Notifications
You must be signed in to change notification settings - Fork 6
Add builder, job and generator for json data with provider regions #444 #479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
a00e354 to
3b0acc4
Compare
| def provider_region_data(language) | ||
| FileToUpload.new( | ||
| content: JsonGenerator::ProviderRegions.new(language).perform, | ||
| name: "#{language.file_storage_prefix}provider_region_data.json", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filename TBD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They'll get back to us on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, will wait
|
|
||
| def json_content | ||
| scope | ||
| .map { |provider| { name: provider.name, prefix: provider.file_name_prefix, regions: provider.regions } } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Field names TBD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we get a sample file to send them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like locally generated, for example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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"}]}]
| provider_region_data: | ||
| command: ProviderRegionDataBuilder.new.perform | ||
| queue: default | ||
| schedule: "@daily" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Schedule TBD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't change very often. Daily should be fine.
3b0acc4 to
909db49
Compare
909db49 to
c209c96
Compare
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