Prorations (#975)

* Prorations

* Fix pyro integration

* set server uuid on creation

* fix comp

* Fix new charge date, pyro suspend reason

* Update server creation endpoint
This commit is contained in:
Geometrically
2024-10-14 13:30:04 -07:00
committed by GitHub
parent c88bfbb5f0
commit ff7975773e
6 changed files with 382 additions and 128 deletions

View File

@@ -21,7 +21,12 @@ pub struct Product {
#[serde(tag = "type", rename_all = "kebab-case")]
pub enum ProductMetadata {
Midas,
Pyro { ram: u32 },
Pyro {
cpu: u32,
ram: u32,
swap: u32,
storage: u32,
},
}
#[derive(Copy, Clone, PartialEq, Eq, Serialize, Deserialize, Debug)]
@@ -70,13 +75,16 @@ impl PriceDuration {
_ => PriceDuration::Monthly,
}
}
pub fn as_str(&self) -> &'static str {
match self {
PriceDuration::Monthly => "monthly",
PriceDuration::Yearly => "yearly",
}
}
pub fn iterator() -> impl Iterator<Item = PriceDuration> {
vec![PriceDuration::Monthly, PriceDuration::Yearly].into_iter()
}
}
#[derive(Copy, Clone, PartialEq, Eq, Serialize, Deserialize, Debug)]