-
Notifications
You must be signed in to change notification settings - Fork 56
Data model for spend price per building blocks and project settings #373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 13 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
4eb6e47
added constant with estimation types ESTIMATION_TYPE
maxceem 95074c7
winning submission from challenge 30096338
maxceem 647ee72
fix “GET /projects/{id}/estimations/{id}/items” endpoint
maxceem df06bf3
winning submission from the challenge 30096337
maxceem 1dda122
reset changes in config files
maxceem 2946084
fixed issues found during review, improved code quality, improved uni…
maxceem 8669f97
Merge branch 'dev' into feature/price-estimation-items/project-settings
maxceem 57aae7a
small fixes to postman
maxceem f30367e
fix swagger
maxceem f1dc776
re-save postman file in versions 2.1 for easier merging
maxceem 0db1130
Merge branch 'feature/price-estimation-items/building-blocks' into fe…
maxceem eda13da
make logic of filtering Project Estimation Items more general. Cleane…
maxceem 02bc7b0
use the solution from the second place submitter to take care about p…
maxceem f67092b
fix: more realistic condition for demo/test building block
maxceem 1a23721
fix: remove unnecessary ESTIMATION_TYPE.REFERENCE_PROGRAM
maxceem eaaaef0
refactor: correct name for model creating method defineProjectEstimat…
maxceem adec0ce
refactor: enhance unit test description
maxceem a8b24c4
Merge branch 'dev' into feature/price-estimation-items/merged
maxceem 70d70d8
fix: lint
maxceem File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
migrations/20190719_project_settings_and_project_estimation_items.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
-- CREATE NEW TABLES: | ||
-- project_settings | ||
-- project_estimation_items | ||
-- | ||
|
||
-- | ||
-- project_settings | ||
-- | ||
|
||
CREATE TABLE project_settings ( | ||
id bigint NOT NULL, | ||
key character varying(255), | ||
value character varying(255), | ||
"valueType" character varying(255), | ||
"projectId" bigint NOT NULL, | ||
metadata json NOT NULL DEFAULT '{}'::json, | ||
"readPermission" json NOT NULL DEFAULT '{}'::json, | ||
"writePermission" json NOT NULL DEFAULT '{}'::json, | ||
"deletedAt" timestamp with time zone, | ||
"createdAt" timestamp with time zone, | ||
"updatedAt" timestamp with time zone, | ||
"deletedBy" bigint, | ||
"createdBy" bigint NOT NULL, | ||
"updatedBy" bigint NOT NULL, | ||
CONSTRAINT project_settings_pkey PRIMARY KEY (id) | ||
); | ||
|
||
CREATE SEQUENCE project_settings_id_seq | ||
START WITH 1 | ||
INCREMENT BY 1 | ||
NO MINVALUE | ||
NO MAXVALUE | ||
CACHE 1; | ||
|
||
ALTER SEQUENCE project_settings_id_seq OWNED BY project_settings.id; | ||
|
||
ALTER TABLE project_settings | ||
ALTER COLUMN id SET DEFAULT nextval('project_settings_id_seq'); | ||
|
||
ALTER TABLE project_settings | ||
ADD CONSTRAINT project_settings_key_project_id UNIQUE (key, "projectId"); | ||
|
||
-- | ||
-- project_estimation_items | ||
-- | ||
|
||
CREATE TABLE project_estimation_items ( | ||
id bigint NOT NULL, | ||
"projectEstimationId" bigint NOT NULL, | ||
price double precision NOT NULL, | ||
type character varying(255) NOT NULL, | ||
"markupUsedReference" character varying(255) NOT NULL, | ||
"markupUsedReferenceId" bigint NOT NULL, | ||
metadata json NOT NULL DEFAULT '{}'::json, | ||
"deletedAt" timestamp with time zone, | ||
"createdAt" timestamp with time zone, | ||
"updatedAt" timestamp with time zone, | ||
"deletedBy" bigint, | ||
"createdBy" bigint NOT NULL, | ||
"updatedBy" bigint NOT NULL, | ||
CONSTRAINT project_estimation_items_pkey PRIMARY KEY (id) | ||
); | ||
|
||
CREATE SEQUENCE project_estimation_items_id_seq | ||
START WITH 1 | ||
INCREMENT BY 1 | ||
NO MINVALUE | ||
NO MAXVALUE | ||
CACHE 1; | ||
|
||
ALTER SEQUENCE project_estimation_items_id_seq OWNED BY form.id; | ||
|
||
ALTER TABLE project_estimation_items | ||
ALTER COLUMN id SET DEFAULT nextval('project_estimation_items_id_seq'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
-- | ||
-- CREATE NEW TABLE: | ||
-- building_blocks | ||
-- | ||
CREATE TABLE building_blocks ( | ||
id bigint NOT NULL, | ||
"key" character varying(255) NOT NULL, | ||
"config" json NOT NULL DEFAULT '{}'::json, | ||
"privateConfig" json NOT NULL DEFAULT '{}'::json, | ||
"deletedAt" timestamp with time zone, | ||
"createdAt" timestamp with time zone, | ||
"updatedAt" timestamp with time zone, | ||
"deletedBy" bigint, | ||
"createdBy" bigint NOT NULL, | ||
"updatedBy" bigint NOT NULL | ||
); | ||
|
||
ALTER TABLE building_blocks | ||
ADD CONSTRAINT building_blocks_key_uniq UNIQUE (key); | ||
|
||
CREATE SEQUENCE building_blocks_id_seq | ||
START WITH 1 | ||
INCREMENT BY 1 | ||
NO MINVALUE | ||
NO MAXVALUE | ||
CACHE 1; | ||
|
||
ALTER SEQUENCE building_blocks_id_seq OWNED BY building_blocks.id; | ||
|
||
ALTER TABLE building_blocks | ||
ALTER COLUMN id SET DEFAULT nextval('building_blocks_id_seq'); | ||
|
||
ALTER TABLE ONLY building_blocks | ||
ADD CONSTRAINT building_blocks_pkey PRIMARY KEY (id); | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.