2024-04-18 17:10:23 +00:00
|
|
|
package transfer
|
2024-05-02 19:36:53 +00:00
|
|
|
import(
|
2024-11-18 07:23:41 +00:00
|
|
|
"gitea.pena/PenaSide/customer/internal/models"
|
|
|
|
"gitea.pena/PenaSide/customer/internal/proto/treasurer"
|
2024-05-02 19:36:53 +00:00
|
|
|
)
|
|
|
|
func ReceiptItemToProto(in models.Item) *treasurer.Item {
|
|
|
|
return &treasurer.Item{
|
|
|
|
Description: in.Description,
|
|
|
|
Measure: in.Measure,
|
|
|
|
Quantity: in.Quantity,
|
|
|
|
Money: in.Money,
|
|
|
|
Currency: in.Currency,
|
|
|
|
}
|
|
|
|
}
|
2024-04-18 17:10:23 +00:00
|
|
|
|
2024-05-02 19:36:53 +00:00
|
|
|
func ReceiptItemsToProto(in []models.Item) []*treasurer.Item {
|
|
|
|
result := make([]*treasurer.Item, len(in), len(in))
|
|
|
|
for i, item := range in {
|
|
|
|
result[i] = ReceiptItemToProto(item)
|
|
|
|
}
|
|
|
|
return result
|
|
|
|
}
|