generated from holaplex/hub-rust-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: add creators and compressed to collection mints. finish min…
…t to collection and retry mint minus creating a purchase record and emitting mint webhook events.
- Loading branch information
Showing
20 changed files
with
533 additions
and
515 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.5 | ||
|
||
use async_graphql::SimpleObject; | ||
use sea_orm::entity::prelude::*; | ||
|
||
use crate::proto; | ||
|
||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, SimpleObject)] | ||
#[sea_orm(table_name = "mint_creators")] | ||
pub struct Model { | ||
#[sea_orm(primary_key, auto_increment = false)] | ||
pub collection_mint_id: Uuid, | ||
#[sea_orm(primary_key, auto_increment = false)] | ||
pub address: String, | ||
pub verified: bool, | ||
pub share: i32, | ||
} | ||
|
||
impl From<Model> for proto::Creator { | ||
fn from( | ||
Model { | ||
address, | ||
verified, | ||
share, | ||
.. | ||
}: Model, | ||
) -> Self { | ||
Self { | ||
address, | ||
verified, | ||
share, | ||
} | ||
} | ||
} | ||
|
||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] | ||
pub enum Relation { | ||
#[sea_orm( | ||
belongs_to = "super::collection_mints::Entity", | ||
from = "Column::CollectionMintId", | ||
to = "super::collection_mints::Column::Id", | ||
on_update = "Cascade", | ||
on_delete = "Cascade" | ||
)] | ||
CollectionMints, | ||
} | ||
|
||
impl Related<super::collection_mints::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
Relation::CollectionMints.def() | ||
} | ||
} | ||
|
||
impl ActiveModelBehavior for ActiveModel {} | ||
|
||
impl Entity { | ||
pub fn find_by_collection_mint_id(collection_mint_id: Uuid) -> Select<Self> { | ||
Self::find().filter(Column::CollectionMintId.eq(collection_mint_id)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.