const String CategoryTableName = 'goods_category';
const String CategoryColumnId = 'id';
const String CategoryColumnParentIn = 'parent_id';
const String CategoryColumnName = 'name';
const String CategoryColumnAppCompanyId = 'app_company_id';
const String CategoryColumnUpdatedAt = 'updated_at';

class Category {
  int? id;
  int? parentId;
  String? name;
  int? appCompanyId;
  String? updatedAt;

  Map<String, dynamic> toMap() {
    var map = <String, dynamic>{
      CategoryColumnParentIn: parentId,
      CategoryColumnName: name,
      CategoryColumnAppCompanyId: appCompanyId,
      CategoryColumnUpdatedAt: updatedAt,
    };
    if (id != null) {
      map[CategoryColumnId] = id;
    }
    return map;
  }

  Category();

  Category.fromMap(Map<String, dynamic> map) {
    id = map[CategoryColumnId];
    parentId = map[CategoryColumnParentIn];
    name = map[CategoryColumnName];
    appCompanyId = map[CategoryColumnAppCompanyId];
    updatedAt =  map[CategoryColumnUpdatedAt];
  }
}

