fix: religion relation

This commit is contained in:
Methapon2001 2024-03-21 16:29:51 +07:00
parent c32883f2e8
commit 02878b769b
3 changed files with 37 additions and 21 deletions

View file

@ -21,6 +21,7 @@ import { ProfileGovernment } from "./ProfileGovernment";
import { Gender } from "./Gender";
import { Relationship } from "./Relationship";
import { BloodGroup } from "./BloodGroup";
import { Religion } from "./Religion";
@Entity("profile")
export class Profile extends EntityBase {
@ -149,14 +150,6 @@ export class Profile extends EntityBase {
})
ethnicity: string;
@Column({
nullable: true,
comment: "ศาสนา",
length: 255,
default: null,
})
religion: string;
@Column({
nullable: true,
comment: "เบอร์โทร",
@ -187,6 +180,17 @@ export class Profile extends EntityBase {
@ManyToOne(() => Relationship, (v) => v.profile)
relationship: Relationship;
@Column({
nullable: true,
comment: "ศาสนา",
length: 255,
default: null,
})
religionId: string;
@ManyToOne(() => Religion, (v) => v.profile)
religion: Religion;
@Column({
nullable: true,
comment: "กรุ๊ปเลือด",
@ -286,9 +290,9 @@ export class CreateProfile {
dateRetire: Date | null;
birthDate: Date | null;
ethnicity: string | null;
religion: string | null;
telephoneNumber: string | null;
citizenId: string;
religionId: string | null;
posLevelId: string | null;
posTypeId: string | null;
genderId: string | null;
@ -308,9 +312,9 @@ export type UpdateProfile = {
dateRetire?: Date | null;
birthDate?: Date | null;
ethnicity?: string | null;
religion?: string | null;
telephoneNumber?: string | null;
citizenId?: string | null;
religionId: string | null;
posLevelId?: string | null;
posTypeId?: string | null;
genderId?: string | null;