Files
online-backend/internal/cards/visamaster/dto.go
GuwandykA 8795ae2195 Put the user's role and branch on GET /profile, upsert role_user and branch_user on POST, and drop their list endpoints.
Also accept flexible card-order form values, move mock seed under db/mock, and regenerate Swagger.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-22 17:56:07 +05:00

132 lines
6.3 KiB
Go

package visamaster
import (
"encoding/json"
"time"
)
type LocalizedText struct {
En string `json:"en"`
Ru string `json:"ru"`
Tm string `json:"tm"`
}
type BranchInfo struct {
Id int64 `json:"id"`
UniqueCode string `json:"uniqueCode"`
Name LocalizedText `json:"name"`
Region string `json:"region"`
ProvinceId *int64 `json:"provinceId"`
ProvinceName LocalizedText `json:"provinceName"`
}
type UserInfo struct {
Id int64 `json:"id"`
Name string `json:"name"`
Username string `json:"username"`
Phone string `json:"phone"`
Email string `json:"email"`
}
type VisaMasterPaymentOrderDTO struct {
Id int64 `json:"id"`
UniqueId *string `json:"uniqueId"`
Type *string `json:"type"`
PassportName string `json:"passportName"`
PassportSurname string `json:"passportSurname"`
Phone string `json:"phone"`
Email *string `json:"email"`
Region string `json:"region"`
RegionName LocalizedText `json:"regionName"`
BranchId int64 `json:"branchId"`
Branch BranchInfo `json:"branch"`
UserId *int64 `json:"userId"`
User *UserInfo `json:"user"`
Address string `json:"address"`
SenderDatas json.RawMessage `json:"senderDatas" swaggertype:"object"`
PaymentReciever json.RawMessage `json:"paymentReciever" swaggertype:"array,object"`
Documents json.RawMessage `json:"documents" swaggertype:"object"`
Status *string `json:"status"`
Notes *string `json:"notes"`
SenderFullName string `json:"senderFullName"`
SenderPassportSerie string `json:"senderPassportSerie"`
SenderPassportNumber string `json:"senderPassportNumber"`
SenderDepositAccount string `json:"senderDepositAccount"`
RecieverFullName *string `json:"recieverFullName"`
RecieverPassportSerie *string `json:"recieverPassportSerie"`
RecieverPassportNumber *string `json:"recieverPassportNumber"`
RecieverDepositAccount *string `json:"recieverDepositAccount"`
Paid bool `json:"paid"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
type CreateVisaMasterPaymentOrderDTO struct {
UniqueId *string `json:"uniqueId"`
Type *string `json:"type"`
PassportName string `json:"passportName" binding:"required"`
PassportSurname string `json:"passportSurname" binding:"required"`
Phone string `json:"phone" binding:"required"`
Email *string `json:"email"`
Region string `json:"region" binding:"required"`
BranchId int64 `json:"branchId" binding:"required"`
UserId *int64 `json:"userId"`
Address string `json:"address" binding:"required"`
SenderDatas json.RawMessage `json:"senderDatas" swaggertype:"object"`
PaymentReciever json.RawMessage `json:"paymentReciever" swaggertype:"array,object"`
Documents json.RawMessage `json:"documents" swaggertype:"object"`
Status *string `json:"status"`
Notes *string `json:"notes"`
SenderFullName string `json:"senderFullName" binding:"required"`
SenderPassportSerie string `json:"senderPassportSerie" binding:"required"`
SenderPassportNumber string `json:"senderPassportNumber" binding:"required"`
SenderDepositAccount string `json:"senderDepositAccount" binding:"required"`
RecieverFullName *string `json:"recieverFullName"`
RecieverPassportSerie *string `json:"recieverPassportSerie"`
RecieverPassportNumber *string `json:"recieverPassportNumber"`
RecieverDepositAccount *string `json:"recieverDepositAccount"`
Paid *bool `json:"paid"`
}
type UpdateVisaMasterPaymentOrderDTO struct {
UniqueId *string `json:"uniqueId"`
Type *string `json:"type"`
PassportName string `json:"passportName" binding:"required"`
PassportSurname string `json:"passportSurname" binding:"required"`
Phone string `json:"phone" binding:"required"`
Email *string `json:"email"`
Region string `json:"region" binding:"required"`
BranchId int64 `json:"branchId" binding:"required"`
UserId *int64 `json:"userId"`
Address string `json:"address" binding:"required"`
SenderDatas json.RawMessage `json:"senderDatas" swaggertype:"object"`
PaymentReciever json.RawMessage `json:"paymentReciever" swaggertype:"array,object"`
Documents json.RawMessage `json:"documents" swaggertype:"object"`
Status *string `json:"status"`
Notes *string `json:"notes"`
SenderFullName string `json:"senderFullName" binding:"required"`
SenderPassportSerie string `json:"senderPassportSerie" binding:"required"`
SenderPassportNumber string `json:"senderPassportNumber" binding:"required"`
SenderDepositAccount string `json:"senderDepositAccount" binding:"required"`
RecieverFullName *string `json:"recieverFullName"`
RecieverPassportSerie *string `json:"recieverPassportSerie"`
RecieverPassportNumber *string `json:"recieverPassportNumber"`
RecieverDepositAccount *string `json:"recieverDepositAccount"`
Paid bool `json:"paid"`
}
type ListFilter struct {
Name string
Status *string
BranchId *int64
UserId *int64
Region string
Page int
Limit int
}
type ListVisaMasterPaymentOrderDTO struct {
Count int64 `json:"count"`
VisaMasterPaymentOrders []VisaMasterPaymentOrderDTO `json:"visaMasterPaymentOrders"`
}