From aa0dd18e225b35e00e44aa464465952be59fe4d5 Mon Sep 17 00:00:00 2001 From: Preston Baxter Date: Mon, 30 Oct 2023 19:06:18 -0500 Subject: [PATCH] B: Thinking about vendors --- ui/db/models/venor.go | 22 ++++++++++++++++++++++ ui/templates/dashboard_page.templ | 5 ++++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 ui/db/models/venor.go diff --git a/ui/db/models/venor.go b/ui/db/models/venor.go new file mode 100644 index 0000000..ac98f40 --- /dev/null +++ b/ui/db/models/venor.go @@ -0,0 +1,22 @@ +package models + +import "go.mongodb.org/mongo-driver/bson/primitive" + +const VENDOR_TYPE = "vendor" +const VENDOR_ACCOUNT_TYPE = "vendor_account" + +type Vendor struct { + CommonFields `bson:"obj_info"` + mongoId primitive.ObjectID `bson:"_id,omitempty"` + VendorId string `bson:"vendor_id,omitempty"` + Name string `bson:"name,omitempty"` + OAuthUrl string `bson:"oauth_url"` +} + +type VendorAccount struct { + CommonFields `bson:"obj_info"` + mongoId primitive.ObjectID `bson:"_id,omitempty"` + UserId string `bson:"user_id,omitempty"` + Secret string `bson:"secret,omitempty"` + VendorId string `bson:"vendor_id,omitempty"` +} diff --git a/ui/templates/dashboard_page.templ b/ui/templates/dashboard_page.templ index 8645771..b43cc89 100644 --- a/ui/templates/dashboard_page.templ +++ b/ui/templates/dashboard_page.templ @@ -123,7 +123,7 @@ templ DashboardContentNav(user *models.User) { + >Capstone