fix: join address to the customer get by admin

This commit is contained in:
mahyargdz
2025-03-06 10:35:12 +03:30
parent b92a65c22c
commit 144bfb2ac1
12 changed files with 257 additions and 75 deletions
@@ -0,0 +1,16 @@
import { Column, Entity, ManyToOne } from "typeorm";
import { User } from "./user.entity";
import { BaseEntity } from "../../../common/entities/base.entity";
@Entity()
export class RefreshToken extends BaseEntity {
@Column({ type: "text" })
token: string;
@ManyToOne(() => User, (user) => user.refreshTokens, { onDelete: "CASCADE" })
user: User;
@Column({ type: "timestamptz", nullable: true })
expiresAt: Date;
}
@@ -3,6 +3,7 @@ import { Column, Entity, JoinTable, ManyToMany, OneToMany, OneToOne } from "type
import { LegalUser } from "./legal-user.entity";
import { RealUser } from "./real-user.entity";
import { RefreshToken } from "./refresh-token.entity";
import { Role } from "./role.entity";
import { UserGroup } from "./user-group.entity";
import { BaseEntity } from "../../../common/entities/base.entity";
@@ -120,6 +121,9 @@ export class User extends BaseEntity {
@OneToMany(() => UserQuickAccess, (quickAccess) => quickAccess.user)
quickAccesses: UserQuickAccess[];
@OneToMany(() => RefreshToken, (refreshToken) => refreshToken.user, { cascade: true })
refreshTokens: RefreshToken[];
}
// @ManyToMany(() => DanakService, (danakService) => danakService.users)