code cleanup, starts testing
This commit is contained in:
@@ -1,19 +1,32 @@
|
||||
use crate::models::item::Loot;
|
||||
use crate::schema::claims;
|
||||
use diesel::prelude::*;
|
||||
|
||||
/// A Claim is a request by a single player on an item from group chest.
|
||||
#[derive(Identifiable, Queryable, Associations, Serialize, Debug)]
|
||||
#[belongs_to(Loot)]
|
||||
pub struct Claim {
|
||||
id: i32,
|
||||
player_id: i32,
|
||||
loot_id: i32,
|
||||
resolve: i32,
|
||||
/// DB Identifier
|
||||
pub id: i32,
|
||||
/// ID that references the player making this claim
|
||||
pub player_id: i32,
|
||||
/// ID that references the loot claimed
|
||||
pub loot_id: i32,
|
||||
/// WIP: How bad the player wants this item
|
||||
pub resolve: i32,
|
||||
}
|
||||
|
||||
#[derive(Insertable, Debug)]
|
||||
#[table_name = "claims"]
|
||||
pub struct NewClaim {
|
||||
pub player_id: i32,
|
||||
pub loot_id: i32,
|
||||
pub(crate) struct NewClaim {
|
||||
player_id: i32,
|
||||
loot_id: i32,
|
||||
}
|
||||
|
||||
impl NewClaim {
|
||||
pub(crate) fn new(player_id: i32, loot_id: i32) -> Self {
|
||||
Self {
|
||||
player_id,
|
||||
loot_id
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user