Skip to content

Commit

Permalink
feat(tax): get tax lines
Browse files Browse the repository at this point in the history
  • Loading branch information
srindom committed Feb 20, 2024
1 parent 137cc0e commit 84174f2
Show file tree
Hide file tree
Showing 13 changed files with 762 additions and 201 deletions.
546 changes: 546 additions & 0 deletions packages/tax/integration-tests/__tests__/index.spec.ts

Large diffs are not rendered by default.

141 changes: 0 additions & 141 deletions packages/tax/integration-tests/__tests__/index.ts

This file was deleted.

6 changes: 0 additions & 6 deletions packages/tax/integration-tests/setup-env.js

This file was deleted.

3 changes: 0 additions & 3 deletions packages/tax/integration-tests/setup.js

This file was deleted.

12 changes: 0 additions & 12 deletions packages/tax/integration-tests/utils/database.ts

This file was deleted.

33 changes: 0 additions & 33 deletions packages/tax/integration-tests/utils/get-init-module-config.ts

This file was deleted.

2 changes: 0 additions & 2 deletions packages/tax/integration-tests/utils/index.ts

This file was deleted.

2 changes: 0 additions & 2 deletions packages/tax/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@ module.exports = {
testEnvironment: `node`,
moduleFileExtensions: [`js`, `ts`],
modulePathIgnorePatterns: ["dist/"],
setupFiles: ["<rootDir>/integration-tests/setup-env.js"],
setupFilesAfterEnv: ["<rootDir>/integration-tests/setup.js"],
}
2 changes: 1 addition & 1 deletion packages/tax/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"prepublishOnly": "cross-env NODE_ENV=production tsc --build && tsc-alias -p tsconfig.json",
"build": "rimraf dist && tsc --build && tsc-alias -p tsconfig.json",
"test": "jest --runInBand --bail --forceExit -- src/**/__tests__/**/*.ts",
"test:integration": "jest --runInBand --forceExit -- integration-tests/**/__tests__/**/*.ts",
"test:integration": "jest --runInBand --forceExit -- integration-tests/**/__tests__/**/*.spec.ts",
"migration:generate": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:generate",
"migration:initial": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:create --initial",
"migration:create": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:create",
Expand Down
6 changes: 6 additions & 0 deletions packages/tax/src/models/tax-rate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ import {
import {
BeforeCreate,
Cascade,
Collection,
Entity,
ManyToOne,
OnInit,
OneToMany,
OptionalProps,
PrimaryKey,
Property,
} from "@mikro-orm/core"
import TaxRegion from "./tax-region"
import TaxRateRule from "./tax-rate-rule"

type OptionalTaxRateProps = DAL.EntityDateColumns

Expand Down Expand Up @@ -63,6 +66,9 @@ export default class TaxRate {
})
tax_region: TaxRegion

@OneToMany(() => TaxRateRule, (rule) => rule.tax_rate)
rules = new Collection<TaxRateRule>(this)

@Property({ columnType: "jsonb", nullable: true })
metadata: Record<string, unknown> | null = null

Expand Down
Loading

0 comments on commit 84174f2

Please sign in to comment.