-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FES-79-update-packaging-db-change (#61)
- adjust dto, entity and logic to get data Co-authored-by: NHT <[email protected]>
- Loading branch information
1 parent
14bad8c
commit 148ef1c
Showing
10 changed files
with
189 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "all", | ||
"printWidth": 200 | ||
} | ||
"printWidth": 80 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { | ||
Entity, | ||
CreateDateColumn, | ||
PrimaryColumn, | ||
Column, | ||
JoinColumn, | ||
ManyToOne, | ||
OneToOne, | ||
} from 'typeorm'; | ||
import { Packaging } from './packaging.entity'; | ||
import { MenuItem } from './menu-item.entity'; | ||
import { Media } from './media.entity'; | ||
|
||
@Entity('MenuItem_Packaging') | ||
export class MenuItemPackaging { | ||
@PrimaryColumn({ type: 'int', nullable: false }) | ||
public packaging_id: number; | ||
|
||
@PrimaryColumn({ type: 'int', nullable: false }) | ||
public menu_item_id: number; | ||
|
||
@Column({ type: 'int', nullable: false }) | ||
public image: number; | ||
|
||
@CreateDateColumn({ | ||
type: 'datetime', | ||
nullable: false, | ||
unique: false, | ||
default: () => 'CURRENT_TIMESTAMP', | ||
}) | ||
public created_at: Date; | ||
|
||
//RELATIONSHIP | ||
@ManyToOne(() => Packaging) | ||
@JoinColumn({ | ||
name: 'packaging_id', | ||
referencedColumnName: 'packaging_id', | ||
}) | ||
public packaging_obj: Packaging; | ||
|
||
@ManyToOne(() => MenuItem) | ||
@JoinColumn({ | ||
name: 'menu_item_id', | ||
referencedColumnName: 'menu_item_id', | ||
}) | ||
public menu_item_obj: MenuItem; | ||
|
||
@OneToOne(() => Media) | ||
@JoinColumn({ | ||
name: 'image', | ||
referencedColumnName: 'media_id', | ||
}) | ||
image_obj: Media; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters