Skip to content

Commit

Permalink
Rahu vendor env (#116)
Browse files Browse the repository at this point in the history
* Adding role details to vendor's owner.

* PSPCL name in env variable

* removed unnecessary constant
  • Loading branch information
rahu-eGov authored Aug 23, 2022
1 parent adbefc9 commit 5073c50
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
Expand All @@ -27,4 +29,6 @@ public class OwnerDTO {
private String emailId;
@JsonProperty("mobileNumber")
private String mobileNumber;
@JsonProperty("roles")
private List<RoleDTO> roles;
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ public void createChallan(String eventType, FiscalEvent fiscalEvent, String mgra
challanRequestDTO.setBusinessService(applicationConfiguration.getMgramsevaPspclBusinessService());
challanRequestDTO.setConsumerType(applicationConfiguration.getMgramsevaPspclConsumerType());
challanRequestDTO.setTypeOfExpense(applicationConfiguration.getMgramsevaPspclTypeOfExpense());
challanRequestDTO.setVendor(mgramsevaVendorService.getVendorIdByTenantId(mgramsevaTenantId, PSPCL_VENDOR_NAME));
challanRequestDTO.setVendor(mgramsevaVendorService.getVendorIdByTenantId(mgramsevaTenantId,
applicationConfiguration.getMgramsevaPspclVendorName()));
challanRequestDTO.setVendorName(applicationConfiguration.getMgramsevaPspclVendorName());
challanRequestDTO.setBillDate(fiscalEvent.getEventTime());
challanRequestDTO.setIsBillPaid(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ public String getVendorIdByTenantId(@NotNull String tenantId, @NotNull String na
* @return
*/
public @NotNull VendorCreateRequestDTO wrapVendorCreateRequestData(@NotNull String tenantId, @NotNull String name) {
RoleDTO role = new RoleDTO();
role.setTenantId(tenantId);
role.setName(OWNER_ROLE_CITIZEN);
role.setCode(OWNER_ROLE_CITIZEN);

OwnerDTO owner = OwnerDTO.builder().build();
owner.setTenantId(tenantId);
owner.setName(name);
Expand All @@ -101,6 +106,8 @@ public String getVendorIdByTenantId(@NotNull String tenantId, @NotNull String na
// It is not fixed yet, it's just providing random mobile no with 10 digit. Needs to be implemented by user info.
owner.setMobileNumber(
String.valueOf(ThreadLocalRandom.current().nextLong(10000_11111L, 10000_99999L)));
owner.setRoles(Collections.singletonList(role));

LocalityDTO locality = LocalityDTO.builder().build();
locality.setCode(applicationConfiguration.getVendorOwnerLocalityCode());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@ public class EventConstants {
public static final String USER_TYPE = "userType";
public static final String CLIENT_SECRET = "client_secret";
public static final String CLIENT_ID = "client_id";
public static final String PSPCL_VENDOR_NAME = "PSPCL";
public static final String OWNER_ROLE_CITIZEN = "CITIZEN";

}
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ mgramseva.collection.service.payments.create.endpoint=collection-services/paymen
mgramseva.pspcl.business.service=EXPENSE.ELECTRICITY_BILL
mgramseva.pspcl.consumer.type=EXPENSE
mgramseva.pspcl.typeOfExpense=ELECTRICITY_BILL
mgramseva.pspcl.vendor.name=PSPCL
mgramseva.pspcl.vendor.name=PSPCL_TEST
mgramseva.pspcl.tax.head.code=20101

mgramseva.basic.authorization.base64.value=ZWdvdi11c2VyLWNsaWVudDo=
Expand Down

0 comments on commit 5073c50

Please sign in to comment.