Skip to content

Conversation

@dmitrytrager
Copy link
Collaborator

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

@dmitrytrager dmitrytrager force-pushed the provider-data-json-444 branch from a00e354 to 3b0acc4 Compare November 11, 2025 20:21
def provider_region_data(language)
FileToUpload.new(
content: JsonGenerator::ProviderRegions.new(language).perform,
name: "#{language.file_storage_prefix}provider_region_data.json",
Copy link
Collaborator Author

@dmitrytrager dmitrytrager Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filename TBD

Copy link
Collaborator

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.

Copy link
Collaborator Author

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 } }
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Field names TBD

Copy link
Collaborator

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?

Copy link
Collaborator Author

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?

Copy link
Collaborator Author

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"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Schedule TBD

Copy link
Collaborator

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.

@dmitrytrager dmitrytrager marked this pull request as ready for review November 17, 2025 22:38
@dmitrytrager dmitrytrager force-pushed the provider-data-json-444 branch from 3b0acc4 to 909db49 Compare November 17, 2025 22:38
@dmitrytrager dmitrytrager force-pushed the provider-data-json-444 branch from 909db49 to c209c96 Compare November 20, 2025 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants