Skip to content

Commit d2fd7f4

Browse files
kitallisclaude
andcommitted
Use subtotalDisplay for better quote item formatting
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent bf4b01a commit d2fd7f4

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

main.go

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ type Customer struct {
4646
}
4747

4848
type Item struct {
49-
Product string `json:"product"`
50-
Display string `json:"display"`
51-
Quantity any `json:"quantity"`
52-
Price any `json:"price"`
53-
Subtotal any `json:"subtotal"`
49+
Product string `json:"product"`
50+
Display string `json:"display"`
51+
Quantity any `json:"quantity"`
52+
Price any `json:"price"`
53+
Subtotal any `json:"subtotal"`
54+
SubtotalDisplay string `json:"subtotalDisplay"`
5455
}
5556

5657
type SubscriptionData struct {
@@ -426,7 +427,11 @@ func formatQuoteMessage(data QuoteData, live bool, title string) SlackMessage {
426427
if len(data.Items) > 0 {
427428
text += "\n\nItems:"
428429
for _, item := range data.Items {
429-
text += fmt.Sprintf("\n• %s (x%v) - %s", item.Display, item.Quantity, item.Subtotal)
430+
subtotalStr := fmt.Sprintf("%v", item.Subtotal)
431+
if item.SubtotalDisplay != "" {
432+
subtotalStr = item.SubtotalDisplay
433+
}
434+
text += fmt.Sprintf("\n• %s (x%v) - %s", item.Display, item.Quantity, subtotalStr)
430435
}
431436
}
432437

0 commit comments

Comments
 (0)