Skip to content

Commit

Permalink
FES-22-database-modify-table-basic-customization (#28)
Browse files Browse the repository at this point in the history
* adjust data for the basic customization
Co-authored-by: NHT <[email protected]>
  • Loading branch information
nfesta2023 authored Jan 5, 2024
1 parent 62fadab commit 2b5d46d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/dto/food-detail.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ class Ingredient {
}

class BasicCustomization {
basic_customization_id: string;
no_adding_id: string;
description: TextByLang[];
}
20 changes: 8 additions & 12 deletions src/entity/basic-customization.entity.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
import {
Entity,
CreateDateColumn,
PrimaryGeneratedColumn,
Column,
OneToMany,
} from 'typeorm';
import { Entity, CreateDateColumn, OneToMany, PrimaryColumn } from 'typeorm';
import { NoAddingExt } from './no-adding-ext.entity';

@Entity('Basic_Customization')
export class BasicCustomization {
@PrimaryGeneratedColumn()
public basic_customization_id: number;

@Column({ type: 'int', nullable: false, unique: false })
@PrimaryColumn({ type: 'int', nullable: false, unique: false })
public menu_item_id: number;

@Column({ type: 'varchar', length: 45, nullable: true, unique: false })
@PrimaryColumn({
type: 'varchar',
length: 45,
nullable: false,
unique: false,
})
public no_adding_id: string;

@CreateDateColumn({
Expand Down
2 changes: 1 addition & 1 deletion src/feature/food/food.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export class FoodService {
const convertedBasicCustomization = [];
for (const basic of basicCustomization) {
const customizedItem = {
basic_customization_id: basic.basic_customization_id,
no_adding_id: basic.no_adding_id,
description: basic.extension.map((ext) => {
return {
ISO_language_code: ext.ISO_language_code,
Expand Down

0 comments on commit 2b5d46d

Please sign in to comment.