mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-06-01 01:54:00 +00:00
Split data models into dedicated headers
This commit is contained in:
@@ -26,6 +26,19 @@ package "Composition root" {
|
||||
}
|
||||
|
||||
package "Core orchestration" {
|
||||
class BiergartenDataGenerator {
|
||||
-context_service_: std::shared_ptr<IEnrichmentService>
|
||||
-generator_: std::unique_ptr<DataGenerator>
|
||||
-generated_breweries_: std::vector<GeneratedBrewery>
|
||||
+BiergartenDataGenerator(context_service: std::shared_ptr<IEnrichmentService>, generator: std::unique_ptr<DataGenerator>)
|
||||
+Run(): bool
|
||||
-QueryCitiesWithCountries(): std::vector<Location>
|
||||
-GenerateBreweries(cities: std::vector<EnrichedCity>): void
|
||||
-LogResults(): void
|
||||
}
|
||||
}
|
||||
|
||||
package "Data models" {
|
||||
class ApplicationOptions <<struct>> {
|
||||
+model_path: std::string
|
||||
+use_mocked: bool
|
||||
@@ -36,29 +49,20 @@ package "Core orchestration" {
|
||||
+seed: int
|
||||
}
|
||||
|
||||
class BiergartenDataGenerator {
|
||||
-context_service_: std::shared_ptr<IEnrichmentService>
|
||||
-generator_: std::unique_ptr<DataGenerator>
|
||||
+BiergartenDataGenerator(context_service: std::shared_ptr<IEnrichmentService>, generator: std::unique_ptr<DataGenerator>)
|
||||
+Run(): bool
|
||||
-QueryCitiesWithCountries(): std::vector<Location>
|
||||
-GenerateBreweries(cities: std::vector<EnrichedCity>): void
|
||||
-LogResults(): void
|
||||
}
|
||||
|
||||
class EnrichedCity <<struct>> {
|
||||
+location: Location
|
||||
+region_context: std::string
|
||||
}
|
||||
}
|
||||
|
||||
package "Shared models" {
|
||||
class BreweryLocation <<struct>> {
|
||||
+city_name: std::string_view
|
||||
+country_name: std::string_view
|
||||
}
|
||||
|
||||
class Location
|
||||
class Location <<struct>> {
|
||||
+city: std::string
|
||||
+state_province: std::string
|
||||
+iso3166_2: std::string
|
||||
+country: std::string
|
||||
+iso3166_1: std::string
|
||||
+latitude: double
|
||||
+longitude: double
|
||||
}
|
||||
|
||||
class BreweryResult <<struct>> {
|
||||
+name: std::string
|
||||
@@ -69,6 +73,16 @@ package "Shared models" {
|
||||
+username: std::string
|
||||
+bio: std::string
|
||||
}
|
||||
|
||||
class EnrichedCity <<struct>> {
|
||||
+location: Location
|
||||
+region_context: std::string
|
||||
}
|
||||
|
||||
class GeneratedBrewery <<struct>> {
|
||||
+location: Location
|
||||
+brewery: BreweryResult
|
||||
}
|
||||
}
|
||||
|
||||
package "Generation" {
|
||||
@@ -105,6 +119,12 @@ package "HTTP" {
|
||||
}
|
||||
}
|
||||
|
||||
package "JSON handling" {
|
||||
class JsonLoader {
|
||||
{static} +LoadLocations(filepath: std::string): std::vector<Location>
|
||||
}
|
||||
}
|
||||
|
||||
package "Wikipedia" {
|
||||
interface IEnrichmentService {
|
||||
+GetLocationContext(loc: Location): std::string
|
||||
@@ -114,10 +134,6 @@ package "Wikipedia" {
|
||||
+WikipediaService(client: std::shared_ptr<WebClient>)
|
||||
+GetLocationContext(loc: Location): std::string
|
||||
}
|
||||
|
||||
class JsonLoader {
|
||||
{static} +LoadLocations(filepath: std::string): std::vector<Location>
|
||||
}
|
||||
}
|
||||
|
||||
Main --> CurlGlobalState
|
||||
@@ -128,6 +144,7 @@ Main ..> DataGenerator : DI factory
|
||||
Main ..> CURLWebClient : DI binding
|
||||
|
||||
BiergartenDataGenerator *-- EnrichedCity
|
||||
BiergartenDataGenerator *-- GeneratedBrewery
|
||||
BiergartenDataGenerator ..> JsonLoader : LoadLocations()
|
||||
BiergartenDataGenerator --> IEnrichmentService : context lookup
|
||||
BiergartenDataGenerator --> DataGenerator : brewery generation
|
||||
|
||||
Reference in New Issue
Block a user