51 lines
2.0 KiB
Go
51 lines
2.0 KiB
Go
package payment
|
|
|
|
import walletv1 "hyapp.local/api/proto/wallet/v1"
|
|
|
|
type rechargeBillDTO struct {
|
|
AppCode string `json:"appCode"`
|
|
TransactionID string `json:"transactionId"`
|
|
CommandID string `json:"commandId"`
|
|
RechargeType string `json:"rechargeType"`
|
|
Status string `json:"status"`
|
|
ExternalRef string `json:"externalRef"`
|
|
UserID int64 `json:"userId"`
|
|
SellerUserID int64 `json:"sellerUserId"`
|
|
SellerRegionID int64 `json:"sellerRegionId"`
|
|
TargetRegionID int64 `json:"targetRegionId"`
|
|
PolicyID int64 `json:"policyId"`
|
|
PolicyVersion string `json:"policyVersion"`
|
|
CurrencyCode string `json:"currencyCode"`
|
|
CoinAmount int64 `json:"coinAmount"`
|
|
USDMinorAmount int64 `json:"usdMinorAmount"`
|
|
ExchangeCoinAmount int64 `json:"exchangeCoinAmount"`
|
|
ExchangeUSDMinorAmount int64 `json:"exchangeUsdMinorAmount"`
|
|
CreatedAtMS int64 `json:"createdAtMs"`
|
|
}
|
|
|
|
func rechargeBillFromProto(item *walletv1.RechargeBill) rechargeBillDTO {
|
|
if item == nil {
|
|
return rechargeBillDTO{}
|
|
}
|
|
return rechargeBillDTO{
|
|
AppCode: item.GetAppCode(),
|
|
TransactionID: item.GetTransactionId(),
|
|
CommandID: item.GetCommandId(),
|
|
RechargeType: item.GetRechargeType(),
|
|
Status: item.GetStatus(),
|
|
ExternalRef: item.GetExternalRef(),
|
|
UserID: item.GetUserId(),
|
|
SellerUserID: item.GetSellerUserId(),
|
|
SellerRegionID: item.GetSellerRegionId(),
|
|
TargetRegionID: item.GetTargetRegionId(),
|
|
PolicyID: item.GetPolicyId(),
|
|
PolicyVersion: item.GetPolicyVersion(),
|
|
CurrencyCode: item.GetCurrencyCode(),
|
|
CoinAmount: item.GetCoinAmount(),
|
|
USDMinorAmount: item.GetUsdMinorAmount(),
|
|
ExchangeCoinAmount: item.GetExchangeCoinAmount(),
|
|
ExchangeUSDMinorAmount: item.GetExchangeUsdMinorAmount(),
|
|
CreatedAtMS: item.GetCreatedAtMs(),
|
|
}
|
|
}
|