21 lines
562 B
Go
Raw Normal View History

2025-06-14 21:17:13 +07:00
package request
import "enaklo-pos-be/internal/entity"
type OpenCashierSessionRequest struct {
2025-06-27 13:01:39 +07:00
PartnerID int64 `json:"partner_id" validate:"required"`
2025-06-14 21:17:13 +07:00
OpeningAmount float64 `json:"opening_amount" validate:"required,gt=0"`
}
type CloseCashierSessionRequest struct {
ClosingAmount float64 `json:"closing_amount" validate:"required"`
}
func (o *OpenCashierSessionRequest) ToEntity(cashierID int64) *entity.CashierSession {
return &entity.CashierSession{
2025-06-27 13:01:39 +07:00
PartnerID: o.PartnerID,
2025-06-14 21:17:13 +07:00
CashierID: cashierID,
OpeningAmount: o.OpeningAmount,
}
}