diff --git a/.gitapp/.gitkeep b/.gitapp/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/.gitapp/manifest.json b/.gitapp/manifest.json new file mode 100644 index 0000000..53afe04 --- /dev/null +++ b/.gitapp/manifest.json @@ -0,0 +1,51 @@ +{ + "name": "pocketbase-lite", + "version": "0.1.0", + "paths": { + "data": "collections/", + "media": "media/", + "indexes": ".gitapp/indexes/" + }, + "schemas": [ + { + "id": "tags", + "file": "schemas/tags.json", + "glob": "collections/tags/*.json" + }, + { + "id": "companies", + "file": "schemas/companies.json", + "glob": "collections/companies/*.json" + }, + { + "id": "contacts", + "file": "schemas/contacts.json", + "glob": "collections/contacts/*.json" + }, + { + "id": "deals", + "file": "schemas/deals.json", + "glob": "collections/deals/*.json" + }, + { + "id": "activities", + "file": "schemas/activities.json", + "glob": "collections/activities/*.json" + } + ], + "operations": [ + "create-record", + "update-record", + "delete-record" + ], + "policies": { + "roles": [ + "viewer", + "editor" + ], + "acl": null + }, + "lfs": { + "enabled": false + } +} \ No newline at end of file diff --git a/.gitapp/operations/.gitkeep b/.gitapp/operations/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/.gitapp/operations/create-record.yaml b/.gitapp/operations/create-record.yaml new file mode 100644 index 0000000..1037449 --- /dev/null +++ b/.gitapp/operations/create-record.yaml @@ -0,0 +1,20 @@ +name: create-record +version: 1 +scope: + subtree: "collections/" +input: + $schema: zod + schema: | + z.object({ + collection: z.string().min(1), + id: z.string().min(1), + data: z.record(z.unknown()) + }) +preconditions: [] +mutations: + - type: create_file + path: "collections/${input.collection}/${input.id}.json" + content: "${JSON.stringify(input.data, null, 2)}" +commit: + message: "feat(data): create ${input.collection} record ${input.id}" + updateRef: "refs/heads/main" diff --git a/.gitapp/operations/delete-record.yaml b/.gitapp/operations/delete-record.yaml new file mode 100644 index 0000000..e2425c8 --- /dev/null +++ b/.gitapp/operations/delete-record.yaml @@ -0,0 +1,20 @@ +name: delete-record +version: 1 +scope: + subtree: "collections/" +input: + $schema: zod + schema: | + z.object({ + collection: z.string().min(1), + id: z.string().min(1) + }) +preconditions: + - type: path_exists + path: "collections/${input.collection}/${input.id}.json" +mutations: + - type: delete_file + path: "collections/${input.collection}/${input.id}.json" +commit: + message: "feat(data): delete ${input.collection} record ${input.id}" + updateRef: "refs/heads/main" diff --git a/.gitapp/operations/update-record.yaml b/.gitapp/operations/update-record.yaml new file mode 100644 index 0000000..bb9ece0 --- /dev/null +++ b/.gitapp/operations/update-record.yaml @@ -0,0 +1,22 @@ +name: update-record +version: 1 +scope: + subtree: "collections/" +input: + $schema: zod + schema: | + z.object({ + collection: z.string().min(1), + id: z.string().min(1), + data: z.record(z.unknown()) + }) +preconditions: + - type: path_exists + path: "collections/${input.collection}/${input.id}.json" +mutations: + - type: create_file + path: "collections/${input.collection}/${input.id}.json" + content: "${JSON.stringify(input.data, null, 2)}" +commit: + message: "feat(data): update ${input.collection} record ${input.id}" + updateRef: "refs/heads/main" diff --git a/.gitapp/schemas/.gitkeep b/.gitapp/schemas/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/.gitapp/schemas/activities.json b/.gitapp/schemas/activities.json new file mode 100644 index 0000000..c7008a9 --- /dev/null +++ b/.gitapp/schemas/activities.json @@ -0,0 +1,50 @@ +{ + "$id": "activities", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "type", + "subject", + "date" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "call", + "email", + "meeting", + "note", + "task" + ] + }, + "subject": { + "type": "string", + "minLength": 1 + }, + "notes": { + "type": "string" + }, + "date": { + "type": "string", + "format": "date-time" + }, + "completed": { + "type": "boolean" + }, + "contact": { + "type": "string", + "x-relation": { + "collection": "contacts", + "type": "single" + } + }, + "deal": { + "type": "string", + "x-relation": { + "collection": "deals", + "type": "single" + } + } + } +} \ No newline at end of file diff --git a/.gitapp/schemas/companies.json b/.gitapp/schemas/companies.json new file mode 100644 index 0000000..e4f6799 --- /dev/null +++ b/.gitapp/schemas/companies.json @@ -0,0 +1,41 @@ +{ + "$id": "companies", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "name", + "industry" + ], + "properties": { + "name": { + "type": "string", + "minLength": 1 + }, + "industry": { + "type": "string" + }, + "size": { + "type": "string", + "enum": [ + "1-10", + "11-50", + "51-200", + "201-500", + "500+" + ] + }, + "website": { + "type": "string", + "format": "uri" + }, + "logo": { + "type": "string" + }, + "revenue": { + "type": "string" + }, + "description": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/.gitapp/schemas/contacts.json b/.gitapp/schemas/contacts.json new file mode 100644 index 0000000..7fbb47e --- /dev/null +++ b/.gitapp/schemas/contacts.json @@ -0,0 +1,38 @@ +{ + "$id": "contacts", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "name", + "email" + ], + "properties": { + "name": { + "type": "string", + "minLength": 1 + }, + "email": { + "type": "string", + "format": "email" + }, + "phone": { + "type": "string" + }, + "title": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "notes": { + "type": "string" + }, + "company": { + "type": "string", + "x-relation": { + "collection": "companies", + "type": "single" + } + } + } +} \ No newline at end of file diff --git a/.gitapp/schemas/deals.json b/.gitapp/schemas/deals.json new file mode 100644 index 0000000..39a8091 --- /dev/null +++ b/.gitapp/schemas/deals.json @@ -0,0 +1,57 @@ +{ + "$id": "deals", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "title", + "value", + "stage" + ], + "properties": { + "title": { + "type": "string", + "minLength": 1 + }, + "value": { + "type": "number", + "minimum": 0 + }, + "stage": { + "type": "string", + "enum": [ + "lead", + "qualified", + "proposal", + "negotiation", + "won", + "lost" + ] + }, + "probability": { + "type": "number", + "minimum": 0, + "maximum": 100 + }, + "closeDate": { + "type": "string", + "format": "date" + }, + "notes": { + "type": "string" + }, + "contact": { + "type": "string", + "x-relation": { + "collection": "contacts", + "type": "single" + } + }, + "company": { + "type": "string", + "x-relation": { + "collection": "companies", + "type": "single" + } + } + } +} \ No newline at end of file diff --git a/.gitapp/schemas/tags.json b/.gitapp/schemas/tags.json new file mode 100644 index 0000000..ba5e9de --- /dev/null +++ b/.gitapp/schemas/tags.json @@ -0,0 +1,17 @@ +{ + "$id": "tags", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "minLength": 1 + }, + "color": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/collections/activities/.gitkeep b/collections/activities/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/collections/companies/.gitkeep b/collections/companies/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/collections/contacts/.gitkeep b/collections/contacts/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/collections/deals/.gitkeep b/collections/deals/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/collections/tags/.gitkeep b/collections/tags/.gitkeep new file mode 100644 index 0000000..e69de29