From d9763edd75d48c0d20b7ce5aff940b47fb44eb67 Mon Sep 17 00:00:00 2001 From: Nguyen Minh Date: Fri, 23 Sep 2022 22:11:24 +0700 Subject: [PATCH 1/2] pull js seller affiliate statistic --- js/consumer/selly.go | 6 ++++-- js/model/selly.go | 19 +++++++++++++++++++ js/subject/selly.go | 6 ++++-- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/js/consumer/selly.go b/js/consumer/selly.go index 380927c..b13c5f6 100644 --- a/js/consumer/selly.go +++ b/js/consumer/selly.go @@ -2,7 +2,9 @@ package jsconsumer // Selly ... var Selly = struct { - PushNotification string + PushNotification string + UpdateSellerStatistic string }{ - PushNotification: "PULL_PUSH_NOTIFICATION", + PushNotification: "PULL_PUSH_NOTIFICATION", + UpdateSellerStatistic: "PULL_UPDATE_SELLER_STATISTIC", } diff --git a/js/model/selly.go b/js/model/selly.go index ab8d021..412e62d 100644 --- a/js/model/selly.go +++ b/js/model/selly.go @@ -15,3 +15,22 @@ 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"` + CommissionTransactionRejected float64 `json:"commissionTransactionRejected"` +} diff --git a/js/subject/selly.go b/js/subject/selly.go index bdd4ce8..204e781 100644 --- a/js/subject/selly.go +++ b/js/subject/selly.go @@ -11,7 +11,9 @@ func getSellyValue(val string) string { // Selly ... var Selly = struct { - PushNotification string + PushNotification string + UpdateSellerStatistic string }{ - PushNotification: getSellyValue("push_notifications"), + PushNotification: getSellyValue("push_notifications"), + UpdateSellerStatistic: getSellyValue("update_seller_statistic"), } From 68b9cab1e2f9733947cf3709f54ee0ae53289f04 Mon Sep 17 00:00:00 2001 From: Nguyen Minh Date: Fri, 23 Sep 2022 22:11:28 +0700 Subject: [PATCH 2/2] pull js seller affiliate statistic --- js/consumer/selly.go | 8 ++++---- js/subject/selly.go | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/js/consumer/selly.go b/js/consumer/selly.go index b13c5f6..0305c7c 100644 --- a/js/consumer/selly.go +++ b/js/consumer/selly.go @@ -2,9 +2,9 @@ package jsconsumer // Selly ... var Selly = struct { - PushNotification string - UpdateSellerStatistic string + PushNotification string + UpdateSellerAffiliateStatistic string }{ - PushNotification: "PULL_PUSH_NOTIFICATION", - UpdateSellerStatistic: "PULL_UPDATE_SELLER_STATISTIC", + PushNotification: "PULL_PUSH_NOTIFICATION", + UpdateSellerAffiliateStatistic: "PULL_UPDATE_SELLER_AFFILIATE_STATISTIC", } diff --git a/js/subject/selly.go b/js/subject/selly.go index 204e781..71ca355 100644 --- a/js/subject/selly.go +++ b/js/subject/selly.go @@ -11,9 +11,9 @@ func getSellyValue(val string) string { // Selly ... var Selly = struct { - PushNotification string - UpdateSellerStatistic string + PushNotification string + UpdateSellerAffiliateStatistic string }{ - PushNotification: getSellyValue("push_notifications"), - UpdateSellerStatistic: getSellyValue("update_seller_statistic"), + PushNotification: getSellyValue("push_notifications"), + UpdateSellerAffiliateStatistic: getSellyValue("update_seller_affiliate_statistic"), }