diff --git a/README.md b/README.md index 33c0cdd6a..6e96f6c54 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ # Simple CPQ Simply CPQ soll eine kleine, einfache CPQ Lösung für Klein- und Mittständische Unternehmen sein, die schnell aufgesetzt ist und leicht zu pflegen und warten. -Folgende Eigenschaften soll sie besitzen: + +## Folgende Eigenschaften soll sie besitzen: - Open Source Lösung - Source Code überprüfbar und auf Wunsch erweiterbar (GPL 3) - Ohne Vendor-Login @@ -33,7 +34,21 @@ Folgende Eigenschaften soll sie besitzen: - Implementiert auf Basis von GO (Server lassen sich sehr einfach mit GO bauen) - Mehrsprachig - Produktdaten - - Pflege der Logik in Excel + - Pflege der Logik in Excel (bin ich mir noch nicht sicher) - Produktdatenimport, Preis- und Kostenlisten sowie Logik als CSV - K-Modell von Axel Brinkop - Globaler Merkmalspool für eindeutige Merkmale und deren Wertemengen + +## Installation + +## Erste Schritte + +## Entwicklungstools: +### Go +Die Software ist hauptsächlich in GO geschrieben ab der Version 1.22. + +### VSCode +Als Quelltext-Editor / IDE kommt VSCode zum Einsatz. + +### DBeaver +Ist der Datenbank-Editor diff --git a/buildtime/client/README.md b/buildtime/client/README.md new file mode 100644 index 000000000..c043a495b --- /dev/null +++ b/buildtime/client/README.md @@ -0,0 +1,2 @@ +# Simply CPQ Buildtime Client +Dieser Ordner enthält alle relevanten Dateien und Informationen zum Simply CPQ Buildtime Client. Dieser dient der Pflege von Produktdaten, Regeln, Konditionen und Administration der Simply CPQ Anwendung. diff --git a/buildtime/server/README.md b/buildtime/server/README.md new file mode 100644 index 000000000..f3a70f691 --- /dev/null +++ b/buildtime/server/README.md @@ -0,0 +1,2 @@ +# Simply CPQ Buildtime Server +Dieser Ordner enthält alle relevanten Dateien und Informationen zum Simply CPQ Buildtime Server. Dieser dient der Pflege von Produktdaten, Regeln, Konditionen und Administration der Simply CPQ Anwendung durch die Bereitstellung des Pflege-Servers. \ No newline at end of file diff --git a/database/dbscripts/simply-cpq-master-data.sql b/database/dbscripts/simply-cpq-master-data.sql new file mode 100644 index 000000000..a3ae59c74 --- /dev/null +++ b/database/dbscripts/simply-cpq-master-data.sql @@ -0,0 +1,747 @@ +-- DROP SCHEMA public; + +CREATE SCHEMA public AUTHORIZATION pg_database_owner; + +COMMENT ON SCHEMA public IS 'standard public schema'; + +-- DROP SEQUENCE public.calculations_id_seq; + +CREATE SEQUENCE public.calculations_id_seq + INCREMENT BY 1 + MINVALUE 1 + MAXVALUE 2147483647 + START 1 + CACHE 1 + NO CYCLE; +-- DROP SEQUENCE public.condition_application_id_seq; + +CREATE SEQUENCE public.condition_application_id_seq + INCREMENT BY 1 + MINVALUE 1 + MAXVALUE 2147483647 + START 1 + CACHE 1 + NO CYCLE; +-- DROP SEQUENCE public.conditions_id_seq; + +CREATE SEQUENCE public.conditions_id_seq + INCREMENT BY 1 + MINVALUE 1 + MAXVALUE 2147483647 + START 1 + CACHE 1 + NO CYCLE; +-- DROP SEQUENCE public.languages_id_seq; + +CREATE SEQUENCE public.languages_id_seq + INCREMENT BY 1 + MINVALUE 1 + MAXVALUE 2147483647 + START 1 + CACHE 1 + NO CYCLE; +-- DROP SEQUENCE public.meta_fieldcatalog_id_seq; + +CREATE SEQUENCE public.meta_fieldcatalog_id_seq + INCREMENT BY 1 + MINVALUE 1 + MAXVALUE 2147483647 + START 1 + CACHE 1 + NO CYCLE; +-- DROP SEQUENCE public.product_type_groups_id_seq; + +CREATE SEQUENCE public.product_type_groups_id_seq + INCREMENT BY 1 + MINVALUE 1 + MAXVALUE 2147483647 + START 1 + CACHE 1 + NO CYCLE; +-- DROP SEQUENCE public.product_type_id_seq; + +CREATE SEQUENCE public.product_type_id_seq + INCREMENT BY 1 + MINVALUE 1 + MAXVALUE 2147483647 + START 1 + CACHE 1 + NO CYCLE; +-- DROP SEQUENCE public.product_type_structure_nodes_id_seq; + +CREATE SEQUENCE public.product_type_structure_nodes_id_seq + INCREMENT BY 1 + MINVALUE 1 + MAXVALUE 2147483647 + START 1 + CACHE 1 + NO CYCLE; +-- DROP SEQUENCE public.property_type_group_id_seq; + +CREATE SEQUENCE public.property_type_group_id_seq + INCREMENT BY 1 + MINVALUE 1 + MAXVALUE 2147483647 + START 1 + CACHE 1 + NO CYCLE; +-- DROP SEQUENCE public.property_types_id_seq; + +CREATE SEQUENCE public.property_types_id_seq + INCREMENT BY 1 + MINVALUE 1 + MAXVALUE 2147483647 + START 1 + CACHE 1 + NO CYCLE; +-- DROP SEQUENCE public.row_descriptions_id_seq; + +CREATE SEQUENCE public.row_descriptions_id_seq + INCREMENT BY 1 + MINVALUE 1 + MAXVALUE 2147483647 + START 1 + CACHE 1 + NO CYCLE; +-- DROP SEQUENCE public.rules_list_product_type_set_amount_of_id_seq; + +CREATE SEQUENCE public.rules_list_product_type_set_amount_of_id_seq + INCREMENT BY 1 + MINVALUE 1 + MAXVALUE 2147483647 + START 1 + CACHE 1 + NO CYCLE; +-- DROP SEQUENCE public.units_id_seq; + +CREATE SEQUENCE public.units_id_seq + INCREMENT BY 1 + MINVALUE 1 + MAXVALUE 2147483647 + START 1 + CACHE 1 + NO CYCLE; +-- DROP SEQUENCE public.values_id_seq; + +CREATE SEQUENCE public.values_id_seq + INCREMENT BY 1 + MINVALUE 1 + MAXVALUE 2147483647 + START 1 + CACHE 1 + NO CYCLE; +-- DROP SEQUENCE public.values_type_id_seq; + +CREATE SEQUENCE public.values_type_id_seq + INCREMENT BY 1 + MINVALUE 1 + MAXVALUE 2147483647 + START 1 + CACHE 1 + NO CYCLE;-- public.calculations definition + +-- Drop table + +-- DROP TABLE public.calculations; + +CREATE TABLE public.calculations ( + id serial4 NOT NULL, + "label" varchar NULL, -- Bezeichner der Kalkulationsdefinition + description varchar NULL, -- Beschreibung der Kalkulationsvorschrift + formula varchar NOT NULL, -- Formel der kalkulation:¶{field_id}+-*/[row_id]¶Die Werte aus der jeweiligen Spalte werden genommen. + CONSTRAINT calculations_formula_not_null NOT NULL formula, + CONSTRAINT calculations_id_not_null NOT NULL id, + CONSTRAINT calculations_pk PRIMARY KEY (id) +); +COMMENT ON TABLE public.calculations IS 'Kalkulationsdefinitionen für Kalkulationsspalten'; + +-- Column comments + +COMMENT ON COLUMN public.calculations."label" IS 'Bezeichner der Kalkulationsdefinition'; +COMMENT ON COLUMN public.calculations.description IS 'Beschreibung der Kalkulationsvorschrift'; +COMMENT ON COLUMN public.calculations.formula IS 'Formel der kalkulation: +{field_id}+-*/[row_id] +Die Werte aus der jeweiligen Spalte werden genommen.'; + + +-- public.condition_applications definition + +-- Drop table + +-- DROP TABLE public.condition_applications; + +CREATE TABLE public.condition_applications ( + id int4 DEFAULT nextval('condition_application_id_seq'::regclass) NOT NULL, + "label" varchar NULL, + description varchar NULL, + CONSTRAINT condition_application_id_not_null NOT NULL id, + CONSTRAINT condition_application_pk PRIMARY KEY (id) +); +COMMENT ON TABLE public.condition_applications IS 'Z.B. Preisliste Deutschland'; + + +-- public.languages definition + +-- Drop table + +-- DROP TABLE public.languages; + +CREATE TABLE public.languages ( + id serial4 NOT NULL, + locale varchar NULL, -- Sprachlokalisierung der ausgewählten Sprache, z.B. "de-DE" für Deutsch + "language" varchar NULL, -- Name/Bezeichnung der Sprache + CONSTRAINT languages_id_not_null NOT NULL id, + CONSTRAINT languages_pk PRIMARY KEY (id) +); +COMMENT ON TABLE public.languages IS 'Sprachtabelle +Liste der zur Verfügung gestellten Sprachen.'; + +-- Column comments + +COMMENT ON COLUMN public.languages.locale IS 'Sprachlokalisierung der ausgewählten Sprache, z.B. "de-DE" für Deutsch'; +COMMENT ON COLUMN public.languages."language" IS 'Name/Bezeichnung der Sprache'; + + +-- public.meta_condition_fields definition + +-- Drop table + +-- DROP TABLE public.meta_condition_fields; + +CREATE TABLE public.meta_condition_fields ( + id int4 DEFAULT nextval('meta_fieldcatalog_id_seq'::regclass) NOT NULL, + table_name varchar NOT NULL, + table_field varchar NOT NULL, + "label" varchar NULL, + description varchar NULL, + CONSTRAINT meta_fieldcatalog_id_not_null NOT NULL id, + CONSTRAINT meta_fieldcatalog_pk PRIMARY KEY (id), + CONSTRAINT meta_fieldcatalog_table_field_not_null NOT NULL table_field, + CONSTRAINT meta_fieldcatalog_table_name_not_null NOT NULL table_name +); +COMMENT ON TABLE public.meta_condition_fields IS 'Felder für die Konditionsbeschreibung'; + + +-- public.product_types definition + +-- Drop table + +-- DROP TABLE public.product_types; + +CREATE TABLE public.product_types ( + id int4 DEFAULT nextval('product_type_id_seq'::regclass) NOT NULL, + product_identifierer varchar NOT NULL, + "label" varchar NULL, + CONSTRAINT product_type_id_not_null NOT NULL id, + CONSTRAINT product_type_pk PRIMARY KEY (id), + CONSTRAINT product_type_product_identifierer_not_null NOT NULL product_identifierer, + CONSTRAINT product_type_unique UNIQUE (product_identifierer) +); +COMMENT ON TABLE public.product_types IS 'Ein Produkttyp besteht aus Propertytypen, ggf. Strukturknoten, die Unterprodukttypen enthalten können und/oder Auswahlknoten, die ebenfalls Unterprodukttypen enthalten können'; + + +-- public.value_types definition + +-- Drop table + +-- DROP TABLE public.value_types; + +CREATE TABLE public.value_types ( + "label" varchar NULL, + id int4 DEFAULT nextval('values_type_id_seq'::regclass) NOT NULL, + CONSTRAINT values_type_id_not_null NOT NULL id, + CONSTRAINT values_types_pk PRIMARY KEY (id) +); + + +-- public.conditions definition + +-- Drop table + +-- DROP TABLE public.conditions; + +CREATE TABLE public.conditions ( + id serial4 NOT NULL, + "label" varchar NULL, + description varchar NULL, + application_id int4 NULL, + key_value varchar NOT NULL, -- String als semikolon separierte Liste von Schlüssel-ids, definiert über die Tabele condition_keys mit der entsprechenden condition_id + value float4 NOT NULL, -- Wert der Kondition + CONSTRAINT condition_pk PRIMARY KEY (id), + CONSTRAINT conditions_id_not_null NOT NULL id, + CONSTRAINT conditions_key_value_not_null NOT NULL key_value, + CONSTRAINT conditions_value_not_null NOT NULL value, + CONSTRAINT conditions_condition_application_fk FOREIGN KEY (application_id) REFERENCES public.condition_applications(id) +); + +-- Column comments + +COMMENT ON COLUMN public.conditions.key_value IS 'String als semikolon separierte Liste von Schlüssel-ids, definiert über die Tabele condition_keys mit der entsprechenden condition_id'; +COMMENT ON COLUMN public.conditions.value IS 'Wert der Kondition'; + + +-- public.meta_condition_keys definition + +-- Drop table + +-- DROP TABLE public.meta_condition_keys; + +CREATE TABLE public.meta_condition_keys ( + field_id int4 NOT NULL, + condition_position int4 NULL, + "label" varchar NULL, + description varchar NULL, + condition_key_id int4 NOT NULL, + CONSTRAINT meta_condition_keys_condition_key_id_not_null NOT NULL condition_key_id, + CONSTRAINT meta_condition_keys_field_id_not_null NOT NULL field_id, + CONSTRAINT meta_condition_keys_meta_condition_fields_fk FOREIGN KEY (field_id) REFERENCES public.meta_condition_fields(id) +); +COMMENT ON TABLE public.meta_condition_keys IS 'Keydefinition für Konditionen'; + + +-- public.product_type_groups definition + +-- Drop table + +-- DROP TABLE public.product_type_groups; + +CREATE TABLE public.product_type_groups ( + id serial4 NOT NULL, + "label" varchar NULL, + parent_group_id int4 NULL, + is_visible bool DEFAULT true NOT NULL, + CONSTRAINT product_type_groups_id_not_null NOT NULL id, + CONSTRAINT product_type_groups_is_visible_not_null NOT NULL is_visible, + CONSTRAINT product_type_groups_pk PRIMARY KEY (id), + CONSTRAINT product_type_groups_product_type_groups_fk FOREIGN KEY (parent_group_id) REFERENCES public.product_type_groups(id) +); +COMMENT ON TABLE public.product_type_groups IS 'Produktgruppe. Sie enthält die Property_types für die jeweiligen Produkte als Kopiervorlage'; + + +-- public.product_type_is_part_of definition + +-- Drop table + +-- DROP TABLE public.product_type_is_part_of; + +CREATE TABLE public.product_type_is_part_of ( + product_type_id int4 NOT NULL, -- Komponenten-ID + is_part_of_product_tyoe_id int4 NOT NULL, + "number" int4 DEFAULT 1 NOT NULL, + min_number int4 DEFAULT 0 NOT NULL, + max_number int4 DEFAULT 1 NOT NULL, + CONSTRAINT product_type_is_part_of_is_part_of_product_tyoe_id_not_null NOT NULL is_part_of_product_tyoe_id, + CONSTRAINT product_type_is_part_of_max_number_not_null NOT NULL max_number, + CONSTRAINT product_type_is_part_of_min_number_not_null NOT NULL min_number, + CONSTRAINT product_type_is_part_of_number_not_null NOT NULL number, + CONSTRAINT product_type_is_part_of_product_type_id_not_null NOT NULL product_type_id, + CONSTRAINT product_type_is_part_of_unique UNIQUE (product_type_id, is_part_of_product_tyoe_id), + CONSTRAINT product_type_is_part_of_product_types_fk FOREIGN KEY (product_type_id) REFERENCES public.product_types(id), + CONSTRAINT product_type_is_part_of_product_types_fk_1 FOREIGN KEY (is_part_of_product_tyoe_id) REFERENCES public.product_types(id) +); +COMMENT ON TABLE public.product_type_is_part_of IS 'Hat Teile Beziehung'; + +-- Column comments + +COMMENT ON COLUMN public.product_type_is_part_of.product_type_id IS 'Komponenten-ID'; + + +-- public.product_type_structure_nodes definition + +-- Drop table + +-- DROP TABLE public.product_type_structure_nodes; + +CREATE TABLE public.product_type_structure_nodes ( + id serial4 NOT NULL, + "label" varchar NULL, + is_one_off_structure bool DEFAULT false NOT NULL, + product_type_id int4 NOT NULL, -- Zu welchem Produkt gehört diese Struktur + CONSTRAINT product_type_structure_nodes_id_not_null NOT NULL id, + CONSTRAINT product_type_structure_nodes_is_one_off_structure_not_null NOT NULL is_one_off_structure, + CONSTRAINT product_type_structure_nodes_pk PRIMARY KEY (id), + CONSTRAINT product_type_structure_nodes_product_type_id_not_null NOT NULL product_type_id, + CONSTRAINT product_type_structure_nodes_product_types_fk FOREIGN KEY (product_type_id) REFERENCES public.product_types(id) +); +COMMENT ON TABLE public.product_type_structure_nodes IS 'Strukturknoten für unterprodukte'; + +-- Column comments + +COMMENT ON COLUMN public.product_type_structure_nodes.product_type_id IS 'Zu welchem Produkt gehört diese Struktur'; + + +-- public.product_type_translations definition + +-- Drop table + +-- DROP TABLE public.product_type_translations; + +CREATE TABLE public.product_type_translations ( + product_type_id int4 NOT NULL, + language_id int4 NOT NULL, + "translation" varchar NULL, + CONSTRAINT product_type_translations_language_id_not_null NOT NULL language_id, + CONSTRAINT product_type_translations_property_type_id_not_null NOT NULL product_type_id, + CONSTRAINT product_type_translations_languages_fk FOREIGN KEY (language_id) REFERENCES public.languages(id), + CONSTRAINT product_type_translations_product_type_fk FOREIGN KEY (product_type_id) REFERENCES public.product_types(id) +); + + +-- public.product_types_group_translations definition + +-- Drop table + +-- DROP TABLE public.product_types_group_translations; + +CREATE TABLE public.product_types_group_translations ( + product_types_group_id int4 NOT NULL, + language_id int4 NOT NULL, + "translation" varchar NULL, + CONSTRAINT product_types_group_translation_product_types_group_id_not_null NOT NULL product_types_group_id, + CONSTRAINT product_types_group_translations_language_id_not_null NOT NULL language_id, + CONSTRAINT product_types_group_translations_unique UNIQUE (product_types_group_id, language_id), + CONSTRAINT product_types_group_translations_languages_fk FOREIGN KEY (language_id) REFERENCES public.languages(id), + CONSTRAINT product_types_group_translations_product_type_groups_fk FOREIGN KEY (product_types_group_id) REFERENCES public.product_type_groups(id) +); + + +-- public.property_type_groups definition + +-- Drop table + +-- DROP TABLE public.property_type_groups; + +CREATE TABLE public.property_type_groups ( + id int4 DEFAULT nextval('property_type_group_id_seq'::regclass) NOT NULL, + "label" varchar NULL, + description varchar NULL, + parent_proper_type_group_id int4 NULL, + CONSTRAINT property_type_group_id_not_null NOT NULL id, + CONSTRAINT property_type_group_pk PRIMARY KEY (id), + CONSTRAINT property_type_group_property_type_group_fk FOREIGN KEY (parent_proper_type_group_id) REFERENCES public.property_type_groups(id) +); + + +-- public.property_types definition + +-- Drop table + +-- DROP TABLE public.property_types; + +CREATE TABLE public.property_types ( + id serial4 NOT NULL, + "label" varchar NULL, + value_type_id int4 NULL, + CONSTRAINT property_types_id_not_null NOT NULL id, + CONSTRAINT property_types_pk PRIMARY KEY (id), + CONSTRAINT property_types_value_types_fk FOREIGN KEY (value_type_id) REFERENCES public.value_types(id) +); +COMMENT ON TABLE public.property_types IS 'Vorlage für Merkmale eines Produktes'; + + +-- public.row_descriptions definition + +-- Drop table + +-- DROP TABLE public.row_descriptions; + +CREATE TABLE public.row_descriptions ( + id serial4 NOT NULL, + "label" varchar NULL, + description varchar NULL, + "position" int4 NOT NULL, + is_visible bool DEFAULT true NOT NULL, + field_id int4 NULL, + calculation_id int4 NULL, + is_editable bool DEFAULT false NOT NULL, + condition_id int4 NULL, + row_type int4 NULL, -- 1: field¶2: calculation¶3: condition + CONSTRAINT row_descriptions_id_not_null NOT NULL id, + CONSTRAINT row_descriptions_is_editable_not_null NOT NULL is_editable, + CONSTRAINT row_descriptions_is_visible_not_null NOT NULL is_visible, + CONSTRAINT row_descriptions_pk PRIMARY KEY (id), + CONSTRAINT row_descriptions_position_not_null NOT NULL "position", + CONSTRAINT row_descriptions_calculations_fk FOREIGN KEY (calculation_id) REFERENCES public.calculations(id), + CONSTRAINT row_descriptions_conditions_fk FOREIGN KEY (condition_id) REFERENCES public.conditions(id), + CONSTRAINT row_descriptions_meta_condition_fields_fk FOREIGN KEY (field_id) REFERENCES public.meta_condition_fields(id) +); + +-- Column comments + +COMMENT ON COLUMN public.row_descriptions.row_type IS '1: field +2: calculation +3: condition'; + + +-- public.row_translations definition + +-- Drop table + +-- DROP TABLE public.row_translations; + +CREATE TABLE public.row_translations ( + row_id int4 NOT NULL, + language_id int4 NOT NULL, + "translation" varchar NULL, + CONSTRAINT row_translations_language_id_not_null NOT NULL language_id, + CONSTRAINT row_translations_row_id_not_null NOT NULL row_id, + CONSTRAINT row_translations_unique UNIQUE (row_id, language_id), + CONSTRAINT row_translations_languages_fk FOREIGN KEY (language_id) REFERENCES public.languages(id), + CONSTRAINT row_translations_row_descriptions_fk FOREIGN KEY (row_id) REFERENCES public.row_descriptions(id) +); + + +-- public.rules_list_product_type_set_amount_of definition + +-- Drop table + +-- DROP TABLE public.rules_list_product_type_set_amount_of; + +CREATE TABLE public.rules_list_product_type_set_amount_of ( + id serial4 NOT NULL, + product_type_id int4 NOT NULL, -- Produkt für das die Regel gelten soll + component_x_product_type_id int4 NOT NULL, + component_y_product_type_id int4 NOT NULL, + component_x_amount int4 DEFAULT 1 NOT NULL, + factor int4 DEFAULT 1 NOT NULL, + description varchar NULL, + CONSTRAINT rules_list_product_type_pk PRIMARY KEY (id), + CONSTRAINT rules_list_product_type_set_amount__component_x_amount_not_null NOT NULL component_x_amount, + CONSTRAINT rules_list_product_type_set_amount_of_factor_not_null NOT NULL factor, + CONSTRAINT rules_list_product_type_set_amount_of_id_not_null NOT NULL id, + CONSTRAINT rules_list_product_type_set_amount_of_product_type_id_not_null NOT NULL product_type_id, + CONSTRAINT rules_list_product_type_set_component_x_product_type_i_not_null NOT NULL component_x_product_type_id, + CONSTRAINT rules_list_product_type_set_component_y_product_type_i_not_null NOT NULL component_y_product_type_id, + CONSTRAINT rules_list_product_type_set_amount_of_product_types_fk FOREIGN KEY (product_type_id) REFERENCES public.product_types(id), + CONSTRAINT rules_list_product_type_set_amount_of_product_types_fk_1 FOREIGN KEY (component_x_product_type_id) REFERENCES public.product_types(id), + CONSTRAINT rules_list_product_type_set_amount_of_product_types_fk_2 FOREIGN KEY (component_y_product_type_id) REFERENCES public.product_types(id) +); +COMMENT ON TABLE public.rules_list_product_type_set_amount_of IS 'In Solution product_type: +Ist die Komponente x mehr als a * vertreten (in dr Regel 1) +dann setzte amount of Komponente y auf a * factor (in der Regel auch 1)'; + +-- Column comments + +COMMENT ON COLUMN public.rules_list_product_type_set_amount_of.product_type_id IS 'Produkt für das die Regel gelten soll'; + + +-- public.structure_node_product_types_list definition + +-- Drop table + +-- DROP TABLE public.structure_node_product_types_list; + +CREATE TABLE public.structure_node_product_types_list ( + structure_node_id int4 NOT NULL, + product_type_id int4 NOT NULL, -- Produkte in der Struktur + CONSTRAINT structure_node_product_types_list_product_type_id_not_null NOT NULL product_type_id, + CONSTRAINT structure_node_product_types_list_structure_node_id_not_null NOT NULL structure_node_id, + CONSTRAINT structure_node_product_types_list_product_type_structure_nodes_ FOREIGN KEY (structure_node_id) REFERENCES public.product_type_structure_nodes(id), + CONSTRAINT structure_node_product_types_list_product_types_fk FOREIGN KEY (product_type_id) REFERENCES public.product_types(id) +); +COMMENT ON TABLE public.structure_node_product_types_list IS 'Produkte in einem Strukturknoten'; + +-- Column comments + +COMMENT ON COLUMN public.structure_node_product_types_list.product_type_id IS 'Produkte in der Struktur'; + + +-- public.units definition + +-- Drop table + +-- DROP TABLE public.units; + +CREATE TABLE public.units ( + id serial4 NOT NULL, + "label" varchar NULL, + description varchar NULL, + unit varchar NULL, + base_unit_id int4 NULL, -- Wenn es eine Ableitung von einer Base-Unit ist, so kann diese hier verlinkt werden und dann wird der base_unit_factor berücksichtigt. + base_unit_factor float4 NULL, -- Von der Bas eaus betrachtet der Faktor, der für die Umrechnung benötigt wird. + CONSTRAINT units_id_not_null NOT NULL id, + CONSTRAINT units_pk PRIMARY KEY (id), + CONSTRAINT units_units_fk FOREIGN KEY (base_unit_id) REFERENCES public.units(id) +); + +-- Column comments + +COMMENT ON COLUMN public.units.base_unit_id IS 'Wenn es eine Ableitung von einer Base-Unit ist, so kann diese hier verlinkt werden und dann wird der base_unit_factor berücksichtigt.'; +COMMENT ON COLUMN public.units.base_unit_factor IS 'Von der Bas eaus betrachtet der Faktor, der für die Umrechnung benötigt wird.'; + + +-- public."values" definition + +-- Drop table + +-- DROP TABLE public."values"; + +CREATE TABLE public."values" ( + id serial4 NOT NULL, + "label" varchar NULL, -- interne Bezeichnung + int_min_value int4 NULL, -- Kleinster oder einziger int_Wert + int_max_value int4 NULL, -- größter Wert, wenn Range + float_min_value float4 NULL, + float_max_value float4 NULL, + bool_value bool NULL, + value_type_id int4 NOT NULL, + value_translation_id int4 NULL, -- muss nicht gesetzt werden, z.B. bei Zahlen + is_range bool DEFAULT false NULL, + unit_id int4 NULL, + is_terminal bool NULL, + CONSTRAINT value_id_pk PRIMARY KEY (id), + CONSTRAINT values_id_not_null NOT NULL id, + CONSTRAINT values_value_type_id_not_null NOT NULL value_type_id, + CONSTRAINT values_units_fk FOREIGN KEY (unit_id) REFERENCES public.units(id), + CONSTRAINT values_values_type_fk FOREIGN KEY (value_type_id) REFERENCES public.value_types(id) +); + +-- Column comments + +COMMENT ON COLUMN public."values"."label" IS 'interne Bezeichnung'; +COMMENT ON COLUMN public."values".int_min_value IS 'Kleinster oder einziger int_Wert'; +COMMENT ON COLUMN public."values".int_max_value IS 'größter Wert, wenn Range'; +COMMENT ON COLUMN public."values".value_translation_id IS 'muss nicht gesetzt werden, z.B. bei Zahlen'; + + +-- public.product_type_group_products_types_list definition + +-- Drop table + +-- DROP TABLE public.product_type_group_products_types_list; + +CREATE TABLE public.product_type_group_products_types_list ( + product_type_group_id int4 NOT NULL, + product_type_id int4 NOT NULL, + is_mandatory bool DEFAULT false NOT NULL, + CONSTRAINT product_type_group_products_type_product_type_group_id_not_null NOT NULL product_type_group_id, + CONSTRAINT product_type_group_products_types_list_is_mandatory_not_null NOT NULL is_mandatory, + CONSTRAINT product_type_group_products_types_list_product_type_id_not_null NOT NULL product_type_id, + CONSTRAINT product_type_group_products_types_list_product_type_groups_fk FOREIGN KEY (product_type_group_id) REFERENCES public.product_type_groups(id), + CONSTRAINT product_type_group_products_types_list_product_types_fk FOREIGN KEY (product_type_id) REFERENCES public.product_types(id) +); + + +-- public.product_type_structure_node_translations definition + +-- Drop table + +-- DROP TABLE public.product_type_structure_node_translations; + +CREATE TABLE public.product_type_structure_node_translations ( + structure_node_id int4 NOT NULL, + language_id int4 NOT NULL, + "translation" varchar NULL, + CONSTRAINT product_type_structure_node_translat_structure_node_id_not_null NOT NULL structure_node_id, + CONSTRAINT product_type_structure_node_translations_language_id_not_null NOT NULL language_id, + CONSTRAINT product_type_structure_node_translations_languages_fk FOREIGN KEY (language_id) REFERENCES public.languages(id), + CONSTRAINT product_type_structure_node_translations_product_type_structure FOREIGN KEY (structure_node_id) REFERENCES public.product_type_structure_nodes(id) +); + + +-- public.product_type_values_list definition + +-- Drop table + +-- DROP TABLE public.product_type_values_list; + +CREATE TABLE public.product_type_values_list ( + product_type_id int4 NOT NULL, + property_type_id int4 NOT NULL, + value_id int4 NOT NULL, + CONSTRAINT product_type_values_list_product_type_id_not_null NOT NULL product_type_id, + CONSTRAINT product_type_values_list_property_type_id_not_null NOT NULL property_type_id, + CONSTRAINT product_type_values_list_unique UNIQUE (product_type_id, property_type_id), + CONSTRAINT product_type_values_list_value_id_not_null NOT NULL value_id, + CONSTRAINT product_type_values_list_product_types_fk FOREIGN KEY (product_type_id) REFERENCES public.product_types(id), + CONSTRAINT product_type_values_list_property_types_fk FOREIGN KEY (property_type_id) REFERENCES public.property_types(id), + CONSTRAINT product_type_values_list_values_fk FOREIGN KEY (value_id) REFERENCES public."values"(id) +); + + +-- public.property_type_group_list definition + +-- Drop table + +-- DROP TABLE public.property_type_group_list; + +CREATE TABLE public.property_type_group_list ( + property_type_group_id int4 NOT NULL, + property_type_id int4 NOT NULL, + CONSTRAINT property_type_group_list_property_type_group_id_not_null NOT NULL property_type_group_id, + CONSTRAINT property_type_group_list_property_type_id_not_null NOT NULL property_type_id, + CONSTRAINT property_type_group_list_unique UNIQUE (property_type_group_id, property_type_id), + CONSTRAINT property_type_group_list_property_type_groups_fk FOREIGN KEY (property_type_group_id) REFERENCES public.property_type_groups(id), + CONSTRAINT property_type_group_list_property_types_fk FOREIGN KEY (property_type_id) REFERENCES public.property_types(id) +); +COMMENT ON TABLE public.property_type_group_list IS 'Properties einer Produktgruppe'; + + +-- public.property_type_group_translations definition + +-- Drop table + +-- DROP TABLE public.property_type_group_translations; + +CREATE TABLE public.property_type_group_translations ( + property_type_group_id int4 NOT NULL, + language_id int4 NOT NULL, + "translation" varchar NULL, + CONSTRAINT property_type_group_translation_property_type_group_id_not_null NOT NULL property_type_group_id, + CONSTRAINT property_type_group_translations_language_id_not_null NOT NULL language_id, + CONSTRAINT property_type_group_translations_unique UNIQUE (property_type_group_id, language_id), + CONSTRAINT property_type_group_translations_languages_fk FOREIGN KEY (language_id) REFERENCES public.languages(id), + CONSTRAINT property_type_group_translations_property_type_group_fk FOREIGN KEY (property_type_group_id) REFERENCES public.property_type_groups(id) +); + + +-- public.property_type_translations definition + +-- Drop table + +-- DROP TABLE public.property_type_translations; + +CREATE TABLE public.property_type_translations ( + property_type_id int4 NOT NULL, + language_id int4 NOT NULL, + "translation" varchar NULL, + CONSTRAINT property_type_translations_language_id_not_null NOT NULL language_id, + CONSTRAINT property_type_translations_unique UNIQUE (property_type_id, language_id), + CONSTRAINT property_type_translations_value_id_not_null NOT NULL property_type_id, + CONSTRAINT property_type_translations_languages_fk FOREIGN KEY (language_id) REFERENCES public.languages(id), + CONSTRAINT property_type_translations_property_types_fk FOREIGN KEY (property_type_id) REFERENCES public.property_types(id) +); + + +-- public.value_lists definition + +-- Drop table + +-- DROP TABLE public.value_lists; + +CREATE TABLE public.value_lists ( + property_type_id int4 NULL, + value_id int4 NULL, + CONSTRAINT value_lists_unique UNIQUE (property_type_id, value_id), + CONSTRAINT value_lists_property_types_fk FOREIGN KEY (property_type_id) REFERENCES public.property_types(id), + CONSTRAINT value_lists_values_fk FOREIGN KEY (value_id) REFERENCES public."values"(id) +); +COMMENT ON TABLE public.value_lists IS 'List of possilbe values'; + + +-- public.value_translations definition + +-- Drop table + +-- DROP TABLE public.value_translations; + +CREATE TABLE public.value_translations ( + value_id int4 NOT NULL, + language_id int4 NOT NULL, + "translation" varchar NULL, + CONSTRAINT value_translation_language_id_not_null NOT NULL language_id, + CONSTRAINT value_translation_value_id_not_null NOT NULL value_id, + CONSTRAINT value_translations_unique UNIQUE (value_id, language_id), + CONSTRAINT value_translation_languages_fk FOREIGN KEY (language_id) REFERENCES public.languages(id), + CONSTRAINT value_translation_values_fk FOREIGN KEY (value_id) REFERENCES public."values"(id) +); \ No newline at end of file diff --git a/database/dbscripts/tsindt - simpy_cpq_master_data - public.erd b/database/dbscripts/tsindt - simpy_cpq_master_data - public.erd new file mode 100644 index 000000000..5c5098ad6 --- /dev/null +++ b/database/dbscripts/tsindt - simpy_cpq_master_data - public.erd @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/database/dbscripts/tsindt - simpy_cpq_master_data - public.graphml b/database/dbscripts/tsindt - simpy_cpq_master_data - public.graphml new file mode 100644 index 000000000..1f495f09a --- /dev/null +++ b/database/dbscripts/tsindt - simpy_cpq_master_data - public.graphml @@ -0,0 +1,1025 @@ + + + + + + + + + + + + calculations + id +label +description +formula + + + + + + + + + + + + + + + + condition_applications + id +label +description + + + + + + + + + + + + + + + + conditions + id +label +description +application_id +key_value +value + + + + + + + + + + + + + + + + languages + id +locale +language + + + + + + + + + + + + + + + + meta_condition_fields + id +table_name +table_field +label +description + + + + + + + + + + + + + + + + meta_condition_keys + field_id +condition_position +label +description +condition_key_id + + + + + + + + + + + + + + + + product_type_group_products_types_list + product_type_group_id +product_type_id +is_mandatory + + + + + + + + + + + + + + + + product_type_groups + id +label +parent_group_id +is_visible + + + + + + + + + + + + + + + + product_type_is_part_of + product_type_id +is_part_of_product_tyoe_id +number +min_number +max_number + + + + + + + + + + + + + + + + product_type_structure_node_translations + structure_node_id +language_id +translation + + + + + + + + + + + + + + + + product_type_structure_nodes + id +label +is_one_off_structure +product_type_id + + + + + + + + + + + + + + + + product_type_translations + product_type_id +language_id +translation + + + + + + + + + + + + + + + + product_type_values_list + product_type_id +property_type_id +value_id + + + + + + + + + + + + + + + + product_types + id +product_identifierer +label + + + + + + + + + + + + + + + + product_types_group_translations + product_types_group_id +language_id +translation + + + + + + + + + + + + + + + + property_type_group_list + property_type_group_id +property_type_id + + + + + + + + + + + + + + + + property_type_group_translations + property_type_group_id +language_id +translation + + + + + + + + + + + + + + + + property_type_groups + id +label +description +parent_proper_type_group_id + + + + + + + + + + + + + + + + property_type_translations + property_type_id +language_id +translation + + + + + + + + + + + + + + + + property_types + id +label +value_type_id + + + + + + + + + + + + + + + + row_descriptions + id +label +description +position +is_visible +field_id +calculation_id +is_editable +condition_id +row_type + + + + + + + + + + + + + + + + row_translations + row_id +language_id +translation + + + + + + + + + + + + + + + + rules_list_product_type_set_amount_of + id +product_type_id +component_x_product_type_id +component_y_product_type_id +component_x_amount +factor +description + + + + + + + + + + + + + + + + structure_node_product_types_list + structure_node_id +product_type_id + + + + + + + + + + + + + + + + units + id +label +description +unit +base_unit_id +base_unit_factor + + + + + + + + + + + + + + + + value_lists + property_type_id +value_id + + + + + + + + + + + + + + + + value_translations + value_id +language_id +translation + + + + + + + + + + + + + + + + value_types + label +id + + + + + + + + + + + + + + + + values + id +label +int_min_value +int_max_value +float_min_value +float_max_value +bool_value +value_type_id +value_translation_id +is_range +unit_id +is_terminal + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/database/dbscripts/tsindt - simpy_cpq_master_data - public.png b/database/dbscripts/tsindt - simpy_cpq_master_data - public.png new file mode 100644 index 000000000..440f42c52 Binary files /dev/null and b/database/dbscripts/tsindt - simpy_cpq_master_data - public.png differ diff --git a/documentation/01_general/Architekturmodell.drawio b/documentation/01_general/Architekturmodell.drawio new file mode 100644 index 000000000..bbe964e1b --- /dev/null +++ b/documentation/01_general/Architekturmodell.drawio @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/documentation/01_general/UseCases.md b/documentation/01_general/UseCases.md new file mode 100644 index 000000000..614aea60c --- /dev/null +++ b/documentation/01_general/UseCases.md @@ -0,0 +1,44 @@ +# Use Cases Simply CPQ +Ziel von Simply CPQ ist es, ein Werkzeug für den Vertrieb eines Unternehmens bereit zu stellen, mit dem Angebote für komplexe, variantenreiche Produkte und Lösungen schnell, fehlerfrei, zum korrekten Preis erstellt werden können. + +## Logical Editor +Der Logical Editor dient zum Erfassen von Daten, Produkten, Preisen, Merkmalen und Logiken der anzubietenden Produkte und Lösungen. + +### Sprachen + +#### Sprachen verwalten: +Ich als User kann neue Sprachen anlegen, löschen und ändern. Löschen kann ich eine Sprache nur, wenn sie nicht verwendet wird + +#### Übersetzungen pflegen: +Für folgende Daten kann ich Übersetzungen einpflegen, löschen und ändern: + +- Werte +- Merkmale +- Merkmalsgruppen +- Produkte +- Produktgruppen +- Spaltenamen +- Strukturknoten von Lösungen + +### Merkmale +Merkmale werden global definiert und strukturiert. Sie können Produktgruppen zugeordnet werden und damit werden sich auch automatisch allen Produkten und Produktgruppen unterhalb dieser Produktgruppe zugeordnet. Merkmale können mögliche Werte, Wertemengen oder MinMax-Werte beinhalten, je nach Typ des Merkmals. + +#### Merkmalsgruppen pflegen +Ich kann Merkmalsgruppen anlegen, löschen (sofern leer) und ändern. Diese Gruppen dienen der Strukturierung des Merkmalspools. Merkmalsgruppen können beliebig tief verschachtelt werden. + +#### Merkmalswert pflegen +Ich kann Werte anlegen, pflegen und löschen. Die Werte kann ich Merkmalen zuordnen, wenn der Werte-Typ identisch ist. + +#### Merkmale pflegen +Ich kann Merkmale anlegen, pflegen und löschen (wenn sie nicht in Verwendung sind). Ein Merkmal kann ich einen Bezeichner geben. Ein Merkmal kann ich einer Merkmalsgruppe zuordnen. Ich kann sehen, in welchen Produkten und Produktgruppen ein Merkmal verwendet wird. Ich kann einem Merkmal einen Wert, einen Wertebereich oder eine Liste möglicher Werte mitgeben. In den letzten Fällen muss dann dieses Merkmal bei der Auswahl eines Produktes mit diesem Merkmal der terminale Wert im Konfigurator bestimmt werden. + +### Datenbank-Sicherungen + +#### Sicherung erstellen: +Ich als Administrator kann zu jedem Zeitpunkt eine Sicherung der Master-Data Datenbank vornehmen. Ich führe dieses manuell aus. + +#### Sicherungen öffnen: +Ich als Adminstrator kann eine Instanz des Logical Editors mit einer Sicherungsdatenbank verbinden und öffnen. Hiermit kann ich mir den Versionsstand zu einem definierten Zeitpunkt der Datenbank anschauen + +## Quote Editor +Der Quote Editor dient zur Erstellung von Angeboten auf Basis der gepflegten Daten und Logiken. \ No newline at end of file diff --git a/runtime/client/README.md b/runtime/client/README.md new file mode 100644 index 000000000..b2b93f0bd --- /dev/null +++ b/runtime/client/README.md @@ -0,0 +1,2 @@ +# Simply CPQ Runtime Client +Dieser Ordner enthält alle relevanten Dateien und Informationen zum Simply CPQ Runtime Client. Dieser dient dem Schreiben von Angeboten. diff --git a/runtime/server/README.md b/runtime/server/README.md new file mode 100644 index 000000000..ce307cbb7 --- /dev/null +++ b/runtime/server/README.md @@ -0,0 +1,2 @@ +# Simply CPQ Runtime Server +Dieses Verzeichnis enthält alle Simply CPQ Runtime Server relevanten Dateien und Informationen. \ No newline at end of file