asv-hlps-market 1.0.3 → 1.0.4

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.
@@ -0,0 +1 @@
1
+ export * from "./models";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./models"), exports);
@@ -0,0 +1,31 @@
1
+ import Ste from "asv-hlps/lib/cjs/users/models/Ste";
2
+ import User from "asv-hlps/lib/cjs/users/models/User";
3
+ import ProductIn from "asv-hlps/lib/cjs/products/models/ProductIn";
4
+ import { BuyProduct } from "./BuyProduct";
5
+ export interface Buy {
6
+ author: User;
7
+ buyProducts: BuyProduct[];
8
+ createdAt: Date;
9
+ buyDate: Date | string;
10
+ id: number;
11
+ ins: ProductIn[];
12
+ isReceived: boolean;
13
+ isSaved: boolean;
14
+ isClosed: boolean;
15
+ fromInventory: boolean;
16
+ isArchived: boolean;
17
+ isSended: boolean;
18
+ isStandby: boolean;
19
+ isValided: boolean;
20
+ nbProducts: number;
21
+ pvd: Ste;
22
+ receivedDate: Date;
23
+ ref: string;
24
+ sendDate: Date | string;
25
+ otherCosts: number;
26
+ shippingCosts: number;
27
+ totalAmount: number;
28
+ totalQtity: number;
29
+ updatedAt: Date;
30
+ directReceived: boolean;
31
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,23 @@
1
+ import Product from "../../products/models/Product";
2
+ import { Buy } from "./Buy";
3
+ export interface BuyProduct {
4
+ buy?: Buy;
5
+ createdAt?: Date;
6
+ id?: number;
7
+ lot?: number;
8
+ product?: Product;
9
+ qtityDlvr: number;
10
+ qtityMiss?: number;
11
+ qtityOdr: number;
12
+ qtityFree?: number;
13
+ qtityPackOdr?: number;
14
+ qtityPackDlvr?: number;
15
+ qtityUnitOdr?: number;
16
+ qtityUnitDlvr?: number;
17
+ updatedAt?: Date;
18
+ qrCode?: string;
19
+ expirationDate: Date | string;
20
+ buyPrice: number;
21
+ amountBuyPrice: number;
22
+ publicPrice: number;
23
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from "./Buy";
2
+ export * from "./BuyProduct";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./Buy"), exports);
18
+ __exportStar(require("./BuyProduct"), exports);
@@ -2,5 +2,5 @@ import Product from "../products/models/Product";
2
2
  import CartItem from "../shared/CartItem";
3
3
  export default interface CartProduct extends CartItem {
4
4
  product: Product;
5
- specialPrice: number;
5
+ specialPrice?: number;
6
6
  }
@@ -22,7 +22,6 @@ class HlpShop {
22
22
  this.createCart(product.shop.id);
23
23
  const nItem = cartProducts.find((item) => this.isProductInCart(item, product));
24
24
  if (!nItem) {
25
- //@ts-ignore
26
25
  nCartProducts = [...cartProducts, { product, qtityOdr: 1 }];
27
26
  }
28
27
  else {
@@ -1,7 +1,7 @@
1
1
  import { Bank, BankAccount, PaymentMode } from "asv-hlps/lib/cjs/cashs";
2
2
  import User from "../../users/models/User";
3
3
  import Sale from "./Sale";
4
- export interface SalePayment {
4
+ export default interface SalePayment {
5
5
  id: number;
6
6
  ref: string;
7
7
  createdAt: Date;
@@ -1,5 +1,5 @@
1
1
  import BaseSaleProduct from "asv-hlps/lib/cjs/sales/models/SaleProduct";
2
- export interface SaleProduct extends BaseSaleProduct {
2
+ export default interface SaleProduct extends BaseSaleProduct {
3
3
  buy?: {
4
4
  avgUnitCostPrice: number;
5
5
  };
@@ -0,0 +1 @@
1
+ export * from "./models";
@@ -0,0 +1 @@
1
+ export * from "./models";
@@ -0,0 +1,31 @@
1
+ import Ste from "asv-hlps/lib/cjs/users/models/Ste";
2
+ import User from "asv-hlps/lib/cjs/users/models/User";
3
+ import ProductIn from "asv-hlps/lib/cjs/products/models/ProductIn";
4
+ import { BuyProduct } from "./BuyProduct";
5
+ export interface Buy {
6
+ author: User;
7
+ buyProducts: BuyProduct[];
8
+ createdAt: Date;
9
+ buyDate: Date | string;
10
+ id: number;
11
+ ins: ProductIn[];
12
+ isReceived: boolean;
13
+ isSaved: boolean;
14
+ isClosed: boolean;
15
+ fromInventory: boolean;
16
+ isArchived: boolean;
17
+ isSended: boolean;
18
+ isStandby: boolean;
19
+ isValided: boolean;
20
+ nbProducts: number;
21
+ pvd: Ste;
22
+ receivedDate: Date;
23
+ ref: string;
24
+ sendDate: Date | string;
25
+ otherCosts: number;
26
+ shippingCosts: number;
27
+ totalAmount: number;
28
+ totalQtity: number;
29
+ updatedAt: Date;
30
+ directReceived: boolean;
31
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ import Product from "../../products/models/Product";
2
+ import { Buy } from "./Buy";
3
+ export interface BuyProduct {
4
+ buy?: Buy;
5
+ createdAt?: Date;
6
+ id?: number;
7
+ lot?: number;
8
+ product?: Product;
9
+ qtityDlvr: number;
10
+ qtityMiss?: number;
11
+ qtityOdr: number;
12
+ qtityFree?: number;
13
+ qtityPackOdr?: number;
14
+ qtityPackDlvr?: number;
15
+ qtityUnitOdr?: number;
16
+ qtityUnitDlvr?: number;
17
+ updatedAt?: Date;
18
+ qrCode?: string;
19
+ expirationDate: Date | string;
20
+ buyPrice: number;
21
+ amountBuyPrice: number;
22
+ publicPrice: number;
23
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from "./Buy";
2
+ export * from "./BuyProduct";
@@ -0,0 +1,2 @@
1
+ export * from "./Buy";
2
+ export * from "./BuyProduct";
@@ -2,5 +2,5 @@ import Product from "../products/models/Product";
2
2
  import CartItem from "../shared/CartItem";
3
3
  export default interface CartProduct extends CartItem {
4
4
  product: Product;
5
- specialPrice: number;
5
+ specialPrice?: number;
6
6
  }
@@ -17,7 +17,6 @@ export default class HlpShop {
17
17
  this.createCart(product.shop.id);
18
18
  const nItem = cartProducts.find((item) => this.isProductInCart(item, product));
19
19
  if (!nItem) {
20
- //@ts-ignore
21
20
  nCartProducts = [...cartProducts, { product, qtityOdr: 1 }];
22
21
  }
23
22
  else {
@@ -1,7 +1,7 @@
1
1
  import { Bank, BankAccount, PaymentMode } from "asv-hlps/lib/cjs/cashs";
2
2
  import User from "../../users/models/User";
3
3
  import Sale from "./Sale";
4
- export interface SalePayment {
4
+ export default interface SalePayment {
5
5
  id: number;
6
6
  ref: string;
7
7
  createdAt: Date;
@@ -1,5 +1,5 @@
1
1
  import BaseSaleProduct from "asv-hlps/lib/cjs/sales/models/SaleProduct";
2
- export interface SaleProduct extends BaseSaleProduct {
2
+ export default interface SaleProduct extends BaseSaleProduct {
3
3
  buy?: {
4
4
  avgUnitCostPrice: number;
5
5
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asv-hlps-market",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "helpers for markets app",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/esm/index.js",