Skip to content

Commit

Permalink
Fix sql value type and add debug logging
Browse files Browse the repository at this point in the history
Jira ticket: CAMS-461

Co-authored-by: Fritz Madden <[email protected]>
Co-authored-by: Arthur Morrow <[email protected]>
Co-authored-by: Brian Posey <[email protected]>
  • Loading branch information
4 people committed Dec 18, 2024
1 parent 47d7af4 commit 4cf766c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/lib/adapters/gateways/acms/acms.gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class AcmsGatewayImpl extends AbstractMssqlClient implements AcmsGateway

input.push({
name: 'divisionCode',
type: mssql.VarChar,
type: mssql.Int,
value: predicate.divisionCode,
});

Expand Down Expand Up @@ -57,6 +57,7 @@ export class AcmsGatewayImpl extends AbstractMssqlClient implements AcmsGateway
leadCaseId: string;
};

context.logger.debug(MODULE_NAME, `Querying for parameters: ${JSON.stringify(input)}`);
try {
const { results } = await this.executeQuery<ResultType>(context, query, input);
const leadCaseIdsResults = results as ResultType[];
Expand Down
7 changes: 7 additions & 0 deletions backend/lib/use-cases/acms-orders/acms-orders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ export class AcmsOrders {
try {
const gateway = Factory.getAcmsGateway(context);
const leadCaseIds = await gateway.getLeadCaseIds(context, predicate);
context.logger.debug(
MODULE_NAME,
`Found ${leadCaseIds.length} lead cases for ${predicate.chapter}:${predicate.divisionCode}.`,
leadCaseIds,
);
return leadCaseIds;
} catch (originalError) {
throw getCamsError(
Expand All @@ -79,6 +84,7 @@ export class AcmsOrders {
success: true,
};
try {
context.logger.debug(MODULE_NAME, `Beginning migration of ${acmsLeadCaseId}.`);
const casesRepo = Factory.getCasesRepository(context);
const dxtr = Factory.getCasesGateway(context);
const acms = Factory.getAcmsGateway(context);
Expand Down Expand Up @@ -202,6 +208,7 @@ export class AcmsOrders {
await casesRepo.createCaseHistory(leadCaseHistory);
leadCaseHistoryBefore = leadCaseHistoryAfter;
}
context.logger.debug(MODULE_NAME, `Finished migration of ${acmsLeadCaseId}.`, report);
} catch (error) {
report.success = false;
const camsError = getCamsError(
Expand Down

0 comments on commit 4cf766c

Please sign in to comment.