Add contractors by residence endpoint and Bruno API collection
- Add GET /contractors/by-residence/:residence_id/ endpoint - Create comprehensive Bruno API collection (89 endpoints) - Collection covers all API endpoints with Local and Dev environments 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
meta {
|
||||
name: Apple Sign In
|
||||
type: http
|
||||
seq: 11
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/auth/apple-sign-in/
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"identity_token": "eyJhbG...",
|
||||
"authorization_code": "code...",
|
||||
"first_name": "John",
|
||||
"last_name": "Doe"
|
||||
}
|
||||
}
|
||||
15
bruno-collections/casera-api/Authentication/Current User.bru
Normal file
15
bruno-collections/casera-api/Authentication/Current User.bru
Normal file
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: Current User
|
||||
type: http
|
||||
seq: 4
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/auth/me/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
meta {
|
||||
name: Forgot Password
|
||||
type: http
|
||||
seq: 6
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/auth/forgot-password/
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"email": "user@example.com"
|
||||
}
|
||||
}
|
||||
18
bruno-collections/casera-api/Authentication/Login.bru
Normal file
18
bruno-collections/casera-api/Authentication/Login.bru
Normal file
@@ -0,0 +1,18 @@
|
||||
meta {
|
||||
name: Login
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/auth/login/
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"username": "apple",
|
||||
"password": "password123"
|
||||
}
|
||||
}
|
||||
15
bruno-collections/casera-api/Authentication/Logout.bru
Normal file
15
bruno-collections/casera-api/Authentication/Logout.bru
Normal file
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: Logout
|
||||
type: http
|
||||
seq: 3
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/auth/logout/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
19
bruno-collections/casera-api/Authentication/Register.bru
Normal file
19
bruno-collections/casera-api/Authentication/Register.bru
Normal file
@@ -0,0 +1,19 @@
|
||||
meta {
|
||||
name: Register
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/auth/register/
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"username": "newuser",
|
||||
"email": "newuser@example.com",
|
||||
"password": "securepassword123"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: Resend Verification
|
||||
type: http
|
||||
seq: 10
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/auth/resend-verification/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
meta {
|
||||
name: Reset Password
|
||||
type: http
|
||||
seq: 8
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/auth/reset-password/
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"email": "user@example.com",
|
||||
"code": "123456",
|
||||
"new_password": "newSecurePassword123"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
meta {
|
||||
name: Update Profile
|
||||
type: http
|
||||
seq: 5
|
||||
}
|
||||
|
||||
put {
|
||||
url: {{api_url}}/auth/profile/
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"first_name": "John",
|
||||
"last_name": "Doe",
|
||||
"phone_number": "+1234567890"
|
||||
}
|
||||
}
|
||||
21
bruno-collections/casera-api/Authentication/Verify Email.bru
Normal file
21
bruno-collections/casera-api/Authentication/Verify Email.bru
Normal file
@@ -0,0 +1,21 @@
|
||||
meta {
|
||||
name: Verify Email
|
||||
type: http
|
||||
seq: 9
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/auth/verify-email/
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"code": "123456"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
meta {
|
||||
name: Verify Reset Code
|
||||
type: http
|
||||
seq: 7
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/auth/verify-reset-code/
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"email": "user@example.com",
|
||||
"code": "123456"
|
||||
}
|
||||
}
|
||||
19
bruno-collections/casera-api/Contractors/By Residence.bru
Normal file
19
bruno-collections/casera-api/Contractors/By Residence.bru
Normal file
@@ -0,0 +1,19 @@
|
||||
meta {
|
||||
name: By Residence
|
||||
type: http
|
||||
seq: 6
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/contractors/by-residence/:residence_id/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
residence_id: 1
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
meta {
|
||||
name: Create Contractor
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/contractors/
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"name": "John's Plumbing",
|
||||
"company": "John's Plumbing Co",
|
||||
"phone": "555-123-4567",
|
||||
"email": "john@plumbing.com",
|
||||
"address": "123 Main St",
|
||||
"notes": "Available weekends",
|
||||
"specialty_ids": [1, 2],
|
||||
"residence_ids": [1]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
meta {
|
||||
name: Delete Contractor
|
||||
type: http
|
||||
seq: 5
|
||||
}
|
||||
|
||||
delete {
|
||||
url: {{api_url}}/contractors/:id/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
id: 1
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
meta {
|
||||
name: Get Contractor Tasks
|
||||
type: http
|
||||
seq: 8
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/contractors/:id/tasks/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
id: 1
|
||||
}
|
||||
19
bruno-collections/casera-api/Contractors/Get Contractor.bru
Normal file
19
bruno-collections/casera-api/Contractors/Get Contractor.bru
Normal file
@@ -0,0 +1,19 @@
|
||||
meta {
|
||||
name: Get Contractor
|
||||
type: http
|
||||
seq: 3
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/contractors/:id/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
id: 1
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: List Contractors
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/contractors/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
19
bruno-collections/casera-api/Contractors/Toggle Favorite.bru
Normal file
19
bruno-collections/casera-api/Contractors/Toggle Favorite.bru
Normal file
@@ -0,0 +1,19 @@
|
||||
meta {
|
||||
name: Toggle Favorite
|
||||
type: http
|
||||
seq: 7
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/contractors/:id/toggle-favorite/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
id: 1
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
meta {
|
||||
name: Update Contractor
|
||||
type: http
|
||||
seq: 4
|
||||
}
|
||||
|
||||
put {
|
||||
url: {{api_url}}/contractors/:id/
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
id: 1
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"name": "John's Plumbing Updated",
|
||||
"company": "John's Plumbing Co LLC",
|
||||
"phone": "555-123-4567",
|
||||
"email": "john@plumbing.com",
|
||||
"address": "456 Oak Ave",
|
||||
"notes": "Available weekends and evenings",
|
||||
"specialty_ids": [1, 2, 3],
|
||||
"residence_ids": [1, 2]
|
||||
}
|
||||
}
|
||||
19
bruno-collections/casera-api/Documents/Activate Document.bru
Normal file
19
bruno-collections/casera-api/Documents/Activate Document.bru
Normal file
@@ -0,0 +1,19 @@
|
||||
meta {
|
||||
name: Activate Document
|
||||
type: http
|
||||
seq: 7
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/documents/:id/activate/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
id: 1
|
||||
}
|
||||
25
bruno-collections/casera-api/Documents/Create Document.bru
Normal file
25
bruno-collections/casera-api/Documents/Create Document.bru
Normal file
@@ -0,0 +1,25 @@
|
||||
meta {
|
||||
name: Create Document
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/documents/
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"name": "Home Insurance Policy",
|
||||
"description": "Annual home insurance policy document",
|
||||
"file_url": "https://example.com/documents/policy.pdf",
|
||||
"residence_id": 1,
|
||||
"is_warranty": false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
meta {
|
||||
name: Deactivate Document
|
||||
type: http
|
||||
seq: 8
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/documents/:id/deactivate/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
id: 1
|
||||
}
|
||||
19
bruno-collections/casera-api/Documents/Delete Document.bru
Normal file
19
bruno-collections/casera-api/Documents/Delete Document.bru
Normal file
@@ -0,0 +1,19 @@
|
||||
meta {
|
||||
name: Delete Document
|
||||
type: http
|
||||
seq: 5
|
||||
}
|
||||
|
||||
delete {
|
||||
url: {{api_url}}/documents/:id/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
id: 1
|
||||
}
|
||||
19
bruno-collections/casera-api/Documents/Get Document.bru
Normal file
19
bruno-collections/casera-api/Documents/Get Document.bru
Normal file
@@ -0,0 +1,19 @@
|
||||
meta {
|
||||
name: Get Document
|
||||
type: http
|
||||
seq: 3
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/documents/:id/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
id: 1
|
||||
}
|
||||
15
bruno-collections/casera-api/Documents/List Documents.bru
Normal file
15
bruno-collections/casera-api/Documents/List Documents.bru
Normal file
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: List Documents
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/documents/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
15
bruno-collections/casera-api/Documents/List Warranties.bru
Normal file
15
bruno-collections/casera-api/Documents/List Warranties.bru
Normal file
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: List Warranties
|
||||
type: http
|
||||
seq: 6
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/documents/warranties/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
29
bruno-collections/casera-api/Documents/Update Document.bru
Normal file
29
bruno-collections/casera-api/Documents/Update Document.bru
Normal file
@@ -0,0 +1,29 @@
|
||||
meta {
|
||||
name: Update Document
|
||||
type: http
|
||||
seq: 4
|
||||
}
|
||||
|
||||
put {
|
||||
url: {{api_url}}/documents/:id/
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
id: 1
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"name": "Home Insurance Policy 2024",
|
||||
"description": "Updated annual home insurance policy",
|
||||
"file_url": "https://example.com/documents/policy-2024.pdf",
|
||||
"residence_id": 1,
|
||||
"is_warranty": false
|
||||
}
|
||||
}
|
||||
11
bruno-collections/casera-api/Health Check.bru
Normal file
11
bruno-collections/casera-api/Health Check.bru
Normal file
@@ -0,0 +1,11 @@
|
||||
meta {
|
||||
name: Health Check
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/health/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: Contractor Specialties
|
||||
type: http
|
||||
seq: 6
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/lookups/contractor-specialties/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
15
bruno-collections/casera-api/Lookups/Residence Types.bru
Normal file
15
bruno-collections/casera-api/Lookups/Residence Types.bru
Normal file
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: Residence Types
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/lookups/residence-types/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
15
bruno-collections/casera-api/Lookups/Static Data.bru
Normal file
15
bruno-collections/casera-api/Lookups/Static Data.bru
Normal file
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: Static Data
|
||||
type: http
|
||||
seq: 7
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/lookups/static-data/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
15
bruno-collections/casera-api/Lookups/Task Categories.bru
Normal file
15
bruno-collections/casera-api/Lookups/Task Categories.bru
Normal file
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: Task Categories
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/lookups/task-categories/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
15
bruno-collections/casera-api/Lookups/Task Frequencies.bru
Normal file
15
bruno-collections/casera-api/Lookups/Task Frequencies.bru
Normal file
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: Task Frequencies
|
||||
type: http
|
||||
seq: 4
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/lookups/task-frequencies/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
15
bruno-collections/casera-api/Lookups/Task Priorities.bru
Normal file
15
bruno-collections/casera-api/Lookups/Task Priorities.bru
Normal file
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: Task Priorities
|
||||
type: http
|
||||
seq: 3
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/lookups/task-priorities/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
15
bruno-collections/casera-api/Lookups/Task Statuses.bru
Normal file
15
bruno-collections/casera-api/Lookups/Task Statuses.bru
Normal file
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: Task Statuses
|
||||
type: http
|
||||
seq: 5
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/lookups/task-statuses/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
19
bruno-collections/casera-api/Notifications/Delete Device.bru
Normal file
19
bruno-collections/casera-api/Notifications/Delete Device.bru
Normal file
@@ -0,0 +1,19 @@
|
||||
meta {
|
||||
name: Delete Device
|
||||
type: http
|
||||
seq: 7
|
||||
}
|
||||
|
||||
delete {
|
||||
url: {{api_url}}/notifications/devices/:id/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
id: 1
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: Get Preferences
|
||||
type: http
|
||||
seq: 8
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/notifications/preferences/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
15
bruno-collections/casera-api/Notifications/List Devices.bru
Normal file
15
bruno-collections/casera-api/Notifications/List Devices.bru
Normal file
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: List Devices
|
||||
type: http
|
||||
seq: 6
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/notifications/devices/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: List Notifications
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/notifications/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
15
bruno-collections/casera-api/Notifications/Mark All Read.bru
Normal file
15
bruno-collections/casera-api/Notifications/Mark All Read.bru
Normal file
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: Mark All Read
|
||||
type: http
|
||||
seq: 3
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/notifications/mark-all-read/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
19
bruno-collections/casera-api/Notifications/Mark Read.bru
Normal file
19
bruno-collections/casera-api/Notifications/Mark Read.bru
Normal file
@@ -0,0 +1,19 @@
|
||||
meta {
|
||||
name: Mark Read
|
||||
type: http
|
||||
seq: 4
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/notifications/:id/mark-read/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
id: 1
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
meta {
|
||||
name: Register Device
|
||||
type: http
|
||||
seq: 5
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/notifications/devices/
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"device_token": "abc123devicetoken",
|
||||
"platform": "ios",
|
||||
"device_name": "iPhone 15 Pro"
|
||||
}
|
||||
}
|
||||
15
bruno-collections/casera-api/Notifications/Unread Count.bru
Normal file
15
bruno-collections/casera-api/Notifications/Unread Count.bru
Normal file
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: Unread Count
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/notifications/unread-count/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
meta {
|
||||
name: Update Preferences
|
||||
type: http
|
||||
seq: 9
|
||||
}
|
||||
|
||||
put {
|
||||
url: {{api_url}}/notifications/preferences/
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"task_reminders": true,
|
||||
"task_due_soon": true,
|
||||
"task_overdue": true,
|
||||
"task_completed": true,
|
||||
"residence_shared": true,
|
||||
"marketing": false
|
||||
}
|
||||
}
|
||||
31
bruno-collections/casera-api/Residences/Create Residence.bru
Normal file
31
bruno-collections/casera-api/Residences/Create Residence.bru
Normal file
@@ -0,0 +1,31 @@
|
||||
meta {
|
||||
name: Create Residence
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/residences/
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"name": "My Home",
|
||||
"property_type_id": 1,
|
||||
"street_address": "123 Main St",
|
||||
"city": "San Francisco",
|
||||
"state_province": "CA",
|
||||
"postal_code": "94102",
|
||||
"country": "USA",
|
||||
"bedrooms": 3,
|
||||
"bathrooms": 2.5,
|
||||
"square_footage": 2000,
|
||||
"year_built": 2015
|
||||
}
|
||||
}
|
||||
19
bruno-collections/casera-api/Residences/Delete Residence.bru
Normal file
19
bruno-collections/casera-api/Residences/Delete Residence.bru
Normal file
@@ -0,0 +1,19 @@
|
||||
meta {
|
||||
name: Delete Residence
|
||||
type: http
|
||||
seq: 5
|
||||
}
|
||||
|
||||
delete {
|
||||
url: {{api_url}}/residences/:id/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
id: 1
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
meta {
|
||||
name: Generate Share Code
|
||||
type: http
|
||||
seq: 8
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/residences/:id/generate-share-code/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
id: 1
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
meta {
|
||||
name: Generate Tasks Report
|
||||
type: http
|
||||
seq: 9
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/residences/:id/generate-tasks-report/
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
id: 1
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"email": "recipient@example.com"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
meta {
|
||||
name: Get Residence Users
|
||||
type: http
|
||||
seq: 10
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/residences/:id/users/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
id: 1
|
||||
}
|
||||
19
bruno-collections/casera-api/Residences/Get Residence.bru
Normal file
19
bruno-collections/casera-api/Residences/Get Residence.bru
Normal file
@@ -0,0 +1,19 @@
|
||||
meta {
|
||||
name: Get Residence
|
||||
type: http
|
||||
seq: 3
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/residences/:id/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
id: 1
|
||||
}
|
||||
21
bruno-collections/casera-api/Residences/Join With Code.bru
Normal file
21
bruno-collections/casera-api/Residences/Join With Code.bru
Normal file
@@ -0,0 +1,21 @@
|
||||
meta {
|
||||
name: Join With Code
|
||||
type: http
|
||||
seq: 7
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/residences/join-with-code/
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"code": "ABC123"
|
||||
}
|
||||
}
|
||||
15
bruno-collections/casera-api/Residences/List Residences.bru
Normal file
15
bruno-collections/casera-api/Residences/List Residences.bru
Normal file
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: List Residences
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/residences/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
15
bruno-collections/casera-api/Residences/My Residences.bru
Normal file
15
bruno-collections/casera-api/Residences/My Residences.bru
Normal file
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: My Residences
|
||||
type: http
|
||||
seq: 6
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/residences/my-residences/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
meta {
|
||||
name: Remove Residence User
|
||||
type: http
|
||||
seq: 11
|
||||
}
|
||||
|
||||
delete {
|
||||
url: {{api_url}}/residences/:id/users/:user_id/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
id: 1
|
||||
user_id: 2
|
||||
}
|
||||
31
bruno-collections/casera-api/Residences/Update Residence.bru
Normal file
31
bruno-collections/casera-api/Residences/Update Residence.bru
Normal file
@@ -0,0 +1,31 @@
|
||||
meta {
|
||||
name: Update Residence
|
||||
type: http
|
||||
seq: 4
|
||||
}
|
||||
|
||||
put {
|
||||
url: {{api_url}}/residences/:id/
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
id: 1
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"name": "My Updated Home",
|
||||
"property_type_id": 1,
|
||||
"street_address": "123 Main St",
|
||||
"city": "San Francisco",
|
||||
"state_province": "CA",
|
||||
"postal_code": "94102",
|
||||
"country": "USA"
|
||||
}
|
||||
}
|
||||
15
bruno-collections/casera-api/Subscription/Cancel.bru
Normal file
15
bruno-collections/casera-api/Subscription/Cancel.bru
Normal file
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: Cancel
|
||||
type: http
|
||||
seq: 8
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/subscription/cancel/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
15
bruno-collections/casera-api/Subscription/Features.bru
Normal file
15
bruno-collections/casera-api/Subscription/Features.bru
Normal file
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: Features
|
||||
type: http
|
||||
seq: 5
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/subscription/features/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: Get Subscription
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/subscription/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
15
bruno-collections/casera-api/Subscription/Promotions.bru
Normal file
15
bruno-collections/casera-api/Subscription/Promotions.bru
Normal file
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: Promotions
|
||||
type: http
|
||||
seq: 6
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/subscription/promotions/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
22
bruno-collections/casera-api/Subscription/Purchase.bru
Normal file
22
bruno-collections/casera-api/Subscription/Purchase.bru
Normal file
@@ -0,0 +1,22 @@
|
||||
meta {
|
||||
name: Purchase
|
||||
type: http
|
||||
seq: 7
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/subscription/purchase/
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"receipt": "base64_encoded_receipt_data",
|
||||
"platform": "ios"
|
||||
}
|
||||
}
|
||||
22
bruno-collections/casera-api/Subscription/Restore.bru
Normal file
22
bruno-collections/casera-api/Subscription/Restore.bru
Normal file
@@ -0,0 +1,22 @@
|
||||
meta {
|
||||
name: Restore
|
||||
type: http
|
||||
seq: 9
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/subscription/restore/
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"receipt": "base64_encoded_receipt_data",
|
||||
"platform": "ios"
|
||||
}
|
||||
}
|
||||
15
bruno-collections/casera-api/Subscription/Status.bru
Normal file
15
bruno-collections/casera-api/Subscription/Status.bru
Normal file
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: Status
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/subscription/status/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
meta {
|
||||
name: Upgrade Trigger
|
||||
type: http
|
||||
seq: 4
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/subscription/upgrade-trigger/
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"trigger": "residence_limit"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: Upgrade Triggers
|
||||
type: http
|
||||
seq: 3
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/subscription/upgrade-triggers/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
meta {
|
||||
name: Create Completion
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/task-completions/
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"task_id": 1,
|
||||
"notes": "Completed the task",
|
||||
"actual_cost": 150.00,
|
||||
"images": []
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
meta {
|
||||
name: Delete Completion
|
||||
type: http
|
||||
seq: 4
|
||||
}
|
||||
|
||||
delete {
|
||||
url: {{api_url}}/task-completions/:id/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
id: 1
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
meta {
|
||||
name: Get Completion
|
||||
type: http
|
||||
seq: 3
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/task-completions/:id/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
id: 1
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: List Completions
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/task-completions/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
19
bruno-collections/casera-api/Tasks/Archive Task.bru
Normal file
19
bruno-collections/casera-api/Tasks/Archive Task.bru
Normal file
@@ -0,0 +1,19 @@
|
||||
meta {
|
||||
name: Archive Task
|
||||
type: http
|
||||
seq: 10
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/tasks/:id/archive/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
id: 1
|
||||
}
|
||||
19
bruno-collections/casera-api/Tasks/Cancel Task.bru
Normal file
19
bruno-collections/casera-api/Tasks/Cancel Task.bru
Normal file
@@ -0,0 +1,19 @@
|
||||
meta {
|
||||
name: Cancel Task
|
||||
type: http
|
||||
seq: 8
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/tasks/:id/cancel/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
id: 1
|
||||
}
|
||||
27
bruno-collections/casera-api/Tasks/Create Task.bru
Normal file
27
bruno-collections/casera-api/Tasks/Create Task.bru
Normal file
@@ -0,0 +1,27 @@
|
||||
meta {
|
||||
name: Create Task
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/tasks/
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"residence_id": 1,
|
||||
"title": "Clean gutters",
|
||||
"description": "Clear debris from all gutters",
|
||||
"category_id": 1,
|
||||
"priority_id": 2,
|
||||
"frequency_id": 3,
|
||||
"due_date": "2024-12-31"
|
||||
}
|
||||
}
|
||||
19
bruno-collections/casera-api/Tasks/Delete Task.bru
Normal file
19
bruno-collections/casera-api/Tasks/Delete Task.bru
Normal file
@@ -0,0 +1,19 @@
|
||||
meta {
|
||||
name: Delete Task
|
||||
type: http
|
||||
seq: 5
|
||||
}
|
||||
|
||||
delete {
|
||||
url: {{api_url}}/tasks/:id/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
id: 1
|
||||
}
|
||||
19
bruno-collections/casera-api/Tasks/Get Task Completions.bru
Normal file
19
bruno-collections/casera-api/Tasks/Get Task Completions.bru
Normal file
@@ -0,0 +1,19 @@
|
||||
meta {
|
||||
name: Get Task Completions
|
||||
type: http
|
||||
seq: 12
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/tasks/:id/completions/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
id: 1
|
||||
}
|
||||
19
bruno-collections/casera-api/Tasks/Get Task.bru
Normal file
19
bruno-collections/casera-api/Tasks/Get Task.bru
Normal file
@@ -0,0 +1,19 @@
|
||||
meta {
|
||||
name: Get Task
|
||||
type: http
|
||||
seq: 3
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/tasks/:id/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
id: 1
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
meta {
|
||||
name: Get Tasks by Residence
|
||||
type: http
|
||||
seq: 6
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/tasks/by-residence/:residence_id/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
residence_id: 1
|
||||
}
|
||||
15
bruno-collections/casera-api/Tasks/List Tasks.bru
Normal file
15
bruno-collections/casera-api/Tasks/List Tasks.bru
Normal file
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: List Tasks
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/tasks/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
19
bruno-collections/casera-api/Tasks/Mark In Progress.bru
Normal file
19
bruno-collections/casera-api/Tasks/Mark In Progress.bru
Normal file
@@ -0,0 +1,19 @@
|
||||
meta {
|
||||
name: Mark In Progress
|
||||
type: http
|
||||
seq: 7
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/tasks/:id/mark-in-progress/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
id: 1
|
||||
}
|
||||
19
bruno-collections/casera-api/Tasks/Unarchive Task.bru
Normal file
19
bruno-collections/casera-api/Tasks/Unarchive Task.bru
Normal file
@@ -0,0 +1,19 @@
|
||||
meta {
|
||||
name: Unarchive Task
|
||||
type: http
|
||||
seq: 11
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/tasks/:id/unarchive/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
id: 1
|
||||
}
|
||||
19
bruno-collections/casera-api/Tasks/Uncancel Task.bru
Normal file
19
bruno-collections/casera-api/Tasks/Uncancel Task.bru
Normal file
@@ -0,0 +1,19 @@
|
||||
meta {
|
||||
name: Uncancel Task
|
||||
type: http
|
||||
seq: 9
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{api_url}}/tasks/:id/uncancel/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
id: 1
|
||||
}
|
||||
26
bruno-collections/casera-api/Tasks/Update Task.bru
Normal file
26
bruno-collections/casera-api/Tasks/Update Task.bru
Normal file
@@ -0,0 +1,26 @@
|
||||
meta {
|
||||
name: Update Task
|
||||
type: http
|
||||
seq: 4
|
||||
}
|
||||
|
||||
put {
|
||||
url: {{api_url}}/tasks/:id/
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
id: 1
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"title": "Updated task title",
|
||||
"description": "Updated description"
|
||||
}
|
||||
}
|
||||
19
bruno-collections/casera-api/Users/Get User.bru
Normal file
19
bruno-collections/casera-api/Users/Get User.bru
Normal file
@@ -0,0 +1,19 @@
|
||||
meta {
|
||||
name: Get User
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/users/:id/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
|
||||
params:path {
|
||||
id: 1
|
||||
}
|
||||
15
bruno-collections/casera-api/Users/List Profiles.bru
Normal file
15
bruno-collections/casera-api/Users/List Profiles.bru
Normal file
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: List Profiles
|
||||
type: http
|
||||
seq: 3
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/users/profiles/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
15
bruno-collections/casera-api/Users/List Users.bru
Normal file
15
bruno-collections/casera-api/Users/List Users.bru
Normal file
@@ -0,0 +1,15 @@
|
||||
meta {
|
||||
name: List Users
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{api_url}}/users/
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Token {{auth_token}}
|
||||
}
|
||||
9
bruno-collections/casera-api/bruno.json
Normal file
9
bruno-collections/casera-api/bruno.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"version": "1",
|
||||
"name": "Casera API (Go)",
|
||||
"type": "collection",
|
||||
"ignore": [
|
||||
"node_modules",
|
||||
".git"
|
||||
]
|
||||
}
|
||||
5
bruno-collections/casera-api/environments/Dev.bru
Normal file
5
bruno-collections/casera-api/environments/Dev.bru
Normal file
@@ -0,0 +1,5 @@
|
||||
vars {
|
||||
base_url: https://casera.treytartt.com
|
||||
api_url: {{base_url}}/api
|
||||
auth_token: your-auth-token-here
|
||||
}
|
||||
5
bruno-collections/casera-api/environments/Local.bru
Normal file
5
bruno-collections/casera-api/environments/Local.bru
Normal file
@@ -0,0 +1,5 @@
|
||||
vars {
|
||||
base_url: http://localhost:8000
|
||||
api_url: {{base_url}}/api
|
||||
auth_token: your-auth-token-here
|
||||
}
|
||||
@@ -181,6 +181,27 @@ func (h *ContractorHandler) GetContractorTasks(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, response)
|
||||
}
|
||||
|
||||
// ListContractorsByResidence handles GET /api/contractors/by-residence/:residence_id/
|
||||
func (h *ContractorHandler) ListContractorsByResidence(c *gin.Context) {
|
||||
user := c.MustGet(middleware.AuthUserKey).(*models.User)
|
||||
residenceID, err := strconv.ParseUint(c.Param("residence_id"), 10, 32)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": "Invalid residence ID"})
|
||||
return
|
||||
}
|
||||
|
||||
response, err := h.contractorService.ListContractorsByResidence(uint(residenceID), user.ID)
|
||||
if err != nil {
|
||||
if errors.Is(err, services.ErrResidenceAccessDenied) {
|
||||
c.JSON(http.StatusForbidden, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, response)
|
||||
}
|
||||
|
||||
// GetSpecialties handles GET /api/contractors/specialties/
|
||||
func (h *ContractorHandler) GetSpecialties(c *gin.Context) {
|
||||
specialties, err := h.contractorService.GetSpecialties()
|
||||
|
||||
@@ -270,6 +270,7 @@ func setupContractorRoutes(api *gin.RouterGroup, contractorHandler *handlers.Con
|
||||
{
|
||||
contractors.GET("/", contractorHandler.ListContractors)
|
||||
contractors.POST("/", contractorHandler.CreateContractor)
|
||||
contractors.GET("/by-residence/:residence_id/", contractorHandler.ListContractorsByResidence)
|
||||
contractors.GET("/:id/", contractorHandler.GetContractor)
|
||||
contractors.PUT("/:id/", contractorHandler.UpdateContractor)
|
||||
contractors.PATCH("/:id/", contractorHandler.UpdateContractor)
|
||||
|
||||
@@ -294,6 +294,25 @@ func (s *ContractorService) GetContractorTasks(contractorID, userID uint) ([]res
|
||||
return responses.NewTaskListResponse(tasks), nil
|
||||
}
|
||||
|
||||
// ListContractorsByResidence lists all contractors for a specific residence
|
||||
func (s *ContractorService) ListContractorsByResidence(residenceID, userID uint) ([]responses.ContractorResponse, error) {
|
||||
// Check user has access to the residence
|
||||
hasAccess, err := s.residenceRepo.HasAccess(residenceID, userID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !hasAccess {
|
||||
return nil, ErrResidenceAccessDenied
|
||||
}
|
||||
|
||||
contractors, err := s.contractorRepo.FindByResidence(residenceID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return responses.NewContractorListResponse(contractors), nil
|
||||
}
|
||||
|
||||
// GetSpecialties returns all contractor specialties
|
||||
func (s *ContractorService) GetSpecialties() ([]responses.ContractorSpecialtyResponse, error) {
|
||||
specialties, err := s.contractorRepo.GetAllSpecialties()
|
||||
|
||||
Reference in New Issue
Block a user