package cardorder import ( "time" "online-back/internal/shared" ) type CardOrderDTO struct { Id int64 `json:"id"` UniqueId *string `json:"uniqueId"` CardStateId int64 `json:"-"` CardState *shared.NamedInfo `json:"cardState,omitempty"` CardTypeId int64 `json:"-"` CardType *shared.NamedInfo `json:"cardType,omitempty"` Region string `json:"region"` BranchId int64 `json:"-"` Branch *shared.NamedInfo `json:"branch,omitempty"` CustomerName string `json:"customerName"` CustomerSurname string `json:"customerSurname"` CustomerPatronicName *string `json:"customerPatronicName"` BornAt *time.Time `json:"bornAt"` OldSurname *string `json:"oldSurname"` Citizenship string `json:"citizenship"` PassportSerie string `json:"passportSerie"` PassportId string `json:"passportId"` PassportGivenAt time.Time `json:"passportGivenAt"` PassportGivenBy string `json:"passportGivenBy"` BornPlace string `json:"bornPlace"` JobLocation *string `json:"jobLocation"` PassportAddress *string `json:"passportAddress"` RealAddress *string `json:"realAddress"` Phone *string `json:"phone"` PhoneAdditional *string `json:"phoneAdditional"` Status *string `json:"status"` PassportOne string `json:"passportOne"` PassportTwo string `json:"passportTwo"` PassportThree string `json:"passportThree"` PassportFour string `json:"passportFour"` Notes *string `json:"notes"` UserId *int64 `json:"-"` User *shared.UserInfo `json:"user,omitempty"` Paid bool `json:"paid"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` } type CreateCardOrderDTO struct { UniqueId *string `json:"uniqueId"` CardStateId shared.FlexibleInt64 `json:"cardStateId" binding:"required" swaggertype:"integer"` CardTypeId shared.FlexibleInt64 `json:"cardTypeId" binding:"required" swaggertype:"integer"` Region string `json:"region" binding:"required"` BranchId shared.FlexibleInt64 `json:"branchId" binding:"required" swaggertype:"integer"` CustomerName string `json:"customerName" binding:"required"` CustomerSurname string `json:"customerSurname" binding:"required"` CustomerPatronicName *string `json:"customerPatronicName"` BornAt *shared.FlexibleTime `json:"bornAt" swaggertype:"string" format:"date"` OldSurname *string `json:"oldSurname"` Citizenship string `json:"citizenship" binding:"required"` PassportSerie string `json:"passportSerie" binding:"required"` PassportId string `json:"passportId" binding:"required"` PassportGivenAt shared.FlexibleTime `json:"passportGivenAt" swaggertype:"string" format:"date"` PassportGivenBy string `json:"passportGivenBy" binding:"required"` BornPlace string `json:"bornPlace" binding:"required"` JobLocation *string `json:"jobLocation"` PassportAddress *string `json:"passportAddress"` RealAddress *string `json:"realAddress"` Phone *string `json:"phone"` PhoneAdditional *string `json:"phoneAdditional"` Status *string `json:"status"` PassportOne string `json:"passportOne" binding:"required"` PassportTwo string `json:"passportTwo" binding:"required"` PassportThree string `json:"passportThree" binding:"required"` PassportFour string `json:"passportFour" binding:"required"` Notes *string `json:"notes"` UserId *shared.FlexibleInt64 `json:"userId" swaggertype:"integer"` Paid *bool `json:"paid"` } type UpdateCardOrderDTO struct { UniqueId *string `json:"uniqueId"` CardStateId shared.FlexibleInt64 `json:"cardStateId" binding:"required" swaggertype:"integer"` CardTypeId shared.FlexibleInt64 `json:"cardTypeId" binding:"required" swaggertype:"integer"` Region string `json:"region" binding:"required"` BranchId shared.FlexibleInt64 `json:"branchId" binding:"required" swaggertype:"integer"` CustomerName string `json:"customerName" binding:"required"` CustomerSurname string `json:"customerSurname" binding:"required"` CustomerPatronicName *string `json:"customerPatronicName"` BornAt *shared.FlexibleTime `json:"bornAt" swaggertype:"string" format:"date"` OldSurname *string `json:"oldSurname"` Citizenship string `json:"citizenship" binding:"required"` PassportSerie string `json:"passportSerie" binding:"required"` PassportId string `json:"passportId" binding:"required"` PassportGivenAt shared.FlexibleTime `json:"passportGivenAt" swaggertype:"string" format:"date"` PassportGivenBy string `json:"passportGivenBy" binding:"required"` BornPlace string `json:"bornPlace" binding:"required"` JobLocation *string `json:"jobLocation"` PassportAddress *string `json:"passportAddress"` RealAddress *string `json:"realAddress"` Phone *string `json:"phone"` PhoneAdditional *string `json:"phoneAdditional"` Status *string `json:"status"` PassportOne string `json:"passportOne" binding:"required"` PassportTwo string `json:"passportTwo" binding:"required"` PassportThree string `json:"passportThree" binding:"required"` PassportFour string `json:"passportFour" binding:"required"` Notes *string `json:"notes"` UserId *shared.FlexibleInt64 `json:"userId" swaggertype:"integer"` Paid bool `json:"paid"` } type ListFilter struct { Status *string BranchId *int64 BranchIds []int64 UserId *int64 CardStateId *int64 CardTypeId *int64 Region string Page int Limit int } // CardOrderListItemDTO is the list row; addresses, passport issue details // and scans come from GET /card-orders/:id. type CardOrderListItemDTO struct { Id int64 `json:"id"` UniqueId *string `json:"uniqueId"` CustomerName string `json:"customerName"` CustomerSurname string `json:"customerSurname"` CustomerPatronicName *string `json:"customerPatronicName"` Phone *string `json:"phone"` CardType *shared.NamedInfo `json:"cardType,omitempty"` CardState *shared.NamedInfo `json:"cardState,omitempty"` Branch *shared.NamedInfo `json:"branch,omitempty"` // ProvinceName is the branch's province (etrap). ProvinceName shared.LocalizedText `json:"provinceName"` Region string `json:"region"` PassportSerie string `json:"passportSerie"` PassportId string `json:"passportId"` User *ListUserDTO `json:"user,omitempty"` Status *string `json:"status"` Paid bool `json:"paid"` CreatedAt time.Time `json:"createdAt"` } type ListUserDTO struct { Id int64 `json:"id"` Name string `json:"name"` } type ListCardOrderDTO struct { Count int64 `json:"count"` CardOrders []CardOrderListItemDTO `json:"cardOrders"` }