@medusajs/medusa 1.1.62 → 1.1.63-adminc.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/routes/admin/collections/list-collections.d.ts +16 -3
- package/dist/api/routes/admin/collections/list-collections.js +88 -10
- package/dist/api/routes/admin/collections/list-collections.js.map +1 -1
- package/dist/api/routes/admin/discounts/list-discounts.d.ts +6 -0
- package/dist/api/routes/admin/discounts/list-discounts.js +45 -8
- package/dist/api/routes/admin/discounts/list-discounts.js.map +1 -1
- package/dist/api/routes/admin/orders/list-orders.js +1 -1
- package/dist/api/routes/admin/orders/list-orders.js.map +1 -1
- package/dist/api/routes/admin/products/list-products.js +1 -2
- package/dist/api/routes/admin/products/list-products.js.map +1 -1
- package/dist/api/routes/admin/tax-rates/add-to-product-types.d.ts +29 -0
- package/dist/api/routes/admin/tax-rates/add-to-product-types.js +177 -0
- package/dist/api/routes/admin/tax-rates/add-to-product-types.js.map +1 -0
- package/dist/api/routes/admin/tax-rates/add-to-products.d.ts +29 -0
- package/dist/api/routes/admin/tax-rates/add-to-products.js +173 -0
- package/dist/api/routes/admin/tax-rates/add-to-products.js.map +1 -0
- package/dist/api/routes/admin/tax-rates/add-to-shipping-options.d.ts +29 -0
- package/dist/api/routes/admin/tax-rates/add-to-shipping-options.js +177 -0
- package/dist/api/routes/admin/tax-rates/add-to-shipping-options.js.map +1 -0
- package/dist/api/routes/admin/tax-rates/create-tax-rate.d.ts +35 -0
- package/dist/api/routes/admin/tax-rates/create-tax-rate.js +286 -0
- package/dist/api/routes/admin/tax-rates/create-tax-rate.js.map +1 -0
- package/dist/api/routes/admin/tax-rates/delete-tax-rate.d.ts +28 -0
- package/dist/api/routes/admin/tax-rates/delete-tax-rate.js +84 -0
- package/dist/api/routes/admin/tax-rates/delete-tax-rate.js.map +1 -0
- package/dist/api/routes/admin/tax-rates/get-tax-rate.d.ts +26 -0
- package/dist/api/routes/admin/tax-rates/get-tax-rate.js +106 -0
- package/dist/api/routes/admin/tax-rates/get-tax-rate.js.map +1 -0
- package/dist/api/routes/admin/tax-rates/index.d.ts +21 -0
- package/dist/api/routes/admin/tax-rates/index.js +74 -0
- package/dist/api/routes/admin/tax-rates/index.js.map +1 -0
- package/dist/api/routes/admin/tax-rates/list-tax-rates.d.ts +44 -0
- package/dist/api/routes/admin/tax-rates/list-tax-rates.js +178 -0
- package/dist/api/routes/admin/tax-rates/list-tax-rates.js.map +1 -0
- package/dist/api/routes/admin/tax-rates/update-tax-rate.d.ts +35 -0
- package/dist/api/routes/admin/tax-rates/update-tax-rate.js +286 -0
- package/dist/api/routes/admin/tax-rates/update-tax-rate.js.map +1 -0
- package/dist/api/routes/admin/tax-rates/utils/get-query-config.d.ts +7 -0
- package/dist/api/routes/admin/tax-rates/utils/get-query-config.js +91 -0
- package/dist/api/routes/admin/tax-rates/utils/get-query-config.js.map +1 -0
- package/dist/api/routes/store/carts/calculate-taxes.d.ts +24 -0
- package/dist/api/routes/store/carts/calculate-taxes.js +153 -0
- package/dist/api/routes/store/carts/calculate-taxes.js.map +1 -0
- package/dist/interfaces/cart-completion-strategy.d.ts +20 -0
- package/dist/interfaces/cart-completion-strategy.js +10 -0
- package/dist/interfaces/cart-completion-strategy.js.map +1 -0
- package/dist/interfaces/index.d.ts +3 -0
- package/dist/interfaces/index.js +16 -0
- package/dist/interfaces/index.js.map +1 -0
- package/dist/interfaces/tax-calculation-strategy.d.ts +16 -0
- package/dist/interfaces/tax-calculation-strategy.js +10 -0
- package/dist/interfaces/tax-calculation-strategy.js.map +1 -0
- package/dist/interfaces/tax-service.d.ts +51 -0
- package/dist/interfaces/tax-service.js +3 -0
- package/dist/interfaces/tax-service.js.map +1 -0
- package/dist/loaders/strategies.d.ts +12 -0
- package/dist/loaders/strategies.js +32 -0
- package/dist/loaders/strategies.js.map +1 -0
- package/dist/migrations/1641636508055-new_tax_system.d.ts +6 -0
- package/dist/migrations/1641636508055-new_tax_system.js +248 -0
- package/dist/migrations/1641636508055-new_tax_system.js.map +1 -0
- package/dist/models/discount.js +2 -1
- package/dist/models/discount.js.map +1 -1
- package/dist/models/line-item-tax-line.d.ts +7 -0
- package/dist/models/line-item-tax-line.js +65 -0
- package/dist/models/line-item-tax-line.js.map +1 -0
- package/dist/models/product-tax-rate.d.ts +40 -0
- package/dist/models/product-tax-rate.js +88 -0
- package/dist/models/product-tax-rate.js.map +1 -0
- package/dist/models/product-type-tax-rate.d.ts +40 -0
- package/dist/models/product-type-tax-rate.js +88 -0
- package/dist/models/product-type-tax-rate.js.map +1 -0
- package/dist/models/shipping-method-tax-line.d.ts +7 -0
- package/dist/models/shipping-method-tax-line.js +65 -0
- package/dist/models/shipping-method-tax-line.js.map +1 -0
- package/dist/models/shipping-tax-rate.d.ts +40 -0
- package/dist/models/shipping-tax-rate.js +88 -0
- package/dist/models/shipping-tax-rate.js.map +1 -0
- package/dist/models/tax-line.d.ts +39 -0
- package/dist/models/tax-line.js +79 -0
- package/dist/models/tax-line.js.map +1 -0
- package/dist/models/tax-provider.d.ts +17 -0
- package/dist/models/tax-provider.js +44 -0
- package/dist/models/tax-provider.js.map +1 -0
- package/dist/models/tax-rate.d.ts +58 -0
- package/dist/models/tax-rate.js +159 -0
- package/dist/models/tax-rate.js.map +1 -0
- package/dist/repositories/line-item-tax-line.d.ts +4 -0
- package/dist/repositories/line-item-tax-line.js +38 -0
- package/dist/repositories/line-item-tax-line.js.map +1 -0
- package/dist/repositories/product-tax-rate.d.ts +4 -0
- package/dist/repositories/product-tax-rate.js +38 -0
- package/dist/repositories/product-tax-rate.js.map +1 -0
- package/dist/repositories/shipping-method-tax-line.d.ts +4 -0
- package/dist/repositories/shipping-method-tax-line.js +38 -0
- package/dist/repositories/shipping-method-tax-line.js.map +1 -0
- package/dist/repositories/shipping-tax-rate.d.ts +4 -0
- package/dist/repositories/shipping-tax-rate.js +38 -0
- package/dist/repositories/shipping-tax-rate.js.map +1 -0
- package/dist/repositories/tax-rate.d.ts +18 -0
- package/dist/repositories/tax-rate.js +359 -0
- package/dist/repositories/tax-rate.js.map +1 -0
- package/dist/services/product-tax-rate.d.ts +25 -0
- package/dist/services/product-tax-rate.js +104 -0
- package/dist/services/product-tax-rate.js.map +1 -0
- package/dist/services/product-type.d.ts +27 -0
- package/dist/services/product-type.js +112 -0
- package/dist/services/product-type.js.map +1 -0
- package/dist/services/shipping-tax-rate.d.ts +26 -0
- package/dist/services/shipping-tax-rate.js +105 -0
- package/dist/services/shipping-tax-rate.js.map +1 -0
- package/dist/services/system-tax.d.ts +9 -0
- package/dist/services/system-tax.js +89 -0
- package/dist/services/system-tax.js.map +1 -0
- package/dist/services/tax-provider.d.ts +105 -0
- package/dist/services/tax-provider.js +455 -0
- package/dist/services/tax-provider.js.map +1 -0
- package/dist/services/tax-rate.d.ts +31 -0
- package/dist/services/tax-rate.js +405 -0
- package/dist/services/tax-rate.js.map +1 -0
- package/dist/strategies/cart-completion.d.ts +17 -0
- package/dist/strategies/cart-completion.js +336 -0
- package/dist/strategies/cart-completion.js.map +1 -0
- package/dist/strategies/tax-calculation.d.ts +11 -0
- package/dist/strategies/tax-calculation.js +147 -0
- package/dist/strategies/tax-calculation.js.map +1 -0
- package/dist/types/discount.js.map +1 -1
- package/dist/types/orders.js +1 -1
- package/dist/types/orders.js.map +1 -1
- package/dist/types/product-tax-rate.d.ts +10 -0
- package/dist/types/product-tax-rate.js +13 -0
- package/dist/types/product-tax-rate.js.map +1 -0
- package/dist/types/request.d.ts +3 -0
- package/dist/types/request.js +3 -0
- package/dist/types/request.js.map +1 -0
- package/dist/types/shipping-tax-rate.d.ts +10 -0
- package/dist/types/shipping-tax-rate.js +13 -0
- package/dist/types/shipping-tax-rate.js.map +1 -0
- package/dist/types/tax-rate.d.ts +25 -0
- package/dist/types/tax-rate.js +3 -0
- package/dist/types/tax-rate.js.map +1 -0
- package/dist/types/tax-service.d.ts +34 -0
- package/dist/types/tax-service.js +3 -0
- package/dist/types/tax-service.js.map +1 -0
- package/dist/types/totals.d.ts +42 -0
- package/dist/types/totals.js +3 -0
- package/dist/types/totals.js.map +1 -0
- package/jest.config.js +17 -0
- package/package.json +3 -3
- package/yarn-error.log +79 -5
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.ShippingMethodTaxLine = void 0;
|
|
28
|
+
var typeorm_1 = require("typeorm");
|
|
29
|
+
var ulid_1 = require("ulid");
|
|
30
|
+
var tax_line_1 = require("./tax-line");
|
|
31
|
+
var shipping_method_1 = require("./shipping-method");
|
|
32
|
+
var ShippingMethodTaxLine = /** @class */ (function (_super) {
|
|
33
|
+
__extends(ShippingMethodTaxLine, _super);
|
|
34
|
+
function ShippingMethodTaxLine() {
|
|
35
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
36
|
+
}
|
|
37
|
+
ShippingMethodTaxLine.prototype.beforeInsert = function () {
|
|
38
|
+
if (this.id)
|
|
39
|
+
return;
|
|
40
|
+
var id = (0, ulid_1.ulid)();
|
|
41
|
+
this.id = "smtl_".concat(id);
|
|
42
|
+
};
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.Index)(),
|
|
45
|
+
(0, typeorm_1.Column)(),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], ShippingMethodTaxLine.prototype, "shipping_method_id", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.ManyToOne)(function () { return shipping_method_1.ShippingMethod; }, function (sm) { return sm.tax_lines; }),
|
|
50
|
+
(0, typeorm_1.JoinColumn)({ name: "shipping_method_id" }),
|
|
51
|
+
__metadata("design:type", shipping_method_1.ShippingMethod)
|
|
52
|
+
], ShippingMethodTaxLine.prototype, "shipping_method", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.BeforeInsert)(),
|
|
55
|
+
__metadata("design:type", Function),
|
|
56
|
+
__metadata("design:paramtypes", []),
|
|
57
|
+
__metadata("design:returntype", void 0)
|
|
58
|
+
], ShippingMethodTaxLine.prototype, "beforeInsert", null);
|
|
59
|
+
ShippingMethodTaxLine = __decorate([
|
|
60
|
+
(0, typeorm_1.Entity)()
|
|
61
|
+
], ShippingMethodTaxLine);
|
|
62
|
+
return ShippingMethodTaxLine;
|
|
63
|
+
}(tax_line_1.TaxLine));
|
|
64
|
+
exports.ShippingMethodTaxLine = ShippingMethodTaxLine;
|
|
65
|
+
//# sourceMappingURL=shipping-method-tax-line.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shipping-method-tax-line.js","sourceRoot":"","sources":["../../src/models/shipping-method-tax-line.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAOgB;AAChB,6BAA2B;AAE3B,uCAAoC;AACpC,qDAAkD;AAGlD;IAA2C,yCAAO;IAAlD;;IAeA,CAAC;IALS,4CAAY,GAApB;QACE,IAAI,IAAI,CAAC,EAAE;YAAE,OAAM;QACnB,IAAM,EAAE,GAAG,IAAA,WAAI,GAAE,CAAA;QACjB,IAAI,CAAC,EAAE,GAAG,eAAQ,EAAE,CAAE,CAAA;IACxB,CAAC;IAXD;QAFC,IAAA,eAAK,GAAE;QACP,IAAA,gBAAM,GAAE;;qEACiB;IAI1B;QAFC,IAAA,mBAAS,EAAC,cAAM,OAAA,gCAAc,EAAd,CAAc,EAAE,UAAC,EAAE,IAAK,OAAA,EAAE,CAAC,SAAS,EAAZ,CAAY,CAAC;QACrD,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,oBAAoB,EAAE,CAAC;kCAC1B,gCAAc;kEAAA;IAG/B;QADC,IAAA,sBAAY,GAAE;;;;6DAKd;IAdU,qBAAqB;QADjC,IAAA,gBAAM,GAAE;OACI,qBAAqB,CAejC;IAAD,4BAAC;CAAA,AAfD,CAA2C,kBAAO,GAejD;AAfY,sDAAqB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ShippingOption } from "./shipping-option";
|
|
2
|
+
import { TaxRate } from "./tax-rate";
|
|
3
|
+
export declare class ShippingTaxRate {
|
|
4
|
+
shipping_option_id: string;
|
|
5
|
+
rate_id: string;
|
|
6
|
+
shipping_option?: ShippingOption;
|
|
7
|
+
tax_rate?: TaxRate;
|
|
8
|
+
created_at: Date;
|
|
9
|
+
updated_at: Date;
|
|
10
|
+
deleted_at: Date;
|
|
11
|
+
metadata: any;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @schema shipping_tax_rate
|
|
15
|
+
* title: "Shipping Tax Rate"
|
|
16
|
+
* description: "Associates a tax rate with a shipping option to indicate that the shipping option is taxed in a certain way"
|
|
17
|
+
* x-resourceId: shipping_tax_rate
|
|
18
|
+
* properties:
|
|
19
|
+
* shipping_option_id:
|
|
20
|
+
* description: "The id of the Shipping Option"
|
|
21
|
+
* type: string
|
|
22
|
+
* rate_id:
|
|
23
|
+
* description: "The id of the Tax Rate"
|
|
24
|
+
* type: string
|
|
25
|
+
* created_at:
|
|
26
|
+
* description: "The date with timezone at which the resource was created."
|
|
27
|
+
* type: string
|
|
28
|
+
* format: date-time
|
|
29
|
+
* updated_at:
|
|
30
|
+
* description: "The date with timezone at which the resource was last updated."
|
|
31
|
+
* type: string
|
|
32
|
+
* format: date-time
|
|
33
|
+
* deleted_at:
|
|
34
|
+
* description: "The date with timezone at which the resource was deleted."
|
|
35
|
+
* type: string
|
|
36
|
+
* format: date-time
|
|
37
|
+
* metadata:
|
|
38
|
+
* description: "An optional key-value map with additional information."
|
|
39
|
+
* type: object
|
|
40
|
+
*/
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ShippingTaxRate = void 0;
|
|
13
|
+
var typeorm_1 = require("typeorm");
|
|
14
|
+
var db_aware_column_1 = require("../utils/db-aware-column");
|
|
15
|
+
var shipping_option_1 = require("./shipping-option");
|
|
16
|
+
var tax_rate_1 = require("./tax-rate");
|
|
17
|
+
var ShippingTaxRate = /** @class */ (function () {
|
|
18
|
+
function ShippingTaxRate() {
|
|
19
|
+
}
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, typeorm_1.PrimaryColumn)(),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], ShippingTaxRate.prototype, "shipping_option_id", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.PrimaryColumn)(),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], ShippingTaxRate.prototype, "rate_id", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.ManyToOne)(function () { return shipping_option_1.ShippingOption; }),
|
|
30
|
+
(0, typeorm_1.JoinColumn)({ name: "shipping_option_id" }),
|
|
31
|
+
__metadata("design:type", shipping_option_1.ShippingOption)
|
|
32
|
+
], ShippingTaxRate.prototype, "shipping_option", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.ManyToOne)(function () { return tax_rate_1.TaxRate; }),
|
|
35
|
+
(0, typeorm_1.JoinColumn)({ name: "rate_id" }),
|
|
36
|
+
__metadata("design:type", tax_rate_1.TaxRate)
|
|
37
|
+
], ShippingTaxRate.prototype, "tax_rate", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.CreateDateColumn)({ type: (0, db_aware_column_1.resolveDbType)("timestamptz") }),
|
|
40
|
+
__metadata("design:type", Date)
|
|
41
|
+
], ShippingTaxRate.prototype, "created_at", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.UpdateDateColumn)({ type: (0, db_aware_column_1.resolveDbType)("timestamptz") }),
|
|
44
|
+
__metadata("design:type", Date)
|
|
45
|
+
], ShippingTaxRate.prototype, "updated_at", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.DeleteDateColumn)({ type: (0, db_aware_column_1.resolveDbType)("timestamptz") }),
|
|
48
|
+
__metadata("design:type", Date)
|
|
49
|
+
], ShippingTaxRate.prototype, "deleted_at", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, db_aware_column_1.DbAwareColumn)({ type: "jsonb", nullable: true }),
|
|
52
|
+
__metadata("design:type", Object)
|
|
53
|
+
], ShippingTaxRate.prototype, "metadata", void 0);
|
|
54
|
+
ShippingTaxRate = __decorate([
|
|
55
|
+
(0, typeorm_1.Entity)()
|
|
56
|
+
], ShippingTaxRate);
|
|
57
|
+
return ShippingTaxRate;
|
|
58
|
+
}());
|
|
59
|
+
exports.ShippingTaxRate = ShippingTaxRate;
|
|
60
|
+
/**
|
|
61
|
+
* @schema shipping_tax_rate
|
|
62
|
+
* title: "Shipping Tax Rate"
|
|
63
|
+
* description: "Associates a tax rate with a shipping option to indicate that the shipping option is taxed in a certain way"
|
|
64
|
+
* x-resourceId: shipping_tax_rate
|
|
65
|
+
* properties:
|
|
66
|
+
* shipping_option_id:
|
|
67
|
+
* description: "The id of the Shipping Option"
|
|
68
|
+
* type: string
|
|
69
|
+
* rate_id:
|
|
70
|
+
* description: "The id of the Tax Rate"
|
|
71
|
+
* type: string
|
|
72
|
+
* created_at:
|
|
73
|
+
* description: "The date with timezone at which the resource was created."
|
|
74
|
+
* type: string
|
|
75
|
+
* format: date-time
|
|
76
|
+
* updated_at:
|
|
77
|
+
* description: "The date with timezone at which the resource was last updated."
|
|
78
|
+
* type: string
|
|
79
|
+
* format: date-time
|
|
80
|
+
* deleted_at:
|
|
81
|
+
* description: "The date with timezone at which the resource was deleted."
|
|
82
|
+
* type: string
|
|
83
|
+
* format: date-time
|
|
84
|
+
* metadata:
|
|
85
|
+
* description: "An optional key-value map with additional information."
|
|
86
|
+
* type: object
|
|
87
|
+
*/
|
|
88
|
+
//# sourceMappingURL=shipping-tax-rate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shipping-tax-rate.js","sourceRoot":"","sources":["../../src/models/shipping-tax-rate.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAQgB;AAChB,4DAAuE;AAEvE,qDAAkD;AAClD,uCAAoC;AAGpC;IAAA;IA0BA,CAAC;IAxBC;QADC,IAAA,uBAAa,GAAE;;+DACU;IAG1B;QADC,IAAA,uBAAa,GAAE;;oDACD;IAIf;QAFC,IAAA,mBAAS,EAAC,cAAM,OAAA,gCAAc,EAAd,CAAc,CAAC;QAC/B,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,oBAAoB,EAAE,CAAC;kCACzB,gCAAc;4DAAA;IAIhC;QAFC,IAAA,mBAAS,EAAC,cAAM,OAAA,kBAAO,EAAP,CAAO,CAAC;QACxB,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;kCACrB,kBAAO;qDAAA;IAGlB;QADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,IAAA,+BAAa,EAAC,aAAa,CAAC,EAAE,CAAC;kCAC7C,IAAI;uDAAA;IAGhB;QADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,IAAA,+BAAa,EAAC,aAAa,CAAC,EAAE,CAAC;kCAC7C,IAAI;uDAAA;IAGhB;QADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,IAAA,+BAAa,EAAC,aAAa,CAAC,EAAE,CAAC;kCAC7C,IAAI;uDAAA;IAGhB;QADC,IAAA,+BAAa,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACpC;IAzBF,eAAe;QAD3B,IAAA,gBAAM,GAAE;OACI,eAAe,CA0B3B;IAAD,sBAAC;CAAA,AA1BD,IA0BC;AA1BY,0CAAe;AA4B5B;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare class TaxLine {
|
|
2
|
+
id: string;
|
|
3
|
+
rate: number;
|
|
4
|
+
name: string;
|
|
5
|
+
code: string | null;
|
|
6
|
+
created_at: Date;
|
|
7
|
+
updated_at: Date;
|
|
8
|
+
metadata: any;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* @schema tax_line
|
|
12
|
+
* title: "Tax Line"
|
|
13
|
+
* description: "Line item that specifies an amount of tax to add to a line item."
|
|
14
|
+
* x-resourceId: tax_line
|
|
15
|
+
* properties:
|
|
16
|
+
* id:
|
|
17
|
+
* description: "The id of the Tax Line. This value will be prefixed by `tl_`."
|
|
18
|
+
* type: string
|
|
19
|
+
* code:
|
|
20
|
+
* description: "A code to identify the tax type by"
|
|
21
|
+
* type: string
|
|
22
|
+
* name:
|
|
23
|
+
* description: "A human friendly name for the tax"
|
|
24
|
+
* type: string
|
|
25
|
+
* rate:
|
|
26
|
+
* description: "The numeric rate to charge tax by"
|
|
27
|
+
* type: number
|
|
28
|
+
* created_at:
|
|
29
|
+
* description: "The date with timezone at which the resource was created."
|
|
30
|
+
* type: string
|
|
31
|
+
* format: date-time
|
|
32
|
+
* updated_at:
|
|
33
|
+
* description: "The date with timezone at which the resource was last updated."
|
|
34
|
+
* type: string
|
|
35
|
+
* format: date-time
|
|
36
|
+
* metadata:
|
|
37
|
+
* description: "An optional key-value map with additional information."
|
|
38
|
+
* type: object
|
|
39
|
+
*/
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.TaxLine = void 0;
|
|
13
|
+
var typeorm_1 = require("typeorm");
|
|
14
|
+
var db_aware_column_1 = require("../utils/db-aware-column");
|
|
15
|
+
var TaxLine = /** @class */ (function () {
|
|
16
|
+
function TaxLine() {
|
|
17
|
+
}
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, typeorm_1.PrimaryColumn)(),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], TaxLine.prototype, "id", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.Column)({ type: "real" }),
|
|
24
|
+
__metadata("design:type", Number)
|
|
25
|
+
], TaxLine.prototype, "rate", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.Column)(),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], TaxLine.prototype, "name", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Column)({ type: "varchar", nullable: true }),
|
|
32
|
+
__metadata("design:type", Object)
|
|
33
|
+
], TaxLine.prototype, "code", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.CreateDateColumn)({ type: (0, db_aware_column_1.resolveDbType)("timestamptz") }),
|
|
36
|
+
__metadata("design:type", Date)
|
|
37
|
+
], TaxLine.prototype, "created_at", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.UpdateDateColumn)({ type: (0, db_aware_column_1.resolveDbType)("timestamptz") }),
|
|
40
|
+
__metadata("design:type", Date)
|
|
41
|
+
], TaxLine.prototype, "updated_at", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, db_aware_column_1.DbAwareColumn)({ type: "jsonb", nullable: true }),
|
|
44
|
+
__metadata("design:type", Object)
|
|
45
|
+
], TaxLine.prototype, "metadata", void 0);
|
|
46
|
+
return TaxLine;
|
|
47
|
+
}());
|
|
48
|
+
exports.TaxLine = TaxLine;
|
|
49
|
+
/**
|
|
50
|
+
* @schema tax_line
|
|
51
|
+
* title: "Tax Line"
|
|
52
|
+
* description: "Line item that specifies an amount of tax to add to a line item."
|
|
53
|
+
* x-resourceId: tax_line
|
|
54
|
+
* properties:
|
|
55
|
+
* id:
|
|
56
|
+
* description: "The id of the Tax Line. This value will be prefixed by `tl_`."
|
|
57
|
+
* type: string
|
|
58
|
+
* code:
|
|
59
|
+
* description: "A code to identify the tax type by"
|
|
60
|
+
* type: string
|
|
61
|
+
* name:
|
|
62
|
+
* description: "A human friendly name for the tax"
|
|
63
|
+
* type: string
|
|
64
|
+
* rate:
|
|
65
|
+
* description: "The numeric rate to charge tax by"
|
|
66
|
+
* type: number
|
|
67
|
+
* created_at:
|
|
68
|
+
* description: "The date with timezone at which the resource was created."
|
|
69
|
+
* type: string
|
|
70
|
+
* format: date-time
|
|
71
|
+
* updated_at:
|
|
72
|
+
* description: "The date with timezone at which the resource was last updated."
|
|
73
|
+
* type: string
|
|
74
|
+
* format: date-time
|
|
75
|
+
* metadata:
|
|
76
|
+
* description: "An optional key-value map with additional information."
|
|
77
|
+
* type: object
|
|
78
|
+
*/
|
|
79
|
+
//# sourceMappingURL=tax-line.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tax-line.js","sourceRoot":"","sources":["../../src/models/tax-line.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAKgB;AAChB,4DAAuE;AAEvE;IAAA;IAqBA,CAAC;IAnBC;QADC,IAAA,uBAAa,GAAE;;uCACN;IAGV;QADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yCACb;IAGZ;QADC,IAAA,gBAAM,GAAE;;yCACG;IAGZ;QADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACzB;IAGnB;QADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,IAAA,+BAAa,EAAC,aAAa,CAAC,EAAE,CAAC;kCAC7C,IAAI;+CAAA;IAGhB;QADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,IAAA,+BAAa,EAAC,aAAa,CAAC,EAAE,CAAC;kCAC7C,IAAI;+CAAA;IAGhB;QADC,IAAA,+BAAa,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACpC;IACf,cAAC;CAAA,AArBD,IAqBC;AArBY,0BAAO;AAuBpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare class TaxProvider {
|
|
2
|
+
id: string;
|
|
3
|
+
is_installed: boolean;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* @schema tax_provider
|
|
7
|
+
* title: "Tax Provider"
|
|
8
|
+
* description: "The tax service used to calculate taxes"
|
|
9
|
+
* x-resourceId: tax_provider
|
|
10
|
+
* properties:
|
|
11
|
+
* id:
|
|
12
|
+
* description: "The id of the tax provider as given by the plugin."
|
|
13
|
+
* type: string
|
|
14
|
+
* is_installed:
|
|
15
|
+
* description: "Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`."
|
|
16
|
+
* type: boolean
|
|
17
|
+
*/
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.TaxProvider = void 0;
|
|
13
|
+
var typeorm_1 = require("typeorm");
|
|
14
|
+
var TaxProvider = /** @class */ (function () {
|
|
15
|
+
function TaxProvider() {
|
|
16
|
+
}
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, typeorm_1.PrimaryColumn)(),
|
|
19
|
+
__metadata("design:type", String)
|
|
20
|
+
], TaxProvider.prototype, "id", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.Column)({ default: true }),
|
|
23
|
+
__metadata("design:type", Boolean)
|
|
24
|
+
], TaxProvider.prototype, "is_installed", void 0);
|
|
25
|
+
TaxProvider = __decorate([
|
|
26
|
+
(0, typeorm_1.Entity)()
|
|
27
|
+
], TaxProvider);
|
|
28
|
+
return TaxProvider;
|
|
29
|
+
}());
|
|
30
|
+
exports.TaxProvider = TaxProvider;
|
|
31
|
+
/**
|
|
32
|
+
* @schema tax_provider
|
|
33
|
+
* title: "Tax Provider"
|
|
34
|
+
* description: "The tax service used to calculate taxes"
|
|
35
|
+
* x-resourceId: tax_provider
|
|
36
|
+
* properties:
|
|
37
|
+
* id:
|
|
38
|
+
* description: "The id of the tax provider as given by the plugin."
|
|
39
|
+
* type: string
|
|
40
|
+
* is_installed:
|
|
41
|
+
* description: "Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`."
|
|
42
|
+
* type: boolean
|
|
43
|
+
*/
|
|
44
|
+
//# sourceMappingURL=tax-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tax-provider.js","sourceRoot":"","sources":["../../src/models/tax-provider.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAuD;AAGvD;IAAA;IAMA,CAAC;IAJC;QADC,IAAA,uBAAa,GAAE;;2CACN;IAGV;QADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;qDACL;IALV,WAAW;QADvB,IAAA,gBAAM,GAAE;OACI,WAAW,CAMvB;IAAD,kBAAC;CAAA,AAND,IAMC;AANY,kCAAW;AAQxB;;;;;;;;;;;;GAYG"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Region } from "./region";
|
|
2
|
+
import { Product } from "./product";
|
|
3
|
+
import { ProductType } from "./product-type";
|
|
4
|
+
import { ShippingOption } from "./shipping-option";
|
|
5
|
+
export declare class TaxRate {
|
|
6
|
+
id: string;
|
|
7
|
+
rate: number | null;
|
|
8
|
+
code: string | null;
|
|
9
|
+
name: string;
|
|
10
|
+
region_id: string;
|
|
11
|
+
region: Region;
|
|
12
|
+
created_at: Date;
|
|
13
|
+
updated_at: Date;
|
|
14
|
+
metadata: any;
|
|
15
|
+
products: Product[];
|
|
16
|
+
product_types: ProductType[];
|
|
17
|
+
shipping_options: ShippingOption[];
|
|
18
|
+
product_count?: number;
|
|
19
|
+
product_type_count?: number;
|
|
20
|
+
shipping_option_count?: number;
|
|
21
|
+
private beforeInsert;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @schema tax_rate
|
|
25
|
+
* title: "Tax Rate"
|
|
26
|
+
* description: "A Tax Rate can be used to associate a certain rate to charge on products within a given Region"
|
|
27
|
+
* x-resourceId: line_item
|
|
28
|
+
* properties:
|
|
29
|
+
* id:
|
|
30
|
+
* description: "The id of the Tax Rate. This value will be prefixed by `txr_`."
|
|
31
|
+
* type: string
|
|
32
|
+
* rate:
|
|
33
|
+
* description: "The numeric rate to charge"
|
|
34
|
+
* type: number
|
|
35
|
+
* code:
|
|
36
|
+
* description: "A code to identify the tax type by"
|
|
37
|
+
* type: string
|
|
38
|
+
* name:
|
|
39
|
+
* description: "A human friendly name for the tax"
|
|
40
|
+
* type: string
|
|
41
|
+
* region_id:
|
|
42
|
+
* description: "The id of the Region that the rate belongs to"
|
|
43
|
+
* type: string
|
|
44
|
+
* created_at:
|
|
45
|
+
* description: "The date with timezone at which the resource was created."
|
|
46
|
+
* type: string
|
|
47
|
+
* format: date-time
|
|
48
|
+
* updated_at:
|
|
49
|
+
* description: "The date with timezone at which the resource was last updated."
|
|
50
|
+
* type: string
|
|
51
|
+
* format: date-time
|
|
52
|
+
* metadata:
|
|
53
|
+
* description: "An optional key-value map with additional information."
|
|
54
|
+
* type: object
|
|
55
|
+
* refundable:
|
|
56
|
+
* description: "The amount that can be refunded from the given Line Item. Takes taxes and discounts into consideration."
|
|
57
|
+
* type: integer
|
|
58
|
+
*/
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.TaxRate = void 0;
|
|
13
|
+
var typeorm_1 = require("typeorm");
|
|
14
|
+
var ulid_1 = require("ulid");
|
|
15
|
+
var db_aware_column_1 = require("../utils/db-aware-column");
|
|
16
|
+
var region_1 = require("./region");
|
|
17
|
+
var product_1 = require("./product");
|
|
18
|
+
var product_type_1 = require("./product-type");
|
|
19
|
+
var shipping_option_1 = require("./shipping-option");
|
|
20
|
+
var TaxRate = /** @class */ (function () {
|
|
21
|
+
function TaxRate() {
|
|
22
|
+
}
|
|
23
|
+
TaxRate.prototype.beforeInsert = function () {
|
|
24
|
+
if (this.id)
|
|
25
|
+
return;
|
|
26
|
+
var id = (0, ulid_1.ulid)();
|
|
27
|
+
this.id = "txr_".concat(id);
|
|
28
|
+
};
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.PrimaryColumn)(),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], TaxRate.prototype, "id", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({ type: "real", nullable: true }),
|
|
35
|
+
__metadata("design:type", Object)
|
|
36
|
+
], TaxRate.prototype, "rate", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ type: "varchar", nullable: true }),
|
|
39
|
+
__metadata("design:type", Object)
|
|
40
|
+
], TaxRate.prototype, "code", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)(),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], TaxRate.prototype, "name", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Column)(),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], TaxRate.prototype, "region_id", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.ManyToOne)(function () { return region_1.Region; }),
|
|
51
|
+
(0, typeorm_1.JoinColumn)({ name: "region_id" }),
|
|
52
|
+
__metadata("design:type", region_1.Region)
|
|
53
|
+
], TaxRate.prototype, "region", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.CreateDateColumn)({ type: (0, db_aware_column_1.resolveDbType)("timestamptz") }),
|
|
56
|
+
__metadata("design:type", Date)
|
|
57
|
+
], TaxRate.prototype, "created_at", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.UpdateDateColumn)({ type: (0, db_aware_column_1.resolveDbType)("timestamptz") }),
|
|
60
|
+
__metadata("design:type", Date)
|
|
61
|
+
], TaxRate.prototype, "updated_at", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, db_aware_column_1.DbAwareColumn)({ type: "jsonb", nullable: true }),
|
|
64
|
+
__metadata("design:type", Object)
|
|
65
|
+
], TaxRate.prototype, "metadata", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, typeorm_1.ManyToMany)(function () { return product_1.Product; }),
|
|
68
|
+
(0, typeorm_1.JoinTable)({
|
|
69
|
+
name: "product_tax_rate",
|
|
70
|
+
joinColumn: {
|
|
71
|
+
name: "rate_id",
|
|
72
|
+
referencedColumnName: "id",
|
|
73
|
+
},
|
|
74
|
+
inverseJoinColumn: {
|
|
75
|
+
name: "product_id",
|
|
76
|
+
referencedColumnName: "id",
|
|
77
|
+
},
|
|
78
|
+
}),
|
|
79
|
+
__metadata("design:type", Array)
|
|
80
|
+
], TaxRate.prototype, "products", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, typeorm_1.ManyToMany)(function () { return product_type_1.ProductType; }),
|
|
83
|
+
(0, typeorm_1.JoinTable)({
|
|
84
|
+
name: "product_type_tax_rate",
|
|
85
|
+
joinColumn: {
|
|
86
|
+
name: "rate_id",
|
|
87
|
+
referencedColumnName: "id",
|
|
88
|
+
},
|
|
89
|
+
inverseJoinColumn: {
|
|
90
|
+
name: "product_type_id",
|
|
91
|
+
referencedColumnName: "id",
|
|
92
|
+
},
|
|
93
|
+
}),
|
|
94
|
+
__metadata("design:type", Array)
|
|
95
|
+
], TaxRate.prototype, "product_types", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
(0, typeorm_1.ManyToMany)(function () { return shipping_option_1.ShippingOption; }),
|
|
98
|
+
(0, typeorm_1.JoinTable)({
|
|
99
|
+
name: "shipping_tax_rate",
|
|
100
|
+
joinColumn: {
|
|
101
|
+
name: "rate_id",
|
|
102
|
+
referencedColumnName: "id",
|
|
103
|
+
},
|
|
104
|
+
inverseJoinColumn: {
|
|
105
|
+
name: "shipping_option_id",
|
|
106
|
+
referencedColumnName: "id",
|
|
107
|
+
},
|
|
108
|
+
}),
|
|
109
|
+
__metadata("design:type", Array)
|
|
110
|
+
], TaxRate.prototype, "shipping_options", void 0);
|
|
111
|
+
__decorate([
|
|
112
|
+
(0, typeorm_1.BeforeInsert)(),
|
|
113
|
+
__metadata("design:type", Function),
|
|
114
|
+
__metadata("design:paramtypes", []),
|
|
115
|
+
__metadata("design:returntype", void 0)
|
|
116
|
+
], TaxRate.prototype, "beforeInsert", null);
|
|
117
|
+
TaxRate = __decorate([
|
|
118
|
+
(0, typeorm_1.Entity)()
|
|
119
|
+
], TaxRate);
|
|
120
|
+
return TaxRate;
|
|
121
|
+
}());
|
|
122
|
+
exports.TaxRate = TaxRate;
|
|
123
|
+
/**
|
|
124
|
+
* @schema tax_rate
|
|
125
|
+
* title: "Tax Rate"
|
|
126
|
+
* description: "A Tax Rate can be used to associate a certain rate to charge on products within a given Region"
|
|
127
|
+
* x-resourceId: line_item
|
|
128
|
+
* properties:
|
|
129
|
+
* id:
|
|
130
|
+
* description: "The id of the Tax Rate. This value will be prefixed by `txr_`."
|
|
131
|
+
* type: string
|
|
132
|
+
* rate:
|
|
133
|
+
* description: "The numeric rate to charge"
|
|
134
|
+
* type: number
|
|
135
|
+
* code:
|
|
136
|
+
* description: "A code to identify the tax type by"
|
|
137
|
+
* type: string
|
|
138
|
+
* name:
|
|
139
|
+
* description: "A human friendly name for the tax"
|
|
140
|
+
* type: string
|
|
141
|
+
* region_id:
|
|
142
|
+
* description: "The id of the Region that the rate belongs to"
|
|
143
|
+
* type: string
|
|
144
|
+
* created_at:
|
|
145
|
+
* description: "The date with timezone at which the resource was created."
|
|
146
|
+
* type: string
|
|
147
|
+
* format: date-time
|
|
148
|
+
* updated_at:
|
|
149
|
+
* description: "The date with timezone at which the resource was last updated."
|
|
150
|
+
* type: string
|
|
151
|
+
* format: date-time
|
|
152
|
+
* metadata:
|
|
153
|
+
* description: "An optional key-value map with additional information."
|
|
154
|
+
* type: object
|
|
155
|
+
* refundable:
|
|
156
|
+
* description: "The amount that can be refunded from the given Line Item. Takes taxes and discounts into consideration."
|
|
157
|
+
* type: integer
|
|
158
|
+
*/
|
|
159
|
+
//# sourceMappingURL=tax-rate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tax-rate.js","sourceRoot":"","sources":["../../src/models/tax-rate.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAWgB;AAChB,6BAA2B;AAC3B,4DAAuE;AAEvE,mCAAiC;AACjC,qCAAmC;AACnC,+CAA4C;AAC5C,qDAAkD;AAGlD;IAAA;IAkFA,CAAC;IALS,8BAAY,GAApB;QACE,IAAI,IAAI,CAAC,EAAE;YAAE,OAAM;QACnB,IAAM,EAAE,GAAG,IAAA,WAAI,GAAE,CAAA;QACjB,IAAI,CAAC,EAAE,GAAG,cAAO,EAAE,CAAE,CAAA;IACvB,CAAC;IA/ED;QADC,IAAA,uBAAa,GAAE;;uCACN;IAGV;QADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACtB;IAGnB;QADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACzB;IAGnB;QADC,IAAA,gBAAM,GAAE;;yCACG;IAGZ;QADC,IAAA,gBAAM,GAAE;;8CACQ;IAIjB;QAFC,IAAA,mBAAS,EAAC,cAAM,OAAA,eAAM,EAAN,CAAM,CAAC;QACvB,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;kCAC1B,eAAM;2CAAA;IAGd;QADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,IAAA,+BAAa,EAAC,aAAa,CAAC,EAAE,CAAC;kCAC7C,IAAI;+CAAA;IAGhB;QADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,IAAA,+BAAa,EAAC,aAAa,CAAC,EAAE,CAAC;kCAC7C,IAAI;+CAAA;IAGhB;QADC,IAAA,+BAAa,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACpC;IAcb;QAZC,IAAA,oBAAU,EAAC,cAAM,OAAA,iBAAO,EAAP,CAAO,CAAC;QACzB,IAAA,mBAAS,EAAC;YACT,IAAI,EAAE,kBAAkB;YACxB,UAAU,EAAE;gBACV,IAAI,EAAE,SAAS;gBACf,oBAAoB,EAAE,IAAI;aAC3B;YACD,iBAAiB,EAAE;gBACjB,IAAI,EAAE,YAAY;gBAClB,oBAAoB,EAAE,IAAI;aAC3B;SACF,CAAC;;6CACiB;IAcnB;QAZC,IAAA,oBAAU,EAAC,cAAM,OAAA,0BAAW,EAAX,CAAW,CAAC;QAC7B,IAAA,mBAAS,EAAC;YACT,IAAI,EAAE,uBAAuB;YAC7B,UAAU,EAAE;gBACV,IAAI,EAAE,SAAS;gBACf,oBAAoB,EAAE,IAAI;aAC3B;YACD,iBAAiB,EAAE;gBACjB,IAAI,EAAE,iBAAiB;gBACvB,oBAAoB,EAAE,IAAI;aAC3B;SACF,CAAC;;kDAC0B;IAc5B;QAZC,IAAA,oBAAU,EAAC,cAAM,OAAA,gCAAc,EAAd,CAAc,CAAC;QAChC,IAAA,mBAAS,EAAC;YACT,IAAI,EAAE,mBAAmB;YACzB,UAAU,EAAE;gBACV,IAAI,EAAE,SAAS;gBACf,oBAAoB,EAAE,IAAI;aAC3B;YACD,iBAAiB,EAAE;gBACjB,IAAI,EAAE,oBAAoB;gBAC1B,oBAAoB,EAAE,IAAI;aAC3B;SACF,CAAC;;qDACgC;IAQlC;QADC,IAAA,sBAAY,GAAE;;;;+CAKd;IAjFU,OAAO;QADnB,IAAA,gBAAM,GAAE;OACI,OAAO,CAkFnB;IAAD,cAAC;CAAA,AAlFD,IAkFC;AAlFY,0BAAO;AAoFpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG"}
|