Add one additional seller.

fixes #24
This commit is contained in:
Martin Brodbeck 2022-09-24 20:41:15 +02:00
parent 01577d02a0
commit 3a132e69ae
2 changed files with 14 additions and 3 deletions

View file

@ -32,10 +32,8 @@ std::size_t CsvReader::readSellersFromFile(const fs::path &filePath, Marketplace
market->storeToDb(true);
int rowCount{};
for (csv::CSVRow &row : csvReader) {
if (!row[0].is_int()) {
++rowCount;
continue;
}
@ -60,9 +58,15 @@ std::size_t CsvReader::readSellersFromFile(const fs::path &filePath, Marketplace
}
market->getSellers().push_back(std::move(seller));
rowCount++;
}
// Add one additional seller "RESERVE RESERVE"
auto seller = std::make_unique<Seller>();
seller->setSellerNo(market->getNextSellerNo());
seller->setFirstName("RESERVE");
seller->setLastName("RESERVE");
market->getSellers().push_back(std::move(seller));
// If there was no special seller "Sonderkonto" in import data, then create one
auto specialSeller = market->findSellerWithSellerNo(0);
if (!specialSeller) {

View file

@ -47,6 +47,13 @@ std::size_t ExcelReader::readSellersFromFile(const fs::path &filePath, Marketpla
market->getSellers().push_back(std::move(seller));
}
// Add one additional seller "RESERVE RESERVE"
auto seller = std::make_unique<Seller>();
seller->setSellerNo(market->getNextSellerNo());
seller->setFirstName("RESERVE");
seller->setLastName("RESERVE");
market->getSellers().push_back(std::move(seller));
// If there was no special seller "Sonderkonto" in import data, then create one
auto specialSeller = market->findSellerWithSellerNo(0);
if (!specialSeller) {