Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
3ea93af
WIP DEvices API.
edwh Feb 26, 2024
bc564f4
WIP Devices API.
edwh Feb 26, 2024
3554136
Test fixes
edwh Mar 7, 2024
fb0414e
WIP Device API
edwh Mar 7, 2024
3dc026b
Merge branch 'refs/heads/develop' into RES-1962_devices_api
edwh Jun 10, 2024
7f6aab3
Some test failures, introduce edit device APIv2 call.
edwh Jun 10, 2024
752d2f5
Migrate more tests over to the v2 API. call.
edwh Jun 17, 2024
3589898
Migrate more tests over to the v2 API call.
edwh Jun 24, 2024
c583d09
Update store to use new API calls.
edwh Jun 24, 2024
eb8db29
Add devices using new API call
edwh Jun 24, 2024
7fa7c50
Edit devices using new API call
edwh Jun 24, 2024
f8b0c53
Merge branch 'refs/heads/develop' into RES-1962_devices_api
edwh Jul 11, 2024
ace13c0
Test fixes.
edwh Jul 11, 2024
c6bad85
Edit fixes.
edwh Jul 11, 2024
2cbd01e
Fill out test provider for item inputs
ngm Jul 15, 2024
3f99482
Rework to use new Device resource for data returned, and use the new …
edwh Jul 16, 2024
3dc63dd
Merge remote-tracking branch 'origin/RES-1962_devices_api' into RES-1…
edwh Jul 16, 2024
13d88ad
Test fixes.
edwh Jul 16, 2024
4b0b8ea
Test fixes.
edwh Jul 16, 2024
54b8e91
Testing fixes.
edwh Jul 22, 2024
ec73198
Test fixes
edwh Jul 22, 2024
d363eba
Fix barriers.
edwh Jul 22, 2024
ec7933a
WIP images.
edwh Jul 30, 2024
771d68f
Image add/delete
edwh Jul 30, 2024
70f31b7
Delete TODOs which have been done.
edwh Jul 30, 2024
bc1871c
Item type should be optional.
edwh Jul 30, 2024
4c73e9f
Playwright file chooser fix.
edwh Aug 5, 2024
eaa1aa1
Increase throttle limit for API, which may be blocking Playwright tests.
edwh Aug 5, 2024
990c684
Changes to image upload/delete/use of store.
edwh Aug 5, 2024
8d0dbb0
Can't set end of life.
edwh Aug 12, 2024
f8fb270
Disable image upload during device creation.
edwh Aug 12, 2024
fbff857
Photo upload not working during image creation.
edwh Aug 12, 2024
a18a608
Merge branch 'develop' into RES-1962_devices_api
edwh Jan 7, 2025
e2002e1
Review feedback.
edwh Jan 7, 2025
c7befc9
Test fixes.
edwh Jan 7, 2025
e7f33ad
Test fixes.
edwh Jan 7, 2025
1ead5c9
Add reference field for devices.
edwh Jan 7, 2025
2c55f0b
Review feedback.
edwh Jun 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion app/Device.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,38 @@ class Device extends Model implements Auditable
use HasFactory;

const REPAIR_STATUS_FIXED = 1;
const REPAIR_STATUS_FIXED_STR = 'Fixed';
const REPAIR_STATUS_REPAIRABLE = 2;
const REPAIR_STATUS_REPAIRABLE_STR = 'Repairable';
const REPAIR_STATUS_ENDOFLIFE = 3;
const REPAIR_STATUS_ENDOFLIFE_STR = 'End of life';

const SPARE_PARTS_NEEDED = 1;
const SPARE_PARTS_NOT_NEEDED = 2;
const SPARE_PARTS_UNKNOWN = 0;

const PARTS_PROVIDER_MANUFACTURER = 1;
const PARTS_PROVIDER_MANUFACTURER_STR = 'Manufacturer';
const PARTS_PROVIDER_THIRD_PARTY = 2;
const PARTS_PROVIDER_THIRD_PARTY_STR = 'Third party';
const PARTS_PROVIDER_NO = 0;
const PARTS_PROVIDER_NO_STR = 'No';

const BARRIER_SPARE_PARTS_NOT_AVAILABLE = 1;
const BARRIER_SPARE_PARTS_NOT_AVAILABLE_STR = 'Spare parts not available';
const BARRIER_SPARE_PARTS_TOO_EXPENSIVE = 2;
const BARRIER_SPARE_PARTS_TOO_EXPENSIVE_STR = 'Spare parts too expensive';
const BARRIER_NO_WAY_TO_OPEN_THE_PRODUCT = 3;
const BARRIER_NO_WAY_TO_OPEN_THE_PRODUCT_STR = 'No way to open the product';
const BARRIER_REPAIR_INFORMATION_NOT_AVAILABLE = 4;
const BARRIER_REPAIR_INFORMATION_NOT_AVAILABLE_STR = 'Repair information not available';
const BARRIER_LACK_OF_EQUIPMENT = 5;
const BARRIER_LACK_OF_EQUIPMENT_STR = 'Lack of equipment';

const NEXT_STEPS_MORE_TIME_NEEDED_STR = 'More time needed';
const NEXT_STEPS_PROFESSIONAL_HELP_STR = 'Professional help';
const NEXT_STEPS_DO_IT_YOURSELF_STR = 'Do it yourself';


use \OwenIt\Auditing\Auditable;
protected $table = 'devices';
Expand All @@ -33,7 +56,7 @@ class Device extends Model implements Auditable
*
* @var array
*/
protected $fillable = ['event', 'category', 'category_creation', 'estimate', 'repair_status', 'spare_parts', 'parts_provider', 'brand', 'item_type', 'model', 'age', 'problem', 'notes', 'repaired_by', 'do_it_yourself', 'professional_help', 'more_time_needed', 'wiki', 'fault_type'];
protected $fillable = ['event', 'category', 'category_creation', 'estimate', 'repair_status', 'spare_parts', 'parts_provider', 'brand', 'item_type', 'model', 'age', 'problem', 'notes', 'repaired_by', 'do_it_yourself', 'professional_help', 'more_time_needed', 'wiki', 'fault_type', 'reference'];

/**
* The attributes that should be hidden for arrays.
Expand Down
2 changes: 1 addition & 1 deletion app/DeviceBarrier.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class DeviceBarrier extends Model
{
protected $table = 'devices_barriers';
protected $fillable = ['device_id', 'barrier'];
protected $fillable = ['device_id', 'barrier_id'];
protected $hidden = [];
public $timestamps = false;
}
Loading