title: Save audit for an entity using nestjs and typeorm
body: <p>I have an entity <code>Audit</code> Like below in Nestjs app with typeorm for mongodb:</p>
  
  <pre><code>@Entity()
  export class Audit {
  
    @Column()
    createdBy: string;
  
    @BeforeInsert()
    setAudit() {
      this.createdBy = ???
    }
  }
  
  @Entity()
  export class Post extends Audit {
  
    @Column()
    title: string;
  
    ...
  }
  </code></pre>
  
  <p>My other entities extend <code>Audit</code> and in my application i'm using jwt to authenticate users.</p>
  
  <p>The problem is that when i want to save an entity i don't know how to set createdBy with @BeforeInsert hook...</p>
  
  <p>I know we have user in request but i don't know what is the correct way of bringing user into <code>setAudit</code> method?</p>