Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Http\Repositories\interfaces; |
| 4 | |
| 5 | use App\Http\Models\PlanHubspotConfig; |
| 6 | |
| 7 | /** |
| 8 | * Interface for plan HubSpot config data access operations. |
| 9 | * |
| 10 | * This repository abstracts plan-hubspot-config relationship database queries, |
| 11 | * providing methods to manage HubSpot CRM property mappings for plans. |
| 12 | */ |
| 13 | interface IPlanHubspotConfigRepository |
| 14 | { |
| 15 | /** |
| 16 | * Find a HubSpot config by plan ID. |
| 17 | * |
| 18 | * @param string $planId The plan ID |
| 19 | * @return PlanHubspotConfig|null The config or null if not found |
| 20 | */ |
| 21 | public function findByPlanId(string $planId): ?PlanHubspotConfig; |
| 22 | |
| 23 | /** |
| 24 | * Create a new HubSpot config for a plan. |
| 25 | * |
| 26 | * @param string $planId The plan ID |
| 27 | * @param array{ |
| 28 | * name?: string|null, |
| 29 | * last_product?: string|null, |
| 30 | * cancel_subscription_date?: string|null, |
| 31 | * payment_status?: string|null, |
| 32 | * subscription_annual_recurring_revenue?: string|null, |
| 33 | * subscription_churn_date?: string|null, |
| 34 | * subscription_expiration_date?: string|null, |
| 35 | * subscription_frequency?: string|null, |
| 36 | * subscription_monthly_recurring_revenue?: string|null, |
| 37 | * subscription_plan_type?: string|null, |
| 38 | * subscription_start_date?: string|null, |
| 39 | * subscription_status?: string|null, |
| 40 | * subscription_status_updated_on?: string|null, |
| 41 | * user_type?: string|null |
| 42 | * } $data The config data |
| 43 | * @return PlanHubspotConfig The created config |
| 44 | */ |
| 45 | public function create(string $planId, array $data): PlanHubspotConfig; |
| 46 | |
| 47 | /** |
| 48 | * Update an existing HubSpot config. |
| 49 | * |
| 50 | * @param PlanHubspotConfig $config The config to update |
| 51 | * @param array{ |
| 52 | * name?: string|null, |
| 53 | * last_product?: string|null, |
| 54 | * cancel_subscription_date?: string|null, |
| 55 | * payment_status?: string|null, |
| 56 | * subscription_annual_recurring_revenue?: string|null, |
| 57 | * subscription_churn_date?: string|null, |
| 58 | * subscription_expiration_date?: string|null, |
| 59 | * subscription_frequency?: string|null, |
| 60 | * subscription_monthly_recurring_revenue?: string|null, |
| 61 | * subscription_plan_type?: string|null, |
| 62 | * subscription_start_date?: string|null, |
| 63 | * subscription_status?: string|null, |
| 64 | * subscription_status_updated_on?: string|null, |
| 65 | * user_type?: string|null |
| 66 | * } $data The update data |
| 67 | * @return PlanHubspotConfig The updated config |
| 68 | */ |
| 69 | public function update(PlanHubspotConfig $config, array $data): PlanHubspotConfig; |
| 70 | |
| 71 | /** |
| 72 | * Delete a HubSpot config. |
| 73 | * |
| 74 | * @param PlanHubspotConfig $config The config to delete |
| 75 | * @return bool True if deleted successfully |
| 76 | */ |
| 77 | public function delete(PlanHubspotConfig $config): bool; |
| 78 | |
| 79 | /** |
| 80 | * Create or update a HubSpot config for a plan. |
| 81 | * |
| 82 | * @param string $planId The plan ID |
| 83 | * @param array{ |
| 84 | * name?: string|null, |
| 85 | * last_product?: string|null, |
| 86 | * cancel_subscription_date?: string|null, |
| 87 | * payment_status?: string|null, |
| 88 | * subscription_annual_recurring_revenue?: string|null, |
| 89 | * subscription_churn_date?: string|null, |
| 90 | * subscription_expiration_date?: string|null, |
| 91 | * subscription_frequency?: string|null, |
| 92 | * subscription_monthly_recurring_revenue?: string|null, |
| 93 | * subscription_plan_type?: string|null, |
| 94 | * subscription_start_date?: string|null, |
| 95 | * subscription_status?: string|null, |
| 96 | * subscription_status_updated_on?: string|null, |
| 97 | * user_type?: string|null |
| 98 | * } $data The config data |
| 99 | * @return PlanHubspotConfig The created or updated config |
| 100 | */ |
| 101 | public function upsert(string $planId, array $data): PlanHubspotConfig; |
| 102 | } |