Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
| BoundedContextDefinition | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| createRandom | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace Apie\Maker\BoundedContext\Resources; |
| 4 | |
| 5 | use Apie\Core\Attributes\FakeCount; |
| 6 | use Apie\Core\Attributes\FakeMethod; |
| 7 | use Apie\Core\Identifiers\Identifier; |
| 8 | use Apie\Core\Identifiers\Ulid; |
| 9 | use Apie\Maker\BoundedContext\Identifiers\BoundedContextDefinitionIdentifier; |
| 10 | use Faker\Generator; |
| 11 | |
| 12 | #[FakeCount(2)] |
| 13 | #[FakeMethod('createRandom')] |
| 14 | class BoundedContextDefinition implements \Apie\Core\Entities\EntityInterface |
| 15 | { |
| 16 | private const EXAMPLE_NAMES = [ |
| 17 | 'usermanagement', |
| 18 | 'customersupport', |
| 19 | 'orderprocessing', |
| 20 | 'paymentprocessing', |
| 21 | 'inventorymanagement', |
| 22 | 'productcatalog', |
| 23 | 'shippinganddelivery', |
| 24 | 'suppliermanagement', |
| 25 | 'warehousemanagement', |
| 26 | 'sales', |
| 27 | 'marketing', |
| 28 | 'advertising', |
| 29 | 'customerrelationshipmanagement', |
| 30 | 'subscriptionmanagement', |
| 31 | 'billingandinvoicing', |
| 32 | 'financialaccounting', |
| 33 | 'expensetracking', |
| 34 | 'humanresources', |
| 35 | 'employeemanagement', |
| 36 | 'projectmanagement', |
| 37 | 'taskmanagement', |
| 38 | 'teamcollaboration', |
| 39 | 'legalcompliance', |
| 40 | 'contractmanagement', |
| 41 | 'riskmanagement', |
| 42 | 'policymanagement', |
| 43 | 'claimsprocessing', |
| 44 | 'insurancemanagement', |
| 45 | 'investmentmanagement', |
| 46 | 'taxreporting', |
| 47 | 'regulatorycompliance', |
| 48 | 'eventplanning', |
| 49 | 'resourcemanagement', |
| 50 | 'documentmanagement', |
| 51 | 'contentmanagement', |
| 52 | 'filestorage', |
| 53 | 'versioncontrol', |
| 54 | 'auditlogging', |
| 55 | 'configurationmanagement', |
| 56 | 'systemmonitoring', |
| 57 | 'userauthentication', |
| 58 | 'accesscontrol', |
| 59 | 'notificationservice', |
| 60 | 'feedbackandreviews', |
| 61 | 'customerengagement', |
| 62 | 'loyaltyprograms', |
| 63 | 'promotionsanddiscounts', |
| 64 | 'surveymanagement', |
| 65 | 'analyticsandreporting', |
| 66 | 'businessintelligence', |
| 67 | 'forecasting', |
| 68 | 'budgeting', |
| 69 | 'inventoryreplenishment', |
| 70 | 'orderfulfillment', |
| 71 | 'returnsmanagement', |
| 72 | 'customeronboarding', |
| 73 | 'supportticketing', |
| 74 | 'issuetracking', |
| 75 | 'servicedesk', |
| 76 | 'complianceauditing', |
| 77 | 'securitymanagement', |
| 78 | 'qualityassurance', |
| 79 | 'testingandvalidation', |
| 80 | 'releasemanagement', |
| 81 | 'continuousintegration', |
| 82 | 'deploymentautomation', |
| 83 | 'devops', |
| 84 | 'itservicemanagement', |
| 85 | 'incidentmanagement', |
| 86 | 'problemmanagement', |
| 87 | 'changemanagement', |
| 88 | 'capacityplanning', |
| 89 | 'assetmanagement', |
| 90 | 'resourceallocation', |
| 91 | 'supplieronboarding', |
| 92 | 'procurement', |
| 93 | 'contractnegotiation', |
| 94 | 'vendormanagement', |
| 95 | 'demandplanning', |
| 96 | 'supplychainmanagement', |
| 97 | 'productionscheduling', |
| 98 | 'manufacturingexecution', |
| 99 | 'qualitycontrol', |
| 100 | 'maintenancemanagement', |
| 101 | 'facilitiesmanagement', |
| 102 | 'energymanagement', |
| 103 | 'environmentalcompliance', |
| 104 | 'sustainabilityreporting', |
| 105 | 'customersuccess', |
| 106 | 'partnermanagement', |
| 107 | 'channelmanagement', |
| 108 | 'salesoperations', |
| 109 | 'leadgeneration', |
| 110 | 'pipelinemanagement', |
| 111 | 'accountmanagement' |
| 112 | ]; |
| 113 | private BoundedContextDefinitionIdentifier $id; |
| 114 | |
| 115 | public function __construct(public Identifier $name) |
| 116 | { |
| 117 | $this->id = BoundedContextDefinitionIdentifier::fromNameAndUlid($name, Ulid::createRandom()); |
| 118 | } |
| 119 | |
| 120 | public function getId(): BoundedContextDefinitionIdentifier |
| 121 | { |
| 122 | return $this->id; |
| 123 | } |
| 124 | |
| 125 | public static function createRandom(Generator $faker): static |
| 126 | { |
| 127 | return new static(new Identifier($faker->randomElement(self::EXAMPLE_NAMES))); |
| 128 | } |
| 129 | } |