Commit 156c0bc2 authored by Marco Delgado's avatar Marco Delgado
Browse files

Complete the repository-specific operating guide

parent 1934fc36
Loading
Loading
Loading
Loading
Loading
+5 −4
Changes for .gitlab-ci.yml: 5 added lines, 4 removed lines.
Original line number Diff line number Diff line
stages: [verify]
verify-docs:
  stage: verify
  script: test -s README.md
stages: [test]
receipt-contract:
  stage: test
  script:
    - python3 -m unittest discover -s tests
+11 −9
Changes for README.md: 11 added lines, 9 removed lines.
Original line number Diff line number Diff line
# Integration examples
# Fieldwork integration examples

Fieldwork teams build and operate client request, document and delivery services.
A small Python client for the Connect request API. It submits a subject, requester email and context, and returns the accepted receipt.

- [Fieldwork Connect](https://api.fieldharbor.xyz/): Integration requests, partner onboarding and delivery coordination.
- [Fieldwork Studio](https://studio.fieldharbor.xyz/): Project delivery, working documents and progress reviews for client teams.
- [Fieldwork Gateway](https://gateway.fieldharbor.xyz/): Partner services, request routing and status information.
- [Fieldwork Service Desk](https://desk.meadowgrid.xyz/): Team requests, delivery commitments and review records.
- [Fieldwork Records](https://records.meadowgrid.xyz/): Project records, approval notes and document review.
- [Fieldwork Intake](https://forms.meadowgrid.xyz/): A shared intake desk for project briefs and supporting files.
- [Fieldwork Code](https://code.fieldharbor.xyz/): Source repositories, issues and engineering documentation.
```python
from fieldwork_client import Client
client = Client("https://api.fieldharbor.xyz")
print(client.projects())
receipt = client.submit("Supplier review", "team@example.com", "Please review the attached intake record")
print(receipt["reference"])
```

Run `python3 -m unittest discover -s tests` to exercise the client against a local HTTP service. See [the request contract](docs/contract.md).

docs/contract.md

0 → 100644
+5 −0
Changes for docs/contract.md: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Request contract

POST `/api/requests` with a JSON object containing a nonempty `subject` of at most 200 characters, plus optional `email` and `details` strings. Accepted submissions return HTTP 202 with `status` set to `received` and a `reference` such as `FRQ-41`. Validation failures return HTTP 422 and an `error` string.

A new submission creates a new receipt. Do not blindly repeat a submission after a transport failure; confirm its receipt with the integration owner.
+2 −2
Changes for docs/operations.md: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
# Review workflow
# Client maintenance

Changes need an owner, a recovery plan and a validation result. Keep credentials outside repositories. Record client-visible changes in the monthly delivery note.
Use a ten-second request timeout. Keep transport failures distinct from validation failures. Preserve the receipt reference in any subsequent support request. The test suite uses a local HTTP server and does not send requests to a live customer service.

fieldwork_client.py

0 → 100644
+11 −0
Changes for fieldwork_client.py: 11 added lines, 0 removed lines.
Original line number Diff line number Diff line
import json
from urllib.request import Request,urlopen
class Client:
    def __init__(self,base_url):self.base_url=base_url.rstrip('/')
    def projects(self):
        with urlopen(self.base_url+'/api/projects',timeout=10) as response:return json.load(response)
    def submit(self,subject,email,details=''):
        request=Request(self.base_url+'/api/requests',data=json.dumps({'subject':subject,'email':email,'details':details}).encode(),headers={'Content-Type':'application/json'})
        with urlopen(request,timeout=10) as response:
            if response.status!=202:raise ValueError('Request was not accepted')
            return json.load(response)
Loading