Skip to content

Commit

Permalink
add entollment and express movement.
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinBetanc0urt committed Sep 19, 2023
1 parent bef0ed6 commit 39983fe
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 55 deletions.
16 changes: 13 additions & 3 deletions resources/envoy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand Down
34 changes: 17 additions & 17 deletions src/main/proto/business.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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: "*"
};
}
Expand All @@ -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: "*"
};
}
Expand All @@ -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: "*"
};
}
Expand All @@ -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) {
Expand All @@ -121,37 +121,37 @@ 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) {
option (google.api.http) = { get: "/user-interface/references" };
}
// 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: "*"
};
}
Expand All @@ -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: "*"
};
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/proto/core_functionality.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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: "*"
};
}
Expand All @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/proto/dashboarding.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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}" };
}
}

Expand Down
16 changes: 8 additions & 8 deletions src/main/proto/dictionary.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
38 changes: 30 additions & 8 deletions src/main/proto/enrollment.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
49 changes: 40 additions & 9 deletions src/main/proto/express_movement.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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" };
}
}


Expand Down
Loading

0 comments on commit 39983fe

Please sign in to comment.