Loading backend/src/app.module.ts +5 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ import { ServeStaticModule } from '@nestjs/serve-static'; import { join } from 'path'; import { Town } from './town/entities/town.entity'; import { TownModule } from './town/town.module'; import { TownTraduction } from './town/entities/town-traduction.entity'; @Module({ imports: [ TypeOrmModule.forRoot({ Loading @@ -25,8 +27,9 @@ import { TownModule } from './town/town.module'; username: DbConstants.DB_USER, password: DbConstants.DB_PASSWORD, database: DbConstants.DB_NAME, entities: [Admin, User, State, Town], entities: [Admin, User, State, Town, TownTraduction], synchronize: DbConstants.DB_SYNC, logging: true, }), AuthAdminModule, AdminModule, Loading @@ -41,5 +44,6 @@ import { TownModule } from './town/town.module'; ], controllers: [AppController], providers: [AppService, DatabaseSeederModule], exports: [TypeOrmModule], }) export class AppModule {} backend/src/database-seeder/database-seeder.module.ts +2 −1 Original line number Diff line number Diff line Loading @@ -3,9 +3,10 @@ import { DatabaseSeederService } from './database-seeder.service'; import { TypeOrmModule } from '@nestjs/typeorm'; import { State } from 'src/state/entities/state.entity'; import { StateService } from 'src/state/state.service'; import { Town } from 'src/town/entities/town.entity'; @Module({ providers: [DatabaseSeederService, StateService], imports: [TypeOrmModule.forFeature([State])], imports: [TypeOrmModule.forFeature([State, Town])], }) export class DatabaseSeederModule {} backend/src/enum/languages.enum.ts 0 → 100644 +4 −0 Original line number Diff line number Diff line export enum LANGUAGES { EN = 'en', ES = 'es', } backend/src/town/dto/create-town-trad.dto.ts 0 → 100644 +8 −0 Original line number Diff line number Diff line import { LANGUAGES } from 'src/enum/languages.enum'; export class CreateTownTraductionDto { townId: number; language: LANGUAGES; name: string; description: string; } backend/src/town/dto/create-town.dto.ts +12 −2 Original line number Diff line number Diff line Loading @@ -3,8 +3,18 @@ import { ApiProperty } from '@nestjs/swagger'; export class CreateTownDto { @ApiProperty() name: string; @ApiProperty() description: string; @ApiProperty({ type: String, description: 'Language content for Spanish (es)', }) descriptionES: string; @ApiProperty({ type: String, description: 'Language content for English (en)', }) descriptionEN: string; imageName: string = 'default.jpg'; @ApiProperty() state: number; Loading Loading
backend/src/app.module.ts +5 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ import { ServeStaticModule } from '@nestjs/serve-static'; import { join } from 'path'; import { Town } from './town/entities/town.entity'; import { TownModule } from './town/town.module'; import { TownTraduction } from './town/entities/town-traduction.entity'; @Module({ imports: [ TypeOrmModule.forRoot({ Loading @@ -25,8 +27,9 @@ import { TownModule } from './town/town.module'; username: DbConstants.DB_USER, password: DbConstants.DB_PASSWORD, database: DbConstants.DB_NAME, entities: [Admin, User, State, Town], entities: [Admin, User, State, Town, TownTraduction], synchronize: DbConstants.DB_SYNC, logging: true, }), AuthAdminModule, AdminModule, Loading @@ -41,5 +44,6 @@ import { TownModule } from './town/town.module'; ], controllers: [AppController], providers: [AppService, DatabaseSeederModule], exports: [TypeOrmModule], }) export class AppModule {}
backend/src/database-seeder/database-seeder.module.ts +2 −1 Original line number Diff line number Diff line Loading @@ -3,9 +3,10 @@ import { DatabaseSeederService } from './database-seeder.service'; import { TypeOrmModule } from '@nestjs/typeorm'; import { State } from 'src/state/entities/state.entity'; import { StateService } from 'src/state/state.service'; import { Town } from 'src/town/entities/town.entity'; @Module({ providers: [DatabaseSeederService, StateService], imports: [TypeOrmModule.forFeature([State])], imports: [TypeOrmModule.forFeature([State, Town])], }) export class DatabaseSeederModule {}
backend/src/enum/languages.enum.ts 0 → 100644 +4 −0 Original line number Diff line number Diff line export enum LANGUAGES { EN = 'en', ES = 'es', }
backend/src/town/dto/create-town-trad.dto.ts 0 → 100644 +8 −0 Original line number Diff line number Diff line import { LANGUAGES } from 'src/enum/languages.enum'; export class CreateTownTraductionDto { townId: number; language: LANGUAGES; name: string; description: string; }
backend/src/town/dto/create-town.dto.ts +12 −2 Original line number Diff line number Diff line Loading @@ -3,8 +3,18 @@ import { ApiProperty } from '@nestjs/swagger'; export class CreateTownDto { @ApiProperty() name: string; @ApiProperty() description: string; @ApiProperty({ type: String, description: 'Language content for Spanish (es)', }) descriptionES: string; @ApiProperty({ type: String, description: 'Language content for English (en)', }) descriptionEN: string; imageName: string = 'default.jpg'; @ApiProperty() state: number; Loading