@limetech/limepkg-cpq-order 2.8.0-dev.1

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 (51) hide show
  1. package/README.md +78 -0
  2. package/dist/index.cjs.js +1 -0
  3. package/dist/types/classes/base.d.ts +27 -0
  4. package/dist/types/classes/deal.d.ts +7 -0
  5. package/dist/types/classes/index.d.ts +3 -0
  6. package/dist/types/classes/item.d.ts +32 -0
  7. package/dist/types/classes/number.d.ts +3 -0
  8. package/dist/types/classes/order.d.ts +10 -0
  9. package/dist/types/components/article-selector/article-group-picker.d.ts +25 -0
  10. package/dist/types/components/article-selector/article-picker.d.ts +25 -0
  11. package/dist/types/components/article-selector/article-selector.d.ts +35 -0
  12. package/dist/types/components/article-selector-layout/article-selector-layout.d.ts +3 -0
  13. package/dist/types/components/cpq-tab/cpq-tab.d.ts +27 -0
  14. package/dist/types/components/deal-view/deal-view.d.ts +30 -0
  15. package/dist/types/components/dynamic-properties/dynamic-properties.d.ts +23 -0
  16. package/dist/types/components/edit-item-dialog/edit-item-dialog.d.ts +52 -0
  17. package/dist/types/components/erp-status/erp-status.d.ts +20 -0
  18. package/dist/types/components/erp-status/flow-items.d.ts +9 -0
  19. package/dist/types/components/item-form/item-form.d.ts +130 -0
  20. package/dist/types/components/item-summary/item-summary.d.ts +20 -0
  21. package/dist/types/components/item-table/item-table.d.ts +23 -0
  22. package/dist/types/components/loader/coc-loader.d.ts +19 -0
  23. package/dist/types/components/new-order-dialog/new-order-dialog.d.ts +26 -0
  24. package/dist/types/components/order-card/order-card.d.ts +22 -0
  25. package/dist/types/components/order-view/order-view.d.ts +30 -0
  26. package/dist/types/components/template-selector/template-selector.d.ts +25 -0
  27. package/dist/types/components.d.ts +723 -0
  28. package/dist/types/index.d.ts +2 -0
  29. package/dist/types/interface.d.ts +6 -0
  30. package/dist/types/interfaces/article-selector.d.ts +23 -0
  31. package/dist/types/interfaces/config.d.ts +106 -0
  32. package/dist/types/interfaces/index.d.ts +3 -0
  33. package/dist/types/interfaces/objects.d.ts +73 -0
  34. package/dist/types/services/article.d.ts +7 -0
  35. package/dist/types/services/deal.d.ts +5 -0
  36. package/dist/types/services/documenttemplate.service.interface.d.ts +142 -0
  37. package/dist/types/services/index.d.ts +8 -0
  38. package/dist/types/services/item.d.ts +6 -0
  39. package/dist/types/services/limetype.d.ts +4 -0
  40. package/dist/types/services/notification.d.ts +3 -0
  41. package/dist/types/services/order.d.ts +6 -0
  42. package/dist/types/services/servercommand.service.interface.d.ts +36 -0
  43. package/dist/types/services/template.d.ts +4 -0
  44. package/dist/types/services/translate.d.ts +2 -0
  45. package/dist/types/stencil-public-runtime.d.ts +1565 -0
  46. package/dist/types/testing/config.d.ts +2 -0
  47. package/dist/types/testing/index.d.ts +4 -0
  48. package/dist/types/testing/limetype.d.ts +3 -0
  49. package/dist/types/testing/schema.d.ts +33 -0
  50. package/dist/types/testing/views.d.ts +140 -0
  51. package/package.json +61 -0
@@ -0,0 +1,2 @@
1
+ export * from './components';
2
+ export * from './interfaces/article-selector';
@@ -0,0 +1,6 @@
1
+ // Components interfaces
2
+ export * from './components';
3
+
4
+ // If you need to export interfaces externally,
5
+ // add them like the example below:
6
+ // export * from './components/my-component/my-interface';
@@ -0,0 +1,23 @@
1
+ import { EventEmitter } from '../stencil-public-runtime';
2
+ import { Iitem as CpqItem } from './objects';
3
+ import type { Deal as CpqDeal, Order as CpqOrder } from '../classes';
4
+ import { LimeProperty } from '@limetech/lime-web-components';
5
+ export { CpqItem, CpqDeal, CpqOrder };
6
+ export { IarticleGroup as CpqArticleGroup, Iarticle as CpqArticle, } from './objects';
7
+ export declare type ArticleSelectorComponent<Item extends CpqItem = CpqItem> = {
8
+ /**
9
+ * The article group relation for the item
10
+ */
11
+ articleGroupProperty?: LimeProperty;
12
+ /**
13
+ * The article relation for the item
14
+ */
15
+ articleProperty?: LimeProperty;
16
+ /**
17
+ * The edited deal article or order row item
18
+ */
19
+ item: Item;
20
+ itemParent?: CpqDeal | CpqOrder;
21
+ additionalProperties?: Array<keyof Item['additionalProperties']>;
22
+ itemChange?: EventEmitter<Item>;
23
+ };
@@ -0,0 +1,106 @@
1
+ export interface IconfigArticleMapping {
2
+ limetype: string;
3
+ propertyDescription: string;
4
+ propertyArticleno: string;
5
+ propertyArticlegroup: string;
6
+ propertyPricePerUnit: string;
7
+ propertyCostPrice: string;
8
+ propertyGrossMarginRatio: string;
9
+ propertyUnit: string;
10
+ propertyVat: string;
11
+ propertyActive: string;
12
+ }
13
+ export interface IconfigArticlegroupMapping {
14
+ limetype: string;
15
+ propertyName: string;
16
+ propertyActive: string;
17
+ }
18
+ export interface IconfigArticle {
19
+ requireArticle: boolean;
20
+ articleMapping: IconfigArticleMapping;
21
+ articlegroupMapping: IconfigArticlegroupMapping;
22
+ }
23
+ export interface IconfigCustomization {
24
+ articleSelectorComponent?: {
25
+ name: string;
26
+ props?: Record<string, unknown>;
27
+ };
28
+ additionalItemProperties?: string[];
29
+ }
30
+ export interface IconfigItemMapping {
31
+ limetype: string;
32
+ parentRelation: string;
33
+ propertyArticle: string;
34
+ propertyArticlegroup: string;
35
+ propertyArticleno: string;
36
+ propertyDescription: string;
37
+ propertyVat: string;
38
+ propertyQuantity: string;
39
+ propertyUnit: string;
40
+ propertyPricePerUnit: string;
41
+ propertyDiscountPerUnit: string;
42
+ propertyDiscountPercent: string;
43
+ propertyDiscountClass: string;
44
+ propertyCostPrice: string;
45
+ propertyGrossMarginRatio: string;
46
+ propertySubtotal: string;
47
+ propertyDiscount: string;
48
+ propertyTotalvalue: string;
49
+ propertyPosition: string;
50
+ }
51
+ export interface IconfigBaseMapping {
52
+ limetype: string;
53
+ dynamicProperties: string[];
54
+ propertyCurrency: string;
55
+ propertySubtotal: string;
56
+ propertyDiscount: string;
57
+ }
58
+ export interface IconfigDealMapping extends IconfigBaseMapping {
59
+ propertyName: string;
60
+ propertyValue: string;
61
+ propertyOrder: string;
62
+ propertyVat: string;
63
+ }
64
+ export interface IconfigDealarticleMapping extends IconfigItemMapping {
65
+ }
66
+ export interface IconfigDocumentMapping {
67
+ limetype: string;
68
+ propertyDocument: string;
69
+ propertyComment: string;
70
+ propertyType: string;
71
+ optionTypeQuote: string;
72
+ propertyDeal: string;
73
+ }
74
+ export interface IconfigCpq {
75
+ dealMapping: IconfigDealMapping;
76
+ dealarticleMapping: IconfigDealarticleMapping;
77
+ documentMapping: IconfigDocumentMapping;
78
+ }
79
+ export interface IconfigOrderMapping extends IconfigBaseMapping {
80
+ propertyOrderstatus: string;
81
+ propertyCustomerid: string;
82
+ propertyCustomerReference: string;
83
+ propertyCurrency: string;
84
+ propertyOrderSum: string;
85
+ propertyOrderVat: string;
86
+ propertyOrderTotalSum: string;
87
+ propertyCompany: string;
88
+ propertyDeal: string;
89
+ }
90
+ export interface IconfigOrderrowMapping extends IconfigItemMapping {
91
+ }
92
+ export interface IconfigOrderFromDealMapping {
93
+ source: string;
94
+ target: string;
95
+ }
96
+ export interface IconfigOrder {
97
+ orderMapping: IconfigOrderMapping;
98
+ orderrowMapping: IconfigOrderrowMapping;
99
+ orderFromDealMapping: IconfigOrderFromDealMapping[];
100
+ }
101
+ export interface Iconfig {
102
+ article: IconfigArticle;
103
+ customization?: IconfigCustomization;
104
+ cpq?: IconfigCpq;
105
+ order?: IconfigOrder;
106
+ }
@@ -0,0 +1,3 @@
1
+ export * from './article-selector';
2
+ export * from './config';
3
+ export * from './objects';
@@ -0,0 +1,73 @@
1
+ import { IconfigBaseMapping } from './config';
2
+ export interface Iitem<T extends {} = Record<string, any>> {
3
+ id: number;
4
+ articleGroup?: IarticleGroup;
5
+ article?: Iarticle;
6
+ articleno?: string;
7
+ description: string;
8
+ position: number;
9
+ vat: number;
10
+ unit: string;
11
+ pricePerUnit: number;
12
+ discountPerUnit: number;
13
+ discountPercent: number;
14
+ discountClass: DiscountClasses;
15
+ costPrice: number;
16
+ grossMarginRatio: number;
17
+ quantity: number;
18
+ subtotal: number;
19
+ discount: number;
20
+ total: number;
21
+ guid?: string;
22
+ deleted: boolean;
23
+ additionalProperties?: T;
24
+ }
25
+ export interface Iarticle {
26
+ id: number;
27
+ description: string;
28
+ articleGroup?: IarticleGroup;
29
+ articleno: string;
30
+ price: number;
31
+ costPrice: number;
32
+ grossMarginRatio: number;
33
+ unit: string;
34
+ vat: number;
35
+ }
36
+ export interface IarticleGroup {
37
+ id: number;
38
+ name: string;
39
+ }
40
+ export interface Base {
41
+ id: number;
42
+ limetype: string;
43
+ currency: string;
44
+ items: Iitem[];
45
+ mapping: IconfigBaseMapping;
46
+ subtotal: number;
47
+ discount: number;
48
+ total: number;
49
+ vat: number;
50
+ totalInclVat: number;
51
+ }
52
+ export interface Ideal extends Base {
53
+ name: string;
54
+ }
55
+ export interface Iorder extends Base {
56
+ deal: number;
57
+ orderstatus: ErpStatus;
58
+ }
59
+ export interface Icolumn {
60
+ title: string;
61
+ field: string;
62
+ headerSort: boolean;
63
+ horizontalAlign?: 'left' | 'center' | 'right';
64
+ formatter?: any;
65
+ }
66
+ export declare enum ErpStatus {
67
+ notready = "notready",
68
+ readytobesent = "readytobesent",
69
+ inprocess = "inprocess",
70
+ senttoerp = "senttoerp",
71
+ error = "error"
72
+ }
73
+ export declare type DiscountClasses = 'amount' | 'percent';
@@ -0,0 +1,7 @@
1
+ import { Iarticle, IarticleGroup, Iconfig, IconfigArticle, IconfigArticlegroupMapping } from '../interfaces';
2
+ import { LimeWebComponentPlatform } from '@limetech/lime-web-components';
3
+ export declare function getArticleConfig(platform: LimeWebComponentPlatform, config?: Iconfig): IconfigArticle;
4
+ export declare function getArticleGroups(platform: LimeWebComponentPlatform, articlegroupMapping?: IconfigArticlegroupMapping): Promise<IarticleGroup[]>;
5
+ export declare function getArticles(platform: LimeWebComponentPlatform, articleConfig: IconfigArticle, articleGroup?: IarticleGroup, searchText?: string): Promise<Iarticle[]>;
6
+ export declare function articleResponseFormat(articleConfig: IconfigArticle): any;
7
+ export declare function mapArticleResult(result: Record<string, any>, articleConfig: IconfigArticle): Iarticle;
@@ -0,0 +1,5 @@
1
+ import { LimeWebComponentPlatform } from '@limetech/lime-web-components';
2
+ import { Deal } from '../classes';
3
+ import { Iconfig } from '../interfaces';
4
+ export declare function loadDeal(platform: LimeWebComponentPlatform, config: Iconfig, id: number): Promise<Deal>;
5
+ export declare function saveDeal(deal: Deal, platform: LimeWebComponentPlatform): Promise<number>;
@@ -0,0 +1,142 @@
1
+ import { FileInfo } from '@limetech/lime-elements';
2
+ export interface Template {
3
+ id: number;
4
+ extension?: string;
5
+ last_modified?: string;
6
+ mimetype?: string;
7
+ filename?: string;
8
+ size?: number;
9
+ storage_type?: string;
10
+ metadata?: {
11
+ [key: string]: any;
12
+ };
13
+ filetype: TemplateFileType;
14
+ }
15
+ export declare enum TemplateFileType {
16
+ DOCUMENT_TEMPLATE = 113,
17
+ DOCUMENT_TEMPLATE_2 = 115
18
+ }
19
+ /**
20
+ * The registered name of the document template service.
21
+ */
22
+ export declare const DocumentTemplateServiceName = "limepkg-document-templates.documenttemplateservice";
23
+ /**
24
+ * Array of supported document template extensions. Currently allowed ones are: .docx, .pdf, .xlsx
25
+ */
26
+ export declare const SupportedDocumentTemplateExtensions: readonly ["docx", "pdf", "xlsx"];
27
+ /**
28
+ * The supported document template extension.
29
+ */
30
+ export declare type SupportedDocumentTemplateExtension = (typeof SupportedDocumentTemplateExtensions)[number];
31
+ /**
32
+ * The available options used when getting templates.
33
+ */
34
+ export declare type GetOptions = {
35
+ /**
36
+ * Only return templates compatible with this lime type.
37
+ */
38
+ limetype?: string;
39
+ /**
40
+ * Only return templates matching this extension.
41
+ */
42
+ extension?: SupportedDocumentTemplateExtension[];
43
+ };
44
+ /**
45
+ * Defines the document template service.
46
+ */
47
+ export interface DocumentTemplateService {
48
+ /**
49
+ * Returns a list of available templates based
50
+ * on the provided options.
51
+ *
52
+ * @param {GetOptions} options The options for the request
53
+ * @returns {Promise<DocumentTemplate[]>} The document templates.
54
+ */
55
+ getTemplates(options?: GetOptions): Promise<DocumentTemplate[]>;
56
+ /**
57
+ * Returns a file info representation of a document template.
58
+ *
59
+ * @param {DocumentTemplate} template The document template
60
+ * @returns {FileInfo} The file info representation
61
+ */
62
+ templateToFileInfo(template: DocumentTemplate): FileInfo;
63
+ /**
64
+ * Returns a document template representation of a file info.
65
+ *
66
+ * @param {FileInfo} file The file info
67
+ * @returns {DocumentTemplate} The document template representation
68
+ */
69
+ fileInfoToTemplate(file: FileInfo): DocumentTemplate;
70
+ }
71
+ export interface Locale {
72
+ /**
73
+ * The locale code.
74
+ * For example "en_US".
75
+ */
76
+ code?: string;
77
+ /**
78
+ * The locale display name.
79
+ */
80
+ displayName?: string;
81
+ }
82
+ /**
83
+ * The available document template types.
84
+ */
85
+ export declare type DocumentTemplateType = 'document_template' | 'legacy_template' | 'field_file';
86
+ export interface DocumentTemplate {
87
+ /**
88
+ * The id of the document template.
89
+ *
90
+ * When this value is a string it has a custom template id which will
91
+ * stay persisted even if the document template file changes.
92
+ * When this value is a number it is the same as {@link DocumentTemplate#id}.
93
+ */
94
+ templateId: string | number;
95
+ /**
96
+ * The id of the document template's file.
97
+ *
98
+ * IMPORTANT!
99
+ * This id is volatile since it is the id of the document template
100
+ * file and thus will change when the template document file changes.
101
+ */
102
+ fileId: number;
103
+ /**
104
+ * The name of the document template file.
105
+ */
106
+ fileName: string;
107
+ /**
108
+ * The extension of the document template file.
109
+ */
110
+ extension: string;
111
+ /**
112
+ * Additional tags for this document template.
113
+ */
114
+ tags?: string[];
115
+ /**
116
+ * An optional category for this document template.
117
+ *
118
+ * NOTE! Only used with legacy templates.
119
+ */
120
+ category?: string;
121
+ /**
122
+ * Defines the default locale for this document template.
123
+ */
124
+ locale?: Locale;
125
+ /**
126
+ * The type of this document template.
127
+ */
128
+ type?: DocumentTemplateType;
129
+ }
130
+ export interface TemplatePickerComponent {
131
+ /**
132
+ * The name of the web component.
133
+ */
134
+ name: string;
135
+ /**
136
+ * The optional web component properties.
137
+ */
138
+ props?: object;
139
+ }
140
+ export interface LoadTemplateOptions {
141
+ limetype?: string;
142
+ }
@@ -0,0 +1,8 @@
1
+ export * from './article';
2
+ export * from './deal';
3
+ export * from './item';
4
+ export * from './limetype';
5
+ export * from './order';
6
+ export * from './template';
7
+ export * from './translate';
8
+ export * from './notification';
@@ -0,0 +1,6 @@
1
+ import { LimeWebComponentPlatform } from '@limetech/lime-web-components';
2
+ import { ServerCommand } from './servercommand.service.interface';
3
+ import { Item } from '../classes';
4
+ import { Iconfig, IconfigItemMapping } from '../interfaces';
5
+ export declare function getItems(platform: LimeWebComponentPlatform, itemMapping: IconfigItemMapping, config: Iconfig, id: number): Promise<Item[]>;
6
+ export declare function mapItemsCommands(items: Item[], itemMapping: IconfigItemMapping, ref: string, commands: ServerCommand[]): void;
@@ -0,0 +1,4 @@
1
+ import { LimeType, LimeWebComponentPlatform } from '@limetech/lime-web-components';
2
+ export declare function getLimeColor(color: string): string;
3
+ export declare function getTranslatedName(limetype: LimeType): string;
4
+ export declare function loadLimeobject(platform: LimeWebComponentPlatform, limetype: string, id: number): Promise<any>;
@@ -0,0 +1,3 @@
1
+ import { Notifications } from '@limetech/lime-web-components';
2
+ export declare function notifyUser(notificationService: Notifications, message: string): Promise<boolean>;
3
+ export declare function alertUser(notificationService: Notifications, title: string, message: string): Promise<void>;
@@ -0,0 +1,6 @@
1
+ import { LimeWebComponentPlatform, LimeProperty } from '@limetech/lime-web-components';
2
+ import { Order } from '../classes';
3
+ import { Iconfig } from '../interfaces';
4
+ export declare function loadOrder(platform: LimeWebComponentPlatform, config: Iconfig, id: number): Promise<Order>;
5
+ export declare function saveOrder(order: Order, platform: LimeWebComponentPlatform): Promise<number>;
6
+ export declare function orderFromDeal(platform: LimeWebComponentPlatform, config: Iconfig, dealId: number, order?: Order, orderrowProperties?: Record<string, LimeProperty>): Promise<Order>;
@@ -0,0 +1,36 @@
1
+ export declare const ServerCommandServiceName = "limepkg-server-commands.service";
2
+ export interface ServerCommandService {
3
+ /**
4
+ * Posts the commands to the command endpoint.
5
+ *
6
+ * @param {ServerCommand[]} payload The commands.
7
+ * @returns {Promise<ServerCommandBatchResponse>} The response.
8
+ */
9
+ postCommands(payload: ServerCommand[]): Promise<ServerCommandBatchResponse>;
10
+ }
11
+ export interface ServerCommand {
12
+ name: string;
13
+ parameters: object;
14
+ }
15
+ export interface ServerCommandResponse {
16
+ successful: boolean;
17
+ command: object;
18
+ data: any;
19
+ error: ServerCommandError;
20
+ }
21
+ export interface ServerCommandError {
22
+ code: string;
23
+ message: string;
24
+ }
25
+ export interface ServerCommandBatch {
26
+ commands: ServerCommand[];
27
+ }
28
+ export interface ServerCommandBatchResponse {
29
+ successful: boolean;
30
+ id: string;
31
+ commands: ServerCommandResponse[];
32
+ }
33
+ export declare enum ServerCommandName {
34
+ upsert = "upsert-limeobject",
35
+ delete = "delete-limeobject"
36
+ }
@@ -0,0 +1,4 @@
1
+ import { CreateLimeobjectDialogCommand, LimeWebComponentPlatform } from '@limetech/lime-web-components';
2
+ import { DocumentTemplate } from './documenttemplate.service.interface';
3
+ export declare function loadAllTemplates(platform: LimeWebComponentPlatform, limetype: string): Promise<DocumentTemplate[]>;
4
+ export declare function openGenerateQuotationDialog(platform: LimeWebComponentPlatform, command: CreateLimeobjectDialogCommand): void;
@@ -0,0 +1,2 @@
1
+ import { Translator } from '@limetech/lime-web-components';
2
+ export declare function getTranslation(translateService: Translator, tag: string, params?: {}): string;