Add Chassis asset model and repository; define properties and metadata

This commit is contained in:
2025-06-08 15:03:46 +02:00
parent 162bd7fd74
commit 51820545a0
2 changed files with 62 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
package be.seeseepuff.pcinv.models;
import be.seeseepuff.pcinv.meta.AssetInfo;
import be.seeseepuff.pcinv.meta.Description;
import be.seeseepuff.pcinv.meta.HideInOverview;
import be.seeseepuff.pcinv.meta.Property;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Entity
@AssetInfo(
displayName = "Chassis",
pluralName = "Chassis",
type = "chassis"
)
@Table(name = "chassis_assets")
public class ChassisAsset implements Asset
{
@Id
@GeneratedValue
private long id;
/// The generic asset associated with this RAM.
@OneToOne(orphanRemoval = true)
private GenericAsset asset;
@Description("The number of 5.25\" drive bays in the chassis.")
@Property("5.25\" Bays")
@HideInOverview
private Long bay5_25Count;
@Description("The number of 3.5\" drive bays in the chassis.")
@Property("3.5\" Bays")
private Long bay3_5Count;
@Description("The number of internal 3.5\" drive bays in the chassis.")
@Property("Internal 3.5\" Bays")
private Long internalBay3_5Count;
@Description("The number of 2.5\" drive bays in the chassis.")
@Property("2.5\" Bays")
private Long bay2_5Count;
@Description("The number of expansion slots in the chassis.")
@Property("Expansion Slots")
private Long expansionSlotCount;
}

View File

@@ -0,0 +1,12 @@
package be.seeseepuff.pcinv.repositories;
import be.seeseepuff.pcinv.models.ChassisAsset;
import org.springframework.data.jpa.repository.JpaRepository;
@SuppressWarnings("unused")
public interface ChassisRepository extends JpaRepository<ChassisAsset, Long>, AssetRepository<ChassisAsset> {
@Override
default Class<ChassisAsset> getAssetType() {
return ChassisAsset.class;
}
}