Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EPMUII-8637 Order - Order status current date #59

Merged
merged 7 commits into from
Oct 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions internal/repositories/order_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (r *orderStatusRepository) UpdateStatus(ctx context.Context, userID int, st
}
_, err = tx.OrderStatus.Create().
SetComment(*status.Comment).
SetCurrentDate(time.Time(*status.CreatedAt)).
SetCurrentDate(time.Now()).
SetOrder(receivedOrder).
SetOrderStatusName(statusName).
SetUsers(receivedUser).Save(ctx)
Expand Down Expand Up @@ -139,7 +139,7 @@ func (r *orderStatusRepository) GetOrderCurrentStatus(ctx context.Context, order
WithOrder(func(query *ent.OrderQuery) {
query.WithUsers()
}).
Order(ent.Desc(orderstatus.FieldCurrentDate)).First(ctx)
Order(ent.Desc(orderstatus.FieldID)).First(ctx)
if err != nil {
return nil, fmt.Errorf("status history error, failed to get statuses: %s", err)
}
Expand Down