All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ligoj.app.plugin.prov.model.AbstractPrice Maven / Gradle / Ivy

The newest version!
/*
 * Licensed under MIT (https://github.com/ligoj/ligoj/blob/master/LICENSE)
 */
package org.ligoj.app.plugin.prov.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.MappedSuperclass;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.ColumnDefault;
import org.ligoj.bootstrap.core.model.AbstractPersistable;

/**
 * Resource price context.
 *
 * @param  Resource type.
 */
@Getter
@Setter
@MappedSuperclass
@ToString(of = { "cost", "type", "location" })
public abstract class AbstractPrice extends AbstractPersistable {

	/**
	 * The internal offer code.
	 */
	private String code;

	/**
	 * The monthly cost of the resource. The meaning of this value depends on the implementing class.
	 */
	private double cost = 0;

	/**
	 * Optional location constraint.
	 */
	@ManyToOne
	@JsonIgnore
	private ProvLocation location;

	/**
	 * The related resource type.
	 */
	@NotNull
	@ManyToOne
	private T type;

	/**
	 * Indicates the consumption of carbon(co2) for this instance.
	 */
	@ColumnDefault("0")
	private double co2 = 0;

	/**
	 * The optional monthly CO2 consumption of one requested CPU with an array of 10% workload usage, from idle to 90%.
	 * Required for dynamic instance type. Separator is ;.
	 */
	private String co210 = null;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy