<commit_before><?php

/*
|--------------------------------------------------------------------------
| Membership Factory
|--------------------------------------------------------------------------
|
| Create models with stub data for all data coming from the Membership
| Data Service.
|
*/

if (!function_exists('membershipIdsAndTitle'))
{
    function membershipIdsAndTitle($faker, $title = '')
    {

        return [
            'membership_id' => $faker->unique()->randomNumber(5),
            'title' => $title ? $title : ucfirst($faker->words(3, true)),
        ];

    }

    function membershipDates($faker)
    {

        return [
            'source_created_at' => $faker->dateTimeThisYear,
            'source_modified_at' => $faker->dateTimeThisYear,
        ];

    }

}


$factory->define(App\Models\Membership\Event::class, function (Faker\Generator $faker) {
    return array_merge(
        membershipIdsAndTitle($faker),
        [
            'start' => $faker->dateTimeThisYear,
            'end' => $faker->dateTimeThisYear,
            'type' => $faker->randomNumber(2),
            'on_sale' => $faker->dateTimeThisYear,
            'off_sale' => $faker->dateTimeThisYear,
            'resource' => $faker->randomNumber(2),
            'user_event_number' => $faker->randomNumber(3),
            'available' => $faker->randomDigit * 10,
            'total_capacity' => $faker->randomDigit * 10,
            'status' => $faker->randomDigit,
            'has_roster' => $faker->boolean,
            'rs_event_seat_map_id' => $faker->randomDigit,
            'private_event' => $faker->boolean,
            'has_holds' => $faker->boolean,
        ],
        membershipDates($faker)
    );
});

$factory->define(App\Models\Membership\Member::class, function (Faker\Generator $faker) {
    $first = $faker->firstName;
    $last = $faker->lastName;
    return array_merge(
        membershipIdsAndTitle($faker, $first .' ' .$last),
        [
            'first_name' => $first,<commit_msg>Update Event factory to match new schema<commit_after><?php

/*
|--------------------------------------------------------------------------
| Membership Factory
|--------------------------------------------------------------------------
|
| Create models with stub data for all data coming from the Membership
| Data Service.
|
*/

if (!function_exists('membershipIdsAndTitle'))
{
    function membershipIdsAndTitle($faker, $title = '')
    {

        return [
            'membership_id' => $faker->unique()->randomNumber(5),
            'title' => $title ? $title : ucfirst($faker->words(3, true)),
        ];

    }

    function membershipDates($faker)
    {

        return [
            'source_created_at' => $faker->dateTimeThisYear,
            'source_modified_at' => $faker->dateTimeThisYear,
        ];

    }

}


$factory->define(App\Models\Membership\Event::class, function (Faker\Generator $faker) {

    $has_capacity = rand(0,1) == 1;

    return array_merge(
        membershipIdsAndTitle($faker),
        [
            'type_id' => $faker->randomNumber(2),
            'start_at' => $faker->dateTimeThisYear,
            'end_at' => $faker->dateTimeThisYear,
            'resource_id' => $faker->randomNumber(2),
            'resource_title' => ucfirst($faker->words(3, true)),
            'is_after_hours' => $faker->boolean,
            'is_private_event' => $faker->boolean,
            'is_admission_required' => $faker->boolean,
            'available' => $has_capacity ? $faker->randomDigit * 10 : null,
            'total_capacity' => $has_capacity ? $faker->randomDigit * 100 : null,
        ],
        membershipDates($faker)
    );
});

$factory->define(App\Models\Membership\Member::class, function (Faker\Generator $faker) {
    $first = $faker->firstName;
    $last = $faker->lastName;
    return array_merge(
        membershipIdsAndTitle($faker, $first .' ' .$last),
        [
            'first_name' => $first,
{'fraction_non_alphanumeric': 0.21831520364280294, 'fraction_numerical': 0.005565393372122439, 'mean_word_length': 1.9397769516728625, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 79, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3211540', 'n_tokens_mistral': 1185, 'n_tokens_neox': 1162, 'n_words': 185}