Skip to content

Commit

Permalink
Merge pull request #305 from Roger13579/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Roger13579 authored Jun 28, 2024
2 parents d35b625 + 46075f8 commit ed241bd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/models/order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const { userId, productId, plan } = schemaDef;

const schema = new Schema<IOrder>(
{
thirdPartyPaymentId: { type: String },
thirdPartyPaymentId: { type: String, default: '' },
userId,
products: {
type: [
Expand Down Expand Up @@ -61,6 +61,7 @@ const schema = new Schema<IOrder>(
},
paidAt: {
type: Date,
default: '',
},
deliveryInfo: {
type: {
Expand Down
11 changes: 11 additions & 0 deletions src/types/order.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { IUserReq, TPaginationQuery } from './common.type';
import { IPlan, IProductId } from './product.type';
import { IProduct } from '../models/product';
import { Types } from 'mongoose';
import { IOrder } from '../models/order';

export enum PaymentMethod {
linePay = 'linePay',
Expand Down Expand Up @@ -105,3 +106,13 @@ export interface IUpdateOrderParam extends IOrderId {
export interface INewebPayCheckOrderReq extends IUserReq {
body: { TradeInfo: string; TradeSha: unknown };
}

export interface IGetOrderParam extends IOrder {
thirdPartyPaymentId: string;
paidAt: Date;
}

export type OrderDocumentWithPayment = Document &
IGetOrderParam & {
_id: Types.ObjectId;
};

0 comments on commit ed241bd

Please sign in to comment.