Skip to content

Commit 812113e

Browse files
authored
Merge pull request #128 from ioet/feature-125/add-technologies-to-project
Feature 125/add technologies to project
2 parents 1b14d54 + d42b85c commit 812113e

File tree

4 files changed

+17
-8
lines changed

4 files changed

+17
-8
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ docker run -p 5000:5000 time_tracker_api:local
264264

265265
## Migrations
266266
Looking for a DB-agnostic migration tool, the only choice I found was [migrate-anything](https://pypi.org/project/migrate-anything/).
267-
An specific requirement file was created to run the migrations in `requirements/migrations.txt`. This way we do not mix
267+
A specific requirement file was created to run the migrations in `requirements/migrations.txt`. This way we do not mix
268268
any possible vulnerable dependency brought by these dependencies to the environment `prod`. Therefore the dependencies
269269
to run the migrations shall be installed this way:
270270

@@ -274,16 +274,16 @@ pip install -r requirements/migrations.txt
274274
```
275275

276276
All the migrations will be handled and created in the python package `migrations`. In order to create a migration we
277-
must do it manually (for now) and prefixed by a number, e.g. `migrations/01-initialize-db.py` in order to warranty the
277+
must do it manually (for now) and prefixed by a number, e.g. `migrations/01-initialize-db.py` in order to guarantee the
278278
order of execution alphabetically.
279279
Inside every migration there is an `up` and `down` method. The `down` method is executed from the persisted migration in
280-
the database. Whe a `down` logic that used external dependencies was tested it failed, whilst I put that same logic in
281-
the an `up` method it run correctly. In general the library seems to present [design issues](https://github.com/Lieturd/migrate-anything/issues/3).
280+
the database. When a `down` logic that used external dependencies was tested, it failed; whilst, I put that same logic in
281+
the `up` method, it run correctly. In general, the library seems to present [design issues](https://github.com/Lieturd/migrate-anything/issues/3).
282282
Therefore, it is recommended to apply changes just in one direction: `up`.
283283
For more information, please check out [some examples](https://github.com/Lieturd/migrate-anything/tree/master/examples)
284-
that illustrates the usage of this migration tool.
284+
that illustrate the usage of this migration tool.
285285

286-
Basically, for running the migrations you must execute
286+
Basically, for running the migrations you must execute:
287287

288288
```bash
289289
migrate-anything migrations

tests/time_tracker_api/projects/projects_namespace_test.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
"name": fake.company(),
1313
"description": fake.paragraph(),
1414
'customer_id': fake.uuid4(),
15-
'project_type_id': fake.uuid4()
15+
'project_type_id': fake.uuid4(),
16+
'technologies': ["python", "faker", "openapi"]
17+
1618
}
1719

1820
fake_project = ({
@@ -27,7 +29,6 @@ def test_create_project_should_succeed_with_valid_request(client: FlaskClient,
2729
repository_create_mock = mocker.patch.object(project_dao.repository,
2830
'create',
2931
return_value=fake_project)
30-
3132
response = client.post("/projects",
3233
headers=valid_header,
3334
json=valid_project_data,

time_tracker_api/projects/projects_model.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class ProjectCosmosDBModel(CosmosDBModel):
3030
customer_id: str
3131
deleted: str
3232
tenant_id: str
33+
technologies: list
3334

3435
def __init__(self, data):
3536
super(ProjectCosmosDBModel, self).__init__(data) # pragma: no cover

time_tracker_api/projects/projects_namespace.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@
3939
description='Id of the project type it belongs. This allows grouping the projects.',
4040
example=faker.uuid4(),
4141
),
42+
'technologies': fields.List(
43+
fields.String,
44+
title='List of technologies this project involves',
45+
required=False,
46+
description='List of technologies this project involves',
47+
example="['python', 'restplus', 'openapi']",
48+
)
4249
})
4350

4451
project_response_fields = {}

0 commit comments

Comments
 (0)