-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #193 from Roger13579/dev
Dev
- Loading branch information
Showing
8 changed files
with
217 additions
and
14 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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Types } from 'mongoose'; | ||
import { ISellTicketReq } from '../../types/ticket.type'; | ||
import { IUser } from '../../models/user'; | ||
|
||
export class SellTicketDto { | ||
private readonly _userId: Types.ObjectId; | ||
private readonly _orderId: Types.ObjectId; | ||
private readonly _productId: Types.ObjectId; | ||
private readonly _sellAmount: number; | ||
|
||
get userId(): Types.ObjectId { | ||
return this._userId; | ||
} | ||
|
||
get orderId(): Types.ObjectId { | ||
return this._orderId; | ||
} | ||
|
||
get productId(): Types.ObjectId { | ||
return this._productId; | ||
} | ||
|
||
get sellAmount(): number { | ||
return this._sellAmount; | ||
} | ||
|
||
constructor(req: ISellTicketReq) { | ||
const { orderId, productId, amount } = req.body; | ||
this._userId = (req.user as IUser)._id as Types.ObjectId; | ||
this._orderId = new Types.ObjectId(orderId); | ||
this._productId = new Types.ObjectId(productId); | ||
this._sellAmount = amount; | ||
} | ||
} |
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