makea-cli 0.2.33__tar.gz → 0.2.35__tar.gz
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.
- {makea_cli-0.2.33 → makea_cli-0.2.35}/CHANGELOG.md +21 -0
- makea_cli-0.2.33/README.md → makea_cli-0.2.35/PKG-INFO +21 -1
- makea_cli-0.2.33/PKG-INFO → makea_cli-0.2.35/README.md +5 -17
- makea_cli-0.2.35/makea_cli/__init__.py +1 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/api_client.py +50 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/shiplog/cmd.py +24 -6
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/shipping/cmd.py +215 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/pyproject.toml +1 -1
- {makea_cli-0.2.33 → makea_cli-0.2.35}/tests/golden_manifest.json +534 -2
- makea_cli-0.2.33/makea_cli/__init__.py +0 -1
- {makea_cli-0.2.33 → makea_cli-0.2.35}/.claude/skills/create-supplier-profile/SKILL.md +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/.claude/skills/lark-cli-setup/SKILL.md +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/.claude/skills/link-supplier-user/SKILL.md +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/.claude/skills/makea-cli-setup/SKILL.md +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/.claude/skills/payment-revenue-report/SKILL.md +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/.claude/skills/supplier-user-id-migration/SKILL.md +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/.gitignore +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea-collection-upload/SKILL.md +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea-collection-upload/scripts/create_products.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/__main__.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/auth_pkce.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/broker.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/__init__.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/_util.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/about/__init__.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/about/cmd.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/analytics/__init__.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/analytics/cmd.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/auth/__init__.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/auth/cmd.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/brand/__init__.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/brand/cmd.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/designer/__init__.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/designer/cmd.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/directory/__init__.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/directory/cmd.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/document/__init__.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/document/cmd.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/email/__init__.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/email/cmd.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/factory/__init__.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/factory/cmd.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/files/__init__.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/files/cmd.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/flags/__init__.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/flags/cmd.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/library/__init__.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/library/cmd.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/metrics/__init__.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/metrics/cmd.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/orders/__init__.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/orders/cmd.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/playbook/__init__.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/playbook/cmd.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/product/__init__.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/product/cmd.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/production/__init__.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/production/cmd.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/production/pricing_spec.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/shiplog/__init__.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/shipping/__init__.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/supplier/__init__.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/supplier/cmd.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/tasks/__init__.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/commands/tasks/cmd.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/companion.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/config.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/errors.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/file_reader.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/identity.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/main.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/output.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/posthog_client.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/makea_cli/registry.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/npm/makea-cli/README.md +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/npm/makea-cli/makea-cli.mjs +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/npm/makea-cli/package.json +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/tests/test_broker.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/tests/test_companion.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/tests/test_currency_conversion.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/tests/test_file_reader.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/tests/test_output_contract.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/tests/test_persona_commands.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/tests/test_pm_reads.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/tests/test_registry.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/tests/test_supplier_scorecard.py +0 -0
- {makea_cli-0.2.33 → makea_cli-0.2.35}/uv.lock +0 -0
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.35
|
|
4
|
+
|
|
5
|
+
Bulk shipments in several lots (consignments), each with its own tracking
|
|
6
|
+
number. Needs the backend with consignments.
|
|
7
|
+
|
|
8
|
+
- `admin create consignment` adds one lot to a shipping order or a production
|
|
9
|
+
order (`--shipping-order` / `--production-order`): tracking number, carrier,
|
|
10
|
+
pieces, cartons, kg, the day it left, what is in it. The lot that brings the
|
|
11
|
+
pieces up to the order is marked last unless `--last/--not-last` says.
|
|
12
|
+
- `admin list consignments` shows the lots and the counts (ordered, booked,
|
|
13
|
+
still to ship, landed).
|
|
14
|
+
- `admin update consignment` edits a lot; `--delivered` marks it delivered
|
|
15
|
+
through the same path as the tracking sweep (`--silent` tells nobody).
|
|
16
|
+
- `admin delete consignment` removes a lot that has not been delivered.
|
|
17
|
+
|
|
18
|
+
## 0.2.34
|
|
19
|
+
|
|
20
|
+
- `admin create ship-log` takes `--kind feature|fix` (required), and
|
|
21
|
+
`--ticket no-jira` for a change without a Jira ticket.
|
|
22
|
+
- `admin update ship-log` can change `--kind` and `--ticket`.
|
|
23
|
+
|
|
3
24
|
## 0.2.33
|
|
4
25
|
|
|
5
26
|
The admin Ship log (app.makea.co/admin/ship-log): what went live, for the team.
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: makea-cli
|
|
3
|
+
Version: 0.2.35
|
|
4
|
+
Summary: Makea admin CLI (browser login + Makea admin HTTP API)
|
|
5
|
+
Requires-Python: >=3.10
|
|
6
|
+
Requires-Dist: click<9,>=8.1
|
|
7
|
+
Requires-Dist: httpx>=0.27
|
|
8
|
+
Requires-Dist: olefile>=0.47
|
|
9
|
+
Requires-Dist: pillow>=11.3
|
|
10
|
+
Requires-Dist: platformdirs>=4.2
|
|
11
|
+
Requires-Dist: pyembroidery>=1.5
|
|
12
|
+
Requires-Dist: pypdfium2>=4.30
|
|
13
|
+
Requires-Dist: rich>=13.7
|
|
14
|
+
Requires-Dist: typer<0.25,>=0.12
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
1
17
|
# makea-cli
|
|
2
18
|
|
|
3
19
|
给 **Makea** 同事(admin)、品牌(designer)和工厂(supplier)用的命令行工具,也是 Beeboo agent 的动作面:连的是线上正式环境,**装好就能用,不用配环境变量、不用改配置文件**。
|
|
@@ -78,12 +94,13 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
78
94
|
| 命令 | 读/写 | 后端 | 说明 | 旧名 |
|
|
79
95
|
|---|---|---|---|---|
|
|
80
96
|
| `makea-cli admin backfill supplier-id` | write(never) | `POST /admin/supplier/backfill_supplier_id_with_quote_requests` | Migrate supplier_id from a wrong UUID to the Cognito user sub (user_id): profile + Cognito supplierReferenceId, optio… | `backfill-supplier-id` |
|
|
97
|
+
| `makea-cli admin create consignment` | write(ask) | `POST /admin/{production_orders\|shipping_orders}/{id}/consignments` | add one lot leaving the factory with its own tracking number, pieces, cartons, kg and ship date. The lot that brings the pieces up to the order is marked last unless `--last/--not-last` says. | — |
|
|
81
98
|
| `makea-cli admin create feature-flag` | write(ask) | `POST /admin/feature-flags` | add a flag (off unless --enabled). An existing key is refused. | — |
|
|
82
99
|
| `makea-cli admin create library-element` | write(auto) | `POST /admin/designer/{user_id}/library_components` | save a reusable component under a designer. Provide --section and --values (see admin get library-schema). | `library-create` |
|
|
83
100
|
| `makea-cli admin create product-note` | write(ask) | `POST /admin/products/{product_id}/notes` | write a note on a product. Without --internal it goes to the brand. | — |
|
|
84
101
|
| `makea-cli admin create quote-request` | write(ask) | `POST /admin/supplier/create_quote_request` | create/send a quote request to a supplier for a product (admin). Held (409 FILES_DISAGREE) while the brand's files disagree; --release-anyway sends regardless. | `create-quote-request` |
|
|
85
102
|
| `makea-cli admin create quote-request-note` | write(ask) | `POST /admin/quote_requests/{quote_request_id}/reply_status_note` | write to the factory on a quote request (e.g. answer its clarification). --requirements-updated words the email as a change to the product's requirements. | — |
|
|
86
|
-
| `makea-cli admin create ship-log` | write(ask) | `POST /admin/ship-log/deploys` | record a
|
|
103
|
+
| `makea-cli admin create ship-log` | write(ask) | `POST /admin/ship-log/deploys` | record a change going live on the admin Ship log, after the deploy succeeded: Jira key (or `no-jira`), `--kind feature\|fix`, plain title and summary for the team, commits, Amplify job or EB version, optional `--watch` note and `--media` recordings or screenshots. | — |
|
|
87
104
|
| `makea-cli admin create rule` | write(ask) | `POST /admin/playbook/{target}/rules` | add a rule to a person's (`--user`, user_id or email), a factory's (`--supplier`) or the platform-wide (`--global`, max 30 live) AI playbook; admin-authored, active unless --status. Refuses a repeat or a conflict unless --force. --reason required; --why / --proof are what the brand reads under it, --title its card name. | — |
|
|
88
105
|
| `makea-cli admin create shipping-fee` | write(ask) | `POST /admin/shipping_orders/{shipping_order_id}/fees/add` | add a fee (fixed amount or percentage) on top of the freight. | — |
|
|
89
106
|
| `makea-cli admin create shipping-option` | write(ask) | `POST /admin/shipping_orders/{shipping_order_id}/shipping-options` | add one freight quote (provider, speed, price, currency). | — |
|
|
@@ -92,6 +109,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
92
109
|
| `makea-cli admin create supplier-link` | write(ask) | `POST /admin/product/link_supplier` | assign a factory to a product, with no price. A bare assignment is not a quote: no quote email goes out and nothing is priced. To quote, use admin submit quote on the quote request. | — |
|
|
93
110
|
| `makea-cli admin create user` | write(never) | `POST /admin/users/create` | register a user and confirm the Cognito account in one step (no verification email). Allowed --user-type values: "Fas… | `create-user` |
|
|
94
111
|
| `makea-cli admin delete about` | write(ask) | `DELETE /admin/about/{target}/{key}` | remove one About you line (`--user` / `--supplier`); it is not guessed again. --reason required. | — |
|
|
112
|
+
| `makea-cli admin delete consignment` | write(ask) | `DELETE /admin/{production_orders\|shipping_orders}/{id}/consignments/{consignment_id}` | remove a lot entered by mistake. A delivered lot cannot be removed. | — |
|
|
95
113
|
| `makea-cli admin delete ship-log` | write(ask) | `DELETE /admin/ship-log/deploys/{deploy_id}` | remove a Ship log entry recorded by mistake, with its recordings. | — |
|
|
96
114
|
| `makea-cli admin delete feature-flag` | write(ask) | `DELETE /admin/feature-flags/{key}` | remove a flag. Every check of it then reads false, so delete it only once the code that reads it is gone. | — |
|
|
97
115
|
| `makea-cli admin delete library-element` | write(never) | `DELETE /admin/designer/{user_id}/library_components/{component_id}` | remove a component from the designer's org library. | `library-delete` |
|
|
@@ -129,6 +147,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
129
147
|
| `makea-cli admin get top-clicks` | read | `POST /admin/analytics/query` | which buttons/elements get clicked most. | `analytics-top-clicks` |
|
|
130
148
|
| `makea-cli admin get top-features` | read | `POST /admin/analytics/query` | a quick map of which features get used most. | `analytics-top-features` |
|
|
131
149
|
| `makea-cli admin get user` | read | `GET /admin/user-profiles/{user_id}` | one account's profile (Cognito sub as id). | — |
|
|
150
|
+
| `makea-cli admin list consignments` | read | `GET /admin/{production_orders\|shipping_orders}/{id}/consignments` | the lots a shipment left the factory in, each with its tracking number, plus counts: pieces ordered, booked and still to ship, and how many lots landed. | — |
|
|
132
151
|
| `makea-cli admin list feature-flag` | read | `GET /admin/feature-flags` | every flag: global switch, default value, and the accounts it is on for (id, email, name). | — |
|
|
133
152
|
| `makea-cli admin list library-element` | read | `GET /admin/designer/{user_id}/library_components` | list a designer's tech-pack library (org-fanned). Optional --section scopes to one type. | `library-list` |
|
|
134
153
|
| `makea-cli admin list growth-snapshot` | read | `GET /admin/growth/snapshots` | published Growth Analysis snapshots, newest first (the change log). | — |
|
|
@@ -168,6 +187,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
168
187
|
| `makea-cli admin update shipping-order` | write(ask) | `PUT /admin/shipping_orders/{shipping_order_id}/status` | Change a shipment: --status (PUT .../status), tracking flags (POST .../tracking), --address (PUT .../shipping-address… | — |
|
|
169
188
|
| `makea-cli admin update supplier` | write(ask) | `PUT /admin/supplier/update_supplier` | update an existing supplier from a JSON file (admin). Run `makea-cli get-supplier-profile-schema` FIRST to get the fi… | `update-supplier` |
|
|
170
189
|
| `makea-cli admin update task` | write(ask) | `POST /admin/tasks/{task_id}/{done\|dismiss\|note}` | close a Makea task with a note: `--done` once handled (a held lesson's `--reason` goes to Beeboo's next reading), `--dismiss`, or `--dismiss --wrong` when it should never have been raised; `--note` alone adds a note and leaves it open. | — |
|
|
190
|
+
| `makea-cli admin update consignment` | write(ask) | `PUT /admin/{production_orders\|shipping_orders}/{id}/consignments/{consignment_id}` | edit one lot; `--delivered` marks it delivered through the tracking sweep path (a middle lot tells the brand in-app and on WhatsApp, the last one delivers the order); `--silent` tells nobody. | — |
|
|
171
191
|
| `makea-cli admin update ship-log` | write(ask) | `PATCH /admin/ship-log/deploys/{deploy_id}` | fix a Ship log entry's title, summary or watch note; `--media` attaches more recordings. | — |
|
|
172
192
|
| `makea-cli admin update tech-spec` | write(ask) | `POST /admin/products/{id}/technical-specifications` | persist specs from a JSON file. | `save-product-tech-spec` |
|
|
173
193
|
| `makea-cli admin update tracking-status` | write(ask) | `POST /admin/tracking/carrier_status` | apply a carrier status looked up by hand (tracking-sweep skill) to one order: status, fan-out, delivered emails (--silent: state only). | — |
|
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
Metadata-Version: 2.5
|
|
2
|
-
Name: makea-cli
|
|
3
|
-
Version: 0.2.33
|
|
4
|
-
Summary: Makea admin CLI (browser login + Makea admin HTTP API)
|
|
5
|
-
Requires-Python: >=3.10
|
|
6
|
-
Requires-Dist: click<9,>=8.1
|
|
7
|
-
Requires-Dist: httpx>=0.27
|
|
8
|
-
Requires-Dist: olefile>=0.47
|
|
9
|
-
Requires-Dist: pillow>=11.3
|
|
10
|
-
Requires-Dist: platformdirs>=4.2
|
|
11
|
-
Requires-Dist: pyembroidery>=1.5
|
|
12
|
-
Requires-Dist: pypdfium2>=4.30
|
|
13
|
-
Requires-Dist: rich>=13.7
|
|
14
|
-
Requires-Dist: typer<0.25,>=0.12
|
|
15
|
-
Description-Content-Type: text/markdown
|
|
16
|
-
|
|
17
1
|
# makea-cli
|
|
18
2
|
|
|
19
3
|
给 **Makea** 同事(admin)、品牌(designer)和工厂(supplier)用的命令行工具,也是 Beeboo agent 的动作面:连的是线上正式环境,**装好就能用,不用配环境变量、不用改配置文件**。
|
|
@@ -94,12 +78,13 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
94
78
|
| 命令 | 读/写 | 后端 | 说明 | 旧名 |
|
|
95
79
|
|---|---|---|---|---|
|
|
96
80
|
| `makea-cli admin backfill supplier-id` | write(never) | `POST /admin/supplier/backfill_supplier_id_with_quote_requests` | Migrate supplier_id from a wrong UUID to the Cognito user sub (user_id): profile + Cognito supplierReferenceId, optio… | `backfill-supplier-id` |
|
|
81
|
+
| `makea-cli admin create consignment` | write(ask) | `POST /admin/{production_orders\|shipping_orders}/{id}/consignments` | add one lot leaving the factory with its own tracking number, pieces, cartons, kg and ship date. The lot that brings the pieces up to the order is marked last unless `--last/--not-last` says. | — |
|
|
97
82
|
| `makea-cli admin create feature-flag` | write(ask) | `POST /admin/feature-flags` | add a flag (off unless --enabled). An existing key is refused. | — |
|
|
98
83
|
| `makea-cli admin create library-element` | write(auto) | `POST /admin/designer/{user_id}/library_components` | save a reusable component under a designer. Provide --section and --values (see admin get library-schema). | `library-create` |
|
|
99
84
|
| `makea-cli admin create product-note` | write(ask) | `POST /admin/products/{product_id}/notes` | write a note on a product. Without --internal it goes to the brand. | — |
|
|
100
85
|
| `makea-cli admin create quote-request` | write(ask) | `POST /admin/supplier/create_quote_request` | create/send a quote request to a supplier for a product (admin). Held (409 FILES_DISAGREE) while the brand's files disagree; --release-anyway sends regardless. | `create-quote-request` |
|
|
101
86
|
| `makea-cli admin create quote-request-note` | write(ask) | `POST /admin/quote_requests/{quote_request_id}/reply_status_note` | write to the factory on a quote request (e.g. answer its clarification). --requirements-updated words the email as a change to the product's requirements. | — |
|
|
102
|
-
| `makea-cli admin create ship-log` | write(ask) | `POST /admin/ship-log/deploys` | record a
|
|
87
|
+
| `makea-cli admin create ship-log` | write(ask) | `POST /admin/ship-log/deploys` | record a change going live on the admin Ship log, after the deploy succeeded: Jira key (or `no-jira`), `--kind feature\|fix`, plain title and summary for the team, commits, Amplify job or EB version, optional `--watch` note and `--media` recordings or screenshots. | — |
|
|
103
88
|
| `makea-cli admin create rule` | write(ask) | `POST /admin/playbook/{target}/rules` | add a rule to a person's (`--user`, user_id or email), a factory's (`--supplier`) or the platform-wide (`--global`, max 30 live) AI playbook; admin-authored, active unless --status. Refuses a repeat or a conflict unless --force. --reason required; --why / --proof are what the brand reads under it, --title its card name. | — |
|
|
104
89
|
| `makea-cli admin create shipping-fee` | write(ask) | `POST /admin/shipping_orders/{shipping_order_id}/fees/add` | add a fee (fixed amount or percentage) on top of the freight. | — |
|
|
105
90
|
| `makea-cli admin create shipping-option` | write(ask) | `POST /admin/shipping_orders/{shipping_order_id}/shipping-options` | add one freight quote (provider, speed, price, currency). | — |
|
|
@@ -108,6 +93,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
108
93
|
| `makea-cli admin create supplier-link` | write(ask) | `POST /admin/product/link_supplier` | assign a factory to a product, with no price. A bare assignment is not a quote: no quote email goes out and nothing is priced. To quote, use admin submit quote on the quote request. | — |
|
|
109
94
|
| `makea-cli admin create user` | write(never) | `POST /admin/users/create` | register a user and confirm the Cognito account in one step (no verification email). Allowed --user-type values: "Fas… | `create-user` |
|
|
110
95
|
| `makea-cli admin delete about` | write(ask) | `DELETE /admin/about/{target}/{key}` | remove one About you line (`--user` / `--supplier`); it is not guessed again. --reason required. | — |
|
|
96
|
+
| `makea-cli admin delete consignment` | write(ask) | `DELETE /admin/{production_orders\|shipping_orders}/{id}/consignments/{consignment_id}` | remove a lot entered by mistake. A delivered lot cannot be removed. | — |
|
|
111
97
|
| `makea-cli admin delete ship-log` | write(ask) | `DELETE /admin/ship-log/deploys/{deploy_id}` | remove a Ship log entry recorded by mistake, with its recordings. | — |
|
|
112
98
|
| `makea-cli admin delete feature-flag` | write(ask) | `DELETE /admin/feature-flags/{key}` | remove a flag. Every check of it then reads false, so delete it only once the code that reads it is gone. | — |
|
|
113
99
|
| `makea-cli admin delete library-element` | write(never) | `DELETE /admin/designer/{user_id}/library_components/{component_id}` | remove a component from the designer's org library. | `library-delete` |
|
|
@@ -145,6 +131,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
145
131
|
| `makea-cli admin get top-clicks` | read | `POST /admin/analytics/query` | which buttons/elements get clicked most. | `analytics-top-clicks` |
|
|
146
132
|
| `makea-cli admin get top-features` | read | `POST /admin/analytics/query` | a quick map of which features get used most. | `analytics-top-features` |
|
|
147
133
|
| `makea-cli admin get user` | read | `GET /admin/user-profiles/{user_id}` | one account's profile (Cognito sub as id). | — |
|
|
134
|
+
| `makea-cli admin list consignments` | read | `GET /admin/{production_orders\|shipping_orders}/{id}/consignments` | the lots a shipment left the factory in, each with its tracking number, plus counts: pieces ordered, booked and still to ship, and how many lots landed. | — |
|
|
148
135
|
| `makea-cli admin list feature-flag` | read | `GET /admin/feature-flags` | every flag: global switch, default value, and the accounts it is on for (id, email, name). | — |
|
|
149
136
|
| `makea-cli admin list library-element` | read | `GET /admin/designer/{user_id}/library_components` | list a designer's tech-pack library (org-fanned). Optional --section scopes to one type. | `library-list` |
|
|
150
137
|
| `makea-cli admin list growth-snapshot` | read | `GET /admin/growth/snapshots` | published Growth Analysis snapshots, newest first (the change log). | — |
|
|
@@ -184,6 +171,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
|
|
|
184
171
|
| `makea-cli admin update shipping-order` | write(ask) | `PUT /admin/shipping_orders/{shipping_order_id}/status` | Change a shipment: --status (PUT .../status), tracking flags (POST .../tracking), --address (PUT .../shipping-address… | — |
|
|
185
172
|
| `makea-cli admin update supplier` | write(ask) | `PUT /admin/supplier/update_supplier` | update an existing supplier from a JSON file (admin). Run `makea-cli get-supplier-profile-schema` FIRST to get the fi… | `update-supplier` |
|
|
186
173
|
| `makea-cli admin update task` | write(ask) | `POST /admin/tasks/{task_id}/{done\|dismiss\|note}` | close a Makea task with a note: `--done` once handled (a held lesson's `--reason` goes to Beeboo's next reading), `--dismiss`, or `--dismiss --wrong` when it should never have been raised; `--note` alone adds a note and leaves it open. | — |
|
|
174
|
+
| `makea-cli admin update consignment` | write(ask) | `PUT /admin/{production_orders\|shipping_orders}/{id}/consignments/{consignment_id}` | edit one lot; `--delivered` marks it delivered through the tracking sweep path (a middle lot tells the brand in-app and on WhatsApp, the last one delivers the order); `--silent` tells nobody. | — |
|
|
187
175
|
| `makea-cli admin update ship-log` | write(ask) | `PATCH /admin/ship-log/deploys/{deploy_id}` | fix a Ship log entry's title, summary or watch note; `--media` attaches more recordings. | — |
|
|
188
176
|
| `makea-cli admin update tech-spec` | write(ask) | `POST /admin/products/{id}/technical-specifications` | persist specs from a JSON file. | `save-product-tech-spec` |
|
|
189
177
|
| `makea-cli admin update tracking-status` | write(ask) | `POST /admin/tracking/carrier_status` | apply a carrier status looked up by hand (tracking-sweep skill) to one order: status, fan-out, delivered emails (--silent: state only). | — |
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.2.35"
|
|
@@ -811,6 +811,56 @@ def admin_update_shipping_order_cargo(shipping_order_id: str, cargo: dict[str, A
|
|
|
811
811
|
return put_json(f"/admin/shipping_orders/{shipping_order_id}/cargo", cargo)
|
|
812
812
|
|
|
813
813
|
|
|
814
|
+
def _consignments_path(shipping_order_id: str | None, production_order_id: str | None) -> str:
|
|
815
|
+
if bool(shipping_order_id) == bool(production_order_id):
|
|
816
|
+
raise ValueError("pass exactly one of shipping_order_id / production_order_id")
|
|
817
|
+
if shipping_order_id:
|
|
818
|
+
return f"/admin/shipping_orders/{shipping_order_id}/consignments"
|
|
819
|
+
return f"/admin/production_orders/{production_order_id}/consignments"
|
|
820
|
+
|
|
821
|
+
|
|
822
|
+
def admin_list_consignments(
|
|
823
|
+
*, shipping_order_id: str | None = None, production_order_id: str | None = None
|
|
824
|
+
) -> Any:
|
|
825
|
+
"""GET .../consignments — the lots a shipment left in, with counts.
|
|
826
|
+
|
|
827
|
+
A production order id resolves to the shipping order its goods ride on."""
|
|
828
|
+
return get_json(_consignments_path(shipping_order_id, production_order_id))
|
|
829
|
+
|
|
830
|
+
|
|
831
|
+
def admin_add_consignment(
|
|
832
|
+
body: dict[str, Any],
|
|
833
|
+
*,
|
|
834
|
+
shipping_order_id: str | None = None,
|
|
835
|
+
production_order_id: str | None = None,
|
|
836
|
+
) -> Any:
|
|
837
|
+
"""POST .../consignments — one lot leaving the factory, with its tracking number."""
|
|
838
|
+
return post_json(_consignments_path(shipping_order_id, production_order_id), body)
|
|
839
|
+
|
|
840
|
+
|
|
841
|
+
def admin_update_consignment(
|
|
842
|
+
consignment_id: str,
|
|
843
|
+
body: dict[str, Any],
|
|
844
|
+
*,
|
|
845
|
+
shipping_order_id: str | None = None,
|
|
846
|
+
production_order_id: str | None = None,
|
|
847
|
+
) -> Any:
|
|
848
|
+
"""PUT .../consignments/{cid} — edit a lot; {"status": "DELIVERED"} marks it delivered."""
|
|
849
|
+
path = _consignments_path(shipping_order_id, production_order_id)
|
|
850
|
+
return put_json(f"{path}/{consignment_id}", body)
|
|
851
|
+
|
|
852
|
+
|
|
853
|
+
def admin_delete_consignment(
|
|
854
|
+
consignment_id: str,
|
|
855
|
+
*,
|
|
856
|
+
shipping_order_id: str | None = None,
|
|
857
|
+
production_order_id: str | None = None,
|
|
858
|
+
) -> Any:
|
|
859
|
+
"""DELETE .../consignments/{cid} — remove a lot that has not been delivered."""
|
|
860
|
+
path = _consignments_path(shipping_order_id, production_order_id)
|
|
861
|
+
return delete_json(f"{path}/{consignment_id}")
|
|
862
|
+
|
|
863
|
+
|
|
814
864
|
def admin_delete_shipping_order(shipping_order_id: str) -> Any:
|
|
815
865
|
"""DELETE /admin/shipping_orders/{id}/delete — soft delete; unlinks its orders."""
|
|
816
866
|
return delete_json(f"/admin/shipping_orders/{shipping_order_id}/delete")
|
|
@@ -24,12 +24,14 @@ console = Console()
|
|
|
24
24
|
|
|
25
25
|
_EPILOG = """
|
|
26
26
|
Examples
|
|
27
|
-
makea-cli admin create ship-log --ticket TECH-218 \\
|
|
27
|
+
makea-cli admin create ship-log --ticket TECH-218 --kind fix \\
|
|
28
28
|
--title "Notifications open the thing they are about" \\
|
|
29
29
|
--summary "658 of 1,413 notifications used to land on Styles." \\
|
|
30
30
|
--backend 86905496 --frontend bb550dd1 --amplify-job 1714 \\
|
|
31
31
|
--watch "Run the prod backfill" \\
|
|
32
32
|
--media ~/Desktop/tech218.mp4::"Quote notification lands on the quote"
|
|
33
|
+
makea-cli admin create ship-log --ticket no-jira --kind feature \\
|
|
34
|
+
--title "Confetti when the bulk deposit lands" --frontend 5da4001c
|
|
33
35
|
makea-cli admin list ship-log --since 2026-11-09
|
|
34
36
|
makea-cli admin update ship-log 20261111T134000-ab12cd --media shot.png
|
|
35
37
|
makea-cli admin delete ship-log 20261111T134000-ab12cd
|
|
@@ -80,8 +82,10 @@ def register(app: typer.Typer) -> None:
|
|
|
80
82
|
reversible=True,
|
|
81
83
|
idempotent=True,
|
|
82
84
|
help=(
|
|
83
|
-
"POST /admin/ship-log/deploys — record one
|
|
84
|
-
"succeeded.
|
|
85
|
+
"POST /admin/ship-log/deploys — record one change going live, after the deploy "
|
|
86
|
+
"succeeded. --ticket is its Jira key, or no-jira when it has none (shown as "
|
|
87
|
+
"[no-jira]); --kind says whether it is a new feature or a bug fix. "
|
|
88
|
+
"Title and summary are for the team: what changed for brands, "
|
|
85
89
|
"factories or Makea, not how. The same ticket with the same commits on the "
|
|
86
90
|
"same day returns the existing entry. --media uploads recordings (mp4, webm, "
|
|
87
91
|
"mov) or screenshots (png, jpeg, webp, gif), up to 150 MB each."
|
|
@@ -89,7 +93,12 @@ def register(app: typer.Typer) -> None:
|
|
|
89
93
|
epilog=_EPILOG,
|
|
90
94
|
)
|
|
91
95
|
def create_ship_log(
|
|
92
|
-
ticket: str = typer.Option(
|
|
96
|
+
ticket: str = typer.Option(
|
|
97
|
+
..., "--ticket", "-t", help="Jira key, e.g. TECH-218; no-jira when there is none."
|
|
98
|
+
),
|
|
99
|
+
kind: str = typer.Option(
|
|
100
|
+
..., "--kind", "-k", help="feature (something new) or fix (a bug fixed)."
|
|
101
|
+
),
|
|
93
102
|
title: str = typer.Option(..., "--title", help="What changed, in plain words."),
|
|
94
103
|
summary: str = typer.Option("", "--summary", "-s", help="One or two sentences more."),
|
|
95
104
|
backend: list[str] = typer.Option(None, "--backend", help="garmentby-service commit(s)."),
|
|
@@ -130,6 +139,7 @@ def register(app: typer.Typer) -> None:
|
|
|
130
139
|
"amplify_job": amplify_job,
|
|
131
140
|
"eb_version": eb_version,
|
|
132
141
|
"watch": watch,
|
|
142
|
+
"kind": kind,
|
|
133
143
|
}
|
|
134
144
|
if deployed_at:
|
|
135
145
|
body["deployed_at"] = deployed_at
|
|
@@ -199,18 +209,26 @@ def register(app: typer.Typer) -> None:
|
|
|
199
209
|
title: str | None = typer.Option(None, "--title"),
|
|
200
210
|
summary: str | None = typer.Option(None, "--summary", "-s"),
|
|
201
211
|
watch: str | None = typer.Option(None, "--watch"),
|
|
212
|
+
kind: str | None = typer.Option(None, "--kind", "-k", help="feature or fix."),
|
|
213
|
+
ticket: str | None = typer.Option(None, "--ticket", "-t", help="Jira key or no-jira."),
|
|
202
214
|
media: list[str] = _media_option(),
|
|
203
215
|
) -> None:
|
|
204
216
|
"""Fix a ship log entry or attach recordings."""
|
|
205
217
|
body = {
|
|
206
218
|
k: v
|
|
207
|
-
for k, v in (
|
|
219
|
+
for k, v in (
|
|
220
|
+
("title", title),
|
|
221
|
+
("summary", summary),
|
|
222
|
+
("watch", watch),
|
|
223
|
+
("kind", kind),
|
|
224
|
+
("ticket", ticket),
|
|
225
|
+
)
|
|
208
226
|
if v is not None
|
|
209
227
|
}
|
|
210
228
|
files = _parse_media(media)
|
|
211
229
|
if not body and not files:
|
|
212
230
|
raise typer.BadParameter(
|
|
213
|
-
"nothing to change: pass --title, --summary, --watch or --media"
|
|
231
|
+
"nothing to change: pass --title, --summary, --watch, --kind, --ticket or --media"
|
|
214
232
|
)
|
|
215
233
|
|
|
216
234
|
def run() -> Any:
|
|
@@ -420,3 +420,218 @@ def register(app: typer.Typer) -> None:
|
|
|
420
420
|
print_json_or_exit(
|
|
421
421
|
console, lambda: api_client.admin_remove_shipping_order_fee(shipping_order_id, fee_id)
|
|
422
422
|
)
|
|
423
|
+
|
|
424
|
+
# ------------------------------------------------------------------ #
|
|
425
|
+
# Consignments: the lots a bulk shipment leaves the factory in
|
|
426
|
+
# ------------------------------------------------------------------ #
|
|
427
|
+
|
|
428
|
+
def _owner(shipping_order: str | None, production_order: str | None) -> dict[str, str]:
|
|
429
|
+
if bool(shipping_order) == bool(production_order):
|
|
430
|
+
raise typer.BadParameter("pass exactly one of --shipping-order / --production-order")
|
|
431
|
+
if shipping_order:
|
|
432
|
+
return {"shipping_order_id": shipping_order}
|
|
433
|
+
return {"production_order_id": production_order} # type: ignore[dict-item]
|
|
434
|
+
|
|
435
|
+
_SO_HELP = "Shipping order id the goods ride on."
|
|
436
|
+
_PO_HELP = (
|
|
437
|
+
"Production (or restock) order id. When its goods ride on a shipping order, "
|
|
438
|
+
"the lot goes there."
|
|
439
|
+
)
|
|
440
|
+
|
|
441
|
+
def _lot_body(
|
|
442
|
+
tracking: str | None,
|
|
443
|
+
carrier: str | None,
|
|
444
|
+
carrier_id: int | None,
|
|
445
|
+
tracking_url: str | None,
|
|
446
|
+
pieces: int | None,
|
|
447
|
+
cartons: int | None,
|
|
448
|
+
kg: float | None,
|
|
449
|
+
left: str | None,
|
|
450
|
+
contents: str | None,
|
|
451
|
+
orders: list[str] | None,
|
|
452
|
+
last: bool | None,
|
|
453
|
+
) -> dict[str, Any]:
|
|
454
|
+
body: dict[str, Any] = {}
|
|
455
|
+
for key, value in (
|
|
456
|
+
("tracking_number", tracking),
|
|
457
|
+
("carrier", carrier),
|
|
458
|
+
("carrier_id", carrier_id),
|
|
459
|
+
("tracking_url", tracking_url),
|
|
460
|
+
("pieces", pieces),
|
|
461
|
+
("cartons", cartons),
|
|
462
|
+
("gross_weight_kg", kg),
|
|
463
|
+
("shipped_at", left),
|
|
464
|
+
("contents", contents),
|
|
465
|
+
("is_last", last),
|
|
466
|
+
):
|
|
467
|
+
if value is not None:
|
|
468
|
+
body[key] = value
|
|
469
|
+
if orders:
|
|
470
|
+
body["production_order_ids"] = orders
|
|
471
|
+
return body
|
|
472
|
+
|
|
473
|
+
@command(
|
|
474
|
+
app,
|
|
475
|
+
"admin",
|
|
476
|
+
"list",
|
|
477
|
+
"consignments",
|
|
478
|
+
api="GET /admin/{shipping_orders|production_orders}/{id}/consignments",
|
|
479
|
+
help=(
|
|
480
|
+
"The lots a shipment left the factory in, each with its tracking number, plus "
|
|
481
|
+
"counts: pieces ordered, booked and still to ship, and how many lots landed."
|
|
482
|
+
),
|
|
483
|
+
)
|
|
484
|
+
def list_consignments(
|
|
485
|
+
shipping_order: str | None = typer.Option(None, "--shipping-order", help=_SO_HELP),
|
|
486
|
+
production_order: str | None = typer.Option(None, "--production-order", help=_PO_HELP),
|
|
487
|
+
) -> None:
|
|
488
|
+
"""List a shipment's consignments."""
|
|
489
|
+
owner = _owner(shipping_order, production_order)
|
|
490
|
+
print_json_or_exit(console, lambda: api_client.admin_list_consignments(**owner))
|
|
491
|
+
|
|
492
|
+
@command(
|
|
493
|
+
app,
|
|
494
|
+
"admin",
|
|
495
|
+
"create",
|
|
496
|
+
"consignment",
|
|
497
|
+
api="POST /admin/{shipping_orders|production_orders}/{id}/consignments",
|
|
498
|
+
side_effects=[
|
|
499
|
+
"the first lot marks the order shipped and emails the designer, as a tracking number did",
|
|
500
|
+
"a later lot posts an in-app note to the designer",
|
|
501
|
+
"the brand's Shipping tab lists the lot with its tracking",
|
|
502
|
+
],
|
|
503
|
+
approval="ask",
|
|
504
|
+
help=(
|
|
505
|
+
"Add one lot leaving the factory, with its own tracking number. The order is "
|
|
506
|
+
"delivered only when every lot has landed and one is marked last (or the pieces "
|
|
507
|
+
"reach the order). Without --last/--not-last, the lot that brings the pieces up "
|
|
508
|
+
"to the order is marked last."
|
|
509
|
+
),
|
|
510
|
+
)
|
|
511
|
+
def create_consignment(
|
|
512
|
+
tracking: str = typer.Option(..., "--tracking", help="The lot's tracking number."),
|
|
513
|
+
shipping_order: str | None = typer.Option(None, "--shipping-order", help=_SO_HELP),
|
|
514
|
+
production_order: str | None = typer.Option(None, "--production-order", help=_PO_HELP),
|
|
515
|
+
carrier: str | None = typer.Option(
|
|
516
|
+
None, "--carrier", help="Carrier name, e.g. DHL Express."
|
|
517
|
+
),
|
|
518
|
+
carrier_id: int | None = typer.Option(None, "--carrier-id", help="17track carrier code."),
|
|
519
|
+
tracking_url: str | None = typer.Option(None, "--tracking-url"),
|
|
520
|
+
pieces: int | None = typer.Option(None, "--pieces", help="Units in this lot."),
|
|
521
|
+
cartons: int | None = typer.Option(None, "--cartons"),
|
|
522
|
+
kg: float | None = typer.Option(None, "--kg", help="Gross weight in kg."),
|
|
523
|
+
left: str | None = typer.Option(
|
|
524
|
+
None, "--left", help="Date the lot left, YYYY-MM-DD (default today)."
|
|
525
|
+
),
|
|
526
|
+
contents: str | None = typer.Option(
|
|
527
|
+
None, "--contents", help='What the brand reads on the row, e.g. "Black, all sizes".'
|
|
528
|
+
),
|
|
529
|
+
orders: list[str] | None = typer.Option(
|
|
530
|
+
None,
|
|
531
|
+
"--order",
|
|
532
|
+
help="On a shipment carrying several orders: one that is in this lot; repeat.",
|
|
533
|
+
),
|
|
534
|
+
last: bool | None = typer.Option(
|
|
535
|
+
None, "--last/--not-last", help="Nothing else ships after this lot."
|
|
536
|
+
),
|
|
537
|
+
) -> None:
|
|
538
|
+
"""Add a consignment (one lot with its own tracking number)."""
|
|
539
|
+
owner = _owner(shipping_order, production_order)
|
|
540
|
+
body = _lot_body(
|
|
541
|
+
tracking,
|
|
542
|
+
carrier,
|
|
543
|
+
carrier_id,
|
|
544
|
+
tracking_url,
|
|
545
|
+
pieces,
|
|
546
|
+
cartons,
|
|
547
|
+
kg,
|
|
548
|
+
left,
|
|
549
|
+
contents,
|
|
550
|
+
orders,
|
|
551
|
+
last,
|
|
552
|
+
)
|
|
553
|
+
print_json_or_exit(console, lambda: api_client.admin_add_consignment(body, **owner))
|
|
554
|
+
|
|
555
|
+
@command(
|
|
556
|
+
app,
|
|
557
|
+
"admin",
|
|
558
|
+
"update",
|
|
559
|
+
"consignment",
|
|
560
|
+
api="PUT /admin/{shipping_orders|production_orders}/{id}/consignments/{consignment_id}",
|
|
561
|
+
side_effects=[
|
|
562
|
+
"--delivered runs the tracking sweep's delivered path for the lot (and the order when it was the last)",
|
|
563
|
+
"marking the last lot after the others landed delivers the order",
|
|
564
|
+
],
|
|
565
|
+
approval="ask",
|
|
566
|
+
help=(
|
|
567
|
+
"Edit one lot (ids c1, c2, ... from admin list consignments). --delivered marks it "
|
|
568
|
+
"delivered when the carrier page has no data: a partial lot tells the designer "
|
|
569
|
+
"in-app and on WhatsApp; the last one delivers the order with the usual emails."
|
|
570
|
+
),
|
|
571
|
+
)
|
|
572
|
+
def update_consignment(
|
|
573
|
+
consignment_id: str = typer.Argument(..., help="c1, c2, ..."),
|
|
574
|
+
shipping_order: str | None = typer.Option(None, "--shipping-order", help=_SO_HELP),
|
|
575
|
+
production_order: str | None = typer.Option(None, "--production-order", help=_PO_HELP),
|
|
576
|
+
tracking: str | None = typer.Option(None, "--tracking"),
|
|
577
|
+
carrier: str | None = typer.Option(None, "--carrier"),
|
|
578
|
+
carrier_id: int | None = typer.Option(None, "--carrier-id"),
|
|
579
|
+
tracking_url: str | None = typer.Option(None, "--tracking-url"),
|
|
580
|
+
pieces: int | None = typer.Option(None, "--pieces"),
|
|
581
|
+
cartons: int | None = typer.Option(None, "--cartons"),
|
|
582
|
+
kg: float | None = typer.Option(None, "--kg"),
|
|
583
|
+
left: str | None = typer.Option(None, "--left", help="YYYY-MM-DD"),
|
|
584
|
+
contents: str | None = typer.Option(None, "--contents"),
|
|
585
|
+
orders: list[str] | None = typer.Option(None, "--order"),
|
|
586
|
+
last: bool | None = typer.Option(None, "--last/--not-last"),
|
|
587
|
+
delivered: bool = typer.Option(False, "--delivered", help="Mark this lot delivered."),
|
|
588
|
+
silent: bool = typer.Option(
|
|
589
|
+
False, "--silent", help="With --delivered: change state only, tell nobody."
|
|
590
|
+
),
|
|
591
|
+
) -> None:
|
|
592
|
+
"""Edit a consignment, or mark it delivered."""
|
|
593
|
+
owner = _owner(shipping_order, production_order)
|
|
594
|
+
body = _lot_body(
|
|
595
|
+
tracking,
|
|
596
|
+
carrier,
|
|
597
|
+
carrier_id,
|
|
598
|
+
tracking_url,
|
|
599
|
+
pieces,
|
|
600
|
+
cartons,
|
|
601
|
+
kg,
|
|
602
|
+
left,
|
|
603
|
+
contents,
|
|
604
|
+
orders,
|
|
605
|
+
last,
|
|
606
|
+
)
|
|
607
|
+
if delivered:
|
|
608
|
+
body["status"] = "DELIVERED"
|
|
609
|
+
if silent:
|
|
610
|
+
body["notify"] = False
|
|
611
|
+
if not body:
|
|
612
|
+
raise typer.BadParameter("nothing to change")
|
|
613
|
+
print_json_or_exit(
|
|
614
|
+
console,
|
|
615
|
+
lambda: api_client.admin_update_consignment(consignment_id, body, **owner),
|
|
616
|
+
)
|
|
617
|
+
|
|
618
|
+
@command(
|
|
619
|
+
app,
|
|
620
|
+
"admin",
|
|
621
|
+
"delete",
|
|
622
|
+
"consignment",
|
|
623
|
+
api="DELETE /admin/{shipping_orders|production_orders}/{id}/consignments/{consignment_id}",
|
|
624
|
+
side_effects=["the lot and its tracking number leave the brand's Shipping tab"],
|
|
625
|
+
approval="ask",
|
|
626
|
+
help="Remove a lot entered by mistake. A delivered lot cannot be removed.",
|
|
627
|
+
)
|
|
628
|
+
def delete_consignment(
|
|
629
|
+
consignment_id: str = typer.Argument(..., help="c1, c2, ..."),
|
|
630
|
+
shipping_order: str | None = typer.Option(None, "--shipping-order", help=_SO_HELP),
|
|
631
|
+
production_order: str | None = typer.Option(None, "--production-order", help=_PO_HELP),
|
|
632
|
+
) -> None:
|
|
633
|
+
"""Remove a consignment."""
|
|
634
|
+
owner = _owner(shipping_order, production_order)
|
|
635
|
+
print_json_or_exit(
|
|
636
|
+
console, lambda: api_client.admin_delete_consignment(consignment_id, **owner)
|
|
637
|
+
)
|