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

37 lines
996 B
Go

package productbatch
import (
"muyu-apiserver/gateway/internal/types"
"muyu-apiserver/rpc/inventory/pb"
)
func batchInputToPB(input types.ProductBatchInput) *pb.ProductBatchInput {
return &pb.ProductBatchInput{
BatchNo: input.BatchNo,
YarnRatio: input.YarnRatio,
WarpWeightGM: input.WarpWeightGM,
WeftWeightGM: input.WeftWeightGM,
ProductionProcess: input.ProductionProcess,
Remark: input.Remark,
}
}
func batchInfoFromPB(b *pb.ProductBatchInfo) types.ProductBatchInfo {
if b == nil {
return types.ProductBatchInfo{}
}
return types.ProductBatchInfo{
BatchId: b.BatchId,
ProductId: b.ProductId,
BatchNo: b.BatchNo,
YarnRatio: b.YarnRatio,
WarpWeightGM: b.WarpWeightGM,
WeftWeightGM: b.WeftWeightGM,
ProductionProcess: b.ProductionProcess,
Remark: b.Remark,
Status: b.Status,
CreatedAt: b.CreatedAt,
UpdatedAt: b.UpdatedAt,
}
}