Update on the Review Comments

1. Resolved review comments.
2. Resolved Go linting issues.
3. Increase coverage from 93 to 96 percentage for module.
This commit is contained in:
MohitKatare-protean
2025-03-27 12:24:17 +05:30
parent 2fa34759bc
commit be30b522b5
14 changed files with 291 additions and 102 deletions

69
config/bap.yaml Normal file
View File

@@ -0,0 +1,69 @@
appName: "bapAdapter"
log:
level: debug
destinations:
- type: stdout
context_keys:
- transaction_id
- message_id
http:
port: 8080
timeout:
read: 30
write: 30
idle: 30
plugin:
root: /app/plugins
pluginZipPath: /mnt/gcs/plugins/plugins_bundle.zip
plugins:
- publisher Src version raw comp zip
- nopschemavalidator
- router
- nopsigner
- nopsignvalidator
- reqpreprocessor
- gcpAuthMdw
modules:
- name: reciever
type: transaction
path: /reciever
targetType: msgQ
plugin:
schemaValidator:
id: nopschemavalidator
signValidator:
id: nopsignvalidator
publisher:
id: publisher
config:
project: ondc-seller-dev
topic: bapNetworkReciever
router:
id: router
config:
routingConfigPath: /mnt/gcs/configs/bapRecieverRouting-config.yaml
preProcessors:
- id: reqpreprocessor
steps:
steps:
- addRoute
signValidate
-addRout
customValidate
- name: transactionCaller
path: /caller
targetType: "http"
plugin:
signer:
id: nopsigner
router:
id: router
config:
routingConfigPath: /mnt/gcs/configs/bapCallerRouting-config.yaml
preProcessors:
- id: reqpreprocessor
# postProcessors:
# - id: gcpAuthMdw
# config:
# audience: https://bpp-adapter-903496459467.asia-southeast1.run.app
# serviceAccount: 903496459467-compute@developer.gserviceaccount.com

View File

@@ -0,0 +1,3 @@
routes:
- action: search
target: https://bpp-adapter-903496459467.asia-southeast1.run.app/reciever

63
config/bpp-local.yaml Normal file
View File

@@ -0,0 +1,63 @@
appName: "bppClientService"
log:
level: debug
destinations:
- type: stdout
context_keys:
- transaction_id
- message_id
http:
port: 8080
timeout:
read: 30
write: 30
idle: 30
plugin:
root: extracted/plugins
pluginZipPath: plugins_bundle.zip
plugins:
- publisher
- nopschemavalidator
- router
- nopsigner
- nopsignvalidator
- reqpreprocessor
- gcpAuthMdw
module:
modules:
- name: transactionReciever
path: /reciever
targetType: msgQ
plugin:
schemaValidator:
id: nopschemavalidator
signValidator:
id: nopsignValidator
publisher:
id: publisher
config:
project: ondc-seller-dev
topic: clientSideTopic
Router:
id: router
config:
routingConfigPath: configs/bppRecieverRouting-config.yaml
preProcessors:
- id: reqpreprocessor
- name: transactionCaller
path: /caller
targetType: "http"
plugin:
signer:
id: nopsigner
Router:
id: router
config:
routingConfigPath: configs/bppCallerRouting-config.yaml
preProcessors:
- id: reqpreprocessor
postProcessors:
- id: gcpAuthMdw
config:
audience: "target"

63
config/bpp.yaml Normal file
View File

@@ -0,0 +1,63 @@
appName: "bppClientService"
log:
level: debug
destinations:
- type: stdout
context_keys:
- transaction_id
- message_id
http:
port: 8080
timeout:
read: 30
write: 30
idle: 30
plugin:
root: /app/plugins
pluginZipPath: /mnt/gcs/plugins/plugins_bundle.zip
plugins:
- publisher
- nopschemavalidator
- router
- nopsigner
- nopsignvalidator
- reqpreprocessor
- gcpAuthMdw
module:
modules:
- name: transactionReciever
path: /reciever
targetType: msgQ
plugin:
schemaValidator:
id: nopschemavalidator
signValidator:
id: nopsignvalidator
publisher:
id: publisher
config:
project: ondc-seller-dev
topic: bppNetworkReciever
router:
id: router
config:
routingConfigPath: /mnt/gcs/configs/bppRecieverRouting-config.yaml
preProcessors:
- id: reqpreprocessor
- name: transactionCaller
path: /caller
targetType: "http"
plugin:
signer:
id: nopsigner
router:
id: router
config:
routingConfigPath: /mnt/gcs/configs/bppCallerRouting-config.yaml
preProcessors:
- id: reqpreprocessor
# postProcessors:
# - id: gcpAuthMdw
# config:
# audience: https://bap-adapter-903496459467.asia-southeast1.run.app
# serviceAccount: 903496459467-compute@developer.gserviceaccount.com

View File

@@ -0,0 +1,3 @@
routes:
- action: on_search
target: targeturl

View File

@@ -0,0 +1,3 @@
routes:
- action: search
target: https://sellerapp-903496459467.asia-southeast1.run.app

View File

@@ -0,0 +1,2 @@
bap_url: "https://bap-csr-903496459467.asia-southeast1.run.app" # Replace with actual Beckn API endpoint
port: "8080" # The port on which the server will run

69
config/sellerData.yaml Normal file
View File

@@ -0,0 +1,69 @@
- id: pooja-stores
descriptor:
name: Pooja Stores
locations:
- id: koramangala-4th-block-location
gps: "12.9349377,77.6055586"
categories:
- id: fresh_fruits
descriptor:
name: Fresh Fruits
- id: beverages
descriptor:
name: Beverages
items:
- id: item_2
descriptor:
name: Green Apples Organic
images:
- url: "https://mock_bpp.com/images/item_2.jpg"
category_id: fresh_fruits
location_id: koramangala-4th-block-location
price:
currency: INR
value: "170"
matched: true
- id: item_1
descriptor:
name: Red Apples
images:
- url: "https://mock_bpp.com/images/item_1.jpg"
category_id: fresh_fruits
location_id: koramangala-4th-block-location
price:
currency: INR
value: "90"
related: true
- id: item_7
descriptor:
name: Green Apple Juice
images:
- url: "https://mock_bpp.com/images/item_7.jpg"
category_id: beverages
location_id: koramangala-4th-block-location
price:
currency: INR
value: "70"
matched: true
- id: food-mall
descriptor:
name: Food Mall
locations:
- id: food-mall-location
gps: "12.9349377,77.6055586"
categories:
- id: fresh-food
descriptor:
name: Fresh food
items:
- id: item_1_1
descriptor:
name: Green Apple Salad
images:
- url: "https://mock_bpp.com/images/item_1_1.jpg"
category_id: fresh-food
location_id: food-mall-location
price:
currency: INR
value: "200"
matched: true