Files
online-backend/internal/cards/visamaster/dto.go
GuwandykA 60787c8149
Some checks failed
CI/CD / Vet, test, build (push) Has been cancelled
CI/CD / Docker image (push) Has been cancelled
CI/CD / Deploy binary to server (push) Has been cancelled
ch something
2026-09-30 14:41:13 +05:00

151 lines
7.8 KiB
Go

package visamaster
import (
"encoding/json"
"time"
"online-back/internal/shared"
)
type BranchInfo struct {
Id int64 `json:"id"`
UniqueCode string `json:"uniqueCode"`
Name shared.LocalizedText `json:"name"`
Region string `json:"region"`
ProvinceId *int64 `json:"provinceId"`
ProvinceName shared.LocalizedText `json:"provinceName"`
}
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 shared.LocalizedText `json:"regionName,omitempty"`
BranchId int64 `json:"-"`
Branch BranchInfo `json:"branch"`
UserId *int64 `json:"-"`
User *shared.UserInfo `json:"user,omitempty"`
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"`
AmountUsd *float64 `json:"amountUsd"`
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"`
AmountUsd float64 `json:"amountUsd"`
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"`
AmountUsd float64 `json:"amountUsd"`
Paid bool `json:"paid"`
}
type ListFilter struct {
Name string
// Type narrows to one order type; ExcludeType drops one (the Visa/Master
// page hides sber, which has its own page).
Type string
ExcludeType string
Status *string
BranchId *int64
BranchIds []int64
UserId *int64
Region string
Page int
Limit int
}
// VisaMasterPaymentOrderListItemDTO is the list row (visa/master and sber);
// sender, receiver, documents and amounts come from GET /visa-master-payment-orders/:id.
type VisaMasterPaymentOrderListItemDTO struct {
Id int64 `json:"id"`
UniqueId *string `json:"uniqueId"`
Type *string `json:"type"`
CreatedAt time.Time `json:"createdAt"`
Region string `json:"region"`
// RegionName is the welaýat of the branch's province (Mary, Lebap, ...).
RegionName shared.LocalizedText `json:"regionName"`
Branch *shared.NamedInfo `json:"branch,omitempty"`
// ProvinceName is the branch's province (etrap).
ProvinceName shared.LocalizedText `json:"provinceName"`
PassportName string `json:"passportName"`
PassportSurname string `json:"passportSurname"`
Phone string `json:"phone"`
Status *string `json:"status"`
Paid bool `json:"paid"`
// PaidThisMonth: a successful payment exists for the current month's
// payment period (Ashgabat time).
PaidThisMonth bool `json:"paidThisMonth"`
}
type ListVisaMasterPaymentOrderDTO struct {
Count int64 `json:"count"`
VisaMasterPaymentOrders []VisaMasterPaymentOrderListItemDTO `json:"visaMasterPaymentOrders"`
}