mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-07-16 17:47:22 +00:00
Add user and brewery address tables
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
* enriched data, and complete generation results.
|
||||
*/
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
#include "data_model/models.h"
|
||||
@@ -92,22 +93,40 @@ struct EnrichedCity {
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief A brewery's street-level address, distinct from the shared `City`
|
||||
* it belongs to. Mirrors the backend's `BreweryPostLocation` shape.
|
||||
* @brief A brewery's address. Owns the `City` it belongs to alongside its
|
||||
* street-level fields. Mirrors the `brewery_addresses` table and the
|
||||
* backend's `BreweryPostLocation` shape.
|
||||
*
|
||||
* Only `postal_code` is populated today -- street-address generation has no
|
||||
* fixture data or service yet.
|
||||
* Only `city` and `postal_code` are populated today -- street-address
|
||||
* generation has no fixture data or service yet, so the address lines stay
|
||||
* empty.
|
||||
*/
|
||||
struct Address {
|
||||
struct BreweryAddress {
|
||||
City city{};
|
||||
std::optional<std::string> address_line_1{};
|
||||
std::optional<std::string> address_line_2{};
|
||||
std::string postal_code{};
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief A user's address. Owns the `City` it belongs to alongside its
|
||||
* street-level fields. Mirrors the `user_addresses` table.
|
||||
*
|
||||
* Only `city` is populated today; the street-level columns exist for future
|
||||
* enrichment.
|
||||
*/
|
||||
struct UserAddress {
|
||||
City city{};
|
||||
std::optional<std::string> address_line_1{};
|
||||
std::optional<std::string> address_line_2{};
|
||||
std::optional<std::string> postal_code{};
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Helper struct to store generated brewery data.
|
||||
*/
|
||||
struct BreweryRecord {
|
||||
City location;
|
||||
Address address;
|
||||
BreweryAddress address;
|
||||
BreweryResult brewery;
|
||||
};
|
||||
|
||||
@@ -119,7 +138,7 @@ struct BreweryRecord {
|
||||
* consumer can register real accounts from the pipeline's SQLite export.
|
||||
*/
|
||||
struct UserRecord {
|
||||
City location;
|
||||
UserAddress address{};
|
||||
UserResult user;
|
||||
std::string email{};
|
||||
std::string date_of_birth{};
|
||||
|
||||
@@ -60,16 +60,6 @@ struct City {
|
||||
* @brief Local language codes in priority order.
|
||||
*/
|
||||
std::vector<std::string> local_languages{};
|
||||
|
||||
/**
|
||||
* @brief Latitude in decimal degrees.
|
||||
*/
|
||||
double latitude{};
|
||||
|
||||
/**
|
||||
* @brief Longitude in decimal degrees.
|
||||
*/
|
||||
double longitude{};
|
||||
};
|
||||
|
||||
// ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user