Use typed IDs instead of plain strings

This commit is contained in:
2019-11-18 14:01:13 +09:00
parent e7c7e84334
commit a50a119e08
26 changed files with 75 additions and 44 deletions

View File

@ -4,8 +4,8 @@ import "github.com/aerogo/nano"
// Purchase represents an item purchase by a user.
type Purchase struct {
UserID string `json:"userId"`
ItemID string `json:"itemId"`
UserID UserID `json:"userId"`
ItemID ID `json:"itemId"`
Quantity int `json:"quantity"`
Price int `json:"price"`
Currency string `json:"currency"`