1
0
This commit is contained in:
Ahmed Bouhuolia
2026-03-26 18:04:33 +02:00
parent 8b59f28125
commit 2e90e3cc5b
12 changed files with 65 additions and 19 deletions
@@ -0,0 +1,12 @@
exports.up = function(knex) {
return knex.schema.alterTable('contacts', table => {
table.string('code').nullable().unique();
});
};
exports.down = function(knex) {
return knex.schema.alterTable('contacts', table => {
table.dropColumn('code');
});
};
@@ -155,4 +155,13 @@ export class CreateCustomerDto extends ContactAddressDto {
@IsOptional()
@IsBoolean()
active?: boolean;
@ApiProperty({
required: false,
description: 'Customer code',
example: 'CUST-001',
})
@IsOptional()
@IsString()
code?: string;
}
@@ -63,4 +63,9 @@ export class EditCustomerDto extends ContactAddressDto {
@IsOptional()
@IsBoolean()
active?: boolean;
@ApiProperty({ required: false, description: 'Customer code' })
@IsOptional()
@IsString()
code?: string;
}
@@ -70,6 +70,8 @@ export class Customer extends TenantBaseModel {
note: string;
active: boolean;
code?: string;
/**
* Query builder.
*/
@@ -32,6 +32,7 @@ export interface ICustomerNewDTO extends IContactAddressDTO {
note?: string;
active?: boolean;
code?: string;
}
export interface ICustomerEditDTO extends IContactAddressDTO {
@@ -50,6 +51,7 @@ export interface ICustomerEditDTO extends IContactAddressDTO {
note?: string;
active?: boolean;
code?: string;
}
export interface ICustomersFilter extends IDynamicListFilter {
@@ -115,4 +115,13 @@ export class CreateVendorDto extends ContactAddressDto {
@IsOptional()
@IsBoolean()
active?: boolean;
@ApiProperty({
required: false,
description: 'Vendor code',
example: 'VEND-001',
})
@IsOptional()
@IsString()
code?: string;
}
@@ -60,4 +60,9 @@ export class EditVendorDto extends ContactAddressDto {
@IsOptional()
@IsBoolean()
active?: boolean;
@ApiProperty({ required: false, description: 'Vendor code' })
@IsOptional()
@IsString()
code?: string;
}
@@ -71,6 +71,8 @@ export class Vendor extends TenantBaseModel {
note: string;
active: boolean;
code?: string;
/**
* Query builder.
*/
@@ -31,6 +31,7 @@ export interface IVendorNewDTO extends IContactAddressDTO {
note?: string;
active?: boolean;
code?: string;
}
export interface IVendorEditDTO extends IContactAddressDTO {
salutation?: string;
@@ -46,6 +47,7 @@ export interface IVendorEditDTO extends IContactAddressDTO {
note?: string;
active?: boolean;
code?: string;
}
export interface IVendorsFilter extends IDynamicListFilter {