@controleonline/ui-crm 1.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/actions/workers/manager/action.yml +147 -0
- package/.github/actions/workers/qa/action.yml +44 -0
- package/.github/actions/workers/security/action.yml +44 -0
- package/.github/actions/workers/technical-documenter/action.yml +51 -0
- package/.github/workflows/manager-worker.yml +167 -0
- package/.github/workflows/publish-npm.yml +40 -0
- package/.github/workflows/pull-request-checks.yml +29 -0
- package/.scrutinizer.yml +24 -0
- package/AGENTS.md +56 -0
- package/FUNDING.yml +1 -0
- package/docs/technical/Cliente-Vendedor-Vinculo-e-Permissoes.md +121 -0
- package/docs/technical/Income-Statements-Demonstrativo.md +38 -0
- package/docs/technical/Oportunidades-Ordenacao-por-Data-de-Retorno.md +134 -0
- package/docs/technical/Propostas-Filtro-de-Status.md +147 -0
- package/docs/technical/Royalties-a-pagar-Franqueado.md +51 -0
- package/docs/technical/Visao-Vendedor-Comissoes.md +58 -0
- package/docs/wiki.md +1 -0
- package/package.json +43 -0
- package/scripts/validate-wiki-pointer.cjs +13 -0
- package/src/react/components/AnimatedModal.js +149 -0
- package/src/react/components/AnimatedModal.styles.js +21 -0
- package/src/react/components/CreateContractModal.js +151 -0
- package/src/react/components/CreateContractModal.styles.js +43 -0
- package/src/react/hooks/useToastMessage.js +59 -0
- package/src/react/index.js +4 -0
- package/src/react/pages/ModelTemplatesPage.js +1461 -0
- package/src/react/pages/ModelTemplatesPage.styles.js +441 -0
- package/src/react/pages/comissions/IncomeStatementDetailsModal.js +102 -0
- package/src/react/pages/comissions/IncomeStatementsFilters.js +120 -0
- package/src/react/pages/comissions/SellerCommissionsPage.js +368 -0
- package/src/react/pages/comissions/SellerCommissionsPage.styles.js +219 -0
- package/src/react/pages/comissions/incomeStatementsHelpers.js +233 -0
- package/src/react/pages/comissions/index.js +309 -0
- package/src/react/pages/comissions/index.styles.js +381 -0
- package/src/react/pages/comissions/sellerCommissionsHelpers.js +222 -0
- package/src/react/pages/crm/components/CrmHeader.js +117 -0
- package/src/react/pages/crm/components/MarketingEventsSection.js +142 -0
- package/src/react/pages/crm/components/MarketingEventsSection.styles.js +105 -0
- package/src/react/pages/crm/components/OpportunityCard.js +138 -0
- package/src/react/pages/crm/components/OpportunityFormModal.js +279 -0
- package/src/react/pages/crm/components/OpportunityList.js +113 -0
- package/src/react/pages/crm/components/OpportunitySkeletons.js +53 -0
- package/src/react/pages/crm/components/ProviderSelectModal.js +166 -0
- package/src/react/pages/crm/components/SelectModal.js +178 -0
- package/src/react/pages/crm/conversation.js +342 -0
- package/src/react/pages/crm/conversation.styles.js +206 -0
- package/src/react/pages/crm/hooks/useCrmData.js +494 -0
- package/src/react/pages/crm/hooks/useOpportunityForms.js +306 -0
- package/src/react/pages/crm/index.js +262 -0
- package/src/react/pages/crm/index.styles.js +13 -0
- package/src/react/pages/crm/marketingEventsHelpers.js +41 -0
- package/src/react/pages/crm/styles/card.styles.js +178 -0
- package/src/react/pages/crm/styles/layout.styles.js +184 -0
- package/src/react/pages/crm/styles/modal.styles.js +347 -0
- package/src/react/pages/home/index.js +559 -0
- package/src/react/pages/home/index.styles.js +268 -0
- package/src/react/pages/proposals/CreateProposalsModal.js +466 -0
- package/src/react/pages/proposals/CreateProposalsModal.styles.js +344 -0
- package/src/react/pages/proposals/CreateProposalsPickers.js +187 -0
- package/src/react/pages/proposals/CreateProposalsProductSection.js +117 -0
- package/src/react/pages/proposals/ProposalCard.js +112 -0
- package/src/react/pages/proposals/ProposalDetails.js +263 -0
- package/src/react/pages/proposals/ProposalDetails.styles.js +195 -0
- package/src/react/pages/proposals/index.js +488 -0
- package/src/react/pages/proposals/index.styles.js +248 -0
- package/src/react/pages/proposals/proposalListHelpers.js +216 -0
- package/src/react/pages/proposals/proposalNavigation.js +26 -0
- package/src/react/pages/royalties/ReceivablePage.js +233 -0
- package/src/react/pages/royalties/RoyaltiesPayablePage.js +260 -0
- package/src/react/pages/royalties/index.js +2 -0
- package/src/react/pages/royalties/royaltiesReceivableHelpers.js +68 -0
- package/src/react/pages/settings/GeneralSettings.js +317 -0
- package/src/react/pages/settings/GeneralSettings.shared.js +490 -0
- package/src/react/pages/settings/GeneralSettings.styles.js +746 -0
- package/src/react/pages/settings/GeneralSettingsSection.js +57 -0
- package/src/react/pages/settings/generalSettingsActiveTab.js +85 -0
- package/src/react/pages/settings/sections/CrmSection.js +281 -0
- package/src/react/pages/settings/sections/DeviceRuntimeFooterSection.js +128 -0
- package/src/react/pages/settings/sections/DisplayPreparationSection.js +155 -0
- package/src/react/pages/settings/sections/IntegrationsSection.js +392 -0
- package/src/react/pages/settings/sections/LogSection.js +322 -0
- package/src/react/pages/settings/sections/LoginSection.js +137 -0
- package/src/react/pages/settings/sections/LoyaltyProductPicker.js +230 -0
- package/src/react/pages/settings/sections/LoyaltySection.js +451 -0
- package/src/react/pages/settings/sections/MaintenanceSection.js +205 -0
- package/src/react/pages/settings/sections/MapsSection.js +629 -0
- package/src/react/pages/settings/sections/MenuCatalogSection.js +405 -0
- package/src/react/pages/settings/sections/OperationsSection.js +303 -0
- package/src/react/pages/settings/sections/OrderPaymentSection.js +379 -0
- package/src/react/pages/settings/sections/OrderPrintSection.js +308 -0
- package/src/react/pages/settings/sections/ShopSection.js +490 -0
- package/src/react/pages/settings/sections/shop/FranchiseMapPreview.js +124 -0
- package/src/react/pages/settings/sections/shop/ShopDomainCreateForm.js +57 -0
- package/src/react/pages/settings/sections/shop/ShopDomainPanel.js +184 -0
- package/src/react/pages/settings/sections/shop/ShopDomainShowcasesSection.js +237 -0
- package/src/react/pages/settings/sections/shop/ShopDomainShowcasesSection.styles.js +256 -0
- package/src/react/pages/settings/sections/shop/ShopDomainTabs.js +61 -0
- package/src/react/pages/settings/sections/shop/ShopFranchiseLocatorSection.js +526 -0
- package/src/react/pages/settings/sections/shop/ShopLoyaltySection.js +426 -0
- package/src/react/pages/settings/sections/shop/ShopSettingsSection.js +10 -0
- package/src/react/pages/settings/sections/shop/mapsFranchiseMapHelpers.js +163 -0
- package/src/react/pages/settings/sections/shop/shopDomainShowcasesUtils.js +68 -0
- package/src/react/pages/settings/sections/shop/shopFranchiseVisibility.js +158 -0
- package/src/react/pages/settings/sections/shop/shopSettingsShared.js +427 -0
- package/src/react/router/routes.js +135 -0
- package/src/react/utils/opportunityDate.js +82 -0
- package/src/react/utils/opportunityEditorReferences.js +76 -0
- package/src/react/utils/opportunityEmptyState.js +20 -0
- package/src/react/utils/opportunityPeople.js +111 -0
- package/src/react/utils/opportunityPhone.js +82 -0
- package/src/react/utils/opportunityStage.js +30 -0
- package/src/react/utils/opportunityStatusFilter.js +54 -0
- package/src/react/utils/proposalCreateHelpers.js +61 -0
- package/src/react/utils/proposalProductSelection.js +71 -0
- package/src/react/utils/royaltiesPayableParams.js +37 -0
- package/src/react/utils/translateWithFallback.js +42 -0
- package/src/store/crm/index.js +2 -0
- package/src/store/model/index.js +104 -0
- package/src/tests/browser/crm/create-proposal-product-category-filter.spec.js +149 -0
- package/src/tests/browser/crm/crm-index-status-filter.spec.js +263 -0
- package/src/tests/browser/crm/crm-opportunity-category-editor.spec.js +269 -0
- package/src/tests/browser/crm/royalties-payable.spec.js +122 -0
- package/src/tests/browser/crm/royalties-receivable.spec.js +121 -0
- package/src/tests/browser/crm/seller-commissions.spec.js +214 -0
- package/src/tests/browser/manager/general-settings-maps.spec.js +400 -0
- package/src/tests/react/pages/comissions/incomeStatementsHelpers.test.js +181 -0
- package/src/tests/react/pages/comissions/sellerCommissionsHelpers.test.js +132 -0
- package/src/tests/react/pages/crm/marketingEventsHelpers.test.cjs +53 -0
- package/src/tests/react/pages/crm/opportunitySearchParams.test.cjs +44 -0
- package/src/tests/react/pages/proposals/navigation.test.js +71 -0
- package/src/tests/react/pages/proposals/proposalListHelpers.test.js +42 -0
- package/src/tests/react/pages/royalties/royaltiesReceivableHelpers.test.js +60 -0
- package/src/tests/react/pages/settings/generalSettings.shared.test.js +102 -0
- package/src/tests/react/pages/settings/sections/shop/shopDomainShowcasesUtils.test.js +60 -0
- package/src/tests/react/pages/settings/sections/shop/shopFranchiseVisibility.test.js +80 -0
- package/src/tests/react/utils/opportunityEditorReferences.test.js +70 -0
- package/src/tests/react/utils/opportunityEmptyState.test.js +39 -0
- package/src/tests/react/utils/opportunityStatusFilter.test.cjs +81 -0
- package/src/tests/react/utils/proposalCreateHelpers.test.js +25 -0
- package/src/tests/react/utils/proposalProductSelection.test.js +76 -0
- package/src/tests/react/utils/royaltiesPayableParams.test.js +44 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
name: Manager Subworker
|
|
2
|
+
description: Resolve/cria issue, aplica labels e decide quais workers invocar (padrão de branch = master)
|
|
3
|
+
inputs:
|
|
4
|
+
gh_token:
|
|
5
|
+
description: PAT (GH_TOKEN)
|
|
6
|
+
required: true
|
|
7
|
+
branch:
|
|
8
|
+
description: Branch do push (master|dev|staging)
|
|
9
|
+
required: true
|
|
10
|
+
outputs:
|
|
11
|
+
issue_number:
|
|
12
|
+
description: Número da issue fonte
|
|
13
|
+
value: ${{ steps.resolve.outputs.issue_number }}
|
|
14
|
+
created:
|
|
15
|
+
description: true se a issue foi criada agora
|
|
16
|
+
value: ${{ steps.resolve.outputs.created }}
|
|
17
|
+
found:
|
|
18
|
+
description: true se issue veio do commit
|
|
19
|
+
value: ${{ steps.resolve.outputs.found }}
|
|
20
|
+
run_qa:
|
|
21
|
+
description: Manager decide invocar QA
|
|
22
|
+
value: ${{ steps.resolve.outputs.run_qa }}
|
|
23
|
+
run_security:
|
|
24
|
+
description: Manager decide invocar Security
|
|
25
|
+
value: ${{ steps.resolve.outputs.run_security }}
|
|
26
|
+
run_docs:
|
|
27
|
+
description: Manager decide invocar Technical Documenter
|
|
28
|
+
value: ${{ steps.resolve.outputs.run_docs }}
|
|
29
|
+
run_gates:
|
|
30
|
+
description: Manager decide checar quarteto em master
|
|
31
|
+
value: ${{ steps.resolve.outputs.run_gates }}
|
|
32
|
+
base_branch:
|
|
33
|
+
description: Branch canônico (sempre master se veio main)
|
|
34
|
+
value: ${{ steps.resolve.outputs.base_branch }}
|
|
35
|
+
runs:
|
|
36
|
+
using: composite
|
|
37
|
+
steps:
|
|
38
|
+
- name: Resolve issue, labels e plano de workers
|
|
39
|
+
id: resolve
|
|
40
|
+
shell: bash
|
|
41
|
+
env:
|
|
42
|
+
GH_TOKEN: ${{ inputs.gh_token }}
|
|
43
|
+
BRANCH_IN: ${{ inputs.branch }}
|
|
44
|
+
REPO: ${{ github.repository }}
|
|
45
|
+
SHA: ${{ github.sha }}
|
|
46
|
+
MSG: ${{ github.event.head_commit.message }}
|
|
47
|
+
BEFORE: ${{ github.event.before }}
|
|
48
|
+
run: |
|
|
49
|
+
set -euo pipefail
|
|
50
|
+
|
|
51
|
+
# Padrão da org: master (nunca main como branch de trabalho)
|
|
52
|
+
BRANCH="$BRANCH_IN"
|
|
53
|
+
if [ "$BRANCH" = "main" ]; then
|
|
54
|
+
echo "AVISO: branch main detectada — tratando como master (padrão org)"
|
|
55
|
+
BRANCH="master"
|
|
56
|
+
fi
|
|
57
|
+
echo "base_branch=$BRANCH" >> "$GITHUB_OUTPUT"
|
|
58
|
+
|
|
59
|
+
MESSAGES=$(git log --pretty=format:"%s %b" "${BEFORE}..${SHA}" 2>/dev/null || git log -1 --pretty=format:"%s %b")
|
|
60
|
+
ISSUE_REF=$(echo "$MESSAGES" | grep -oE '([A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+)?#([0-9]+)' | head -1 || true)
|
|
61
|
+
|
|
62
|
+
if [ -n "$ISSUE_REF" ]; then
|
|
63
|
+
NUM=$(echo "$ISSUE_REF" | grep -oE '[0-9]+$')
|
|
64
|
+
echo "found=true" >> "$GITHUB_OUTPUT"
|
|
65
|
+
echo "created=false" >> "$GITHUB_OUTPUT"
|
|
66
|
+
echo "issue_number=$NUM" >> "$GITHUB_OUTPUT"
|
|
67
|
+
echo "Issue fonte: #$NUM"
|
|
68
|
+
else
|
|
69
|
+
echo "Push sem issue → Manager cria issue"
|
|
70
|
+
TITLE="ops: orquestração automática (push ${BRANCH} ${SHA:0:7})"
|
|
71
|
+
BODY=$(cat <<EOF
|
|
72
|
+
## Manager Worker — issue automática
|
|
73
|
+
|
|
74
|
+
Push em \`${BRANCH}\` sem referência de issue no commit.
|
|
75
|
+
|
|
76
|
+
- **Commit**: ${SHA}
|
|
77
|
+
- **Mensagem**: ${MSG}
|
|
78
|
+
|
|
79
|
+
O Manager aplica labels e **invoca** os workers necessários (QA / Security / Technical Documenter) conforme o branch.
|
|
80
|
+
|
|
81
|
+
Fonte: https://raw.githubusercontent.com/ControleOnline/agents-mcp/master/agents/roles/manager/agent.md
|
|
82
|
+
EOF
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
LABELS='["agent:manager"]'
|
|
86
|
+
case "$BRANCH" in
|
|
87
|
+
master)
|
|
88
|
+
LABELS='["agent:manager","agent:technical-documenter"]'
|
|
89
|
+
;;
|
|
90
|
+
dev)
|
|
91
|
+
LABELS='["agent:manager","agent:qa","agent:security","agent:developer:done"]'
|
|
92
|
+
;;
|
|
93
|
+
staging)
|
|
94
|
+
LABELS='["agent:manager","agent:qa","agent:security"]'
|
|
95
|
+
;;
|
|
96
|
+
esac
|
|
97
|
+
|
|
98
|
+
RESPONSE=$(gh api --method POST \
|
|
99
|
+
-H "Accept: application/vnd.github+json" \
|
|
100
|
+
-H "X-GitHub-Api-Version: 2022-11-28" \
|
|
101
|
+
"/repos/${REPO}/issues" \
|
|
102
|
+
--input - <<EOF
|
|
103
|
+
{
|
|
104
|
+
"title": $(echo "$TITLE" | jq -Rs .),
|
|
105
|
+
"body": $(echo "$BODY" | jq -Rs .),
|
|
106
|
+
"labels": $LABELS
|
|
107
|
+
}
|
|
108
|
+
EOF
|
|
109
|
+
)
|
|
110
|
+
NUM=$(echo "$RESPONSE" | jq -r .number)
|
|
111
|
+
echo "found=false" >> "$GITHUB_OUTPUT"
|
|
112
|
+
echo "created=true" >> "$GITHUB_OUTPUT"
|
|
113
|
+
echo "issue_number=$NUM" >> "$GITHUB_OUTPUT"
|
|
114
|
+
echo "Issue criada: #$NUM"
|
|
115
|
+
fi
|
|
116
|
+
|
|
117
|
+
# Manager decide quais workers invocar
|
|
118
|
+
run_qa=false
|
|
119
|
+
run_security=false
|
|
120
|
+
run_docs=false
|
|
121
|
+
run_gates=false
|
|
122
|
+
|
|
123
|
+
case "$BRANCH" in
|
|
124
|
+
master)
|
|
125
|
+
run_docs=true
|
|
126
|
+
run_gates=true
|
|
127
|
+
gh issue edit "$NUM" --repo "$REPO" --add-label "agent:technical-documenter" || true
|
|
128
|
+
;;
|
|
129
|
+
dev)
|
|
130
|
+
run_qa=true
|
|
131
|
+
run_security=true
|
|
132
|
+
gh issue edit "$NUM" --repo "$REPO" --add-label "agent:qa" --add-label "agent:security" --add-label "agent:developer:done" || true
|
|
133
|
+
;;
|
|
134
|
+
staging)
|
|
135
|
+
run_qa=true
|
|
136
|
+
run_security=true
|
|
137
|
+
gh issue edit "$NUM" --repo "$REPO" --add-label "agent:qa" --add-label "agent:security" || true
|
|
138
|
+
;;
|
|
139
|
+
esac
|
|
140
|
+
|
|
141
|
+
echo "run_qa=$run_qa" >> "$GITHUB_OUTPUT"
|
|
142
|
+
echo "run_security=$run_security" >> "$GITHUB_OUTPUT"
|
|
143
|
+
echo "run_docs=$run_docs" >> "$GITHUB_OUTPUT"
|
|
144
|
+
echo "run_gates=$run_gates" >> "$GITHUB_OUTPUT"
|
|
145
|
+
|
|
146
|
+
gh issue comment "$NUM" --repo "$REPO" --body \
|
|
147
|
+
"**Manager** orquestrou push \`${BRANCH}\`: run_qa=$run_qa run_security=$run_security run_docs=$run_docs run_gates=$run_gates. Workers serão invocados a seguir."
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: QA Worker
|
|
2
|
+
description: Assign Copilot as QA — single link to agents-mcp
|
|
3
|
+
inputs:
|
|
4
|
+
gh_token:
|
|
5
|
+
required: true
|
|
6
|
+
issue_number:
|
|
7
|
+
required: true
|
|
8
|
+
base_branch:
|
|
9
|
+
default: dev
|
|
10
|
+
runs:
|
|
11
|
+
using: composite
|
|
12
|
+
steps:
|
|
13
|
+
- name: Assign Copilot as QA
|
|
14
|
+
shell: bash
|
|
15
|
+
env:
|
|
16
|
+
GH_TOKEN: ${{ inputs.gh_token }}
|
|
17
|
+
ISSUE: ${{ inputs.issue_number }}
|
|
18
|
+
REPO: ${{ github.repository }}
|
|
19
|
+
BASE: ${{ inputs.base_branch }}
|
|
20
|
+
run: |
|
|
21
|
+
set -euo pipefail
|
|
22
|
+
CUSTOM_INSTRUCTIONS='Atue 100% como QA do ControleOnline.
|
|
23
|
+
Leia e siga OBRIGATORIAMENTE a fonte canônica única:
|
|
24
|
+
https://raw.githubusercontent.com/ControleOnline/agents-mcp/master/agents/roles/qa/agent.md'
|
|
25
|
+
|
|
26
|
+
gh issue edit "$ISSUE" --repo "$REPO" --add-label "agent:qa" || true
|
|
27
|
+
|
|
28
|
+
gh api --method POST \
|
|
29
|
+
-H "Accept: application/vnd.github+json" \
|
|
30
|
+
-H "X-GitHub-Api-Version: 2022-11-28" \
|
|
31
|
+
"/repos/${REPO}/issues/${ISSUE}/assignees" \
|
|
32
|
+
--input - <<EOFINNER
|
|
33
|
+
{
|
|
34
|
+
"assignees": ["copilot-swe-agent[bot]"],
|
|
35
|
+
"agent_assignment": {
|
|
36
|
+
"target_repo": "${REPO}",
|
|
37
|
+
"base_branch": "${BASE}",
|
|
38
|
+
"custom_instructions": $(echo "$CUSTOM_INSTRUCTIONS" | jq -Rs .)
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
EOFINNER
|
|
42
|
+
|
|
43
|
+
gh issue comment "$ISSUE" --repo "$REPO" --body \
|
|
44
|
+
"Manager Worker → **QA**. Fonte: agents-mcp/agents/roles/qa/agent.md"
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: Security Worker
|
|
2
|
+
description: Assign Copilot as Security — single link to agents-mcp
|
|
3
|
+
inputs:
|
|
4
|
+
gh_token:
|
|
5
|
+
required: true
|
|
6
|
+
issue_number:
|
|
7
|
+
required: true
|
|
8
|
+
base_branch:
|
|
9
|
+
default: dev
|
|
10
|
+
runs:
|
|
11
|
+
using: composite
|
|
12
|
+
steps:
|
|
13
|
+
- name: Assign Copilot as Security
|
|
14
|
+
shell: bash
|
|
15
|
+
env:
|
|
16
|
+
GH_TOKEN: ${{ inputs.gh_token }}
|
|
17
|
+
ISSUE: ${{ inputs.issue_number }}
|
|
18
|
+
REPO: ${{ github.repository }}
|
|
19
|
+
BASE: ${{ inputs.base_branch }}
|
|
20
|
+
run: |
|
|
21
|
+
set -euo pipefail
|
|
22
|
+
CUSTOM_INSTRUCTIONS='Atue 100% como Security do ControleOnline.
|
|
23
|
+
Leia e siga OBRIGATORIAMENTE a fonte canônica única:
|
|
24
|
+
https://raw.githubusercontent.com/ControleOnline/agents-mcp/master/agents/roles/security/agent.md'
|
|
25
|
+
|
|
26
|
+
gh issue edit "$ISSUE" --repo "$REPO" --add-label "agent:security" || true
|
|
27
|
+
|
|
28
|
+
gh api --method POST \
|
|
29
|
+
-H "Accept: application/vnd.github+json" \
|
|
30
|
+
-H "X-GitHub-Api-Version: 2022-11-28" \
|
|
31
|
+
"/repos/${REPO}/issues/${ISSUE}/assignees" \
|
|
32
|
+
--input - <<EOFINNER
|
|
33
|
+
{
|
|
34
|
+
"assignees": ["copilot-swe-agent[bot]"],
|
|
35
|
+
"agent_assignment": {
|
|
36
|
+
"target_repo": "${REPO}",
|
|
37
|
+
"base_branch": "${BASE}",
|
|
38
|
+
"custom_instructions": $(echo "$CUSTOM_INSTRUCTIONS" | jq -Rs .)
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
EOFINNER
|
|
42
|
+
|
|
43
|
+
gh issue comment "$ISSUE" --repo "$REPO" --body \
|
|
44
|
+
"Manager Worker → **Security**. Fonte: agents-mcp/agents/roles/security/agent.md"
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
name: Technical Documenter Worker
|
|
2
|
+
description: Assign Copilot as technical-documenter — rules live only in agents-mcp
|
|
3
|
+
inputs:
|
|
4
|
+
gh_token:
|
|
5
|
+
required: true
|
|
6
|
+
issue_number:
|
|
7
|
+
required: true
|
|
8
|
+
base_branch:
|
|
9
|
+
default: master
|
|
10
|
+
runs:
|
|
11
|
+
using: composite
|
|
12
|
+
steps:
|
|
13
|
+
- name: Assign Copilot as technical-documenter
|
|
14
|
+
shell: bash
|
|
15
|
+
env:
|
|
16
|
+
GH_TOKEN: ${{ inputs.gh_token }}
|
|
17
|
+
ISSUE: ${{ inputs.issue_number }}
|
|
18
|
+
REPO: ${{ github.repository }}
|
|
19
|
+
BASE: ${{ inputs.base_branch }}
|
|
20
|
+
run: |
|
|
21
|
+
set -euo pipefail
|
|
22
|
+
# Regras 100% no agents-mcp — não copiar checklist/labels aqui
|
|
23
|
+
CUSTOM_INSTRUCTIONS='Atue 100% como technical-documenter do ControleOnline.
|
|
24
|
+
Leia e siga OBRIGATORIAMENTE (fonte canônica única):
|
|
25
|
+
https://raw.githubusercontent.com/ControleOnline/agents-mcp/master/agents/roles/technical-documenter/agent.md
|
|
26
|
+
|
|
27
|
+
Também leia:
|
|
28
|
+
https://raw.githubusercontent.com/ControleOnline/agents-mcp/master/agents/skills/shared/operations/copilot-cooperation.md
|
|
29
|
+
https://raw.githubusercontent.com/ControleOnline/agents-mcp/master/agents/skills/by-role/technical-documenter/README.md
|
|
30
|
+
|
|
31
|
+
Não use regras embutidas neste assignment; a fonte acima prevalece.'
|
|
32
|
+
|
|
33
|
+
gh issue edit "$ISSUE" --repo "$REPO" --add-label "agent:technical-documenter" || true
|
|
34
|
+
|
|
35
|
+
gh api --method POST \
|
|
36
|
+
-H "Accept: application/vnd.github+json" \
|
|
37
|
+
-H "X-GitHub-Api-Version: 2022-11-28" \
|
|
38
|
+
"/repos/${REPO}/issues/${ISSUE}/assignees" \
|
|
39
|
+
--input - <<EOFINNER
|
|
40
|
+
{
|
|
41
|
+
"assignees": ["copilot-swe-agent[bot]"],
|
|
42
|
+
"agent_assignment": {
|
|
43
|
+
"target_repo": "${REPO}",
|
|
44
|
+
"base_branch": "${BASE}",
|
|
45
|
+
"custom_instructions": $(echo "$CUSTOM_INSTRUCTIONS" | jq -Rs .)
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
EOFINNER
|
|
49
|
+
|
|
50
|
+
gh issue comment "$ISSUE" --repo "$REPO" --body \
|
|
51
|
+
"Manager Worker → **technical-documenter**. Fonte: agents-mcp/agents/roles/technical-documenter/agent.md"
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
name: Manager Worker
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master, dev, staging]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: write
|
|
9
|
+
issues: write
|
|
10
|
+
pull-requests: write
|
|
11
|
+
|
|
12
|
+
# Orquestrador: Manager resolve/cria issue e decide quais workers invocar.
|
|
13
|
+
# Padrão de branch da org = master (não usar main).
|
|
14
|
+
jobs:
|
|
15
|
+
manager:
|
|
16
|
+
name: Manager — resolve + plano de workers
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
outputs:
|
|
19
|
+
issue_number: ${{ steps.mgr.outputs.issue_number }}
|
|
20
|
+
created: ${{ steps.mgr.outputs.created }}
|
|
21
|
+
run_qa: ${{ steps.mgr.outputs.run_qa }}
|
|
22
|
+
run_security: ${{ steps.mgr.outputs.run_security }}
|
|
23
|
+
run_docs: ${{ steps.mgr.outputs.run_docs }}
|
|
24
|
+
run_gates: ${{ steps.mgr.outputs.run_gates }}
|
|
25
|
+
base_branch: ${{ steps.mgr.outputs.base_branch }}
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@v4
|
|
28
|
+
with:
|
|
29
|
+
fetch-depth: 0
|
|
30
|
+
|
|
31
|
+
- name: Manager subworker
|
|
32
|
+
id: mgr
|
|
33
|
+
uses: ./.github/actions/workers/manager
|
|
34
|
+
with:
|
|
35
|
+
gh_token: ${{ secrets.GH_TOKEN }}
|
|
36
|
+
branch: ${{ github.ref_name }}
|
|
37
|
+
|
|
38
|
+
# Workers invocados pelo plano do Manager (paralelo quando ambos true)
|
|
39
|
+
qa:
|
|
40
|
+
name: QA (invocado pelo Manager)
|
|
41
|
+
needs: manager
|
|
42
|
+
if: needs.manager.outputs.run_qa == 'true'
|
|
43
|
+
runs-on: ubuntu-latest
|
|
44
|
+
steps:
|
|
45
|
+
- uses: actions/checkout@v4
|
|
46
|
+
- uses: ./.github/actions/workers/qa
|
|
47
|
+
with:
|
|
48
|
+
gh_token: ${{ secrets.GH_TOKEN }}
|
|
49
|
+
issue_number: ${{ needs.manager.outputs.issue_number }}
|
|
50
|
+
base_branch: ${{ needs.manager.outputs.base_branch }}
|
|
51
|
+
|
|
52
|
+
security:
|
|
53
|
+
name: Security (invocado pelo Manager)
|
|
54
|
+
needs: manager
|
|
55
|
+
if: needs.manager.outputs.run_security == 'true'
|
|
56
|
+
runs-on: ubuntu-latest
|
|
57
|
+
steps:
|
|
58
|
+
- uses: actions/checkout@v4
|
|
59
|
+
- uses: ./.github/actions/workers/security
|
|
60
|
+
with:
|
|
61
|
+
gh_token: ${{ secrets.GH_TOKEN }}
|
|
62
|
+
issue_number: ${{ needs.manager.outputs.issue_number }}
|
|
63
|
+
base_branch: ${{ needs.manager.outputs.base_branch }}
|
|
64
|
+
|
|
65
|
+
technical-documenter:
|
|
66
|
+
name: Technical Documenter (invocado pelo Manager)
|
|
67
|
+
needs: manager
|
|
68
|
+
if: needs.manager.outputs.run_docs == 'true'
|
|
69
|
+
runs-on: ubuntu-latest
|
|
70
|
+
steps:
|
|
71
|
+
- uses: actions/checkout@v4
|
|
72
|
+
- uses: ./.github/actions/workers/technical-documenter
|
|
73
|
+
with:
|
|
74
|
+
gh_token: ${{ secrets.GH_TOKEN }}
|
|
75
|
+
issue_number: ${{ needs.manager.outputs.issue_number }}
|
|
76
|
+
base_branch: ${{ needs.manager.outputs.base_branch }}
|
|
77
|
+
|
|
78
|
+
# master: se faltar gate do quarteto → tags + workers faltantes
|
|
79
|
+
master-gates:
|
|
80
|
+
name: Master gates (quarteto)
|
|
81
|
+
needs: manager
|
|
82
|
+
if: needs.manager.outputs.run_gates == 'true'
|
|
83
|
+
runs-on: ubuntu-latest
|
|
84
|
+
outputs:
|
|
85
|
+
need_qa: ${{ steps.check.outputs.need_qa }}
|
|
86
|
+
need_security: ${{ steps.check.outputs.need_security }}
|
|
87
|
+
need_docs: ${{ steps.check.outputs.need_docs }}
|
|
88
|
+
steps:
|
|
89
|
+
- uses: actions/checkout@v4
|
|
90
|
+
- name: Inspect quarteto e tags
|
|
91
|
+
id: check
|
|
92
|
+
env:
|
|
93
|
+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
94
|
+
ISSUE: ${{ needs.manager.outputs.issue_number }}
|
|
95
|
+
REPO: ${{ github.repository }}
|
|
96
|
+
run: |
|
|
97
|
+
set -euo pipefail
|
|
98
|
+
LABELS=$(gh issue view "$ISSUE" --repo "$REPO" --json labels --jq '[.labels[].name] | join(",")')
|
|
99
|
+
echo "Labels: $LABELS"
|
|
100
|
+
|
|
101
|
+
need_qa=false
|
|
102
|
+
need_security=false
|
|
103
|
+
need_docs=false
|
|
104
|
+
|
|
105
|
+
echo "$LABELS" | grep -q 'qa:accepted' || need_qa=true
|
|
106
|
+
echo "$LABELS" | grep -q 'security:accepted' || need_security=true
|
|
107
|
+
echo "$LABELS" | grep -q 'agent:technical-documenter:done' || need_docs=true
|
|
108
|
+
|
|
109
|
+
echo "need_qa=$need_qa" >> "$GITHUB_OUTPUT"
|
|
110
|
+
echo "need_security=$need_security" >> "$GITHUB_OUTPUT"
|
|
111
|
+
echo "need_docs=$need_docs" >> "$GITHUB_OUTPUT"
|
|
112
|
+
|
|
113
|
+
[ "$need_qa" = true ] && gh issue edit "$ISSUE" --repo "$REPO" --add-label "agent:qa" || true
|
|
114
|
+
[ "$need_security" = true ] && gh issue edit "$ISSUE" --repo "$REPO" --add-label "agent:security" || true
|
|
115
|
+
[ "$need_docs" = true ] && gh issue edit "$ISSUE" --repo "$REPO" --add-label "agent:technical-documenter" || true
|
|
116
|
+
|
|
117
|
+
gh issue comment "$ISSUE" --repo "$REPO" --body \
|
|
118
|
+
"Master gates (Manager): need_qa=$need_qa need_security=$need_security need_docs=$need_docs"
|
|
119
|
+
|
|
120
|
+
master-qa:
|
|
121
|
+
name: QA (master gap via Manager)
|
|
122
|
+
needs: [manager, master-gates]
|
|
123
|
+
if: needs.master-gates.outputs.need_qa == 'true'
|
|
124
|
+
runs-on: ubuntu-latest
|
|
125
|
+
steps:
|
|
126
|
+
- uses: actions/checkout@v4
|
|
127
|
+
- uses: ./.github/actions/workers/qa
|
|
128
|
+
with:
|
|
129
|
+
gh_token: ${{ secrets.GH_TOKEN }}
|
|
130
|
+
issue_number: ${{ needs.manager.outputs.issue_number }}
|
|
131
|
+
base_branch: master
|
|
132
|
+
|
|
133
|
+
master-security:
|
|
134
|
+
name: Security (master gap via Manager)
|
|
135
|
+
needs: [manager, master-gates]
|
|
136
|
+
if: needs.master-gates.outputs.need_security == 'true'
|
|
137
|
+
runs-on: ubuntu-latest
|
|
138
|
+
steps:
|
|
139
|
+
- uses: actions/checkout@v4
|
|
140
|
+
- uses: ./.github/actions/workers/security
|
|
141
|
+
with:
|
|
142
|
+
gh_token: ${{ secrets.GH_TOKEN }}
|
|
143
|
+
issue_number: ${{ needs.manager.outputs.issue_number }}
|
|
144
|
+
base_branch: master
|
|
145
|
+
|
|
146
|
+
# Em push para master: bump patch + cria tag vX.Y.Z (dispara publish-npm.yml)
|
|
147
|
+
# Ignora commits de release ([skip bump]) para evitar loop.
|
|
148
|
+
version-tag:
|
|
149
|
+
name: Bump version + tag
|
|
150
|
+
if: github.ref == 'refs/heads/master' && !contains(github.event.head_commit.message, '[skip bump]')
|
|
151
|
+
runs-on: ubuntu-latest
|
|
152
|
+
steps:
|
|
153
|
+
- uses: actions/checkout@v4
|
|
154
|
+
with:
|
|
155
|
+
fetch-depth: 0
|
|
156
|
+
token: ${{ secrets.GH_TOKEN }}
|
|
157
|
+
|
|
158
|
+
- uses: actions/setup-node@v4
|
|
159
|
+
with:
|
|
160
|
+
node-version: '24'
|
|
161
|
+
|
|
162
|
+
- name: Bump patch + tag
|
|
163
|
+
run: |
|
|
164
|
+
git config user.name "github-actions[bot]"
|
|
165
|
+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
166
|
+
npm version patch -m "chore(release): %s [skip bump]"
|
|
167
|
+
git push origin HEAD:master --follow-tags
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
name: Publish Package to npmjs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
id-token: write
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
publish:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
permissions:
|
|
16
|
+
id-token: write
|
|
17
|
+
contents: read
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- uses: actions/setup-node@v4
|
|
22
|
+
with:
|
|
23
|
+
node-version: '24'
|
|
24
|
+
|
|
25
|
+
- name: Ensure npm 11.5.1+ (OIDC support)
|
|
26
|
+
run: |
|
|
27
|
+
npm install -g npm@latest
|
|
28
|
+
echo "node=$(node -v) npm=$(npm -v)"
|
|
29
|
+
|
|
30
|
+
- name: Prepare registry (OIDC only — no classic token)
|
|
31
|
+
run: |
|
|
32
|
+
unset NODE_AUTH_TOKEN NPM_TOKEN || true
|
|
33
|
+
rm -f .npmrc "$HOME/.npmrc" || true
|
|
34
|
+
npm config delete //registry.npmjs.org/:_authToken 2>/dev/null || true
|
|
35
|
+
npm config set registry https://registry.npmjs.org/
|
|
36
|
+
|
|
37
|
+
- name: Publish to npmjs (Trusted Publishing / OIDC)
|
|
38
|
+
run: |
|
|
39
|
+
unset NODE_AUTH_TOKEN NPM_TOKEN || true
|
|
40
|
+
npm publish --access public
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: Pull Request Checks
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- task-*
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
validation:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout
|
|
15
|
+
uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- name: Set up Node.js
|
|
18
|
+
uses: actions/setup-node@v4
|
|
19
|
+
with:
|
|
20
|
+
node-version: 22
|
|
21
|
+
|
|
22
|
+
- name: Run CRM empty-state test
|
|
23
|
+
run: npm run test:crm-empty-state
|
|
24
|
+
|
|
25
|
+
- name: Validate diff formatting
|
|
26
|
+
run: git diff --check
|
|
27
|
+
|
|
28
|
+
- name: Run focused opportunity status tests
|
|
29
|
+
run: node --test src/tests/react/utils/opportunityStatusFilter.test.cjs
|
package/.scrutinizer.yml
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
checks:
|
|
2
|
+
javascript: true
|
|
3
|
+
|
|
4
|
+
build:
|
|
5
|
+
nodes:
|
|
6
|
+
analysis:
|
|
7
|
+
environment:
|
|
8
|
+
node: v16
|
|
9
|
+
project_setup:
|
|
10
|
+
override: true
|
|
11
|
+
tests:
|
|
12
|
+
override:
|
|
13
|
+
- js-scrutinizer-run
|
|
14
|
+
- command: npm run test:coverage
|
|
15
|
+
coverage:
|
|
16
|
+
file: coverage/clover.xml
|
|
17
|
+
format: clover
|
|
18
|
+
|
|
19
|
+
filter:
|
|
20
|
+
excluded_paths:
|
|
21
|
+
- "build/*"
|
|
22
|
+
- "coverage/*"
|
|
23
|
+
- "dist/*"
|
|
24
|
+
- "node_modules/*"
|
package/AGENTS.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
## Ponto de entrada
|
|
2
|
+
|
|
3
|
+
- A documentação funcional e de regras deste modulo vive na **wiki do proprio repositório** e na wiki principal do app.
|
|
4
|
+
- Regras transversais de qualidade, modularizacao e limites de componente vivem em `https://github.com/ControleOnline/agents-mcp/blob/master/skills/shared/code-quality.md`.
|
|
5
|
+
- Quando houver detalhe especifico de implementacao, prefira comentar no codigo em ingles perto da regra.
|
|
6
|
+
- Este arquivo deve ficar curto e servir apenas como ponte para as fontes oficiais.
|
|
7
|
+
|
|
8
|
+
## Documentação (navegação humana)
|
|
9
|
+
|
|
10
|
+
Sempre comece pela **Home** da wiki e siga as categorias abaixo.
|
|
11
|
+
|
|
12
|
+
| Categoria | Destino |
|
|
13
|
+
| --- | --- |
|
|
14
|
+
| Home do módulo | https://github.com/ControleOnline/ui-crm/wiki |
|
|
15
|
+
| Wiki principal do app | https://github.com/ControleOnline/app-community/wiki |
|
|
16
|
+
| Wiki da API | https://github.com/ControleOnline/api-community/wiki |
|
|
17
|
+
| Visões do app (`APP_TYPE`) | https://github.com/ControleOnline/app-community/blob/master/MODOS_OPERACAO.md |
|
|
18
|
+
|
|
19
|
+
### Por categoria — fluxos de negócio (CRM)
|
|
20
|
+
|
|
21
|
+
| Página | O que documenta |
|
|
22
|
+
| --- | --- |
|
|
23
|
+
| [Cliente × Vendedor — vínculo e permissões](https://github.com/ControleOnline/ui-crm/wiki/Cliente-Vendedor-Vinculo-e-Permissoes) | Vínculo automático, handoff CRM → detalhe, corte MANAGER vs demais |
|
|
24
|
+
| [Propostas — Filtro de status](https://github.com/ControleOnline/ui-crm/wiki/Propostas-Filtro-de-Status) | Chips de status (fixos + dinâmicos), matching e parâmetros de listagem |
|
|
25
|
+
| [Oportunidades — estado vazio e filtros](https://github.com/ControleOnline/ui-crm/wiki/Oportunidades-Estado-Vazio-e-Filtros) | Empty state vs filtered; helper `getOpportunityEmptyStateMode` |
|
|
26
|
+
| [Oportunidades — ordenação por data de retorno](https://github.com/ControleOnline/ui-crm/wiki/Oportunidades-Ordenacao-por-Data-de-Retorno) | Ordenação client-side por dueDate/alterDate (mais antiga → mais nova) |
|
|
27
|
+
| [Income Statements — Demonstrativo geral](https://github.com/ControleOnline/ui-crm/wiki) | Visão empresa por categorias (comission/royalties); ver `docs/technical/Income-Statements-Demonstrativo.md` |
|
|
28
|
+
| [Visão Vendedor — Comissões](https://github.com/ControleOnline/ui-crm/wiki/Visao-Vendedor-Comissoes) | Invoices tipo `comission`; vendedor recebe; filtro cliente + período |
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
Cópias versionadas no Git:
|
|
32
|
+
- `docs/technical/Cliente-Vendedor-Vinculo-e-Permissoes.md`
|
|
33
|
+
- `docs/technical/Propostas-Filtro-de-Status.md`
|
|
34
|
+
- `docs/technical/Visao-Vendedor-Comissoes.md`
|
|
35
|
+
|
|
36
|
+
### Visão deste módulo
|
|
37
|
+
|
|
38
|
+
`ui-crm` atende o **`APP_TYPE=CRM`** (visão comercial): oportunidades, pipeline, propostas, comissões e relacionamento.
|
|
39
|
+
|
|
40
|
+
- **Não** é backoffice (`MANAGER` / `ADMIN`).
|
|
41
|
+
- **Não** opera caixa (`POS`) nem vitrine (`SHOP`).
|
|
42
|
+
- Módulos típicos no mesmo fluxo comercial: `ui-crm`, `ui-customers`, `ui-contracts`, `ui-common`.
|
|
43
|
+
|
|
44
|
+
No fluxo cliente × vendedor:
|
|
45
|
+
|
|
46
|
+
1. o CRM abre o cliente com contexto seguro (`clientId`, `contextKey=client`, aba `sellers` quando PJ);
|
|
47
|
+
2. o detalhe e a aba de vendedores vivem em `ui-customers`;
|
|
48
|
+
3. vínculo automático e `people_link` vivem em `api-platform-people`.
|
|
49
|
+
|
|
50
|
+
### Módulos relacionados (mesmo fluxo)
|
|
51
|
+
|
|
52
|
+
| Módulo | Papel | Entrada da documentação |
|
|
53
|
+
| --- | --- |
|
|
54
|
+
| `ui-customers` | Detalhe do cliente / aba Vendedores | https://github.com/ControleOnline/ui-customers/wiki |
|
|
55
|
+
| `api-platform-people` | Backend de vínculos e distribuição | https://github.com/ControleOnline/api-platform-people/wiki |
|
|
56
|
+
| `app-community` | Home do app e mapa de submódulos | https://github.com/ControleOnline/app-community/wiki |
|
package/FUNDING.yml
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
github: [controleonline]
|