spotcharge-types 1.0.358 → 1.0.360

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 (78) hide show
  1. package/dist/consts/index.d.ts +1 -0
  2. package/dist/consts/index.d.ts.map +1 -1
  3. package/dist/consts/index.js +5 -1
  4. package/dist/consts/index.js.map +1 -1
  5. package/dist/consts/permission-config.d.ts +16 -0
  6. package/dist/consts/permission-config.d.ts.map +1 -1
  7. package/dist/consts/permission-config.js +16 -0
  8. package/dist/consts/permission-config.js.map +1 -1
  9. package/dist/consts/pricing/index.d.ts +4 -0
  10. package/dist/consts/pricing/index.d.ts.map +1 -0
  11. package/dist/consts/pricing/index.js +20 -0
  12. package/dist/consts/pricing/index.js.map +1 -0
  13. package/dist/consts/pricing/promotion-adjustment-type.const.d.ts +7 -0
  14. package/dist/consts/pricing/promotion-adjustment-type.const.d.ts.map +1 -0
  15. package/dist/consts/pricing/promotion-adjustment-type.const.js +9 -0
  16. package/dist/consts/pricing/promotion-adjustment-type.const.js.map +1 -0
  17. package/dist/consts/pricing/promotion-applies-to.const.d.ts +7 -0
  18. package/dist/consts/pricing/promotion-applies-to.const.d.ts.map +1 -0
  19. package/dist/consts/pricing/promotion-applies-to.const.js +9 -0
  20. package/dist/consts/pricing/promotion-applies-to.const.js.map +1 -0
  21. package/dist/consts/pricing/promotion-scope-type.const.d.ts +8 -0
  22. package/dist/consts/pricing/promotion-scope-type.const.d.ts.map +1 -0
  23. package/dist/consts/pricing/promotion-scope-type.const.js +10 -0
  24. package/dist/consts/pricing/promotion-scope-type.const.js.map +1 -0
  25. package/dist/enum/index.d.ts +1 -1
  26. package/dist/enum/index.d.ts.map +1 -1
  27. package/dist/enum/index.js +5 -2
  28. package/dist/enum/index.js.map +1 -1
  29. package/dist/enum/pricing/index.d.ts +1 -0
  30. package/dist/enum/pricing/index.d.ts.map +1 -1
  31. package/dist/enum/pricing/index.js +5 -1
  32. package/dist/enum/pricing/index.js.map +1 -1
  33. package/dist/enum/pricing/promotion-adjustment-type.enum.d.ts +6 -0
  34. package/dist/enum/pricing/promotion-adjustment-type.enum.d.ts.map +1 -0
  35. package/dist/enum/pricing/promotion-adjustment-type.enum.js +10 -0
  36. package/dist/enum/pricing/promotion-adjustment-type.enum.js.map +1 -0
  37. package/dist/enum/pricing/promotion-applies-to.enum.d.ts +6 -0
  38. package/dist/enum/pricing/promotion-applies-to.enum.d.ts.map +1 -0
  39. package/dist/enum/pricing/promotion-applies-to.enum.js +10 -0
  40. package/dist/enum/pricing/promotion-applies-to.enum.js.map +1 -0
  41. package/dist/enum/pricing/promotion-scope-type.enum.d.ts +7 -0
  42. package/dist/enum/pricing/promotion-scope-type.enum.d.ts.map +1 -0
  43. package/dist/enum/pricing/promotion-scope-type.enum.js +11 -0
  44. package/dist/enum/pricing/promotion-scope-type.enum.js.map +1 -0
  45. package/dist/models/api/chargers/charger.api.model.d.ts +3 -4
  46. package/dist/models/api/chargers/charger.api.model.d.ts.map +1 -1
  47. package/dist/models/api/connector.api.model.d.ts +0 -2
  48. package/dist/models/api/connector.api.model.d.ts.map +1 -1
  49. package/dist/models/api/index.d.ts +1 -0
  50. package/dist/models/api/index.d.ts.map +1 -1
  51. package/dist/models/api/index.js.map +1 -1
  52. package/dist/models/api/pricing/promotion.api.model.d.ts +75 -0
  53. package/dist/models/api/pricing/promotion.api.model.d.ts.map +1 -0
  54. package/dist/models/api/pricing/promotion.api.model.js +3 -0
  55. package/dist/models/api/pricing/promotion.api.model.js.map +1 -0
  56. package/dist/models/connector.model.d.ts +0 -1
  57. package/dist/models/connector.model.d.ts.map +1 -1
  58. package/dist/models/index.d.ts +1 -1
  59. package/dist/models/index.d.ts.map +1 -1
  60. package/dist/models/resolved-tariff.model.d.ts +26 -3
  61. package/dist/models/resolved-tariff.model.d.ts.map +1 -1
  62. package/package.json +2 -1
  63. package/src/consts/index.ts +6 -1
  64. package/src/consts/permission-config.ts +16 -0
  65. package/src/consts/pricing/index.ts +3 -0
  66. package/src/consts/pricing/promotion-adjustment-type.const.ts +8 -0
  67. package/src/consts/pricing/promotion-applies-to.const.ts +8 -0
  68. package/src/consts/pricing/promotion-scope-type.const.ts +9 -0
  69. package/src/enum/index.ts +3 -0
  70. package/src/enum/pricing/index.ts +5 -0
  71. package/src/models/api/chargers/charger.api.model.ts +3 -4
  72. package/src/models/api/connector.api.model.ts +0 -2
  73. package/src/models/api/index.ts +9 -0
  74. package/src/models/api/pricing/promotion.api.model.ts +88 -0
  75. package/src/models/connector.model.ts +0 -1
  76. package/src/models/index.ts +5 -1
  77. package/src/models/resolved-tariff.model.ts +35 -10
  78. package/sync-types-to-repos.sh +109 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAuGA,mCAA+C;AAAvC,2GAAA,mBAAmB,OAAA;AAoE3B,mGAQ4D;AAH1D,uIAAA,uBAAuB,OAAA;AAKzB,yEAA2J;AAA3H,0IAAA,6BAA6B,OAAA;AAAE,4IAAA,+BAA+B,OAAA;AAAE,mIAAA,sBAAsB,OAAA;AACtH,2FASuD;AADrD,iIAAA,oBAAoB,OAAA;AAEtB,8HAc8E;AAT5E,wJAAA,+BAA+B,OAAA;AAC/B,iJAAA,wBAAwB,OAAA;AACxB,yJAAA,gCAAgC,OAAA;AAChC,6IAAA,oBAAoB,OAAA;AACpB,+IAAA,sBAAsB,OAAA;AACtB,sJAAA,6BAA6B,OAAA;AAO/B,qCAQmB;AAHjB,8HAAA,mCAAmC,OAAA;AAIrC,iCAIiB;AAHf,wGAAA,eAAe,OAAA;AAIjB,0CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAuGA,mCAA+C;AAAvC,2GAAA,mBAAmB,OAAA;AA6E3B,mGAQ4D;AAH1D,uIAAA,uBAAuB,OAAA;AAKzB,yEAA2J;AAA3H,0IAAA,6BAA6B,OAAA;AAAE,4IAAA,+BAA+B,OAAA;AAAE,mIAAA,sBAAsB,OAAA;AACtH,2FASuD;AADrD,iIAAA,oBAAoB,OAAA;AAEtB,8HAc8E;AAT5E,wJAAA,+BAA+B,OAAA;AAC/B,iJAAA,wBAAwB,OAAA;AACxB,yJAAA,gCAAgC,OAAA;AAChC,6IAAA,oBAAoB,OAAA;AACpB,+IAAA,sBAAsB,OAAA;AACtB,sJAAA,6BAA6B,OAAA;AAO/B,qCAQmB;AAHjB,8HAAA,mCAAmC,OAAA;AAIrC,iCAIiB;AAHf,wGAAA,eAAe,OAAA;AAIjB,0CAAwB"}
@@ -0,0 +1,75 @@
1
+ import { ConnectorOutputType, PromotionAdjustmentType, PromotionAppliesTo, PromotionScopeType } from '../../../enum/pricing';
2
+ import { AuditActor } from '../../audit-actor.model';
3
+ import { AuditTimestampsApiModel, IsoDateTime } from '../users/shared.api.model';
4
+ import { ApiSortDirection } from '../users/admin-user.api.model';
5
+ export interface PromotionAdjustmentApiModel {
6
+ type: PromotionAdjustmentType;
7
+ value: number;
8
+ }
9
+ /** GET /api/promotions */
10
+ export type PromotionListOrderBy = 'validFrom' | 'createdAt' | 'name';
11
+ export interface PromotionListItemApiModel {
12
+ id: string;
13
+ name: string;
14
+ label: string | null;
15
+ scopeType: PromotionScopeType;
16
+ stationId: string | null;
17
+ stationName: string | null;
18
+ chargerId: string | null;
19
+ connectorId: string | null;
20
+ outputType: ConnectorOutputType | null;
21
+ appliesTo: PromotionAppliesTo;
22
+ energyAdjustment: PromotionAdjustmentApiModel | null;
23
+ sessionAdjustment: PromotionAdjustmentApiModel | null;
24
+ validFrom: IsoDateTime;
25
+ validTo: IsoDateTime | null;
26
+ priority: number;
27
+ isActive: boolean;
28
+ createdAt: IsoDateTime;
29
+ }
30
+ export interface PromotionListApiModel {
31
+ rows: PromotionListItemApiModel[];
32
+ totalCount: number;
33
+ pageIndex: number;
34
+ pageSize: number;
35
+ orderBy: PromotionListOrderBy;
36
+ sortDirection: ApiSortDirection;
37
+ }
38
+ export interface PromotionDetailApiModel extends PromotionListItemApiModel, AuditTimestampsApiModel {
39
+ isDeleted: boolean;
40
+ createdBy: AuditActor | null;
41
+ updatedBy: AuditActor | null;
42
+ deletedBy: AuditActor | null;
43
+ }
44
+ export interface CreatePromotionRequest {
45
+ name: string;
46
+ label?: string | null;
47
+ scopeType: PromotionScopeType;
48
+ stationId?: string | null;
49
+ chargerId?: string | null;
50
+ connectorId?: string | null;
51
+ outputType?: ConnectorOutputType | null;
52
+ appliesTo: PromotionAppliesTo;
53
+ energyAdjustment?: PromotionAdjustmentApiModel | null;
54
+ sessionAdjustment?: PromotionAdjustmentApiModel | null;
55
+ validFrom?: IsoDateTime;
56
+ validTo?: IsoDateTime | null;
57
+ priority?: number;
58
+ isActive?: boolean;
59
+ }
60
+ export interface UpdatePromotionRequest {
61
+ name?: string;
62
+ label?: string | null;
63
+ stationId?: string | null;
64
+ chargerId?: string | null;
65
+ connectorId?: string | null;
66
+ outputType?: ConnectorOutputType | null;
67
+ appliesTo?: PromotionAppliesTo;
68
+ energyAdjustment?: PromotionAdjustmentApiModel | null;
69
+ sessionAdjustment?: PromotionAdjustmentApiModel | null;
70
+ validFrom?: IsoDateTime;
71
+ validTo?: IsoDateTime | null;
72
+ priority?: number;
73
+ isActive?: boolean;
74
+ }
75
+ //# sourceMappingURL=promotion.api.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promotion.api.model.d.ts","sourceRoot":"","sources":["../../../../src/models/api/pricing/promotion.api.model.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACjF,OAAO,EAAE,gBAAgB,E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OAAO,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=promotion.api.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promotion.api.model.js","sourceRoot":"","sources":["../../../../src/models/api/pricing/promotion.api.model.ts"],"names":[],"mappings":""}
@@ -5,7 +5,6 @@ export interface ConnectorModel {
5
5
  name: number;
6
6
  status: ConnectorStatus;
7
7
  capacity: string | ChargerCapacity;
8
- unitRate: number;
9
8
  type: ConnectorTypeModel;
10
9
  }
11
10
  //# sourceMappingURL=connector.model.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connector.model.d.ts","sourceRoot":"","sources":["../../src/models/connector.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,SAAS,CAAC;AACxC,OAAO,EAAC,eAAe,EAAC,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAC,kBAAkB,EAAC,MAAM,wBAAwB,CAAC;AAE1D,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,EAAE,MAAM,GAAG,eAAe,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,kBAAkB,CAAC;CAC5B"}
1
+ {"version":3,"file":"connector.model.d.ts","sourceRoot":"","sources":["../../src/models/connector.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,SAAS,CAAC;AACxC,OAAO,EAAC,eAAe,EAAC,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAC,kBAAkB,EAAC,MAAM,wBAAwB,CAAC;AAE1D,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,EAAE,MAAM,GAAG,eAAe,CAAC;IACnC,IAAI,EAAE,kBAAkB,CAAC;CAC5B"}
@@ -27,6 +27,6 @@ export { RoleDescriptor } from './role-descriptor.model';
27
27
  export { AdminSessionModel } from './admin-session.model';
28
28
  export { ApiErrorResponse } from './api-error-response.model';
29
29
  export { TaxType, TaxConfigModel, InvoiceTaxModel } from './tax-config.model';
30
- export { ResolvedTariff } from './resolved-tariff.model';
30
+ export { ResolvedTariff, ResolvedPromotionSnapshot, ResolvedPromotionAdjustment, } from './resolved-tariff.model';
31
31
  export { RevenueSnapshot } from './revenue-snapshot.model';
32
32
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AAEtB,OAAO,EAAC,SAAS,EAAE,YAAY,EAAE,WAAW,EAAC,MAAM,cAAc,CAAC;AAClE,OAAO,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,eAAe,EAAC,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAg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AC,iBAAiB,EAAC,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAC,gBAAgB,EAAC,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAC,OAAO,EAAE,cAAc,EAAE,eAAe,EAAC,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EACL,cAAc,EACd,yBAAyB,EACzB,2BAA2B,GAC5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,eAAe,EAAC,MAAM,0BAA0B,CAAC"}
@@ -1,16 +1,39 @@
1
+ import { PromotionAdjustmentType, PromotionAppliesTo } from "../enum/pricing";
1
2
  import { TariffScope } from "../enum/tariff-scope.enum";
2
3
  import { Timestamp } from "./timestamp";
3
4
  import { RateDuration } from "./rate-duration.model";
5
+ export interface ResolvedPromotionAdjustment {
6
+ type: PromotionAdjustmentType;
7
+ value: number;
8
+ }
9
+ export interface ResolvedPromotionSnapshot {
10
+ id: string;
11
+ name: string;
12
+ label?: string | null;
13
+ appliesTo: PromotionAppliesTo;
14
+ energyAdjustment?: ResolvedPromotionAdjustment;
15
+ sessionAdjustment?: ResolvedPromotionAdjustment;
16
+ }
4
17
  export interface ResolvedTariff {
5
- tariffId: string | null;
18
+ tariffId: string;
6
19
  tariffName: string;
7
- assignmentId: string | null;
8
- scope: TariffScope | 'connector_override';
20
+ assignmentId: string;
21
+ scope: TariffScope;
22
+ /** Effective billable ₹/kWh after promotion. */
9
23
  energyRate: number;
24
+ /** Effective session fee after promotion. */
10
25
  serviceCharge?: {
11
26
  rate: number;
12
27
  rateDuration: RateDuration;
13
28
  } | null;
29
+ /** Base tariff ₹/kWh before promotion (strike-through). */
30
+ referenceEnergyRate?: number;
31
+ /** Base session fee before promotion (strike-through). */
32
+ referenceServiceCharge?: {
33
+ rate: number;
34
+ rateDuration: RateDuration;
35
+ } | null;
36
+ promotion?: ResolvedPromotionSnapshot | null;
14
37
  resolvedAt: Timestamp;
15
38
  }
16
39
  //# sourceMappingURL=resolved-tariff.model.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolved-tariff.model.d.ts","sourceRoot":"","sources":["../../src/models/resolved-tariff.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAEnD,MAAM,WAAW,cAAc;IAC3B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,KAAK,EAAE,WAAW,GAAG,oBAAoB,CAAC;IAC1C,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,YAAY,EAAE,YAAY,CAAC;KAC9B,GAAG,IAAI,CAAC;IACT,UAAU,EAAE,SAAS,CAAC;CACzB"}
1
+ {"version":3,"file":"resolved-tariff.model.d.ts","sourceRoot":"","sources":["../../src/models/resolved-tariff.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,uBAAuB,EAAE,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAC,WAAW,EAAC,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAEnD,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,uBAAuB,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,yBAAyB;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,EAAE,kBAAkB,CAAC;IAC9B,gBAAgB,CAAC,EAAE,2BAA2B,CAAC;IAC/C,iBAAiB,CAAC,EAAE,2BAA2B,CAAC;CACjD;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,WAAW,CAAC;IACnB,gDAAgD;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,aAAa,CAAC,EAAE;QACd,IAAI,EAAE,MAAM,CAAC;QACb,YAAY,EAAE,YAAY,CAAC;KAC5B,GAAG,IAAI,CAAC;IACT,2DAA2D;IAC3D,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,0DAA0D;IAC1D,sBAAsB,CAAC,EAAE;QACvB,IAAI,EAAE,MAAM,CAAC;QACb,YAAY,EAAE,YAAY,CAAC;KAC5B,GAAG,IAAI,CAAC;IACT,SAAS,CAAC,EAAE,yBAAyB,GAAG,IAAI,CAAC;IAC7C,UAAU,EAAE,SAAS,CAAC;CACvB"}
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "spotcharge-types",
3
- "version": "1.0.358",
3
+ "version": "1.0.360",
4
4
  "description": "Spotcharge typesn",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "scripts": {
8
8
  "start": "tsc",
9
+ "sync-repos": "bash ./sync-types-to-repos.sh",
9
10
  "test": "echo \"Error: no test specified\" && exit 1",
10
11
  "release": "bash ./publish_git.sh"
11
12
  },
@@ -3,4 +3,9 @@ export {InOutStatusType, InOutStatus} from './in-out-status.const';
3
3
  export {InOutType, InOutKeys} from './in-out-type.const';
4
4
  export {VehicleInspectionChecklist, VehicleInspectionChecklistType} from './vehicle-inspection-check-list.const';
5
5
  export {Notifications, NotificationType} from './notifications.const';
6
- export {permissionConfig, Permission, PermissionKeys} from './permission-config';
6
+ export {permissionConfig, Permission, PermissionKeys} from './permission-config';
7
+ export {
8
+ PromotionAdjustmentType,
9
+ PromotionAppliesTo,
10
+ PromotionScopeType,
11
+ } from './pricing';
@@ -771,6 +771,22 @@ export const permissionConfig = {
771
771
  key: 'DELETE_TARIFF_ASSIGNMENT',
772
772
  formattedPermission: 'Can Delete Tariff Assignment',
773
773
  },
774
+ 'LIST_PROMOTIONS': {
775
+ key: 'LIST_PROMOTIONS',
776
+ formattedPermission: 'Can View Promotion List',
777
+ },
778
+ 'ADD_PROMOTION': {
779
+ key: 'ADD_PROMOTION',
780
+ formattedPermission: 'Can Add Promotion',
781
+ },
782
+ 'EDIT_PROMOTION': {
783
+ key: 'EDIT_PROMOTION',
784
+ formattedPermission: 'Can Edit Promotion',
785
+ },
786
+ 'DELETE_PROMOTION': {
787
+ key: 'DELETE_PROMOTION',
788
+ formattedPermission: 'Can Delete Promotion',
789
+ },
774
790
  'LIST_COMPANIES': {
775
791
  key: 'LIST_COMPANIES',
776
792
  formattedPermission: 'Can View Company List',
@@ -0,0 +1,3 @@
1
+ export * from './promotion-adjustment-type.const';
2
+ export * from './promotion-applies-to.const';
3
+ export * from './promotion-scope-type.const';
@@ -0,0 +1,8 @@
1
+ export const PromotionAdjustmentType = {
2
+ SetPrice: 'set_price',
3
+ AmountOff: 'amount_off',
4
+ PercentOff: 'percent_off',
5
+ } as const;
6
+
7
+ export type PromotionAdjustmentType =
8
+ (typeof PromotionAdjustmentType)[keyof typeof PromotionAdjustmentType];
@@ -0,0 +1,8 @@
1
+ export const PromotionAppliesTo = {
2
+ Energy: 'energy',
3
+ Session: 'session',
4
+ Both: 'both',
5
+ } as const;
6
+
7
+ export type PromotionAppliesTo =
8
+ (typeof PromotionAppliesTo)[keyof typeof PromotionAppliesTo];
@@ -0,0 +1,9 @@
1
+ export const PromotionScopeType = {
2
+ Global: 'global',
3
+ Station: 'station',
4
+ Charger: 'charger',
5
+ Connector: 'connector',
6
+ } as const;
7
+
8
+ export type PromotionScopeType =
9
+ (typeof PromotionScopeType)[keyof typeof PromotionScopeType];
package/src/enum/index.ts CHANGED
@@ -46,6 +46,9 @@ export {
46
46
  RateDurationUnit,
47
47
  TariffRuleType,
48
48
  ConnectorOutputType,
49
+ PromotionAdjustmentType,
50
+ PromotionScopeType,
51
+ PromotionAppliesTo,
49
52
  } from './pricing';
50
53
  export {CompanyType} from './company-type.enum';
51
54
  export {CompanyStatus} from './company-status.enum';
@@ -3,3 +3,8 @@ export {FeeUnit} from './fee-unit.enum';
3
3
  export {RateDurationUnit} from './rate-duration-unit.enum';
4
4
  export {TariffRuleType} from './tariff-rule-type.enum';
5
5
  export {ConnectorOutputType} from './connector-output-type.enum';
6
+ export {
7
+ PromotionAdjustmentType,
8
+ PromotionScopeType,
9
+ PromotionAppliesTo,
10
+ } from '../../consts/pricing';
@@ -9,6 +9,7 @@ import {
9
9
  SessionEligibility,
10
10
  } from '../../../enum';
11
11
  import { AuditActor } from '../../audit-actor.model';
12
+ import { ResolvedTariff } from '../../resolved-tariff.model';
12
13
  import { ApiSortDirection } from '../users/admin-user.api.model';
13
14
  import { AuditTimestampsApiModel, IsoDateTime } from '../users/shared.api.model';
14
15
 
@@ -39,9 +40,9 @@ export interface ConnectorApiModel {
39
40
  qrCodeId: string | null;
40
41
  isActive: boolean;
41
42
  ocppStatus: ConnectorStatus;
42
- unitRate: string | null;
43
- isManualPricing: boolean;
44
43
  lastStatusAt: IsoDateTime | null;
44
+ /** Resolved tariff with optional promotion snapshot (admin/portal detail). */
45
+ appliedPrice?: ResolvedTariff;
45
46
  }
46
47
 
47
48
  /** Shared slim charger fields across list/detail/picker DTOs. */
@@ -139,8 +140,6 @@ export interface CreateConnectorRequest {
139
140
  name?: string | null;
140
141
  qrCodeId?: string | null;
141
142
  isActive?: boolean;
142
- unitRate?: number | string | null;
143
- isManualPricing?: boolean;
144
143
  }
145
144
 
146
145
  /** POST /api/admin/chargers */
@@ -11,8 +11,6 @@ export interface ConnectorApiModel {
11
11
  outputType: "AC" | "DC"; // Clearly AC or DC — easy to filter & use
12
12
 
13
13
  capacity: string; // reference to charger capacity document ID
14
- unitRate: number;
15
- isManualPricing?: boolean; // true = use unitRate directly, false/undefined = use tariff resolution
16
14
  status: ConnectorStatus; // Current connector status
17
15
 
18
16
  qrCodeId?: string; // Stable QR code identifier (nanoid), immutable after creation
@@ -145,6 +145,15 @@ export {
145
145
  CreateTariffRuleRequest,
146
146
  UpdateTariffRuleRequest,
147
147
  } from './pricing/pricing.api.model';
148
+ export {
149
+ PromotionAdjustmentApiModel,
150
+ PromotionListOrderBy,
151
+ PromotionListItemApiModel,
152
+ PromotionListApiModel,
153
+ PromotionDetailApiModel,
154
+ CreatePromotionRequest,
155
+ UpdatePromotionRequest,
156
+ } from './pricing/promotion.api.model';
148
157
  export {CompanyApiModel} from './company.api.model';
149
158
  export {
150
159
  CompanyDetailApiModel,
@@ -0,0 +1,88 @@
1
+ import {
2
+ ConnectorOutputType,
3
+ PromotionAdjustmentType,
4
+ PromotionAppliesTo,
5
+ PromotionScopeType,
6
+ } from '../../../enum/pricing';
7
+ import { AuditActor } from '../../audit-actor.model';
8
+ import { AuditTimestampsApiModel, IsoDateTime } from '../users/shared.api.model';
9
+ import { ApiSortDirection } from '../users/admin-user.api.model';
10
+
11
+ export interface PromotionAdjustmentApiModel {
12
+ type: PromotionAdjustmentType;
13
+ value: number;
14
+ }
15
+
16
+ /** GET /api/promotions */
17
+ export type PromotionListOrderBy = 'validFrom' | 'createdAt' | 'name';
18
+
19
+ export interface PromotionListItemApiModel {
20
+ id: string;
21
+ name: string;
22
+ label: string | null;
23
+ scopeType: PromotionScopeType;
24
+ stationId: string | null;
25
+ stationName: string | null;
26
+ chargerId: string | null;
27
+ connectorId: string | null;
28
+ outputType: ConnectorOutputType | null;
29
+ appliesTo: PromotionAppliesTo;
30
+ energyAdjustment: PromotionAdjustmentApiModel | null;
31
+ sessionAdjustment: PromotionAdjustmentApiModel | null;
32
+ validFrom: IsoDateTime;
33
+ validTo: IsoDateTime | null;
34
+ priority: number;
35
+ isActive: boolean;
36
+ createdAt: IsoDateTime;
37
+ }
38
+
39
+ export interface PromotionListApiModel {
40
+ rows: PromotionListItemApiModel[];
41
+ totalCount: number;
42
+ pageIndex: number;
43
+ pageSize: number;
44
+ orderBy: PromotionListOrderBy;
45
+ sortDirection: ApiSortDirection;
46
+ }
47
+
48
+ export interface PromotionDetailApiModel
49
+ extends PromotionListItemApiModel,
50
+ AuditTimestampsApiModel {
51
+ isDeleted: boolean;
52
+ createdBy: AuditActor | null;
53
+ updatedBy: AuditActor | null;
54
+ deletedBy: AuditActor | null;
55
+ }
56
+
57
+ export interface CreatePromotionRequest {
58
+ name: string;
59
+ label?: string | null;
60
+ scopeType: PromotionScopeType;
61
+ stationId?: string | null;
62
+ chargerId?: string | null;
63
+ connectorId?: string | null;
64
+ outputType?: ConnectorOutputType | null;
65
+ appliesTo: PromotionAppliesTo;
66
+ energyAdjustment?: PromotionAdjustmentApiModel | null;
67
+ sessionAdjustment?: PromotionAdjustmentApiModel | null;
68
+ validFrom?: IsoDateTime;
69
+ validTo?: IsoDateTime | null;
70
+ priority?: number;
71
+ isActive?: boolean;
72
+ }
73
+
74
+ export interface UpdatePromotionRequest {
75
+ name?: string;
76
+ label?: string | null;
77
+ stationId?: string | null;
78
+ chargerId?: string | null;
79
+ connectorId?: string | null;
80
+ outputType?: ConnectorOutputType | null;
81
+ appliesTo?: PromotionAppliesTo;
82
+ energyAdjustment?: PromotionAdjustmentApiModel | null;
83
+ sessionAdjustment?: PromotionAdjustmentApiModel | null;
84
+ validFrom?: IsoDateTime;
85
+ validTo?: IsoDateTime | null;
86
+ priority?: number;
87
+ isActive?: boolean;
88
+ }
@@ -6,6 +6,5 @@ export interface ConnectorModel {
6
6
  name: number;
7
7
  status: ConnectorStatus;
8
8
  capacity: string | ChargerCapacity;
9
- unitRate: number;
10
9
  type: ConnectorTypeModel;
11
10
  }
@@ -28,5 +28,9 @@ export {RoleDescriptor} from './role-descriptor.model';
28
28
  export {AdminSessionModel} from './admin-session.model';
29
29
  export {ApiErrorResponse} from './api-error-response.model';
30
30
  export {TaxType, TaxConfigModel, InvoiceTaxModel} from './tax-config.model';
31
- export {ResolvedTariff} from './resolved-tariff.model';
31
+ export {
32
+ ResolvedTariff,
33
+ ResolvedPromotionSnapshot,
34
+ ResolvedPromotionAdjustment,
35
+ } from './resolved-tariff.model';
32
36
  export {RevenueSnapshot} from './revenue-snapshot.model';
@@ -1,16 +1,41 @@
1
+ import {PromotionAdjustmentType, PromotionAppliesTo} from "../enum/pricing";
1
2
  import {TariffScope} from "../enum/tariff-scope.enum";
2
3
  import {Timestamp} from "./timestamp";
3
4
  import {RateDuration} from "./rate-duration.model";
4
5
 
6
+ export interface ResolvedPromotionAdjustment {
7
+ type: PromotionAdjustmentType;
8
+ value: number;
9
+ }
10
+
11
+ export interface ResolvedPromotionSnapshot {
12
+ id: string;
13
+ name: string;
14
+ label?: string | null;
15
+ appliesTo: PromotionAppliesTo;
16
+ energyAdjustment?: ResolvedPromotionAdjustment;
17
+ sessionAdjustment?: ResolvedPromotionAdjustment;
18
+ }
19
+
5
20
  export interface ResolvedTariff {
6
- tariffId: string | null; // null if connector override was used
7
- tariffName: string;
8
- assignmentId: string | null; // null if connector override
9
- scope: TariffScope | 'connector_override';
10
- energyRate: number; // effective ₹/kWh
11
- serviceCharge?: {
12
- rate: number;
13
- rateDuration: RateDuration;
14
- } | null;
15
- resolvedAt: Timestamp;
21
+ tariffId: string;
22
+ tariffName: string;
23
+ assignmentId: string;
24
+ scope: TariffScope;
25
+ /** Effective billable ₹/kWh after promotion. */
26
+ energyRate: number;
27
+ /** Effective session fee after promotion. */
28
+ serviceCharge?: {
29
+ rate: number;
30
+ rateDuration: RateDuration;
31
+ } | null;
32
+ /** Base tariff ₹/kWh before promotion (strike-through). */
33
+ referenceEnergyRate?: number;
34
+ /** Base session fee before promotion (strike-through). */
35
+ referenceServiceCharge?: {
36
+ rate: number;
37
+ rateDuration: RateDuration;
38
+ } | null;
39
+ promotion?: ResolvedPromotionSnapshot | null;
40
+ resolvedAt: Timestamp;
16
41
  }
@@ -0,0 +1,109 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # Build local spotcharge-types and reinstall it into sibling project node_modules.
4
+ # Tries a normal npm install first; retries with --legacy-peer-deps on failure.
5
+ #
6
+ # Usage (from spotcharge-types):
7
+ # ./sync-types-to-repos.sh
8
+ # npm run sync-repos
9
+
10
+ set -u
11
+
12
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
13
+ TYPES_DIR="$SCRIPT_DIR"
14
+ PROJECTS_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
15
+ TYPES_VERSION="$(node -p "require('$TYPES_DIR/package.json').version")"
16
+ TYPES_SPEC="file:${TYPES_DIR}"
17
+
18
+ TARGETS=(
19
+ "spotcharge-node-ocpp"
20
+ "spotcharge.co.in_mobile-app"
21
+ "spotcharge-superadmin"
22
+ "spotcharge-superadmin/functions"
23
+ "spotcharge-fleet-mobile-app"
24
+ "spotcharge-client-portal"
25
+ "spotcharge-script"
26
+ "spotcharge-script/scripts"
27
+ )
28
+
29
+ RED='\033[0;31m'
30
+ GREEN='\033[0;32m'
31
+ YELLOW='\033[1;33m'
32
+ NC='\033[0m'
33
+
34
+ log() {
35
+ printf '%b\n' "$1"
36
+ }
37
+
38
+ fail() {
39
+ log "${RED}ERROR:${NC} $1"
40
+ exit 1
41
+ }
42
+
43
+ install_types_in() {
44
+ local project_dir="$1"
45
+ local label="$2"
46
+
47
+ if [[ ! -d "$project_dir" ]]; then
48
+ log "${YELLOW}SKIP${NC} $label — directory not found: $project_dir"
49
+ return 0
50
+ fi
51
+
52
+ if [[ ! -f "$project_dir/package.json" ]]; then
53
+ log "${YELLOW}SKIP${NC} $label — no package.json"
54
+ return 0
55
+ fi
56
+
57
+ log "\n${GREEN}==>${NC} $label"
58
+ cd "$project_dir" || fail "cannot cd to $project_dir"
59
+
60
+ if [[ -d node_modules/spotcharge-types ]]; then
61
+ log " removing node_modules/spotcharge-types"
62
+ rm -rf node_modules/spotcharge-types
63
+ fi
64
+
65
+ log " installing spotcharge-types@${TYPES_VERSION} (${TYPES_SPEC})"
66
+
67
+ if npm install "$TYPES_SPEC"; then
68
+ log " ${GREEN}ok${NC} (standard install)"
69
+ return 0
70
+ fi
71
+
72
+ log " ${YELLOW}retrying with --legacy-peer-deps${NC}"
73
+ if npm install --legacy-peer-deps "$TYPES_SPEC"; then
74
+ log " ${GREEN}ok${NC} (legacy peer deps)"
75
+ return 0
76
+ fi
77
+
78
+ log " ${RED}failed${NC} in $project_dir"
79
+ return 1
80
+ }
81
+
82
+ main() {
83
+ log "Building spotcharge-types@${TYPES_VERSION}..."
84
+ cd "$TYPES_DIR" || fail "cannot cd to $TYPES_DIR"
85
+ npm start || fail "types build failed (npm start)"
86
+
87
+ if [[ ! -f "$TYPES_DIR/dist/index.js" ]]; then
88
+ fail "build output missing: dist/index.js — run npm start in spotcharge-types first"
89
+ fi
90
+
91
+ local failed=0
92
+ local target rel_path project_dir label
93
+
94
+ for target in "${TARGETS[@]}"; do
95
+ rel_path="$target"
96
+ project_dir="$PROJECTS_ROOT/$rel_path"
97
+ label="$rel_path"
98
+ install_types_in "$project_dir" "$label" || failed=$((failed + 1))
99
+ done
100
+
101
+ log ""
102
+ if [[ "$failed" -gt 0 ]]; then
103
+ fail "$failed project(s) failed to install spotcharge-types"
104
+ fi
105
+
106
+ log "${GREEN}Done.${NC} spotcharge-types@${TYPES_VERSION} synced to all targets."
107
+ }
108
+
109
+ main "$@"