feat: add customer details to customer entity

This commit is contained in:
Abdalhamid Alhamad
2025-05-19 14:16:18 +03:00
parent 35ab3df7c1
commit 881d88c8d8
6 changed files with 56 additions and 0 deletions

View File

@ -0,0 +1,8 @@
import { Module } from '@nestjs/common';
@Module({
imports: [],
controllers: [],
providers: [],
})
export class NeoLeapModule {}

View File

@ -0,0 +1,6 @@
import { Injectable } from '@nestjs/common';
@Injectable()
export class NeoLeapService {
createApplication() {}
}

View File

@ -75,6 +75,24 @@ export class Customer extends BaseEntity {
@Column('varchar', { name: 'user_id' })
userId!: string;
@Column('varchar', { name: 'country', length: 255, nullable: true })
country!: string;
@Column('varchar', { name: 'region', length: 255, nullable: true })
region!: string;
@Column('varchar', { name: 'city', length: 255, nullable: true })
city!: string;
@Column('varchar', { name: 'neighborhood', length: 255, nullable: true })
neighborhood!: string;
@Column('varchar', { name: 'street', length: 255, nullable: true })
street!: string;
@Column('varchar', { name: 'building', length: 255, nullable: true })
building!: string;
@Column('varchar', { name: 'profile_picture_id', nullable: true })
profilePictureId!: string;

View File

@ -0,0 +1,23 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
export class AddAddressFieldsToCustomers1747569536067 implements MigrationInterface {
name = 'AddAddressFieldsToCustomers1747569536067';
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "customers" ADD "country" character varying(255)`);
await queryRunner.query(`ALTER TABLE "customers" ADD "region" character varying(255)`);
await queryRunner.query(`ALTER TABLE "customers" ADD "city" character varying(255)`);
await queryRunner.query(`ALTER TABLE "customers" ADD "neighborhood" character varying(255)`);
await queryRunner.query(`ALTER TABLE "customers" ADD "street" character varying(255)`);
await queryRunner.query(`ALTER TABLE "customers" ADD "building" character varying(255)`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "customers" DROP COLUMN "building"`);
await queryRunner.query(`ALTER TABLE "customers" DROP COLUMN "street"`);
await queryRunner.query(`ALTER TABLE "customers" DROP COLUMN "neighborhood"`);
await queryRunner.query(`ALTER TABLE "customers" DROP COLUMN "city"`);
await queryRunner.query(`ALTER TABLE "customers" DROP COLUMN "region"`);
await queryRunner.query(`ALTER TABLE "customers" DROP COLUMN "country"`);
}
}

View File

@ -24,3 +24,4 @@ export * from './1739954239949-add-civilid-to-customers-and-update-notifications
export * from './1740045960580-create-user-registration-table';
export * from './1741087742821-add-used-flag-to-otp-and-remove-constraints-from-customers';
export * from './1742112997024-update-customer-table';
export * from './1747569536067-add-address-fields-to-customers';