3695 lines
115 KiB
Dart
3695 lines
115 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'app_database.dart';
|
|
|
|
// ignore_for_file: type=lint
|
|
class $ProductsTable extends Products
|
|
with TableInfo<$ProductsTable, ProductRow> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$ProductsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _nameMeta = const VerificationMeta('name');
|
|
@override
|
|
late final GeneratedColumn<String> name = GeneratedColumn<String>(
|
|
'name',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _categoryMeta = const VerificationMeta(
|
|
'category',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> category = GeneratedColumn<String>(
|
|
'category',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _stockQuantityMeta = const VerificationMeta(
|
|
'stockQuantity',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> stockQuantity = GeneratedColumn<int>(
|
|
'stock_quantity',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _lowStockThresholdMeta = const VerificationMeta(
|
|
'lowStockThreshold',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> lowStockThreshold = GeneratedColumn<int>(
|
|
'low_stock_threshold',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _priceInCentsMeta = const VerificationMeta(
|
|
'priceInCents',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> priceInCents = GeneratedColumn<int>(
|
|
'price_in_cents',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _imagePathMeta = const VerificationMeta(
|
|
'imagePath',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> imagePath = GeneratedColumn<String>(
|
|
'image_path',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _activeMeta = const VerificationMeta('active');
|
|
@override
|
|
late final GeneratedColumn<bool> active = GeneratedColumn<bool>(
|
|
'active',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("active" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(true),
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
name,
|
|
category,
|
|
stockQuantity,
|
|
lowStockThreshold,
|
|
priceInCents,
|
|
imagePath,
|
|
active,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'products';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<ProductRow> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('name')) {
|
|
context.handle(
|
|
_nameMeta,
|
|
name.isAcceptableOrUnknown(data['name']!, _nameMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_nameMeta);
|
|
}
|
|
if (data.containsKey('category')) {
|
|
context.handle(
|
|
_categoryMeta,
|
|
category.isAcceptableOrUnknown(data['category']!, _categoryMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_categoryMeta);
|
|
}
|
|
if (data.containsKey('stock_quantity')) {
|
|
context.handle(
|
|
_stockQuantityMeta,
|
|
stockQuantity.isAcceptableOrUnknown(
|
|
data['stock_quantity']!,
|
|
_stockQuantityMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_stockQuantityMeta);
|
|
}
|
|
if (data.containsKey('low_stock_threshold')) {
|
|
context.handle(
|
|
_lowStockThresholdMeta,
|
|
lowStockThreshold.isAcceptableOrUnknown(
|
|
data['low_stock_threshold']!,
|
|
_lowStockThresholdMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_lowStockThresholdMeta);
|
|
}
|
|
if (data.containsKey('price_in_cents')) {
|
|
context.handle(
|
|
_priceInCentsMeta,
|
|
priceInCents.isAcceptableOrUnknown(
|
|
data['price_in_cents']!,
|
|
_priceInCentsMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_priceInCentsMeta);
|
|
}
|
|
if (data.containsKey('image_path')) {
|
|
context.handle(
|
|
_imagePathMeta,
|
|
imagePath.isAcceptableOrUnknown(data['image_path']!, _imagePathMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('active')) {
|
|
context.handle(
|
|
_activeMeta,
|
|
active.isAcceptableOrUnknown(data['active']!, _activeMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
ProductRow map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return ProductRow(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
name: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}name'],
|
|
)!,
|
|
category: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}category'],
|
|
)!,
|
|
stockQuantity: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}stock_quantity'],
|
|
)!,
|
|
lowStockThreshold: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}low_stock_threshold'],
|
|
)!,
|
|
priceInCents: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}price_in_cents'],
|
|
)!,
|
|
imagePath: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}image_path'],
|
|
),
|
|
active: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}active'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$ProductsTable createAlias(String alias) {
|
|
return $ProductsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class ProductRow extends DataClass implements Insertable<ProductRow> {
|
|
final String id;
|
|
final String name;
|
|
final String category;
|
|
final int stockQuantity;
|
|
final int lowStockThreshold;
|
|
final int priceInCents;
|
|
final String? imagePath;
|
|
final bool active;
|
|
const ProductRow({
|
|
required this.id,
|
|
required this.name,
|
|
required this.category,
|
|
required this.stockQuantity,
|
|
required this.lowStockThreshold,
|
|
required this.priceInCents,
|
|
this.imagePath,
|
|
required this.active,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['name'] = Variable<String>(name);
|
|
map['category'] = Variable<String>(category);
|
|
map['stock_quantity'] = Variable<int>(stockQuantity);
|
|
map['low_stock_threshold'] = Variable<int>(lowStockThreshold);
|
|
map['price_in_cents'] = Variable<int>(priceInCents);
|
|
if (!nullToAbsent || imagePath != null) {
|
|
map['image_path'] = Variable<String>(imagePath);
|
|
}
|
|
map['active'] = Variable<bool>(active);
|
|
return map;
|
|
}
|
|
|
|
ProductsCompanion toCompanion(bool nullToAbsent) {
|
|
return ProductsCompanion(
|
|
id: Value(id),
|
|
name: Value(name),
|
|
category: Value(category),
|
|
stockQuantity: Value(stockQuantity),
|
|
lowStockThreshold: Value(lowStockThreshold),
|
|
priceInCents: Value(priceInCents),
|
|
imagePath: imagePath == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(imagePath),
|
|
active: Value(active),
|
|
);
|
|
}
|
|
|
|
factory ProductRow.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return ProductRow(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
name: serializer.fromJson<String>(json['name']),
|
|
category: serializer.fromJson<String>(json['category']),
|
|
stockQuantity: serializer.fromJson<int>(json['stockQuantity']),
|
|
lowStockThreshold: serializer.fromJson<int>(json['lowStockThreshold']),
|
|
priceInCents: serializer.fromJson<int>(json['priceInCents']),
|
|
imagePath: serializer.fromJson<String?>(json['imagePath']),
|
|
active: serializer.fromJson<bool>(json['active']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'name': serializer.toJson<String>(name),
|
|
'category': serializer.toJson<String>(category),
|
|
'stockQuantity': serializer.toJson<int>(stockQuantity),
|
|
'lowStockThreshold': serializer.toJson<int>(lowStockThreshold),
|
|
'priceInCents': serializer.toJson<int>(priceInCents),
|
|
'imagePath': serializer.toJson<String?>(imagePath),
|
|
'active': serializer.toJson<bool>(active),
|
|
};
|
|
}
|
|
|
|
ProductRow copyWith({
|
|
String? id,
|
|
String? name,
|
|
String? category,
|
|
int? stockQuantity,
|
|
int? lowStockThreshold,
|
|
int? priceInCents,
|
|
Value<String?> imagePath = const Value.absent(),
|
|
bool? active,
|
|
}) => ProductRow(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
category: category ?? this.category,
|
|
stockQuantity: stockQuantity ?? this.stockQuantity,
|
|
lowStockThreshold: lowStockThreshold ?? this.lowStockThreshold,
|
|
priceInCents: priceInCents ?? this.priceInCents,
|
|
imagePath: imagePath.present ? imagePath.value : this.imagePath,
|
|
active: active ?? this.active,
|
|
);
|
|
ProductRow copyWithCompanion(ProductsCompanion data) {
|
|
return ProductRow(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
name: data.name.present ? data.name.value : this.name,
|
|
category: data.category.present ? data.category.value : this.category,
|
|
stockQuantity: data.stockQuantity.present
|
|
? data.stockQuantity.value
|
|
: this.stockQuantity,
|
|
lowStockThreshold: data.lowStockThreshold.present
|
|
? data.lowStockThreshold.value
|
|
: this.lowStockThreshold,
|
|
priceInCents: data.priceInCents.present
|
|
? data.priceInCents.value
|
|
: this.priceInCents,
|
|
imagePath: data.imagePath.present ? data.imagePath.value : this.imagePath,
|
|
active: data.active.present ? data.active.value : this.active,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ProductRow(')
|
|
..write('id: $id, ')
|
|
..write('name: $name, ')
|
|
..write('category: $category, ')
|
|
..write('stockQuantity: $stockQuantity, ')
|
|
..write('lowStockThreshold: $lowStockThreshold, ')
|
|
..write('priceInCents: $priceInCents, ')
|
|
..write('imagePath: $imagePath, ')
|
|
..write('active: $active')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
name,
|
|
category,
|
|
stockQuantity,
|
|
lowStockThreshold,
|
|
priceInCents,
|
|
imagePath,
|
|
active,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is ProductRow &&
|
|
other.id == this.id &&
|
|
other.name == this.name &&
|
|
other.category == this.category &&
|
|
other.stockQuantity == this.stockQuantity &&
|
|
other.lowStockThreshold == this.lowStockThreshold &&
|
|
other.priceInCents == this.priceInCents &&
|
|
other.imagePath == this.imagePath &&
|
|
other.active == this.active);
|
|
}
|
|
|
|
class ProductsCompanion extends UpdateCompanion<ProductRow> {
|
|
final Value<String> id;
|
|
final Value<String> name;
|
|
final Value<String> category;
|
|
final Value<int> stockQuantity;
|
|
final Value<int> lowStockThreshold;
|
|
final Value<int> priceInCents;
|
|
final Value<String?> imagePath;
|
|
final Value<bool> active;
|
|
final Value<int> rowid;
|
|
const ProductsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.name = const Value.absent(),
|
|
this.category = const Value.absent(),
|
|
this.stockQuantity = const Value.absent(),
|
|
this.lowStockThreshold = const Value.absent(),
|
|
this.priceInCents = const Value.absent(),
|
|
this.imagePath = const Value.absent(),
|
|
this.active = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
ProductsCompanion.insert({
|
|
required String id,
|
|
required String name,
|
|
required String category,
|
|
required int stockQuantity,
|
|
required int lowStockThreshold,
|
|
required int priceInCents,
|
|
this.imagePath = const Value.absent(),
|
|
this.active = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
name = Value(name),
|
|
category = Value(category),
|
|
stockQuantity = Value(stockQuantity),
|
|
lowStockThreshold = Value(lowStockThreshold),
|
|
priceInCents = Value(priceInCents);
|
|
static Insertable<ProductRow> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? name,
|
|
Expression<String>? category,
|
|
Expression<int>? stockQuantity,
|
|
Expression<int>? lowStockThreshold,
|
|
Expression<int>? priceInCents,
|
|
Expression<String>? imagePath,
|
|
Expression<bool>? active,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (name != null) 'name': name,
|
|
if (category != null) 'category': category,
|
|
if (stockQuantity != null) 'stock_quantity': stockQuantity,
|
|
if (lowStockThreshold != null) 'low_stock_threshold': lowStockThreshold,
|
|
if (priceInCents != null) 'price_in_cents': priceInCents,
|
|
if (imagePath != null) 'image_path': imagePath,
|
|
if (active != null) 'active': active,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
ProductsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? name,
|
|
Value<String>? category,
|
|
Value<int>? stockQuantity,
|
|
Value<int>? lowStockThreshold,
|
|
Value<int>? priceInCents,
|
|
Value<String?>? imagePath,
|
|
Value<bool>? active,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return ProductsCompanion(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
category: category ?? this.category,
|
|
stockQuantity: stockQuantity ?? this.stockQuantity,
|
|
lowStockThreshold: lowStockThreshold ?? this.lowStockThreshold,
|
|
priceInCents: priceInCents ?? this.priceInCents,
|
|
imagePath: imagePath ?? this.imagePath,
|
|
active: active ?? this.active,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (name.present) {
|
|
map['name'] = Variable<String>(name.value);
|
|
}
|
|
if (category.present) {
|
|
map['category'] = Variable<String>(category.value);
|
|
}
|
|
if (stockQuantity.present) {
|
|
map['stock_quantity'] = Variable<int>(stockQuantity.value);
|
|
}
|
|
if (lowStockThreshold.present) {
|
|
map['low_stock_threshold'] = Variable<int>(lowStockThreshold.value);
|
|
}
|
|
if (priceInCents.present) {
|
|
map['price_in_cents'] = Variable<int>(priceInCents.value);
|
|
}
|
|
if (imagePath.present) {
|
|
map['image_path'] = Variable<String>(imagePath.value);
|
|
}
|
|
if (active.present) {
|
|
map['active'] = Variable<bool>(active.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ProductsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('name: $name, ')
|
|
..write('category: $category, ')
|
|
..write('stockQuantity: $stockQuantity, ')
|
|
..write('lowStockThreshold: $lowStockThreshold, ')
|
|
..write('priceInCents: $priceInCents, ')
|
|
..write('imagePath: $imagePath, ')
|
|
..write('active: $active, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $BarTabsTable extends BarTabs with TableInfo<$BarTabsTable, BarTabRow> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$BarTabsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _customerNameMeta = const VerificationMeta(
|
|
'customerName',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> customerName = GeneratedColumn<String>(
|
|
'customer_name',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _statusMeta = const VerificationMeta('status');
|
|
@override
|
|
late final GeneratedColumn<String> status = GeneratedColumn<String>(
|
|
'status',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant('open'),
|
|
);
|
|
static const VerificationMeta _openedAtMeta = const VerificationMeta(
|
|
'openedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> openedAt = GeneratedColumn<DateTime>(
|
|
'opened_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _closedAtMeta = const VerificationMeta(
|
|
'closedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> closedAt = GeneratedColumn<DateTime>(
|
|
'closed_at',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
customerName,
|
|
status,
|
|
openedAt,
|
|
closedAt,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'bar_tabs';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<BarTabRow> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('customer_name')) {
|
|
context.handle(
|
|
_customerNameMeta,
|
|
customerName.isAcceptableOrUnknown(
|
|
data['customer_name']!,
|
|
_customerNameMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_customerNameMeta);
|
|
}
|
|
if (data.containsKey('status')) {
|
|
context.handle(
|
|
_statusMeta,
|
|
status.isAcceptableOrUnknown(data['status']!, _statusMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('opened_at')) {
|
|
context.handle(
|
|
_openedAtMeta,
|
|
openedAt.isAcceptableOrUnknown(data['opened_at']!, _openedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_openedAtMeta);
|
|
}
|
|
if (data.containsKey('closed_at')) {
|
|
context.handle(
|
|
_closedAtMeta,
|
|
closedAt.isAcceptableOrUnknown(data['closed_at']!, _closedAtMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
BarTabRow map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return BarTabRow(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
customerName: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}customer_name'],
|
|
)!,
|
|
status: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}status'],
|
|
)!,
|
|
openedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}opened_at'],
|
|
)!,
|
|
closedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}closed_at'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$BarTabsTable createAlias(String alias) {
|
|
return $BarTabsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class BarTabRow extends DataClass implements Insertable<BarTabRow> {
|
|
final String id;
|
|
final String customerName;
|
|
final String status;
|
|
final DateTime openedAt;
|
|
final DateTime? closedAt;
|
|
const BarTabRow({
|
|
required this.id,
|
|
required this.customerName,
|
|
required this.status,
|
|
required this.openedAt,
|
|
this.closedAt,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['customer_name'] = Variable<String>(customerName);
|
|
map['status'] = Variable<String>(status);
|
|
map['opened_at'] = Variable<DateTime>(openedAt);
|
|
if (!nullToAbsent || closedAt != null) {
|
|
map['closed_at'] = Variable<DateTime>(closedAt);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
BarTabsCompanion toCompanion(bool nullToAbsent) {
|
|
return BarTabsCompanion(
|
|
id: Value(id),
|
|
customerName: Value(customerName),
|
|
status: Value(status),
|
|
openedAt: Value(openedAt),
|
|
closedAt: closedAt == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(closedAt),
|
|
);
|
|
}
|
|
|
|
factory BarTabRow.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return BarTabRow(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
customerName: serializer.fromJson<String>(json['customerName']),
|
|
status: serializer.fromJson<String>(json['status']),
|
|
openedAt: serializer.fromJson<DateTime>(json['openedAt']),
|
|
closedAt: serializer.fromJson<DateTime?>(json['closedAt']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'customerName': serializer.toJson<String>(customerName),
|
|
'status': serializer.toJson<String>(status),
|
|
'openedAt': serializer.toJson<DateTime>(openedAt),
|
|
'closedAt': serializer.toJson<DateTime?>(closedAt),
|
|
};
|
|
}
|
|
|
|
BarTabRow copyWith({
|
|
String? id,
|
|
String? customerName,
|
|
String? status,
|
|
DateTime? openedAt,
|
|
Value<DateTime?> closedAt = const Value.absent(),
|
|
}) => BarTabRow(
|
|
id: id ?? this.id,
|
|
customerName: customerName ?? this.customerName,
|
|
status: status ?? this.status,
|
|
openedAt: openedAt ?? this.openedAt,
|
|
closedAt: closedAt.present ? closedAt.value : this.closedAt,
|
|
);
|
|
BarTabRow copyWithCompanion(BarTabsCompanion data) {
|
|
return BarTabRow(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
customerName: data.customerName.present
|
|
? data.customerName.value
|
|
: this.customerName,
|
|
status: data.status.present ? data.status.value : this.status,
|
|
openedAt: data.openedAt.present ? data.openedAt.value : this.openedAt,
|
|
closedAt: data.closedAt.present ? data.closedAt.value : this.closedAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('BarTabRow(')
|
|
..write('id: $id, ')
|
|
..write('customerName: $customerName, ')
|
|
..write('status: $status, ')
|
|
..write('openedAt: $openedAt, ')
|
|
..write('closedAt: $closedAt')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(id, customerName, status, openedAt, closedAt);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is BarTabRow &&
|
|
other.id == this.id &&
|
|
other.customerName == this.customerName &&
|
|
other.status == this.status &&
|
|
other.openedAt == this.openedAt &&
|
|
other.closedAt == this.closedAt);
|
|
}
|
|
|
|
class BarTabsCompanion extends UpdateCompanion<BarTabRow> {
|
|
final Value<String> id;
|
|
final Value<String> customerName;
|
|
final Value<String> status;
|
|
final Value<DateTime> openedAt;
|
|
final Value<DateTime?> closedAt;
|
|
final Value<int> rowid;
|
|
const BarTabsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.customerName = const Value.absent(),
|
|
this.status = const Value.absent(),
|
|
this.openedAt = const Value.absent(),
|
|
this.closedAt = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
BarTabsCompanion.insert({
|
|
required String id,
|
|
required String customerName,
|
|
this.status = const Value.absent(),
|
|
required DateTime openedAt,
|
|
this.closedAt = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
customerName = Value(customerName),
|
|
openedAt = Value(openedAt);
|
|
static Insertable<BarTabRow> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? customerName,
|
|
Expression<String>? status,
|
|
Expression<DateTime>? openedAt,
|
|
Expression<DateTime>? closedAt,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (customerName != null) 'customer_name': customerName,
|
|
if (status != null) 'status': status,
|
|
if (openedAt != null) 'opened_at': openedAt,
|
|
if (closedAt != null) 'closed_at': closedAt,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
BarTabsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? customerName,
|
|
Value<String>? status,
|
|
Value<DateTime>? openedAt,
|
|
Value<DateTime?>? closedAt,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return BarTabsCompanion(
|
|
id: id ?? this.id,
|
|
customerName: customerName ?? this.customerName,
|
|
status: status ?? this.status,
|
|
openedAt: openedAt ?? this.openedAt,
|
|
closedAt: closedAt ?? this.closedAt,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (customerName.present) {
|
|
map['customer_name'] = Variable<String>(customerName.value);
|
|
}
|
|
if (status.present) {
|
|
map['status'] = Variable<String>(status.value);
|
|
}
|
|
if (openedAt.present) {
|
|
map['opened_at'] = Variable<DateTime>(openedAt.value);
|
|
}
|
|
if (closedAt.present) {
|
|
map['closed_at'] = Variable<DateTime>(closedAt.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('BarTabsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('customerName: $customerName, ')
|
|
..write('status: $status, ')
|
|
..write('openedAt: $openedAt, ')
|
|
..write('closedAt: $closedAt, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $TabItemsTable extends TabItems
|
|
with TableInfo<$TabItemsTable, TabItemRow> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$TabItemsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _tabIdMeta = const VerificationMeta('tabId');
|
|
@override
|
|
late final GeneratedColumn<String> tabId = GeneratedColumn<String>(
|
|
'tab_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES bar_tabs (id) ON DELETE CASCADE',
|
|
),
|
|
);
|
|
static const VerificationMeta _productIdMeta = const VerificationMeta(
|
|
'productId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> productId = GeneratedColumn<String>(
|
|
'product_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES products (id)',
|
|
),
|
|
);
|
|
static const VerificationMeta _productNameMeta = const VerificationMeta(
|
|
'productName',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> productName = GeneratedColumn<String>(
|
|
'product_name',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _quantityMeta = const VerificationMeta(
|
|
'quantity',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> quantity = GeneratedColumn<int>(
|
|
'quantity',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _unitPriceInCentsMeta = const VerificationMeta(
|
|
'unitPriceInCents',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> unitPriceInCents = GeneratedColumn<int>(
|
|
'unit_price_in_cents',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _createdAtMeta = const VerificationMeta(
|
|
'createdAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
|
|
'created_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
tabId,
|
|
productId,
|
|
productName,
|
|
quantity,
|
|
unitPriceInCents,
|
|
createdAt,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'tab_items';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<TabItemRow> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('tab_id')) {
|
|
context.handle(
|
|
_tabIdMeta,
|
|
tabId.isAcceptableOrUnknown(data['tab_id']!, _tabIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_tabIdMeta);
|
|
}
|
|
if (data.containsKey('product_id')) {
|
|
context.handle(
|
|
_productIdMeta,
|
|
productId.isAcceptableOrUnknown(data['product_id']!, _productIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_productIdMeta);
|
|
}
|
|
if (data.containsKey('product_name')) {
|
|
context.handle(
|
|
_productNameMeta,
|
|
productName.isAcceptableOrUnknown(
|
|
data['product_name']!,
|
|
_productNameMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_productNameMeta);
|
|
}
|
|
if (data.containsKey('quantity')) {
|
|
context.handle(
|
|
_quantityMeta,
|
|
quantity.isAcceptableOrUnknown(data['quantity']!, _quantityMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_quantityMeta);
|
|
}
|
|
if (data.containsKey('unit_price_in_cents')) {
|
|
context.handle(
|
|
_unitPriceInCentsMeta,
|
|
unitPriceInCents.isAcceptableOrUnknown(
|
|
data['unit_price_in_cents']!,
|
|
_unitPriceInCentsMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_unitPriceInCentsMeta);
|
|
}
|
|
if (data.containsKey('created_at')) {
|
|
context.handle(
|
|
_createdAtMeta,
|
|
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMeta);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
TabItemRow map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return TabItemRow(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
tabId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}tab_id'],
|
|
)!,
|
|
productId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}product_id'],
|
|
)!,
|
|
productName: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}product_name'],
|
|
)!,
|
|
quantity: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}quantity'],
|
|
)!,
|
|
unitPriceInCents: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}unit_price_in_cents'],
|
|
)!,
|
|
createdAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}created_at'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$TabItemsTable createAlias(String alias) {
|
|
return $TabItemsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class TabItemRow extends DataClass implements Insertable<TabItemRow> {
|
|
final String id;
|
|
final String tabId;
|
|
final String productId;
|
|
final String productName;
|
|
final int quantity;
|
|
final int unitPriceInCents;
|
|
final DateTime createdAt;
|
|
const TabItemRow({
|
|
required this.id,
|
|
required this.tabId,
|
|
required this.productId,
|
|
required this.productName,
|
|
required this.quantity,
|
|
required this.unitPriceInCents,
|
|
required this.createdAt,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['tab_id'] = Variable<String>(tabId);
|
|
map['product_id'] = Variable<String>(productId);
|
|
map['product_name'] = Variable<String>(productName);
|
|
map['quantity'] = Variable<int>(quantity);
|
|
map['unit_price_in_cents'] = Variable<int>(unitPriceInCents);
|
|
map['created_at'] = Variable<DateTime>(createdAt);
|
|
return map;
|
|
}
|
|
|
|
TabItemsCompanion toCompanion(bool nullToAbsent) {
|
|
return TabItemsCompanion(
|
|
id: Value(id),
|
|
tabId: Value(tabId),
|
|
productId: Value(productId),
|
|
productName: Value(productName),
|
|
quantity: Value(quantity),
|
|
unitPriceInCents: Value(unitPriceInCents),
|
|
createdAt: Value(createdAt),
|
|
);
|
|
}
|
|
|
|
factory TabItemRow.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return TabItemRow(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
tabId: serializer.fromJson<String>(json['tabId']),
|
|
productId: serializer.fromJson<String>(json['productId']),
|
|
productName: serializer.fromJson<String>(json['productName']),
|
|
quantity: serializer.fromJson<int>(json['quantity']),
|
|
unitPriceInCents: serializer.fromJson<int>(json['unitPriceInCents']),
|
|
createdAt: serializer.fromJson<DateTime>(json['createdAt']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'tabId': serializer.toJson<String>(tabId),
|
|
'productId': serializer.toJson<String>(productId),
|
|
'productName': serializer.toJson<String>(productName),
|
|
'quantity': serializer.toJson<int>(quantity),
|
|
'unitPriceInCents': serializer.toJson<int>(unitPriceInCents),
|
|
'createdAt': serializer.toJson<DateTime>(createdAt),
|
|
};
|
|
}
|
|
|
|
TabItemRow copyWith({
|
|
String? id,
|
|
String? tabId,
|
|
String? productId,
|
|
String? productName,
|
|
int? quantity,
|
|
int? unitPriceInCents,
|
|
DateTime? createdAt,
|
|
}) => TabItemRow(
|
|
id: id ?? this.id,
|
|
tabId: tabId ?? this.tabId,
|
|
productId: productId ?? this.productId,
|
|
productName: productName ?? this.productName,
|
|
quantity: quantity ?? this.quantity,
|
|
unitPriceInCents: unitPriceInCents ?? this.unitPriceInCents,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
);
|
|
TabItemRow copyWithCompanion(TabItemsCompanion data) {
|
|
return TabItemRow(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
tabId: data.tabId.present ? data.tabId.value : this.tabId,
|
|
productId: data.productId.present ? data.productId.value : this.productId,
|
|
productName: data.productName.present
|
|
? data.productName.value
|
|
: this.productName,
|
|
quantity: data.quantity.present ? data.quantity.value : this.quantity,
|
|
unitPriceInCents: data.unitPriceInCents.present
|
|
? data.unitPriceInCents.value
|
|
: this.unitPriceInCents,
|
|
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('TabItemRow(')
|
|
..write('id: $id, ')
|
|
..write('tabId: $tabId, ')
|
|
..write('productId: $productId, ')
|
|
..write('productName: $productName, ')
|
|
..write('quantity: $quantity, ')
|
|
..write('unitPriceInCents: $unitPriceInCents, ')
|
|
..write('createdAt: $createdAt')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
tabId,
|
|
productId,
|
|
productName,
|
|
quantity,
|
|
unitPriceInCents,
|
|
createdAt,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is TabItemRow &&
|
|
other.id == this.id &&
|
|
other.tabId == this.tabId &&
|
|
other.productId == this.productId &&
|
|
other.productName == this.productName &&
|
|
other.quantity == this.quantity &&
|
|
other.unitPriceInCents == this.unitPriceInCents &&
|
|
other.createdAt == this.createdAt);
|
|
}
|
|
|
|
class TabItemsCompanion extends UpdateCompanion<TabItemRow> {
|
|
final Value<String> id;
|
|
final Value<String> tabId;
|
|
final Value<String> productId;
|
|
final Value<String> productName;
|
|
final Value<int> quantity;
|
|
final Value<int> unitPriceInCents;
|
|
final Value<DateTime> createdAt;
|
|
final Value<int> rowid;
|
|
const TabItemsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.tabId = const Value.absent(),
|
|
this.productId = const Value.absent(),
|
|
this.productName = const Value.absent(),
|
|
this.quantity = const Value.absent(),
|
|
this.unitPriceInCents = const Value.absent(),
|
|
this.createdAt = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
TabItemsCompanion.insert({
|
|
required String id,
|
|
required String tabId,
|
|
required String productId,
|
|
required String productName,
|
|
required int quantity,
|
|
required int unitPriceInCents,
|
|
required DateTime createdAt,
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
tabId = Value(tabId),
|
|
productId = Value(productId),
|
|
productName = Value(productName),
|
|
quantity = Value(quantity),
|
|
unitPriceInCents = Value(unitPriceInCents),
|
|
createdAt = Value(createdAt);
|
|
static Insertable<TabItemRow> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? tabId,
|
|
Expression<String>? productId,
|
|
Expression<String>? productName,
|
|
Expression<int>? quantity,
|
|
Expression<int>? unitPriceInCents,
|
|
Expression<DateTime>? createdAt,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (tabId != null) 'tab_id': tabId,
|
|
if (productId != null) 'product_id': productId,
|
|
if (productName != null) 'product_name': productName,
|
|
if (quantity != null) 'quantity': quantity,
|
|
if (unitPriceInCents != null) 'unit_price_in_cents': unitPriceInCents,
|
|
if (createdAt != null) 'created_at': createdAt,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
TabItemsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? tabId,
|
|
Value<String>? productId,
|
|
Value<String>? productName,
|
|
Value<int>? quantity,
|
|
Value<int>? unitPriceInCents,
|
|
Value<DateTime>? createdAt,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return TabItemsCompanion(
|
|
id: id ?? this.id,
|
|
tabId: tabId ?? this.tabId,
|
|
productId: productId ?? this.productId,
|
|
productName: productName ?? this.productName,
|
|
quantity: quantity ?? this.quantity,
|
|
unitPriceInCents: unitPriceInCents ?? this.unitPriceInCents,
|
|
createdAt: createdAt ?? this.createdAt,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (tabId.present) {
|
|
map['tab_id'] = Variable<String>(tabId.value);
|
|
}
|
|
if (productId.present) {
|
|
map['product_id'] = Variable<String>(productId.value);
|
|
}
|
|
if (productName.present) {
|
|
map['product_name'] = Variable<String>(productName.value);
|
|
}
|
|
if (quantity.present) {
|
|
map['quantity'] = Variable<int>(quantity.value);
|
|
}
|
|
if (unitPriceInCents.present) {
|
|
map['unit_price_in_cents'] = Variable<int>(unitPriceInCents.value);
|
|
}
|
|
if (createdAt.present) {
|
|
map['created_at'] = Variable<DateTime>(createdAt.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('TabItemsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('tabId: $tabId, ')
|
|
..write('productId: $productId, ')
|
|
..write('productName: $productName, ')
|
|
..write('quantity: $quantity, ')
|
|
..write('unitPriceInCents: $unitPriceInCents, ')
|
|
..write('createdAt: $createdAt, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $ClosedTabsTable extends ClosedTabs
|
|
with TableInfo<$ClosedTabsTable, ClosedTabsRow> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$ClosedTabsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _originalTabIdMeta = const VerificationMeta(
|
|
'originalTabId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> originalTabId = GeneratedColumn<String>(
|
|
'original_tab_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _customerNameMeta = const VerificationMeta(
|
|
'customerName',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> customerName = GeneratedColumn<String>(
|
|
'customer_name',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _closedAtMeta = const VerificationMeta(
|
|
'closedAt',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<DateTime> closedAt = GeneratedColumn<DateTime>(
|
|
'closed_at',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.dateTime,
|
|
requiredDuringInsert: true,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
originalTabId,
|
|
customerName,
|
|
closedAt,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'closed_tabs';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<ClosedTabsRow> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('original_tab_id')) {
|
|
context.handle(
|
|
_originalTabIdMeta,
|
|
originalTabId.isAcceptableOrUnknown(
|
|
data['original_tab_id']!,
|
|
_originalTabIdMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_originalTabIdMeta);
|
|
}
|
|
if (data.containsKey('customer_name')) {
|
|
context.handle(
|
|
_customerNameMeta,
|
|
customerName.isAcceptableOrUnknown(
|
|
data['customer_name']!,
|
|
_customerNameMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_customerNameMeta);
|
|
}
|
|
if (data.containsKey('closed_at')) {
|
|
context.handle(
|
|
_closedAtMeta,
|
|
closedAt.isAcceptableOrUnknown(data['closed_at']!, _closedAtMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_closedAtMeta);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
ClosedTabsRow map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return ClosedTabsRow(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
originalTabId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}original_tab_id'],
|
|
)!,
|
|
customerName: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}customer_name'],
|
|
)!,
|
|
closedAt: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.dateTime,
|
|
data['${effectivePrefix}closed_at'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$ClosedTabsTable createAlias(String alias) {
|
|
return $ClosedTabsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class ClosedTabsRow extends DataClass implements Insertable<ClosedTabsRow> {
|
|
final String id;
|
|
final String originalTabId;
|
|
final String customerName;
|
|
final DateTime closedAt;
|
|
const ClosedTabsRow({
|
|
required this.id,
|
|
required this.originalTabId,
|
|
required this.customerName,
|
|
required this.closedAt,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['original_tab_id'] = Variable<String>(originalTabId);
|
|
map['customer_name'] = Variable<String>(customerName);
|
|
map['closed_at'] = Variable<DateTime>(closedAt);
|
|
return map;
|
|
}
|
|
|
|
ClosedTabsCompanion toCompanion(bool nullToAbsent) {
|
|
return ClosedTabsCompanion(
|
|
id: Value(id),
|
|
originalTabId: Value(originalTabId),
|
|
customerName: Value(customerName),
|
|
closedAt: Value(closedAt),
|
|
);
|
|
}
|
|
|
|
factory ClosedTabsRow.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return ClosedTabsRow(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
originalTabId: serializer.fromJson<String>(json['originalTabId']),
|
|
customerName: serializer.fromJson<String>(json['customerName']),
|
|
closedAt: serializer.fromJson<DateTime>(json['closedAt']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'originalTabId': serializer.toJson<String>(originalTabId),
|
|
'customerName': serializer.toJson<String>(customerName),
|
|
'closedAt': serializer.toJson<DateTime>(closedAt),
|
|
};
|
|
}
|
|
|
|
ClosedTabsRow copyWith({
|
|
String? id,
|
|
String? originalTabId,
|
|
String? customerName,
|
|
DateTime? closedAt,
|
|
}) => ClosedTabsRow(
|
|
id: id ?? this.id,
|
|
originalTabId: originalTabId ?? this.originalTabId,
|
|
customerName: customerName ?? this.customerName,
|
|
closedAt: closedAt ?? this.closedAt,
|
|
);
|
|
ClosedTabsRow copyWithCompanion(ClosedTabsCompanion data) {
|
|
return ClosedTabsRow(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
originalTabId: data.originalTabId.present
|
|
? data.originalTabId.value
|
|
: this.originalTabId,
|
|
customerName: data.customerName.present
|
|
? data.customerName.value
|
|
: this.customerName,
|
|
closedAt: data.closedAt.present ? data.closedAt.value : this.closedAt,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ClosedTabsRow(')
|
|
..write('id: $id, ')
|
|
..write('originalTabId: $originalTabId, ')
|
|
..write('customerName: $customerName, ')
|
|
..write('closedAt: $closedAt')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(id, originalTabId, customerName, closedAt);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is ClosedTabsRow &&
|
|
other.id == this.id &&
|
|
other.originalTabId == this.originalTabId &&
|
|
other.customerName == this.customerName &&
|
|
other.closedAt == this.closedAt);
|
|
}
|
|
|
|
class ClosedTabsCompanion extends UpdateCompanion<ClosedTabsRow> {
|
|
final Value<String> id;
|
|
final Value<String> originalTabId;
|
|
final Value<String> customerName;
|
|
final Value<DateTime> closedAt;
|
|
final Value<int> rowid;
|
|
const ClosedTabsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.originalTabId = const Value.absent(),
|
|
this.customerName = const Value.absent(),
|
|
this.closedAt = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
ClosedTabsCompanion.insert({
|
|
required String id,
|
|
required String originalTabId,
|
|
required String customerName,
|
|
required DateTime closedAt,
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
originalTabId = Value(originalTabId),
|
|
customerName = Value(customerName),
|
|
closedAt = Value(closedAt);
|
|
static Insertable<ClosedTabsRow> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? originalTabId,
|
|
Expression<String>? customerName,
|
|
Expression<DateTime>? closedAt,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (originalTabId != null) 'original_tab_id': originalTabId,
|
|
if (customerName != null) 'customer_name': customerName,
|
|
if (closedAt != null) 'closed_at': closedAt,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
ClosedTabsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? originalTabId,
|
|
Value<String>? customerName,
|
|
Value<DateTime>? closedAt,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return ClosedTabsCompanion(
|
|
id: id ?? this.id,
|
|
originalTabId: originalTabId ?? this.originalTabId,
|
|
customerName: customerName ?? this.customerName,
|
|
closedAt: closedAt ?? this.closedAt,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (originalTabId.present) {
|
|
map['original_tab_id'] = Variable<String>(originalTabId.value);
|
|
}
|
|
if (customerName.present) {
|
|
map['customer_name'] = Variable<String>(customerName.value);
|
|
}
|
|
if (closedAt.present) {
|
|
map['closed_at'] = Variable<DateTime>(closedAt.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ClosedTabsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('originalTabId: $originalTabId, ')
|
|
..write('customerName: $customerName, ')
|
|
..write('closedAt: $closedAt, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $ClosedTabItemsTable extends ClosedTabItems
|
|
with TableInfo<$ClosedTabItemsTable, ClosedTabItemRow> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$ClosedTabItemsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _closedTabIdMeta = const VerificationMeta(
|
|
'closedTabId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> closedTabId = GeneratedColumn<String>(
|
|
'closed_tab_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _productIdMeta = const VerificationMeta(
|
|
'productId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> productId = GeneratedColumn<String>(
|
|
'product_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _productNameMeta = const VerificationMeta(
|
|
'productName',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> productName = GeneratedColumn<String>(
|
|
'product_name',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _quantityMeta = const VerificationMeta(
|
|
'quantity',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> quantity = GeneratedColumn<int>(
|
|
'quantity',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _unitPriceInCentsMeta = const VerificationMeta(
|
|
'unitPriceInCents',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> unitPriceInCents = GeneratedColumn<int>(
|
|
'unit_price_in_cents',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
closedTabId,
|
|
productId,
|
|
productName,
|
|
quantity,
|
|
unitPriceInCents,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'closed_tab_items';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<ClosedTabItemRow> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('closed_tab_id')) {
|
|
context.handle(
|
|
_closedTabIdMeta,
|
|
closedTabId.isAcceptableOrUnknown(
|
|
data['closed_tab_id']!,
|
|
_closedTabIdMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_closedTabIdMeta);
|
|
}
|
|
if (data.containsKey('product_id')) {
|
|
context.handle(
|
|
_productIdMeta,
|
|
productId.isAcceptableOrUnknown(data['product_id']!, _productIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_productIdMeta);
|
|
}
|
|
if (data.containsKey('product_name')) {
|
|
context.handle(
|
|
_productNameMeta,
|
|
productName.isAcceptableOrUnknown(
|
|
data['product_name']!,
|
|
_productNameMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_productNameMeta);
|
|
}
|
|
if (data.containsKey('quantity')) {
|
|
context.handle(
|
|
_quantityMeta,
|
|
quantity.isAcceptableOrUnknown(data['quantity']!, _quantityMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_quantityMeta);
|
|
}
|
|
if (data.containsKey('unit_price_in_cents')) {
|
|
context.handle(
|
|
_unitPriceInCentsMeta,
|
|
unitPriceInCents.isAcceptableOrUnknown(
|
|
data['unit_price_in_cents']!,
|
|
_unitPriceInCentsMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_unitPriceInCentsMeta);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
ClosedTabItemRow map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return ClosedTabItemRow(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
closedTabId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}closed_tab_id'],
|
|
)!,
|
|
productId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}product_id'],
|
|
)!,
|
|
productName: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}product_name'],
|
|
)!,
|
|
quantity: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}quantity'],
|
|
)!,
|
|
unitPriceInCents: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}unit_price_in_cents'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$ClosedTabItemsTable createAlias(String alias) {
|
|
return $ClosedTabItemsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class ClosedTabItemRow extends DataClass
|
|
implements Insertable<ClosedTabItemRow> {
|
|
final String id;
|
|
final String closedTabId;
|
|
final String productId;
|
|
final String productName;
|
|
final int quantity;
|
|
final int unitPriceInCents;
|
|
const ClosedTabItemRow({
|
|
required this.id,
|
|
required this.closedTabId,
|
|
required this.productId,
|
|
required this.productName,
|
|
required this.quantity,
|
|
required this.unitPriceInCents,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['closed_tab_id'] = Variable<String>(closedTabId);
|
|
map['product_id'] = Variable<String>(productId);
|
|
map['product_name'] = Variable<String>(productName);
|
|
map['quantity'] = Variable<int>(quantity);
|
|
map['unit_price_in_cents'] = Variable<int>(unitPriceInCents);
|
|
return map;
|
|
}
|
|
|
|
ClosedTabItemsCompanion toCompanion(bool nullToAbsent) {
|
|
return ClosedTabItemsCompanion(
|
|
id: Value(id),
|
|
closedTabId: Value(closedTabId),
|
|
productId: Value(productId),
|
|
productName: Value(productName),
|
|
quantity: Value(quantity),
|
|
unitPriceInCents: Value(unitPriceInCents),
|
|
);
|
|
}
|
|
|
|
factory ClosedTabItemRow.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return ClosedTabItemRow(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
closedTabId: serializer.fromJson<String>(json['closedTabId']),
|
|
productId: serializer.fromJson<String>(json['productId']),
|
|
productName: serializer.fromJson<String>(json['productName']),
|
|
quantity: serializer.fromJson<int>(json['quantity']),
|
|
unitPriceInCents: serializer.fromJson<int>(json['unitPriceInCents']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'closedTabId': serializer.toJson<String>(closedTabId),
|
|
'productId': serializer.toJson<String>(productId),
|
|
'productName': serializer.toJson<String>(productName),
|
|
'quantity': serializer.toJson<int>(quantity),
|
|
'unitPriceInCents': serializer.toJson<int>(unitPriceInCents),
|
|
};
|
|
}
|
|
|
|
ClosedTabItemRow copyWith({
|
|
String? id,
|
|
String? closedTabId,
|
|
String? productId,
|
|
String? productName,
|
|
int? quantity,
|
|
int? unitPriceInCents,
|
|
}) => ClosedTabItemRow(
|
|
id: id ?? this.id,
|
|
closedTabId: closedTabId ?? this.closedTabId,
|
|
productId: productId ?? this.productId,
|
|
productName: productName ?? this.productName,
|
|
quantity: quantity ?? this.quantity,
|
|
unitPriceInCents: unitPriceInCents ?? this.unitPriceInCents,
|
|
);
|
|
ClosedTabItemRow copyWithCompanion(ClosedTabItemsCompanion data) {
|
|
return ClosedTabItemRow(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
closedTabId: data.closedTabId.present
|
|
? data.closedTabId.value
|
|
: this.closedTabId,
|
|
productId: data.productId.present ? data.productId.value : this.productId,
|
|
productName: data.productName.present
|
|
? data.productName.value
|
|
: this.productName,
|
|
quantity: data.quantity.present ? data.quantity.value : this.quantity,
|
|
unitPriceInCents: data.unitPriceInCents.present
|
|
? data.unitPriceInCents.value
|
|
: this.unitPriceInCents,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ClosedTabItemRow(')
|
|
..write('id: $id, ')
|
|
..write('closedTabId: $closedTabId, ')
|
|
..write('productId: $productId, ')
|
|
..write('productName: $productName, ')
|
|
..write('quantity: $quantity, ')
|
|
..write('unitPriceInCents: $unitPriceInCents')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
closedTabId,
|
|
productId,
|
|
productName,
|
|
quantity,
|
|
unitPriceInCents,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is ClosedTabItemRow &&
|
|
other.id == this.id &&
|
|
other.closedTabId == this.closedTabId &&
|
|
other.productId == this.productId &&
|
|
other.productName == this.productName &&
|
|
other.quantity == this.quantity &&
|
|
other.unitPriceInCents == this.unitPriceInCents);
|
|
}
|
|
|
|
class ClosedTabItemsCompanion extends UpdateCompanion<ClosedTabItemRow> {
|
|
final Value<String> id;
|
|
final Value<String> closedTabId;
|
|
final Value<String> productId;
|
|
final Value<String> productName;
|
|
final Value<int> quantity;
|
|
final Value<int> unitPriceInCents;
|
|
final Value<int> rowid;
|
|
const ClosedTabItemsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.closedTabId = const Value.absent(),
|
|
this.productId = const Value.absent(),
|
|
this.productName = const Value.absent(),
|
|
this.quantity = const Value.absent(),
|
|
this.unitPriceInCents = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
ClosedTabItemsCompanion.insert({
|
|
required String id,
|
|
required String closedTabId,
|
|
required String productId,
|
|
required String productName,
|
|
required int quantity,
|
|
required int unitPriceInCents,
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
closedTabId = Value(closedTabId),
|
|
productId = Value(productId),
|
|
productName = Value(productName),
|
|
quantity = Value(quantity),
|
|
unitPriceInCents = Value(unitPriceInCents);
|
|
static Insertable<ClosedTabItemRow> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? closedTabId,
|
|
Expression<String>? productId,
|
|
Expression<String>? productName,
|
|
Expression<int>? quantity,
|
|
Expression<int>? unitPriceInCents,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (closedTabId != null) 'closed_tab_id': closedTabId,
|
|
if (productId != null) 'product_id': productId,
|
|
if (productName != null) 'product_name': productName,
|
|
if (quantity != null) 'quantity': quantity,
|
|
if (unitPriceInCents != null) 'unit_price_in_cents': unitPriceInCents,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
ClosedTabItemsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? closedTabId,
|
|
Value<String>? productId,
|
|
Value<String>? productName,
|
|
Value<int>? quantity,
|
|
Value<int>? unitPriceInCents,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return ClosedTabItemsCompanion(
|
|
id: id ?? this.id,
|
|
closedTabId: closedTabId ?? this.closedTabId,
|
|
productId: productId ?? this.productId,
|
|
productName: productName ?? this.productName,
|
|
quantity: quantity ?? this.quantity,
|
|
unitPriceInCents: unitPriceInCents ?? this.unitPriceInCents,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (closedTabId.present) {
|
|
map['closed_tab_id'] = Variable<String>(closedTabId.value);
|
|
}
|
|
if (productId.present) {
|
|
map['product_id'] = Variable<String>(productId.value);
|
|
}
|
|
if (productName.present) {
|
|
map['product_name'] = Variable<String>(productName.value);
|
|
}
|
|
if (quantity.present) {
|
|
map['quantity'] = Variable<int>(quantity.value);
|
|
}
|
|
if (unitPriceInCents.present) {
|
|
map['unit_price_in_cents'] = Variable<int>(unitPriceInCents.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('ClosedTabItemsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('closedTabId: $closedTabId, ')
|
|
..write('productId: $productId, ')
|
|
..write('productName: $productName, ')
|
|
..write('quantity: $quantity, ')
|
|
..write('unitPriceInCents: $unitPriceInCents, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
abstract class _$AppDatabase extends GeneratedDatabase {
|
|
_$AppDatabase(QueryExecutor e) : super(e);
|
|
$AppDatabaseManager get managers => $AppDatabaseManager(this);
|
|
late final $ProductsTable products = $ProductsTable(this);
|
|
late final $BarTabsTable barTabs = $BarTabsTable(this);
|
|
late final $TabItemsTable tabItems = $TabItemsTable(this);
|
|
late final $ClosedTabsTable closedTabs = $ClosedTabsTable(this);
|
|
late final $ClosedTabItemsTable closedTabItems = $ClosedTabItemsTable(this);
|
|
@override
|
|
Iterable<TableInfo<Table, Object?>> get allTables =>
|
|
allSchemaEntities.whereType<TableInfo<Table, Object?>>();
|
|
@override
|
|
List<DatabaseSchemaEntity> get allSchemaEntities => [
|
|
products,
|
|
barTabs,
|
|
tabItems,
|
|
closedTabs,
|
|
closedTabItems,
|
|
];
|
|
@override
|
|
StreamQueryUpdateRules get streamUpdateRules => const StreamQueryUpdateRules([
|
|
WritePropagation(
|
|
on: TableUpdateQuery.onTableName(
|
|
'bar_tabs',
|
|
limitUpdateKind: UpdateKind.delete,
|
|
),
|
|
result: [TableUpdate('tab_items', kind: UpdateKind.delete)],
|
|
),
|
|
]);
|
|
}
|
|
|
|
typedef $$ProductsTableCreateCompanionBuilder =
|
|
ProductsCompanion Function({
|
|
required String id,
|
|
required String name,
|
|
required String category,
|
|
required int stockQuantity,
|
|
required int lowStockThreshold,
|
|
required int priceInCents,
|
|
Value<String?> imagePath,
|
|
Value<bool> active,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$ProductsTableUpdateCompanionBuilder =
|
|
ProductsCompanion Function({
|
|
Value<String> id,
|
|
Value<String> name,
|
|
Value<String> category,
|
|
Value<int> stockQuantity,
|
|
Value<int> lowStockThreshold,
|
|
Value<int> priceInCents,
|
|
Value<String?> imagePath,
|
|
Value<bool> active,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$ProductsTableReferences
|
|
extends BaseReferences<_$AppDatabase, $ProductsTable, ProductRow> {
|
|
$$ProductsTableReferences(super.$_db, super.$_table, super.$_typedResult);
|
|
|
|
static MultiTypedResultKey<$TabItemsTable, List<TabItemRow>>
|
|
_tabItemsRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable(
|
|
db.tabItems,
|
|
aliasName: 'products__id__tab_items__product_id',
|
|
);
|
|
|
|
$$TabItemsTableProcessedTableManager get tabItemsRefs {
|
|
final manager = $$TabItemsTableTableManager(
|
|
$_db,
|
|
$_db.tabItems,
|
|
).filter((f) => f.productId.id.sqlEquals($_itemColumn<String>('id')!));
|
|
|
|
final cache = $_typedResult.readTableOrNull(_tabItemsRefsTable($_db));
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$ProductsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $ProductsTable> {
|
|
$$ProductsTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get name => $composableBuilder(
|
|
column: $table.name,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get category => $composableBuilder(
|
|
column: $table.category,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get stockQuantity => $composableBuilder(
|
|
column: $table.stockQuantity,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get lowStockThreshold => $composableBuilder(
|
|
column: $table.lowStockThreshold,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get priceInCents => $composableBuilder(
|
|
column: $table.priceInCents,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get imagePath => $composableBuilder(
|
|
column: $table.imagePath,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get active => $composableBuilder(
|
|
column: $table.active,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
Expression<bool> tabItemsRefs(
|
|
Expression<bool> Function($$TabItemsTableFilterComposer f) f,
|
|
) {
|
|
final $$TabItemsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.tabItems,
|
|
getReferencedColumn: (t) => t.productId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$TabItemsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.tabItems,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$ProductsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $ProductsTable> {
|
|
$$ProductsTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get name => $composableBuilder(
|
|
column: $table.name,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get category => $composableBuilder(
|
|
column: $table.category,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get stockQuantity => $composableBuilder(
|
|
column: $table.stockQuantity,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get lowStockThreshold => $composableBuilder(
|
|
column: $table.lowStockThreshold,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get priceInCents => $composableBuilder(
|
|
column: $table.priceInCents,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get imagePath => $composableBuilder(
|
|
column: $table.imagePath,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get active => $composableBuilder(
|
|
column: $table.active,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$ProductsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $ProductsTable> {
|
|
$$ProductsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get name =>
|
|
$composableBuilder(column: $table.name, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get category =>
|
|
$composableBuilder(column: $table.category, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get stockQuantity => $composableBuilder(
|
|
column: $table.stockQuantity,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get lowStockThreshold => $composableBuilder(
|
|
column: $table.lowStockThreshold,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get priceInCents => $composableBuilder(
|
|
column: $table.priceInCents,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get imagePath =>
|
|
$composableBuilder(column: $table.imagePath, builder: (column) => column);
|
|
|
|
GeneratedColumn<bool> get active =>
|
|
$composableBuilder(column: $table.active, builder: (column) => column);
|
|
|
|
Expression<T> tabItemsRefs<T extends Object>(
|
|
Expression<T> Function($$TabItemsTableAnnotationComposer a) f,
|
|
) {
|
|
final $$TabItemsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.tabItems,
|
|
getReferencedColumn: (t) => t.productId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$TabItemsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.tabItems,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$ProductsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$ProductsTable,
|
|
ProductRow,
|
|
$$ProductsTableFilterComposer,
|
|
$$ProductsTableOrderingComposer,
|
|
$$ProductsTableAnnotationComposer,
|
|
$$ProductsTableCreateCompanionBuilder,
|
|
$$ProductsTableUpdateCompanionBuilder,
|
|
(ProductRow, $$ProductsTableReferences),
|
|
ProductRow,
|
|
PrefetchHooks Function({bool tabItemsRefs})
|
|
> {
|
|
$$ProductsTableTableManager(_$AppDatabase db, $ProductsTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$ProductsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$ProductsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$ProductsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> name = const Value.absent(),
|
|
Value<String> category = const Value.absent(),
|
|
Value<int> stockQuantity = const Value.absent(),
|
|
Value<int> lowStockThreshold = const Value.absent(),
|
|
Value<int> priceInCents = const Value.absent(),
|
|
Value<String?> imagePath = const Value.absent(),
|
|
Value<bool> active = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ProductsCompanion(
|
|
id: id,
|
|
name: name,
|
|
category: category,
|
|
stockQuantity: stockQuantity,
|
|
lowStockThreshold: lowStockThreshold,
|
|
priceInCents: priceInCents,
|
|
imagePath: imagePath,
|
|
active: active,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String name,
|
|
required String category,
|
|
required int stockQuantity,
|
|
required int lowStockThreshold,
|
|
required int priceInCents,
|
|
Value<String?> imagePath = const Value.absent(),
|
|
Value<bool> active = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ProductsCompanion.insert(
|
|
id: id,
|
|
name: name,
|
|
category: category,
|
|
stockQuantity: stockQuantity,
|
|
lowStockThreshold: lowStockThreshold,
|
|
priceInCents: priceInCents,
|
|
imagePath: imagePath,
|
|
active: active,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$ProductsTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback: ({tabItemsRefs = false}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [if (tabItemsRefs) db.tabItems],
|
|
addJoins: null,
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [
|
|
if (tabItemsRefs)
|
|
await $_getPrefetchedData<
|
|
ProductRow,
|
|
$ProductsTable,
|
|
TabItemRow
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$ProductsTableReferences
|
|
._tabItemsRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$ProductsTableReferences(db, table, p0).tabItemsRefs,
|
|
referencedItemsForCurrentItem: (item, referencedItems) =>
|
|
referencedItems.where((e) => e.productId == item.id),
|
|
typedResults: items,
|
|
),
|
|
];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$ProductsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$ProductsTable,
|
|
ProductRow,
|
|
$$ProductsTableFilterComposer,
|
|
$$ProductsTableOrderingComposer,
|
|
$$ProductsTableAnnotationComposer,
|
|
$$ProductsTableCreateCompanionBuilder,
|
|
$$ProductsTableUpdateCompanionBuilder,
|
|
(ProductRow, $$ProductsTableReferences),
|
|
ProductRow,
|
|
PrefetchHooks Function({bool tabItemsRefs})
|
|
>;
|
|
typedef $$BarTabsTableCreateCompanionBuilder =
|
|
BarTabsCompanion Function({
|
|
required String id,
|
|
required String customerName,
|
|
Value<String> status,
|
|
required DateTime openedAt,
|
|
Value<DateTime?> closedAt,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$BarTabsTableUpdateCompanionBuilder =
|
|
BarTabsCompanion Function({
|
|
Value<String> id,
|
|
Value<String> customerName,
|
|
Value<String> status,
|
|
Value<DateTime> openedAt,
|
|
Value<DateTime?> closedAt,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$BarTabsTableReferences
|
|
extends BaseReferences<_$AppDatabase, $BarTabsTable, BarTabRow> {
|
|
$$BarTabsTableReferences(super.$_db, super.$_table, super.$_typedResult);
|
|
|
|
static MultiTypedResultKey<$TabItemsTable, List<TabItemRow>>
|
|
_tabItemsRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable(
|
|
db.tabItems,
|
|
aliasName: 'bar_tabs__id__tab_items__tab_id',
|
|
);
|
|
|
|
$$TabItemsTableProcessedTableManager get tabItemsRefs {
|
|
final manager = $$TabItemsTableTableManager(
|
|
$_db,
|
|
$_db.tabItems,
|
|
).filter((f) => f.tabId.id.sqlEquals($_itemColumn<String>('id')!));
|
|
|
|
final cache = $_typedResult.readTableOrNull(_tabItemsRefsTable($_db));
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$BarTabsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $BarTabsTable> {
|
|
$$BarTabsTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get customerName => $composableBuilder(
|
|
column: $table.customerName,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get status => $composableBuilder(
|
|
column: $table.status,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get openedAt => $composableBuilder(
|
|
column: $table.openedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get closedAt => $composableBuilder(
|
|
column: $table.closedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
Expression<bool> tabItemsRefs(
|
|
Expression<bool> Function($$TabItemsTableFilterComposer f) f,
|
|
) {
|
|
final $$TabItemsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.tabItems,
|
|
getReferencedColumn: (t) => t.tabId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$TabItemsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.tabItems,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$BarTabsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $BarTabsTable> {
|
|
$$BarTabsTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get customerName => $composableBuilder(
|
|
column: $table.customerName,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get status => $composableBuilder(
|
|
column: $table.status,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get openedAt => $composableBuilder(
|
|
column: $table.openedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get closedAt => $composableBuilder(
|
|
column: $table.closedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$BarTabsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $BarTabsTable> {
|
|
$$BarTabsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get customerName => $composableBuilder(
|
|
column: $table.customerName,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get status =>
|
|
$composableBuilder(column: $table.status, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get openedAt =>
|
|
$composableBuilder(column: $table.openedAt, builder: (column) => column);
|
|
|
|
GeneratedColumn<DateTime> get closedAt =>
|
|
$composableBuilder(column: $table.closedAt, builder: (column) => column);
|
|
|
|
Expression<T> tabItemsRefs<T extends Object>(
|
|
Expression<T> Function($$TabItemsTableAnnotationComposer a) f,
|
|
) {
|
|
final $$TabItemsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.tabItems,
|
|
getReferencedColumn: (t) => t.tabId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$TabItemsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.tabItems,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$BarTabsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$BarTabsTable,
|
|
BarTabRow,
|
|
$$BarTabsTableFilterComposer,
|
|
$$BarTabsTableOrderingComposer,
|
|
$$BarTabsTableAnnotationComposer,
|
|
$$BarTabsTableCreateCompanionBuilder,
|
|
$$BarTabsTableUpdateCompanionBuilder,
|
|
(BarTabRow, $$BarTabsTableReferences),
|
|
BarTabRow,
|
|
PrefetchHooks Function({bool tabItemsRefs})
|
|
> {
|
|
$$BarTabsTableTableManager(_$AppDatabase db, $BarTabsTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$BarTabsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$BarTabsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$BarTabsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> customerName = const Value.absent(),
|
|
Value<String> status = const Value.absent(),
|
|
Value<DateTime> openedAt = const Value.absent(),
|
|
Value<DateTime?> closedAt = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => BarTabsCompanion(
|
|
id: id,
|
|
customerName: customerName,
|
|
status: status,
|
|
openedAt: openedAt,
|
|
closedAt: closedAt,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String customerName,
|
|
Value<String> status = const Value.absent(),
|
|
required DateTime openedAt,
|
|
Value<DateTime?> closedAt = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => BarTabsCompanion.insert(
|
|
id: id,
|
|
customerName: customerName,
|
|
status: status,
|
|
openedAt: openedAt,
|
|
closedAt: closedAt,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$BarTabsTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback: ({tabItemsRefs = false}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [if (tabItemsRefs) db.tabItems],
|
|
addJoins: null,
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [
|
|
if (tabItemsRefs)
|
|
await $_getPrefetchedData<
|
|
BarTabRow,
|
|
$BarTabsTable,
|
|
TabItemRow
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$BarTabsTableReferences
|
|
._tabItemsRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$BarTabsTableReferences(db, table, p0).tabItemsRefs,
|
|
referencedItemsForCurrentItem: (item, referencedItems) =>
|
|
referencedItems.where((e) => e.tabId == item.id),
|
|
typedResults: items,
|
|
),
|
|
];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$BarTabsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$BarTabsTable,
|
|
BarTabRow,
|
|
$$BarTabsTableFilterComposer,
|
|
$$BarTabsTableOrderingComposer,
|
|
$$BarTabsTableAnnotationComposer,
|
|
$$BarTabsTableCreateCompanionBuilder,
|
|
$$BarTabsTableUpdateCompanionBuilder,
|
|
(BarTabRow, $$BarTabsTableReferences),
|
|
BarTabRow,
|
|
PrefetchHooks Function({bool tabItemsRefs})
|
|
>;
|
|
typedef $$TabItemsTableCreateCompanionBuilder =
|
|
TabItemsCompanion Function({
|
|
required String id,
|
|
required String tabId,
|
|
required String productId,
|
|
required String productName,
|
|
required int quantity,
|
|
required int unitPriceInCents,
|
|
required DateTime createdAt,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$TabItemsTableUpdateCompanionBuilder =
|
|
TabItemsCompanion Function({
|
|
Value<String> id,
|
|
Value<String> tabId,
|
|
Value<String> productId,
|
|
Value<String> productName,
|
|
Value<int> quantity,
|
|
Value<int> unitPriceInCents,
|
|
Value<DateTime> createdAt,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$TabItemsTableReferences
|
|
extends BaseReferences<_$AppDatabase, $TabItemsTable, TabItemRow> {
|
|
$$TabItemsTableReferences(super.$_db, super.$_table, super.$_typedResult);
|
|
|
|
static $BarTabsTable _tabIdTable(_$AppDatabase db) =>
|
|
db.barTabs.createAlias('tab_items__tab_id__bar_tabs__id');
|
|
|
|
$$BarTabsTableProcessedTableManager get tabId {
|
|
final $_column = $_itemColumn<String>('tab_id')!;
|
|
|
|
final manager = $$BarTabsTableTableManager(
|
|
$_db,
|
|
$_db.barTabs,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_tabIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
|
|
static $ProductsTable _productIdTable(_$AppDatabase db) =>
|
|
db.products.createAlias('tab_items__product_id__products__id');
|
|
|
|
$$ProductsTableProcessedTableManager get productId {
|
|
final $_column = $_itemColumn<String>('product_id')!;
|
|
|
|
final manager = $$ProductsTableTableManager(
|
|
$_db,
|
|
$_db.products,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_productIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$TabItemsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $TabItemsTable> {
|
|
$$TabItemsTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get productName => $composableBuilder(
|
|
column: $table.productName,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get quantity => $composableBuilder(
|
|
column: $table.quantity,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get unitPriceInCents => $composableBuilder(
|
|
column: $table.unitPriceInCents,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
$$BarTabsTableFilterComposer get tabId {
|
|
final $$BarTabsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.tabId,
|
|
referencedTable: $db.barTabs,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$BarTabsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.barTabs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$ProductsTableFilterComposer get productId {
|
|
final $$ProductsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.productId,
|
|
referencedTable: $db.products,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProductsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.products,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$TabItemsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $TabItemsTable> {
|
|
$$TabItemsTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get productName => $composableBuilder(
|
|
column: $table.productName,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get quantity => $composableBuilder(
|
|
column: $table.quantity,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get unitPriceInCents => $composableBuilder(
|
|
column: $table.unitPriceInCents,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get createdAt => $composableBuilder(
|
|
column: $table.createdAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
$$BarTabsTableOrderingComposer get tabId {
|
|
final $$BarTabsTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.tabId,
|
|
referencedTable: $db.barTabs,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$BarTabsTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.barTabs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$ProductsTableOrderingComposer get productId {
|
|
final $$ProductsTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.productId,
|
|
referencedTable: $db.products,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProductsTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.products,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$TabItemsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $TabItemsTable> {
|
|
$$TabItemsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get productName => $composableBuilder(
|
|
column: $table.productName,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get quantity =>
|
|
$composableBuilder(column: $table.quantity, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get unitPriceInCents => $composableBuilder(
|
|
column: $table.unitPriceInCents,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<DateTime> get createdAt =>
|
|
$composableBuilder(column: $table.createdAt, builder: (column) => column);
|
|
|
|
$$BarTabsTableAnnotationComposer get tabId {
|
|
final $$BarTabsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.tabId,
|
|
referencedTable: $db.barTabs,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$BarTabsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.barTabs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$ProductsTableAnnotationComposer get productId {
|
|
final $$ProductsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.productId,
|
|
referencedTable: $db.products,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$ProductsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.products,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$TabItemsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$TabItemsTable,
|
|
TabItemRow,
|
|
$$TabItemsTableFilterComposer,
|
|
$$TabItemsTableOrderingComposer,
|
|
$$TabItemsTableAnnotationComposer,
|
|
$$TabItemsTableCreateCompanionBuilder,
|
|
$$TabItemsTableUpdateCompanionBuilder,
|
|
(TabItemRow, $$TabItemsTableReferences),
|
|
TabItemRow,
|
|
PrefetchHooks Function({bool tabId, bool productId})
|
|
> {
|
|
$$TabItemsTableTableManager(_$AppDatabase db, $TabItemsTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$TabItemsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$TabItemsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$TabItemsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> tabId = const Value.absent(),
|
|
Value<String> productId = const Value.absent(),
|
|
Value<String> productName = const Value.absent(),
|
|
Value<int> quantity = const Value.absent(),
|
|
Value<int> unitPriceInCents = const Value.absent(),
|
|
Value<DateTime> createdAt = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => TabItemsCompanion(
|
|
id: id,
|
|
tabId: tabId,
|
|
productId: productId,
|
|
productName: productName,
|
|
quantity: quantity,
|
|
unitPriceInCents: unitPriceInCents,
|
|
createdAt: createdAt,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String tabId,
|
|
required String productId,
|
|
required String productName,
|
|
required int quantity,
|
|
required int unitPriceInCents,
|
|
required DateTime createdAt,
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => TabItemsCompanion.insert(
|
|
id: id,
|
|
tabId: tabId,
|
|
productId: productId,
|
|
productName: productName,
|
|
quantity: quantity,
|
|
unitPriceInCents: unitPriceInCents,
|
|
createdAt: createdAt,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$TabItemsTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback: ({tabId = false, productId = false}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [],
|
|
addJoins:
|
|
<
|
|
T extends TableManagerState<
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic
|
|
>
|
|
>(state) {
|
|
if (tabId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.tabId,
|
|
referencedTable: $$TabItemsTableReferences
|
|
._tabIdTable(db),
|
|
referencedColumn: $$TabItemsTableReferences
|
|
._tabIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
if (productId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.productId,
|
|
referencedTable: $$TabItemsTableReferences
|
|
._productIdTable(db),
|
|
referencedColumn: $$TabItemsTableReferences
|
|
._productIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
|
|
return state;
|
|
},
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$TabItemsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$TabItemsTable,
|
|
TabItemRow,
|
|
$$TabItemsTableFilterComposer,
|
|
$$TabItemsTableOrderingComposer,
|
|
$$TabItemsTableAnnotationComposer,
|
|
$$TabItemsTableCreateCompanionBuilder,
|
|
$$TabItemsTableUpdateCompanionBuilder,
|
|
(TabItemRow, $$TabItemsTableReferences),
|
|
TabItemRow,
|
|
PrefetchHooks Function({bool tabId, bool productId})
|
|
>;
|
|
typedef $$ClosedTabsTableCreateCompanionBuilder =
|
|
ClosedTabsCompanion Function({
|
|
required String id,
|
|
required String originalTabId,
|
|
required String customerName,
|
|
required DateTime closedAt,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$ClosedTabsTableUpdateCompanionBuilder =
|
|
ClosedTabsCompanion Function({
|
|
Value<String> id,
|
|
Value<String> originalTabId,
|
|
Value<String> customerName,
|
|
Value<DateTime> closedAt,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$ClosedTabsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $ClosedTabsTable> {
|
|
$$ClosedTabsTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get originalTabId => $composableBuilder(
|
|
column: $table.originalTabId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get customerName => $composableBuilder(
|
|
column: $table.customerName,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<DateTime> get closedAt => $composableBuilder(
|
|
column: $table.closedAt,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$ClosedTabsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $ClosedTabsTable> {
|
|
$$ClosedTabsTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get originalTabId => $composableBuilder(
|
|
column: $table.originalTabId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get customerName => $composableBuilder(
|
|
column: $table.customerName,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<DateTime> get closedAt => $composableBuilder(
|
|
column: $table.closedAt,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$ClosedTabsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $ClosedTabsTable> {
|
|
$$ClosedTabsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get originalTabId => $composableBuilder(
|
|
column: $table.originalTabId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get customerName => $composableBuilder(
|
|
column: $table.customerName,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<DateTime> get closedAt =>
|
|
$composableBuilder(column: $table.closedAt, builder: (column) => column);
|
|
}
|
|
|
|
class $$ClosedTabsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$ClosedTabsTable,
|
|
ClosedTabsRow,
|
|
$$ClosedTabsTableFilterComposer,
|
|
$$ClosedTabsTableOrderingComposer,
|
|
$$ClosedTabsTableAnnotationComposer,
|
|
$$ClosedTabsTableCreateCompanionBuilder,
|
|
$$ClosedTabsTableUpdateCompanionBuilder,
|
|
(
|
|
ClosedTabsRow,
|
|
BaseReferences<_$AppDatabase, $ClosedTabsTable, ClosedTabsRow>,
|
|
),
|
|
ClosedTabsRow,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$ClosedTabsTableTableManager(_$AppDatabase db, $ClosedTabsTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$ClosedTabsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$ClosedTabsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$ClosedTabsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> originalTabId = const Value.absent(),
|
|
Value<String> customerName = const Value.absent(),
|
|
Value<DateTime> closedAt = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ClosedTabsCompanion(
|
|
id: id,
|
|
originalTabId: originalTabId,
|
|
customerName: customerName,
|
|
closedAt: closedAt,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String originalTabId,
|
|
required String customerName,
|
|
required DateTime closedAt,
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ClosedTabsCompanion.insert(
|
|
id: id,
|
|
originalTabId: originalTabId,
|
|
customerName: customerName,
|
|
closedAt: closedAt,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$ClosedTabsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$ClosedTabsTable,
|
|
ClosedTabsRow,
|
|
$$ClosedTabsTableFilterComposer,
|
|
$$ClosedTabsTableOrderingComposer,
|
|
$$ClosedTabsTableAnnotationComposer,
|
|
$$ClosedTabsTableCreateCompanionBuilder,
|
|
$$ClosedTabsTableUpdateCompanionBuilder,
|
|
(
|
|
ClosedTabsRow,
|
|
BaseReferences<_$AppDatabase, $ClosedTabsTable, ClosedTabsRow>,
|
|
),
|
|
ClosedTabsRow,
|
|
PrefetchHooks Function()
|
|
>;
|
|
typedef $$ClosedTabItemsTableCreateCompanionBuilder =
|
|
ClosedTabItemsCompanion Function({
|
|
required String id,
|
|
required String closedTabId,
|
|
required String productId,
|
|
required String productName,
|
|
required int quantity,
|
|
required int unitPriceInCents,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$ClosedTabItemsTableUpdateCompanionBuilder =
|
|
ClosedTabItemsCompanion Function({
|
|
Value<String> id,
|
|
Value<String> closedTabId,
|
|
Value<String> productId,
|
|
Value<String> productName,
|
|
Value<int> quantity,
|
|
Value<int> unitPriceInCents,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$ClosedTabItemsTableFilterComposer
|
|
extends Composer<_$AppDatabase, $ClosedTabItemsTable> {
|
|
$$ClosedTabItemsTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get closedTabId => $composableBuilder(
|
|
column: $table.closedTabId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get productId => $composableBuilder(
|
|
column: $table.productId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get productName => $composableBuilder(
|
|
column: $table.productName,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get quantity => $composableBuilder(
|
|
column: $table.quantity,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get unitPriceInCents => $composableBuilder(
|
|
column: $table.unitPriceInCents,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$ClosedTabItemsTableOrderingComposer
|
|
extends Composer<_$AppDatabase, $ClosedTabItemsTable> {
|
|
$$ClosedTabItemsTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get closedTabId => $composableBuilder(
|
|
column: $table.closedTabId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get productId => $composableBuilder(
|
|
column: $table.productId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get productName => $composableBuilder(
|
|
column: $table.productName,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get quantity => $composableBuilder(
|
|
column: $table.quantity,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get unitPriceInCents => $composableBuilder(
|
|
column: $table.unitPriceInCents,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$ClosedTabItemsTableAnnotationComposer
|
|
extends Composer<_$AppDatabase, $ClosedTabItemsTable> {
|
|
$$ClosedTabItemsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get closedTabId => $composableBuilder(
|
|
column: $table.closedTabId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get productId =>
|
|
$composableBuilder(column: $table.productId, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get productName => $composableBuilder(
|
|
column: $table.productName,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get quantity =>
|
|
$composableBuilder(column: $table.quantity, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get unitPriceInCents => $composableBuilder(
|
|
column: $table.unitPriceInCents,
|
|
builder: (column) => column,
|
|
);
|
|
}
|
|
|
|
class $$ClosedTabItemsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$AppDatabase,
|
|
$ClosedTabItemsTable,
|
|
ClosedTabItemRow,
|
|
$$ClosedTabItemsTableFilterComposer,
|
|
$$ClosedTabItemsTableOrderingComposer,
|
|
$$ClosedTabItemsTableAnnotationComposer,
|
|
$$ClosedTabItemsTableCreateCompanionBuilder,
|
|
$$ClosedTabItemsTableUpdateCompanionBuilder,
|
|
(
|
|
ClosedTabItemRow,
|
|
BaseReferences<
|
|
_$AppDatabase,
|
|
$ClosedTabItemsTable,
|
|
ClosedTabItemRow
|
|
>,
|
|
),
|
|
ClosedTabItemRow,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$ClosedTabItemsTableTableManager(
|
|
_$AppDatabase db,
|
|
$ClosedTabItemsTable table,
|
|
) : super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$ClosedTabItemsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$ClosedTabItemsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$ClosedTabItemsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> closedTabId = const Value.absent(),
|
|
Value<String> productId = const Value.absent(),
|
|
Value<String> productName = const Value.absent(),
|
|
Value<int> quantity = const Value.absent(),
|
|
Value<int> unitPriceInCents = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ClosedTabItemsCompanion(
|
|
id: id,
|
|
closedTabId: closedTabId,
|
|
productId: productId,
|
|
productName: productName,
|
|
quantity: quantity,
|
|
unitPriceInCents: unitPriceInCents,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String closedTabId,
|
|
required String productId,
|
|
required String productName,
|
|
required int quantity,
|
|
required int unitPriceInCents,
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => ClosedTabItemsCompanion.insert(
|
|
id: id,
|
|
closedTabId: closedTabId,
|
|
productId: productId,
|
|
productName: productName,
|
|
quantity: quantity,
|
|
unitPriceInCents: unitPriceInCents,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$ClosedTabItemsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$AppDatabase,
|
|
$ClosedTabItemsTable,
|
|
ClosedTabItemRow,
|
|
$$ClosedTabItemsTableFilterComposer,
|
|
$$ClosedTabItemsTableOrderingComposer,
|
|
$$ClosedTabItemsTableAnnotationComposer,
|
|
$$ClosedTabItemsTableCreateCompanionBuilder,
|
|
$$ClosedTabItemsTableUpdateCompanionBuilder,
|
|
(
|
|
ClosedTabItemRow,
|
|
BaseReferences<_$AppDatabase, $ClosedTabItemsTable, ClosedTabItemRow>,
|
|
),
|
|
ClosedTabItemRow,
|
|
PrefetchHooks Function()
|
|
>;
|
|
|
|
class $AppDatabaseManager {
|
|
final _$AppDatabase _db;
|
|
$AppDatabaseManager(this._db);
|
|
$$ProductsTableTableManager get products =>
|
|
$$ProductsTableTableManager(_db, _db.products);
|
|
$$BarTabsTableTableManager get barTabs =>
|
|
$$BarTabsTableTableManager(_db, _db.barTabs);
|
|
$$TabItemsTableTableManager get tabItems =>
|
|
$$TabItemsTableTableManager(_db, _db.tabItems);
|
|
$$ClosedTabsTableTableManager get closedTabs =>
|
|
$$ClosedTabsTableTableManager(_db, _db.closedTabs);
|
|
$$ClosedTabItemsTableTableManager get closedTabItems =>
|
|
$$ClosedTabItemsTableTableManager(_db, _db.closedTabItems);
|
|
}
|