Simplify lab trial dispatch and fix per-jaw pricing

This commit is contained in:
egecankomur
2026-10-10 14:52:05 +03:00
parent f44e07f378
commit d20d44a1f3
6 changed files with 204 additions and 74 deletions
+6 -2
View File
@@ -38,7 +38,6 @@ class PricingService {
int billableUnitsForTeeth(ProstheticType type, Iterable<int> teeth) {
final selected = teeth.toSet();
if (selected.isEmpty) return billableUnitsForType(type, 0);
if (type.family == ProstheticFamily.hareketli) return 1;
final upper = {
for (int i = 11; i <= 18; i++) i,
@@ -49,6 +48,11 @@ class PricingService {
for (int i = 41; i <= 48; i++) i,
};
if (type.family == ProstheticFamily.hareketli) {
return (selected.any(upper.contains) ? 1 : 0) +
(selected.any(lower.contains) ? 1 : 0);
}
var units = 0;
final remaining = Set<int>.from(selected);
if (upper.every(selected.contains)) {
@@ -67,7 +71,7 @@ class PricingService {
ProstheticType.hareketli ||
ProstheticType.tamProtez ||
ProstheticType.parsiyel =>
'vaka',
'çene',
_ => 'diş',
};
}