initial commit
This commit is contained in:
42
internal/types/assets.go
Normal file
42
internal/types/assets.go
Normal 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"`
|
||||
}
|
||||
11
internal/types/buildings.go
Normal file
11
internal/types/buildings.go
Normal 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"`
|
||||
}
|
||||
11
internal/types/categories.go
Normal file
11
internal/types/categories.go
Normal 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
23
internal/types/shelves.go
Normal 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"`
|
||||
}
|
||||
Reference in New Issue
Block a user