Initial commit: DLS - Dental Lab System
- Flutter + PocketBase dental lab management system - Clinic & lab dashboards, job tracking, patient management - Product catalog, finance tracking, multi-language support - AI assistant integration, realtime notifications - Windows installer (Inno Setup) included - Developed by kovakyazilim.com
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
class ProstheticProduct {
|
||||
const ProstheticProduct({
|
||||
required this.id,
|
||||
required this.labTenantId,
|
||||
required this.name,
|
||||
required this.prostheticType,
|
||||
this.unitPrice,
|
||||
this.currency,
|
||||
this.isActive = true,
|
||||
this.description,
|
||||
});
|
||||
|
||||
final String id;
|
||||
final String labTenantId;
|
||||
final String name;
|
||||
final String prostheticType;
|
||||
final double? unitPrice;
|
||||
final String? currency;
|
||||
final bool isActive;
|
||||
final String? description;
|
||||
|
||||
factory ProstheticProduct.fromJson(Map<String, dynamic> j) {
|
||||
String? _str(dynamic v) { final s = v as String?; return (s == null || s.isEmpty) ? null : s; }
|
||||
return ProstheticProduct(
|
||||
id: j['id'] as String,
|
||||
labTenantId: j['lab_tenant_id'] as String,
|
||||
name: j['name'] as String,
|
||||
prostheticType: j['prosthetic_type'] as String,
|
||||
unitPrice: (j['unit_price'] as num?)?.toDouble(),
|
||||
currency: j['currency'] as String? ?? 'TRY',
|
||||
isActive: j['is_active'] as bool? ?? true,
|
||||
description: _str(j['description']),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'lab_tenant_id': labTenantId,
|
||||
'name': name,
|
||||
'prosthetic_type': prostheticType,
|
||||
if (unitPrice != null) 'unit_price': unitPrice,
|
||||
'currency': currency ?? 'TRY',
|
||||
'is_active': isActive,
|
||||
if (description != null) 'description': description,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user