30 lines
675 B
Dart
30 lines
675 B
Dart
enum DocumentType { ticket, shipment, invoice }
|
|
|
|
class DocumentSequence {
|
|
final String docType;
|
|
final int nextValue;
|
|
final String prefix;
|
|
|
|
DocumentSequence({
|
|
required this.docType,
|
|
required this.nextValue,
|
|
required this.prefix,
|
|
});
|
|
|
|
DocumentSequence copyWith({int? nextValue, String? prefix}) {
|
|
return DocumentSequence(
|
|
docType: docType,
|
|
nextValue: nextValue ?? this.nextValue,
|
|
prefix: prefix ?? this.prefix,
|
|
);
|
|
}
|
|
|
|
factory DocumentSequence.fromMap(Map<String, dynamic> map) {
|
|
return DocumentSequence(
|
|
docType: map['doc_type'],
|
|
nextValue: map['next_value'],
|
|
prefix: map['prefix'] ?? '',
|
|
);
|
|
}
|
|
}
|