Skip to content

Commit 2ab92ff

Browse files
Refactor AgentType enum: Replace 'AFJ' with 'Credo'
**What does this PR do?** This pull request refactors the `AgentType` enum by replacing the outdated `'AFJ'` value with `'Credo'` in `libs/enum/src/enum.ts`. All usages of `AgentType.AFJ` and the string `'AFJ'` across the codebase have been updated to `AgentType.Credo` and `'Credo'` respectively. The lingering TODO comment has also been removed. **Why is this change necessary?** There was a TODO to update the agent type for consistency and clarity. Using the correct agent name avoids confusion and ensures uniform reference across services. **What has changed?** - `AgentType.AFJ` → `AgentType.Credo` - `'AFJ'` string values replaced with `'Credo'` - TODO comment removed **How was this tested?** All references and usages were carefully updated and verified. ✅ (Optional) If tests were run: "The test suite was executed to ensure no regressions."
1 parent 2b1a409 commit 2ab92ff

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

apps/agent-provisioning/src/agent-provisioning.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export class AgentProvisioningService {
2323
try {
2424

2525
const { containerName, externalIp, orgId, seed, walletName, walletPassword, walletStorageHost, walletStoragePassword, walletStoragePort, walletStorageUser, webhookEndpoint, agentType, protocol, credoImage, tenant, indyLedger, inboundEndpoint } = payload;
26-
if (agentType === AgentType.AFJ) {
26+
if (agentType === AgentType.Credo) {
2727
// The wallet provision command is used to invoke a shell script
2828
const walletProvision = `${process.cwd() + process.env.AFJ_AGENT_SPIN_UP} ${orgId} "${externalIp}" "${walletName}" "${walletPassword}" ${seed} ${webhookEndpoint} ${walletStorageHost} ${walletStoragePort} ${walletStorageUser} ${walletStoragePassword} ${containerName} ${protocol} ${tenant} ${credoImage} "${indyLedger}" ${inboundEndpoint} ${process.env.SCHEMA_FILE_SERVER_URL} ${process.env.AGENT_HOST} ${process.env.AWS_ACCOUNT_ID} ${process.env.S3_BUCKET_ARN} ${process.env.CLUSTER_NAME} ${process.env.TESKDEFINITION_FAMILY}`;
2929
const spinUpResponse: object = new Promise(async (resolve) => {

apps/agent-service/src/agent-service.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ export class AgentServiceService {
414414
walletStoragePassword: process.env.WALLET_STORAGE_PASSWORD || '',
415415
inboundEndpoint,
416416
containerName: orgData.name.split(' ').join('_'),
417-
agentType: AgentType.AFJ,
417+
agentType: AgentType.Credo,
418418
orgName: orgData?.name,
419419
indyLedger: escapedJsonString,
420420
credoImage: process.env.AFJ_VERSION || '',
@@ -862,7 +862,7 @@ export class AgentServiceService {
862862
// Get shared agent type
863863
const orgAgentTypeId = await this.agentServiceRepository.getOrgAgentTypeDetails(OrgAgentType.SHARED);
864864
// Get agent type details
865-
const agentTypeId = await this.agentServiceRepository.getAgentTypeId(AgentType.AFJ);
865+
const agentTypeId = await this.agentServiceRepository.getAgentTypeId(AgentType.Credo);
866866

867867
const storeOrgAgentData: IStoreOrgAgentDetails = {
868868
did: tenantDetails.DIDCreationOption.did,

apps/agent-service/src/repositories/agent-service.repository.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ export class AgentServiceRepository {
297297
try {
298298
const { id } = await this.prisma.agents_type.findFirstOrThrow({
299299
where: {
300-
agent: AgentType.AFJ
300+
agent: AgentType.Credo
301301
}
302302
});
303303
return id;

libs/enum/src/enum.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ export enum CredDefSortFields {
2626
}
2727

2828
export enum AgentType {
29-
// TODO: Change to Credo
30-
AFJ = 'AFJ',
29+
Credo = 'Credo',
3130
ACAPY = 'ACAPY'
3231
}
3332

0 commit comments

Comments
 (0)