@dynamatix/gb-schemas 2.0.67 → 2.0.68
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/entities/product-catalogues/index.d.ts +2 -3
- package/dist/entities/product-catalogues/index.d.ts.map +1 -1
- package/dist/entities/product-catalogues/index.js +0 -1
- package/dist/entities/product-catalogues/product-definition.entity.d.ts +14 -2
- package/dist/entities/product-catalogues/product-definition.entity.d.ts.map +1 -1
- package/entities/product-catalogues/index.ts +3 -6
- package/entities/product-catalogues/product-definition.entity.ts +17 -4
- package/package.json +1 -1
- package/prisma/migrations/20250521194549_update_product_definition_schema/migration.sql +14 -0
- package/prisma/product-catalogues/product-definition.prisma +3 -3
- package/prisma/schema.prisma +2 -26
- package/dist/entities/product-catalogues/rule.entity.d.ts +0 -21
- package/dist/entities/product-catalogues/rule.entity.d.ts.map +0 -1
- package/dist/entities/product-catalogues/rule.entity.js +0 -5
- package/entities/product-catalogues/rule.entity.ts +0 -26
- package/prisma/product-catalogues/rule.prisma +0 -22
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { ProductCatalogue, ProductDefinition, ProductVariant, Product
|
|
2
|
-
export type { ProductCatalogue, ProductDefinition, ProductVariant, Product
|
|
1
|
+
import type { ProductCatalogue, ProductDefinition, ProductVariant, Product } from '@prisma/client';
|
|
2
|
+
export type { ProductCatalogue, ProductDefinition, ProductVariant, Product };
|
|
3
3
|
export * from './product-catalogue.entity';
|
|
4
4
|
export * from './product-definition.entity';
|
|
5
5
|
export * from './product-variant.entity';
|
|
6
6
|
export * from './product.entity';
|
|
7
|
-
export * from './rule.entity';
|
|
8
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../entities/product-catalogues/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../entities/product-catalogues/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,OAAO,EACV,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EACR,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,OAAO,EACV,CAAC;AAGF,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC"}
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import { ProductCatalogueEntity } from './product-catalogue.entity';
|
|
2
|
-
|
|
2
|
+
export interface Rule {
|
|
3
|
+
ruleId: string;
|
|
4
|
+
rule: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
scope?: string;
|
|
8
|
+
mandatory: boolean;
|
|
9
|
+
overrideRuleType?: string;
|
|
10
|
+
overrideRuleMessage?: string;
|
|
11
|
+
inheritedFrom?: string;
|
|
12
|
+
anyPass: boolean;
|
|
13
|
+
preCashflow: boolean;
|
|
14
|
+
}
|
|
3
15
|
export declare class ProductDefinitionEntity {
|
|
4
16
|
id: string;
|
|
5
17
|
productDefinitionId: string;
|
|
@@ -7,10 +19,10 @@ export declare class ProductDefinitionEntity {
|
|
|
7
19
|
name: string;
|
|
8
20
|
atLeastOnePass: boolean;
|
|
9
21
|
elements: any[];
|
|
22
|
+
rules: Rule[];
|
|
10
23
|
createdAt: Date;
|
|
11
24
|
updatedAt: Date;
|
|
12
25
|
productCatalogue?: ProductCatalogueEntity;
|
|
13
|
-
rules?: RuleEntity[];
|
|
14
26
|
constructor(partial: Partial<ProductDefinitionEntity>);
|
|
15
27
|
}
|
|
16
28
|
//# sourceMappingURL=product-definition.entity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-definition.entity.d.ts","sourceRoot":"","sources":["../../../entities/product-catalogues/product-definition.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"product-definition.entity.d.ts","sourceRoot":"","sources":["../../../entities/product-catalogues/product-definition.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAGpE,MAAM,WAAW,IAAI;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;CACxB;AAED,qBAAa,uBAAuB;IAChC,EAAE,EAAG,MAAM,CAAC;IACZ,mBAAmB,EAAG,MAAM,CAAC;IAC7B,kBAAkB,EAAG,MAAM,CAAC;IAC5B,IAAI,EAAG,MAAM,CAAC;IACd,cAAc,EAAG,OAAO,CAAC;IACzB,QAAQ,EAAG,GAAG,EAAE,CAAC;IACjB,KAAK,EAAG,IAAI,EAAE,CAAC;IACf,SAAS,EAAG,IAAI,CAAC;IACjB,SAAS,EAAG,IAAI,CAAC;IAGjB,gBAAgB,CAAC,EAAE,sBAAsB,CAAC;gBAC9B,OAAO,EAAE,OAAO,CAAC,uBAAuB,CAAC;CAGxD"}
|
|
@@ -2,8 +2,7 @@ import type {
|
|
|
2
2
|
ProductCatalogue,
|
|
3
3
|
ProductDefinition,
|
|
4
4
|
ProductVariant,
|
|
5
|
-
Product
|
|
6
|
-
Rule
|
|
5
|
+
Product
|
|
7
6
|
} from '@prisma/client';
|
|
8
7
|
|
|
9
8
|
// Export Prisma types
|
|
@@ -11,13 +10,11 @@ export type {
|
|
|
11
10
|
ProductCatalogue,
|
|
12
11
|
ProductDefinition,
|
|
13
12
|
ProductVariant,
|
|
14
|
-
Product
|
|
15
|
-
Rule
|
|
13
|
+
Product
|
|
16
14
|
};
|
|
17
15
|
|
|
18
16
|
// Export entity classes
|
|
19
17
|
export * from './product-catalogue.entity';
|
|
20
18
|
export * from './product-definition.entity';
|
|
21
19
|
export * from './product-variant.entity';
|
|
22
|
-
export * from './product.entity';
|
|
23
|
-
export * from './rule.entity';
|
|
20
|
+
export * from './product.entity';
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import { ProductCatalogueEntity } from './product-catalogue.entity';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
// Define Rule interface within the same file
|
|
4
|
+
export interface Rule {
|
|
5
|
+
ruleId: string;
|
|
6
|
+
rule: string;
|
|
7
|
+
name: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
scope?: string;
|
|
10
|
+
mandatory: boolean;
|
|
11
|
+
overrideRuleType?: string;
|
|
12
|
+
overrideRuleMessage?: string;
|
|
13
|
+
inheritedFrom?: string;
|
|
14
|
+
anyPass: boolean;
|
|
15
|
+
preCashflow: boolean;
|
|
16
|
+
}
|
|
3
17
|
|
|
4
18
|
export class ProductDefinitionEntity {
|
|
5
19
|
id!: string;
|
|
@@ -8,14 +22,13 @@ export class ProductDefinitionEntity {
|
|
|
8
22
|
name!: string;
|
|
9
23
|
atLeastOnePass!: boolean;
|
|
10
24
|
elements!: any[];
|
|
25
|
+
rules!: Rule[];
|
|
11
26
|
createdAt!: Date;
|
|
12
27
|
updatedAt!: Date;
|
|
13
28
|
|
|
14
29
|
// Relations
|
|
15
30
|
productCatalogue?: ProductCatalogueEntity;
|
|
16
|
-
rules?: RuleEntity[];
|
|
17
|
-
|
|
18
31
|
constructor(partial: Partial<ProductDefinitionEntity>) {
|
|
19
32
|
Object.assign(this, partial);
|
|
20
33
|
}
|
|
21
|
-
}
|
|
34
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Warnings:
|
|
3
|
+
|
|
4
|
+
- You are about to drop the `rules` table. If the table is not empty, all the data it contains will be lost.
|
|
5
|
+
|
|
6
|
+
*/
|
|
7
|
+
-- DropForeignKey
|
|
8
|
+
ALTER TABLE "rules" DROP CONSTRAINT "rules_product_definition_id_fkey";
|
|
9
|
+
|
|
10
|
+
-- AlterTable
|
|
11
|
+
ALTER TABLE "product_definitions" ADD COLUMN "rules" JSONB NOT NULL DEFAULT '[]';
|
|
12
|
+
|
|
13
|
+
-- DropTable
|
|
14
|
+
DROP TABLE "rules";
|
|
@@ -5,12 +5,12 @@ model ProductDefinition {
|
|
|
5
5
|
name String @map("name")
|
|
6
6
|
atLeastOnePass Boolean @map("at_least_one_pass")
|
|
7
7
|
elements Json @default("[]") @map("elements")
|
|
8
|
+
rules Json @default("[]") @map("rules")
|
|
8
9
|
createdAt DateTime @default(now()) @map("created_at")
|
|
9
10
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
10
11
|
|
|
11
12
|
// Relations
|
|
12
|
-
productCatalogue
|
|
13
|
-
rules Rule[]
|
|
13
|
+
productCatalogue ProductCatalogue @relation(fields: [productCatalogueId], references: [id])
|
|
14
14
|
|
|
15
15
|
@@map("product_definitions")
|
|
16
|
-
}
|
|
16
|
+
}
|
package/prisma/schema.prisma
CHANGED
|
@@ -418,12 +418,12 @@ model ProductDefinition {
|
|
|
418
418
|
name String @map("name")
|
|
419
419
|
atLeastOnePass Boolean @map("at_least_one_pass")
|
|
420
420
|
elements Json @default("[]") @map("elements")
|
|
421
|
+
rules Json @default("[]") @map("rules")
|
|
421
422
|
createdAt DateTime @default(now()) @map("created_at")
|
|
422
423
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
423
424
|
|
|
424
425
|
// Relations
|
|
425
|
-
productCatalogue
|
|
426
|
-
rules Rule[]
|
|
426
|
+
productCatalogue ProductCatalogue @relation(fields: [productCatalogueId], references: [id])
|
|
427
427
|
|
|
428
428
|
@@map("product_definitions")
|
|
429
429
|
}
|
|
@@ -457,30 +457,6 @@ model Product {
|
|
|
457
457
|
@@map("products")
|
|
458
458
|
}
|
|
459
459
|
|
|
460
|
-
// From prisma/product-catalogues/rule.prisma
|
|
461
|
-
model Rule {
|
|
462
|
-
id String @id @default(uuid())
|
|
463
|
-
ruleId String @unique @map("rule_id")
|
|
464
|
-
rule String @map("rule")
|
|
465
|
-
name String @map("name")
|
|
466
|
-
description String? @map("description")
|
|
467
|
-
scope String? @map("scope")
|
|
468
|
-
mandatory Boolean @map("mandatory")
|
|
469
|
-
overrideRuleType String? @map("override_rule_type")
|
|
470
|
-
overrideRuleMessage String? @map("override_rule_message")
|
|
471
|
-
inheritedFrom String? @map("inherited_from")
|
|
472
|
-
anyPass Boolean @map("any_pass")
|
|
473
|
-
preCashflow Boolean @map("pre_cashflow")
|
|
474
|
-
productDefinitionId String @map("product_definition_id")
|
|
475
|
-
createdAt DateTime @default(now()) @map("created_at")
|
|
476
|
-
updatedAt DateTime @updatedAt @map("updated_at")
|
|
477
|
-
|
|
478
|
-
// Relations
|
|
479
|
-
productDefinition ProductDefinition @relation(fields: [productDefinitionId], references: [id])
|
|
480
|
-
|
|
481
|
-
@@map("rules")
|
|
482
|
-
}
|
|
483
|
-
|
|
484
460
|
// From prisma/applicants/applicant-credit-data.prisma
|
|
485
461
|
model ApplicantCreditData {
|
|
486
462
|
id String @id @default(uuid())
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ProductDefinitionEntity } from './product-definition.entity';
|
|
2
|
-
export declare class RuleEntity {
|
|
3
|
-
id: string;
|
|
4
|
-
ruleId: string;
|
|
5
|
-
rule: string;
|
|
6
|
-
name: string;
|
|
7
|
-
description?: string;
|
|
8
|
-
scope?: string;
|
|
9
|
-
mandatory: boolean;
|
|
10
|
-
overrideRuleType?: string;
|
|
11
|
-
overrideRuleMessage?: string;
|
|
12
|
-
inheritedFrom?: string;
|
|
13
|
-
anyPass: boolean;
|
|
14
|
-
preCashflow: boolean;
|
|
15
|
-
productDefinitionId: string;
|
|
16
|
-
createdAt: Date;
|
|
17
|
-
updatedAt: Date;
|
|
18
|
-
productDefinition?: ProductDefinitionEntity;
|
|
19
|
-
constructor(partial: Partial<RuleEntity>);
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=rule.entity.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rule.entity.d.ts","sourceRoot":"","sources":["../../../entities/product-catalogues/rule.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,qBAAa,UAAU;IACnB,EAAE,EAAG,MAAM,CAAC;IACZ,MAAM,EAAG,MAAM,CAAC;IAChB,IAAI,EAAG,MAAM,CAAC;IACd,IAAI,EAAG,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAG,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,EAAG,OAAO,CAAC;IAClB,WAAW,EAAG,OAAO,CAAC;IACtB,mBAAmB,EAAG,MAAM,CAAC;IAC7B,SAAS,EAAG,IAAI,CAAC;IACjB,SAAS,EAAG,IAAI,CAAC;IAGjB,iBAAiB,CAAC,EAAE,uBAAuB,CAAC;gBAEhC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC;CAG3C"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ProductDefinitionEntity } from './product-definition.entity';
|
|
2
|
-
|
|
3
|
-
export class RuleEntity {
|
|
4
|
-
id!: string;
|
|
5
|
-
ruleId!: string;
|
|
6
|
-
rule!: string;
|
|
7
|
-
name!: string;
|
|
8
|
-
description?: string;
|
|
9
|
-
scope?: string;
|
|
10
|
-
mandatory!: boolean;
|
|
11
|
-
overrideRuleType?: string;
|
|
12
|
-
overrideRuleMessage?: string;
|
|
13
|
-
inheritedFrom?: string;
|
|
14
|
-
anyPass!: boolean;
|
|
15
|
-
preCashflow!: boolean;
|
|
16
|
-
productDefinitionId!: string;
|
|
17
|
-
createdAt!: Date;
|
|
18
|
-
updatedAt!: Date;
|
|
19
|
-
|
|
20
|
-
// Relations
|
|
21
|
-
productDefinition?: ProductDefinitionEntity;
|
|
22
|
-
|
|
23
|
-
constructor(partial: Partial<RuleEntity>) {
|
|
24
|
-
Object.assign(this, partial);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
model Rule {
|
|
2
|
-
id String @id @default(uuid())
|
|
3
|
-
ruleId String @unique @map("rule_id")
|
|
4
|
-
rule String @map("rule")
|
|
5
|
-
name String @map("name")
|
|
6
|
-
description String? @map("description")
|
|
7
|
-
scope String? @map("scope")
|
|
8
|
-
mandatory Boolean @map("mandatory")
|
|
9
|
-
overrideRuleType String? @map("override_rule_type")
|
|
10
|
-
overrideRuleMessage String? @map("override_rule_message")
|
|
11
|
-
inheritedFrom String? @map("inherited_from")
|
|
12
|
-
anyPass Boolean @map("any_pass")
|
|
13
|
-
preCashflow Boolean @map("pre_cashflow")
|
|
14
|
-
productDefinitionId String @map("product_definition_id")
|
|
15
|
-
createdAt DateTime @default(now()) @map("created_at")
|
|
16
|
-
updatedAt DateTime @updatedAt @map("updated_at")
|
|
17
|
-
|
|
18
|
-
// Relations
|
|
19
|
-
productDefinition ProductDefinition @relation(fields: [productDefinitionId], references: [id])
|
|
20
|
-
|
|
21
|
-
@@map("rules")
|
|
22
|
-
}
|