update
This commit is contained in:
parent
ecc427c958
commit
ee1884790a
11 changed files with 113 additions and 127 deletions
|
|
@ -5,13 +5,15 @@ class RefMedicines {
|
|||
final SupabaseClient _supabase = Supabase.instance.client;
|
||||
|
||||
Future<List> getList() async {
|
||||
final data = await _supabase
|
||||
.from('ref_manufactorers')
|
||||
.select('manufactorer_name')
|
||||
.order('manufactorer_name', ascending: true);
|
||||
final data = await _supabase.from('ref_medicines').select('medicine_name').order('medicine_name', ascending: true);
|
||||
return data.toList();
|
||||
}
|
||||
|
||||
Future<String> getUUID(String name) async {
|
||||
final data = await _supabase.from('ref_medicines').select('ref_medicines_uuid').eq('medicine_name', name);
|
||||
return data.first['ref_medicines_uuid'];
|
||||
}
|
||||
|
||||
Future<void> postMedicine(String name, String muuid, String guuid, String tuuid) async {
|
||||
final uuid = Uuid().v4();
|
||||
|
||||
|
|
|
|||
|
|
@ -14,9 +14,16 @@ class Stocks {
|
|||
// return data.first['ref_types_uuid'].toString();
|
||||
// }
|
||||
|
||||
// Future<void> postType(String name) async {
|
||||
// final typeUUID = Uuid().v4();
|
||||
Future<void> postStock(String muuid, String name, String quantity) async {
|
||||
final uuid = Uuid().v4();
|
||||
|
||||
// await _supabase.from('ref_types').insert({'ref_types_uuid': typeUUID, 'type_name': name});
|
||||
// }
|
||||
final stock = {
|
||||
'stock_uuid': uuid,
|
||||
'ref_medicines_uuid': muuid,
|
||||
'expiration_date': name,
|
||||
'quantity': quantity,
|
||||
};
|
||||
|
||||
await _supabase.from('stocks').insert(stock);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue