Simplify lab trial dispatch and fix per-jaw pricing
This commit is contained in:
+23
-2
@@ -47,8 +47,8 @@ const visibleProstheticTypes = <ProstheticType>[
|
||||
|
||||
extension JobStatusExt on JobStatus {
|
||||
String get label => switch (this) {
|
||||
JobStatus.pending => 'Bekliyor',
|
||||
JobStatus.inProgress => 'İşlemde',
|
||||
JobStatus.pending => 'Üretim aşamasında · Kabul bekliyor',
|
||||
JobStatus.inProgress => 'Üretim aşamasında',
|
||||
JobStatus.sent => 'Gönderildi',
|
||||
JobStatus.delivered => 'Teslim Alındı',
|
||||
JobStatus.cancelled => 'İptal',
|
||||
@@ -556,6 +556,27 @@ class Job {
|
||||
bool get isLastStep =>
|
||||
currentStep != null && currentStep == stepTemplate.last;
|
||||
|
||||
JobStep labDispatchStep({required bool finish}) {
|
||||
if (status != JobStatus.inProgress || location != JobLocation.atLab) {
|
||||
throw StateError('İş üretim aşamasında ve laboratuvarda olmalıdır.');
|
||||
}
|
||||
if (finish) return JobStep.cilaBitim;
|
||||
if (!provaRequired) {
|
||||
throw StateError('Provasız iş provaya gönderilemez.');
|
||||
}
|
||||
const trialSteps = {
|
||||
JobStep.altYapiProva,
|
||||
JobStep.ustYapiProva,
|
||||
JobStep.mumProva,
|
||||
JobStep.dislerProva,
|
||||
JobStep.dayanakProva,
|
||||
JobStep.kronProva,
|
||||
};
|
||||
if (trialSteps.contains(currentStep)) return currentStep!;
|
||||
return stepTemplate.where(trialSteps.contains).firstOrNull ??
|
||||
JobStep.altYapiProva;
|
||||
}
|
||||
|
||||
/// The next step after currentStep in this job's template, or null if done.
|
||||
JobStep? get nextStep {
|
||||
if (currentStep == null) return stepTemplate.firstOrNull;
|
||||
|
||||
Reference in New Issue
Block a user