@movalib/movalib-commons 1.25.0 → 1.27.0

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 CHANGED
@@ -47,5 +47,5 @@ export { readCookie, deleteCookie } from './src/helpers/CookieUtils';
47
47
  export { validateField, formatVehicleTire, formatFrenchVehiclePlate, isEmpty, getApplicationShortLabel, capitalizeFirstLetter, flexLeftRow, formatPhoneNumber, getFormattedSchedule, getFormattedIntervals, findScheduleByDayOfWeek, getDayOfWeekLabel, isSafariOniOS } from './src/helpers/Tools';
48
48
  export { validatePhoneNumber, validateText, validateEmail } from './src/helpers/Validator';
49
49
  export { formatDateByCountryCode, getLongFormattedDateTime } from './src/helpers/DateUtils';
50
- export { request } from './src/helpers/ApiHelper';
51
- export { RoleType, MovaAppType, DayOfWeek, EventState, EventType, DocumentType, DigitalPassportIndex, DocumentState, Gender, DateFormatTypes, PartsApplicationType, ProductType, OrderPreference, OrderState, SlotAlgorithm, VehiclePlateFormat as VehiclePlateType, SubscriptionPaymentInterval, RegistrationState, PrestationType, PrestationState, CountryCode, SubscriptionState, SubscriptionType } from './src/helpers/Enums';
50
+ export { request, API_BASE_URL, } from './src/helpers/ApiHelper';
51
+ export { RoleType, MovaAppType, DayOfWeek, EventState, EventType, DocumentType, DigitalPassportIndex, DocumentState, Gender, DateFormatTypes, PartsApplicationType, ProductType, OrderPreference, OrderState, SlotAlgorithm, VehiclePlateFormat as VehiclePlateType, SubscriptionPaymentInterval, RegistrationState, PrestationType, PrestationState, CountryCode, SubscriptionState, SubscriptionType, APIMethod } from './src/helpers/Enums';
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  };
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.capitalizeFirstLetter = exports.getApplicationShortLabel = exports.isEmpty = exports.formatFrenchVehiclePlate = exports.formatVehicleTire = exports.validateField = exports.deleteCookie = exports.readCookie = exports.VehicleTire = exports.Event = exports.Schedule = exports.Garage = exports.Document = exports.Vehicle = exports.Address = exports.Role = exports.User = exports.Customer = exports.Logger = exports.Operation = exports.Prestation = exports.Product = exports.Supplier = exports.Employee = exports.Absence = exports.Subscription = exports.GenderSelector = exports.ConfirmationDialog = exports.MovaVehicleTireField = exports.MovaCopyright = exports.MovaSignUp = exports.MovaLogin = exports.MovaSnackbar = exports.TestButton = exports.VehiclePlateField = exports.QRCode = exports.MovaDialog = exports.Loader = exports.MovaDigitalPassport = exports.VehicleFullCard = exports.ScheduleFields = exports.AddressFields = exports.AccountValidation = exports.GaragePLV = exports.IbanInput = exports.DialogForgotPassword = exports.UserService = exports.GarageService = exports.AuthenticationService = exports.VehicleService = void 0;
8
- exports.SubscriptionType = exports.SubscriptionState = exports.CountryCode = exports.PrestationState = exports.PrestationType = exports.RegistrationState = exports.SubscriptionPaymentInterval = exports.VehiclePlateType = exports.SlotAlgorithm = exports.OrderState = exports.OrderPreference = exports.ProductType = exports.PartsApplicationType = exports.DateFormatTypes = exports.Gender = exports.DocumentState = exports.DigitalPassportIndex = exports.DocumentType = exports.EventType = exports.EventState = exports.DayOfWeek = exports.MovaAppType = exports.RoleType = exports.request = exports.getLongFormattedDateTime = exports.formatDateByCountryCode = exports.validateEmail = exports.validateText = exports.validatePhoneNumber = exports.isSafariOniOS = exports.getDayOfWeekLabel = exports.findScheduleByDayOfWeek = exports.getFormattedIntervals = exports.getFormattedSchedule = exports.formatPhoneNumber = exports.flexLeftRow = void 0;
8
+ exports.APIMethod = exports.SubscriptionType = exports.SubscriptionState = exports.CountryCode = exports.PrestationState = exports.PrestationType = exports.RegistrationState = exports.SubscriptionPaymentInterval = exports.VehiclePlateType = exports.SlotAlgorithm = exports.OrderState = exports.OrderPreference = exports.ProductType = exports.PartsApplicationType = exports.DateFormatTypes = exports.Gender = exports.DocumentState = exports.DigitalPassportIndex = exports.DocumentType = exports.EventType = exports.EventState = exports.DayOfWeek = exports.MovaAppType = exports.RoleType = exports.API_BASE_URL = exports.request = exports.getLongFormattedDateTime = exports.formatDateByCountryCode = exports.validateEmail = exports.validateText = exports.validatePhoneNumber = exports.isSafariOniOS = exports.getDayOfWeekLabel = exports.findScheduleByDayOfWeek = exports.getFormattedIntervals = exports.getFormattedSchedule = exports.formatPhoneNumber = exports.flexLeftRow = void 0;
9
9
  // Export des services
10
10
  var VehicleService_1 = require("./src/services/VehicleService");
11
11
  Object.defineProperty(exports, "VehicleService", { enumerable: true, get: function () { return __importDefault(VehicleService_1).default; } });
@@ -120,6 +120,7 @@ Object.defineProperty(exports, "formatDateByCountryCode", { enumerable: true, ge
120
120
  Object.defineProperty(exports, "getLongFormattedDateTime", { enumerable: true, get: function () { return DateUtils_1.getLongFormattedDateTime; } });
121
121
  var ApiHelper_1 = require("./src/helpers/ApiHelper");
122
122
  Object.defineProperty(exports, "request", { enumerable: true, get: function () { return ApiHelper_1.request; } });
123
+ Object.defineProperty(exports, "API_BASE_URL", { enumerable: true, get: function () { return ApiHelper_1.API_BASE_URL; } });
123
124
  // Export des enums
124
125
  var Enums_1 = require("./src/helpers/Enums");
125
126
  Object.defineProperty(exports, "RoleType", { enumerable: true, get: function () { return Enums_1.RoleType; } });
@@ -145,3 +146,4 @@ Object.defineProperty(exports, "PrestationState", { enumerable: true, get: funct
145
146
  Object.defineProperty(exports, "CountryCode", { enumerable: true, get: function () { return Enums_1.CountryCode; } });
146
147
  Object.defineProperty(exports, "SubscriptionState", { enumerable: true, get: function () { return Enums_1.SubscriptionState; } });
147
148
  Object.defineProperty(exports, "SubscriptionType", { enumerable: true, get: function () { return Enums_1.SubscriptionType; } });
149
+ Object.defineProperty(exports, "APIMethod", { enumerable: true, get: function () { return Enums_1.APIMethod; } });
@@ -1,4 +1,4 @@
1
- import { SubscriptionState, SubscriptionType } from "../helpers/Enums";
1
+ import { SubscriptionPaymentInterval, SubscriptionState, SubscriptionType } from "../helpers/Enums";
2
2
  export default class Subscription {
3
3
  id: string;
4
4
  garageId: string;
@@ -6,6 +6,13 @@ export default class Subscription {
6
6
  state: SubscriptionState;
7
7
  companyName: string;
8
8
  companyEmail: string;
9
+ companySiren: string;
10
+ companyLegalForm: string;
11
+ trialDays: number;
12
+ startDate: Date;
13
+ activationDate: Date;
14
+ cancellationDate: Date;
15
+ paymentInterval: SubscriptionPaymentInterval;
9
16
  paymentIban: string;
10
- constructor(id: string, garageId: string, type: SubscriptionType, state: SubscriptionState, companyName: string, companyEmail: string, paymentIban: string);
17
+ 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);
11
18
  }
@@ -1,13 +1,20 @@
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, paymentIban) {
4
+ function Subscription(id, garageId, type, state, companyName, companyEmail, companySiren, companyLegalForm, trialDays, startDate, activationDate, cancellationDate, paymentInterval, paymentIban) {
5
5
  this.id = id;
6
6
  this.garageId = garageId;
7
7
  this.type = type;
8
8
  this.state = state;
9
9
  this.companyName = companyName;
10
10
  this.companyEmail = companyEmail;
11
+ this.companySiren = companySiren;
12
+ this.companyLegalForm = companyLegalForm;
13
+ this.trialDays = trialDays;
14
+ this.startDate = startDate;
15
+ this.activationDate = activationDate;
16
+ this.cancellationDate = cancellationDate;
17
+ this.paymentInterval = paymentInterval;
11
18
  this.paymentIban = paymentIban;
12
19
  }
13
20
  return Subscription;
@@ -2,6 +2,7 @@ import { APIResponse } from "../helpers/ApiHelper";
2
2
  import Employee from "../models/Employee";
3
3
  import Garage from "../models/Garage";
4
4
  export default class GarageService {
5
+ static sendGarageMandate(garageId: string): Promise<APIResponse<string>>;
5
6
  static getGarageAllData(garageId: string): Promise<APIResponse<Garage>>;
6
7
  static createGaragePrestationRequest(garageId: string, req: any): Promise<APIResponse<string>>;
7
8
  static getGarageSettings(garageId: string): Promise<APIResponse<Garage>>;
@@ -5,6 +5,12 @@ var Enums_1 = require("../helpers/Enums");
5
5
  var GarageService = /** @class */ (function () {
6
6
  function GarageService() {
7
7
  }
8
+ GarageService.sendGarageMandate = function (garageId) {
9
+ return (0, ApiHelper_1.request)({
10
+ url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/subscription-mandate"),
11
+ method: Enums_1.APIMethod.POST,
12
+ });
13
+ };
8
14
  GarageService.getGarageAllData = function (garageId) {
9
15
  return (0, ApiHelper_1.request)({
10
16
  url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/all-data"),
package/index.ts CHANGED
@@ -61,12 +61,12 @@ export { validateField, formatVehicleTire, formatFrenchVehiclePlate, isEmpty, ge
61
61
  findScheduleByDayOfWeek, getDayOfWeekLabel, isSafariOniOS } from './src/helpers/Tools';
62
62
  export { validatePhoneNumber, validateText, validateEmail } from './src/helpers/Validator';
63
63
  export { formatDateByCountryCode, getLongFormattedDateTime } from './src/helpers/DateUtils';
64
- export { request } from './src/helpers/ApiHelper';
64
+ export { request, API_BASE_URL, } from './src/helpers/ApiHelper';
65
65
 
66
66
  // Export des enums
67
67
  export { RoleType, MovaAppType, DayOfWeek, EventState, EventType, DocumentType,
68
68
  DigitalPassportIndex, DocumentState, Gender, DateFormatTypes, PartsApplicationType,
69
69
  ProductType, OrderPreference, OrderState, SlotAlgorithm, VehiclePlateFormat as VehiclePlateType,
70
70
  SubscriptionPaymentInterval, RegistrationState, PrestationType, PrestationState, CountryCode,
71
- SubscriptionState, SubscriptionType } from './src/helpers/Enums';
71
+ SubscriptionState, SubscriptionType, APIMethod } from './src/helpers/Enums';
72
72
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movalib/movalib-commons",
3
- "version": "1.25.0",
3
+ "version": "1.27.0",
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",
@@ -1,4 +1,4 @@
1
- import { SubscriptionState, SubscriptionType } from "../helpers/Enums";
1
+ import { SubscriptionPaymentInterval, SubscriptionState, SubscriptionType } from "../helpers/Enums";
2
2
 
3
3
  export default class Subscription {
4
4
 
@@ -9,10 +9,18 @@ export default class Subscription {
9
9
  state: SubscriptionState;
10
10
  companyName: string;
11
11
  companyEmail: string;
12
+ companySiren: string;
13
+ companyLegalForm: string;
14
+ trialDays: number;
15
+ startDate: Date;
16
+ activationDate: Date;
17
+ cancellationDate: Date;
18
+ paymentInterval: SubscriptionPaymentInterval;
12
19
  paymentIban: string;
13
20
 
14
21
  constructor(id: string, garageId: string, type: SubscriptionType, state: SubscriptionState, companyName: string,
15
- companyEmail: string, paymentIban : string) {
22
+ companyEmail: string, companySiren: string, companyLegalForm: string, trialDays: number, startDate: Date, activationDate: Date,
23
+ cancellationDate: Date, paymentInterval: SubscriptionPaymentInterval, paymentIban : string) {
16
24
 
17
25
  this.id = id;
18
26
  this.garageId = garageId;
@@ -20,6 +28,13 @@ export default class Subscription {
20
28
  this.state = state;
21
29
  this.companyName = companyName;
22
30
  this.companyEmail = companyEmail;
31
+ this.companySiren = companySiren;
32
+ this.companyLegalForm = companyLegalForm;
33
+ this.trialDays = trialDays;
34
+ this.startDate = startDate;
35
+ this.activationDate = activationDate;
36
+ this.cancellationDate = cancellationDate;
37
+ this.paymentInterval = paymentInterval;
23
38
  this.paymentIban = paymentIban;
24
39
  }
25
40
  }
@@ -2,9 +2,18 @@ import { APIResponse, API_BASE_URL, request } from "../helpers/ApiHelper";
2
2
  import { APIMethod, MovaAppType } from "../helpers/Enums";
3
3
  import Employee from "../models/Employee";
4
4
  import Garage from "../models/Garage";
5
+ import Subscription from "../models/Subscription";
5
6
 
6
7
  export default class GarageService {
7
8
 
9
+ static sendGarageMandate(garageId: string): Promise<APIResponse<string>> {
10
+
11
+ return request({
12
+ url: `${API_BASE_URL}/garage/${garageId}/subscription-mandate`,
13
+ method: APIMethod.POST,
14
+ });
15
+ }
16
+
8
17
  static getGarageAllData(garageId: string): Promise<APIResponse<Garage>> {
9
18
  return request({
10
19
  url: `${API_BASE_URL}/garage/${garageId}/all-data`,