fix: use created time from cmd
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
ci/woodpecker/pull_request_closed/woodpecker Pipeline was successful

This commit is contained in:
Aravinth Manivannan 2024-07-23 20:51:11 +05:30
parent 366c7dc639
commit df7ec8cfd4
Signed by: realaravinth
GPG key ID: F8F50389936984FF

View file

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