ticket labels e ticket receipt
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import 'package:flux/features/settings/document_sequence/models/document_sequence_model.dart';
|
||||
import 'package:get_it/get_it.dart';
|
||||
import 'package:supabase_flutter/supabase_flutter.dart';
|
||||
|
||||
class DocumentSequenceRepository {
|
||||
final _supabase = GetIt.I.get<SupabaseClient>();
|
||||
|
||||
Future<List<DocumentSequence>> getDocumentSequences(String companyId) async {
|
||||
final response = await _supabase
|
||||
.from('document_sequences')
|
||||
.select()
|
||||
.eq('company_id', companyId);
|
||||
|
||||
return (response as List).map((e) => DocumentSequence.fromMap(e)).toList();
|
||||
}
|
||||
|
||||
Future<void> updateSequence({
|
||||
required String companyId,
|
||||
required String docType,
|
||||
required int nextValue,
|
||||
required String prefix,
|
||||
}) async {
|
||||
await _supabase.from('document_sequences').upsert({
|
||||
'company_id': companyId,
|
||||
'doc_type': docType,
|
||||
'next_value': nextValue,
|
||||
'prefix': prefix,
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user