fix: use created time from cmd #70

Merged
realaravinth merged 1 commit from fix-add-kot-created-time into master 2024-07-23 21:10:06 +05:30

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());
} }