expand orders #75

Merged
goc_daniel merged 3 commits from expand_orders into main 2026-04-16 14:25:59 +00:00
Owner
  • bugfix in auth.go
  • added fields BasePrice, TaxIncl, TaxExcl, UpdatedAt, CreatedAt
- bugfix in auth.go - added fields BasePrice, TaxIncl, TaxExcl, UpdatedAt, CreatedAt
goc_daniel added 1 commit 2026-04-16 09:49:08 +00:00
goc_daniel requested review from dudzic_wiktor 2026-04-16 13:00:19 +00:00
goc_daniel removed review request for dudzic_wiktor 2026-04-16 13:00:46 +00:00
goc_daniel added 2 commits 2026-04-16 13:02:42 +00:00
goc_daniel requested review from dudzic_wiktor 2026-04-16 13:03:38 +00:00
dudzic_wiktor requested changes 2026-04-16 13:22:21 +00:00
@@ -106,3 +115,3 @@
Table("b2b_customer_orders").
Where("order_id = ?", order_id).
Update("status", status).
Updates(map[string]interface{}{
Collaborator

this code is fine but just letting you know that when you use DB.Model() instead of DB.Table the updated_at columns is being updated by gorm automatically

this code is fine but just letting you know that when you use DB.Model() instead of DB.Table the updated_at columns is being updated by gorm automatically
goc_daniel marked this conversation as resolved
@@ -130,6 +130,7 @@ func (s *AuthService) Login(req *model.LoginRequest) (*model.AuthResponse, strin
user.LangID = *req.LangID
}
user.Country = nil
Collaborator

db shouldn't be called in the service and updating logic should be in single place in repo. that way we don't have to rely on remembering to nullify associated models like country.

Best approach would be to build a Customer model out of a DTO for this operation for the sake of safety.
But the customer struct is small enough that nullifying Country and Role would be sufficient for now.

db shouldn't be called in the service and updating logic should be in single place in repo. that way we don't have to rely on remembering to nullify associated models like country. Best approach would be to build a Customer model out of a DTO for this operation for the sake of safety. But the customer struct is small enough that nullifying Country and Role would be sufficient for now.
Author
Owner

yeah, it's old code, and it's coauthored by me and Marek. Let's leave things as they are (and hopefully not change Customer struct anymore)

yeah, it's old code, and it's coauthored by me and Marek. Let's leave things as they are (and hopefully not change Customer struct anymore)
goc_daniel marked this conversation as resolved
goc_daniel merged commit 931840c243 into main 2026-04-16 14:25:59 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: goc_daniel/b2b#75