diff --git a/apps/your-burger-api/src/app/app.module.ts b/apps/your-burger-api/src/app/app.module.ts index 36b6d40..6c76a0a 100644 --- a/apps/your-burger-api/src/app/app.module.ts +++ b/apps/your-burger-api/src/app/app.module.ts @@ -2,9 +2,14 @@ import { Module } from '@nestjs/common'; import { BurgerBusinessModule } from './burger-business/burger-business.module'; import { MikroOrmModule } from '@mikro-orm/nestjs'; import config from '../mikro-orm.config'; +import { ProposalModule } from './proposal/proposal.module'; @Module({ - imports: [BurgerBusinessModule, MikroOrmModule.forRoot(config)], + imports: [ + BurgerBusinessModule, + ProposalModule, + MikroOrmModule.forRoot(config), + ], controllers: [], providers: [], }) diff --git a/apps/your-burger-api/src/app/burger-business/infra/http/allergen/allergens.controller.ts b/apps/your-burger-api/src/app/burger-business/infra/http/allergen/allergens.controller.ts index 84a2519..c2e0dce 100644 --- a/apps/your-burger-api/src/app/burger-business/infra/http/allergen/allergens.controller.ts +++ b/apps/your-burger-api/src/app/burger-business/infra/http/allergen/allergens.controller.ts @@ -5,7 +5,7 @@ import { ApiTags } from '@nestjs/swagger'; import { API_TAGS } from '../../../../../open-api'; @Controller('allergens') -@ApiTags(API_TAGS.BURGERS) +@ApiTags(API_TAGS.ALLERGENS) export class AllergensController { constructor(private readonly allergensRepository: AllergensRepository) {} diff --git a/apps/your-burger-api/src/app/burger-business/infra/http/burger-brand/burger-brand.controller.ts b/apps/your-burger-api/src/app/burger-business/infra/http/burger-brand/burger-brand.controller.ts index bcabab1..3c68203 100644 --- a/apps/your-burger-api/src/app/burger-business/infra/http/burger-brand/burger-brand.controller.ts +++ b/apps/your-burger-api/src/app/burger-business/infra/http/burger-brand/burger-brand.controller.ts @@ -5,7 +5,7 @@ import { ApiTags } from '@nestjs/swagger'; import { API_TAGS } from '../../../../../open-api'; @Controller('burger-brands') -@ApiTags(API_TAGS.BURGER_PLACES) +@ApiTags(API_TAGS.BURGER_BRANDS) export class BurgerBrandsController { constructor( private readonly burgerBrandsRepository: BrugerBrandsRepository diff --git a/apps/your-burger-api/src/app/burger-business/infra/http/ingredient/ingredients.controller.ts b/apps/your-burger-api/src/app/burger-business/infra/http/ingredient/ingredients.controller.ts index fe9cf3c..33da8f3 100644 --- a/apps/your-burger-api/src/app/burger-business/infra/http/ingredient/ingredients.controller.ts +++ b/apps/your-burger-api/src/app/burger-business/infra/http/ingredient/ingredients.controller.ts @@ -5,7 +5,7 @@ import { ApiTags } from '@nestjs/swagger'; import { API_TAGS } from '../../../../../open-api'; @Controller('ingredients') -@ApiTags(API_TAGS.BURGERS) +@ApiTags(API_TAGS.INGREDIENTS) export class IngredientsController { constructor(private readonly ingredientsRepository: IngredientsRepository) {} diff --git a/apps/your-burger-api/src/app/proposal/domain/customer-preferences.ts b/apps/your-burger-api/src/app/proposal/domain/customer-preferences.ts new file mode 100644 index 0000000..9154250 --- /dev/null +++ b/apps/your-burger-api/src/app/proposal/domain/customer-preferences.ts @@ -0,0 +1 @@ +export class CustomerPreferences {} diff --git a/apps/your-burger-api/src/app/proposal/domain/proposal.service.ts b/apps/your-burger-api/src/app/proposal/domain/proposal.service.ts index eed7d71..1c0ae97 100644 --- a/apps/your-burger-api/src/app/proposal/domain/proposal.service.ts +++ b/apps/your-burger-api/src/app/proposal/domain/proposal.service.ts @@ -1 +1,3 @@ -export abstract class ProposalService {} +export abstract class ProposalService { + abstract computeProposal(preferences: any); +} diff --git a/apps/your-burger-api/src/app/proposal/domain/proposal.ts b/apps/your-burger-api/src/app/proposal/domain/proposal.ts index fcdd583..972662a 100644 --- a/apps/your-burger-api/src/app/proposal/domain/proposal.ts +++ b/apps/your-burger-api/src/app/proposal/domain/proposal.ts @@ -1 +1,5 @@ -export class Proposal {} +import { Burger } from '../../burger-business/domain/burger'; + +export class Proposal { + burguers: Burger[]; +} diff --git a/apps/your-burger-api/src/app/proposal/infra/http/customer-preferences.dto.ts b/apps/your-burger-api/src/app/proposal/infra/http/customer-preferences.dto.ts new file mode 100644 index 0000000..90cd3ef --- /dev/null +++ b/apps/your-burger-api/src/app/proposal/infra/http/customer-preferences.dto.ts @@ -0,0 +1 @@ +export class CustomerPreferencesDto {} diff --git a/apps/your-burger-api/src/app/proposal/infra/http/proposal.controller.ts b/apps/your-burger-api/src/app/proposal/infra/http/proposal.controller.ts new file mode 100644 index 0000000..3092db9 --- /dev/null +++ b/apps/your-burger-api/src/app/proposal/infra/http/proposal.controller.ts @@ -0,0 +1,17 @@ +import { Controller, Post } from '@nestjs/common'; +import { ApiTags } from '@nestjs/swagger'; +import { Proposal } from '../../domain/proposal'; +import { ProposalService } from '../../domain/proposal.service'; +import { CustomerPreferencesDto } from './customer-preferences.dto'; +import { API_TAGS } from '../../../../open-api'; + +@Controller('proposal') +@ApiTags(API_TAGS.PROPOSAL) +export class ProposalController { + constructor(private readonly proposalService: ProposalService) {} + + @Post() + computeProposal(preferences: CustomerPreferencesDto): Proposal { + return { burguers: [] }; + } +} diff --git a/apps/your-burger-api/src/app/proposal/proposal.module.ts b/apps/your-burger-api/src/app/proposal/proposal.module.ts index af6a89a..4ae34d6 100644 --- a/apps/your-burger-api/src/app/proposal/proposal.module.ts +++ b/apps/your-burger-api/src/app/proposal/proposal.module.ts @@ -1,7 +1,9 @@ import { Module } from '@nestjs/common'; import { ProposalService } from './domain/proposal.service'; +import { ProposalController } from './infra/http/proposal.controller'; @Module({ + controllers: [ProposalController], providers: [{ provide: ProposalService, useClass: ProposalService as any }], }) export class ProposalModule {} diff --git a/apps/your-burger-api/src/assets/allergens.csv b/apps/your-burger-api/src/assets/allergens.csv new file mode 100644 index 0000000..c597838 --- /dev/null +++ b/apps/your-burger-api/src/assets/allergens.csv @@ -0,0 +1,15 @@ +id,name,i18n_key +1,GLUTEN,allergen.gluten +2,CRUSTACEANS,allergen.crustaceans +3,EGGS,allergen.eggs +4,FISH,allergen.fish +5,PEANUTS,allergen.peanuts +6,SOYBEANS,allergen.soybeans +7,MILK,allergen.milk +8,NUTS,allergen.nuts +9,CELERY,allergen.celery +10,MUSTARD,allergen.mustard +11,SESAME,allergen.sesame +12,SULPHUR_DIOXIDE,allergen.sulphurDioxide +13,LUPIN,allergen.lupin +14,MOLLUSCS,allergen.molluscs diff --git a/apps/your-burger-api/src/assets/burger-brands.csv b/apps/your-burger-api/src/assets/burger-brands.csv new file mode 100644 index 0000000..c5953cd --- /dev/null +++ b/apps/your-burger-api/src/assets/burger-brands.csv @@ -0,0 +1,29 @@ +id,name +1,Goiko Grill +2,Mcdonalds +3,Burger King +4,Porn Eat +5,Alfredo's Barbacoa +6,Hamburguesa Nostra +7,Vicio +8,Juancho's BBQ +9,Nugu Burger +10,Beefcius +11,Hundred +12,Lola's Burger +13,Junk Burger +14,Cesar's Burger +15,Frankie Burgers +16,Jenkin's +17,La puerta amarilla +18,La Birra Bar +19,Mad Grill +20,Viva Burger +21,Burmet +22,Briochef +23,Pink's +24,BDPburger +25,Burger Jazz +26,Milwaukee +27,La Bistroteca +28,New York Burger diff --git a/apps/your-burger-api/src/assets/ingredients.csv b/apps/your-burger-api/src/assets/ingredients.csv new file mode 100644 index 0000000..3e02d7d --- /dev/null +++ b/apps/your-burger-api/src/assets/ingredients.csv @@ -0,0 +1,55 @@ +id,name,i18n_key +1,BEEF_PATTY,ingredient.beefPatty +2,CHICKEN_PATTY,ingredient.chickenPatty +3,VEGGIE_PATTY,ingredient.veggiePatty +4,LETTUCE,ingredient.lettuce +5,TOMATO,ingredient.tomato +6,ONION,ingredient.onion +7,PICKLES,ingredient.pickles +8,CHEESE,ingredient.cheese +9,BACON,ingredient.bacon +10,AVOCADO,ingredient.avocado +11,KETCHUP,ingredient.ketchup +12,MUSTARD,ingredient.mustard +13,MAYONNAISE,ingredient.mayonnaise +14,BBQ_SAUCE,ingredient.bbqSauce +15,RELISH,ingredient.relish +16,MUSHROOMS,ingredient.mushrooms +17,JALAPEÑOS,ingredient.jalapeños +18,FRIED_EGG,ingredient.friedEgg +19,CHILI,ingredient.chili +20,SPINACH,ingredient.spinach +21,CUCUMBER,ingredient.cucumber +22,BELL_PEPPER,ingredient.bellPepper +23,OLIVES,ingredient.olives +24,GARLIC,ingredient.garlic +25,PINEAPPLE,ingredient.pineapple +26,SRIRACHA,ingredient.sriracha +27,CHIPOTLE_MAYO,ingredient.chipotleMayo +28,HONEY_MUSTARD,ingredient.honeyMustard +29,RANCH_DRESSING,ingredient.ranchDressing +30,THOUSAND_ISLAND_DRESSING,ingredient.thousandIslandDressing +31,BLUE_CHEESE,ingredient.blueCheese +32,SWISS_CHEESE,ingredient.swissCheese +33,CHEDDAR_CHEESE,ingredient.cheddarCheese +34,MONTEREY_JACK_CHEESE,ingredient.montereyJackCheese +35,AMERICAN_CHEESE,ingredient.americanCheese +36,PROVOLONE_CHEESE,ingredient.provoloneCheese +37,PEPPER_JACK_CHEESE,ingredient.pepperJackCheese +38,BRIOCHE_BUN,ingredient.briocheBun +39,SESAME_BUN,ingredient.sesameBun +40,WHOLE_WHEAT_BUN,ingredient.wholeWheatBun +41,GLUTEN_FREE_BUN,ingredient.gluten-FreeBun +42,BALSAMIC_GLAZE,ingredient.balsamicGlaze +43,TRUFFLE_OIL,ingredient.truffleOil +44,ARUGULA,ingredient.arugula +45,KIMCHI,ingredient.kimchi +46,COLESLAW,ingredient.coleslaw +47,PESTO,ingredient.pesto +48,RED_ONION,ingredient.redOnion +49,CARAMELIZED_ONIONS,ingredient.caramelizedOnions +50,SUN_DRIED_TOMATOES,ingredient.sun-DriedTomatoes +51,GUACAMOLE,ingredient.guacamole +52,BUFFALO_SAUCE,ingredient.buffaloSauce +53,SWEET_CHILI_SAUCE,ingredient.sweetChiliSauce +54,AIOLI,ingredient.aioli diff --git a/apps/your-burger-api/src/assets/your-burger.sqlite3 b/apps/your-burger-api/src/assets/your-burger.sqlite3 index 7e3c051..6c76d12 100644 Binary files a/apps/your-burger-api/src/assets/your-burger.sqlite3 and b/apps/your-burger-api/src/assets/your-burger.sqlite3 differ diff --git a/apps/your-burger-api/src/open-api.ts b/apps/your-burger-api/src/open-api.ts index 01ee360..9ea63af 100644 --- a/apps/your-burger-api/src/open-api.ts +++ b/apps/your-burger-api/src/open-api.ts @@ -3,7 +3,11 @@ import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; export const API_TAGS = { BURGERS: 'Burgers', + ALLERGENS: 'Allergens', + INGREDIENTS: 'Ingredients', + BURGER_BRANDS: 'Burger Brands', BURGER_PLACES: 'Burger Places', + PROPOSAL: 'Proposal', }; export function setupOpenApi(app: INestApplication) {