[V2] Add normalised location to Company
resource
#51
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.
This pull request introduces significant changes to the
Company
model and its associated frontend and backend components to include geographical information. The most important changes include adding new models forCity
,Region
,Country
, andContinent
, updating theCompany
model and serializer to include these new relationships, and modifying the frontend to display this information.Backend Changes:
Models and Associations:
City
,Region
,Country
, andContinent
with appropriate associations and validations. (app/models/city.rb
,app/models/region.rb
,app/models/country.rb
,app/models/continent.rb
) [1] [2] [3] [4]Company
model to include associations withCity
,Region
,Country
, andContinent
. (app/models/company.rb
)Serializers:
CompanySerializer
to include address and geographical information. (app/serializers/company_serializer.rb
)GeoFragmentSerializer
for serializing geographical fragments. (app/serializers/geo_fragment_serializer.rb
)Database Migrations:
db/migrate/20240823144658_create_continents.rb
,db/migrate/20240823144705_create_countries.rb
,db/migrate/20240823144711_create_regions.rb
,db/migrate/20240823144715_create_cities.rb
,db/migrate/20240823144728_add_city_to_companies.rb
,db/schema.rb
) [1] [2] [3] [4] [5] [6] [7] [8]Frontend Changes:
Company
interface to include address and geographical information. (app/frontend/types/company.ts
) [1] [2]Show
component to display the company's address and geographical information. (app/frontend/pages/companies/show.tsx
) [1] [2]Index
component. (app/frontend/pages/companies/index.tsx
)Controller Changes:
CompaniesController
to use a newcompany_scope
method for including geographical associations. (app/controllers/companies_controller.rb
)