mirror of
https://github.com/bleackstorm/satiea.git
synced 2026-12-03 07:41:56 +01:00
feat(planning): add burst barcode scanner with Open Food Facts lookup
This commit is contained in:
1 parent
381fe9ab72
commit
7c5dab5477
10 files changed
+1614
-9
No files matched your search
@@ -226,6 +226,29 @@ data class ScannedReceiptItem(
|
||||
val selected: Boolean = true
|
||||
)
|
||||
|
||||
data class ScannedBarcodeItem(
|
||||
val id: String = "bc_${UUID.randomUUID().toString().take(8)}",
|
||||
val barcode: String,
|
||||
val name: String,
|
||||
val brand: String? = null,
|
||||
val unitQuantity: Double = 1.0,
|
||||
val packCount: Int = 1,
|
||||
val unit: FoodUnit = FoodUnit.PORTION,
|
||||
val category: FoodCategory = FoodCategory.OTHER,
|
||||
val location: StorageLocation = StorageLocation.PANTRY,
|
||||
val expirationDateEpochDay: Long? = null,
|
||||
val imageUrl: String? = null,
|
||||
val isFoundInCatalog: Boolean = true,
|
||||
val isLoading: Boolean = false
|
||||
) {
|
||||
val totalQuantity: Double
|
||||
get() = unitQuantity * packCount.coerceAtLeast(1)
|
||||
|
||||
fun formatTotalQuantity(): String = IngredientMatcher.formatQuantity(totalQuantity, unit)
|
||||
|
||||
fun formatPackageQuantity(): String = IngredientMatcher.formatQuantity(unitQuantity, unit)
|
||||
}
|
||||
|
||||
data class StockDeductionProposal(
|
||||
val inventoryItem: InventoryItem,
|
||||
val deductAmount: Double,
|
||||
|
||||
Reference in new issue
Block a user