add notes

This commit is contained in:
aditya.siregar
2025-05-16 13:18:11 +07:00
parent dea7d4c2b3
commit 2b1c49ad63
7 changed files with 18 additions and 2 deletions
+2
View File
@@ -40,6 +40,7 @@ type OrderItemDB struct {
CreatedBy int64 `gorm:"column:created_by"`
CreatedAt time.Time `gorm:"column:created_at"`
Product ProductDB `gorm:"foreignKey:ItemID;references:ID"`
Notes string `gorm:"column:notes"`
}
func (OrderItemDB) TableName() string {
@@ -83,6 +84,7 @@ type InquiryItemDB struct {
Quantity int `gorm:"column:quantity"`
CreatedBy int64 `gorm:"column:created_by"`
CreatedAt time.Time `gorm:"column:created_at"`
Notes string `gorm:"column:notes"`
}
func (InquiryItemDB) TableName() string {
+4
View File
@@ -148,6 +148,7 @@ func (r *orderRepository) CreateInquiry(ctx mycontext.Context, inquiry *entity.O
Quantity: item.Quantity,
CreatedBy: item.CreatedBy,
CreatedAt: time.Now(),
Notes: item.Notes,
})
}
@@ -202,6 +203,7 @@ func (r *orderRepository) FindInquiryByID(ctx mycontext.Context, id string) (*en
Quantity: itemDB.Quantity,
CreatedBy: itemDB.CreatedBy,
CreatedAt: itemDB.CreatedAt,
Notes: itemDB.Notes,
})
}
inquiry.OrderItems = orderItems
@@ -264,6 +266,7 @@ func (r *orderRepository) toDomainOrderModel(dbModel *models.OrderDB) *entity.Or
Quantity: itemDB.Quantity,
CreatedBy: itemDB.CreatedBy,
CreatedAt: itemDB.CreatedAt,
Notes: itemDB.Notes,
})
}
@@ -300,6 +303,7 @@ func (r *orderRepository) toOrderItemDBModel(item *entity.OrderItem) models.Orde
Quantity: item.Quantity,
CreatedBy: item.CreatedBy,
CreatedAt: item.CreatedAt,
Notes: item.Notes,
}
}