kae_mihara e3f6fa236d
feat:improve product yarn ratio workflow (#5)
* feat: support product yarn batches

* feat: improve product yarn ratio workflow

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-05 08:06:28 +09:00

26 lines
648 B
Go

package logic
import (
"fmt"
"muyu-apiserver/model"
"muyu-apiserver/rpc/inventory/pb"
)
func yarnToPb(yarn *model.InvYarn, supplierName string) *pb.YarnInfo {
return &pb.YarnInfo{
YarnId: yarn.YarnId,
YarnName: yarn.YarnName,
Color: yarn.Color,
WeightGM: fmt.Sprintf("%.4f", yarn.WeightGM),
SupplierId: yarn.SupplierId,
SupplierName: supplierName,
DyeFactory: yarn.DyeFactory,
ImageUrl: yarn.ImageUrl,
Remark: yarn.Remark.String,
Status: yarn.Status,
CreatedAt: yarn.CreatedAt.Format("2006-01-02 15:04:05"),
UpdatedAt: yarn.UpdatedAt.Format("2006-01-02 15:04:05"),
}
}