@bisondesk/core-sdk 1.0.23-B → 1.0.25

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.
Files changed (225) hide show
  1. package/lib/constants.d.ts +0 -77
  2. package/lib/constants.d.ts.map +1 -1
  3. package/lib/constants.js +1 -924
  4. package/lib/constants.js.map +1 -1
  5. package/lib/types/crm.d.ts +30 -102
  6. package/lib/types/crm.d.ts.map +1 -1
  7. package/lib/types/crm.js +0 -16
  8. package/lib/types/crm.js.map +1 -1
  9. package/lib/types/definitions.d.ts +13 -15
  10. package/lib/types/definitions.d.ts.map +1 -1
  11. package/lib/types/fields.d.ts +25 -26
  12. package/lib/types/fields.d.ts.map +1 -1
  13. package/lib/types/fields.js +0 -4
  14. package/lib/types/fields.js.map +1 -1
  15. package/lib/types/interests.d.ts +31 -0
  16. package/lib/types/interests.d.ts.map +1 -0
  17. package/lib/types/{settings.js → interests.js} +1 -1
  18. package/lib/types/interests.js.map +1 -0
  19. package/lib/types/picklists.d.ts +4 -15
  20. package/lib/types/picklists.d.ts.map +1 -1
  21. package/lib/types/search.d.ts +4 -26
  22. package/lib/types/search.d.ts.map +1 -1
  23. package/lib/types/search.js.map +1 -1
  24. package/lib/types/storage.d.ts +11 -1
  25. package/lib/types/storage.d.ts.map +1 -1
  26. package/lib/types/storage.js +0 -15
  27. package/lib/types/storage.js.map +1 -1
  28. package/lib/types/tenants.d.ts +9 -32
  29. package/lib/types/tenants.d.ts.map +1 -1
  30. package/lib/types/tenants.js +0 -11
  31. package/lib/types/tenants.js.map +1 -1
  32. package/lib/types/users.d.ts +3 -11
  33. package/lib/types/users.d.ts.map +1 -1
  34. package/lib/types/utils.d.ts +0 -20
  35. package/lib/types/utils.d.ts.map +1 -1
  36. package/lib/types/utils.js +0 -6
  37. package/lib/types/utils.js.map +1 -1
  38. package/lib/types/vehicles.d.ts +92 -406
  39. package/lib/types/vehicles.d.ts.map +1 -1
  40. package/lib/types/vehicles.js +1 -54
  41. package/lib/types/vehicles.js.map +1 -1
  42. package/package.json +6 -8
  43. package/src/constants.ts +1 -930
  44. package/src/types/crm.ts +30 -117
  45. package/src/types/definitions.ts +12 -19
  46. package/src/types/fields.ts +31 -72
  47. package/src/types/interests.ts +28 -0
  48. package/src/types/picklists.ts +7 -26
  49. package/src/types/search.ts +4 -34
  50. package/src/types/storage.ts +12 -1
  51. package/src/types/tenants.ts +11 -37
  52. package/src/types/users.ts +3 -17
  53. package/src/types/utils.ts +0 -25
  54. package/src/types/vehicles.ts +93 -461
  55. package/tsconfig.tsbuildinfo +2995 -1
  56. package/lib/apis/crm.d.ts +0 -39
  57. package/lib/apis/crm.d.ts.map +0 -1
  58. package/lib/apis/crm.js +0 -201
  59. package/lib/apis/crm.js.map +0 -1
  60. package/lib/apis/documents.d.ts +0 -4
  61. package/lib/apis/documents.d.ts.map +0 -1
  62. package/lib/apis/documents.js +0 -47
  63. package/lib/apis/documents.js.map +0 -1
  64. package/lib/apis/internet-vehicles.d.ts +0 -3
  65. package/lib/apis/internet-vehicles.d.ts.map +0 -1
  66. package/lib/apis/internet-vehicles.js +0 -27
  67. package/lib/apis/internet-vehicles.js.map +0 -1
  68. package/lib/apis/leasing-administration.d.ts +0 -8
  69. package/lib/apis/leasing-administration.d.ts.map +0 -1
  70. package/lib/apis/leasing-administration.js +0 -49
  71. package/lib/apis/leasing-administration.js.map +0 -1
  72. package/lib/apis/leasing.d.ts +0 -19
  73. package/lib/apis/leasing.d.ts.map +0 -1
  74. package/lib/apis/leasing.js +0 -168
  75. package/lib/apis/leasing.js.map +0 -1
  76. package/lib/apis/opportunities.d.ts +0 -9
  77. package/lib/apis/opportunities.d.ts.map +0 -1
  78. package/lib/apis/opportunities.js +0 -94
  79. package/lib/apis/opportunities.js.map +0 -1
  80. package/lib/apis/picklists.d.ts +0 -5
  81. package/lib/apis/picklists.d.ts.map +0 -1
  82. package/lib/apis/picklists.js +0 -44
  83. package/lib/apis/picklists.js.map +0 -1
  84. package/lib/apis/tenants.d.ts +0 -7
  85. package/lib/apis/tenants.d.ts.map +0 -1
  86. package/lib/apis/tenants.js +0 -80
  87. package/lib/apis/tenants.js.map +0 -1
  88. package/lib/apis/users.d.ts +0 -3
  89. package/lib/apis/users.d.ts.map +0 -1
  90. package/lib/apis/users.js +0 -26
  91. package/lib/apis/users.js.map +0 -1
  92. package/lib/apis/utils.d.ts +0 -9
  93. package/lib/apis/utils.d.ts.map +0 -1
  94. package/lib/apis/utils.js +0 -23
  95. package/lib/apis/utils.js.map +0 -1
  96. package/lib/apis/vehicles.d.ts +0 -18
  97. package/lib/apis/vehicles.d.ts.map +0 -1
  98. package/lib/apis/vehicles.js +0 -159
  99. package/lib/apis/vehicles.js.map +0 -1
  100. package/lib/ddb-entities.d.ts +0 -2
  101. package/lib/ddb-entities.d.ts.map +0 -1
  102. package/lib/ddb-entities.js +0 -5
  103. package/lib/ddb-entities.js.map +0 -1
  104. package/lib/types/activities.d.ts +0 -38
  105. package/lib/types/activities.d.ts.map +0 -1
  106. package/lib/types/activities.js +0 -16
  107. package/lib/types/activities.js.map +0 -1
  108. package/lib/types/documents.d.ts +0 -105
  109. package/lib/types/documents.d.ts.map +0 -1
  110. package/lib/types/documents.js +0 -3
  111. package/lib/types/documents.js.map +0 -1
  112. package/lib/types/internet-vehicles.d.ts +0 -64
  113. package/lib/types/internet-vehicles.d.ts.map +0 -1
  114. package/lib/types/internet-vehicles.js +0 -3
  115. package/lib/types/internet-vehicles.js.map +0 -1
  116. package/lib/types/leads.d.ts +0 -134
  117. package/lib/types/leads.d.ts.map +0 -1
  118. package/lib/types/leads.js +0 -3
  119. package/lib/types/leads.js.map +0 -1
  120. package/lib/types/leasing-administration.d.ts +0 -107
  121. package/lib/types/leasing-administration.d.ts.map +0 -1
  122. package/lib/types/leasing-administration.js +0 -3
  123. package/lib/types/leasing-administration.js.map +0 -1
  124. package/lib/types/leasing-search.d.ts +0 -22
  125. package/lib/types/leasing-search.d.ts.map +0 -1
  126. package/lib/types/leasing-search.js +0 -3
  127. package/lib/types/leasing-search.js.map +0 -1
  128. package/lib/types/leasing-settings.d.ts +0 -113
  129. package/lib/types/leasing-settings.d.ts.map +0 -1
  130. package/lib/types/leasing-settings.js +0 -10
  131. package/lib/types/leasing-settings.js.map +0 -1
  132. package/lib/types/leasing.d.ts +0 -322
  133. package/lib/types/leasing.d.ts.map +0 -1
  134. package/lib/types/leasing.js +0 -24
  135. package/lib/types/leasing.js.map +0 -1
  136. package/lib/types/machines.d.ts +0 -38
  137. package/lib/types/machines.d.ts.map +0 -1
  138. package/lib/types/machines.js +0 -3
  139. package/lib/types/machines.js.map +0 -1
  140. package/lib/types/opportunities.d.ts +0 -448
  141. package/lib/types/opportunities.d.ts.map +0 -1
  142. package/lib/types/opportunities.js +0 -68
  143. package/lib/types/opportunities.js.map +0 -1
  144. package/lib/types/payments.d.ts +0 -38
  145. package/lib/types/payments.d.ts.map +0 -1
  146. package/lib/types/payments.js +0 -9
  147. package/lib/types/payments.js.map +0 -1
  148. package/lib/types/quotes.d.ts +0 -173
  149. package/lib/types/quotes.d.ts.map +0 -1
  150. package/lib/types/quotes.js +0 -26
  151. package/lib/types/quotes.js.map +0 -1
  152. package/lib/types/recently-viewed.d.ts +0 -33
  153. package/lib/types/recently-viewed.d.ts.map +0 -1
  154. package/lib/types/recently-viewed.js +0 -3
  155. package/lib/types/recently-viewed.js.map +0 -1
  156. package/lib/types/saved-filters.d.ts +0 -20
  157. package/lib/types/saved-filters.d.ts.map +0 -1
  158. package/lib/types/saved-filters.js +0 -3
  159. package/lib/types/saved-filters.js.map +0 -1
  160. package/lib/types/settings.d.ts +0 -50
  161. package/lib/types/settings.d.ts.map +0 -1
  162. package/lib/types/settings.js.map +0 -1
  163. package/lib/types/templates.d.ts +0 -35
  164. package/lib/types/templates.d.ts.map +0 -1
  165. package/lib/types/templates.js +0 -9
  166. package/lib/types/templates.js.map +0 -1
  167. package/lib/types/website.d.ts +0 -24
  168. package/lib/types/website.d.ts.map +0 -1
  169. package/lib/types/website.js +0 -3
  170. package/lib/types/website.js.map +0 -1
  171. package/lib/utils/forms.d.ts +0 -6
  172. package/lib/utils/forms.d.ts.map +0 -1
  173. package/lib/utils/forms.js +0 -33
  174. package/lib/utils/forms.js.map +0 -1
  175. package/lib/utils/leasing.d.ts +0 -3
  176. package/lib/utils/leasing.d.ts.map +0 -1
  177. package/lib/utils/leasing.js +0 -10
  178. package/lib/utils/leasing.js.map +0 -1
  179. package/lib/utils/slug.d.ts +0 -3
  180. package/lib/utils/slug.d.ts.map +0 -1
  181. package/lib/utils/slug.js +0 -23
  182. package/lib/utils/slug.js.map +0 -1
  183. package/lib/utils/tenants.d.ts +0 -4
  184. package/lib/utils/tenants.d.ts.map +0 -1
  185. package/lib/utils/tenants.js +0 -16
  186. package/lib/utils/tenants.js.map +0 -1
  187. package/lib/utils/vehicles.d.ts +0 -12
  188. package/lib/utils/vehicles.d.ts.map +0 -1
  189. package/lib/utils/vehicles.js +0 -73
  190. package/lib/utils/vehicles.js.map +0 -1
  191. package/src/apis/crm.ts +0 -302
  192. package/src/apis/documents.ts +0 -54
  193. package/src/apis/internet-vehicles.ts +0 -23
  194. package/src/apis/leasing-administration.ts +0 -70
  195. package/src/apis/leasing.ts +0 -257
  196. package/src/apis/opportunities.ts +0 -133
  197. package/src/apis/picklists.ts +0 -50
  198. package/src/apis/tenants.ts +0 -100
  199. package/src/apis/users.ts +0 -22
  200. package/src/apis/utils.ts +0 -23
  201. package/src/apis/vehicles.ts +0 -229
  202. package/src/ddb-entities.ts +0 -1
  203. package/src/environment.d.ts +0 -6
  204. package/src/types/activities.ts +0 -41
  205. package/src/types/documents.ts +0 -110
  206. package/src/types/internet-vehicles.ts +0 -67
  207. package/src/types/leads.ts +0 -144
  208. package/src/types/leasing-administration.ts +0 -131
  209. package/src/types/leasing-search.ts +0 -24
  210. package/src/types/leasing-settings.ts +0 -111
  211. package/src/types/leasing.ts +0 -360
  212. package/src/types/machines.ts +0 -40
  213. package/src/types/opportunities.ts +0 -496
  214. package/src/types/payments.ts +0 -40
  215. package/src/types/quotes.ts +0 -186
  216. package/src/types/recently-viewed.ts +0 -45
  217. package/src/types/saved-filters.ts +0 -21
  218. package/src/types/settings.ts +0 -51
  219. package/src/types/templates.ts +0 -40
  220. package/src/types/website.ts +0 -28
  221. package/src/utils/forms.ts +0 -32
  222. package/src/utils/leasing.ts +0 -14
  223. package/src/utils/slug.ts +0 -19
  224. package/src/utils/tenants.ts +0 -14
  225. package/src/utils/vehicles.ts +0 -92
@@ -1,45 +0,0 @@
1
- import { AttachmentValue, Requester } from '@bisondesk/commons-sdk/lib/types';
2
- import { BusinessEntityIds } from '../constants';
3
-
4
- export type ViewedItemsRequest = {
5
- businessEntity?: string;
6
- id?: string;
7
- };
8
-
9
- export type NewViewedItem = {
10
- businessEntity: BusinessEntityIds;
11
- id: string;
12
- viewedAt: string;
13
- };
14
-
15
- export type ViewedItemMeta = {
16
- title: string;
17
- subtitle: string;
18
- thumbnail?: AttachmentValue | null; // null signals that it can have a thumbnail, it is just not available
19
- };
20
-
21
- export type ViewedItem = ViewedItemMeta & {
22
- viewedAt: string;
23
- id: string;
24
- actions: string[];
25
- };
26
-
27
- export type RawViewedItem = {
28
- id: string;
29
- viewedAt: string;
30
- };
31
-
32
- export type ViewedItemHandler = (
33
- requester: Requester,
34
- req: ViewedItemsRequest,
35
- itemsBusinessEntity: BusinessEntityIds,
36
- items: RawViewedItem[]
37
- ) => Promise<ViewedItem[]>;
38
-
39
- export type ViewedItemsContextHandlers = {
40
- [entity in BusinessEntityIds]?: ViewedItemHandler;
41
- };
42
-
43
- export type ViewedItemsHandlersCollection = {
44
- [entity in BusinessEntityIds]?: ViewedItemsContextHandlers;
45
- };
@@ -1,21 +0,0 @@
1
- import { BusinessEntityIds } from '../constants';
2
- import { ComplexFilter } from './search';
3
-
4
- type SavedFilterQuery = {
5
- conditions: {
6
- [fieldId: string]: ComplexFilter;
7
- };
8
- fullText?: string;
9
- };
10
-
11
- export type SavedFilter = SavedFilterQuery & {
12
- id: string;
13
- businessEntityId: BusinessEntityIds;
14
- name: string;
15
- userId: string;
16
- };
17
-
18
- export type NewSavedFilterRequest = SavedFilterQuery & {
19
- businessEntityId: BusinessEntityIds;
20
- name: string;
21
- };
@@ -1,51 +0,0 @@
1
- export type WebsiteSettings = {
2
- contacts: {
3
- destinations: string[];
4
- };
5
- leasing?: {
6
- interestRate: number;
7
- initialValues: {
8
- residual: number;
9
- deposit: number;
10
- periods: number;
11
- };
12
- maxPeriods: number;
13
- };
14
- gatsbyCloud?: {
15
- webhook: string;
16
- };
17
- };
18
-
19
- export type HyperportalSettings = {
20
- hcTenantId: string;
21
- crm: {
22
- active: boolean;
23
- };
24
- vehicles: {
25
- active: boolean;
26
- ignoreBeforeDate?: string; // do not modify vehicles created before this date;
27
- };
28
- leasing: {
29
- active: boolean;
30
- contractTransferDefinitionId: string;
31
- contractDealDefinitionId: string;
32
- contractOwner: { [countryCode: string]: string };
33
- };
34
- };
35
-
36
- export type HyperportalMachinesSettings = {
37
- hcTenantId: string;
38
- active: boolean;
39
- };
40
-
41
- export type LeasingCreditorBranch = {
42
- bciNumber: string;
43
- vatNumber: string;
44
- licenceDate: string;
45
- becrisFirstReportDate: string;
46
- becrisStartDate: string;
47
- };
48
-
49
- export type LeasingCreditorSettings = {
50
- [branchId: string]: LeasingCreditorBranch;
51
- };
@@ -1,40 +0,0 @@
1
- export enum TemplateType {
2
- Email = 'email',
3
- Sms = 'sms',
4
- }
5
-
6
- export type TemplateContent =
7
- | {
8
- type: TemplateType.Email;
9
- subject: string;
10
- content: {
11
- html: string;
12
- design: any;
13
- };
14
- }
15
- | {
16
- type: TemplateType.Sms;
17
- content: string;
18
- };
19
-
20
- export type NewTemplateRequest = {
21
- id?: string;
22
- country: string;
23
- name: string;
24
- } & TemplateContent;
25
-
26
- export type Template = {
27
- id: string;
28
- modifiedAt: string;
29
- modifiedBy: string;
30
- country: string;
31
- name: string;
32
- } & TemplateContent;
33
-
34
- export type TemplateInfo = {
35
- id: string;
36
- countries: string[];
37
- modifiedAt: string;
38
- name: string;
39
- type: TemplateType;
40
- };
@@ -1,28 +0,0 @@
1
- import { PhoneNumberRawValue, PhoneNumberValue } from '@bisondesk/commons-sdk/lib/types';
2
-
3
- export type ContactFormRequest = {
4
- email: string;
5
- name: string;
6
- message: string;
7
- phone: PhoneNumberRawValue;
8
- };
9
-
10
- export type ValidContactFormRequest = Omit<ContactFormRequest, 'phone'> & {
11
- phone: PhoneNumberValue;
12
- };
13
-
14
- export type ContactFormEvent = {
15
- tenantId: string;
16
- payload: ValidContactFormRequest;
17
- };
18
-
19
- export type LeasingSimulationRequest = {
20
- deposit: number;
21
- residual: number;
22
- durationInMonths: number;
23
- vehicleId: string;
24
- };
25
-
26
- export type LeasingSimulationResponse = {
27
- monthly: string;
28
- };
@@ -1,32 +0,0 @@
1
- import Decimal from 'decimal.js';
2
- import { PricePercentageMode } from '../types/utils';
3
-
4
- export const computePricePercentage = (
5
- totalAmount: string,
6
- percentage: string,
7
- partialAmount: string = '0',
8
- mode: PricePercentageMode = PricePercentageMode.PERCENTAGE
9
- ): { percentageAmount: string; currencyAmount: string } => {
10
- const output: { percentageAmount: string; currencyAmount: string } = {
11
- percentageAmount: percentage,
12
- currencyAmount: partialAmount,
13
- };
14
-
15
- if (mode === PricePercentageMode.PERCENTAGE) {
16
- output.currencyAmount = new Decimal(totalAmount)
17
- .mul(percentage)
18
- .div(100)
19
- .toDecimalPlaces(2)
20
- .clamp(0, totalAmount)
21
- .toString();
22
- } else {
23
- output.percentageAmount = new Decimal(partialAmount)
24
- .mul(100)
25
- .div(totalAmount)
26
- .toDecimalPlaces(4)
27
- .clamp(0, 100)
28
- .toString();
29
- }
30
-
31
- return output;
32
- };
@@ -1,14 +0,0 @@
1
- import { utc } from '@bisondesk/commons-sdk/lib/dayjs-utils';
2
- import { map, sortBy, uniqBy } from 'lodash';
3
- import { LeasingContractClient } from '../types/leasing';
4
-
5
- /* sort from oldest to most recent client */
6
- export const sortContractClients = (clients: LeasingContractClient[]): LeasingContractClient[] =>
7
- sortBy(
8
- map(
9
- uniqBy(clients, (c) => c.takeoverId),
10
- (c) => ({ ...c, since: utc(c.since).format('YYYY-MM-DD') }) // doing a map to also fix legacy data
11
- ),
12
- (cli) => cli.since,
13
- (cli) => (cli.takeoverId ? parseInt(cli.takeoverId.replace(/[^0-9]/g, '')) : 0)
14
- );
package/src/utils/slug.ts DELETED
@@ -1,19 +0,0 @@
1
- import slugify from 'slugify';
2
- import { Vehicle } from '../types/vehicles';
3
-
4
- export const getVehicleSlug = (vehicle: Vehicle): string => {
5
- return slugify(
6
- [
7
- vehicle.external.identification.stockNumber ?? vehicle.internal.identification.stockNumber,
8
- vehicle.external.general.make,
9
- vehicle.external.general.modelName,
10
- vehicle.external.general.typeName,
11
- `${vehicle.external.history?.advertisingYear}`,
12
- vehicle.external.general.category,
13
- vehicle.external.general.bodystyle,
14
- vehicle.external.powertrain?.axles?.configuration,
15
- ]
16
- .filter((f) => !!f)
17
- .join(' ')
18
- );
19
- };
@@ -1,14 +0,0 @@
1
- import { XError } from '@bisondesk/commons-sdk/lib/errors';
2
- import { first } from 'lodash';
3
- import { Branch, Tenant } from '../types/tenants';
4
-
5
- export const getBranch = (tenant: Tenant, branchId: string): Branch => {
6
- const branch = tenant.branches.find((branch: Branch) => branch.id === branchId);
7
- if (branch == null) {
8
- throw new XError('tenants.branch-not-found', { tenantId: tenant.id, branchId });
9
- }
10
-
11
- return branch;
12
- };
13
-
14
- export const getDefaultBranch = (tenant: Tenant): Branch => first(tenant.branches)!;
@@ -1,92 +0,0 @@
1
- import { Categories } from '../constants';
2
- import { CustomSearchState, Vehicle, VehicleExternalInfo } from '../types/vehicles';
3
-
4
- export const extractCustomState = (vehicle: Vehicle): CustomSearchState[] => {
5
- const state: CustomSearchState[] = [];
6
-
7
- if (vehicle.internal.status.option != null) {
8
- state.push(CustomSearchState.Reserved);
9
- }
10
-
11
- if (vehicle.internal.role === 'SALE' && vehicle.internal.status.sale.dealStatus === 'NOT_SOLD') {
12
- state.push(CustomSearchState.Available);
13
- }
14
-
15
- return state;
16
- };
17
-
18
- export const extractCustomFeatures = (vehicle: VehicleExternalInfo): string[] => {
19
- const features: {
20
- getValue: (vehicle: VehicleExternalInfo) => any;
21
- picklistValueId: string;
22
- }[] = [
23
- {
24
- getValue: (vehicle) => vehicle.superstructure?.crane?.present,
25
- picklistValueId: 'crane',
26
- },
27
- {
28
- getValue: (vehicle) => vehicle.superstructure?.tailgate?.present,
29
- picklistValueId: 'tailgate',
30
- },
31
- { getValue: (vehicle) => vehicle.accessories.adr, picklistValueId: 'adr' },
32
- {
33
- getValue: (vehicle) => vehicle.accessories.retarderIntarder,
34
- picklistValueId: 'retarderIntarder',
35
- },
36
- {
37
- getValue: (vehicle) => vehicle.accessories.hydraulicTipperKit,
38
- picklistValueId: 'hydraulicTipperKit',
39
- },
40
- {
41
- getValue: (vehicle) => vehicle.accessories.lowDeck,
42
- picklistValueId: 'lowDeck',
43
- },
44
- ];
45
-
46
- return features
47
- .filter((feature) => !!feature.getValue(vehicle))
48
- .map((feature) => feature.picklistValueId);
49
- };
50
-
51
- export const getInternalTitle = ({
52
- make,
53
- category,
54
- modelName,
55
- bodywork,
56
- modelTypeName,
57
- }: {
58
- make: string;
59
- category: string;
60
- modelName?: string;
61
- modelTypeName?: string;
62
- bodywork?: string;
63
- }): string => {
64
- if (category === Categories.Trailer || category === Categories.SemiTrailer) {
65
- return [make, modelName, bodywork]
66
- .filter((v): v is string => !!v)
67
- .map((v) => v.trim())
68
- .join(' ')
69
- .trim();
70
- }
71
-
72
- return [make, modelName, modelTypeName]
73
- .filter((v): v is string => !!v)
74
- .map((v) => v.trim())
75
- .join(' ')
76
- .trim();
77
- };
78
-
79
- // example: 1 -> A, 2 -> B, 26 -> Z, 27 -> AA, 28 -> AB, 52 -> AZ, 53 -> BA, 54 -> BB, 702 -> ZZ, 703 -> AAA
80
- export const convertNumberToLetters = (num: number): string => {
81
- const letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
82
- const lettersLength = letters.length;
83
-
84
- if (num < 1) {
85
- return '';
86
- }
87
-
88
- const remainder = num % lettersLength;
89
- const quotient = Math.floor(num / lettersLength);
90
-
91
- return convertNumberToLetters(quotient) + letters.charAt(remainder - 1);
92
- };