-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* create order & update order logic * get driver infor and adjust table to get share_link * create ahamove order * create ahamove order * build other data for order detail response --------- Co-authored-by: NHT <[email protected]>
- Loading branch information
1 parent
c78267b
commit 672f28a
Showing
30 changed files
with
2,168 additions
and
389 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/database/migrations/1710669092619-UpdateAhamoveOrder.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
|
||
export class UpdateAhamoveOrder1710669092619 implements MigrationInterface { | ||
name = 'UpdateAhamoveOrder1710669092619'; | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`ALTER TABLE \`Ahamove_Order\` ADD COLUMN \`shared_link\` VARCHAR(2048) NOT NULL AFTER \`response\``, | ||
); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`ALTER TABLE \`Ahamove_Order\` DROP COLUMN \`shared_link\` `, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { | ||
Column, | ||
CreateDateColumn, | ||
Entity, | ||
JoinColumn, | ||
OneToOne, | ||
PrimaryGeneratedColumn, | ||
} from 'typeorm'; | ||
import { Media } from './media.entity'; | ||
|
||
@Entity('Customer') | ||
export class Customer { | ||
@PrimaryGeneratedColumn() | ||
public customer_id: number; | ||
|
||
@Column({ type: 'varchar', length: 25, nullable: false, unique: true }) | ||
public phone_number: string; | ||
|
||
@Column({ type: 'varchar', length: 255, nullable: true, unique: false }) | ||
public name: string; | ||
|
||
@Column({ type: 'varchar', length: 255, nullable: true, unique: false }) | ||
public email: string; | ||
|
||
@Column({ type: 'date', nullable: true, unique: false }) | ||
public birthday: Date; | ||
|
||
@Column({ type: 'char', length: 1, nullable: true, unique: false }) | ||
public sex: string; | ||
|
||
@OneToOne(() => Media) | ||
@JoinColumn({ | ||
name: 'profile_image', | ||
referencedColumnName: 'media_id', | ||
}) | ||
public profile_image: Media; | ||
|
||
@Column({ | ||
type: 'tinyint', | ||
nullable: false, | ||
unique: false, | ||
default: 0, | ||
}) | ||
public is_active: number; | ||
|
||
// @OneToOne(() => HealthInfo) | ||
// @JoinColumn({ | ||
// name: 'health_info_id', | ||
// referencedColumnName: 'health_info_id', | ||
// }) | ||
// public health_info: HealthInfo; | ||
|
||
@Column({ type: 'varchar', length: 255, nullable: true, unique: false }) | ||
public refresh_token: string; | ||
|
||
@CreateDateColumn({ | ||
type: 'datetime', | ||
nullable: false, | ||
unique: false, | ||
default: () => 'CURRENT_TIMESTAMP', | ||
}) | ||
public created_at: Date; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,52 @@ | ||
import { | ||
Entity, | ||
PrimaryColumn, | ||
Column, | ||
PrimaryGeneratedColumn, | ||
ManyToOne, | ||
JoinColumn, | ||
CreateDateColumn, | ||
OneToMany, | ||
} from 'typeorm'; | ||
import { Invoice } from './invoice.entity'; | ||
import { InvoiceStatusExt } from './invoice-status-ext.entity'; | ||
|
||
@Entity('Invoice_Status_History') | ||
export class InvoiceStatusHistory { | ||
@PrimaryColumn({ | ||
type: 'varchar', | ||
length: 36, | ||
}) | ||
@PrimaryGeneratedColumn('uuid') | ||
status_history_id: string; | ||
|
||
@Column({ | ||
type: 'int', | ||
nullable: false, | ||
unique: false, | ||
}) | ||
invoice_id: number; | ||
|
||
@Column({ | ||
type: 'varchar', | ||
length: 64, | ||
nullable: true, | ||
unique: false, | ||
}) | ||
status_id: string | null; | ||
|
||
@Column({ | ||
type: 'text', | ||
nullable: true, | ||
unique: false, | ||
}) | ||
note: string | null; | ||
|
||
@Column({ type: 'bigint', nullable: false }) | ||
@Column({ type: 'bigint', nullable: false, unique: false }) | ||
created_at: number; | ||
|
||
//RELATIONSHIP | ||
@ManyToOne(() => Invoice, (invoice) => invoice.history_status_obj) | ||
@JoinColumn({ | ||
name: 'invoice_id', | ||
referencedColumnName: 'invoice_id', | ||
}) | ||
public invoice_obj: Invoice; | ||
|
||
@OneToMany(() => InvoiceStatusExt, (ext) => ext.invoice_status_history) | ||
public invoice_status_ext: InvoiceStatusExt[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { | ||
Column, | ||
Entity, | ||
PrimaryColumn, | ||
CreateDateColumn, | ||
ManyToOne, | ||
JoinColumn, | ||
} from 'typeorm'; | ||
import { InvoiceStatusHistory } from './invoice-history-status.entity'; | ||
|
||
@Entity('Invoice_Status_Ext') | ||
export class InvoiceStatusExt { | ||
@PrimaryColumn() | ||
public status_id: string; | ||
|
||
@PrimaryColumn() | ||
public ISO_language_code: string; | ||
|
||
@Column({ type: 'varchar', length: 64, nullable: false, unique: false }) | ||
public name: string; | ||
|
||
@CreateDateColumn({ | ||
type: 'datetime', | ||
nullable: false, | ||
unique: false, | ||
default: () => 'CURRENT_TIMESTAMP', | ||
}) | ||
public created_at: Date; | ||
|
||
//RELATIONSHIP | ||
@ManyToOne( | ||
() => InvoiceStatusHistory, | ||
(history) => history.invoice_status_ext, | ||
) | ||
@JoinColumn({ | ||
name: 'status_id', | ||
referencedColumnName: 'status_id', | ||
}) | ||
public invoice_status_history: InvoiceStatusHistory; | ||
} |
Oops, something went wrong.