@decaf-ts/for-fabric 0.1.41 → 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.
- package/dist/for-fabric.cjs +1 -1
- package/dist/for-fabric.cjs.map +1 -1
- package/dist/for-fabric.js +1 -1
- package/dist/for-fabric.js.map +1 -1
- package/lib/client/FabricClientAdapter.cjs +7 -1
- package/lib/client/FabricClientAdapter.js.map +1 -1
- package/lib/contract/BatchContract.cjs +30 -0
- package/lib/contract/BatchContract.d.ts +5 -0
- package/lib/contract/BatchContract.js.map +1 -0
- package/lib/contract/ProductContract.cjs +1 -4
- package/lib/contract/ProductContract.d.ts +1 -1
- package/lib/contract/ProductContract.js.map +1 -1
- package/lib/contract/index.cjs +2 -0
- package/lib/contract/index.js.map +1 -1
- package/lib/contract/models/Audit.cjs +83 -0
- package/lib/contract/models/Audit.d.ts +12 -0
- package/lib/contract/models/Audit.js.map +1 -0
- package/lib/contract/models/BaseIdentifiedModel.cjs +37 -0
- package/lib/contract/models/BaseIdentifiedModel.d.ts +7 -0
- package/lib/contract/models/BaseIdentifiedModel.js.map +1 -0
- package/lib/contract/models/BaseModel.cjs +42 -0
- package/lib/contract/models/BaseModel.d.ts +7 -0
- package/lib/contract/models/BaseModel.js.map +1 -0
- package/lib/contract/models/Batch.cjs +174 -0
- package/lib/contract/models/Batch.d.ts +18 -0
- package/lib/contract/models/Batch.js.map +1 -0
- package/lib/contract/models/Leaflet.cjs +95 -0
- package/lib/contract/models/Leaflet.d.ts +12 -0
- package/lib/contract/models/Leaflet.js.map +1 -0
- package/lib/contract/models/LeafletFile.cjs +58 -0
- package/lib/contract/models/LeafletFile.d.ts +9 -0
- package/lib/contract/models/LeafletFile.js.map +1 -0
- package/lib/contract/models/Market.cjs +75 -0
- package/lib/contract/models/Market.d.ts +12 -0
- package/lib/contract/models/Market.js.map +1 -0
- package/lib/contract/models/Product.cjs +77 -0
- package/lib/contract/models/Product.d.ts +15 -0
- package/lib/contract/models/Product.js.map +1 -0
- package/lib/contract/models/ProductStrength.cjs +60 -0
- package/lib/contract/models/ProductStrength.d.ts +10 -0
- package/lib/contract/models/ProductStrength.js.map +1 -0
- package/lib/contract/models/constants.cjs +30 -0
- package/lib/contract/models/constants.d.ts +24 -0
- package/lib/contract/models/constants.js.map +1 -0
- package/lib/contract/models/decorators.cjs +54 -0
- package/lib/contract/models/decorators.d.ts +8 -0
- package/lib/contract/models/decorators.js.map +1 -0
- package/lib/contract/models/gtin.cjs +88 -0
- package/lib/contract/models/gtin.d.ts +8 -0
- package/lib/contract/models/gtin.js.map +1 -0
- package/lib/contracts/ContractAdapter.cjs +1 -7
- package/lib/contracts/ContractAdapter.d.ts +0 -6
- package/lib/contracts/ContractAdapter.js.map +1 -1
- package/lib/contracts/FabricContractPaginator.js.map +1 -1
- package/lib/contracts/FabricContractRepository.cjs +0 -46
- package/lib/contracts/FabricContractRepository.d.ts +1 -1
- package/lib/contracts/FabricContractRepository.js.map +1 -1
- package/lib/contracts/FabricContractSequence.cjs +93 -58
- package/lib/contracts/FabricContractSequence.d.ts +2 -2
- package/lib/contracts/FabricContractSequence.js.map +1 -1
- package/lib/contracts/crud/serialized-crud-contract.cjs +4 -1
- package/lib/contracts/crud/serialized-crud-contract.js.map +1 -1
- package/lib/contracts/index.cjs +0 -1
- package/lib/contracts/index.d.ts +0 -1
- package/lib/contracts/index.js.map +1 -1
- package/lib/esm/client/FabricClientAdapter.js +8 -2
- package/lib/esm/client/FabricClientAdapter.js.map +1 -1
- package/lib/esm/contract/BatchContract.d.ts +5 -0
- package/lib/esm/contract/BatchContract.js +27 -0
- package/lib/esm/contract/BatchContract.js.map +1 -0
- package/lib/esm/contract/ProductContract.d.ts +1 -1
- package/lib/esm/contract/ProductContract.js +1 -4
- package/lib/esm/contract/ProductContract.js.map +1 -1
- package/lib/esm/contract/index.js +2 -0
- package/lib/esm/contract/index.js.map +1 -1
- package/lib/esm/contract/models/Audit.d.ts +12 -0
- package/lib/esm/contract/models/Audit.js +80 -0
- package/lib/esm/contract/models/Audit.js.map +1 -0
- package/lib/esm/contract/models/BaseIdentifiedModel.d.ts +7 -0
- package/lib/esm/contract/models/BaseIdentifiedModel.js +34 -0
- package/lib/esm/contract/models/BaseIdentifiedModel.js.map +1 -0
- package/lib/esm/contract/models/BaseModel.d.ts +7 -0
- package/lib/esm/contract/models/BaseModel.js +39 -0
- package/lib/esm/contract/models/BaseModel.js.map +1 -0
- package/lib/esm/contract/models/Batch.d.ts +18 -0
- package/lib/esm/contract/models/Batch.js +171 -0
- package/lib/esm/contract/models/Batch.js.map +1 -0
- package/lib/esm/contract/models/Leaflet.d.ts +12 -0
- package/lib/esm/contract/models/Leaflet.js +92 -0
- package/lib/esm/contract/models/Leaflet.js.map +1 -0
- package/lib/esm/contract/models/LeafletFile.d.ts +9 -0
- package/lib/esm/contract/models/LeafletFile.js +55 -0
- package/lib/esm/contract/models/LeafletFile.js.map +1 -0
- package/lib/esm/contract/models/Market.d.ts +12 -0
- package/lib/esm/contract/models/Market.js +72 -0
- package/lib/esm/contract/models/Market.js.map +1 -0
- package/lib/esm/contract/models/Product.d.ts +15 -0
- package/lib/esm/contract/models/Product.js +74 -0
- package/lib/esm/contract/models/Product.js.map +1 -0
- package/lib/esm/contract/models/ProductStrength.d.ts +10 -0
- package/lib/esm/contract/models/ProductStrength.js +57 -0
- package/lib/esm/contract/models/ProductStrength.js.map +1 -0
- package/lib/esm/contract/models/constants.d.ts +24 -0
- package/lib/esm/contract/models/constants.js +27 -0
- package/lib/esm/contract/models/constants.js.map +1 -0
- package/lib/esm/contract/models/decorators.d.ts +8 -0
- package/lib/esm/contract/models/decorators.js +48 -0
- package/lib/esm/contract/models/decorators.js.map +1 -0
- package/lib/esm/contract/models/gtin.d.ts +8 -0
- package/lib/esm/contract/models/gtin.js +82 -0
- package/lib/esm/contract/models/gtin.js.map +1 -0
- package/lib/esm/contracts/ContractAdapter.d.ts +0 -6
- package/lib/esm/contracts/ContractAdapter.js +1 -7
- package/lib/esm/contracts/ContractAdapter.js.map +1 -1
- package/lib/esm/contracts/FabricContractPaginator.js.map +1 -1
- package/lib/esm/contracts/FabricContractRepository.d.ts +1 -1
- package/lib/esm/contracts/FabricContractRepository.js +1 -47
- package/lib/esm/contracts/FabricContractRepository.js.map +1 -1
- package/lib/esm/contracts/FabricContractSequence.d.ts +2 -2
- package/lib/esm/contracts/FabricContractSequence.js +93 -58
- package/lib/esm/contracts/FabricContractSequence.js.map +1 -1
- package/lib/esm/contracts/crud/serialized-crud-contract.js +4 -1
- package/lib/esm/contracts/crud/serialized-crud-contract.js.map +1 -1
- package/lib/esm/contracts/index.d.ts +0 -1
- package/lib/esm/contracts/index.js +0 -1
- package/lib/esm/contracts/index.js.map +1 -1
- package/lib/esm/shared/errors.d.ts +9 -0
- package/lib/esm/shared/errors.js +15 -0
- package/lib/esm/shared/errors.js.map +1 -1
- package/lib/esm/version.d.ts +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/shared/errors.cjs +19 -1
- package/lib/shared/errors.d.ts +9 -0
- package/lib/shared/errors.js.map +1 -1
- package/lib/version.cjs +1 -1
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -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,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,uBAAoB;AACpE,OAAO,EACL,eAAe,EACf,QAAQ,EACR,aAAa,EACb,QAAQ,GACT,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EA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;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,OAAO,EACP,MAAM,EACN,KAAK,EACL,SAAS,EACT,SAAS,EACT,cAAc,EACd,EAAE,EACF,KAAK,GACN,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,qBAAkB;AACpC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,iCAA8B;AAC5D,OAAO,EAAE,KAAK,EAAE,wBAAqB;AACrC,OAAO,EAAE,aAAa,EAAE,gCAA2B;AAQ5C,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,mBAAmB;IA+D9C,YAAY,KAAyB;QACnC,KAAK,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;CACF,CAAA;AAxDC;IATC,KAAK,EAAE;IACP,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IACxC,QAAQ,CAAC,CAAC,aAAa,EAAE,aAAa,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,GAAG,EAAE;QACtE,aAAa;QACb,eAAe;KAChB,CAAC;IACD,WAAW,CACV,yEAAyE,CAC1E;;mCACW;AAYZ;IAVC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@ -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,EAC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AW,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
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
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 { maxlength, minlength, model, required, } from "@decaf-ts/decorator-validation";
|
|
11
|
+
import { TableNames } from "./constants.js";
|
|
12
|
+
import { column, index, OrderDirection, pk, table } from "@decaf-ts/core";
|
|
13
|
+
import { composed } from "@decaf-ts/db-decorators";
|
|
14
|
+
import { description, uses } from "@decaf-ts/decoration";
|
|
15
|
+
import { BaseIdentifiedModel } from "./BaseIdentifiedModel.js";
|
|
16
|
+
import { gtin } from "./gtin.js";
|
|
17
|
+
import { FabricFlavour } from "./../../shared/index.js";
|
|
18
|
+
let Market = class Market extends BaseIdentifiedModel {
|
|
19
|
+
constructor(model) {
|
|
20
|
+
super(model);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
__decorate([
|
|
24
|
+
pk({ type: "String", generated: false }),
|
|
25
|
+
composed(["productCode", "marketId"], ":", true),
|
|
26
|
+
description("Unique identifier composed of product code and market ID."),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], Market.prototype, "id", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
column(),
|
|
31
|
+
required(),
|
|
32
|
+
index([OrderDirection.ASC, OrderDirection.DSC]),
|
|
33
|
+
description("Identifier of the market where the product is registered or sold."),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], Market.prototype, "marketId", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
column(),
|
|
38
|
+
gtin(),
|
|
39
|
+
required(),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], Market.prototype, "productCode", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
column(),
|
|
44
|
+
minlength(2),
|
|
45
|
+
maxlength(2),
|
|
46
|
+
description("Two-letter national code (ISO format) representing the market's country."),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], Market.prototype, "nationalCode", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
column(),
|
|
51
|
+
description("Name of the Marketing Authorization Holder (MAH)."),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], Market.prototype, "mahName", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
column(),
|
|
56
|
+
description("Name of the legal entity responsible for the product in this market."),
|
|
57
|
+
__metadata("design:type", String)
|
|
58
|
+
], Market.prototype, "legalEntityName", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
column(),
|
|
61
|
+
description("Address of the Marketing Authorization Holder or responsible legal entity."),
|
|
62
|
+
__metadata("design:type", String)
|
|
63
|
+
], Market.prototype, "mahAddress", void 0);
|
|
64
|
+
Market = __decorate([
|
|
65
|
+
description("Links a product to a specific market."),
|
|
66
|
+
uses(FabricFlavour),
|
|
67
|
+
table(TableNames.Market),
|
|
68
|
+
model(),
|
|
69
|
+
__metadata("design:paramtypes", [Object])
|
|
70
|
+
], Market);
|
|
71
|
+
export { Market };
|
|
72
|
+
//# sourceMappingURL=Market.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Market.js","sourceRoot":"","sources":["../../../../src/contract/models/Market.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EACL,SAAS,EACT,SAAS,EACT,KAAK,EACL,QAAQ,GACT,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,uBAAoB;AACzC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,iCAA8B;AAC5D,OAAO,EAAE,IAAI,EAAE,kBAAe;AAC9B,OAAO,EAAE,aAAa,EAAE,gCAA2B;AAM5C,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,mBAAmB;IA2C7C,YAAY,KAAwB;QAClC,KAAK,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;CACF,CAAA;AA1CC;IAHC,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IACxC,QAAQ,CAAC,CAAC,aAAa,EAAE,UAAU,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC;IAChD,WAAW,CAAC,2DAA2D,CAAC;;kCAC7D;AAQZ;IANC,MAAM,EAAE;IACR,QAAQ,EAAE;IACV,KAAK,CAAC,CAAC,cAAc,CAAC,GAAG,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAC/C,WAAW,CACV,mEAAmE,CACpE;;wCACiB;AAKlB;IAHC,MAAM,EAAE;IACR,IAAI,EAAE;IACN,QAAQ,EAAE;;2CACU;AAQrB;IANC,MAAM,EAAE;IACR,SAAS,CAAC,CAAC,CAAC;IACZ,SAAS,CAAC,CAAC,CAAC;IACZ,WAAW,CACV,0EAA0E,CAC3E;;4CACqB;AAItB;IAFC,MAAM,EAAE;IACR,WAAW,CAAC,mDAAmD,CAAC;;uCAChD;AAMjB;IAJC,MAAM,EAAE;IACR,WAAW,CACV,sEAAsE,CACvE;;+CACwB;AAMzB;IAJC,MAAM,EAAE;IACR,WAAW,CACV,4EAA4E,CAC7E;;0CACmB;AAzCT,MAAM;IAJlB,WAAW,CAAC,uCAAuC,CAAC;IACpD,IAAI,CAAC,aAAa,CAAC;IACnB,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC;IACxB,KAAK,EAAE;;GACK,MAAM,CA8ClB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ModelArg } from "@decaf-ts/decorator-validation";
|
|
2
|
+
import { ProductStrength } from "./ProductStrength";
|
|
3
|
+
import { Market } from "./Market";
|
|
4
|
+
import { BaseIdentifiedModel } from "./BaseIdentifiedModel";
|
|
5
|
+
export declare class Product extends BaseIdentifiedModel {
|
|
6
|
+
productCode: string;
|
|
7
|
+
inventedName: string;
|
|
8
|
+
nameMedicinalProduct: string;
|
|
9
|
+
internalMaterialCode?: string;
|
|
10
|
+
productRecall: boolean;
|
|
11
|
+
counter?: number;
|
|
12
|
+
strengths: ProductStrength[];
|
|
13
|
+
markets: Market[];
|
|
14
|
+
constructor(args?: ModelArg<Product>);
|
|
15
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
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, oneToMany, OrderDirection, pk, table, } from "@decaf-ts/core";
|
|
12
|
+
// import {BlockOperations, OperationKeys, readonly} from "@decaf-ts/db-decorators";
|
|
13
|
+
import { uses } from "@decaf-ts/decoration";
|
|
14
|
+
import { ProductStrength } from "./ProductStrength.js";
|
|
15
|
+
import { Market } from "./Market.js";
|
|
16
|
+
import { BaseIdentifiedModel } from "./BaseIdentifiedModel.js";
|
|
17
|
+
import { gtin } from "./gtin.js";
|
|
18
|
+
import { audit } from "./decorators.js";
|
|
19
|
+
import { FabricFlavour } from "./../../shared/index.js";
|
|
20
|
+
let Product = class Product extends BaseIdentifiedModel {
|
|
21
|
+
constructor(args) {
|
|
22
|
+
super(args);
|
|
23
|
+
this.productRecall = false;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
__decorate([
|
|
27
|
+
gtin(),
|
|
28
|
+
audit(),
|
|
29
|
+
pk({ type: String, generated: false }),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], Product.prototype, "productCode", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
column(),
|
|
34
|
+
required(),
|
|
35
|
+
index([OrderDirection.ASC, OrderDirection.DSC]),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], Product.prototype, "inventedName", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
column(),
|
|
40
|
+
required(),
|
|
41
|
+
index([OrderDirection.ASC, OrderDirection.DSC]),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], Product.prototype, "nameMedicinalProduct", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
column(),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], Product.prototype, "internalMaterialCode", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
column(),
|
|
50
|
+
index([OrderDirection.ASC, OrderDirection.DSC]),
|
|
51
|
+
__metadata("design:type", Boolean)
|
|
52
|
+
], Product.prototype, "productRecall", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
column(),
|
|
55
|
+
__metadata("design:type", Number)
|
|
56
|
+
], Product.prototype, "counter", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
oneToMany(() => ProductStrength, { update: Cascade.CASCADE, delete: Cascade.CASCADE }, false),
|
|
59
|
+
__metadata("design:type", Array)
|
|
60
|
+
], Product.prototype, "strengths", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
oneToMany(() => Market, { update: Cascade.NONE, delete: Cascade.NONE }, false),
|
|
63
|
+
__metadata("design:type", Array)
|
|
64
|
+
], Product.prototype, "markets", void 0);
|
|
65
|
+
Product = __decorate([
|
|
66
|
+
uses(FabricFlavour)
|
|
67
|
+
// @BlockOperations([OperationKeys.DELETE])
|
|
68
|
+
,
|
|
69
|
+
table(),
|
|
70
|
+
model(),
|
|
71
|
+
__metadata("design:paramtypes", [Object])
|
|
72
|
+
], Product);
|
|
73
|
+
export { Product };
|
|
74
|
+
//# sourceMappingURL=Product.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Product.js","sourceRoot":"","sources":["../../../../src/contract/models/Product.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,EA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AO9B;IALC,SAAS,CACR,GAAG,EAAE,CAAC,MAAM,EACZ,EAAE,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,EAC9C,KAAK,CACN;;wCACkB;AAzDR,OAAO;IAJnB,IAAI,CAAC,aAAa,CAAC;IACpB,2CAA2C;;IAC1C,KAAK,EAAE;IACP,KAAK,EAAE;;GACK,OAAO,CA8DnB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ModelArg } from "@decaf-ts/decorator-validation";
|
|
2
|
+
import { BaseIdentifiedModel } from "./BaseIdentifiedModel";
|
|
3
|
+
export declare class ProductStrength extends BaseIdentifiedModel {
|
|
4
|
+
id: number;
|
|
5
|
+
productCode: string;
|
|
6
|
+
strength: string;
|
|
7
|
+
substance?: string;
|
|
8
|
+
legalEntityName?: string;
|
|
9
|
+
constructor(model?: ModelArg<ProductStrength>);
|
|
10
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
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 { column, index, OrderDirection, pk, table } from "@decaf-ts/core";
|
|
12
|
+
import { TableNames } from "./constants.js";
|
|
13
|
+
import { description, uses } from "@decaf-ts/decoration";
|
|
14
|
+
import { BaseIdentifiedModel } from "./BaseIdentifiedModel.js";
|
|
15
|
+
import { FabricFlavour } from "./../../shared/index.js";
|
|
16
|
+
let ProductStrength = class ProductStrength extends BaseIdentifiedModel {
|
|
17
|
+
constructor(model) {
|
|
18
|
+
super(model);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
__decorate([
|
|
22
|
+
pk({ type: Number, generated: true }),
|
|
23
|
+
description("Unique identifier of the product strength."),
|
|
24
|
+
__metadata("design:type", Number)
|
|
25
|
+
], ProductStrength.prototype, "id", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
index([OrderDirection.ASC, OrderDirection.DSC]),
|
|
28
|
+
description("Product code associated with this strength entry."),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], ProductStrength.prototype, "productCode", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
column(),
|
|
33
|
+
required(),
|
|
34
|
+
index([OrderDirection.ASC, OrderDirection.DSC]),
|
|
35
|
+
description("Product concentration or dosage (e.g., 500mg, 10%)."),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], ProductStrength.prototype, "strength", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
column(),
|
|
40
|
+
index([OrderDirection.ASC, OrderDirection.DSC]),
|
|
41
|
+
description("Active substance related to this product strength."),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], ProductStrength.prototype, "substance", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
column(),
|
|
46
|
+
description("Legal entity name responsible for the product."),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], ProductStrength.prototype, "legalEntityName", void 0);
|
|
49
|
+
ProductStrength = __decorate([
|
|
50
|
+
uses(FabricFlavour),
|
|
51
|
+
table(TableNames.ProductStrength),
|
|
52
|
+
model(),
|
|
53
|
+
description("Represents the product’s strength and composition details."),
|
|
54
|
+
__metadata("design:paramtypes", [Object])
|
|
55
|
+
], ProductStrength);
|
|
56
|
+
export { ProductStrength };
|
|
57
|
+
//# sourceMappingURL=ProductStrength.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProductStrength.js","sourceRoot":"","sources":["../../../../src/contract/models/ProductStrength.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,uBAAoB;AACzC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,iCAA8B;AAE5D,OAAO,EAAE,aAAa,EAAE,gCAA2B;AAM5C,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,mBAAmB;IA6BtD,YAAY,KAAiC;QAC3C,KAAK,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;CACF,CAAA;AA7BC;IAFC,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IACrC,WAAW,CAAC,4CAA4C,CAAC;;2CAC9C;AASZ;IAFC,KAAK,CAAC,CAAC,cAAc,CAAC,GAAG,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAC/C,WAAW,CAAC,mDAAmD,CAAC;;oDAC5C;AAMrB;IAJC,MAAM,EAAE;IACR,QAAQ,EAAE;IACV,KAAK,CAAC,CAAC,cAAc,CAAC,GAAG,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAC/C,WAAW,CAAC,qDAAqD,CAAC;;iDACjD;AAKlB;IAHC,MAAM,EAAE;IACR,KAAK,CAAC,CAAC,cAAc,CAAC,GAAG,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAC/C,WAAW,CAAC,oDAAoD,CAAC;;kDAC/C;AAInB;IAFC,MAAM,EAAE;IACR,WAAW,CAAC,gDAAgD,CAAC;;wDACrC;AA3Bd,eAAe;IAJ3B,IAAI,CAAC,aAAa,CAAC;IACnB,KAAK,CAAC,UAAU,CAAC,eAAe,CAAC;IACjC,KAAK,EAAE;IACP,WAAW,CAAC,4DAA4D,CAAC;;GAC7D,eAAe,CAgC3B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const DatePattern = "yyyy-MM-dd";
|
|
2
|
+
export declare const BatchPattern: RegExp;
|
|
3
|
+
export declare enum TableNames {
|
|
4
|
+
Audit = "audit",
|
|
5
|
+
Batch = "batch",
|
|
6
|
+
GtinOwner = "gtin_owner",
|
|
7
|
+
Leaflet = "leaflet",
|
|
8
|
+
LeafletFile = "leaflet_file",
|
|
9
|
+
Product = "product",
|
|
10
|
+
Market = "market",
|
|
11
|
+
ProductStrength = "product_strength"
|
|
12
|
+
}
|
|
13
|
+
export declare enum AuditOperations {
|
|
14
|
+
REMOVE = "Remove user",
|
|
15
|
+
ADD = "Add user",
|
|
16
|
+
DEACTIVATE = "Deactivate user",
|
|
17
|
+
LOGIN = "Access wallet",
|
|
18
|
+
SHARED_ENCLAVE_CREATE = "Create identity",
|
|
19
|
+
BREAK_GLASS_RECOVERY = "Wallet recovered with the break Glass Recovery Code",
|
|
20
|
+
AUTHORIZE = "Authorize integration user",
|
|
21
|
+
REVOKE = "Revoke integration user",
|
|
22
|
+
DATA_RECOVERY = "Use of the Data Recovery Key",
|
|
23
|
+
RECOVERY_KEY_COPIED = "Copy Data Recovery Key"
|
|
24
|
+
}
|