feat: Add hourly rate field to order position arguments and update related blocs
This commit is contained in:
@@ -10,6 +10,7 @@ class OneTimeOrderPositionArgument extends UseCaseArgument {
|
|||||||
required this.endTime,
|
required this.endTime,
|
||||||
this.roleName,
|
this.roleName,
|
||||||
this.lunchBreak,
|
this.lunchBreak,
|
||||||
|
this.hourlyRateCents,
|
||||||
});
|
});
|
||||||
|
|
||||||
/// The role ID for this position.
|
/// The role ID for this position.
|
||||||
@@ -30,9 +31,19 @@ class OneTimeOrderPositionArgument extends UseCaseArgument {
|
|||||||
/// Break duration label (e.g. `'MIN_30'`, `'NO_BREAK'`), if set.
|
/// Break duration label (e.g. `'MIN_30'`, `'NO_BREAK'`), if set.
|
||||||
final String? lunchBreak;
|
final String? lunchBreak;
|
||||||
|
|
||||||
|
/// Hourly rate in cents for this position, if set.
|
||||||
|
final int? hourlyRateCents;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Object?> get props =>
|
List<Object?> get props => <Object?>[
|
||||||
<Object?>[roleId, roleName, workerCount, startTime, endTime, lunchBreak];
|
roleId,
|
||||||
|
roleName,
|
||||||
|
workerCount,
|
||||||
|
startTime,
|
||||||
|
endTime,
|
||||||
|
lunchBreak,
|
||||||
|
hourlyRateCents,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Typed arguments for [CreateOneTimeOrderUseCase].
|
/// Typed arguments for [CreateOneTimeOrderUseCase].
|
||||||
@@ -84,6 +95,7 @@ class OneTimeOrderArguments extends UseCaseArgument {
|
|||||||
p.lunchBreak != 'NO_BREAK' &&
|
p.lunchBreak != 'NO_BREAK' &&
|
||||||
p.lunchBreak!.isNotEmpty)
|
p.lunchBreak!.isNotEmpty)
|
||||||
'lunchBreakMinutes': breakMinutesFromLabel(p.lunchBreak!),
|
'lunchBreakMinutes': breakMinutesFromLabel(p.lunchBreak!),
|
||||||
|
if (p.hourlyRateCents != null) 'hourlyRateCents': p.hourlyRateCents,
|
||||||
};
|
};
|
||||||
}).toList();
|
}).toList();
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ class PermanentOrderPositionArgument extends UseCaseArgument {
|
|||||||
required this.startTime,
|
required this.startTime,
|
||||||
required this.endTime,
|
required this.endTime,
|
||||||
this.roleName,
|
this.roleName,
|
||||||
|
this.hourlyRateCents,
|
||||||
});
|
});
|
||||||
|
|
||||||
/// The role ID for this position.
|
/// The role ID for this position.
|
||||||
@@ -26,9 +27,18 @@ class PermanentOrderPositionArgument extends UseCaseArgument {
|
|||||||
/// Shift end time in HH:mm format.
|
/// Shift end time in HH:mm format.
|
||||||
final String endTime;
|
final String endTime;
|
||||||
|
|
||||||
|
/// Hourly rate in cents for this position, if set.
|
||||||
|
final int? hourlyRateCents;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Object?> get props =>
|
List<Object?> get props => <Object?>[
|
||||||
<Object?>[roleId, roleName, workerCount, startTime, endTime];
|
roleId,
|
||||||
|
roleName,
|
||||||
|
workerCount,
|
||||||
|
startTime,
|
||||||
|
endTime,
|
||||||
|
hourlyRateCents,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Typed arguments for [CreatePermanentOrderUseCase].
|
/// Typed arguments for [CreatePermanentOrderUseCase].
|
||||||
@@ -95,6 +105,7 @@ class PermanentOrderArguments extends UseCaseArgument {
|
|||||||
'workerCount': p.workerCount,
|
'workerCount': p.workerCount,
|
||||||
'startTime': toUtcTimeHHmm(startDate, p.startTime),
|
'startTime': toUtcTimeHHmm(startDate, p.startTime),
|
||||||
'endTime': toUtcTimeHHmm(startDate, p.endTime),
|
'endTime': toUtcTimeHHmm(startDate, p.endTime),
|
||||||
|
if (p.hourlyRateCents != null) 'hourlyRateCents': p.hourlyRateCents,
|
||||||
};
|
};
|
||||||
}).toList();
|
}).toList();
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ class RecurringOrderPositionArgument extends UseCaseArgument {
|
|||||||
required this.startTime,
|
required this.startTime,
|
||||||
required this.endTime,
|
required this.endTime,
|
||||||
this.roleName,
|
this.roleName,
|
||||||
|
this.hourlyRateCents,
|
||||||
});
|
});
|
||||||
|
|
||||||
/// The role ID for this position.
|
/// The role ID for this position.
|
||||||
@@ -26,9 +27,18 @@ class RecurringOrderPositionArgument extends UseCaseArgument {
|
|||||||
/// Shift end time in HH:mm format.
|
/// Shift end time in HH:mm format.
|
||||||
final String endTime;
|
final String endTime;
|
||||||
|
|
||||||
|
/// Hourly rate in cents for this position, if set.
|
||||||
|
final int? hourlyRateCents;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Object?> get props =>
|
List<Object?> get props => <Object?>[
|
||||||
<Object?>[roleId, roleName, workerCount, startTime, endTime];
|
roleId,
|
||||||
|
roleName,
|
||||||
|
workerCount,
|
||||||
|
startTime,
|
||||||
|
endTime,
|
||||||
|
hourlyRateCents,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Typed arguments for [CreateRecurringOrderUseCase].
|
/// Typed arguments for [CreateRecurringOrderUseCase].
|
||||||
@@ -100,6 +110,7 @@ class RecurringOrderArguments extends UseCaseArgument {
|
|||||||
'workerCount': p.workerCount,
|
'workerCount': p.workerCount,
|
||||||
'startTime': toUtcTimeHHmm(startDate, p.startTime),
|
'startTime': toUtcTimeHHmm(startDate, p.startTime),
|
||||||
'endTime': toUtcTimeHHmm(startDate, p.endTime),
|
'endTime': toUtcTimeHHmm(startDate, p.endTime),
|
||||||
|
if (p.hourlyRateCents != null) 'hourlyRateCents': p.hourlyRateCents,
|
||||||
};
|
};
|
||||||
}).toList();
|
}).toList();
|
||||||
|
|
||||||
|
|||||||
@@ -265,6 +265,8 @@ class OneTimeOrderBloc extends Bloc<OneTimeOrderEvent, OneTimeOrderState>
|
|||||||
startTime: p.startTime,
|
startTime: p.startTime,
|
||||||
endTime: p.endTime,
|
endTime: p.endTime,
|
||||||
lunchBreak: p.lunchBreak,
|
lunchBreak: p.lunchBreak,
|
||||||
|
hourlyRateCents:
|
||||||
|
role != null ? (role.costPerHour * 100).round() : null,
|
||||||
);
|
);
|
||||||
}).toList();
|
}).toList();
|
||||||
|
|
||||||
|
|||||||
@@ -360,6 +360,8 @@ class PermanentOrderBloc extends Bloc<PermanentOrderEvent, PermanentOrderState>
|
|||||||
workerCount: p.count,
|
workerCount: p.count,
|
||||||
startTime: p.startTime,
|
startTime: p.startTime,
|
||||||
endTime: p.endTime,
|
endTime: p.endTime,
|
||||||
|
hourlyRateCents:
|
||||||
|
role != null ? (role.costPerHour * 100).round() : null,
|
||||||
);
|
);
|
||||||
}).toList();
|
}).toList();
|
||||||
|
|
||||||
|
|||||||
@@ -380,6 +380,8 @@ class RecurringOrderBloc extends Bloc<RecurringOrderEvent, RecurringOrderState>
|
|||||||
workerCount: p.count,
|
workerCount: p.count,
|
||||||
startTime: p.startTime,
|
startTime: p.startTime,
|
||||||
endTime: p.endTime,
|
endTime: p.endTime,
|
||||||
|
hourlyRateCents:
|
||||||
|
role != null ? (role.costPerHour * 100).round() : null,
|
||||||
);
|
);
|
||||||
}).toList();
|
}).toList();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user