Skip to content

Commit

Permalink
[feat] add detail for address
Browse files Browse the repository at this point in the history
  • Loading branch information
erik1110 committed Jan 27, 2024
1 parent 1828905 commit 13d5a4b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/features/user/dto/address.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ export class AddressDto {
@IsIn(zipCodeList, { message: 'Invalid Zip Code' })
zipcode: number;

@ApiProperty({
example: '民生東路五段117號3F',
description: 'Detail',
})
@IsNotEmpty({ message: 'Detail is Null' })
detail: string;

@ApiProperty({
example: '中正區',
description: 'County',
Expand Down
1 change: 1 addition & 0 deletions src/features/user/interfaces/user.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface IUser extends Document {
zipcode: number;
county: string;
city: string;
detail: string;
};
verificationToken: string;
loginAttempts?: number;
Expand Down
2 changes: 2 additions & 0 deletions src/features/user/schemas/user.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ export class User extends Document implements IUser {
zipcode: { type: Number, required: [true, 'zipcode 未填寫'] },
county: { type: String, required: [true, 'county 未填寫'] },
city: { type: String, required: [true, 'city 未填寫'] },
detail: { type: String, required: [true, 'detail 未填寫'] },
}),
)
address: {
zipcode: number;
county: string;
city: string;
detail: string;
};
@Prop({ type: String, default: '', select: false })
verificationToken: string;
Expand Down

0 comments on commit 13d5a4b

Please sign in to comment.