mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-10-14 17:54:42 +00:00
Update generate pipeline to add OpenAI api as an additional backend (for comparison testing), add brewery coordinates (#244)
* add brewery coordinates * Add openai mode * Add coordinates to schema * Fix C++ review findings in pipeline: k-prefixed enum values, include ordering, populated validation error messages, conventional const notation, and endl replaced with newline
This commit is contained in:
@@ -22,6 +22,6 @@
|
||||
<ProjectReference Include="..\..\Features\Features.Locations\Features.Locations.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None CopyToOutputDirectory="PreserveNewest" Include="SeedData\biergarten_seed_2026-07-20T05-46-02.993511Z.sqlite" />
|
||||
<None CopyToOutputDirectory="PreserveNewest" Include="SeedData\open-ai-test2.sqlite" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -12,6 +12,6 @@ public class ConnectionStrings
|
||||
public static string GetSqlServerConnectionString(IConfiguration configuration) =>
|
||||
SqlConnectionStringHelper.BuildConnectionString(configuration);
|
||||
|
||||
public static string SqliteConnectionString =>
|
||||
"Data Source=SeedData/biergarten_seed_2026-07-20T05-46-02.993511Z.sqlite";
|
||||
public static string SqliteConnectionString => "Data Source=SeedData/open-ai-test2.sqlite";
|
||||
// "Data Source=SeedData/biergarten_seed_2026-07-20T05-46-02.993511Z.sqlite";
|
||||
}
|
||||
|
||||
@@ -5,4 +5,8 @@ public sealed record BreweryAddress
|
||||
public required City City { get; init; }
|
||||
|
||||
public required string PostalCode { get; init; }
|
||||
|
||||
public required double Longitude { get; init; }
|
||||
|
||||
public required double Latitude { get; init; }
|
||||
}
|
||||
|
||||
BIN
web/backend/Database/Database.Seed/SeedData/open-ai-test.sqlite
Normal file
BIN
web/backend/Database/Database.Seed/SeedData/open-ai-test.sqlite
Normal file
Binary file not shown.
BIN
web/backend/Database/Database.Seed/SeedData/open-ai-test2.sqlite
Normal file
BIN
web/backend/Database/Database.Seed/SeedData/open-ai-test2.sqlite
Normal file
Binary file not shown.
@@ -54,7 +54,7 @@ public sealed class PipelineSeedDataReader
|
||||
{
|
||||
const string sql = """
|
||||
SELECT b.name_en, b.description_en, b.name_local, b.description_local,
|
||||
ba.city_id, ba.postal_code
|
||||
ba.city_id, ba.postal_code, ba.longitude, ba.latitude
|
||||
FROM breweries b
|
||||
JOIN brewery_addresses ba ON ba.brewery_id = b.id;
|
||||
""";
|
||||
@@ -68,6 +68,8 @@ public sealed class PipelineSeedDataReader
|
||||
const int descriptionLocalIndex = 3;
|
||||
const int cityIdIndex = 4;
|
||||
const int postalCodeIndex = 5;
|
||||
const int longitudeIndex = 6;
|
||||
const int latitudeIndex = 7;
|
||||
|
||||
List<BreweryRecord> records = [];
|
||||
while (await reader.ReadAsync(cancellationToken))
|
||||
@@ -85,6 +87,8 @@ public sealed class PipelineSeedDataReader
|
||||
{
|
||||
City = cities[reader.GetInt64(cityIdIndex)],
|
||||
PostalCode = reader.GetString(postalCodeIndex),
|
||||
Longitude = reader.GetDouble(longitudeIndex),
|
||||
Latitude = reader.GetDouble(latitudeIndex),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user