Compare commits
58 Commits
warehouse-
...
master
Author | SHA1 | Date |
---|---|---|
Sinh Luu | d80090cfb5 | |
Sinh | 9ba66dae05 | |
trunglt251292 | 89f4e1a11d | |
Sinh Luu | 99f75cfbc7 | |
Sinh | aab1103fc8 | |
trunglt251292 | e6b620ca6c | |
Sinh | 57d6cb18a9 | |
Nguyen Minh | dcea3798f8 | |
Nguyen Minh | 68b9cab1e2 | |
Nguyen Minh | d9763edd75 | |
Nguyen Minh | 547b3b8dd9 | |
Nguyen Minh | 047037f123 | |
Nguyen Minh | f80f89e793 | |
Nguyen Minh | b718162cd4 | |
Nguyen Minh | e16a537ed2 | |
trunglt251292 | cc89feac0d | |
Nguyen Minh | 4ac7ec3b0c | |
trunglt251292 | 4319d2644c | |
Nguyen Minh | 583f2abda5 | |
trunglt251292 | 952c09ccba | |
trunglt251292 | 4452be1474 | |
trunglt251292 | 34c61ccfcc | |
trunglt251292 | 1d58e55af7 | |
anbuiselly | 99eacb44a8 | |
phuanbui | 35a811886b | |
Minh Nguyen | c043a03861 | |
phuanbui | 89967955ea | |
trunglt251292 | 92040d0b9f | |
trunglt251292 | fb8a8bd471 | |
Nguyen Minh | 40533e1805 | |
trunglt251292 | 9f1f2faf9e | |
trunglt251292 | cc48a083f2 | |
Sinh Luu | 738089755a | |
Sinh | d605e3f291 | |
Sinh | 26a116a2a4 | |
Sinh Luu | 3c5fa1207e | |
Sinh | 943fff292d | |
trunglt251292 | 06b2398e3d | |
Sinh Luu | 6cf422cf59 | |
phuanbui | 218123ccfb | |
phuanbui | 9b40f5f9ba | |
Sinh Luu | 40e71440f1 | |
Sinh | 367dc7edd9 | |
Sinh | af6e0843b9 | |
trunglt251292 | 9413158b8a | |
trunglt251292 | d65c98f646 | |
nguyenphamquangtue | 9295a8e13f | |
Sinh | 3bc5f0673d | |
Sinh | 12afbd81fe | |
Sinh Luu | 8cabf2f4a4 | |
Sinh | b9a7d9648e | |
Sinh | 01c28e1ee3 | |
trunglt251292 | e89273aa70 | |
trunglt251292 | 9e645a60c0 | |
Sinh | 43aa67fa2e | |
Sinh | 9acd7e48b4 | |
Sinh | 35737a34ab | |
Sinh | 5ca473ffc1 |
|
@ -17,6 +17,7 @@ func GetLocation() Location {
|
||||||
return Location{}
|
return Location{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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.GetLocationByCode, toBytes(payload))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -36,3 +37,70 @@ func (l Location) GetLocationByCode(payload model.LocationRequestPayload) (*mode
|
||||||
}
|
}
|
||||||
return r.Data, nil
|
return r.Data, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetProvincesByCodes ... ...
|
||||||
|
func (l Location) GetProvincesByCodes(p model.ProvinceRequestPayload) (*model.LocationProvinceResponse, error) {
|
||||||
|
msg, err := natsio.GetServer().Request(subject.Location.GetProvincesByCodes, toBytes(p))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var r struct {
|
||||||
|
Data *model.LocationProvinceResponse `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
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetDistrictsByCodes ...
|
||||||
|
func (l Location) GetDistrictsByCodes(p model.DistrictRequestPayload) (*model.LocationDistrictResponse, error) {
|
||||||
|
msg, err := natsio.GetServer().Request(subject.Location.GetDistrictsByCodes, toBytes(p))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
var r struct {
|
||||||
|
Data *model.LocationDistrictResponse `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
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetWardsByCodes ...
|
||||||
|
func (l Location) GetWardsByCodes(p model.WardRequestPayload) (*model.LocationWardResponse, error) {
|
||||||
|
msg, err := natsio.GetServer().Request(subject.Location.GetWardsByCodes, toBytes(p))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var r struct {
|
||||||
|
Data *model.LocationWardResponse `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
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
package client
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
|
"github.com/Selly-Modules/natsio"
|
||||||
|
"github.com/Selly-Modules/natsio/model"
|
||||||
|
"github.com/Selly-Modules/natsio/subject"
|
||||||
|
)
|
||||||
|
|
||||||
|
// News ...
|
||||||
|
type News struct{}
|
||||||
|
|
||||||
|
// GetNews ...
|
||||||
|
func GetNews() News {
|
||||||
|
return News{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetProductNoticesByInventory ...
|
||||||
|
func (n News) GetProductNoticesByInventory(p model.GetProductNoticesByInventoryRequest) (*model.GetProductNoticesByInventoryResponse, error) {
|
||||||
|
msg, err := natsio.GetServer().Request(subject.News.GetProductNoticesByInventory, toBytes(p))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
var r struct {
|
||||||
|
Data *model.GetProductNoticesByInventoryResponse `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
|
||||||
|
}
|
|
@ -50,3 +50,51 @@ func (o Order) CancelDelivery(p model.OrderCancelDelivery) error {
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ChangeDeliveryStatus ...
|
||||||
|
func (o Order) ChangeDeliveryStatus(p model.OrderChangeDeliveryStatus) error {
|
||||||
|
msg, err := natsio.GetServer().Request(subject.Order.ChangeDeliveryStatus, toBytes(p))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var r model.CommonResponseData
|
||||||
|
if err = json.Unmarshal(msg.Data, &r); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if r.Error != "" {
|
||||||
|
return errors.New(r.Error)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateLogisticInfoFailed ...
|
||||||
|
func (o Order) UpdateLogisticInfoFailed(p model.OrderUpdateLogisticInfoFailed) error {
|
||||||
|
msg, err := natsio.GetServer().Request(subject.Order.UpdateLogisticInfoFailed, toBytes(p))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var r model.CommonResponseData
|
||||||
|
if err = json.Unmarshal(msg.Data, &r); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if r.Error != "" {
|
||||||
|
return errors.New(r.Error)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// ORNotUpdateStatus ...
|
||||||
|
func (o Order) ORNotUpdateStatus(p model.OrderORsNotUpdateStatus) error {
|
||||||
|
msg, err := natsio.GetServer().Request(subject.Order.ORNotUpdateStatus, toBytes(p))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var r model.CommonResponseData
|
||||||
|
if err = json.Unmarshal(msg.Data, &r); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if r.Error != "" {
|
||||||
|
return errors.New(r.Error)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,88 @@
|
||||||
|
package client
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
|
|
||||||
|
"github.com/Selly-Modules/natsio"
|
||||||
|
"github.com/Selly-Modules/natsio/model"
|
||||||
|
"github.com/Selly-Modules/natsio/subject"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Seller ...
|
||||||
|
type Seller struct{}
|
||||||
|
|
||||||
|
// GetSeller ...
|
||||||
|
func GetSeller() Seller {
|
||||||
|
return Seller{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetSellerInfoByID ...
|
||||||
|
func (s Seller) GetSellerInfoByID(p model.GetSellerByIDRequest) (*model.ResponseSellerInfo, error) {
|
||||||
|
msg, err := natsio.GetServer().Request(subject.Seller.GetSellerInfoByID, toBytes(p))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var r struct {
|
||||||
|
Data *model.ResponseSellerInfo `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
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetListSellerInfoByIDs ...
|
||||||
|
func (s Seller) GetListSellerInfoByIDs(p model.GetListSellerByIDsRequest) (*model.ResponseListSellerInfo, error) {
|
||||||
|
msg, err := natsio.GetServer().Request(subject.Seller.GetListSellerInfoByIDs, toBytes(p))
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var r struct {
|
||||||
|
Data *model.ResponseListSellerInfo `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
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetListSellerInfoSupportChatByIDs ...
|
||||||
|
func (s Seller) GetListSellerInfoSupportChatByIDs(p model.GetListSellerSupportChatByIDsRequest) (*model.ResponseListSellerInfoSupportChat, error) {
|
||||||
|
msg, err := natsio.GetServer().Request(subject.SupportChat.GetListSellerInfoSupportChatByIDs, toBytes(p))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var r struct {
|
||||||
|
Data *model.ResponseListSellerInfoSupportChat `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
|
||||||
|
}
|
|
@ -58,3 +58,24 @@ func (s Supplier) GetSupplierContractBySupplierID(p model.GetSupplierContractReq
|
||||||
|
|
||||||
return r.Data, nil
|
return r.Data, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s Supplier) FindAll(supplierID model.SupplierRequestPayload) (*model.SupplierAll, error) {
|
||||||
|
msg, err := natsio.GetServer().Request(subject.Supplier.FindAll, toBytes(supplierID))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var r struct {
|
||||||
|
Data *model.SupplierAll `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
|
||||||
|
}
|
||||||
|
|
|
@ -17,6 +17,24 @@ func GetWarehouse() Warehouse {
|
||||||
return Warehouse{}
|
return Warehouse{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UpdateIsClosedSupplier ...
|
||||||
|
func (w Warehouse) UpdateIsClosedSupplier(p model.UpdateSupplierIsClosedRequest) error {
|
||||||
|
msg, err := natsio.GetServer().Request(subject.Warehouse.UpdateIsClosedSupplier, toBytes(p))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var r struct {
|
||||||
|
Error string `json:"error"`
|
||||||
|
}
|
||||||
|
if err = json.Unmarshal(msg.Data, &r); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if r.Error != "" {
|
||||||
|
return errors.New(r.Error)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// AfterCreateWarehouse ...
|
// AfterCreateWarehouse ...
|
||||||
func (w Warehouse) AfterCreateWarehouse(p model.WarehouseNatsResponse) error {
|
func (w Warehouse) AfterCreateWarehouse(p model.WarehouseNatsResponse) error {
|
||||||
msg, err := natsio.GetServer().Request(subject.Warehouse.AfterCreateWarehouse, toBytes(p))
|
msg, err := natsio.GetServer().Request(subject.Warehouse.AfterCreateWarehouse, toBytes(p))
|
||||||
|
@ -126,3 +144,22 @@ func (w Warehouse) GetConfigByWarehouseID(warehouseID string) (*model.WarehouseC
|
||||||
}
|
}
|
||||||
return r.Data, nil
|
return r.Data, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetWarehouses ...
|
||||||
|
func (w Warehouse) GetWarehouses(p model.GetWarehousesRequest) (*model.GetWarehousesResponse, error) {
|
||||||
|
msg, err := natsio.GetServer().Request(subject.Warehouse.GetWarehouses, toBytes(p))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
var r struct {
|
||||||
|
Data *model.GetWarehousesResponse `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
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
package natsio
|
||||||
|
|
||||||
|
// StreamNameSelly ...
|
||||||
|
const StreamNameSelly = "selly"
|
|
@ -0,0 +1,12 @@
|
||||||
|
package jsconsumer
|
||||||
|
|
||||||
|
// Selly ...
|
||||||
|
var Selly = struct {
|
||||||
|
PushNotification string
|
||||||
|
UpdateSellerAffiliateStatistic string
|
||||||
|
CheckAnDInsertCashflowBySeller string
|
||||||
|
}{
|
||||||
|
PushNotification: "PULL_PUSH_NOTIFICATION",
|
||||||
|
UpdateSellerAffiliateStatistic: "PULL_UPDATE_SELLER_AFFILIATE_STATISTIC",
|
||||||
|
CheckAnDInsertCashflowBySeller: "PULL_CHECK_AND_INSERT_CASHFLOW_BY_SELLER",
|
||||||
|
}
|
|
@ -0,0 +1,60 @@
|
||||||
|
package jsmodel
|
||||||
|
|
||||||
|
// PushNotification ...
|
||||||
|
type PushNotification struct {
|
||||||
|
User string `json:"user"`
|
||||||
|
Type string `json:"type"`
|
||||||
|
TargetID string `json:"targetId"`
|
||||||
|
IsFromAdmin bool `json:"isFromAdmin"`
|
||||||
|
Category string `json:"category"`
|
||||||
|
Options NotificationOptions `json:"options"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// NotificationOptions ...
|
||||||
|
type NotificationOptions struct {
|
||||||
|
Title string `json:"title"`
|
||||||
|
Content string `json:"content"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// PayloadUpdateSellerAffiliateStatistic ...
|
||||||
|
type PayloadUpdateSellerAffiliateStatistic struct {
|
||||||
|
SellerID string `json:"sellerId"`
|
||||||
|
Statistic SellerAffiliateStatistic `json:"statistic"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// SellerAffiliateStatistic ...
|
||||||
|
type SellerAffiliateStatistic struct {
|
||||||
|
TransactionTotal int `json:"transactionTotal"`
|
||||||
|
TransactionCashback int `json:"transactionCashback"`
|
||||||
|
TransactionPending int `json:"transactionPending"`
|
||||||
|
TransactionApproved int `json:"transactionApproved"`
|
||||||
|
TransactionRejected int `json:"transactionRejected"`
|
||||||
|
CommissionTransactionTotal float64 `json:"commissionTransactionTotal"`
|
||||||
|
CommissionTransactionCashback float64 `json:"commissionTransactionCashback"`
|
||||||
|
CommissionTransactionApproved float64 `json:"commissionTransactionApproved"`
|
||||||
|
CommissionTransactionPending float64 `json:"commissionTransactionPending"`
|
||||||
|
CommissionTransactionRejected float64 `json:"commissionTransactionRejected"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// PayloadCashflowsBySeller ...
|
||||||
|
type PayloadCashflowsBySeller struct {
|
||||||
|
SellerID string `json:"sellerId"`
|
||||||
|
List []CashflowSeller `json:"list"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// CashflowSeller ...
|
||||||
|
type CashflowSeller struct {
|
||||||
|
Value float64 `json:"value"`
|
||||||
|
Action string `json:"action"`
|
||||||
|
Category string `json:"category"`
|
||||||
|
TargetID string `json:"targetId"`
|
||||||
|
TargetType string `json:"targetType"`
|
||||||
|
Options *CashFlowOptions `json:"options"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// CashFlowOptions ...
|
||||||
|
type CashFlowOptions struct {
|
||||||
|
AffiliateTransactionCode string `json:"affiliateTransactionCode,omitempty"`
|
||||||
|
AffiliateCampaignID string `json:"affiliateCampaignId,omitempty"`
|
||||||
|
AffiliateCampaignName string `json:"affiliateCampaignName,omitempty"`
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package jssubject
|
||||||
|
|
||||||
|
var root = "js"
|
||||||
|
|
||||||
|
// prefixes ...
|
||||||
|
var prefixes = struct {
|
||||||
|
Selly string
|
||||||
|
}{
|
||||||
|
Selly: "selly",
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
package jssubject
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// getSellyValue ...
|
||||||
|
func getSellyValue(val string) string {
|
||||||
|
return fmt.Sprintf("%s.%s.%s", root, prefixes.Selly, val)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Selly ...
|
||||||
|
var Selly = struct {
|
||||||
|
PushNotification string
|
||||||
|
UpdateSellerAffiliateStatistic string
|
||||||
|
CheckAnDInsertCashflowBySeller string
|
||||||
|
}{
|
||||||
|
PushNotification: getSellyValue("push_notifications"),
|
||||||
|
UpdateSellerAffiliateStatistic: getSellyValue("update_seller_affiliate_statistic"),
|
||||||
|
CheckAnDInsertCashflowBySeller: getSellyValue("check_and_insert_cashflow_statistic"),
|
||||||
|
}
|
|
@ -15,3 +15,8 @@ type DistinctWithField struct {
|
||||||
Conditions interface{} `json:"conditions"`
|
Conditions interface{} `json:"conditions"`
|
||||||
Filed string `json:"filed"`
|
Filed string `json:"filed"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ActionBy struct {
|
||||||
|
ID string `json:"id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
}
|
||||||
|
|
|
@ -6,3 +6,18 @@ type LocationRequestPayload struct {
|
||||||
District int `json:"district"`
|
District int `json:"district"`
|
||||||
Ward int `json:"ward"`
|
Ward int `json:"ward"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ProvinceRequestPayload ...
|
||||||
|
type ProvinceRequestPayload struct {
|
||||||
|
Codes []int `json:"codes"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// DistrictRequestPayload ...
|
||||||
|
type DistrictRequestPayload struct {
|
||||||
|
Codes []int `json:"codes"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// WardRequestPayload ...
|
||||||
|
type WardRequestPayload struct {
|
||||||
|
Codes []int `json:"codes"`
|
||||||
|
}
|
||||||
|
|
|
@ -26,3 +26,18 @@ type LocationWard struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Code int `json:"code"`
|
Code int `json:"code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LocationProvinceResponse ...
|
||||||
|
type LocationProvinceResponse struct {
|
||||||
|
Provinces []LocationProvince `json:"provinces"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// LocationDistrictResponse ...
|
||||||
|
type LocationDistrictResponse struct {
|
||||||
|
Districts []LocationDistrict `json:"districts"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// LocationWardResponse ...
|
||||||
|
type LocationWardResponse struct {
|
||||||
|
Wards []LocationWard `json:"wards"`
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
package model
|
||||||
|
|
||||||
|
// GetProductNoticesByInventoryRequest ....
|
||||||
|
type GetProductNoticesByInventoryRequest struct {
|
||||||
|
InventoryIds []string `json:"inventoryIds"`
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
package model
|
||||||
|
|
||||||
|
// GetProductNoticesByInventoryResponse ....
|
||||||
|
type GetProductNoticesByInventoryResponse struct {
|
||||||
|
Notices []NewsAppResponse `json:"notices"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewsAppResponse ...
|
||||||
|
type NewsAppResponse struct {
|
||||||
|
ID string `json:"_id"`
|
||||||
|
Title string `json:"title,omitempty"`
|
||||||
|
Target *TargetNewDoc `json:"target,omitempty"`
|
||||||
|
ActionType *ActionType `json:"action"`
|
||||||
|
ShortDesc string `json:"shortDesc,omitempty"`
|
||||||
|
Type string `json:"type"`
|
||||||
|
ShortTitle string `json:"shortTitle,omitempty"`
|
||||||
|
Color string `json:"color"`
|
||||||
|
Options *NewsOptions `json:"options,omitempty"`
|
||||||
|
DisplayStyle string `json:"displayStyle"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewsOptions ...
|
||||||
|
type NewsOptions struct {
|
||||||
|
Category string `json:"category"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// TargetNewDoc ...
|
||||||
|
type TargetNewDoc struct {
|
||||||
|
Type string `json:"type,omitempty"`
|
||||||
|
Value string `json:"value,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// ActionType ...
|
||||||
|
type ActionType struct {
|
||||||
|
Type string `json:"type"`
|
||||||
|
Value string `json:"value"`
|
||||||
|
Text string `json:"text,omitempty"`
|
||||||
|
}
|
|
@ -2,13 +2,39 @@ package model
|
||||||
|
|
||||||
// OrderUpdateORStatus ...
|
// OrderUpdateORStatus ...
|
||||||
type OrderUpdateORStatus struct {
|
type OrderUpdateORStatus struct {
|
||||||
OrderCode string `json:"orderCode"`
|
OrderCode string `json:"orderCode"`
|
||||||
ORCode string `json:"orCode"`
|
ORCode string `json:"orCode"`
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
Reason string `json:"reason"`
|
DeliveryStatus string `json:"deliveryStatus"`
|
||||||
|
Reason string `json:"reason"`
|
||||||
|
Data OrderORData `json:"data"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrderCancelDelivery ...
|
// OrderCancelDelivery ...
|
||||||
type OrderCancelDelivery struct {
|
type OrderCancelDelivery struct {
|
||||||
OrderID string `json:"orderId"`
|
OrderID string `json:"orderId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// OrderChangeDeliveryStatus ...
|
||||||
|
type OrderChangeDeliveryStatus struct {
|
||||||
|
OrderID string `json:"orderId"`
|
||||||
|
DeliveryStatus string `json:"deliveryStatus"`
|
||||||
|
ActionBy ActionBy `json:"actionBy"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// OrderORData ...
|
||||||
|
type OrderORData struct {
|
||||||
|
Link string `json:"link"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// OrderUpdateLogisticInfoFailed ...
|
||||||
|
type OrderUpdateLogisticInfoFailed struct {
|
||||||
|
OrderID string `json:"orderId"`
|
||||||
|
ORCode string `json:"orCode"`
|
||||||
|
Reason string `json:"reason"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// OrderORsNotUpdateStatus ...
|
||||||
|
type OrderORsNotUpdateStatus struct {
|
||||||
|
ORCodes []string `json:"orCodes"`
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
package model
|
||||||
|
|
||||||
|
import "go.mongodb.org/mongo-driver/bson/primitive"
|
||||||
|
|
||||||
|
// GetSellerByIDRequest ...
|
||||||
|
type GetSellerByIDRequest struct {
|
||||||
|
SellerID primitive.ObjectID `json:"sellerId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetListSellerByIDsRequest ...
|
||||||
|
type GetListSellerByIDsRequest struct {
|
||||||
|
SellerIDs []primitive.ObjectID `json:"sellerIds"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetListSellerSupportChatByIDsRequest ...
|
||||||
|
type GetListSellerSupportChatByIDsRequest struct {
|
||||||
|
SellerIDs []primitive.ObjectID `json:"sellerIds"`
|
||||||
|
}
|
|
@ -0,0 +1,81 @@
|
||||||
|
package model
|
||||||
|
|
||||||
|
import "time"
|
||||||
|
|
||||||
|
// ResponseSellerInfo ...
|
||||||
|
type ResponseSellerInfo struct {
|
||||||
|
ID string `json:"_id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
Code string `json:"code"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// ResponseListSellerInfo ...
|
||||||
|
type ResponseListSellerInfo struct {
|
||||||
|
Sellers []ResponseSellerInfo `json:"sellers"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// ResponseListSellerInfoSupportChat ...
|
||||||
|
type ResponseListSellerInfoSupportChat struct {
|
||||||
|
Sellers []ResponseSellerInfoSupportChat `json:"sellers"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// ResponseSellerInfoSupportChat ...
|
||||||
|
type ResponseSellerInfoSupportChat struct {
|
||||||
|
ID string `json:"_id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
Code string `json:"code"`
|
||||||
|
Membership SellerMembershipInfo `json:"membership"`
|
||||||
|
Info SellerContactInfo `json:"info"`
|
||||||
|
Team *TeamInfo `json:"team,omitempty"`
|
||||||
|
Statistic SellerStatistic `json:"statistic"`
|
||||||
|
TrackingTime *SellerTrackingTime `json:"trackingTime"`
|
||||||
|
Invitee *InviteeInfo `json:"invitee"`
|
||||||
|
CreatedAt time.Time `json:"createdAt"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// SellerTrackingTime ...
|
||||||
|
type SellerTrackingTime struct {
|
||||||
|
FirstOrderDeliveredAt time.Time `json:"firstOrderDeliveredAt,omitempty"`
|
||||||
|
ThirdOrderDeliveredAt time.Time `json:"thirdOrderDeliveredAt,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// SellerStatistic ...
|
||||||
|
type SellerStatistic struct {
|
||||||
|
ThisMonthSale float64 `bson:"thisMonthSale" json:"thisMonthSale"`
|
||||||
|
LastMonthSale float64 `bson:"lastMonthSale" json:"lastMonthSale"`
|
||||||
|
Sale float64 `bson:"sale" json:"sale"`
|
||||||
|
TransactionTotal int `json:"transactionTotal"`
|
||||||
|
TransactionPaymentProcessing int `json:"transactionPaymentProcessing"`
|
||||||
|
TransactionWaitingApprove int `json:"transactionWaitingApprove"`
|
||||||
|
TransactionPending int `json:"transactionPending"`
|
||||||
|
TransactionSuccess int `json:"transactionSuccess"`
|
||||||
|
TransactionRejected int `json:"transactionRejected"`
|
||||||
|
TransactionDelivering int `json:"transactionDelivering"`
|
||||||
|
TransactionDelivered int `json:"transactionDelivered"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// TeamInfo ...
|
||||||
|
type TeamInfo struct {
|
||||||
|
ID string `json:"_id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
Role string `json:"role"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// InviteeInfo ...
|
||||||
|
type InviteeInfo struct {
|
||||||
|
ID string `json:"_id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// SellerContactInfo ...
|
||||||
|
type SellerContactInfo struct {
|
||||||
|
City int `json:"cityCode"`
|
||||||
|
CityName string `json:"cityName"`
|
||||||
|
Gender string `json:"gender"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// SellerMembershipInfo ...
|
||||||
|
type SellerMembershipInfo struct {
|
||||||
|
Level int `json:"level"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
}
|
|
@ -12,3 +12,13 @@ type GetSupplierRequest struct {
|
||||||
type GetSupplierContractRequest struct {
|
type GetSupplierContractRequest struct {
|
||||||
SupplierID primitive.ObjectID `json:"supplierID"`
|
SupplierID primitive.ObjectID `json:"supplierID"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SupplierRequestPayload ...
|
||||||
|
type SupplierRequestPayload struct {
|
||||||
|
Limit int
|
||||||
|
Page int
|
||||||
|
Keyword string
|
||||||
|
Status string
|
||||||
|
PIC string
|
||||||
|
ContractStatus string
|
||||||
|
}
|
||||||
|
|
|
@ -2,8 +2,9 @@ package model
|
||||||
|
|
||||||
// ResponseSupplierInfo ...
|
// ResponseSupplierInfo ...
|
||||||
type ResponseSupplierInfo struct {
|
type ResponseSupplierInfo struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
|
BusinessType string `json:"businessType"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ResponseSupplierContract ...
|
// ResponseSupplierContract ...
|
||||||
|
@ -13,3 +14,18 @@ type ResponseSupplierContract struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SupplierBrief ...
|
||||||
|
type SupplierBrief struct {
|
||||||
|
ID string `json:"_id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
Status string `json:"status"`
|
||||||
|
BusinessType string `json:"businessType"`
|
||||||
|
CreatedAt string `json:"createdAt"`
|
||||||
|
UpdatedAt string `json:"updatedAt"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type SupplierAll struct {
|
||||||
|
Suppliers []SupplierBrief `json:"suppliers"`
|
||||||
|
Total int64 `json:"total"`
|
||||||
|
}
|
||||||
|
|
|
@ -12,6 +12,26 @@ type OutboundRequestPayload struct {
|
||||||
TPLCode string `json:"tplCode"`
|
TPLCode string `json:"tplCode"`
|
||||||
Customer CustomerInfo `json:"customer"`
|
Customer CustomerInfo `json:"customer"`
|
||||||
Items []OutboundRequestItem `json:"items"`
|
Items []OutboundRequestItem `json:"items"`
|
||||||
|
Insurance *InsuranceOpts `json:"insurance"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// InsuranceOpts ...
|
||||||
|
type InsuranceOpts struct {
|
||||||
|
InsuranceType string `json:"insuranceType"`
|
||||||
|
VehicleTypeID string `json:"vehicleTypeId"`
|
||||||
|
VehicleTypeName string `json:"vehicleTypeName"`
|
||||||
|
InsuranceTypeID string `json:"insuranceTypeId"`
|
||||||
|
YearsOfInsurance int `json:"yearsOfInsurance"`
|
||||||
|
License string `json:"license"`
|
||||||
|
Chassis string `json:"chassis"`
|
||||||
|
Engine string `json:"engine"`
|
||||||
|
BeginDate string `json:"beginDate"`
|
||||||
|
|
||||||
|
// For car insurance
|
||||||
|
NumberOfSeatsCarOccupantAccidentInsurance int `json:"numberOfSeatsCarOccupantAccidentInsurance"`
|
||||||
|
NumberOfSeats int `json:"numberOfSeats"`
|
||||||
|
NumberOfSeatsOrTonnageId string `json:"numberOfSeatsOrTonnageId"`
|
||||||
|
NumberOfSeatsOrTonnageName string `json:"numberOfSeatsOrTonnageName"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OutboundRequestItem ...
|
// OutboundRequestItem ...
|
||||||
|
@ -25,6 +45,7 @@ type OutboundRequestItem struct {
|
||||||
type CustomerInfo struct {
|
type CustomerInfo struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
PhoneNumber string `json:"phoneNumber"`
|
PhoneNumber string `json:"phoneNumber"`
|
||||||
|
Email string `json:"email"`
|
||||||
Address AddressDetail `json:"address"`
|
Address AddressDetail `json:"address"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,3 +70,31 @@ type CancelOutboundRequest struct {
|
||||||
ORCode string `json:"orCode"`
|
ORCode string `json:"orCode"`
|
||||||
Note string `json:"note"`
|
Note string `json:"note"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SyncORStatusRequest ...
|
||||||
|
type SyncORStatusRequest struct {
|
||||||
|
ORCode string `json:"orCode"`
|
||||||
|
OrderCode string `json:"orderCode"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateSupplierIsClosedRequest ...
|
||||||
|
type UpdateSupplierIsClosedRequest struct {
|
||||||
|
Suppliers []SupplierIsClosed `json:"suppliers"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// SupplierIsClosed ...
|
||||||
|
type SupplierIsClosed struct {
|
||||||
|
Supplier string `json:"supplier"`
|
||||||
|
IsClosed bool `json:"isClosed"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetWarehousesRequest ...
|
||||||
|
type GetWarehousesRequest struct {
|
||||||
|
Keyword string `json:"keyword"`
|
||||||
|
Status string `json:"status"`
|
||||||
|
Supplier string `json:"supplier"`
|
||||||
|
BusinessType string `json:"businessType"`
|
||||||
|
|
||||||
|
Page int64 `json:"page"`
|
||||||
|
Limit int64 `json:"limit"`
|
||||||
|
}
|
||||||
|
|
|
@ -25,6 +25,20 @@ type WarehouseConfiguration struct {
|
||||||
Partner WarehousePartner `json:"partner"`
|
Partner WarehousePartner `json:"partner"`
|
||||||
Delivery WarehouseDelivery `json:"delivery"`
|
Delivery WarehouseDelivery `json:"delivery"`
|
||||||
Other WarehouseOther `json:"other"`
|
Other WarehouseOther `json:"other"`
|
||||||
|
Food WarehouseFood `json:"food"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// WarehouseFood ...
|
||||||
|
type WarehouseFood struct {
|
||||||
|
ForceClosed bool `json:"forceClosed"`
|
||||||
|
IsClosed bool `json:"isClosed"`
|
||||||
|
TimeRange []TimeRange `json:"timeRange"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// TimeRange ...
|
||||||
|
type TimeRange struct {
|
||||||
|
From int64 `json:"from"`
|
||||||
|
To int64 `json:"to"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// WarehouseOther ...
|
// WarehouseOther ...
|
||||||
|
@ -68,6 +82,14 @@ type WarehousePartner struct {
|
||||||
Authentication string `json:"authentication"`
|
Authentication string `json:"authentication"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SyncORStatusResponse ...
|
||||||
|
type SyncORStatusResponse struct {
|
||||||
|
ORCode string `json:"orCode"`
|
||||||
|
OrderCode string `json:"orderCode"`
|
||||||
|
Status string `json:"status"`
|
||||||
|
DeliveryStatus string `json:"deliveryStatus"`
|
||||||
|
}
|
||||||
|
|
||||||
// ResponseWarehouseContact ...
|
// ResponseWarehouseContact ...
|
||||||
type ResponseWarehouseContact struct {
|
type ResponseWarehouseContact struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
|
@ -101,6 +123,7 @@ type ResponseLatLng struct {
|
||||||
type WarehouseNatsResponse struct {
|
type WarehouseNatsResponse struct {
|
||||||
ID string `json:"_id"`
|
ID string `json:"_id"`
|
||||||
Staff string `json:"staff"`
|
Staff string `json:"staff"`
|
||||||
|
BusinessType string `json:"businessType"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
SearchString string `json:"searchString"`
|
SearchString string `json:"searchString"`
|
||||||
Slug string `json:"slug"`
|
Slug string `json:"slug"`
|
||||||
|
@ -112,3 +135,30 @@ type WarehouseNatsResponse struct {
|
||||||
CreatedAt time.Time `json:"createdAt"`
|
CreatedAt time.Time `json:"createdAt"`
|
||||||
UpdatedAt time.Time `json:"updatedAt"`
|
UpdatedAt time.Time `json:"updatedAt"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WarehouseInfo ...
|
||||||
|
type WarehouseInfo struct {
|
||||||
|
ID string `json:"_id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
BusinessType string `json:"businessType"`
|
||||||
|
Status string `json:"status"`
|
||||||
|
Slug string `json:"slug"`
|
||||||
|
Supplier WarehouseSupplierInfo `json:"supplier"`
|
||||||
|
Location ResponseWarehouseLocation `json:"location"`
|
||||||
|
Contact ResponseWarehouseContact `json:"contact"`
|
||||||
|
CreatedAt string `json:"createdAt"`
|
||||||
|
UpdatedAt string `json:"updatedAt"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// WarehouseSupplierInfo ...
|
||||||
|
type WarehouseSupplierInfo struct {
|
||||||
|
ID string `json:"_id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetWarehousesResponse ...
|
||||||
|
type GetWarehousesResponse struct {
|
||||||
|
Total int64 `json:"total"`
|
||||||
|
Limit int64 `json:"limit"`
|
||||||
|
List []WarehouseInfo `json:"list"`
|
||||||
|
}
|
||||||
|
|
|
@ -18,7 +18,11 @@ func (sv Server) Request(subject string, payload []byte) (*nats.Msg, error) {
|
||||||
if sv.Config.RequestTimeout > 0 {
|
if sv.Config.RequestTimeout > 0 {
|
||||||
timeout = sv.Config.RequestTimeout
|
timeout = sv.Config.RequestTimeout
|
||||||
}
|
}
|
||||||
return sv.instance.Request(subject, payload, timeout)
|
msg, err := sv.instance.Request(subject, payload, timeout)
|
||||||
|
if errors.Is(err, nats.ErrNoResponders) {
|
||||||
|
log.Printf("[NATS SERVER]: request - no responders for subject: %s", subject)
|
||||||
|
}
|
||||||
|
return msg, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reply ...
|
// Reply ...
|
||||||
|
|
|
@ -7,13 +7,9 @@ func getCommunicationValue(val string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
var Communication = struct {
|
var Communication = struct {
|
||||||
RequestHTTP string
|
RequestHTTP string
|
||||||
ResponseHTTP string
|
ResponseHTTP string
|
||||||
WebhookTNC string
|
|
||||||
WebhookGlobalCare string
|
|
||||||
}{
|
}{
|
||||||
RequestHTTP: getCommunicationValue("request_http"),
|
RequestHTTP: getCommunicationValue("request_http"),
|
||||||
ResponseHTTP: getCommunicationValue("response_http"),
|
ResponseHTTP: getCommunicationValue("response_http"),
|
||||||
WebhookTNC: getCommunicationValue("webhook_tnc"),
|
|
||||||
WebhookGlobalCare: getCommunicationValue("webhook_global_care"),
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,13 +3,17 @@ package subject
|
||||||
var prefixes = struct {
|
var prefixes = struct {
|
||||||
Communication string
|
Communication string
|
||||||
Order string
|
Order string
|
||||||
|
News string
|
||||||
Warehouse string
|
Warehouse string
|
||||||
Location string
|
Location string
|
||||||
Supplier string
|
Supplier string
|
||||||
|
Seller string
|
||||||
}{
|
}{
|
||||||
Communication: "communication",
|
Communication: "communication",
|
||||||
Order: "order",
|
Order: "order",
|
||||||
|
News: "news",
|
||||||
Warehouse: "warehouse",
|
Warehouse: "warehouse",
|
||||||
Location: "location",
|
Location: "location",
|
||||||
Supplier: "supplier",
|
Supplier: "supplier",
|
||||||
|
Seller: "seller",
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,13 @@ func getLocationValue(val string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
var Location = struct {
|
var Location = struct {
|
||||||
GetLocationByCode string
|
GetLocationByCode string
|
||||||
|
GetProvincesByCodes string
|
||||||
|
GetDistrictsByCodes string
|
||||||
|
GetWardsByCodes string
|
||||||
}{
|
}{
|
||||||
GetLocationByCode: getLocationValue("get_location_warehouse"),
|
GetLocationByCode: getLocationValue("get_location_warehouse"),
|
||||||
|
GetProvincesByCodes: getLocationValue("get_provinces_by_codes"),
|
||||||
|
GetDistrictsByCodes: getLocationValue("get_districts_by_codes"),
|
||||||
|
GetWardsByCodes: getLocationValue("get_wards_by_codes"),
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
package subject
|
||||||
|
|
||||||
|
import "fmt"
|
||||||
|
|
||||||
|
func getNewsValue(val string) string {
|
||||||
|
return fmt.Sprintf("%s.%s", prefixes.News, val)
|
||||||
|
}
|
||||||
|
|
||||||
|
var News = struct {
|
||||||
|
GetProductNoticesByInventory string
|
||||||
|
}{
|
||||||
|
GetProductNoticesByInventory: getNewsValue("get_product_notices_by_inventory"),
|
||||||
|
}
|
|
@ -7,11 +7,15 @@ func getOrderValue(val string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
var Order = struct {
|
var Order = struct {
|
||||||
UpdateORStatus string
|
UpdateORStatus string
|
||||||
CancelDelivery string
|
CancelDelivery string
|
||||||
WebhookTNC string
|
ChangeDeliveryStatus string
|
||||||
WebhookGlobalCare string
|
UpdateLogisticInfoFailed string
|
||||||
|
ORNotUpdateStatus string
|
||||||
}{
|
}{
|
||||||
UpdateORStatus: getOrderValue("update_outbound_request_status"),
|
UpdateORStatus: getOrderValue("update_outbound_request_status"),
|
||||||
CancelDelivery: getOrderValue("cancel_delivery"),
|
CancelDelivery: getOrderValue("cancel_delivery"),
|
||||||
|
ChangeDeliveryStatus: getOrderValue("change_delivery_status"),
|
||||||
|
UpdateLogisticInfoFailed: getOrderValue("update_logistic_info_failed"),
|
||||||
|
ORNotUpdateStatus: getOrderValue("outbound_request_not_update_status"),
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
package subject
|
||||||
|
|
||||||
|
import "fmt"
|
||||||
|
|
||||||
|
func getSellerValue(val string) string {
|
||||||
|
return fmt.Sprintf("%s.%s", prefixes.Seller, val)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Seller ...
|
||||||
|
var Seller = struct {
|
||||||
|
GetSellerInfoByID string
|
||||||
|
GetListSellerInfoByIDs string
|
||||||
|
}{
|
||||||
|
GetSellerInfoByID: getSellerValue("get_seller_info_by_id"),
|
||||||
|
GetListSellerInfoByIDs: getSellerValue("get_list_seller_info_by_ids"),
|
||||||
|
}
|
||||||
|
|
||||||
|
// SupportChat ...
|
||||||
|
var SupportChat = struct {
|
||||||
|
GetListSellerInfoSupportChatByIDs string
|
||||||
|
}{
|
||||||
|
GetListSellerInfoSupportChatByIDs: "SELLY_CHAT.REQUEST.SELLER_INFO",
|
||||||
|
}
|
|
@ -9,7 +9,9 @@ func getSupplierValue(val string) string {
|
||||||
var Supplier = struct {
|
var Supplier = struct {
|
||||||
GetListSupplierInfo string
|
GetListSupplierInfo string
|
||||||
GetSupplierContractBySupplierID string
|
GetSupplierContractBySupplierID string
|
||||||
|
FindAll string
|
||||||
}{
|
}{
|
||||||
GetListSupplierInfo: getSupplierValue("get_list_supplier_info"),
|
GetListSupplierInfo: getSupplierValue("get_list_supplier_info"),
|
||||||
GetSupplierContractBySupplierID: getSupplierValue("get_supplier_contract_by_supplier_id"),
|
GetSupplierContractBySupplierID: getSupplierValue("get_supplier_contract_by_supplier_id"),
|
||||||
|
FindAll: getSupplierValue("find_all"),
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,12 +11,17 @@ var Warehouse = struct {
|
||||||
UpdateOutboundRequestLogistic string
|
UpdateOutboundRequestLogistic string
|
||||||
CancelOutboundRequest string
|
CancelOutboundRequest string
|
||||||
GetConfiguration string
|
GetConfiguration string
|
||||||
|
SyncORStatus string
|
||||||
|
WebhookTNC string
|
||||||
|
WebhookGlobalCare string
|
||||||
FindOne string
|
FindOne string
|
||||||
FindByCondition string
|
FindByCondition string
|
||||||
Distinct string
|
Distinct string
|
||||||
Count string
|
Count string
|
||||||
AfterUpdateWarehouse string
|
AfterUpdateWarehouse string
|
||||||
AfterCreateWarehouse string
|
AfterCreateWarehouse string
|
||||||
|
UpdateIsClosedSupplier string
|
||||||
|
GetWarehouses string
|
||||||
}{
|
}{
|
||||||
AfterCreateWarehouse: getWarehouseValue("after_create_warehouse"),
|
AfterCreateWarehouse: getWarehouseValue("after_create_warehouse"),
|
||||||
AfterUpdateWarehouse: getWarehouseValue("after_update_warehouse"),
|
AfterUpdateWarehouse: getWarehouseValue("after_update_warehouse"),
|
||||||
|
@ -24,8 +29,13 @@ var Warehouse = struct {
|
||||||
UpdateOutboundRequestLogistic: getWarehouseValue("update_outbound_request_logistic_info"),
|
UpdateOutboundRequestLogistic: getWarehouseValue("update_outbound_request_logistic_info"),
|
||||||
CancelOutboundRequest: getWarehouseValue("cancel_outbound_request"),
|
CancelOutboundRequest: getWarehouseValue("cancel_outbound_request"),
|
||||||
GetConfiguration: getWarehouseValue("get_configuration"),
|
GetConfiguration: getWarehouseValue("get_configuration"),
|
||||||
|
SyncORStatus: getWarehouseValue("sync_or_status"),
|
||||||
|
WebhookTNC: getWarehouseValue("webhook_tnc"),
|
||||||
|
WebhookGlobalCare: getWarehouseValue("webhook_global_care"),
|
||||||
FindOne: getWarehouseValue("find_one"),
|
FindOne: getWarehouseValue("find_one"),
|
||||||
FindByCondition: getWarehouseValue("find_all_by_condition"),
|
FindByCondition: getWarehouseValue("find_all_by_condition"),
|
||||||
Distinct: getWarehouseValue("distinct"),
|
Distinct: getWarehouseValue("distinct"),
|
||||||
Count: getWarehouseValue("count"),
|
Count: getWarehouseValue("count"),
|
||||||
|
UpdateIsClosedSupplier: getWarehouseValue("update_is_closed_supplier"),
|
||||||
|
GetWarehouses: getWarehouseValue("get_warehouses"),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue