feat(trigger): add workflows_in_use field to TriggerProviderSubscriptionApiEntity

- Introduced a new field `workflows_in_use` to the TriggerProviderSubscriptionApiEntity to track the number of workflows utilizing each subscription.
- Enhanced the TriggerProviderService to populate this field by querying the WorkflowPluginTrigger model for usage counts associated with each subscription.

This addition improves the visibility of subscription usage within the trigger provider context.
This commit is contained in:
Harry
2025-09-11 16:50:12 +08:00
parent 1562d00037
commit c3ebb22a4b
2 changed files with 27 additions and 1 deletions

View File

@ -23,6 +23,7 @@ class TriggerProviderSubscriptionApiEntity(BaseModel):
endpoint: str = Field(description="The endpoint of the subscription")
parameters: dict = Field(description="The parameters of the subscription")
properties: dict = Field(description="The properties of the subscription")
workflows_in_use: int = Field(description="The number of workflows using this subscription")
class TriggerApiEntity(BaseModel):