Got initial framework running
Some checks failed
Build / build (push) Failing after 9s

This commit is contained in:
2025-06-04 09:43:53 +02:00
parent ed68ead1fb
commit 20bd00f67b
14 changed files with 133 additions and 122 deletions

View 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;
}

View 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,
}

View 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;
}

View 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;
}

View File

@@ -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> {}

View File

@@ -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