This commit is contained in:
37
src/main/java/be/seeseepuff/pcinv/models/Asset.java
Normal file
37
src/main/java/be/seeseepuff/pcinv/models/Asset.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package be.seeseepuff.pcinv.models;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.Id;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* Represents a generic asset in the inventory system.
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
public class Asset
|
||||
{
|
||||
@Id @GeneratedValue
|
||||
private Long id;
|
||||
|
||||
/// The QR code attached to the asset, used for identification.
|
||||
private Long qr;
|
||||
|
||||
/// The brand of the asset.
|
||||
private String brand;
|
||||
|
||||
/// The model of the asset
|
||||
private String model;
|
||||
|
||||
/// The asset's serial number.
|
||||
private String serialNumber;
|
||||
|
||||
/// A description of the asset, providing additional details.
|
||||
private String description;
|
||||
|
||||
/// The state of the asset, indicating its condition.
|
||||
private AssetCondition condition;
|
||||
}
|
||||
18
src/main/java/be/seeseepuff/pcinv/models/AssetCondition.java
Normal file
18
src/main/java/be/seeseepuff/pcinv/models/AssetCondition.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package be.seeseepuff.pcinv.models;
|
||||
|
||||
/**
|
||||
* Represents the condition of an asset in the inventory system.
|
||||
*/
|
||||
public enum AssetCondition
|
||||
{
|
||||
/// The asset is in perfect working order.
|
||||
HEALTHY,
|
||||
/// The condition of the asset is unknown. E.g.: it is untested.
|
||||
UNKNOWN,
|
||||
/// The asset generally works, but has some known issues.
|
||||
PARTIAL,
|
||||
/// The asset is in need of repair, but is not completely broken.
|
||||
REPAIR,
|
||||
/// The asset is completely broken and cannot be used.
|
||||
BORKED,
|
||||
}
|
||||
32
src/main/java/be/seeseepuff/pcinv/models/HddAsset.java
Normal file
32
src/main/java/be/seeseepuff/pcinv/models/HddAsset.java
Normal file
@@ -0,0 +1,32 @@
|
||||
package be.seeseepuff.pcinv.models;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.Id;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* Represents a hard drive or similar device.
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
public class HddAsset
|
||||
{
|
||||
@Id
|
||||
@GeneratedValue
|
||||
private Long id;
|
||||
|
||||
/// The ID of the associated asset, linking it to the generic Asset model.
|
||||
private Long assetId;
|
||||
|
||||
/// The capacity of the drive in bytes.
|
||||
private Long capacity;
|
||||
|
||||
/// The drive's interface type, such as SATA, IDE, ISA-16, ...
|
||||
private String interfaceType;
|
||||
|
||||
/// The drive's form factor, such as 2.5", 3.5", etc.
|
||||
private String formFactor;
|
||||
}
|
||||
29
src/main/java/be/seeseepuff/pcinv/models/RamAsset.java
Normal file
29
src/main/java/be/seeseepuff/pcinv/models/RamAsset.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package be.seeseepuff.pcinv.models;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.Id;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* Represents a RAM DIMM or similar memory asset in the inventory system.
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
public class RamAsset
|
||||
{
|
||||
@Id
|
||||
@GeneratedValue
|
||||
private Long id;
|
||||
|
||||
/// The ID of the associated asset, linking it to the generic Asset model.
|
||||
private Long assetId;
|
||||
|
||||
/// The capacity of the RAM in bytes.
|
||||
private Long capacity;
|
||||
|
||||
/// The type of memory. E.g.: DDR2, SDRAM, ISA-8, etc...
|
||||
private String type;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package be.seeseepuff.pcinv.repositories;
|
||||
|
||||
import be.seeseepuff.pcinv.models.Asset;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface AssetRepository extends CrudRepository<Asset, Long> {}
|
||||
@@ -1 +1,6 @@
|
||||
spring.application.name=pcinv
|
||||
server.port=8088
|
||||
spring.datasource.url=jdbc:postgresql://localhost:5432/pcinv
|
||||
spring.datasource.username=pcinv
|
||||
spring.datasource.password=pcinv
|
||||
a
|
||||
|
||||
Reference in New Issue
Block a user