A company's office: its GPS position and a photo
The company form has a field for the office's GPS position (migration 0004, column companies.office_gps). It takes what people have at hand: the numbers Google Maps copies, a link to the place on Google Maps or OpenStreetMap, a geo: URI, or degrees, minutes and seconds. It keeps decimal degrees with six decimals and refuses a position outside Thailand, which catches a swapped pair; a short maps.app.goo.gl link is refused with a hint, as it holds no position (src/gps.rs, with unit tests). The company's page has an Office card: the position with links that open it on OpenStreetMap and Google Maps, the newest photo of the office, and a strip that uploads a photo (kind "Photo of the office") and returns to the card. The photos are documents like any other: encrypted on the server and audited. A refused photo shows its errors on the card only; office photos that are PDFs are counted under Company documents. The demo company has a position. Tests: the position read from a link, from degrees, minutes and seconds, the three refusals, the audit entry and its removal; a photo uploaded from the card, shown, and its errors placed.
This commit is contained in:
1 parent
e88bb74e1e
commit
2a6e972b68
14 files changed
+642
-8
No files matched your search
@@ -0,0 +1,9 @@
|
||||
-- The GPS position of a company's office, as decimal degrees with six
|
||||
-- decimals ("18.796500, 99.008200"); empty when not recorded. Photos of the
|
||||
-- office are documents of the kind office-photo (0003).
|
||||
|
||||
ALTER TABLE companies ADD COLUMN office_gps TEXT NOT NULL DEFAULT ''
|
||||
CONSTRAINT companies_office_gps_check CHECK (
|
||||
office_gps = ''
|
||||
OR office_gps ~ '^-?[0-9]{1,2}\.[0-9]{6}, -?[0-9]{1,3}\.[0-9]{6}$'
|
||||
);
|
||||
Reference in new issue
Block a user