fix/update handler

This commit is contained in:
SowinskiBraeden committed 2022-09-28 20:14:13 -07:00
1 parent 4f4438b4b2
commit 292f334f9c
4 files changed
+73 -29

No files matched your search

+10 -10
View File
@@ -7,23 +7,23 @@ import (
// Cow holds the structure for the cow collection in mongo
type Cow struct {
ID string `json:"_id" bson:"_id"` // MongoDB ID
Details CowDetails `json:"cow" bson:"cow"` // Details
Details CowDetails `json:"cow" bson:"Cow"` // Details
}
// BookDetails holds the checkout details
type BookDetails struct {
Author string `json:"author" bson:"author"` // User who booked
Devices []string `json:"devices" bson:"devices"` // Array of device mongo ID's
Block string `json:"block" bson:"block"` // Block that is booked
Date primitive.DateTime `json:"date" bson:"date"` // Date this booking occurs
Author string `json:"author" bson:"Author"` // User who booked
Devices []string `json:"devices" bson:"Devices"` // Array of device mongo ID's
Block string `json:"block" bson:"Block"` // Block that is booked
Date primitive.DateTime `json:"date" bson:"Date"` // Date this booking occurs
}
// CowDetails holds the structure for the inner cow structure as
// defined in the cow collection in mongo
type CowDetails struct {
Name string `json:"name" bson:"name"` // eg. CA-01
Collection string `json:"collection" bson:"collection"` // eg. Laptop, Ipad, etc
TotalDevices int `json:"totalDevices" bson:"totalDevices"` // # of devices in that cart collection
Bookings []BookDetails `json:"bookings" bson:"bookings"` // An array of all active bookings (send top 10)
Devices []string `json:"devices" bson:"devices"` // Array of device mongo ID's
Name string `json:"name" bson:"Name"` // eg. CA-01
Collection string `json:"collection" bson:"Collection"` // eg. Laptop, Ipad, etc
DeviceTotal int `json:"deviceTotal" bson:"DeviceTotal"` // # of devices in that cart collection
Bookings []BookDetails `json:"bookings" bson:"Bookings"` // An array of all active bookings (send top 10)
Devices []string `json:"devices" bson:"Devices"` // Array of device mongo ID's
}
+5 -5
View File
@@ -2,13 +2,13 @@ package models
// Device holds the structure for the device collection in mongo
type Device struct {
ID string `json:"_id" bson:"_id"` // MongoDB ID
Details DeviceDetails `json:"details" bson:"details"` // Details
ID string `json:"_id" bson:"_id"` // MongoDB ID
Details DeviceDetails `json:"device" bson:"Device"` // Details
}
// Device holds the structure for the Device collection in mongo
type DeviceDetails struct {
Type string `json:"type" bson:"type"` // eg. Laptop, Ipdad, etc
Name string `json:"name" bson:"name"` // eg. SULH-LAP-01
Parent string `json:"parent" bson:"parent"` // Parent cow Mongo ID
Type string `json:"type" bson:"Type"` // eg. Laptop, Ipdad, etc
Name string `json:"name" bson:"Name"` // eg. SULH-LAP-01
Parent string `json:"parent" bson:"Parent"` // Parent cow Mongo ID
}