fix(payments): stop doubling the pack size in buyer mail
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 11s
CI / integration (pull_request) Successful in 23s
CI / ui (pull_request) Successful in 1m16s
CI / conformance (pull_request) Successful in 11s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m50s
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 11s
CI / integration (pull_request) Successful in 23s
CI / ui (pull_request) Successful in 1m16s
CI / conformance (pull_request) Successful in 11s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m50s
Catalog titles already name the pack ("50 фишек"), so appending the chip count
produced "50 фишек — 50 фишек, 79.00 ₽". The letter now carries the title
exactly as the storefront shows it, then the price.
The tax receipt is unaffected: it states the quantity in the wording the tax
service wants, which is a separate surface with separate requirements.
This commit is contained in:
@@ -476,7 +476,7 @@ func (s *Store) pendingPurchaseMails(ctx context.Context, limit int) ([]Purchase
|
||||
rows, err := s.db.QueryContext(ctx, `
|
||||
SELECT e.event_id, e.account_id, e.order_id, COALESCE(o.origin, ''),
|
||||
COALESCE(o.expected_amount, 0), COALESCE(o.currency, ''),
|
||||
COALESCE(p.title, ''), COALESCE((e.payload->>'chips')::int, 0), e.created_at
|
||||
COALESCE(p.title, ''), e.created_at
|
||||
FROM payments.payment_events e
|
||||
LEFT JOIN payments.orders o ON o.order_id = e.order_id
|
||||
LEFT JOIN payments.product p ON p.product_id = o.product_id
|
||||
@@ -495,7 +495,7 @@ func (s *Store) pendingPurchaseMails(ctx context.Context, limit int) ([]Purchase
|
||||
orderID uuid.NullUUID
|
||||
)
|
||||
if err := rows.Scan(&m.EventID, &m.AccountID, &orderID, &m.Origin, &m.AmountMinor,
|
||||
&m.Currency, &m.Title, &m.Chips, &m.CreatedAt); err != nil {
|
||||
&m.Currency, &m.Title, &m.CreatedAt); err != nil {
|
||||
return nil, fmt.Errorf("payments: scan purchase mail: %w", err)
|
||||
}
|
||||
m.OrderID = orderID.UUID
|
||||
@@ -551,7 +551,7 @@ func (s *Store) pendingMyNalogMails(ctx context.Context, limit int, cancelled bo
|
||||
&m.AmountMinor, &m.Currency, &m.OperationTime); err != nil {
|
||||
return nil, fmt.Errorf("payments: scan receipt mail: %w", err)
|
||||
}
|
||||
m.Title, m.Chips = describeSnapshot(snapshot.String)
|
||||
m.Title, _ = describeSnapshot(snapshot.String)
|
||||
out = append(out, m)
|
||||
}
|
||||
if err := rows.Err(); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user