{{ 'codbex-payments:codbex-payments-model.t.PAYMENTRECORD_UUID' | t }}
diff --git a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-print/controller.js b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-print/controller.js
index bf19960..91f1a9d 100644
--- a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-print/controller.js
+++ b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-print/controller.js
@@ -1,6 +1,6 @@
angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntityService'])
.config(['EntityServiceProvider', (EntityServiceProvider) => {
- EntityServiceProvider.baseUrl = '/services/ts/codbex-payments/gen/codbex-payments/api/PaymentRecord/PaymentRecordController.ts';
+ EntityServiceProvider.baseUrl = '/services/java/codbex-payments/gen/codbex_payments/api/paymentrecord/PaymentRecordController';
}])
.controller('PageController', ($scope, EntityService, LocaleService, ViewParameters) => {
const Dialogs = new DialogHub();
@@ -52,6 +52,10 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
const condition = { propertyName: 'Amount', operator: 'EQ', value: entity.Amount };
filter.$filter.conditions.push(condition);
}
+ if (entity.Company !== undefined) {
+ const condition = { propertyName: 'Company', operator: 'EQ', value: entity.Company };
+ filter.$filter.conditions.push(condition);
+ }
if (entity.Currency !== undefined) {
const condition = { propertyName: 'Currency', operator: 'EQ', value: entity.Currency };
filter.$filter.conditions.push(condition);
@@ -72,10 +76,6 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
const condition = { propertyName: 'Description', operator: 'LIKE', value: `%${entity.Description}%` };
filter.$filter.conditions.push(condition);
}
- if (entity.Company !== undefined) {
- const condition = { propertyName: 'Company', operator: 'EQ', value: entity.Company };
- filter.$filter.conditions.push(condition);
- }
if (entity.UUID) {
const condition = { propertyName: 'UUID', operator: 'LIKE', value: `%${entity.UUID}%` };
filter.$filter.conditions.push(condition);
@@ -127,10 +127,10 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
$scope.filter = filter;
+ $scope.optionsCompany = params.optionsCompany;
$scope.optionsCurrency = params.optionsCurrency;
$scope.optionsPaymentDirection = params.optionsPaymentDirection;
$scope.optionsPaymentType = params.optionsPaymentType;
- $scope.optionsCompany = params.optionsCompany;
}
$scope.loadPage = (filter) => {
@@ -178,6 +178,14 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
};
$scope.loadPage($scope.filter);
+ $scope.optionsCompanyValue = (optionKey) => {
+ for (let i = 0; i < $scope.optionsCompany.length; i++) {
+ if ($scope.optionsCompany[i].value === optionKey) {
+ return $scope.optionsCompany[i].text;
+ }
+ }
+ return null;
+ };
$scope.optionsCurrencyValue = (optionKey) => {
for (let i = 0; i < $scope.optionsCurrency.length; i++) {
if ($scope.optionsCurrency[i].value === optionKey) {
@@ -202,14 +210,6 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
}
return null;
};
- $scope.optionsCompanyValue = (optionKey) => {
- for (let i = 0; i < $scope.optionsCompany.length; i++) {
- if ($scope.optionsCompany[i].value === optionKey) {
- return $scope.optionsCompany[i].text;
- }
- }
- return null;
- };
window.onafterprint = () => {
Dialogs.closeWindow({ path: viewData.path });
}
diff --git a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-print/index.html b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-print/index.html
index 5703623..a01d3f8 100644
--- a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-print/index.html
+++ b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-print/index.html
@@ -26,12 +26,12 @@
{{ 'codbex-payments:codbex-payments-model.t.PAYMENTRECORD_COUNTERPARTYIBAN' | t:'CounterpartyIBAN' }} |
{{ 'codbex-payments:codbex-payments-model.t.PAYMENTRECORD_COUNTERPARTYNAME' | t:'CounterpartyName' }} |
{{ 'codbex-payments:codbex-payments-model.t.PAYMENTRECORD_AMOUNT' | t:'Amount' }} |
+
{{ 'codbex-payments:codbex-payments-model.t.PAYMENTRECORD_COMPANY' | t:'Company' }} |
{{ 'codbex-payments:codbex-payments-model.t.PAYMENTRECORD_CURRENCY' | t:'Currency' }} |
{{ 'codbex-payments:codbex-payments-model.t.PAYMENTRECORD_PAYMENTDIRECTION' | t:'PaymentDirection' }} |
{{ 'codbex-payments:codbex-payments-model.t.PAYMENTRECORD_PAYMENTTYPE' | t:'PaymentType' }} |
{{ 'codbex-payments:codbex-payments-model.t.PAYMENTRECORD_REASON' | t:'Reason' }} |
{{ 'codbex-payments:codbex-payments-model.t.PAYMENTRECORD_DESCRIPTION' | t:'Description' }} |
-
{{ 'codbex-payments:codbex-payments-model.t.PAYMENTRECORD_COMPANY' | t:'Company' }} |
{{ 'codbex-payments:codbex-payments-model.t.PAYMENTRECORD_UUID' | t:'UUID' }} |
{{ 'codbex-payments:codbex-payments-model.t.PAYMENTRECORD_REFERENCE' | t:'Reference' }} |
{{ 'codbex-payments:codbex-payments-model.t.PAYMENTRECORD_DELETED' | t:'Deleted' }} |
@@ -58,12 +58,12 @@
{{next.CounterpartyIBAN}} |
{{next.CounterpartyName}} |
{{next.Amount}} |
+
{{optionsCompanyValue(next.Company)}} |
{{optionsCurrencyValue(next.Currency)}} |
{{optionsPaymentDirectionValue(next.PaymentDirection)}} |
{{optionsPaymentTypeValue(next.PaymentType)}} |
{{next.Reason}} |
{{next.Description}} |
-
{{optionsCompanyValue(next.Company)}} |
{{next.UUID}} |
{{next.Reference}} |
diff --git a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-window/controller.js b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-window/controller.js
index cfa3989..9568936 100644
--- a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-window/controller.js
+++ b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-window/controller.js
@@ -21,9 +21,9 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale']).controlle
params.entity.UpdatedAt = new Date(params.entity.UpdatedAt);
}
$scope.entity = params.entity;
+ $scope.optionsCompany = params.optionsCompany;
$scope.optionsCurrency = params.optionsCurrency;
$scope.optionsPaymentDirection = params.optionsPaymentDirection;
$scope.optionsPaymentType = params.optionsPaymentType;
- $scope.optionsCompany = params.optionsCompany;
}
});
\ No newline at end of file
diff --git a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-window/index.html b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-window/index.html
index 8a9c118..986b187 100644
--- a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-window/index.html
+++ b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/dialog-window/index.html
@@ -103,6 +103,22 @@
+
+
+ {{ 'codbex-payments:codbex-payments-model.t.PAYMENTRECORD_COMPANY' | t }}
+
+
+
+
+
+
{{ 'codbex-payments:codbex-payments-model.t.PAYMENTRECORD_CURRENCY' | t }}
@@ -181,22 +197,6 @@
-
-
- {{ 'codbex-payments:codbex-payments-model.t.PAYMENTRECORD_COMPANY' | t }}
-
-
-
-
-
-
{{ 'codbex-payments:codbex-payments-model.t.PAYMENTRECORD_UUID' | t }}
diff --git a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/index.html b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/index.html
index e340fa8..7de046b 100644
--- a/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/index.html
+++ b/codbex-payments/gen/codbex-payments/ui/Reports/PaymentRecord/index.html
@@ -30,12 +30,12 @@
{{ 'codbex-payments:codbex-payments-model.t.PAYMENTRECORD_COUNTERPARTYIBAN' | t:'CounterpartyIBAN' }} |
{{ 'codbex-payments:codbex-payments-model.t.PAYMENTRECORD_COUNTERPARTYNAME' | t:'CounterpartyName' }} |
{{ 'codbex-payments:codbex-payments-model.t.PAYMENTRECORD_AMOUNT' | t:'Amount' }} |
+ {{ 'codbex-payments:codbex-payments-model.t.PAYMENTRECORD_COMPANY' | t:'Company' }} |
{{ 'codbex-payments:codbex-payments-model.t.PAYMENTRECORD_CURRENCY' | t:'Currency' }} |
{{ 'codbex-payments:codbex-payments-model.t.PAYMENTRECORD_PAYMENTDIRECTION' | t:'PaymentDirection' }} |
{{ 'codbex-payments:codbex-payments-model.t.PAYMENTRECORD_PAYMENTTYPE' | t:'PaymentType' }} |
{{ 'codbex-payments:codbex-payments-model.t.PAYMENTRECORD_REASON' | t:'Reason' }} |
{{ 'codbex-payments:codbex-payments-model.t.PAYMENTRECORD_DESCRIPTION' | t:'Description' }} |
- {{ 'codbex-payments:codbex-payments-model.t.PAYMENTRECORD_COMPANY' | t:'Company' }} |
{{ 'codbex-payments:codbex-payments-model.t.PAYMENTRECORD_UUID' | t:'UUID' }} |
{{ 'codbex-payments:codbex-payments-model.t.PAYMENTRECORD_REFERENCE' | t:'Reference' }} |
{{ 'codbex-payments:codbex-payments-model.t.PAYMENTRECORD_DELETED' | t:'Deleted' }} |
@@ -64,6 +64,9 @@
{{next.CounterpartyIBAN}} |
{{next.CounterpartyName}} |
{{next.Amount}} |
+
+ {{optionsCompanyValue(next.Company)}}
+ |
{{optionsCurrencyValue(next.Currency)}}
|
@@ -75,9 +78,6 @@
|
{{next.Reason}} |
{{next.Description}} |
-
- {{optionsCompanyValue(next.Company)}}
- |
{{next.UUID}} |
{{next.Reference}} |
diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentDirection/controller.js b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentDirection/controller.js
index 82ee113..e05dfdb 100644
--- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentDirection/controller.js
+++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentDirection/controller.js
@@ -1,6 +1,6 @@
angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntityService'])
.config(['EntityServiceProvider', (EntityServiceProvider) => {
- EntityServiceProvider.baseUrl = '/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentDirectionController.ts';
+ EntityServiceProvider.baseUrl = '/services/java/codbex-payments/gen/codbex_payments/api/settings/PaymentDirectionController';
}])
.controller('PageController', ($scope, EntityService, Extensions, LocaleService, ButtonStates) => {
const Dialogs = new DialogHub();
diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentDirection/dialog-window/controller.js b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentDirection/dialog-window/controller.js
index f7b68dc..606276f 100644
--- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentDirection/dialog-window/controller.js
+++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentDirection/dialog-window/controller.js
@@ -1,6 +1,6 @@
angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntityService'])
.config(['EntityServiceProvider', (EntityServiceProvider) => {
- EntityServiceProvider.baseUrl = '/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentDirectionController.ts';
+ EntityServiceProvider.baseUrl = '/services/java/codbex-payments/gen/codbex_payments/api/settings/PaymentDirectionController';
}])
.controller('PageController', ($scope, $http, ViewParameters, LocaleService, EntityService) => {
const Dialogs = new DialogHub();
diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/controller.js b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/controller.js
index db3699f..0f5e2cc 100644
--- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/controller.js
+++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/controller.js
@@ -1,6 +1,6 @@
angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntityService'])
.config(['EntityServiceProvider', (EntityServiceProvider) => {
- EntityServiceProvider.baseUrl = '/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentTypeController.ts';
+ EntityServiceProvider.baseUrl = '/services/java/codbex-payments/gen/codbex_payments/api/settings/PaymentTypeController';
}])
.controller('PageController', ($scope, EntityService, Extensions, LocaleService, ButtonStates) => {
const Dialogs = new DialogHub();
diff --git a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-window/controller.js b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-window/controller.js
index a7433c5..d4b1ba4 100644
--- a/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-window/controller.js
+++ b/codbex-payments/gen/codbex-payments/ui/Settings/PaymentType/dialog-window/controller.js
@@ -1,6 +1,6 @@
angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntityService'])
.config(['EntityServiceProvider', (EntityServiceProvider) => {
- EntityServiceProvider.baseUrl = '/services/ts/codbex-payments/gen/codbex-payments/api/Settings/PaymentTypeController.ts';
+ EntityServiceProvider.baseUrl = '/services/java/codbex-payments/gen/codbex_payments/api/settings/PaymentTypeController';
}])
.controller('PageController', ($scope, $http, ViewParameters, LocaleService, EntityService) => {
const Dialogs = new DialogHub();
diff --git a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/controller.js b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/controller.js
index 2746552..72cf60d 100644
--- a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/controller.js
+++ b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/controller.js
@@ -1,6 +1,6 @@
angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntityService'])
.config(['EntityServiceProvider', (EntityServiceProvider) => {
- EntityServiceProvider.baseUrl = '/services/ts/codbex-payments/gen/codbex-payments/api/SupplierPayment/SupplierPaymentController.ts';
+ EntityServiceProvider.baseUrl = '/services/java/codbex-payments/gen/codbex_payments/api/supplierpayment/SupplierPaymentController';
}])
.controller('PageController', ($scope, $http, EntityService, Extensions, LocaleService, ButtonStates) => {
const Dialogs = new DialogHub();
@@ -105,7 +105,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
if (optionsSupplierHasMore) {
const optionsSupplierSearchValues = Array.from(new Set(response.data.map(e => e.Supplier)));
if (optionsSupplierSearchValues.length > 0) {
- $http.post('/services/ts/codbex-partners/gen/codbex-partners/api/Suppliers/SupplierController.ts/search', {
+ $http.post('/services/java/codbex-partners/gen/codbex_partners/api/suppliers/SupplierController/search', {
conditions: [
{ propertyName: 'Id', operator: 'IN', value: optionsSupplierSearchValues }
]
@@ -128,7 +128,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
if (optionsCurrencyHasMore) {
const optionsCurrencySearchValues = Array.from(new Set(response.data.map(e => e.Currency)));
if (optionsCurrencySearchValues.length > 0) {
- $http.post('/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyController.ts/search', {
+ $http.post('/services/java/codbex-currencies/gen/codbex_currencies/api/settings/CurrencyController/search', {
conditions: [
{ propertyName: 'Id', operator: 'IN', value: optionsCurrencySearchValues }
]
@@ -151,7 +151,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
if (optionsCompanyHasMore) {
const optionsCompanySearchValues = Array.from(new Set(response.data.map(e => e.Company)));
if (optionsCompanySearchValues.length > 0) {
- $http.post('/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyController.ts/search', {
+ $http.post('/services/java/codbex-companies/gen/codbex_companies/api/companies/CompanyController/search', {
conditions: [
{ propertyName: 'Id', operator: 'IN', value: optionsCompanySearchValues }
]
@@ -171,6 +171,29 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
});
}
}
+ if (optionsPaymentMethodHasMore) {
+ const optionsPaymentMethodSearchValues = Array.from(new Set(response.data.map(e => e.PaymentMethod)));
+ if (optionsPaymentMethodSearchValues.length > 0) {
+ $http.post('/services/java/codbex-methods/gen/codbex_methods/api/settings/PaymentMethodController/search', {
+ conditions: [
+ { propertyName: 'Id', operator: 'IN', value: optionsPaymentMethodSearchValues }
+ ]
+ }).then((response) => {
+ $scope.optionsPaymentMethod.push(...response.data.map(e => ({
+ value: e.Id,
+ text: e.Name
+ })));
+ }, (error) => {
+ console.error(error);
+ const message = error.data ? error.data.message : '';
+ Dialogs.showAlert({
+ title: 'PaymentMethod',
+ message: LocaleService.t('codbex-payments:codbex-payments-model.messages.error.unableToLoad', { message: message }),
+ type: AlertTypes.Error
+ });
+ });
+ }
+ }
response.data.forEach(e => {
if (e.Date) {
e.Date = new Date(e.Date);
@@ -217,6 +240,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
optionsSupplier: $scope.optionsSupplier,
optionsCurrency: $scope.optionsCurrency,
optionsCompany: $scope.optionsCompany,
+ optionsPaymentMethod: $scope.optionsPaymentMethod,
}});
};
@@ -229,6 +253,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
optionsSupplier: $scope.optionsSupplier,
optionsCurrency: $scope.optionsCurrency,
optionsCompany: $scope.optionsCompany,
+ optionsPaymentMethod: $scope.optionsPaymentMethod,
}});
};
@@ -239,6 +264,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
optionsSupplier: $scope.optionsSupplier,
optionsCurrency: $scope.optionsCurrency,
optionsCompany: $scope.optionsCompany,
+ optionsPaymentMethod: $scope.optionsPaymentMethod,
}});
};
@@ -283,6 +309,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
optionsSupplier: $scope.optionsSupplier,
optionsCurrency: $scope.optionsCurrency,
optionsCompany: $scope.optionsCompany,
+ optionsPaymentMethod: $scope.optionsPaymentMethod,
},
});
};
@@ -291,12 +318,13 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
$scope.optionsSupplier = [];
$scope.optionsCurrency = [];
$scope.optionsCompany = [];
+ $scope.optionsPaymentMethod = [];
let optionsSupplierHasMore = true;
- $http.get('/services/ts/codbex-partners/gen/codbex-partners/api/Suppliers/SupplierController.ts/count').then((response) => {
+ $http.get('/services/java/codbex-partners/gen/codbex_partners/api/suppliers/SupplierController/count').then((response) => {
const optionsSupplierCount = response.data.count;
- $http.get('/services/ts/codbex-partners/gen/codbex-partners/api/Suppliers/SupplierController.ts').then((response) => {
+ $http.get('/services/java/codbex-partners/gen/codbex_partners/api/suppliers/SupplierController').then((response) => {
$scope.optionsSupplier = response.data.map(e => ({
value: e.Id,
text: e.Name
@@ -322,9 +350,9 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
});
let optionsCurrencyHasMore = true;
- $http.get('/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyController.ts/count').then((response) => {
+ $http.get('/services/java/codbex-currencies/gen/codbex_currencies/api/settings/CurrencyController/count').then((response) => {
const optionsCurrencyCount = response.data.count;
- $http.get('/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyController.ts').then((response) => {
+ $http.get('/services/java/codbex-currencies/gen/codbex_currencies/api/settings/CurrencyController').then((response) => {
$scope.optionsCurrency = response.data.map(e => ({
value: e.Id,
text: e.Code
@@ -350,9 +378,9 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
});
let optionsCompanyHasMore = true;
- $http.get('/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyController.ts/count').then((response) => {
+ $http.get('/services/java/codbex-companies/gen/codbex_companies/api/companies/CompanyController/count').then((response) => {
const optionsCompanyCount = response.data.count;
- $http.get('/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyController.ts').then((response) => {
+ $http.get('/services/java/codbex-companies/gen/codbex_companies/api/companies/CompanyController').then((response) => {
$scope.optionsCompany = response.data.map(e => ({
value: e.Id,
text: e.Name
@@ -376,6 +404,34 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
type: AlertTypes.Error
});
});
+ let optionsPaymentMethodHasMore = true;
+
+ $http.get('/services/java/codbex-methods/gen/codbex_methods/api/settings/PaymentMethodController/count').then((response) => {
+ const optionsPaymentMethodCount = response.data.count;
+ $http.get('/services/java/codbex-methods/gen/codbex_methods/api/settings/PaymentMethodController').then((response) => {
+ $scope.optionsPaymentMethod = response.data.map(e => ({
+ value: e.Id,
+ text: e.Name
+ }));
+ optionsPaymentMethodHasMore = optionsPaymentMethodCount > $scope.optionsPaymentMethod.length;
+ }, (error) => {
+ console.error(error);
+ const message = error.data ? error.data.message : '';
+ Dialogs.showAlert({
+ title: 'PaymentMethod',
+ message: LocaleService.t('codbex-payments:codbex-payments-model.messages.error.unableToLoad', { message: message }),
+ type: AlertTypes.Error
+ });
+ });
+ }, (error) => {
+ console.error(error);
+ const message = error.data ? error.data.message : '';
+ Dialogs.showAlert({
+ title: 'PaymentMethod',
+ message: LocaleService.t('codbex-payments:codbex-payments-model.messages.error.unableToLoad', { message: message }),
+ type: AlertTypes.Error
+ });
+ });
$scope.optionsSupplierValue = (optionKey) => {
for (let i = 0; i < $scope.optionsSupplier.length; i++) {
@@ -401,5 +457,13 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
}
return null;
};
+ $scope.optionsPaymentMethodValue = (optionKey) => {
+ for (let i = 0; i < $scope.optionsPaymentMethod.length; i++) {
+ if ($scope.optionsPaymentMethod[i].value === optionKey) {
+ return $scope.optionsPaymentMethod[i].text;
+ }
+ }
+ return null;
+ };
//----------------Dropdowns-----------------//
});
diff --git a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-filter/controller.js b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-filter/controller.js
index 34d871d..626b1aa 100644
--- a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-filter/controller.js
+++ b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-filter/controller.js
@@ -43,6 +43,9 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale']).controlle
const optionsCompanyMap = new Map();
params.optionsCompany.forEach(e => optionsCompanyMap.set(e.value, e));
$scope.optionsCompany = Array.from(optionsCompanyMap.values());
+ const optionsPaymentMethodMap = new Map();
+ params.optionsPaymentMethod.forEach(e => optionsPaymentMethodMap.set(e.value, e));
+ $scope.optionsPaymentMethod = Array.from(optionsPaymentMethodMap.values());
}
$scope.filter = () => {
@@ -99,6 +102,10 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale']).controlle
const condition = { propertyName: 'Currency', operator: 'EQ', value: entity.Currency };
filter.$filter.conditions.push(condition);
}
+ if (entity.Company !== undefined) {
+ const condition = { propertyName: 'Company', operator: 'EQ', value: entity.Company };
+ filter.$filter.conditions.push(condition);
+ }
if (entity.Reason) {
const condition = { propertyName: 'Reason', operator: 'LIKE', value: `%${entity.Reason}%` };
filter.$filter.conditions.push(condition);
@@ -107,8 +114,8 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale']).controlle
const condition = { propertyName: 'Description', operator: 'LIKE', value: `%${entity.Description}%` };
filter.$filter.conditions.push(condition);
}
- if (entity.Company !== undefined) {
- const condition = { propertyName: 'Company', operator: 'EQ', value: entity.Company };
+ if (entity.PaymentMethod !== undefined) {
+ const condition = { propertyName: 'PaymentMethod', operator: 'EQ', value: entity.PaymentMethod };
filter.$filter.conditions.push(condition);
}
if (entity.Name) {
@@ -123,10 +130,6 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale']).controlle
const condition = { propertyName: 'Reference', operator: 'LIKE', value: `%${entity.Reference}%` };
filter.$filter.conditions.push(condition);
}
- if (entity.PaymentMethod !== undefined) {
- const condition = { propertyName: 'PaymentMethod', operator: 'EQ', value: entity.PaymentMethod };
- filter.$filter.conditions.push(condition);
- }
if (entity.CreatedAtFrom) {
const condition = { propertyName: 'CreatedAt', operator: 'GE', value: entity.CreatedAtFrom };
filter.$filter.conditions.push(condition);
@@ -168,6 +171,8 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale']).controlle
allValuesCurrency.length = 0;
lastSearchValuesCompany.clear();
allValuesCompany.length = 0;
+ lastSearchValuesPaymentMethod.clear();
+ allValuesPaymentMethod.length = 0;
};
$scope.cancel = () => {
@@ -187,7 +192,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale']).controlle
$scope.loadMoreOptionsSupplier = () => {
const limit = 20;
$scope.optionsSupplierLoading = true;
- $http.get(`/services/ts/codbex-partners/gen/codbex-partners/api/Suppliers/SupplierController.ts?$limit=${limit}&$offset=${++loadMoreOptionsSupplierCounter * limit}`)
+ $http.get(`/services/java/codbex-partners/gen/codbex_partners/api/suppliers/SupplierController?$limit=${limit}&$offset=${++loadMoreOptionsSupplierCounter * limit}`)
.then((response) => {
const optionValues = allValuesSupplier.map(e => e.value);
const resultValues = response.data.map(e => ({
@@ -237,7 +242,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale']).controlle
}
})
if (!cacheHit) {
- $http.post('/services/ts/codbex-partners/gen/codbex-partners/api/Suppliers/SupplierController.ts/search', {
+ $http.post('/services/java/codbex-partners/gen/codbex_partners/api/suppliers/SupplierController/search', {
conditions: [
{ propertyName: 'Name', operator: 'LIKE', value: `${event.originalEvent.target.value}%` }
]
@@ -276,7 +281,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale']).controlle
$scope.loadMoreOptionsCurrency = () => {
const limit = 20;
$scope.optionsCurrencyLoading = true;
- $http.get(`/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyController.ts?$limit=${limit}&$offset=${++loadMoreOptionsCurrencyCounter * limit}`)
+ $http.get(`/services/java/codbex-currencies/gen/codbex_currencies/api/settings/CurrencyController?$limit=${limit}&$offset=${++loadMoreOptionsCurrencyCounter * limit}`)
.then((response) => {
const optionValues = allValuesCurrency.map(e => e.value);
const resultValues = response.data.map(e => ({
@@ -326,7 +331,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale']).controlle
}
})
if (!cacheHit) {
- $http.post('/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyController.ts/search', {
+ $http.post('/services/java/codbex-currencies/gen/codbex_currencies/api/settings/CurrencyController/search', {
conditions: [
{ propertyName: 'Code', operator: 'LIKE', value: `${event.originalEvent.target.value}%` }
]
@@ -365,7 +370,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale']).controlle
$scope.loadMoreOptionsCompany = () => {
const limit = 20;
$scope.optionsCompanyLoading = true;
- $http.get(`/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyController.ts?$limit=${limit}&$offset=${++loadMoreOptionsCompanyCounter * limit}`)
+ $http.get(`/services/java/codbex-companies/gen/codbex_companies/api/companies/CompanyController?$limit=${limit}&$offset=${++loadMoreOptionsCompanyCounter * limit}`)
.then((response) => {
const optionValues = allValuesCompany.map(e => e.value);
const resultValues = response.data.map(e => ({
@@ -415,7 +420,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale']).controlle
}
})
if (!cacheHit) {
- $http.post('/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyController.ts/search', {
+ $http.post('/services/java/codbex-companies/gen/codbex_companies/api/companies/CompanyController/search', {
conditions: [
{ propertyName: 'Name', operator: 'LIKE', value: `${event.originalEvent.target.value}%` }
]
@@ -445,6 +450,95 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale']).controlle
}
};
+ const lastSearchValuesPaymentMethod = new Set();
+ const allValuesPaymentMethod = [];
+ let loadMoreOptionsPaymentMethodCounter = 0;
+ $scope.optionsPaymentMethodLoading = false;
+ $scope.optionsPaymentMethodHasMore = true;
+
+ $scope.loadMoreOptionsPaymentMethod = () => {
+ const limit = 20;
+ $scope.optionsPaymentMethodLoading = true;
+ $http.get(`/services/java/codbex-methods/gen/codbex_methods/api/settings/PaymentMethodController?$limit=${limit}&$offset=${++loadMoreOptionsPaymentMethodCounter * limit}`)
+ .then((response) => {
+ const optionValues = allValuesPaymentMethod.map(e => e.value);
+ const resultValues = response.data.map(e => ({
+ value: e.Id,
+ text: e.Name
+ }));
+ const newValues = [];
+ resultValues.forEach(e => {
+ if (!optionValues.includes(e.value)) {
+ allValuesPaymentMethod.push(e);
+ newValues.push(e);
+ }
+ });
+ newValues.forEach(e => {
+ if (!$scope.optionsPaymentMethod.find(o => o.value === e.value)) {
+ $scope.optionsPaymentMethod.push(e);
+ }
+ })
+ $scope.optionsPaymentMethodHasMore = resultValues.length > 0;
+ $scope.optionsPaymentMethodLoading = false;
+ }, (error) => {
+ $scope.optionsPaymentMethodLoading = false;
+ console.error(error);
+ const message = error.data ? error.data.message : '';
+ Dialogs.showAlert({
+ title: 'PaymentMethod',
+ message: LocaleService.t('codbex-payments:codbex-payments-model.messages.error.unableToLoad', { message: message }),
+ type: AlertTypes.Error
+ });
+ });
+ };
+
+ $scope.onOptionsPaymentMethodChange = (event) => {
+ if (allValuesPaymentMethod.length === 0) {
+ allValuesPaymentMethod.push(...$scope.optionsPaymentMethod);
+ }
+ if (event.originalEvent.target.value === '') {
+ allValuesPaymentMethod.sort((a, b) => a.text.localeCompare(b.text));
+ $scope.optionsPaymentMethod = allValuesPaymentMethod;
+ $scope.optionsPaymentMethodHasMore = true;
+ } else if (isText(event.which)) {
+ $scope.optionsPaymentMethodHasMore = false;
+ let cacheHit = false;
+ Array.from(lastSearchValuesPaymentMethod).forEach(e => {
+ if (event.originalEvent.target.value.startsWith(e)) {
+ cacheHit = true;
+ }
+ })
+ if (!cacheHit) {
+ $http.post('/services/java/codbex-methods/gen/codbex_methods/api/settings/PaymentMethodController/search', {
+ conditions: [
+ { propertyName: 'Name', operator: 'LIKE', value: `${event.originalEvent.target.value}%` }
+ ]
+ }).then((response) => {
+ const optionValues = allValuesPaymentMethod.map(e => e.value);
+ const searchResult = response.data.map(e => ({
+ value: e.Id,
+ text: e.Name
+ }));
+ searchResult.forEach(e => {
+ if (!optionValues.includes(e.value)) {
+ allValuesPaymentMethod.push(e);
+ }
+ });
+ $scope.optionsPaymentMethod = allValuesPaymentMethod.filter(e => e.text.toLowerCase().startsWith(event.originalEvent.target.value.toLowerCase()));
+ }, (error) => {
+ console.error(error);
+ const message = error.data ? error.data.message : '';
+ Dialogs.showAlert({
+ title: 'PaymentMethod',
+ message: LocaleService.t('codbex-payments:codbex-payments-model.messages.error.unableToLoad', { message: message }),
+ type: AlertTypes.Error
+ });
+ });
+ lastSearchValuesPaymentMethod.add(event.originalEvent.target.value);
+ }
+ }
+ };
+
function isText(keycode) {
if ((keycode >= 48 && keycode <= 90) || (keycode >= 96 && keycode <= 111) || (keycode >= 186 && keycode <= 222) || [8, 46, 173].includes(keycode)) return true;
return false;
diff --git a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-filter/index.html b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-filter/index.html
index b13bf8d..7a81cef 100644
--- a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-filter/index.html
+++ b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-filter/index.html
@@ -179,6 +179,27 @@
+
+
+ {{ 'codbex-payments:codbex-payments-model.t.SUPPLIERPAYMENT_COMPANY' | t }}
+
+
+
+
+
+
+ More Options
+
+
+
+
{{ 'codbex-payments:codbex-payments-model.t.SUPPLIERPAYMENT_REASON' | t }}
@@ -215,21 +236,21 @@
- {{ 'codbex-payments:codbex-payments-model.t.SUPPLIERPAYMENT_COMPANY' | t }}
+ {{ 'codbex-payments:codbex-payments-model.t.SUPPLIERPAYMENT_PAYMENTMETHOD' | t }}
-
-
-
-
- More Options
+
+
+
+
+ More Options
@@ -285,22 +306,6 @@
-
-
- {{ 'codbex-payments:codbex-payments-model.t.SUPPLIERPAYMENT_PAYMENTMETHOD' | t }}
-
-
-
-
-
-
-
-
{{ 'codbex-payments:codbex-payments-model.t.SUPPLIERPAYMENT_CREATEDAT' | t }}
diff --git a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-window/controller.js b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-window/controller.js
index 5c3ca30..be41065 100644
--- a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-window/controller.js
+++ b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-window/controller.js
@@ -1,6 +1,6 @@
angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntityService'])
.config(['EntityServiceProvider', (EntityServiceProvider) => {
- EntityServiceProvider.baseUrl = '/services/ts/codbex-payments/gen/codbex-payments/api/SupplierPayment/SupplierPaymentController.ts';
+ EntityServiceProvider.baseUrl = '/services/java/codbex-payments/gen/codbex_payments/api/supplierpayment/SupplierPaymentController';
}])
.controller('PageController', ($scope, $http, ViewParameters, LocaleService, EntityService) => {
const Dialogs = new DialogHub();
@@ -55,6 +55,9 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
const optionsCompanyMap = new Map();
params.optionsCompany?.forEach(e => optionsCompanyMap.set(e.value, e));
$scope.optionsCompany = Array.from(optionsCompanyMap.values());
+ const optionsPaymentMethodMap = new Map();
+ params.optionsPaymentMethod?.forEach(e => optionsPaymentMethodMap.set(e.value, e));
+ $scope.optionsPaymentMethod = Array.from(optionsPaymentMethodMap.values());
}
$scope.create = () => {
@@ -98,11 +101,11 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
});
};
- $scope.serviceSupplier = '/services/ts/codbex-partners/gen/codbex-partners/api/Suppliers/SupplierController.ts';
+ $scope.serviceSupplier = '/services/java/codbex-partners/gen/codbex_partners/api/suppliers/SupplierController';
$scope.optionsSupplier = [];
- $http.get('/services/ts/codbex-partners/gen/codbex-partners/api/Suppliers/SupplierController.ts').then((response) => {
+ $http.get('/services/java/codbex-partners/gen/codbex_partners/api/suppliers/SupplierController').then((response) => {
$scope.optionsSupplier = response.data.map(e => ({
value: e.Id,
text: e.Name
@@ -126,7 +129,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
$scope.loadMoreOptionsSupplier = () => {
const limit = 20;
$scope.optionsSupplierLoading = true;
- $http.get(`/services/ts/codbex-partners/gen/codbex-partners/api/Suppliers/SupplierController.ts?$limit=${limit}&$offset=${++loadMoreOptionsSupplierCounter * limit}`)
+ $http.get(`/services/java/codbex-partners/gen/codbex_partners/api/suppliers/SupplierController?$limit=${limit}&$offset=${++loadMoreOptionsSupplierCounter * limit}`)
.then((response) => {
const optionValues = allValuesSupplier.map(e => e.value);
const resultValues = response.data.map(e => ({
@@ -176,7 +179,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
}
})
if (!cacheHit) {
- $http.post('/services/ts/codbex-partners/gen/codbex-partners/api/Suppliers/SupplierController.ts/search', {
+ $http.post('/services/java/codbex-partners/gen/codbex_partners/api/suppliers/SupplierController/search', {
conditions: [
{ propertyName: 'Name', operator: 'LIKE', value: `${event.originalEvent.target.value}%` }
]
@@ -205,11 +208,11 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
}
}
};
- $scope.serviceCurrency = '/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyController.ts';
+ $scope.serviceCurrency = '/services/java/codbex-currencies/gen/codbex_currencies/api/settings/CurrencyController';
$scope.optionsCurrency = [];
- $http.get('/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyController.ts').then((response) => {
+ $http.get('/services/java/codbex-currencies/gen/codbex_currencies/api/settings/CurrencyController').then((response) => {
$scope.optionsCurrency = response.data.map(e => ({
value: e.Id,
text: e.Code
@@ -233,7 +236,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
$scope.loadMoreOptionsCurrency = () => {
const limit = 20;
$scope.optionsCurrencyLoading = true;
- $http.get(`/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyController.ts?$limit=${limit}&$offset=${++loadMoreOptionsCurrencyCounter * limit}`)
+ $http.get(`/services/java/codbex-currencies/gen/codbex_currencies/api/settings/CurrencyController?$limit=${limit}&$offset=${++loadMoreOptionsCurrencyCounter * limit}`)
.then((response) => {
const optionValues = allValuesCurrency.map(e => e.value);
const resultValues = response.data.map(e => ({
@@ -283,7 +286,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
}
})
if (!cacheHit) {
- $http.post('/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyController.ts/search', {
+ $http.post('/services/java/codbex-currencies/gen/codbex_currencies/api/settings/CurrencyController/search', {
conditions: [
{ propertyName: 'Code', operator: 'LIKE', value: `${event.originalEvent.target.value}%` }
]
@@ -312,11 +315,11 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
}
}
};
- $scope.serviceCompany = '/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyController.ts';
+ $scope.serviceCompany = '/services/java/codbex-companies/gen/codbex_companies/api/companies/CompanyController';
$scope.optionsCompany = [];
- $http.get('/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyController.ts').then((response) => {
+ $http.get('/services/java/codbex-companies/gen/codbex_companies/api/companies/CompanyController').then((response) => {
$scope.optionsCompany = response.data.map(e => ({
value: e.Id,
text: e.Name
@@ -340,7 +343,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
$scope.loadMoreOptionsCompany = () => {
const limit = 20;
$scope.optionsCompanyLoading = true;
- $http.get(`/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyController.ts?$limit=${limit}&$offset=${++loadMoreOptionsCompanyCounter * limit}`)
+ $http.get(`/services/java/codbex-companies/gen/codbex_companies/api/companies/CompanyController?$limit=${limit}&$offset=${++loadMoreOptionsCompanyCounter * limit}`)
.then((response) => {
const optionValues = allValuesCompany.map(e => e.value);
const resultValues = response.data.map(e => ({
@@ -390,7 +393,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
}
})
if (!cacheHit) {
- $http.post('/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyController.ts/search', {
+ $http.post('/services/java/codbex-companies/gen/codbex_companies/api/companies/CompanyController/search', {
conditions: [
{ propertyName: 'Name', operator: 'LIKE', value: `${event.originalEvent.target.value}%` }
]
@@ -419,6 +422,113 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
}
}
};
+ $scope.servicePaymentMethod = '/services/java/codbex-methods/gen/codbex_methods/api/settings/PaymentMethodController';
+
+ $scope.optionsPaymentMethod = [];
+
+ $http.get('/services/java/codbex-methods/gen/codbex_methods/api/settings/PaymentMethodController').then((response) => {
+ $scope.optionsPaymentMethod = response.data.map(e => ({
+ value: e.Id,
+ text: e.Name
+ }));
+ }, (error) => {
+ console.error(error);
+ const message = error.data ? error.data.message : '';
+ Dialogs.showAlert({
+ title: 'PaymentMethod',
+ message: LocaleService.t('codbex-payments:codbex-payments-model.messages.error.unableToLoad', { message: message }),
+ type: AlertTypes.Error
+ });
+ });
+
+ const lastSearchValuesPaymentMethod = new Set();
+ const allValuesPaymentMethod = [];
+ let loadMoreOptionsPaymentMethodCounter = 0;
+ $scope.optionsPaymentMethodLoading = false;
+ $scope.optionsPaymentMethodHasMore = true;
+
+ $scope.loadMoreOptionsPaymentMethod = () => {
+ const limit = 20;
+ $scope.optionsPaymentMethodLoading = true;
+ $http.get(`/services/java/codbex-methods/gen/codbex_methods/api/settings/PaymentMethodController?$limit=${limit}&$offset=${++loadMoreOptionsPaymentMethodCounter * limit}`)
+ .then((response) => {
+ const optionValues = allValuesPaymentMethod.map(e => e.value);
+ const resultValues = response.data.map(e => ({
+ value: e.Id,
+ text: e.Name
+ }));
+ const newValues = [];
+ resultValues.forEach(e => {
+ if (!optionValues.includes(e.value)) {
+ allValuesPaymentMethod.push(e);
+ newValues.push(e);
+ }
+ });
+ newValues.forEach(e => {
+ if (!$scope.optionsPaymentMethod.find(o => o.value === e.value)) {
+ $scope.optionsPaymentMethod.push(e);
+ }
+ })
+ $scope.optionsPaymentMethodHasMore = resultValues.length > 0;
+ $scope.optionsPaymentMethodLoading = false;
+ }, (error) => {
+ $scope.optionsPaymentMethodLoading = false;
+ console.error(error);
+ const message = error.data ? error.data.message : '';
+ Dialogs.showAlert({
+ title: 'PaymentMethod',
+ message: LocaleService.t('codbex-payments:codbex-payments-model.messages.error.unableToLoad', { message: message }),
+ type: AlertTypes.Error
+ });
+ });
+ };
+
+ $scope.onOptionsPaymentMethodChange = (event) => {
+ if (allValuesPaymentMethod.length === 0) {
+ allValuesPaymentMethod.push(...$scope.optionsPaymentMethod);
+ }
+ if (event.originalEvent.target.value === '') {
+ allValuesPaymentMethod.sort((a, b) => a.text.localeCompare(b.text));
+ $scope.optionsPaymentMethod = allValuesPaymentMethod;
+ $scope.optionsPaymentMethodHasMore = true;
+ } else if (isText(event.which)) {
+ $scope.optionsPaymentMethodHasMore = false;
+ let cacheHit = false;
+ Array.from(lastSearchValuesPaymentMethod).forEach(e => {
+ if (event.originalEvent.target.value.startsWith(e)) {
+ cacheHit = true;
+ }
+ })
+ if (!cacheHit) {
+ $http.post('/services/java/codbex-methods/gen/codbex_methods/api/settings/PaymentMethodController/search', {
+ conditions: [
+ { propertyName: 'Name', operator: 'LIKE', value: `${event.originalEvent.target.value}%` }
+ ]
+ }).then((response) => {
+ const optionValues = allValuesPaymentMethod.map(e => e.value);
+ const searchResult = response.data.map(e => ({
+ value: e.Id,
+ text: e.Name
+ }));
+ searchResult.forEach(e => {
+ if (!optionValues.includes(e.value)) {
+ allValuesPaymentMethod.push(e);
+ }
+ });
+ $scope.optionsPaymentMethod = allValuesPaymentMethod.filter(e => e.text.toLowerCase().startsWith(event.originalEvent.target.value.toLowerCase()));
+ }, (error) => {
+ console.error(error);
+ const message = error.data ? error.data.message : '';
+ Dialogs.showAlert({
+ title: 'PaymentMethod',
+ message: LocaleService.t('codbex-payments:codbex-payments-model.messages.error.unableToLoad', { message: message }),
+ type: AlertTypes.Error
+ });
+ });
+ lastSearchValuesPaymentMethod.add(event.originalEvent.target.value);
+ }
+ }
+ };
function isText(keycode) {
if ((keycode >= 48 && keycode <= 90) || (keycode >= 96 && keycode <= 111) || (keycode >= 186 && keycode <= 222) || [8, 46, 173].includes(keycode)) return true;
return false;
diff --git a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-window/index.html b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-window/index.html
index 77c532a..cc3d8c5 100644
--- a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-window/index.html
+++ b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/dialog-window/index.html
@@ -178,6 +178,29 @@
+
+
+ {{ 'codbex-payments:codbex-payments-model.t.SUPPLIERPAYMENT_COMPANY' | t }}
+
+
+
+
+
+
+ More Options
+
+
+
+
{{ 'codbex-payments:codbex-payments-model.t.SUPPLIERPAYMENT_REASON' | t }}
@@ -222,23 +245,23 @@
- {{ 'codbex-payments:codbex-payments-model.t.SUPPLIERPAYMENT_COMPANY' | t }}
+ {{ 'codbex-payments:codbex-payments-model.t.SUPPLIERPAYMENT_PAYMENTMETHOD' | t }}
-
-
-
-
- More Options
+ dropdown-items="optionsPaymentMethod"
+ ng-keyup="onOptionsPaymentMethodChange($event)"
+ placeholder="{{ 'codbex-payments:codbex-payments-model.messages.inputSearch' | t:{'name':'$t(codbex-payments:codbex-payments-model.t.SUPPLIERPAYMENT_PAYMENTMETHOD)'} }}"
+ btn-aria-label="{{ 'codbex-payments:codbex-payments-model.aria.showHide' | t:{'name':'PaymentMethod'} }}" list-aria-label="{{ 'codbex-payments:codbex-payments-model.aria.options' | t:{'name':'PaymentMethod'} }}">
+
+
+
+ More Options
@@ -292,26 +315,6 @@
-
-
- {{ 'codbex-payments:codbex-payments-model.t.SUPPLIERPAYMENT_PAYMENTMETHOD' | t }}
-
-
-
-
-
-
-
-
{{ 'codbex-payments:codbex-payments-model.t.SUPPLIERPAYMENT_CREATEDAT' | t }}
diff --git a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/index.html b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/index.html
index 0d917df..0239a52 100644
--- a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/index.html
+++ b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/index.html
@@ -47,13 +47,13 @@
{{next.CounterpartyName}} |
{{next.Amount}} |
{{optionsCurrencyValue(next.Currency)}} |
+ {{optionsCompanyValue(next.Company)}} |
{{next.Reason}} |
{{next.Description}} |
- {{optionsCompanyValue(next.Company)}} |
+ {{optionsPaymentMethodValue(next.PaymentMethod)}} |
{{next.Name}} |
{{next.UUID}} |
{{next.Reference}} |
- {{next.PaymentMethod}} |
{{next.CreatedAt}} |
{{next.CreatedBy}} |
{{next.UpdatedAt}} |
diff --git a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/main-details/controller.js b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/main-details/controller.js
index 067b14d..6583814 100644
--- a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/main-details/controller.js
+++ b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/main-details/controller.js
@@ -1,6 +1,6 @@
angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntityService'])
.config(["EntityServiceProvider", (EntityServiceProvider) => {
- EntityServiceProvider.baseUrl = '/services/ts/codbex-payments/gen/codbex-payments/api/SupplierPayment/SupplierPaymentController.ts';
+ EntityServiceProvider.baseUrl = '/services/java/codbex-payments/gen/codbex_payments/api/supplierpayment/SupplierPaymentController';
}])
.controller('PageController', ($scope, $http, Extensions, LocaleService, EntityService) => {
const Dialogs = new DialogHub();
@@ -53,6 +53,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
$scope.optionsSupplier = [];
$scope.optionsCurrency = [];
$scope.optionsCompany = [];
+ $scope.optionsPaymentMethod = [];
$scope.action = 'select';
});
}});
@@ -74,6 +75,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
$scope.optionsSupplier = data.optionsSupplier;
$scope.optionsCurrency = data.optionsCurrency;
$scope.optionsCompany = data.optionsCompany;
+ $scope.optionsPaymentMethod = data.optionsPaymentMethod;
$scope.action = 'select';
});
}});
@@ -83,6 +85,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
$scope.optionsSupplier = data.optionsSupplier;
$scope.optionsCurrency = data.optionsCurrency;
$scope.optionsCompany = data.optionsCompany;
+ $scope.optionsPaymentMethod = data.optionsPaymentMethod;
$scope.action = 'create';
});
}});
@@ -104,13 +107,15 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
$scope.optionsSupplier = data.optionsSupplier;
$scope.optionsCurrency = data.optionsCurrency;
$scope.optionsCompany = data.optionsCompany;
+ $scope.optionsPaymentMethod = data.optionsPaymentMethod;
$scope.action = 'update';
});
}});
- $scope.serviceSupplier = '/services/ts/codbex-partners/gen/codbex-partners/api/Suppliers/SupplierController.ts';
- $scope.serviceCurrency = '/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyController.ts';
- $scope.serviceCompany = '/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyController.ts';
+ $scope.serviceSupplier = '/services/java/codbex-partners/gen/codbex_partners/api/suppliers/SupplierController';
+ $scope.serviceCurrency = '/services/java/codbex-currencies/gen/codbex_currencies/api/settings/CurrencyController';
+ $scope.serviceCompany = '/services/java/codbex-companies/gen/codbex_companies/api/companies/CompanyController';
+ $scope.servicePaymentMethod = '/services/java/codbex-methods/gen/codbex_methods/api/settings/PaymentMethodController';
//-----------------Events-------------------//
@@ -198,6 +203,16 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
closeButton: false
});
};
+ $scope.createPaymentMethod = () => {
+ Dialogs.showWindow({
+ id: 'PaymentMethod-details',
+ params: {
+ action: 'create',
+ entity: {},
+ },
+ closeButton: false
+ });
+ };
//-----------------Dialogs-------------------//
@@ -214,7 +229,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
$scope.loadMoreOptionsSupplier = () => {
const limit = 20;
$scope.optionsSupplierLoading = true;
- $http.get(`/services/ts/codbex-partners/gen/codbex-partners/api/Suppliers/SupplierController.ts?$limit=${limit}&$offset=${++loadMoreOptionsSupplierCounter * limit}`)
+ $http.get(`/services/java/codbex-partners/gen/codbex_partners/api/suppliers/SupplierController?$limit=${limit}&$offset=${++loadMoreOptionsSupplierCounter * limit}`)
.then((response) => {
const optionValues = allValuesSupplier.map(e => e.value);
const resultValues = response.data.map(e => ({
@@ -264,7 +279,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
}
})
if (!cacheHit) {
- $http.post('/services/ts/codbex-partners/gen/codbex-partners/api/Suppliers/SupplierController.ts/search', {
+ $http.post('/services/java/codbex-partners/gen/codbex_partners/api/suppliers/SupplierController/search', {
conditions: [
{ propertyName: 'Name', operator: 'LIKE', value: `${event.originalEvent.target.value}%` }
]
@@ -296,7 +311,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
$scope.refreshSupplier = () => {
$scope.optionsSupplier = [];
- $http.get('/services/ts/codbex-partners/gen/codbex-partners/api/Suppliers/SupplierController.ts').then((response) => {
+ $http.get('/services/java/codbex-partners/gen/codbex_partners/api/suppliers/SupplierController').then((response) => {
$scope.optionsSupplier = response.data.map(e => ({
value: e.Id,
text: e.Name
@@ -321,7 +336,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
$scope.loadMoreOptionsCurrency = () => {
const limit = 20;
$scope.optionsCurrencyLoading = true;
- $http.get(`/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyController.ts?$limit=${limit}&$offset=${++loadMoreOptionsCurrencyCounter * limit}`)
+ $http.get(`/services/java/codbex-currencies/gen/codbex_currencies/api/settings/CurrencyController?$limit=${limit}&$offset=${++loadMoreOptionsCurrencyCounter * limit}`)
.then((response) => {
const optionValues = allValuesCurrency.map(e => e.value);
const resultValues = response.data.map(e => ({
@@ -371,7 +386,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
}
})
if (!cacheHit) {
- $http.post('/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyController.ts/search', {
+ $http.post('/services/java/codbex-currencies/gen/codbex_currencies/api/settings/CurrencyController/search', {
conditions: [
{ propertyName: 'Code', operator: 'LIKE', value: `${event.originalEvent.target.value}%` }
]
@@ -403,7 +418,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
$scope.refreshCurrency = () => {
$scope.optionsCurrency = [];
- $http.get('/services/ts/codbex-currencies/gen/codbex-currencies/api/Settings/CurrencyController.ts').then((response) => {
+ $http.get('/services/java/codbex-currencies/gen/codbex_currencies/api/settings/CurrencyController').then((response) => {
$scope.optionsCurrency = response.data.map(e => ({
value: e.Id,
text: e.Code
@@ -428,7 +443,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
$scope.loadMoreOptionsCompany = () => {
const limit = 20;
$scope.optionsCompanyLoading = true;
- $http.get(`/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyController.ts?$limit=${limit}&$offset=${++loadMoreOptionsCompanyCounter * limit}`)
+ $http.get(`/services/java/codbex-companies/gen/codbex_companies/api/companies/CompanyController?$limit=${limit}&$offset=${++loadMoreOptionsCompanyCounter * limit}`)
.then((response) => {
const optionValues = allValuesCompany.map(e => e.value);
const resultValues = response.data.map(e => ({
@@ -478,7 +493,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
}
})
if (!cacheHit) {
- $http.post('/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyController.ts/search', {
+ $http.post('/services/java/codbex-companies/gen/codbex_companies/api/companies/CompanyController/search', {
conditions: [
{ propertyName: 'Name', operator: 'LIKE', value: `${event.originalEvent.target.value}%` }
]
@@ -510,7 +525,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
$scope.refreshCompany = () => {
$scope.optionsCompany = [];
- $http.get('/services/ts/codbex-companies/gen/codbex-companies/api/Companies/CompanyController.ts').then((response) => {
+ $http.get('/services/java/codbex-companies/gen/codbex_companies/api/companies/CompanyController').then((response) => {
$scope.optionsCompany = response.data.map(e => ({
value: e.Id,
text: e.Name
@@ -526,6 +541,113 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer
});
});
};
+ const lastSearchValuesPaymentMethod = new Set();
+ const allValuesPaymentMethod = [];
+ let loadMoreOptionsPaymentMethodCounter = 0;
+ $scope.optionsPaymentMethodLoading = false;
+ $scope.optionsPaymentMethodHasMore = true;
+
+ $scope.loadMoreOptionsPaymentMethod = () => {
+ const limit = 20;
+ $scope.optionsPaymentMethodLoading = true;
+ $http.get(`/services/java/codbex-methods/gen/codbex_methods/api/settings/PaymentMethodController?$limit=${limit}&$offset=${++loadMoreOptionsPaymentMethodCounter * limit}`)
+ .then((response) => {
+ const optionValues = allValuesPaymentMethod.map(e => e.value);
+ const resultValues = response.data.map(e => ({
+ value: e.Id,
+ text: e.Name
+ }));
+ const newValues = [];
+ resultValues.forEach(e => {
+ if (!optionValues.includes(e.value)) {
+ allValuesPaymentMethod.push(e);
+ newValues.push(e);
+ }
+ });
+ newValues.forEach(e => {
+ if (!$scope.optionsPaymentMethod.find(o => o.value === e.value)) {
+ $scope.optionsPaymentMethod.push(e);
+ }
+ })
+ $scope.optionsPaymentMethodHasMore = resultValues.length > 0;
+ $scope.optionsPaymentMethodLoading = false;
+ }, (error) => {
+ $scope.optionsPaymentMethodLoading = false;
+ console.error(error);
+ const message = error.data ? error.data.message : '';
+ Dialogs.showAlert({
+ title: 'PaymentMethod',
+ message: LocaleService.t('codbex-payments:codbex-payments-model.messages.error.unableToLoad', { message: message }),
+ type: AlertTypes.Error
+ });
+ });
+ };
+
+ $scope.onOptionsPaymentMethodChange = (event) => {
+ if (allValuesPaymentMethod.length === 0) {
+ allValuesPaymentMethod.push(...$scope.optionsPaymentMethod);
+ }
+ if (event.originalEvent.target.value === '') {
+ allValuesPaymentMethod.sort((a, b) => a.text.localeCompare(b.text));
+ $scope.optionsPaymentMethod = allValuesPaymentMethod;
+ $scope.optionsPaymentMethodHasMore = true;
+ } else if (isText(event.which)) {
+ $scope.optionsPaymentMethodHasMore = false;
+ let cacheHit = false;
+ Array.from(lastSearchValuesPaymentMethod).forEach(e => {
+ if (event.originalEvent.target.value.startsWith(e)) {
+ cacheHit = true;
+ }
+ })
+ if (!cacheHit) {
+ $http.post('/services/java/codbex-methods/gen/codbex_methods/api/settings/PaymentMethodController/search', {
+ conditions: [
+ { propertyName: 'Name', operator: 'LIKE', value: `${event.originalEvent.target.value}%` }
+ ]
+ }).then((response) => {
+ const optionValues = allValuesPaymentMethod.map(e => e.value);
+ const searchResult = response.data.map(e => ({
+ value: e.Id,
+ text: e.Name
+ }));
+ searchResult.forEach(e => {
+ if (!optionValues.includes(e.value)) {
+ allValuesPaymentMethod.push(e);
+ }
+ });
+ $scope.optionsPaymentMethod = allValuesPaymentMethod.filter(e => e.text.toLowerCase().startsWith(event.originalEvent.target.value.toLowerCase()));
+ }, (error) => {
+ console.error(error);
+ const message = error.data ? error.data.message : '';
+ Dialogs.showAlert({
+ title: 'PaymentMethod',
+ message: LocaleService.t('codbex-payments:codbex-payments-model.messages.error.unableToLoad', { message: message }),
+ type: AlertTypes.Error
+ });
+ });
+ lastSearchValuesPaymentMethod.add(event.originalEvent.target.value);
+ }
+ }
+ };
+
+ $scope.refreshPaymentMethod = () => {
+ $scope.optionsPaymentMethod = [];
+ $http.get('/services/java/codbex-methods/gen/codbex_methods/api/settings/PaymentMethodController').then((response) => {
+ $scope.optionsPaymentMethod = response.data.map(e => ({
+ value: e.Id,
+ text: e.Name
+ }));
+ allValuesPaymentMethod.length === 0;
+ }, (error) => {
+ console.error(error);
+ const message = error.data ? error.data.message : '';
+ Dialogs.showAlert({
+ title: 'PaymentMethod',
+ message: LocaleService.t('codbex-payments:codbex-payments-model.messages.error.unableToLoad', { message: message }),
+ type: AlertTypes.Error
+ });
+ });
+ };
function isText(keycode) {
if ((keycode >= 48 && keycode <= 90) || (keycode >= 96 && keycode <= 111) || (keycode >= 186 && keycode <= 222) || [8, 46, 173].includes(keycode)) return true;
diff --git a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/main-details/index.html b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/main-details/index.html
index b396a8f..5092505 100644
--- a/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/main-details/index.html
+++ b/codbex-payments/gen/codbex-payments/ui/SupplierPayment/SupplierPayment/main-details/index.html
@@ -184,6 +184,33 @@
+
+
+ {{ 'codbex-payments:codbex-payments-model.t.SUPPLIERPAYMENT_COMPANY' | t }}
+
+
+
+
+
+
+ More Options
+
+
+
+
+
+
+
+
{{ 'codbex-payments:codbex-payments-model.t.SUPPLIERPAYMENT_REASON' | t }}
@@ -228,29 +255,29 @@
- {{ 'codbex-payments:codbex-payments-model.t.SUPPLIERPAYMENT_COMPANY' | t }}
+ {{ 'codbex-payments:codbex-payments-model.t.SUPPLIERPAYMENT_PAYMENTMETHOD' | t }}
-
-
-
-
- More Options
+ dropdown-items="optionsPaymentMethod"
+ ng-keyup="onOptionsPaymentMethodChange($event)"
+ placeholder="{{ 'codbex-payments:codbex-payments-model.messages.inputSearch' | t:{'name':'$t(codbex-payments:codbex-payments-model.t.SUPPLIERPAYMENT_PAYMENTMETHOD)'} }}"
+ btn-aria-label="{{ 'codbex-payments:codbex-payments-model.aria.showHide' | t:{'name':'PaymentMethod'} }}" list-aria-label="{{ 'codbex-payments:codbex-payments-model.aria.options' | t:{'name':'PaymentMethod'} }}">
+
+
+
+ More Options
-
-
+
+
@@ -302,26 +329,6 @@
-
-
- {{ 'codbex-payments:codbex-payments-model.t.SUPPLIERPAYMENT_PAYMENTMETHOD' | t }}
-
-
-
-
-
-
-
-
{{ 'codbex-payments:codbex-payments-model.t.SUPPLIERPAYMENT_CREATEDAT' | t }}
diff --git a/codbex-payments/gen/codbex_payments/api/customerpayment/CustomerPaymentController.java b/codbex-payments/gen/codbex_payments/api/customerpayment/CustomerPaymentController.java
new file mode 100644
index 0000000..fc04637
--- /dev/null
+++ b/codbex-payments/gen/codbex_payments/api/customerpayment/CustomerPaymentController.java
@@ -0,0 +1,227 @@
+package gen.codbex_payments.api.customerpayment;
+
+import gen.codbex_payments.data.customerpayment.CustomerPaymentEntity;
+import gen.codbex_payments.data.customerpayment.CustomerPaymentRepository;
+
+import org.eclipse.dirigible.components.api.security.UserFacade;
+import org.eclipse.dirigible.engine.java.annotations.Documentation;
+import org.eclipse.dirigible.engine.java.annotations.Inject;
+import org.eclipse.dirigible.engine.java.annotations.http.Body;
+import org.eclipse.dirigible.engine.java.annotations.http.Controller;
+import org.eclipse.dirigible.engine.java.annotations.http.Delete;
+import org.eclipse.dirigible.engine.java.annotations.http.Get;
+import org.eclipse.dirigible.engine.java.annotations.http.PathParam;
+import org.eclipse.dirigible.engine.java.annotations.http.Post;
+import org.eclipse.dirigible.engine.java.annotations.http.Put;
+import org.eclipse.dirigible.engine.java.annotations.http.QueryParam;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.server.ResponseStatusException;
+
+import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+
+@Controller
+@Documentation("codbex-payments - CustomerPayment Controller")
+public class CustomerPaymentController {
+
+ private static final Set FILTER_FIELDS = Set.of("Id", "Customer", "Date", "Valor", "OurPartyIBAN", "CounterpartyIBAN", "CounterpartyName", "Amount", "Currency", "Company", "Reason", "Description", "PaymentMethod", "Name", "UUID", "Reference", "CreatedAt", "CreatedBy", "UpdatedAt", "UpdatedBy");
+
+ @Inject
+ private CustomerPaymentRepository repository;
+
+ @Get
+ @Documentation("List CustomerPayment")
+ public List getAll(@QueryParam("$limit") Integer limit,
+ @QueryParam("$offset") Integer offset) {
+ checkPermissions("read");
+ int actualLimit = limit != null ? limit.intValue() : 20;
+ int actualOffset = offset != null ? offset.intValue() : 0;
+ List result = repository.findAll(actualLimit, actualOffset);
+ return result;
+ }
+
+ @Get("/count")
+ @Documentation("Count CustomerPayment")
+ public Map count() {
+ checkPermissions("read");
+ return Map.of("count", repository.count());
+ }
+
+ @Post("/count")
+ @Documentation("Count CustomerPayment with filter")
+ public Map countWithFilter(@Body Map filter) {
+ checkPermissions("read");
+ return Map.of("count", (long) runFilter(filter).size());
+ }
+
+ @Post("/search")
+ @Documentation("Search CustomerPayment")
+ public List search(@Body Map filter) {
+ checkPermissions("read");
+ List result = runFilter(filter);
+ return result;
+ }
+
+ @Get("/{id}")
+ @Documentation("Get CustomerPayment by id")
+ public CustomerPaymentEntity getById(@PathParam("id") Integer id) {
+ checkPermissions("read");
+ CustomerPaymentEntity entity = repository.findOne(id)
+ .orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND, "CustomerPayment not found"));
+ return entity;
+ }
+
+ @Post
+ @Documentation("Create CustomerPayment")
+ public CustomerPaymentEntity create(@Body CustomerPaymentEntity entity) {
+ checkPermissions("write");
+ validate(entity);
+ return repository.save(entity);
+ }
+
+ @Put("/{id}")
+ @Documentation("Update CustomerPayment by id")
+ public CustomerPaymentEntity update(@PathParam("id") Integer id, @Body CustomerPaymentEntity entity) {
+ checkPermissions("write");
+ entity.Id = id;
+ validate(entity);
+ return repository.update(entity);
+ }
+
+ @Delete("/{id}")
+ @Documentation("Delete CustomerPayment by id")
+ public void deleteById(@PathParam("id") Integer id) {
+ checkPermissions("write");
+ if (repository.findOne(id).isEmpty()) {
+ throw new ResponseStatusException(HttpStatus.NOT_FOUND, "CustomerPayment not found");
+ }
+ repository.deleteById(id);
+ }
+
+ private List runFilter(Map filter) {
+ StringBuilder hql = new StringBuilder("from CustomerPaymentEntity e");
+ Map params = new LinkedHashMap<>();
+ boolean first = true;
+ if (filter != null && filter.get("equals") instanceof Map, ?> equals) {
+ for (Map.Entry, ?> entry : equals.entrySet()) {
+ String field = requireKnownField(String.valueOf(entry.getKey()));
+ String paramName = "p" + params.size();
+ hql.append(first ? " where e." : " and e.").append(field).append(" = :").append(paramName);
+ params.put(paramName, entry.getValue());
+ first = false;
+ }
+ }
+ if (filter != null && filter.get("conditions") instanceof List> conditions) {
+ for (Object raw : conditions) {
+ if (!(raw instanceof Map, ?> condition)) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Invalid filter condition");
+ }
+ String field = requireKnownField(String.valueOf(condition.get("propertyName")));
+ String operator = String.valueOf(condition.get("operator")).toUpperCase(Locale.ROOT);
+ Object value = condition.get("value");
+ String paramName = "p" + params.size();
+ String clause = switch (operator) {
+ case "EQ" -> "e." + field + " = :" + paramName;
+ case "IN" -> {
+ if (!(value instanceof Collection>)) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "IN value must be a list for field: " + field);
+ }
+ yield "e." + field + " in (:" + paramName + ")";
+ }
+ case "LIKE" -> "e." + field + " like :" + paramName;
+ default -> throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Unsupported operator: " + operator);
+ };
+ hql.append(first ? " where " : " and ").append(clause);
+ params.put(paramName, value);
+ first = false;
+ }
+ }
+ return repository.query(hql.toString(), params);
+ }
+
+ private static String requireKnownField(String field) {
+ if (!FILTER_FIELDS.contains(field)) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Unknown filter field: " + field);
+ }
+ return field;
+ }
+
+ private void checkPermissions(String op) {
+ if ("read".equals(op) && !(UserFacade.isInRole("codbex-payments.CustomerPayment.CustomerPaymentReadOnly") || UserFacade.isInRole("codbex-payments.CustomerPayment.CustomerPaymentFullAccess"))) {
+ throw new ResponseStatusException(HttpStatus.FORBIDDEN);
+ }
+ if ("write".equals(op) && !UserFacade.isInRole("codbex-payments.CustomerPayment.CustomerPaymentFullAccess")) {
+ throw new ResponseStatusException(HttpStatus.FORBIDDEN);
+ }
+ }
+
+ private static void validate(CustomerPaymentEntity entity) {
+ if (entity.Customer == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Customer' property is required");
+ }
+ if (entity.Date == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Date' property is required");
+ }
+ if (entity.Valor == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Valor' property is required");
+ }
+ if (entity.OurPartyIBAN == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'OurPartyIBAN' property is required");
+ }
+ if (entity.OurPartyIBAN != null && entity.OurPartyIBAN.length() > 34) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'OurPartyIBAN' exceeds the maximum length of 34");
+ }
+ if (entity.OurPartyIBAN != null && !entity.OurPartyIBAN.toString().matches("^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$")) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The value of 'OurPartyIBAN' does not match the required pattern '^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$'");
+ }
+ if (entity.CounterpartyIBAN == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'CounterpartyIBAN' property is required");
+ }
+ if (entity.CounterpartyIBAN != null && entity.CounterpartyIBAN.length() > 34) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'CounterpartyIBAN' exceeds the maximum length of 34");
+ }
+ if (entity.CounterpartyIBAN != null && !entity.CounterpartyIBAN.toString().matches("^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$")) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The value of 'CounterpartyIBAN' does not match the required pattern '^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$'");
+ }
+ if (entity.CounterpartyName != null && entity.CounterpartyName.length() > 100) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'CounterpartyName' exceeds the maximum length of 100");
+ }
+ if (entity.Amount == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Amount' property is required");
+ }
+ if (entity.Currency == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Currency' property is required");
+ }
+ if (entity.Reason == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Reason' property is required");
+ }
+ if (entity.Reason != null && entity.Reason.length() > 100) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Reason' exceeds the maximum length of 100");
+ }
+ if (entity.Description != null && entity.Description.length() > 100) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Description' exceeds the maximum length of 100");
+ }
+ if (entity.PaymentMethod == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'PaymentMethod' property is required");
+ }
+ if (entity.Name != null && entity.Name.length() > 20) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Name' exceeds the maximum length of 20");
+ }
+ if (entity.UUID != null && entity.UUID.length() > 36) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'UUID' exceeds the maximum length of 36");
+ }
+ if (entity.Reference != null && entity.Reference.length() > 36) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Reference' exceeds the maximum length of 36");
+ }
+ if (entity.CreatedBy != null && entity.CreatedBy.length() > 20) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'CreatedBy' exceeds the maximum length of 20");
+ }
+ if (entity.UpdatedBy != null && entity.UpdatedBy.length() > 20) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'UpdatedBy' exceeds the maximum length of 20");
+ }
+ }
+}
diff --git a/codbex-payments/gen/codbex_payments/api/employeepayment/EmployeePaymentController.java b/codbex-payments/gen/codbex_payments/api/employeepayment/EmployeePaymentController.java
new file mode 100644
index 0000000..d0c5e0c
--- /dev/null
+++ b/codbex-payments/gen/codbex_payments/api/employeepayment/EmployeePaymentController.java
@@ -0,0 +1,224 @@
+package gen.codbex_payments.api.employeepayment;
+
+import gen.codbex_payments.data.employeepayment.EmployeePaymentEntity;
+import gen.codbex_payments.data.employeepayment.EmployeePaymentRepository;
+
+import org.eclipse.dirigible.components.api.security.UserFacade;
+import org.eclipse.dirigible.engine.java.annotations.Documentation;
+import org.eclipse.dirigible.engine.java.annotations.Inject;
+import org.eclipse.dirigible.engine.java.annotations.http.Body;
+import org.eclipse.dirigible.engine.java.annotations.http.Controller;
+import org.eclipse.dirigible.engine.java.annotations.http.Delete;
+import org.eclipse.dirigible.engine.java.annotations.http.Get;
+import org.eclipse.dirigible.engine.java.annotations.http.PathParam;
+import org.eclipse.dirigible.engine.java.annotations.http.Post;
+import org.eclipse.dirigible.engine.java.annotations.http.Put;
+import org.eclipse.dirigible.engine.java.annotations.http.QueryParam;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.server.ResponseStatusException;
+
+import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+
+@Controller
+@Documentation("codbex-payments - EmployeePayment Controller")
+public class EmployeePaymentController {
+
+ private static final Set FILTER_FIELDS = Set.of("Id", "Employee", "Date", "Valor", "OurPartyIBAN", "CounterpartyIBAN", "CounterpartyName", "Amount", "Currency", "Company", "Reason", "Description", "Name", "UUID", "Reference", "CreatedAt", "CreatedBy", "UpdatedAt", "UpdatedBy");
+
+ @Inject
+ private EmployeePaymentRepository repository;
+
+ @Get
+ @Documentation("List EmployeePayment")
+ public List getAll(@QueryParam("$limit") Integer limit,
+ @QueryParam("$offset") Integer offset) {
+ checkPermissions("read");
+ int actualLimit = limit != null ? limit.intValue() : 20;
+ int actualOffset = offset != null ? offset.intValue() : 0;
+ List result = repository.findAll(actualLimit, actualOffset);
+ return result;
+ }
+
+ @Get("/count")
+ @Documentation("Count EmployeePayment")
+ public Map count() {
+ checkPermissions("read");
+ return Map.of("count", repository.count());
+ }
+
+ @Post("/count")
+ @Documentation("Count EmployeePayment with filter")
+ public Map countWithFilter(@Body Map filter) {
+ checkPermissions("read");
+ return Map.of("count", (long) runFilter(filter).size());
+ }
+
+ @Post("/search")
+ @Documentation("Search EmployeePayment")
+ public List search(@Body Map filter) {
+ checkPermissions("read");
+ List result = runFilter(filter);
+ return result;
+ }
+
+ @Get("/{id}")
+ @Documentation("Get EmployeePayment by id")
+ public EmployeePaymentEntity getById(@PathParam("id") Integer id) {
+ checkPermissions("read");
+ EmployeePaymentEntity entity = repository.findOne(id)
+ .orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND, "EmployeePayment not found"));
+ return entity;
+ }
+
+ @Post
+ @Documentation("Create EmployeePayment")
+ public EmployeePaymentEntity create(@Body EmployeePaymentEntity entity) {
+ checkPermissions("write");
+ validate(entity);
+ return repository.save(entity);
+ }
+
+ @Put("/{id}")
+ @Documentation("Update EmployeePayment by id")
+ public EmployeePaymentEntity update(@PathParam("id") Integer id, @Body EmployeePaymentEntity entity) {
+ checkPermissions("write");
+ entity.Id = id;
+ validate(entity);
+ return repository.update(entity);
+ }
+
+ @Delete("/{id}")
+ @Documentation("Delete EmployeePayment by id")
+ public void deleteById(@PathParam("id") Integer id) {
+ checkPermissions("write");
+ if (repository.findOne(id).isEmpty()) {
+ throw new ResponseStatusException(HttpStatus.NOT_FOUND, "EmployeePayment not found");
+ }
+ repository.deleteById(id);
+ }
+
+ private List runFilter(Map filter) {
+ StringBuilder hql = new StringBuilder("from EmployeePaymentEntity e");
+ Map params = new LinkedHashMap<>();
+ boolean first = true;
+ if (filter != null && filter.get("equals") instanceof Map, ?> equals) {
+ for (Map.Entry, ?> entry : equals.entrySet()) {
+ String field = requireKnownField(String.valueOf(entry.getKey()));
+ String paramName = "p" + params.size();
+ hql.append(first ? " where e." : " and e.").append(field).append(" = :").append(paramName);
+ params.put(paramName, entry.getValue());
+ first = false;
+ }
+ }
+ if (filter != null && filter.get("conditions") instanceof List> conditions) {
+ for (Object raw : conditions) {
+ if (!(raw instanceof Map, ?> condition)) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Invalid filter condition");
+ }
+ String field = requireKnownField(String.valueOf(condition.get("propertyName")));
+ String operator = String.valueOf(condition.get("operator")).toUpperCase(Locale.ROOT);
+ Object value = condition.get("value");
+ String paramName = "p" + params.size();
+ String clause = switch (operator) {
+ case "EQ" -> "e." + field + " = :" + paramName;
+ case "IN" -> {
+ if (!(value instanceof Collection>)) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "IN value must be a list for field: " + field);
+ }
+ yield "e." + field + " in (:" + paramName + ")";
+ }
+ case "LIKE" -> "e." + field + " like :" + paramName;
+ default -> throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Unsupported operator: " + operator);
+ };
+ hql.append(first ? " where " : " and ").append(clause);
+ params.put(paramName, value);
+ first = false;
+ }
+ }
+ return repository.query(hql.toString(), params);
+ }
+
+ private static String requireKnownField(String field) {
+ if (!FILTER_FIELDS.contains(field)) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Unknown filter field: " + field);
+ }
+ return field;
+ }
+
+ private void checkPermissions(String op) {
+ if ("read".equals(op) && !(UserFacade.isInRole("codbex-payments.EmployeePayment.EmployeePaymentReadOnly") || UserFacade.isInRole("codbex-payments.EmployeePayment.EmployeePaymentFullAccess"))) {
+ throw new ResponseStatusException(HttpStatus.FORBIDDEN);
+ }
+ if ("write".equals(op) && !UserFacade.isInRole("codbex-payments.EmployeePayment.EmployeePaymentFullAccess")) {
+ throw new ResponseStatusException(HttpStatus.FORBIDDEN);
+ }
+ }
+
+ private static void validate(EmployeePaymentEntity entity) {
+ if (entity.Employee == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Employee' property is required");
+ }
+ if (entity.Date == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Date' property is required");
+ }
+ if (entity.Valor == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Valor' property is required");
+ }
+ if (entity.OurPartyIBAN == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'OurPartyIBAN' property is required");
+ }
+ if (entity.OurPartyIBAN != null && entity.OurPartyIBAN.length() > 34) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'OurPartyIBAN' exceeds the maximum length of 34");
+ }
+ if (entity.OurPartyIBAN != null && !entity.OurPartyIBAN.toString().matches("^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$")) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The value of 'OurPartyIBAN' does not match the required pattern '^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$'");
+ }
+ if (entity.CounterpartyIBAN == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'CounterpartyIBAN' property is required");
+ }
+ if (entity.CounterpartyIBAN != null && entity.CounterpartyIBAN.length() > 34) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'CounterpartyIBAN' exceeds the maximum length of 34");
+ }
+ if (entity.CounterpartyIBAN != null && !entity.CounterpartyIBAN.toString().matches("^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$")) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The value of 'CounterpartyIBAN' does not match the required pattern '^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$'");
+ }
+ if (entity.CounterpartyName != null && entity.CounterpartyName.length() > 100) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'CounterpartyName' exceeds the maximum length of 100");
+ }
+ if (entity.Amount == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Amount' property is required");
+ }
+ if (entity.Currency == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Currency' property is required");
+ }
+ if (entity.Reason == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Reason' property is required");
+ }
+ if (entity.Reason != null && entity.Reason.length() > 100) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Reason' exceeds the maximum length of 100");
+ }
+ if (entity.Description != null && entity.Description.length() > 100) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Description' exceeds the maximum length of 100");
+ }
+ if (entity.Name != null && entity.Name.length() > 20) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Name' exceeds the maximum length of 20");
+ }
+ if (entity.UUID != null && entity.UUID.length() > 36) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'UUID' exceeds the maximum length of 36");
+ }
+ if (entity.Reference != null && entity.Reference.length() > 36) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Reference' exceeds the maximum length of 36");
+ }
+ if (entity.CreatedBy != null && entity.CreatedBy.length() > 20) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'CreatedBy' exceeds the maximum length of 20");
+ }
+ if (entity.UpdatedBy != null && entity.UpdatedBy.length() > 20) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'UpdatedBy' exceeds the maximum length of 20");
+ }
+ }
+}
diff --git a/codbex-payments/gen/codbex_payments/api/paymentadjustment/PaymentAdjustmentController.java b/codbex-payments/gen/codbex_payments/api/paymentadjustment/PaymentAdjustmentController.java
new file mode 100644
index 0000000..af71b35
--- /dev/null
+++ b/codbex-payments/gen/codbex_payments/api/paymentadjustment/PaymentAdjustmentController.java
@@ -0,0 +1,191 @@
+package gen.codbex_payments.api.paymentadjustment;
+
+import gen.codbex_payments.data.paymentadjustment.PaymentAdjustmentEntity;
+import gen.codbex_payments.data.paymentadjustment.PaymentAdjustmentRepository;
+
+import org.eclipse.dirigible.components.api.security.UserFacade;
+import org.eclipse.dirigible.engine.java.annotations.Documentation;
+import org.eclipse.dirigible.engine.java.annotations.Inject;
+import org.eclipse.dirigible.engine.java.annotations.http.Body;
+import org.eclipse.dirigible.engine.java.annotations.http.Controller;
+import org.eclipse.dirigible.engine.java.annotations.http.Delete;
+import org.eclipse.dirigible.engine.java.annotations.http.Get;
+import org.eclipse.dirigible.engine.java.annotations.http.PathParam;
+import org.eclipse.dirigible.engine.java.annotations.http.Post;
+import org.eclipse.dirigible.engine.java.annotations.http.Put;
+import org.eclipse.dirigible.engine.java.annotations.http.QueryParam;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.server.ResponseStatusException;
+
+import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+
+@Controller
+@Documentation("codbex-payments - PaymentAdjustment Controller")
+public class PaymentAdjustmentController {
+
+ private static final Set FILTER_FIELDS = Set.of("Id", "Date", "Valor", "Amount", "Currency", "Reason", "Company", "UUID", "CreatedAt", "CreatedBy", "UpdatedAt", "UpdatedBy");
+
+ @Inject
+ private PaymentAdjustmentRepository repository;
+
+ @Get
+ @Documentation("List PaymentAdjustment")
+ public List getAll(@QueryParam("$limit") Integer limit,
+ @QueryParam("$offset") Integer offset) {
+ checkPermissions("read");
+ int actualLimit = limit != null ? limit.intValue() : 20;
+ int actualOffset = offset != null ? offset.intValue() : 0;
+ List result = repository.findAll(actualLimit, actualOffset);
+ return result;
+ }
+
+ @Get("/count")
+ @Documentation("Count PaymentAdjustment")
+ public Map count() {
+ checkPermissions("read");
+ return Map.of("count", repository.count());
+ }
+
+ @Post("/count")
+ @Documentation("Count PaymentAdjustment with filter")
+ public Map countWithFilter(@Body Map filter) {
+ checkPermissions("read");
+ return Map.of("count", (long) runFilter(filter).size());
+ }
+
+ @Post("/search")
+ @Documentation("Search PaymentAdjustment")
+ public List search(@Body Map filter) {
+ checkPermissions("read");
+ List result = runFilter(filter);
+ return result;
+ }
+
+ @Get("/{id}")
+ @Documentation("Get PaymentAdjustment by id")
+ public PaymentAdjustmentEntity getById(@PathParam("id") Integer id) {
+ checkPermissions("read");
+ PaymentAdjustmentEntity entity = repository.findOne(id)
+ .orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND, "PaymentAdjustment not found"));
+ return entity;
+ }
+
+ @Post
+ @Documentation("Create PaymentAdjustment")
+ public PaymentAdjustmentEntity create(@Body PaymentAdjustmentEntity entity) {
+ checkPermissions("write");
+ validate(entity);
+ return repository.save(entity);
+ }
+
+ @Put("/{id}")
+ @Documentation("Update PaymentAdjustment by id")
+ public PaymentAdjustmentEntity update(@PathParam("id") Integer id, @Body PaymentAdjustmentEntity entity) {
+ checkPermissions("write");
+ entity.Id = id;
+ validate(entity);
+ return repository.update(entity);
+ }
+
+ @Delete("/{id}")
+ @Documentation("Delete PaymentAdjustment by id")
+ public void deleteById(@PathParam("id") Integer id) {
+ checkPermissions("write");
+ if (repository.findOne(id).isEmpty()) {
+ throw new ResponseStatusException(HttpStatus.NOT_FOUND, "PaymentAdjustment not found");
+ }
+ repository.deleteById(id);
+ }
+
+ private List runFilter(Map filter) {
+ StringBuilder hql = new StringBuilder("from PaymentAdjustmentEntity e");
+ Map params = new LinkedHashMap<>();
+ boolean first = true;
+ if (filter != null && filter.get("equals") instanceof Map, ?> equals) {
+ for (Map.Entry, ?> entry : equals.entrySet()) {
+ String field = requireKnownField(String.valueOf(entry.getKey()));
+ String paramName = "p" + params.size();
+ hql.append(first ? " where e." : " and e.").append(field).append(" = :").append(paramName);
+ params.put(paramName, entry.getValue());
+ first = false;
+ }
+ }
+ if (filter != null && filter.get("conditions") instanceof List> conditions) {
+ for (Object raw : conditions) {
+ if (!(raw instanceof Map, ?> condition)) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Invalid filter condition");
+ }
+ String field = requireKnownField(String.valueOf(condition.get("propertyName")));
+ String operator = String.valueOf(condition.get("operator")).toUpperCase(Locale.ROOT);
+ Object value = condition.get("value");
+ String paramName = "p" + params.size();
+ String clause = switch (operator) {
+ case "EQ" -> "e." + field + " = :" + paramName;
+ case "IN" -> {
+ if (!(value instanceof Collection>)) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "IN value must be a list for field: " + field);
+ }
+ yield "e." + field + " in (:" + paramName + ")";
+ }
+ case "LIKE" -> "e." + field + " like :" + paramName;
+ default -> throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Unsupported operator: " + operator);
+ };
+ hql.append(first ? " where " : " and ").append(clause);
+ params.put(paramName, value);
+ first = false;
+ }
+ }
+ return repository.query(hql.toString(), params);
+ }
+
+ private static String requireKnownField(String field) {
+ if (!FILTER_FIELDS.contains(field)) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Unknown filter field: " + field);
+ }
+ return field;
+ }
+
+ private void checkPermissions(String op) {
+ if ("read".equals(op) && !(UserFacade.isInRole("codbex-payments.PaymentAdjustment.PaymentAdjustmentReadOnly") || UserFacade.isInRole("codbex-payments.PaymentAdjustment.PaymentAdjustmentFullAccess"))) {
+ throw new ResponseStatusException(HttpStatus.FORBIDDEN);
+ }
+ if ("write".equals(op) && !UserFacade.isInRole("codbex-payments.PaymentAdjustment.PaymentAdjustmentFullAccess")) {
+ throw new ResponseStatusException(HttpStatus.FORBIDDEN);
+ }
+ }
+
+ private static void validate(PaymentAdjustmentEntity entity) {
+ if (entity.Date == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Date' property is required");
+ }
+ if (entity.Valor == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Valor' property is required");
+ }
+ if (entity.Amount == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Amount' property is required");
+ }
+ if (entity.Currency == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Currency' property is required");
+ }
+ if (entity.Reason != null && entity.Reason.length() > 100) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Reason' exceeds the maximum length of 100");
+ }
+ if (entity.Company == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Company' property is required");
+ }
+ if (entity.UUID != null && entity.UUID.length() > 36) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'UUID' exceeds the maximum length of 36");
+ }
+ if (entity.CreatedBy != null && entity.CreatedBy.length() > 20) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'CreatedBy' exceeds the maximum length of 20");
+ }
+ if (entity.UpdatedBy != null && entity.UpdatedBy.length() > 20) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'UpdatedBy' exceeds the maximum length of 20");
+ }
+ }
+}
diff --git a/codbex-payments/gen/codbex_payments/api/paymentrecord/PaymentRecordController.java b/codbex-payments/gen/codbex_payments/api/paymentrecord/PaymentRecordController.java
new file mode 100644
index 0000000..efe4bbb
--- /dev/null
+++ b/codbex-payments/gen/codbex_payments/api/paymentrecord/PaymentRecordController.java
@@ -0,0 +1,224 @@
+package gen.codbex_payments.api.paymentrecord;
+
+import gen.codbex_payments.data.paymentrecord.PaymentRecordEntity;
+import gen.codbex_payments.data.paymentrecord.PaymentRecordRepository;
+
+import org.eclipse.dirigible.components.api.security.UserFacade;
+import org.eclipse.dirigible.engine.java.annotations.Documentation;
+import org.eclipse.dirigible.engine.java.annotations.Inject;
+import org.eclipse.dirigible.engine.java.annotations.http.Body;
+import org.eclipse.dirigible.engine.java.annotations.http.Controller;
+import org.eclipse.dirigible.engine.java.annotations.http.Delete;
+import org.eclipse.dirigible.engine.java.annotations.http.Get;
+import org.eclipse.dirigible.engine.java.annotations.http.PathParam;
+import org.eclipse.dirigible.engine.java.annotations.http.Post;
+import org.eclipse.dirigible.engine.java.annotations.http.Put;
+import org.eclipse.dirigible.engine.java.annotations.http.QueryParam;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.server.ResponseStatusException;
+
+import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+
+@Controller
+@Documentation("codbex-payments - PaymentRecord Controller")
+public class PaymentRecordController {
+
+ private static final Set FILTER_FIELDS = Set.of("Id", "Date", "Valor", "OurPartyIBAN", "CounterpartyIBAN", "CounterpartyName", "Amount", "Company", "Currency", "PaymentDirection", "PaymentType", "Reason", "Description", "UUID", "Reference", "Deleted", "DeletedAt", "DeletedReason", "CreatedAt", "CreatedBy", "UpdatedAt", "UpdatedBy");
+
+ @Inject
+ private PaymentRecordRepository repository;
+
+ @Get
+ @Documentation("List PaymentRecord")
+ public List getAll(@QueryParam("$limit") Integer limit,
+ @QueryParam("$offset") Integer offset) {
+ checkPermissions("read");
+ int actualLimit = limit != null ? limit.intValue() : 20;
+ int actualOffset = offset != null ? offset.intValue() : 0;
+ List result = repository.findAll(actualLimit, actualOffset);
+ return result;
+ }
+
+ @Get("/count")
+ @Documentation("Count PaymentRecord")
+ public Map count() {
+ checkPermissions("read");
+ return Map.of("count", repository.count());
+ }
+
+ @Post("/count")
+ @Documentation("Count PaymentRecord with filter")
+ public Map countWithFilter(@Body Map filter) {
+ checkPermissions("read");
+ return Map.of("count", (long) runFilter(filter).size());
+ }
+
+ @Post("/search")
+ @Documentation("Search PaymentRecord")
+ public List search(@Body Map filter) {
+ checkPermissions("read");
+ List result = runFilter(filter);
+ return result;
+ }
+
+ @Get("/{id}")
+ @Documentation("Get PaymentRecord by id")
+ public PaymentRecordEntity getById(@PathParam("id") Integer id) {
+ checkPermissions("read");
+ PaymentRecordEntity entity = repository.findOne(id)
+ .orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND, "PaymentRecord not found"));
+ return entity;
+ }
+
+ @Post
+ @Documentation("Create PaymentRecord")
+ public PaymentRecordEntity create(@Body PaymentRecordEntity entity) {
+ checkPermissions("write");
+ validate(entity);
+ return repository.save(entity);
+ }
+
+ @Put("/{id}")
+ @Documentation("Update PaymentRecord by id")
+ public PaymentRecordEntity update(@PathParam("id") Integer id, @Body PaymentRecordEntity entity) {
+ checkPermissions("write");
+ entity.Id = id;
+ validate(entity);
+ return repository.update(entity);
+ }
+
+ @Delete("/{id}")
+ @Documentation("Delete PaymentRecord by id")
+ public void deleteById(@PathParam("id") Integer id) {
+ checkPermissions("write");
+ if (repository.findOne(id).isEmpty()) {
+ throw new ResponseStatusException(HttpStatus.NOT_FOUND, "PaymentRecord not found");
+ }
+ repository.deleteById(id);
+ }
+
+ private List runFilter(Map filter) {
+ StringBuilder hql = new StringBuilder("from PaymentRecordEntity e");
+ Map params = new LinkedHashMap<>();
+ boolean first = true;
+ if (filter != null && filter.get("equals") instanceof Map, ?> equals) {
+ for (Map.Entry, ?> entry : equals.entrySet()) {
+ String field = requireKnownField(String.valueOf(entry.getKey()));
+ String paramName = "p" + params.size();
+ hql.append(first ? " where e." : " and e.").append(field).append(" = :").append(paramName);
+ params.put(paramName, entry.getValue());
+ first = false;
+ }
+ }
+ if (filter != null && filter.get("conditions") instanceof List> conditions) {
+ for (Object raw : conditions) {
+ if (!(raw instanceof Map, ?> condition)) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Invalid filter condition");
+ }
+ String field = requireKnownField(String.valueOf(condition.get("propertyName")));
+ String operator = String.valueOf(condition.get("operator")).toUpperCase(Locale.ROOT);
+ Object value = condition.get("value");
+ String paramName = "p" + params.size();
+ String clause = switch (operator) {
+ case "EQ" -> "e." + field + " = :" + paramName;
+ case "IN" -> {
+ if (!(value instanceof Collection>)) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "IN value must be a list for field: " + field);
+ }
+ yield "e." + field + " in (:" + paramName + ")";
+ }
+ case "LIKE" -> "e." + field + " like :" + paramName;
+ default -> throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Unsupported operator: " + operator);
+ };
+ hql.append(first ? " where " : " and ").append(clause);
+ params.put(paramName, value);
+ first = false;
+ }
+ }
+ return repository.query(hql.toString(), params);
+ }
+
+ private static String requireKnownField(String field) {
+ if (!FILTER_FIELDS.contains(field)) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Unknown filter field: " + field);
+ }
+ return field;
+ }
+
+ private void checkPermissions(String op) {
+ if ("read".equals(op) && !(UserFacade.isInRole("codbex-payments.PaymentRecord.PaymentRecordReadOnly") || UserFacade.isInRole("codbex-payments.PaymentRecord.PaymentRecordFullAccess"))) {
+ throw new ResponseStatusException(HttpStatus.FORBIDDEN);
+ }
+ if ("write".equals(op) && !UserFacade.isInRole("codbex-payments.PaymentRecord.PaymentRecordFullAccess")) {
+ throw new ResponseStatusException(HttpStatus.FORBIDDEN);
+ }
+ }
+
+ private static void validate(PaymentRecordEntity entity) {
+ if (entity.Date == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Date' property is required");
+ }
+ if (entity.Valor == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Valor' property is required");
+ }
+ if (entity.OurPartyIBAN == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'OurPartyIBAN' property is required");
+ }
+ if (entity.OurPartyIBAN != null && entity.OurPartyIBAN.length() > 34) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'OurPartyIBAN' exceeds the maximum length of 34");
+ }
+ if (entity.OurPartyIBAN != null && !entity.OurPartyIBAN.toString().matches("^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$")) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The value of 'OurPartyIBAN' does not match the required pattern '^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$'");
+ }
+ if (entity.CounterpartyIBAN == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'CounterpartyIBAN' property is required");
+ }
+ if (entity.CounterpartyIBAN != null && entity.CounterpartyIBAN.length() > 34) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'CounterpartyIBAN' exceeds the maximum length of 34");
+ }
+ if (entity.CounterpartyIBAN != null && !entity.CounterpartyIBAN.toString().matches("^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$")) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The value of 'CounterpartyIBAN' does not match the required pattern '^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$'");
+ }
+ if (entity.CounterpartyName != null && entity.CounterpartyName.length() > 100) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'CounterpartyName' exceeds the maximum length of 100");
+ }
+ if (entity.Amount == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Amount' property is required");
+ }
+ if (entity.Currency == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Currency' property is required");
+ }
+ if (entity.PaymentDirection == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'PaymentDirection' property is required");
+ }
+ if (entity.PaymentType == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'PaymentType' property is required");
+ }
+ if (entity.Reason != null && entity.Reason.length() > 100) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Reason' exceeds the maximum length of 100");
+ }
+ if (entity.Description != null && entity.Description.length() > 100) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Description' exceeds the maximum length of 100");
+ }
+ if (entity.UUID != null && entity.UUID.length() > 36) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'UUID' exceeds the maximum length of 36");
+ }
+ if (entity.Reference != null && entity.Reference.length() > 36) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Reference' exceeds the maximum length of 36");
+ }
+ if (entity.DeletedReason != null && entity.DeletedReason.length() > 255) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'DeletedReason' exceeds the maximum length of 255");
+ }
+ if (entity.CreatedBy != null && entity.CreatedBy.length() > 20) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'CreatedBy' exceeds the maximum length of 20");
+ }
+ if (entity.UpdatedBy != null && entity.UpdatedBy.length() > 20) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'UpdatedBy' exceeds the maximum length of 20");
+ }
+ }
+}
diff --git a/codbex-payments/gen/codbex_payments/api/settings/PaymentDirectionController.java b/codbex-payments/gen/codbex_payments/api/settings/PaymentDirectionController.java
new file mode 100644
index 0000000..b133939
--- /dev/null
+++ b/codbex-payments/gen/codbex_payments/api/settings/PaymentDirectionController.java
@@ -0,0 +1,153 @@
+package gen.codbex_payments.api.settings;
+
+import gen.codbex_payments.data.settings.PaymentDirectionEntity;
+import gen.codbex_payments.data.settings.PaymentDirectionRepository;
+
+import org.eclipse.dirigible.components.api.security.UserFacade;
+import org.eclipse.dirigible.engine.java.annotations.Documentation;
+import org.eclipse.dirigible.engine.java.annotations.Inject;
+import org.eclipse.dirigible.engine.java.annotations.http.Body;
+import org.eclipse.dirigible.engine.java.annotations.http.Controller;
+import org.eclipse.dirigible.engine.java.annotations.http.Delete;
+import org.eclipse.dirigible.engine.java.annotations.http.Get;
+import org.eclipse.dirigible.engine.java.annotations.http.PathParam;
+import org.eclipse.dirigible.engine.java.annotations.http.Post;
+import org.eclipse.dirigible.engine.java.annotations.http.Put;
+import org.eclipse.dirigible.engine.java.annotations.http.QueryParam;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.server.ResponseStatusException;
+
+import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+
+@Controller
+@Documentation("codbex-payments - PaymentDirection Controller")
+public class PaymentDirectionController {
+
+ private static final Set FILTER_FIELDS = Set.of("Id", "Name");
+
+ @Inject
+ private PaymentDirectionRepository repository;
+
+ @Get
+ @Documentation("List PaymentDirection")
+ public List getAll(@QueryParam("$limit") Integer limit,
+ @QueryParam("$offset") Integer offset) {
+ int actualLimit = limit != null ? limit.intValue() : 20;
+ int actualOffset = offset != null ? offset.intValue() : 0;
+ List result = repository.findAll(actualLimit, actualOffset);
+ return result;
+ }
+
+ @Get("/count")
+ @Documentation("Count PaymentDirection")
+ public Map count() {
+ return Map.of("count", repository.count());
+ }
+
+ @Post("/count")
+ @Documentation("Count PaymentDirection with filter")
+ public Map countWithFilter(@Body Map filter) {
+ return Map.of("count", (long) runFilter(filter).size());
+ }
+
+ @Post("/search")
+ @Documentation("Search PaymentDirection")
+ public List search(@Body Map filter) {
+ List result = runFilter(filter);
+ return result;
+ }
+
+ @Get("/{id}")
+ @Documentation("Get PaymentDirection by id")
+ public PaymentDirectionEntity getById(@PathParam("id") Integer id) {
+ PaymentDirectionEntity entity = repository.findOne(id)
+ .orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND, "PaymentDirection not found"));
+ return entity;
+ }
+
+ @Post
+ @Documentation("Create PaymentDirection")
+ public PaymentDirectionEntity create(@Body PaymentDirectionEntity entity) {
+ validate(entity);
+ return repository.save(entity);
+ }
+
+ @Put("/{id}")
+ @Documentation("Update PaymentDirection by id")
+ public PaymentDirectionEntity update(@PathParam("id") Integer id, @Body PaymentDirectionEntity entity) {
+ entity.Id = id;
+ validate(entity);
+ return repository.update(entity);
+ }
+
+ @Delete("/{id}")
+ @Documentation("Delete PaymentDirection by id")
+ public void deleteById(@PathParam("id") Integer id) {
+ if (repository.findOne(id).isEmpty()) {
+ throw new ResponseStatusException(HttpStatus.NOT_FOUND, "PaymentDirection not found");
+ }
+ repository.deleteById(id);
+ }
+
+ private List runFilter(Map filter) {
+ StringBuilder hql = new StringBuilder("from PaymentDirectionEntity e");
+ Map params = new LinkedHashMap<>();
+ boolean first = true;
+ if (filter != null && filter.get("equals") instanceof Map, ?> equals) {
+ for (Map.Entry, ?> entry : equals.entrySet()) {
+ String field = requireKnownField(String.valueOf(entry.getKey()));
+ String paramName = "p" + params.size();
+ hql.append(first ? " where e." : " and e.").append(field).append(" = :").append(paramName);
+ params.put(paramName, entry.getValue());
+ first = false;
+ }
+ }
+ if (filter != null && filter.get("conditions") instanceof List> conditions) {
+ for (Object raw : conditions) {
+ if (!(raw instanceof Map, ?> condition)) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Invalid filter condition");
+ }
+ String field = requireKnownField(String.valueOf(condition.get("propertyName")));
+ String operator = String.valueOf(condition.get("operator")).toUpperCase(Locale.ROOT);
+ Object value = condition.get("value");
+ String paramName = "p" + params.size();
+ String clause = switch (operator) {
+ case "EQ" -> "e." + field + " = :" + paramName;
+ case "IN" -> {
+ if (!(value instanceof Collection>)) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "IN value must be a list for field: " + field);
+ }
+ yield "e." + field + " in (:" + paramName + ")";
+ }
+ case "LIKE" -> "e." + field + " like :" + paramName;
+ default -> throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Unsupported operator: " + operator);
+ };
+ hql.append(first ? " where " : " and ").append(clause);
+ params.put(paramName, value);
+ first = false;
+ }
+ }
+ return repository.query(hql.toString(), params);
+ }
+
+ private static String requireKnownField(String field) {
+ if (!FILTER_FIELDS.contains(field)) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Unknown filter field: " + field);
+ }
+ return field;
+ }
+
+ private static void validate(PaymentDirectionEntity entity) {
+ if (entity.Name == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Name' property is required");
+ }
+ if (entity.Name != null && entity.Name.length() > 20) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Name' exceeds the maximum length of 20");
+ }
+ }
+}
diff --git a/codbex-payments/gen/codbex_payments/api/settings/PaymentTypeController.java b/codbex-payments/gen/codbex_payments/api/settings/PaymentTypeController.java
new file mode 100644
index 0000000..17d6fcb
--- /dev/null
+++ b/codbex-payments/gen/codbex_payments/api/settings/PaymentTypeController.java
@@ -0,0 +1,170 @@
+package gen.codbex_payments.api.settings;
+
+import gen.codbex_payments.data.settings.PaymentTypeEntity;
+import gen.codbex_payments.data.settings.PaymentTypeRepository;
+
+import org.eclipse.dirigible.components.api.security.UserFacade;
+import org.eclipse.dirigible.engine.java.annotations.Documentation;
+import org.eclipse.dirigible.engine.java.annotations.Inject;
+import org.eclipse.dirigible.engine.java.annotations.http.Body;
+import org.eclipse.dirigible.engine.java.annotations.http.Controller;
+import org.eclipse.dirigible.engine.java.annotations.http.Delete;
+import org.eclipse.dirigible.engine.java.annotations.http.Get;
+import org.eclipse.dirigible.engine.java.annotations.http.PathParam;
+import org.eclipse.dirigible.engine.java.annotations.http.Post;
+import org.eclipse.dirigible.engine.java.annotations.http.Put;
+import org.eclipse.dirigible.engine.java.annotations.http.QueryParam;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.server.ResponseStatusException;
+
+import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+
+@Controller
+@Documentation("codbex-payments - PaymentType Controller")
+public class PaymentTypeController {
+
+ private static final Set FILTER_FIELDS = Set.of("Id", "Name");
+
+ @Inject
+ private PaymentTypeRepository repository;
+
+ @Get
+ @Documentation("List PaymentType")
+ public List getAll(@QueryParam("$limit") Integer limit,
+ @QueryParam("$offset") Integer offset) {
+ checkPermissions("read");
+ int actualLimit = limit != null ? limit.intValue() : 20;
+ int actualOffset = offset != null ? offset.intValue() : 0;
+ List result = repository.findAll(actualLimit, actualOffset);
+ return result;
+ }
+
+ @Get("/count")
+ @Documentation("Count PaymentType")
+ public Map count() {
+ checkPermissions("read");
+ return Map.of("count", repository.count());
+ }
+
+ @Post("/count")
+ @Documentation("Count PaymentType with filter")
+ public Map countWithFilter(@Body Map filter) {
+ checkPermissions("read");
+ return Map.of("count", (long) runFilter(filter).size());
+ }
+
+ @Post("/search")
+ @Documentation("Search PaymentType")
+ public List search(@Body Map filter) {
+ checkPermissions("read");
+ List result = runFilter(filter);
+ return result;
+ }
+
+ @Get("/{id}")
+ @Documentation("Get PaymentType by id")
+ public PaymentTypeEntity getById(@PathParam("id") Integer id) {
+ checkPermissions("read");
+ PaymentTypeEntity entity = repository.findOne(id)
+ .orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND, "PaymentType not found"));
+ return entity;
+ }
+
+ @Post
+ @Documentation("Create PaymentType")
+ public PaymentTypeEntity create(@Body PaymentTypeEntity entity) {
+ checkPermissions("write");
+ validate(entity);
+ return repository.save(entity);
+ }
+
+ @Put("/{id}")
+ @Documentation("Update PaymentType by id")
+ public PaymentTypeEntity update(@PathParam("id") Integer id, @Body PaymentTypeEntity entity) {
+ checkPermissions("write");
+ entity.Id = id;
+ validate(entity);
+ return repository.update(entity);
+ }
+
+ @Delete("/{id}")
+ @Documentation("Delete PaymentType by id")
+ public void deleteById(@PathParam("id") Integer id) {
+ checkPermissions("write");
+ if (repository.findOne(id).isEmpty()) {
+ throw new ResponseStatusException(HttpStatus.NOT_FOUND, "PaymentType not found");
+ }
+ repository.deleteById(id);
+ }
+
+ private List runFilter(Map filter) {
+ StringBuilder hql = new StringBuilder("from PaymentTypeEntity e");
+ Map params = new LinkedHashMap<>();
+ boolean first = true;
+ if (filter != null && filter.get("equals") instanceof Map, ?> equals) {
+ for (Map.Entry, ?> entry : equals.entrySet()) {
+ String field = requireKnownField(String.valueOf(entry.getKey()));
+ String paramName = "p" + params.size();
+ hql.append(first ? " where e." : " and e.").append(field).append(" = :").append(paramName);
+ params.put(paramName, entry.getValue());
+ first = false;
+ }
+ }
+ if (filter != null && filter.get("conditions") instanceof List> conditions) {
+ for (Object raw : conditions) {
+ if (!(raw instanceof Map, ?> condition)) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Invalid filter condition");
+ }
+ String field = requireKnownField(String.valueOf(condition.get("propertyName")));
+ String operator = String.valueOf(condition.get("operator")).toUpperCase(Locale.ROOT);
+ Object value = condition.get("value");
+ String paramName = "p" + params.size();
+ String clause = switch (operator) {
+ case "EQ" -> "e." + field + " = :" + paramName;
+ case "IN" -> {
+ if (!(value instanceof Collection>)) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "IN value must be a list for field: " + field);
+ }
+ yield "e." + field + " in (:" + paramName + ")";
+ }
+ case "LIKE" -> "e." + field + " like :" + paramName;
+ default -> throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Unsupported operator: " + operator);
+ };
+ hql.append(first ? " where " : " and ").append(clause);
+ params.put(paramName, value);
+ first = false;
+ }
+ }
+ return repository.query(hql.toString(), params);
+ }
+
+ private static String requireKnownField(String field) {
+ if (!FILTER_FIELDS.contains(field)) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Unknown filter field: " + field);
+ }
+ return field;
+ }
+
+ private void checkPermissions(String op) {
+ if ("read".equals(op) && !(UserFacade.isInRole("codbex-payments.Settings.PaymentTypeReadOnly") || UserFacade.isInRole("codbex-payments.Settings.PaymentTypeFullAccess"))) {
+ throw new ResponseStatusException(HttpStatus.FORBIDDEN);
+ }
+ if ("write".equals(op) && !UserFacade.isInRole("codbex-payments.Settings.PaymentTypeFullAccess")) {
+ throw new ResponseStatusException(HttpStatus.FORBIDDEN);
+ }
+ }
+
+ private static void validate(PaymentTypeEntity entity) {
+ if (entity.Name == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Name' property is required");
+ }
+ if (entity.Name != null && entity.Name.length() > 20) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Name' exceeds the maximum length of 20");
+ }
+ }
+}
diff --git a/codbex-payments/gen/codbex_payments/api/supplierpayment/SupplierPaymentController.java b/codbex-payments/gen/codbex_payments/api/supplierpayment/SupplierPaymentController.java
new file mode 100644
index 0000000..9f1e54e
--- /dev/null
+++ b/codbex-payments/gen/codbex_payments/api/supplierpayment/SupplierPaymentController.java
@@ -0,0 +1,227 @@
+package gen.codbex_payments.api.supplierpayment;
+
+import gen.codbex_payments.data.supplierpayment.SupplierPaymentEntity;
+import gen.codbex_payments.data.supplierpayment.SupplierPaymentRepository;
+
+import org.eclipse.dirigible.components.api.security.UserFacade;
+import org.eclipse.dirigible.engine.java.annotations.Documentation;
+import org.eclipse.dirigible.engine.java.annotations.Inject;
+import org.eclipse.dirigible.engine.java.annotations.http.Body;
+import org.eclipse.dirigible.engine.java.annotations.http.Controller;
+import org.eclipse.dirigible.engine.java.annotations.http.Delete;
+import org.eclipse.dirigible.engine.java.annotations.http.Get;
+import org.eclipse.dirigible.engine.java.annotations.http.PathParam;
+import org.eclipse.dirigible.engine.java.annotations.http.Post;
+import org.eclipse.dirigible.engine.java.annotations.http.Put;
+import org.eclipse.dirigible.engine.java.annotations.http.QueryParam;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.server.ResponseStatusException;
+
+import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+
+@Controller
+@Documentation("codbex-payments - SupplierPayment Controller")
+public class SupplierPaymentController {
+
+ private static final Set FILTER_FIELDS = Set.of("Id", "Supplier", "Date", "Valor", "OurPartyIBAN", "CounterpartyIBAN", "CounterpartyName", "Amount", "Currency", "Company", "Reason", "Description", "PaymentMethod", "Name", "UUID", "Reference", "CreatedAt", "CreatedBy", "UpdatedAt", "UpdatedBy");
+
+ @Inject
+ private SupplierPaymentRepository repository;
+
+ @Get
+ @Documentation("List SupplierPayment")
+ public List getAll(@QueryParam("$limit") Integer limit,
+ @QueryParam("$offset") Integer offset) {
+ checkPermissions("read");
+ int actualLimit = limit != null ? limit.intValue() : 20;
+ int actualOffset = offset != null ? offset.intValue() : 0;
+ List result = repository.findAll(actualLimit, actualOffset);
+ return result;
+ }
+
+ @Get("/count")
+ @Documentation("Count SupplierPayment")
+ public Map count() {
+ checkPermissions("read");
+ return Map.of("count", repository.count());
+ }
+
+ @Post("/count")
+ @Documentation("Count SupplierPayment with filter")
+ public Map countWithFilter(@Body Map filter) {
+ checkPermissions("read");
+ return Map.of("count", (long) runFilter(filter).size());
+ }
+
+ @Post("/search")
+ @Documentation("Search SupplierPayment")
+ public List search(@Body Map filter) {
+ checkPermissions("read");
+ List result = runFilter(filter);
+ return result;
+ }
+
+ @Get("/{id}")
+ @Documentation("Get SupplierPayment by id")
+ public SupplierPaymentEntity getById(@PathParam("id") Integer id) {
+ checkPermissions("read");
+ SupplierPaymentEntity entity = repository.findOne(id)
+ .orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND, "SupplierPayment not found"));
+ return entity;
+ }
+
+ @Post
+ @Documentation("Create SupplierPayment")
+ public SupplierPaymentEntity create(@Body SupplierPaymentEntity entity) {
+ checkPermissions("write");
+ validate(entity);
+ return repository.save(entity);
+ }
+
+ @Put("/{id}")
+ @Documentation("Update SupplierPayment by id")
+ public SupplierPaymentEntity update(@PathParam("id") Integer id, @Body SupplierPaymentEntity entity) {
+ checkPermissions("write");
+ entity.Id = id;
+ validate(entity);
+ return repository.update(entity);
+ }
+
+ @Delete("/{id}")
+ @Documentation("Delete SupplierPayment by id")
+ public void deleteById(@PathParam("id") Integer id) {
+ checkPermissions("write");
+ if (repository.findOne(id).isEmpty()) {
+ throw new ResponseStatusException(HttpStatus.NOT_FOUND, "SupplierPayment not found");
+ }
+ repository.deleteById(id);
+ }
+
+ private List runFilter(Map filter) {
+ StringBuilder hql = new StringBuilder("from SupplierPaymentEntity e");
+ Map params = new LinkedHashMap<>();
+ boolean first = true;
+ if (filter != null && filter.get("equals") instanceof Map, ?> equals) {
+ for (Map.Entry, ?> entry : equals.entrySet()) {
+ String field = requireKnownField(String.valueOf(entry.getKey()));
+ String paramName = "p" + params.size();
+ hql.append(first ? " where e." : " and e.").append(field).append(" = :").append(paramName);
+ params.put(paramName, entry.getValue());
+ first = false;
+ }
+ }
+ if (filter != null && filter.get("conditions") instanceof List> conditions) {
+ for (Object raw : conditions) {
+ if (!(raw instanceof Map, ?> condition)) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Invalid filter condition");
+ }
+ String field = requireKnownField(String.valueOf(condition.get("propertyName")));
+ String operator = String.valueOf(condition.get("operator")).toUpperCase(Locale.ROOT);
+ Object value = condition.get("value");
+ String paramName = "p" + params.size();
+ String clause = switch (operator) {
+ case "EQ" -> "e." + field + " = :" + paramName;
+ case "IN" -> {
+ if (!(value instanceof Collection>)) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "IN value must be a list for field: " + field);
+ }
+ yield "e." + field + " in (:" + paramName + ")";
+ }
+ case "LIKE" -> "e." + field + " like :" + paramName;
+ default -> throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Unsupported operator: " + operator);
+ };
+ hql.append(first ? " where " : " and ").append(clause);
+ params.put(paramName, value);
+ first = false;
+ }
+ }
+ return repository.query(hql.toString(), params);
+ }
+
+ private static String requireKnownField(String field) {
+ if (!FILTER_FIELDS.contains(field)) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Unknown filter field: " + field);
+ }
+ return field;
+ }
+
+ private void checkPermissions(String op) {
+ if ("read".equals(op) && !(UserFacade.isInRole("codbex-payments.SupplierPayment.SupplierPaymentReadOnly") || UserFacade.isInRole("codbex-payments.SupplierPayment.SupplierPaymentFullAccess"))) {
+ throw new ResponseStatusException(HttpStatus.FORBIDDEN);
+ }
+ if ("write".equals(op) && !UserFacade.isInRole("codbex-payments.SupplierPayment.SupplierPaymentFullAccess")) {
+ throw new ResponseStatusException(HttpStatus.FORBIDDEN);
+ }
+ }
+
+ private static void validate(SupplierPaymentEntity entity) {
+ if (entity.Supplier == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Supplier' property is required");
+ }
+ if (entity.Date == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Date' property is required");
+ }
+ if (entity.Valor == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Valor' property is required");
+ }
+ if (entity.OurPartyIBAN == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'OurPartyIBAN' property is required");
+ }
+ if (entity.OurPartyIBAN != null && entity.OurPartyIBAN.length() > 34) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'OurPartyIBAN' exceeds the maximum length of 34");
+ }
+ if (entity.OurPartyIBAN != null && !entity.OurPartyIBAN.toString().matches("^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$")) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The value of 'OurPartyIBAN' does not match the required pattern '^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$'");
+ }
+ if (entity.CounterpartyIBAN == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'CounterpartyIBAN' property is required");
+ }
+ if (entity.CounterpartyIBAN != null && entity.CounterpartyIBAN.length() > 34) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'CounterpartyIBAN' exceeds the maximum length of 34");
+ }
+ if (entity.CounterpartyIBAN != null && !entity.CounterpartyIBAN.toString().matches("^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$")) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The value of 'CounterpartyIBAN' does not match the required pattern '^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$'");
+ }
+ if (entity.CounterpartyName != null && entity.CounterpartyName.length() > 100) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'CounterpartyName' exceeds the maximum length of 100");
+ }
+ if (entity.Amount == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Amount' property is required");
+ }
+ if (entity.Currency == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Currency' property is required");
+ }
+ if (entity.Reason == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Reason' property is required");
+ }
+ if (entity.Reason != null && entity.Reason.length() > 100) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Reason' exceeds the maximum length of 100");
+ }
+ if (entity.Description != null && entity.Description.length() > 100) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Description' exceeds the maximum length of 100");
+ }
+ if (entity.PaymentMethod == null) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'PaymentMethod' property is required");
+ }
+ if (entity.Name != null && entity.Name.length() > 20) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Name' exceeds the maximum length of 20");
+ }
+ if (entity.UUID != null && entity.UUID.length() > 36) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'UUID' exceeds the maximum length of 36");
+ }
+ if (entity.Reference != null && entity.Reference.length() > 36) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'Reference' exceeds the maximum length of 36");
+ }
+ if (entity.CreatedBy != null && entity.CreatedBy.length() > 20) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'CreatedBy' exceeds the maximum length of 20");
+ }
+ if (entity.UpdatedBy != null && entity.UpdatedBy.length() > 20) {
+ throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "The 'UpdatedBy' exceeds the maximum length of 20");
+ }
+ }
+}
diff --git a/codbex-payments/gen/codbex-payments/data/CustomerPayment/CustomerPayment.extensionpoint b/codbex-payments/gen/codbex_payments/data/customerpayment/CustomerPayment.extensionpoint
similarity index 98%
rename from codbex-payments/gen/codbex-payments/data/CustomerPayment/CustomerPayment.extensionpoint
rename to codbex-payments/gen/codbex_payments/data/customerpayment/CustomerPayment.extensionpoint
index 4136418..f4092b6 100644
--- a/codbex-payments/gen/codbex-payments/data/CustomerPayment/CustomerPayment.extensionpoint
+++ b/codbex-payments/gen/codbex_payments/data/customerpayment/CustomerPayment.extensionpoint
@@ -1,4 +1,4 @@
{
"name": "codbex-payments-CustomerPayment-CustomerPayment",
"description": "Extension Point for the codbex-payments-CustomerPayment-CustomerPayment entity"
-}
\ No newline at end of file
+}
diff --git a/codbex-payments/gen/codbex_payments/data/customerpayment/CustomerPaymentEntity.java b/codbex-payments/gen/codbex_payments/data/customerpayment/CustomerPaymentEntity.java
new file mode 100644
index 0000000..6cbc415
--- /dev/null
+++ b/codbex-payments/gen/codbex_payments/data/customerpayment/CustomerPaymentEntity.java
@@ -0,0 +1,106 @@
+package gen.codbex_payments.data.customerpayment;
+
+import org.eclipse.dirigible.engine.java.annotations.Column;
+import org.eclipse.dirigible.engine.java.annotations.CreatedAt;
+import org.eclipse.dirigible.engine.java.annotations.CreatedBy;
+import org.eclipse.dirigible.engine.java.annotations.Documentation;
+import org.eclipse.dirigible.engine.java.annotations.Entity;
+import org.eclipse.dirigible.engine.java.annotations.GeneratedValue;
+import org.eclipse.dirigible.engine.java.annotations.GenerationType;
+import org.eclipse.dirigible.engine.java.annotations.Id;
+import org.eclipse.dirigible.engine.java.annotations.Table;
+import org.eclipse.dirigible.engine.java.annotations.UpdatedAt;
+import org.eclipse.dirigible.engine.java.annotations.UpdatedBy;
+
+@Entity
+@Table(name = "CODBEX_CUSTOMERPAYMENT")
+@Documentation("CustomerPayment entity mapping")
+public class CustomerPaymentEntity {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "CUSTOMERPAYMENT_ID")
+ @Documentation("Id")
+ public Integer Id;
+
+ @Column(name = "CUSTOMERPAYMENT_CUSTOMER", nullable = false)
+ @Documentation("Customer")
+ public Integer Customer;
+
+ @Column(name = "CUSTOMERPAYMENT_DATE", nullable = false)
+ @Documentation("Date")
+ public java.time.LocalDate Date;
+
+ @Column(name = "CUSTOMERPAYMENT_VALOR", nullable = false)
+ @Documentation("Valor")
+ public java.time.LocalDate Valor;
+
+ @Column(name = "CUSTOMERPAYMENT_OURPARTYIBAN", length = 34, nullable = false)
+ @Documentation("OurPartyIBAN")
+ public String OurPartyIBAN;
+
+ @Column(name = "CUSTOMERPAYMENT_COUNTERPARTYIBAN", length = 34, nullable = false)
+ @Documentation("CounterpartyIBAN")
+ public String CounterpartyIBAN;
+
+ @Column(name = "CUSTOMERPAYMENT_COUNTERPARTYNAME", length = 100, nullable = true)
+ @Documentation("CounterpartyName")
+ public String CounterpartyName;
+
+ @Column(name = "CUSTOMERPAYMENT_AMOUNT", precision = 16, scale = 2, nullable = false)
+ @Documentation("Amount")
+ public java.math.BigDecimal Amount;
+
+ @Column(name = "CUSTOMERPAYMENT_CURRENCY", nullable = false)
+ @Documentation("Currency")
+ public Integer Currency;
+
+ @Column(name = "CUSTOMERPAYMENT_COMPANY", nullable = true)
+ @Documentation("Company")
+ public Integer Company;
+
+ @Column(name = "CUSTOMERPAYMENT_REASON", length = 100, nullable = false)
+ @Documentation("Reason")
+ public String Reason;
+
+ @Column(name = "CUSTOMERPAYMENT_DESCRIPTION", length = 100, nullable = true)
+ @Documentation("Description")
+ public String Description;
+
+ @Column(name = "CUSTOMERPAYMENT_PAYMENTMETHOD", nullable = false)
+ @Documentation("PaymentMethod")
+ public Integer PaymentMethod;
+
+ @Column(name = "CUSTOMERPAYMENT_NAME", length = 20, nullable = true)
+ @Documentation("Name")
+ public String Name;
+
+ @Column(name = "CUSTOMERPAYMENT_UUID", length = 36, nullable = false, unique = true)
+ @Documentation("UUID")
+ public String UUID;
+
+ @Column(name = "CUSTOMERPAYMENT_REFERENCE", length = 36, nullable = true)
+ @Documentation("Reference")
+ public String Reference;
+
+ @CreatedAt
+ @Column(name = "CUSTOMERPAYMENT_CREATEDAT", nullable = true)
+ @Documentation("CreatedAt")
+ public java.time.Instant CreatedAt;
+
+ @CreatedBy
+ @Column(name = "CUSTOMERPAYMENT_CREATEDBY", length = 20, nullable = true)
+ @Documentation("CreatedBy")
+ public String CreatedBy;
+
+ @UpdatedAt
+ @Column(name = "CUSTOMERPAYMENT_UPDATEDAT", nullable = true)
+ @Documentation("UpdatedAt")
+ public java.time.Instant UpdatedAt;
+
+ @UpdatedBy
+ @Column(name = "CUSTOMERPAYMENT_UPDATEDBY", length = 20, nullable = true)
+ @Documentation("UpdatedBy")
+ public String UpdatedBy;
+
+}
diff --git a/codbex-payments/gen/codbex_payments/data/customerpayment/CustomerPaymentRepository.java b/codbex-payments/gen/codbex_payments/data/customerpayment/CustomerPaymentRepository.java
new file mode 100644
index 0000000..62e1a6e
--- /dev/null
+++ b/codbex-payments/gen/codbex_payments/data/customerpayment/CustomerPaymentRepository.java
@@ -0,0 +1,19 @@
+package gen.codbex_payments.data.customerpayment;
+
+import org.eclipse.dirigible.components.data.store.java.repository.JavaRepository;
+import org.eclipse.dirigible.engine.java.annotations.Repository;
+
+@Repository
+public class CustomerPaymentRepository extends JavaRepository {
+
+ public CustomerPaymentRepository() {
+ super(CustomerPaymentEntity.class);
+ }
+
+ @Override
+ public CustomerPaymentEntity save(CustomerPaymentEntity entity) {
+ entity.Name = new Generator().generateByType("Customer Payment");
+ entity.UUID = Uuid.random();
+ return super.save(entity);
+ }
+}
diff --git a/codbex-payments/gen/codbex-payments/data/EmployeePayment/EmployeePayment.extensionpoint b/codbex-payments/gen/codbex_payments/data/employeepayment/EmployeePayment.extensionpoint
similarity index 98%
rename from codbex-payments/gen/codbex-payments/data/EmployeePayment/EmployeePayment.extensionpoint
rename to codbex-payments/gen/codbex_payments/data/employeepayment/EmployeePayment.extensionpoint
index 3516966..d253298 100644
--- a/codbex-payments/gen/codbex-payments/data/EmployeePayment/EmployeePayment.extensionpoint
+++ b/codbex-payments/gen/codbex_payments/data/employeepayment/EmployeePayment.extensionpoint
@@ -1,4 +1,4 @@
{
"name": "codbex-payments-EmployeePayment-EmployeePayment",
"description": "Extension Point for the codbex-payments-EmployeePayment-EmployeePayment entity"
-}
\ No newline at end of file
+}
diff --git a/codbex-payments/gen/codbex_payments/data/employeepayment/EmployeePaymentEntity.java b/codbex-payments/gen/codbex_payments/data/employeepayment/EmployeePaymentEntity.java
new file mode 100644
index 0000000..3a5a519
--- /dev/null
+++ b/codbex-payments/gen/codbex_payments/data/employeepayment/EmployeePaymentEntity.java
@@ -0,0 +1,102 @@
+package gen.codbex_payments.data.employeepayment;
+
+import org.eclipse.dirigible.engine.java.annotations.Column;
+import org.eclipse.dirigible.engine.java.annotations.CreatedAt;
+import org.eclipse.dirigible.engine.java.annotations.CreatedBy;
+import org.eclipse.dirigible.engine.java.annotations.Documentation;
+import org.eclipse.dirigible.engine.java.annotations.Entity;
+import org.eclipse.dirigible.engine.java.annotations.GeneratedValue;
+import org.eclipse.dirigible.engine.java.annotations.GenerationType;
+import org.eclipse.dirigible.engine.java.annotations.Id;
+import org.eclipse.dirigible.engine.java.annotations.Table;
+import org.eclipse.dirigible.engine.java.annotations.UpdatedAt;
+import org.eclipse.dirigible.engine.java.annotations.UpdatedBy;
+
+@Entity
+@Table(name = "CODBEX_EMPLOYEEPAYMENT")
+@Documentation("EmployeePayment entity mapping")
+public class EmployeePaymentEntity {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "EMPLOYEEPAYMENT_ID")
+ @Documentation("Id")
+ public Integer Id;
+
+ @Column(name = "EMPLOYEEPAYMENT_EMPLOYEE", nullable = false)
+ @Documentation("Employee")
+ public Integer Employee;
+
+ @Column(name = "EMPLOYEEPAYMENT_DATE", nullable = false)
+ @Documentation("Date")
+ public java.time.LocalDate Date;
+
+ @Column(name = "EMPLOYEEPAYMENT_VALOR", nullable = false)
+ @Documentation("Valor")
+ public java.time.LocalDate Valor;
+
+ @Column(name = "EMPLOYEEPAYMENT_OURPARTYIBAN", length = 34, nullable = false)
+ @Documentation("OurPartyIBAN")
+ public String OurPartyIBAN;
+
+ @Column(name = "EMPLOYEEPAYMENT_COUNTERPARTYIBAN", length = 34, nullable = false)
+ @Documentation("CounterpartyIBAN")
+ public String CounterpartyIBAN;
+
+ @Column(name = "EMPLOYEEPAYMENT_COUNTERPARTYNAME", length = 100, nullable = true)
+ @Documentation("CounterpartyName")
+ public String CounterpartyName;
+
+ @Column(name = "EMPLOYEEPAYMENT_AMOUNT", precision = 16, scale = 2, nullable = false)
+ @Documentation("Amount")
+ public java.math.BigDecimal Amount;
+
+ @Column(name = "EMPLOYEEPAYMENT_CURRENCY", nullable = false)
+ @Documentation("Currency")
+ public Integer Currency;
+
+ @Column(name = "EMPLOYEEPAYMENT_COMPANY", nullable = true)
+ @Documentation("Company")
+ public Integer Company;
+
+ @Column(name = "EMPLOYEEPAYMENT_REASON", length = 100, nullable = false)
+ @Documentation("Reason")
+ public String Reason;
+
+ @Column(name = "EMPLOYEEPAYMENT_DESCRIPTION", length = 100, nullable = true)
+ @Documentation("Description")
+ public String Description;
+
+ @Column(name = "EMPLOYEEPAYMENT_NAME", length = 20, nullable = true)
+ @Documentation("Name")
+ public String Name;
+
+ @Column(name = "EMPLOYEEPAYMENT_UUID", length = 36, nullable = false, unique = true)
+ @Documentation("UUID")
+ public String UUID;
+
+ @Column(name = "EMPLOYEEPAYMENT_REFERENCE", length = 36, nullable = true)
+ @Documentation("Reference")
+ public String Reference;
+
+ @CreatedAt
+ @Column(name = "EMPLOYEEPAYMENT_CREATEDAT", nullable = true)
+ @Documentation("CreatedAt")
+ public java.time.Instant CreatedAt;
+
+ @CreatedBy
+ @Column(name = "EMPLOYEEPAYMENT_CREATEDBY", length = 20, nullable = true)
+ @Documentation("CreatedBy")
+ public String CreatedBy;
+
+ @UpdatedAt
+ @Column(name = "EMPLOYEEPAYMENT_UPDATEDAT", nullable = true)
+ @Documentation("UpdatedAt")
+ public java.time.Instant UpdatedAt;
+
+ @UpdatedBy
+ @Column(name = "EMPLOYEEPAYMENT_UPDATEDBY", length = 20, nullable = true)
+ @Documentation("UpdatedBy")
+ public String UpdatedBy;
+
+}
diff --git a/codbex-payments/gen/codbex_payments/data/employeepayment/EmployeePaymentRepository.java b/codbex-payments/gen/codbex_payments/data/employeepayment/EmployeePaymentRepository.java
new file mode 100644
index 0000000..98708b9
--- /dev/null
+++ b/codbex-payments/gen/codbex_payments/data/employeepayment/EmployeePaymentRepository.java
@@ -0,0 +1,19 @@
+package gen.codbex_payments.data.employeepayment;
+
+import org.eclipse.dirigible.components.data.store.java.repository.JavaRepository;
+import org.eclipse.dirigible.engine.java.annotations.Repository;
+
+@Repository
+public class EmployeePaymentRepository extends JavaRepository {
+
+ public EmployeePaymentRepository() {
+ super(EmployeePaymentEntity.class);
+ }
+
+ @Override
+ public EmployeePaymentEntity save(EmployeePaymentEntity entity) {
+ entity.Name = new Generator().generateByType("Employee Payment");
+ entity.UUID = Uuid.random();
+ return super.save(entity);
+ }
+}
diff --git a/codbex-payments/gen/codbex-payments/data/PaymentAdjustment/PaymentAdjustment.extensionpoint b/codbex-payments/gen/codbex_payments/data/paymentadjustment/PaymentAdjustment.extensionpoint
similarity index 98%
rename from codbex-payments/gen/codbex-payments/data/PaymentAdjustment/PaymentAdjustment.extensionpoint
rename to codbex-payments/gen/codbex_payments/data/paymentadjustment/PaymentAdjustment.extensionpoint
index 98bfe6f..3d4208b 100644
--- a/codbex-payments/gen/codbex-payments/data/PaymentAdjustment/PaymentAdjustment.extensionpoint
+++ b/codbex-payments/gen/codbex_payments/data/paymentadjustment/PaymentAdjustment.extensionpoint
@@ -1,4 +1,4 @@
{
"name": "codbex-payments-PaymentAdjustment-PaymentAdjustment",
"description": "Extension Point for the codbex-payments-PaymentAdjustment-PaymentAdjustment entity"
-}
\ No newline at end of file
+}
diff --git a/codbex-payments/gen/codbex_payments/data/paymentadjustment/PaymentAdjustmentEntity.java b/codbex-payments/gen/codbex_payments/data/paymentadjustment/PaymentAdjustmentEntity.java
new file mode 100644
index 0000000..8d8b5a9
--- /dev/null
+++ b/codbex-payments/gen/codbex_payments/data/paymentadjustment/PaymentAdjustmentEntity.java
@@ -0,0 +1,74 @@
+package gen.codbex_payments.data.paymentadjustment;
+
+import org.eclipse.dirigible.engine.java.annotations.Column;
+import org.eclipse.dirigible.engine.java.annotations.CreatedAt;
+import org.eclipse.dirigible.engine.java.annotations.CreatedBy;
+import org.eclipse.dirigible.engine.java.annotations.Documentation;
+import org.eclipse.dirigible.engine.java.annotations.Entity;
+import org.eclipse.dirigible.engine.java.annotations.GeneratedValue;
+import org.eclipse.dirigible.engine.java.annotations.GenerationType;
+import org.eclipse.dirigible.engine.java.annotations.Id;
+import org.eclipse.dirigible.engine.java.annotations.Table;
+import org.eclipse.dirigible.engine.java.annotations.UpdatedAt;
+import org.eclipse.dirigible.engine.java.annotations.UpdatedBy;
+
+@Entity
+@Table(name = "CODBEX_PAYMENTADJUSTMENT")
+@Documentation("PaymentAdjustment entity mapping")
+public class PaymentAdjustmentEntity {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "PAYMENTADJUSTMENT_ID")
+ @Documentation("Id")
+ public Integer Id;
+
+ @Column(name = "PAYMENTADJUSTMENT_DATE", nullable = false)
+ @Documentation("Date")
+ public java.time.LocalDate Date;
+
+ @Column(name = "PAYMENTADJUSTMENT_VALOR", nullable = false)
+ @Documentation("Valor")
+ public java.time.LocalDate Valor;
+
+ @Column(name = "PAYMENTADJUSTMENT_AMOUNT", precision = 16, scale = 2, nullable = false)
+ @Documentation("Amount")
+ public java.math.BigDecimal Amount;
+
+ @Column(name = "PAYMENTADJUSTMENT_CURRENCY", nullable = false)
+ @Documentation("Currency")
+ public Integer Currency;
+
+ @Column(name = "PAYMENTADJUSTMENT_REASON", length = 100, nullable = true)
+ @Documentation("Reason")
+ public String Reason;
+
+ @Column(name = "PAYMENTADJUSTMENT_COMPANY", nullable = false)
+ @Documentation("Company")
+ public Integer Company;
+
+ @Column(name = "PAYMENTADJUSTMENT_UUID", length = 36, nullable = true, unique = true)
+ @Documentation("UUID")
+ public String UUID;
+
+ @CreatedAt
+ @Column(name = "PAYMENTADJUSTMENT_CREATEDAT", nullable = true)
+ @Documentation("CreatedAt")
+ public java.time.Instant CreatedAt;
+
+ @CreatedBy
+ @Column(name = "PAYMENTADJUSTMENT_CREATEDBY", length = 20, nullable = true)
+ @Documentation("CreatedBy")
+ public String CreatedBy;
+
+ @UpdatedAt
+ @Column(name = "PAYMENTADJUSTMENT_UPDATEDAT", nullable = true)
+ @Documentation("UpdatedAt")
+ public java.time.Instant UpdatedAt;
+
+ @UpdatedBy
+ @Column(name = "PAYMENTADJUSTMENT_UPDATEDBY", length = 20, nullable = true)
+ @Documentation("UpdatedBy")
+ public String UpdatedBy;
+
+}
diff --git a/codbex-payments/gen/codbex_payments/data/paymentadjustment/PaymentAdjustmentRepository.java b/codbex-payments/gen/codbex_payments/data/paymentadjustment/PaymentAdjustmentRepository.java
new file mode 100644
index 0000000..f6a8c58
--- /dev/null
+++ b/codbex-payments/gen/codbex_payments/data/paymentadjustment/PaymentAdjustmentRepository.java
@@ -0,0 +1,18 @@
+package gen.codbex_payments.data.paymentadjustment;
+
+import org.eclipse.dirigible.components.data.store.java.repository.JavaRepository;
+import org.eclipse.dirigible.engine.java.annotations.Repository;
+
+@Repository
+public class PaymentAdjustmentRepository extends JavaRepository {
+
+ public PaymentAdjustmentRepository() {
+ super(PaymentAdjustmentEntity.class);
+ }
+
+ @Override
+ public PaymentAdjustmentEntity save(PaymentAdjustmentEntity entity) {
+ entity.UUID = Uuid.random();
+ return super.save(entity);
+ }
+}
diff --git a/codbex-payments/gen/codbex-payments/data/PaymentRecord/PaymentRecord.extensionpoint b/codbex-payments/gen/codbex_payments/data/paymentrecord/PaymentRecord.extensionpoint
similarity index 98%
rename from codbex-payments/gen/codbex-payments/data/PaymentRecord/PaymentRecord.extensionpoint
rename to codbex-payments/gen/codbex_payments/data/paymentrecord/PaymentRecord.extensionpoint
index b1251db..ea0c354 100644
--- a/codbex-payments/gen/codbex-payments/data/PaymentRecord/PaymentRecord.extensionpoint
+++ b/codbex-payments/gen/codbex_payments/data/paymentrecord/PaymentRecord.extensionpoint
@@ -1,4 +1,4 @@
{
"name": "codbex-payments-PaymentRecord-PaymentRecord",
"description": "Extension Point for the codbex-payments-PaymentRecord-PaymentRecord entity"
-}
\ No newline at end of file
+}
diff --git a/codbex-payments/gen/codbex_payments/data/paymentrecord/PaymentRecordEntity.java b/codbex-payments/gen/codbex_payments/data/paymentrecord/PaymentRecordEntity.java
new file mode 100644
index 0000000..83ee954
--- /dev/null
+++ b/codbex-payments/gen/codbex_payments/data/paymentrecord/PaymentRecordEntity.java
@@ -0,0 +1,114 @@
+package gen.codbex_payments.data.paymentrecord;
+
+import org.eclipse.dirigible.engine.java.annotations.Column;
+import org.eclipse.dirigible.engine.java.annotations.CreatedAt;
+import org.eclipse.dirigible.engine.java.annotations.CreatedBy;
+import org.eclipse.dirigible.engine.java.annotations.Documentation;
+import org.eclipse.dirigible.engine.java.annotations.Entity;
+import org.eclipse.dirigible.engine.java.annotations.GeneratedValue;
+import org.eclipse.dirigible.engine.java.annotations.GenerationType;
+import org.eclipse.dirigible.engine.java.annotations.Id;
+import org.eclipse.dirigible.engine.java.annotations.Table;
+import org.eclipse.dirigible.engine.java.annotations.UpdatedAt;
+import org.eclipse.dirigible.engine.java.annotations.UpdatedBy;
+
+@Entity
+@Table(name = "CODBEX_PAYMENTRECORD")
+@Documentation("PaymentRecord entity mapping")
+public class PaymentRecordEntity {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "PAYMENTRECORD_ID")
+ @Documentation("Id")
+ public Integer Id;
+
+ @Column(name = "PAYMENTRECORD_DATE", nullable = false)
+ @Documentation("Date")
+ public java.time.LocalDate Date;
+
+ @Column(name = "PAYMENTRECORD_VALOR", nullable = false)
+ @Documentation("Valor")
+ public java.time.LocalDate Valor;
+
+ @Column(name = "PAYMENTRECORD_OURPARTYIBAN", length = 34, nullable = false)
+ @Documentation("OurPartyIBAN")
+ public String OurPartyIBAN;
+
+ @Column(name = "PAYMENTRECORD_COUNTERPARTYIBAN", length = 34, nullable = false)
+ @Documentation("CounterpartyIBAN")
+ public String CounterpartyIBAN;
+
+ @Column(name = "PAYMENTRECORD_COUNTERPARTYNAME", length = 100, nullable = true)
+ @Documentation("CounterpartyName")
+ public String CounterpartyName;
+
+ @Column(name = "PAYMENTRECORD_AMOUNT", precision = 16, scale = 2, nullable = false)
+ @Documentation("Amount")
+ public java.math.BigDecimal Amount;
+
+ @Column(name = "PAYMENTRECORD_COMPANY", nullable = true)
+ @Documentation("Company")
+ public Integer Company;
+
+ @Column(name = "PAYMENTRECORD_CURRENCY", nullable = false)
+ @Documentation("Currency")
+ public Integer Currency;
+
+ @Column(name = "PAYMENTRECORD_PAYMENTDIRECTION", nullable = false)
+ @Documentation("PaymentDirection")
+ public Integer PaymentDirection;
+
+ @Column(name = "PAYMENTRECORD_PAYMENTTYPE", nullable = false)
+ @Documentation("PaymentType")
+ public Integer PaymentType;
+
+ @Column(name = "PAYMENTRECORD_REASON", length = 100, nullable = true)
+ @Documentation("Reason")
+ public String Reason;
+
+ @Column(name = "PAYMENTRECORD_DESCRIPTION", length = 100, nullable = true)
+ @Documentation("Description")
+ public String Description;
+
+ @Column(name = "PAYMENTRECORD_UUID", length = 36, nullable = false, unique = true)
+ @Documentation("UUID")
+ public String UUID;
+
+ @Column(name = "PAYMENTRECORD_REFERENCE", length = 36, nullable = true)
+ @Documentation("Reference")
+ public String Reference;
+
+ @Column(name = "PAYMENTRECORD_DELETED", nullable = true)
+ @Documentation("Deleted")
+ public Boolean Deleted;
+
+ @Column(name = "PAYMENTRECORD_DELETEDAT", nullable = true)
+ @Documentation("DeletedAt")
+ public java.time.Instant DeletedAt;
+
+ @Column(name = "PAYMENTRECORD_DELETEDREASON", length = 255, nullable = true)
+ @Documentation("DeletedReason")
+ public String DeletedReason;
+
+ @CreatedAt
+ @Column(name = "PAYMENTRECORD_CREATEDAT", nullable = true)
+ @Documentation("CreatedAt")
+ public java.time.Instant CreatedAt;
+
+ @CreatedBy
+ @Column(name = "PAYMENTRECORD_CREATEDBY", length = 20, nullable = true)
+ @Documentation("CreatedBy")
+ public String CreatedBy;
+
+ @UpdatedAt
+ @Column(name = "PAYMENTRECORD_UPDATEDAT", nullable = true)
+ @Documentation("UpdatedAt")
+ public java.time.Instant UpdatedAt;
+
+ @UpdatedBy
+ @Column(name = "PAYMENTRECORD_UPDATEDBY", length = 20, nullable = true)
+ @Documentation("UpdatedBy")
+ public String UpdatedBy;
+
+}
diff --git a/codbex-payments/gen/codbex_payments/data/paymentrecord/PaymentRecordRepository.java b/codbex-payments/gen/codbex_payments/data/paymentrecord/PaymentRecordRepository.java
new file mode 100644
index 0000000..9bc83cc
--- /dev/null
+++ b/codbex-payments/gen/codbex_payments/data/paymentrecord/PaymentRecordRepository.java
@@ -0,0 +1,18 @@
+package gen.codbex_payments.data.paymentrecord;
+
+import org.eclipse.dirigible.components.data.store.java.repository.JavaRepository;
+import org.eclipse.dirigible.engine.java.annotations.Repository;
+
+@Repository
+public class PaymentRecordRepository extends JavaRepository {
+
+ public PaymentRecordRepository() {
+ super(PaymentRecordEntity.class);
+ }
+
+ @Override
+ public PaymentRecordEntity save(PaymentRecordEntity entity) {
+ entity.UUID = Uuid.random();
+ return super.save(entity);
+ }
+}
diff --git a/codbex-payments/gen/codbex-payments/data/Settings/PaymentDirection.extensionpoint b/codbex-payments/gen/codbex_payments/data/settings/PaymentDirection.extensionpoint
similarity index 98%
rename from codbex-payments/gen/codbex-payments/data/Settings/PaymentDirection.extensionpoint
rename to codbex-payments/gen/codbex_payments/data/settings/PaymentDirection.extensionpoint
index 44517c5..7a74d59 100644
--- a/codbex-payments/gen/codbex-payments/data/Settings/PaymentDirection.extensionpoint
+++ b/codbex-payments/gen/codbex_payments/data/settings/PaymentDirection.extensionpoint
@@ -1,4 +1,4 @@
{
"name": "codbex-payments-Settings-PaymentDirection",
"description": "Extension Point for the codbex-payments-Settings-PaymentDirection entity"
-}
\ No newline at end of file
+}
diff --git a/codbex-payments/gen/codbex_payments/data/settings/PaymentDirectionEntity.java b/codbex-payments/gen/codbex_payments/data/settings/PaymentDirectionEntity.java
new file mode 100644
index 0000000..b0b6d21
--- /dev/null
+++ b/codbex-payments/gen/codbex_payments/data/settings/PaymentDirectionEntity.java
@@ -0,0 +1,30 @@
+package gen.codbex_payments.data.settings;
+
+import org.eclipse.dirigible.engine.java.annotations.Column;
+import org.eclipse.dirigible.engine.java.annotations.CreatedAt;
+import org.eclipse.dirigible.engine.java.annotations.CreatedBy;
+import org.eclipse.dirigible.engine.java.annotations.Documentation;
+import org.eclipse.dirigible.engine.java.annotations.Entity;
+import org.eclipse.dirigible.engine.java.annotations.GeneratedValue;
+import org.eclipse.dirigible.engine.java.annotations.GenerationType;
+import org.eclipse.dirigible.engine.java.annotations.Id;
+import org.eclipse.dirigible.engine.java.annotations.Table;
+import org.eclipse.dirigible.engine.java.annotations.UpdatedAt;
+import org.eclipse.dirigible.engine.java.annotations.UpdatedBy;
+
+@Entity
+@Table(name = "CODBEX_PAYMENTDIRECTION")
+@Documentation("PaymentDirection entity mapping")
+public class PaymentDirectionEntity {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "PAYMENTDIRECTION_ID")
+ @Documentation("Id")
+ public Integer Id;
+
+ @Column(name = "PAYMENTDIRECTION_NAME", length = 20, nullable = false)
+ @Documentation("Name")
+ public String Name;
+
+}
diff --git a/codbex-payments/gen/codbex_payments/data/settings/PaymentDirectionRepository.java b/codbex-payments/gen/codbex_payments/data/settings/PaymentDirectionRepository.java
new file mode 100644
index 0000000..415636f
--- /dev/null
+++ b/codbex-payments/gen/codbex_payments/data/settings/PaymentDirectionRepository.java
@@ -0,0 +1,12 @@
+package gen.codbex_payments.data.settings;
+
+import org.eclipse.dirigible.components.data.store.java.repository.JavaRepository;
+import org.eclipse.dirigible.engine.java.annotations.Repository;
+
+@Repository
+public class PaymentDirectionRepository extends JavaRepository {
+
+ public PaymentDirectionRepository() {
+ super(PaymentDirectionEntity.class);
+ }
+}
diff --git a/codbex-payments/gen/codbex-payments/data/Settings/PaymentType.extensionpoint b/codbex-payments/gen/codbex_payments/data/settings/PaymentType.extensionpoint
similarity index 98%
rename from codbex-payments/gen/codbex-payments/data/Settings/PaymentType.extensionpoint
rename to codbex-payments/gen/codbex_payments/data/settings/PaymentType.extensionpoint
index 5e9fecc..a310cb5 100644
--- a/codbex-payments/gen/codbex-payments/data/Settings/PaymentType.extensionpoint
+++ b/codbex-payments/gen/codbex_payments/data/settings/PaymentType.extensionpoint
@@ -1,4 +1,4 @@
{
"name": "codbex-payments-Settings-PaymentType",
"description": "Extension Point for the codbex-payments-Settings-PaymentType entity"
-}
\ No newline at end of file
+}
diff --git a/codbex-payments/gen/codbex_payments/data/settings/PaymentTypeEntity.java b/codbex-payments/gen/codbex_payments/data/settings/PaymentTypeEntity.java
new file mode 100644
index 0000000..578d54a
--- /dev/null
+++ b/codbex-payments/gen/codbex_payments/data/settings/PaymentTypeEntity.java
@@ -0,0 +1,30 @@
+package gen.codbex_payments.data.settings;
+
+import org.eclipse.dirigible.engine.java.annotations.Column;
+import org.eclipse.dirigible.engine.java.annotations.CreatedAt;
+import org.eclipse.dirigible.engine.java.annotations.CreatedBy;
+import org.eclipse.dirigible.engine.java.annotations.Documentation;
+import org.eclipse.dirigible.engine.java.annotations.Entity;
+import org.eclipse.dirigible.engine.java.annotations.GeneratedValue;
+import org.eclipse.dirigible.engine.java.annotations.GenerationType;
+import org.eclipse.dirigible.engine.java.annotations.Id;
+import org.eclipse.dirigible.engine.java.annotations.Table;
+import org.eclipse.dirigible.engine.java.annotations.UpdatedAt;
+import org.eclipse.dirigible.engine.java.annotations.UpdatedBy;
+
+@Entity
+@Table(name = "CODBEX_PAYMENTTYPE")
+@Documentation("PaymentType entity mapping")
+public class PaymentTypeEntity {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "PAYMENTTYPE_ID")
+ @Documentation("Id")
+ public Integer Id;
+
+ @Column(name = "PAYMENTTYPE_NAME", length = 20, nullable = false)
+ @Documentation("Name")
+ public String Name;
+
+}
diff --git a/codbex-payments/gen/codbex_payments/data/settings/PaymentTypeRepository.java b/codbex-payments/gen/codbex_payments/data/settings/PaymentTypeRepository.java
new file mode 100644
index 0000000..db1c09b
--- /dev/null
+++ b/codbex-payments/gen/codbex_payments/data/settings/PaymentTypeRepository.java
@@ -0,0 +1,12 @@
+package gen.codbex_payments.data.settings;
+
+import org.eclipse.dirigible.components.data.store.java.repository.JavaRepository;
+import org.eclipse.dirigible.engine.java.annotations.Repository;
+
+@Repository
+public class PaymentTypeRepository extends JavaRepository {
+
+ public PaymentTypeRepository() {
+ super(PaymentTypeEntity.class);
+ }
+}
diff --git a/codbex-payments/gen/codbex-payments/data/SupplierPayment/SupplierPayment.extensionpoint b/codbex-payments/gen/codbex_payments/data/supplierpayment/SupplierPayment.extensionpoint
similarity index 98%
rename from codbex-payments/gen/codbex-payments/data/SupplierPayment/SupplierPayment.extensionpoint
rename to codbex-payments/gen/codbex_payments/data/supplierpayment/SupplierPayment.extensionpoint
index b8295aa..b2af2c8 100644
--- a/codbex-payments/gen/codbex-payments/data/SupplierPayment/SupplierPayment.extensionpoint
+++ b/codbex-payments/gen/codbex_payments/data/supplierpayment/SupplierPayment.extensionpoint
@@ -1,4 +1,4 @@
{
"name": "codbex-payments-SupplierPayment-SupplierPayment",
"description": "Extension Point for the codbex-payments-SupplierPayment-SupplierPayment entity"
-}
\ No newline at end of file
+}
diff --git a/codbex-payments/gen/codbex_payments/data/supplierpayment/SupplierPaymentEntity.java b/codbex-payments/gen/codbex_payments/data/supplierpayment/SupplierPaymentEntity.java
new file mode 100644
index 0000000..4681424
--- /dev/null
+++ b/codbex-payments/gen/codbex_payments/data/supplierpayment/SupplierPaymentEntity.java
@@ -0,0 +1,106 @@
+package gen.codbex_payments.data.supplierpayment;
+
+import org.eclipse.dirigible.engine.java.annotations.Column;
+import org.eclipse.dirigible.engine.java.annotations.CreatedAt;
+import org.eclipse.dirigible.engine.java.annotations.CreatedBy;
+import org.eclipse.dirigible.engine.java.annotations.Documentation;
+import org.eclipse.dirigible.engine.java.annotations.Entity;
+import org.eclipse.dirigible.engine.java.annotations.GeneratedValue;
+import org.eclipse.dirigible.engine.java.annotations.GenerationType;
+import org.eclipse.dirigible.engine.java.annotations.Id;
+import org.eclipse.dirigible.engine.java.annotations.Table;
+import org.eclipse.dirigible.engine.java.annotations.UpdatedAt;
+import org.eclipse.dirigible.engine.java.annotations.UpdatedBy;
+
+@Entity
+@Table(name = "CODBEX_SUPPLIERPAYMENT")
+@Documentation("SupplierPayment entity mapping")
+public class SupplierPaymentEntity {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "SUPPLIERPAYMENT_ID")
+ @Documentation("Id")
+ public Integer Id;
+
+ @Column(name = "SUPPLIERPAYMENT_SUPPLIER", nullable = false)
+ @Documentation("Supplier")
+ public Integer Supplier;
+
+ @Column(name = "SUPPLIERPAYMENT_DATE", nullable = false)
+ @Documentation("Date")
+ public java.time.LocalDate Date;
+
+ @Column(name = "SUPPLIERPAYMENT_VALOR", nullable = false)
+ @Documentation("Valor")
+ public java.time.LocalDate Valor;
+
+ @Column(name = "SUPPLIERPAYMENT_OURPARTYIBAN", length = 34, nullable = false)
+ @Documentation("OurPartyIBAN")
+ public String OurPartyIBAN;
+
+ @Column(name = "SUPPLIERPAYMENT_COUNTERPARTYIBAN", length = 34, nullable = false)
+ @Documentation("CounterpartyIBAN")
+ public String CounterpartyIBAN;
+
+ @Column(name = "SUPPLIERPAYMENT_COUNTERPARTYNAME", length = 100, nullable = true)
+ @Documentation("CounterpartyName")
+ public String CounterpartyName;
+
+ @Column(name = "SUPPLIERPAYMENT_AMOUNT", precision = 16, scale = 2, nullable = false)
+ @Documentation("Amount")
+ public java.math.BigDecimal Amount;
+
+ @Column(name = "SUPPLIERPAYMENT_CURRENCY", nullable = false)
+ @Documentation("Currency")
+ public Integer Currency;
+
+ @Column(name = "SUPPLIERPAYMENT_COMPANY", nullable = true)
+ @Documentation("Company")
+ public Integer Company;
+
+ @Column(name = "SUPPLIERPAYMENT_REASON", length = 100, nullable = false)
+ @Documentation("Reason")
+ public String Reason;
+
+ @Column(name = "SUPPLIERPAYMENT_DESCRIPTION", length = 100, nullable = true)
+ @Documentation("Description")
+ public String Description;
+
+ @Column(name = "SUPPLIERPAYMENT_PAYMENTMETHOD", nullable = false)
+ @Documentation("PaymentMethod")
+ public Integer PaymentMethod;
+
+ @Column(name = "SUPPLIERPAYMENT_NAME", length = 20, nullable = true)
+ @Documentation("Name")
+ public String Name;
+
+ @Column(name = "SUPPLIERPAYMENT_UUID", length = 36, nullable = false, unique = true)
+ @Documentation("UUID")
+ public String UUID;
+
+ @Column(name = "SUPPLIERPAYMENT_REFERENCE", length = 36, nullable = true)
+ @Documentation("Reference")
+ public String Reference;
+
+ @CreatedAt
+ @Column(name = "SUPPLIERPAYMENT_CREATEDAT", nullable = true)
+ @Documentation("CreatedAt")
+ public java.time.Instant CreatedAt;
+
+ @CreatedBy
+ @Column(name = "SUPPLIERPAYMENT_CREATEDBY", length = 20, nullable = true)
+ @Documentation("CreatedBy")
+ public String CreatedBy;
+
+ @UpdatedAt
+ @Column(name = "SUPPLIERPAYMENT_UPDATEDAT", nullable = true)
+ @Documentation("UpdatedAt")
+ public java.time.Instant UpdatedAt;
+
+ @UpdatedBy
+ @Column(name = "SUPPLIERPAYMENT_UPDATEDBY", length = 20, nullable = true)
+ @Documentation("UpdatedBy")
+ public String UpdatedBy;
+
+}
diff --git a/codbex-payments/gen/codbex_payments/data/supplierpayment/SupplierPaymentRepository.java b/codbex-payments/gen/codbex_payments/data/supplierpayment/SupplierPaymentRepository.java
new file mode 100644
index 0000000..210d9aa
--- /dev/null
+++ b/codbex-payments/gen/codbex_payments/data/supplierpayment/SupplierPaymentRepository.java
@@ -0,0 +1,19 @@
+package gen.codbex_payments.data.supplierpayment;
+
+import org.eclipse.dirigible.components.data.store.java.repository.JavaRepository;
+import org.eclipse.dirigible.engine.java.annotations.Repository;
+
+@Repository
+public class SupplierPaymentRepository extends JavaRepository {
+
+ public SupplierPaymentRepository() {
+ super(SupplierPaymentEntity.class);
+ }
+
+ @Override
+ public SupplierPaymentEntity save(SupplierPaymentEntity entity) {
+ entity.Name = new Generator().generateByType("Employee Payment");
+ entity.UUID = Uuid.random();
+ return super.save(entity);
+ }
+}
diff --git a/codbex-payments/gen/codbex-payments/roles/default-roles.roles b/codbex-payments/gen/codbex_payments/roles/default-roles.roles
similarity index 99%
rename from codbex-payments/gen/codbex-payments/roles/default-roles.roles
rename to codbex-payments/gen/codbex_payments/roles/default-roles.roles
index 83a1f87..aae9a47 100644
--- a/codbex-payments/gen/codbex-payments/roles/default-roles.roles
+++ b/codbex-payments/gen/codbex_payments/roles/default-roles.roles
@@ -47,4 +47,4 @@
"name": "codbex-payments.PaymentAdjustment.PaymentAdjustmentFullAccess",
"description": "A role that grants full access for PaymentAdjustment."
}
-]
\ No newline at end of file
+]
diff --git a/codbex-payments/translations/en-US/codbex-payments.model.json b/codbex-payments/translations/en-US/codbex-payments.model.json
index 60149c4..8711f19 100644
--- a/codbex-payments/translations/en-US/codbex-payments.model.json
+++ b/codbex-payments/translations/en-US/codbex-payments.model.json
@@ -76,13 +76,13 @@
"CUSTOMERPAYMENT_COUNTERPARTYNAME": "CounterpartyName",
"CUSTOMERPAYMENT_AMOUNT": "Amount",
"CUSTOMERPAYMENT_CURRENCY": "Currency",
+ "CUSTOMERPAYMENT_COMPANY": "Company",
"CUSTOMERPAYMENT_REASON": "Reason",
"CUSTOMERPAYMENT_DESCRIPTION": "Description",
- "CUSTOMERPAYMENT_COMPANY": "Company",
+ "CUSTOMERPAYMENT_PAYMENTMETHOD": "PaymentMethod",
"CUSTOMERPAYMENT_NAME": "Name",
"CUSTOMERPAYMENT_UUID": "UUID",
"CUSTOMERPAYMENT_REFERENCE": "Reference",
- "CUSTOMERPAYMENT_PAYMENTMETHOD": "PaymentMethod",
"CUSTOMERPAYMENT_CREATEDAT": "CreatedAt",
"CUSTOMERPAYMENT_CREATEDBY": "CreatedBy",
"CUSTOMERPAYMENT_UPDATEDAT": "UpdatedAt",
@@ -97,13 +97,13 @@
"SUPPLIERPAYMENT_COUNTERPARTYNAME": "CounterpartyName",
"SUPPLIERPAYMENT_AMOUNT": "Amount",
"SUPPLIERPAYMENT_CURRENCY": "Currency",
+ "SUPPLIERPAYMENT_COMPANY": "Company",
"SUPPLIERPAYMENT_REASON": "Reason",
"SUPPLIERPAYMENT_DESCRIPTION": "Description",
- "SUPPLIERPAYMENT_COMPANY": "Company",
+ "SUPPLIERPAYMENT_PAYMENTMETHOD": "PaymentMethod",
"SUPPLIERPAYMENT_NAME": "Name",
"SUPPLIERPAYMENT_UUID": "UUID",
"SUPPLIERPAYMENT_REFERENCE": "Reference",
- "SUPPLIERPAYMENT_PAYMENTMETHOD": "PaymentMethod",
"SUPPLIERPAYMENT_CREATEDAT": "CreatedAt",
"SUPPLIERPAYMENT_CREATEDBY": "CreatedBy",
"SUPPLIERPAYMENT_UPDATEDAT": "UpdatedAt",
@@ -118,13 +118,12 @@
"EMPLOYEEPAYMENT_COUNTERPARTYNAME": "CounterpartyName",
"EMPLOYEEPAYMENT_AMOUNT": "Amount",
"EMPLOYEEPAYMENT_CURRENCY": "Currency",
+ "EMPLOYEEPAYMENT_COMPANY": "Company",
"EMPLOYEEPAYMENT_REASON": "Reason",
"EMPLOYEEPAYMENT_DESCRIPTION": "Description",
- "EMPLOYEEPAYMENT_COMPANY": "Company",
"EMPLOYEEPAYMENT_NAME": "Name",
"EMPLOYEEPAYMENT_UUID": "UUID",
"EMPLOYEEPAYMENT_REFERENCE": "Reference",
- "EMPLOYEEPAYMENT_PAYMENTMETHOD": "PaymentMethod",
"EMPLOYEEPAYMENT_CREATEDAT": "CreatedAt",
"EMPLOYEEPAYMENT_CREATEDBY": "CreatedBy",
"EMPLOYEEPAYMENT_UPDATEDAT": "UpdatedAt",
@@ -137,12 +136,12 @@
"PAYMENTRECORD_COUNTERPARTYIBAN": "CounterpartyIBAN",
"PAYMENTRECORD_COUNTERPARTYNAME": "CounterpartyName",
"PAYMENTRECORD_AMOUNT": "Amount",
+ "PAYMENTRECORD_COMPANY": "Company",
"PAYMENTRECORD_CURRENCY": "Currency",
"PAYMENTRECORD_PAYMENTDIRECTION": "PaymentDirection",
"PAYMENTRECORD_PAYMENTTYPE": "PaymentType",
"PAYMENTRECORD_REASON": "Reason",
"PAYMENTRECORD_DESCRIPTION": "Description",
- "PAYMENTRECORD_COMPANY": "Company",
"PAYMENTRECORD_UUID": "UUID",
"PAYMENTRECORD_REFERENCE": "Reference",
"PAYMENTRECORD_DELETED": "Deleted",
@@ -152,52 +151,17 @@
"PAYMENTRECORD_CREATEDBY": "CreatedBy",
"PAYMENTRECORD_UPDATEDAT": "UpdatedAt",
"PAYMENTRECORD_UPDATEDBY": "UpdatedBy",
- "CURRENCY": "Currency",
- "CURRENCY_ID": "Id",
- "CURRENCY_CODE": "Code",
- "CURRENCY_NAME": "Name",
- "CURRENCY_NUMERIC": "Numeric",
- "CURRENCY_ROUNDING": "Rounding",
- "CURRENCY_BASE": "Base",
- "CURRENCY_RATE": "Rate",
- "COMPANY": "Company",
- "COMPANY_ID": "Id",
- "COMPANY_NAME": "Name",
- "COMPANY_MANAGER": "Manager",
- "COMPANY_EMAIL": "Email",
- "COMPANY_PHONE": "Phone",
- "COMPANY_ADDRESS": "Address",
- "COMPANY_POSTCODE": "PostCode",
- "COMPANY_CITY": "City",
- "COMPANY_COUNTRY": "Country",
- "COMPANY_TIN": "TIN",
- "COMPANY_IBAN": "IBAN",
"PAYMENTTYPE": "PaymentType",
"PAYMENTTYPE_ID": "Id",
"PAYMENTTYPE_NAME": "Name",
- "PAYMENTMETHOD": "PaymentMethod",
- "PAYMENTMETHOD_ID": "Id",
- "PAYMENTMETHOD_NAME": "Name",
- "CUSTOMER": "Customer",
- "CUSTOMER_ID": "Id",
- "CUSTOMER_NAME": "Name",
- "CUSTOMER_ADDRESS": "Address",
- "CUSTOMER_POSTALCODE": "PostalCode",
- "CUSTOMER_EMAIL": "Email",
- "CUSTOMER_PHONE": "Phone",
- "CUSTOMER_FAX": "Fax",
- "CUSTOMER_COUNTRY": "Country",
- "CUSTOMER_CITY": "City",
- "CUSTOMER_TIN": "TIN",
- "CUSTOMER_IBAN": "IBAN",
"PAYMENTADJUSTMENT": "PaymentAdjustment",
"PAYMENTADJUSTMENT_ID": "Id",
"PAYMENTADJUSTMENT_DATE": "Date",
"PAYMENTADJUSTMENT_VALOR": "Valor",
"PAYMENTADJUSTMENT_AMOUNT": "Amount",
"PAYMENTADJUSTMENT_CURRENCY": "Currency",
- "PAYMENTADJUSTMENT_COMPANY": "Company",
"PAYMENTADJUSTMENT_REASON": "Reason",
+ "PAYMENTADJUSTMENT_COMPANY": "Company",
"PAYMENTADJUSTMENT_UUID": "UUID",
"PAYMENTADJUSTMENT_CREATEDAT": "CreatedAt",
"PAYMENTADJUSTMENT_CREATEDBY": "CreatedBy",
@@ -206,6 +170,26 @@
"PAYMENTDIRECTION": "PaymentDirection",
"PAYMENTDIRECTION_ID": "Id",
"PAYMENTDIRECTION_NAME": "Name",
+ "CUSTOMER": "Customer",
+ "CUSTOMER_ID": "Id",
+ "CUSTOMER_FIRSTNAME": "FirstName",
+ "CUSTOMER_LASTNAME": "LastName",
+ "CUSTOMER_LEGALENTITYNAME": "LegalEntityName",
+ "CUSTOMER_NAME": "Name",
+ "CUSTOMER_EMAIL": "Email",
+ "CUSTOMER_PHONE": "Phone",
+ "CUSTOMER_COUNTRY": "Country",
+ "CUSTOMER_CITY": "City",
+ "CUSTOMER_FAX": "Fax",
+ "CUSTOMER_ADDRESS": "Address",
+ "CUSTOMER_POSTALCODE": "PostalCode",
+ "CUSTOMER_TIN": "TIN",
+ "CUSTOMER_IBAN": "IBAN",
+ "CUSTOMER_RESPONSIBLEPERSON": "ResponsiblePerson",
+ "CUSTOMER_CREATEDAT": "CreatedAt",
+ "CUSTOMER_CREATEDBY": "CreatedBy",
+ "CUSTOMER_UPDATEDAT": "UpdatedAt",
+ "CUSTOMER_UPDATEDBY": "UpdatedBy",
"EMPLOYEE": "Employee",
"EMPLOYEE_ID": "Id",
"EMPLOYEE_FIRSTNAME": "First Name",
@@ -220,6 +204,10 @@
"EMPLOYEE_GENDER": "Gender",
"EMPLOYEE_MARTIALSTATUS": "MartialStatus",
"EMPLOYEE_IBAN": "IBAN",
+ "EMPLOYEE_CREATEDAT": "CreatedAt",
+ "EMPLOYEE_CREATEDBY": "CreatedBy",
+ "EMPLOYEE_UPDATEDAT": "UpdatedAt",
+ "EMPLOYEE_UPDATEDBY": "UpdatedBy",
"SUPPLIER": "Supplier",
"SUPPLIER_ID": "Id",
"SUPPLIER_FIRSTNAME": "FirstName",
@@ -232,6 +220,40 @@
"SUPPLIER_TIN": "TIN",
"SUPPLIER_IBAN": "IBAN",
"SUPPLIER_CREATEDAT": "CreatedAt",
+ "SUPPLIER_CREATEDBY": "CreatedBy",
+ "SUPPLIER_UPDATEDAT": "UpdatedAt",
+ "SUPPLIER_UPDATEDBY": "UpdatedBy",
+ "PAYMENTMETHOD": "PaymentMethod",
+ "PAYMENTMETHOD_ID": "Id",
+ "PAYMENTMETHOD_NAME": "Name",
+ "CURRENCY": "Currency",
+ "CURRENCY_ID": "Id",
+ "CURRENCY_CODE": "Code",
+ "CURRENCY_NAME": "Name",
+ "CURRENCY_NUMERIC": "Numeric",
+ "CURRENCY_ROUNDING": "Rounding",
+ "CURRENCY_BASE": "Base",
+ "CURRENCY_RATE": "Rate",
+ "CURRENCY_CREATEDAT": "CreatedAt",
+ "CURRENCY_CREATEDBY": "CreatedBy",
+ "CURRENCY_UPDATEDAT": "UpdatedAt",
+ "CURRENCY_UPDATEDBY": "UpdatedBy",
+ "COMPANY": "Company",
+ "COMPANY_ID": "Id",
+ "COMPANY_NAME": "Name",
+ "COMPANY_EMAIL": "Email",
+ "COMPANY_MANAGER": "Manager",
+ "COMPANY_PHONE": "Phone",
+ "COMPANY_ADDRESS": "Address",
+ "COMPANY_COUNTRY": "Country",
+ "COMPANY_CITY": "City",
+ "COMPANY_POSTCODE": "PostCode",
+ "COMPANY_TIN": "TIN",
+ "COMPANY_IBAN": "IBAN",
+ "COMPANY_CREATEDAT": "CreatedAt",
+ "COMPANY_CREATEDBY": "CreatedBy",
+ "COMPANY_UPDATEDAT": "UpdatedAt",
+ "COMPANY_UPDATEDBY": "UpdatedBy",
"CustomerPayment": "CustomerPayment",
"SupplierPayment": "SupplierPayment",
"PaymentRecord": "PaymentRecord",
|