-
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 25 refactor concept variant option to attribute value (#34)
* refactor part 1 * refactor concept part 2 * fix typing err and add the restaurant remove logic --------- Co-authored-by: NHT <[email protected]>
- Loading branch information
1 parent
0f26b2f
commit 2d5e9ce
Showing
14 changed files
with
204 additions
and
228 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
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, | ||
ManyToOne, | ||
JoinColumn, | ||
} from 'typeorm'; | ||
import { SKU } from './sku.entity'; | ||
import { MenuItemAttribute } from './menu-item-attribute.entity'; | ||
import { MenuItemAttributeValue } from './menu-item-attribute-value.entity'; | ||
|
||
@Entity('SKU_Detail') | ||
export class SkuDetail { | ||
@PrimaryColumn() | ||
public sku_id: number; | ||
|
||
@PrimaryColumn() | ||
public attribute_id: number; | ||
|
||
@Column({ type: 'int', nullable: false, unique: false }) | ||
public value_id: number; | ||
|
||
@CreateDateColumn({ | ||
type: 'datetime', | ||
nullable: false, | ||
unique: false, | ||
default: () => 'CURRENT_TIMESTAMP', | ||
}) | ||
public created_at: Date; | ||
|
||
//RELATIONSHIPS | ||
|
||
@ManyToOne(() => SKU, (sku) => sku.detail) | ||
@JoinColumn({ | ||
name: 'sku_id', | ||
referencedColumnName: 'sku_id', | ||
}) | ||
public sku_obj: SKU; | ||
|
||
@ManyToOne(() => MenuItemAttribute) | ||
@JoinColumn({ | ||
name: 'attribute_id', | ||
referencedColumnName: 'attribute_id', | ||
}) | ||
public attribute_obj: MenuItemAttribute; | ||
|
||
@ManyToOne(() => MenuItemAttributeValue) | ||
@JoinColumn({ | ||
name: 'value_id', | ||
referencedColumnName: 'value_id', | ||
}) | ||
public value_obj: MenuItemAttributeValue; | ||
} |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.