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
58 changes: 39 additions & 19 deletions codbex-payments/codbex-payments.edm

Large diffs are not rendered by default.

898 changes: 754 additions & 144 deletions codbex-payments/codbex-payments.gen

Large diffs are not rendered by default.

462 changes: 377 additions & 85 deletions codbex-payments/codbex-payments.model

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class CustomerPaymentController {
const options: Options = {
limit: ctx.queryParameters["$limit"] ? parseInt(ctx.queryParameters["$limit"]) : 20,
offset: ctx.queryParameters["$offset"] ? parseInt(ctx.queryParameters["$offset"]) : 0,
language: request.getLocale().slice(0, 2)
language: request.getLocale().split("_")[0]
};

return this.repository.findAll(options);
Expand Down Expand Up @@ -98,7 +98,7 @@ class CustomerPaymentController {
this.checkPermissions('read');
const id = parseInt(ctx.pathParameters.id);
const options: Options = {
language: request.getLocale().slice(0, 2)
language: request.getLocale().split("_")[0]
};
const entity = this.repository.findById(id, options);
if (entity) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class EmployeePaymentController {
const options: Options = {
limit: ctx.queryParameters["$limit"] ? parseInt(ctx.queryParameters["$limit"]) : 20,
offset: ctx.queryParameters["$offset"] ? parseInt(ctx.queryParameters["$offset"]) : 0,
language: request.getLocale().slice(0, 2)
language: request.getLocale().split("_")[0]
};

return this.repository.findAll(options);
Expand Down Expand Up @@ -98,7 +98,7 @@ class EmployeePaymentController {
this.checkPermissions('read');
const id = parseInt(ctx.pathParameters.id);
const options: Options = {
language: request.getLocale().slice(0, 2)
language: request.getLocale().split("_")[0]
};
const entity = this.repository.findById(id, options);
if (entity) {
Expand Down Expand Up @@ -166,6 +166,9 @@ class EmployeePaymentController {
}

private validateEntity(entity: any): void {
if (entity.Employee === null || entity.Employee === undefined) {
throw new ValidationError(`The 'Employee' property is required, provide a valid value`);
}
if (entity.Date === null || entity.Date === undefined) {
throw new ValidationError(`The 'Date' property is required, provide a valid value`);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class PaymentAdjustmentController {
const options: Options = {
limit: ctx.queryParameters["$limit"] ? parseInt(ctx.queryParameters["$limit"]) : 20,
offset: ctx.queryParameters["$offset"] ? parseInt(ctx.queryParameters["$offset"]) : 0,
language: request.getLocale().slice(0, 2)
language: request.getLocale().split("_")[0]
};

return this.repository.findAll(options);
Expand Down Expand Up @@ -96,7 +96,7 @@ class PaymentAdjustmentController {
this.checkPermissions('read');
const id = parseInt(ctx.pathParameters.id);
const options: Options = {
language: request.getLocale().slice(0, 2)
language: request.getLocale().split("_")[0]
};
const entity = this.repository.findById(id, options);
if (entity) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class PaymentRecordController {
const options: Options = {
limit: ctx.queryParameters["$limit"] ? parseInt(ctx.queryParameters["$limit"]) : 20,
offset: ctx.queryParameters["$offset"] ? parseInt(ctx.queryParameters["$offset"]) : 0,
language: request.getLocale().slice(0, 2)
language: request.getLocale().split("_")[0]
};

return this.repository.findAll(options);
Expand Down Expand Up @@ -96,7 +96,7 @@ class PaymentRecordController {
this.checkPermissions('read');
const id = parseInt(ctx.pathParameters.id);
const options: Options = {
language: request.getLocale().slice(0, 2)
language: request.getLocale().split("_")[0]
};
const entity = this.repository.findById(id, options);
if (entity) {
Expand Down Expand Up @@ -191,6 +191,9 @@ class PaymentRecordController {
if (entity.Reference?.length > 36) {
throw new ValidationError(`The 'Reference' exceeds the maximum length of [36] characters`);
}
if (entity.DeletedReason?.length > 255) {
throw new ValidationError(`The 'DeletedReason' exceeds the maximum length of [255] characters`);
}
for (const next of validationModules) {
next.validate(entity);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class PaymentDirectionController {
const options: Options = {
limit: ctx.queryParameters["$limit"] ? parseInt(ctx.queryParameters["$limit"]) : 20,
offset: ctx.queryParameters["$offset"] ? parseInt(ctx.queryParameters["$offset"]) : 0,
language: request.getLocale().slice(0, 2)
language: request.getLocale().split("_")[0]
};

return this.repository.findAll(options);
Expand Down Expand Up @@ -88,7 +88,7 @@ class PaymentDirectionController {
try {
const id = parseInt(ctx.pathParameters.id);
const options: Options = {
language: request.getLocale().slice(0, 2)
language: request.getLocale().split("_")[0]
};
const entity = this.repository.findById(id, options);
if (entity) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class PaymentTypeController {
const options: Options = {
limit: ctx.queryParameters["$limit"] ? parseInt(ctx.queryParameters["$limit"]) : 20,
offset: ctx.queryParameters["$offset"] ? parseInt(ctx.queryParameters["$offset"]) : 0,
language: request.getLocale().slice(0, 2)
language: request.getLocale().split("_")[0]
};

return this.repository.findAll(options);
Expand Down Expand Up @@ -96,7 +96,7 @@ class PaymentTypeController {
this.checkPermissions('read');
const id = parseInt(ctx.pathParameters.id);
const options: Options = {
language: request.getLocale().slice(0, 2)
language: request.getLocale().split("_")[0]
};
const entity = this.repository.findById(id, options);
if (entity) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class SupplierPaymentController {
const options: Options = {
limit: ctx.queryParameters["$limit"] ? parseInt(ctx.queryParameters["$limit"]) : 20,
offset: ctx.queryParameters["$offset"] ? parseInt(ctx.queryParameters["$offset"]) : 0,
language: request.getLocale().slice(0, 2)
language: request.getLocale().split("_")[0]
};

return this.repository.findAll(options);
Expand Down Expand Up @@ -98,7 +98,7 @@ class SupplierPaymentController {
this.checkPermissions('read');
const id = parseInt(ctx.pathParameters.id);
const options: Options = {
language: request.getLocale().slice(0, 2)
language: request.getLocale().split("_")[0]
};
const entity = this.repository.findById(id, options);
if (entity) {
Expand Down Expand Up @@ -166,6 +166,9 @@ class SupplierPaymentController {
}

private validateEntity(entity: any): void {
if (entity.Supplier === null || entity.Supplier === undefined) {
throw new ValidationError(`The 'Supplier' property is required, provide a valid value`);
}
if (entity.Date === null || entity.Date === undefined) {
throw new ValidationError(`The 'Date' property is required, provide a valid value`);
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { NumberGeneratorService } from "/codbex-number-generator/service/generat

export interface CustomerPaymentEntity {
readonly Id: number;
Customer?: number;
Customer: number;
Date: Date;
Valor: Date;
CompanyIBAN?: string;
Expand All @@ -26,7 +26,7 @@ export interface CustomerPaymentEntity {
}

export interface CustomerPaymentCreateEntity {
readonly Customer?: number;
readonly Customer: number;
readonly Date: Date;
readonly Valor: Date;
readonly CompanyIBAN?: string;
Expand Down Expand Up @@ -213,6 +213,7 @@ export class CustomerPaymentRepository {
name: "Customer",
column: "CUSTOMERPAYMENT_CUSTOMER",
type: "INTEGER",
required: true
},
{
name: "Date",
Expand Down
Loading
Loading