@mj-biz-apps/orders-ng 5.53.0 → 5.54.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.
Files changed (65) hide show
  1. package/dist/lib/custom/OrderHeader/order-header-form.component.js +5 -5
  2. package/dist/lib/custom/OrderHeader/order-header-form.component.js.map +1 -1
  3. package/dist/lib/custom/OrderHeader/order-line-details-panel.component.js +2 -2
  4. package/dist/lib/custom/OrderHeader/order-line-details-panel.component.js.map +1 -1
  5. package/dist/lib/custom/OrderHeader/order-lines-editor.component.d.ts +11 -0
  6. package/dist/lib/custom/OrderHeader/order-lines-editor.component.d.ts.map +1 -1
  7. package/dist/lib/custom/OrderHeader/order-lines-editor.component.js +310 -251
  8. package/dist/lib/custom/OrderHeader/order-lines-editor.component.js.map +1 -1
  9. package/dist/lib/custom/Product/widgets/product-accounting-widget.component.js +2 -2
  10. package/dist/lib/form-panels/product-header.panel.d.ts +2 -2
  11. package/dist/lib/form-panels/product-header.panel.d.ts.map +1 -1
  12. package/dist/lib/form-panels/product-header.panel.js +4 -21
  13. package/dist/lib/form-panels/product-header.panel.js.map +1 -1
  14. package/dist/lib/form-panels/product-readiness-check.d.ts +4 -0
  15. package/dist/lib/form-panels/product-readiness-check.d.ts.map +1 -0
  16. package/dist/lib/form-panels/product-readiness-check.js +38 -0
  17. package/dist/lib/form-panels/product-readiness-check.js.map +1 -0
  18. package/dist/lib/pages/catalog/new-product-dialog.component.d.ts +67 -0
  19. package/dist/lib/pages/catalog/new-product-dialog.component.d.ts.map +1 -0
  20. package/dist/lib/pages/catalog/new-product-dialog.component.js +554 -0
  21. package/dist/lib/pages/catalog/new-product-dialog.component.js.map +1 -0
  22. package/dist/lib/pages/catalog/new-product-draft.d.ts +31 -0
  23. package/dist/lib/pages/catalog/new-product-draft.d.ts.map +1 -0
  24. package/dist/lib/pages/catalog/new-product-draft.js +81 -0
  25. package/dist/lib/pages/catalog/new-product-draft.js.map +1 -0
  26. package/dist/lib/pages/catalog/pricing.page.d.ts +16 -3
  27. package/dist/lib/pages/catalog/pricing.page.d.ts.map +1 -1
  28. package/dist/lib/pages/catalog/pricing.page.js +77 -38
  29. package/dist/lib/pages/catalog/pricing.page.js.map +1 -1
  30. package/dist/lib/pages/catalog/products.page.d.ts +16 -4
  31. package/dist/lib/pages/catalog/products.page.d.ts.map +1 -1
  32. package/dist/lib/pages/catalog/products.page.js +150 -111
  33. package/dist/lib/pages/catalog/products.page.js.map +1 -1
  34. package/dist/lib/pages/orders/orders-dashboard.page.d.ts +11 -3
  35. package/dist/lib/pages/orders/orders-dashboard.page.d.ts.map +1 -1
  36. package/dist/lib/pages/orders/orders-dashboard.page.js +31 -14
  37. package/dist/lib/pages/orders/orders-dashboard.page.js.map +1 -1
  38. package/dist/lib/pages/orders/orders-list.page.d.ts +3 -1
  39. package/dist/lib/pages/orders/orders-list.page.d.ts.map +1 -1
  40. package/dist/lib/pages/orders/orders-list.page.js +10 -5
  41. package/dist/lib/pages/orders/orders-list.page.js.map +1 -1
  42. package/dist/lib/pages/payments/payments-dashboard.page.d.ts +3 -1
  43. package/dist/lib/pages/payments/payments-dashboard.page.d.ts.map +1 -1
  44. package/dist/lib/pages/payments/payments-dashboard.page.js +10 -5
  45. package/dist/lib/pages/payments/payments-dashboard.page.js.map +1 -1
  46. package/dist/lib/pages/payments/payments-list.page.d.ts +3 -1
  47. package/dist/lib/pages/payments/payments-list.page.d.ts.map +1 -1
  48. package/dist/lib/pages/payments/payments-list.page.js +10 -5
  49. package/dist/lib/pages/payments/payments-list.page.js.map +1 -1
  50. package/dist/lib/pages/subscriptions/subscriptions.page.d.ts +3 -1
  51. package/dist/lib/pages/subscriptions/subscriptions.page.d.ts.map +1 -1
  52. package/dist/lib/pages/subscriptions/subscriptions.page.js +10 -5
  53. package/dist/lib/pages/subscriptions/subscriptions.page.js.map +1 -1
  54. package/dist/lib/pages/workspace-requests.d.ts +30 -0
  55. package/dist/lib/pages/workspace-requests.d.ts.map +1 -0
  56. package/dist/lib/pages/workspace-requests.js +12 -0
  57. package/dist/lib/pages/workspace-requests.js.map +1 -0
  58. package/dist/lib/sections/orders-sections.component.d.ts.map +1 -1
  59. package/dist/lib/sections/orders-sections.component.js +10 -7
  60. package/dist/lib/sections/orders-sections.component.js.map +1 -1
  61. package/dist/public-api.d.ts +1 -0
  62. package/dist/public-api.d.ts.map +1 -1
  63. package/dist/public-api.js +1 -0
  64. package/dist/public-api.js.map +1 -1
  65. package/package.json +2 -2
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Runs the two server checks a Draft product needs before it is activated (golive#433), for the
3
+ * product header and the New product dialog (golive#434) alike.
4
+ *
5
+ * The evaluation is in `product-readiness.ts`, which stays free of runtime imports so its tests need
6
+ * no operation classes. This file only calls the operations and hands their results over.
7
+ */
8
+ import { OrdersExplainProductGLAccountsOperation, OrdersPreviewPriceOperation, } from '@mj-biz-apps/orders-entities';
9
+ import { ACTIVATION_GL_ROLES, EvaluateProductReadiness } from './product-readiness.js';
10
+ /** Asks pricing and the GL walk whether the saved product `productID` is ready to sell. */
11
+ export async function CheckProductReadiness(productID) {
12
+ const [price, gl] = await Promise.all([checkPrice(productID), checkGLAccounts(productID)]);
13
+ return EvaluateProductReadiness({ ...price, ...gl });
14
+ }
15
+ async function checkPrice(productID) {
16
+ try {
17
+ // A Draft product may not be sold, so pricing refuses it unless told to ignore that.
18
+ const r = await new OrdersPreviewPriceOperation().Execute({ ProductID: productID, IgnoreSellability: true });
19
+ return r.Success && r.Output
20
+ ? { PriceInForce: r.Output.Success, PriceMessage: r.Output.Success ? null : r.Output.Message }
21
+ : { PriceInForce: null, PriceMessage: r.ErrorMessage };
22
+ }
23
+ catch (e) {
24
+ return { PriceInForce: null, PriceMessage: e instanceof Error ? e.message : String(e) };
25
+ }
26
+ }
27
+ async function checkGLAccounts(productID) {
28
+ try {
29
+ const r = await new OrdersExplainProductGLAccountsOperation().Execute({ ProductID: productID, Roles: [...ACTIVATION_GL_ROLES] });
30
+ return r.Success && r.Output?.Success
31
+ ? { Roles: r.Output.Roles ?? null, GLError: null }
32
+ : { Roles: null, GLError: r.Output?.Message ?? r.ErrorMessage };
33
+ }
34
+ catch (e) {
35
+ return { Roles: null, GLError: e instanceof Error ? e.message : String(e) };
36
+ }
37
+ }
38
+ //# sourceMappingURL=product-readiness-check.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product-readiness-check.js","sourceRoot":"","sources":["../../../src/lib/form-panels/product-readiness-check.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACH,uCAAuC,EACvC,2BAA2B,GAC9B,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAsD,MAAM,qBAAqB,CAAC;AAExI,2FAA2F;AAC3F,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,SAAiB;IACzD,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAC3F,OAAO,wBAAwB,CAAC,EAAE,GAAG,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;AACzD,CAAC;AAED,KAAK,UAAU,UAAU,CAAC,SAAiB;IACvC,IAAI,CAAC;QACD,qFAAqF;QACrF,MAAM,CAAC,GAAG,MAAM,IAAI,2BAA2B,EAAE,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7G,OAAO,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM;YACxB,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE;YAC9F,CAAC,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC,YAAY,EAAE,CAAC;IAC/D,CAAC;IAAC,OAAO,CAAU,EAAE,CAAC;QAClB,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5F,CAAC;AACL,CAAC;AAED,KAAK,UAAU,eAAe,CAAC,SAAiB;IAC5C,IAAI,CAAC;QACD,MAAM,CAAC,GAAG,MAAM,IAAI,uCAAuC,EAAE,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,GAAG,mBAAmB,CAAC,EAAE,CAAC,CAAC;QACjI,OAAO,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO;YACjC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,IAAI,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE;YAClD,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,OAAO,IAAI,CAAC,CAAC,YAAY,EAAE,CAAC;IACxE,CAAC;IAAC,OAAO,CAAU,EAAE,CAAC;QAClB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IAChF,CAAC;AACL,CAAC"}
@@ -0,0 +1,67 @@
1
+ import { EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
2
+ import { type mjBizAppsOrdersProductEntity } from '@mj-biz-apps/orders-entities';
3
+ import { type NewProductDraft } from './new-product-draft.js';
4
+ import * as i0 from "@angular/core";
5
+ /** One choice in a select. */
6
+ interface Option {
7
+ ID: string;
8
+ Name: string;
9
+ }
10
+ /** Which part of the dialog is showing. */
11
+ type Step = 'details' | 'accounts';
12
+ /**
13
+ * `mjo-new-product-dialog` — the guided way to create a sellable product (golive#434).
14
+ *
15
+ * Step 1 asks for the record and its base price and saves both as one unit, with the product in
16
+ * Draft. Step 2 shows the GL accounts the saved product books to (inherited from its category,
17
+ * product type or company where it has none of its own), lets the user link one for any role that has
18
+ * none, then activates it after the same readiness check the product header runs.
19
+ *
20
+ * Closing after step 1 leaves a Draft product with its price, which the product form's Draft banner
21
+ * picks up. `Created` fires once the product exists, with its ID, whether or not it was activated.
22
+ *
23
+ * ## Example
24
+ *
25
+ * ```html
26
+ * <mjo-new-product-dialog [Visible]="open" (Created)="openProduct($event)" (Closed)="open = false" />
27
+ * ```
28
+ */
29
+ export declare class MJONewProductDialogComponent implements OnChanges {
30
+ private readonly cdr;
31
+ Visible: boolean;
32
+ /** The saved product's ID, once step 1 has saved it. */
33
+ Created: EventEmitter<string>;
34
+ Closed: EventEmitter<void>;
35
+ private effective?;
36
+ Step: Step;
37
+ Draft: NewProductDraft;
38
+ Product: mjBizAppsOrdersProductEntity | null;
39
+ Companies: Option[];
40
+ Categories: Option[];
41
+ Types: Option[];
42
+ RevenueRecognitionTypes: Option[];
43
+ Errors: string[];
44
+ /** What the readiness check found missing, shown before the user activates anyway. */
45
+ Missing: string[];
46
+ Busy: boolean;
47
+ private typeDefaults;
48
+ private lookupsLoaded;
49
+ ngOnChanges(changes: SimpleChanges): Promise<void>;
50
+ OnTypeChanged(typeID: string): void;
51
+ /** Step 1: saves the product and its base price as one unit, in Draft, then moves to step 2. */
52
+ SaveDetails(): Promise<void>;
53
+ /** A link was added or changed: the inherited accounts and any earlier check are now stale. */
54
+ OnLinksChanged(): void;
55
+ /**
56
+ * Step 2: activates the product. Without `anyway`, runs the readiness check first and stops to
57
+ * list what is missing; the user can then link accounts, or activate anyway (golive#433's rule).
58
+ */
59
+ Activate(anyway: boolean): Promise<void>;
60
+ Close(): void;
61
+ private reset;
62
+ private loadLookups;
63
+ static ɵfac: i0.ɵɵFactoryDeclaration<MJONewProductDialogComponent, never>;
64
+ static ɵcmp: i0.ɵɵComponentDeclaration<MJONewProductDialogComponent, "mjo-new-product-dialog", never, { "Visible": { "alias": "Visible"; "required": false; }; }, { "Created": "Created"; "Closed": "Closed"; }, never, never, true, never>;
65
+ }
66
+ export {};
67
+ //# sourceMappingURL=new-product-dialog.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"new-product-dialog.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/pages/catalog/new-product-dialog.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,YAAY,EAAS,SAAS,EAAU,aAAa,EAAqB,MAAM,eAAe,CAAC;AAKvI,OAAO,EAAuB,KAAK,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AAOtG,OAAO,EAKH,KAAK,eAAe,EACvB,MAAM,qBAAqB,CAAC;;AAE7B,8BAA8B;AAC9B,UAAU,MAAM;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,2CAA2C;AAC3C,KAAK,IAAI,GAAG,SAAS,GAAG,UAAU,CAAC;AAInC;;;;;;;;;;;;;;;;GAgBG;AACH,qBAyJa,4BAA6B,YAAW,SAAS;IAC1D,OAAO,CAAC,QAAQ,CAAC,GAAG,CAA6B;IAExC,OAAO,UAAS;IACzB,wDAAwD;IAC9C,OAAO,uBAA8B;IACrC,MAAM,qBAA4B;IAEpB,OAAO,CAAC,SAAS,CAAC,CAA6C;IAEhF,IAAI,EAAE,IAAI,CAAa;IACvB,KAAK,EAAE,eAAe,CAAiC;IACvD,OAAO,EAAE,4BAA4B,GAAG,IAAI,CAAQ;IACpD,SAAS,EAAE,MAAM,EAAE,CAAM;IACzB,UAAU,EAAE,MAAM,EAAE,CAAM;IAC1B,KAAK,EAAE,MAAM,EAAE,CAAM;IACrB,uBAAuB,EAAE,MAAM,EAAE,CAAM;IACvC,MAAM,EAAE,MAAM,EAAE,CAAM;IAC7B,sFAAsF;IAC/E,OAAO,EAAE,MAAM,EAAE,CAAM;IACvB,IAAI,UAAS;IAEpB,OAAO,CAAC,YAAY,CAAwE;IAC5F,OAAO,CAAC,aAAa,CAAS;IAEjB,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAOxD,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAK1C,gGAAgG;IACnF,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAsBzC,+FAA+F;IACxF,cAAc,IAAI,IAAI;IAK7B;;;OAGG;IACU,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAwB9C,KAAK,IAAI,IAAI;IAIpB,OAAO,CAAC,KAAK;YAQC,WAAW;yCA1GhB,4BAA4B;2CAA5B,4BAA4B;CAwHxC"}