fix invoice number
This commit is contained in:
@@ -24,7 +24,7 @@ import { IAttachment } from 'src/modules/order/interface/order.interface';
|
||||
@Entity({ tableName: 'invoices' })
|
||||
@Index({ properties: ['user'] })
|
||||
export class Invoice extends BaseEntity {
|
||||
[OptionalProps]?: 'createdAt' | 'deletedAt'
|
||||
[OptionalProps]?: 'createdAt' | 'deletedAt' | 'invoiceNumber'
|
||||
|
||||
@PrimaryKey({ type: 'string', columnType: 'char(26)' })
|
||||
id: string = ulid()
|
||||
@@ -50,9 +50,10 @@ export class Invoice extends BaseEntity {
|
||||
|
||||
@Property({
|
||||
type: 'int',
|
||||
unique: true
|
||||
unique: true,
|
||||
autoincrement: true
|
||||
})
|
||||
invoiceNumber!: number | Opt;
|
||||
invoiceNumber: number & Opt;
|
||||
|
||||
|
||||
@Property({ type: 'int' })
|
||||
|
||||
@@ -64,7 +64,6 @@ export class InvoiceService {
|
||||
balance: 0,
|
||||
attachments: dto.attachments ?? [],
|
||||
paymentMethod: dto.paymentMethod,
|
||||
invoiceNumber: 20, // TODO : invoice number
|
||||
description: dto.description,
|
||||
subTotal: 0,
|
||||
taxAmount: 0,
|
||||
|
||||
@@ -80,7 +80,7 @@ export class RequestRepository extends EntityRepository<Request> {
|
||||
limit,
|
||||
offset,
|
||||
orderBy: { [orderBy]: order.toLowerCase() as 'asc' | 'desc' },
|
||||
populate: ['items', 'items.product', 'user'],
|
||||
populate: ['items', 'items.product', 'user','invoices'],
|
||||
});
|
||||
|
||||
const totalPages = Math.ceil(total / limit);
|
||||
|
||||
Reference in New Issue
Block a user