@decaf-ts/for-fabric 0.1.40 → 0.1.42

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 (142) hide show
  1. package/dist/for-fabric.cjs +1 -1
  2. package/dist/for-fabric.cjs.map +1 -1
  3. package/dist/for-fabric.js +1 -1
  4. package/dist/for-fabric.js.map +1 -1
  5. package/lib/cli-module.cjs +2 -1
  6. package/lib/cli-module.js.map +1 -1
  7. package/lib/client/FabricClientAdapter.cjs +7 -1
  8. package/lib/client/FabricClientAdapter.js.map +1 -1
  9. package/lib/contract/BatchContract.cjs +30 -0
  10. package/lib/contract/BatchContract.d.ts +5 -0
  11. package/lib/contract/BatchContract.js.map +1 -0
  12. package/lib/contract/ProductContract.cjs +1 -4
  13. package/lib/contract/ProductContract.d.ts +1 -1
  14. package/lib/contract/ProductContract.js.map +1 -1
  15. package/lib/contract/index.cjs +2 -0
  16. package/lib/contract/index.js.map +1 -1
  17. package/lib/contract/models/Audit.cjs +83 -0
  18. package/lib/contract/models/Audit.d.ts +12 -0
  19. package/lib/contract/models/Audit.js.map +1 -0
  20. package/lib/contract/models/BaseIdentifiedModel.cjs +37 -0
  21. package/lib/contract/models/BaseIdentifiedModel.d.ts +7 -0
  22. package/lib/contract/models/BaseIdentifiedModel.js.map +1 -0
  23. package/lib/contract/models/BaseModel.cjs +42 -0
  24. package/lib/contract/models/BaseModel.d.ts +7 -0
  25. package/lib/contract/models/BaseModel.js.map +1 -0
  26. package/lib/contract/models/Batch.cjs +174 -0
  27. package/lib/contract/models/Batch.d.ts +18 -0
  28. package/lib/contract/models/Batch.js.map +1 -0
  29. package/lib/contract/models/Leaflet.cjs +95 -0
  30. package/lib/contract/models/Leaflet.d.ts +12 -0
  31. package/lib/contract/models/Leaflet.js.map +1 -0
  32. package/lib/contract/models/LeafletFile.cjs +58 -0
  33. package/lib/contract/models/LeafletFile.d.ts +9 -0
  34. package/lib/contract/models/LeafletFile.js.map +1 -0
  35. package/lib/contract/models/Market.cjs +75 -0
  36. package/lib/contract/models/Market.d.ts +12 -0
  37. package/lib/contract/models/Market.js.map +1 -0
  38. package/lib/contract/models/Product.cjs +77 -0
  39. package/lib/contract/models/Product.d.ts +15 -0
  40. package/lib/contract/models/Product.js.map +1 -0
  41. package/lib/contract/models/ProductStrength.cjs +60 -0
  42. package/lib/contract/models/ProductStrength.d.ts +10 -0
  43. package/lib/contract/models/ProductStrength.js.map +1 -0
  44. package/lib/contract/models/constants.cjs +30 -0
  45. package/lib/contract/models/constants.d.ts +24 -0
  46. package/lib/contract/models/constants.js.map +1 -0
  47. package/lib/contract/models/decorators.cjs +54 -0
  48. package/lib/contract/models/decorators.d.ts +8 -0
  49. package/lib/contract/models/decorators.js.map +1 -0
  50. package/lib/contract/models/gtin.cjs +88 -0
  51. package/lib/contract/models/gtin.d.ts +8 -0
  52. package/lib/contract/models/gtin.js.map +1 -0
  53. package/lib/contracts/ContractAdapter.cjs +22 -25
  54. package/lib/contracts/ContractAdapter.d.ts +1 -7
  55. package/lib/contracts/ContractAdapter.js.map +1 -1
  56. package/lib/contracts/FabricContractPaginator.js.map +1 -1
  57. package/lib/contracts/FabricContractRepository.cjs +0 -46
  58. package/lib/contracts/FabricContractRepository.d.ts +1 -1
  59. package/lib/contracts/FabricContractRepository.js.map +1 -1
  60. package/lib/contracts/FabricContractSequence.cjs +93 -58
  61. package/lib/contracts/FabricContractSequence.d.ts +2 -2
  62. package/lib/contracts/FabricContractSequence.js.map +1 -1
  63. package/lib/contracts/crud/serialized-crud-contract.cjs +4 -1
  64. package/lib/contracts/crud/serialized-crud-contract.js.map +1 -1
  65. package/lib/contracts/index.cjs +0 -1
  66. package/lib/contracts/index.d.ts +0 -1
  67. package/lib/contracts/index.js.map +1 -1
  68. package/lib/esm/cli-module.js +2 -1
  69. package/lib/esm/cli-module.js.map +1 -1
  70. package/lib/esm/client/FabricClientAdapter.js +8 -2
  71. package/lib/esm/client/FabricClientAdapter.js.map +1 -1
  72. package/lib/esm/contract/BatchContract.d.ts +5 -0
  73. package/lib/esm/contract/BatchContract.js +27 -0
  74. package/lib/esm/contract/BatchContract.js.map +1 -0
  75. package/lib/esm/contract/ProductContract.d.ts +1 -1
  76. package/lib/esm/contract/ProductContract.js +1 -4
  77. package/lib/esm/contract/ProductContract.js.map +1 -1
  78. package/lib/esm/contract/index.js +2 -0
  79. package/lib/esm/contract/index.js.map +1 -1
  80. package/lib/esm/contract/models/Audit.d.ts +12 -0
  81. package/lib/esm/contract/models/Audit.js +80 -0
  82. package/lib/esm/contract/models/Audit.js.map +1 -0
  83. package/lib/esm/contract/models/BaseIdentifiedModel.d.ts +7 -0
  84. package/lib/esm/contract/models/BaseIdentifiedModel.js +34 -0
  85. package/lib/esm/contract/models/BaseIdentifiedModel.js.map +1 -0
  86. package/lib/esm/contract/models/BaseModel.d.ts +7 -0
  87. package/lib/esm/contract/models/BaseModel.js +39 -0
  88. package/lib/esm/contract/models/BaseModel.js.map +1 -0
  89. package/lib/esm/contract/models/Batch.d.ts +18 -0
  90. package/lib/esm/contract/models/Batch.js +171 -0
  91. package/lib/esm/contract/models/Batch.js.map +1 -0
  92. package/lib/esm/contract/models/Leaflet.d.ts +12 -0
  93. package/lib/esm/contract/models/Leaflet.js +92 -0
  94. package/lib/esm/contract/models/Leaflet.js.map +1 -0
  95. package/lib/esm/contract/models/LeafletFile.d.ts +9 -0
  96. package/lib/esm/contract/models/LeafletFile.js +55 -0
  97. package/lib/esm/contract/models/LeafletFile.js.map +1 -0
  98. package/lib/esm/contract/models/Market.d.ts +12 -0
  99. package/lib/esm/contract/models/Market.js +72 -0
  100. package/lib/esm/contract/models/Market.js.map +1 -0
  101. package/lib/esm/contract/models/Product.d.ts +15 -0
  102. package/lib/esm/contract/models/Product.js +74 -0
  103. package/lib/esm/contract/models/Product.js.map +1 -0
  104. package/lib/esm/contract/models/ProductStrength.d.ts +10 -0
  105. package/lib/esm/contract/models/ProductStrength.js +57 -0
  106. package/lib/esm/contract/models/ProductStrength.js.map +1 -0
  107. package/lib/esm/contract/models/constants.d.ts +24 -0
  108. package/lib/esm/contract/models/constants.js +27 -0
  109. package/lib/esm/contract/models/constants.js.map +1 -0
  110. package/lib/esm/contract/models/decorators.d.ts +8 -0
  111. package/lib/esm/contract/models/decorators.js +48 -0
  112. package/lib/esm/contract/models/decorators.js.map +1 -0
  113. package/lib/esm/contract/models/gtin.d.ts +8 -0
  114. package/lib/esm/contract/models/gtin.js +82 -0
  115. package/lib/esm/contract/models/gtin.js.map +1 -0
  116. package/lib/esm/contracts/ContractAdapter.d.ts +1 -7
  117. package/lib/esm/contracts/ContractAdapter.js +22 -25
  118. package/lib/esm/contracts/ContractAdapter.js.map +1 -1
  119. package/lib/esm/contracts/FabricContractPaginator.js.map +1 -1
  120. package/lib/esm/contracts/FabricContractRepository.d.ts +1 -1
  121. package/lib/esm/contracts/FabricContractRepository.js +1 -47
  122. package/lib/esm/contracts/FabricContractRepository.js.map +1 -1
  123. package/lib/esm/contracts/FabricContractSequence.d.ts +2 -2
  124. package/lib/esm/contracts/FabricContractSequence.js +93 -58
  125. package/lib/esm/contracts/FabricContractSequence.js.map +1 -1
  126. package/lib/esm/contracts/crud/serialized-crud-contract.js +4 -1
  127. package/lib/esm/contracts/crud/serialized-crud-contract.js.map +1 -1
  128. package/lib/esm/contracts/index.d.ts +0 -1
  129. package/lib/esm/contracts/index.js +0 -1
  130. package/lib/esm/contracts/index.js.map +1 -1
  131. package/lib/esm/shared/errors.d.ts +9 -0
  132. package/lib/esm/shared/errors.js +15 -0
  133. package/lib/esm/shared/errors.js.map +1 -1
  134. package/lib/esm/version.d.ts +1 -1
  135. package/lib/esm/version.js +1 -1
  136. package/lib/shared/errors.cjs +19 -1
  137. package/lib/shared/errors.d.ts +9 -0
  138. package/lib/shared/errors.js.map +1 -1
  139. package/lib/version.cjs +1 -1
  140. package/lib/version.d.ts +1 -1
  141. package/package.json +3 -2
  142. package/workdocs/assets/slogans.json +182 -0
@@ -1,10 +1,12 @@
1
1
  import { FabricCrudContract } from "./../contracts/crud/crud-contract.js";
2
2
  console.log(FabricCrudContract.name);
3
3
  import { ProductContract } from "./ProductContract.js";
4
+ import { BatchContract } from "./BatchContract.js";
4
5
  import { UserContract } from "./UserContract.js";
5
6
  import { AddressContract } from "./AddressContract.js";
6
7
  export const contracts = [
7
8
  ProductContract,
9
+ BatchContract,
8
10
  UserContract,
9
11
  AddressContract,
10
12
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/contract/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,6CAAwC;AACrE,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;AAErC,OAAO,EAAE,eAAe,EAAE,6BAA0B;AACpD,OAAO,EAAE,YAAY,EAAE,0BAAuB;AAC9C,OAAO,EAAE,eAAe,EAAE,6BAA0B;AAEpD,MAAM,CAAC,MAAM,SAAS,GAAwB;IAC5C,eAAe;IACf,YAAY;IACZ,eAAe;CAChB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/contract/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,6CAAwC;AACrE,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;AAErC,OAAO,EAAE,eAAe,EAAE,6BAA0B;AACpD,OAAO,EAAE,aAAa,EAAE,2BAAwB;AAChD,OAAO,EAAE,YAAY,EAAE,0BAAuB;AAC9C,OAAO,EAAE,eAAe,EAAE,6BAA0B;AAEpD,MAAM,CAAC,MAAM,SAAS,GAAwB;IAC5C,eAAe;IACf,aAAa;IACb,YAAY;IACZ,eAAe;CAChB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { type ModelArg } from "@decaf-ts/decorator-validation";
2
+ import { BaseModel } from "./BaseModel";
3
+ import { AuditOperations } from "./constants";
4
+ export declare class Audit extends BaseModel {
5
+ id: string;
6
+ userId: string;
7
+ userGroup: string;
8
+ transaction: string;
9
+ action: AuditOperations;
10
+ diffs?: Record<string, any>;
11
+ constructor(model?: ModelArg<Audit>);
12
+ }
@@ -0,0 +1,80 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { model, required, type, } from "@decaf-ts/decorator-validation";
11
+ import { BlockOperations, composed, OperationKeys, readonly, serialize, } from "@decaf-ts/db-decorators";
12
+ import { description, uses } from "@decaf-ts/decoration";
13
+ import { table, pk, createdBy, column, OrderDirection, index, } from "@decaf-ts/core";
14
+ import { BaseModel } from "./BaseModel.js";
15
+ import { AuditOperations } from "./constants.js";
16
+ import { FabricFlavour, transactionId } from "./../../shared/index.js";
17
+ let Audit = class Audit extends BaseModel {
18
+ constructor(model) {
19
+ super(model);
20
+ }
21
+ };
22
+ __decorate([
23
+ pk({ type: String, generated: false }),
24
+ composed(["transaction", "action", "diffs"], ":", false, true),
25
+ description("Unique identifier of the audit record."),
26
+ __metadata("design:type", String)
27
+ ], Audit.prototype, "id", void 0);
28
+ __decorate([
29
+ column(),
30
+ createdBy(),
31
+ index([OrderDirection.ASC, OrderDirection.DSC]),
32
+ description("Identifier of the user who performed the action."),
33
+ __metadata("design:type", String)
34
+ ], Audit.prototype, "userId", void 0);
35
+ __decorate([
36
+ column(),
37
+ required(),
38
+ readonly(),
39
+ index([OrderDirection.ASC, OrderDirection.DSC]),
40
+ description("Group or role of the user who performed the action."),
41
+ __metadata("design:type", String)
42
+ ], Audit.prototype, "userGroup", void 0);
43
+ __decorate([
44
+ column(),
45
+ required(),
46
+ readonly(),
47
+ transactionId(),
48
+ description("the transaction the audit record was created in"),
49
+ __metadata("design:type", String)
50
+ ], Audit.prototype, "transaction", void 0);
51
+ __decorate([
52
+ column(),
53
+ required(),
54
+ readonly(),
55
+ type(String),
56
+ index([OrderDirection.ASC, OrderDirection.DSC]),
57
+ description("Type of action performed by the user."),
58
+ __metadata("design:type", String)
59
+ ], Audit.prototype, "action", void 0);
60
+ __decorate([
61
+ column(),
62
+ readonly(),
63
+ serialize(),
64
+ description("the diffs for the action."),
65
+ __metadata("design:type", Object)
66
+ ], Audit.prototype, "diffs", void 0);
67
+ Audit = __decorate([
68
+ description("Logs user activity for auditing purposes."),
69
+ BlockOperations([
70
+ // OperationKeys.CREATE,
71
+ OperationKeys.UPDATE,
72
+ OperationKeys.DELETE,
73
+ ]),
74
+ uses(FabricFlavour),
75
+ table("audit"),
76
+ model(),
77
+ __metadata("design:paramtypes", [Object])
78
+ ], Audit);
79
+ export { Audit };
80
+ //# sourceMappingURL=Audit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Audit.js","sourceRoot":"","sources":["../../../../src/contract/models/Audit.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACL,KAAK,EAEL,QAAQ,EACR,IAAI,GACL,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,eAAe,EACf,QAAQ,EACR,aAAa,EACb,QAAQ,EACR,SAAS,GACV,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EACL,KAAK,EACL,EAAE,EACF,SAAS,EAET,MAAM,EAEN,cAAc,EACd,KAAK,GACN,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,uBAAoB;AACxC,OA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WAAW,CAAC,2CAA2C,CAAC;IACxD,eAAe,CAAC;QACf,wBAAwB;QACxB,aAAa,CAAC,MAAM;QACpB,aAAa,CAAC,MAAM;KACrB,CAAC;IACD,IAAI,CAAC,aAAa,CAAC;IACnB,KAAK,CAAC,OAAO,CAAC;IACd,KAAK,EAAE;;GACK,KAAK,CA2CjB"}
@@ -0,0 +1,7 @@
1
+ import { type ModelArg } from "@decaf-ts/decorator-validation";
2
+ import { BaseModel } from "./BaseModel";
3
+ export declare class BaseIdentifiedModel extends BaseModel {
4
+ createdBy: string;
5
+ updatedBy: string;
6
+ constructor(arg?: ModelArg<BaseIdentifiedModel>);
7
+ }
@@ -0,0 +1,34 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { createdBy, index, OrderDirection, updatedBy } from "@decaf-ts/core";
11
+ import { uses } from "@decaf-ts/decoration";
12
+ import { BaseModel } from "./BaseModel.js";
13
+ import { FabricFlavour } from "./../../shared/index.js";
14
+ let BaseIdentifiedModel = class BaseIdentifiedModel extends BaseModel {
15
+ constructor(arg) {
16
+ super(arg);
17
+ }
18
+ };
19
+ __decorate([
20
+ createdBy(),
21
+ index([OrderDirection.ASC, OrderDirection.DSC]),
22
+ __metadata("design:type", String)
23
+ ], BaseIdentifiedModel.prototype, "createdBy", void 0);
24
+ __decorate([
25
+ updatedBy(),
26
+ index([OrderDirection.ASC, OrderDirection.DSC]),
27
+ __metadata("design:type", String)
28
+ ], BaseIdentifiedModel.prototype, "updatedBy", void 0);
29
+ BaseIdentifiedModel = __decorate([
30
+ uses(FabricFlavour),
31
+ __metadata("design:paramtypes", [Object])
32
+ ], BaseIdentifiedModel);
33
+ export { BaseIdentifiedModel };
34
+ //# sourceMappingURL=BaseIdentifiedModel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseIdentifiedModel.js","sourceRoot":"","sources":["../../../../src/contract/models/BaseIdentifiedModel.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,uBAAoB;AACxC,OAAO,EAAE,aAAa,EAAE,gCAA2B;AAG5C,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,SAAS;IAQhD,YAAY,GAAmC;QAC7C,KAAK,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;CACF,CAAA;AARC;IAFC,SAAS,EAAE;IACX,KAAK,CAAC,CAAC,cAAc,CAAC,GAAG,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;;sDAC7B;AAGnB;IAFC,SAAS,EAAE;IACX,KAAK,CAAC,CAAC,cAAc,CAAC,GAAG,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;;sDAC7B;AANR,mBAAmB;IAD/B,IAAI,CAAC,aAAa,CAAC;;GACP,mBAAmB,CAW/B"}
@@ -0,0 +1,7 @@
1
+ import { Model, type ModelArg } from "@decaf-ts/decorator-validation";
2
+ export declare class BaseModel extends Model {
3
+ createdAt: Date;
4
+ updatedAt: Date;
5
+ version: number;
6
+ constructor(arg?: ModelArg<BaseModel>);
7
+ }
@@ -0,0 +1,39 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { Model } from "@decaf-ts/decorator-validation";
11
+ import { createdAt, index, OrderDirection, updatedAt } from "@decaf-ts/core";
12
+ import { uses } from "@decaf-ts/decoration";
13
+ import { version } from "@decaf-ts/db-decorators";
14
+ import { FabricFlavour } from "./../../shared/index.js";
15
+ let BaseModel = class BaseModel extends Model {
16
+ constructor(arg) {
17
+ super(arg);
18
+ }
19
+ };
20
+ __decorate([
21
+ createdAt(),
22
+ index([OrderDirection.ASC, OrderDirection.DSC]),
23
+ __metadata("design:type", Date)
24
+ ], BaseModel.prototype, "createdAt", void 0);
25
+ __decorate([
26
+ updatedAt(),
27
+ index([OrderDirection.ASC, OrderDirection.DSC]),
28
+ __metadata("design:type", Date)
29
+ ], BaseModel.prototype, "updatedAt", void 0);
30
+ __decorate([
31
+ version(),
32
+ __metadata("design:type", Number)
33
+ ], BaseModel.prototype, "version", void 0);
34
+ BaseModel = __decorate([
35
+ uses(FabricFlavour),
36
+ __metadata("design:paramtypes", [Object])
37
+ ], BaseModel);
38
+ export { BaseModel };
39
+ //# sourceMappingURL=BaseModel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseModel.js","sourceRoot":"","sources":["../../../../src/contract/models/BaseModel.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAiB,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,gCAA2B;AAG5C,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,KAAK;IAUlC,YAAY,GAAyB;QACnC,KAAK,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;CACF,CAAA;AAVC;IAFC,SAAS,EAAE;IACX,KAAK,CAAC,CAAC,cAAc,CAAC,GAAG,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;8BACpC,IAAI;4CAAC;AAGjB;IAFC,SAAS,EAAE;IACX,KAAK,CAAC,CAAC,cAAc,CAAC,GAAG,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;8BACpC,IAAI;4CAAC;AAEjB;IADC,OAAO,EAAE;;0CACO;AARN,SAAS;IADrB,IAAI,CAAC,aAAa,CAAC;;GACP,SAAS,CAarB"}
@@ -0,0 +1,18 @@
1
+ import type { ModelArg } from "@decaf-ts/decorator-validation";
2
+ import { BaseIdentifiedModel } from "./BaseIdentifiedModel";
3
+ export declare class Batch extends BaseIdentifiedModel {
4
+ id: string;
5
+ productCode: string;
6
+ batchNumber: string;
7
+ expiryDate: Date;
8
+ importLicenseNumber?: string;
9
+ dateOfManufacturing?: string;
10
+ manufacturerName?: string;
11
+ manufacturerAddress1?: string;
12
+ manufacturerAddress2?: string;
13
+ manufacturerAddress3?: string;
14
+ manufacturerAddress4?: string;
15
+ manufacturerAddress5?: string;
16
+ batchRecall: boolean;
17
+ constructor(model?: ModelArg<Batch>);
18
+ }
@@ -0,0 +1,171 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { date, model, pattern, required } from "@decaf-ts/decorator-validation";
11
+ import { column, index, OrderDirection, pk, table } from "@decaf-ts/core";
12
+ import { BatchPattern, DatePattern, TableNames } from "./constants.js";
13
+ import { BlockOperations, composed, OperationKeys, readonly, } from "@decaf-ts/db-decorators";
14
+ import { description, uses } from "@decaf-ts/decoration";
15
+ import { BaseIdentifiedModel } from "./BaseIdentifiedModel.js";
16
+ import { audit } from "./decorators.js";
17
+ import { gtin } from "./gtin.js";
18
+ import { FabricFlavour } from "./../../shared/index.js";
19
+ let Batch = class Batch extends BaseIdentifiedModel {
20
+ // @column()
21
+ // @description("Name of the site where the product was packaged.")
22
+ // packagingSiteName?: string;
23
+ //
24
+ // @column()
25
+ // @description("Version of the electronic product information leaflet.")
26
+ // epiLeafletVersion?: number;
27
+ //
28
+ // @column()
29
+ // @description("Enables expiry date verification feature.")
30
+ // flagEnableEXPVerification: boolean = false;
31
+ //
32
+ // @column()
33
+ // @description("Allows checking for expired batches.")
34
+ // flagEnableExpiredEXPCheck: boolean = false;
35
+ //
36
+ // @column()
37
+ // @description("Custom message displayed for this batch.")
38
+ // batchMessage?: string;
39
+ //
40
+ // @column()
41
+ // @description("Enables display of recall messages for this batch.")
42
+ // flagEnableBatchRecallMessage: boolean = false;
43
+ //
44
+ // @column()
45
+ // @description("Message shown when the batch is recalled.")
46
+ // recallMessage?: string;
47
+ //
48
+ // @column()
49
+ // @description("Enables ACF batch verification feature.")
50
+ // flagEnableACFBatchCheck: boolean = false;
51
+ //
52
+ // @column()
53
+ // @description("URL for ACF batch verification.")
54
+ // acfBatchCheckURL?: string;
55
+ //
56
+ // @column()
57
+ // @description("Enables serial number (SN) verification feature.")
58
+ // flagEnableSNVerification: boolean = false;
59
+ //
60
+ // /** ACDC PATCH */
61
+ // @column()
62
+ // @description("Identifier of the ACDC authentication feature (SSI).")
63
+ // acdcAuthFeatureSSI?: string;
64
+ //
65
+ // @column()
66
+ // @description("Indicates if serial number validation was reset.")
67
+ // snValidReset: boolean = false;
68
+ // TODO -> Uncomment and fix
69
+ // @column({ type: "text", array: true })
70
+ // @list(String)
71
+ // @description("List of valid serial numbers for the batch.")
72
+ // snValid?: string[];
73
+ constructor(model) {
74
+ super(model);
75
+ this.batchRecall = false;
76
+ }
77
+ };
78
+ __decorate([
79
+ pk({ type: String, generated: false }),
80
+ audit(),
81
+ composed(["productCode", "batchNumber"], ":"),
82
+ description("Unique identifier composed of product code and batch number."),
83
+ __metadata("design:type", String)
84
+ ], Batch.prototype, "id", void 0);
85
+ __decorate([
86
+ gtin(),
87
+ readonly()
88
+ // @manyToOne(
89
+ // () => Product,
90
+ // { update: Cascade.NONE, delete: Cascade.NONE },
91
+ // false
92
+ // )
93
+ ,
94
+ index([OrderDirection.ASC, OrderDirection.DSC]),
95
+ description("Code of the product associated with this batch."),
96
+ __metadata("design:type", String)
97
+ ], Batch.prototype, "productCode", void 0);
98
+ __decorate([
99
+ column(),
100
+ readonly(),
101
+ pattern(BatchPattern),
102
+ index([OrderDirection.ASC, OrderDirection.DSC]),
103
+ description("Batch number assigned to the product."),
104
+ __metadata("design:type", String)
105
+ ], Batch.prototype, "batchNumber", void 0);
106
+ __decorate([
107
+ required(),
108
+ date(DatePattern),
109
+ column(),
110
+ index([OrderDirection.ASC, OrderDirection.DSC]),
111
+ description("Date when the batch expires."),
112
+ __metadata("design:type", Date)
113
+ ], Batch.prototype, "expiryDate", void 0);
114
+ __decorate([
115
+ column(),
116
+ description("Import license number for this batch."),
117
+ __metadata("design:type", String)
118
+ ], Batch.prototype, "importLicenseNumber", void 0);
119
+ __decorate([
120
+ column(),
121
+ date(DatePattern),
122
+ description("Date when the batch was manufactured."),
123
+ __metadata("design:type", String)
124
+ ], Batch.prototype, "dateOfManufacturing", void 0);
125
+ __decorate([
126
+ column(),
127
+ index([OrderDirection.ASC, OrderDirection.DSC]),
128
+ description("Name of the product manufacturer."),
129
+ __metadata("design:type", String)
130
+ ], Batch.prototype, "manufacturerName", void 0);
131
+ __decorate([
132
+ column(),
133
+ description("Manufacturer address line 1."),
134
+ __metadata("design:type", String)
135
+ ], Batch.prototype, "manufacturerAddress1", void 0);
136
+ __decorate([
137
+ column(),
138
+ description("Manufacturer address line 2."),
139
+ __metadata("design:type", String)
140
+ ], Batch.prototype, "manufacturerAddress2", void 0);
141
+ __decorate([
142
+ column(),
143
+ description("Manufacturer address line 3."),
144
+ __metadata("design:type", String)
145
+ ], Batch.prototype, "manufacturerAddress3", void 0);
146
+ __decorate([
147
+ column(),
148
+ description("Manufacturer address line 4."),
149
+ __metadata("design:type", String)
150
+ ], Batch.prototype, "manufacturerAddress4", void 0);
151
+ __decorate([
152
+ column(),
153
+ description("Manufacturer address line 5."),
154
+ __metadata("design:type", String)
155
+ ], Batch.prototype, "manufacturerAddress5", void 0);
156
+ __decorate([
157
+ column(),
158
+ index([OrderDirection.ASC, OrderDirection.DSC]),
159
+ description("Indicates whether this batch has been recalled."),
160
+ __metadata("design:type", Boolean)
161
+ ], Batch.prototype, "batchRecall", void 0);
162
+ Batch = __decorate([
163
+ description("Represents a product batch"),
164
+ uses(FabricFlavour),
165
+ BlockOperations([OperationKeys.DELETE]),
166
+ table(TableNames.Batch),
167
+ model(),
168
+ __metadata("design:paramtypes", [Object])
169
+ ], Batch);
170
+ export { Batch };
171
+ //# sourceMappingURL=Batch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Batch.js","sourceRoot":"","sources":["../../../../src/contract/models/Batch.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAA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cAAc,CAAC,GAAG,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAC/C,WAAW,CAAC,mCAAmC,CAAC;;+CACvB;AAI1B;IAFC,MAAM,EAAE;IACR,WAAW,CAAC,8BAA8B,CAAC;;mDACd;AAI9B;IAFC,MAAM,EAAE;IACR,WAAW,CAAC,8BAA8B,CAAC;;mDACd;AAI9B;IAFC,MAAM,EAAE;IACR,WAAW,CAAC,8BAA8B,CAAC;;mDACd;AAI9B;IAFC,MAAM,EAAE;IACR,WAAW,CAAC,8BAA8B,CAAC;;mDACd;AAI9B;IAFC,MAAM,EAAE;IACR,WAAW,CAAC,8BAA8B,CAAC;;mDACd;AAK9B;IAHC,MAAM,EAAE;IACR,KAAK,CAAC,CAAC,cAAc,CAAC,GAAG,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAC/C,WAAW,CAAC,iDAAiD,CAAC;;0CAClC;AArElB,KAAK;IALjB,WAAW,CAAC,4BAA4B,CAAC;IACzC,IAAI,CAAC,aAAa,CAAC;IACnB,eAAe,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IACvC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC;IACvB,KAAK,EAAE;;GACK,KAAK,CAiIjB"}
@@ -0,0 +1,12 @@
1
+ import type { ModelArg } from "@decaf-ts/decorator-validation";
2
+ import { BaseIdentifiedModel } from "./BaseIdentifiedModel";
3
+ export declare class Leaflet extends BaseIdentifiedModel {
4
+ id: string;
5
+ productCode: string;
6
+ batchNumber?: string;
7
+ lang: string;
8
+ countryMarket: string;
9
+ xmlFileContent: string;
10
+ otherFilesContent: string[];
11
+ constructor(model?: ModelArg<Leaflet>);
12
+ }
@@ -0,0 +1,92 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { model, required } from "@decaf-ts/decorator-validation";
11
+ import { LeafletFile } from "./LeafletFile.js";
12
+ import { gtin } from "./gtin.js";
13
+ import { TableNames } from "./constants.js";
14
+ import { Cascade, column, index, manyToOne, oneToMany, OrderDirection, pk, table, } from "@decaf-ts/core";
15
+ import { composed, readonly } from "@decaf-ts/db-decorators";
16
+ import { Product } from "./Product.js";
17
+ import { description, uses } from "@decaf-ts/decoration";
18
+ import { BaseIdentifiedModel } from "./BaseIdentifiedModel.js";
19
+ import { audit } from "./decorators.js";
20
+ import { FabricFlavour } from "./../../shared/index.js";
21
+ let Leaflet = class Leaflet extends BaseIdentifiedModel {
22
+ constructor(model) {
23
+ super(model);
24
+ }
25
+ };
26
+ __decorate([
27
+ audit(),
28
+ pk({ type: "String", generated: false }),
29
+ composed(["productCode", "batchNumber", "lang", "countryMarket"], ":", [
30
+ "batchNumber",
31
+ "countryMarket",
32
+ ]),
33
+ description("Unique identifier composed of product code, batch number, and language."),
34
+ __metadata("design:type", String)
35
+ ], Leaflet.prototype, "id", void 0);
36
+ __decorate([
37
+ gtin(),
38
+ manyToOne(() => Product, { update: Cascade.CASCADE, delete: Cascade.CASCADE }, false),
39
+ required(),
40
+ readonly(),
41
+ index([OrderDirection.ASC, OrderDirection.DSC]),
42
+ description("GTIN code of the product associated with this leaflet."),
43
+ __metadata("design:type", String)
44
+ ], Leaflet.prototype, "productCode", void 0);
45
+ __decorate([
46
+ column()
47
+ //TODO: Uncomment when implemented in couch and FK relationshipacept composed one
48
+ // @manyToOne(
49
+ // () => Batch,
50
+ // { update: Cascade.CASCADE, delete: Cascade.CASCADE },
51
+ // false
52
+ // )
53
+ ,
54
+ readonly(),
55
+ index([OrderDirection.ASC, OrderDirection.DSC]),
56
+ description("Batch number linked to the product, if applicable."),
57
+ __metadata("design:type", String)
58
+ ], Leaflet.prototype, "batchNumber", void 0);
59
+ __decorate([
60
+ column(),
61
+ required(),
62
+ readonly(),
63
+ index([OrderDirection.ASC, OrderDirection.DSC]),
64
+ description("Language code of the leaflet (e.g., 'en', 'pt', 'es')."),
65
+ __metadata("design:type", String)
66
+ ], Leaflet.prototype, "lang", void 0);
67
+ __decorate([
68
+ column(),
69
+ required(),
70
+ readonly(),
71
+ __metadata("design:type", String)
72
+ ], Leaflet.prototype, "countryMarket", void 0);
73
+ __decorate([
74
+ column(),
75
+ required(),
76
+ description("Main XML content of the electronic leaflet."),
77
+ __metadata("design:type", String)
78
+ ], Leaflet.prototype, "xmlFileContent", void 0);
79
+ __decorate([
80
+ oneToMany(() => LeafletFile, { update: Cascade.CASCADE, delete: Cascade.CASCADE }, false),
81
+ description("List of additional files linked to the leaflet, such as PDFs or images."),
82
+ __metadata("design:type", Array)
83
+ ], Leaflet.prototype, "otherFilesContent", void 0);
84
+ Leaflet = __decorate([
85
+ description("Represents a medical leaflet linked to a specific product, batch, and language."),
86
+ uses(FabricFlavour),
87
+ table(TableNames.Leaflet),
88
+ model(),
89
+ __metadata("design:paramtypes", [Object])
90
+ ], Leaflet);
91
+ export { Leaflet };
92
+ //# sourceMappingURL=Leaflet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Leaflet.js","sourceRoot":"","sources":["../../../../src/contract/models/Leaflet.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,yBAAsB;AAC5C,OAAO,EAAE,IAAI,EAAE,kBAAe;AAC9B,OAAO,EAAE,UAAU,EAAE,uBAAoB;AACzC,OAAO,EACL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EAAE;IACV,KAAK,CAAC,CAAC,cAAc,CAAC,GAAG,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAC/C,WAAW,CAAC,oDAAoD,CAAC;;4CAC7C;AAOrB;IALC,MAAM,EAAE;IACR,QAAQ,EAAE;IACV,QAAQ,EAAE;IACV,KAAK,CAAC,CAAC,cAAc,CAAC,GAAG,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAC/C,WAAW,CAAC,wDAAwD,CAAC;;qCACxD;AAKd;IAHC,MAAM,EAAE;IACR,QAAQ,EAAE;IACV,QAAQ,EAAE;;8CACY;AAKvB;IAHC,MAAM,EAAE;IACR,QAAQ,EAAE;IACV,WAAW,CAAC,6CAA6C,CAAC;;+CACnC;AAUxB;IARC,SAAS,CACR,GAAG,EAAE,CAAC,WAAW,EACjB,EAAE,MAAM,EAAE,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,OAAO,EAAE,EACpD,KAAK,CACN;IACA,WAAW,CACV,yEAAyE,CAC1E;;kDAC4B;AA7DlB,OAAO;IANnB,WAAW,CACV,iFAAiF,CAClF;IACA,IAAI,CAAC,aAAa,CAAC;IACnB,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC;IACzB,KAAK,EAAE;;GACK,OAAO,CAkEnB"}
@@ -0,0 +1,9 @@
1
+ import type { ModelArg } from "@decaf-ts/decorator-validation";
2
+ import { BaseIdentifiedModel } from "./BaseIdentifiedModel";
3
+ export declare class LeafletFile extends BaseIdentifiedModel {
4
+ id: string;
5
+ leafletId: string;
6
+ filename: string;
7
+ fileContent: string;
8
+ constructor(model?: ModelArg<LeafletFile>);
9
+ }
@@ -0,0 +1,55 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { model, required } from "@decaf-ts/decorator-validation";
11
+ import { Cascade, column, index, manyToOne, OrderDirection, pk, table, } from "@decaf-ts/core";
12
+ import { TableNames } from "./constants.js";
13
+ import { Leaflet } from "./Leaflet.js";
14
+ import { description, uses } from "@decaf-ts/decoration";
15
+ import { BaseIdentifiedModel } from "./BaseIdentifiedModel.js";
16
+ import { composed } from "@decaf-ts/db-decorators";
17
+ import { FabricFlavour } from "./../../shared/index.js";
18
+ let LeafletFile = class LeafletFile extends BaseIdentifiedModel {
19
+ constructor(model) {
20
+ super(model);
21
+ }
22
+ };
23
+ __decorate([
24
+ pk(),
25
+ composed(["productCode", "batchNumber", "lang"], ":", ["batchNumber"]),
26
+ description("Unique identifier of the leaflet file."),
27
+ __metadata("design:type", String)
28
+ ], LeafletFile.prototype, "id", void 0);
29
+ __decorate([
30
+ manyToOne(() => Leaflet, { update: Cascade.NONE, delete: Cascade.NONE }, false),
31
+ description("Identifier of the leaflet this file belongs to."),
32
+ __metadata("design:type", String)
33
+ ], LeafletFile.prototype, "leafletId", void 0);
34
+ __decorate([
35
+ column(),
36
+ required(),
37
+ index([OrderDirection.ASC, OrderDirection.DSC]),
38
+ description("Name of the file, including its extension."),
39
+ __metadata("design:type", String)
40
+ ], LeafletFile.prototype, "filename", void 0);
41
+ __decorate([
42
+ column(),
43
+ required(),
44
+ description("Base64-encoded content of the file."),
45
+ __metadata("design:type", String)
46
+ ], LeafletFile.prototype, "fileContent", void 0);
47
+ LeafletFile = __decorate([
48
+ description("Represents an additional file associated with a leaflet, such as a PDF or image."),
49
+ uses(FabricFlavour),
50
+ table(TableNames.LeafletFile),
51
+ model(),
52
+ __metadata("design:paramtypes", [Object])
53
+ ], LeafletFile);
54
+ export { LeafletFile };
55
+ //# sourceMappingURL=LeafletFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LeafletFile.js","sourceRoot":"","sources":["../../../../src/contract/models/LeafletFile.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EACL,OAAO,EACP,MAAM,EACN,KAAK,EACL,SAAS,EACT,cAAc,EACd,EAAE,EACF,KAAK,GACN,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,uBAAoB;AACzC,OAAO,EAAE,OAAO,EAAE,qBAAkB;AACpC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,iCAA8B;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,gCAA2B;AAO5C,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,mBAAmB;IAyBlD,YAAY,KAA6B;QACvC,KAAK,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;CACF,CAAA;AAxBC;IAHC,EAAE,EAAE;IACJ,QAAQ,CAAC,CAAC,aAAa,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,CAAC;IACtE,WAAW,CAAC,wCAAwC,CAAC;;uCAC1C;AAQZ;IANC,SAAS,CACR,GAAG,EAAE,CAAC,OAAO,EACb,EAAE,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,EAC9C,KAAK,CACN;IACA,WAAW,CAAC,iDAAiD,CAAC;;8CAC5C;AAMnB;IAJC,MAAM,EAAE;IACR,QAAQ,EAAE;IACV,KAAK,CAAC,CAAC,cAAc,CAAC,GAAG,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAC/C,WAAW,CAAC,4CAA4C,CAAC;;6CACxC;AAKlB;IAHC,MAAM,EAAE;IACR,QAAQ,EAAE;IACV,WAAW,CAAC,qCAAqC,CAAC;;gDAC9B;AAvBV,WAAW;IANvB,WAAW,CACV,kFAAkF,CACnF;IACA,IAAI,CAAC,aAAa,CAAC;IACnB,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC;IAC7B,KAAK,EAAE;;GACK,WAAW,CA4BvB"}
@@ -0,0 +1,12 @@
1
+ import type { ModelArg } from "@decaf-ts/decorator-validation";
2
+ import { BaseIdentifiedModel } from "./BaseIdentifiedModel";
3
+ export declare class Market extends BaseIdentifiedModel {
4
+ id: string;
5
+ marketId: string;
6
+ productCode: string;
7
+ nationalCode?: string;
8
+ mahName?: string;
9
+ legalEntityName?: string;
10
+ mahAddress?: string;
11
+ constructor(model?: ModelArg<Market>);
12
+ }