@movalib/movalib-commons 1.68.12 → 1.68.14

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/devIndex.tsx CHANGED
@@ -77,7 +77,7 @@ const App = () => {
77
77
  const getQRCodeData = ():string => {
78
78
  // On renvoie les données pour le QR Code, l'url change selon l'environnement (variables d'environnement)
79
79
  //return `https://app.movalib.com/#/garage/2?redirect=garage`;
80
- return `https://movalib.com/info-contact-agiless-2/`;
80
+ return `https://forms.gle/TabzYcYiaLNfhTu7A`;
81
81
  }
82
82
 
83
83
  const handleScheduleChange = (schedule: DaySchedule[]) => {
package/dist/devIndex.js CHANGED
@@ -105,7 +105,7 @@ var App = function () {
105
105
  var getQRCodeData = function () {
106
106
  // On renvoie les données pour le QR Code, l'url change selon l'environnement (variables d'environnement)
107
107
  //return `https://app.movalib.com/#/garage/2?redirect=garage`;
108
- return "https://movalib.com/info-contact-agiless-2/";
108
+ return "https://forms.gle/TabzYcYiaLNfhTu7A";
109
109
  };
110
110
  var handleScheduleChange = function (schedule) {
111
111
  if (schedule) {
package/dist/index.d.ts CHANGED
@@ -62,4 +62,5 @@ export { validateEmail, validatePhoneNumber, validateText, } from "./src/helpers
62
62
  export { APIMethod, CountryCode, CustomerType, DateFormatTypes, DayOfWeek, DigitalPassportIndex, DocumentState, DocumentType, EventState, EventType, Gender, MovaAppType, OrderPreference, OrderState, PartsApplicationType, PrestationState, PrestationType, ProductType, RegistrationState, RoleType, SecondaryPartsApplicationType, SlotAlgorithm, SubscriptionPaymentInterval, SubscriptionState, SubscriptionType, VehiclePlateFormat as VehiclePlateType, } from "./src/helpers/Enums";
63
63
  export { openDialogPrint } from "./src/utils/DialogPrint";
64
64
  export { getQrCodeBase64 } from "./src/utils/getQRCodeBase64";
65
+ export { isStockActive, getSetting } from './src/models/Garage';
65
66
  export { StyledToggleButton, StyledToggleButtonGroup, } from "./src/style/styled";
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.Supplier = exports.Subscription = exports.Schedule = exports.Role = exports.Product = exports.Prestation = exports.Operation = exports.LoanVehicle = exports.Garage = exports.Event = exports.Employee = exports.Document = exports.Customer = exports.CategoryPrestation = exports.Address = exports.Absence = exports.Logger = exports.TestButton = exports.ScheduleFields = exports.QRCode = exports.MovaVehicleTireField = exports.MovaSnackbar = exports.MovaSignUp = exports.MovaLogin = exports.MovaDigitalPassport = exports.MovaDialog = exports.MovaCopyright = exports.Loader = exports.IbanInput = exports.GenderSelector = exports.GaragePLV = exports.DialogForgotPassword = exports.ConfirmationDialog = exports.regexPlate = exports.oldRegexPlate = exports.VehiclePlateField = exports.VehicleFullCard = exports.ActivateAccount = exports.QrCodePLVContainer = exports.PrintSize = exports.PLVComponent = exports.MovaTableBack = exports.MovaTable = exports.LinkedDocumentDialog = exports.AddressFields = exports.AccountValidation = exports.VehicleService = exports.UserService = exports.GarageService = exports.AuthenticationService = void 0;
8
8
  exports.SlotAlgorithm = exports.SecondaryPartsApplicationType = exports.RoleType = exports.RegistrationState = exports.ProductType = exports.PrestationType = exports.PrestationState = exports.PartsApplicationType = exports.OrderState = exports.OrderPreference = exports.MovaAppType = exports.Gender = exports.EventType = exports.EventState = exports.DocumentType = exports.DocumentState = exports.DigitalPassportIndex = exports.DayOfWeek = exports.DateFormatTypes = exports.CustomerType = exports.CountryCode = exports.APIMethod = exports.validateText = exports.validatePhoneNumber = exports.validateEmail = exports.validateField = exports.isSafariOniOS = exports.isEmpty = exports.getFormattedSchedule = exports.getFormattedIntervals = exports.getDayOfWeekLabel = exports.getApplicationsShortLabels = exports.getApplicationShortLabel = exports.formatVehicleTire = exports.formatVehiclePlate = exports.formatPhoneNumber = exports.flexLeftRow = exports.findScheduleByDayOfWeek = exports.capitalizeFirstLetter = exports.getLongFormattedDateTime = exports.formatDateByTimezone = exports.readCookie = exports.deleteCookie = exports.request = exports.API_BASE_URL = exports.LoanVehicleLightAgreement = exports.VehicleTire = exports.VehicleGarage = exports.Vehicle = exports.User = void 0;
9
- exports.StyledToggleButtonGroup = exports.StyledToggleButton = exports.getQrCodeBase64 = exports.openDialogPrint = exports.VehiclePlateType = exports.SubscriptionType = exports.SubscriptionState = exports.SubscriptionPaymentInterval = void 0;
9
+ exports.StyledToggleButtonGroup = exports.StyledToggleButton = exports.getSetting = exports.isStockActive = exports.getQrCodeBase64 = exports.openDialogPrint = exports.VehiclePlateType = exports.SubscriptionType = exports.SubscriptionState = exports.SubscriptionPaymentInterval = void 0;
10
10
  // Export des services
11
11
  var AuthenticationService_1 = require("./src/services/AuthenticationService");
12
12
  Object.defineProperty(exports, "AuthenticationService", { enumerable: true, get: function () { return __importDefault(AuthenticationService_1).default; } });
@@ -179,6 +179,9 @@ var DialogPrint_1 = require("./src/utils/DialogPrint");
179
179
  Object.defineProperty(exports, "openDialogPrint", { enumerable: true, get: function () { return DialogPrint_1.openDialogPrint; } });
180
180
  var getQRCodeBase64_1 = require("./src/utils/getQRCodeBase64");
181
181
  Object.defineProperty(exports, "getQrCodeBase64", { enumerable: true, get: function () { return getQRCodeBase64_1.getQrCodeBase64; } });
182
+ var Garage_2 = require("./src/models/Garage");
183
+ Object.defineProperty(exports, "isStockActive", { enumerable: true, get: function () { return Garage_2.isStockActive; } });
184
+ Object.defineProperty(exports, "getSetting", { enumerable: true, get: function () { return Garage_2.getSetting; } });
182
185
  // Export des styles
183
186
  var styled_1 = require("./src/style/styled");
184
187
  Object.defineProperty(exports, "StyledToggleButton", { enumerable: true, get: function () { return styled_1.StyledToggleButton; } });
@@ -30,8 +30,10 @@ export default class Customer extends User {
30
30
  vatId?: string;
31
31
  contactId?: number;
32
32
  establishmentId?: number;
33
+ paymentMethods?: string;
34
+ paymentPeriod?: number;
33
35
  constructor(id: string, roles: Role[] | undefined, firstname: string | undefined, lastname: string | undefined, avatar: string | undefined, addresses: Address[] | undefined, vehicles: Vehicle[], email: string | undefined, turnover: {
34
36
  key: string;
35
37
  value: number;
36
- }[], type: CustomerType, companyName: string, companyPhoneNumber: string, billingAddress: Address | undefined, notes: string, siren?: string, vatId?: string, contactId?: number, establishmentId?: number);
38
+ }[], type: CustomerType, companyName: string, companyPhoneNumber: string, billingAddress: Address | undefined, notes: string, siren?: string, vatId?: string, contactId?: number, establishmentId?: number, paymentMethods?: string, paymentPeriod?: number);
37
39
  }
@@ -21,7 +21,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
21
21
  var User_1 = __importDefault(require("./User"));
22
22
  var Customer = /** @class */ (function (_super) {
23
23
  __extends(Customer, _super);
24
- function Customer(id, roles, firstname, lastname, avatar, addresses, vehicles, email, turnover, type, companyName, companyPhoneNumber, billingAddress, notes, siren, vatId, contactId, establishmentId) {
24
+ function Customer(id, roles, firstname, lastname, avatar, addresses, vehicles, email, turnover, type, companyName, companyPhoneNumber, billingAddress, notes, siren, vatId, contactId, establishmentId, paymentMethods, paymentPeriod) {
25
25
  if (roles === void 0) { roles = []; }
26
26
  if (firstname === void 0) { firstname = ""; }
27
27
  if (lastname === void 0) { lastname = ""; }
@@ -43,6 +43,8 @@ var Customer = /** @class */ (function (_super) {
43
43
  _this.vatId = vatId;
44
44
  _this.contactId = contactId;
45
45
  _this.establishmentId = establishmentId;
46
+ _this.paymentMethods = paymentMethods;
47
+ _this.paymentPeriod = paymentPeriod;
46
48
  return _this;
47
49
  }
48
50
  return Customer;
@@ -80,7 +80,7 @@ var Event = /** @class */ (function () {
80
80
  }
81
81
  }
82
82
  else {
83
- return ((_e = quoteDocument.find(function (doc) { return doc.state === Enums_1.DocumentState.APPROVED; })) !== null && _e !== void 0 ? _e : null);
83
+ return ((_e = quoteDocument.find(function (doc) { return doc.state === Enums_1.DocumentState.APPROVED && doc.sinaoDocumentId === null; })) !== null && _e !== void 0 ? _e : null);
84
84
  }
85
85
  }
86
86
  return null;
@@ -74,3 +74,4 @@ export default class Garage {
74
74
  constructor(id: string, adminId: string, name: string, address: Address, workforce: number, prestations: Prestation[], schedules: Schedule[], contactPhone: string, prestationCategories: CategoryPrestation[], dayPeriodFastServiceExcluded: boolean, loanerVehicleFastServiceExcluded: boolean, fastServiceThreshold: number, timezone: string, settings: Settings[], vehicles?: VehicleGarage[], contactEmail?: string, logo?: string, suppliers?: Supplier[], documents?: Document[], subscriptions?: Subscription[], loanerVehicleActive?: boolean, loanerVehicleRequestActive?: boolean, customStyle?: string, subscription?: Subscription, partialWorkforce?: number, mailCustomization?: boolean, billingActive?: boolean, billingToken?: string, billingSimulationActive?: boolean, appId?: number, establishmentRegistrationNumber?: string, companyRegistrationNumber?: string, reopeningDate?: Date, targetMargin?: number, demoBillingActive?: boolean, onlyBilling?: boolean, newDocumentEditor?: boolean, googleReviewUrl?: string, isOnlineAppointment?: boolean, isOnlineQuote?: boolean);
75
75
  }
76
76
  export declare function isStockActive(g: Garage): boolean;
77
+ export declare function getSetting(settings: Settings[], code: string): string | null;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isStockActive = void 0;
3
+ exports.getSetting = exports.isStockActive = void 0;
4
4
  var Settings_1 = require("./Settings");
5
5
  var Garage = /** @class */ (function () {
6
6
  function Garage(id, adminId, name, address, workforce, prestations, schedules, contactPhone, prestationCategories, dayPeriodFastServiceExcluded, loanerVehicleFastServiceExcluded, fastServiceThreshold, timezone, settings, vehicles, contactEmail, logo, suppliers, documents, subscriptions, loanerVehicleActive, loanerVehicleRequestActive, customStyle, subscription, partialWorkforce, mailCustomization, billingActive, billingToken, billingSimulationActive, appId, establishmentRegistrationNumber, companyRegistrationNumber, reopeningDate, targetMargin, demoBillingActive, onlyBilling, newDocumentEditor, googleReviewUrl, isOnlineAppointment, isOnlineQuote) {
@@ -58,3 +58,8 @@ function isStockActive(g) {
58
58
  return (_b = (_a = g.settings.find(function (s) { return s.code === Settings_1.SettingsEnumCode.STOCK_MODULE_ENABLED; })) === null || _a === void 0 ? void 0 : _a.valueBoolean) !== null && _b !== void 0 ? _b : false;
59
59
  }
60
60
  exports.isStockActive = isStockActive;
61
+ function getSetting(settings, code) {
62
+ var _a, _b;
63
+ return (_b = (_a = settings.find(function (s) { return s.code === code; })) === null || _a === void 0 ? void 0 : _a.valueText) !== null && _b !== void 0 ? _b : null;
64
+ }
65
+ exports.getSetting = getSetting;
@@ -18,6 +18,7 @@ interface roiInterface {
18
18
  partialWorkforce: number;
19
19
  workingTimePerPartialEmployee: number;
20
20
  smsCampaign: boolean;
21
+ totalPrice: number;
21
22
  }
22
23
  export default class Subscription {
23
24
  id: string;
@@ -46,6 +47,16 @@ export default class Subscription {
46
47
  smsCampaign: boolean;
47
48
  expertMonthly: boolean;
48
49
  checkList: any;
49
- constructor(id: string, garageId: string, type: SubscriptionType, state: SubscriptionState, companyName: string, companyEmail: string, companySiren: string, companyLegalForm: string, trialDays: number, startDate: Date, activationDate: Date, cancellationDate: Date, paymentInterval: SubscriptionPaymentInterval, paymentIban: string, roi: roiInterface, additionalFormationQuantity: number, webPage: boolean, smsCampaign: boolean, trainingOptionalOne: Date, trainingOptionalTwo: Date, webcam: boolean, billing: boolean, movaPackage: string, packInfo: boolean, checkList: any, expertMonthly: boolean);
50
+ wholesaleOffer: string;
51
+ accountantEmail: string;
52
+ accountantPhone: string;
53
+ accountantIdentity: string;
54
+ isClientImportBillable: boolean;
55
+ isCatalogImportBillable: boolean;
56
+ needAccountingOffer: boolean;
57
+ accountingPrice: boolean;
58
+ training: boolean;
59
+ totalPrice: number;
60
+ constructor(id: string, garageId: string, type: SubscriptionType, state: SubscriptionState, companyName: string, companyEmail: string, companySiren: string, companyLegalForm: string, trialDays: number, startDate: Date, activationDate: Date, cancellationDate: Date, paymentInterval: SubscriptionPaymentInterval, paymentIban: string, roi: roiInterface, additionalFormationQuantity: number, webPage: boolean, smsCampaign: boolean, trainingOptionalOne: Date, trainingOptionalTwo: Date, webcam: boolean, billing: boolean, movaPackage: string, packInfo: boolean, checkList: any, expertMonthly: boolean, wholesaleOffer: string, accountantEmail: string, accountantPhone: string, accountantIdentity: string, isClientImportBillable: boolean, isCatalogImportBillable: boolean, needAccountingOffer: boolean, accountingPrice: boolean, training: boolean, totalPrice: number);
50
61
  }
51
62
  export {};
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var Subscription = /** @class */ (function () {
4
- function Subscription(id, garageId, type, state, companyName, companyEmail, companySiren, companyLegalForm, trialDays, startDate, activationDate, cancellationDate, paymentInterval, paymentIban, roi, additionalFormationQuantity, webPage, smsCampaign, trainingOptionalOne, trainingOptionalTwo, webcam, billing, movaPackage, packInfo, checkList, expertMonthly) {
4
+ function Subscription(id, garageId, type, state, companyName, companyEmail, companySiren, companyLegalForm, trialDays, startDate, activationDate, cancellationDate, paymentInterval, paymentIban, roi, additionalFormationQuantity, webPage, smsCampaign, trainingOptionalOne, trainingOptionalTwo, webcam, billing, movaPackage, packInfo, checkList, expertMonthly, wholesaleOffer, accountantEmail, accountantPhone, accountantIdentity, isClientImportBillable, isCatalogImportBillable, needAccountingOffer, accountingPrice, training, totalPrice) {
5
5
  this.id = id;
6
6
  this.garageId = garageId;
7
7
  this.type = type;
@@ -28,6 +28,16 @@ var Subscription = /** @class */ (function () {
28
28
  this.smsCampaign = smsCampaign;
29
29
  this.checkList = checkList;
30
30
  this.expertMonthly = expertMonthly;
31
+ this.wholesaleOffer = wholesaleOffer;
32
+ this.accountantEmail = accountantEmail;
33
+ this.accountantPhone = accountantPhone;
34
+ this.accountantIdentity = accountantIdentity;
35
+ this.isClientImportBillable = isClientImportBillable;
36
+ this.isCatalogImportBillable = isCatalogImportBillable;
37
+ this.needAccountingOffer = needAccountingOffer;
38
+ this.accountingPrice = accountingPrice;
39
+ this.training = training;
40
+ this.totalPrice = totalPrice;
31
41
  }
32
42
  return Subscription;
33
43
  }());
package/index.ts CHANGED
@@ -140,6 +140,7 @@ export {
140
140
  // Export des utils
141
141
  export { openDialogPrint } from "./src/utils/DialogPrint";
142
142
  export { getQrCodeBase64 } from "./src/utils/getQRCodeBase64";
143
+ export {isStockActive , getSetting} from './src/models/Garage'
143
144
 
144
145
  // Export des styles
145
146
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movalib/movalib-commons",
3
- "version": "1.68.12",
3
+ "version": "1.68.14",
4
4
  "description": "Bibliothèque d'objets communs à l'ensemble des projets React de Movalib",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -32,6 +32,8 @@ export default class Customer extends User {
32
32
  vatId?: string;
33
33
  contactId?: number;
34
34
  establishmentId?: number;
35
+ paymentMethods?: string;
36
+ paymentPeriod?:number
35
37
  constructor(
36
38
  id: string,
37
39
  roles: Role[] = [],
@@ -50,7 +52,9 @@ export default class Customer extends User {
50
52
  siren: string = "",
51
53
  vatId: string = "",
52
54
  contactId?: number,
53
- establishmentId?: number
55
+ establishmentId?: number,
56
+ paymentMethods?:string,
57
+ paymentPeriod?: number
54
58
  ) {
55
59
  super(id, roles, firstname, lastname, avatar, email);
56
60
 
@@ -65,5 +69,7 @@ export default class Customer extends User {
65
69
  this.vatId = vatId;
66
70
  this.contactId = contactId;
67
71
  this.establishmentId = establishmentId;
72
+ this.paymentMethods = paymentMethods;
73
+ this.paymentPeriod = paymentPeriod;
68
74
  }
69
75
  }
@@ -251,7 +251,7 @@ export default class Event {
251
251
  }
252
252
  else {
253
253
  return (
254
- quoteDocument.find((doc) => doc.state === DocumentState.APPROVED) ??
254
+ quoteDocument.find((doc) => doc.state === DocumentState.APPROVED && doc.sinaoDocumentId === null) ??
255
255
  null
256
256
  );
257
257
  }
@@ -163,4 +163,7 @@ export function isStockActive (g: Garage): boolean {
163
163
  return false;
164
164
  }
165
165
  return g.settings.find((s) => s.code === SettingsEnumCode.STOCK_MODULE_ENABLED)?.valueBoolean ?? false
166
+ }
167
+ export function getSetting(settings: Settings[], code: string): string | null {
168
+ return settings.find((s) => s.code === code)?.valueText ?? null;
166
169
  }
@@ -22,6 +22,7 @@ interface roiInterface {
22
22
  partialWorkforce: number;
23
23
  workingTimePerPartialEmployee: number;
24
24
  smsCampaign: boolean;
25
+ totalPrice: number;
25
26
  }
26
27
  export default class Subscription {
27
28
  // Properties
@@ -51,7 +52,16 @@ export default class Subscription {
51
52
  smsCampaign: boolean;
52
53
  expertMonthly: boolean;
53
54
  checkList: any;
54
-
55
+ wholesaleOffer: string;
56
+ accountantEmail: string;
57
+ accountantPhone: string;
58
+ accountantIdentity: string;
59
+ isClientImportBillable: boolean;
60
+ isCatalogImportBillable: boolean;
61
+ needAccountingOffer: boolean;
62
+ accountingPrice: boolean;
63
+ training: boolean;
64
+ totalPrice: number;
55
65
  constructor(
56
66
  id: string,
57
67
  garageId: string,
@@ -78,7 +88,17 @@ export default class Subscription {
78
88
  movaPackage: string,
79
89
  packInfo: boolean,
80
90
  checkList: any,
81
- expertMonthly: boolean
91
+ expertMonthly: boolean,
92
+ wholesaleOffer: string,
93
+ accountantEmail: string,
94
+ accountantPhone: string,
95
+ accountantIdentity: string,
96
+ isClientImportBillable: boolean,
97
+ isCatalogImportBillable: boolean,
98
+ needAccountingOffer: boolean,
99
+ accountingPrice: boolean,
100
+ training: boolean,
101
+ totalPrice: number
82
102
  ) {
83
103
  this.id = id;
84
104
  this.garageId = garageId;
@@ -106,5 +126,15 @@ export default class Subscription {
106
126
  this.smsCampaign = smsCampaign;
107
127
  this.checkList = checkList;
108
128
  this.expertMonthly = expertMonthly;
129
+ this.wholesaleOffer = wholesaleOffer;
130
+ this.accountantEmail = accountantEmail;
131
+ this.accountantPhone = accountantPhone;
132
+ this.accountantIdentity = accountantIdentity;
133
+ this.isClientImportBillable = isClientImportBillable;
134
+ this.isCatalogImportBillable = isCatalogImportBillable;
135
+ this.needAccountingOffer = needAccountingOffer;
136
+ this.accountingPrice = accountingPrice;
137
+ this.training = training;
138
+ this.totalPrice = totalPrice;
109
139
  }
110
140
  }