04/06 implement creating ticket on behalf of another user for IT staff

This commit is contained in:
2026-04-06 17:13:53 -04:00
parent 3b17705911
commit bc236a3d19
8 changed files with 738 additions and 14 deletions
+6
View File
@@ -117,6 +117,12 @@ class Ticket(db.Model):
internal_notes = db.Column(db.Text)
resolution_notes = db.Column(db.Text)
# When an IT staff member creates a ticket on behalf of an employee
# (e.g. from a phone call or email), this column records who filed it.
# NULL means the ticket was self-submitted by the employee.
created_by_staff_id = db.Column(db.Integer, db.ForeignKey('users.id'), nullable=True)
filed_by_staff = db.relationship('User', foreign_keys='Ticket.created_by_staff_id')
# Relationships
comments = db.relationship('Comment', backref='ticket', lazy='dynamic', cascade='all, delete-orphan')
attachments = db.relationship('Attachment', backref='ticket', lazy='dynamic', cascade='all, delete-orphan')