Web users may only CRUD their own records, operators stay in assigned branches, and admin/manager/superadmin keep full access. Co-authored-by: Cursor <cursoragent@cursor.com>
62 lines
2.5 KiB
Go
62 lines
2.5 KiB
Go
package cardbalance
|
|
|
|
import (
|
|
"time"
|
|
|
|
"online-back/internal/cards/shared"
|
|
)
|
|
|
|
type CardBalanceDTO struct {
|
|
Id int64 `json:"id"`
|
|
PassportNumber string `json:"passportNumber"`
|
|
CardLast4 string `json:"cardLast4"`
|
|
ExpiryMonth int16 `json:"expiryMonth"`
|
|
ExpiryYear int16 `json:"expiryYear"`
|
|
ExpiryAt time.Time `json:"expiryAt"`
|
|
BalanceAmount *float64 `json:"balanceAmount"`
|
|
BalanceCurrency string `json:"balanceCurrency"`
|
|
Status string `json:"status"`
|
|
CheckedAt *time.Time `json:"checkedAt"`
|
|
CreatedById *int64 `json:"-"`
|
|
CreatedBy *shared.UserInfo `json:"createdBy,omitempty"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
}
|
|
|
|
type CreateCardBalanceDTO struct {
|
|
PassportNumber string `json:"passportNumber" binding:"required"`
|
|
CardNumber string `json:"cardNumber" binding:"required"`
|
|
ExpiryMonth int16 `json:"expiryMonth" binding:"required"`
|
|
ExpiryYear int16 `json:"expiryYear" binding:"required"`
|
|
BalanceAmount *float64 `json:"balanceAmount"`
|
|
BalanceCurrency *string `json:"balanceCurrency"`
|
|
Status *string `json:"status"`
|
|
CheckedAt *shared.FlexibleTime `json:"checkedAt" swaggertype:"string" format:"date-time"`
|
|
CreatedBy *shared.FlexibleInt64 `json:"createdBy" swaggertype:"integer"`
|
|
}
|
|
|
|
type UpdateCardBalanceDTO struct {
|
|
PassportNumber string `json:"passportNumber" binding:"required"`
|
|
CardNumber string `json:"cardNumber" binding:"required"`
|
|
ExpiryMonth int16 `json:"expiryMonth" binding:"required"`
|
|
ExpiryYear int16 `json:"expiryYear" binding:"required"`
|
|
BalanceAmount *float64 `json:"balanceAmount"`
|
|
BalanceCurrency *string `json:"balanceCurrency"`
|
|
Status *string `json:"status"`
|
|
CheckedAt *shared.FlexibleTime `json:"checkedAt" swaggertype:"string" format:"date-time"`
|
|
CreatedBy *shared.FlexibleInt64 `json:"createdBy" swaggertype:"integer"`
|
|
}
|
|
|
|
type ListFilter struct {
|
|
Status *string
|
|
PassportNumber string
|
|
CreatedBy *int64
|
|
Page int
|
|
Limit int
|
|
}
|
|
|
|
type ListCardBalanceDTO struct {
|
|
Count int64 `json:"count"`
|
|
CardBalances []CardBalanceDTO `json:"cardBalances"`
|
|
}
|