2020-07-21 13:20:51 +00:00
|
|
|
import {BaseEntity, Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn} from 'typeorm';
|
|
|
|
import {BillingAccount} from 'app/gen-server/entity/BillingAccount';
|
|
|
|
import {User} from 'app/gen-server/entity/User';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A list of users with the right to modify a giving billing account.
|
|
|
|
*/
|
|
|
|
@Entity({name: 'billing_account_managers'})
|
|
|
|
export class BillingAccountManager extends BaseEntity {
|
|
|
|
@PrimaryGeneratedColumn()
|
|
|
|
public id: number;
|
|
|
|
|
2023-05-23 19:17:28 +00:00
|
|
|
@Column({name: 'billing_account_id', type: Number})
|
2020-07-21 13:20:51 +00:00
|
|
|
public billingAccountId: number;
|
|
|
|
|
|
|
|
@ManyToOne(type => BillingAccount, { onDelete: 'CASCADE' })
|
|
|
|
@JoinColumn({name: 'billing_account_id'})
|
|
|
|
public billingAccount: BillingAccount;
|
|
|
|
|
2023-05-23 19:17:28 +00:00
|
|
|
@Column({name: 'user_id', type: Number})
|
2020-07-21 13:20:51 +00:00
|
|
|
public userId: number;
|
|
|
|
|
|
|
|
@ManyToOne(type => User, { onDelete: 'CASCADE' })
|
|
|
|
@JoinColumn({name: 'user_id'})
|
|
|
|
public user: User;
|
|
|
|
}
|