Files
online-backend/internal/org/branches/dto.go
GuwandykA 4f3631c70d
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 branches
2026-09-30 13:48:35 +05:00

89 lines
4.0 KiB
Go

package branches
type LocalizedText struct {
En string `json:"en"`
Ru string `json:"ru"`
Tm string `json:"tm"`
}
type BranchDTO struct {
Id int64 `json:"id"`
UniqueCode string `json:"uniqueCode"`
Name LocalizedText `json:"name"`
Address LocalizedText `json:"address"`
Region string `json:"region"`
ProvinceId *int64 `json:"provinceId"`
ProvinceName LocalizedText `json:"provinceName"`
PhoneNumbers string `json:"phoneNumbers"`
BillingUsername string `json:"billingUsername"`
BillingPassword string `json:"billingPassword"`
BillingSberUsername string `json:"billingSberUsername"`
BillingSberPassword string `json:"billingSberPassword"`
BillingVisaMasterUsername string `json:"billingVisaMasterUsername"`
BillingVisaMasterPassword string `json:"billingVisaMasterPassword"`
BillingSwiftUsername string `json:"billingSwiftUsername"`
BillingSwiftPassword string `json:"billingSwiftPassword"`
Active bool `json:"active"`
}
type CreateBranchDTO struct {
UniqueCode string `json:"uniqueCode" binding:"required,numeric,len=4"`
Name LocalizedText `json:"name" binding:"required"`
Address LocalizedText `json:"address" binding:"required"`
Region string `json:"region" binding:"required"`
ProvinceId *int64 `json:"provinceId"`
PhoneNumbers string `json:"phoneNumbers"`
BillingUsername string `json:"billingUsername"`
BillingPassword string `json:"billingPassword"`
BillingSberUsername string `json:"billingSberUsername"`
BillingSberPassword string `json:"billingSberPassword"`
BillingVisaMasterUsername string `json:"billingVisaMasterUsername"`
BillingVisaMasterPassword string `json:"billingVisaMasterPassword"`
BillingSwiftUsername string `json:"billingSwiftUsername"`
BillingSwiftPassword string `json:"billingSwiftPassword"`
Active *bool `json:"active"`
}
type UpdateBranchDTO struct {
Name LocalizedText `json:"name" binding:"required"`
Address LocalizedText `json:"address" binding:"required"`
Region string `json:"region" binding:"required"`
ProvinceId *int64 `json:"provinceId"`
PhoneNumbers string `json:"phoneNumbers"`
BillingUsername string `json:"billingUsername"`
BillingPassword string `json:"billingPassword"`
BillingSberUsername string `json:"billingSberUsername"`
BillingSberPassword string `json:"billingSberPassword"`
BillingVisaMasterUsername string `json:"billingVisaMasterUsername"`
BillingVisaMasterPassword string `json:"billingVisaMasterPassword"`
BillingSwiftUsername string `json:"billingSwiftUsername"`
BillingSwiftPassword string `json:"billingSwiftPassword"`
Active bool `json:"active"`
}
type ListFilter struct {
ProvinceID *int64
ProvinceName string
BranchName string
UniqueCode string
BranchIds []int64
Page int
Limit int
}
// BranchListItemDTO is the list row; address, region and billing credentials
// come from GET /branches/:id.
type BranchListItemDTO struct {
Id int64 `json:"id"`
UniqueCode string `json:"uniqueCode"`
Name LocalizedText `json:"name"`
ProvinceName LocalizedText `json:"provinceName"`
PhoneNumbers string `json:"phoneNumbers"`
Active bool `json:"active"`
}
type ListBranchDTO struct {
Count int64 `json:"count"`
Branches []BranchListItemDTO `json:"branches"`
}