@movalib/movalib-commons 1.68.13 → 1.68.15
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/dist/index.d.ts +1 -0
- package/dist/index.js +4 -1
- package/dist/src/models/Customer.d.ts +3 -1
- package/dist/src/models/Customer.js +3 -1
- package/dist/src/models/Garage.d.ts +3 -2
- package/dist/src/models/Garage.js +8 -3
- package/index.ts +1 -0
- package/package.json +1 -1
- package/src/models/Customer.ts +7 -1
- package/src/models/Garage.ts +6 -3
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;
|
|
@@ -59,7 +59,7 @@ export default class Garage {
|
|
|
59
59
|
mailCustomization?: boolean;
|
|
60
60
|
billingActive?: boolean;
|
|
61
61
|
billingToken?: string;
|
|
62
|
-
|
|
62
|
+
legacyQuoteActive?: boolean;
|
|
63
63
|
demoBillingActive?: boolean;
|
|
64
64
|
appId?: number;
|
|
65
65
|
companyRegistrationNumber?: string;
|
|
@@ -71,6 +71,7 @@ export default class Garage {
|
|
|
71
71
|
newDocumentEditor?: boolean;
|
|
72
72
|
isOnlineAppointment?: boolean;
|
|
73
73
|
isOnlineQuote?: boolean;
|
|
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,
|
|
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, legacyQuoteActive?: 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,9 +1,9 @@
|
|
|
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
|
-
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,
|
|
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, legacyQuoteActive, appId, establishmentRegistrationNumber, companyRegistrationNumber, reopeningDate, targetMargin, demoBillingActive, onlyBilling, newDocumentEditor, googleReviewUrl, isOnlineAppointment, isOnlineQuote) {
|
|
7
7
|
if (onlyBilling === void 0) { onlyBilling = false; }
|
|
8
8
|
if (newDocumentEditor === void 0) { newDocumentEditor = false; }
|
|
9
9
|
this.id = id;
|
|
@@ -33,7 +33,7 @@ var Garage = /** @class */ (function () {
|
|
|
33
33
|
this.mailCustomization = mailCustomization;
|
|
34
34
|
this.billingActive = billingActive;
|
|
35
35
|
this.billingToken = billingToken;
|
|
36
|
-
this.
|
|
36
|
+
this.legacyQuoteActive = legacyQuoteActive;
|
|
37
37
|
this.appId = appId;
|
|
38
38
|
this.companyRegistrationNumber = companyRegistrationNumber;
|
|
39
39
|
this.establishmentRegistrationNumber = establishmentRegistrationNumber;
|
|
@@ -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;
|
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
package/src/models/Customer.ts
CHANGED
|
@@ -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
|
}
|
package/src/models/Garage.ts
CHANGED
|
@@ -60,7 +60,7 @@ export default class Garage {
|
|
|
60
60
|
mailCustomization?: boolean;
|
|
61
61
|
billingActive?: boolean;
|
|
62
62
|
billingToken?: string;
|
|
63
|
-
|
|
63
|
+
legacyQuoteActive?: boolean;
|
|
64
64
|
demoBillingActive?: boolean;
|
|
65
65
|
appId?: number;
|
|
66
66
|
companyRegistrationNumber?: string;
|
|
@@ -101,7 +101,7 @@ export default class Garage {
|
|
|
101
101
|
mailCustomization?: boolean,
|
|
102
102
|
billingActive?: boolean,
|
|
103
103
|
billingToken?: string,
|
|
104
|
-
|
|
104
|
+
legacyQuoteActive?: boolean,
|
|
105
105
|
appId?: number,
|
|
106
106
|
establishmentRegistrationNumber?: string,
|
|
107
107
|
companyRegistrationNumber?: string,
|
|
@@ -141,7 +141,7 @@ export default class Garage {
|
|
|
141
141
|
this.mailCustomization = mailCustomization;
|
|
142
142
|
this.billingActive = billingActive;
|
|
143
143
|
this.billingToken = billingToken;
|
|
144
|
-
this.
|
|
144
|
+
this.legacyQuoteActive = legacyQuoteActive;
|
|
145
145
|
this.appId = appId;
|
|
146
146
|
this.companyRegistrationNumber = companyRegistrationNumber;
|
|
147
147
|
this.establishmentRegistrationNumber = establishmentRegistrationNumber;
|
|
@@ -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
|
}
|