added user->crimes

This commit is contained in:
TotallyNot 2022-09-09 23:27:49 +02:00
parent 1eec2477c6
commit 259f09aef5
2 changed files with 17 additions and 1 deletions

View file

@ -1,6 +1,6 @@
[package]
name = "torn-api"
version = "0.4.0"
version = "0.4.1"
edition = "2021"
authors = ["Pyrit [2111649]"]
license = "MIT"

View file

@ -19,6 +19,8 @@ pub enum Selection {
Discord,
#[api(type = "PersonalStats", field = "personalstats")]
PersonalStats,
#[api(type = "CriminalRecord", field = "criminalrecord")]
Crimes,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize)]
@ -371,6 +373,19 @@ pub struct PersonalStats {
pub best_damage: i32,
}
#[derive(Deserialize)]
pub struct CriminalRecord {
pub selling_illegal_products: i32,
pub theft: i32,
pub auto_theft: i32,
pub drug_deals: i32,
pub computer_crimes: i32,
pub murder: i32,
pub fraud_crimes: i32,
pub other: i32,
pub total: i32,
}
#[cfg(test)]
mod tests {
use super::*;
@ -388,6 +403,7 @@ mod tests {
Selection::Discord,
Selection::Profile,
Selection::PersonalStats,
Selection::Crimes,
])
})
.await