import 'package:satu/core/utils/utils_parse.dart'; const String goodTableName = 'goods'; const String GoodColumnId = 'id'; const String GoodColumnCategoryId = 'category_id'; const String GoodColumnName = 'name'; const String GoodColumnEan = 'ean'; const String GoodColumnArticul = 'articul'; const String GoodColumnPrice = 'price'; const String GoodColumnOptPrice = 'opt_price'; const String GoodColumnBasePrice = 'base_price'; const String GoodColumnDivisible = 'divisible'; const String GoodColumnUpdatedAt = 'updated_at'; const String GoodColumnAppCompanyId = 'app_company_id'; class Good { Good(); Good.fromMap(Map map) { id = map[GoodColumnId] as int; articul = map[GoodColumnArticul] as int; name = (map[GoodColumnName] ?? '') as String ; price = map[GoodColumnPrice] as num; categoryId = map[GoodColumnCategoryId] as int; ean = map[GoodColumnEan] as String; appCompanyId = map[GoodColumnAppCompanyId] as int; optPrice = map[GoodColumnOptPrice] as num; basePrice = cast(map[GoodColumnBasePrice]); divisible = map[GoodColumnDivisible] as int; updatedAt = map[GoodColumnUpdatedAt] as String; } int? id; int? categoryId; String name = ''; String? ean; int? articul; num? price; num? optPrice; num? basePrice; int? divisible; String? updatedAt; int? appCompanyId; Map toMap() { final Map map = { GoodColumnArticul: articul, GoodColumnName: name, GoodColumnPrice: price, GoodColumnCategoryId: categoryId, GoodColumnEan: ean, GoodColumnAppCompanyId: appCompanyId, GoodColumnOptPrice: optPrice, GoodColumnBasePrice: basePrice, GoodColumnDivisible: divisible, GoodColumnUpdatedAt: updatedAt, }; if (id != null) { map[GoodColumnId] = id; } return map; } }