From 39983fe1745d4f6dd337876547d43ed0834beab3 Mon Sep 17 00:00:00 2001 From: EdwinBetanc0urt Date: Tue, 19 Sep 2023 09:51:42 -0400 Subject: [PATCH] add entollment and express movement. --- resources/envoy.yaml | 16 ++++++-- src/main/proto/business.proto | 34 ++++++++--------- src/main/proto/core_functionality.proto | 8 ++-- src/main/proto/dashboarding.proto | 4 +- src/main/proto/dictionary.proto | 16 ++++---- src/main/proto/enrollment.proto | 38 +++++++++++++++---- src/main/proto/express_movement.proto | 49 ++++++++++++++++++++----- src/main/proto/security.proto | 9 +++-- 8 files changed, 119 insertions(+), 55 deletions(-) diff --git a/resources/envoy.yaml b/resources/envoy.yaml index dda4eaf66..b6e7d8f8f 100644 --- a/resources/envoy.yaml +++ b/resources/envoy.yaml @@ -2,7 +2,10 @@ static_resources: listeners: - name: listener1 address: - socket_address: {address: 0.0.0.0, port_value: 5555} + socket_address: { + address: 0.0.0.0, + port_value: 5555 + } filter_chains: - filters: - name: envoy.filters.network.http_connection_manager @@ -19,8 +22,13 @@ static_resources: # NOTE: by default, matching happens based on the gRPC route, and not on the incoming request path. # Reference: https://envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/grpc_json_transcoder_filter#route-configs-for-transcoded-requests # https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/grpc_json_transcoder_filter#sample-envoy-configuration - - match: {prefix: "/"} - route: {cluster: grpc, timeout: 60s} + - match: { + prefix: "/" + } + route: { + cluster: grpc, + timeout: 60s + } http_filters: - name: envoy.filters.http.grpc_json_transcoder typed_config: @@ -36,6 +44,8 @@ static_resources: - data.CoreFunctionality - dashboarding.Dashboarding - dictionary.Dictionary + - enrollment.Register + - express_movement.ExpressMovement print_options: add_whitespace: true always_print_primitive_fields: true diff --git a/src/main/proto/business.proto b/src/main/proto/business.proto index e1980c935..8fff8b990 100644 --- a/src/main/proto/business.proto +++ b/src/main/proto/business.proto @@ -27,25 +27,25 @@ package data; service BusinessData { // Get a Entity rpc GetEntity(GetEntityRequest) returns (Entity) { - option (google.api.http) = { get: "/business-data/entity/{id}" }; + option (google.api.http) = { get: "/business-data/entities/{id}" }; } // Create Entity Request rpc CreateEntity(CreateEntityRequest) returns (Entity) { option (google.api.http) = { - post: "/business-data/entity", + post: "/business-data/entities", body: "*" }; } // Update Entity Request rpc UpdateEntity(UpdateEntityRequest) returns (Entity) { option (google.api.http) = { - put: "/business-data/entity", + put: "/business-data/entities/{id}", body: "*" }; } // Delete Entity Request rpc DeleteEntity(DeleteEntityRequest) returns (Empty) { - option (google.api.http) = { delete: "/business-data/entity/{id}" }; + option (google.api.http) = { delete: "/business-data/entities/{id}" }; } // List a Entities rpc ListEntities(ListEntitiesRequest) returns (ListEntitiesResponse) { @@ -54,7 +54,7 @@ service BusinessData { // Request a BusinessProcess / Report rpc RunBusinessProcess(RunBusinessProcessRequest) returns (ProcessLog) { option (google.api.http) = { - post: "/business-data/run-process", + post: "/business-data/process", body: "*" }; } @@ -64,19 +64,19 @@ service BusinessData { service UserInterface { // Get a Tab Entity rpc GetTabEntity(GetTabEntityRequest) returns (Entity) { - option (google.api.http) = { get: "/user-interface/entity/{id}" }; + option (google.api.http) = { get: "/user-interface/entities/{id}" }; } // Create Tab Entity rpc CreateTabEntity(CreateTabEntityRequest) returns (Entity) { option (google.api.http) = { - post: "/user-interface/entity", + post: "/user-interface/entities", body: "*" }; } // Update Tab Entity rpc UpdateTabEntity(UpdateTabEntityRequest) returns (Entity) { option (google.api.http) = { - put: "/user-interface/entity", + put: "/user-interface/entities/{id}", body: "*" }; } @@ -87,7 +87,7 @@ service UserInterface { // Rollback Entity Request rpc RollbackEntity(RollbackEntityRequest) returns (Entity) { option (google.api.http) = { - put: "/user-interface/rollback-entity", + put: "/user-interface/entities/{id}/rollback", body: "*" }; } @@ -108,7 +108,7 @@ service UserInterface { } // Get Lookup Item rpc GetLookupItem(GetLookupItemRequest) returns (LookupItem) { - option (google.api.http) = { get: "/user-interface/lookup/{id}" }; + option (google.api.http) = { get: "/user-interface/lookups/{id}" }; } // List Lookup Item rpc ListLookupItems(ListLookupItemsRequest) returns (ListLookupItemsResponse) { @@ -121,13 +121,13 @@ service UserInterface { // Update Browser Entity rpc UpdateBrowserEntity(UpdateBrowserEntityRequest) returns (Entity) { option (google.api.http) = { - put: "/user-interface/lookup/{id}", + put: "/user-interface/browser-items/{id}", body: "*" }; } // Exists References on Record rpc ExistsReferences(ExistsReferencesRequest) returns (ExistsReferencesResponse) { - option (google.api.http) = { get: "/user-interface/exists-references" }; + option (google.api.http) = { get: "/user-interface/references/{record_id}/exists" }; } // List a References rpc ListReferences(ListReferencesRequest) returns (ListReferencesResponse) { @@ -135,23 +135,23 @@ service UserInterface { } // Get context Info rpc GetContextInfoValue(GetContextInfoValueRequest) returns (ContextInfoValue) { - option (google.api.http) = { get: "/business-data/context-info/{id}" }; + option (google.api.http) = { get: "/user-interface/context-info/{id}" }; } // Get Private Access rpc GetPrivateAccess(GetPrivateAccessRequest) returns (PrivateAccess) { - option (google.api.http) = { get: "/business-data/private-access/{id}" }; + option (google.api.http) = { get: "/user-interface/private-access/{id}" }; } // Create Private Access rpc LockPrivateAccess(LockPrivateAccessRequest) returns (PrivateAccess) { option (google.api.http) = { - put: "/user-interface/lock-private-access/{id}", + put: "/user-interface/private-access/{id}/lock", body: "*" }; } // Change Private Access rpc UnlockPrivateAccess(UnlockPrivateAccessRequest) returns (PrivateAccess) { option (google.api.http) = { - put: "/user-interface/unlock-private-access/{id}", + put: "/user-interface/private-access/{id}/unlock", body: "*" }; } @@ -162,7 +162,7 @@ service UserInterface { // Set Record Access rpc SetRecordAccess(SetRecordAccessRequest) returns (RecordAccess) { option (google.api.http) = { - post: "/user-interface/record-access", + put: "/user-interface/record-access/{id}", body: "*" }; } diff --git a/src/main/proto/core_functionality.proto b/src/main/proto/core_functionality.proto index 0601efb11..a058ef58b 100644 --- a/src/main/proto/core_functionality.proto +++ b/src/main/proto/core_functionality.proto @@ -30,7 +30,7 @@ service CoreFunctionality { } // Get Country Information rpc GetCountry(GetCountryRequest) returns (Country) { - option (google.api.http) = { get: "/core-functionality/country/{id}" }; + option (google.api.http) = { get: "/core-functionality/countries/{id}" }; } // List Organizations rpc ListOrganizations(ListOrganizationsRequest) returns (ListOrganizationsResponse) { @@ -46,12 +46,12 @@ service CoreFunctionality { } // Get Business Partner from search rpc GetBusinessPartner(GetBusinessPartnerRequest) returns (BusinessPartner) { - option (google.api.http) = { get: "/core-functionality/business-partner/{id}" }; + option (google.api.http) = { get: "/core-functionality/business-partners/{id}" }; } // Create Business Partner rpc CreateBusinessPartner(CreateBusinessPartnerRequest) returns (BusinessPartner) { option (google.api.http) = { - post: "/core-functionality/business-partner", + post: "/core-functionality/business-partners", body: "*" }; } @@ -61,7 +61,7 @@ service CoreFunctionality { } // Get Currency Rate rpc GetConversionRate(GetConversionRateRequest) returns (ConversionRate) { - option (google.api.http) = { get: "/core-functionality/conversion-rate/{id}" }; + option (google.api.http) = { get: "/core-functionality/conversion-rates/{id}" }; } // List Product Conversion UOM rpc ListProductConversion(ListProductConversionRequest) returns (ListProductConversionResponse) { diff --git a/src/main/proto/dashboarding.proto b/src/main/proto/dashboarding.proto index b55dacca5..7978d50ff 100644 --- a/src/main/proto/dashboarding.proto +++ b/src/main/proto/dashboarding.proto @@ -40,7 +40,7 @@ service Dashboarding { } // Get Metrics rpc GetMetrics(GetMetricsRequest) returns (Metrics) { - option (google.api.http) = { get: "/dashboarding/metric/{id}" }; + option (google.api.http) = { get: "/dashboarding/metrics/{id}" }; } // NotificationWindowChart rpc ListNotifications(ListNotificationsRequest) returns (ListNotificationsResponse) { @@ -54,7 +54,7 @@ service Dashboarding { option (google.api.http) = { get: "/dashboarding/window-dashboards" }; } rpc GetWindowMetrics(GetWindowMetricsRequest) returns (WindowMetrics) { - option (google.api.http) = { get: "/dashboarding/window-metric/{id}" }; + option (google.api.http) = { get: "/dashboarding/window-metrics/{id}" }; } } diff --git a/src/main/proto/dictionary.proto b/src/main/proto/dictionary.proto index 6b639f235..b00a978a0 100644 --- a/src/main/proto/dictionary.proto +++ b/src/main/proto/dictionary.proto @@ -26,35 +26,35 @@ package dictionary; service Dictionary { // Request a Window rpc GetWindow(EntityRequest) returns (Window) { - option (google.api.http) = { get: "/dictionary/window/{id}" }; + option (google.api.http) = { get: "/dictionary/windows/{id}" }; } // Request a Tab rpc GetTab(EntityRequest) returns (Tab) { - option (google.api.http) = { get: "/dictionary/tab/{id}" }; + option (google.api.http) = { get: "/dictionary/tabs/{id}" }; } // Request a Field rpc GetField(FieldRequest) returns (Field) { - option (google.api.http) = { get: "/dictionary/field/{id}" }; + option (google.api.http) = { get: "/dictionary/fields/{id}" }; } // Reference Request rpc GetReference(ReferenceRequest) returns (Reference) { - option (google.api.http) = { get: "/dictionary/reference/{id}" }; + option (google.api.http) = { get: "/dictionary/references/{id}" }; } // Reference Request rpc GetValidationRule(EntityRequest) returns (ValidationRule) { - option (google.api.http) = { get: "/dictionary/validation-rule/{id}" }; + option (google.api.http) = { get: "/dictionary/validation-rules/{id}" }; } // Request Process rpc GetProcess(EntityRequest) returns (Process) { - option (google.api.http) = { get: "/dictionary/process/{id}" }; + option (google.api.http) = { get: "/dictionary/processes/{id}" }; } // Request Browser rpc GetBrowser(EntityRequest) returns (Browser) { - option (google.api.http) = { get: "/dictionary/browser/{id}" }; + option (google.api.http) = { get: "/dictionary/browsers/{id}" }; } // Get Form rpc GetForm(EntityRequest) returns (Form) { - option (google.api.http) = { get: "/dictionary/form/{id}" }; + option (google.api.http) = { get: "/dictionary/forms/{id}" }; } // List Search Info Fields rpc ListSearchInfoFields(ListFieldsRequest) returns (ListFieldsResponse) { diff --git a/src/main/proto/enrollment.proto b/src/main/proto/enrollment.proto index 84ce5d098..a32eb730d 100644 --- a/src/main/proto/enrollment.proto +++ b/src/main/proto/enrollment.proto @@ -18,18 +18,40 @@ option java_multiple_files = true; option java_package = "org.spin.backend.grpc.enrollment"; option java_outer_classname = "Enrollment"; +import "google/api/annotations.proto"; + package enrollment; // The greeting service definition. service Register { - // Request enroll User - rpc EnrollUser(EnrollUserRequest) returns (User) {} - // - rpc ResetPassword(ResetPasswordRequest) returns (ResetPasswordResponse) {} - // - rpc ResetPasswordFromToken(ResetPasswordTokenRequest) returns (ResetPasswordResponse) {} - // - rpc ActivateUser(ActivateUserRequest) returns (ActivateUserResponse) {} + // Request enroll User + rpc EnrollUser(EnrollUserRequest) returns (User) { + option (google.api.http) = { + post: "/enrollment/user", + body: "*" + }; + } + // + rpc ResetPassword(ResetPasswordRequest) returns (ResetPasswordResponse) { + option (google.api.http) = { + put: "/enrollment/reset-password", + body: "*" + }; + } + // + rpc ResetPasswordFromToken(ResetPasswordTokenRequest) returns (ResetPasswordResponse) { + option (google.api.http) = { + put: "/enrollment/reset-password-token", + body: "*" + }; + } + // + rpc ActivateUser(ActivateUserRequest) returns (ActivateUserResponse) { + option (google.api.http) = { + put: "/enrollment/user", + body: "*" + }; + } } // Request a Enroll for a user diff --git a/src/main/proto/express_movement.proto b/src/main/proto/express_movement.proto index c5ee59680..71c388950 100644 --- a/src/main/proto/express_movement.proto +++ b/src/main/proto/express_movement.proto @@ -19,21 +19,52 @@ option java_package = "org.spin.backend.grpc.form.express_movement"; option java_outer_classname = "ADempiereExpressMovement"; import "base_data_type.proto"; +import "google/api/annotations.proto"; package express_movement; service ExpressMovement { - rpc ListWarehouses(ListWarehousesRequest) returns (ListWarehousesResponse) {} - rpc ListProducts(ListProductsRequest) returns (ListProductsResponse) {} + rpc ListWarehouses(ListWarehousesRequest) returns (ListWarehousesResponse) { + option (google.api.http) = { delete: "/express-movement/warehouses" }; + } + rpc ListProducts(ListProductsRequest) returns (ListProductsResponse) { + option (google.api.http) = { delete: "/express-movement/products" }; + } // Movement - rpc CreateMovement(CreateMovementRequest) returns (Movement) {} - rpc DeleteMovement(DeleteMovementRequest) returns (data.Empty) {} - rpc ProcessMovement(ProcessMovementRequest) returns (Movement) {} + rpc CreateMovement(CreateMovementRequest) returns (Movement) { + option (google.api.http) = { + post: "/express-movement/movements", + body: "*" + }; + } + rpc DeleteMovement(DeleteMovementRequest) returns (data.Empty) { + option (google.api.http) = { delete: "/express-movement/movements/{id}" }; + } + rpc ProcessMovement(ProcessMovementRequest) returns (Movement) { + option (google.api.http) = { + put: "/express-movement/movements/{id}/process", + body: "*" + }; + } // Movement Line - rpc CreateMovementLine(CreateMovementLineRequest) returns (MovementLine) {} - rpc DeleteMovementLine(DeleteMovementLineRequest) returns (data.Empty) {} - rpc UpdateMovementLine(UpdateMovementLineRequest) returns (MovementLine) {} - rpc ListMovementLines(ListMovementLinesRequest) returns (ListMovementLinesResponse) {} + rpc CreateMovementLine(CreateMovementLineRequest) returns (MovementLine) { + option (google.api.http) = { + post: "/express-movement/movements/lines", + body: "*" + }; + } + rpc DeleteMovementLine(DeleteMovementLineRequest) returns (data.Empty) { + option (google.api.http) = { delete: "/express-movement/movement/lines/{id}" }; + } + rpc UpdateMovementLine(UpdateMovementLineRequest) returns (MovementLine) { + option (google.api.http) = { + put: "/express-movement/movement/lines", + body: "*" + }; + } + rpc ListMovementLines(ListMovementLinesRequest) returns (ListMovementLinesResponse) { + option (google.api.http) = { delete: "/express-movement/movement/lines" }; + } } diff --git a/src/main/proto/security.proto b/src/main/proto/security.proto index 8d8bf84ea..c54805f10 100644 --- a/src/main/proto/security.proto +++ b/src/main/proto/security.proto @@ -17,6 +17,7 @@ syntax = "proto3"; option java_multiple_files = true; option java_package = "org.spin.backend.grpc.security"; option java_outer_classname = "ADempiereSecurity"; + import "google/api/annotations.proto"; package security; @@ -25,7 +26,7 @@ package security; service Security { // Request login from user rpc RunLogin(LoginRequest) returns (Session) { - option (google.api.http) = { + option (google.api.http) = { post: "/security/login", body: "*" }; @@ -44,7 +45,7 @@ service Security { } // Request change role rpc RunChangeRole(ChangeRoleRequest) returns (Session) { - option (google.api.http) = { + option (google.api.http) = { post: "/security/change-role", body: "*" }; @@ -54,7 +55,7 @@ service Security { option (google.api.http) = { get: "/security/session-info" }; } rpc SetSessionAttribute(SetSessionAttributeRequest) returns (Session) { - option (google.api.http) = { + option (google.api.http) = { post: "/security/session-attribute", body: "*" }; @@ -69,7 +70,7 @@ service Security { } // Request login from Open ID rpc RunLoginOpenID(LoginOpenIDRequest) returns (Session) { - option (google.api.http) = { + option (google.api.http) = { post: "/security/login-open-id", body: "*" };