// Copyright IBM Corp. 2020, 2026
// SPDX-License-Identifier: BUSL-1.1

syntax = "proto3";

// define a test proto package for the internal/db package.  These protos
// are only used for unit tests and are not part of the rest of the boundary
// domain model
package controller.storage.db.db_test.v1;

import "controller/storage/timestamp/v1/timestamp.proto";

option go_package = "github.com/hashicorp/boundary/internal/db/db_test;db_test";

// TestUser for gorm test user model
message StoreTestUser {
  // @inject_tag: gorm:"primary_key"
  uint32 id = 1;

  // create_time from the RDBMS
  // @inject_tag: `gorm:"default:CURRENT_TIMESTAMP"`
  timestamp.v1.Timestamp create_time = 2;

  // update_time from the RDBMS
  // @inject_tag: `gorm:"default:CURRENT_TIMESTAMP"`
  timestamp.v1.Timestamp update_time = 3;

  // public_id is the used to access the user via an API
  string public_id = 4;

  // name is the optional friendly name used to
  // access the user via an API
  // @inject_tag: `gorm:"default:null"`
  string name = 5;

  // @inject_tag: `gorm:"default:null"`
  string phone_number = 6;

  // @inject_tag: `gorm:"default:null"`
  string email = 7;

  // @inject_tag: `gorm:"default:null"`
  uint32 version = 8;
}

// TestCar for gorm test car model
message StoreTestCar {
  // @inject_tag: gorm:"primary_key"
  uint32 id = 1;

  // create_time from the RDBMS
  // @inject_tag: `gorm:"default:CURRENT_TIMESTAMP"`
  timestamp.v1.Timestamp create_time = 2;

  // update_time from the RDBMS
  // @inject_tag: `gorm:"default:CURRENT_TIMESTAMP"`
  timestamp.v1.Timestamp update_time = 3;

  // public_id is the used to access the car via an API
  string public_id = 4;

  // name is the optional friendly name used to
  // access the Scope via an API
  // @inject_tag: `gorm:"default:null"`
  string name = 5;

  // @inject_tag: `gorm:"default:null"`
  string model = 6;

  // @inject_tag: `gorm:"default:null"`
  int32 mpg = 7;
}

// TestRental for gorm test rental model
message StoreTestRental {
  // @inject_tag: gorm:"primary_key"
  uint32 id = 1;

  // create_time from the RDBMS
  // @inject_tag: `gorm:"default:CURRENT_TIMESTAMP"`
  timestamp.v1.Timestamp create_time = 2;

  // update_time from the RDBMS
  // @inject_tag: `gorm:"default:CURRENT_TIMESTAMP"`
  timestamp.v1.Timestamp update_time = 3;

  // public_id is the used to access the rental via an API
  string public_id = 4;

  // name is the optional friendly name used to
  // access the rental via an API
  // @inject_tag: `gorm:"default:null"`
  string name = 5;

  // @inject_tag: `gorm:"default:null"`
  uint32 user_id = 6;

  // @inject_tag: `gorm:"default:null"`
  uint32 car_id = 7;
}

// StoreTestScooter used in the db tests only and provides a gorm resource with
// a private id.
message StoreTestScooter {
  // @inject_tag: gorm:"primary_key"
  uint32 id = 1;

  // create_time from the RDBMS
  // @inject_tag: `gorm:"default:CURRENT_TIMESTAMP"`
  timestamp.v1.Timestamp create_time = 2;

  // update_time from the RDBMS
  // @inject_tag: `gorm:"default:CURRENT_TIMESTAMP"`
  timestamp.v1.Timestamp update_time = 3;

  // private_id is the used to access scooter, but not intended to be available
  // via the API
  string private_id = 4;

  // @inject_tag: `gorm:"default:null"`
  string model = 6;

  // @inject_tag: `gorm:"default:null"`
  int32 mpg = 7;
}

// StoreTestAccessory used in the db tests only and provides a gorm resource with
// an id that's not a private or public id
message StoreTestAccessory {
  // @inject_tag: gorm:"primary_key"
  uint32 accessory_id = 1;

  // @inject_tag: `gorm:"default:not_null"`
  string description = 2;
}

// StoreTestScooterAccessory used in the db tests only and provides a gorm
// resource with multiple pks
message StoreTestScooterAccessory {
  // @inject_tag: gorm:"primary_key"
  uint32 accessory_id = 1;

  // @inject_tag: gorm:"primary_key"
  uint32 scooter_id = 2;

  // @inject_tag: `gorm:"default:null"`
  string review = 3;
}
