mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 06:40:57 +00:00
- Introduced a new step in the onboarding process to select company nationality (Ethiopian or Foreign). - Updated API and service layers to handle nationality data for companies. - Added support for uploading multiple business license files for each operational profile. - Refactored company and forwarder forms to include new license upload step. - Created a reusable RoleLicenseStep component for managing license file uploads. - Implemented utility functions for phone number handling. - Added migrations to update the database schema for nationality and business license files.
29 lines
804 B
TypeScript
29 lines
804 B
TypeScript
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
|
|
export class AddNationalityToCompanies1791000000002
|
|
implements MigrationInterface
|
|
{
|
|
name = "AddNationalityToCompanies1791000000002";
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
ALTER TABLE freight.companies
|
|
ADD COLUMN IF NOT EXISTS nationality varchar(32);
|
|
`);
|
|
|
|
// Existing companies default to Ethiopian (country defaults to Ethiopia).
|
|
await queryRunner.query(`
|
|
UPDATE freight.companies
|
|
SET nationality = 'ethiopian'
|
|
WHERE nationality IS NULL;
|
|
`);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
ALTER TABLE freight.companies
|
|
DROP COLUMN IF EXISTS nationality;
|
|
`);
|
|
}
|
|
}
|