Implement reserved list
This commit is contained in:
parent
bd7536b6d3
commit
5cc20e8bad
@ -173,9 +173,9 @@ func print_price_history(prices []PriceEntry, prefix string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if value > before && before != 0 {
|
if value > before && before != 0 {
|
||||||
fmt.Printf("%s%s%s %.2f %s%s (%+.2f%%)\n", prefix, stringToTime(e.Date), Green, value, getCurrency(), Reset, (value/before*100)-100)
|
fmt.Printf("%s%s%s %.2f %s%s (%+.2f%%, %+.2f %s)\n", prefix, stringToTime(e.Date), Green, value, getCurrency(), Reset, (value/before*100)-100, value-before, getCurrency())
|
||||||
} else if value < before {
|
} else if value < before {
|
||||||
fmt.Printf("%s%s%s %.2f %s%s (%+.2f%%)\n", prefix, stringToTime(e.Date), Red, value, getCurrency(), Reset, (value/before*100)-100)
|
fmt.Printf("%s%s%s %.2f %s%s (%+.2f%%, %+.2f %s)\n", prefix, stringToTime(e.Date), Red, value, getCurrency(), Reset, (value/before*100)-100, value-before, getCurrency())
|
||||||
} else {
|
} else {
|
||||||
fmt.Printf("%s%s %.2f %s%s\n", prefix, stringToTime(e.Date), value, getCurrency(), Reset)
|
fmt.Printf("%s%s %.2f %s%s\n", prefix, stringToTime(e.Date), value, getCurrency(), Reset)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,11 +58,24 @@ var statsCmd = &cobra.Command{
|
|||||||
{"unique", bson.D{{"$sum", 1}}},
|
{"unique", bson.D{{"$sum", 1}}},
|
||||||
}}},
|
}}},
|
||||||
})
|
})
|
||||||
|
|
||||||
fmt.Printf("\n%sCards %s\n", Green, Reset)
|
fmt.Printf("\n%sCards %s\n", Green, Reset)
|
||||||
fmt.Printf("Total Cards: %s%.0f%s\n", Yellow, stats[0]["count"], Reset)
|
fmt.Printf("Total: %s%.0f%s\n", Yellow, stats[0]["count"], Reset)
|
||||||
fmt.Printf("Total Foil Cards: %s%d%s\n", Purple, stats[0]["count_foil"], Reset)
|
fmt.Printf("Unique: %s%d%s\n", Purple, stats[0]["unique"], Reset)
|
||||||
fmt.Printf("Total Etched Cards: %s%d%s\n", Purple, stats[0]["count_etched"], Reset)
|
fmt.Printf("Foil: %s%d%s\n", Purple, stats[0]["count_foil"], Reset)
|
||||||
fmt.Printf("Unique Cards: %s%d%s\n", Purple, stats[0]["unique"], Reset)
|
fmt.Printf("Etched: %s%d%s\n", Purple, stats[0]["count_etched"], Reset)
|
||||||
|
|
||||||
|
reserved, _ := coll.storage_aggregate(mongo.Pipeline{
|
||||||
|
bson.D{
|
||||||
|
{"$match", bson.D{
|
||||||
|
{"reserved", true}}}},
|
||||||
|
bson.D{
|
||||||
|
{"$group", bson.D{
|
||||||
|
{"_id", nil},
|
||||||
|
{"count", bson.D{{"$sum", 1}}},
|
||||||
|
}}},
|
||||||
|
})
|
||||||
|
fmt.Printf("Reserved List: %s%d%s\n", Yellow, reserved[0]["count"], Reset)
|
||||||
|
|
||||||
rar, _ := coll.storage_aggregate(mongo.Pipeline{
|
rar, _ := coll.storage_aggregate(mongo.Pipeline{
|
||||||
bson.D{
|
bson.D{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user