initial commit

This commit is contained in:
2024-01-18 00:03:13 -06:00
commit 8654ded7a0
34 changed files with 2650 additions and 0 deletions

42
internal/types/assets.go Normal file
View File

@@ -0,0 +1,42 @@
package types
import (
"time"
)
type AssetResponse struct {
Asset *Asset `json:"asset"`
}
type MultipleAssetsResponse struct {
Assets []*Asset `json:"assets"`
Total int `json:"total"`
}
type CreateAssetRequest struct {
Name string `json:"name"`
Quantity int `json:"quantity"`
Length string `json:"length,omitempty"`
Manufacturer string `json:"manufacturer,omitempty"`
ModelName string `json:"model_name,omitempty"`
Price float64 `json:"price,omitempty"`
Comments string `json:"comments,omitempty"`
ShelfLocationID int `json:"shelf_location_id,omitempty"`
CategoryID int `json:"category_id,omitempty"`
}
type Asset struct {
ID uint64 `json:"id"`
Name string `json:"name"`
Quantity int `json:"quantity"`
Length string `json:"length,omitempty"`
Manufacturer string `json:"manufacturer,omitempty"`
ModelName string `json:"model_name,omitempty"`
Price float64 `json:"price,omitempty"`
Comments string `json:"comments,omitempty"`
ShelfLocation *ShelfLocation `json:"shelf_location,omitempty"`
Category *Category `json:"category,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
}

View File

@@ -0,0 +1,11 @@
package types
import "time"
type Building struct {
ID uint64 `json:"id"`
Name string `json:"name"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
}

View File

@@ -0,0 +1,11 @@
package types
import "time"
type Category struct {
ID uint64 `json:"id"`
Name string `json:"name"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
}

23
internal/types/shelves.go Normal file
View File

@@ -0,0 +1,23 @@
package types
import "time"
type ShelfResponse struct {
ShelfLocation *ShelfLocation `json:"shelf"`
}
type MultipleShelfResponse struct {
ShelfLocations []*ShelfLocation `json:"shelves"`
Total int `json:"total"`
}
type ShelfLocation struct {
ID uint64 `json:"id"`
Name string `json:"name"`
RoomNumber string `json:"room_number,omitempty"`
Description string `json:"description,omitempty"`
BuildingID *uint64 `json:"building_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
}