Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
it-bott-integrasjoner
ubw-client
Commits
26724264
Commit
26724264
authored
Dec 15, 2020
by
Jo Sama
😱
Browse files
Add support to fetch partial arbeidsordre
parent
b0d1ce2d
Pipeline
#48749
failed with stage
in 2 minutes and 5 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ubw_client/client.py
View file @
26724264
...
...
@@ -533,6 +533,29 @@ class UBWClient:
r
=
self
.
get
(
url
,
headers
=
headers
)
return
[
models
.
Arbeidsordre
.
from_dict
(
x
)
for
x
in
r
]
def
get_partial_arbeidsordrer
(
self
,
company_id
:
str
)
->
typing
.
List
[
models
.
PartialArbeidsordre
]:
url
=
self
.
urls
.
get_arbeidsordre
(
company_id
)
headers
=
self
.
config
.
rest
.
endpoints
.
begreper
.
headers
r
=
self
.
get
(
url
,
headers
=
headers
,
params
=
{
'select'
:
','
.
join
(
[
'companyId'
,
'workOrderId'
,
'dateFrom'
,
'dateTo'
,
'periodFrom'
,
'periodTo'
,
'status'
,
'projectId'
,
'workOrderName'
,
'costCentre'
,
'projectManagerId'
,
'category1'
,
'lastUpdated(updatedAt,updatedBy)'
])})
return
[
models
.
PartialArbeidsordre
.
from_dict
(
x
)
for
x
in
r
]
def
get_perioder
(
self
,
company_id
:
str
,
...
...
ubw_client/models.py
View file @
26724264
...
...
@@ -631,6 +631,26 @@ class CustomerInformation(BaseModel):
allow_population_by_field_name
=
True
class
PartialArbeidsordre
(
BaseModel
):
company_id
:
str
work_order_id
:
str
date_from
:
str
date_to
:
str
period_from
:
str
period_to
:
str
status
:
str
project_id
:
str
work_order_name
:
str
cost_centre
:
str
project_manager_id
:
str
category1
:
str
last_updated
:
UpdatedInfo
class
Config
:
alias_generator
=
to_lower_camel
allow_population_by_field_name
=
True
class
Arbeidsordre
(
BaseModel
):
company_id
:
str
work_order_id
:
str
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment