Merge pull request 'fix: use created time from cmd' (#70) from fix-add-kot-created-time into master
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

Reviewed-on: #70
This commit is contained in:
Aravinth Manivannan 2024-07-23 21:10:05 +05:30
commit 54471351c6

View file

@ -55,7 +55,7 @@ impl AddKotUseCase for AddKotService {
}
let kot = KotBuilder::default()
.created_time(OffsetDateTime::now_utc())
.created_time(cmd.created_time().clone())
.order_id(*cmd.order_id())
.kot_id(kot_id)
.deleted(false)
@ -107,6 +107,7 @@ pub mod tests {
let res = s.add_kot(cmd.clone()).await.unwrap();
assert_eq!(res.kot().order_id(), cmd.order_id());
assert!(!res.kot().deleted());
assert_eq!(res.kot().created_time(), cmd.created_time());
assert_eq!(res.added_by_user(), cmd.adding_by());
}