proflores-db-model 0.2.11 → 0.2.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.
Binary file
package/.yarnrc.yml ADDED
@@ -0,0 +1 @@
1
+ nodeLinker: node-modules
@@ -1,9 +1,11 @@
1
1
  import { ObjectLiteral } from "typeorm";
2
2
  import { ExpenseTransaction } from "./ExpenseTransaction";
3
+ import { InventoryItem } from "./InventoryItem";
3
4
  export declare class ExpenseDetail implements ObjectLiteral {
4
5
  expenseDetailId: number;
5
6
  expenseTransaction: ExpenseTransaction;
6
- concept: string;
7
+ inventoryItem?: InventoryItem;
8
+ concept?: string;
7
9
  quantity: number;
8
10
  unitPrice: number;
9
11
  purchaseDate: Date;
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ExpenseDetail = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const ExpenseTransaction_1 = require("./ExpenseTransaction");
15
+ const InventoryItem_1 = require("./InventoryItem");
15
16
  let ExpenseDetail = class ExpenseDetail {
16
17
  };
17
18
  exports.ExpenseDetail = ExpenseDetail;
@@ -25,7 +26,12 @@ __decorate([
25
26
  __metadata("design:type", ExpenseTransaction_1.ExpenseTransaction)
26
27
  ], ExpenseDetail.prototype, "expenseTransaction", void 0);
27
28
  __decorate([
28
- (0, typeorm_1.Column)("varchar", { nullable: false }),
29
+ (0, typeorm_1.ManyToOne)(() => InventoryItem_1.InventoryItem, { nullable: false }),
30
+ (0, typeorm_1.JoinColumn)({ name: "inventoryItemId" }),
31
+ __metadata("design:type", InventoryItem_1.InventoryItem)
32
+ ], ExpenseDetail.prototype, "inventoryItem", void 0);
33
+ __decorate([
34
+ (0, typeorm_1.Column)("varchar", { nullable: true }),
29
35
  __metadata("design:type", String)
30
36
  ], ExpenseDetail.prototype, "concept", void 0);
31
37
  __decorate([
@@ -6,10 +6,12 @@ import { ContainerType } from "./ContainerType";
6
6
  import { Supplier } from "./Suppliers";
7
7
  import { InventoryImage } from "./InventoryImage";
8
8
  import { InventoryMovement } from "./InventoryMovement";
9
+ import { PlantTechnicalSheet } from "../models/technical-sheet/PlantTechnicalSheet";
9
10
  export declare class Inventory implements ObjectLiteral {
10
11
  idInventory: number;
11
12
  product: Product | null;
12
13
  container: ContainerType | null;
14
+ plantTechnicalSheet?: PlantTechnicalSheet;
13
15
  quantity: number;
14
16
  wholesalePrice: number;
15
17
  retailPrice: number;
@@ -18,6 +18,7 @@ const ContainerType_1 = require("./ContainerType");
18
18
  const Suppliers_1 = require("./Suppliers");
19
19
  const InventoryImage_1 = require("./InventoryImage");
20
20
  const InventoryMovement_1 = require("./InventoryMovement");
21
+ const PlantTechnicalSheet_1 = require("../models/technical-sheet/PlantTechnicalSheet");
21
22
  let Inventory = class Inventory {
22
23
  };
23
24
  exports.Inventory = Inventory;
@@ -35,6 +36,11 @@ __decorate([
35
36
  (0, typeorm_1.JoinColumn)({ name: "containerId" }),
36
37
  __metadata("design:type", Object)
37
38
  ], Inventory.prototype, "container", void 0);
39
+ __decorate([
40
+ (0, typeorm_1.ManyToOne)(() => PlantTechnicalSheet_1.PlantTechnicalSheet, { nullable: true }),
41
+ (0, typeorm_1.JoinColumn)({ name: "idPlantTechnicalSheet" }),
42
+ __metadata("design:type", PlantTechnicalSheet_1.PlantTechnicalSheet)
43
+ ], Inventory.prototype, "plantTechnicalSheet", void 0);
38
44
  __decorate([
39
45
  (0, typeorm_1.Column)("decimal", { nullable: false, default: 0 }),
40
46
  __metadata("design:type", Number)
@@ -0,0 +1,8 @@
1
+ export declare const PAYMENT_METHOD: {
2
+ EFECTIVO: string;
3
+ TRANSFERENCIA: string;
4
+ TARJETA: string;
5
+ CHEQUE: string;
6
+ OTRO: string;
7
+ };
8
+ export type PaymentMethod = keyof typeof PAYMENT_METHOD;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PAYMENT_METHOD = void 0;
4
+ // src/models/expense/catalogs/payment-method.ts
5
+ const makeCatalog_1 = require("../utils/makeCatalog");
6
+ exports.PAYMENT_METHOD = (0, makeCatalog_1.makeCatalog)({
7
+ EFECTIVO: "Efectivo",
8
+ TRANSFERENCIA: "Transferencia",
9
+ TARJETA: "Tarjeta",
10
+ CHEQUE: "Cheque",
11
+ OTRO: "Otro",
12
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "proflores-db-model",
3
- "version": "0.2.11",
3
+ "version": "0.2.21",
4
4
  "description": "Data model for managing expenses and transactions for Proflores nursery business",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -18,5 +18,6 @@
18
18
  "@types/node": "^22.15.3",
19
19
  "ts-node": "^10.0.0",
20
20
  "typescript": "^5.8.3"
21
- }
21
+ },
22
+ "packageManager": "yarn@4.9.2+sha512.1fc009bc09d13cfd0e19efa44cbfc2b9cf6ca61482725eb35bbc5e257e093ebf4130db6dfe15d604ff4b79efd8e1e8e99b25fa7d0a6197c9f9826358d4d65c3c"
22
23
  }
@@ -7,6 +7,7 @@ import {
7
7
  ObjectLiteral,
8
8
  } from "typeorm";
9
9
  import { ExpenseTransaction } from "./ExpenseTransaction";
10
+ import { InventoryItem } from "./InventoryItem";
10
11
 
11
12
  @Entity()
12
13
  export class ExpenseDetail implements ObjectLiteral {
@@ -20,8 +21,12 @@ export class ExpenseDetail implements ObjectLiteral {
20
21
  @JoinColumn({ name: "expenseTransactionId" })
21
22
  expenseTransaction!: ExpenseTransaction;
22
23
 
23
- @Column("varchar", { nullable: false })
24
- concept!: string;
24
+ @ManyToOne(() => InventoryItem, { nullable: false })
25
+ @JoinColumn({ name: "inventoryItemId" })
26
+ inventoryItem?: InventoryItem;
27
+
28
+ @Column("varchar", { nullable: true })
29
+ concept?: string;
25
30
 
26
31
  @Column("decimal", { nullable: false })
27
32
  quantity!: number;
@@ -31,7 +36,7 @@ export class ExpenseDetail implements ObjectLiteral {
31
36
 
32
37
  @Column("date", { nullable: false })
33
38
  purchaseDate!: Date;
34
-
39
+
35
40
  @Column("boolean", { default: true })
36
41
  isActive!: boolean;
37
42
  }
@@ -14,6 +14,7 @@ import { ContainerType } from "./ContainerType";
14
14
  import { Supplier } from "./Suppliers";
15
15
  import { InventoryImage } from "./InventoryImage";
16
16
  import { InventoryMovement } from "./InventoryMovement";
17
+ import { PlantTechnicalSheet } from "../models/technical-sheet/PlantTechnicalSheet";
17
18
 
18
19
  @Entity("inventory")
19
20
  export class Inventory implements ObjectLiteral {
@@ -28,6 +29,10 @@ export class Inventory implements ObjectLiteral {
28
29
  @JoinColumn({ name: "containerId" })
29
30
  container!: ContainerType | null;
30
31
 
32
+ @ManyToOne(() => PlantTechnicalSheet, { nullable: true })
33
+ @JoinColumn({ name: "idPlantTechnicalSheet" })
34
+ plantTechnicalSheet?: PlantTechnicalSheet;
35
+
31
36
  @Column("decimal", { nullable: false, default: 0 })
32
37
  quantity!: number;
33
38
 
@@ -0,0 +1,12 @@
1
+ // src/models/expense/catalogs/payment-method.ts
2
+ import { makeCatalog } from "../utils/makeCatalog";
3
+
4
+ export const PAYMENT_METHOD = makeCatalog({
5
+ EFECTIVO: "Efectivo",
6
+ TRANSFERENCIA: "Transferencia",
7
+ TARJETA: "Tarjeta",
8
+ CHEQUE: "Cheque",
9
+ OTRO: "Otro",
10
+ });
11
+
12
+ export type PaymentMethod = keyof typeof PAYMENT_METHOD;
@@ -0,0 +1 @@
1
+ const supabaseNames = ["agapanto"]