mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-25 00:07:54 +00:00
Add TimeZone module
This commit is contained in:
@@ -0,0 +1 @@
|
||||
export * from './timezone.entity';
|
||||
@@ -0,0 +1,23 @@
|
||||
import { Column, Entity, OneToMany } from 'typeorm';
|
||||
import { TimeZoneDto } from '../dtos';
|
||||
import { AbstractEntity } from '../../abstract/entities/abstract.entity';
|
||||
import { UserEntity } from '../../user/entities';
|
||||
|
||||
@Entity({ name: 'timezone' })
|
||||
export class TimeZoneEntity extends AbstractEntity<TimeZoneDto> {
|
||||
@Column({
|
||||
nullable: false,
|
||||
})
|
||||
cityName: string;
|
||||
@Column({
|
||||
nullable: false,
|
||||
})
|
||||
timeZoneOffset: string;
|
||||
@OneToMany(() => UserEntity, (user) => user.timezone)
|
||||
users: UserEntity[];
|
||||
|
||||
constructor(partial: Partial<TimeZoneEntity>) {
|
||||
super();
|
||||
Object.assign(this, partial);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user