{"id":24672017,"url":"https://github.com/cable8mm/good-code","last_synced_at":"2026-03-06T11:31:48.124Z","repository":{"id":56979141,"uuid":"266034397","full_name":"cable8mm/good-code","owner":"cable8mm","description":"Create a general code specification for building a WMS (Warehouse Management System), and specify parsers and implementation guidelines.","archived":false,"fork":false,"pushed_at":"2025-02-24T17:54:27.000Z","size":202,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-08T07:36:15.230Z","etag":null,"topics":["code-standards","goods","product-code","receipt","warehouse","wms"],"latest_commit_sha":null,"homepage":"https://www.palgle.com/good-code/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cable8mm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-05-22T06:22:01.000Z","updated_at":"2025-02-24T17:54:31.000Z","dependencies_parsed_at":"2024-11-15T12:30:49.568Z","dependency_job_id":"c7850fa9-e3d3-4cc1-bdbe-9fcc822760a2","html_url":"https://github.com/cable8mm/good-code","commit_stats":{"total_commits":19,"total_committers":1,"mean_commits":19.0,"dds":0.0,"last_synced_commit":"a7d5169aec94cf68828195fa36e0f30c3ecb7c3d"},"previous_names":["cable8mm/good-code","cable8mm/good-code-parser"],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/cable8mm/good-code","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cable8mm%2Fgood-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cable8mm%2Fgood-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cable8mm%2Fgood-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cable8mm%2Fgood-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cable8mm","download_url":"https://codeload.github.com/cable8mm/good-code/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cable8mm%2Fgood-code/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30173694,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T07:56:45.623Z","status":"ssl_error","status_checked_at":"2026-03-06T07:55:55.621Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-standards","goods","product-code","receipt","warehouse","wms"],"created_at":"2025-01-26T10:12:33.514Z","updated_at":"2026-03-06T11:31:48.078Z","avatar_url":"https://github.com/cable8mm.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Good Code Parser\n\n[![code-style](https://github.com/cable8mm/good-code/actions/workflows/code-style.yml/badge.svg)](https://github.com/cable8mm/good-code/actions/workflows/code-style.yml)\n[![run-tests](https://github.com/cable8mm/good-code/actions/workflows/run-tests.yml/badge.svg)](https://github.com/cable8mm/good-code/actions/workflows/run-tests.yml)\n![Packagist Version](https://img.shields.io/packagist/v/cable8mm/good-code)\n![Packagist Downloads](https://img.shields.io/packagist/dt/cable8mm/good-code)\n![Packagist Dependency Version](https://img.shields.io/packagist/dependency-v/cable8mm/good-code/php)\n![Packagist Stars](https://img.shields.io/packagist/stars/cable8mm/good-code)\n![Packagist License](https://img.shields.io/packagist/l/cable8mm/good-code)\n\nA robust code specification is crucial within the commercial market industry, especially for online stores like Amazon. The integration of online stores with Warehouse Management Systems (WMS) is essential as both systems handle extensive seller and product data. Therefore, we recommend implementing a solid structure and providing robust support for these systems.\n\nThese specifications cover a variety of online stores, including Coupang, 11th Street, Naver Storefarm, and many others for a while.\n\nWe have provided the API Documentation on the web. For more information, please visit \u003chttps://www.palgle.com/good-code/\u003e ❤️\n\n## Features\n\n- [x] Normal good code parser\n- [x] Gift good code parser\n- [x] Set good code parser\n- [x] Complex good code parser\n- [x] Option Good code parser(No code, it matched by name)\n- [x] Receipt code parser\n- [x] Location code parser\n- [x] SKU parser\n\n## Install\n\n```bash\ncomposer require cable8mm/good-code\n```\n\n## Usage\n\n### Production codes for Laravel\n\nVisit repository - \u003chttps://github.com/cable8mm/aipro\u003e\n\n```php\n\u003c?php\n\nuse App\\Models\\OptionGood;\nuse Cable8mm\\GoodCode\\Enums\\GoodCodeType;\nuse Cable8mm\\GoodCode\\GoodCode;\n\n/**\n * For option products, retrieve the master_code of the option and update it.\n */\nif (GoodCodeType::of($this-\u003edata-\u003eget('sellerGoodsCd')) == GoodCodeType::OPTION) {\n    $code = GoodCode::of(\n        $this-\u003edata-\u003eget('sellerGoodsCd'),\n        option: $this-\u003edata-\u003eget('option'),\n        callback: function ($key, $option) {\n            return OptionGood::findMasterCode($key)-\u003eoption($option)-\u003efirst()-\u003emasterCode();\n        }\n    )-\u003ecode();\n\n    $this-\u003edata-\u003eput('masterGoodsCd', $code);\n}\n```\n\n```php\n\u003c?php\n\nuse Cable8mm\\GoodCode\\Enums\\GoodCodeType;\nuse Cable8mm\\GoodCode\\GoodCode;\nuse Cable8mm\\GoodCode\\ValueObjects\\SetGood;\n\n/**\n * For composite and gift products, retrieve the set product and update the master_code.\n */\nif (\n    GoodCodeType::of($this-\u003edata-\u003eget('sellerGoodsCd')) == GoodCodeType::COMPLEX\n    || GoodCodeType::of($this-\u003edata-\u003eget('sellerGoodsCd')) == GoodCodeType::GIFT\n) {\n    $code = GoodCode::of(\n        $this-\u003edata-\u003eget('sellerGoodsCd'),\n        callback: function ($key) {\n            return SetGood::findComCode($key)-\u003emaster_code;\n        }\n    )-\u003ecode();\n\n    $this-\u003edata-\u003eput('masterGoodsCd', $code);\n}\n```\n\n### Example codes\n\n#### `set-code`\n\n```php\n\u003c?php\n\nuse Cable8mm\\GoodCode\\GoodCode;\n\nprint GoodCode::of('SET7369x4zz4235x6')-\u003evalue();\n//=\u003e ['7369'=\u003e4,'4235'=\u003e6]\n\nprint GoodCode::setCodeOf(['1234' =\u003e 2, '5678' =\u003e 1,])-\u003ecode();\n//=\u003e 'set1234x2ZZ5678x1'\n```\n\n#### `complex-code`\n\n```php\n\u003c?php\n\nuse Cable8mm\\GoodCode\\GoodCode;\n\nprint GoodCode::of('COM10', callback: function ($key) {\n    $a = [ 10 =\u003e '123'];\n\n    return $a[$key];\n})-\u003evalue();\n//=\u003e '123'\n```\n\n#### `gift-code`\n\n```php\n\u003c?php\n\nuse Cable8mm\\GoodCode\\GoodCode;\n\nprint GoodCode::of('GIF11', callback: function ($key) {\n    $a = [\n        11 =\u003e '456',\n    ];\n\n    return $a[$key];\n});\n//=\u003e '456'\n```\n\n#### `option-code`\n\n\u003e [!TIP]\n\u003e `option-code` are matching with **both** `option-code` **and** `option-good-option` name. Unfortunately all of online shops like Coupang and 11st have not send any key for option to sellers.\n\n```php\n\u003c?php\n\nuse Cable8mm\\GoodCode\\GoodCode;\n\nprint GoodCode::of($optionCode, option: $optionName, callback: function ($key, $option) {\n    $a = [\n        10 =\u003e [\n            'Super Smash Bros. Ultimate' =\u003e 'COM4',\n            'Animal Crossing: New Horizons' =\u003e '3124',\n            'The Legend of Zelda: Tears of the Kingdom' =\u003e '1234',\n            'Call of Duty®: Black Ops 6' =\u003e '2314',\n            'Grand Theft Auto V' =\u003e '43123',\n            '42342', 'name' =\u003e 'Marvel\\'s Spider-Man 2',\n        ],\n    ];\n\n    return $a[$key][$option];\n})-\u003evalue();\n//=\u003e '3124'\n\n```\n\n### Special value object - `SetGood`\n\n```php\n\u003c?php\n\nuse Cable8mm\\GoodCode\\ValueObjects\\SetGood;\n\nprint SetGood::of('SET43x3zz253x3')-\u003egoods();\n//=\u003e ['43' =\u003e 3, '253' =\u003e 3]\n\nprint SetGood::ofArray(['43' =\u003e 3, '253' =\u003e 3])-\u003ecode();\n//=\u003e SET43x3zz253x3\n```\n\n### Receipt Code\n\n```php\n\u003c?php\n\nuse Cable8mm\\GoodCode\\ReceiptCode;\n\nprint ReceiptCode::of('PO-20250312-0001')-\u003ecode;\n//=\u003e PO-20250312-0001\n\nprint ReceiptCode::of('PO-20250312-0001')-\u003eprefix;\n//=\u003e PO\n\nprint ReceiptCode::of('PO-20250312-0001')-\u003eymd;\n//=\u003e 20250312\n\nprint ReceiptCode::of('PO-20250312-0001')-\u003enumber;\n//=\u003e 0001\n\nprint ReceiptCode::of('PO-20250312-0001')-\u003enextCode();\n//=\u003e PO-20250312-0002\n\nprint ReceiptCode::of()-\u003enextCode();\n//=\u003e PO-[Today's ymd]-0001\n\nprint ReceiptCode::of(prefix: 'CT')-\u003enextCode();\n//=\u003e CT-[Today's ymd]-0001\n```\n\n### Location Code\n\n```php\nprint LocationCode::of(warehouse: 'AUK', rack: 'R3', shelf: 'S32')-\u003elocationCode();\nprint LocationCode::of(['warehouse' =\u003e 'AUK', 'rack' =\u003e 'R3', 'shelf' =\u003e 'S32')-\u003elocationCode();\nprint LocationCode::of(warehouse: 'AUK', rack: 'R3', shelf: 'S32'); //` Stringable` supported\n//=\u003e AUK-R3-S32\n```\n\n### SKU\n\n```php\nprint Sku::of(code: 123, prefix: 'PO');     //=\u003e PO123\nprint Sku::of(123);                         //=\u003e 123\nprint Sku::of(123, prefix: 'PO');           //=\u003e PO123\n```\n\n## Formatting\n\n```sh\ncomposer lint\n```\n\n## Test\n\n```sh\ncomposer test\n```\n\n## Support codes\n\n| Type           | Notation | Description                                                                                                                      | Implement |\n| -------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- | --------- |\n| `Normal Code`  | -        | Match only one good                                                                                                              | Yes       |\n| `Set Code`     | SET      | Match one more good, max 255 characters                                                                                          | Yes       |\n| `Complex Code` | COM      | Shorten code for `Set Code`                                                                                                      | Yes       |\n| `Gift Code`    | GIF      | Alias `Complex Code`                                                                                                             | Yes       |\n| `Option Code`  | OPT      | Very complicated code. Not mastercode, but code + search name.(eq. wemakeprice, naver petWindow and all most OpenMarket options) | Yes       |\n\n## License\n\nThe Phpunit Start Kit is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcable8mm%2Fgood-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcable8mm%2Fgood-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcable8mm%2Fgood-code/lists"}