Skip to content

Instantly share code, notes, and snippets.

@codedmart
Created Apr 2, 2021
Embed
What would you like to do?
#[derive(Debug, Queryable, Serialize, Deserialize)]
pub struct LineItem {
pub id: Uuid,
pub quantity: i32,
pub total: BigDecimal,
pub client_id: Uuid,
pub organization_id: Uuid,
pub created_by_id: Uuid,
pub created_at: NaiveDateTime,
pub updated_at: NaiveDateTime,
}
#[derive(Debug, Insertable, AsChangeset, Serialize, Deserialize)]
#[table_name = "line_items"]
pub struct NewLineItem<'x> {
pub quantity: &'x i32,
pub total: BigDecimal,
pub client_id: Uuid,
pub organization_id: Uuid,
pub created_by_id: Uuid,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment