Skip to content
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

[WIP] Cria captura de tickets de atendimento do MoviDesk #369

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
0682260
cria captura movidesk
akaBotelho Dec 23, 2024
f1b7f70
import movidesk flows
akaBotelho Dec 26, 2024
823a81d
corrige parametro
akaBotelho Dec 26, 2024
636c41c
add headers
akaBotelho Dec 26, 2024
021f73b
altera source name
akaBotelho Dec 26, 2024
20caeac
altera retorno create_tickets_extractor
akaBotelho Dec 26, 2024
25a69fd
teste create_tickets_extractor
akaBotelho Dec 26, 2024
08f75a0
altera service para teste
akaBotelho Dec 26, 2024
217751d
corrige service para teste
akaBotelho Dec 26, 2024
2a6478f
altera transform_to_nested_structure
akaBotelho Dec 26, 2024
062421c
altera transform_raw_to_nested_structure
akaBotelho Dec 26, 2024
649f760
Merge branch 'main' into staging/flow-movidesk
akaBotelho Dec 27, 2024
8659cf9
Merge branch 'main' into staging/flow-movidesk
mergify[bot] Dec 30, 2024
b4929a8
Merge branch 'main' into staging/flow-movidesk
mergify[bot] Jan 2, 2025
d3abaf2
Merge branch 'main' into staging/flow-movidesk
mergify[bot] Jan 2, 2025
bcadb02
Merge branch 'main' into staging/flow-movidesk
mergify[bot] Jan 3, 2025
85190fe
Merge branch 'main' into staging/flow-movidesk
mergify[bot] Jan 6, 2025
72b644f
Merge branch 'main' into staging/flow-movidesk
mergify[bot] Jan 6, 2025
c37e0ed
Merge branch 'main' into staging/flow-movidesk
mergify[bot] Jan 6, 2025
eaec647
Merge branch 'main' into staging/flow-movidesk
mergify[bot] Jan 6, 2025
a618483
Merge branch 'main' into staging/flow-movidesk
mergify[bot] Jan 13, 2025
a260e3f
Merge branch 'main' into staging/flow-movidesk
mergify[bot] Jan 13, 2025
f276434
Merge branch 'main' into staging/flow-movidesk
mergify[bot] Jan 13, 2025
9c98405
Merge branch 'main' into staging/flow-movidesk
mergify[bot] Jan 16, 2025
5ae52f1
Merge branch 'main' into staging/flow-movidesk
mergify[bot] Jan 16, 2025
70ee6d0
Merge branch 'main' into staging/flow-movidesk
mergify[bot] Jan 16, 2025
3e99bb0
Merge branch 'main' into staging/flow-movidesk
mergify[bot] Jan 21, 2025
d741c68
Merge branch 'main' into staging/flow-movidesk
mergify[bot] Jan 22, 2025
f92b7ec
Merge branch 'main' into staging/flow-movidesk
mergify[bot] Jan 22, 2025
519f90d
Merge branch 'main' into staging/flow-movidesk
mergify[bot] Jan 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
teste create_tickets_extractor
  • Loading branch information
akaBotelho committed Dec 26, 2024
commit 25a69fd4aa9aedf4914ec30f383c78d8562b2a08
43 changes: 18 additions & 25 deletions pipelines/capture/movidesk/tasks.py
Original file line number Diff line number Diff line change
@@ -25,29 +25,22 @@ def create_tickets_extractor(
start = datetime.strftime(timestamp - timedelta(days=1), "%Y-%m-%dT%H:%M:%S.%MZ")
end = datetime.strftime(timestamp, "%Y-%m-%dT%H:%M:%S.%MZ")
token = get_secret(constants.MOVIDESK_SECRET_PATH.value)["token"]
params = [
{
"token": token,
"$select": "id,protocol,createdDate,lastUpdate",
"$filter": f"serviceFirstLevel eq '{service} - Recurso Viagens Subsídio'and (lastUpdate ge {start} and lastUpdate lt {end} or createdDate ge {start} and createdDate lt {end})", # noqa
"$expand": "customFieldValues,customFieldValues($expand=items)",
"$orderby": "createdDate asc",
}
for service in smtr_constants.SUBSIDIO_SPPO_RECURSO_TABLE_CAPTURE_PARAMS.value
]
service = "recursos_sppo_reprocessamento"
params = {
"token": token,
"$select": "id,protocol,createdDate,lastUpdate",
"$filter": f"serviceFirstLevel eq '{service} - Recurso Viagens Subsídio'and (lastUpdate ge {start} and lastUpdate lt {end} or createdDate ge {start} and createdDate lt {end})", # noqa
"$expand": "customFieldValues,customFieldValues($expand=items)",
"$orderby": "createdDate asc",
}

partial_list = [
partial(
get_raw_api_top_skip,
url=constants.TICKETS_BASE_URL.value,
headers=None,
params=param,
top_param_name="$top",
skip_param_name="$skip",
page_size=1000,
max_page=10,
)
for param in params
]

return partial_list
return partial(
get_raw_api_top_skip,
url=constants.TICKETS_BASE_URL.value,
headers=None,
params=params,
top_param_name="$top",
skip_param_name="$skip",
page_size=1000,
max_page=10,
)
Loading