forked from yoone/API
1
0
Fork 0
API/src/entity/order_retund_item.entity.ts

112 lines
2.0 KiB
TypeScript

import { ApiProperty } from '@midwayjs/swagger';
import { Exclude, Expose } from 'class-transformer';
import {
Column,
CreateDateColumn,
Entity,
PrimaryGeneratedColumn,
UpdateDateColumn,
} from 'typeorm';
@Entity('order_refund_item')
@Exclude()
export class OrderRefundItem {
@ApiProperty()
@PrimaryGeneratedColumn()
@Expose()
id?: number;
@ApiProperty()
@Column()
@Expose()
refundId: number; // 订单 refund ID
@ApiProperty()
@Column()
@Expose()
siteId: string; // 来源站点唯一标识
@ApiProperty()
@Column()
@Expose()
externalRefundId: string; // WooCommerce refund ID
@ApiProperty()
@Column()
@Expose()
externalRefundItemId: string; // WooCommerce refund item ID
@ApiProperty()
@Column()
@Expose()
externalProductId: string; // WooCommerce 产品 ID
@ApiProperty()
@Column()
@Expose()
externalVariationId: string; // WooCommerce 变体 ID
@ApiProperty()
@Column()
@Expose()
name: string;
@ApiProperty()
@Column()
@Expose()
quantity: number;
@ApiProperty()
@Column()
@Expose()
tax_class: string;
@ApiProperty()
@Column('decimal', { precision: 10, scale: 2 })
@Expose()
subtotal: number;
@ApiProperty()
@Column('decimal', { precision: 10, scale: 2 })
@Expose()
subtotal_tax: number;
@ApiProperty()
@Column('decimal', { precision: 10, scale: 2 })
@Expose()
total: number;
@ApiProperty()
@Column('decimal', { precision: 10, scale: 2 })
@Expose()
total_tax: number;
@ApiProperty()
@Column({ nullable: true })
@Expose()
sku?: string;
@ApiProperty()
@Column('decimal', { precision: 10, scale: 2 })
@Expose()
price: number;
@ApiProperty({
example: '2022-12-12 11:11:11',
description: '创建时间',
required: true,
})
@CreateDateColumn()
@Expose()
createdAt?: Date;
@ApiProperty({
example: '2022-12-12 11:11:11',
description: '更新时间',
required: true,
})
@UpdateDateColumn()
@Expose()
updatedAt?: Date;
}