proflores-db-model 0.2.30 → 0.2.32

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.
@@ -1,6 +1,7 @@
1
1
  import { ObjectLiteral } from "typeorm";
2
2
  import { ExpenseTransaction } from "./ExpenseTransaction";
3
3
  import { Inventory } from "./Inventory";
4
+ import { ProjectOrder } from "./ProjectOrder";
4
5
  export declare class ExpenseDetail implements ObjectLiteral {
5
6
  expenseDetailId: number;
6
7
  expenseTransaction: ExpenseTransaction;
@@ -10,4 +11,5 @@ export declare class ExpenseDetail implements ObjectLiteral {
10
11
  unitPrice: number;
11
12
  purchaseDate: Date;
12
13
  isActive: boolean;
14
+ projectOrder?: ProjectOrder;
13
15
  }
@@ -13,6 +13,7 @@ exports.ExpenseDetail = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const ExpenseTransaction_1 = require("./ExpenseTransaction");
15
15
  const Inventory_1 = require("./Inventory");
16
+ const ProjectOrder_1 = require("./ProjectOrder");
16
17
  let ExpenseDetail = class ExpenseDetail {
17
18
  };
18
19
  exports.ExpenseDetail = ExpenseDetail;
@@ -53,6 +54,11 @@ __decorate([
53
54
  (0, typeorm_1.Column)("boolean", { default: true }),
54
55
  __metadata("design:type", Boolean)
55
56
  ], ExpenseDetail.prototype, "isActive", void 0);
57
+ __decorate([
58
+ (0, typeorm_1.ManyToOne)(() => ProjectOrder_1.ProjectOrder, { nullable: false }),
59
+ (0, typeorm_1.JoinColumn)({ name: "projectId" }),
60
+ __metadata("design:type", ProjectOrder_1.ProjectOrder)
61
+ ], ExpenseDetail.prototype, "projectOrder", void 0);
56
62
  exports.ExpenseDetail = ExpenseDetail = __decorate([
57
63
  (0, typeorm_1.Entity)()
58
64
  ], ExpenseDetail);
@@ -1,5 +1,4 @@
1
1
  import { ObjectLiteral } from "typeorm";
2
- import { ProjectOrder } from "./ProjectOrder";
3
2
  import { ExpenseType } from "./ExpenseType";
4
3
  import { ExpenseDetail } from "./ExpenseDetail";
5
4
  import { TransactionBank } from "./Bank/TransactionBank";
@@ -11,7 +10,6 @@ export declare class ExpenseTransaction implements ObjectLiteral {
11
10
  paymentMethod: string;
12
11
  description: string;
13
12
  mediaFile: string;
14
- projectOrder: ProjectOrder;
15
13
  expenseType: ExpenseType;
16
14
  expenseDetails?: ExpenseDetail[];
17
15
  transactionBank?: TransactionBank;
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ExpenseTransaction = void 0;
13
13
  // src/entities/ExpenseTransaction.ts
14
14
  const typeorm_1 = require("typeorm");
15
- const ProjectOrder_1 = require("./ProjectOrder");
16
15
  const ExpenseType_1 = require("./ExpenseType");
17
16
  const ExpenseDetail_1 = require("./ExpenseDetail");
18
17
  const TransactionBank_1 = require("./Bank/TransactionBank");
@@ -47,11 +46,6 @@ __decorate([
47
46
  (0, typeorm_1.Column)("varchar", { nullable: true }),
48
47
  __metadata("design:type", String)
49
48
  ], ExpenseTransaction.prototype, "mediaFile", void 0);
50
- __decorate([
51
- (0, typeorm_1.ManyToOne)(() => ProjectOrder_1.ProjectOrder, { nullable: false }),
52
- (0, typeorm_1.JoinColumn)({ name: "projectId" }),
53
- __metadata("design:type", ProjectOrder_1.ProjectOrder)
54
- ], ExpenseTransaction.prototype, "projectOrder", void 0);
55
49
  __decorate([
56
50
  (0, typeorm_1.ManyToOne)(() => ExpenseType_1.ExpenseType, { nullable: false }),
57
51
  (0, typeorm_1.JoinColumn)({ name: "expenseTypeId" }),
@@ -7,7 +7,7 @@ import { Supplier } from "./Suppliers";
7
7
  import { InventoryImage } from "./InventoryImage";
8
8
  import { InventoryMovement } from "./InventoryMovement";
9
9
  import { PlantTechnicalSheet } from "../models/technical-sheet/PlantTechnicalSheet";
10
- import { InventoryTechnicalSheet } from "../models/inventory-technical-sheet.entity";
10
+ import { InventoryTechnicalSheet } from "../models/technical-sheet/inventory-technical-sheet.entity";
11
11
  export declare class Inventory implements ObjectLiteral {
12
12
  idInventory: number;
13
13
  product?: Product | null;
@@ -19,7 +19,7 @@ const Suppliers_1 = require("./Suppliers");
19
19
  const InventoryImage_1 = require("./InventoryImage");
20
20
  const InventoryMovement_1 = require("./InventoryMovement");
21
21
  const PlantTechnicalSheet_1 = require("../models/technical-sheet/PlantTechnicalSheet");
22
- const inventory_technical_sheet_entity_1 = require("../models/inventory-technical-sheet.entity");
22
+ const inventory_technical_sheet_entity_1 = require("../models/technical-sheet/inventory-technical-sheet.entity");
23
23
  let Inventory = class Inventory {
24
24
  };
25
25
  exports.Inventory = Inventory;
@@ -11,7 +11,7 @@ import { PropagationMethodInfo } from "./PropagationMethodInfo";
11
11
  import { PlantSize } from "./PlantSize";
12
12
  import { GrowthClassInfo } from "./GrowthClassInfo";
13
13
  import { ImageInfo } from "./ImageInfo";
14
- import { InventoryTechnicalSheet } from "../inventory-technical-sheet.entity";
14
+ import { InventoryTechnicalSheet } from "./inventory-technical-sheet.entity";
15
15
  export declare class PlantTechnicalSheet implements ObjectLiteral {
16
16
  idPlantTechnicalSheet: number;
17
17
  commonName: string;
@@ -23,7 +23,7 @@ const PropagationMethodInfo_1 = require("./PropagationMethodInfo");
23
23
  const PlantSize_1 = require("./PlantSize");
24
24
  const GrowthClassInfo_1 = require("./GrowthClassInfo");
25
25
  const ImageInfo_1 = require("./ImageInfo");
26
- const inventory_technical_sheet_entity_1 = require("../inventory-technical-sheet.entity");
26
+ const inventory_technical_sheet_entity_1 = require("./inventory-technical-sheet.entity");
27
27
  let PlantTechnicalSheet = class PlantTechnicalSheet {
28
28
  };
29
29
  exports.PlantTechnicalSheet = PlantTechnicalSheet;
@@ -11,4 +11,5 @@ export * from './SubstrateInfo';
11
11
  export * from './ClimateIdeal';
12
12
  export * from './FertilizationInfo';
13
13
  export * from './PropagationMethodInfo';
14
+ export * from './inventory-technical-sheet.entity';
14
15
  export * from './catalogs';
@@ -27,4 +27,5 @@ __exportStar(require("./SubstrateInfo"), exports);
27
27
  __exportStar(require("./ClimateIdeal"), exports);
28
28
  __exportStar(require("./FertilizationInfo"), exports);
29
29
  __exportStar(require("./PropagationMethodInfo"), exports);
30
+ __exportStar(require("./inventory-technical-sheet.entity"), exports);
30
31
  __exportStar(require("./catalogs"), exports);
@@ -0,0 +1,8 @@
1
+ import { Inventory } from "../../entities/Inventory";
2
+ import { PlantTechnicalSheet } from "./PlantTechnicalSheet";
3
+ export declare class InventoryTechnicalSheet {
4
+ id: number;
5
+ inventory: Inventory;
6
+ technicalSheet: PlantTechnicalSheet;
7
+ ratio?: number;
8
+ }
@@ -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.InventoryTechnicalSheet = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const Inventory_1 = require("../../entities/Inventory");
15
+ const PlantTechnicalSheet_1 = require("./PlantTechnicalSheet");
16
+ let InventoryTechnicalSheet = class InventoryTechnicalSheet {
17
+ };
18
+ exports.InventoryTechnicalSheet = InventoryTechnicalSheet;
19
+ __decorate([
20
+ (0, typeorm_1.PrimaryGeneratedColumn)("increment"),
21
+ __metadata("design:type", Number)
22
+ ], InventoryTechnicalSheet.prototype, "id", void 0);
23
+ __decorate([
24
+ (0, typeorm_1.ManyToOne)(() => Inventory_1.Inventory, (inv) => inv.plantTechnicalSheet, {
25
+ onDelete: "CASCADE",
26
+ }),
27
+ (0, typeorm_1.JoinColumn)({ name: "inventoryId" }),
28
+ __metadata("design:type", Inventory_1.Inventory)
29
+ ], InventoryTechnicalSheet.prototype, "inventory", void 0);
30
+ __decorate([
31
+ (0, typeorm_1.ManyToOne)(() => PlantTechnicalSheet_1.PlantTechnicalSheet, (sheet) => sheet.idPlantTechnicalSheet, {
32
+ eager: true,
33
+ onDelete: "CASCADE",
34
+ }),
35
+ (0, typeorm_1.JoinColumn)({ name: "technicalSheetId" }),
36
+ __metadata("design:type", PlantTechnicalSheet_1.PlantTechnicalSheet)
37
+ ], InventoryTechnicalSheet.prototype, "technicalSheet", void 0);
38
+ __decorate([
39
+ (0, typeorm_1.Column)("decimal", { default: 1, nullable: true }),
40
+ __metadata("design:type", Number)
41
+ ], InventoryTechnicalSheet.prototype, "ratio", void 0);
42
+ exports.InventoryTechnicalSheet = InventoryTechnicalSheet = __decorate([
43
+ (0, typeorm_1.Entity)("inventory_technical_sheets")
44
+ ], InventoryTechnicalSheet);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "proflores-db-model",
3
- "version": "0.2.30",
3
+ "version": "0.2.32",
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",
@@ -8,6 +8,7 @@ import {
8
8
  } from "typeorm";
9
9
  import { ExpenseTransaction } from "./ExpenseTransaction";
10
10
  import { Inventory } from "./Inventory";
11
+ import { ProjectOrder } from "./ProjectOrder";
11
12
 
12
13
  @Entity()
13
14
  export class ExpenseDetail implements ObjectLiteral {
@@ -42,4 +43,8 @@ export class ExpenseDetail implements ObjectLiteral {
42
43
 
43
44
  @Column("boolean", { default: true })
44
45
  isActive!: boolean;
46
+
47
+ @ManyToOne(() => ProjectOrder, { nullable: false })
48
+ @JoinColumn({ name: "projectId" })
49
+ projectOrder?: ProjectOrder;
45
50
  }
@@ -9,7 +9,6 @@ import {
9
9
  ObjectLiteral,
10
10
  OneToOne
11
11
  } from "typeorm";
12
- import { ProjectOrder } from "./ProjectOrder";
13
12
  import { ExpenseType } from "./ExpenseType";
14
13
  import { ExpenseDetail } from "./ExpenseDetail";
15
14
  import { TransactionBank } from "./Bank/TransactionBank";
@@ -37,10 +36,6 @@ export class ExpenseTransaction implements ObjectLiteral {
37
36
  @Column("varchar", { nullable: true })
38
37
  mediaFile!: string;
39
38
 
40
- @ManyToOne(() => ProjectOrder, { nullable: false })
41
- @JoinColumn({ name: "projectId" })
42
- projectOrder!: ProjectOrder;
43
-
44
39
  @ManyToOne(() => ExpenseType, { nullable: false })
45
40
  @JoinColumn({ name: "expenseTypeId" })
46
41
  expenseType!: ExpenseType;
@@ -15,7 +15,7 @@ import { Supplier } from "./Suppliers";
15
15
  import { InventoryImage } from "./InventoryImage";
16
16
  import { InventoryMovement } from "./InventoryMovement";
17
17
  import { PlantTechnicalSheet } from "../models/technical-sheet/PlantTechnicalSheet";
18
- import { InventoryTechnicalSheet } from "../models/inventory-technical-sheet.entity";
18
+ import { InventoryTechnicalSheet } from "../models/technical-sheet/inventory-technical-sheet.entity";
19
19
 
20
20
  @Entity("inventory")
21
21
  export class Inventory implements ObjectLiteral {
@@ -1,5 +1,7 @@
1
1
  // src/entities/ProjectOrder.ts
2
- import { Entity, PrimaryGeneratedColumn, Column, ObjectLiteral } from "typeorm";
2
+ import {
3
+ Entity, PrimaryGeneratedColumn, Column, ObjectLiteral
4
+ } from "typeorm";
3
5
 
4
6
  @Entity()
5
7
  export class ProjectOrder implements ObjectLiteral {
@@ -26,4 +28,5 @@ export class ProjectOrder implements ObjectLiteral {
26
28
 
27
29
  @Column("decimal")
28
30
  estimatedAmount!: number;
31
+
29
32
  }
@@ -19,7 +19,7 @@ import {
19
19
  import { PlantSize } from "./PlantSize";
20
20
  import { GrowthClassInfo } from "./GrowthClassInfo";
21
21
  import { ImageInfo } from "./ImageInfo";
22
- import { InventoryTechnicalSheet } from "../inventory-technical-sheet.entity";
22
+ import { InventoryTechnicalSheet } from "./inventory-technical-sheet.entity";
23
23
 
24
24
  @Entity("plant_technical_sheets")
25
25
  export class PlantTechnicalSheet implements ObjectLiteral {
@@ -11,6 +11,6 @@ export * from './SubstrateInfo';
11
11
  export * from './ClimateIdeal';
12
12
  export * from './FertilizationInfo';
13
13
  export * from './PropagationMethodInfo';
14
-
14
+ export * from './inventory-technical-sheet.entity';
15
15
 
16
16
  export * from './catalogs';
@@ -5,8 +5,8 @@ import {
5
5
  ManyToOne,
6
6
  JoinColumn,
7
7
  } from "typeorm";
8
- import { Inventory } from "../entities/Inventory";
9
- import { PlantTechnicalSheet } from "../models/technical-sheet/PlantTechnicalSheet";
8
+ import { Inventory } from "../../entities/Inventory";
9
+ import { PlantTechnicalSheet } from "./PlantTechnicalSheet";
10
10
 
11
11
  @Entity("inventory_technical_sheets")
12
12
  export class InventoryTechnicalSheet {