53 lines
1.3 KiB
Go
53 lines
1.3 KiB
Go
package cards
|
|
|
|
import (
|
|
"time"
|
|
|
|
"online-back/internal/shared"
|
|
)
|
|
|
|
type CardDTO struct {
|
|
Id int64 `json:"id"`
|
|
UserId *int64 `json:"-"`
|
|
User *shared.UserInfo `json:"user,omitempty"`
|
|
Number string `json:"number"`
|
|
Name string `json:"name"`
|
|
Month string `json:"month"`
|
|
Year *string `json:"year"`
|
|
Type *string `json:"-"`
|
|
CardType *shared.NamedInfo `json:"cardType,omitempty"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
}
|
|
|
|
type CreateCardDTO struct {
|
|
UserId *int64 `json:"userId"`
|
|
Number string `json:"number" binding:"required"`
|
|
Name string `json:"name" binding:"required"`
|
|
Month string `json:"month" binding:"required"`
|
|
Year *string `json:"year"`
|
|
Type *string `json:"type"`
|
|
}
|
|
|
|
type UpdateCardDTO struct {
|
|
UserId *int64 `json:"userId"`
|
|
Number string `json:"number" binding:"required"`
|
|
Name string `json:"name" binding:"required"`
|
|
Month string `json:"month" binding:"required"`
|
|
Year *string `json:"year"`
|
|
Type *string `json:"type"`
|
|
}
|
|
|
|
type ListFilter struct {
|
|
UserId *int64
|
|
BranchIds []int64
|
|
Type *string
|
|
Page int
|
|
Limit int
|
|
}
|
|
|
|
type ListCardDTO struct {
|
|
Count int64 `json:"count"`
|
|
Cards []CardDTO `json:"cards"`
|
|
}
|