Nachschlagen: Lagerort-QR zeigt alle Artikel an diesem Ort
Neuer Endpunkt GET /location/{code} liefert alle Artikel an einem Lagerort inkl. der Unterorte (Lot-Bestaende und Einzelstuecke), sortiert nach Name mit Menge in Artikeleinheiten. In der App loest der /l/-QR beim Nachschlagen jetzt diese Liste auf; ein Tipp auf einen Eintrag oeffnet den Artikel.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -405,6 +405,39 @@ struct LocationNeeds: Codable, Identifiable {
|
||||
}
|
||||
}
|
||||
|
||||
/// Ein Artikel mit seinem Bestand an einem Lagerort (in Artikeleinheiten).
|
||||
struct LocationContentEntry: Codable, Identifiable, Hashable {
|
||||
let productId: Int
|
||||
let name: String
|
||||
let brand: String?
|
||||
let stock: Double
|
||||
let unitLabel: String
|
||||
let individual: Bool
|
||||
|
||||
var id: Int { productId }
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case name, brand, stock, individual
|
||||
case productId = "product_id"
|
||||
case unitLabel = "unit_label"
|
||||
}
|
||||
}
|
||||
|
||||
/// Alles, was an einem gescannten Lagerort liegt – inklusive der Unterorte.
|
||||
struct LocationContents: Codable, Identifiable {
|
||||
let locationId: String
|
||||
let locationName: String
|
||||
let products: [LocationContentEntry]
|
||||
|
||||
var id: String { locationId }
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case products
|
||||
case locationId = "location_id"
|
||||
case locationName = "location_name"
|
||||
}
|
||||
}
|
||||
|
||||
struct ExpiringItem: Codable, Identifiable {
|
||||
let lotId: Int
|
||||
let productId: Int
|
||||
|
||||
Reference in New Issue
Block a user