import Column from "@entity-access/entity-access/dist/decorators/Column.js"; import { RelateTo } from "@entity-access/entity-access/dist/decorators/Relate.js"; import Table from "@entity-access/entity-access/dist/decorators/Table.js"; import { StoreAccount } from "./StoreAccount.js"; import type { StoreJournal } from "./StoreJournal.js"; import GeoEntity from "./GeoEntity.js"; @Table("StoreAccountAddresses") export class StoreAccountAddress { @Column({ dataType: "BigInt", key: true, generated: "identity"}) addressID: number; @Column({ dataType: "BigInt" }) @RelateTo(StoreAccount, { property: (x) => x.storeAccount, inverseProperty: (x) => x.addresses }) accountID: number; @Column({ dataType: "Char", length: 400}) title: string; @Column({ dataType: "Char", length: 400}) line1: string; @Column({ dataType: "Char", length: 400, nullable: true}) line2: string; @Column({ dataType: "Char", length: 400, nullable: true}) line3: string; @Column({ dataType: "BigInt", nullable: true}) @RelateTo(GeoEntity, { property: (x) => x.city, inverseProperty: (x) => x.cityAddresses }) cityID: number; // @Column({ dataType: "Char", length: 50, nullable: true}) // city: string; // @Column({ dataType: "Char", length: 50, nullable: true}) // state: string; @Column({ dataType: "Char", length: 5, nullable: true}) countryCode: string; @Column({ dataType: "Char", length: 5, nullable: true}) phoneNumber: string; @Column({ dataType: "Char", length: 200, nullable: true}) incomeTaxID: string; @Column({ dataType: "Char", length: 200, nullable: true}) gstTaxID: string; @Column({ dataType: "Char", length: 200, nullable: true}) salesTaxID: string; @Column({ dataType: "Char", length: 200, nullable: true}) vatTaxID: string; @Column({ dataType: "Char", length: 200, nullable: true}) otherTaxID: string; @Column({ dataType: "Char", length: 5, nullable: true}) notes: string; storeAccount: StoreAccount; city: GeoEntity; shippingContacts: StoreAccount[]; billingContacts: StoreAccount[]; billedOrders: StoreJournal[]; shippedOrders: StoreJournal[]; // billedOrders: StoreJournal[]; // shippedOrders: StoreJournal[]; }