Skip to content

Commit

Permalink
Merge pull request #3 from MiSArch/missing-event-subscriptions
Browse files Browse the repository at this point in the history
Added missing event subsciptions
  • Loading branch information
legendofa authored Mar 30, 2024
2 parents 3628dd9 + 0380ad5 commit b94d088
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions src/http_event_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ pub struct ShipmentStatusUpdatedEventData {
}

#[derive(Deserialize, Debug)]
/// Shipment status of order.
pub enum ShipmentStatus {
Pending,
InProgress,
Expand Down Expand Up @@ -141,6 +142,11 @@ pub async fn list_topic_subscriptions() -> Result<Json<Vec<Pubsub>>, StatusCode>
topic: "catalog/product-variant-version/created".to_string(),
route: "/on-product-variant-version-creation-event".to_string(),
};
let pubsub_product_variant_updated = Pubsub {
pubsubname: "pubsub".to_string(),
topic: "catalog/product-variant/updated".to_string(),
route: "/on-product-variant-updated-event".to_string(),
};
let pubsub_coupon = Pubsub {
pubsubname: "pubsub".to_string(),
topic: "discount/coupon/created".to_string(),
Expand All @@ -166,13 +172,20 @@ pub async fn list_topic_subscriptions() -> Result<Json<Vec<Pubsub>>, StatusCode>
topic: "address/user-address/created".to_string(),
route: "/on-user-address-creation-event".to_string(),
};
let pubsub_user_address_archived = Pubsub {
pubsubname: "pubsub".to_string(),
topic: "address/user-address/archived".to_string(),
route: "/on-user-address-archived-event".to_string(),
};
Ok(Json(vec![
pubsub_product_variant_updated,
pubsub_product_variant_version,
pubsub_coupon,
pubsub_tax_rate_version,
pubsub_shipment_method,
pubsub_user,
pubsub_user_address,
pubsub_user_address_archived,
]))
}

Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ async fn build_dapr_router(db_client: Database) -> Router {
post(on_product_variant_version_creation_event),
)
.route(
"/on-product-variant-update-event",
"/on-product-variant-updated-event",
post(on_product_variant_update_event),
)
.route(
Expand Down

0 comments on commit b94d088

Please sign in to comment.