@duvdu-v1/duvdu 1.1.353 → 1.1.354

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.
@@ -53,6 +53,7 @@ export interface IprojectContract {
53
53
  secondPaymentAmount: number;
54
54
  status: ProjectContractStatus;
55
55
  rejectedBy?: 'customer' | 'sp';
56
+ canceledBy?: 'customer' | 'sp' | 'system';
56
57
  paymentLink: string;
57
58
  duration: number;
58
59
  createdAt: Date;
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ // disable eslint for this file
3
+ /* eslint-disable */
2
4
  Object.defineProperty(exports, "__esModule", { value: true });
3
5
  exports.ProjectContract = exports.ProjectContractStatus = void 0;
4
6
  const mongoose_1 = require("mongoose");
@@ -20,7 +22,7 @@ const generateTicketNumber = () => {
20
22
  const random = Math.floor(100000 + Math.random() * 900000); // 6-digit random number
21
23
  return `PRJC${random}`;
22
24
  };
23
- exports.ProjectContract = (0, mongoose_1.model)(model_names_1.MODELS.projectContract, new mongoose_1.Schema({
25
+ const projectContractSchema = new mongoose_1.Schema({
24
26
  sp: { type: mongoose_1.Schema.Types.ObjectId, ref: model_names_1.MODELS.user },
25
27
  ticketNumber: { type: String, default: generateTicketNumber, unique: true, sparse: true },
26
28
  customer: { type: mongoose_1.Schema.Types.ObjectId, ref: model_names_1.MODELS.user },
@@ -60,6 +62,7 @@ exports.ProjectContract = (0, mongoose_1.model)(model_names_1.MODELS.projectCont
60
62
  secondPaymentAmount: { type: Number, default: 0 },
61
63
  status: { type: String, enum: ProjectContractStatus },
62
64
  rejectedBy: { type: String, enum: ['sp', 'customer'], default: null },
65
+ canceledBy: { type: String, enum: ['sp', 'customer', 'system'], default: null },
63
66
  paymentLink: String,
64
67
  duration: { type: Number, default: 0 },
65
68
  equipmentPrice: { type: Number, default: 0 },
@@ -81,5 +84,5 @@ exports.ProjectContract = (0, mongoose_1.model)(model_names_1.MODELS.projectCont
81
84
  },
82
85
  user: { type: mongoose_1.Schema.Types.ObjectId, ref: model_names_1.MODELS.user, default: null },
83
86
  },
84
- }, { timestamps: true, collection: model_names_1.MODELS.projectContract }));
85
- // i need here add ticket number to the project contract by default
87
+ }, { timestamps: true, collection: model_names_1.MODELS.projectContract });
88
+ exports.ProjectContract = (0, mongoose_1.model)(model_names_1.MODELS.projectContract, projectContractSchema);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duvdu-v1/duvdu",
3
- "version": "1.1.353",
3
+ "version": "1.1.354",
4
4
  "main": "./build/index.js",
5
5
  "types": "./build/index.d.ts",
6
6
  "files": [