core: badge codes schema, plan (#7427)

This commit is contained in:
spaced4ndy authored and GitHub committed 2026-08-28 09:31:24 +00:00
1 parent 7d54a5b960
commit e80a174f13
11 files changed
+364 -20

No files matched your search

+4
View File
@@ -62,6 +62,10 @@ data BadgeServiceCommand
paymentVia :: ServicePaymentMethod,
upgrade :: Maybe BadgeUpgrade -- upgrade non-store badge
}
| BSCRedeemBadgeCode
{ masterKey :: BadgeMasterKey,
code :: Text -- no badgeRequest: a code carries no tier for the client to state
}
| BSCPurchaseBadge
{ badgeRequest :: BadgeRequest,
payment :: ServicePayment,
+5 -1
View File
@@ -9,6 +9,7 @@ module Simplex.Chat.Badges.Types
BadgeItemStatus (..),
OfferDiscount (..),
BadgePurchaseStatus (..),
BadgeCodePaymentStatus (..),
LedgerEntryType (..),
LedgerCreditType (..),
LedgerDebitType (..),
@@ -22,7 +23,6 @@ module Simplex.Chat.Badges.Types
) where
import qualified Data.Aeson as J
import Data.ByteString.Char8 (ByteString)
import Data.Int (Int64)
import Data.Text (Text)
import Data.Time.Clock (UTCTime)
@@ -58,6 +58,10 @@ data OfferDiscount
data BadgePurchaseStatus = PSAcquiring | PSIssued | PSSuperseded | PSFailed
deriving (Eq, Show)
-- unconfirmed draft
data BadgeCodePaymentStatus = CPSPaid | CPSUnpaid | CPSFree
deriving (Eq, Show)
-- confirmed
data LedgerEntryType = LECredit {credit :: LedgerCreditType} | LEDebit {debit :: LedgerDebitType}
deriving (Eq, Show)