Files
api_arrahn/database/seeds/UnsoldCommodityNotificationSettingsSeeders.php
Afiq Hamzah 119f6d6428 Codebase update
- Remove default pic assignments for unsold commodity notifications
- Check wabot credential complete first before notification blast, if incomplete no notification be sent
- Change migration column order for settings table, column group first
- Resolve error of not showing select after updating any PIC for selected day
2024-06-11 08:41:12 +08:00

92 lines
3.0 KiB
PHP

<?php
use App\Setting;
use Illuminate\Database\Seeder;
class UnsoldCommodityNotificationSettingSeeders extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Setting::where('group', 'unsold_commodity_notifications')->each(fn($x) => $x->delete());
$data = [
[
'key' => 'status',
'value' => '1',
'group' => 'unsold_commodity_notifications',
'description' => 'Turn on or turn off notification for unsold commodity notifications',
],
[
'key' => 'start_time',
'value' => '20:00',
'group' => 'unsold_commodity_notifications',
'description' => 'The time the notifications start',
],
[
'key' => 'end_time',
'value' => '23:00',
'group' => 'unsold_commodity_notifications',
'description' => 'The time the notifications end',
],
[
'key' => 'message',
'value' => 'Baki komoditi masih lagi berbaki dan belum habis dijual',
'group' => 'unsold_commodity_notifications',
'description' => 'Turn on or turn off notification for unsold commodity notifications',
],
[
'key' => 'pic_sunday',
'value' => '[{}]',
'group' => 'unsold_commodity_notifications',
'description' => 'Person Incharge on Sunday',
],
[
'key' => 'pic_monday',
'value' => '[{}]',
'group' => 'unsold_commodity_notifications',
'description' => 'Person Incharge on Monday',
],
[
'key' => 'pic_tuesday',
'value' => '[{}]',
'group' => 'unsold_commodity_notifications',
'description' => 'Person Incharge on Tuesday',
],
[
'key' => 'pic_wednesday',
'value' => '[{}]',
'group' => 'unsold_commodity_notifications',
'description' => 'Person Incharge on Wednesday',
],
[
'key' => 'pic_thursday',
'value' => '[{}]',
'group' => 'unsold_commodity_notifications',
'description' => 'Person Incharge on Thursday',
],
[
'key' => 'pic_friday',
'value' => '[{}]',
'group' => 'unsold_commodity_notifications',
'description' => 'Person Incharge on Friday',
],
[
'key' => 'pic_saturday',
'value' => '[{}]',
'group' => 'unsold_commodity_notifications',
'description' => 'Person Incharge on Saturday',
],
];
array_walk($data, function ($setting) {
Setting::create($setting);
});
}
}