-
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.
feat: added places module with all features; fixed some serverless pr…
…oblems and permissions in serverless.yml; fixed some logic in users/ module
- Loading branch information
Showing
33 changed files
with
667 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
DB_RUN_LOCAL=true | ||
DB_RUN_LOCAL=false | ||
DB_TABLE_SUFFIX=dev |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,22 @@ | ||
import { IsEmail, IsNotEmpty, Length, IsNotEmptyObject, IsObject } from "class-validator"; | ||
|
||
export class AddressDto { | ||
@IsNotEmpty() | ||
zipcode: number; | ||
@IsNotEmpty() | ||
street: string; | ||
@IsNotEmpty() | ||
number: string; | ||
complement: string; | ||
@IsNotEmpty() | ||
city: string; | ||
@IsNotEmpty() | ||
@Length(2, 2) | ||
state: string; | ||
@IsNotEmpty() | ||
district: string; | ||
@IsNotEmpty() | ||
lat: number; | ||
@IsNotEmpty() | ||
lng: number; | ||
} |
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,19 @@ | ||
import { Address } from "../entities/address.entity"; | ||
import { Types } from "../entities/place.entity"; | ||
import { IsEmail, IsNotEmpty, Length, IsNotEmptyObject, IsObject, ValidateNested } from "class-validator"; | ||
import { Type } from 'class-transformer'; | ||
import { AddressDto } from "./address.dto"; | ||
|
||
export class CreatePlaceDto { | ||
@IsNotEmpty() | ||
title: string; | ||
@IsNotEmpty() | ||
whatsappContact: string; | ||
imageUrl: string; | ||
|
||
@IsNotEmptyObject() | ||
@IsObject() | ||
@ValidateNested() | ||
@Type(() => AddressDto) | ||
address: AddressDto; | ||
} |
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,15 @@ | ||
import { IsEmail, IsNotEmpty, Length, IsNotEmptyObject, IsObject } from "class-validator"; | ||
import { MultipleChoiceOptionsDto } from "./multiple-choice.dto"; | ||
import { OneChoiceOptionDto } from "./one-choice-option.dto"; | ||
|
||
export class MenuSectionItemDto { | ||
id: string; | ||
placeId: string; | ||
sectionId: string; | ||
title: string; | ||
description: string; | ||
value: number; | ||
imageUrl: string; | ||
oneChoiceOptions: OneChoiceOptionDto[]; | ||
multipleChoiceOptions: MultipleChoiceOptionsDto[]; | ||
} |
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,7 @@ | ||
import { IsEmail, IsNotEmpty, Length, IsNotEmptyObject, IsObject } from "class-validator"; | ||
|
||
export class MenuSectionDto { | ||
id: string; | ||
placeId: string; | ||
title: string; | ||
} |
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,9 @@ | ||
import { OptionDto } from "./option.dto"; | ||
|
||
|
||
export class MultipleChoiceOptionsDto { | ||
title: string; | ||
options: OptionDto[]; | ||
min: number; | ||
max: number; | ||
} |
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,7 @@ | ||
import { IsEmail, IsNotEmpty, Length, IsNotEmptyObject, IsObject } from "class-validator"; | ||
import { OptionDto } from "./option.dto"; | ||
|
||
export class OneChoiceOptionDto { | ||
title: string; | ||
options: OptionDto[]; | ||
} |
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,7 @@ | ||
import { IsEmail, IsNotEmpty, Length, IsNotEmptyObject, IsObject } from "class-validator"; | ||
|
||
export class OptionDto { | ||
title: string; | ||
description: string; | ||
value: number; | ||
} |
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,4 @@ | ||
import { PartialType } from '@nestjs/mapped-types'; | ||
import { CreatePlaceDto } from './create-place.dto'; | ||
|
||
export class UpdatePlaceDto extends PartialType(CreatePlaceDto) {} |
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,21 @@ | ||
export class Address { | ||
public constructor(init?:Partial<Address>) { | ||
Object.assign(this, init); | ||
} | ||
|
||
id: string; | ||
zipcode: number; | ||
street: string; | ||
number: string; | ||
complement: string; | ||
city: string; | ||
state: string; | ||
district: string; | ||
// | ||
// GoogleMaps | ||
completeByGeo: string; | ||
lat: number; | ||
lng: number; | ||
createdAt?: Date; | ||
updatedAt?: Date; | ||
} |
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,18 @@ | ||
import { IsEmail, IsNotEmpty, Length, IsNotEmptyObject, IsObject } from "class-validator"; | ||
import { MultipleChoiceOptions } from "./multiple-choice"; | ||
import { OneChoiceOption } from "./one-choice-option"; | ||
|
||
export class MenuSectionItem { | ||
public constructor(init?:Partial<MenuSectionItem>) { | ||
Object.assign(this, init); | ||
} | ||
|
||
id: string; | ||
sectionId: string; | ||
title: string; | ||
description: string; | ||
value: number; | ||
imageUrl: string; | ||
oneChoiceOptions: OneChoiceOption[]; | ||
multipleChoiceOptions: MultipleChoiceOptions[]; | ||
} |
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,13 @@ | ||
import { IsEmail, IsNotEmpty, Length, IsNotEmptyObject, IsObject } from "class-validator"; | ||
import { MenuSectionItem } from "./menu-section-item"; | ||
|
||
export class MenuSection { | ||
public constructor(init?:Partial<MenuSection>) { | ||
Object.assign(this, init); | ||
} | ||
|
||
id: string; | ||
placeId: string; | ||
title: string; | ||
itens: MenuSectionItem[]; | ||
} |
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,9 @@ | ||
import { Option } from "./option"; | ||
|
||
|
||
export class MultipleChoiceOptions { | ||
title: string; | ||
options: Option[]; | ||
min: number; | ||
max: number; | ||
} |
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,7 @@ | ||
import { IsEmail, IsNotEmpty, Length, IsNotEmptyObject, IsObject } from "class-validator"; | ||
import { Option } from "./option"; | ||
|
||
export class OneChoiceOption { | ||
title: string; | ||
options: Option[]; | ||
} |
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,7 @@ | ||
import { IsEmail, IsNotEmpty, Length, IsNotEmptyObject, IsObject } from "class-validator"; | ||
|
||
export class Option { | ||
title: string; | ||
description: string; | ||
value: number; | ||
} |
Oops, something went wrong.