Add another checkout table

This commit is contained in:
eraden 2023-06-08 17:28:57 +02:00
parent 592f157225
commit 379910081a

View File

@ -45,6 +45,7 @@ impl MigrationTrait for Migration {
drop_type!(m, crate::types::OrderItemChangeType);
drop_type!(m, crate::types::PaymentCollectionType);
drop_type!(m, crate::types::OrderFulfillmentStatus);
drop_type!(m, crate::types::PaymentCollectionStatus);
Ok(())
}
}
@ -56,6 +57,7 @@ impl Migration {
create_type!(m, crate::types::OrderItemChangeType);
create_type!(m, crate::types::PaymentCollectionType);
create_type!(m, crate::types::OrderFulfillmentStatus);
create_type!(m, crate::types::PaymentCollectionStatus);
Ok(())
}
/// ```sql
@ -316,12 +318,26 @@ impl Migration {
.col(ts_def_now_not_null!(PaymentCollection::CreatedAt))
.col(ts_def_now_not_null!(PaymentCollection::UpdatedAt))
.col(PaymentCollection::DeletedAt.col().timestamp())
.col(PaymentCollection::Type.col().enumeration(crate::types::PaymentCollectionType::PaymentCollectionTypes, crate::types::PaymentCollectionType::iter().skip(1)))
////////
//////// TODO
//////// TODO
//////// TODO
////////
.col(PaymentCollection::PaymentCollectionType.col().enumeration(
crate::types::PaymentCollectionType::PaymentCollectionTypes,
crate::types::PaymentCollectionType::iter().skip(1),
))
.col(
PaymentCollection::Status
.col()
.enumeration(
crate::types::PaymentCollectionStatus::PaymentCollectionStatuses,
crate::types::PaymentCollectionStatus::iter().skip(1),
)
.not_null(),
)
.col(PaymentCollection::Description.col().string())
.col(PaymentCollection::Amount.col().integer().not_null())
.col(PaymentCollection::AuthorizedAmount.col().integer())
.col(PaymentCollection::RegionId.col().uuid().not_null())
.col(PaymentCollection::CurrencyCode.col().string().not_null())
.col(PaymentCollection::Metadata.col().json_binary())
.col(PaymentCollection::CreatedBy.col().uuid().not_null())
.to_owned(),
)
.await?;
@ -530,7 +546,7 @@ pub enum PaymentCollection {
CreatedAt,
UpdatedAt,
DeletedAt,
Type,
PaymentCollectionType,
Status,
Description,
Amount,