Merge branch 'master' of git.selly.red:Selly-Modules/natsio into supplier-setup-product
This commit is contained in:
commit
4c328c0858
|
@ -34,3 +34,25 @@ func (c Campaign) GetCampaignTransaction(p model.GetCampaignTransactionsRequest)
|
||||||
}
|
}
|
||||||
return r.Data, nil
|
return r.Data, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetCampaignSellerStatistic ....
|
||||||
|
func (c Campaign) GetCampaignSellerStatistic(req model.GetCampaignSellerStatisticBySellerIDs) (*model.ResponseCampaignSellerStatisticList, error) {
|
||||||
|
msg, err := natsio.GetServer().Request(subject.Campaign.GetCampaignSellerStatisticBySellerIDs, toBytes(req))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var r struct {
|
||||||
|
Data *model.ResponseCampaignSellerStatisticList `json:"data"`
|
||||||
|
Error string `json:"error"`
|
||||||
|
}
|
||||||
|
|
||||||
|
if err = json.Unmarshal(msg.Data, &r); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if r.Error != "" {
|
||||||
|
return nil, errors.New(r.Error)
|
||||||
|
}
|
||||||
|
return r.Data, nil
|
||||||
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ func GetLocation() Location {
|
||||||
|
|
||||||
// GetLocationByCode ...
|
// GetLocationByCode ...
|
||||||
func (l Location) GetLocationByCode(payload model.LocationRequestPayload) (*model.ResponseLocationAddress, error) {
|
func (l Location) GetLocationByCode(payload model.LocationRequestPayload) (*model.ResponseLocationAddress, error) {
|
||||||
msg, err := natsio.GetServer().Request(subject.Location.GetLocationByCode, toBytes(payload))
|
msg, err := natsio.GetServer().Request(subject.Location.GetLocationByCodeFromLocationService, toBytes(payload))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ func (l Location) GetLocationByCode(payload model.LocationRequestPayload) (*mode
|
||||||
Data *model.ResponseLocationAddress `json:"data"`
|
Data *model.ResponseLocationAddress `json:"data"`
|
||||||
Error string `json:"error"`
|
Error string `json:"error"`
|
||||||
}
|
}
|
||||||
if err := json.Unmarshal(msg.Data, &r); err != nil {
|
if err = json.Unmarshal(msg.Data, &r); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,19 +38,19 @@ func (l Location) GetLocationByCode(payload model.LocationRequestPayload) (*mode
|
||||||
return r.Data, nil
|
return r.Data, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetProvincesByCodes ... ...
|
// GetProvincesByCodes ...
|
||||||
func (l Location) GetProvincesByCodes(p model.ProvinceRequestPayload) (*model.LocationProvinceResponse, error) {
|
func (l Location) GetProvincesByCodes(p model.ProvinceRequestPayload) (*model.LocationProvinceResponse, error) {
|
||||||
msg, err := natsio.GetServer().Request(subject.Location.GetProvincesByCodes, toBytes(p))
|
msg, err := natsio.GetServer().Request(subject.Location.GetProvincesByCodesFromLocationService, toBytes(p))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
var r struct {
|
var r struct {
|
||||||
Data *model.LocationProvinceResponse `json:"data"'`
|
Data *model.LocationProvinceResponse `json:"data"`
|
||||||
Error string `json:"error"`
|
Error string `json:"error"`
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := json.Unmarshal(msg.Data, &r); err != nil {
|
if err = json.Unmarshal(msg.Data, &r); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ func (l Location) GetProvincesByCodes(p model.ProvinceRequestPayload) (*model.Lo
|
||||||
|
|
||||||
// GetDistrictsByCodes ...
|
// GetDistrictsByCodes ...
|
||||||
func (l Location) GetDistrictsByCodes(p model.DistrictRequestPayload) (*model.LocationDistrictResponse, error) {
|
func (l Location) GetDistrictsByCodes(p model.DistrictRequestPayload) (*model.LocationDistrictResponse, error) {
|
||||||
msg, err := natsio.GetServer().Request(subject.Location.GetDistrictsByCodes, toBytes(p))
|
msg, err := natsio.GetServer().Request(subject.Location.GetDistrictsByCodesFromLocationService, toBytes(p))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ func (l Location) GetDistrictsByCodes(p model.DistrictRequestPayload) (*model.Lo
|
||||||
Error string `json:"error"`
|
Error string `json:"error"`
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := json.Unmarshal(msg.Data, &r); err != nil {
|
if err = json.Unmarshal(msg.Data, &r); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ func (l Location) GetDistrictsByCodes(p model.DistrictRequestPayload) (*model.Lo
|
||||||
|
|
||||||
// GetWardsByCodes ...
|
// GetWardsByCodes ...
|
||||||
func (l Location) GetWardsByCodes(p model.WardRequestPayload) (*model.LocationWardResponse, error) {
|
func (l Location) GetWardsByCodes(p model.WardRequestPayload) (*model.LocationWardResponse, error) {
|
||||||
msg, err := natsio.GetServer().Request(subject.Location.GetWardsByCodes, toBytes(p))
|
msg, err := natsio.GetServer().Request(subject.Location.GetWardsByCodesFromLocationService, toBytes(p))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ func (l Location) GetWardsByCodes(p model.WardRequestPayload) (*model.LocationWa
|
||||||
Error string `json:"error"`
|
Error string `json:"error"`
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := json.Unmarshal(msg.Data, &r); err != nil {
|
if err = json.Unmarshal(msg.Data, &r); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,3 +104,211 @@ func (l Location) GetWardsByCodes(p model.WardRequestPayload) (*model.LocationWa
|
||||||
|
|
||||||
return r.Data, nil
|
return r.Data, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetProvinceByCondition ...
|
||||||
|
func (l Location) GetProvinceByCondition(p model.RequestCondition) (*model.LocationProvinceDetailResponse, error) {
|
||||||
|
msg, err := natsio.GetServer().Request(subject.Location.GetProvinceByCondition, toBytes(p))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var r struct {
|
||||||
|
Data *model.LocationProvinceDetailResponse `json:"data"`
|
||||||
|
Error string `json:"error"`
|
||||||
|
}
|
||||||
|
|
||||||
|
if err = json.Unmarshal(msg.Data, &r); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if r.Error != "" {
|
||||||
|
return nil, errors.New(r.Error)
|
||||||
|
}
|
||||||
|
return r.Data, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetProvincesByCondition ...
|
||||||
|
func (l Location) GetProvincesByCondition(p model.RequestCondition) ([]*model.LocationProvinceDetailResponse, error) {
|
||||||
|
msg, err := natsio.GetServer().Request(subject.Location.GetProvincesByCondition, toBytes(p))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var r struct {
|
||||||
|
Data []*model.LocationProvinceDetailResponse `json:"data"`
|
||||||
|
Error string `json:"error"`
|
||||||
|
}
|
||||||
|
|
||||||
|
if err = json.Unmarshal(msg.Data, &r); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if r.Error != "" {
|
||||||
|
return nil, errors.New(r.Error)
|
||||||
|
}
|
||||||
|
return r.Data, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetDistrictByCondition ...
|
||||||
|
func (l Location) GetDistrictByCondition(p model.RequestCondition) (*model.LocationDistrictDetailResponse, error) {
|
||||||
|
msg, err := natsio.GetServer().Request(subject.Location.GetDistrictByCondition, toBytes(p))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var r struct {
|
||||||
|
Data *model.LocationDistrictDetailResponse `json:"data"`
|
||||||
|
Error string `json:"error"`
|
||||||
|
}
|
||||||
|
|
||||||
|
if err = json.Unmarshal(msg.Data, &r); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if r.Error != "" {
|
||||||
|
return nil, errors.New(r.Error)
|
||||||
|
}
|
||||||
|
return r.Data, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetDistrictsByCondition ...
|
||||||
|
func (l Location) GetDistrictsByCondition(p model.RequestCondition) ([]*model.LocationDistrictDetailResponse, error) {
|
||||||
|
msg, err := natsio.GetServer().Request(subject.Location.GetDistrictsByCondition, toBytes(p))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var r struct {
|
||||||
|
Data []*model.LocationDistrictDetailResponse `json:"data"`
|
||||||
|
Error string `json:"error"`
|
||||||
|
}
|
||||||
|
|
||||||
|
if err = json.Unmarshal(msg.Data, &r); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if r.Error != "" {
|
||||||
|
return nil, errors.New(r.Error)
|
||||||
|
}
|
||||||
|
return r.Data, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetWardByCondition ...
|
||||||
|
func (l Location) GetWardByCondition(p model.RequestCondition) (*model.LocationWardDetailResponse, error) {
|
||||||
|
msg, err := natsio.GetServer().Request(subject.Location.GetWardByCondition, toBytes(p))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var r struct {
|
||||||
|
Data *model.LocationWardDetailResponse `json:"data"`
|
||||||
|
Error string `json:"error"`
|
||||||
|
}
|
||||||
|
|
||||||
|
if err = json.Unmarshal(msg.Data, &r); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if r.Error != "" {
|
||||||
|
return nil, errors.New(r.Error)
|
||||||
|
}
|
||||||
|
return r.Data, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetWardsByCondition ...
|
||||||
|
func (l Location) GetWardsByCondition(p model.RequestCondition) ([]*model.LocationWardDetailResponse, error) {
|
||||||
|
msg, err := natsio.GetServer().Request(subject.Location.GetWardsByCondition, toBytes(p))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var r struct {
|
||||||
|
Data []*model.LocationWardDetailResponse `json:"data"`
|
||||||
|
Error string `json:"error"`
|
||||||
|
}
|
||||||
|
|
||||||
|
if err = json.Unmarshal(msg.Data, &r); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if r.Error != "" {
|
||||||
|
return nil, errors.New(r.Error)
|
||||||
|
}
|
||||||
|
return r.Data, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// CountProvinceByCondition ...
|
||||||
|
func (l Location) CountProvinceByCondition(p model.RequestCondition) (int64, error) {
|
||||||
|
msg, err := natsio.GetServer().Request(subject.Location.CountProvinceByCondition, toBytes(p))
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
var r struct {
|
||||||
|
Data int64 `json:"data"`
|
||||||
|
Error string `json:"error"`
|
||||||
|
}
|
||||||
|
if err = json.Unmarshal(msg.Data, &r); err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
if r.Error != "" {
|
||||||
|
return 0, errors.New(r.Error)
|
||||||
|
}
|
||||||
|
return r.Data, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// CountDistrictByCondition ...
|
||||||
|
func (l Location) CountDistrictByCondition(p model.RequestCondition) (int64, error) {
|
||||||
|
msg, err := natsio.GetServer().Request(subject.Location.CountDistrictByCondition, toBytes(p))
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
var r struct {
|
||||||
|
Data int64 `json:"data"`
|
||||||
|
Error string `json:"error"`
|
||||||
|
}
|
||||||
|
if err = json.Unmarshal(msg.Data, &r); err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
if r.Error != "" {
|
||||||
|
return 0, errors.New(r.Error)
|
||||||
|
}
|
||||||
|
return r.Data, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// CountWardByCondition ...
|
||||||
|
func (l Location) CountWardByCondition(p model.RequestCondition) (int64, error) {
|
||||||
|
msg, err := natsio.GetServer().Request(subject.Location.CountWardByCondition, toBytes(p))
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
var r struct {
|
||||||
|
Data int64 `json:"data"`
|
||||||
|
Error string `json:"error"`
|
||||||
|
}
|
||||||
|
if err = json.Unmarshal(msg.Data, &r); err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
if r.Error != "" {
|
||||||
|
return 0, errors.New(r.Error)
|
||||||
|
}
|
||||||
|
return r.Data, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// DistinctWithField ...
|
||||||
|
func (l Location) DistinctWithField(p model.ProvinceDistinctWithField) ([]interface{}, error) {
|
||||||
|
msg, err := natsio.GetServer().Request(subject.Location.ProvinceDistinctWithField, toBytes(p))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
var r struct {
|
||||||
|
Data []interface{} `json:"data"`
|
||||||
|
Error string `json:"error"`
|
||||||
|
}
|
||||||
|
if err = json.Unmarshal(msg.Data, &r); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if r.Error != "" {
|
||||||
|
return nil, errors.New(r.Error)
|
||||||
|
}
|
||||||
|
return r.Data, nil
|
||||||
|
}
|
||||||
|
|
|
@ -182,3 +182,23 @@ func (w Warehouse) UpdateORDeliveryStatus(p model.WarehouseORUpdateDeliveryStatu
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UpdateStatusWarehousePendingInactive ...
|
||||||
|
func (w Warehouse) UpdateStatusWarehousePendingInactive(p model.UpdateStatusWarehousePendingInactiveRequest) error {
|
||||||
|
msg, err := natsio.GetServer().Request(subject.Warehouse.UpdateStatusWarehousePendingInactive, toBytes(p))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
var r struct {
|
||||||
|
Error string `json:"error"`
|
||||||
|
}
|
||||||
|
|
||||||
|
if err = json.Unmarshal(msg.Data, &r); err != nil {
|
||||||
|
return fmt.Errorf("nats: update_status_warehouse_pending_inactive %v", err)
|
||||||
|
}
|
||||||
|
if r.Error != "" {
|
||||||
|
return errors.New(r.Error)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
package model
|
package model
|
||||||
|
|
||||||
import "time"
|
import (
|
||||||
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
// GetCampaignTransactionsRequest ...
|
// GetCampaignTransactionsRequest ...
|
||||||
type GetCampaignTransactionsRequest struct {
|
type GetCampaignTransactionsRequest struct {
|
||||||
|
@ -12,3 +15,8 @@ type GetCampaignTransactionsRequest struct {
|
||||||
Page int64 `json:"page"`
|
Page int64 `json:"page"`
|
||||||
Limit int64 `json:"limit"`
|
Limit int64 `json:"limit"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetCampaignSellerStatisticBySellerIDs ...
|
||||||
|
type GetCampaignSellerStatisticBySellerIDs struct {
|
||||||
|
SellerIDs []primitive.ObjectID
|
||||||
|
}
|
||||||
|
|
|
@ -57,3 +57,32 @@ type ResponseCampaignTransactionOptions struct {
|
||||||
type ResponseCampaignTransactionAdminConfirmData struct {
|
type ResponseCampaignTransactionAdminConfirmData struct {
|
||||||
FriendPublicTotal int64 `json:"friendPublicTotal"`
|
FriendPublicTotal int64 `json:"friendPublicTotal"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ResponseCampaignSellerStatisticList ...
|
||||||
|
type ResponseCampaignSellerStatisticList struct {
|
||||||
|
List []ResponseCampaignSellerStatistic `json:"list"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// ResponseCampaignSellerStatistic ...
|
||||||
|
type ResponseCampaignSellerStatistic struct {
|
||||||
|
SellerID primitive.ObjectID `json:"sellerId"`
|
||||||
|
Statistic CampaignSellerStatistic `json:"Statistic"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// CampaignSellerStatistic ...
|
||||||
|
type CampaignSellerStatistic struct {
|
||||||
|
TotalNotRejected int64 `bson:"totalNotRejected" json:"totalNotRejected"`
|
||||||
|
CashTotalNotRejected float64 `bson:"cashTotalNotRejected" json:"cashTotalNotRejected"`
|
||||||
|
|
||||||
|
TotalCompleted int64 `bson:"totalCompleted" json:"totalCompleted"`
|
||||||
|
CashTotalCompleted float64 `bson:"cashTotalCompleted" json:"cashTotalCompleted"`
|
||||||
|
|
||||||
|
TotalPending int64 `bson:"totalPending" json:"totalPending"`
|
||||||
|
CashTotalPending float64 `bson:"cashTotalPending" json:"cashTotalPending"`
|
||||||
|
|
||||||
|
TotalApproved int64 `bson:"totalApproved" json:"totalApproved"`
|
||||||
|
CashTotalApproved float64 `bson:"cashTotalApproved" json:"cashTotalApproved"`
|
||||||
|
|
||||||
|
TotalRejected int64 `bson:"totalRejected" json:"totalRejected"`
|
||||||
|
CashTotalRejected float64 `bson:"cashTotalRejected" json:"cashTotalRejected"`
|
||||||
|
}
|
||||||
|
|
|
@ -20,3 +20,26 @@ type ActionBy struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RequestCondition ...
|
||||||
|
type RequestCondition struct {
|
||||||
|
Code int `json:"code"`
|
||||||
|
Codes []int `json:"codes"`
|
||||||
|
DistrictCode int `json:"districtCode"`
|
||||||
|
ProvinceCode int `json:"provinceCode"`
|
||||||
|
|
||||||
|
Slug string `json:"slug"`
|
||||||
|
OldSlug string `json:"oldSlug"`
|
||||||
|
|
||||||
|
Slugs []string `json:"slugs"`
|
||||||
|
OldSlugs []string `json:"oldSlugs"`
|
||||||
|
|
||||||
|
DistrictSlug string `json:"districtSlug"`
|
||||||
|
ProvinceSlug string `json:"provinceSlug"`
|
||||||
|
|
||||||
|
Keyword string `json:"keyword"`
|
||||||
|
Region string `json:"region"`
|
||||||
|
|
||||||
|
Page int64 `json:"page"`
|
||||||
|
Limit int64 `json:"limit"`
|
||||||
|
}
|
||||||
|
|
|
@ -1,23 +1,66 @@
|
||||||
package model
|
package model
|
||||||
|
|
||||||
// LocationRequestPayload ...
|
// LocationRequestPayload ...
|
||||||
type LocationRequestPayload struct {
|
type (
|
||||||
|
// LocationRequestPayload ...
|
||||||
|
LocationRequestPayload struct {
|
||||||
Province int `json:"province"`
|
Province int `json:"province"`
|
||||||
District int `json:"district"`
|
District int `json:"district"`
|
||||||
Ward int `json:"ward"`
|
Ward int `json:"ward"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ProvinceRequestPayload ...
|
// ProvinceRequestPayload ...
|
||||||
type ProvinceRequestPayload struct {
|
ProvinceRequestPayload struct {
|
||||||
Codes []int `json:"codes"`
|
Codes []int `json:"codes"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ProvinceRequestCondition ...
|
||||||
|
ProvinceRequestCondition struct {
|
||||||
|
Code int `json:"code"`
|
||||||
|
Codes []int `json:"codes"`
|
||||||
|
Slug string `json:"slug"`
|
||||||
|
Slugs []string `json:"slugs"`
|
||||||
|
Keyword string `json:"keyword"`
|
||||||
|
Region string `json:"region"`
|
||||||
|
}
|
||||||
|
|
||||||
// DistrictRequestPayload ...
|
// DistrictRequestPayload ...
|
||||||
type DistrictRequestPayload struct {
|
DistrictRequestPayload struct {
|
||||||
Codes []int `json:"codes"`
|
Codes []int `json:"codes"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DistrictRequestCondition ...
|
||||||
|
DistrictRequestCondition struct {
|
||||||
|
Code int `json:"code"`
|
||||||
|
Codes []int `json:"codes"`
|
||||||
|
ProvinceCode int `json:"provinceCode"`
|
||||||
|
Slug string `json:"slug"`
|
||||||
|
ProvinceSlug string `json:"provinceSlug"`
|
||||||
|
Keyword string `json:"keyword"`
|
||||||
|
}
|
||||||
|
|
||||||
// WardRequestPayload ...
|
// WardRequestPayload ...
|
||||||
type WardRequestPayload struct {
|
WardRequestPayload struct {
|
||||||
Codes []int `json:"codes"`
|
Codes []int `json:"codes"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WardRequestCondition ...
|
||||||
|
WardRequestCondition struct {
|
||||||
|
Code int `json:"code"`
|
||||||
|
Codes []int `json:"codes"`
|
||||||
|
DistrictCode int `json:"districtCode"`
|
||||||
|
ProvinceCode int `json:"provinceCode"`
|
||||||
|
Slug string `json:"slug"`
|
||||||
|
DistrictSlug string `json:"districtSlug"`
|
||||||
|
ProvinceSlug string `json:"provinceSlug"`
|
||||||
|
Keyword string `json:"keyword"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// ProvinceDistinctWithField ...
|
||||||
|
ProvinceDistinctWithField struct {
|
||||||
|
Conditions struct {
|
||||||
|
Region string `json:"region"`
|
||||||
|
} `json:"conditions"`
|
||||||
|
Field string `json:"filed"`
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
|
@ -1,43 +1,87 @@
|
||||||
package model
|
package model
|
||||||
|
|
||||||
type ResponseLocationAddress struct {
|
type (
|
||||||
|
// ResponseLocationAddress ...
|
||||||
|
ResponseLocationAddress struct {
|
||||||
Province LocationProvince `json:"province"`
|
Province LocationProvince `json:"province"`
|
||||||
District LocationDistrict `json:"district"`
|
District LocationDistrict `json:"district"`
|
||||||
Ward LocationWard `json:"ward"`
|
Ward LocationWard `json:"ward"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// LocationProvince ...
|
// LocationProvince ...
|
||||||
type LocationProvince struct {
|
LocationProvince struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Code int `json:"code"`
|
Code int `json:"code"`
|
||||||
|
Slug string `json:"slug"`
|
||||||
|
RegionCode string `json:"regionCode"`
|
||||||
|
MainRegionCode string `json:"mainRegionCode"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// LocationDistrict ...
|
// LocationDistrict ...
|
||||||
type LocationDistrict struct {
|
LocationDistrict struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Code int `json:"code"`
|
Code int `json:"code"`
|
||||||
|
Slug string `json:"slug"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// LocationWard ...
|
// LocationWard ...
|
||||||
type LocationWard struct {
|
LocationWard struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Code int `json:"code"`
|
Code int `json:"code"`
|
||||||
|
Slug string `json:"slug"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// LocationProvinceResponse ...
|
// LocationProvinceResponse ...
|
||||||
type LocationProvinceResponse struct {
|
LocationProvinceResponse struct {
|
||||||
Provinces []LocationProvince `json:"provinces"`
|
Provinces []LocationProvince `json:"provinces"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// LocationDistrictResponse ...
|
// LocationDistrictResponse ...
|
||||||
type LocationDistrictResponse struct {
|
LocationDistrictResponse struct {
|
||||||
Districts []LocationDistrict `json:"districts"`
|
Districts []LocationDistrict `json:"districts"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// LocationWardResponse ...
|
// LocationWardResponse ...
|
||||||
type LocationWardResponse struct {
|
LocationWardResponse struct {
|
||||||
Wards []LocationWard `json:"wards"`
|
Wards []LocationWard `json:"wards"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LocationProvinceDetailResponse ...
|
||||||
|
LocationProvinceDetailResponse struct {
|
||||||
|
ID string `json:"_id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
Slug string `json:"slug"`
|
||||||
|
Code int `json:"code"`
|
||||||
|
CountryCode string `json:"countryCode"`
|
||||||
|
RegionCode string `json:"regionCode"`
|
||||||
|
MainRegionCode string `json:"mainRegionCode"`
|
||||||
|
TotalDistricts int `json:"totalDistricts"`
|
||||||
|
TotalWards int `json:"totalWards"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// LocationDistrictDetailResponse ...
|
||||||
|
LocationDistrictDetailResponse struct {
|
||||||
|
ID string `json:"_id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
OldSlugs []string `json:"oldSlugs"`
|
||||||
|
Slug string `json:"slug"`
|
||||||
|
Code int `json:"code"`
|
||||||
|
ProvinceCode int `json:"provinceCode"`
|
||||||
|
Area int `json:"area"`
|
||||||
|
TotalWards int `json:"totalWards"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// LocationWardDetailResponse ...
|
||||||
|
LocationWardDetailResponse struct {
|
||||||
|
ID string `json:"_id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
OldSlugs []string `json:"oldSlugs"`
|
||||||
|
Slug string `json:"slug"`
|
||||||
|
Code int `json:"code"`
|
||||||
|
DistrictCode int `json:"districtCode"`
|
||||||
|
ProvinceCode int `json:"provinceCode"`
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
|
@ -114,3 +114,14 @@ type WarehouseORUpdateDeliveryStatus struct {
|
||||||
OrderID string `json:"orderId"`
|
OrderID string `json:"orderId"`
|
||||||
DeliveryStatus string `json:"deliveryStatus"`
|
DeliveryStatus string `json:"deliveryStatus"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UpdateStatusWarehousePendingInactiveRequest ...
|
||||||
|
type UpdateStatusWarehousePendingInactiveRequest struct {
|
||||||
|
Warehouses []UpdateStatusWarehousePendingInactive `json:"warehouses"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateStatusWarehousePendingInactive ...
|
||||||
|
type UpdateStatusWarehousePendingInactive struct {
|
||||||
|
WarehouseID string `json:"warehouse"`
|
||||||
|
PendingInactive bool `json:"pendingInactive"`
|
||||||
|
}
|
||||||
|
|
|
@ -10,6 +10,8 @@ func getCampaignValue(val string) string {
|
||||||
// Campaign ...
|
// Campaign ...
|
||||||
var Campaign = struct {
|
var Campaign = struct {
|
||||||
GetListCampaignTransactionAdminInfoByIDs string
|
GetListCampaignTransactionAdminInfoByIDs string
|
||||||
|
GetCampaignSellerStatisticBySellerIDs string
|
||||||
}{
|
}{
|
||||||
GetListCampaignTransactionAdminInfoByIDs: getCampaignValue("get_list_campaign_transaction_admin_info_by_ids"),
|
GetListCampaignTransactionAdminInfoByIDs: getCampaignValue("get_list_campaign_transaction_admin_info_by_ids"),
|
||||||
|
GetCampaignSellerStatisticBySellerIDs: getCampaignValue("get_campaign_seller_statistic_by_seller_ids"),
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,12 +8,40 @@ func getLocationValue(val string) string {
|
||||||
|
|
||||||
var Location = struct {
|
var Location = struct {
|
||||||
GetLocationByCode string
|
GetLocationByCode string
|
||||||
|
GetLocationByCodeFromLocationService string
|
||||||
GetProvincesByCodes string
|
GetProvincesByCodes string
|
||||||
|
GetProvincesByCodesFromLocationService string
|
||||||
GetDistrictsByCodes string
|
GetDistrictsByCodes string
|
||||||
|
GetDistrictsByCodesFromLocationService string
|
||||||
GetWardsByCodes string
|
GetWardsByCodes string
|
||||||
|
GetWardsByCodesFromLocationService string
|
||||||
|
GetProvinceByCondition string
|
||||||
|
GetProvincesByCondition string
|
||||||
|
GetDistrictByCondition string
|
||||||
|
GetDistrictsByCondition string
|
||||||
|
GetWardByCondition string
|
||||||
|
GetWardsByCondition string
|
||||||
|
CountProvinceByCondition string
|
||||||
|
CountDistrictByCondition string
|
||||||
|
CountWardByCondition string
|
||||||
|
ProvinceDistinctWithField string
|
||||||
}{
|
}{
|
||||||
GetLocationByCode: getLocationValue("get_location_warehouse"),
|
GetLocationByCode: getLocationValue("get_location_warehouse"),
|
||||||
|
GetLocationByCodeFromLocationService: getLocationValue("get_location_warehouse_from_location_service"),
|
||||||
GetProvincesByCodes: getLocationValue("get_provinces_by_codes"),
|
GetProvincesByCodes: getLocationValue("get_provinces_by_codes"),
|
||||||
|
GetProvincesByCodesFromLocationService: getLocationValue("get_provinces_by_codes_from_location_service"),
|
||||||
GetDistrictsByCodes: getLocationValue("get_districts_by_codes"),
|
GetDistrictsByCodes: getLocationValue("get_districts_by_codes"),
|
||||||
|
GetDistrictsByCodesFromLocationService: getLocationValue("get_districts_by_codes_from_location_service"),
|
||||||
GetWardsByCodes: getLocationValue("get_wards_by_codes"),
|
GetWardsByCodes: getLocationValue("get_wards_by_codes"),
|
||||||
|
GetWardsByCodesFromLocationService: getLocationValue("get_wards_by_codes_from_location_service"),
|
||||||
|
GetProvinceByCondition: getLocationValue("get_province_by_condition"),
|
||||||
|
GetProvincesByCondition: getLocationValue("get_provinces_by_condition"),
|
||||||
|
GetDistrictByCondition: getLocationValue("get_district_by_condition"),
|
||||||
|
GetDistrictsByCondition: getLocationValue("get_districts_byCondition"),
|
||||||
|
GetWardByCondition: getLocationValue("get_ward_by_condition"),
|
||||||
|
GetWardsByCondition: getLocationValue("get_wards_by_condition"),
|
||||||
|
CountProvinceByCondition: getLocationValue("count_province_by_condition"),
|
||||||
|
CountDistrictByCondition: getLocationValue("count_district_by_condition"),
|
||||||
|
CountWardByCondition: getLocationValue("count_ward_by_condition"),
|
||||||
|
ProvinceDistinctWithField: getLocationValue("province_distinct_with_field"),
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package subject
|
package subject
|
||||||
|
|
||||||
import "fmt"
|
import (
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
func getWarehouseValue(val string) string {
|
func getWarehouseValue(val string) string {
|
||||||
return fmt.Sprintf("%s.%s", prefixes.Warehouse, val)
|
return fmt.Sprintf("%s.%s", prefixes.Warehouse, val)
|
||||||
|
@ -26,6 +28,7 @@ var Warehouse = struct {
|
||||||
UpdateIsClosedSupplier string
|
UpdateIsClosedSupplier string
|
||||||
GetWarehouses string
|
GetWarehouses string
|
||||||
UpdateORDeliveryStatus string
|
UpdateORDeliveryStatus string
|
||||||
|
UpdateStatusWarehousePendingInactive string
|
||||||
}{
|
}{
|
||||||
CreateWarehouseIntoServiceSupplier: getWarehouseValue("create_warehouse_into_service_supplier"),
|
CreateWarehouseIntoServiceSupplier: getWarehouseValue("create_warehouse_into_service_supplier"),
|
||||||
UpdateWarehouseIntoServiceSupplier: getWarehouseValue("update_warehouse_into_service_supplier"),
|
UpdateWarehouseIntoServiceSupplier: getWarehouseValue("update_warehouse_into_service_supplier"),
|
||||||
|
@ -46,4 +49,5 @@ var Warehouse = struct {
|
||||||
UpdateIsClosedSupplier: getWarehouseValue("update_is_closed_supplier"),
|
UpdateIsClosedSupplier: getWarehouseValue("update_is_closed_supplier"),
|
||||||
GetWarehouses: getWarehouseValue("get_warehouses"),
|
GetWarehouses: getWarehouseValue("get_warehouses"),
|
||||||
UpdateORDeliveryStatus: getWarehouseValue("update_or_delivery_status"),
|
UpdateORDeliveryStatus: getWarehouseValue("update_or_delivery_status"),
|
||||||
|
UpdateStatusWarehousePendingInactive: getWarehouseValue("update_status_warehouse_pending_inactive"),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue