From df7ec8cfd4ee232b52e338412f969c125a4dfdd1 Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Tue, 23 Jul 2024 20:51:11 +0530 Subject: [PATCH] fix: use created time from cmd --- src/ordering/application/services/add_kot_service.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ordering/application/services/add_kot_service.rs b/src/ordering/application/services/add_kot_service.rs index f5bb481..09edd5d 100644 --- a/src/ordering/application/services/add_kot_service.rs +++ b/src/ordering/application/services/add_kot_service.rs @@ -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()); }