diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.xyz> | 2023-01-31 14:45:55 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.xyz> | 2023-01-31 14:45:55 +0530 |
commit | 894042060791ec106ad12ddf1b4a7b872c4a6aa6 (patch) | |
tree | 7c305ce72b296794065fa5f36f62290a9f48ea17 | |
parent | 7be2937c84c7b9e260498268c210fd6f4bebf2a3 (diff) |
-rw-r--r-- | auth/refresh.go | 1 | ||||
-rw-r--r-- | invoice/invoice.go | 2 | ||||
-rw-r--r-- | user/user.go | 14 |
3 files changed, 12 insertions, 5 deletions
diff --git a/auth/refresh.go b/auth/refresh.go index 5b1a7df..ef01a84 100644 --- a/auth/refresh.go +++ b/auth/refresh.go @@ -42,6 +42,7 @@ func init() { refreshSecret = []byte(conf.RefreshTokenSecret) } +// TODO: check if user even exists and send response accordingly // middleware to check refresh token func verifyRefreshToken() gin.HandlerFunc { return func(ctx *gin.Context) { diff --git a/invoice/invoice.go b/invoice/invoice.go index f7b638a..813ce06 100644 --- a/invoice/invoice.go +++ b/invoice/invoice.go @@ -29,7 +29,7 @@ import ( // initialise a database connection for this package // not sure if I should do this but I am... -var db *mongo.Collection = database.DB.Collection("Invoice") +var db *mongo.Collection = database.DB.Collection("Invoices") /* The *legendary* Invoice struct * Each Recipient, Item in invoice, Address diff --git a/user/user.go b/user/user.go index 6fc6163..3ada9e6 100644 --- a/user/user.go +++ b/user/user.go @@ -19,6 +19,7 @@ package user import ( "errors" + c "github.com/MikunoNaka/OpenBills-server/client" "github.com/MikunoNaka/OpenBills-server/database" "go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.org/mongo-driver/mongo" @@ -43,10 +44,15 @@ type Session struct { type User struct { Id primitive.ObjectID `bson:"_id,omitempty" json:"Id"` UserName string `bson:"UserName" json:"UserName"` - Email string `bson:"Email" json:"Email"` - Password string `bson:"Password" json:"Password"` - Config Config `bson:"Config" json:"Config"` - Sessions []Session `bson:"Sessions" json:"Sessions"` + // business title, etc + Title string `bson:"Title" json:"Title"` + Email string `bson:"Email" json:"Email"` + Password string `bson:"Password" json:"Password"` + Config Config `bson:"Config" json:"Config"` + Sessions []Session `bson:"Sessions" json:"Sessions"` + Contact c.Contact `bson:"Contact" json:"Contact"` + Address c.Address `bson:"Address" json:"Address"` + GSTIN string `bson:"GSTIN" json:"GSTIN"` // some actions are only available when email is verified Verified bool `bson:"Verified" json:"Verified"` } |