auth, user, userbranch and org/branches each declared their own identical
{en, ru, tm} struct; they now use shared.LocalizedText. No JSON change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
85 lines
4.3 KiB
Go
85 lines
4.3 KiB
Go
package branches
|
|
|
|
import "online-back/internal/shared"
|
|
|
|
type BranchDTO struct {
|
|
Id int64 `json:"id"`
|
|
UniqueCode string `json:"uniqueCode"`
|
|
Name shared.LocalizedText `json:"name"`
|
|
Address shared.LocalizedText `json:"address"`
|
|
Region string `json:"region"`
|
|
ProvinceId *int64 `json:"provinceId"`
|
|
ProvinceName shared.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 shared.LocalizedText `json:"name" binding:"required"`
|
|
Address shared.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 shared.LocalizedText `json:"name" binding:"required"`
|
|
Address shared.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 shared.LocalizedText `json:"name"`
|
|
ProvinceName shared.LocalizedText `json:"provinceName"`
|
|
PhoneNumbers string `json:"phoneNumbers"`
|
|
Active bool `json:"active"`
|
|
}
|
|
|
|
type ListBranchDTO struct {
|
|
Count int64 `json:"count"`
|
|
Branches []BranchListItemDTO `json:"branches"`
|
|
}
|