Extend database with more tables, rewrite API doc, improve API endpoints
This commit is contained in:
27
software/backend/models/address.model.ts
Normal file
27
software/backend/models/address.model.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { BelongsTo, Column, ForeignKey, Model, Table } from "sequelize-typescript";
|
||||
import { Account } from "./account.model";
|
||||
|
||||
@Table({ timestamps: false })
|
||||
export class Address extends Model {
|
||||
@ForeignKey(() => Account)
|
||||
@Column
|
||||
accountId: number
|
||||
|
||||
@Column
|
||||
street: string
|
||||
|
||||
@Column
|
||||
houseNumber: number
|
||||
|
||||
@Column
|
||||
postalCode: number
|
||||
|
||||
@Column
|
||||
city: string
|
||||
|
||||
|
||||
// Relations
|
||||
|
||||
@BelongsTo(() => Account)
|
||||
account: Account
|
||||
}
|
||||
Reference in New Issue
Block a user