Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion codbex-partners/codbex-partners.edm

Large diffs are not rendered by default.

1,212 changes: 1,116 additions & 96 deletions codbex-partners/codbex-partners.gen

Large diffs are not rendered by default.

393 changes: 393 additions & 0 deletions codbex-partners/codbex-partners.model

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ class CustomerContactController {
if (entity.Phone?.length > 15) {
throw new ValidationError(`The 'Phone' exceeds the maximum length of [15] characters`);
}
if (entity.CreatedBy?.length > 20) {
throw new ValidationError(`The 'CreatedBy' exceeds the maximum length of [20] characters`);
}
for (const next of validationModules) {
next.validate(entity);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,12 @@ class CustomerController {
if (entity.Identifier?.length > 36) {
throw new ValidationError(`The 'Identifier' exceeds the maximum length of [36] characters`);
}
if (entity.CreatedBy?.length > 20) {
throw new ValidationError(`The 'CreatedBy' exceeds the maximum length of [20] characters`);
}
if (entity.UpdatedBy?.length > 20) {
throw new ValidationError(`The 'UpdatedBy' exceeds the maximum length of [20] characters`);
}
for (const next of validationModules) {
next.validate(entity);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ class CustomerNoteController {
if (entity.Note?.length > 5000) {
throw new ValidationError(`The 'Note' exceeds the maximum length of [5000] characters`);
}
if (entity.CreatedBy?.length > 20) {
throw new ValidationError(`The 'CreatedBy' exceeds the maximum length of [20] characters`);
}
if (entity.UpdatedBy?.length > 20) {
throw new ValidationError(`The 'UpdatedBy' exceeds the maximum length of [20] characters`);
}
for (const next of validationModules) {
next.validate(entity);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ class ManufacturerContactController {
if (entity.Phone?.length > 15) {
throw new ValidationError(`The 'Phone' exceeds the maximum length of [15] characters`);
}
if (entity.CreatedBy?.length > 20) {
throw new ValidationError(`The 'CreatedBy' exceeds the maximum length of [20] characters`);
}
for (const next of validationModules) {
next.validate(entity);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,12 @@ class ManufacturerController {
if (!RegExp(/^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$/).test(entity.IBAN)) {
throw new ValidationError(`The value provided for the 'IBAN' property ('[${entity.IBAN}]') doesn't match the required pattern '^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$'`);
}
if (entity.CreatedBy?.length > 20) {
throw new ValidationError(`The 'CreatedBy' exceeds the maximum length of [20] characters`);
}
if (entity.UpdatedBy?.length > 20) {
throw new ValidationError(`The 'UpdatedBy' exceeds the maximum length of [20] characters`);
}
for (const next of validationModules) {
next.validate(entity);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ class ManufacturerNoteController {
if (entity.Note?.length > 5000) {
throw new ValidationError(`The 'Note' exceeds the maximum length of [5000] characters`);
}
if (entity.CreatedBy?.length > 20) {
throw new ValidationError(`The 'CreatedBy' exceeds the maximum length of [20] characters`);
}
if (entity.UpdatedBy?.length > 20) {
throw new ValidationError(`The 'UpdatedBy' exceeds the maximum length of [20] characters`);
}
for (const next of validationModules) {
next.validate(entity);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ class SupplierContactController {
if (entity.Phone?.length > 15) {
throw new ValidationError(`The 'Phone' exceeds the maximum length of [15] characters`);
}
if (entity.CreatedBy?.length > 20) {
throw new ValidationError(`The 'CreatedBy' exceeds the maximum length of [20] characters`);
}
for (const next of validationModules) {
next.validate(entity);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,12 @@ class SupplierController {
if (!RegExp(/^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$/).test(entity.IBAN)) {
throw new ValidationError(`The value provided for the 'IBAN' property ('[${entity.IBAN}]') doesn't match the required pattern '^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$'`);
}
if (entity.CreatedBy?.length > 20) {
throw new ValidationError(`The 'CreatedBy' exceeds the maximum length of [20] characters`);
}
if (entity.UpdatedBy?.length > 20) {
throw new ValidationError(`The 'UpdatedBy' exceeds the maximum length of [20] characters`);
}
for (const next of validationModules) {
next.validate(entity);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ class SupplierNoteController {
if (entity.Note?.length > 5000) {
throw new ValidationError(`The 'Note' exceeds the maximum length of [5000] characters`);
}
if (entity.CreatedBy?.length > 20) {
throw new ValidationError(`The 'CreatedBy' exceeds the maximum length of [20] characters`);
}
if (entity.UpdatedBy?.length > 20) {
throw new ValidationError(`The 'UpdatedBy' exceeds the maximum length of [20] characters`);
}
for (const next of validationModules) {
next.validate(entity);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,25 @@ export class CustomerContactEntity {
})
public Phone!: string;

@Documentation('CreatedAt')
@Column({
name: 'CUSTOMERCONTACT_CREATEDAT',
type: 'timestamp',
nullable: true,
})
@CreatedAt()
public CreatedAt?: Date;

@Documentation('CreatedBy')
@Column({
name: 'CUSTOMERCONTACT_CREATEDBY',
type: 'string',
length: 20,
nullable: true,
})
@CreatedBy()
public CreatedBy?: string;

}

(new CustomerContactEntity());
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,22 @@ export class CustomerContactRepository extends Repository<CustomerContactEntity>
super((CustomerContactEntity as EntityConstructor));
}

public override findById(id: string | number, options?: Options): CustomerContactEntity | undefined {
const entity = super.findById(id, options);
if (entity) {
entity.CreatedAt = entity.CreatedAt ? new Date(entity.CreatedAt) : undefined;
}
return entity;
}

public override findAll(options?: Options): CustomerContactEntity[] {
const entities = super.findAll(options);
entities.forEach(entity => {
entity.CreatedAt = entity.CreatedAt ? new Date(entity.CreatedAt) : undefined;
});
return entities;
}

protected override async triggerEvent(data: EntityEvent<CustomerContactEntity>): Promise<void> {
const triggerExtensions = await Extensions.loadExtensionModules('codbex-partners-Customers-CustomerContact', ['trigger']);
triggerExtensions.forEach(triggerExtension => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,35 @@ export class CustomerEntity {
@CreatedAt()
public CreatedAt?: Date;

@Documentation('CreatedBy')
@Column({
name: 'CUSTOMER_CREATEDBY',
type: 'string',
length: 20,
nullable: true,
})
@CreatedBy()
public CreatedBy?: string;

@Documentation('UpdatedAt')
@Column({
name: 'CUSTOMER_UPDATEDAT',
type: 'timestamp',
nullable: true,
})
@UpdatedAt()
public UpdatedAt?: Date;

@Documentation('UpdatedBy')
@Column({
name: 'CUSTOMER_UPDATEDBY',
type: 'string',
length: 20,
nullable: true,
})
@UpdatedBy()
public UpdatedBy?: string;

}

(new CustomerEntity());
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,44 @@ export class CustomerNoteEntity {
})
public Note!: string;

@Documentation('CreatedAt')
@Column({
name: 'CUSTOMERNOTE_CREATEDAT',
type: 'timestamp',
nullable: true,
})
@CreatedAt()
public CreatedAt?: Date;

@Documentation('CreatedBy')
@Column({
name: 'CUSTOMERNOTE_CREATEDBY',
type: 'string',
length: 20,
nullable: true,
})
@CreatedBy()
public CreatedBy?: string;

@Documentation('UpdatedAt')
@Column({
name: 'CUSTOMERNOTE_UPDATEDAT',
type: 'timestamp',
nullable: true,
})
@UpdatedAt()
public UpdatedAt?: Date;

@Documentation('UpdatedBy')
@Column({
name: 'CUSTOMERNOTE_UPDATEDBY',
type: 'string',
length: 20,
nullable: true,
})
@UpdatedBy()
public UpdatedBy?: string;

}

(new CustomerNoteEntity());
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,24 @@ export class CustomerNoteRepository extends Repository<CustomerNoteEntity> {
super((CustomerNoteEntity as EntityConstructor));
}

public override findById(id: string | number, options?: Options): CustomerNoteEntity | undefined {
const entity = super.findById(id, options);
if (entity) {
entity.CreatedAt = entity.CreatedAt ? new Date(entity.CreatedAt) : undefined;
entity.UpdatedAt = entity.UpdatedAt ? new Date(entity.UpdatedAt) : undefined;
}
return entity;
}

public override findAll(options?: Options): CustomerNoteEntity[] {
const entities = super.findAll(options);
entities.forEach(entity => {
entity.CreatedAt = entity.CreatedAt ? new Date(entity.CreatedAt) : undefined;
entity.UpdatedAt = entity.UpdatedAt ? new Date(entity.UpdatedAt) : undefined;
});
return entities;
}

protected override async triggerEvent(data: EntityEvent<CustomerNoteEntity>): Promise<void> {
const triggerExtensions = await Extensions.loadExtensionModules('codbex-partners-Customers-CustomerNote', ['trigger']);
triggerExtensions.forEach(triggerExtension => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export class CustomerRepository extends Repository<CustomerEntity> {
const entity = super.findById(id, options);
if (entity) {
entity.CreatedAt = entity.CreatedAt ? new Date(entity.CreatedAt) : undefined;
entity.UpdatedAt = entity.UpdatedAt ? new Date(entity.UpdatedAt) : undefined;
}
return entity;
}
Expand All @@ -23,6 +24,7 @@ export class CustomerRepository extends Repository<CustomerEntity> {
const entities = super.findAll(options);
entities.forEach(entity => {
entity.CreatedAt = entity.CreatedAt ? new Date(entity.CreatedAt) : undefined;
entity.UpdatedAt = entity.UpdatedAt ? new Date(entity.UpdatedAt) : undefined;
});
return entities;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,25 @@ export class ManufacturerContactEntity {
})
public Phone!: string;

@Documentation('CreatedAt')
@Column({
name: 'MANUFACTURERCONTACT_CREATEDAT',
type: 'timestamp',
nullable: true,
})
@CreatedAt()
public CreatedAt?: Date;

@Documentation('CreatedBy')
@Column({
name: 'MANUFACTURERCONTACT_CREATEDBY',
type: 'string',
length: 20,
nullable: true,
})
@CreatedBy()
public CreatedBy?: string;

}

(new ManufacturerContactEntity());
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,22 @@ export class ManufacturerContactRepository extends Repository<ManufacturerContac
super((ManufacturerContactEntity as EntityConstructor));
}

public override findById(id: string | number, options?: Options): ManufacturerContactEntity | undefined {
const entity = super.findById(id, options);
if (entity) {
entity.CreatedAt = entity.CreatedAt ? new Date(entity.CreatedAt) : undefined;
}
return entity;
}

public override findAll(options?: Options): ManufacturerContactEntity[] {
const entities = super.findAll(options);
entities.forEach(entity => {
entity.CreatedAt = entity.CreatedAt ? new Date(entity.CreatedAt) : undefined;
});
return entities;
}

protected override async triggerEvent(data: EntityEvent<ManufacturerContactEntity>): Promise<void> {
const triggerExtensions = await Extensions.loadExtensionModules('codbex-partners-Manufacturers-ManufacturerContact', ['trigger']);
triggerExtensions.forEach(triggerExtension => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,35 @@ export class ManufacturerEntity {
@CreatedAt()
public CreatedAt?: Date;

@Documentation('CreatedBy')
@Column({
name: 'MANUFACTURER_CREATEDBY',
type: 'string',
length: 20,
nullable: true,
})
@CreatedBy()
public CreatedBy?: string;

@Documentation('UpdatedAt')
@Column({
name: 'MANUFACTURER_UPDATEDAT',
type: 'timestamp',
nullable: true,
})
@UpdatedAt()
public UpdatedAt?: Date;

@Documentation('UpdatedBy')
@Column({
name: 'MANUFACTURER_UPDATEDBY',
type: 'string',
length: 20,
nullable: true,
})
@UpdatedBy()
public UpdatedBy?: string;

}

(new ManufacturerEntity());
Loading
Loading