feat: add transaction tag rel model

This commit is contained in:
brian
2025-09-21 22:56:46 +08:00
parent a34dbc60c4
commit 7e5e9cb32f
10 changed files with 106 additions and 9 deletions

View File

@@ -1,4 +1,4 @@
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.11
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.16
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
@@ -9,7 +9,7 @@ pub struct Model {
#[sea_orm(primary_key)]
pub id: i64,
pub name: String,
pub r#type: i32,
pub account_type: i32,
pub uid: i64,
pub is_deleted: bool,
pub created_at: DateTime,

View File

@@ -1,4 +1,4 @@
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.11
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.16
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};

View File

@@ -1,4 +1,4 @@
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.11
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.16
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};

View File

@@ -1,4 +1,4 @@
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.11
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.16
pub mod prelude;
@@ -7,3 +7,4 @@ pub mod book;
pub mod category;
pub mod tag;
pub mod transaction;
pub mod transaction_tag_rel;

View File

@@ -1,7 +1,8 @@
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.11
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.16
pub use super::account::Entity as Account;
pub use super::book::Entity as Book;
pub use super::category::Entity as Category;
pub use super::tag::Entity as Tag;
pub use super::transaction::Entity as Transaction;
pub use super::transaction_tag_rel::Entity as TransactionTagRel;

View File

@@ -1,4 +1,4 @@
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.11
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.16
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};

View File

@@ -1,4 +1,4 @@
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.11
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.16
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
@@ -9,7 +9,7 @@ pub struct Model {
#[sea_orm(primary_key)]
pub id: i64,
pub uid: i64,
pub r#type: i32,
pub transaction_type: i32,
pub book_id: i64,
pub category_id: i64,
pub description: String,

View File

@@ -0,0 +1,22 @@
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.16
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[sea_orm(table_name = "transaction_tag_rel")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i64,
pub uid: i64,
pub transaction_id: i64,
pub tag_id: i64,
pub is_deleted: bool,
pub created_at: DateTime,
pub updated_at: DateTime,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {}
impl ActiveModelBehavior for ActiveModel {}