1
1
use std:: collections:: HashSet ;
2
2
3
3
use super :: surreal:: { Bindings , SurrealWrapper } ;
4
- use super :: { FileDb , PostalAddressDb , Result } ;
4
+ use super :: { BillIdDb , FileDb , PostalAddressDb , Result } ;
5
5
use crate :: constants:: { DB_BILL_ID , DB_IDS , DB_OP_CODE , DB_TABLE , DB_TIMESTAMP } ;
6
6
use crate :: { Error , bill:: BillStoreApi } ;
7
7
use async_trait:: async_trait;
8
8
use bcr_ebill_core:: ServiceTraitBounds ;
9
9
use bcr_ebill_core:: bill:: {
10
- BillAcceptanceStatus , BillCurrentWaitingState , BillData , BillParticipants , BillPaymentStatus ,
11
- BillRecourseStatus , BillSellStatus , BillStatus , BillWaitingForPaymentState ,
10
+ BillAcceptanceStatus , BillCurrentWaitingState , BillData , BillMintStatus , BillParticipants ,
11
+ BillPaymentStatus , BillRecourseStatus , BillSellStatus , BillStatus , BillWaitingForPaymentState ,
12
12
BillWaitingForRecourseState , BillWaitingForSellState , BitcreditBillResult ,
13
13
} ;
14
14
use bcr_ebill_core:: constants:: { PAYMENT_DEADLINE_SECONDS , RECOURSE_DEADLINE_SECONDS } ;
@@ -445,6 +445,7 @@ pub struct BillStatusDb {
445
445
pub payment : BillPaymentStatusDb ,
446
446
pub sell : BillSellStatusDb ,
447
447
pub recourse : BillRecourseStatusDb ,
448
+ pub mint : BillMintStatusDb ,
448
449
pub redeemed_funds_available : bool ,
449
450
pub has_requested_funds : bool ,
450
451
}
@@ -456,6 +457,7 @@ impl From<BillStatusDb> for BillStatus {
456
457
payment : value. payment . into ( ) ,
457
458
sell : value. sell . into ( ) ,
458
459
recourse : value. recourse . into ( ) ,
460
+ mint : value. mint . into ( ) ,
459
461
redeemed_funds_available : value. redeemed_funds_available ,
460
462
has_requested_funds : value. has_requested_funds ,
461
463
}
@@ -469,6 +471,7 @@ impl From<&BillStatus> for BillStatusDb {
469
471
payment : ( & value. payment ) . into ( ) ,
470
472
sell : ( & value. sell ) . into ( ) ,
471
473
recourse : ( & value. recourse ) . into ( ) ,
474
+ mint : ( & value. mint ) . into ( ) ,
472
475
redeemed_funds_available : value. redeemed_funds_available ,
473
476
has_requested_funds : value. has_requested_funds ,
474
477
}
@@ -607,6 +610,27 @@ impl From<&BillRecourseStatus> for BillRecourseStatusDb {
607
610
}
608
611
}
609
612
613
+ #[ derive( Debug , Clone , Serialize , Deserialize ) ]
614
+ pub struct BillMintStatusDb {
615
+ pub has_mint_requests : bool ,
616
+ }
617
+
618
+ impl From < BillMintStatusDb > for BillMintStatus {
619
+ fn from ( value : BillMintStatusDb ) -> Self {
620
+ Self {
621
+ has_mint_requests : value. has_mint_requests ,
622
+ }
623
+ }
624
+ }
625
+
626
+ impl From < & BillMintStatus > for BillMintStatusDb {
627
+ fn from ( value : & BillMintStatus ) -> Self {
628
+ Self {
629
+ has_mint_requests : value. has_mint_requests ,
630
+ }
631
+ }
632
+ }
633
+
610
634
#[ derive( Debug , Clone , Serialize , Deserialize ) ]
611
635
pub struct BillDataDb {
612
636
pub language : String ,
@@ -783,11 +807,6 @@ pub struct BillPaidDb {
783
807
pub payment_address : String ,
784
808
}
785
809
786
- #[ derive( Debug , Clone , Serialize , Deserialize ) ]
787
- pub struct BillIdDb {
788
- pub bill_id : String ,
789
- }
790
-
791
810
#[ derive( Debug , Clone , Serialize , Deserialize ) ]
792
811
pub struct BillKeysDb {
793
812
#[ serde( skip_serializing_if = "Option::is_none" ) ]
0 commit comments