diff --git a/database/factories/AnnouncementFactory.php b/database/factories/AnnouncementFactory.php new file mode 100644 index 0000000..5325d56 --- /dev/null +++ b/database/factories/AnnouncementFactory.php @@ -0,0 +1,27 @@ + + */ +class AnnouncementFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'title' => fake()->sentence(), + 'content' => fake()->paragraphs(3, true), + 'type' => AnnouncementType::PUBLIC, + ]; + } +} diff --git a/database/factories/AnnouncementMediaFactory.php b/database/factories/AnnouncementMediaFactory.php new file mode 100644 index 0000000..aea423f --- /dev/null +++ b/database/factories/AnnouncementMediaFactory.php @@ -0,0 +1,27 @@ + + */ +class AnnouncementMediaFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'announcement_id' => Announcement::factory(), + 'partner_media_id' => PartnerMedia::factory(), + ]; + } +} diff --git a/database/factories/CategoryFactory.php b/database/factories/CategoryFactory.php new file mode 100644 index 0000000..2eea52f --- /dev/null +++ b/database/factories/CategoryFactory.php @@ -0,0 +1,26 @@ + + */ +class CategoryFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => fake()->unique()->word(), + 'is_active' => IsActive::ACTIVE, + ]; + } +} diff --git a/database/factories/CategoryNewsFactory.php b/database/factories/CategoryNewsFactory.php new file mode 100644 index 0000000..d98689a --- /dev/null +++ b/database/factories/CategoryNewsFactory.php @@ -0,0 +1,27 @@ + + */ +class CategoryNewsFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'category_id' => Category::factory(), + 'news_id' => News::factory(), + ]; + } +} diff --git a/database/factories/ClassificationFactory.php b/database/factories/ClassificationFactory.php new file mode 100644 index 0000000..074eba1 --- /dev/null +++ b/database/factories/ClassificationFactory.php @@ -0,0 +1,41 @@ + + */ +class ClassificationFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => $this->faker->unique()->sentence(2), + 'description' => $this->faker->paragraph(), + 'is_active' => IsActive::ACTIVE, + ]; + } + + public function active(): static + { + return $this->state(fn (array $attributes) => [ + 'is_active' => IsActive::ACTIVE, + ]); + } + + public function inactive(): static + { + return $this->state(fn (array $attributes) => [ + 'is_active' => IsActive::INACTIVE, + ]); + } +} diff --git a/database/factories/CompanyFactory.php b/database/factories/CompanyFactory.php new file mode 100644 index 0000000..5834061 --- /dev/null +++ b/database/factories/CompanyFactory.php @@ -0,0 +1,38 @@ + + */ +class CompanyFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'user_id' => User::factory(), + 'name' => fake()->company(), + 'email' => fake()->unique()->companyEmail(), + 'phone_number' => fake()->phoneNumber(), + 'address' => fake()->address(), + 'director_name' => fake()->name(), + 'director_nik' => fake()->numerify('################'), + 'deed_incorporation' => fake()->numerify('DEED-####'), + 'trade_license' => fake()->numerify('NIB-####'), + 'tax_id_number' => fake()->numerify('NPWP-####'), + 'taxable_enterprise' => fake()->numerify('PKP-####'), + 'annual_tax_return' => fake()->numerify('SPT-####'), + 'domicile_certificate' => fake()->numerify('DOM-####'), + 'profile' => fake()->sentence(), + ]; + } +} diff --git a/database/factories/ContactFactory.php b/database/factories/ContactFactory.php new file mode 100644 index 0000000..7847301 --- /dev/null +++ b/database/factories/ContactFactory.php @@ -0,0 +1,27 @@ + + */ +class ContactFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => fake()->name(), + 'email' => fake()->safeEmail(), + 'subject' => fake()->sentence(), + 'message' => fake()->paragraph(), + ]; + } +} diff --git a/database/factories/ContentRecapFactory.php b/database/factories/ContentRecapFactory.php new file mode 100644 index 0000000..6e1d531 --- /dev/null +++ b/database/factories/ContentRecapFactory.php @@ -0,0 +1,34 @@ + + */ +class ContentRecapFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'classification_id' => Classification::factory(), + 'title' => fake()->sentence(), + 'link' => fake()->url(), + 'posting_date' => fake()->date(), + 'type' => ContentType::FOTO, + 'channel' => Channel::WEBSITE, + 'social_media' => SocialMedia::DISKOMINFO_PURWAKARTA, + ]; + } +} diff --git a/database/factories/CooperationFactory.php b/database/factories/CooperationFactory.php new file mode 100644 index 0000000..0beebeb --- /dev/null +++ b/database/factories/CooperationFactory.php @@ -0,0 +1,29 @@ + + */ +class CooperationFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'title' => fake()->sentence(), + 'initial_submission_date' => fake()->date(), + 'final_submission_date' => fake()->date(), + 'description' => fake()->paragraph(), + 'status' => CooperationStatus::PENDING, + ]; + } +} diff --git a/database/factories/CooperationMediaFactory.php b/database/factories/CooperationMediaFactory.php new file mode 100644 index 0000000..abfd582 --- /dev/null +++ b/database/factories/CooperationMediaFactory.php @@ -0,0 +1,29 @@ + + */ +class CooperationMediaFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'cooperation_id' => Cooperation::factory(), + 'partner_media_id' => PartnerMedia::factory(), + 'status' => ApprovalStatus::PENDING, + ]; + } +} diff --git a/database/factories/CooperationPaymentFactory.php b/database/factories/CooperationPaymentFactory.php new file mode 100644 index 0000000..79190bf --- /dev/null +++ b/database/factories/CooperationPaymentFactory.php @@ -0,0 +1,27 @@ + + */ +class CooperationPaymentFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'cooperation_media_id' => CooperationMedia::factory(), + 'amount' => fake()->numberBetween(100000, 10000000), + 'payment_date' => fake()->date(), + ]; + } +} diff --git a/database/factories/CooperationProposalFactory.php b/database/factories/CooperationProposalFactory.php new file mode 100644 index 0000000..ded685a --- /dev/null +++ b/database/factories/CooperationProposalFactory.php @@ -0,0 +1,30 @@ + + */ +class CooperationProposalFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'cooperation_id' => Cooperation::factory(), + 'partner_media_id' => PartnerMedia::factory(), + 'description' => fake()->paragraph(), + 'status' => ApprovalStatus::PENDING, + ]; + } +} diff --git a/database/factories/DataChangeRequestFactory.php b/database/factories/DataChangeRequestFactory.php new file mode 100644 index 0000000..6dc5477 --- /dev/null +++ b/database/factories/DataChangeRequestFactory.php @@ -0,0 +1,33 @@ + + */ +class DataChangeRequestFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'user_id' => User::factory(), + 'entity_type' => Company::class, + 'entity_id' => Company::factory(), + 'status' => DataChangeStatus::PENDING, + 'old_data' => [], + 'new_data' => ['name' => 'New Company Name'], + 'change_reason' => fake()->sentence(), + ]; + } +} diff --git a/database/factories/DataChangeReviewFactory.php b/database/factories/DataChangeReviewFactory.php new file mode 100644 index 0000000..feb59f3 --- /dev/null +++ b/database/factories/DataChangeReviewFactory.php @@ -0,0 +1,30 @@ + + */ +class DataChangeReviewFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'data_change_request_id' => DataChangeRequest::factory(), + 'reviewer_id' => User::factory(), + 'decision' => DataChangeDecision::APPROVED, + 'note' => fake()->sentence(), + ]; + } +} diff --git a/database/factories/DepartmentFactory.php b/database/factories/DepartmentFactory.php new file mode 100644 index 0000000..7139b7a --- /dev/null +++ b/database/factories/DepartmentFactory.php @@ -0,0 +1,27 @@ + + */ +class DepartmentFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => fake()->unique()->words(2, true), + 'alias' => strtoupper(fake()->unique()->lexify('???')), + 'is_active' => IsActive::ACTIVE, + ]; + } +} diff --git a/database/factories/IssueManagementFactory.php b/database/factories/IssueManagementFactory.php new file mode 100644 index 0000000..1502db7 --- /dev/null +++ b/database/factories/IssueManagementFactory.php @@ -0,0 +1,33 @@ + + */ +class IssueManagementFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'location_id' => Location::factory(), + 'classification_id' => Classification::factory(), + 'media_monitoring_id' => MediaMonitoring::factory(), + 'issue' => IssueSentiment::NEUTRAL, + 'response' => IssueSentiment::NEUTRAL, + 'description' => fake()->paragraph(), + ]; + } +} diff --git a/database/factories/JournalistFactory.php b/database/factories/JournalistFactory.php new file mode 100644 index 0000000..e31c621 --- /dev/null +++ b/database/factories/JournalistFactory.php @@ -0,0 +1,28 @@ + + */ +class JournalistFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'partner_media_id' => PartnerMedia::factory(), + 'name' => fake()->name(), + 'email' => fake()->unique()->safeEmail(), + 'phone_number' => fake()->phoneNumber(), + ]; + } +} diff --git a/database/factories/LocationFactory.php b/database/factories/LocationFactory.php new file mode 100644 index 0000000..8436b16 --- /dev/null +++ b/database/factories/LocationFactory.php @@ -0,0 +1,27 @@ + + */ +class LocationFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => fake()->unique()->city(), + 'description' => fake()->sentence(), + 'is_active' => IsActive::ACTIVE, + ]; + } +} diff --git a/database/factories/MediaMonitoringFactory.php b/database/factories/MediaMonitoringFactory.php new file mode 100644 index 0000000..9c17f80 --- /dev/null +++ b/database/factories/MediaMonitoringFactory.php @@ -0,0 +1,32 @@ + + */ +class MediaMonitoringFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'code' => fake()->lexify('??????'), + 'media_name' => fake()->company(), + 'title' => fake()->sentence(), + 'channel' => Channel::WEBSITE, + 'writter' => fake()->name(), + 'content' => fake()->paragraph(), + 'keyword' => fake()->word(), + 'release_date' => fake()->date(), + ]; + } +} diff --git a/database/factories/MediaMonitoringThemeFactory.php b/database/factories/MediaMonitoringThemeFactory.php new file mode 100644 index 0000000..bd5dbac --- /dev/null +++ b/database/factories/MediaMonitoringThemeFactory.php @@ -0,0 +1,27 @@ + + */ +class MediaMonitoringThemeFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'media_monitoring_id' => MediaMonitoring::factory(), + 'theme_id' => Theme::factory(), + ]; + } +} diff --git a/database/factories/MediaTaskAssignmentFactory.php b/database/factories/MediaTaskAssignmentFactory.php new file mode 100644 index 0000000..9b233fb --- /dev/null +++ b/database/factories/MediaTaskAssignmentFactory.php @@ -0,0 +1,29 @@ + + */ +class MediaTaskAssignmentFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'task_assignment_id' => TaskAssignment::factory(), + 'partner_media_id' => PartnerMedia::factory(), + 'status' => ApprovalStatus::PENDING, + ]; + } +} diff --git a/database/factories/NewsFactory.php b/database/factories/NewsFactory.php new file mode 100644 index 0000000..b5466d3 --- /dev/null +++ b/database/factories/NewsFactory.php @@ -0,0 +1,35 @@ + + */ +class NewsFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + $title = fake()->sentence(); + + return [ + 'author_id' => User::factory(), + 'title' => $title, + 'slug' => Str::slug($title), + 'content' => fake()->paragraphs(5, true), + 'excerpt' => fake()->sentence(), + 'status' => NewsStatus::DRAFT, + 'views' => 0, + ]; + } +} diff --git a/database/factories/PartnerMediaFactory.php b/database/factories/PartnerMediaFactory.php new file mode 100644 index 0000000..5b625b3 --- /dev/null +++ b/database/factories/PartnerMediaFactory.php @@ -0,0 +1,32 @@ + + */ +class PartnerMediaFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'company_id' => Company::factory(), + 'name' => fake()->company(), + 'address' => fake()->address(), + 'link' => fake()->url(), + 'type' => MediaType::ONLINE, + 'classification' => MediaClassification::LOCAL, + ]; + } +} diff --git a/database/factories/RejectionReasonFactory.php b/database/factories/RejectionReasonFactory.php new file mode 100644 index 0000000..21f62bb --- /dev/null +++ b/database/factories/RejectionReasonFactory.php @@ -0,0 +1,27 @@ + + */ +class RejectionReasonFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'rejectable_type' => Cooperation::class, + 'rejectable_id' => Cooperation::factory(), + 'reason' => fake()->sentence(), + ]; + } +} diff --git a/database/factories/ReportFactory.php b/database/factories/ReportFactory.php new file mode 100644 index 0000000..57f8f05 --- /dev/null +++ b/database/factories/ReportFactory.php @@ -0,0 +1,31 @@ + + */ +class ReportFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'media_task_assignment_id' => MediaTaskAssignment::factory(), + 'title' => fake()->sentence(), + 'publication_date' => fake()->date(), + 'link' => fake()->url(), + 'description' => fake()->paragraph(), + 'status' => ApprovalStatus::PENDING, + ]; + } +} diff --git a/database/factories/SubClassificationFactory.php b/database/factories/SubClassificationFactory.php new file mode 100644 index 0000000..bd53aac --- /dev/null +++ b/database/factories/SubClassificationFactory.php @@ -0,0 +1,29 @@ + + */ +class SubClassificationFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'classification_id' => Classification::factory(), + 'name' => fake()->unique()->word(), + 'description' => fake()->sentence(), + 'is_active' => IsActive::ACTIVE, + ]; + } +} diff --git a/database/factories/SubLocationFactory.php b/database/factories/SubLocationFactory.php new file mode 100644 index 0000000..fc278e6 --- /dev/null +++ b/database/factories/SubLocationFactory.php @@ -0,0 +1,29 @@ + + */ +class SubLocationFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'location_id' => Location::factory(), + 'name' => fake()->unique()->word(), + 'description' => fake()->sentence(), + 'is_active' => IsActive::ACTIVE, + ]; + } +} diff --git a/database/factories/TaskAssignmentFactory.php b/database/factories/TaskAssignmentFactory.php new file mode 100644 index 0000000..9261aad --- /dev/null +++ b/database/factories/TaskAssignmentFactory.php @@ -0,0 +1,29 @@ + + */ +class TaskAssignmentFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'cooperation_id' => Cooperation::factory(), + 'start_date' => fake()->date(), + 'end_date' => fake()->date(), + 'task_description' => fake()->paragraph(), + 'report_amount' => fake()->numberBetween(1, 10), + ]; + } +} diff --git a/database/factories/ThemeFactory.php b/database/factories/ThemeFactory.php new file mode 100644 index 0000000..a91c736 --- /dev/null +++ b/database/factories/ThemeFactory.php @@ -0,0 +1,26 @@ + + */ +class ThemeFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => fake()->unique()->word(), + 'is_active' => IsActive::ACTIVE, + ]; + } +} diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php new file mode 100644 index 0000000..a0a2c15 --- /dev/null +++ b/database/factories/UserFactory.php @@ -0,0 +1,48 @@ + + */ +class UserFactory extends Factory +{ + /** + * The current password being used by the factory. + */ + protected static ?string $password; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => fake()->name(), + 'email' => fake()->unique()->safeEmail(), + 'username' => Str::random(10), + 'email_verified_at' => now(), + 'password' => static::$password ??= Hash::make('password'), + 'remember_token' => Str::random(10), + 'is_active' => IsActive::ACTIVE, + ]; + } + + /** + * Indicate that the model's email address should be unverified. + */ + public function unverified(): static + { + return $this->state(fn (array $attributes) => [ + 'email_verified_at' => null, + ]); + } +} diff --git a/database/factories/VerificationRequestFactory.php b/database/factories/VerificationRequestFactory.php new file mode 100644 index 0000000..77880fe --- /dev/null +++ b/database/factories/VerificationRequestFactory.php @@ -0,0 +1,57 @@ + + */ +class VerificationRequestFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'company_id' => Company::factory(), + 'submitted_by' => User::factory(), + 'status' => VerificationStatus::PENDING, + ]; + } + + public function pending(): static + { + return $this->state(fn (array $attributes) => [ + 'status' => VerificationStatus::PENDING, + ]); + } + + public function approved(): static + { + return $this->state(fn (array $attributes) => [ + 'status' => VerificationStatus::APPROVED, + ]); + } + + public function rejected(): static + { + return $this->state(fn (array $attributes) => [ + 'status' => VerificationStatus::REJECTED, + ]); + } + + public function needRevision(): static + { + return $this->state(fn (array $attributes) => [ + 'status' => VerificationStatus::NEED_REVISION, + ]); + } +} diff --git a/database/factories/VerificationReviewFactory.php b/database/factories/VerificationReviewFactory.php new file mode 100644 index 0000000..8d26ac3 --- /dev/null +++ b/database/factories/VerificationReviewFactory.php @@ -0,0 +1,30 @@ + + */ +class VerificationReviewFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'verification_request_id' => VerificationRequest::factory(), + 'reviewer_id' => User::factory(), + 'decision' => DecisionAdmin::APPROVED, + 'note' => fake()->sentence(), + ]; + } +} diff --git a/database/factories/VisitorFactory.php b/database/factories/VisitorFactory.php new file mode 100644 index 0000000..77885bd --- /dev/null +++ b/database/factories/VisitorFactory.php @@ -0,0 +1,32 @@ + + */ +class VisitorFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'user_id' => User::factory(), + 'method' => 'GET', + 'route' => 'home', + 'parameters' => [], + 'status' => 200, + 'ip' => fake()->ipv4(), + 'date' => now(), + 'counter' => 1, + ]; + } +}