Skip to content

Commit

Permalink
Merge branch 'main' into ci/add_dynamic_param_injection_from_event
Browse files Browse the repository at this point in the history
  • Loading branch information
cberg-aot committed Jan 24, 2025
2 parents 3d84f08 + bac5f11 commit c593d80
Show file tree
Hide file tree
Showing 104 changed files with 492 additions and 596 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ INSERT [dbo].[ORBC_POWER_UNIT] ([POWER_UNIT_ID], [UNIT_NUMBER], [PLATE], [PROVIN
INSERT [dbo].[ORBC_POWER_UNIT] ([POWER_UNIT_ID], [UNIT_NUMBER], [PLATE], [PROVINCE_TYPE], [YEAR], [MAKE], [VIN], [LICENSED_GVW], [POWER_UNIT_TYPE], [STEER_AXLE_TIRE_SIZE], [CONCURRENCY_CONTROL_NUMBER], [DB_CREATE_USERID], [DB_CREATE_TIMESTAMP], [DB_LAST_UPDATE_USERID], [DB_LAST_UPDATE_TIMESTAMP], [COMPANY_ID]) VALUES (99, N'9', N'F7XC0M', N'CA-BC', 2020, N'Freightliner', N'713995', CAST(18917.00 AS Numeric(18, 2)), N'CONCRET', 711, NULL, N'dbo', GETUTCDATE(), N'dbo', GETUTCDATE(), 99)
INSERT [dbo].[ORBC_POWER_UNIT] ([POWER_UNIT_ID], [UNIT_NUMBER], [PLATE], [PROVINCE_TYPE], [YEAR], [MAKE], [VIN], [LICENSED_GVW], [POWER_UNIT_TYPE], [STEER_AXLE_TIRE_SIZE], [CONCURRENCY_CONTROL_NUMBER], [DB_CREATE_USERID], [DB_CREATE_TIMESTAMP], [DB_LAST_UPDATE_USERID], [DB_LAST_UPDATE_TIMESTAMP], [COMPANY_ID]) VALUES (100, N'9', N'VCUDWK', N'CA-BC', 2014, N'Hyundai', N'925292', CAST(4989.00 AS Numeric(18, 2)), N'TRKTRAC', 325, NULL, N'dbo', GETUTCDATE(), N'dbo', GETUTCDATE(), 100)


INSERT [dbo].[ORBC_POWER_UNIT] ([POWER_UNIT_ID], [UNIT_NUMBER], [PLATE], [PROVINCE_TYPE], [YEAR], [MAKE], [VIN], [LICENSED_GVW], [POWER_UNIT_TYPE], [STEER_AXLE_TIRE_SIZE], [CONCURRENCY_CONTROL_NUMBER], [DB_CREATE_USERID], [DB_CREATE_TIMESTAMP], [DB_LAST_UPDATE_USERID], [DB_LAST_UPDATE_TIMESTAMP], [COMPANY_ID]) VALUES (101, N'LCV1', N'TTH199', N'CA-BC', 2020, N'Western Star', N'657854', CAST(20000 AS Numeric(18, 2)), N'LCVRMDB', 325, NULL, N'dbo', GETUTCDATE(), N'dbo', GETUTCDATE(), 74)
INSERT [dbo].[ORBC_POWER_UNIT] ([POWER_UNIT_ID], [UNIT_NUMBER], [PLATE], [PROVINCE_TYPE], [YEAR], [MAKE], [VIN], [LICENSED_GVW], [POWER_UNIT_TYPE], [STEER_AXLE_TIRE_SIZE], [CONCURRENCY_CONTROL_NUMBER], [DB_CREATE_USERID], [DB_CREATE_TIMESTAMP], [DB_LAST_UPDATE_USERID], [DB_LAST_UPDATE_TIMESTAMP], [COMPANY_ID]) VALUES (102, N'LCV2', N'HIU499', N'CA-BC', 2022, N'Kenworth', N'199876', CAST(22000 AS Numeric(18, 2)), N'LCVTPDB', 431, NULL, N'dbo', GETUTCDATE(), N'dbo', GETUTCDATE(), 74)

SET IDENTITY_INSERT [dbo].[ORBC_POWER_UNIT] OFF
GO
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SET NOCOUNT ON
GO

INSERT INTO permit.ORBC_SPECIAL_AUTH (COMPANY_ID, LCV) VALUES (74, 'Y')
GO
2 changes: 2 additions & 0 deletions database/mssql/scripts/utility/refresh-sample-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ USAGE="-u ORBC_USER -p ORBC_PASS -s ORBC_SERVER -d ORBC_DATABASE"
parse_options "${USAGE}" ${@}

echo "Deleting existing sample data"
sqlcmd -C -U ${ORBC_USER} -P "${ORBC_PASS}" -S ${ORBC_SERVER} -d ${ORBC_DATABASE} -Q "SET QUOTED_IDENTIFIER ON; SET NOCOUNT ON; DELETE FROM permit.ORBC_SPECIAL_AUTH"
sqlcmd -C -U ${ORBC_USER} -P "${ORBC_PASS}" -S ${ORBC_SERVER} -d ${ORBC_DATABASE} -Q "SET QUOTED_IDENTIFIER ON; SET NOCOUNT ON; DELETE FROM dbo.ORBC_FEATURE_FLAG"
sqlcmd -C -U ${ORBC_USER} -P "${ORBC_PASS}" -S ${ORBC_SERVER} -d ${ORBC_DATABASE} -Q "SET QUOTED_IDENTIFIER ON; SET NOCOUNT ON; DELETE FROM dbo.ORBC_TRAILER"
sqlcmd -C -U ${ORBC_USER} -P "${ORBC_PASS}" -S ${ORBC_SERVER} -d ${ORBC_DATABASE} -Q "SET QUOTED_IDENTIFIER ON; SET NOCOUNT ON; DELETE FROM dbo.ORBC_POWER_UNIT"
Expand All @@ -25,6 +26,7 @@ sqlcmd -C -U ${ORBC_USER} -P "${ORBC_PASS}" -S ${ORBC_SERVER} -d ${ORBC_DATABASE
sqlcmd -C -U ${ORBC_USER} -P "${ORBC_PASS}" -S ${ORBC_SERVER} -d ${ORBC_DATABASE} -i ${SCRIPT_DIR}/sampledata/dbo.ORBC_POWER_UNIT.Table.sql
sqlcmd -C -U ${ORBC_USER} -P "${ORBC_PASS}" -S ${ORBC_SERVER} -d ${ORBC_DATABASE} -i ${SCRIPT_DIR}/sampledata/dbo.ORBC_TRAILER.Table.sql
sqlcmd -C -U ${ORBC_USER} -P "${ORBC_PASS}" -S ${ORBC_SERVER} -d ${ORBC_DATABASE} -i ${SCRIPT_DIR}/sampledata/dbo.ORBC_FEATURE_FLAG.Table.sql
sqlcmd -C -U ${ORBC_USER} -P "${ORBC_PASS}" -S ${ORBC_SERVER} -d ${ORBC_DATABASE} -i ${SCRIPT_DIR}/sampledata/permit.ORBC_SPECIAL_AUTH.Table.sql

echo "Setting credit account sequence restart to current timestamp (used only for lower environments)"
sqlcmd -C -U ${ORBC_USER} -P "${ORBC_PASS}" -S ${ORBC_SERVER} -d ${ORBC_DATABASE} -i ${SCRIPT_DIR}/sampledata/permit.ORBC_CREDIT_ACCOUNT_NUMBER_SEQ.sql
Expand Down
43 changes: 43 additions & 0 deletions database/mssql/scripts/versions/revert/v_55_ddl_revert.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET NOCOUNT ON
GO
SET XACT_ABORT ON
GO
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
GO
BEGIN TRANSACTION
GO

-- Remove the newly added policy configuration
DELETE FROM [dbo].[ORBC_POLICY_CONFIGURATION]
WHERE POLICY_CONFIGURATION_ID = (SELECT MAX(POLICY_CONFIGURATION_ID) FROM [dbo].[ORBC_POLICY_CONFIGURATION])
GO

IF @@ERROR <> 0 SET NOEXEC ON
GO

DECLARE @VersionDescription VARCHAR(255)
SET @VersionDescription = 'Reverting updates to policy configuration JSON allowing lcv vehicles for TROS and TROW'

INSERT [dbo].[ORBC_SYS_VERSION] ([VERSION_ID], [DESCRIPTION], [RELEASE_DATE]) VALUES (54, @VersionDescription, getutcdate())
GO

IF @@ERROR <> 0 SET NOEXEC ON
GO

COMMIT TRANSACTION
GO
IF @@ERROR <> 0 SET NOEXEC ON
GO
DECLARE @Success AS BIT
SET @Success = 1
SET NOEXEC OFF
IF (@Success = 1) PRINT 'The database revert succeeded'
ELSE BEGIN
IF @@TRANCOUNT > 0 ROLLBACK TRANSACTION
PRINT 'The database revert failed'
END
GO
48 changes: 48 additions & 0 deletions database/mssql/scripts/versions/v_55_ddl.sql

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ services:
VEHICLES_API_LOG_LEVEL: ${VEHICLES_API_LOG_LEVEL}
VEHICLES_API_TYPEORM_LOG_LEVEL: ${VEHICLES_API_TYPEORM_LOG_LEVEL}
VEHICLES_API_MAX_QUERY_EXECUTION_TIME_MS: ${VEHICLES_API_MAX_QUERY_EXECUTION_TIME_MS}
VEHICLES_API_MSSQL_MAX_CONNECTION: ${VEHICLES_API_MSSQL_MAX_CONNECTION}
DB_TYPE: ${DB_TYPE}
MSSQL_HOST: sql-server-db
MSSQL_PORT: ${MSSQL_PORT}
Expand Down Expand Up @@ -111,6 +112,7 @@ services:
DOPS_API_LOG_LEVEL: ${DOPS_API_LOG_LEVEL}
DOPS_API_TYPEORM_LOG_LEVEL: ${DOPS_API_TYPEORM_LOG_LEVEL}
DOPS_API_MAX_QUERY_EXECUTION_TIME_MS: ${DOPS_API_MAX_QUERY_EXECUTION_TIME_MS}
DOPS_API_MSSQL_MAX_CONNECTION: ${DOPS_API_MSSQL_MAX_CONNECTION}
DB_TYPE: ${DB_TYPE}
MSSQL_HOST: sql-server-db
MSSQL_PORT: ${MSSQL_PORT}
Expand Down Expand Up @@ -167,6 +169,7 @@ services:
POLICY_API_LOG_LEVEL: ${POLICY_API_LOG_LEVEL}
POLICY_API_TYPEORM_LOG_LEVEL: ${POLICY_API_TYPEORM_LOG_LEVEL}
POLICY_API_MAX_QUERY_EXECUTION_TIME_MS: ${POLICY_API_MAX_QUERY_EXECUTION_TIME_MS}
POLICY_API_MSSQL_MAX_CONNECTION: ${POLICY_API_MSSQL_MAX_CONNECTION}
DB_TYPE: ${DB_TYPE}
MSSQL_HOST: sql-server-db
MSSQL_PORT: ${MSSQL_PORT}
Expand Down Expand Up @@ -233,6 +236,7 @@ services:
SCHEDULER_API_LOG_LEVEL: ${SCHEDULER_API_LOG_LEVEL}
SCHEDULER_API_TYPEORM_LOG_LEVEL: ${SCHEDULER_API_TYPEORM_LOG_LEVEL}
SCHEDULER_API_MAX_QUERY_EXECUTION_TIME_MS: ${SCHEDULER_API_MAX_QUERY_EXECUTION_TIME_MS}
SCHEDULER_API_MSSQL_MAX_CONNECTION: ${SCHEDULER_API_MSSQL_MAX_CONNECTION}
DB_TYPE: ${DB_TYPE}
MSSQL_HOST: sql-server-db
MSSQL_PORT: ${MSSQL_PORT}
Expand Down
1 change: 1 addition & 0 deletions dops/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ ENV DB_TYPE ${DB_TYPE}
ENV DOPS_API_LOG_LEVEL ${DOPS_API_LOG_LEVEL}
ENV DOPS_API_TYPEORM_LOG_LEVEL ${DOPS_API_TYPEORM_LOG_LEVEL}
ENV DOPS_API_MAX_QUERY_EXECUTION_TIME_MS ${DOPS_API_MAX_QUERY_EXECUTION_TIME_MS}
ENV DOPS_API_MSSQL_MAX_CONNECTION ${DOPS_API_MSSQL_MAX_CONNECTION}
ENV MSSQL_HOST ${MSSQL_HOST}
ENV MSSQL_PORT ${MSSQL_PORT}
ENV MSSQL_DB ${MSSQL_DB}
Expand Down
1 change: 1 addition & 0 deletions dops/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const envPath = path.resolve(process.cwd() + '/../');
logger: new TypeormCustomLogger(
getTypeormLogLevel(process.env.DOPS_API_TYPEORM_LOG_LEVEL),
),
pool: { max: +process.env.DOPS_API_MSSQL_MAX_CONNECTION || 10 },
}),
AutomapperModule.forRoot({
strategyInitializer: classes(),
Expand Down
23 changes: 0 additions & 23 deletions dops/src/assets/templates/profile-registration.email.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -268,29 +268,6 @@
>{{ companyPhoneNumber }}</a
>
</p>
{{#if companyFaxNumber}}
<p
class="info-section__item"
style="
font-family:
BC Sans,
sans-serif;
font-style: normal;
font-size: 16px;
color: #313132;
margin: 0;
padding: 0;
"
>
Fax:
<a
href="#"
x-apple-data-detectors="false"
style="color: #313232; text-decoration: none"
>{{ companyFaxNumber }}</a
>
</p>
{{/if}}
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export class CreateGeneratedDocumentDto {
phone1Extension: '1',
phone2: null,
phone2Extension: null,
fax: null,
},
mailingAddress: {
addressLine1: '123 Short Street',
Expand Down
10 changes: 0 additions & 10 deletions dops/src/modules/notification/dto/request/notification.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,6 @@ export class NotificationDto {
})
bcc?: string[];

@ApiProperty({
description: 'Notification fax emails.',
example: ['<faxnumber>@mycompany.co'],
})
@IsOptional()
@IsEmail(undefined, {
each: true,
})
fax?: string[];

@ApiProperty({
enum: NotificationTemplate,
example: NotificationTemplate.COMPANY_SUSPEND,
Expand Down
31 changes: 2 additions & 29 deletions dops/src/modules/notification/notification.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class NotificationController {
// Retrieves the current user details from the request
const currentUser = req.user as IUserJWT;
// Destructures the required fields from the NotificationDocumentDto
const { subject, to, cc, bcc, fax, templateName, data, documentIds } =
const { subject, to, cc, bcc, templateName, data, documentIds } =
notificationDocumentDto;

// Processes document IDs to attach them to the notification
Expand Down Expand Up @@ -119,24 +119,10 @@ export class NotificationController {
bcc,
);

let faxTransactionId: string;

if (fax?.length) {
faxTransactionId = await this.notificationService.sendEmailMessage(
templateName,
data,
subject,
fax,
true,
attachments,
);
}

// Returns a success message and the transaction ID of the sent notification
return {
message: 'Notification sent successfully.',
emailTransactionId: emailTransactionId,
faxTransactionId: faxTransactionId,
};
}

Expand All @@ -162,7 +148,7 @@ export class NotificationController {
@Body() notificationDocumentDto: NotificationDto,
) {
// Destructures the required fields from the NotificationDocumentDto
const { subject, to, cc, bcc, fax, templateName, data } =
const { subject, to, cc, bcc, templateName, data } =
notificationDocumentDto;

// Sends the notification with attachments and returns the transaction ID
Expand All @@ -177,23 +163,10 @@ export class NotificationController {
bcc,
);

let faxTransactionId: string;

if (fax?.length) {
faxTransactionId = await this.notificationService.sendEmailMessage(
templateName,
data,
subject,
fax,
true,
);
}

// Returns a success message and the transaction ID of the sent notification
return {
message: 'Notification sent successfully.',
transactionId: transactionId,
faxTransactionId: faxTransactionId,
};
}
}
14 changes: 7 additions & 7 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"material-react-table": "^2.13.3",
"mui-nested-menu": "^3.4.0",
"oidc-client-ts": "^3.1.0",
"onroute-policy-engine": "^1.1.0",
"onroute-policy-engine": "^1.4.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-error-boundary": "^4.1.2",
Expand Down
1 change: 0 additions & 1 deletion frontend/src/common/authentication/OnRouteBCContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export interface BCeIDUserDetailContext {
phone2?: string;
phone2Extension?: string;
email: string;
fax?: string;
userRole: BCeIDUserRoleType;
}

Expand Down
2 changes: 0 additions & 2 deletions frontend/src/common/authentication/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export type PartialCompanyProfile = {
};
email: string;
phone: string;
fax?: Nullable<string>;
extension?: Nullable<string>;
primaryContact?: Nullable<Contact>;
};
Expand All @@ -55,7 +54,6 @@ export type BCeIDUserContextType = {
lastName?: string;
phone1?: string;
phone2?: string;
fax?: string;
email?: string;
city?: string;
provinceCode?: string;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/common/constants/bannerMessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const BANNER_MESSAGES = {
ALL_FIELDS_MANDATORY:
"Please note, unless stated otherwise, all fields are mandatory.",
PERMIT_SEND_TO:
"The permit will be sent to the email on your onRouteBC Company Information, in addition to any email listed below. If you would also like to receive the permit by Fax, please enter a fax number.",
"The permit will be sent to the email on your onRouteBC Company Information, in addition to any email listed below.",
PERMIT_REFUND_REQUEST: `Refunds and amendments can be requested over the phone by calling the Provincial Permit Centre at Toll-free: ${TOLL_FREE_NUMBER}. Please have your permit number ready.`,
POLICY_REMINDER:
"The applicant is responsible for ensuring they are following Legislation, policies, standards and guidelines in the operation of a commercial transportation business in British Columbia.",
Expand Down
1 change: 0 additions & 1 deletion frontend/src/features/idir/company/IDIRCreateCompany.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ export const IDIRCreateCompany = React.memo(() => {
email: getDefaultRequiredVal("", migratedClient?.email),
phone: getDefaultRequiredVal("", migratedClient?.phone),
extension: getDefaultRequiredVal("", migratedClient?.extension),
fax: getDefaultRequiredVal("", migratedClient?.fax),
// A migrated but unclaimed company will not have primaryContact.
primaryContact: {
firstName: "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ export const IDIRCompanySearchResults = memo(
migratedClientHash,
mailingAddress,
email,
fax,
alternateName,
phone,
extension,
Expand All @@ -109,7 +108,6 @@ export const IDIRCompanySearchResults = memo(
email,
phone,
extension,
fax,
alternateName,
isSuspended,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,11 @@ export const IDIRPermitSearchRowActions = ({
const handleResend = async (
permitId: string,
email: string,
fax: string,
notificationTypes: EmailNotificationType[],
) => {
const response = await resendPermitMutation.mutateAsync({
permitId,
email,
fax,
notificationTypes,
});

Expand Down
Loading

0 comments on commit c593d80

Please sign in to comment.