Skip to content

Conversation

greatman
Copy link

Add #17687.

This adds a User responsible field to maintenances. That way, we can track who cost a lot to a company.

The information is available both in the Users & the maintenance page.

image image image

@greatman greatman requested a review from snipe as a code owner September 21, 2025 02:23
@greatman greatman changed the base branch from master to develop September 21, 2025 02:23
Copy link
Member

@snipe snipe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty good, thanks! I have a few requests here, but also I think I'd probably want to reverse the logic in the name, Responsible User versus User Responsible.

It could also get a little confusing, since this "responsible" could be interpreted as the person responsible for causing a maintenance event, versus the person responsible for ensuring the maintenance is handled.

I was actually already working on this issue (I have a branch that wasn't pushed up yet.) It's often better to ask first, just so we're not duplicating efforts :)

'completion_date' => 'date_format:Y-m-d|nullable|after_or_equal:start_date',
'notes' => 'string|nullable',
'cost' => 'numeric|nullable|gte:0|max:99999999999999999.99',
'user_responsible_id' => 'nullable|integer'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want a check here to make sure the user's ID exists in the user table.

'asset.supplier' => ['name'],
'asset.assetstatus' => ['name'],
'supplier' => ['name'],
'user_responsible' => ['first_name', 'last_name'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you want to refer to the relationship here, no? userResponsible down below.

*
* @return \Illuminate\Database\Eloquent\Relations\Relation
*/
public function maintenanceCausedBy()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we rename this to maintenanceCausedByUser or causedByUser for clarity?

@uberbrady uberbrady mentioned this pull request Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants